@muyichengshayu/promptx 0.1.29 → 0.1.31
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/CHANGELOG.md +10 -0
- package/apps/web/dist/assets/{CodexSessionManagerDialog-BTJT6exI.js → CodexSessionManagerDialog-jzGuqsOt.js} +2 -2
- package/apps/web/dist/assets/{TaskDiffReviewDialog-CFYInZW6.js → TaskDiffReviewDialog-Dzj4GDaj.js} +1 -1
- package/apps/web/dist/assets/{WorkbenchSettingsDialog-mw7tdSL8.js → WorkbenchSettingsDialog-BA9EYzIQ.js} +2 -2
- package/apps/web/dist/assets/WorkbenchView-WoVxKFEW.js +423 -0
- package/apps/web/dist/assets/index-BhMEdZoM.css +1 -0
- package/apps/web/dist/assets/index-DVWGdkCl.js +26 -0
- package/apps/web/dist/index.html +2 -2
- package/package.json +1 -1
- package/apps/web/dist/assets/WorkbenchView-C_25_arF.js +0 -268
- package/apps/web/dist/assets/index-DjZCfigQ.css +0 -1
- package/apps/web/dist/assets/index-DlMwVg8o.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.31
|
|
4
|
+
|
|
5
|
+
- 继续打磨执行过程展示:统一 `Codex / Claude Code / OpenCode` 的终端输出、搜索命中、构建报错与 diff 渲染,补齐移动端横向滚动、代码字体统一和多余元信息收敛,整体阅读更稳定。
|
|
6
|
+
- 修复执行过程中的多处展示问题:去掉“目标”“退出码 0”“完成 reasoning”等低价值噪音,长命令与路径改为更紧凑的 mono 展示,单条搜索结果、编号源码、build error 与混合 prose/code 内容都能更一致地渲染。
|
|
7
|
+
- 加固执行过程展开状态与文本解析:避免 block 重排后展开/收起状态串位;过程文本不再错误吞掉前导缩进;同时补齐相关单测与构建验证。
|
|
8
|
+
|
|
9
|
+
## 0.1.30
|
|
10
|
+
|
|
11
|
+
- 工作台编辑器升级为基于 Tiptap 的图文混排块编辑器,支持图片、文本文件与 PDF 导入;修复输入、焦点、滚动与移动端布局问题,并清理旧编辑器实现。
|
|
12
|
+
|
|
3
13
|
## 0.1.29
|
|
4
14
|
|
|
5
15
|
- 重做执行过程 detail 展示:新增结构化解析与渲染,针对 `Codex / Claude Code / OpenCode` 的过程事件统一支持待办列表、代码块、行号片段、XML-like 输出、编号列表、Markdown 表格/列表等内容,排版更稳定、更接近原生 CLI。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as he,a as p,c as se,d as le,g as t,t as o,u as a,b as S,A as lt,B as it,n as P,e as v,F as xe,m as _e,i as j,v as ot,f as rt,x as $,l as ye,k as _,G as Ke,o as dt,D as ct,E as ut,
|
|
1
|
+
import{w as he,a as p,c as se,d as le,g as t,t as o,u as a,b as S,A as lt,B as it,n as P,e as v,F as xe,m as _e,i as j,v as ot,f as rt,x as $,l as ye,k as _,G as Ke,o as dt,D as ct,E as ut,a1 as pt,y as gt}from"./index-DVWGdkCl.js";import{c as Re,A as mt,n as Pe,o as Me,r as vt,S as Ue,f as fe,L as Ie,p as ft,d as Qe,h as Je,s as ht,q as He,_ as xt,P as yt,I as bt,b as wt,t as qe,v as St,e as Ve,T as kt,w as $t}from"./WorkbenchView-WoVxKFEW.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{w as he,a as p,c as se,d as le,g as t,t as o,u as a,b as S,A as lt,B as i
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Ct=Re("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function jt(i=[]){return(Array.isArray(i)&&i.length?i:mt).filter(u=>u&&typeof u=="object").map(u=>{const k=Pe(u.value);return{...u,value:k,label:String(u.label||Me(k)).trim()||Me(k),enabled:u.enabled!==!1,available:u.available!==!1}})}function Te(i=[]){return jt(i).filter(T=>T.enabled&&T.available)}async function It(){const i=await vt("/api/meta",{cache:"no-store"});return Te(i==null?void 0:i.agentEngineOptions)}const Pt={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Tt={class:"theme-muted-text mt-1 text-xs leading-5"},Rt={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Dt={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},Lt={class:"flex items-start gap-2 text-xs leading-5"},Et={class:"theme-muted-text shrink-0"},Ft={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},Bt={class:"theme-muted-text mt-4 block text-xs"},At={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},Nt=["placeholder"],zt={class:"mt-4 flex items-center gap-1.5"},Ot={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},Ut={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},Ht={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},qt={key:2,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Vt={key:3,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Wt={key:4,class:"theme-empty-state px-3 py-8 text-sm"},Gt={key:5,class:"theme-empty-state px-3 py-8 text-sm"},Kt={key:6,class:"theme-empty-state px-3 py-8 text-sm"},Qt={key:7,class:"space-y-1"},Xt=["onClick"],Jt={class:"min-w-0 flex-1"},Yt=["innerHTML"],Zt=["innerHTML"],en={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},tn={key:8,class:"space-y-1"},nn={class:"flex items-start gap-1.5"},an=["onClick"],sn=["onClick"],ln={class:"min-w-0 flex-1"},on={key:0,class:"theme-muted-text truncate font-mono text-[10px]"},rn={class:"theme-divider flex flex-col-reverse gap-2 border-t border-dashed px-4 py-4 sm:flex-row sm:items-center sm:justify-end sm:px-5"},dn={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},cn=["disabled"],un=["disabled"],pn={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye(),c=$(""),h=$(null),C=$(!1),r=$(""),d=$(!1),w=$(""),E=$([]),F=$(!1),R=$(""),M=$("tree"),L=$(""),G=$("");let B=null,A=0;const K=_(()=>de(h.value?[h.value]:[])),z=_(()=>M.value==="search"&&!R.value.trim()),ie=_(()=>M.value==="search"&&!!R.value.trim()&&!d.value&&!w.value&&!E.value.length),q=_(()=>M.value==="tree"&&!C.value&&!r.value&&!K.value.length);function ne(n=""){const g=String(n||"").trim();return/^[a-z]:[\\/]/i.test(g)||g.includes("\\")}function b(n=""){const g=String(n||"").trim();if(!g)return"";const l=ne(g);let m=g.replace(/\\/g,"/");return m.length>1&&!/^[a-z]:\/?$/i.test(m)&&m!=="/"&&(m=m.replace(/\/+$/,"")),l?m.toLowerCase():m}function Z(n="",g=""){const l=b(n),m=b(g);return!l||!m?!1:l===m||l.startsWith(`${m}/`)}function Ce(n="",g=""){const l=String(n||"").trim(),m=String(g||"").trim();return l?m?ne(l)?/^[a-z]:\\?$/i.test(l)?`${l.replace(/[\\/]+$/,"")}\\${m}`:`${l.replace(/[\\/]+$/,"")}\\${m}`:l==="/"?`/${m}`:`${l.replace(/\/+$/,"")}/${m}`:l:m}function ae(n="",g=""){const l=b(n),m=b(g);if(!l||!m||!Z(m,l))return[];const D=m===l?"":m.slice(l.length).replace(/^\//,"");return D?D.split("/").filter(Boolean):[]}function Q(n){return(n==null?void 0:n.name)||(n==null?void 0:n.path)||f("directoryPicker.unnamedDirectory")}function oe(n=""){const g=String(n||"").trim();return g?g.split(/[\\/]/).filter(Boolean).at(-1)||g:"Home"}function V(n=""){return String(n||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(n="",g=""){const l=String(n||""),m=String(g||"").trim().toLowerCase();if(!l||!m)return null;const D=l.toLowerCase(),U=D.indexOf(m);if(U>=0)return{start:U,end:U+m.length};const $e=m.split(/[\\/\s_.-]+/).filter(Boolean).sort((W,Y)=>Y.length-W.length);for(const W of $e){if(W.length<2)continue;const Y=D.indexOf(W);if(Y>=0)return{start:Y,end:Y+W.length}}return null}function be(n="",g=""){const l=String(n||""),m=I(l,g);return m?`${V(l.slice(0,m.start))}<mark class="theme-search-highlight">${V(l.slice(m.start,m.end))}</mark>${V(l.slice(m.end))}`:V(l)}function re(n){return be(Q(n),R.value)}function we(n){return be((n==null?void 0:n.path)||"",R.value)}function ee(n,g=0){return{...n,depth:g,expanded:!1,loaded:!1,loading:!1,children:[]}}function de(n=[],g=[]){return n.forEach(l=>{g.push(l),l.expanded&&l.children.length&&de(l.children,g)}),g}function X(){h.value&&(h.value={...h.value})}function ce(n,g=h.value?[h.value]:[]){const l=b(n);if(!l)return null;for(const m of g){if(b(m.path)===l)return m;if(m.children.length){const D=ce(n,m.children);if(D)return D}}return null}function J(n){L.value=String((n==null?void 0:n.path)||"").trim(),G.value=Q(n)}async function ue(n,g={}){if(!(!n||n.loading)&&!(n.loaded&&!g.force)){n.loading=!0,r.value="",X();try{const l=await He({path:n.path,limit:240});n.children=(l.items||[]).map(m=>ee(m,n.depth+1)),n.loaded=!0}catch(l){r.value=l.message||f("directoryPicker.loadFailed")}finally{n.loading=!1,X()}}}async function je(){C.value=!0,r.value="";try{const n=await He({limit:240});c.value=String(n.path||""),h.value=ee({name:oe(n.path||""),path:String(n.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),h.value.children=(n.items||[]).map(g=>ee(g,1)),h.value.loaded=!0,h.value.expanded=!0,J(h.value)}catch(n){r.value=n.message||f("directoryPicker.treeLoadFailed"),h.value=null,c.value=""}finally{C.value=!1}}async function pe(n=""){const g=String(n||"").trim();if(!g||!c.value||!Z(g,c.value))return;let l=h.value;if(!l)return;J(l);const m=ae(c.value,g);for(const D of m){await ue(l),l.expanded=!0,X();const U=ce(Ce(l.path,D),l.children);if(!U)break;l=U,J(l)}}async function Se(){R.value="",M.value="tree",E.value=[],w.value="",F.value=!1,L.value="",G.value="",await je();const n=String(u.initialPath||"").trim();n&&Z(n,c.value)&&await pe(n)}async function O(n){if(n!=null&&n.path&&(J(n),!!n.hasChildren)){if(!n.loaded){n.expanded=!0,X(),await ue(n);return}n.expanded=!n.expanded,X()}}function te(n){n!=null&&n.path&&(J(n),M.value="tree")}async function ke(){const n=String(R.value||"").trim();A+=1;const g=A;if(!u.open||!n||!c.value){d.value=!1,w.value="",E.value=[],F.value=!1;return}d.value=!0,w.value="";try{const l=await ht(n,{path:c.value,limit:80});if(g!==A)return;E.value=Array.isArray(l.items)?l.items:[],F.value=!!l.truncated}catch(l){if(g!==A)return;w.value=l.message||f("directoryPicker.searchFailed"),E.value=[],F.value=!1}finally{g===A&&(d.value=!1)}}function ge(){if(B&&(window.clearTimeout(B),B=null),!String(R.value||"").trim()){d.value=!1,w.value="",E.value=[],F.value=!1;return}d.value=!0,w.value="",B=window.setTimeout(()=>{ke()},120)}async function me(n){n!=null&&n.path&&(M.value="tree",await pe(n.path))}function ve(){L.value&&(k("select",L.value),k("close"))}return he(R,()=>{M.value=R.value.trim()?"search":"tree",ge()}),he(()=>u.open,n=>{if(n){Se().catch(()=>{});return}B&&(window.clearTimeout(B),B=null)}),(n,g)=>(p(),se(Xe,{open:i.open,"backdrop-class":"z-[60] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"settings-dialog-panel h-full max-w-4xl sm:h-auto sm:max-h-[86vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:px-5","close-disabled":C.value||d.value,"close-on-backdrop":!(C.value||d.value),"close-on-escape":!(C.value||d.value),onClose:g[4]||(g[4]=l=>k("close"))},{title:le(()=>[t("div",null,[t("div",Pt,[S(a(fe),{class:"h-4 w-4"}),t("span",null,o(a(f)("directoryPicker.title")),1)]),t("p",Tt,o(a(f)("directoryPicker.intro")),1)])]),default:le(()=>[t("div",Rt,[t("div",Dt,[t("div",Lt,[t("span",Et,o(a(f)("directoryPicker.currentSelection")),1),t("span",Ft,o(L.value||a(f)("directoryPicker.selectionPlaceholder")),1)])]),t("label",Bt,[t("span",null,o(a(f)("directoryPicker.searchLabel")),1),t("div",At,[S(a(Ue),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),lt(t("input",{"onUpdate:modelValue":g[0]||(g[0]=l=>R.value=l),type:"text",placeholder:a(f)("directoryPicker.searchPlaceholder"),class:"min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]"},null,8,Nt),[[it,R.value]])])]),t("div",zt,[t("button",{type:"button",class:P(["inline-flex h-8 items-center gap-1 rounded-sm border px-2 text-[11px] transition",M.value==="search"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:g[1]||(g[1]=l=>M.value="search")},[S(a(Ue),{class:"h-3.5 w-3.5"}),t("span",null,o(a(f)("directoryPicker.searchTab")),1)],2),t("button",{type:"button",class:P(["inline-flex h-8 items-center gap-1 rounded-sm border px-2 text-[11px] transition",M.value==="tree"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:g[2]||(g[2]=l=>M.value="tree")},[S(a(fe),{class:"h-3.5 w-3.5"}),t("span",null,o(a(f)("directoryPicker.treeTab")),1)],2)]),t("div",Ot,[M.value==="search"&&w.value?(p(),v("div",Ut,o(w.value),1)):M.value==="tree"&&r.value?(p(),v("div",Ht,o(r.value),1)):M.value==="search"&&d.value?(p(),v("div",qt,[S(a(Ie),{class:"h-4 w-4 animate-spin"}),t("span",null,o(a(f)("directoryPicker.searching")),1)])):M.value==="tree"&&C.value?(p(),v("div",Vt,[S(a(Ie),{class:"h-4 w-4 animate-spin"}),t("span",null,o(a(f)("directoryPicker.treeLoading")),1)])):z.value?(p(),v("div",Wt,o(a(f)("directoryPicker.searchPrompt")),1)):ie.value?(p(),v("div",Gt,o(a(f)("directoryPicker.noSearchResults")),1)):q.value?(p(),v("div",Kt,o(a(f)("directoryPicker.emptyTree")),1)):M.value==="search"?(p(),v("div",Qt,[(p(!0),v(xe,null,_e(E.value,l=>(p(),v("button",{key:l.path,type:"button",class:P(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",b(L.value)===b(l.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:m=>me(l)},[S(a(fe),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"}),t("div",Jt,[t("div",null,[t("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:re(l)},null,8,Yt)]),t("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:we(l)},null,8,Zt)])],10,Xt))),128)),F.value?(p(),v("p",en,o(a(f)("directoryPicker.truncatedHint")),1)):j("",!0)])):(p(),v("div",tn,[(p(!0),v(xe,null,_e(K.value,l=>(p(),v("div",{key:l.path,class:P(["rounded-sm border border-transparent px-1.5 py-1 transition",b(L.value)===b(l.path)?"theme-list-item-active":l.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:ot({paddingLeft:`${l.depth*16+6}px`})},[t("div",nn,[t("button",{type:"button",class:P(["theme-icon-button h-5 w-5 shrink-0",l.hasChildren?"":"invisible pointer-events-none"]),onClick:rt(m=>O(l),["stop"])},[l.loading?(p(),se(a(Ie),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(p(),se(a(ft),{key:1,class:P(["h-3.5 w-3.5 transition",l.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,an),t("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:m=>te(l)},[S(a(fe),{class:P(["h-4 w-4 shrink-0",b(L.value)===b(l.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),t("div",ln,[t("div",{class:P(["truncate text-[13px]",l.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},o(Q(l)),3),l.isHomeRoot?(p(),v("div",on,o(l.path),1)):j("",!0)])],8,sn)])],6))),128))]))])]),t("div",rn,[t("div",dn,[t("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:C.value||d.value,onClick:g[3]||(g[3]=l=>k("close"))},o(a(f)("directoryPicker.cancel")),9,cn),t("button",{type:"button",class:"tool-button tool-button-primary inline-flex w-full items-center justify-center gap-2 px-3 py-2 text-xs sm:w-auto",disabled:C.value||d.value||!L.value,onClick:ve},[S(a(Qe),{class:"h-4 w-4"}),t("span",null,o(a(f)("directoryPicker.useCurrentDirectory")),1)],8,un)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},gn={class:"grid gap-4"},mn={class:"theme-muted-text block text-xs"},vn=["value","disabled"],fn={class:"theme-muted-text block text-xs"},hn={class:"mt-1 flex gap-2"},xn=["value","disabled"],yn=["disabled"],bn={id:"codex-manager-workspace-suggestions"},wn=["value"],Sn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},kn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},$n={class:"theme-muted-text block text-xs"},_n={class:"mt-1"},Mn={class:"flex items-center gap-2 text-sm"},Cn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},jn=["disabled","onClick"],In={class:"flex items-center justify-between gap-3"},Pn={class:"min-w-0 flex-1 truncate"},Tn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Rn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},Dn={class:"theme-muted-text block text-xs"},Ln={class:"mt-1 flex gap-2"},En=["value","disabled"],Fn=["disabled"],Bn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},An={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},We={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},canEditEngine:{type:Boolean,default:!0},canEditCwd:{type:Boolean,default:!0},canEditSessionId:{type:Boolean,default:!0},cwd:{type:String,default:""},cwdReadonlyMessage:{type:String,default:""},duplicateCwdMessage:{type:String,default:""},engine:{type:String,default:"codex"},engineOptions:{type:Array,default:()=>[]},engineReadonlyMessage:{type:String,default:""},mobile:{type:Boolean,default:!1},sessionId:{type:String,default:""},sessionIdCopied:{type:Boolean,default:!1},sessionIdReadonlyMessage:{type:String,default:""},title:{type:String,default:""},workspaceSuggestions:{type:Array,default:()=>[]}},emits:["copy-session-id","open-directory-picker","update:cwd","update:engine","update:sessionId","update:title"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye(),c=_(()=>{const C=String(u.engine||"").trim();return u.engineOptions.find(r=>String((r==null?void 0:r.value)||"").trim()===C)||null}),h=_(()=>String(u.sessionId||"").trim());return(C,r)=>(p(),v("div",gn,[t("label",mn,[t("span",null,o(a(f)("projectManager.projectTitleOptional")),1),t("input",{value:i.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:i.busy,onInput:r[0]||(r[0]=d=>k("update:title",d.target.value))},null,40,vn)]),t("label",fn,[t("span",null,o(a(f)("projectManager.workingDirectoryField")),1),t("div",hn,[t("input",{value:i.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:P(["tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",i.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:i.busy||!i.canEditCwd,onInput:r[1]||(r[1]=d=>k("update:cwd",d.target.value))},null,42,xn),t("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:i.busy||!i.canEditCwd,onClick:r[2]||(r[2]=d=>k("open-directory-picker"))},[S(a(fe),{class:"h-4 w-4"}),t("span",null,o(i.mobile?a(f)("projectManager.choose"):a(f)("projectManager.chooseDirectory")),1)],8,yn)]),t("datalist",bn,[(p(!0),v(xe,null,_e(i.workspaceSuggestions,d=>(p(),v("option",{key:d,value:d},null,8,wn))),128))]),i.duplicateCwdMessage?(p(),v("p",Sn,o(i.duplicateCwdMessage),1)):i.cwdReadonlyMessage?(p(),v("p",kn,o(i.cwdReadonlyMessage),1)):j("",!0)]),t("label",$n,[t("span",null,o(a(f)("projectManager.engineField")),1),t("div",_n,[S(xt,{"model-value":i.engine,options:i.engineOptions,disabled:i.busy||!i.canEditEngine,placeholder:a(f)("projectManager.selectEngine"),"empty-text":a(f)("projectManager.noEngines"),"get-option-value":d=>(d==null?void 0:d.value)||"","onUpdate:modelValue":r[3]||(r[3]=d=>k("update:engine",d))},{trigger:le(({disabled:d})=>{var w;return[t("div",Mn,[t("span",{class:P(["min-w-0 flex-1 truncate",d?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},o(((w=c.value)==null?void 0:w.label)||a(f)("projectManager.selectEngine")),3),c.value&&c.value.enabled===!1?(p(),v("span",Cn,o(a(f)("projectManager.comingSoon")),1)):j("",!0)])]}),option:le(({option:d,selected:w,select:E})=>[t("button",{type:"button",class:P(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",w?"theme-filter-active":"theme-filter-idle"]),disabled:(d==null?void 0:d.enabled)===!1,onClick:E},[t("div",In,[t("span",Pn,o(d.label),1),(d==null?void 0:d.enabled)===!1?(p(),v("span",Tn,o(a(f)("projectManager.comingSoon")),1)):j("",!0)])],10,jn)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),i.engineReadonlyMessage?(p(),v("p",Rn,o(i.engineReadonlyMessage),1)):j("",!0)]),t("label",Dn,[t("span",null,o(a(f)("projectManager.sessionId")),1),t("div",Ln,[t("input",{value:i.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",disabled:i.busy||!i.canEditSessionId,onInput:r[4]||(r[4]=d=>k("update:sessionId",d.target.value))},null,40,En),h.value?(p(),v("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:i.busy,onClick:r[5]||(r[5]=d=>k("copy-session-id"))},[i.sessionIdCopied?(p(),se(a(Qe),{key:0,class:"h-4 w-4"})):(p(),se(a(Mt),{key:1,class:"h-4 w-4"})),t("span",null,o(i.sessionIdCopied?a(f)("projectManager.sessionIdCopied"):a(f)("projectManager.copySessionId")),1)],8,Fn)):j("",!0)]),i.sessionIdReadonlyMessage?(p(),v("p",Bn,o(i.sessionIdReadonlyMessage),1)):(p(),v("p",An,o(a(f)("projectManager.sessionIdHint")),1))])]))}},Nn={class:"flex items-center justify-between gap-3"},zn={class:"theme-heading text-sm font-medium"},On={key:0,class:"theme-muted-text mt-1 text-xs"},Un=["disabled"],Hn=["onClick"],qn={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Vn={class:"flex w-full flex-col gap-2 text-left"},Wn={class:"theme-heading min-w-0 text-sm font-medium"},Gn=["title"],Kn=["title"],Qn={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},Xn={key:0,"aria-hidden":"true"},Jn={key:1},Yn={class:"flex flex-wrap items-center gap-2 pt-1"},Zn={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Ge={__name:"CodexSessionManagerList",props:{busy:{type:Boolean,default:!1},editingSessionId:{type:String,default:""},formatUpdatedAt:{type:Function,default:i=>i},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},hasSessions:{type:Boolean,default:!1},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1},mode:{type:String,default:"edit"},mobile:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]}},emits:["create","select"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye();function c(r){return u.mode==="edit"&&u.editingSessionId===r.id?"theme-card-selected":u.isSessionRunning(r.id)?"theme-card-warning":"theme-card-idle-strong"}function h(r){return u.isCurrentSession(r.id)?f("projectManager.current"):f("projectManager.regular")}function C(r){return u.isCurrentSession(r.id)?"theme-status-info":"theme-status-neutral"}return(r,d)=>(p(),v("div",{class:P(i.mobile?"flex h-full min-h-0 flex-col":"")},[t("div",Nn,[t("div",null,[t("div",zn,o(a(f)("projectManager.projectList")),1),i.hasSessions?j("",!0):(p(),v("p",On,o(a(f)("projectManager.noProjects")),1))]),t("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:i.busy,onClick:d[0]||(d[0]=w=>k("create"))},[S(a(yt),{class:"h-4 w-4"}),t("span",null,o(a(f)("projectManager.create")),1)],8,Un)]),t("div",{class:P(["mt-4 space-y-2",i.mobile?"min-h-0 flex-1 overflow-y-auto":"max-h-52 overflow-y-auto pr-1 sm:max-h-64 lg:max-h-[calc(88vh-11rem)]"])},[(p(!0),v(xe,null,_e(i.sessions,w=>(p(),v("article",{key:w.id,class:P(["relative cursor-pointer rounded-sm border p-3 transition",c(w)]),onClick:E=>k("select",w.id)},[i.mode==="edit"&&i.editingSessionId===w.id?(p(),v("span",qn)):j("",!0),t("div",Vn,[t("div",Wn,[t("span",{class:"block truncate",title:w.title||a(f)("projectManager.untitledProject")},o(w.title||a(f)("projectManager.untitledProject")),9,Gn)]),t("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:w.cwd},o(w.cwd),9,Kn),t("div",Qn,[t("span",null,o(a(Me)(w.engine)),1),i.mobile?j("",!0):(p(),v("span",Xn,"·")),i.mobile?j("",!0):(p(),v("span",Jn,o(i.formatUpdatedAt(w.updatedAt)),1))]),t("div",Yn,[t("span",{class:P(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",C(w)])},o(h(w)),3),t("span",{class:P(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",i.getRuntimeStatusClass(w.id)])},[i.isSessionRunning(w.id)?(p(),v("span",Zn)):j("",!0),Ke(" "+o(i.getRuntimeStatusLabel(w.id)),1)],2),t("span",{class:P(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",i.getThreadStatusClass(w)])},o(i.getThreadStatusLabel(w)),3)])])],10,Hn))),128))],2)],2))}},ea={class:"space-y-3"},ta={class:"dashed-panel px-3 py-3"},na={class:"theme-muted-text text-[11px]"},aa={class:"mt-2 flex flex-wrap gap-2"},sa={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},la={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},ia={class:"dashed-panel px-3 py-3"},oa={class:"theme-muted-text text-[11px]"},ra={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},da={class:"dashed-panel px-3 py-3"},ca={class:"theme-muted-text text-[11px]"},ua={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},pa={class:"dashed-panel px-3 py-3"},ga={class:"theme-muted-text text-[11px]"},ma={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},va={class:"dashed-panel px-3 py-3"},fa={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},ha={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},xa={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:i=>i},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1}},setup(i){const{t:T}=ye();return(u,k)=>{var f,c,h,C,r,d,w;return p(),v("div",ea,[t("div",ta,[t("div",na,o(a(T)("projectManager.runtimeStatus")),1),t("div",aa,[t("span",{class:P(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",i.getRuntimeStatusClass((f=i.activeSession)==null?void 0:f.id)])},[i.isSessionRunning((c=i.activeSession)==null?void 0:c.id)?(p(),v("span",sa)):j("",!0),Ke(" "+o(i.getRuntimeStatusLabel((h=i.activeSession)==null?void 0:h.id)),1)],2),t("span",{class:P(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",i.getThreadStatusClass(i.activeSession)])},o(i.getThreadStatusLabel(i.activeSession)),3),(C=i.activeSession)!=null&&C.id&&i.isCurrentSession(i.activeSession.id)?(p(),v("span",la,o(a(T)("projectManager.currentProject")),1)):j("",!0)])]),t("div",ia,[t("div",oa,o(a(T)("projectManager.engine")),1),t("div",ra,o(a(Me)((r=i.activeSession)==null?void 0:r.engine)),1)]),t("div",da,[t("div",ca,o(a(T)("projectManager.workingDirectory")),1),t("div",ua,o(((d=i.activeSession)==null?void 0:d.cwd)||a(T)("projectManager.notSet")),1)]),t("div",pa,[t("div",ga,o(a(T)("projectManager.updatedAt")),1),t("div",ma,o(i.formatUpdatedAt((w=i.activeSession)==null?void 0:w.updatedAt)),1)]),t("div",va,[t("div",fa,[S(a(bt),{class:"h-3.5 w-3.5"}),t("span",null,o(a(T)("projectManager.note")),1)]),t("p",ha,o(a(T)("projectManager.noteDescription")),1)])])}}},ya={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ba={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},wa={class:"theme-divider theme-muted-panel border-b px-3 py-3 sm:px-4 sm:py-4 lg:border-b-0 lg:border-r"},Sa={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},ka={class:"flex flex-wrap items-start justify-between gap-3"},$a={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},_a={class:"mt-5"},Ma={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ca={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4 sm:flex-row sm:items-center sm:justify-between"},ja={class:"flex flex-wrap items-center gap-2"},Ia=["disabled"],Pa=["disabled"],Ta={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},Ra=["disabled"],Da=["disabled"],La=["disabled"],Ea={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Fa={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ba={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},Aa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Na={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},za=["disabled"],Oa={class:"min-w-0 flex-1"},Ua={class:"theme-heading truncate text-sm font-medium"},Ha={key:0,class:"theme-muted-text mt-1 truncate text-xs"},qa={class:"theme-divider border-b px-4 py-3"},Va={class:"grid grid-cols-2 gap-2"},Wa=["disabled"],Ga={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Ka={key:0},Qa={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Xa={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Ja=["disabled"],Ya=["disabled"],Za=["disabled"],ns={__name:"CodexSessionManagerDialog",props:{open:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]},workspaces:{type:Array,default:()=>[]},selectedSessionId:{type:String,default:""},selectionLocked:{type:Boolean,default:!1},selectionLockReason:{type:String,default:""},loading:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},onRefresh:{type:Function,default:null},onCreate:{type:Function,default:null},onUpdate:{type:Function,default:null},onDelete:{type:Function,default:null},onReset:{type:Function,default:null}},emits:["close","project-created","select-session"],setup(i,{emit:T}){const u=i,k=T,{locale:f,t:c}=ye(),h=$("edit"),C=$(""),r=ct({title:"",engine:"codex",cwd:"",sessionId:""}),d=$(""),w=$(!1),E=$(!1),F=$(!1),R=$(!1),M=$(!1),L=$(!1),G=$(!1),B=$(!1),{matches:A}=wt("(max-width: 767px)"),K=$("list"),z=$("basic"),ie=$(Te());let q=null;const ne=_(()=>ke(u.sessions)),b=_(()=>u.sessions.find(e=>e.id===C.value)||null),Z=_(()=>u.sessions.length>0),Ce=_(()=>u.sessions.find(e=>e.id===u.selectedSessionId)||null),ae=_(()=>!!(b.value&&O(b.value.id))),Q=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),oe=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),V=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),I=_(()=>u.loading||w.value||E.value||F.value||R.value),be=_(()=>String(r.sessionId||"").trim()),re=_(()=>{var x,y;const e=new Set,s=[];return[r.cwd,(x=b.value)==null?void 0:x.cwd,(y=Ce.value)==null?void 0:y.cwd,...u.workspaces,...u.sessions.map(H=>H.cwd)].forEach(H=>{const N=String(H||"").trim();!N||e.has(N)||(e.add(N),s.push(N))}),s.slice(0,12)}),we=_(()=>ie.value),ee=_(()=>{const e=Se(r.cwd);return e?u.sessions.filter(s=>{var x;return s.id===((x=b.value)==null?void 0:x.id)?!1:Se(s.cwd)===e}):[]}),de=_(()=>{if(!ee.value.length)return"";const e=ee.value.slice(0,3).map(s=>{const x=s.title||c("projectManager.untitledProject");return f.value==="en-US"?`"${x}"`:`「${x}」`}).join(f.value==="en-US"?", ":"、");return c("projectManager.duplicateDirectory",{labels:e,count:ee.value.length})}),X=_(()=>h.value!=="edit"||Q.value?"":c("projectManager.cwdReadonly")),ce=_(()=>h.value!=="edit"||!b.value||oe.value?"":c("projectManager.engineReadonly")),J=_(()=>h.value!=="edit"||!b.value||V.value?"":c("projectManager.sessionIdReadonly")),ue=_(()=>h.value==="create"?w.value?c("projectManager.creatingProject"):c("projectManager.createProject"):E.value?c("projectManager.savingChanges"):c("projectManager.saveChanges")),je=_(()=>{var e;return h.value==="create"?c("projectManager.newProject"):((e=b.value)==null?void 0:e.title)||c("projectManager.untitledProject")});function pe(e=""){const s=Date.parse(String(e||""));return Number.isFinite(s)?s:0}function Se(e=""){const s=String(e||"").trim();if(!s)return"";const x=/^[a-z]:[\\/]/i.test(s)||s.includes("\\");let y=s.replace(/\\/g,"/");return y.length>1&&!/^[a-z]:\/$/i.test(y)&&(y=y.replace(/\/+$/,"")),x?y.toLowerCase():y}function O(e){var s;return!!((s=u.sessions.find(x=>x.id===e))!=null&&s.running)}function te(e){return!!e&&e===u.selectedSessionId}function ke(e=[]){return[...e].sort((s,x)=>{const y=Number(O(x.id))-Number(O(s.id));if(y)return y;const H=Number(te(x.id))-Number(te(s.id));if(H)return H;const N=pe(x.updatedAt)-pe(s.updatedAt);return N||pt(String(s.title||s.cwd||s.id),String(x.title||x.cwd||x.id))})}function ge(e){return O(e)?c("projectManager.running"):c("projectManager.idle")}function me(e){return O(e)?"theme-status-warning":"theme-status-success"}function ve(e){return e!=null&&e.started?c("projectManager.threadBound"):c("projectManager.notStarted")}function n(e){return e!=null&&e.started?"theme-status-success":"theme-status-neutral"}function g(e=""){if(!e)return c("projectManager.unknown");const s=new Date(e);return Number.isNaN(s.getTime())?e:ut(s.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function l(e){r.title=String((e==null?void 0:e.title)||""),r.engine=Pe(e==null?void 0:e.engine),r.cwd=String((e==null?void 0:e.cwd)||""),r.sessionId=String((e==null?void 0:e.sessionId)||(e==null?void 0:e.engineSessionId)||(e==null?void 0:e.engineThreadId)||(e==null?void 0:e.codexThreadId)||"").trim()}function m(){h.value="create",C.value="",d.value="",r.title="",r.engine="codex",r.cwd="",r.sessionId=""}function D(e){const s=u.sessions.find(x=>x.id===e);s&&(h.value="edit",C.value=s.id,d.value="",l(s))}function U(){var e;return u.selectedSessionId&&u.sessions.some(s=>s.id===u.selectedSessionId)?u.selectedSessionId:((e=ne.value[0])==null?void 0:e.id)||""}function $e(e="basic"){K.value="detail",z.value=e}function W(){K.value="list",z.value="basic"}function Y(){m(),A.value&&$e("basic")}function De(e){I.value||(D(e),A.value&&$e("basic"))}function Je(e){r.cwd=String(e||"").trim()}function Le(e){r.title=String(e||"")}function Ee(e){r.engine=Pe(e)}function Fe(e){r.cwd=String(e||"")}function Be(e){r.sessionId=String(e||"")}function Ae(){d.value="",M.value=!1,L.value=!1,B.value=!1,z.value="basic",K.value=A.value?"list":"detail";const e=U();if(e){D(e);return}m()}async function Ye(){if(!(I.value||typeof u.onRefresh!="function")){d.value="";try{await Promise.all([u.onRefresh(),Ne()])}catch(e){d.value=e.message}}}async function Ne(){try{ie.value=await It()}catch{ie.value=Te()}}async function Ze(e){var x;if((x=navigator.clipboard)!=null&&x.writeText&&window.isSecureContext){await navigator.clipboard.writeText(e);return}const s=document.createElement("textarea");s.value=e,s.setAttribute("readonly","true"),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}async function ze(){const e=be.value;if(e)try{await Ze(e),B.value=!0,q&&clearTimeout(q),q=setTimeout(()=>{B.value=!1,q=null},1800)}catch(s){d.value=(s==null?void 0:s.message)||c("projectManager.copySessionIdFailed")}}async function Oe(){if(!I.value){d.value="";try{const e=et();if(!e)return;await tt(e)}catch(e){d.value=e.message}}}function et(){if(h.value==="create"){const s=String(r.cwd||"").trim();return s?{type:"create",cwd:s,payload:{title:r.title,engine:r.engine,cwd:s,sessionId:String(r.sessionId||"").trim()}}:(d.value=c("projectManager.directoryRequired"),null)}if(!b.value)return d.value=c("projectManager.projectMissing"),null;const e={title:r.title,engine:r.engine};return Q.value&&(e.cwd=r.cwd),V.value&&(e.sessionId=String(r.sessionId||"").trim()),{type:"update",sessionId:b.value.id,payload:e}}async function tt(e){var s,x;if(e.type==="create"){w.value=!0;try{const y=await((s=u.onCreate)==null?void 0:s.call(u,e.payload));y!=null&&y.id&&(D(y.id),k("select-session",y.id),await gt(),k("project-created",y),k("close"));return}finally{w.value=!1}}E.value=!0;try{const y=await((x=u.onUpdate)==null?void 0:x.call(u,e.sessionId,e.payload));y!=null&&y.id&&D(y.id)}finally{E.value=!1}}async function nt(){var s,x;if(!b.value||F.value)return;const e=b.value.id;d.value="",F.value=!0;try{const y=await((s=u.onDelete)==null?void 0:s.call(u,e));M.value=!1;const H=u.sessions.filter(st=>st.id!==e),N=(y==null?void 0:y.selectedSessionId)||((x=ke(H)[0])==null?void 0:x.id)||"";k("select-session",N),N?(D(N),A.value&&W()):(m(),A.value&&W())}catch(y){d.value=y.message}finally{F.value=!1}}async function at(){var s;if(!b.value||R.value)return;const e=b.value.id;d.value="",R.value=!0;try{const x=await((s=u.onReset)==null?void 0:s.call(u,e));L.value=!1;const y=(x==null?void 0:x.session)||u.sessions.find(H=>H.id===e)||null;y!=null&&y.id&&D(y.id)}catch(x){d.value=x.message}finally{R.value=!1}}return he(()=>u.open,e=>{if(e){Ae(),typeof u.onRefresh=="function"?Ye().catch(()=>{}):Ne().catch(()=>{});return}G.value=!1,M.value=!1,L.value=!1,B.value=!1,d.value=""},{immediate:!0}),he(A,e=>{e||(K.value="detail")},{immediate:!0}),he(()=>u.sessions,()=>{if(!u.open)return;if(h.value==="create"){if(!!(String(r.title||"").trim()||String(r.cwd||"").trim())||!!String(r.sessionId||"").trim())return;const x=U();x&&D(x);return}if(b.value){l(b.value);return}const e=U();if(e){D(e);return}m()}),dt(()=>{q&&(clearTimeout(q),q=null)}),(e,s)=>(p(),v(xe,null,[S(qe,{open:L.value,title:a(c)("projectManager.confirmResetTitle"),description:b.value?a(c)("projectManager.confirmResetDescription",{title:b.value.title||a(c)("projectManager.untitledProject")}):"","confirm-text":a(c)("projectManager.confirmReset"),"cancel-text":a(c)("projectManager.keep"),loading:R.value,onCancel:s[0]||(s[0]=x=>L.value=!1),onConfirm:at},null,8,["open","title","description","confirm-text","cancel-text","loading"]),S(qe,{open:M.value,title:a(c)("projectManager.confirmDeleteTitle"),description:b.value?a(c)("projectManager.confirmDeleteDescription",{title:b.value.title||a(c)("projectManager.untitledProject")}):"","confirm-text":a(c)("projectManager.confirmDelete"),"cancel-text":a(c)("projectManager.keep"),loading:F.value,danger:"",onCancel:s[1]||(s[1]=x=>M.value=!1),onConfirm:nt},null,8,["open","title","description","confirm-text","cancel-text","loading"]),S(pn,{open:G.value,"initial-path":r.cwd,suggestions:re.value,onClose:s[2]||(s[2]=x=>G.value=!1),onSelect:Je},null,8,["open","initial-path","suggestions"]),S(Xe,{open:i.open,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-auto sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 overflow-hidden","close-disabled":I.value,"close-on-backdrop":!I.value,"close-on-escape":!I.value,onClose:s[12]||(s[12]=x=>k("close"))},{title:le(()=>[t("div",ya,[S(a(_t),{class:"h-4 w-4"}),t("span",null,o(a(c)("projectManager.managingTitle")),1)])]),default:le(()=>{var x;return[a(A)?(p(),v("div",Ea,[K.value==="list"?(p(),v("div",Fa,[t("div",Ba,[S(Ge,{mobile:"",busy:I.value,"editing-session-id":C.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"has-sessions":Z.value,"is-current-session":te,"is-session-running":O,mode:h.value,sessions:ne.value,onCreate:Y,onSelect:De},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])])])):(p(),v("div",Aa,[t("div",Na,[t("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-3 py-2 text-xs",disabled:I.value,onClick:W},[S(a($t),{class:"h-4 w-4"}),t("span",null,o(a(c)("projectManager.projectList")),1)],8,za),t("div",Oa,[t("div",Ua,o(je.value),1),h.value==="edit"&&((x=b.value)!=null&&x.cwd)?(p(),v("p",Ha,o(b.value.cwd),1)):j("",!0)])]),t("div",qa,[t("div",Va,[t("button",{type:"button",class:P(["tool-button px-3 py-2 text-sm",z.value==="basic"?"tool-button-accent-subtle":""]),onClick:s[7]||(s[7]=y=>z.value="basic")},o(a(c)("projectManager.basicInfo")),3),t("button",{type:"button",class:P(["tool-button px-3 py-2 text-sm",z.value==="status"?"tool-button-accent-subtle":""]),disabled:h.value==="create",onClick:s[8]||(s[8]=y=>z.value="status")},o(a(c)("projectManager.status")),11,Wa)])]),t("div",Ga,[z.value==="basic"?(p(),v("div",Ka,[S(We,{mobile:"",busy:I.value,"can-edit-engine":h.value!=="edit"||oe.value,"can-edit-cwd":h.value!=="edit"||Q.value,"can-edit-session-id":h.value!=="edit"||V.value,cwd:r.cwd,"cwd-readonly-message":X.value,"duplicate-cwd-message":de.value,engine:r.engine,"engine-options":we.value,"engine-readonly-message":ce.value,"session-id":r.sessionId,"session-id-copied":B.value,"session-id-readonly-message":J.value,title:r.title,"workspace-suggestions":re.value,onCopySessionId:ze,onOpenDirectoryPicker:s[9]||(s[9]=y=>G.value=!0),"onUpdate:cwd":Fe,"onUpdate:engine":Ee,"onUpdate:sessionId":Be,"onUpdate:title":Le},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"]),d.value?(p(),v("p",Qa,[S(a(Ve),{class:"h-4 w-4"}),t("span",null,o(d.value),1)])):j("",!0),t("div",Xa,[t("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-sm",disabled:I.value,onClick:Oe},o(ue.value),9,Ja),h.value==="edit"&&b.value?(p(),v("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:I.value||ae.value,onClick:s[10]||(s[10]=y=>L.value=!0)},o(R.value?a(c)("projectManager.resettingSession"):a(c)("projectManager.newSession")),9,Ya)):j("",!0),h.value==="edit"&&b.value?(p(),v("button",{key:1,type:"button",class:"tool-button tool-button-danger-subtle w-full px-3 py-2 text-sm",disabled:I.value||ae.value,onClick:s[11]||(s[11]=y=>M.value=!0)},o(F.value?a(c)("projectManager.deletingProject"):a(c)("projectManager.deleteProject")),9,Za)):j("",!0)])])):(p(),se(xa,{key:1,"active-session":b.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"is-current-session":te,"is-session-running":O},null,8,["active-session"]))])]))])):(p(),v("div",ba,[t("aside",wa,[S(Ge,{busy:I.value,"editing-session-id":C.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"has-sessions":Z.value,"is-current-session":te,"is-session-running":O,mode:h.value,sessions:ne.value,onCreate:Y,onSelect:De},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])]),t("div",Sa,[t("div",ka,[t("div",null,[t("div",$a,[S(a(St),{class:"h-4 w-4"}),t("span",null,o(h.value==="create"?a(c)("projectManager.createTitle"):a(c)("projectManager.editTitle")),1)])])]),t("div",_a,[S(We,{busy:I.value,"can-edit-engine":h.value!=="edit"||oe.value,"can-edit-cwd":h.value!=="edit"||Q.value,"can-edit-session-id":h.value!=="edit"||V.value,cwd:r.cwd,"cwd-readonly-message":X.value,"duplicate-cwd-message":de.value,engine:r.engine,"engine-options":we.value,"engine-readonly-message":ce.value,"session-id":r.sessionId,"session-id-copied":B.value,"session-id-readonly-message":J.value,title:r.title,"workspace-suggestions":re.value,onCopySessionId:ze,onOpenDirectoryPicker:s[3]||(s[3]=y=>G.value=!0),"onUpdate:cwd":Fe,"onUpdate:engine":Ee,"onUpdate:sessionId":Be,"onUpdate:title":Le},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"])]),d.value?(p(),v("p",Ma,[S(a(Ve),{class:"h-4 w-4"}),t("span",null,o(d.value),1)])):j("",!0),t("div",Ca,[t("div",ja,[h.value==="edit"&&b.value?(p(),v("button",{key:0,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:I.value||ae.value,onClick:s[4]||(s[4]=y=>L.value=!0)},[S(a(Ct),{class:"h-4 w-4"}),t("span",null,o(R.value?a(c)("projectManager.resettingSession"):a(c)("projectManager.newSession")),1)],8,Ia)):j("",!0),h.value==="edit"&&b.value?(p(),v("button",{key:1,type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:I.value||ae.value,onClick:s[5]||(s[5]=y=>M.value=!0)},[S(a(kt),{class:"h-4 w-4"}),t("span",null,o(F.value?a(c)("projectManager.deletingProject"):a(c)("projectManager.deleteProject")),1)],8,Pa)):j("",!0)]),t("div",Ta,[t("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:s[6]||(s[6]=y=>k("close"))},o(a(c)("projectManager.close")),9,Ra),h.value==="create"&&Z.value?(p(),v("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:Ae},o(a(c)("projectManager.backToList")),9,Da)):j("",!0),t("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:Oe},o(ue.value),9,La)])])])]))]}),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"])],64))}};export{ns as default};
|
|
16
|
+
*/const Ct=Re("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function jt(i=[]){return(Array.isArray(i)&&i.length?i:mt).filter(u=>u&&typeof u=="object").map(u=>{const k=Pe(u.value);return{...u,value:k,label:String(u.label||Me(k)).trim()||Me(k),enabled:u.enabled!==!1,available:u.available!==!1}})}function Te(i=[]){return jt(i).filter(T=>T.enabled&&T.available)}async function It(){const i=await vt("/api/meta",{cache:"no-store"});return Te(i==null?void 0:i.agentEngineOptions)}const Pt={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Tt={class:"theme-muted-text mt-1 text-xs leading-5"},Rt={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Dt={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},Lt={class:"flex items-start gap-2 text-xs leading-5"},Et={class:"theme-muted-text shrink-0"},Ft={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},Bt={class:"theme-muted-text mt-4 block text-xs"},At={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},Nt=["placeholder"],zt={class:"mt-4 flex items-center gap-1.5"},Ot={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},Ut={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},Ht={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},qt={key:2,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Vt={key:3,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Wt={key:4,class:"theme-empty-state px-3 py-8 text-sm"},Gt={key:5,class:"theme-empty-state px-3 py-8 text-sm"},Kt={key:6,class:"theme-empty-state px-3 py-8 text-sm"},Qt={key:7,class:"space-y-1"},Jt=["onClick"],Xt={class:"min-w-0 flex-1"},Yt=["innerHTML"],Zt=["innerHTML"],en={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},tn={key:8,class:"space-y-1"},nn={class:"flex items-start gap-1.5"},an=["onClick"],sn=["onClick"],ln={class:"min-w-0 flex-1"},on={key:0,class:"theme-muted-text truncate font-mono text-[10px]"},rn={class:"theme-divider flex flex-col-reverse gap-2 border-t border-dashed px-4 py-4 sm:flex-row sm:items-center sm:justify-end sm:px-5"},dn={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},cn=["disabled"],un=["disabled"],pn={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye(),c=$(""),h=$(null),C=$(!1),r=$(""),d=$(!1),w=$(""),E=$([]),F=$(!1),R=$(""),M=$("tree"),L=$(""),G=$("");let B=null,A=0;const K=_(()=>de(h.value?[h.value]:[])),z=_(()=>M.value==="search"&&!R.value.trim()),ie=_(()=>M.value==="search"&&!!R.value.trim()&&!d.value&&!w.value&&!E.value.length),q=_(()=>M.value==="tree"&&!C.value&&!r.value&&!K.value.length);function ne(n=""){const g=String(n||"").trim();return/^[a-z]:[\\/]/i.test(g)||g.includes("\\")}function b(n=""){const g=String(n||"").trim();if(!g)return"";const l=ne(g);let m=g.replace(/\\/g,"/");return m.length>1&&!/^[a-z]:\/?$/i.test(m)&&m!=="/"&&(m=m.replace(/\/+$/,"")),l?m.toLowerCase():m}function Z(n="",g=""){const l=b(n),m=b(g);return!l||!m?!1:l===m||l.startsWith(`${m}/`)}function Ce(n="",g=""){const l=String(n||"").trim(),m=String(g||"").trim();return l?m?ne(l)?/^[a-z]:\\?$/i.test(l)?`${l.replace(/[\\/]+$/,"")}\\${m}`:`${l.replace(/[\\/]+$/,"")}\\${m}`:l==="/"?`/${m}`:`${l.replace(/\/+$/,"")}/${m}`:l:m}function ae(n="",g=""){const l=b(n),m=b(g);if(!l||!m||!Z(m,l))return[];const D=m===l?"":m.slice(l.length).replace(/^\//,"");return D?D.split("/").filter(Boolean):[]}function Q(n){return(n==null?void 0:n.name)||(n==null?void 0:n.path)||f("directoryPicker.unnamedDirectory")}function oe(n=""){const g=String(n||"").trim();return g?g.split(/[\\/]/).filter(Boolean).at(-1)||g:"Home"}function V(n=""){return String(n||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(n="",g=""){const l=String(n||""),m=String(g||"").trim().toLowerCase();if(!l||!m)return null;const D=l.toLowerCase(),U=D.indexOf(m);if(U>=0)return{start:U,end:U+m.length};const $e=m.split(/[\\/\s_.-]+/).filter(Boolean).sort((W,Y)=>Y.length-W.length);for(const W of $e){if(W.length<2)continue;const Y=D.indexOf(W);if(Y>=0)return{start:Y,end:Y+W.length}}return null}function be(n="",g=""){const l=String(n||""),m=I(l,g);return m?`${V(l.slice(0,m.start))}<mark class="theme-search-highlight">${V(l.slice(m.start,m.end))}</mark>${V(l.slice(m.end))}`:V(l)}function re(n){return be(Q(n),R.value)}function we(n){return be((n==null?void 0:n.path)||"",R.value)}function ee(n,g=0){return{...n,depth:g,expanded:!1,loaded:!1,loading:!1,children:[]}}function de(n=[],g=[]){return n.forEach(l=>{g.push(l),l.expanded&&l.children.length&&de(l.children,g)}),g}function J(){h.value&&(h.value={...h.value})}function ce(n,g=h.value?[h.value]:[]){const l=b(n);if(!l)return null;for(const m of g){if(b(m.path)===l)return m;if(m.children.length){const D=ce(n,m.children);if(D)return D}}return null}function X(n){L.value=String((n==null?void 0:n.path)||"").trim(),G.value=Q(n)}async function ue(n,g={}){if(!(!n||n.loading)&&!(n.loaded&&!g.force)){n.loading=!0,r.value="",J();try{const l=await He({path:n.path,limit:240});n.children=(l.items||[]).map(m=>ee(m,n.depth+1)),n.loaded=!0}catch(l){r.value=l.message||f("directoryPicker.loadFailed")}finally{n.loading=!1,J()}}}async function je(){C.value=!0,r.value="";try{const n=await He({limit:240});c.value=String(n.path||""),h.value=ee({name:oe(n.path||""),path:String(n.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),h.value.children=(n.items||[]).map(g=>ee(g,1)),h.value.loaded=!0,h.value.expanded=!0,X(h.value)}catch(n){r.value=n.message||f("directoryPicker.treeLoadFailed"),h.value=null,c.value=""}finally{C.value=!1}}async function pe(n=""){const g=String(n||"").trim();if(!g||!c.value||!Z(g,c.value))return;let l=h.value;if(!l)return;X(l);const m=ae(c.value,g);for(const D of m){await ue(l),l.expanded=!0,J();const U=ce(Ce(l.path,D),l.children);if(!U)break;l=U,X(l)}}async function Se(){R.value="",M.value="tree",E.value=[],w.value="",F.value=!1,L.value="",G.value="",await je();const n=String(u.initialPath||"").trim();n&&Z(n,c.value)&&await pe(n)}async function O(n){if(n!=null&&n.path&&(X(n),!!n.hasChildren)){if(!n.loaded){n.expanded=!0,J(),await ue(n);return}n.expanded=!n.expanded,J()}}function te(n){n!=null&&n.path&&(X(n),M.value="tree")}async function ke(){const n=String(R.value||"").trim();A+=1;const g=A;if(!u.open||!n||!c.value){d.value=!1,w.value="",E.value=[],F.value=!1;return}d.value=!0,w.value="";try{const l=await ht(n,{path:c.value,limit:80});if(g!==A)return;E.value=Array.isArray(l.items)?l.items:[],F.value=!!l.truncated}catch(l){if(g!==A)return;w.value=l.message||f("directoryPicker.searchFailed"),E.value=[],F.value=!1}finally{g===A&&(d.value=!1)}}function ge(){if(B&&(window.clearTimeout(B),B=null),!String(R.value||"").trim()){d.value=!1,w.value="",E.value=[],F.value=!1;return}d.value=!0,w.value="",B=window.setTimeout(()=>{ke()},120)}async function me(n){n!=null&&n.path&&(M.value="tree",await pe(n.path))}function ve(){L.value&&(k("select",L.value),k("close"))}return he(R,()=>{M.value=R.value.trim()?"search":"tree",ge()}),he(()=>u.open,n=>{if(n){Se().catch(()=>{});return}B&&(window.clearTimeout(B),B=null)}),(n,g)=>(p(),se(Je,{open:i.open,"backdrop-class":"z-[60] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"settings-dialog-panel h-full max-w-4xl sm:h-auto sm:max-h-[86vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:px-5","close-disabled":C.value||d.value,"close-on-backdrop":!(C.value||d.value),"close-on-escape":!(C.value||d.value),onClose:g[4]||(g[4]=l=>k("close"))},{title:le(()=>[t("div",null,[t("div",Pt,[S(a(fe),{class:"h-4 w-4"}),t("span",null,o(a(f)("directoryPicker.title")),1)]),t("p",Tt,o(a(f)("directoryPicker.intro")),1)])]),default:le(()=>[t("div",Rt,[t("div",Dt,[t("div",Lt,[t("span",Et,o(a(f)("directoryPicker.currentSelection")),1),t("span",Ft,o(L.value||a(f)("directoryPicker.selectionPlaceholder")),1)])]),t("label",Bt,[t("span",null,o(a(f)("directoryPicker.searchLabel")),1),t("div",At,[S(a(Ue),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),lt(t("input",{"onUpdate:modelValue":g[0]||(g[0]=l=>R.value=l),type:"text",placeholder:a(f)("directoryPicker.searchPlaceholder"),class:"min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]"},null,8,Nt),[[it,R.value]])])]),t("div",zt,[t("button",{type:"button",class:P(["inline-flex h-8 items-center gap-1 rounded-sm border px-2 text-[11px] transition",M.value==="search"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:g[1]||(g[1]=l=>M.value="search")},[S(a(Ue),{class:"h-3.5 w-3.5"}),t("span",null,o(a(f)("directoryPicker.searchTab")),1)],2),t("button",{type:"button",class:P(["inline-flex h-8 items-center gap-1 rounded-sm border px-2 text-[11px] transition",M.value==="tree"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:g[2]||(g[2]=l=>M.value="tree")},[S(a(fe),{class:"h-3.5 w-3.5"}),t("span",null,o(a(f)("directoryPicker.treeTab")),1)],2)]),t("div",Ot,[M.value==="search"&&w.value?(p(),v("div",Ut,o(w.value),1)):M.value==="tree"&&r.value?(p(),v("div",Ht,o(r.value),1)):M.value==="search"&&d.value?(p(),v("div",qt,[S(a(Ie),{class:"h-4 w-4 animate-spin"}),t("span",null,o(a(f)("directoryPicker.searching")),1)])):M.value==="tree"&&C.value?(p(),v("div",Vt,[S(a(Ie),{class:"h-4 w-4 animate-spin"}),t("span",null,o(a(f)("directoryPicker.treeLoading")),1)])):z.value?(p(),v("div",Wt,o(a(f)("directoryPicker.searchPrompt")),1)):ie.value?(p(),v("div",Gt,o(a(f)("directoryPicker.noSearchResults")),1)):q.value?(p(),v("div",Kt,o(a(f)("directoryPicker.emptyTree")),1)):M.value==="search"?(p(),v("div",Qt,[(p(!0),v(xe,null,_e(E.value,l=>(p(),v("button",{key:l.path,type:"button",class:P(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",b(L.value)===b(l.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:m=>me(l)},[S(a(fe),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"}),t("div",Xt,[t("div",null,[t("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:re(l)},null,8,Yt)]),t("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:we(l)},null,8,Zt)])],10,Jt))),128)),F.value?(p(),v("p",en,o(a(f)("directoryPicker.truncatedHint")),1)):j("",!0)])):(p(),v("div",tn,[(p(!0),v(xe,null,_e(K.value,l=>(p(),v("div",{key:l.path,class:P(["rounded-sm border border-transparent px-1.5 py-1 transition",b(L.value)===b(l.path)?"theme-list-item-active":l.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:ot({paddingLeft:`${l.depth*16+6}px`})},[t("div",nn,[t("button",{type:"button",class:P(["theme-icon-button h-5 w-5 shrink-0",l.hasChildren?"":"invisible pointer-events-none"]),onClick:rt(m=>O(l),["stop"])},[l.loading?(p(),se(a(Ie),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(p(),se(a(ft),{key:1,class:P(["h-3.5 w-3.5 transition",l.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,an),t("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:m=>te(l)},[S(a(fe),{class:P(["h-4 w-4 shrink-0",b(L.value)===b(l.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),t("div",ln,[t("div",{class:P(["truncate text-[13px]",l.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},o(Q(l)),3),l.isHomeRoot?(p(),v("div",on,o(l.path),1)):j("",!0)])],8,sn)])],6))),128))]))])]),t("div",rn,[t("div",dn,[t("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:C.value||d.value,onClick:g[3]||(g[3]=l=>k("close"))},o(a(f)("directoryPicker.cancel")),9,cn),t("button",{type:"button",class:"tool-button tool-button-primary inline-flex w-full items-center justify-center gap-2 px-3 py-2 text-xs sm:w-auto",disabled:C.value||d.value||!L.value,onClick:ve},[S(a(Qe),{class:"h-4 w-4"}),t("span",null,o(a(f)("directoryPicker.useCurrentDirectory")),1)],8,un)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},gn={class:"grid gap-4"},mn={class:"theme-muted-text block text-xs"},vn=["value","disabled"],fn={class:"theme-muted-text block text-xs"},hn={class:"mt-1 flex gap-2"},xn=["value","disabled"],yn=["disabled"],bn={id:"codex-manager-workspace-suggestions"},wn=["value"],Sn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},kn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},$n={class:"theme-muted-text block text-xs"},_n={class:"mt-1"},Mn={class:"flex items-center gap-2 text-sm"},Cn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},jn=["disabled","onClick"],In={class:"flex items-center justify-between gap-3"},Pn={class:"min-w-0 flex-1 truncate"},Tn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Rn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},Dn={class:"theme-muted-text block text-xs"},Ln={class:"mt-1 flex gap-2"},En=["value","disabled"],Fn=["disabled"],Bn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},An={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},We={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},canEditEngine:{type:Boolean,default:!0},canEditCwd:{type:Boolean,default:!0},canEditSessionId:{type:Boolean,default:!0},cwd:{type:String,default:""},cwdReadonlyMessage:{type:String,default:""},duplicateCwdMessage:{type:String,default:""},engine:{type:String,default:"codex"},engineOptions:{type:Array,default:()=>[]},engineReadonlyMessage:{type:String,default:""},mobile:{type:Boolean,default:!1},sessionId:{type:String,default:""},sessionIdCopied:{type:Boolean,default:!1},sessionIdReadonlyMessage:{type:String,default:""},title:{type:String,default:""},workspaceSuggestions:{type:Array,default:()=>[]}},emits:["copy-session-id","open-directory-picker","update:cwd","update:engine","update:sessionId","update:title"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye(),c=_(()=>{const C=String(u.engine||"").trim();return u.engineOptions.find(r=>String((r==null?void 0:r.value)||"").trim()===C)||null}),h=_(()=>String(u.sessionId||"").trim());return(C,r)=>(p(),v("div",gn,[t("label",mn,[t("span",null,o(a(f)("projectManager.projectTitleOptional")),1),t("input",{value:i.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:i.busy,onInput:r[0]||(r[0]=d=>k("update:title",d.target.value))},null,40,vn)]),t("label",fn,[t("span",null,o(a(f)("projectManager.workingDirectoryField")),1),t("div",hn,[t("input",{value:i.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:P(["tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",i.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:i.busy||!i.canEditCwd,onInput:r[1]||(r[1]=d=>k("update:cwd",d.target.value))},null,42,xn),t("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:i.busy||!i.canEditCwd,onClick:r[2]||(r[2]=d=>k("open-directory-picker"))},[S(a(fe),{class:"h-4 w-4"}),t("span",null,o(i.mobile?a(f)("projectManager.choose"):a(f)("projectManager.chooseDirectory")),1)],8,yn)]),t("datalist",bn,[(p(!0),v(xe,null,_e(i.workspaceSuggestions,d=>(p(),v("option",{key:d,value:d},null,8,wn))),128))]),i.duplicateCwdMessage?(p(),v("p",Sn,o(i.duplicateCwdMessage),1)):i.cwdReadonlyMessage?(p(),v("p",kn,o(i.cwdReadonlyMessage),1)):j("",!0)]),t("label",$n,[t("span",null,o(a(f)("projectManager.engineField")),1),t("div",_n,[S(xt,{"model-value":i.engine,options:i.engineOptions,disabled:i.busy||!i.canEditEngine,placeholder:a(f)("projectManager.selectEngine"),"empty-text":a(f)("projectManager.noEngines"),"get-option-value":d=>(d==null?void 0:d.value)||"","onUpdate:modelValue":r[3]||(r[3]=d=>k("update:engine",d))},{trigger:le(({disabled:d})=>{var w;return[t("div",Mn,[t("span",{class:P(["min-w-0 flex-1 truncate",d?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},o(((w=c.value)==null?void 0:w.label)||a(f)("projectManager.selectEngine")),3),c.value&&c.value.enabled===!1?(p(),v("span",Cn,o(a(f)("projectManager.comingSoon")),1)):j("",!0)])]}),option:le(({option:d,selected:w,select:E})=>[t("button",{type:"button",class:P(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",w?"theme-filter-active":"theme-filter-idle"]),disabled:(d==null?void 0:d.enabled)===!1,onClick:E},[t("div",In,[t("span",Pn,o(d.label),1),(d==null?void 0:d.enabled)===!1?(p(),v("span",Tn,o(a(f)("projectManager.comingSoon")),1)):j("",!0)])],10,jn)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),i.engineReadonlyMessage?(p(),v("p",Rn,o(i.engineReadonlyMessage),1)):j("",!0)]),t("label",Dn,[t("span",null,o(a(f)("projectManager.sessionId")),1),t("div",Ln,[t("input",{value:i.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",disabled:i.busy||!i.canEditSessionId,onInput:r[4]||(r[4]=d=>k("update:sessionId",d.target.value))},null,40,En),h.value?(p(),v("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:i.busy,onClick:r[5]||(r[5]=d=>k("copy-session-id"))},[i.sessionIdCopied?(p(),se(a(Qe),{key:0,class:"h-4 w-4"})):(p(),se(a(Mt),{key:1,class:"h-4 w-4"})),t("span",null,o(i.sessionIdCopied?a(f)("projectManager.sessionIdCopied"):a(f)("projectManager.copySessionId")),1)],8,Fn)):j("",!0)]),i.sessionIdReadonlyMessage?(p(),v("p",Bn,o(i.sessionIdReadonlyMessage),1)):(p(),v("p",An,o(a(f)("projectManager.sessionIdHint")),1))])]))}},Nn={class:"flex items-center justify-between gap-3"},zn={class:"theme-heading text-sm font-medium"},On={key:0,class:"theme-muted-text mt-1 text-xs"},Un=["disabled"],Hn=["onClick"],qn={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Vn={class:"flex w-full flex-col gap-2 text-left"},Wn={class:"theme-heading min-w-0 text-sm font-medium"},Gn=["title"],Kn=["title"],Qn={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},Jn={key:0,"aria-hidden":"true"},Xn={key:1},Yn={class:"flex flex-wrap items-center gap-2 pt-1"},Zn={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Ge={__name:"CodexSessionManagerList",props:{busy:{type:Boolean,default:!1},editingSessionId:{type:String,default:""},formatUpdatedAt:{type:Function,default:i=>i},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},hasSessions:{type:Boolean,default:!1},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1},mode:{type:String,default:"edit"},mobile:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]}},emits:["create","select"],setup(i,{emit:T}){const u=i,k=T,{t:f}=ye();function c(r){return u.mode==="edit"&&u.editingSessionId===r.id?"theme-card-selected":u.isSessionRunning(r.id)?"theme-card-warning":"theme-card-idle-strong"}function h(r){return u.isCurrentSession(r.id)?f("projectManager.current"):f("projectManager.regular")}function C(r){return u.isCurrentSession(r.id)?"theme-status-info":"theme-status-neutral"}return(r,d)=>(p(),v("div",{class:P(i.mobile?"flex h-full min-h-0 flex-col":"")},[t("div",Nn,[t("div",null,[t("div",zn,o(a(f)("projectManager.projectList")),1),i.hasSessions?j("",!0):(p(),v("p",On,o(a(f)("projectManager.noProjects")),1))]),t("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:i.busy,onClick:d[0]||(d[0]=w=>k("create"))},[S(a(yt),{class:"h-4 w-4"}),t("span",null,o(a(f)("projectManager.create")),1)],8,Un)]),t("div",{class:P(["mt-4 space-y-2",i.mobile?"min-h-0 flex-1 overflow-y-auto":"max-h-52 overflow-y-auto pr-1 sm:max-h-64 lg:max-h-[calc(88vh-11rem)]"])},[(p(!0),v(xe,null,_e(i.sessions,w=>(p(),v("article",{key:w.id,class:P(["relative cursor-pointer rounded-sm border p-3 transition",c(w)]),onClick:E=>k("select",w.id)},[i.mode==="edit"&&i.editingSessionId===w.id?(p(),v("span",qn)):j("",!0),t("div",Vn,[t("div",Wn,[t("span",{class:"block truncate",title:w.title||a(f)("projectManager.untitledProject")},o(w.title||a(f)("projectManager.untitledProject")),9,Gn)]),t("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:w.cwd},o(w.cwd),9,Kn),t("div",Qn,[t("span",null,o(a(Me)(w.engine)),1),i.mobile?j("",!0):(p(),v("span",Jn,"·")),i.mobile?j("",!0):(p(),v("span",Xn,o(i.formatUpdatedAt(w.updatedAt)),1))]),t("div",Yn,[t("span",{class:P(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",C(w)])},o(h(w)),3),t("span",{class:P(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",i.getRuntimeStatusClass(w.id)])},[i.isSessionRunning(w.id)?(p(),v("span",Zn)):j("",!0),Ke(" "+o(i.getRuntimeStatusLabel(w.id)),1)],2),t("span",{class:P(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",i.getThreadStatusClass(w)])},o(i.getThreadStatusLabel(w)),3)])])],10,Hn))),128))],2)],2))}},ea={class:"space-y-3"},ta={class:"dashed-panel px-3 py-3"},na={class:"theme-muted-text text-[11px]"},aa={class:"mt-2 flex flex-wrap gap-2"},sa={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},la={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},ia={class:"dashed-panel px-3 py-3"},oa={class:"theme-muted-text text-[11px]"},ra={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},da={class:"dashed-panel px-3 py-3"},ca={class:"theme-muted-text text-[11px]"},ua={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},pa={class:"dashed-panel px-3 py-3"},ga={class:"theme-muted-text text-[11px]"},ma={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},va={class:"dashed-panel px-3 py-3"},fa={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},ha={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},xa={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:i=>i},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1}},setup(i){const{t:T}=ye();return(u,k)=>{var f,c,h,C,r,d,w;return p(),v("div",ea,[t("div",ta,[t("div",na,o(a(T)("projectManager.runtimeStatus")),1),t("div",aa,[t("span",{class:P(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",i.getRuntimeStatusClass((f=i.activeSession)==null?void 0:f.id)])},[i.isSessionRunning((c=i.activeSession)==null?void 0:c.id)?(p(),v("span",sa)):j("",!0),Ke(" "+o(i.getRuntimeStatusLabel((h=i.activeSession)==null?void 0:h.id)),1)],2),t("span",{class:P(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",i.getThreadStatusClass(i.activeSession)])},o(i.getThreadStatusLabel(i.activeSession)),3),(C=i.activeSession)!=null&&C.id&&i.isCurrentSession(i.activeSession.id)?(p(),v("span",la,o(a(T)("projectManager.currentProject")),1)):j("",!0)])]),t("div",ia,[t("div",oa,o(a(T)("projectManager.engine")),1),t("div",ra,o(a(Me)((r=i.activeSession)==null?void 0:r.engine)),1)]),t("div",da,[t("div",ca,o(a(T)("projectManager.workingDirectory")),1),t("div",ua,o(((d=i.activeSession)==null?void 0:d.cwd)||a(T)("projectManager.notSet")),1)]),t("div",pa,[t("div",ga,o(a(T)("projectManager.updatedAt")),1),t("div",ma,o(i.formatUpdatedAt((w=i.activeSession)==null?void 0:w.updatedAt)),1)]),t("div",va,[t("div",fa,[S(a(bt),{class:"h-3.5 w-3.5"}),t("span",null,o(a(T)("projectManager.note")),1)]),t("p",ha,o(a(T)("projectManager.noteDescription")),1)])])}}},ya={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ba={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},wa={class:"theme-divider theme-muted-panel border-b px-3 py-3 sm:px-4 sm:py-4 lg:border-b-0 lg:border-r"},Sa={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},ka={class:"flex flex-wrap items-start justify-between gap-3"},$a={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},_a={class:"mt-5"},Ma={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ca={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4 sm:flex-row sm:items-center sm:justify-between"},ja={class:"flex flex-wrap items-center gap-2"},Ia=["disabled"],Pa=["disabled"],Ta={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},Ra=["disabled"],Da=["disabled"],La=["disabled"],Ea={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Fa={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ba={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},Aa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Na={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},za=["disabled"],Oa={class:"min-w-0 flex-1"},Ua={class:"theme-heading truncate text-sm font-medium"},Ha={key:0,class:"theme-muted-text mt-1 truncate text-xs"},qa={class:"theme-divider border-b px-4 py-3"},Va={class:"grid grid-cols-2 gap-2"},Wa=["disabled"],Ga={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Ka={key:0},Qa={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ja={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Xa=["disabled"],Ya=["disabled"],Za=["disabled"],ns={__name:"CodexSessionManagerDialog",props:{open:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]},workspaces:{type:Array,default:()=>[]},selectedSessionId:{type:String,default:""},selectionLocked:{type:Boolean,default:!1},selectionLockReason:{type:String,default:""},loading:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},onRefresh:{type:Function,default:null},onCreate:{type:Function,default:null},onUpdate:{type:Function,default:null},onDelete:{type:Function,default:null},onReset:{type:Function,default:null}},emits:["close","project-created","select-session"],setup(i,{emit:T}){const u=i,k=T,{locale:f,t:c}=ye(),h=$("edit"),C=$(""),r=ct({title:"",engine:"codex",cwd:"",sessionId:""}),d=$(""),w=$(!1),E=$(!1),F=$(!1),R=$(!1),M=$(!1),L=$(!1),G=$(!1),B=$(!1),{matches:A}=wt("(max-width: 767px)"),K=$("list"),z=$("basic"),ie=$(Te());let q=null;const ne=_(()=>ke(u.sessions)),b=_(()=>u.sessions.find(e=>e.id===C.value)||null),Z=_(()=>u.sessions.length>0),Ce=_(()=>u.sessions.find(e=>e.id===u.selectedSessionId)||null),ae=_(()=>!!(b.value&&O(b.value.id))),Q=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),oe=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),V=_(()=>{var e;return!((e=b.value)!=null&&e.started)}),I=_(()=>u.loading||w.value||E.value||F.value||R.value),be=_(()=>String(r.sessionId||"").trim()),re=_(()=>{var x,y;const e=new Set,s=[];return[r.cwd,(x=b.value)==null?void 0:x.cwd,(y=Ce.value)==null?void 0:y.cwd,...u.workspaces,...u.sessions.map(H=>H.cwd)].forEach(H=>{const N=String(H||"").trim();!N||e.has(N)||(e.add(N),s.push(N))}),s.slice(0,12)}),we=_(()=>ie.value),ee=_(()=>{const e=Se(r.cwd);return e?u.sessions.filter(s=>{var x;return s.id===((x=b.value)==null?void 0:x.id)?!1:Se(s.cwd)===e}):[]}),de=_(()=>{if(!ee.value.length)return"";const e=ee.value.slice(0,3).map(s=>{const x=s.title||c("projectManager.untitledProject");return f.value==="en-US"?`"${x}"`:`「${x}」`}).join(f.value==="en-US"?", ":"、");return c("projectManager.duplicateDirectory",{labels:e,count:ee.value.length})}),J=_(()=>h.value!=="edit"||Q.value?"":c("projectManager.cwdReadonly")),ce=_(()=>h.value!=="edit"||!b.value||oe.value?"":c("projectManager.engineReadonly")),X=_(()=>h.value!=="edit"||!b.value||V.value?"":c("projectManager.sessionIdReadonly")),ue=_(()=>h.value==="create"?w.value?c("projectManager.creatingProject"):c("projectManager.createProject"):E.value?c("projectManager.savingChanges"):c("projectManager.saveChanges")),je=_(()=>{var e;return h.value==="create"?c("projectManager.newProject"):((e=b.value)==null?void 0:e.title)||c("projectManager.untitledProject")});function pe(e=""){const s=Date.parse(String(e||""));return Number.isFinite(s)?s:0}function Se(e=""){const s=String(e||"").trim();if(!s)return"";const x=/^[a-z]:[\\/]/i.test(s)||s.includes("\\");let y=s.replace(/\\/g,"/");return y.length>1&&!/^[a-z]:\/$/i.test(y)&&(y=y.replace(/\/+$/,"")),x?y.toLowerCase():y}function O(e){var s;return!!((s=u.sessions.find(x=>x.id===e))!=null&&s.running)}function te(e){return!!e&&e===u.selectedSessionId}function ke(e=[]){return[...e].sort((s,x)=>{const y=Number(O(x.id))-Number(O(s.id));if(y)return y;const H=Number(te(x.id))-Number(te(s.id));if(H)return H;const N=pe(x.updatedAt)-pe(s.updatedAt);return N||pt(String(s.title||s.cwd||s.id),String(x.title||x.cwd||x.id))})}function ge(e){return O(e)?c("projectManager.running"):c("projectManager.idle")}function me(e){return O(e)?"theme-status-warning":"theme-status-success"}function ve(e){return e!=null&&e.started?c("projectManager.threadBound"):c("projectManager.notStarted")}function n(e){return e!=null&&e.started?"theme-status-success":"theme-status-neutral"}function g(e=""){if(!e)return c("projectManager.unknown");const s=new Date(e);return Number.isNaN(s.getTime())?e:ut(s.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function l(e){r.title=String((e==null?void 0:e.title)||""),r.engine=Pe(e==null?void 0:e.engine),r.cwd=String((e==null?void 0:e.cwd)||""),r.sessionId=String((e==null?void 0:e.sessionId)||(e==null?void 0:e.engineSessionId)||(e==null?void 0:e.engineThreadId)||(e==null?void 0:e.codexThreadId)||"").trim()}function m(){h.value="create",C.value="",d.value="",r.title="",r.engine="codex",r.cwd="",r.sessionId=""}function D(e){const s=u.sessions.find(x=>x.id===e);s&&(h.value="edit",C.value=s.id,d.value="",l(s))}function U(){var e;return u.selectedSessionId&&u.sessions.some(s=>s.id===u.selectedSessionId)?u.selectedSessionId:((e=ne.value[0])==null?void 0:e.id)||""}function $e(e="basic"){K.value="detail",z.value=e}function W(){K.value="list",z.value="basic"}function Y(){m(),A.value&&$e("basic")}function De(e){I.value||(D(e),A.value&&$e("basic"))}function Xe(e){r.cwd=String(e||"").trim()}function Le(e){r.title=String(e||"")}function Ee(e){r.engine=Pe(e)}function Fe(e){r.cwd=String(e||"")}function Be(e){r.sessionId=String(e||"")}function Ae(){d.value="",M.value=!1,L.value=!1,B.value=!1,z.value="basic",K.value=A.value?"list":"detail";const e=U();if(e){D(e);return}m()}async function Ye(){if(!(I.value||typeof u.onRefresh!="function")){d.value="";try{await Promise.all([u.onRefresh(),Ne()])}catch(e){d.value=e.message}}}async function Ne(){try{ie.value=await It()}catch{ie.value=Te()}}async function Ze(e){var x;if((x=navigator.clipboard)!=null&&x.writeText&&window.isSecureContext){await navigator.clipboard.writeText(e);return}const s=document.createElement("textarea");s.value=e,s.setAttribute("readonly","true"),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)}async function ze(){const e=be.value;if(e)try{await Ze(e),B.value=!0,q&&clearTimeout(q),q=setTimeout(()=>{B.value=!1,q=null},1800)}catch(s){d.value=(s==null?void 0:s.message)||c("projectManager.copySessionIdFailed")}}async function Oe(){if(!I.value){d.value="";try{const e=et();if(!e)return;await tt(e)}catch(e){d.value=e.message}}}function et(){if(h.value==="create"){const s=String(r.cwd||"").trim();return s?{type:"create",cwd:s,payload:{title:r.title,engine:r.engine,cwd:s,sessionId:String(r.sessionId||"").trim()}}:(d.value=c("projectManager.directoryRequired"),null)}if(!b.value)return d.value=c("projectManager.projectMissing"),null;const e={title:r.title,engine:r.engine};return Q.value&&(e.cwd=r.cwd),V.value&&(e.sessionId=String(r.sessionId||"").trim()),{type:"update",sessionId:b.value.id,payload:e}}async function tt(e){var s,x;if(e.type==="create"){w.value=!0;try{const y=await((s=u.onCreate)==null?void 0:s.call(u,e.payload));y!=null&&y.id&&(D(y.id),k("select-session",y.id),await gt(),k("project-created",y),k("close"));return}finally{w.value=!1}}E.value=!0;try{const y=await((x=u.onUpdate)==null?void 0:x.call(u,e.sessionId,e.payload));y!=null&&y.id&&D(y.id)}finally{E.value=!1}}async function nt(){var s,x;if(!b.value||F.value)return;const e=b.value.id;d.value="",F.value=!0;try{const y=await((s=u.onDelete)==null?void 0:s.call(u,e));M.value=!1;const H=u.sessions.filter(st=>st.id!==e),N=(y==null?void 0:y.selectedSessionId)||((x=ke(H)[0])==null?void 0:x.id)||"";k("select-session",N),N?(D(N),A.value&&W()):(m(),A.value&&W())}catch(y){d.value=y.message}finally{F.value=!1}}async function at(){var s;if(!b.value||R.value)return;const e=b.value.id;d.value="",R.value=!0;try{const x=await((s=u.onReset)==null?void 0:s.call(u,e));L.value=!1;const y=(x==null?void 0:x.session)||u.sessions.find(H=>H.id===e)||null;y!=null&&y.id&&D(y.id)}catch(x){d.value=x.message}finally{R.value=!1}}return he(()=>u.open,e=>{if(e){Ae(),typeof u.onRefresh=="function"?Ye().catch(()=>{}):Ne().catch(()=>{});return}G.value=!1,M.value=!1,L.value=!1,B.value=!1,d.value=""},{immediate:!0}),he(A,e=>{e||(K.value="detail")},{immediate:!0}),he(()=>u.sessions,()=>{if(!u.open)return;if(h.value==="create"){if(!!(String(r.title||"").trim()||String(r.cwd||"").trim())||!!String(r.sessionId||"").trim())return;const x=U();x&&D(x);return}if(b.value){l(b.value);return}const e=U();if(e){D(e);return}m()}),dt(()=>{q&&(clearTimeout(q),q=null)}),(e,s)=>(p(),v(xe,null,[S(qe,{open:L.value,title:a(c)("projectManager.confirmResetTitle"),description:b.value?a(c)("projectManager.confirmResetDescription",{title:b.value.title||a(c)("projectManager.untitledProject")}):"","confirm-text":a(c)("projectManager.confirmReset"),"cancel-text":a(c)("projectManager.keep"),loading:R.value,onCancel:s[0]||(s[0]=x=>L.value=!1),onConfirm:at},null,8,["open","title","description","confirm-text","cancel-text","loading"]),S(qe,{open:M.value,title:a(c)("projectManager.confirmDeleteTitle"),description:b.value?a(c)("projectManager.confirmDeleteDescription",{title:b.value.title||a(c)("projectManager.untitledProject")}):"","confirm-text":a(c)("projectManager.confirmDelete"),"cancel-text":a(c)("projectManager.keep"),loading:F.value,danger:"",onCancel:s[1]||(s[1]=x=>M.value=!1),onConfirm:nt},null,8,["open","title","description","confirm-text","cancel-text","loading"]),S(pn,{open:G.value,"initial-path":r.cwd,suggestions:re.value,onClose:s[2]||(s[2]=x=>G.value=!1),onSelect:Xe},null,8,["open","initial-path","suggestions"]),S(Je,{open:i.open,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-auto sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 overflow-hidden","close-disabled":I.value,"close-on-backdrop":!I.value,"close-on-escape":!I.value,onClose:s[12]||(s[12]=x=>k("close"))},{title:le(()=>[t("div",ya,[S(a(_t),{class:"h-4 w-4"}),t("span",null,o(a(c)("projectManager.managingTitle")),1)])]),default:le(()=>{var x;return[a(A)?(p(),v("div",Ea,[K.value==="list"?(p(),v("div",Fa,[t("div",Ba,[S(Ge,{mobile:"",busy:I.value,"editing-session-id":C.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"has-sessions":Z.value,"is-current-session":te,"is-session-running":O,mode:h.value,sessions:ne.value,onCreate:Y,onSelect:De},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])])])):(p(),v("div",Aa,[t("div",Na,[t("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-3 py-2 text-xs",disabled:I.value,onClick:W},[S(a($t),{class:"h-4 w-4"}),t("span",null,o(a(c)("projectManager.projectList")),1)],8,za),t("div",Oa,[t("div",Ua,o(je.value),1),h.value==="edit"&&((x=b.value)!=null&&x.cwd)?(p(),v("p",Ha,o(b.value.cwd),1)):j("",!0)])]),t("div",qa,[t("div",Va,[t("button",{type:"button",class:P(["tool-button px-3 py-2 text-sm",z.value==="basic"?"tool-button-accent-subtle":""]),onClick:s[7]||(s[7]=y=>z.value="basic")},o(a(c)("projectManager.basicInfo")),3),t("button",{type:"button",class:P(["tool-button px-3 py-2 text-sm",z.value==="status"?"tool-button-accent-subtle":""]),disabled:h.value==="create",onClick:s[8]||(s[8]=y=>z.value="status")},o(a(c)("projectManager.status")),11,Wa)])]),t("div",Ga,[z.value==="basic"?(p(),v("div",Ka,[S(We,{mobile:"",busy:I.value,"can-edit-engine":h.value!=="edit"||oe.value,"can-edit-cwd":h.value!=="edit"||Q.value,"can-edit-session-id":h.value!=="edit"||V.value,cwd:r.cwd,"cwd-readonly-message":J.value,"duplicate-cwd-message":de.value,engine:r.engine,"engine-options":we.value,"engine-readonly-message":ce.value,"session-id":r.sessionId,"session-id-copied":B.value,"session-id-readonly-message":X.value,title:r.title,"workspace-suggestions":re.value,onCopySessionId:ze,onOpenDirectoryPicker:s[9]||(s[9]=y=>G.value=!0),"onUpdate:cwd":Fe,"onUpdate:engine":Ee,"onUpdate:sessionId":Be,"onUpdate:title":Le},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"]),d.value?(p(),v("p",Qa,[S(a(Ve),{class:"h-4 w-4"}),t("span",null,o(d.value),1)])):j("",!0),t("div",Ja,[t("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-sm",disabled:I.value,onClick:Oe},o(ue.value),9,Xa),h.value==="edit"&&b.value?(p(),v("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:I.value||ae.value,onClick:s[10]||(s[10]=y=>L.value=!0)},o(R.value?a(c)("projectManager.resettingSession"):a(c)("projectManager.newSession")),9,Ya)):j("",!0),h.value==="edit"&&b.value?(p(),v("button",{key:1,type:"button",class:"tool-button tool-button-danger-subtle w-full px-3 py-2 text-sm",disabled:I.value||ae.value,onClick:s[11]||(s[11]=y=>M.value=!0)},o(F.value?a(c)("projectManager.deletingProject"):a(c)("projectManager.deleteProject")),9,Za)):j("",!0)])])):(p(),se(xa,{key:1,"active-session":b.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"is-current-session":te,"is-session-running":O},null,8,["active-session"]))])]))])):(p(),v("div",ba,[t("aside",wa,[S(Ge,{busy:I.value,"editing-session-id":C.value,"format-updated-at":g,"get-runtime-status-class":me,"get-runtime-status-label":ge,"get-thread-status-class":n,"get-thread-status-label":ve,"has-sessions":Z.value,"is-current-session":te,"is-session-running":O,mode:h.value,sessions:ne.value,onCreate:Y,onSelect:De},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])]),t("div",Sa,[t("div",ka,[t("div",null,[t("div",$a,[S(a(St),{class:"h-4 w-4"}),t("span",null,o(h.value==="create"?a(c)("projectManager.createTitle"):a(c)("projectManager.editTitle")),1)])])]),t("div",_a,[S(We,{busy:I.value,"can-edit-engine":h.value!=="edit"||oe.value,"can-edit-cwd":h.value!=="edit"||Q.value,"can-edit-session-id":h.value!=="edit"||V.value,cwd:r.cwd,"cwd-readonly-message":J.value,"duplicate-cwd-message":de.value,engine:r.engine,"engine-options":we.value,"engine-readonly-message":ce.value,"session-id":r.sessionId,"session-id-copied":B.value,"session-id-readonly-message":X.value,title:r.title,"workspace-suggestions":re.value,onCopySessionId:ze,onOpenDirectoryPicker:s[3]||(s[3]=y=>G.value=!0),"onUpdate:cwd":Fe,"onUpdate:engine":Ee,"onUpdate:sessionId":Be,"onUpdate:title":Le},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"])]),d.value?(p(),v("p",Ma,[S(a(Ve),{class:"h-4 w-4"}),t("span",null,o(d.value),1)])):j("",!0),t("div",Ca,[t("div",ja,[h.value==="edit"&&b.value?(p(),v("button",{key:0,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:I.value||ae.value,onClick:s[4]||(s[4]=y=>L.value=!0)},[S(a(Ct),{class:"h-4 w-4"}),t("span",null,o(R.value?a(c)("projectManager.resettingSession"):a(c)("projectManager.newSession")),1)],8,Ia)):j("",!0),h.value==="edit"&&b.value?(p(),v("button",{key:1,type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:I.value||ae.value,onClick:s[5]||(s[5]=y=>M.value=!0)},[S(a(kt),{class:"h-4 w-4"}),t("span",null,o(F.value?a(c)("projectManager.deletingProject"):a(c)("projectManager.deleteProject")),1)],8,Pa)):j("",!0)]),t("div",Ta,[t("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:s[6]||(s[6]=y=>k("close"))},o(a(c)("projectManager.close")),9,Ra),h.value==="create"&&Z.value?(p(),v("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:Ae},o(a(c)("projectManager.backToList")),9,Da)):j("",!0),t("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-xs sm:w-auto",disabled:I.value,onClick:Oe},o(ue.value),9,La)])])])]))]}),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"])],64))}};export{ns as default};
|
package/apps/web/dist/assets/{TaskDiffReviewDialog-CFYInZW6.js → TaskDiffReviewDialog-Dzj4GDaj.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as V,H as Ye,k as T,x as P,z as w,E as qe,y as Ze,a as h,e as p,g as a,F as te,m as Se,n as F,t as o,b as S,u as t,A as Me,B as et,i as B,l as Re,c as je,d as ue,I as tt,U as Ae}from"./index-
|
|
1
|
+
import{w as V,H as Ye,k as T,x as P,z as w,E as qe,y as Ze,a as h,e as p,g as a,F as te,m as Se,n as F,t as o,b as S,u as t,A as Me,B as et,i as B,l as Re,c as je,d as ue,I as tt,U as Ae}from"./index-DVWGdkCl.js";import{c as Ee,u as st,g as Le,l as at,S as nt,C as Ie,a as Ne,b as it,d as lt,_ as rt,e as ot,F as Ge,f as Be,h as ut}from"./WorkbenchView-WoVxKFEW.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as o,e as c,g as e,t as a,u as i,F as se,m as ne,n as Xe,v as wt,c as $,i as h,l as Ye
|
|
1
|
+
import{a as o,e as c,g as e,t as a,u as i,F as se,m as ne,n as Xe,v as wt,c as $,i as h,l as Ye,$ as Rt,k as v,w as Je,o as Tt,d as de,b as z,A as te,C as St,B as xe,a0 as Mt,x as m,D as pe,E as Et}from"./index-DVWGdkCl.js";import{c as _e,r as H,d as Pt,i as $t,_ as Ut,E as Bt,j as jt,L as me,k as Nt,h as Ft,I as Lt,m as It}from"./WorkbenchView-WoVxKFEW.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{a as o,e as c,g as e,t as a,u as i,F as se,m as ne,n as Xe,v as wt,c as $
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Ge=_e("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);function Vt(){return H("/api/relay/config",{cache:"no-store"})}function Qe(U){return H("/api/relay/config",{method:"PUT",body:JSON.stringify(U)})}function At(){return H("/api/relay/reconnect",{method:"POST"})}function zt(){return H("/api/system/config",{cache:"no-store"})}function Ht(U){return H("/api/system/config",{method:"PUT",body:JSON.stringify(U)})}function Ot(){return H("/api/diagnostics/runtime",{cache:"no-store"})}const Wt={class:"space-y-4"},Jt={class:"flex items-center justify-between gap-3"},Kt={class:"theme-heading text-sm font-medium"},Gt={class:"theme-toggle-current theme-badge-muted theme-muted-text rounded-sm border border-dashed px-2 py-1 text-[11px]"},Qt={class:"theme-muted-text theme-note-text mt-1"},Xt={class:"space-y-4"},Yt={class:"theme-muted-text px-1 text-[10px] font-medium uppercase tracking-[0.16em]"},Zt=["onClick"],es={class:"flex items-start gap-3"},ts={class:"mt-0.5 flex items-center gap-1.5"},ss={class:"min-w-0 flex-1"},ns={class:"flex items-center justify-between gap-2"},as={class:"truncate text-sm font-medium"},is={class:"theme-muted-text theme-note-text mt-1"},ls={__name:"ThemeToggle",setup(U){const{currentTheme:O,setTheme:W,themes:ae}=Rt(),{t:T}=Ye(),ge=v(()=>{const b=ae.value.filter(x=>x.mode==="light"),F=ae.value.filter(x=>x.mode==="dark");return[{id:"light",label:T("theme.groupLight"),items:b},{id:"dark",label:T("theme.groupDark"),items:F}].filter(x=>x.items.length)});function he(b){W(b)}function s(b){return T(`theme.description.${b.id}`,{},b.description)}return(b,F)=>(o(),c("div",Wt,[e("div",null,[e("div",Jt,[e("div",Kt,a(i(T)("theme.heading")),1),e("div",Gt,a(i(T)("theme.currentTheme",{name:i(O).shortName})),1)]),e("div",Qt,a(i(T)("theme.helper")),1)]),e("div",Xt,[(o(!0),c(se,null,ne(ge.value,x=>(o(),c("section",{key:x.id,class:"space-y-1.5"},[e("div",Yt,a(x.label),1),(o(!0),c(se,null,ne(x.items,y=>(o(),c("button",{key:y.id,type:"button",class:Xe(["theme-option theme-toggle-card w-full rounded-sm border px-3 py-2 text-left transition",y.id===i(O).id?"theme-option-active":"theme-option-idle"]),onClick:k=>he(y.id)},[e("div",es,[e("div",ts,[(o(!0),c(se,null,ne(y.swatches,(k,C)=>(o(),c("span",{key:`${y.id}-${C}`,class:"h-3 w-3 rounded-full border border-black/10",style:wt({backgroundColor:k})},null,4))),128))]),e("div",ss,[e("div",ns,[e("span",as,a(y.shortName),1),y.id===i(O).id?(o(),$(i(Pt),{key:0,class:"h-4 w-4 shrink-0"})):h("",!0)]),e("div",is,a(s(y)),1)])])],10,Zt))),128))]))),128))])]))}},os={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},rs={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},cs={key:0,class:"space-y-4"},us={class:"theme-heading text-base font-medium"},ds={class:"theme-muted-text mt-1 text-xs leading-5"},ms={class:"settings-section-card px-4 py-4"},gs={class:"settings-section-card space-y-4 px-4 py-4"},hs={class:"theme-heading text-sm font-medium"},vs={class:"theme-muted-text mt-1 text-xs leading-5"},ys={class:"block space-y-1.5"},xs={class:"theme-muted-text text-xs"},ps={class:"truncate text-sm text-[var(--theme-textPrimary)]"},_s=["onClick"],fs={class:"flex items-center justify-between gap-3"},bs={class:"min-w-0"},Ds={class:"truncate text-[var(--theme-textPrimary)]"},ks={class:"theme-muted-text mt-1 truncate text-xs"},Cs={key:0,class:"theme-status-success rounded-sm border border-dashed px-2 py-0.5 text-[10px]"},ws={class:"theme-muted-text theme-note-text"},Rs={key:1,class:"space-y-4"},Ts={class:"flex items-start justify-between gap-3"},Ss={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ms={class:"settings-section-card space-y-4 px-4 py-4"},Es={class:"settings-form-card flex items-center justify-between gap-3 px-3 py-2"},Ps={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},$s={class:"theme-muted-text mt-1 text-xs"},Us=["disabled"],Bs={class:"grid gap-4 sm:grid-cols-2"},js={class:"space-y-1.5 sm:col-span-2"},Ns={class:"theme-muted-text text-xs"},Fs=["disabled"],Ls={class:"space-y-1.5"},Is={class:"theme-muted-text text-xs"},qs=["disabled"],Vs={class:"space-y-1.5"},As={class:"theme-muted-text text-xs"},zs={class:"relative"},Hs=["type","placeholder","disabled"],Os=["disabled"],Ws={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},Js={class:"min-w-0 space-y-1"},Ks={key:0,class:"theme-danger-text theme-note-text"},Gs={key:1,class:"theme-status-warning theme-note-text"},Qs={key:2,class:"theme-danger-text theme-note-text"},Xs={key:3,class:"theme-status-success theme-note-text"},Ys={key:4,class:"theme-danger-text theme-note-text"},Zs={key:5,class:"theme-muted-text theme-note-text"},en={key:6,class:"theme-muted-text theme-note-text"},tn={key:7,class:"theme-muted-text theme-note-text"},sn={key:8,class:"theme-status-success theme-note-text"},nn={key:9,class:"theme-muted-text theme-note-text"},an={class:"flex flex-wrap items-center gap-2"},ln=["disabled"],on=["disabled"],rn=["disabled"],cn={key:2,class:"space-y-4"},un={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},dn={class:"theme-muted-text mt-1 text-xs leading-5"},mn={class:"settings-section-card space-y-4 px-4 py-4"},gn={class:"space-y-1.5"},hn={class:"theme-muted-text text-xs"},vn=["disabled"],yn={class:"theme-muted-text text-xs leading-5"},xn={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},pn={class:"min-w-0 space-y-1"},_n={key:0,class:"theme-status-warning theme-note-text"},fn={key:1,class:"theme-danger-text theme-note-text"},bn={key:2,class:"theme-status-success theme-note-text"},Dn={key:3,class:"theme-muted-text theme-note-text"},kn={class:"flex flex-wrap items-center gap-2"},Cn=["disabled"],wn={class:"settings-section-card space-y-4 px-4 py-4"},Rn={class:"flex flex-wrap items-start justify-between gap-3"},Tn={class:"theme-heading text-sm font-medium"},Sn={class:"theme-muted-text mt-1 text-xs leading-5"},Mn={class:"flex flex-wrap items-center gap-2"},En=["disabled"],Pn={class:"min-w-0 space-y-1"},$n={key:0,class:"theme-danger-text theme-note-text"},Un={key:1,class:"theme-status-success theme-note-text"},Bn={key:2,class:"theme-muted-text theme-note-text"},jn={key:0,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Nn={class:"settings-form-card space-y-1 px-3 py-3"},Fn={class:"theme-heading text-lg font-medium"},Ln={class:"theme-muted-text text-xs"},In={class:"settings-form-card space-y-1 px-3 py-3"},qn={class:"theme-heading text-lg font-medium"},Vn={class:"theme-muted-text text-xs"},An={class:"settings-form-card space-y-1 px-3 py-3"},zn={class:"theme-heading text-lg font-medium"},Hn={class:"theme-muted-text text-xs"},On={class:"settings-form-card space-y-1 px-3 py-3"},Wn={class:"theme-heading text-lg font-medium"},Jn={class:"theme-muted-text text-xs"},Kn={key:1,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Gn={class:"settings-form-card space-y-1 px-3 py-3"},Qn={class:"theme-heading text-lg font-medium"},Xn={class:"theme-muted-text text-xs"},Yn={class:"settings-form-card space-y-1 px-3 py-3"},Zn={class:"theme-heading text-lg font-medium"},ea={class:"theme-muted-text text-xs"},ta={class:"settings-form-card space-y-1 px-3 py-3"},sa={class:"theme-heading text-lg font-medium"},na={class:"theme-muted-text text-xs"},aa={class:"settings-form-card space-y-1 px-3 py-3"},ia={class:"theme-heading text-lg font-medium"},la={class:"theme-muted-text text-xs"},oa={key:2,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3"},ra={class:"settings-form-card space-y-1 px-3 py-3"},ca={class:"theme-heading text-lg font-medium"},ua={class:"theme-muted-text text-xs"},da={class:"settings-form-card space-y-1 px-3 py-3"},ma={class:"theme-heading text-lg font-medium"},ga={class:"theme-muted-text text-xs"},ha={class:"settings-form-card space-y-1 px-3 py-3"},va={class:"theme-heading text-sm font-medium"},ya={class:"theme-muted-text text-xs"},xa={class:"grid gap-4 lg:grid-cols-2"},pa={class:"settings-form-card space-y-3 px-3 py-3"},_a={class:"theme-heading text-sm font-medium"},fa={class:"space-y-2 text-xs"},ba={class:"flex items-center justify-between gap-3"},Da={class:"truncate text-right text-[var(--theme-textPrimary)]"},ka={class:"flex items-center justify-between gap-3"},Ca={class:"text-right text-[var(--theme-textPrimary)]"},wa={class:"flex items-center justify-between gap-3"},Ra={class:"text-right text-[var(--theme-textPrimary)]"},Ta={class:"flex items-center justify-between gap-3"},Sa={class:"text-right text-[var(--theme-textPrimary)]"},Ma={class:"flex items-center justify-between gap-3"},Ea={class:"text-right text-[var(--theme-textPrimary)]"},Pa={class:"settings-form-card space-y-3 px-3 py-3"},$a={class:"theme-heading text-sm font-medium"},Ua={class:"space-y-2 text-xs"},Ba={class:"theme-muted-text"},ja={class:"text-[var(--theme-textPrimary)]"},Na={key:3,class:"settings-form-card space-y-3 px-3 py-3"},Fa={class:"theme-heading text-sm font-medium"},La={class:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3 text-xs"},Ia={class:"theme-muted-text"},qa={class:"text-[var(--theme-textPrimary)]"},Va={key:4,class:"settings-form-card space-y-2 px-3 py-3"},Aa={class:"theme-heading text-sm font-medium"},za={class:"theme-muted-text text-xs leading-5"},Ha={class:"theme-muted-text text-xs leading-5"},Oa={key:3,class:"space-y-4"},Wa={class:"theme-heading text-base font-medium"},Ja={class:"theme-muted-text mt-1 text-xs leading-5"},Ka={class:"settings-section-card px-4 py-4"},Ga={class:"flex items-center justify-between gap-3"},Qa={class:"theme-heading text-sm font-medium"},Xa={class:"theme-muted-text mt-1 text-xs leading-5"},Ya={class:"theme-badge-strong rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium"},si={__name:"WorkbenchSettingsDialog",props:{open:{type:Boolean,default:!1}},emits:["close"],setup(U,{emit:O}){const W=U,ae=O,{locale:T,localeOptions:ge,setLocale:he,t:s}=Ye(),b=m(""),F=m(!1),x=m(""),y=m(!1),k=m(!1),C=m(!1),_=m(""),w=m(""),ie=m(!1),L=m(!1),I=m(""),J=m(""),q=m(!1),K=m(""),R=m(null),u=m(null),f=m(!1),V=pe({runnerMaxConcurrentRuns:!1}),G=m(!1),le=m(!1),oe=m(!1),re=m(!1),r=pe({enabled:!1,relayUrl:"",deviceId:"",deviceToken:""}),A=pe({runnerMaxConcurrentRuns:3}),S=m("theme");let B=null,j=null,ce=null;const Ze=v(()=>[{id:"theme",label:s("theme.title"),description:s("theme.sectionDescription"),icon:qt},{id:"relay",label:s("settingsDialog.relay.sectionLabel"),description:s("settingsDialog.relay.sectionDescription"),icon:Ge},{id:"system",label:s("settingsDialog.system.sectionLabel"),description:s("settingsDialog.system.sectionDescription"),icon:Ke},{id:"about",label:s("settingsDialog.about.sectionLabel"),description:s("settingsDialog.about.sectionDescription"),icon:Lt}]);function et(t=null,n=""){const l=String((t==null?void 0:t.messageKey)||"").trim();if(l){const g=s(l);if(g&&g!==l)return g}return String((t==null?void 0:t.message)||"").trim()||(n?s(n):"")}function ue(t="",n=""){const l=String(t||"").trim();if(l){const g=`settingsDialog.relay.reason.${l}`,D=s(g);if(D!==g)return D}return String(n||"").trim()||s("common.notAvailable")}function tt(t=null){const n=String((t==null?void 0:t.type)||"").trim()||"unknown",l=`settingsDialog.relay.event.${n}`,g=s(l);return g!==l?g:n}function st(t=null){const n=String((t==null?void 0:t.lastErrorKey)||"").trim(),l=t!=null&&t.lastErrorParams&&typeof t.lastErrorParams=="object"?t.lastErrorParams:{};return n==="connect_failed"?s("settingsDialog.relay.error.connect_failed"):n==="disconnected"?s("settingsDialog.relay.error.disconnected",{reason:ue(l.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="rejected"?s("settingsDialog.relay.error.rejected",{reason:ue(l.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="closed_with_code"?s("settingsDialog.relay.error.closedWithCode",{code:l.code||(t==null?void 0:t.lastCloseCode)||0}):String((t==null?void 0:t.lastError)||"").trim()}const nt=v(()=>{var t,n,l,g;return C.value?s("settingsDialog.relay.status.reconnecting"):k.value||G.value?s("settingsDialog.relay.status.saving"):y.value?s("settingsDialog.relay.status.loading"):(t=u.value)!=null&&t.reconnectPaused?s("settingsDialog.relay.status.paused"):(n=u.value)!=null&&n.connected?s("settingsDialog.relay.status.connected"):(((l=u.value)==null?void 0:l.enabled)??r.enabled)&&Number(((g=u.value)==null?void 0:g.nextReconnectDelayMs)||0)>0?s("settingsDialog.relay.status.waitingReconnect"):r.enabled?s("settingsDialog.relay.status.disconnected"):s("settingsDialog.relay.status.disabled")}),at=v(()=>{var t,n;return(t=u.value)!=null&&t.reconnectPaused?"theme-status-danger":(n=u.value)!=null&&n.connected?"theme-status-success":r.enabled?"theme-status-warning":"theme-status-neutral"}),it=v(()=>{var t,n,l;return!f.value&&!_.value&&!w.value&&!((t=u.value)!=null&&t.lastError)&&!((n=u.value)!=null&&n.lastCloseReason)&&!((l=u.value)!=null&&l.lastConnectedAt)}),lt=v(()=>{const t=r.deviceToken?`${"*".repeat(Math.max(0,r.deviceToken.length-4))}${r.deviceToken.slice(-4)}`:"";return JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceTokenMasked:t,managedByEnv:f.value},status:u.value||null},null,2)}),N=v(()=>{var t,n;return((n=(t=R.value)==null?void 0:t.runner)==null?void 0:n.runner)||null}),Q=v(()=>{var t,n;return!!((n=(t=R.value)==null?void 0:t.runner)!=null&&n.ok&&N.value)}),p=v(()=>{var t;return((t=N.value)==null?void 0:t.metrics)||null}),fe=v(()=>{var t;return((t=R.value)==null?void 0:t.recovery)||null}),be=v(()=>{var t;return((t=R.value)==null?void 0:t.maintenance)||null}),ot=v(()=>{var t;return((t=R.value)==null?void 0:t.gitDiffWorker)||null}),rt=v(()=>JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{runner:{maxConcurrentRuns:A.runnerMaxConcurrentRuns,managedByEnv:V.runnerMaxConcurrentRuns}},diagnostics:R.value||null},null,2));function X(t){const n=String(t||"").trim();if(!n)return s("common.notAvailable");const l=new Date(n);return Number.isNaN(l.getTime())?n:Et(l.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const ct=v(()=>{var t,n,l,g,D,M,E,P;return[{key:"queued_cancelled",label:s("settingsDialog.system.stopReasons.queued_cancelled"),value:Math.max(0,Number((n=(t=p.value)==null?void 0:t.stopReasons)==null?void 0:n.queued_cancelled)||0)},{key:"user_requested",label:s("settingsDialog.system.stopReasons.user_requested"),value:Math.max(0,Number((g=(l=p.value)==null?void 0:l.stopReasons)==null?void 0:g.user_requested)||0)},{key:"user_requested_after_error",label:s("settingsDialog.system.stopReasons.user_requested_after_error"),value:Math.max(0,Number((M=(D=p.value)==null?void 0:D.stopReasons)==null?void 0:M.user_requested_after_error)||0)},{key:"stop_timeout",label:s("settingsDialog.system.stopReasons.stop_timeout"),value:Math.max(0,Number((P=(E=p.value)==null?void 0:E.stopReasons)==null?void 0:P.stop_timeout)||0)}]}),ut=v(()=>{var t,n,l,g,D,M,E,P,Z,ee;return[{key:"runner_timeout_without_stop_request",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_without_stop_request"),value:Math.max(0,Number((n=(t=p.value)==null?void 0:t.stopTimeoutPhases)==null?void 0:n.runner_timeout_without_stop_request)||0)},{key:"runner_timeout_before_cancel",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_before_cancel"),value:Math.max(0,Number((g=(l=p.value)==null?void 0:l.stopTimeoutPhases)==null?void 0:g.runner_timeout_before_cancel)||0)},{key:"cli_not_exiting",label:s("settingsDialog.system.stopTimeoutPhases.cli_not_exiting"),value:Math.max(0,Number((M=(D=p.value)==null?void 0:D.stopTimeoutPhases)==null?void 0:M.cli_not_exiting)||0)},{key:"os_kill_slow",label:s("settingsDialog.system.stopTimeoutPhases.os_kill_slow"),value:Math.max(0,Number((P=(E=p.value)==null?void 0:E.stopTimeoutPhases)==null?void 0:P.os_kill_slow)||0)},{key:"runner_finalize_after_exit",label:s("settingsDialog.system.stopTimeoutPhases.runner_finalize_after_exit"),value:Math.max(0,Number((ee=(Z=p.value)==null?void 0:Z.stopTimeoutPhases)==null?void 0:ee.runner_finalize_after_exit)||0)}]}),dt=v(()=>ge.value.map(t=>({value:t.value,label:t.value==="zh-CN"?s("locale.zhHans"):s("locale.enUs"),englishLabel:t.englishLabel})));async function mt(){F.value=!0,x.value="";try{const t=await It(),n=String((t==null?void 0:t.version)||"").trim();b.value=n,n||(x.value=s("settingsDialog.about.versionPending"))}catch(t){b.value="",x.value=(t==null?void 0:t.message)||s("settingsDialog.about.versionLoadFailed")}finally{F.value=!1}}function ve(t={}){r.enabled=!!(t!=null&&t.enabled),r.relayUrl=String((t==null?void 0:t.relayUrl)||""),r.deviceId=String((t==null?void 0:t.deviceId)||""),r.deviceToken=String((t==null?void 0:t.deviceToken)||"")}function De(t={}){var n;A.runnerMaxConcurrentRuns=Math.max(1,Number((n=t==null?void 0:t.runner)==null?void 0:n.maxConcurrentRuns)||3)}async function ke(){y.value=!0,_.value="",w.value="";try{const t=await Vt();ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigLoadFailed"),u.value=null}finally{y.value=!1}}async function gt(){var t,n;ie.value=!0,I.value="",J.value="";try{const l=await zt();De((l==null?void 0:l.config)||{}),V.runnerMaxConcurrentRuns=!!((n=(t=l==null?void 0:l.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),Y()}catch(l){I.value=(l==null?void 0:l.message)||s("settingsDialog.system.systemConfigLoadFailed")}finally{ie.value=!1}}async function Y(){q.value=!0,K.value="";try{R.value=await Ot()}catch(t){K.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsLoadFailed")}finally{q.value=!1}}async function ht(){k.value=!0,_.value="",w.value="";try{const t=await Qe({enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceToken:r.deviceToken});ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null,w.value=r.enabled?s("settingsDialog.relay.relayConfigSavedEnabled"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigSaveFailed")}finally{k.value=!1}}async function vt(){C.value=!0,_.value="",w.value="";try{const t=await At();u.value=(t==null?void 0:t.relay)||null,w.value=s("settingsDialog.relay.relayReconnectTriggered"),setTimeout(()=>{ke()},1200)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayReconnectFailed")}finally{C.value=!1}}async function yt(){var t,n;L.value=!0,I.value="",J.value="";try{const l=await Ht({runner:{maxConcurrentRuns:A.runnerMaxConcurrentRuns}});De((l==null?void 0:l.config)||{}),V.runnerMaxConcurrentRuns=!!((n=(t=l==null?void 0:l.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),J.value=s("settingsDialog.system.systemConfigSaved"),Y()}catch(l){I.value=(l==null?void 0:l.message)||s("settingsDialog.system.systemConfigSaveFailed")}finally{L.value=!1}}function xt(){return!!(String(r.relayUrl||"").trim()&&String(r.deviceId||"").trim()&&String(r.deviceToken||"").trim())}async function pt(){var t;if(!f.value){if(_.value="",w.value="",r.enabled&&!xt()){r.enabled=!1,_.value=s("settingsDialog.relay.relayFieldsRequired");return}G.value=!0;try{const n=await Qe({enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceToken:r.deviceToken});ve((n==null?void 0:n.config)||{}),f.value=!!(n!=null&&n.managedByEnv),u.value=(n==null?void 0:n.relay)||null,w.value=r.enabled?s("settingsDialog.relay.relayEnabledSaved"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(n){r.enabled=!!((t=u.value)!=null&&t.enabled),_.value=(n==null?void 0:n.message)||s("settingsDialog.relay.relayToggleFailed")}finally{G.value=!1}}}async function Ce(t){var l;if((l=navigator.clipboard)!=null&&l.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}async function _t(){try{await Ce(lt.value),oe.value=!0,B&&clearTimeout(B),B=setTimeout(()=>{oe.value=!1,B=null},2e3)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayDiagnosticsCopyFailed")}}async function ft(){try{await Ce(rt.value),re.value=!0,j&&clearTimeout(j),j=setTimeout(()=>{re.value=!1,j=null},2e3)}catch(t){K.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsCopyFailed")}}function bt(t){he(t)}function ye(){ce&&(clearInterval(ce),ce=null)}function Dt(){ye(),!(!W.open||S.value!=="system")&&(Y(),ce=setInterval(()=>{Y()},5e3))}return Je(()=>W.open,t=>{if(t){S.value="theme",mt(),ke(),gt();return}},{immediate:!0}),Je([()=>W.open,S],([t,n])=>{if(t&&n==="system"){Dt();return}ye()},{immediate:!0}),Tt(()=>{B&&(clearTimeout(B),B=null),j&&(clearTimeout(j),j=null),ye()}),(t,n)=>(o(),$(Ft,{open:U.open,"backdrop-class":"z-[70] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-[42rem] sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row",onClose:n[7]||(n[7]=l=>ae("close"))},{title:de(()=>[e("div",os,[z(i(Nt),{class:"h-4 w-4"}),e("span",null,a(i(s)("common.settings")),1)])]),default:de(()=>{var l,g,D,M,E,P,Z,ee,we,Re,Te,Se,Me,Ee,Pe,$e,Ue,Be,je,Ne,Fe,Le,Ie,qe,Ve,Ae,ze,He,Oe,We;return[z($t,{modelValue:S.value,"onUpdate:modelValue":n[0]||(n[0]=d=>S.value=d),sections:Ze.value},null,8,["modelValue","sections"]),e("div",rs,[S.value==="theme"?(o(),c("section",cs,[e("div",null,[e("div",us,a(i(s)("theme.title")),1),e("p",ds,a(i(s)("theme.sectionDescription")),1)]),e("section",ms,[z(ls)]),e("section",gs,[e("div",null,[e("div",hs,a(i(s)("locale.title")),1),e("p",vs,a(i(s)("locale.description")),1)]),e("label",ys,[e("span",xs,a(i(s)("locale.field")),1),z(Ut,{"model-value":i(T),options:dt.value,"get-option-value":d=>d.value,"onUpdate:modelValue":bt},{trigger:de(({selectedOption:d})=>[e("div",ps,a((d==null?void 0:d.label)||i(s)("common.select")),1)]),option:de(({option:d,selected:kt,select:Ct})=>[e("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:Za=>Ct()},[e("div",fs,[e("div",bs,[e("div",Ds,a(d.label),1),e("div",ks,a(d.englishLabel),1)]),kt?(o(),c("span",Cs,a(i(s)("common.enabled")),1)):h("",!0)])],8,_s)]),_:1},8,["model-value","options","get-option-value"])]),e("p",ws,a(i(s)("locale.immediateHint")),1)])])):S.value==="relay"?(o(),c("section",Rs,[e("div",Ts,[e("div",null,[e("div",Ss,[z(i(Ge),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.relay.title")),1)])]),e("span",{class:Xe(["rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium",at.value])},a(nt.value),3)]),e("section",Ms,[e("label",Es,[e("div",null,[e("div",Ps,a(i(s)("settingsDialog.relay.enableTitle")),1),e("p",$s,a(i(s)("settingsDialog.relay.enableDescription")),1)]),te(e("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>r.enabled=d),type:"checkbox",class:"h-4 w-4",disabled:f.value,onChange:pt},null,40,Us),[[St,r.enabled]])]),e("div",Bs,[e("label",js,[e("span",Ns,a(i(s)("settingsDialog.relay.relayUrl")),1),te(e("input",{"onUpdate:modelValue":n[2]||(n[2]=d=>r.relayUrl=d),type:"text",placeholder:"https://user1.promptx.example.com",class:"tool-input",disabled:f.value},null,8,Fs),[[xe,r.relayUrl]])]),e("label",Ls,[e("span",Is,a(i(s)("settingsDialog.relay.deviceId")),1),te(e("input",{"onUpdate:modelValue":n[3]||(n[3]=d=>r.deviceId=d),type:"text",placeholder:"my-macbook",class:"tool-input",disabled:f.value},null,8,qs),[[xe,r.deviceId]])]),e("label",Vs,[e("span",As,a(i(s)("settingsDialog.relay.deviceToken")),1),e("div",zs,[te(e("input",{"onUpdate:modelValue":n[4]||(n[4]=d=>r.deviceToken=d),type:le.value?"text":"password",placeholder:i(s)("settingsDialog.relay.deviceTokenPlaceholder"),class:"tool-input pr-10",disabled:f.value},null,8,Hs),[[Mt,r.deviceToken]]),e("button",{type:"button",class:"theme-icon-button absolute inset-y-1 right-1 flex h-auto w-8 items-center justify-center",disabled:f.value,onClick:n[5]||(n[5]=d=>le.value=!le.value)},[le.value?(o(),$(i(jt),{key:1,class:"h-4 w-4"})):(o(),$(i(Bt),{key:0,class:"h-4 w-4"}))],8,Os)])])]),e("div",Ws,[e("div",Js,[(l=u.value)!=null&&l.reconnectPausedReason?(o(),c("p",Ks,a(i(s)("settingsDialog.relay.pausedReconnect",{reason:ue(u.value.reconnectPausedReasonCode,u.value.reconnectPausedReason)})),1)):h("",!0),f.value?(o(),c("p",Gs,a(i(s)("settingsDialog.relay.managedByEnv")),1)):h("",!0),_.value?(o(),c("p",Qs,a(_.value),1)):w.value?(o(),c("p",Xs,a(w.value),1)):(g=u.value)!=null&&g.lastError?(o(),c("p",Ys,a(i(s)("settingsDialog.relay.lastError",{value:st(u.value)})),1)):(D=u.value)!=null&&D.lastCloseReason?(o(),c("p",Zs,a(i(s)("settingsDialog.relay.lastClosed",{reason:ue(u.value.lastCloseReasonCode,u.value.lastCloseReason),code:u.value.lastCloseCode})),1)):(M=u.value)!=null&&M.lastConnectedAt?(o(),c("p",en,a(i(s)("settingsDialog.relay.lastConnected",{value:X(u.value.lastConnectedAt)})),1)):h("",!0),(P=(E=u.value)==null?void 0:E.recentEvents)!=null&&P.length?(o(),c("p",tn,a(i(s)("settingsDialog.relay.recentEvent",{value:tt(u.value.recentEvents[0])})),1)):h("",!0),oe.value?(o(),c("p",sn,a(i(s)("settingsDialog.relay.copied")),1)):h("",!0),it.value?(o(),c("p",nn,a(i(s)("settingsDialog.relay.defaultHint")),1)):h("",!0)]),e("div",an,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||k.value||G.value||C.value||!(((Z=u.value)==null?void 0:Z.enabled)??r.enabled),onClick:vt},[C.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(C.value?i(s)("settingsDialog.relay.reconnecting"):i(s)("settingsDialog.relay.reconnectNow")),1)],8,ln),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||C.value,onClick:_t},[e("span",null,a(oe.value?i(s)("settingsDialog.relay.diagnosticsCopied"):i(s)("settingsDialog.relay.copyDiagnostics")),1)],8,on),e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||k.value||G.value||C.value||f.value,onClick:ht},[k.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(k.value?i(s)("common.saving"):i(s)("settingsDialog.relay.saveConfig")),1)],8,rn)])])])])):S.value==="system"?(o(),c("section",cn,[e("div",null,[e("div",un,[z(i(Ke),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.system.title")),1)]),e("p",dn,a(i(s)("settingsDialog.system.intro")),1)]),e("section",mn,[e("label",gn,[e("span",hn,a(i(s)("settingsDialog.system.maxConcurrentRuns")),1),te(e("input",{"onUpdate:modelValue":n[6]||(n[6]=d=>A.runnerMaxConcurrentRuns=d),type:"number",min:"1",max:"16",step:"1",class:"tool-input",disabled:V.runnerMaxConcurrentRuns||ie.value||L.value},null,8,vn),[[xe,A.runnerMaxConcurrentRuns,void 0,{number:!0}]]),e("p",yn,a(i(s)("settingsDialog.system.maxConcurrentRunsHint")),1)]),e("div",xn,[e("div",pn,[V.runnerMaxConcurrentRuns?(o(),c("p",_n,a(i(s)("settingsDialog.system.managedByEnv")),1)):I.value?(o(),c("p",fn,a(I.value),1)):J.value?(o(),c("p",bn,a(J.value),1)):(o(),c("p",Dn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),e("div",kn,[e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:V.runnerMaxConcurrentRuns||ie.value||L.value,onClick:yt},[L.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(L.value?i(s)("common.saving"):i(s)("settingsDialog.system.saveConfig")),1)],8,Cn)])])]),e("section",wn,[e("div",Rn,[e("div",null,[e("div",Tn,a(i(s)("settingsDialog.system.runtimeDiagnostics")),1),e("p",Sn,a(i(s)("settingsDialog.system.runtimeDiagnosticsHint")),1)]),e("div",Mn,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:q.value,onClick:Y},[q.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(q.value?i(s)("settingsDialog.system.refreshingDiagnostics"):i(s)("settingsDialog.system.refreshDiagnostics")),1)],8,En),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:ft},[e("span",null,a(re.value?i(s)("settingsDialog.system.diagnosticsCopied"):i(s)("settingsDialog.system.copyDiagnostics")),1)])])]),e("div",Pn,[K.value?(o(),c("p",$n,a(K.value),1)):re.value?(o(),c("p",Un,a(i(s)("settingsDialog.system.diagnosticsCopiedHint")),1)):(o(),c("p",Bn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),Q.value?(o(),c("div",jn,[e("div",Nn,[n[8]||(n[8]=e("div",{class:"theme-muted-text text-xs"},"active",-1)),e("div",Fn,a(((ee=N.value)==null?void 0:ee.activeRunCount)||0),1),e("p",Ln,a(i(s)("settingsDialog.system.active")),1)]),e("div",In,[n[9]||(n[9]=e("div",{class:"theme-muted-text text-xs"},"tracked",-1)),e("div",qn,a(((we=N.value)==null?void 0:we.trackedRunCount)||0),1),e("p",Vn,a(i(s)("settingsDialog.system.tracked")),1)]),e("div",An,[n[10]||(n[10]=e("div",{class:"theme-muted-text text-xs"},"queued",-1)),e("div",zn,a(((Re=N.value)==null?void 0:Re.queuedRunCount)||0),1),e("p",Hn,a(i(s)("settingsDialog.system.queued")),1)]),e("div",On,[n[11]||(n[11]=e("div",{class:"theme-muted-text text-xs"},"maxConcurrent",-1)),e("div",Wn,a(((Se=(Te=N.value)==null?void 0:Te.config)==null?void 0:Se.maxConcurrentRuns)||A.runnerMaxConcurrentRuns),1),e("p",Jn,a(i(s)("settingsDialog.system.maxConcurrent")),1)])])):h("",!0),Q.value?(o(),c("div",Kn,[e("div",Gn,[n[12]||(n[12]=e("div",{class:"theme-muted-text text-xs"},"completed",-1)),e("div",Qn,a(((Me=p.value)==null?void 0:Me.totalCompleted)||0),1),e("p",Xn,a(i(s)("settingsDialog.system.completed")),1)]),e("div",Yn,[n[13]||(n[13]=e("div",{class:"theme-muted-text text-xs"},"stopped",-1)),e("div",Zn,a(((Ee=p.value)==null?void 0:Ee.totalStopped)||0),1),e("p",ea,a(i(s)("settingsDialog.system.stopped")),1)]),e("div",ta,[n[14]||(n[14]=e("div",{class:"theme-muted-text text-xs"},"error",-1)),e("div",sa,a(((Pe=p.value)==null?void 0:Pe.totalErrored)||0),1),e("p",na,a(i(s)("settingsDialog.system.error")),1)]),e("div",aa,[n[15]||(n[15]=e("div",{class:"theme-muted-text text-xs"},"stop_timeout",-1)),e("div",ia,a((($e=p.value)==null?void 0:$e.totalStopTimeout)||0),1),e("p",la,a(i(s)("settingsDialog.system.stopTimeout")),1)])])):h("",!0),Q.value?(o(),c("div",oa,[e("div",ra,[n[16]||(n[16]=e("div",{class:"theme-muted-text text-xs"},"event flush failures",-1)),e("div",ca,a(((Ue=p.value)==null?void 0:Ue.eventFlushFailureCount)||0),1),e("p",ua,a(i(s)("settingsDialog.system.eventWriteFailures")),1)]),e("div",da,[n[17]||(n[17]=e("div",{class:"theme-muted-text text-xs"},"recovered runs",-1)),e("div",ma,a(((je=(Be=fe.value)==null?void 0:Be.metrics)==null?void 0:je.totalRecovered)||0),1),e("p",ga,a(i(s)("settingsDialog.system.recoveredRuns")),1)]),e("div",ha,[n[18]||(n[18]=e("div",{class:"theme-muted-text text-xs"},"last cleanup",-1)),e("div",va,a(X((Fe=(Ne=be.value)==null?void 0:Ne.lastCleanup)==null?void 0:Fe.finishedAt)),1),e("p",ya,a(i(s)("settingsDialog.system.lastMaintenanceAt")),1)])])):h("",!0),e("div",xa,[e("div",pa,[e("div",_a,a(i(s)("settingsDialog.system.baseStatus")),1),e("div",fa,[e("div",ba,[n[19]||(n[19]=e("span",{class:"theme-muted-text"},"runner baseUrl",-1)),e("span",Da,a(((Ie=(Le=R.value)==null?void 0:Le.runner)==null?void 0:Ie.baseUrl)||"-"),1)]),e("div",ka,[n[20]||(n[20]=e("span",{class:"theme-muted-text"},"runner startedAt",-1)),e("span",Ca,a(X((qe=N.value)==null?void 0:qe.startedAt)),1)]),e("div",wa,[n[21]||(n[21]=e("span",{class:"theme-muted-text"},"last sweep",-1)),e("span",Ra,a(X((Ae=(Ve=fe.value)==null?void 0:Ve.metrics)==null?void 0:Ae.lastSweepFinishedAt)),1)]),e("div",Ta,[n[22]||(n[22]=e("span",{class:"theme-muted-text"},"git diff worker",-1)),e("span",Sa,a(ot.value?i(s)("settingsDialog.system.available"):i(s)("settingsDialog.system.unknown")),1)]),e("div",Ma,[n[23]||(n[23]=e("span",{class:"theme-muted-text"},"db vacuum",-1)),e("span",Ea,a(X((ze=be.value)==null?void 0:ze.lastVacuumAt)),1)])])]),e("div",Pa,[e("div",$a,a(i(s)("settingsDialog.system.stopReasonTitle")),1),e("div",Ua,[(o(!0),c(se,null,ne(ct.value,d=>(o(),c("div",{key:d.key,class:"flex items-center justify-between gap-3"},[e("span",Ba,a(d.label),1),e("span",ja,a(d.value),1)]))),128))])])]),Q.value?(o(),c("div",Na,[e("div",Fa,a(i(s)("settingsDialog.system.stopTimeoutPhaseTitle")),1),e("div",La,[(o(!0),c(se,null,ne(ut.value,d=>(o(),c("div",{key:d.key,class:"flex items-center justify-between gap-3 rounded-sm border border-dashed border-[var(--theme-borderMuted)] px-2.5 py-2"},[e("span",Ia,a(d.label),1),e("span",qa,a(d.value),1)]))),128))])])):h("",!0),!Q.value&&!q.value?(o(),c("div",Va,[e("div",Aa,a(i(s)("settingsDialog.system.runnerUnavailable")),1),e("p",za,a(et((He=R.value)==null?void 0:He.runner,"settingsDialog.system.runnerUnavailableDescription")),1),e("p",Ha," baseUrl: "+a(((We=(Oe=R.value)==null?void 0:Oe.runner)==null?void 0:We.baseUrl)||"-"),1)])):h("",!0)])])):(o(),c("section",Oa,[e("div",null,[e("div",Wa,a(i(s)("settingsDialog.about.title")),1),e("p",Ja,a(i(s)("settingsDialog.about.intro")),1)]),e("section",Ka,[e("div",Ga,[e("div",null,[e("div",Qa,a(i(s)("settingsDialog.about.versionTitle")),1),e("p",Xa,a(x.value||i(s)("settingsDialog.about.versionDescription")),1)]),e("span",Ya,a(F.value?i(s)("common.loading"):b.value?`v${b.value}`:i(s)("common.unavailable")),1)])])]))])]}),_:1},8,["open"]))}};export{si as default};
|
|
16
|
+
*/const Ge=_e("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);function At(){return H("/api/relay/config",{cache:"no-store"})}function Qe(U){return H("/api/relay/config",{method:"PUT",body:JSON.stringify(U)})}function Vt(){return H("/api/relay/reconnect",{method:"POST"})}function zt(){return H("/api/system/config",{cache:"no-store"})}function Ht(U){return H("/api/system/config",{method:"PUT",body:JSON.stringify(U)})}function Ot(){return H("/api/diagnostics/runtime",{cache:"no-store"})}const Wt={class:"space-y-4"},Jt={class:"flex items-center justify-between gap-3"},Kt={class:"theme-heading text-sm font-medium"},Gt={class:"theme-toggle-current theme-badge-muted theme-muted-text rounded-sm border border-dashed px-2 py-1 text-[11px]"},Qt={class:"theme-muted-text theme-note-text mt-1"},Xt={class:"space-y-4"},Yt={class:"theme-muted-text px-1 text-[10px] font-medium uppercase tracking-[0.16em]"},Zt=["onClick"],es={class:"flex items-start gap-3"},ts={class:"mt-0.5 flex items-center gap-1.5"},ss={class:"min-w-0 flex-1"},ns={class:"flex items-center justify-between gap-2"},as={class:"truncate text-sm font-medium"},is={class:"theme-muted-text theme-note-text mt-1"},ls={__name:"ThemeToggle",setup(U){const{currentTheme:O,setTheme:W,themes:ae}=Rt(),{t:T}=Ye(),ge=v(()=>{const b=ae.value.filter(x=>x.mode==="light"),F=ae.value.filter(x=>x.mode==="dark");return[{id:"light",label:T("theme.groupLight"),items:b},{id:"dark",label:T("theme.groupDark"),items:F}].filter(x=>x.items.length)});function he(b){W(b)}function s(b){return T(`theme.description.${b.id}`,{},b.description)}return(b,F)=>(o(),c("div",Wt,[e("div",null,[e("div",Jt,[e("div",Kt,a(i(T)("theme.heading")),1),e("div",Gt,a(i(T)("theme.currentTheme",{name:i(O).shortName})),1)]),e("div",Qt,a(i(T)("theme.helper")),1)]),e("div",Xt,[(o(!0),c(se,null,ne(ge.value,x=>(o(),c("section",{key:x.id,class:"space-y-1.5"},[e("div",Yt,a(x.label),1),(o(!0),c(se,null,ne(x.items,y=>(o(),c("button",{key:y.id,type:"button",class:Xe(["theme-option theme-toggle-card w-full rounded-sm border px-3 py-2 text-left transition",y.id===i(O).id?"theme-option-active":"theme-option-idle"]),onClick:k=>he(y.id)},[e("div",es,[e("div",ts,[(o(!0),c(se,null,ne(y.swatches,(k,C)=>(o(),c("span",{key:`${y.id}-${C}`,class:"h-3 w-3 rounded-full border border-black/10",style:wt({backgroundColor:k})},null,4))),128))]),e("div",ss,[e("div",ns,[e("span",as,a(y.shortName),1),y.id===i(O).id?(o(),$(i(Pt),{key:0,class:"h-4 w-4 shrink-0"})):h("",!0)]),e("div",is,a(s(y)),1)])])],10,Zt))),128))]))),128))])]))}},os={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},rs={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},cs={key:0,class:"space-y-4"},us={class:"theme-heading text-base font-medium"},ds={class:"theme-muted-text mt-1 text-xs leading-5"},ms={class:"settings-section-card px-4 py-4"},gs={class:"settings-section-card space-y-4 px-4 py-4"},hs={class:"theme-heading text-sm font-medium"},vs={class:"theme-muted-text mt-1 text-xs leading-5"},ys={class:"block space-y-1.5"},xs={class:"theme-muted-text text-xs"},ps={class:"truncate text-sm text-[var(--theme-textPrimary)]"},_s=["onClick"],fs={class:"flex items-center justify-between gap-3"},bs={class:"min-w-0"},Ds={class:"truncate text-[var(--theme-textPrimary)]"},ks={class:"theme-muted-text mt-1 truncate text-xs"},Cs={key:0,class:"theme-status-success rounded-sm border border-dashed px-2 py-0.5 text-[10px]"},ws={class:"theme-muted-text theme-note-text"},Rs={key:1,class:"space-y-4"},Ts={class:"flex items-start justify-between gap-3"},Ss={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ms={class:"settings-section-card space-y-4 px-4 py-4"},Es={class:"settings-form-card flex items-center justify-between gap-3 px-3 py-2"},Ps={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},$s={class:"theme-muted-text mt-1 text-xs"},Us=["disabled"],Bs={class:"grid gap-4 sm:grid-cols-2"},js={class:"space-y-1.5 sm:col-span-2"},Ns={class:"theme-muted-text text-xs"},Fs=["disabled"],Ls={class:"space-y-1.5"},Is={class:"theme-muted-text text-xs"},qs=["disabled"],As={class:"space-y-1.5"},Vs={class:"theme-muted-text text-xs"},zs={class:"relative"},Hs=["type","placeholder","disabled"],Os=["disabled"],Ws={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},Js={class:"min-w-0 space-y-1"},Ks={key:0,class:"theme-danger-text theme-note-text"},Gs={key:1,class:"theme-status-warning theme-note-text"},Qs={key:2,class:"theme-danger-text theme-note-text"},Xs={key:3,class:"theme-status-success theme-note-text"},Ys={key:4,class:"theme-danger-text theme-note-text"},Zs={key:5,class:"theme-muted-text theme-note-text"},en={key:6,class:"theme-muted-text theme-note-text"},tn={key:7,class:"theme-muted-text theme-note-text"},sn={key:8,class:"theme-status-success theme-note-text"},nn={key:9,class:"theme-muted-text theme-note-text"},an={class:"flex flex-wrap items-center gap-2"},ln=["disabled"],on=["disabled"],rn=["disabled"],cn={key:2,class:"space-y-4"},un={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},dn={class:"theme-muted-text mt-1 text-xs leading-5"},mn={class:"settings-section-card space-y-4 px-4 py-4"},gn={class:"space-y-1.5"},hn={class:"theme-muted-text text-xs"},vn=["disabled"],yn={class:"theme-muted-text text-xs leading-5"},xn={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},pn={class:"min-w-0 space-y-1"},_n={key:0,class:"theme-status-warning theme-note-text"},fn={key:1,class:"theme-danger-text theme-note-text"},bn={key:2,class:"theme-status-success theme-note-text"},Dn={key:3,class:"theme-muted-text theme-note-text"},kn={class:"flex flex-wrap items-center gap-2"},Cn=["disabled"],wn={class:"settings-section-card space-y-4 px-4 py-4"},Rn={class:"flex flex-wrap items-start justify-between gap-3"},Tn={class:"theme-heading text-sm font-medium"},Sn={class:"theme-muted-text mt-1 text-xs leading-5"},Mn={class:"flex flex-wrap items-center gap-2"},En=["disabled"],Pn={class:"min-w-0 space-y-1"},$n={key:0,class:"theme-danger-text theme-note-text"},Un={key:1,class:"theme-status-success theme-note-text"},Bn={key:2,class:"theme-muted-text theme-note-text"},jn={key:0,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Nn={class:"settings-form-card space-y-1 px-3 py-3"},Fn={class:"theme-heading text-lg font-medium"},Ln={class:"theme-muted-text text-xs"},In={class:"settings-form-card space-y-1 px-3 py-3"},qn={class:"theme-heading text-lg font-medium"},An={class:"theme-muted-text text-xs"},Vn={class:"settings-form-card space-y-1 px-3 py-3"},zn={class:"theme-heading text-lg font-medium"},Hn={class:"theme-muted-text text-xs"},On={class:"settings-form-card space-y-1 px-3 py-3"},Wn={class:"theme-heading text-lg font-medium"},Jn={class:"theme-muted-text text-xs"},Kn={key:1,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Gn={class:"settings-form-card space-y-1 px-3 py-3"},Qn={class:"theme-heading text-lg font-medium"},Xn={class:"theme-muted-text text-xs"},Yn={class:"settings-form-card space-y-1 px-3 py-3"},Zn={class:"theme-heading text-lg font-medium"},ea={class:"theme-muted-text text-xs"},ta={class:"settings-form-card space-y-1 px-3 py-3"},sa={class:"theme-heading text-lg font-medium"},na={class:"theme-muted-text text-xs"},aa={class:"settings-form-card space-y-1 px-3 py-3"},ia={class:"theme-heading text-lg font-medium"},la={class:"theme-muted-text text-xs"},oa={key:2,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3"},ra={class:"settings-form-card space-y-1 px-3 py-3"},ca={class:"theme-heading text-lg font-medium"},ua={class:"theme-muted-text text-xs"},da={class:"settings-form-card space-y-1 px-3 py-3"},ma={class:"theme-heading text-lg font-medium"},ga={class:"theme-muted-text text-xs"},ha={class:"settings-form-card space-y-1 px-3 py-3"},va={class:"theme-heading text-sm font-medium"},ya={class:"theme-muted-text text-xs"},xa={class:"grid gap-4 lg:grid-cols-2"},pa={class:"settings-form-card space-y-3 px-3 py-3"},_a={class:"theme-heading text-sm font-medium"},fa={class:"space-y-2 text-xs"},ba={class:"flex items-center justify-between gap-3"},Da={class:"truncate text-right text-[var(--theme-textPrimary)]"},ka={class:"flex items-center justify-between gap-3"},Ca={class:"text-right text-[var(--theme-textPrimary)]"},wa={class:"flex items-center justify-between gap-3"},Ra={class:"text-right text-[var(--theme-textPrimary)]"},Ta={class:"flex items-center justify-between gap-3"},Sa={class:"text-right text-[var(--theme-textPrimary)]"},Ma={class:"flex items-center justify-between gap-3"},Ea={class:"text-right text-[var(--theme-textPrimary)]"},Pa={class:"settings-form-card space-y-3 px-3 py-3"},$a={class:"theme-heading text-sm font-medium"},Ua={class:"space-y-2 text-xs"},Ba={class:"theme-muted-text"},ja={class:"text-[var(--theme-textPrimary)]"},Na={key:3,class:"settings-form-card space-y-3 px-3 py-3"},Fa={class:"theme-heading text-sm font-medium"},La={class:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3 text-xs"},Ia={class:"theme-muted-text"},qa={class:"text-[var(--theme-textPrimary)]"},Aa={key:4,class:"settings-form-card space-y-2 px-3 py-3"},Va={class:"theme-heading text-sm font-medium"},za={class:"theme-muted-text text-xs leading-5"},Ha={class:"theme-muted-text text-xs leading-5"},Oa={key:3,class:"space-y-4"},Wa={class:"theme-heading text-base font-medium"},Ja={class:"theme-muted-text mt-1 text-xs leading-5"},Ka={class:"settings-section-card px-4 py-4"},Ga={class:"flex items-center justify-between gap-3"},Qa={class:"theme-heading text-sm font-medium"},Xa={class:"theme-muted-text mt-1 text-xs leading-5"},Ya={class:"theme-badge-strong rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium"},si={__name:"WorkbenchSettingsDialog",props:{open:{type:Boolean,default:!1}},emits:["close"],setup(U,{emit:O}){const W=U,ae=O,{locale:T,localeOptions:ge,setLocale:he,t:s}=Ye(),b=m(""),F=m(!1),x=m(""),y=m(!1),k=m(!1),C=m(!1),_=m(""),w=m(""),ie=m(!1),L=m(!1),I=m(""),J=m(""),q=m(!1),K=m(""),R=m(null),u=m(null),f=m(!1),A=pe({runnerMaxConcurrentRuns:!1}),G=m(!1),le=m(!1),oe=m(!1),re=m(!1),r=pe({enabled:!1,relayUrl:"",deviceId:"",deviceToken:""}),V=pe({runnerMaxConcurrentRuns:3}),S=m("theme");let B=null,j=null,ce=null;const Ze=v(()=>[{id:"theme",label:s("theme.title"),description:s("theme.sectionDescription"),icon:qt},{id:"relay",label:s("settingsDialog.relay.sectionLabel"),description:s("settingsDialog.relay.sectionDescription"),icon:Ge},{id:"system",label:s("settingsDialog.system.sectionLabel"),description:s("settingsDialog.system.sectionDescription"),icon:Ke},{id:"about",label:s("settingsDialog.about.sectionLabel"),description:s("settingsDialog.about.sectionDescription"),icon:Lt}]);function et(t=null,n=""){const l=String((t==null?void 0:t.messageKey)||"").trim();if(l){const g=s(l);if(g&&g!==l)return g}return String((t==null?void 0:t.message)||"").trim()||(n?s(n):"")}function ue(t="",n=""){const l=String(t||"").trim();if(l){const g=`settingsDialog.relay.reason.${l}`,D=s(g);if(D!==g)return D}return String(n||"").trim()||s("common.notAvailable")}function tt(t=null){const n=String((t==null?void 0:t.type)||"").trim()||"unknown",l=`settingsDialog.relay.event.${n}`,g=s(l);return g!==l?g:n}function st(t=null){const n=String((t==null?void 0:t.lastErrorKey)||"").trim(),l=t!=null&&t.lastErrorParams&&typeof t.lastErrorParams=="object"?t.lastErrorParams:{};return n==="connect_failed"?s("settingsDialog.relay.error.connect_failed"):n==="disconnected"?s("settingsDialog.relay.error.disconnected",{reason:ue(l.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="rejected"?s("settingsDialog.relay.error.rejected",{reason:ue(l.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="closed_with_code"?s("settingsDialog.relay.error.closedWithCode",{code:l.code||(t==null?void 0:t.lastCloseCode)||0}):String((t==null?void 0:t.lastError)||"").trim()}const nt=v(()=>{var t,n,l,g;return C.value?s("settingsDialog.relay.status.reconnecting"):k.value||G.value?s("settingsDialog.relay.status.saving"):y.value?s("settingsDialog.relay.status.loading"):(t=u.value)!=null&&t.reconnectPaused?s("settingsDialog.relay.status.paused"):(n=u.value)!=null&&n.connected?s("settingsDialog.relay.status.connected"):(((l=u.value)==null?void 0:l.enabled)??r.enabled)&&Number(((g=u.value)==null?void 0:g.nextReconnectDelayMs)||0)>0?s("settingsDialog.relay.status.waitingReconnect"):r.enabled?s("settingsDialog.relay.status.disconnected"):s("settingsDialog.relay.status.disabled")}),at=v(()=>{var t,n;return(t=u.value)!=null&&t.reconnectPaused?"theme-status-danger":(n=u.value)!=null&&n.connected?"theme-status-success":r.enabled?"theme-status-warning":"theme-status-neutral"}),it=v(()=>{var t,n,l;return!f.value&&!_.value&&!w.value&&!((t=u.value)!=null&&t.lastError)&&!((n=u.value)!=null&&n.lastCloseReason)&&!((l=u.value)!=null&&l.lastConnectedAt)}),lt=v(()=>{const t=r.deviceToken?`${"*".repeat(Math.max(0,r.deviceToken.length-4))}${r.deviceToken.slice(-4)}`:"";return JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceTokenMasked:t,managedByEnv:f.value},status:u.value||null},null,2)}),N=v(()=>{var t,n;return((n=(t=R.value)==null?void 0:t.runner)==null?void 0:n.runner)||null}),Q=v(()=>{var t,n;return!!((n=(t=R.value)==null?void 0:t.runner)!=null&&n.ok&&N.value)}),p=v(()=>{var t;return((t=N.value)==null?void 0:t.metrics)||null}),fe=v(()=>{var t;return((t=R.value)==null?void 0:t.recovery)||null}),be=v(()=>{var t;return((t=R.value)==null?void 0:t.maintenance)||null}),ot=v(()=>{var t;return((t=R.value)==null?void 0:t.gitDiffWorker)||null}),rt=v(()=>JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{runner:{maxConcurrentRuns:V.runnerMaxConcurrentRuns,managedByEnv:A.runnerMaxConcurrentRuns}},diagnostics:R.value||null},null,2));function X(t){const n=String(t||"").trim();if(!n)return s("common.notAvailable");const l=new Date(n);return Number.isNaN(l.getTime())?n:Et(l.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const ct=v(()=>{var t,n,l,g,D,M,E,P;return[{key:"queued_cancelled",label:s("settingsDialog.system.stopReasons.queued_cancelled"),value:Math.max(0,Number((n=(t=p.value)==null?void 0:t.stopReasons)==null?void 0:n.queued_cancelled)||0)},{key:"user_requested",label:s("settingsDialog.system.stopReasons.user_requested"),value:Math.max(0,Number((g=(l=p.value)==null?void 0:l.stopReasons)==null?void 0:g.user_requested)||0)},{key:"user_requested_after_error",label:s("settingsDialog.system.stopReasons.user_requested_after_error"),value:Math.max(0,Number((M=(D=p.value)==null?void 0:D.stopReasons)==null?void 0:M.user_requested_after_error)||0)},{key:"stop_timeout",label:s("settingsDialog.system.stopReasons.stop_timeout"),value:Math.max(0,Number((P=(E=p.value)==null?void 0:E.stopReasons)==null?void 0:P.stop_timeout)||0)}]}),ut=v(()=>{var t,n,l,g,D,M,E,P,Z,ee;return[{key:"runner_timeout_without_stop_request",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_without_stop_request"),value:Math.max(0,Number((n=(t=p.value)==null?void 0:t.stopTimeoutPhases)==null?void 0:n.runner_timeout_without_stop_request)||0)},{key:"runner_timeout_before_cancel",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_before_cancel"),value:Math.max(0,Number((g=(l=p.value)==null?void 0:l.stopTimeoutPhases)==null?void 0:g.runner_timeout_before_cancel)||0)},{key:"cli_not_exiting",label:s("settingsDialog.system.stopTimeoutPhases.cli_not_exiting"),value:Math.max(0,Number((M=(D=p.value)==null?void 0:D.stopTimeoutPhases)==null?void 0:M.cli_not_exiting)||0)},{key:"os_kill_slow",label:s("settingsDialog.system.stopTimeoutPhases.os_kill_slow"),value:Math.max(0,Number((P=(E=p.value)==null?void 0:E.stopTimeoutPhases)==null?void 0:P.os_kill_slow)||0)},{key:"runner_finalize_after_exit",label:s("settingsDialog.system.stopTimeoutPhases.runner_finalize_after_exit"),value:Math.max(0,Number((ee=(Z=p.value)==null?void 0:Z.stopTimeoutPhases)==null?void 0:ee.runner_finalize_after_exit)||0)}]}),dt=v(()=>ge.value.map(t=>({value:t.value,label:t.value==="zh-CN"?s("locale.zhHans"):s("locale.enUs"),englishLabel:t.englishLabel})));async function mt(){F.value=!0,x.value="";try{const t=await It(),n=String((t==null?void 0:t.version)||"").trim();b.value=n,n||(x.value=s("settingsDialog.about.versionPending"))}catch(t){b.value="",x.value=(t==null?void 0:t.message)||s("settingsDialog.about.versionLoadFailed")}finally{F.value=!1}}function ve(t={}){r.enabled=!!(t!=null&&t.enabled),r.relayUrl=String((t==null?void 0:t.relayUrl)||""),r.deviceId=String((t==null?void 0:t.deviceId)||""),r.deviceToken=String((t==null?void 0:t.deviceToken)||"")}function De(t={}){var n;V.runnerMaxConcurrentRuns=Math.max(1,Number((n=t==null?void 0:t.runner)==null?void 0:n.maxConcurrentRuns)||3)}async function ke(){y.value=!0,_.value="",w.value="";try{const t=await At();ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigLoadFailed"),u.value=null}finally{y.value=!1}}async function gt(){var t,n;ie.value=!0,I.value="",J.value="";try{const l=await zt();De((l==null?void 0:l.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=l==null?void 0:l.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),Y()}catch(l){I.value=(l==null?void 0:l.message)||s("settingsDialog.system.systemConfigLoadFailed")}finally{ie.value=!1}}async function Y(){q.value=!0,K.value="";try{R.value=await Ot()}catch(t){K.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsLoadFailed")}finally{q.value=!1}}async function ht(){k.value=!0,_.value="",w.value="";try{const t=await Qe({enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceToken:r.deviceToken});ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null,w.value=r.enabled?s("settingsDialog.relay.relayConfigSavedEnabled"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigSaveFailed")}finally{k.value=!1}}async function vt(){C.value=!0,_.value="",w.value="";try{const t=await Vt();u.value=(t==null?void 0:t.relay)||null,w.value=s("settingsDialog.relay.relayReconnectTriggered"),setTimeout(()=>{ke()},1200)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayReconnectFailed")}finally{C.value=!1}}async function yt(){var t,n;L.value=!0,I.value="",J.value="";try{const l=await Ht({runner:{maxConcurrentRuns:V.runnerMaxConcurrentRuns}});De((l==null?void 0:l.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=l==null?void 0:l.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),J.value=s("settingsDialog.system.systemConfigSaved"),Y()}catch(l){I.value=(l==null?void 0:l.message)||s("settingsDialog.system.systemConfigSaveFailed")}finally{L.value=!1}}function xt(){return!!(String(r.relayUrl||"").trim()&&String(r.deviceId||"").trim()&&String(r.deviceToken||"").trim())}async function pt(){var t;if(!f.value){if(_.value="",w.value="",r.enabled&&!xt()){r.enabled=!1,_.value=s("settingsDialog.relay.relayFieldsRequired");return}G.value=!0;try{const n=await Qe({enabled:r.enabled,relayUrl:r.relayUrl,deviceId:r.deviceId,deviceToken:r.deviceToken});ve((n==null?void 0:n.config)||{}),f.value=!!(n!=null&&n.managedByEnv),u.value=(n==null?void 0:n.relay)||null,w.value=r.enabled?s("settingsDialog.relay.relayEnabledSaved"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(n){r.enabled=!!((t=u.value)!=null&&t.enabled),_.value=(n==null?void 0:n.message)||s("settingsDialog.relay.relayToggleFailed")}finally{G.value=!1}}}async function Ce(t){var l;if((l=navigator.clipboard)!=null&&l.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}async function _t(){try{await Ce(lt.value),oe.value=!0,B&&clearTimeout(B),B=setTimeout(()=>{oe.value=!1,B=null},2e3)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayDiagnosticsCopyFailed")}}async function ft(){try{await Ce(rt.value),re.value=!0,j&&clearTimeout(j),j=setTimeout(()=>{re.value=!1,j=null},2e3)}catch(t){K.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsCopyFailed")}}function bt(t){he(t)}function ye(){ce&&(clearInterval(ce),ce=null)}function Dt(){ye(),!(!W.open||S.value!=="system")&&(Y(),ce=setInterval(()=>{Y()},5e3))}return Je(()=>W.open,t=>{if(t){S.value="theme",mt(),ke(),gt();return}},{immediate:!0}),Je([()=>W.open,S],([t,n])=>{if(t&&n==="system"){Dt();return}ye()},{immediate:!0}),Tt(()=>{B&&(clearTimeout(B),B=null),j&&(clearTimeout(j),j=null),ye()}),(t,n)=>(o(),$(Ft,{open:U.open,"backdrop-class":"z-[70] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-[42rem] sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row",onClose:n[7]||(n[7]=l=>ae("close"))},{title:de(()=>[e("div",os,[z(i(Nt),{class:"h-4 w-4"}),e("span",null,a(i(s)("common.settings")),1)])]),default:de(()=>{var l,g,D,M,E,P,Z,ee,we,Re,Te,Se,Me,Ee,Pe,$e,Ue,Be,je,Ne,Fe,Le,Ie,qe,Ae,Ve,ze,He,Oe,We;return[z($t,{modelValue:S.value,"onUpdate:modelValue":n[0]||(n[0]=d=>S.value=d),sections:Ze.value},null,8,["modelValue","sections"]),e("div",rs,[S.value==="theme"?(o(),c("section",cs,[e("div",null,[e("div",us,a(i(s)("theme.title")),1),e("p",ds,a(i(s)("theme.sectionDescription")),1)]),e("section",ms,[z(ls)]),e("section",gs,[e("div",null,[e("div",hs,a(i(s)("locale.title")),1),e("p",vs,a(i(s)("locale.description")),1)]),e("label",ys,[e("span",xs,a(i(s)("locale.field")),1),z(Ut,{"model-value":i(T),options:dt.value,"get-option-value":d=>d.value,"onUpdate:modelValue":bt},{trigger:de(({selectedOption:d})=>[e("div",ps,a((d==null?void 0:d.label)||i(s)("common.select")),1)]),option:de(({option:d,selected:kt,select:Ct})=>[e("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:Za=>Ct()},[e("div",fs,[e("div",bs,[e("div",Ds,a(d.label),1),e("div",ks,a(d.englishLabel),1)]),kt?(o(),c("span",Cs,a(i(s)("common.enabled")),1)):h("",!0)])],8,_s)]),_:1},8,["model-value","options","get-option-value"])]),e("p",ws,a(i(s)("locale.immediateHint")),1)])])):S.value==="relay"?(o(),c("section",Rs,[e("div",Ts,[e("div",null,[e("div",Ss,[z(i(Ge),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.relay.title")),1)])]),e("span",{class:Xe(["rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium",at.value])},a(nt.value),3)]),e("section",Ms,[e("label",Es,[e("div",null,[e("div",Ps,a(i(s)("settingsDialog.relay.enableTitle")),1),e("p",$s,a(i(s)("settingsDialog.relay.enableDescription")),1)]),te(e("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>r.enabled=d),type:"checkbox",class:"h-4 w-4",disabled:f.value,onChange:pt},null,40,Us),[[St,r.enabled]])]),e("div",Bs,[e("label",js,[e("span",Ns,a(i(s)("settingsDialog.relay.relayUrl")),1),te(e("input",{"onUpdate:modelValue":n[2]||(n[2]=d=>r.relayUrl=d),type:"text",placeholder:"https://user1.promptx.example.com",class:"tool-input",disabled:f.value},null,8,Fs),[[xe,r.relayUrl]])]),e("label",Ls,[e("span",Is,a(i(s)("settingsDialog.relay.deviceId")),1),te(e("input",{"onUpdate:modelValue":n[3]||(n[3]=d=>r.deviceId=d),type:"text",placeholder:"my-macbook",class:"tool-input",disabled:f.value},null,8,qs),[[xe,r.deviceId]])]),e("label",As,[e("span",Vs,a(i(s)("settingsDialog.relay.deviceToken")),1),e("div",zs,[te(e("input",{"onUpdate:modelValue":n[4]||(n[4]=d=>r.deviceToken=d),type:le.value?"text":"password",placeholder:i(s)("settingsDialog.relay.deviceTokenPlaceholder"),class:"tool-input pr-10",disabled:f.value},null,8,Hs),[[Mt,r.deviceToken]]),e("button",{type:"button",class:"theme-icon-button absolute inset-y-1 right-1 flex h-auto w-8 items-center justify-center",disabled:f.value,onClick:n[5]||(n[5]=d=>le.value=!le.value)},[le.value?(o(),$(i(jt),{key:1,class:"h-4 w-4"})):(o(),$(i(Bt),{key:0,class:"h-4 w-4"}))],8,Os)])])]),e("div",Ws,[e("div",Js,[(l=u.value)!=null&&l.reconnectPausedReason?(o(),c("p",Ks,a(i(s)("settingsDialog.relay.pausedReconnect",{reason:ue(u.value.reconnectPausedReasonCode,u.value.reconnectPausedReason)})),1)):h("",!0),f.value?(o(),c("p",Gs,a(i(s)("settingsDialog.relay.managedByEnv")),1)):h("",!0),_.value?(o(),c("p",Qs,a(_.value),1)):w.value?(o(),c("p",Xs,a(w.value),1)):(g=u.value)!=null&&g.lastError?(o(),c("p",Ys,a(i(s)("settingsDialog.relay.lastError",{value:st(u.value)})),1)):(D=u.value)!=null&&D.lastCloseReason?(o(),c("p",Zs,a(i(s)("settingsDialog.relay.lastClosed",{reason:ue(u.value.lastCloseReasonCode,u.value.lastCloseReason),code:u.value.lastCloseCode})),1)):(M=u.value)!=null&&M.lastConnectedAt?(o(),c("p",en,a(i(s)("settingsDialog.relay.lastConnected",{value:X(u.value.lastConnectedAt)})),1)):h("",!0),(P=(E=u.value)==null?void 0:E.recentEvents)!=null&&P.length?(o(),c("p",tn,a(i(s)("settingsDialog.relay.recentEvent",{value:tt(u.value.recentEvents[0])})),1)):h("",!0),oe.value?(o(),c("p",sn,a(i(s)("settingsDialog.relay.copied")),1)):h("",!0),it.value?(o(),c("p",nn,a(i(s)("settingsDialog.relay.defaultHint")),1)):h("",!0)]),e("div",an,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||k.value||G.value||C.value||!(((Z=u.value)==null?void 0:Z.enabled)??r.enabled),onClick:vt},[C.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(C.value?i(s)("settingsDialog.relay.reconnecting"):i(s)("settingsDialog.relay.reconnectNow")),1)],8,ln),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||C.value,onClick:_t},[e("span",null,a(oe.value?i(s)("settingsDialog.relay.diagnosticsCopied"):i(s)("settingsDialog.relay.copyDiagnostics")),1)],8,on),e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:y.value||k.value||G.value||C.value||f.value,onClick:ht},[k.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(k.value?i(s)("common.saving"):i(s)("settingsDialog.relay.saveConfig")),1)],8,rn)])])])])):S.value==="system"?(o(),c("section",cn,[e("div",null,[e("div",un,[z(i(Ke),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.system.title")),1)]),e("p",dn,a(i(s)("settingsDialog.system.intro")),1)]),e("section",mn,[e("label",gn,[e("span",hn,a(i(s)("settingsDialog.system.maxConcurrentRuns")),1),te(e("input",{"onUpdate:modelValue":n[6]||(n[6]=d=>V.runnerMaxConcurrentRuns=d),type:"number",min:"1",max:"16",step:"1",class:"tool-input",disabled:A.runnerMaxConcurrentRuns||ie.value||L.value},null,8,vn),[[xe,V.runnerMaxConcurrentRuns,void 0,{number:!0}]]),e("p",yn,a(i(s)("settingsDialog.system.maxConcurrentRunsHint")),1)]),e("div",xn,[e("div",pn,[A.runnerMaxConcurrentRuns?(o(),c("p",_n,a(i(s)("settingsDialog.system.managedByEnv")),1)):I.value?(o(),c("p",fn,a(I.value),1)):J.value?(o(),c("p",bn,a(J.value),1)):(o(),c("p",Dn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),e("div",kn,[e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:A.runnerMaxConcurrentRuns||ie.value||L.value,onClick:yt},[L.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(L.value?i(s)("common.saving"):i(s)("settingsDialog.system.saveConfig")),1)],8,Cn)])])]),e("section",wn,[e("div",Rn,[e("div",null,[e("div",Tn,a(i(s)("settingsDialog.system.runtimeDiagnostics")),1),e("p",Sn,a(i(s)("settingsDialog.system.runtimeDiagnosticsHint")),1)]),e("div",Mn,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:q.value,onClick:Y},[q.value?(o(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(q.value?i(s)("settingsDialog.system.refreshingDiagnostics"):i(s)("settingsDialog.system.refreshDiagnostics")),1)],8,En),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:ft},[e("span",null,a(re.value?i(s)("settingsDialog.system.diagnosticsCopied"):i(s)("settingsDialog.system.copyDiagnostics")),1)])])]),e("div",Pn,[K.value?(o(),c("p",$n,a(K.value),1)):re.value?(o(),c("p",Un,a(i(s)("settingsDialog.system.diagnosticsCopiedHint")),1)):(o(),c("p",Bn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),Q.value?(o(),c("div",jn,[e("div",Nn,[n[8]||(n[8]=e("div",{class:"theme-muted-text text-xs"},"active",-1)),e("div",Fn,a(((ee=N.value)==null?void 0:ee.activeRunCount)||0),1),e("p",Ln,a(i(s)("settingsDialog.system.active")),1)]),e("div",In,[n[9]||(n[9]=e("div",{class:"theme-muted-text text-xs"},"tracked",-1)),e("div",qn,a(((we=N.value)==null?void 0:we.trackedRunCount)||0),1),e("p",An,a(i(s)("settingsDialog.system.tracked")),1)]),e("div",Vn,[n[10]||(n[10]=e("div",{class:"theme-muted-text text-xs"},"queued",-1)),e("div",zn,a(((Re=N.value)==null?void 0:Re.queuedRunCount)||0),1),e("p",Hn,a(i(s)("settingsDialog.system.queued")),1)]),e("div",On,[n[11]||(n[11]=e("div",{class:"theme-muted-text text-xs"},"maxConcurrent",-1)),e("div",Wn,a(((Se=(Te=N.value)==null?void 0:Te.config)==null?void 0:Se.maxConcurrentRuns)||V.runnerMaxConcurrentRuns),1),e("p",Jn,a(i(s)("settingsDialog.system.maxConcurrent")),1)])])):h("",!0),Q.value?(o(),c("div",Kn,[e("div",Gn,[n[12]||(n[12]=e("div",{class:"theme-muted-text text-xs"},"completed",-1)),e("div",Qn,a(((Me=p.value)==null?void 0:Me.totalCompleted)||0),1),e("p",Xn,a(i(s)("settingsDialog.system.completed")),1)]),e("div",Yn,[n[13]||(n[13]=e("div",{class:"theme-muted-text text-xs"},"stopped",-1)),e("div",Zn,a(((Ee=p.value)==null?void 0:Ee.totalStopped)||0),1),e("p",ea,a(i(s)("settingsDialog.system.stopped")),1)]),e("div",ta,[n[14]||(n[14]=e("div",{class:"theme-muted-text text-xs"},"error",-1)),e("div",sa,a(((Pe=p.value)==null?void 0:Pe.totalErrored)||0),1),e("p",na,a(i(s)("settingsDialog.system.error")),1)]),e("div",aa,[n[15]||(n[15]=e("div",{class:"theme-muted-text text-xs"},"stop_timeout",-1)),e("div",ia,a((($e=p.value)==null?void 0:$e.totalStopTimeout)||0),1),e("p",la,a(i(s)("settingsDialog.system.stopTimeout")),1)])])):h("",!0),Q.value?(o(),c("div",oa,[e("div",ra,[n[16]||(n[16]=e("div",{class:"theme-muted-text text-xs"},"event flush failures",-1)),e("div",ca,a(((Ue=p.value)==null?void 0:Ue.eventFlushFailureCount)||0),1),e("p",ua,a(i(s)("settingsDialog.system.eventWriteFailures")),1)]),e("div",da,[n[17]||(n[17]=e("div",{class:"theme-muted-text text-xs"},"recovered runs",-1)),e("div",ma,a(((je=(Be=fe.value)==null?void 0:Be.metrics)==null?void 0:je.totalRecovered)||0),1),e("p",ga,a(i(s)("settingsDialog.system.recoveredRuns")),1)]),e("div",ha,[n[18]||(n[18]=e("div",{class:"theme-muted-text text-xs"},"last cleanup",-1)),e("div",va,a(X((Fe=(Ne=be.value)==null?void 0:Ne.lastCleanup)==null?void 0:Fe.finishedAt)),1),e("p",ya,a(i(s)("settingsDialog.system.lastMaintenanceAt")),1)])])):h("",!0),e("div",xa,[e("div",pa,[e("div",_a,a(i(s)("settingsDialog.system.baseStatus")),1),e("div",fa,[e("div",ba,[n[19]||(n[19]=e("span",{class:"theme-muted-text"},"runner baseUrl",-1)),e("span",Da,a(((Ie=(Le=R.value)==null?void 0:Le.runner)==null?void 0:Ie.baseUrl)||"-"),1)]),e("div",ka,[n[20]||(n[20]=e("span",{class:"theme-muted-text"},"runner startedAt",-1)),e("span",Ca,a(X((qe=N.value)==null?void 0:qe.startedAt)),1)]),e("div",wa,[n[21]||(n[21]=e("span",{class:"theme-muted-text"},"last sweep",-1)),e("span",Ra,a(X((Ve=(Ae=fe.value)==null?void 0:Ae.metrics)==null?void 0:Ve.lastSweepFinishedAt)),1)]),e("div",Ta,[n[22]||(n[22]=e("span",{class:"theme-muted-text"},"git diff worker",-1)),e("span",Sa,a(ot.value?i(s)("settingsDialog.system.available"):i(s)("settingsDialog.system.unknown")),1)]),e("div",Ma,[n[23]||(n[23]=e("span",{class:"theme-muted-text"},"db vacuum",-1)),e("span",Ea,a(X((ze=be.value)==null?void 0:ze.lastVacuumAt)),1)])])]),e("div",Pa,[e("div",$a,a(i(s)("settingsDialog.system.stopReasonTitle")),1),e("div",Ua,[(o(!0),c(se,null,ne(ct.value,d=>(o(),c("div",{key:d.key,class:"flex items-center justify-between gap-3"},[e("span",Ba,a(d.label),1),e("span",ja,a(d.value),1)]))),128))])])]),Q.value?(o(),c("div",Na,[e("div",Fa,a(i(s)("settingsDialog.system.stopTimeoutPhaseTitle")),1),e("div",La,[(o(!0),c(se,null,ne(ut.value,d=>(o(),c("div",{key:d.key,class:"flex items-center justify-between gap-3 rounded-sm border border-dashed border-[var(--theme-borderMuted)] px-2.5 py-2"},[e("span",Ia,a(d.label),1),e("span",qa,a(d.value),1)]))),128))])])):h("",!0),!Q.value&&!q.value?(o(),c("div",Aa,[e("div",Va,a(i(s)("settingsDialog.system.runnerUnavailable")),1),e("p",za,a(et((He=R.value)==null?void 0:He.runner,"settingsDialog.system.runnerUnavailableDescription")),1),e("p",Ha," baseUrl: "+a(((We=(Oe=R.value)==null?void 0:Oe.runner)==null?void 0:We.baseUrl)||"-"),1)])):h("",!0)])])):(o(),c("section",Oa,[e("div",null,[e("div",Wa,a(i(s)("settingsDialog.about.title")),1),e("p",Ja,a(i(s)("settingsDialog.about.intro")),1)]),e("section",Ka,[e("div",Ga,[e("div",null,[e("div",Qa,a(i(s)("settingsDialog.about.versionTitle")),1),e("p",Xa,a(x.value||i(s)("settingsDialog.about.versionDescription")),1)]),e("span",Ya,a(F.value?i(s)("common.loading"):b.value?`v${b.value}`:i(s)("common.unavailable")),1)])])]))])]}),_:1},8,["open"]))}};export{si as default};
|