@ganglion/xacpx-relay 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +9 -5
- package/dist/relay-web/assets/{DashboardView-YomyNeqU.css → DashboardView-DQH2-6ZB.css} +1 -1
- package/dist/relay-web/assets/{DashboardView-pxxhASTg.js → DashboardView-DUUqMJTb.js} +3 -3
- package/dist/relay-web/assets/{LoginView-CH3Gr1EY.js → LoginView-D_ws_UNl.js} +1 -1
- package/dist/relay-web/assets/{SettingsView-Deilrt-x.js → SettingsView-D-nJtS5E.js} +1 -1
- package/dist/relay-web/assets/{index-aG3mrM6y.js → index-Bn9S3sSl.js} +2 -2
- package/dist/relay-web/assets/{theme-DpFOOchX.js → theme-rA-1YbeM.js} +1 -1
- package/dist/relay-web/index.html +1 -1
- package/dist/relay-web/sw.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1073,10 +1073,13 @@ async function createRelayRuntime(dbPath, options = {}) {
|
|
|
1073
1073
|
};
|
|
1074
1074
|
const pushReasoningPart = (a, chunk) => {
|
|
1075
1075
|
const last = a.parts[a.parts.length - 1];
|
|
1076
|
-
if (last?.type === "reasoning")
|
|
1076
|
+
if (last?.type === "reasoning") {
|
|
1077
1077
|
last.text = (last.text + chunk).slice(0, REASONING_CAP);
|
|
1078
|
-
|
|
1079
|
-
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
if (!chunk.trim())
|
|
1081
|
+
return;
|
|
1082
|
+
a.parts.push({ type: "reasoning", text: chunk.slice(0, REASONING_CAP) });
|
|
1080
1083
|
};
|
|
1081
1084
|
const pushToolPart = (a, step) => {
|
|
1082
1085
|
const i = a.parts.findIndex((p) => p.type === "tool" && p.step.toolCallId === step.toolCallId);
|
|
@@ -1131,9 +1134,10 @@ async function createRelayRuntime(dbPath, options = {}) {
|
|
|
1131
1134
|
if (!a)
|
|
1132
1135
|
return;
|
|
1133
1136
|
const steps = [...a.steps.values()];
|
|
1134
|
-
const
|
|
1137
|
+
const hasReasoning = a.reasoning.trim().length > 0;
|
|
1138
|
+
const hasStructured = steps.length > 0 || hasReasoning;
|
|
1135
1139
|
if (a.text || hasStructured) {
|
|
1136
|
-
const structured = hasStructured ? { toolSteps: steps, ...
|
|
1140
|
+
const structured = hasStructured ? { toolSteps: steps, ...hasReasoning ? { reasoning: a.reasoning } : {}, ...a.parts.length ? { parts: a.parts } : {} } : undefined;
|
|
1137
1141
|
messages.append(instanceId, event.sessionAlias, "out", a.text, structured);
|
|
1138
1142
|
}
|
|
1139
1143
|
} else if (event.type === "session-history") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.stream-md>:first-child{margin-top:0}.stream-md>:last-child{margin-bottom:0}.stream-md p{margin:.5em 0;line-height:1.5}.stream-md h1,.stream-md h2,.stream-md h3,.stream-md h4{margin:.8em 0 .4em;font-weight:600;line-height:1.3}.stream-md h1{font-size:1.3em}.stream-md h2{font-size:1.2em}.stream-md h3{font-size:1.1em}.stream-md ul,.stream-md ol{margin:.5em 0;padding-left:1.4em}.stream-md ul{list-style:disc}.stream-md ol{list-style:decimal}.stream-md li{margin:.2em 0}.stream-md a{color:rgb(var(--c-accent));text-decoration:underline}.stream-md code{background:rgb(var(--c-surface));color:rgb(var(--c-fg));border-radius:4px;padding:.1em .3em;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}.stream-md pre{background:rgb(var(--c-bg));color:rgb(var(--c-fg));border:1px solid rgb(var(--c-border));border-radius:8px;padding:.65em .85em;overflow-x:auto;margin:.6em 0;box-shadow:var(--shadow-e1)}.stream-md pre::-webkit-scrollbar{height:8px}.stream-md pre::-webkit-scrollbar-thumb{background:rgb(var(--c-fg-muted) / .28);border-radius:8px}.stream-md pre::-webkit-scrollbar-track{background:transparent}.stream-md pre code{background:transparent;padding:0;color:inherit;font-size:13px;line-height:1.6}.stream-md .hljs-keyword,.stream-md .hljs-built_in,.stream-md .hljs-name,.stream-md .hljs-tag{color:rgb(var(--c-accent))}.stream-md .hljs-string,.stream-md .hljs-attr,.stream-md .hljs-symbol{color:rgb(var(--c-run))}.stream-md .hljs-comment,.stream-md .hljs-quote{color:rgb(var(--c-fg-muted))}.stream-md .hljs-number,.stream-md .hljs-literal{color:rgb(var(--c-info))}.stream-md blockquote{border-left:3px solid rgb(var(--c-border));margin:.6em 0;padding-left:.8em;color:rgb(var(--c-fg-muted))}.stream-md .md-table-wrap{max-width:100%;overflow-x:auto;margin:.6em 0}.stream-md .md-table-wrap::-webkit-scrollbar{height:8px}.stream-md .md-table-wrap::-webkit-scrollbar-thumb{background:rgb(var(--c-fg-muted) / .28);border-radius:8px}.stream-md .md-table-wrap::-webkit-scrollbar-track{background:transparent}.stream-md table{border-collapse:collapse}.stream-md img{max-width:100%;height:auto}.stream-md th,.stream-md td{border:1px solid rgb(var(--c-border));padding:.3em .6em}.stream-md hr{border:none;border-top:1px solid rgb(var(--c-border));margin:.8em 0}.cv-row[data-v-
|
|
1
|
+
.stream-md>:first-child{margin-top:0}.stream-md>:last-child{margin-bottom:0}.stream-md p{margin:.5em 0;line-height:1.5}.stream-md h1,.stream-md h2,.stream-md h3,.stream-md h4{margin:.8em 0 .4em;font-weight:600;line-height:1.3}.stream-md h1{font-size:1.3em}.stream-md h2{font-size:1.2em}.stream-md h3{font-size:1.1em}.stream-md ul,.stream-md ol{margin:.5em 0;padding-left:1.4em}.stream-md ul{list-style:disc}.stream-md ol{list-style:decimal}.stream-md li{margin:.2em 0}.stream-md a{color:rgb(var(--c-accent));text-decoration:underline}.stream-md code{background:rgb(var(--c-surface));color:rgb(var(--c-fg));border-radius:4px;padding:.1em .3em;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}.stream-md pre{background:rgb(var(--c-bg));color:rgb(var(--c-fg));border:1px solid rgb(var(--c-border));border-radius:8px;padding:.65em .85em;overflow-x:auto;margin:.6em 0;box-shadow:var(--shadow-e1)}.stream-md pre::-webkit-scrollbar{height:8px}.stream-md pre::-webkit-scrollbar-thumb{background:rgb(var(--c-fg-muted) / .28);border-radius:8px}.stream-md pre::-webkit-scrollbar-track{background:transparent}.stream-md pre code{background:transparent;padding:0;color:inherit;font-size:13px;line-height:1.6}.stream-md .hljs-keyword,.stream-md .hljs-built_in,.stream-md .hljs-name,.stream-md .hljs-tag{color:rgb(var(--c-accent))}.stream-md .hljs-string,.stream-md .hljs-attr,.stream-md .hljs-symbol{color:rgb(var(--c-run))}.stream-md .hljs-comment,.stream-md .hljs-quote{color:rgb(var(--c-fg-muted))}.stream-md .hljs-number,.stream-md .hljs-literal{color:rgb(var(--c-info))}.stream-md blockquote{border-left:3px solid rgb(var(--c-border));margin:.6em 0;padding-left:.8em;color:rgb(var(--c-fg-muted))}.stream-md .md-table-wrap{max-width:100%;overflow-x:auto;margin:.6em 0}.stream-md .md-table-wrap::-webkit-scrollbar{height:8px}.stream-md .md-table-wrap::-webkit-scrollbar-thumb{background:rgb(var(--c-fg-muted) / .28);border-radius:8px}.stream-md .md-table-wrap::-webkit-scrollbar-track{background:transparent}.stream-md table{border-collapse:collapse}.stream-md img{max-width:100%;height:auto}.stream-md th,.stream-md td{border:1px solid rgb(var(--c-border));padding:.3em .6em}.stream-md hr{border:none;border-top:1px solid rgb(var(--c-border));margin:.8em 0}.cv-row[data-v-a7278286]{content-visibility:auto;contain-intrinsic-size:auto 88px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as te,k as wt,r as S,l as se,A as Lu,m as Z,p as Br,d as ce,q as ut,s as eu,c as m,a as f,n as J,t as k,x as N,f as x,F as X,y as ie,g as M,h as Ae,z as G,o as d,B as It,C as me,T as tu,e as pe,w as _e,D as Oe,E as Nn,G as pu,H as yu,I as ku,J as Ur,K as qe,L as Ru,M as Pn,N as qr,O as jr,P as Hr,Q as Ft,R as mt,S as Vr,b as Wr,U as Gr}from"./index-
|
|
1
|
+
import{j as te,k as wt,r as S,l as se,A as Lu,m as Z,p as Br,d as ce,q as ut,s as eu,c as m,a as f,n as J,t as k,x as N,f as x,F as X,y as ie,g as M,h as Ae,z as G,o as d,B as It,C as me,T as tu,e as pe,w as _e,D as Oe,E as Nn,G as pu,H as yu,I as ku,J as Ur,K as qe,L as Ru,M as Pn,N as qr,O as jr,P as Hr,Q as Ft,R as mt,S as Vr,b as Wr,U as Gr}from"./index-Bn9S3sSl.js";import{_ as Kr}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{u as Zr}from"./theme-rA-1YbeM.js";/**
|
|
2
2
|
* @license lucide-vue-next v1.0.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -238,7 +238,7 @@ import{j as te,k as wt,r as S,l as se,A as Lu,m as Z,p as Br,d as ce,q as ut,s a
|
|
|
238
238
|
*
|
|
239
239
|
* This source code is licensed under the ISC license.
|
|
240
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const nt=te("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var ys=1;function Eo(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"invalid-json"}}return Ao(t)?t.protocolVersion!==ys?{ok:!1,error:"version-mismatch",detail:`expected protocolVersion ${ys}, got ${t.protocolVersion}`}:{ok:!0,envelope:t}:{ok:!1,error:"invalid-envelope"}}function Ao(e){if(typeof e!="object"||e===null)return!1;const t=e;return!(typeof t.protocolVersion!="number"||!Number.isInteger(t.protocolVersion)||t.kind!=="req"&&t.kind!=="res"&&t.kind!=="event"||typeof t.type!="string"||t.type.trim().length===0||t.id!==void 0&&typeof t.id!="string"||(t.kind==="req"||t.kind==="res")&&(typeof t.id!="string"||t.id.length===0))}function Yt(e){if(typeof e!="object"||e===null)return!1;const t=e.error;if(typeof t!="object"||t===null)return!1;const u=t;return typeof u.code=="string"&&typeof u.message=="string"}var $o="web.event",Co=new Set(["instance-status","control-event","notice"]),Do=new Set(["turn-output","turn-started","tool-event","turn-thought","plan","turn-usage","agent-commands","turn-finished","sessions-changed","scheduled-changed","orchestration-changed"]),To=new Set(["read","search","execute","edit","think","other"]),So=new Set(["running","success","error"]),ct=e=>typeof e=="string",Wt=e=>e===void 0||typeof e=="string",Fo=e=>e===void 0||typeof e=="number";function Io(e){switch(e.type){case"diff":return ct(e.path)&&ct(e.oldText)&&ct(e.newText);case"read":return ct(e.path)&&Wt(e.lines)&&Wt(e.preview);case"command":return ct(e.command)&&Wt(e.output)&&Fo(e.exitCode);case"search":return ct(e.query)&&Wt(e.output);case"text":return ct(e.text);case"fields":return Array.isArray(e.fields)&&e.fields.every(t=>t!==null&&typeof t=="object"&&ct(t.label)&&ct(t.value))&&Wt(e.output);default:return!1}}function Mo(e){if(typeof e!="object"||e===null)return!1;const t=e;return!(typeof t.toolCallId!="string"||typeof t.toolName!="string"||typeof t.title!="string"||typeof t.kind!="string"||!To.has(t.kind)||typeof t.status!="string"||!So.has(t.status)||!Wt(t.error)||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||!Io(t.detail)))}function zo(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.type!="string"||!Do.has(t.type)?!1:t.type==="turn-output"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.chunk=="string":t.type==="turn-finished"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.ok=="boolean":t.type==="scheduled-changed"?typeof t.chatKey=="string":t.type==="turn-started"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string":t.type==="turn-thought"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.chunk=="string":t.type==="plan"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Array.isArray(t.entries):t.type==="turn-usage"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.used=="number"&&typeof t.size=="number":t.type==="agent-commands"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Array.isArray(t.commands)&&t.commands.every(u=>u!==null&&typeof u=="object"&&typeof u.name=="string"):t.type==="tool-event"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Mo(t.step):!0}var Oo=new Set(["task-completion","task-progress","coordinator-message"]);function Lo(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.kind=="string"&&Oo.has(t.kind)&&typeof t.text=="string"}function Ro(e){if(e.kind!=="event"||e.type!==$o)return null;const t=e.payload;if(typeof t!="object"||t===null)return null;const u=t;return typeof u.instanceId!="string"||typeof u.kind!="string"||!Co.has(u.kind)||u.kind==="instance-status"&&typeof u.online!="boolean"||u.kind==="control-event"&&!zo(u.event)||u.kind==="notice"&&!Lo(u.notice)?null:t}function No(e,t){let u=null,n=!1,s=0,a=null;const r=()=>{const o=location.protocol==="https:"?"wss":"ws";u=new WebSocket(`${o}://${location.host}/ws`),u.onmessage=i=>{const l=Eo(String(i.data));if(!l.ok)return;const h=Ro(l.envelope);h&&e(h)},u.onopen=()=>{s=0,t==null||t(!0)},u.onclose=()=>{t==null||t(!1),!n&&(s=Math.min(s+1,6),a=setTimeout(()=>{a=null,n||r()},250*2**(s-1)))}};return r(),()=>{n=!0,a&&(clearTimeout(a),a=null),u==null||u.close()}}function Dt(e){if(Yt(e))throw e.error.code==="unknown-type"?new Error("This feature needs a newer connector — rebuild and reconnect the relay channel on that instance."):new Error(e.error.message||e.error.code);return e}const ft=wt("instances",()=>{const e=S([]);async function t(){const{instances:v}=await se.get("/api/instances");e.value=v.map(w=>{const D=A(w.id);return{...w,sessions:(D==null?void 0:D.sessions)??[],sessionsLoaded:(D==null?void 0:D.sessionsLoaded)??!1,agents:(D==null?void 0:D.agents)??[],workspaces:(D==null?void 0:D.workspaces)??[],agentCatalog:(D==null?void 0:D.agentCatalog)??[]}});for(const w of e.value)w.online&&!w.sessionsLoaded&&u(w.id).catch(()=>{})}async function u(v){const{sessions:w}=await se.rpc(v,"control.sessions.list"),D=A(v);D&&(D.sessions=w,D.sessionsLoaded=!0)}async function n(v){const{workspaces:w}=await se.rpc(v,"control.workspaces.list"),D=A(v);D&&(D.workspaces=w)}async function s(v){const[{agents:w},{workspaces:D},{agents:P}]=await Promise.all([se.rpc(v,"control.agents.list"),se.rpc(v,"control.workspaces.list"),se.rpc(v,"control.agents.catalog")]),F=A(v);F&&(F.agents=w,F.workspaces=D,F.agentCatalog=P)}async function a(v){const{agents:w}=await se.rpc(v,"control.agents.catalog"),D=A(v);D&&(D.agentCatalog=w)}async function r(v,w,D){Dt(await se.rpc(v,"control.agents.create",{name:w,driver:D})),await s(v)}async function o(v,w){Dt(await se.rpc(v,"control.agents.remove",{name:w})),await s(v)}async function i(v,w){Dt(await se.rpc(v,"control.workspaces.remove",{name:w})),await s(v)}async function l(v,w,D,P){const{workspace:F}=Dt(await se.rpc(v,"control.workspaces.create",{name:w,cwd:D,description:P})),V=A(v);return V&&!V.workspaces.some(R=>R.name===F.name)&&(V.workspaces=[...V.workspaces,F]),F}async function h(v,w,D,P,F,V){try{Dt(await se.rpc(v,"control.sessions.create",{alias:w,agent:D,workspace:P,...F?{agentSessionId:F}:{},...V?{model:V}:{}}))}catch(R){if(R instanceof Lu&&(R.status===504||R.code==="timeout"))return{pending:!0};throw R}return await u(v),{pending:!1}}async function c(v,w,D){const{sessions:P}=Dt(await se.rpc(v,"control.sessions.native.list",{agent:w,workspace:D}));return P}async function y(v,w,D){const P=A(v),F=((P==null?void 0:P.sessions)??[]).find(V=>V.agent===w&&V.workspace===D);if(!F)return[];try{const V=Dt(await se.rpc(v,"control.session.model.get",{sessionAlias:F.alias})),R=new Set,O=[];for(const ae of[...V.current?[V.current]:[],...V.available])ae&&!R.has(ae)&&(R.add(ae),O.push(ae));return O}catch{return[]}}async function p(v,w){await se.rpc(v,"control.sessions.remove",{alias:w}),await u(v)}async function g(v,w){await se.rpc(v,"control.sessions.archive",{alias:w}),await u(v)}async function C(v,w){await se.rpc(v,"control.sessions.unarchive",{alias:w}),await u(v)}async function $(v,w){await se.patch(`/api/instances/${v}`,{name:w});const D=A(v);D&&(D.name=w)}function E(v){if(v.kind==="instance-status"){const w=A(v.instanceId);w&&(w.online=v.online,v.online&&!w.sessionsLoaded&&u(v.instanceId).catch(()=>{}))}else v.kind==="control-event"&&v.event.type==="sessions-changed"&&u(v.instanceId).catch(()=>{})}function A(v){return e.value.find(w=>w.id===v)}return{instances:e,loadInstances:t,loadSessions:u,loadWorkspaces:n,loadFormOptions:s,loadAgentCatalog:a,createWorkspace:l,createAgent:r,removeAgent:o,removeWorkspace:i,createSession:h,listNativeSessions:c,listModelSuggestions:y,removeSession:p,archiveSession:g,unarchiveSession:C,renameInstance:$,applyEvent:E,byId:A}}),wa="xrelay.selectedSession";function Po(e,t){try{localStorage.setItem(wa,JSON.stringify({instanceId:e,alias:t}))}catch{}}function Bo(){try{const e=localStorage.getItem(wa);if(!e)return null;const t=JSON.parse(e);return typeof t.instanceId=="string"&&typeof t.alias=="string"?{instanceId:t.instanceId,alias:t.alias}:null}catch{return null}}function Uo(e,t){const u=e[e.length-1];(u==null?void 0:u.type)==="text"?u.text+=t:e.push({type:"text",text:t})}function qo(e,t){const u=e[e.length-1];(u==null?void 0:u.type)==="reasoning"?u.text+=t:e.push({type:"reasoning",text:t})}function jo(e,t){const u=e.findIndex(n=>n.type==="tool"&&n.step.toolCallId===t.toolCallId);u>=0?e[u]={type:"tool",step:t}:e.push({type:"tool",step:t})}const ks=e=>e.filter(t=>t.type==="text").map(t=>t.text).join(""),_s=e=>e.filter(t=>t.type==="tool").map(t=>t.step),Ho=e=>e.filter(t=>t.type==="reasoning").map(t=>t.text).join(""),Et=wt("chat",()=>{const e=S(null),t=S(null),u=S([]),n=S({}),s=S({}),a=S({}),r=S({}),o=S(new Set),i=new Set,l=(Y,U)=>`${Y}\0${U}`;function h(Y,U){const ue=l(Y,U);return n.value[ue]?"working":o.value.has(ue)?"unread":"idle"}function c(Y,U){var ue;return((ue=n.value[l(Y,U)])==null?void 0:ue.startedAt)??null}const y=Z(()=>e.value&&t.value?l(e.value,t.value):null),p=Z(()=>y.value?n.value[y.value]??null:null),g=Z(()=>y.value?s.value[y.value]??null:null),C=Z(()=>y.value?a.value[y.value]??null:null),$=Z(()=>y.value?r.value[y.value]??[]:[]),E=Z(()=>p.value?ks(p.value.parts):""),A=Z(()=>p.value?_s(p.value.parts):[]),v=Z(()=>p.value!==null),w=S(!1),D=S(""),P=S(null);let F=0;function V(Y){P.value={taskId:Y,nonce:++F}}const R=100,O=S(!1),ae=S(!1);function I(Y){let U=n.value[Y];return U||(U={parts:[],status:"working",startedAt:Date.now()},n.value[Y]=U),U}function B(Y,U,ue,re){const ke=l(Y,U),Se=n.value[ke];delete n.value[ke];const At=Y===e.value&&U===t.value;if(ue==="error"&&At&&(D.value=re??"turn-failed"),!Se)return;const ot=ks(Se.parts),z=_s(Se.parts),K=Ho(Se.parts);if((ot.length>0||z.length>0||K.length>0)&&At){const oe=z.length>0||K.length>0?{toolSteps:z,...K?{reasoning:K}:{},parts:Se.parts}:void 0;u.value.push({instanceId:Y,sessionAlias:U,direction:"out",text:ot,createdAt:new Date().toISOString(),failed:ue==="error",status:ue,...oe?{structured:oe}:{}})}}function L(Y,U){e.value=Y,t.value=U,Po(Y,U),u.value=[],D.value="",O.value=!1,ae.value=!1;const ue=l(Y,U);if(o.value.has(ue)){const re=new Set(o.value);re.delete(ue),o.value=re}}async function _(){if(!e.value||!t.value)return;const{messages:Y,hasMore:U}=await se.get(`/api/instances/${e.value}/sessions/${t.value}/messages?limit=${R}`);u.value=Y,O.value=U??!1}async function j(){var re;if(!e.value||!t.value||ae.value||!O.value)return;const Y=(re=u.value.find(ke=>typeof ke.id=="number"))==null?void 0:re.id;if(Y===void 0)return;const U=e.value,ue=t.value;ae.value=!0;try{const{messages:ke,hasMore:Se}=await se.get(`/api/instances/${U}/sessions/${ue}/messages?before=${Y}&limit=${R}`);if(U!==e.value||ue!==t.value)return;ke.length>0&&(u.value=[...ke,...u.value]),O.value=Se??!1}catch{}finally{ae.value=!1}}function ee(Y){for(const U of Y){const ue=l(U.instanceId,U.sessionAlias);n.value[ue]||i.has(ue)||(n.value[ue]={parts:U.parts,status:U.status,startedAt:U.startedAt})}}async function fe(){const{turns:Y}=await se.get("/api/active-turns");ee(Y)}function Ne(Y){if(Y.kind==="instance-status"&&!Y.online){const ue=`${Y.instanceId}\0`;for(const ke of Object.keys(n.value))ke.startsWith(ue)&&delete n.value[ke];const re=new Set([...o.value].filter(ke=>!ke.startsWith(ue)));re.size!==o.value.size&&(o.value=re);return}if(Y.kind!=="control-event")return;const U=Y.event;if(U.type==="turn-started"){const ue=l(Y.instanceId,U.sessionAlias);i.delete(ue),I(ue);const re=Y.instanceId===e.value&&U.sessionAlias===t.value;U.prompt&&re&&u.value.push({instanceId:Y.instanceId,sessionAlias:U.sessionAlias,direction:"in",text:U.prompt,createdAt:new Date().toISOString(),...U.scheduled?{scheduled:U.scheduled}:{}})}else if(U.type==="turn-output"){const ue=I(l(Y.instanceId,U.sessionAlias));Uo(ue.parts,U.chunk),ue.status="streaming"}else if(U.type==="tool-event"){const ue=I(l(Y.instanceId,U.sessionAlias));jo(ue.parts,U.step)}else if(U.type==="turn-thought")qo(I(l(Y.instanceId,U.sessionAlias)).parts,U.chunk);else if(U.type==="plan")s.value[l(Y.instanceId,U.sessionAlias)]=U.entries;else if(U.type==="turn-usage")a.value[l(Y.instanceId,U.sessionAlias)]={used:U.used,size:U.size,...U.cost?{cost:U.cost}:{},...U.breakdown?{breakdown:U.breakdown}:{}};else if(U.type==="agent-commands")r.value[l(Y.instanceId,U.sessionAlias)]=U.commands;else if(U.type==="session-history")Y.instanceId===e.value&&U.sessionAlias===t.value&&_().catch(()=>{});else if(U.type==="turn-finished"){const ue=U.cancelled?"cancelled":U.ok?"done":"error",re=Y.instanceId===e.value&&U.sessionAlias===t.value;if(i.add(l(Y.instanceId,U.sessionAlias)),B(Y.instanceId,U.sessionAlias,ue,U.errorMessage),!re&&(ue==="done"||ue==="error")){const ke=l(Y.instanceId,U.sessionAlias),Se=new Set(o.value);Se.add(ke),o.value=Se}}}async function Lt(Y,U=[]){if(!e.value||!t.value)return;D.value="",w.value=!0;const ue={instanceId:e.value,sessionAlias:t.value,direction:"in",text:Y,createdAt:new Date().toISOString(),...U.length>0?{attachments:U.map(re=>({id:re.id,filename:re.fileName,mimeType:re.mimeType,size:re.size,kind:re.kind,...re.previewUrl?{previewUrl:re.previewUrl}:{}}))}:{}};u.value.push(ue);try{const re=await se.rpc(e.value,"control.prompt",{sessionAlias:t.value,text:Y,...U.length>0?{media:U}:{}});re&&re.ok===!1&&(D.value=re.errorMessage??"prompt-failed",ue.failed=!0)}catch(re){re instanceof Lu&&(re.status===504||re.code==="timeout")||(D.value=re instanceof Lu?re.code:"send-failed",ue.failed=!0)}finally{w.value=!1}}async function ge(Y){if(!Y.failed||Y.direction!=="in")return;const U=u.value.indexOf(Y);U>=0&&u.value.splice(U,1),await Lt(Y.text)}async function Rt(){if(!e.value||!t.value)return;const Y=e.value,U=t.value;B(Y,U,"cancelled");try{await se.rpc(Y,"control.prompt.cancel",{sessionAlias:U})}catch(ue){D.value=ue instanceof Lu?ue.code:"cancel-failed"}}return{instanceId:e,sessionAlias:t,messages:u,streaming:E,liveTurn:p,sessionPlan:g,sessionUsage:C,sessionCommands:$,liveToolSteps:A,busy:v,unread:o,sessionAttention:h,runningSince:c,sending:w,error:D,scrollRequest:P,requestScrollToScheduled:V,hasMoreOlder:O,loadingOlder:ae,select:L,loadHistory:_,loadOlder:j,loadActiveTurns:fe,seedActiveTurns:ee,applyEvent:Ne,send:Lt,resend:ge,cancel:Rt}}),_u=wt("tasks",()=>{const e=S([]),t=S([]),u=S(null);async function n(h,c){const{tasks:y}=await se.rpc(h,"control.scheduled.list");e.value=y.filter(p=>p.sessionAlias===c)}async function s(h){const{tasks:c}=await se.rpc(h,"control.orchestration.list");t.value=c}async function a(h,c){u.value={instanceId:h,sessionAlias:c},await Promise.all([n(h,c).catch(()=>{e.value=[]}),s(h).catch(()=>{t.value=[]})])}async function r(h,c,y,p){await se.rpc(h,"control.scheduled.create",{sessionAlias:c,executeAt:y,message:p}),await n(h,c)}async function o(h){const c=u.value;c&&(await se.rpc(c.instanceId,"control.scheduled.cancel",{id:h}),await n(c.instanceId,c.sessionAlias))}async function i(h){const c=u.value;c&&(await se.rpc(c.instanceId,"control.orchestration.cancel",{taskId:h}),await s(c.instanceId))}function l(h){if(h.kind!=="control-event")return;const c=u.value;!c||h.instanceId!==c.instanceId||(h.event.type==="scheduled-changed"?n(c.instanceId,c.sessionAlias).catch(()=>{}):h.event.type==="orchestration-changed"&&s(c.instanceId).catch(()=>{}))}return{scheduled:e,orchestration:t,scope:u,loadScheduled:n,loadOrchestration:s,loadFor:a,createScheduled:r,cancelScheduled:o,cancelOrchestration:i,applyEvent:l}}),ws=20,Ea=wt("notices",()=>{const e=S([]);let t=0;function u(s){s.kind==="notice"&&(e.value.unshift({id:++t,instanceId:s.instanceId,kind:s.notice.kind,text:s.notice.text}),e.value.length>ws&&(e.value.length=ws))}function n(s){e.value=e.value.filter(a=>a.id!==s)}return{items:e,applyEvent:u,dismiss:n}}),Aa=wt("connection",()=>{const e=S(!1);function t(u){e.value=u}return{online:e,setOnline:t}});function ou(e){if(Yt(e))throw new Error(e.error.message||e.error.code);return e}const Hu=wt("files",()=>{const e=S(null),t=S(null),u=S(""),n=S([]),s=S(null),a=S(null),r=S(null),o=S(!1),i=S("files"),l=S({}),h=S(null),c=S(""),y=S([]),p=S(!1),g=S(!1),C=S(!1),$=S("");function E(){t.value=null,u.value="",n.value=[],s.value=null,a.value=null,r.value=null,o.value=!1,l.value={},c.value="",y.value=[],$.value=""}async function A(I,B){e.value=I,t.value=B,s.value=null,a.value=null,r.value=null,o.value=!1,l.value={},c.value="",y.value=[],await D(""),v()}async function v(){if(!(!e.value||!t.value))try{const I=await se.rpc(e.value,"control.fs.diff",{workspace:t.value});if(Yt(I)){l.value={};return}const B={};for(const L of I.files)B[L.path]=L.status;l.value=B}catch{l.value={}}}async function w(I,B){if(!I||!B){h.value=null;return}try{const L=await se.rpc(I,"control.fs.diff",{workspace:B});if(Yt(L)){h.value=null;return}const _=typeof L.branch=="string"?L.branch:void 0,j=L.detached===!0;h.value={workspace:B,changedCount:L.files.length,..._?{branch:_}:{},...j?{detached:!0}:{}}}catch{h.value=null}}async function D(I){if(!(!e.value||!t.value)){C.value=!0,$.value="",s.value=null;try{const B=ou(await se.rpc(e.value,"control.fs.list",{workspace:t.value,path:I}));u.value=B.path,n.value=B.entries}catch(B){$.value=B instanceof Error?B.message:"list-failed"}finally{C.value=!1}}}async function P(I){const B=u.value?`${u.value}/${I.name}`:I.name;if(I.type==="dir")return D(B);if(!(!e.value||!t.value)){C.value=!0,$.value="";try{s.value=ou(await se.rpc(e.value,"control.fs.read",{workspace:t.value,path:B}))}catch(L){$.value=L instanceof Error?L.message:"read-failed"}finally{C.value=!1}}}async function F(I){if(!(!e.value||!t.value)){C.value=!0,$.value="";try{s.value=ou(await se.rpc(e.value,"control.fs.read",{workspace:t.value,path:I}))}catch(B){$.value=B instanceof Error?B.message:"read-failed"}finally{C.value=!1}}}async function V(){if(!(!e.value||!t.value)){if(i.value==="changes"){await ae(r.value??void 0);return}await D(u.value),await v(),await w(e.value,t.value)}}function R(I){const B=u.value?u.value.split("/"):[];D(B.slice(0,I+1).join("/"))}async function O(I){if(c.value=I,!e.value||!t.value||!I.trim()){y.value=[],p.value=!1;return}g.value=!0,$.value="";try{const B=ou(await se.rpc(e.value,"control.fs.search",{workspace:t.value,query:I}));y.value=B.matches,p.value=B.truncated}catch(B){$.value=B instanceof Error?B.message:"search-failed"}finally{g.value=!1}}async function ae(I){if(!(!e.value||!t.value)){C.value=!0,$.value="",r.value=I??null;try{a.value=ou(await se.rpc(e.value,"control.fs.diff",{workspace:t.value,...I?{path:I}:{}})),o.value=!1}catch(B){const L=B instanceof Error?B.message:"diff-failed";a.value=null,L==="not-a-git-repo"?o.value=!0:$.value=L}finally{C.value=!1}}}return{instanceId:e,workspace:t,path:u,entries:n,file:s,diff:a,diffPath:r,notGit:o,changed:l,gitSummary:h,tab:i,query:c,results:y,searchTruncated:p,searching:g,loading:C,error:$,reset:E,selectWorkspace:A,list:D,open:P,openFile:F,up:R,search:O,loadDiff:ae,loadStatus:v,loadGitSummary:w,refresh:V}}),Xt=S(null);let Qe=null;function Vo(){return Xt}function Wo(e,t=6e3){Qe&&clearTimeout(Qe),Xt.value=e,Qe=setTimeout(()=>{Xt.value=null,Qe=null},t)}function Es(){const e=Xt.value;Xt.value=null,Qe&&(clearTimeout(Qe),Qe=null),e==null||e.action()}function As(){Xt.value=null,Qe&&(clearTimeout(Qe),Qe=null)}function Go(e){const t=e.intent??4;let u=0,n=0,s=!1,a=!1,r=!1;function o(c){u=c.clientX,n=c.clientY,s=!0,a=!1,r=!1}function i(c){var g,C;if(!s)return;const y=c.clientX-u,p=c.clientY-n;if(!a){if(Math.abs(y)<t&&Math.abs(p)<t)return;a=!0,r=Math.abs(y)>Math.abs(p)}if(!r){s=!1,(g=e.onEnd)==null||g.call(e,0);return}(C=e.onMove)==null||C.call(e,y)}function l(c){var y;s&&(s=!1,(y=e.onEnd)==null||y.call(e,r?c.clientX-u:0))}function h(){var c;s&&(s=!1,(c=e.onEnd)==null||c.call(e,0))}return{handlers:{pointerdown:o,pointermove:i,pointerup:l,pointercancel:h}}}function $a(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function hn(e,t){return $a(`${e}-${t}`)}function bn(e,t){const u=new Set(t);if(!u.has(e))return e;for(let n=2;;n+=1){const s=`${e}-${n}`;if(!u.has(s))return s}}function $s(e){const u=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??"";return $a(u)}function Ca(){return Br.global.locale.value}function Cs(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString(Ca(),{hour:"2-digit",minute:"2-digit"})}function Un(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(Ca())}const Ko=["data-test","aria-label","aria-expanded"],Zo={key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-border bg-raised py-1 shadow-xl"},Yo={key:0,class:"px-3 pb-0.5 pt-1.5 text-[11px] font-medium uppercase tracking-wide text-fg-muted"},Xo=["data-value","onMousedown","onMouseenter"],Jo={class:"truncate"},mn=ce({__name:"SelectMenu",props:{modelValue:{},groups:{},placeholder:{},dataTest:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const u=e,n=t,s=S(!1),a=S(null),r=S(-1),o=Z(()=>u.groups.flatMap(E=>E.options)),i=Z(()=>{var E;return((E=o.value.find(A=>A.value===u.modelValue))==null?void 0:E.label)??""});function l(){s.value=!0;const E=o.value.findIndex(A=>A.value===u.modelValue&&!A.disabled);r.value=E>=0?E:o.value.findIndex(A=>!A.disabled)}function h(){s.value=!1}function c(){s.value?h():l()}function y(E){E.disabled||(n("update:modelValue",E.value),h())}function p(E){const A=o.value;if(!A.length)return;let v=r.value;for(let w=0;w<A.length;w++)if(v=(v+E+A.length)%A.length,!A[v].disabled){r.value=v;return}}function g(E){if(!s.value){(E.key==="Enter"||E.key===" "||E.key==="ArrowDown")&&(E.preventDefault(),l());return}if(E.key==="ArrowDown")E.preventDefault(),p(1);else if(E.key==="ArrowUp")E.preventDefault(),p(-1);else if(E.key==="Enter"||E.key===" "){E.preventDefault();const A=o.value[r.value];A&&y(A)}else E.key==="Escape"&&(E.stopPropagation(),h())}function C(E){s.value&&a.value&&!a.value.contains(E.target)&&h()}ut(()=>document.addEventListener("mousedown",C)),eu(()=>document.removeEventListener("mousedown",C));function $(E,A){let v=0;for(let w=0;w<E;w++)v+=u.groups[w].options.length;return v+A}return(E,A)=>(d(),m("div",{ref_key:"boxEl",ref:a,class:"relative"},[f("button",{type:"button","data-test":e.dataTest,"aria-label":e.ariaLabel,"aria-expanded":s.value,class:"flex w-full items-center justify-between rounded-lg border border-border bg-bg py-2 pl-3 pr-2 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onClick:c,onKeydown:g},[f("span",{class:J(["truncate",i.value?"text-fg":"text-fg-muted"])},k(i.value||e.placeholder||"Select…"),3),N(x(st),{size:16,class:J(["ml-2 shrink-0 text-fg-muted transition-transform",s.value?"rotate-180":""])},null,8,["class"])],40,Ko),s.value?(d(),m("ul",Zo,[(d(!0),m(X,null,ie(e.groups,(v,w)=>(d(),m(X,{key:w},[v.label?(d(),m("li",Yo,k(v.label),1)):M("",!0),(d(!0),m(X,null,ie(v.options,(D,P)=>(d(),m("li",{key:D.value,"data-value":D.value,class:J(["flex items-center justify-between px-3 py-1.5 text-sm",[D.disabled?"cursor-not-allowed text-fg-muted/50":$(w,P)===r.value?"cursor-pointer bg-accent/15 text-fg":"cursor-pointer text-fg-muted hover:bg-fg/5"]]),onMousedown:Ae(F=>y(D),["prevent"]),onMouseenter:F=>!D.disabled&&(r.value=$(w,P))},[f("span",Jo,k(D.label),1),D.value===e.modelValue?(d(),G(x(uu),{key:0,size:14,class:"ml-2 shrink-0 text-accent"})):M("",!0)],42,Xo))),128))],64))),128))])):M("",!0)],512))}}),Qo={class:"w-full max-w-md rounded-xl border border-border bg-raised shadow-xl","data-test":"new-session-dialog"},ei={class:"flex items-center justify-between border-b border-border px-5 py-3"},ti={class:"text-sm font-semibold text-fg"},ui={class:"font-normal text-fg-muted"},ni=["aria-label"],si={class:"space-y-4 px-5 py-4"},ai={key:0,"data-test":"ns-pending",class:"rounded-lg bg-info/10 px-3 py-3 text-xs text-info"},ri={key:1,class:"py-6 text-center text-sm text-fg-muted"},oi={class:"block"},ii={class:"mb-1 block text-xs font-medium text-fg-muted"},li={class:"flex gap-1"},ci={class:"block"},di={class:"mb-1 block text-xs font-medium text-fg-muted"},fi={class:"font-normal text-fg-muted"},pi=["placeholder"],hi={class:"block"},bi={class:"mb-1 block text-xs font-medium text-fg-muted"},mi={class:"block"},gi={class:"mb-1 flex items-center justify-between"},xi={class:"text-xs font-medium text-fg-muted"},vi={key:0,class:"flex gap-1"},yi=["placeholder"],ki={key:0,class:"block"},_i={class:"mb-1 block text-xs font-medium text-fg-muted"},wi={class:"font-normal text-fg-muted"},Ei=["aria-label"],Ai={key:0,"data-test":"ns-model-list",class:"absolute z-10 mt-1 max-h-48 w-full overflow-auto rounded-lg border border-border bg-raised py-1 shadow-xl"},$i=["onMousedown","onMouseenter"],Ci={class:"truncate"},Di={key:0,class:"ml-2 shrink-0 text-xs text-fg-muted"},Ti={key:1,class:"block"},Si={class:"mb-1 block text-xs font-medium text-fg-muted"},Fi={key:0,"data-test":"ns-native-loading",class:"space-y-1.5"},Ii={class:"flex items-center gap-2 text-xs text-fg-muted"},Mi={key:2,"data-test":"ns-native-error",class:"rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger"},zi={class:"flex items-start gap-1.5"},Oi={class:"min-w-0"},Li={class:"break-words font-medium"},Ri={key:0,class:"mt-1 text-danger/80"},Ni={key:3,"data-test":"ns-native-empty",class:"rounded-lg bg-bg px-3 py-2 text-xs text-fg-muted"},Pi={key:2,"data-test":"ns-error",class:"rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger"},Bi={class:"flex justify-end gap-2 border-t border-border px-5 py-3"},Ui=["disabled"],qi=ce({__name:"NewSessionDialog",props:{instanceId:{},instanceName:{}},emits:["created","close"],setup(e,{emit:t}){const u=e,n=t,{t:s}=It(),a=ft(),r=Z(()=>a.byId(u.instanceId)),o=S(""),i=S(""),l=S("new"),h=S("existing"),c=S(""),y=S(""),p=S(""),g=S([]),C=S(!1),$=S(0),E=S(null),A=Z(()=>{const z=new Set(["default"]),K=["default"];for(const W of g.value)W&&!z.has(W)&&(z.add(W),K.push(W));return K}),v=Z(()=>{const z=p.value.trim().toLowerCase();return z?A.value.filter(K=>K.toLowerCase().includes(z)):A.value});function w(){C.value=!0,$.value=0}function D(){C.value=!1}function P(z){p.value=z==="default"?"":z,D()}function F(z){if(z.key==="ArrowDown"){if(z.preventDefault(),!C.value){w();return}$.value=Math.min($.value+1,v.value.length-1)}else z.key==="ArrowUp"?(z.preventDefault(),$.value=Math.max($.value-1,0)):z.key==="Enter"?C.value&&$.value>=0&&$.value<v.value.length?(z.preventDefault(),P(v.value[$.value])):ot():z.key==="Escape"&&C.value&&(z.stopPropagation(),D())}function V(z){C.value&&E.value&&!E.value.contains(z.target)&&D()}ut(()=>document.addEventListener("mousedown",V)),eu(()=>document.removeEventListener("mousedown",V));const R=S(!1),O=S(!1),ae=S(""),I=S(""),B=S(!0),L=S([]),_=S(""),j=S(!1),ee=S("");ut(async()=>{var z,K,W,be,oe,Pe;try{await a.loadFormOptions(u.instanceId)}catch(He){I.value=He instanceof Error?He.message:s("session.failedLoadOptions")}finally{B.value=!1}i.value=((K=(z=r.value)==null?void 0:z.agents[0])==null?void 0:K.name)??((be=(W=r.value)==null?void 0:W.agentCatalog.find(He=>He.installed!=="unknown"))==null?void 0:be.driver)??"",c.value=((Pe=(oe=r.value)==null?void 0:oe.workspaces[0])==null?void 0:Pe.name)??""});const fe=Z(()=>{var z;return new Set((((z=r.value)==null?void 0:z.agents)??[]).map(K=>K.name))}),Ne=Z(()=>{var z;return(((z=r.value)==null?void 0:z.agentCatalog)??[]).filter(K=>!K.configured)}),Lt=Z(()=>{var W;const z=[],K=((W=r.value)==null?void 0:W.agents)??[];return K.length&&z.push({label:s("session.configured"),options:K.map(be=>({value:be.name,label:`${be.name} · ${be.driver}`}))}),Ne.value.length&&z.push({label:s("session.availableDrivers"),options:Ne.value.map(be=>({value:be.driver,label:be.installed==="unknown"?s("session.cliNotDetected",{driver:be.driver}):be.driver,disabled:be.installed==="unknown"}))}),z}),ge=Z(()=>{var z;return[{options:(((z=r.value)==null?void 0:z.workspaces)??[]).map(K=>({value:K.name,label:`${K.name} — ${K.cwd}`}))}]}),Rt=Z(()=>h.value==="path"?y.value.trim()?$s(y.value):"":c.value),Y=Z(()=>Rt.value&&i.value?hn(Rt.value,i.value):s("session.autoAlias")),U=Z(()=>fe.value.has(i.value));async function ue(){var z;if(_.value="",L.value=[],ee.value="",!(l.value!=="native"||!i.value||!c.value)){if(!U.value){ee.value=s("session.pickConfiguredAgent");return}j.value=!0;try{L.value=await a.listNativeSessions(u.instanceId,i.value,c.value),_.value=((z=L.value[0])==null?void 0:z.sessionId)??""}catch(K){ee.value=K instanceof Error?K.message:s("session.failedListNative")}finally{j.value=!1}}}me([l,i,c],()=>{l.value==="native"&&(h.value="existing",ue())}),me([i,c],async()=>{g.value=[],!(!i.value||!c.value)&&(g.value=await a.listModelSuggestions(u.instanceId,i.value,c.value))});const re=Z(()=>{const z=ee.value;return z&&/auth|login|unauthor|credential|sign[\s-]?in/i.test(z)?s("session.authHint",{agent:i.value||s("session.thisAgent")}):""});function ke(z){const K=(z.title??"").trim()||z.sessionId,W=z.sessionId.length>8?`…${z.sessionId.slice(-8)}`:z.sessionId,be=z.updatedAt?` · ${Un(z.updatedAt)}`:"";return`${K} (${W})${be}`}const Se=Z(()=>[{options:L.value.map(z=>({value:z.sessionId,label:ke(z)}))}]),At=Z(()=>R.value||!i.value?!1:l.value==="native"?!!_.value:h.value==="existing"?!!c.value:!!y.value.trim());async function ot(){var z,K;if(At.value){R.value=!0,I.value="";try{const W=i.value,be=(((z=r.value)==null?void 0:z.sessions)??[]).map(Ve=>Ve.alias);if(l.value==="native"){const Ve=c.value,it=o.value.trim()||bn(hn(Ve,W),be);if(!Ve||!it||!_.value){I.value=s("session.pickNativeAndAlias");return}if((await a.createSession(u.instanceId,it,W,Ve,_.value)).pending){ae.value=it,O.value=!0;return}n("created",it),n("close");return}let oe=c.value;if(h.value==="path"){const Ve=(((K=r.value)==null?void 0:K.workspaces)??[]).map(it=>it.name);oe=bn($s(y.value),Ve)}const Pe=o.value.trim()||bn(hn(oe,W),be);if(!oe||!Pe){I.value=s("session.couldNotDeriveName");return}fe.value.has(W)||await a.createAgent(u.instanceId,W,W),h.value==="path"&&await a.createWorkspace(u.instanceId,oe,y.value.trim());const He=p.value.trim(),Ke=He&&He.toLowerCase()!=="default"?He:void 0;if((await a.createSession(u.instanceId,Pe,W,oe,void 0,Ke)).pending){ae.value=Pe,O.value=!0;return}n("created",Pe),n("close")}catch(W){I.value=W instanceof Error?W.message:s("session.createFailed")}finally{R.value=!1}}}return(z,K)=>(d(),G(tu,{to:"body"},[f("div",{class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:K[14]||(K[14]=Ae(W=>n("close"),["self"]))},[f("div",Qo,[f("header",ei,[f("h2",ti,[pe(k(z.$t("session.newSession"))+" ",1),f("span",ui,"· "+k(e.instanceName),1)]),f("button",{class:"rounded p-1 text-fg-muted hover:bg-fg/5 hover:text-fg","aria-label":z.$t("session.close"),onClick:K[0]||(K[0]=W=>n("close"))},[N(x(nt),{size:16})],8,ni)]),f("div",si,[O.value?(d(),m("div",ai,k(z.$t("session.creating")),1)):B.value?(d(),m("div",ri,k(z.$t("session.loadingOptions")),1)):(d(),m(X,{key:2},[f("div",oi,[f("span",ii,k(z.$t("session.source")),1),f("div",li,[f("button",{type:"button","data-test":"ns-source-new",class:J(["flex-1 rounded px-2 py-1 text-xs",l.value==="new"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[1]||(K[1]=W=>l.value="new")},k(z.$t("session.newSession")),3),f("button",{type:"button","data-test":"ns-source-native",class:J(["flex-1 rounded px-2 py-1 text-xs",l.value==="native"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[2]||(K[2]=W=>l.value="native")},k(z.$t("session.nativeSession")),3)])]),f("label",ci,[f("span",di,[pe(k(z.$t("session.sessionAlias"))+" ",1),f("span",fi,k(z.$t("session.optional")),1)]),_e(f("input",{"onUpdate:modelValue":K[3]||(K[3]=W=>o.value=W),"data-test":"ns-alias",placeholder:Y.value,class:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onKeydown:Nn(ot,["enter"])},null,40,pi),[[Oe,o.value]])]),f("div",hi,[f("span",bi,k(z.$t("session.agent")),1),N(mn,{modelValue:i.value,"onUpdate:modelValue":K[4]||(K[4]=W=>i.value=W),groups:Lt.value,"data-test":"ns-agent","aria-label":z.$t("session.agent"),placeholder:z.$t("session.selectAgent")},null,8,["modelValue","groups","aria-label","placeholder"])]),f("div",mi,[f("div",gi,[f("span",xi,k(z.$t("session.workspace")),1),l.value==="new"?(d(),m("div",vi,[f("button",{type:"button","data-test":"ns-ws-mode-existing",class:J(["rounded px-2 py-0.5 text-xs",h.value==="existing"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[5]||(K[5]=W=>h.value="existing")},k(z.$t("session.existing")),3),f("button",{type:"button","data-test":"ns-ws-mode-path",class:J(["rounded px-2 py-0.5 text-xs",h.value==="path"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[6]||(K[6]=W=>h.value="path")},k(z.$t("session.newPath")),3)])):M("",!0)]),h.value==="existing"?(d(),G(mn,{key:0,modelValue:c.value,"onUpdate:modelValue":K[7]||(K[7]=W=>c.value=W),groups:ge.value,"data-test":"ns-workspace","aria-label":z.$t("session.workspace"),placeholder:z.$t("session.selectWorkspace")},null,8,["modelValue","groups","aria-label","placeholder"])):_e((d(),m("input",{key:1,"onUpdate:modelValue":K[8]||(K[8]=W=>y.value=W),"data-test":"ns-ws-path",placeholder:z.$t("session.pathPlaceholder"),class:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,yi)),[[Oe,y.value]])]),l.value==="new"?(d(),m("div",ki,[f("span",_i,[pe(k(z.$t("session.model"))+" ",1),f("span",wi,k(z.$t("session.optional")),1)]),f("div",{ref_key:"modelBoxEl",ref:E,class:"relative"},[_e(f("input",{"onUpdate:modelValue":K[9]||(K[9]=W=>p.value=W),"data-test":"ns-model",placeholder:"default",autocomplete:"off",class:"w-full rounded-lg border border-border bg-bg py-2 pl-3 pr-9 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onFocus:w,onInput:w,onKeydown:F},null,544),[[Oe,p.value]]),f("button",{type:"button",tabindex:"-1","aria-label":z.$t("session.toggleModelList"),class:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-1 text-fg-muted hover:text-fg",onClick:K[10]||(K[10]=W=>C.value?D():w())},[N(x(st),{size:16,class:J(["transition-transform",C.value?"rotate-180":""])},null,8,["class"])],8,Ei),C.value&&v.value.length?(d(),m("ul",Ai,[(d(!0),m(X,null,ie(v.value,(W,be)=>(d(),m("li",{key:W,class:J(["flex cursor-pointer items-center justify-between px-3 py-1.5 text-sm",be===$.value?"bg-accent/15 text-fg":"text-fg-muted hover:bg-fg/5"]),onMousedown:Ae(oe=>P(W),["prevent"]),onMouseenter:oe=>$.value=be},[f("span",Ci,k(W),1),W==="default"?(d(),m("span",Di,k(z.$t("session.agentDefault")),1)):M("",!0)],42,$i))),128))])):M("",!0)],512)])):M("",!0),l.value==="native"?(d(),m("div",Ti,[f("span",Si,k(z.$t("session.nativeSession")),1),j.value?(d(),m("div",Fi,[f("div",Ii,[N(x(zt),{size:13,class:"animate-spin motion-reduce:animate-none text-accent"}),pe(" "+k(z.$t("session.listingNative")),1)]),(d(),m(X,null,ie(3,W=>f("div",{key:W,class:"h-7 animate-pulse rounded-lg bg-fg/5 motion-reduce:animate-none",style:yu({width:`${92-W*12}%`})},null,4)),64))])):L.value.length?(d(),G(mn,{key:1,modelValue:_.value,"onUpdate:modelValue":K[11]||(K[11]=W=>_.value=W),groups:Se.value,"data-test":"ns-native","aria-label":z.$t("session.nativeSession"),placeholder:z.$t("session.selectNative")},null,8,["modelValue","groups","aria-label","placeholder"])):ee.value?(d(),m("div",Mi,[f("div",zi,[N(x(pu),{size:13,class:"mt-0.5 shrink-0"}),f("div",Oi,[f("p",Li,k(ee.value),1),re.value?(d(),m("p",Ri,k(re.value),1)):M("",!0)])])])):(d(),m("p",Ni,k(z.$t("session.noNativeSessions")),1))])):M("",!0),I.value?(d(),m("p",Pi,k(I.value),1)):M("",!0)],64))]),f("footer",Bi,[O.value?(d(),m("button",{key:0,"data-test":"ns-pending-close",class:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",onClick:K[12]||(K[12]=W=>{n("created",ae.value),n("close")})},k(z.$t("common.ok")),1)):(d(),m(X,{key:1},[f("button",{class:"rounded-lg px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5",onClick:K[13]||(K[13]=W=>n("close"))},k(z.$t("common.cancel")),1),f("button",{"data-test":"ns-create",disabled:!At.value,class:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-white enabled:hover:bg-accent-hover disabled:opacity-40",onClick:ot},k(R.value?z.$t("session.creatingButton"):z.$t("session.create")),9,Ui)],64))])])])]))}}),ji={class:"space-y-3"},Hi={key:0,"data-test":"wm-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},Vi=["placeholder"],Wi={key:2,"data-test":"wm-empty",class:"text-sm text-fg-muted"},Gi={key:3,class:"max-h-64 divide-y divide-border overflow-y-auto rounded border border-border"},Ki=["title"],Zi={class:"font-medium text-fg"},Yi={class:"text-fg-muted"},Xi=["data-test","title","aria-label","disabled","onClick"],Ji={key:0,class:"px-3 py-2 text-sm text-fg-muted"},Qi={key:5,class:"space-y-2 rounded border border-border p-3"},el={class:"grid grid-cols-1 gap-2 sm:grid-cols-3"},tl=["placeholder"],ul=["placeholder"],nl=["placeholder"],sl={class:"flex gap-2"},al=["disabled"],rl=ce({__name:"WorkspacesManager",props:{instanceId:{}},setup(e){const t=e,u=ft(),{t:n}=It(),s=Z(()=>u.byId(t.instanceId)),a=S(""),r=S(""),o=S(""),i=S(""),l=S(!1),h=S(!1),c=S(""),y=Z(()=>{var E;return((E=s.value)==null?void 0:E.workspaces)??[]}),p=Z(()=>y.value.length>6),g=Z(()=>{const E=c.value.trim().toLowerCase();return E?y.value.filter(A=>A.name.toLowerCase().includes(E)||(A.cwd??"").toLowerCase().includes(E)):y.value});async function C(){if(!(!a.value.trim()||!r.value.trim()||l.value)){l.value=!0,i.value="";try{await u.createWorkspace(t.instanceId,a.value.trim(),r.value.trim(),o.value.trim()||void 0),a.value="",r.value="",o.value=""}catch(E){i.value=E instanceof Error?E.message:n("workspaces.createFailed")}finally{l.value=!1}}}async function $(E){if(!(l.value||!await ku({title:n("workspaces.removeTitle"),message:n("workspaces.removeBody",{name:E}),confirmLabel:n("common.remove"),tone:"danger"}))){l.value=!0,i.value="";try{await u.removeWorkspace(t.instanceId,E)}catch(v){i.value=v instanceof Error?v.message:n("workspaces.removeFailed")}finally{l.value=!1}}}return(E,A)=>(d(),m("section",ji,[i.value?(d(),m("p",Hi,k(i.value),1)):M("",!0),p.value?_e((d(),m("input",{key:1,"onUpdate:modelValue":A[0]||(A[0]=v=>c.value=v),"data-test":"wm-filter",placeholder:E.$t("common.filter"),class:"w-full rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,Vi)),[[Oe,c.value]]):M("",!0),y.value.length?(d(),m("ul",Gi,[(d(!0),m(X,null,ie(g.value,v=>(d(),m("li",{key:v.name,class:"flex items-center justify-between gap-2 px-3 py-2 text-sm"},[f("span",{class:"min-w-0 truncate",title:`${v.name} — ${v.cwd}`},[f("span",Zi,k(v.name),1),f("span",Yi," — "+k(v.cwd),1)],8,Ki),f("button",{"data-test":`wm-remove-${v.name}`,title:E.$t("workspaces.remove",{name:v.name}),"aria-label":E.$t("workspaces.removeAria",{name:v.name}),class:"grid h-7 w-7 shrink-0 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger disabled:opacity-50",disabled:l.value,onClick:w=>$(v.name)},[N(x(hu),{size:14})],8,Xi)]))),128)),g.value.length?M("",!0):(d(),m("li",Ji,k(E.$t("common.noMatch")),1))])):(d(),m("p",Wi,k(E.$t("workspaces.empty")),1)),h.value?(d(),m("div",Qi,[f("div",el,[_e(f("input",{"onUpdate:modelValue":A[2]||(A[2]=v=>a.value=v),"data-test":"wm-name",placeholder:E.$t("workspaces.namePlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,tl),[[Oe,a.value]]),_e(f("input",{"onUpdate:modelValue":A[3]||(A[3]=v=>r.value=v),"data-test":"wm-path",placeholder:E.$t("workspaces.pathPlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,ul),[[Oe,r.value]]),_e(f("input",{"onUpdate:modelValue":A[4]||(A[4]=v=>o.value=v),"data-test":"wm-desc",placeholder:E.$t("workspaces.descPlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,nl),[[Oe,o.value]])]),f("div",sl,[f("button",{"data-test":"wm-create",class:"rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:l.value||!a.value.trim()||!r.value.trim(),onClick:C},k(E.$t("common.add")),9,al),f("button",{type:"button","data-test":"wm-add-cancel",class:"rounded px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:A[5]||(A[5]=v=>h.value=!1)},k(E.$t("common.cancel")),1)])])):(d(),m("button",{key:4,type:"button","data-test":"wm-add-toggle",onClick:A[1]||(A[1]=v=>h.value=!0),class:"flex items-center gap-1.5 rounded border border-dashed border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-accent hover:text-fg"},[N(x(qu),{size:14}),pe(" "+k(E.$t("workspaces.add")),1)]))]))}}),ol={class:"space-y-3"},il={key:0,"data-test":"am-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},ll=["placeholder"],cl={key:2,"data-test":"am-empty",class:"text-sm text-fg-muted"},dl={key:3,class:"max-h-64 divide-y divide-border overflow-y-auto rounded border border-border"},fl=["title"],pl={class:"font-medium text-fg"},hl={class:"text-fg-muted"},bl=["data-test","title","aria-label","disabled","onClick"],ml={key:0,class:"px-3 py-2 text-sm text-fg-muted"},gl={key:5,class:"space-y-2 rounded border border-border p-3"},xl={class:"grid grid-cols-1 gap-2 sm:grid-cols-2"},vl={value:"",disabled:""},yl=["value","disabled"],kl=["placeholder"],_l={class:"flex gap-2"},wl=["disabled"],El=ce({__name:"AgentsManager",props:{instanceId:{}},setup(e){const t=e,u=ft(),{t:n}=It(),s=Z(()=>u.byId(t.instanceId)),a=S(""),r=S(""),o=S(""),i=S(!1),l=S(!1),h=S(""),c=Z(()=>{var A;return(((A=s.value)==null?void 0:A.agentCatalog)??[]).filter(v=>!v.configured)}),y=Z(()=>{var A;return((A=s.value)==null?void 0:A.agents)??[]}),p=Z(()=>y.value.length>6),g=Z(()=>{const A=h.value.trim().toLowerCase();return A?y.value.filter(v=>v.name.toLowerCase().includes(A)||(v.driver??"").toLowerCase().includes(A)):y.value});async function C(){if(!(!a.value||i.value)){i.value=!0,o.value="";try{await u.createAgent(t.instanceId,r.value.trim()||a.value,a.value),a.value="",r.value=""}catch(A){o.value=A instanceof Error?A.message:n("agents.addFailed")}finally{i.value=!1}}}async function $(A){if(!(i.value||!await ku({title:n("agents.removeTitle"),message:n("agents.removeBody",{name:A}),confirmLabel:n("common.remove"),tone:"danger"}))){i.value=!0,o.value="";try{await u.removeAgent(t.instanceId,A)}catch(w){o.value=w instanceof Error?w.message:n("agents.removeFailed")}finally{i.value=!1}}}function E(A){return n(A==="builtin"?"agents.builtin":A==="yes"?"agents.installed":"agents.cliNotDetected")}return(A,v)=>(d(),m("section",ol,[o.value?(d(),m("p",il,k(o.value),1)):M("",!0),p.value?_e((d(),m("input",{key:1,"onUpdate:modelValue":v[0]||(v[0]=w=>h.value=w),"data-test":"am-filter",placeholder:A.$t("common.filter"),class:"w-full rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,ll)),[[Oe,h.value]]):M("",!0),y.value.length?(d(),m("ul",dl,[(d(!0),m(X,null,ie(g.value,w=>(d(),m("li",{key:w.name,class:"flex items-center justify-between gap-2 px-3 py-2 text-sm"},[f("span",{class:"min-w-0 truncate",title:`${w.name} · ${w.driver}`},[f("span",pl,k(w.name),1),f("span",hl," · "+k(w.driver),1)],8,fl),f("button",{"data-test":`am-remove-${w.name}`,title:A.$t("agents.remove",{name:w.name}),"aria-label":A.$t("agents.removeAria",{name:w.name}),class:"grid h-7 w-7 shrink-0 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger disabled:opacity-50",disabled:i.value,onClick:D=>$(w.name)},[N(x(hu),{size:14})],8,bl)]))),128)),g.value.length?M("",!0):(d(),m("li",ml,k(A.$t("common.noMatch")),1))])):(d(),m("p",cl,k(A.$t("agents.empty")),1)),l.value?(d(),m("div",gl,[f("div",xl,[_e(f("select",{"onUpdate:modelValue":v[2]||(v[2]=w=>a.value=w),"data-test":"am-driver",class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},[f("option",vl,k(A.$t("agents.chooseDriver")),1),(d(!0),m(X,null,ie(c.value,w=>(d(),m("option",{key:w.driver,value:w.driver,disabled:w.installed==="unknown"},k(w.driver)+" ("+k(E(w.installed))+") ",9,yl))),128))],512),[[Ur,a.value]]),_e(f("input",{"onUpdate:modelValue":v[3]||(v[3]=w=>r.value=w),"data-test":"am-name",placeholder:A.$t("agents.namePlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,kl),[[Oe,r.value]])]),f("div",_l,[f("button",{"data-test":"am-add",class:"rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:i.value||!a.value,onClick:C},k(A.$t("common.add")),9,wl),f("button",{type:"button","data-test":"am-add-cancel",class:"rounded px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:v[4]||(v[4]=w=>l.value=!1)},k(A.$t("common.cancel")),1)])])):(d(),m("button",{key:4,type:"button","data-test":"am-add-toggle",onClick:v[1]||(v[1]=w=>l.value=!0),class:"flex items-center gap-1.5 rounded border border-dashed border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-accent hover:text-fg"},[N(x(qu),{size:14}),pe(" "+k(A.$t("agents.add")),1)]))]))}}),Al={class:"flex shrink-0 items-center justify-between border-b border-border px-5 py-3"},$l={id:"manage-instance-title",class:"truncate text-sm font-semibold text-fg"},Cl=["aria-label"],Dl={key:0,class:"py-6 text-center text-sm text-fg-muted"},Tl=["id","data-test","aria-selected","aria-controls","tabindex","onClick"],Sl={class:"flex-1 overflow-y-auto p-5"},Fl={key:0,id:"tabpanel-general",role:"tabpanel","aria-labelledby":"tab-general",class:"space-y-6"},Il={class:"space-y-3"},Ml={class:"text-sm font-semibold uppercase text-fg-muted"},zl={key:0,"data-test":"rename-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},Ol={class:"flex gap-2"},Ll=["placeholder"],Rl=["disabled"],Nl={class:"space-y-1"},Pl={class:"text-sm font-semibold uppercase text-fg-muted"},Bl={class:"text-sm text-fg-muted","data-test":"instance-version"},Ul={key:1,id:"tabpanel-workspaces",role:"tabpanel","aria-labelledby":"tab-workspaces"},ql={key:2,id:"tabpanel-agents",role:"tabpanel","aria-labelledby":"tab-agents"},jl='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Hl=ce({__name:"ManageInstanceDialog",props:{instanceId:{},instanceName:{}},emits:["close"],setup(e,{emit:t}){const u=e,n=t,s=ft(),{t:a}=It(),r=Z(()=>{var v;return((v=s.byId(u.instanceId))==null?void 0:v.coreVersion)??null}),o=S(!0),i=["general","workspaces","agents"],l=S("general");function h(v){const w=i.indexOf(l.value);let D=w;if(v.key==="ArrowRight")D=(w+1)%i.length;else if(v.key==="ArrowLeft")D=(w-1+i.length)%i.length;else if(v.key==="Home")D=0;else if(v.key==="End")D=i.length-1;else return;v.preventDefault(),l.value=i[D],qe(()=>{var P,F;(F=(P=C.value)==null?void 0:P.querySelector(`#tab-${i[D]}`))==null||F.focus()})}const c=S(u.instanceName),y=S(""),p=S(!1);async function g(){const v=c.value.trim();if(!(!v||p.value)){p.value=!0,y.value="";try{await s.renameInstance(u.instanceId,v),c.value=v}catch(w){y.value=w instanceof Error?w.message:a("instance.renameFailed")}finally{p.value=!1}}}const C=S(null);let $=null;function E(){return C.value?Array.from(C.value.querySelectorAll(jl)):[]}function A(v){if(v.key==="Escape"){v.preventDefault(),n("close");return}if(v.key!=="Tab")return;const w=E();if(w.length===0)return;const D=w[0],P=w[w.length-1],F=document.activeElement;v.shiftKey&&F===D?(v.preventDefault(),P.focus()):!v.shiftKey&&F===P&&(v.preventDefault(),D.focus())}return ut(async()=>{$=document.activeElement instanceof HTMLElement?document.activeElement:null,document.addEventListener("keydown",A),qe(()=>{var v;(v=E()[0]??C.value)==null||v.focus()});try{await s.loadFormOptions(u.instanceId)}catch{}finally{o.value=!1}}),eu(()=>{var v;document.removeEventListener("keydown",A),(v=$==null?void 0:$.focus)==null||v.call($)}),(v,w)=>(d(),G(tu,{to:"body"},[f("div",{class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:w[2]||(w[2]=Ae(D=>n("close"),["self"]))},[f("div",{ref_key:"dialogEl",ref:C,tabindex:"-1",role:"dialog","aria-modal":"true","aria-labelledby":"manage-instance-title",class:"flex max-h-[85vh] w-full max-w-xl flex-col rounded-xl border border-border bg-raised shadow-xl focus:outline-none","data-test":"manage-instance-dialog"},[f("header",Al,[f("h2",$l,k(v.$t("instance.manageTitle",{name:c.value})),1),f("button",{class:"rounded p-1 text-fg-muted hover:bg-fg/5 hover:text-fg","aria-label":v.$t("instance.close"),onClick:w[0]||(w[0]=D=>n("close"))},[N(x(nt),{size:16})],8,Cl)]),o.value?(d(),m("div",Dl,k(v.$t("instance.dialogLoading")),1)):(d(),m(X,{key:1},[f("nav",{class:"flex shrink-0 gap-1 border-b border-border px-3 pt-2",role:"tablist",onKeydown:h},[(d(),m(X,null,ie(["general","workspaces","agents"],D=>f("button",{key:D,id:`tab-${D}`,"data-test":`tab-${D}`,role:"tab","aria-selected":l.value===D,"aria-controls":`tabpanel-${D}`,tabindex:l.value===D?0:-1,class:J(["rounded-t px-3 py-1.5 text-sm font-medium transition-colors",l.value===D?"border-b-2 border-accent text-fg":"text-fg-muted hover:text-fg"]),onClick:P=>l.value=D},k(D==="general"?v.$t("instance.tabGeneral"):D==="workspaces"?v.$t("workspaces.title"):v.$t("agents.title")),11,Tl)),64))],32),f("div",Sl,[l.value==="general"?(d(),m("div",Fl,[f("section",Il,[f("h3",Ml,k(v.$t("instance.nameLabel")),1),y.value?(d(),m("p",zl,k(y.value),1)):M("",!0),f("div",Ol,[_e(f("input",{"onUpdate:modelValue":w[1]||(w[1]=D=>c.value=D),"data-test":"rename-name",placeholder:v.$t("instance.renamePlaceholder"),class:"min-w-0 flex-1 rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onKeyup:Nn(g,["enter"])},null,40,Ll),[[Oe,c.value]]),f("button",{"data-test":"rename-save",class:"shrink-0 rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:p.value||!c.value.trim(),onClick:g},k(p.value?v.$t("instance.renameSaving"):v.$t("instance.renameSave")),9,Rl)])]),f("section",Nl,[f("h3",Pl,k(v.$t("instance.versionLabel")),1),f("p",Bl,k(r.value?v.$t("instance.coreVersion",{version:r.value}):v.$t("instance.coreVersionUnknown")),1)])])):l.value==="workspaces"?(d(),m("div",Ul,[N(rl,{"instance-id":e.instanceId},null,8,["instance-id"])])):l.value==="agents"?(d(),m("div",ql,[N(El,{"instance-id":e.instanceId},null,8,["instance-id"])])):M("",!0)])],64))],512)])]))}}),Vl={class:"thin-scroll flex h-full flex-1 flex-col space-y-1.5 overflow-y-auto px-2 pb-2 pt-1.5"},Wl=["onClick"],Gl=["title"],Kl={key:2,class:"font-mono text-[10px] tabular-nums text-fg-muted"},Zl={key:3,class:"text-[10px] font-medium text-fg-muted"},Yl={class:"ml-2.5 mt-px space-y-px border-l border-border pl-2.5"},Xl={class:"overflow-hidden rounded-md"},Jl={key:0,class:"absolute bottom-1 left-0 top-1 w-[3px] rounded-full bg-accent"},Ql=["onClick"],ec={key:0,"data-test":"attention-dot","data-attention":"working",class:"pulse-dot h-2 w-2 shrink-0 rounded-full bg-run-bright"},tc={key:1,"data-test":"attention-dot","data-attention":"unread",class:"h-2 w-2 shrink-0 rounded-full bg-info"},uc={key:2,"data-test":"attention-dot","data-attention":"running",class:"h-2 w-2 shrink-0 rounded-full bg-run"},nc={key:3,"data-test":"archived-badge",class:"shrink-0 rounded bg-bg px-1 py-px text-[9px] text-fg-muted"},sc={key:4,"data-test":"session-elapsed",class:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-run"},ac={key:1,"data-test":"session-actions",class:"relative mr-1 shrink-0"},rc=["aria-label","onClick"],oc=["aria-label","title","onClick"],ic=["aria-label","title","onClick"],lc=["onClick"],cc=["onClick"],dc={key:0,"data-test":"sessions-loading",class:"py-1 pl-2.5 text-[11px] text-fg-muted"},fc={key:1,"data-test":"no-sessions",class:"py-1 pl-2.5 text-[11px] text-fg-muted"},pc={class:"flex items-center gap-0.5 pb-px pl-2 pt-0.5"},hc=["title","aria-label","onClick"],bc=["title","aria-label","onClick"],mc=ce({__name:"InstanceTree",emits:["select"],setup(e,{emit:t}){const u=ft(),n=Et(),{t:s}=It(),a=t,r=S(null),o=S(null),i=S(Date.now()),l=setInterval(()=>{i.value=Date.now()},1e3);Ru(()=>clearInterval(l));function h(I,B){const L=n.runningSince(I,B);if(L===null)return"";const _=Math.max(0,Math.floor((i.value-L)/1e3));return _<60?`${_}s`:_<3600?`${Math.floor(_/60)}m`:`${Math.floor(_/3600)}h`}function c(I,B){return n.instanceId===I&&n.sessionAlias===B}const y=S(new Set);function p(I){return!y.value.has(I)}function g(I){const B=new Set(y.value);B.has(I)?B.delete(I):B.add(I),y.value=B,E.value=null,p(I)&&u.loadSessions(I).catch(()=>{})}function C(I){return[...I].sort((B,L)=>Number(B.archived??!1)-Number(L.archived??!1))}const $=S(null),E=S(null),A=S(null),v=S(0);function w(){$.value=null,E.value=null}ut(()=>document.addEventListener("mousedown",w)),Ru(()=>document.removeEventListener("mousedown",w));function D(I){return I.archived?56:112}function P(I,B){const L=`${I}:${B.alias}`,_=D(B);if(A.value===L){const j=E.value===L?-_:0;return`translateX(${Math.max(-_,Math.min(0,j+v.value))}px)`}return E.value===L?`translateX(-${_}px)`:"translateX(0)"}function F(I,B){const L=`${I}:${B}`;if(E.value===L){E.value=null;return}a("select",I,B)}async function V(I,B){$.value=null,E.value=null,await u.archiveSession(I,B).catch(()=>{}),R(I,B)}function R(I,B){Wo({message:s("instance.sessionArchivedToast",{alias:B}),actionLabel:s("instance.undo"),action:()=>{u.unarchiveSession(I,B).catch(()=>{})}})}async function O(I,B){$.value=null,E.value=null,await ku({title:s("instance.deleteSessionTitle"),message:s("instance.deleteSessionBody",{alias:B}),confirmLabel:s("common.delete"),tone:"danger"})&&u.removeSession(I,B).catch(()=>{})}const ae=Z(()=>{const I={};for(const B of u.instances)if(B.online)for(const L of B.sessions){const _=`${B.id}:${L.alias}`,j=D(L);I[_]=Go({onMove:ee=>{$.value=null,A.value=_,v.value=ee},onEnd:ee=>{const fe=E.value===_?-j:0,Ne=Math.max(-j,Math.min(0,fe+ee));E.value=Ne<=-j/2?_:null,A.value=null,v.value=0}}).handlers}return I});return(I,B)=>(d(),m("nav",Vl,[(d(!0),m(X,null,ie(x(u).instances,L=>(d(),m("div",{key:L.id,class:J(L.online?"":"opacity-60")},[f("button",{class:"group flex h-7 w-full items-center gap-1.5 rounded-md px-1.5 transition-colors hover:bg-raised",onClick:_=>g(L.id)},[p(L.id)?(d(),G(x(st),{key:0,size:12,class:"shrink-0 text-fg-muted"})):(d(),G(x(Mt),{key:1,size:12,class:"shrink-0 text-fg-muted"})),f("span",{class:J(["h-2 w-2 shrink-0 rounded-full",L.online?"bg-run":"bg-fg-muted"]),"data-test":"online-dot"},null,2),f("span",{class:J(["flex-1 truncate text-left text-[12.5px] font-semibold",L.online?"text-fg":"text-fg-muted"]),title:L.coreVersion?I.$t("instance.coreVersion",{version:L.coreVersion}):I.$t("instance.coreVersionUnknown")},k(L.name),11,Gl),L.online?(d(),m("span",Kl,k(L.sessions.length),1)):(d(),m("span",Zl,k(I.$t("instance.offline")),1))],8,Wl),_e(f("div",Yl,[(d(!0),m(X,null,ie(C(L.sessions),_=>(d(),m("div",{key:_.alias,"data-test":"session-row",class:"group relative rounded-md"},[f("div",Xl,[f("div",qr({"data-test":"swipe-track",class:["flex touch-pan-y ease-out",A.value===`${L.id}:${_.alias}`?"":"transition-transform duration-200"],style:{transform:P(L.id,_)}},jr(L.online?ae.value[`${L.id}:${_.alias}`]??{}:{})),[f("div",{class:J(["relative flex w-full shrink-0 items-center rounded-md transition-colors",c(L.id,_.alias)?"bg-accent/10":"hover:bg-raised"])},[c(L.id,_.alias)?(d(),m("span",Jl)):M("",!0),f("button",{class:"flex min-w-0 flex-1 items-center gap-2 py-2 pl-2.5 pr-1.5 text-left",onClick:j=>F(L.id,_.alias)},[!_.archived&&x(n).sessionAttention(L.id,_.alias)==="working"?(d(),m("span",ec)):!_.archived&&x(n).sessionAttention(L.id,_.alias)==="unread"?(d(),m("span",tc)):!_.archived&&_.running?(d(),m("span",uc)):M("",!0),f("span",{class:J(["truncate text-[12.5px] font-medium",_.archived?"text-fg-muted":c(L.id,_.alias)?"font-semibold text-accent":"text-fg"])},k(_.alias),3),f("span",{class:J(["shrink-0 rounded px-1 py-px font-mono text-[9.5px]",c(L.id,_.alias)?"bg-accent/15 text-accent":"bg-bg text-fg-muted"])},k(_.agent),3),_.archived?(d(),m("span",nc,k(I.$t("instance.sessionArchivedBadge")),1)):M("",!0),!_.archived&&h(L.id,_.alias)?(d(),m("span",sc,k(h(L.id,_.alias)),1)):M("",!0)],8,Ql),L.online?(d(),m("div",ac,[f("button",{"data-test":"session-menu","aria-label":I.$t("common.more"),class:"grid h-5 w-5 place-items-center rounded text-fg-muted hover:bg-raised hover:text-fg opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100",onClick:Ae(j=>{E.value=null,$.value=$.value===`${L.id}:${_.alias}`?null:`${L.id}:${_.alias}`},["stop"])},[N(x(so),{size:13})],8,rc)])):M("",!0)],2),L.online?(d(),m(X,{key:0},[_.archived?M("",!0):(d(),m("button",{key:0,"data-test":"swipe-archive","aria-label":I.$t("instance.archiveSession"),title:I.$t("instance.archiveSession"),class:"flex w-14 shrink-0 items-center justify-center bg-warn text-white transition-colors hover:bg-warn/90",onClick:Ae(j=>V(L.id,_.alias),["stop"])},[N(x(xs),{size:16})],8,oc)),f("button",{"data-test":"swipe-delete","aria-label":I.$t("common.delete"),title:I.$t("common.delete"),class:"flex w-14 shrink-0 items-center justify-center bg-danger text-white transition-colors hover:bg-danger/90",onClick:Ae(j=>O(L.id,_.alias),["stop"])},[N(x(hu),{size:16})],8,ic)],64)):M("",!0)],16)]),L.online&&$.value===`${L.id}:${_.alias}`?(d(),m("div",{key:0,onMousedown:B[0]||(B[0]=Ae(()=>{},["stop"])),class:"absolute right-1 top-full z-30 mt-0.5 w-32 rounded-md border border-border bg-surface py-1 shadow-lg"},[_.archived?M("",!0):(d(),m("button",{key:0,"data-test":"action-archive",class:"flex w-full items-center gap-2 px-2.5 py-1 text-left text-[12px] text-fg hover:bg-raised",onClick:Ae(j=>V(L.id,_.alias),["stop"])},[N(x(xs),{size:12}),pe(k(I.$t("instance.archiveSession")),1)],8,lc)),f("button",{"data-test":"delete-session",class:"flex w-full items-center gap-2 px-2.5 py-1 text-left text-[12px] text-danger hover:bg-danger/10",onClick:Ae(j=>O(L.id,_.alias),["stop"])},[N(x(hu),{size:12}),pe(k(I.$t("common.delete")),1)],8,cc)],32)):M("",!0)]))),128)),L.online&&!L.sessionsLoaded&&!L.sessions.length?(d(),m("div",dc,k(I.$t("instance.loading")),1)):L.sessionsLoaded&&!L.sessions.length?(d(),m("div",fc,k(I.$t("instance.noSessions")),1)):M("",!0),f("div",pc,[f("button",{"data-test":"new-session",title:I.$t("instance.newSession"),"aria-label":I.$t("instance.newSession"),class:"grid h-6 w-6 place-items-center rounded text-accent transition-colors hover:bg-accent/10",onClick:_=>r.value={id:L.id,name:L.name}},[N(x(qu),{size:14})],8,hc),f("button",{"data-test":"manage-instance",title:I.$t("instance.manage"),"aria-label":I.$t("instance.manage"),class:"grid h-6 w-6 place-items-center rounded text-fg-muted transition-colors hover:bg-raised hover:text-fg",onClick:_=>o.value={id:L.id,name:L.name}},[N(x(yo),{size:13})],8,bc)])],512),[[Pn,p(L.id)]])],2))),128)),r.value?(d(),G(qi,{key:0,"instance-id":r.value.id,"instance-name":r.value.name,onClose:B[1]||(B[1]=L=>r.value=null),onCreated:B[2]||(B[2]=L=>r.value=null)},null,8,["instance-id","instance-name"])):M("",!0),o.value?(d(),G(Hl,{key:1,"instance-id":o.value.id,"instance-name":o.value.name,onClose:B[3]||(B[3]=L=>o.value=null)},null,8,["instance-id","instance-name"])):M("",!0)]))}});async function gc(e,t=512){if(!e.type.startsWith("image/"))return;const u=await createImageBitmap(e,{imageOrientation:"from-image"}).catch(()=>null);if(!u)return;const n=Math.min(1,t/Math.max(u.width,u.height)),s=Math.max(1,Math.round(u.width*n)),a=Math.max(1,Math.round(u.height*n)),r=document.createElement("canvas");r.width=s,r.height=a;const o=r.getContext("2d");if(o)return o.drawImage(u,0,0,s,a),u.close(),r.toDataURL("image/jpeg",.8)}function xc(e){return new Promise((t,u)=>{const n=new FileReader;n.onload=()=>{const s=n.result;t(s.slice(s.indexOf(",")+1))},n.onerror=()=>u(n.error),n.readAsDataURL(e)})}const vc=5,yc=10*1024*1024,Da=wt("composer",()=>{const e=S(null);let t=0;function u(y,p){e.value={key:y,text:p,seq:++t}}const n=S([]),s=S(!1),a=S(null);let r="",o=0;function i(y){r=y}async function l(y){const p=r;if(p){a.value=null,s.value=!0;for(const g of y){if(n.value.length>=vc){a.value={reason:"too-many",filename:g.name};break}if(g.size>yc){a.value={reason:"too-large",filename:g.name};continue}const C=`local-${++o}`,$=g.type.startsWith("image/")?"image":"file",E={id:C,filename:g.name,mimeType:g.type||"application/octet-stream",size:g.size,kind:$,status:"uploading"};n.value.push(E);try{const A=await gc(g);A&&(E.previewUrl=A);const v=await xc(g),w=await se.upload(p,{filename:g.name,content:v,mimeType:E.mimeType});E.filePath=w.path,E.id=w.id,E.size=w.size,E.status="ready"}catch{E.status="error"}}s.value=n.value.some(g=>g.status==="uploading")}}function h(y){n.value=n.value.filter(p=>p.id!==y),a.value=null}function c(){n.value=[],a.value=null}return{insertRequest:e,requestInsert:u,pending:n,uploading:s,rejection:a,bindInstance:i,addFiles:l,removeAttachment:h,clearAttachments:c}}),Ds={};function kc(e){let t=Ds[e];if(t)return t;t=Ds[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);t.push(n)}for(let u=0;u<e.length;u++){const n=e.charCodeAt(u);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function Jt(e,t){typeof t!="string"&&(t=Jt.defaultChars);const u=kc(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let s="";for(let a=0,r=n.length;a<r;a+=3){const o=parseInt(n.slice(a+1,a+3),16);if(o<128){s+=u[o];continue}if((o&224)===192&&a+3<r){const i=parseInt(n.slice(a+4,a+6),16);if((i&192)===128){const l=o<<6&1984|i&63;l<128?s+="��":s+=String.fromCharCode(l),a+=3;continue}}if((o&240)===224&&a+6<r){const i=parseInt(n.slice(a+4,a+6),16),l=parseInt(n.slice(a+7,a+9),16);if((i&192)===128&&(l&192)===128){const h=o<<12&61440|i<<6&4032|l&63;h<2048||h>=55296&&h<=57343?s+="���":s+=String.fromCharCode(h),a+=6;continue}}if((o&248)===240&&a+9<r){const i=parseInt(n.slice(a+4,a+6),16),l=parseInt(n.slice(a+7,a+9),16),h=parseInt(n.slice(a+10,a+12),16);if((i&192)===128&&(l&192)===128&&(h&192)===128){let c=o<<18&1835008|i<<12&258048|l<<6&4032|h&63;c<65536||c>1114111?s+="����":(c-=65536,s+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),a+=9;continue}}s+="�"}return s})}Jt.defaultChars=";/?:@&=+$,#";Jt.componentChars="";const Ts={};function _c(e){let t=Ts[e];if(t)return t;t=Ts[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+u.toString(16).toUpperCase()).slice(-2))}for(let u=0;u<e.length;u++)t[e.charCodeAt(u)]=e[u];return t}function wu(e,t,u){typeof t!="string"&&(u=t,t=wu.defaultChars),typeof u>"u"&&(u=!0);const n=_c(t);let s="";for(let a=0,r=e.length;a<r;a++){const o=e.charCodeAt(a);if(u&&o===37&&a+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){s+=e.slice(a,a+3),a+=2;continue}if(o<128){s+=n[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&a+1<r){const i=e.charCodeAt(a+1);if(i>=56320&&i<=57343){s+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[a])}return s}wu.defaultChars=";/?:@&=+$,-_.!~*'()#";wu.componentChars="-_.!~*'()";function qn(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Bu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wc=/^([a-z0-9.+-]+:)/i,Ec=/:[0-9]*$/,Ac=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$c=["<",">",'"',"`"," ","\r",`
|
|
241
|
+
*/const nt=te("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var ys=1;function Eo(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"invalid-json"}}return Ao(t)?t.protocolVersion!==ys?{ok:!1,error:"version-mismatch",detail:`expected protocolVersion ${ys}, got ${t.protocolVersion}`}:{ok:!0,envelope:t}:{ok:!1,error:"invalid-envelope"}}function Ao(e){if(typeof e!="object"||e===null)return!1;const t=e;return!(typeof t.protocolVersion!="number"||!Number.isInteger(t.protocolVersion)||t.kind!=="req"&&t.kind!=="res"&&t.kind!=="event"||typeof t.type!="string"||t.type.trim().length===0||t.id!==void 0&&typeof t.id!="string"||(t.kind==="req"||t.kind==="res")&&(typeof t.id!="string"||t.id.length===0))}function Yt(e){if(typeof e!="object"||e===null)return!1;const t=e.error;if(typeof t!="object"||t===null)return!1;const u=t;return typeof u.code=="string"&&typeof u.message=="string"}var $o="web.event",Co=new Set(["instance-status","control-event","notice"]),Do=new Set(["turn-output","turn-started","tool-event","turn-thought","plan","turn-usage","agent-commands","turn-finished","sessions-changed","workspaces-changed","scheduled-changed","orchestration-changed"]),To=new Set(["read","search","execute","edit","think","other"]),So=new Set(["running","success","error"]),ct=e=>typeof e=="string",Wt=e=>e===void 0||typeof e=="string",Fo=e=>e===void 0||typeof e=="number";function Io(e){switch(e.type){case"diff":return ct(e.path)&&ct(e.oldText)&&ct(e.newText);case"read":return ct(e.path)&&Wt(e.lines)&&Wt(e.preview);case"command":return ct(e.command)&&Wt(e.output)&&Fo(e.exitCode);case"search":return ct(e.query)&&Wt(e.output);case"text":return ct(e.text);case"fields":return Array.isArray(e.fields)&&e.fields.every(t=>t!==null&&typeof t=="object"&&ct(t.label)&&ct(t.value))&&Wt(e.output);default:return!1}}function Mo(e){if(typeof e!="object"||e===null)return!1;const t=e;return!(typeof t.toolCallId!="string"||typeof t.toolName!="string"||typeof t.title!="string"||typeof t.kind!="string"||!To.has(t.kind)||typeof t.status!="string"||!So.has(t.status)||!Wt(t.error)||t.detail!==void 0&&(typeof t.detail!="object"||t.detail===null||!Io(t.detail)))}function zo(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.type!="string"||!Do.has(t.type)?!1:t.type==="turn-output"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.chunk=="string":t.type==="turn-finished"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.ok=="boolean":t.type==="scheduled-changed"?typeof t.chatKey=="string":t.type==="turn-started"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string":t.type==="turn-thought"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.chunk=="string":t.type==="plan"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Array.isArray(t.entries):t.type==="turn-usage"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&typeof t.used=="number"&&typeof t.size=="number":t.type==="agent-commands"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Array.isArray(t.commands)&&t.commands.every(u=>u!==null&&typeof u=="object"&&typeof u.name=="string"):t.type==="tool-event"?typeof t.chatKey=="string"&&typeof t.sessionAlias=="string"&&Mo(t.step):!0}var Oo=new Set(["task-completion","task-progress","coordinator-message"]);function Lo(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.kind=="string"&&Oo.has(t.kind)&&typeof t.text=="string"}function Ro(e){if(e.kind!=="event"||e.type!==$o)return null;const t=e.payload;if(typeof t!="object"||t===null)return null;const u=t;return typeof u.instanceId!="string"||typeof u.kind!="string"||!Co.has(u.kind)||u.kind==="instance-status"&&typeof u.online!="boolean"||u.kind==="control-event"&&!zo(u.event)||u.kind==="notice"&&!Lo(u.notice)?null:t}function No(e,t){let u=null,n=!1,s=0,a=null;const r=()=>{const o=location.protocol==="https:"?"wss":"ws";u=new WebSocket(`${o}://${location.host}/ws`),u.onmessage=i=>{const l=Eo(String(i.data));if(!l.ok)return;const h=Ro(l.envelope);h&&e(h)},u.onopen=()=>{s=0,t==null||t(!0)},u.onclose=()=>{t==null||t(!1),!n&&(s=Math.min(s+1,6),a=setTimeout(()=>{a=null,n||r()},250*2**(s-1)))}};return r(),()=>{n=!0,a&&(clearTimeout(a),a=null),u==null||u.close()}}function Dt(e){if(Yt(e))throw e.error.code==="unknown-type"?new Error("This feature needs a newer connector — rebuild and reconnect the relay channel on that instance."):new Error(e.error.message||e.error.code);return e}const ft=wt("instances",()=>{const e=S([]);async function t(){const{instances:v}=await se.get("/api/instances");e.value=v.map(w=>{const D=A(w.id);return{...w,sessions:(D==null?void 0:D.sessions)??[],sessionsLoaded:(D==null?void 0:D.sessionsLoaded)??!1,agents:(D==null?void 0:D.agents)??[],workspaces:(D==null?void 0:D.workspaces)??[],agentCatalog:(D==null?void 0:D.agentCatalog)??[]}});for(const w of e.value)w.online&&!w.sessionsLoaded&&u(w.id).catch(()=>{})}async function u(v){const{sessions:w}=await se.rpc(v,"control.sessions.list"),D=A(v);D&&(D.sessions=w,D.sessionsLoaded=!0)}async function n(v){const{workspaces:w}=await se.rpc(v,"control.workspaces.list"),D=A(v);D&&(D.workspaces=w)}async function s(v){const[{agents:w},{workspaces:D},{agents:P}]=await Promise.all([se.rpc(v,"control.agents.list"),se.rpc(v,"control.workspaces.list"),se.rpc(v,"control.agents.catalog")]),F=A(v);F&&(F.agents=w,F.workspaces=D,F.agentCatalog=P)}async function a(v){const{agents:w}=await se.rpc(v,"control.agents.catalog"),D=A(v);D&&(D.agentCatalog=w)}async function r(v,w,D){Dt(await se.rpc(v,"control.agents.create",{name:w,driver:D})),await s(v)}async function o(v,w){Dt(await se.rpc(v,"control.agents.remove",{name:w})),await s(v)}async function i(v,w){Dt(await se.rpc(v,"control.workspaces.remove",{name:w})),await s(v)}async function l(v,w,D,P){const{workspace:F}=Dt(await se.rpc(v,"control.workspaces.create",{name:w,cwd:D,description:P})),V=A(v);return V&&!V.workspaces.some(R=>R.name===F.name)&&(V.workspaces=[...V.workspaces,F]),F}async function h(v,w,D,P,F,V){try{Dt(await se.rpc(v,"control.sessions.create",{alias:w,agent:D,workspace:P,...F?{agentSessionId:F}:{},...V?{model:V}:{}}))}catch(R){if(R instanceof Lu&&(R.status===504||R.code==="timeout"))return{pending:!0};throw R}return await u(v),{pending:!1}}async function c(v,w,D){const{sessions:P}=Dt(await se.rpc(v,"control.sessions.native.list",{agent:w,workspace:D}));return P}async function y(v,w,D){const P=A(v),F=((P==null?void 0:P.sessions)??[]).find(V=>V.agent===w&&V.workspace===D);if(!F)return[];try{const V=Dt(await se.rpc(v,"control.session.model.get",{sessionAlias:F.alias})),R=new Set,O=[];for(const ae of[...V.current?[V.current]:[],...V.available])ae&&!R.has(ae)&&(R.add(ae),O.push(ae));return O}catch{return[]}}async function p(v,w){await se.rpc(v,"control.sessions.remove",{alias:w}),await u(v)}async function g(v,w){await se.rpc(v,"control.sessions.archive",{alias:w}),await u(v)}async function C(v,w){await se.rpc(v,"control.sessions.unarchive",{alias:w}),await u(v)}async function $(v,w){await se.patch(`/api/instances/${v}`,{name:w});const D=A(v);D&&(D.name=w)}function E(v){if(v.kind==="instance-status"){const w=A(v.instanceId);w&&(w.online=v.online,v.online&&!w.sessionsLoaded&&u(v.instanceId).catch(()=>{}))}else v.kind==="control-event"&&v.event.type==="sessions-changed"?u(v.instanceId).catch(()=>{}):v.kind==="control-event"&&v.event.type==="workspaces-changed"&&n(v.instanceId).catch(()=>{})}function A(v){return e.value.find(w=>w.id===v)}return{instances:e,loadInstances:t,loadSessions:u,loadWorkspaces:n,loadFormOptions:s,loadAgentCatalog:a,createWorkspace:l,createAgent:r,removeAgent:o,removeWorkspace:i,createSession:h,listNativeSessions:c,listModelSuggestions:y,removeSession:p,archiveSession:g,unarchiveSession:C,renameInstance:$,applyEvent:E,byId:A}}),wa="xrelay.selectedSession";function Po(e,t){try{localStorage.setItem(wa,JSON.stringify({instanceId:e,alias:t}))}catch{}}function Bo(){try{const e=localStorage.getItem(wa);if(!e)return null;const t=JSON.parse(e);return typeof t.instanceId=="string"&&typeof t.alias=="string"?{instanceId:t.instanceId,alias:t.alias}:null}catch{return null}}function Uo(e,t){const u=e[e.length-1];(u==null?void 0:u.type)==="text"?u.text+=t:e.push({type:"text",text:t})}function qo(e,t){const u=e[e.length-1];if((u==null?void 0:u.type)==="reasoning"){u.text+=t;return}t.trim()&&e.push({type:"reasoning",text:t})}function jo(e,t){const u=e.findIndex(n=>n.type==="tool"&&n.step.toolCallId===t.toolCallId);u>=0?e[u]={type:"tool",step:t}:e.push({type:"tool",step:t})}const ks=e=>e.filter(t=>t.type==="text").map(t=>t.text).join(""),_s=e=>e.filter(t=>t.type==="tool").map(t=>t.step),Ho=e=>e.filter(t=>t.type==="reasoning").map(t=>t.text).join(""),Et=wt("chat",()=>{const e=S(null),t=S(null),u=S([]),n=S({}),s=S({}),a=S({}),r=S({}),o=S(new Set),i=new Set,l=(Y,U)=>`${Y}\0${U}`;function h(Y,U){const ue=l(Y,U);return n.value[ue]?"working":o.value.has(ue)?"unread":"idle"}function c(Y,U){var ue;return((ue=n.value[l(Y,U)])==null?void 0:ue.startedAt)??null}const y=Z(()=>e.value&&t.value?l(e.value,t.value):null),p=Z(()=>y.value?n.value[y.value]??null:null),g=Z(()=>y.value?s.value[y.value]??null:null),C=Z(()=>y.value?a.value[y.value]??null:null),$=Z(()=>y.value?r.value[y.value]??[]:[]),E=Z(()=>p.value?ks(p.value.parts):""),A=Z(()=>p.value?_s(p.value.parts):[]),v=Z(()=>p.value!==null),w=S(!1),D=S(""),P=S(null);let F=0;function V(Y){P.value={taskId:Y,nonce:++F}}const R=100,O=S(!1),ae=S(!1);function I(Y){let U=n.value[Y];return U||(U={parts:[],status:"working",startedAt:Date.now()},n.value[Y]=U),U}function B(Y,U,ue,re){const ke=l(Y,U),Se=n.value[ke];delete n.value[ke];const At=Y===e.value&&U===t.value;if(ue==="error"&&At&&(D.value=re??"turn-failed"),!Se)return;const ot=ks(Se.parts),z=_s(Se.parts),K=Ho(Se.parts);if((ot.length>0||z.length>0||K.length>0)&&At){const oe=z.length>0||K.length>0?{toolSteps:z,...K?{reasoning:K}:{},parts:Se.parts}:void 0;u.value.push({instanceId:Y,sessionAlias:U,direction:"out",text:ot,createdAt:new Date().toISOString(),failed:ue==="error",status:ue,...oe?{structured:oe}:{}})}}function L(Y,U){e.value=Y,t.value=U,Po(Y,U),u.value=[],D.value="",O.value=!1,ae.value=!1;const ue=l(Y,U);if(o.value.has(ue)){const re=new Set(o.value);re.delete(ue),o.value=re}}async function _(){if(!e.value||!t.value)return;const{messages:Y,hasMore:U}=await se.get(`/api/instances/${e.value}/sessions/${t.value}/messages?limit=${R}`);u.value=Y,O.value=U??!1}async function j(){var re;if(!e.value||!t.value||ae.value||!O.value)return;const Y=(re=u.value.find(ke=>typeof ke.id=="number"))==null?void 0:re.id;if(Y===void 0)return;const U=e.value,ue=t.value;ae.value=!0;try{const{messages:ke,hasMore:Se}=await se.get(`/api/instances/${U}/sessions/${ue}/messages?before=${Y}&limit=${R}`);if(U!==e.value||ue!==t.value)return;ke.length>0&&(u.value=[...ke,...u.value]),O.value=Se??!1}catch{}finally{ae.value=!1}}function ee(Y){for(const U of Y){const ue=l(U.instanceId,U.sessionAlias);n.value[ue]||i.has(ue)||(n.value[ue]={parts:U.parts,status:U.status,startedAt:U.startedAt})}}async function fe(){const{turns:Y}=await se.get("/api/active-turns");ee(Y)}function Ne(Y){if(Y.kind==="instance-status"&&!Y.online){const ue=`${Y.instanceId}\0`;for(const ke of Object.keys(n.value))ke.startsWith(ue)&&delete n.value[ke];const re=new Set([...o.value].filter(ke=>!ke.startsWith(ue)));re.size!==o.value.size&&(o.value=re);return}if(Y.kind!=="control-event")return;const U=Y.event;if(U.type==="turn-started"){const ue=l(Y.instanceId,U.sessionAlias);i.delete(ue),I(ue);const re=Y.instanceId===e.value&&U.sessionAlias===t.value;U.prompt&&re&&u.value.push({instanceId:Y.instanceId,sessionAlias:U.sessionAlias,direction:"in",text:U.prompt,createdAt:new Date().toISOString(),...U.scheduled?{scheduled:U.scheduled}:{}})}else if(U.type==="turn-output"){const ue=I(l(Y.instanceId,U.sessionAlias));Uo(ue.parts,U.chunk),ue.status="streaming"}else if(U.type==="tool-event"){const ue=I(l(Y.instanceId,U.sessionAlias));jo(ue.parts,U.step)}else if(U.type==="turn-thought")qo(I(l(Y.instanceId,U.sessionAlias)).parts,U.chunk);else if(U.type==="plan")s.value[l(Y.instanceId,U.sessionAlias)]=U.entries;else if(U.type==="turn-usage")a.value[l(Y.instanceId,U.sessionAlias)]={used:U.used,size:U.size,...U.cost?{cost:U.cost}:{},...U.breakdown?{breakdown:U.breakdown}:{}};else if(U.type==="agent-commands")r.value[l(Y.instanceId,U.sessionAlias)]=U.commands;else if(U.type==="session-history")Y.instanceId===e.value&&U.sessionAlias===t.value&&_().catch(()=>{});else if(U.type==="turn-finished"){const ue=U.cancelled?"cancelled":U.ok?"done":"error",re=Y.instanceId===e.value&&U.sessionAlias===t.value;if(i.add(l(Y.instanceId,U.sessionAlias)),B(Y.instanceId,U.sessionAlias,ue,U.errorMessage),!re&&(ue==="done"||ue==="error")){const ke=l(Y.instanceId,U.sessionAlias),Se=new Set(o.value);Se.add(ke),o.value=Se}}}async function Lt(Y,U=[]){if(!e.value||!t.value)return;D.value="",w.value=!0;const ue={instanceId:e.value,sessionAlias:t.value,direction:"in",text:Y,createdAt:new Date().toISOString(),...U.length>0?{attachments:U.map(re=>({id:re.id,filename:re.fileName,mimeType:re.mimeType,size:re.size,kind:re.kind,...re.previewUrl?{previewUrl:re.previewUrl}:{}}))}:{}};u.value.push(ue);try{const re=await se.rpc(e.value,"control.prompt",{sessionAlias:t.value,text:Y,...U.length>0?{media:U}:{}});re&&re.ok===!1&&(D.value=re.errorMessage??"prompt-failed",ue.failed=!0)}catch(re){re instanceof Lu&&(re.status===504||re.code==="timeout")||(D.value=re instanceof Lu?re.code:"send-failed",ue.failed=!0)}finally{w.value=!1}}async function ge(Y){if(!Y.failed||Y.direction!=="in")return;const U=u.value.indexOf(Y);U>=0&&u.value.splice(U,1),await Lt(Y.text)}async function Rt(){if(!e.value||!t.value)return;const Y=e.value,U=t.value;B(Y,U,"cancelled");try{await se.rpc(Y,"control.prompt.cancel",{sessionAlias:U})}catch(ue){D.value=ue instanceof Lu?ue.code:"cancel-failed"}}return{instanceId:e,sessionAlias:t,messages:u,streaming:E,liveTurn:p,sessionPlan:g,sessionUsage:C,sessionCommands:$,liveToolSteps:A,busy:v,unread:o,sessionAttention:h,runningSince:c,sending:w,error:D,scrollRequest:P,requestScrollToScheduled:V,hasMoreOlder:O,loadingOlder:ae,select:L,loadHistory:_,loadOlder:j,loadActiveTurns:fe,seedActiveTurns:ee,applyEvent:Ne,send:Lt,resend:ge,cancel:Rt}}),_u=wt("tasks",()=>{const e=S([]),t=S([]),u=S(null);async function n(h,c){const{tasks:y}=await se.rpc(h,"control.scheduled.list");e.value=y.filter(p=>p.sessionAlias===c)}async function s(h){const{tasks:c}=await se.rpc(h,"control.orchestration.list");t.value=c}async function a(h,c){u.value={instanceId:h,sessionAlias:c},await Promise.all([n(h,c).catch(()=>{e.value=[]}),s(h).catch(()=>{t.value=[]})])}async function r(h,c,y,p){await se.rpc(h,"control.scheduled.create",{sessionAlias:c,executeAt:y,message:p}),await n(h,c)}async function o(h){const c=u.value;c&&(await se.rpc(c.instanceId,"control.scheduled.cancel",{id:h}),await n(c.instanceId,c.sessionAlias))}async function i(h){const c=u.value;c&&(await se.rpc(c.instanceId,"control.orchestration.cancel",{taskId:h}),await s(c.instanceId))}function l(h){if(h.kind!=="control-event")return;const c=u.value;!c||h.instanceId!==c.instanceId||(h.event.type==="scheduled-changed"?n(c.instanceId,c.sessionAlias).catch(()=>{}):h.event.type==="orchestration-changed"&&s(c.instanceId).catch(()=>{}))}return{scheduled:e,orchestration:t,scope:u,loadScheduled:n,loadOrchestration:s,loadFor:a,createScheduled:r,cancelScheduled:o,cancelOrchestration:i,applyEvent:l}}),ws=20,Ea=wt("notices",()=>{const e=S([]);let t=0;function u(s){s.kind==="notice"&&(e.value.unshift({id:++t,instanceId:s.instanceId,kind:s.notice.kind,text:s.notice.text}),e.value.length>ws&&(e.value.length=ws))}function n(s){e.value=e.value.filter(a=>a.id!==s)}return{items:e,applyEvent:u,dismiss:n}}),Aa=wt("connection",()=>{const e=S(!1);function t(u){e.value=u}return{online:e,setOnline:t}});function ou(e){if(Yt(e))throw new Error(e.error.message||e.error.code);return e}const Hu=wt("files",()=>{const e=S(null),t=S(null),u=S(""),n=S([]),s=S(null),a=S(null),r=S(null),o=S(!1),i=S("files"),l=S({}),h=S(null),c=S(""),y=S([]),p=S(!1),g=S(!1),C=S(!1),$=S("");function E(){t.value=null,u.value="",n.value=[],s.value=null,a.value=null,r.value=null,o.value=!1,l.value={},c.value="",y.value=[],$.value=""}async function A(I,B){e.value=I,t.value=B,s.value=null,a.value=null,r.value=null,o.value=!1,l.value={},c.value="",y.value=[],await D(""),v()}async function v(){if(!(!e.value||!t.value))try{const I=await se.rpc(e.value,"control.fs.diff",{workspace:t.value});if(Yt(I)){l.value={};return}const B={};for(const L of I.files)B[L.path]=L.status;l.value=B}catch{l.value={}}}async function w(I,B){if(!I||!B){h.value=null;return}try{const L=await se.rpc(I,"control.fs.diff",{workspace:B});if(Yt(L)){h.value=null;return}const _=typeof L.branch=="string"?L.branch:void 0,j=L.detached===!0;h.value={workspace:B,changedCount:L.files.length,..._?{branch:_}:{},...j?{detached:!0}:{}}}catch{h.value=null}}async function D(I){if(!(!e.value||!t.value)){C.value=!0,$.value="",s.value=null;try{const B=ou(await se.rpc(e.value,"control.fs.list",{workspace:t.value,path:I}));u.value=B.path,n.value=B.entries}catch(B){$.value=B instanceof Error?B.message:"list-failed"}finally{C.value=!1}}}async function P(I){const B=u.value?`${u.value}/${I.name}`:I.name;if(I.type==="dir")return D(B);if(!(!e.value||!t.value)){C.value=!0,$.value="";try{s.value=ou(await se.rpc(e.value,"control.fs.read",{workspace:t.value,path:B}))}catch(L){$.value=L instanceof Error?L.message:"read-failed"}finally{C.value=!1}}}async function F(I){if(!(!e.value||!t.value)){C.value=!0,$.value="";try{s.value=ou(await se.rpc(e.value,"control.fs.read",{workspace:t.value,path:I}))}catch(B){$.value=B instanceof Error?B.message:"read-failed"}finally{C.value=!1}}}async function V(){if(!(!e.value||!t.value)){if(i.value==="changes"){await ae(r.value??void 0);return}await D(u.value),await v(),await w(e.value,t.value)}}function R(I){const B=u.value?u.value.split("/"):[];D(B.slice(0,I+1).join("/"))}async function O(I){if(c.value=I,!e.value||!t.value||!I.trim()){y.value=[],p.value=!1;return}g.value=!0,$.value="";try{const B=ou(await se.rpc(e.value,"control.fs.search",{workspace:t.value,query:I}));y.value=B.matches,p.value=B.truncated}catch(B){$.value=B instanceof Error?B.message:"search-failed"}finally{g.value=!1}}async function ae(I){if(!(!e.value||!t.value)){C.value=!0,$.value="",r.value=I??null;try{a.value=ou(await se.rpc(e.value,"control.fs.diff",{workspace:t.value,...I?{path:I}:{}})),o.value=!1}catch(B){const L=B instanceof Error?B.message:"diff-failed";a.value=null,L==="not-a-git-repo"?o.value=!0:$.value=L}finally{C.value=!1}}}return{instanceId:e,workspace:t,path:u,entries:n,file:s,diff:a,diffPath:r,notGit:o,changed:l,gitSummary:h,tab:i,query:c,results:y,searchTruncated:p,searching:g,loading:C,error:$,reset:E,selectWorkspace:A,list:D,open:P,openFile:F,up:R,search:O,loadDiff:ae,loadStatus:v,loadGitSummary:w,refresh:V}}),Xt=S(null);let Qe=null;function Vo(){return Xt}function Wo(e,t=6e3){Qe&&clearTimeout(Qe),Xt.value=e,Qe=setTimeout(()=>{Xt.value=null,Qe=null},t)}function Es(){const e=Xt.value;Xt.value=null,Qe&&(clearTimeout(Qe),Qe=null),e==null||e.action()}function As(){Xt.value=null,Qe&&(clearTimeout(Qe),Qe=null)}function Go(e){const t=e.intent??4;let u=0,n=0,s=!1,a=!1,r=!1;function o(c){u=c.clientX,n=c.clientY,s=!0,a=!1,r=!1}function i(c){var g,C;if(!s)return;const y=c.clientX-u,p=c.clientY-n;if(!a){if(Math.abs(y)<t&&Math.abs(p)<t)return;a=!0,r=Math.abs(y)>Math.abs(p)}if(!r){s=!1,(g=e.onEnd)==null||g.call(e,0);return}(C=e.onMove)==null||C.call(e,y)}function l(c){var y;s&&(s=!1,(y=e.onEnd)==null||y.call(e,r?c.clientX-u:0))}function h(){var c;s&&(s=!1,(c=e.onEnd)==null||c.call(e,0))}return{handlers:{pointerdown:o,pointermove:i,pointerup:l,pointercancel:h}}}function $a(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function hn(e,t){return $a(`${e}-${t}`)}function bn(e,t){const u=new Set(t);if(!u.has(e))return e;for(let n=2;;n+=1){const s=`${e}-${n}`;if(!u.has(s))return s}}function $s(e){const u=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??"";return $a(u)}function Ca(){return Br.global.locale.value}function Cs(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString(Ca(),{hour:"2-digit",minute:"2-digit"})}function Un(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(Ca())}const Ko=["data-test","aria-label","aria-expanded"],Zo={key:0,class:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-border bg-raised py-1 shadow-xl"},Yo={key:0,class:"px-3 pb-0.5 pt-1.5 text-[11px] font-medium uppercase tracking-wide text-fg-muted"},Xo=["data-value","onMousedown","onMouseenter"],Jo={class:"truncate"},mn=ce({__name:"SelectMenu",props:{modelValue:{},groups:{},placeholder:{},dataTest:{},ariaLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const u=e,n=t,s=S(!1),a=S(null),r=S(-1),o=Z(()=>u.groups.flatMap(E=>E.options)),i=Z(()=>{var E;return((E=o.value.find(A=>A.value===u.modelValue))==null?void 0:E.label)??""});function l(){s.value=!0;const E=o.value.findIndex(A=>A.value===u.modelValue&&!A.disabled);r.value=E>=0?E:o.value.findIndex(A=>!A.disabled)}function h(){s.value=!1}function c(){s.value?h():l()}function y(E){E.disabled||(n("update:modelValue",E.value),h())}function p(E){const A=o.value;if(!A.length)return;let v=r.value;for(let w=0;w<A.length;w++)if(v=(v+E+A.length)%A.length,!A[v].disabled){r.value=v;return}}function g(E){if(!s.value){(E.key==="Enter"||E.key===" "||E.key==="ArrowDown")&&(E.preventDefault(),l());return}if(E.key==="ArrowDown")E.preventDefault(),p(1);else if(E.key==="ArrowUp")E.preventDefault(),p(-1);else if(E.key==="Enter"||E.key===" "){E.preventDefault();const A=o.value[r.value];A&&y(A)}else E.key==="Escape"&&(E.stopPropagation(),h())}function C(E){s.value&&a.value&&!a.value.contains(E.target)&&h()}ut(()=>document.addEventListener("mousedown",C)),eu(()=>document.removeEventListener("mousedown",C));function $(E,A){let v=0;for(let w=0;w<E;w++)v+=u.groups[w].options.length;return v+A}return(E,A)=>(d(),m("div",{ref_key:"boxEl",ref:a,class:"relative"},[f("button",{type:"button","data-test":e.dataTest,"aria-label":e.ariaLabel,"aria-expanded":s.value,class:"flex w-full items-center justify-between rounded-lg border border-border bg-bg py-2 pl-3 pr-2 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onClick:c,onKeydown:g},[f("span",{class:J(["truncate",i.value?"text-fg":"text-fg-muted"])},k(i.value||e.placeholder||"Select…"),3),N(x(st),{size:16,class:J(["ml-2 shrink-0 text-fg-muted transition-transform",s.value?"rotate-180":""])},null,8,["class"])],40,Ko),s.value?(d(),m("ul",Zo,[(d(!0),m(X,null,ie(e.groups,(v,w)=>(d(),m(X,{key:w},[v.label?(d(),m("li",Yo,k(v.label),1)):M("",!0),(d(!0),m(X,null,ie(v.options,(D,P)=>(d(),m("li",{key:D.value,"data-value":D.value,class:J(["flex items-center justify-between px-3 py-1.5 text-sm",[D.disabled?"cursor-not-allowed text-fg-muted/50":$(w,P)===r.value?"cursor-pointer bg-accent/15 text-fg":"cursor-pointer text-fg-muted hover:bg-fg/5"]]),onMousedown:Ae(F=>y(D),["prevent"]),onMouseenter:F=>!D.disabled&&(r.value=$(w,P))},[f("span",Jo,k(D.label),1),D.value===e.modelValue?(d(),G(x(uu),{key:0,size:14,class:"ml-2 shrink-0 text-accent"})):M("",!0)],42,Xo))),128))],64))),128))])):M("",!0)],512))}}),Qo={class:"w-full max-w-md rounded-xl border border-border bg-raised shadow-xl","data-test":"new-session-dialog"},ei={class:"flex items-center justify-between border-b border-border px-5 py-3"},ti={class:"text-sm font-semibold text-fg"},ui={class:"font-normal text-fg-muted"},ni=["aria-label"],si={class:"space-y-4 px-5 py-4"},ai={key:0,"data-test":"ns-pending",class:"rounded-lg bg-info/10 px-3 py-3 text-xs text-info"},ri={key:1,class:"py-6 text-center text-sm text-fg-muted"},oi={class:"block"},ii={class:"mb-1 block text-xs font-medium text-fg-muted"},li={class:"flex gap-1"},ci={class:"block"},di={class:"mb-1 block text-xs font-medium text-fg-muted"},fi={class:"font-normal text-fg-muted"},pi=["placeholder"],hi={class:"block"},bi={class:"mb-1 block text-xs font-medium text-fg-muted"},mi={class:"block"},gi={class:"mb-1 flex items-center justify-between"},xi={class:"text-xs font-medium text-fg-muted"},vi={key:0,class:"flex gap-1"},yi=["placeholder"],ki={key:0,class:"block"},_i={class:"mb-1 block text-xs font-medium text-fg-muted"},wi={class:"font-normal text-fg-muted"},Ei=["aria-label"],Ai={key:0,"data-test":"ns-model-list",class:"absolute z-10 mt-1 max-h-48 w-full overflow-auto rounded-lg border border-border bg-raised py-1 shadow-xl"},$i=["onMousedown","onMouseenter"],Ci={class:"truncate"},Di={key:0,class:"ml-2 shrink-0 text-xs text-fg-muted"},Ti={key:1,class:"block"},Si={class:"mb-1 block text-xs font-medium text-fg-muted"},Fi={key:0,"data-test":"ns-native-loading",class:"space-y-1.5"},Ii={class:"flex items-center gap-2 text-xs text-fg-muted"},Mi={key:2,"data-test":"ns-native-error",class:"rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger"},zi={class:"flex items-start gap-1.5"},Oi={class:"min-w-0"},Li={class:"break-words font-medium"},Ri={key:0,class:"mt-1 text-danger/80"},Ni={key:3,"data-test":"ns-native-empty",class:"rounded-lg bg-bg px-3 py-2 text-xs text-fg-muted"},Pi={key:2,"data-test":"ns-error",class:"rounded-lg bg-danger/10 px-3 py-2 text-xs text-danger"},Bi={class:"flex justify-end gap-2 border-t border-border px-5 py-3"},Ui=["disabled"],qi=ce({__name:"NewSessionDialog",props:{instanceId:{},instanceName:{}},emits:["created","close"],setup(e,{emit:t}){const u=e,n=t,{t:s}=It(),a=ft(),r=Z(()=>a.byId(u.instanceId)),o=S(""),i=S(""),l=S("new"),h=S("existing"),c=S(""),y=S(""),p=S(""),g=S([]),C=S(!1),$=S(0),E=S(null),A=Z(()=>{const z=new Set(["default"]),K=["default"];for(const W of g.value)W&&!z.has(W)&&(z.add(W),K.push(W));return K}),v=Z(()=>{const z=p.value.trim().toLowerCase();return z?A.value.filter(K=>K.toLowerCase().includes(z)):A.value});function w(){C.value=!0,$.value=0}function D(){C.value=!1}function P(z){p.value=z==="default"?"":z,D()}function F(z){if(z.key==="ArrowDown"){if(z.preventDefault(),!C.value){w();return}$.value=Math.min($.value+1,v.value.length-1)}else z.key==="ArrowUp"?(z.preventDefault(),$.value=Math.max($.value-1,0)):z.key==="Enter"?C.value&&$.value>=0&&$.value<v.value.length?(z.preventDefault(),P(v.value[$.value])):ot():z.key==="Escape"&&C.value&&(z.stopPropagation(),D())}function V(z){C.value&&E.value&&!E.value.contains(z.target)&&D()}ut(()=>document.addEventListener("mousedown",V)),eu(()=>document.removeEventListener("mousedown",V));const R=S(!1),O=S(!1),ae=S(""),I=S(""),B=S(!0),L=S([]),_=S(""),j=S(!1),ee=S("");ut(async()=>{var z,K,W,be,oe,Pe;try{await a.loadFormOptions(u.instanceId)}catch(He){I.value=He instanceof Error?He.message:s("session.failedLoadOptions")}finally{B.value=!1}i.value=((K=(z=r.value)==null?void 0:z.agents[0])==null?void 0:K.name)??((be=(W=r.value)==null?void 0:W.agentCatalog.find(He=>He.installed!=="unknown"))==null?void 0:be.driver)??"",c.value=((Pe=(oe=r.value)==null?void 0:oe.workspaces[0])==null?void 0:Pe.name)??""});const fe=Z(()=>{var z;return new Set((((z=r.value)==null?void 0:z.agents)??[]).map(K=>K.name))}),Ne=Z(()=>{var z;return(((z=r.value)==null?void 0:z.agentCatalog)??[]).filter(K=>!K.configured)}),Lt=Z(()=>{var W;const z=[],K=((W=r.value)==null?void 0:W.agents)??[];return K.length&&z.push({label:s("session.configured"),options:K.map(be=>({value:be.name,label:`${be.name} · ${be.driver}`}))}),Ne.value.length&&z.push({label:s("session.availableDrivers"),options:Ne.value.map(be=>({value:be.driver,label:be.installed==="unknown"?s("session.cliNotDetected",{driver:be.driver}):be.driver,disabled:be.installed==="unknown"}))}),z}),ge=Z(()=>{var z;return[{options:(((z=r.value)==null?void 0:z.workspaces)??[]).map(K=>({value:K.name,label:`${K.name} — ${K.cwd}`}))}]}),Rt=Z(()=>h.value==="path"?y.value.trim()?$s(y.value):"":c.value),Y=Z(()=>Rt.value&&i.value?hn(Rt.value,i.value):s("session.autoAlias")),U=Z(()=>fe.value.has(i.value));async function ue(){var z;if(_.value="",L.value=[],ee.value="",!(l.value!=="native"||!i.value||!c.value)){if(!U.value){ee.value=s("session.pickConfiguredAgent");return}j.value=!0;try{L.value=await a.listNativeSessions(u.instanceId,i.value,c.value),_.value=((z=L.value[0])==null?void 0:z.sessionId)??""}catch(K){ee.value=K instanceof Error?K.message:s("session.failedListNative")}finally{j.value=!1}}}me([l,i,c],()=>{l.value==="native"&&(h.value="existing",ue())}),me([i,c],async()=>{g.value=[],!(!i.value||!c.value)&&(g.value=await a.listModelSuggestions(u.instanceId,i.value,c.value))});const re=Z(()=>{const z=ee.value;return z&&/auth|login|unauthor|credential|sign[\s-]?in/i.test(z)?s("session.authHint",{agent:i.value||s("session.thisAgent")}):""});function ke(z){const K=(z.title??"").trim()||z.sessionId,W=z.sessionId.length>8?`…${z.sessionId.slice(-8)}`:z.sessionId,be=z.updatedAt?` · ${Un(z.updatedAt)}`:"";return`${K} (${W})${be}`}const Se=Z(()=>[{options:L.value.map(z=>({value:z.sessionId,label:ke(z)}))}]),At=Z(()=>R.value||!i.value?!1:l.value==="native"?!!_.value:h.value==="existing"?!!c.value:!!y.value.trim());async function ot(){var z,K;if(At.value){R.value=!0,I.value="";try{const W=i.value,be=(((z=r.value)==null?void 0:z.sessions)??[]).map(Ve=>Ve.alias);if(l.value==="native"){const Ve=c.value,it=o.value.trim()||bn(hn(Ve,W),be);if(!Ve||!it||!_.value){I.value=s("session.pickNativeAndAlias");return}if((await a.createSession(u.instanceId,it,W,Ve,_.value)).pending){ae.value=it,O.value=!0;return}n("created",it),n("close");return}let oe=c.value;if(h.value==="path"){const Ve=(((K=r.value)==null?void 0:K.workspaces)??[]).map(it=>it.name);oe=bn($s(y.value),Ve)}const Pe=o.value.trim()||bn(hn(oe,W),be);if(!oe||!Pe){I.value=s("session.couldNotDeriveName");return}fe.value.has(W)||await a.createAgent(u.instanceId,W,W),h.value==="path"&&await a.createWorkspace(u.instanceId,oe,y.value.trim());const He=p.value.trim(),Ke=He&&He.toLowerCase()!=="default"?He:void 0;if((await a.createSession(u.instanceId,Pe,W,oe,void 0,Ke)).pending){ae.value=Pe,O.value=!0;return}n("created",Pe),n("close")}catch(W){I.value=W instanceof Error?W.message:s("session.createFailed")}finally{R.value=!1}}}return(z,K)=>(d(),G(tu,{to:"body"},[f("div",{class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:K[14]||(K[14]=Ae(W=>n("close"),["self"]))},[f("div",Qo,[f("header",ei,[f("h2",ti,[pe(k(z.$t("session.newSession"))+" ",1),f("span",ui,"· "+k(e.instanceName),1)]),f("button",{class:"rounded p-1 text-fg-muted hover:bg-fg/5 hover:text-fg","aria-label":z.$t("session.close"),onClick:K[0]||(K[0]=W=>n("close"))},[N(x(nt),{size:16})],8,ni)]),f("div",si,[O.value?(d(),m("div",ai,k(z.$t("session.creating")),1)):B.value?(d(),m("div",ri,k(z.$t("session.loadingOptions")),1)):(d(),m(X,{key:2},[f("div",oi,[f("span",ii,k(z.$t("session.source")),1),f("div",li,[f("button",{type:"button","data-test":"ns-source-new",class:J(["flex-1 rounded px-2 py-1 text-xs",l.value==="new"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[1]||(K[1]=W=>l.value="new")},k(z.$t("session.newSession")),3),f("button",{type:"button","data-test":"ns-source-native",class:J(["flex-1 rounded px-2 py-1 text-xs",l.value==="native"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[2]||(K[2]=W=>l.value="native")},k(z.$t("session.nativeSession")),3)])]),f("label",ci,[f("span",di,[pe(k(z.$t("session.sessionAlias"))+" ",1),f("span",fi,k(z.$t("session.optional")),1)]),_e(f("input",{"onUpdate:modelValue":K[3]||(K[3]=W=>o.value=W),"data-test":"ns-alias",placeholder:Y.value,class:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onKeydown:Nn(ot,["enter"])},null,40,pi),[[Oe,o.value]])]),f("div",hi,[f("span",bi,k(z.$t("session.agent")),1),N(mn,{modelValue:i.value,"onUpdate:modelValue":K[4]||(K[4]=W=>i.value=W),groups:Lt.value,"data-test":"ns-agent","aria-label":z.$t("session.agent"),placeholder:z.$t("session.selectAgent")},null,8,["modelValue","groups","aria-label","placeholder"])]),f("div",mi,[f("div",gi,[f("span",xi,k(z.$t("session.workspace")),1),l.value==="new"?(d(),m("div",vi,[f("button",{type:"button","data-test":"ns-ws-mode-existing",class:J(["rounded px-2 py-0.5 text-xs",h.value==="existing"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[5]||(K[5]=W=>h.value="existing")},k(z.$t("session.existing")),3),f("button",{type:"button","data-test":"ns-ws-mode-path",class:J(["rounded px-2 py-0.5 text-xs",h.value==="path"?"bg-accent text-white":"bg-bg border border-border text-fg-muted hover:bg-fg/5"]),onClick:K[6]||(K[6]=W=>h.value="path")},k(z.$t("session.newPath")),3)])):M("",!0)]),h.value==="existing"?(d(),G(mn,{key:0,modelValue:c.value,"onUpdate:modelValue":K[7]||(K[7]=W=>c.value=W),groups:ge.value,"data-test":"ns-workspace","aria-label":z.$t("session.workspace"),placeholder:z.$t("session.selectWorkspace")},null,8,["modelValue","groups","aria-label","placeholder"])):_e((d(),m("input",{key:1,"onUpdate:modelValue":K[8]||(K[8]=W=>y.value=W),"data-test":"ns-ws-path",placeholder:z.$t("session.pathPlaceholder"),class:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,yi)),[[Oe,y.value]])]),l.value==="new"?(d(),m("div",ki,[f("span",_i,[pe(k(z.$t("session.model"))+" ",1),f("span",wi,k(z.$t("session.optional")),1)]),f("div",{ref_key:"modelBoxEl",ref:E,class:"relative"},[_e(f("input",{"onUpdate:modelValue":K[9]||(K[9]=W=>p.value=W),"data-test":"ns-model",placeholder:"default",autocomplete:"off",class:"w-full rounded-lg border border-border bg-bg py-2 pl-3 pr-9 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onFocus:w,onInput:w,onKeydown:F},null,544),[[Oe,p.value]]),f("button",{type:"button",tabindex:"-1","aria-label":z.$t("session.toggleModelList"),class:"absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-1 text-fg-muted hover:text-fg",onClick:K[10]||(K[10]=W=>C.value?D():w())},[N(x(st),{size:16,class:J(["transition-transform",C.value?"rotate-180":""])},null,8,["class"])],8,Ei),C.value&&v.value.length?(d(),m("ul",Ai,[(d(!0),m(X,null,ie(v.value,(W,be)=>(d(),m("li",{key:W,class:J(["flex cursor-pointer items-center justify-between px-3 py-1.5 text-sm",be===$.value?"bg-accent/15 text-fg":"text-fg-muted hover:bg-fg/5"]),onMousedown:Ae(oe=>P(W),["prevent"]),onMouseenter:oe=>$.value=be},[f("span",Ci,k(W),1),W==="default"?(d(),m("span",Di,k(z.$t("session.agentDefault")),1)):M("",!0)],42,$i))),128))])):M("",!0)],512)])):M("",!0),l.value==="native"?(d(),m("div",Ti,[f("span",Si,k(z.$t("session.nativeSession")),1),j.value?(d(),m("div",Fi,[f("div",Ii,[N(x(zt),{size:13,class:"animate-spin motion-reduce:animate-none text-accent"}),pe(" "+k(z.$t("session.listingNative")),1)]),(d(),m(X,null,ie(3,W=>f("div",{key:W,class:"h-7 animate-pulse rounded-lg bg-fg/5 motion-reduce:animate-none",style:yu({width:`${92-W*12}%`})},null,4)),64))])):L.value.length?(d(),G(mn,{key:1,modelValue:_.value,"onUpdate:modelValue":K[11]||(K[11]=W=>_.value=W),groups:Se.value,"data-test":"ns-native","aria-label":z.$t("session.nativeSession"),placeholder:z.$t("session.selectNative")},null,8,["modelValue","groups","aria-label","placeholder"])):ee.value?(d(),m("div",Mi,[f("div",zi,[N(x(pu),{size:13,class:"mt-0.5 shrink-0"}),f("div",Oi,[f("p",Li,k(ee.value),1),re.value?(d(),m("p",Ri,k(re.value),1)):M("",!0)])])])):(d(),m("p",Ni,k(z.$t("session.noNativeSessions")),1))])):M("",!0),I.value?(d(),m("p",Pi,k(I.value),1)):M("",!0)],64))]),f("footer",Bi,[O.value?(d(),m("button",{key:0,"data-test":"ns-pending-close",class:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",onClick:K[12]||(K[12]=W=>{n("created",ae.value),n("close")})},k(z.$t("common.ok")),1)):(d(),m(X,{key:1},[f("button",{class:"rounded-lg px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5",onClick:K[13]||(K[13]=W=>n("close"))},k(z.$t("common.cancel")),1),f("button",{"data-test":"ns-create",disabled:!At.value,class:"rounded-lg bg-accent px-4 py-1.5 text-sm font-medium text-white enabled:hover:bg-accent-hover disabled:opacity-40",onClick:ot},k(R.value?z.$t("session.creatingButton"):z.$t("session.create")),9,Ui)],64))])])])]))}}),ji={class:"space-y-3"},Hi={key:0,"data-test":"wm-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},Vi=["placeholder"],Wi={key:2,"data-test":"wm-empty",class:"text-sm text-fg-muted"},Gi={key:3,class:"max-h-64 divide-y divide-border overflow-y-auto rounded border border-border"},Ki=["title"],Zi={class:"font-medium text-fg"},Yi={class:"text-fg-muted"},Xi=["data-test","title","aria-label","disabled","onClick"],Ji={key:0,class:"px-3 py-2 text-sm text-fg-muted"},Qi={key:5,class:"space-y-2 rounded border border-border p-3"},el={class:"grid grid-cols-1 gap-2 sm:grid-cols-3"},tl=["placeholder"],ul=["placeholder"],nl=["placeholder"],sl={class:"flex gap-2"},al=["disabled"],rl=ce({__name:"WorkspacesManager",props:{instanceId:{}},setup(e){const t=e,u=ft(),{t:n}=It(),s=Z(()=>u.byId(t.instanceId)),a=S(""),r=S(""),o=S(""),i=S(""),l=S(!1),h=S(!1),c=S(""),y=Z(()=>{var E;return((E=s.value)==null?void 0:E.workspaces)??[]}),p=Z(()=>y.value.length>6),g=Z(()=>{const E=c.value.trim().toLowerCase();return E?y.value.filter(A=>A.name.toLowerCase().includes(E)||(A.cwd??"").toLowerCase().includes(E)):y.value});async function C(){if(!(!a.value.trim()||!r.value.trim()||l.value)){l.value=!0,i.value="";try{await u.createWorkspace(t.instanceId,a.value.trim(),r.value.trim(),o.value.trim()||void 0),a.value="",r.value="",o.value=""}catch(E){i.value=E instanceof Error?E.message:n("workspaces.createFailed")}finally{l.value=!1}}}async function $(E){if(!(l.value||!await ku({title:n("workspaces.removeTitle"),message:n("workspaces.removeBody",{name:E}),confirmLabel:n("common.remove"),tone:"danger"}))){l.value=!0,i.value="";try{await u.removeWorkspace(t.instanceId,E)}catch(v){i.value=v instanceof Error?v.message:n("workspaces.removeFailed")}finally{l.value=!1}}}return(E,A)=>(d(),m("section",ji,[i.value?(d(),m("p",Hi,k(i.value),1)):M("",!0),p.value?_e((d(),m("input",{key:1,"onUpdate:modelValue":A[0]||(A[0]=v=>c.value=v),"data-test":"wm-filter",placeholder:E.$t("common.filter"),class:"w-full rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,Vi)),[[Oe,c.value]]):M("",!0),y.value.length?(d(),m("ul",Gi,[(d(!0),m(X,null,ie(g.value,v=>(d(),m("li",{key:v.name,class:"flex items-center justify-between gap-2 px-3 py-2 text-sm"},[f("span",{class:"min-w-0 truncate",title:`${v.name} — ${v.cwd}`},[f("span",Zi,k(v.name),1),f("span",Yi," — "+k(v.cwd),1)],8,Ki),f("button",{"data-test":`wm-remove-${v.name}`,title:E.$t("workspaces.remove",{name:v.name}),"aria-label":E.$t("workspaces.removeAria",{name:v.name}),class:"grid h-7 w-7 shrink-0 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger disabled:opacity-50",disabled:l.value,onClick:w=>$(v.name)},[N(x(hu),{size:14})],8,Xi)]))),128)),g.value.length?M("",!0):(d(),m("li",Ji,k(E.$t("common.noMatch")),1))])):(d(),m("p",Wi,k(E.$t("workspaces.empty")),1)),h.value?(d(),m("div",Qi,[f("div",el,[_e(f("input",{"onUpdate:modelValue":A[2]||(A[2]=v=>a.value=v),"data-test":"wm-name",placeholder:E.$t("workspaces.namePlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,tl),[[Oe,a.value]]),_e(f("input",{"onUpdate:modelValue":A[3]||(A[3]=v=>r.value=v),"data-test":"wm-path",placeholder:E.$t("workspaces.pathPlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,ul),[[Oe,r.value]]),_e(f("input",{"onUpdate:modelValue":A[4]||(A[4]=v=>o.value=v),"data-test":"wm-desc",placeholder:E.$t("workspaces.descPlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,nl),[[Oe,o.value]])]),f("div",sl,[f("button",{"data-test":"wm-create",class:"rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:l.value||!a.value.trim()||!r.value.trim(),onClick:C},k(E.$t("common.add")),9,al),f("button",{type:"button","data-test":"wm-add-cancel",class:"rounded px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:A[5]||(A[5]=v=>h.value=!1)},k(E.$t("common.cancel")),1)])])):(d(),m("button",{key:4,type:"button","data-test":"wm-add-toggle",onClick:A[1]||(A[1]=v=>h.value=!0),class:"flex items-center gap-1.5 rounded border border-dashed border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-accent hover:text-fg"},[N(x(qu),{size:14}),pe(" "+k(E.$t("workspaces.add")),1)]))]))}}),ol={class:"space-y-3"},il={key:0,"data-test":"am-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},ll=["placeholder"],cl={key:2,"data-test":"am-empty",class:"text-sm text-fg-muted"},dl={key:3,class:"max-h-64 divide-y divide-border overflow-y-auto rounded border border-border"},fl=["title"],pl={class:"font-medium text-fg"},hl={class:"text-fg-muted"},bl=["data-test","title","aria-label","disabled","onClick"],ml={key:0,class:"px-3 py-2 text-sm text-fg-muted"},gl={key:5,class:"space-y-2 rounded border border-border p-3"},xl={class:"grid grid-cols-1 gap-2 sm:grid-cols-2"},vl={value:"",disabled:""},yl=["value","disabled"],kl=["placeholder"],_l={class:"flex gap-2"},wl=["disabled"],El=ce({__name:"AgentsManager",props:{instanceId:{}},setup(e){const t=e,u=ft(),{t:n}=It(),s=Z(()=>u.byId(t.instanceId)),a=S(""),r=S(""),o=S(""),i=S(!1),l=S(!1),h=S(""),c=Z(()=>{var A;return(((A=s.value)==null?void 0:A.agentCatalog)??[]).filter(v=>!v.configured)}),y=Z(()=>{var A;return((A=s.value)==null?void 0:A.agents)??[]}),p=Z(()=>y.value.length>6),g=Z(()=>{const A=h.value.trim().toLowerCase();return A?y.value.filter(v=>v.name.toLowerCase().includes(A)||(v.driver??"").toLowerCase().includes(A)):y.value});async function C(){if(!(!a.value||i.value)){i.value=!0,o.value="";try{await u.createAgent(t.instanceId,r.value.trim()||a.value,a.value),a.value="",r.value=""}catch(A){o.value=A instanceof Error?A.message:n("agents.addFailed")}finally{i.value=!1}}}async function $(A){if(!(i.value||!await ku({title:n("agents.removeTitle"),message:n("agents.removeBody",{name:A}),confirmLabel:n("common.remove"),tone:"danger"}))){i.value=!0,o.value="";try{await u.removeAgent(t.instanceId,A)}catch(w){o.value=w instanceof Error?w.message:n("agents.removeFailed")}finally{i.value=!1}}}function E(A){return n(A==="builtin"?"agents.builtin":A==="yes"?"agents.installed":"agents.cliNotDetected")}return(A,v)=>(d(),m("section",ol,[o.value?(d(),m("p",il,k(o.value),1)):M("",!0),p.value?_e((d(),m("input",{key:1,"onUpdate:modelValue":v[0]||(v[0]=w=>h.value=w),"data-test":"am-filter",placeholder:A.$t("common.filter"),class:"w-full rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,ll)),[[Oe,h.value]]):M("",!0),y.value.length?(d(),m("ul",dl,[(d(!0),m(X,null,ie(g.value,w=>(d(),m("li",{key:w.name,class:"flex items-center justify-between gap-2 px-3 py-2 text-sm"},[f("span",{class:"min-w-0 truncate",title:`${w.name} · ${w.driver}`},[f("span",pl,k(w.name),1),f("span",hl," · "+k(w.driver),1)],8,fl),f("button",{"data-test":`am-remove-${w.name}`,title:A.$t("agents.remove",{name:w.name}),"aria-label":A.$t("agents.removeAria",{name:w.name}),class:"grid h-7 w-7 shrink-0 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger disabled:opacity-50",disabled:i.value,onClick:D=>$(w.name)},[N(x(hu),{size:14})],8,bl)]))),128)),g.value.length?M("",!0):(d(),m("li",ml,k(A.$t("common.noMatch")),1))])):(d(),m("p",cl,k(A.$t("agents.empty")),1)),l.value?(d(),m("div",gl,[f("div",xl,[_e(f("select",{"onUpdate:modelValue":v[2]||(v[2]=w=>a.value=w),"data-test":"am-driver",class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},[f("option",vl,k(A.$t("agents.chooseDriver")),1),(d(!0),m(X,null,ie(c.value,w=>(d(),m("option",{key:w.driver,value:w.driver,disabled:w.installed==="unknown"},k(w.driver)+" ("+k(E(w.installed))+") ",9,yl))),128))],512),[[Ur,a.value]]),_e(f("input",{"onUpdate:modelValue":v[3]||(v[3]=w=>r.value=w),"data-test":"am-name",placeholder:A.$t("agents.namePlaceholder"),class:"rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"},null,8,kl),[[Oe,r.value]])]),f("div",_l,[f("button",{"data-test":"am-add",class:"rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:i.value||!a.value,onClick:C},k(A.$t("common.add")),9,wl),f("button",{type:"button","data-test":"am-add-cancel",class:"rounded px-3 py-1.5 text-sm text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:v[4]||(v[4]=w=>l.value=!1)},k(A.$t("common.cancel")),1)])])):(d(),m("button",{key:4,type:"button","data-test":"am-add-toggle",onClick:v[1]||(v[1]=w=>l.value=!0),class:"flex items-center gap-1.5 rounded border border-dashed border-border px-3 py-1.5 text-sm text-fg-muted transition-colors hover:border-accent hover:text-fg"},[N(x(qu),{size:14}),pe(" "+k(A.$t("agents.add")),1)]))]))}}),Al={class:"flex shrink-0 items-center justify-between border-b border-border px-5 py-3"},$l={id:"manage-instance-title",class:"truncate text-sm font-semibold text-fg"},Cl=["aria-label"],Dl={key:0,class:"py-6 text-center text-sm text-fg-muted"},Tl=["id","data-test","aria-selected","aria-controls","tabindex","onClick"],Sl={class:"flex-1 overflow-y-auto p-5"},Fl={key:0,id:"tabpanel-general",role:"tabpanel","aria-labelledby":"tab-general",class:"space-y-6"},Il={class:"space-y-3"},Ml={class:"text-sm font-semibold uppercase text-fg-muted"},zl={key:0,"data-test":"rename-error",class:"rounded bg-danger/10 px-3 py-2 text-sm text-danger"},Ol={class:"flex gap-2"},Ll=["placeholder"],Rl=["disabled"],Nl={class:"space-y-1"},Pl={class:"text-sm font-semibold uppercase text-fg-muted"},Bl={class:"text-sm text-fg-muted","data-test":"instance-version"},Ul={key:1,id:"tabpanel-workspaces",role:"tabpanel","aria-labelledby":"tab-workspaces"},ql={key:2,id:"tabpanel-agents",role:"tabpanel","aria-labelledby":"tab-agents"},jl='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Hl=ce({__name:"ManageInstanceDialog",props:{instanceId:{},instanceName:{}},emits:["close"],setup(e,{emit:t}){const u=e,n=t,s=ft(),{t:a}=It(),r=Z(()=>{var v;return((v=s.byId(u.instanceId))==null?void 0:v.coreVersion)??null}),o=S(!0),i=["general","workspaces","agents"],l=S("general");function h(v){const w=i.indexOf(l.value);let D=w;if(v.key==="ArrowRight")D=(w+1)%i.length;else if(v.key==="ArrowLeft")D=(w-1+i.length)%i.length;else if(v.key==="Home")D=0;else if(v.key==="End")D=i.length-1;else return;v.preventDefault(),l.value=i[D],qe(()=>{var P,F;(F=(P=C.value)==null?void 0:P.querySelector(`#tab-${i[D]}`))==null||F.focus()})}const c=S(u.instanceName),y=S(""),p=S(!1);async function g(){const v=c.value.trim();if(!(!v||p.value)){p.value=!0,y.value="";try{await s.renameInstance(u.instanceId,v),c.value=v}catch(w){y.value=w instanceof Error?w.message:a("instance.renameFailed")}finally{p.value=!1}}}const C=S(null);let $=null;function E(){return C.value?Array.from(C.value.querySelectorAll(jl)):[]}function A(v){if(v.key==="Escape"){v.preventDefault(),n("close");return}if(v.key!=="Tab")return;const w=E();if(w.length===0)return;const D=w[0],P=w[w.length-1],F=document.activeElement;v.shiftKey&&F===D?(v.preventDefault(),P.focus()):!v.shiftKey&&F===P&&(v.preventDefault(),D.focus())}return ut(async()=>{$=document.activeElement instanceof HTMLElement?document.activeElement:null,document.addEventListener("keydown",A),qe(()=>{var v;(v=E()[0]??C.value)==null||v.focus()});try{await s.loadFormOptions(u.instanceId)}catch{}finally{o.value=!1}}),eu(()=>{var v;document.removeEventListener("keydown",A),(v=$==null?void 0:$.focus)==null||v.call($)}),(v,w)=>(d(),G(tu,{to:"body"},[f("div",{class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:w[2]||(w[2]=Ae(D=>n("close"),["self"]))},[f("div",{ref_key:"dialogEl",ref:C,tabindex:"-1",role:"dialog","aria-modal":"true","aria-labelledby":"manage-instance-title",class:"flex max-h-[85vh] w-full max-w-xl flex-col rounded-xl border border-border bg-raised shadow-xl focus:outline-none","data-test":"manage-instance-dialog"},[f("header",Al,[f("h2",$l,k(v.$t("instance.manageTitle",{name:c.value})),1),f("button",{class:"rounded p-1 text-fg-muted hover:bg-fg/5 hover:text-fg","aria-label":v.$t("instance.close"),onClick:w[0]||(w[0]=D=>n("close"))},[N(x(nt),{size:16})],8,Cl)]),o.value?(d(),m("div",Dl,k(v.$t("instance.dialogLoading")),1)):(d(),m(X,{key:1},[f("nav",{class:"flex shrink-0 gap-1 border-b border-border px-3 pt-2",role:"tablist",onKeydown:h},[(d(),m(X,null,ie(["general","workspaces","agents"],D=>f("button",{key:D,id:`tab-${D}`,"data-test":`tab-${D}`,role:"tab","aria-selected":l.value===D,"aria-controls":`tabpanel-${D}`,tabindex:l.value===D?0:-1,class:J(["rounded-t px-3 py-1.5 text-sm font-medium transition-colors",l.value===D?"border-b-2 border-accent text-fg":"text-fg-muted hover:text-fg"]),onClick:P=>l.value=D},k(D==="general"?v.$t("instance.tabGeneral"):D==="workspaces"?v.$t("workspaces.title"):v.$t("agents.title")),11,Tl)),64))],32),f("div",Sl,[l.value==="general"?(d(),m("div",Fl,[f("section",Il,[f("h3",Ml,k(v.$t("instance.nameLabel")),1),y.value?(d(),m("p",zl,k(y.value),1)):M("",!0),f("div",Ol,[_e(f("input",{"onUpdate:modelValue":w[1]||(w[1]=D=>c.value=D),"data-test":"rename-name",placeholder:v.$t("instance.renamePlaceholder"),class:"min-w-0 flex-1 rounded border border-border bg-bg px-2 py-1 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",onKeyup:Nn(g,["enter"])},null,40,Ll),[[Oe,c.value]]),f("button",{"data-test":"rename-save",class:"shrink-0 rounded bg-accent px-3 py-1.5 text-sm text-white hover:bg-accent-hover disabled:opacity-50",disabled:p.value||!c.value.trim(),onClick:g},k(p.value?v.$t("instance.renameSaving"):v.$t("instance.renameSave")),9,Rl)])]),f("section",Nl,[f("h3",Pl,k(v.$t("instance.versionLabel")),1),f("p",Bl,k(r.value?v.$t("instance.coreVersion",{version:r.value}):v.$t("instance.coreVersionUnknown")),1)])])):l.value==="workspaces"?(d(),m("div",Ul,[N(rl,{"instance-id":e.instanceId},null,8,["instance-id"])])):l.value==="agents"?(d(),m("div",ql,[N(El,{"instance-id":e.instanceId},null,8,["instance-id"])])):M("",!0)])],64))],512)])]))}}),Vl={class:"thin-scroll flex h-full flex-1 flex-col space-y-1.5 overflow-y-auto px-2 pb-2 pt-1.5"},Wl=["onClick"],Gl=["title"],Kl={key:2,class:"font-mono text-[10px] tabular-nums text-fg-muted"},Zl={key:3,class:"text-[10px] font-medium text-fg-muted"},Yl={class:"ml-2.5 mt-px space-y-px border-l border-border pl-2.5"},Xl={class:"overflow-hidden rounded-md"},Jl={key:0,class:"absolute bottom-1 left-0 top-1 w-[3px] rounded-full bg-accent"},Ql=["onClick"],ec={key:0,"data-test":"attention-dot","data-attention":"working",class:"pulse-dot h-2 w-2 shrink-0 rounded-full bg-run-bright"},tc={key:1,"data-test":"attention-dot","data-attention":"unread",class:"h-2 w-2 shrink-0 rounded-full bg-info"},uc={key:2,"data-test":"attention-dot","data-attention":"running",class:"h-2 w-2 shrink-0 rounded-full bg-run"},nc={key:3,"data-test":"archived-badge",class:"shrink-0 rounded bg-bg px-1 py-px text-[9px] text-fg-muted"},sc={key:4,"data-test":"session-elapsed",class:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-run"},ac={key:1,"data-test":"session-actions",class:"relative mr-1 shrink-0"},rc=["aria-label","onClick"],oc=["aria-label","title","onClick"],ic=["aria-label","title","onClick"],lc=["onClick"],cc=["onClick"],dc={key:0,"data-test":"sessions-loading",class:"py-1 pl-2.5 text-[11px] text-fg-muted"},fc={key:1,"data-test":"no-sessions",class:"py-1 pl-2.5 text-[11px] text-fg-muted"},pc={class:"flex items-center gap-0.5 pb-px pl-2 pt-0.5"},hc=["title","aria-label","onClick"],bc=["title","aria-label","onClick"],mc=ce({__name:"InstanceTree",emits:["select"],setup(e,{emit:t}){const u=ft(),n=Et(),{t:s}=It(),a=t,r=S(null),o=S(null),i=S(Date.now()),l=setInterval(()=>{i.value=Date.now()},1e3);Ru(()=>clearInterval(l));function h(I,B){const L=n.runningSince(I,B);if(L===null)return"";const _=Math.max(0,Math.floor((i.value-L)/1e3));return _<60?`${_}s`:_<3600?`${Math.floor(_/60)}m`:`${Math.floor(_/3600)}h`}function c(I,B){return n.instanceId===I&&n.sessionAlias===B}const y=S(new Set);function p(I){return!y.value.has(I)}function g(I){const B=new Set(y.value);B.has(I)?B.delete(I):B.add(I),y.value=B,E.value=null,p(I)&&u.loadSessions(I).catch(()=>{})}function C(I){return[...I].sort((B,L)=>Number(B.archived??!1)-Number(L.archived??!1))}const $=S(null),E=S(null),A=S(null),v=S(0);function w(){$.value=null,E.value=null}ut(()=>document.addEventListener("mousedown",w)),Ru(()=>document.removeEventListener("mousedown",w));function D(I){return I.archived?56:112}function P(I,B){const L=`${I}:${B.alias}`,_=D(B);if(A.value===L){const j=E.value===L?-_:0;return`translateX(${Math.max(-_,Math.min(0,j+v.value))}px)`}return E.value===L?`translateX(-${_}px)`:"translateX(0)"}function F(I,B){const L=`${I}:${B}`;if(E.value===L){E.value=null;return}a("select",I,B)}async function V(I,B){$.value=null,E.value=null,await u.archiveSession(I,B).catch(()=>{}),R(I,B)}function R(I,B){Wo({message:s("instance.sessionArchivedToast",{alias:B}),actionLabel:s("instance.undo"),action:()=>{u.unarchiveSession(I,B).catch(()=>{})}})}async function O(I,B){$.value=null,E.value=null,await ku({title:s("instance.deleteSessionTitle"),message:s("instance.deleteSessionBody",{alias:B}),confirmLabel:s("common.delete"),tone:"danger"})&&u.removeSession(I,B).catch(()=>{})}const ae=Z(()=>{const I={};for(const B of u.instances)if(B.online)for(const L of B.sessions){const _=`${B.id}:${L.alias}`,j=D(L);I[_]=Go({onMove:ee=>{$.value=null,A.value=_,v.value=ee},onEnd:ee=>{const fe=E.value===_?-j:0,Ne=Math.max(-j,Math.min(0,fe+ee));E.value=Ne<=-j/2?_:null,A.value=null,v.value=0}}).handlers}return I});return(I,B)=>(d(),m("nav",Vl,[(d(!0),m(X,null,ie(x(u).instances,L=>(d(),m("div",{key:L.id,class:J(L.online?"":"opacity-60")},[f("button",{class:"group flex h-7 w-full items-center gap-1.5 rounded-md px-1.5 transition-colors hover:bg-raised",onClick:_=>g(L.id)},[p(L.id)?(d(),G(x(st),{key:0,size:12,class:"shrink-0 text-fg-muted"})):(d(),G(x(Mt),{key:1,size:12,class:"shrink-0 text-fg-muted"})),f("span",{class:J(["h-2 w-2 shrink-0 rounded-full",L.online?"bg-run":"bg-fg-muted"]),"data-test":"online-dot"},null,2),f("span",{class:J(["flex-1 truncate text-left text-[12.5px] font-semibold",L.online?"text-fg":"text-fg-muted"]),title:L.coreVersion?I.$t("instance.coreVersion",{version:L.coreVersion}):I.$t("instance.coreVersionUnknown")},k(L.name),11,Gl),L.online?(d(),m("span",Kl,k(L.sessions.length),1)):(d(),m("span",Zl,k(I.$t("instance.offline")),1))],8,Wl),_e(f("div",Yl,[(d(!0),m(X,null,ie(C(L.sessions),_=>(d(),m("div",{key:_.alias,"data-test":"session-row",class:"group relative rounded-md"},[f("div",Xl,[f("div",qr({"data-test":"swipe-track",class:["flex touch-pan-y ease-out",A.value===`${L.id}:${_.alias}`?"":"transition-transform duration-200"],style:{transform:P(L.id,_)}},jr(L.online?ae.value[`${L.id}:${_.alias}`]??{}:{})),[f("div",{class:J(["relative flex w-full shrink-0 items-center rounded-md transition-colors",c(L.id,_.alias)?"bg-accent/10":"hover:bg-raised"])},[c(L.id,_.alias)?(d(),m("span",Jl)):M("",!0),f("button",{class:"flex min-w-0 flex-1 items-center gap-2 py-2 pl-2.5 pr-1.5 text-left",onClick:j=>F(L.id,_.alias)},[!_.archived&&x(n).sessionAttention(L.id,_.alias)==="working"?(d(),m("span",ec)):!_.archived&&x(n).sessionAttention(L.id,_.alias)==="unread"?(d(),m("span",tc)):!_.archived&&_.running?(d(),m("span",uc)):M("",!0),f("span",{class:J(["truncate text-[12.5px] font-medium",_.archived?"text-fg-muted":c(L.id,_.alias)?"font-semibold text-accent":"text-fg"])},k(_.alias),3),f("span",{class:J(["shrink-0 rounded px-1 py-px font-mono text-[9.5px]",c(L.id,_.alias)?"bg-accent/15 text-accent":"bg-bg text-fg-muted"])},k(_.agent),3),_.archived?(d(),m("span",nc,k(I.$t("instance.sessionArchivedBadge")),1)):M("",!0),!_.archived&&h(L.id,_.alias)?(d(),m("span",sc,k(h(L.id,_.alias)),1)):M("",!0)],8,Ql),L.online?(d(),m("div",ac,[f("button",{"data-test":"session-menu","aria-label":I.$t("common.more"),class:"grid h-5 w-5 place-items-center rounded text-fg-muted hover:bg-raised hover:text-fg opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100",onClick:Ae(j=>{E.value=null,$.value=$.value===`${L.id}:${_.alias}`?null:`${L.id}:${_.alias}`},["stop"])},[N(x(so),{size:13})],8,rc)])):M("",!0)],2),L.online?(d(),m(X,{key:0},[_.archived?M("",!0):(d(),m("button",{key:0,"data-test":"swipe-archive","aria-label":I.$t("instance.archiveSession"),title:I.$t("instance.archiveSession"),class:"flex w-14 shrink-0 items-center justify-center bg-warn text-white transition-colors hover:bg-warn/90",onClick:Ae(j=>V(L.id,_.alias),["stop"])},[N(x(xs),{size:16})],8,oc)),f("button",{"data-test":"swipe-delete","aria-label":I.$t("common.delete"),title:I.$t("common.delete"),class:"flex w-14 shrink-0 items-center justify-center bg-danger text-white transition-colors hover:bg-danger/90",onClick:Ae(j=>O(L.id,_.alias),["stop"])},[N(x(hu),{size:16})],8,ic)],64)):M("",!0)],16)]),L.online&&$.value===`${L.id}:${_.alias}`?(d(),m("div",{key:0,onMousedown:B[0]||(B[0]=Ae(()=>{},["stop"])),class:"absolute right-1 top-full z-30 mt-0.5 w-32 rounded-md border border-border bg-surface py-1 shadow-lg"},[_.archived?M("",!0):(d(),m("button",{key:0,"data-test":"action-archive",class:"flex w-full items-center gap-2 px-2.5 py-1 text-left text-[12px] text-fg hover:bg-raised",onClick:Ae(j=>V(L.id,_.alias),["stop"])},[N(x(xs),{size:12}),pe(k(I.$t("instance.archiveSession")),1)],8,lc)),f("button",{"data-test":"delete-session",class:"flex w-full items-center gap-2 px-2.5 py-1 text-left text-[12px] text-danger hover:bg-danger/10",onClick:Ae(j=>O(L.id,_.alias),["stop"])},[N(x(hu),{size:12}),pe(k(I.$t("common.delete")),1)],8,cc)],32)):M("",!0)]))),128)),L.online&&!L.sessionsLoaded&&!L.sessions.length?(d(),m("div",dc,k(I.$t("instance.loading")),1)):L.sessionsLoaded&&!L.sessions.length?(d(),m("div",fc,k(I.$t("instance.noSessions")),1)):M("",!0),f("div",pc,[f("button",{"data-test":"new-session",title:I.$t("instance.newSession"),"aria-label":I.$t("instance.newSession"),class:"grid h-6 w-6 place-items-center rounded text-accent transition-colors hover:bg-accent/10",onClick:_=>r.value={id:L.id,name:L.name}},[N(x(qu),{size:14})],8,hc),f("button",{"data-test":"manage-instance",title:I.$t("instance.manage"),"aria-label":I.$t("instance.manage"),class:"grid h-6 w-6 place-items-center rounded text-fg-muted transition-colors hover:bg-raised hover:text-fg",onClick:_=>o.value={id:L.id,name:L.name}},[N(x(yo),{size:13})],8,bc)])],512),[[Pn,p(L.id)]])],2))),128)),r.value?(d(),G(qi,{key:0,"instance-id":r.value.id,"instance-name":r.value.name,onClose:B[1]||(B[1]=L=>r.value=null),onCreated:B[2]||(B[2]=L=>r.value=null)},null,8,["instance-id","instance-name"])):M("",!0),o.value?(d(),G(Hl,{key:1,"instance-id":o.value.id,"instance-name":o.value.name,onClose:B[3]||(B[3]=L=>o.value=null)},null,8,["instance-id","instance-name"])):M("",!0)]))}});async function gc(e,t=512){if(!e.type.startsWith("image/"))return;const u=await createImageBitmap(e,{imageOrientation:"from-image"}).catch(()=>null);if(!u)return;const n=Math.min(1,t/Math.max(u.width,u.height)),s=Math.max(1,Math.round(u.width*n)),a=Math.max(1,Math.round(u.height*n)),r=document.createElement("canvas");r.width=s,r.height=a;const o=r.getContext("2d");if(o)return o.drawImage(u,0,0,s,a),u.close(),r.toDataURL("image/jpeg",.8)}function xc(e){return new Promise((t,u)=>{const n=new FileReader;n.onload=()=>{const s=n.result;t(s.slice(s.indexOf(",")+1))},n.onerror=()=>u(n.error),n.readAsDataURL(e)})}const vc=5,yc=10*1024*1024,Da=wt("composer",()=>{const e=S(null);let t=0;function u(y,p){e.value={key:y,text:p,seq:++t}}const n=S([]),s=S(!1),a=S(null);let r="",o=0;function i(y){r=y}async function l(y){const p=r;if(p){a.value=null,s.value=!0;for(const g of y){if(n.value.length>=vc){a.value={reason:"too-many",filename:g.name};break}if(g.size>yc){a.value={reason:"too-large",filename:g.name};continue}const C=`local-${++o}`,$=g.type.startsWith("image/")?"image":"file",E={id:C,filename:g.name,mimeType:g.type||"application/octet-stream",size:g.size,kind:$,status:"uploading"};n.value.push(E);try{const A=await gc(g);A&&(E.previewUrl=A);const v=await xc(g),w=await se.upload(p,{filename:g.name,content:v,mimeType:E.mimeType});E.filePath=w.path,E.id=w.id,E.size=w.size,E.status="ready"}catch{E.status="error"}}s.value=n.value.some(g=>g.status==="uploading")}}function h(y){n.value=n.value.filter(p=>p.id!==y),a.value=null}function c(){n.value=[],a.value=null}return{insertRequest:e,requestInsert:u,pending:n,uploading:s,rejection:a,bindInstance:i,addFiles:l,removeAttachment:h,clearAttachments:c}}),Ds={};function kc(e){let t=Ds[e];if(t)return t;t=Ds[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);t.push(n)}for(let u=0;u<e.length;u++){const n=e.charCodeAt(u);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function Jt(e,t){typeof t!="string"&&(t=Jt.defaultChars);const u=kc(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let s="";for(let a=0,r=n.length;a<r;a+=3){const o=parseInt(n.slice(a+1,a+3),16);if(o<128){s+=u[o];continue}if((o&224)===192&&a+3<r){const i=parseInt(n.slice(a+4,a+6),16);if((i&192)===128){const l=o<<6&1984|i&63;l<128?s+="��":s+=String.fromCharCode(l),a+=3;continue}}if((o&240)===224&&a+6<r){const i=parseInt(n.slice(a+4,a+6),16),l=parseInt(n.slice(a+7,a+9),16);if((i&192)===128&&(l&192)===128){const h=o<<12&61440|i<<6&4032|l&63;h<2048||h>=55296&&h<=57343?s+="���":s+=String.fromCharCode(h),a+=6;continue}}if((o&248)===240&&a+9<r){const i=parseInt(n.slice(a+4,a+6),16),l=parseInt(n.slice(a+7,a+9),16),h=parseInt(n.slice(a+10,a+12),16);if((i&192)===128&&(l&192)===128&&(h&192)===128){let c=o<<18&1835008|i<<12&258048|l<<6&4032|h&63;c<65536||c>1114111?s+="����":(c-=65536,s+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),a+=9;continue}}s+="�"}return s})}Jt.defaultChars=";/?:@&=+$,#";Jt.componentChars="";const Ts={};function _c(e){let t=Ts[e];if(t)return t;t=Ts[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+u.toString(16).toUpperCase()).slice(-2))}for(let u=0;u<e.length;u++)t[e.charCodeAt(u)]=e[u];return t}function wu(e,t,u){typeof t!="string"&&(u=t,t=wu.defaultChars),typeof u>"u"&&(u=!0);const n=_c(t);let s="";for(let a=0,r=e.length;a<r;a++){const o=e.charCodeAt(a);if(u&&o===37&&a+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){s+=e.slice(a,a+3),a+=2;continue}if(o<128){s+=n[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&a+1<r){const i=e.charCodeAt(a+1);if(i>=56320&&i<=57343){s+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[a])}return s}wu.defaultChars=";/?:@&=+$,-_.!~*'()#";wu.componentChars="-_.!~*'()";function qn(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Bu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const wc=/^([a-z0-9.+-]+:)/i,Ec=/:[0-9]*$/,Ac=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$c=["<",">",'"',"`"," ","\r",`
|
|
242
242
|
`," "],Cc=["{","}","|","\\","^","`"].concat($c),Dc=["'"].concat(Cc),Ss=["%","/","?",";","#"].concat(Dc),Fs=["/","?","#"],Tc=255,Is=/^[+a-z0-9A-Z_-]{0,63}$/,Sc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ms={javascript:!0,"javascript:":!0},zs={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function jn(e,t){if(e&&e instanceof Bu)return e;const u=new Bu;return u.parse(e,t),u}Bu.prototype.parse=function(e,t){let u,n,s,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const l=Ac.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let r=wc.exec(a);if(r&&(r=r[0],u=r.toLowerCase(),this.protocol=r,a=a.substr(r.length)),(t||r||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=a.substr(0,2)==="//",s&&!(r&&Ms[r])&&(a=a.substr(2),this.slashes=!0)),!Ms[r]&&(s||r&&!zs[r])){let l=-1;for(let g=0;g<Fs.length;g++)n=a.indexOf(Fs[g]),n!==-1&&(l===-1||n<l)&&(l=n);let h,c;l===-1?c=a.lastIndexOf("@"):c=a.lastIndexOf("@",l),c!==-1&&(h=a.slice(0,c),a=a.slice(c+1),this.auth=h),l=-1;for(let g=0;g<Ss.length;g++)n=a.indexOf(Ss[g]),n!==-1&&(l===-1||n<l)&&(l=n);l===-1&&(l=a.length),a[l-1]===":"&&l--;const y=a.slice(0,l);a=a.slice(l),this.parseHost(y),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const g=this.hostname.split(/\./);for(let C=0,$=g.length;C<$;C++){const E=g[C];if(E&&!E.match(Is)){let A="";for(let v=0,w=E.length;v<w;v++)E.charCodeAt(v)>127?A+="x":A+=E[v];if(!A.match(Is)){const v=g.slice(0,C),w=g.slice(C+1),D=E.match(Sc);D&&(v.push(D[1]),w.unshift(D[2])),w.length&&(a=w.join(".")+a),this.hostname=v.join(".");break}}}}this.hostname.length>Tc&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const o=a.indexOf("#");o!==-1&&(this.hash=a.substr(o),a=a.slice(0,o));const i=a.indexOf("?");return i!==-1&&(this.search=a.substr(i),a=a.slice(0,i)),a&&(this.pathname=a),zs[u]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Bu.prototype.parseHost=function(e){let t=Ec.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Fc=Object.freeze(Object.defineProperty({__proto__:null,decode:Jt,encode:wu,format:qn,parse:jn},Symbol.toStringTag,{value:"Module"})),Ta=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Sa=/[\0-\x1F\x7F-\x9F]/,Ic=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Hn=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Fa=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ia=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Mc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ta,Cc:Sa,Cf:Ic,P:Hn,S:Fa,Z:Ia},Symbol.toStringTag,{value:"Module"})),zc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Oc=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var gn;const Lc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Rc=(gn=String.fromCodePoint)!==null&&gn!==void 0?gn:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Nc(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Lc.get(e))!==null&&t!==void 0?t:e}var $e;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})($e||($e={}));const Pc=32;var vt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(vt||(vt={}));function zn(e){return e>=$e.ZERO&&e<=$e.NINE}function Bc(e){return e>=$e.UPPER_A&&e<=$e.UPPER_F||e>=$e.LOWER_A&&e<=$e.LOWER_F}function Uc(e){return e>=$e.UPPER_A&&e<=$e.UPPER_Z||e>=$e.LOWER_A&&e<=$e.LOWER_Z||zn(e)}function qc(e){return e===$e.EQUALS||Uc(e)}var Ee;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ee||(Ee={}));var dt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(dt||(dt={}));class jc{constructor(t,u,n){this.decodeTree=t,this.emitCodePoint=u,this.errors=n,this.state=Ee.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=dt.Strict}startEntity(t){this.decodeMode=t,this.state=Ee.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,u){switch(this.state){case Ee.EntityStart:return t.charCodeAt(u)===$e.NUM?(this.state=Ee.NumericStart,this.consumed+=1,this.stateNumericStart(t,u+1)):(this.state=Ee.NamedEntity,this.stateNamedEntity(t,u));case Ee.NumericStart:return this.stateNumericStart(t,u);case Ee.NumericDecimal:return this.stateNumericDecimal(t,u);case Ee.NumericHex:return this.stateNumericHex(t,u);case Ee.NamedEntity:return this.stateNamedEntity(t,u)}}stateNumericStart(t,u){return u>=t.length?-1:(t.charCodeAt(u)|Pc)===$e.LOWER_X?(this.state=Ee.NumericHex,this.consumed+=1,this.stateNumericHex(t,u+1)):(this.state=Ee.NumericDecimal,this.stateNumericDecimal(t,u))}addToNumericResult(t,u,n,s){if(u!==n){const a=n-u;this.result=this.result*Math.pow(s,a)+parseInt(t.substr(u,a),s),this.consumed+=a}}stateNumericHex(t,u){const n=u;for(;u<t.length;){const s=t.charCodeAt(u);if(zn(s)||Bc(s))u+=1;else return this.addToNumericResult(t,n,u,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,n,u,16),-1}stateNumericDecimal(t,u){const n=u;for(;u<t.length;){const s=t.charCodeAt(u);if(zn(s))u+=1;else return this.addToNumericResult(t,n,u,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,n,u,10),-1}emitNumericEntity(t,u){var n;if(this.consumed<=u)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===$e.SEMI)this.consumed+=1;else if(this.decodeMode===dt.Strict)return 0;return this.emitCodePoint(Nc(this.result),this.consumed),this.errors&&(t!==$e.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,u){const{decodeTree:n}=this;let s=n[this.treeIndex],a=(s&vt.VALUE_LENGTH)>>14;for(;u<t.length;u++,this.excess++){const r=t.charCodeAt(u);if(this.treeIndex=Hc(n,s,this.treeIndex+Math.max(1,a),r),this.treeIndex<0)return this.result===0||this.decodeMode===dt.Attribute&&(a===0||qc(r))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],a=(s&vt.VALUE_LENGTH)>>14,a!==0){if(r===$e.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==dt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:u,decodeTree:n}=this,s=(n[u]&vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(u,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,u,n){const{decodeTree:s}=this;return this.emitCodePoint(u===1?s[t]&~vt.VALUE_LENGTH:s[t+1],n),u===3&&this.emitCodePoint(s[t+2],n),n}end(){var t;switch(this.state){case Ee.NamedEntity:return this.result!==0&&(this.decodeMode!==dt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ee.NumericDecimal:return this.emitNumericEntity(0,2);case Ee.NumericHex:return this.emitNumericEntity(0,3);case Ee.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ee.EntityStart:return 0}}}function Ma(e){let t="";const u=new jc(e,n=>t+=Rc(n));return function(s,a){let r=0,o=0;for(;(o=s.indexOf("&",o))>=0;){t+=s.slice(r,o),u.startEntity(a);const l=u.write(s,o+1);if(l<0){r=o+u.end();break}r=o+l,o=l===0?r+1:r}const i=t+s.slice(r);return t="",i}}function Hc(e,t,u,n){const s=(t&vt.BRANCH_LENGTH)>>7,a=t&vt.JUMP_TABLE;if(s===0)return a!==0&&n===a?u:-1;if(a){const i=n-a;return i<0||i>=s?-1:e[u+i]-1}let r=u,o=r+s-1;for(;r<=o;){const i=r+o>>>1,l=e[i];if(l<n)r=i+1;else if(l>n)o=i-1;else return e[i+s]}return-1}const za=Ma(zc);Ma(Oc);function Vc(e,t=dt.Legacy){return za(e,t)}function Wc(e){return za(e,dt.Strict)}function Gc(e){return Object.prototype.toString.call(e)}function Vn(e){return Gc(e)==="[object String]"}const Kc=Object.prototype.hasOwnProperty;function Zc(e,t){return Kc.call(e,t)}function Vu(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){if(u){if(typeof u!="object")throw new TypeError(u+"must be object");Object.keys(u).forEach(function(n){e[n]=u[n]})}}),e}function Oa(e,t,u){return[].concat(e.slice(0,t),u,e.slice(t+1))}function Wn(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function bu(e){if(e>65535){e-=65536;const t=55296+(e>>10),u=56320+(e&1023);return String.fromCharCode(t,u)}return String.fromCharCode(e)}const La=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Yc=/&([a-z#][a-z0-9]{1,31});/gi,Xc=new RegExp(La.source+"|"+Yc.source,"gi"),Jc=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Qc(e,t){if(t.charCodeAt(0)===35&&Jc.test(t)){const n=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Wn(n)?bu(n):e}const u=Vc(e);return u!==e?u:e}function e0(e){return e.indexOf("\\")<0?e:e.replace(La,"$1")}function Qt(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Xc,function(t,u,n){return u||Qc(t,n)})}const t0=/[&<>"]/,u0=/[&<>"]/g,n0={"&":"&","<":"<",">":">",'"':"""};function s0(e){return n0[e]}function yt(e){return t0.test(e)?e.replace(u0,s0):e}const a0=/[.?*+^$[\]\\(){}|-]/g;function r0(e){return e.replace(a0,"\\$&")}function he(e){switch(e){case 9:case 32:return!0}return!1}function mu(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ra(e){return Hn.test(e)||Fa.test(e)}function gu(e){return Ra(bu(e))}function xu(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Wu(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Os(e){return e===32||e===9||e===10||e===13}function Gu(e){let t=0;for(;t<e.length&&Os(e.charCodeAt(t));t++);let u=e.length-1;for(;u>=t&&Os(e.charCodeAt(u));u--);return e.slice(t,u+1)}const o0={mdurl:Fc,ucmicro:Mc},i0=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Oa,asciiTrim:Gu,assign:Vu,escapeHtml:yt,escapeRE:r0,fromCodePoint:bu,has:Zc,isMdAsciiPunct:xu,isPunctChar:Ra,isPunctCharCode:gu,isSpace:he,isString:Vn,isValidEntityCode:Wn,isWhiteSpace:mu,lib:o0,normalizeReference:Wu,unescapeAll:Qt,unescapeMd:e0},Symbol.toStringTag,{value:"Module"}));function l0(e,t,u){let n,s,a,r;const o=e.posMax,i=e.pos;for(e.pos=t+1,n=1;e.pos<o;){if(a=e.src.charCodeAt(e.pos),a===93&&(n--,n===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),a===91){if(r===e.pos-1)n++;else if(u)return e.pos=i,-1}}let l=-1;return s&&(l=e.pos),e.pos=i,l}function c0(e,t,u){let n,s=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<u;){if(n=e.charCodeAt(s),n===10||n===60)return a;if(n===62)return a.pos=s+1,a.str=Qt(e.slice(t+1,s)),a.ok=!0,a;if(n===92&&s+1<u){s+=2;continue}s++}return a}let r=0;for(;s<u&&(n=e.charCodeAt(s),!(n===32||n<32||n===127));){if(n===92&&s+1<u){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(n===40&&(r++,r>32))return a;if(n===41){if(r===0)break;r--}s++}return t===s||r!==0||(a.str=Qt(e.slice(t,s)),a.pos=s,a.ok=!0),a}function d0(e,t,u,n){let s,a=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)r.str=n.str,r.marker=n.marker;else{if(a>=u)return r;let o=e.charCodeAt(a);if(o!==34&&o!==39&&o!==40)return r;t++,a++,o===40&&(o=41),r.marker=o}for(;a<u;){if(s=e.charCodeAt(a),s===r.marker)return r.pos=a+1,r.str+=Qt(e.slice(t,a)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&a+1<u&&a++,a++}return r.can_continue=!0,r.str+=Qt(e.slice(t,a)),r}const f0=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:c0,parseLinkLabel:l0,parseLinkTitle:d0},Symbol.toStringTag,{value:"Module"})),at={};at.code_inline=function(e,t,u,n,s){const a=e[t];return"<code"+s.renderAttrs(a)+">"+yt(a.content)+"</code>"};at.code_block=function(e,t,u,n,s){const a=e[t];return"<pre"+s.renderAttrs(a)+"><code>"+yt(e[t].content)+`</code></pre>
|
|
243
243
|
`};at.fence=function(e,t,u,n,s){const a=e[t],r=a.info?Qt(a.info).trim():"";let o="",i="";if(r){const h=r.split(/(\s+)/g);o=h[0],i=h.slice(2).join("")}let l;if(u.highlight?l=u.highlight(a.content,o,i)||yt(a.content):l=yt(a.content),l.indexOf("<pre")===0)return l+`
|
|
244
244
|
`;if(r){const h=a.attrIndex("class"),c=a.attrs?a.attrs.slice():[];h<0?c.push(["class",u.langPrefix+o]):(c[h]=c[h].slice(),c[h][1]+=" "+u.langPrefix+o);const y={attrs:c};return`<pre><code${s.renderAttrs(y)}>${l}</code></pre>
|
|
@@ -280,7 +280,7 @@ $$`:`${e}$$`},z1=e=>F1(e)%2===0?e:M1(e),O1=e=>I1(e)%2===1?`${e}$`:e,L1=(e,t,u)=>
|
|
|
280
280
|
`),u=[];let n=!1;for(let s=0;s<t.length;s++){const a=t[s];if(/^\s*(```|~~~)/.test(a)){n=!n,u.push(a);continue}if(n){u.push(a);continue}const r=u.length>0?u[u.length-1]:null,o=r!==null&&fu(r);if(fu(a)&&!X1(a)&&!o&&!fa(a)){const i=s+1<t.length?t[s+1]:null;if(i!==null&&fu(i)&&fa(i)){u.length>0&&u[u.length-1].trim()!==""&&u.push(""),u.push(a);continue}if(i!==null&&fu(i)){u.length>0&&u[u.length-1].trim()!==""&&u.push(""),u.push(a),u.push(J1(br(a).length));continue}u.push(a);continue}u.push(a)}return u.join(`
|
|
281
281
|
`)}const Jn=new je({html:!1,linkify:!0,breaks:!0});Jn.renderer.rules.table_open=()=>'<div class="md-table-wrap"><table>';Jn.renderer.rules.table_close=()=>"</table></div>";ar.addHook("afterSanitizeAttributes",e=>{e.nodeName==="A"&&e.hasAttribute("href")&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer nofollow"))});function ep(e,t={}){const u=t.streaming?Y1(e):e,n=Q1(u),s=Jn.render(n);return ar.sanitize(s)}const tp=["innerHTML"],mr=ce({__name:"StreamMarkdown",props:{text:{},streaming:{type:Boolean}},setup(e){const t=e,u=Z(()=>ep(t.text,{streaming:t.streaming}));return(n,s)=>(d(),m("div",{class:"stream-md text-sm",innerHTML:u.value},null,8,tp))}}),Ht=ce({__name:"ExpandableBlock",props:{maxPx:{default:200}},setup(e){const t=e,u=S(!1),n=S(!1),s=S(null);let a=null;function r(){const o=s.value;o&&(n.value=o.scrollHeight>t.maxPx+8)}return ut(()=>{qe(r),typeof ResizeObserver<"u"&&s.value&&(a=new ResizeObserver(()=>r()),a.observe(s.value))}),eu(()=>a==null?void 0:a.disconnect()),me(u,()=>{u.value||qe(r)}),(o,i)=>(d(),m("div",null,[f("div",{ref_key:"inner",ref:s,"data-test":"clamp-inner",class:J(!u.value&&n.value?"overflow-hidden":""),style:yu(!u.value&&n.value?{maxHeight:e.maxPx+"px"}:void 0)},[Hr(o.$slots,"default")],6),n.value?(d(),m("button",{key:0,type:"button","data-test":"expand-toggle",class:"mt-1 inline-flex items-center gap-1 text-[10.5px] font-medium text-accent hover:underline",onClick:i[0]||(i[0]=l=>u.value=!u.value)},[(d(),G(Ft(u.value?x(Jr):x(st)),{size:12})),pe(" "+k(u.value?"Show less":"Show more"),1)])):M("",!0)]))}}),up={class:"mt-1 space-y-1 text-xs"},np={class:"flex min-w-0 items-center gap-2 font-mono text-fg-muted"},sp={class:"inline-flex min-w-0 items-center gap-1"},ap={class:"truncate"},rp={"data-test":"diff-stats",class:"ml-auto flex shrink-0 items-center gap-2 font-mono text-[10px]"},op={key:0,class:"text-run"},ip={key:1,class:"text-danger"},lp={class:"overflow-x-auto rounded bg-bg p-2 font-mono"},cp={"data-test":"cmd-command",class:"break-all font-mono text-fg"},dp={"data-test":"cmd-output",class:"overflow-x-auto rounded bg-raised p-2 font-mono text-fg whitespace-pre-wrap"},fp={key:1,class:"text-fg-muted"},pp={"data-test":"read-path",class:"flex min-w-0 items-center gap-1 font-mono text-fg"},hp={class:"truncate"},bp={key:0,class:"ml-2 shrink-0 text-fg-muted"},mp={class:"overflow-x-auto rounded bg-bg p-2 font-mono text-fg-muted whitespace-pre-wrap"},gp={"data-test":"search-query",class:"flex min-w-0 items-center gap-1 font-mono text-fg"},xp={class:"truncate"},vp={"data-test":"search-output",class:"overflow-x-auto rounded bg-bg p-2 font-mono text-fg-muted whitespace-pre-wrap"},yp={class:"grid grid-cols-[auto,1fr] gap-x-3 gap-y-1"},kp={class:"text-fg-muted"},_p=["data-test"],wp={class:"overflow-x-auto rounded bg-bg p-2 font-mono text-fg-muted whitespace-pre-wrap"},Ep={"data-test":"tool-text",class:"whitespace-pre-wrap text-fg-muted"},gr=ce({__name:"ToolDetail",props:{detail:{}},setup(e){const t=e,u=Z(()=>t.detail.type!=="diff"?{del:[],add:[]}:{del:t.detail.oldText.split(`
|
|
282
282
|
`),add:t.detail.newText.split(`
|
|
283
|
-
`)}),n=Z(()=>({add:u.value.add.filter(s=>s.length>0).length,del:u.value.del.filter(s=>s.length>0).length}));return(s,a)=>(d(),m("div",up,[e.detail.type==="diff"?(d(),m(X,{key:0},[f("div",np,[f("span",sp,[N(x(Nu),{size:14,class:"shrink-0"}),f("span",ap,k(e.detail.path),1)]),f("span",rp,[n.value.add?(d(),m("span",op,"+"+k(n.value.add),1)):M("",!0),n.value.del?(d(),m("span",ip,"−"+k(n.value.del),1)):M("",!0)])]),N(Ht,null,{default:mt(()=>[f("div",lp,[(d(!0),m(X,null,ie(u.value.del,(r,o)=>(d(),m("div",{key:"d"+o,"data-test":"diff-del",class:"whitespace-pre text-danger"},"- "+k(r),1))),128)),(d(!0),m(X,null,ie(u.value.add,(r,o)=>(d(),m("div",{key:"a"+o,"data-test":"diff-add",class:"whitespace-pre text-run"},"+ "+k(r),1))),128))])]),_:1})],64)):e.detail.type==="command"?(d(),m(X,{key:1},[f("div",cp,"$ "+k(e.detail.command),1),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",dp,k(e.detail.output),1)]),_:1})):M("",!0),e.detail.exitCode!==void 0?(d(),m("div",fp,"exit "+k(e.detail.exitCode),1)):M("",!0)],64)):e.detail.type==="read"?(d(),m(X,{key:2},[f("div",pp,[N(x(Nu),{size:14,class:"shrink-0"}),f("span",hp,k(e.detail.path),1),e.detail.lines?(d(),m("span",bp,k(e.detail.lines),1)):M("",!0)]),e.detail.preview?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",mp,k(e.detail.preview),1)]),_:1})):M("",!0)],64)):e.detail.type==="search"?(d(),m(X,{key:3},[f("div",gp,[N(x(ju),{size:14,class:"shrink-0"}),f("span",xp,k(e.detail.query),1)]),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",vp,k(e.detail.output),1)]),_:1})):M("",!0)],64)):e.detail.type==="fields"?(d(),m(X,{key:4},[f("dl",yp,[(d(!0),m(X,null,ie(e.detail.fields,r=>(d(),m(X,{key:r.label},[f("dt",kp,k(r.label),1),f("dd",{"data-test":"field-"+r.label,class:"font-mono text-fg break-all"},k(r.value),9,_p)],64))),128))]),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",wp,k(e.detail.output),1)]),_:1})):M("",!0)],64)):e.detail.type==="text"?(d(),G(Ht,{key:5},{default:mt(()=>[f("p",Ep,k(e.detail.text),1)]),_:1})):M("",!0)]))}}),Ap=ce({__name:"FueDot",props:{pulsing:{type:Boolean,default:!0}},setup(e){return(t,u)=>(d(),m("span",{"data-test":"fue-dot",class:J(["inline-block h-2 w-2 rounded-full bg-accent",e.pulsing?"animate-pulse motion-reduce:animate-none":""]),"aria-hidden":"true"},null,2))}}),Vt=8;function xr(e,t,u,n=Vt){const s=e.top+e.height+n,a=e.top-t.height-n,r=u.height-(e.top+e.height),o=e.top,h=s+t.height>u.height-Vt&&o>r?"above":"below",c=h==="above"?Math.max(Vt,a):s,y=e.left+e.width/2-t.width/2,p=Math.max(Vt,u.width-t.width-Vt),g=Math.min(Math.max(Vt,y),p);return{top:c,left:g,placement:h}}const $p={class:"flex items-center gap-2 font-medium text-fg"},Cp={class:"mt-1 text-xs text-fg-muted"},Dp={class:"mt-2 flex justify-end"},Tp=ce({__name:"FueCallout",props:{title:{},body:{},anchor:{}},emits:["dismiss"],setup(e,{emit:t}){const u=e,n=t,s=S(null),a=S({visibility:"hidden"});function r(){const i=s.value;if(!i)return;const l={width:i.offsetWidth||256,height:i.offsetHeight||96},h={width:window.innerWidth,height:window.innerHeight};if(u.anchor){const c=xr(u.anchor,l,h);a.value={top:`${c.top}px`,left:`${c.left}px`,visibility:"visible"}}else a.value={top:`${Math.max(8,h.height/2-l.height/2)}px`,left:`${Math.max(8,h.width/2-l.width/2)}px`,visibility:"visible"}}function o(i){i.key==="Escape"&&n("dismiss")}return ut(()=>{r(),window.addEventListener("keydown",o),window.addEventListener("resize",r)}),eu(()=>{window.removeEventListener("keydown",o),window.removeEventListener("resize",r)}),(i,l)=>(d(),G(tu,{to:"body"},[f("div",{ref_key:"card",ref:s,"data-test":"fue-callout",class:"fixed z-50 w-64 rounded-lg border border-border bg-raised p-3 text-sm shadow-lg",style:yu(a.value),role:"dialog"},[f("p",$p,[l[1]||(l[1]=f("span",{class:"inline-block h-2 w-2 rounded-full bg-accent","aria-hidden":"true"},null,-1)),pe(" "+k(e.title),1)]),f("p",Cp,k(e.body),1),f("div",Dp,[f("button",{"data-test":"fue-dismiss",type:"button",class:"rounded bg-accent px-2 py-1 text-xs font-medium text-white hover:bg-accent-hover",onClick:l[0]||(l[0]=h=>n("dismiss"))},k(i.$t("fue.gotIt")),1)])],4)]))}}),vr="xacpx.fue.v1.";function Sp(e){try{return localStorage.getItem(vr+e)==="1"}catch{return!1}}function Fp(e){try{localStorage.setItem(vr+e,"1")}catch{}}function Ip(e){const t=S(Sp(e)?"acknowledged":"unseen");function u(){t.value==="unseen"&&(t.value="engaging")}function n(){t.value="acknowledged",Fp(e)}return{status:t,engage:u,dismiss:n}}const Qn={read:Yr,search:ju,execute:_o,edit:mo,think:Bn,other:_a},Mp={running:zt,success:uu,error:nt},zp=["read","search","execute","edit","think","other"],Op=["running","success","error"],pa=5;function Lp(e){const t=new Map,u=new Map;for(const n of e)t.set(n.kind,(t.get(n.kind)??0)+1),u.set(n.status,(u.get(n.status)??0)+1);return{kinds:zp.filter(n=>t.has(n)).map(n=>({icon:Qn[n],count:t.get(n),label:n})),statuses:Op.filter(n=>u.has(n)).map(n=>({icon:Mp[n],count:u.get(n),label:n}))}}const Rp={class:"overflow-hidden rounded-lg border border-border bg-surface text-xs shadow-e1"},Np={class:"inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-fg-muted"},Pp={key:3,"data-test":"tool-count",class:"font-mono text-[10.5px] text-fg-muted"},Bp={"data-test":"tool-summary",class:"ml-1 flex items-center gap-1.5 text-[10.5px] text-fg-muted"},Up=["data-test"],qp={class:"tabular-nums"},jp={key:0,class:"text-fg-muted"},Hp=["data-test"],Vp={class:"tabular-nums"},Wp={key:1,class:"space-y-1 border-t border-border px-3 pb-2.5 pt-2"},Gp=["onClick"],Kp={class:"truncate font-mono text-[11px] text-fg"},Zp={key:0,class:"ml-auto font-mono text-[10.5px] text-fg-muted"},Yp={key:0,class:"px-2 pb-2 pt-1"},Xp=ce({__name:"ToolCallPanel",props:{steps:{}},setup(e){const t=e,u=S(t.steps.length<=pa),n=S(new Set);function s(p){n.value.has(p)?n.value.delete(p):n.value.add(p),n.value=new Set(n.value)}const a=Z(()=>Lp(t.steps)),r=Ip("tool-group-collapse"),o=Z(()=>t.steps.length>pa),i=Z(()=>o.value&&r.status.value!=="acknowledged"),l=S(null),h=S(null);function c(){var p;if(u.value=!u.value,i.value){const g=(p=l.value)==null?void 0:p.getBoundingClientRect();g&&(h.value={top:g.top,left:g.left,width:g.width,height:g.height}),r.engage()}}function y(p){return p===void 0?"":p>=1e3?`${(p/1e3).toFixed(1)}s`:`${p}ms`}return(p,g)=>(d(),m("div",Rp,[f("button",{ref_key:"header",ref:l,type:"button",class:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-bg",onClick:c},[u.value?(d(),G(x(st),{key:0,size:13,class:"text-fg-muted"})):(d(),G(x(Mt),{key:1,size:13,class:"text-fg-muted"})),f("span",Np,[N(x(_a),{size:13}),pe(" "+k(p.$t("tools.toolSteps")),1)]),i.value?(d(),G(Ap,{key:2,pulsing:x(r).status.value==="unseen"},null,8,["pulsing"])):(d(),m("span",Pp,k(e.steps.length),1)),f("span",Bp,[(d(!0),m(X,null,ie(a.value.kinds,C=>(d(),m("span",{key:"k"+C.label,"data-test":"sum-"+C.label,class:"inline-flex items-center gap-0.5"},[(d(),G(Ft(C.icon),{size:11})),f("span",qp,k(C.count),1)],8,Up))),128)),a.value.statuses.length?(d(),m("span",jp,"·")):M("",!0),(d(!0),m(X,null,ie(a.value.statuses,C=>(d(),m("span",{key:"s"+C.label,"data-test":"sum-"+C.label,class:J(["inline-flex items-center gap-0.5",C.label==="success"?"text-run":C.label==="error"?"text-danger":"text-fg-muted"])},[(d(),G(Ft(C.icon),{size:11,class:J(C.label==="running"?"animate-spin motion-reduce:animate-none":"")},null,8,["class"])),f("span",Vp,k(C.count),1)],10,Hp))),128))])],512),x(r).status.value==="engaging"?(d(),G(Tp,{key:0,title:p.$t("tools.collapsed"),body:p.$t("tools.collapsedBody"),anchor:h.value,onDismiss:g[0]||(g[0]=C=>x(r).dismiss())},null,8,["title","body","anchor"])):M("",!0),u.value?(d(),m("ul",Wp,[(d(!0),m(X,null,ie(e.steps,C=>(d(),m("li",{key:C.toolCallId},[f("button",{type:"button","data-test":"tool-row",class:"flex w-full items-center gap-2 rounded text-left text-[12px] hover:bg-fg/5",onClick:$=>s(C.toolCallId)},[f("span",{class:J(["grid h-4 w-4 shrink-0 place-items-center rounded-full",C.status==="success"?"bg-run/15":C.status==="running"?"bg-accent/15":"bg-danger/15"])},[C.status==="success"?(d(),G(x(uu),{key:0,"data-test":"step-status-success",size:9,class:"text-run"})):C.status==="running"?(d(),G(x(zt),{key:1,"data-test":"step-status-running",size:9,class:"animate-spin motion-reduce:animate-none text-accent"})):(d(),G(x(pu),{key:2,"data-test":"step-status-error",size:9,class:"text-danger"}))],2),(d(),G(Ft(x(Qn)[C.kind]),{size:12,class:"shrink-0 text-fg-muted"})),f("span",Kp,k(C.title),1),C.durationMs!==void 0?(d(),m("span",Zp,k(y(C.durationMs)),1)):M("",!0)],8,Gp),n.value.has(C.toolCallId)&&C.detail?(d(),m("div",Yp,[N(gr,{detail:C.detail},null,8,["detail"])])):M("",!0)]))),128))])):M("",!0)]))}}),Jp={class:"overflow-hidden rounded-lg border border-border bg-surface text-xs shadow-e1"},Qp={key:2,"data-test":"reasoning-shimmer",class:"ml-1 inline-block h-1.5 w-1.5 animate-pulse motion-reduce:animate-none rounded-full bg-fg-muted","aria-hidden":"true"},eh={key:0,"data-test":"reasoning-body",class:"whitespace-pre-wrap border-t border-border px-3 pb-2.5 pt-2 text-[12px] leading-relaxed text-fg-muted"},yr=ce({__name:"ReasoningPanel",props:{reasoning:{},defaultOpen:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){const u=S(e.defaultOpen??!1),n=Z(()=>u.value);return(s,a)=>(d(),m("div",Jp,[f("button",{type:"button",class:"flex w-full items-center gap-1.5 px-3 py-2 text-left text-fg-muted",onClick:a[0]||(a[0]=r=>u.value=!u.value)},[n.value?(d(),G(x(st),{key:0,size:13})):(d(),G(x(Mt),{key:1,size:13})),N(x(Bn),{size:13,class:J(e.streaming?"text-accent":"")},null,8,["class"]),f("span",{class:J(["text-[12px] font-medium",e.streaming?"shimmer-text":""])},k(e.streaming?s.$t("reasoning.reasoningStreaming"):s.$t("reasoning.reasoning")),3),e.streaming?(d(),m("span",Qp)):M("",!0)]),n.value?(d(),m("p",eh,k(e.reasoning),1)):M("",!0)]))}}),th={class:"truncate font-mono text-[11.5px] text-fg"},uh={class:"ml-auto flex shrink-0 items-center gap-2"},nh={key:0,class:"font-mono text-[10.5px] text-fg-muted"},sh={key:0,class:"border-t border-border px-3 pb-2.5 pt-2"},ah={key:0,"data-test":"tool-step-error",class:"mb-1.5 flex items-start gap-1.5 rounded bg-danger/10 px-2 py-1.5 text-danger"},rh={class:"whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed"},oh=ce({__name:"ToolStepCard",props:{step:{}},setup(e){const t=S(!0);function u(n){return n===void 0?"":n>=1e3?`${(n/1e3).toFixed(1)}s`:`${n}ms`}return(n,s)=>(d(),m("div",{"data-test":"tool-step-card",class:J(["overflow-hidden rounded-lg border bg-surface text-xs shadow-e1",e.step.status==="error"?"border-danger/40":"border-border"])},[f("button",{type:"button","data-test":"tool-step-header",class:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-bg",onClick:s[0]||(s[0]=a=>t.value=!t.value)},[t.value?(d(),G(x(st),{key:0,size:13,class:"text-fg-muted"})):(d(),G(x(Mt),{key:1,size:13,class:"text-fg-muted"})),(d(),G(Ft(x(Qn)[e.step.kind]),{size:13,class:"shrink-0 text-fg-muted"})),f("span",th,k(e.step.title),1),f("span",uh,[e.step.durationMs!==void 0?(d(),m("span",nh,k(u(e.step.durationMs)),1)):M("",!0),e.step.status==="success"?(d(),G(x(uu),{key:1,"data-test":"step-status-success",size:13,class:"text-run"})):e.step.status==="running"?(d(),G(x(zt),{key:2,"data-test":"step-status-running",size:13,class:"animate-spin motion-reduce:animate-none text-accent"})):(d(),G(x(pu),{key:3,"data-test":"step-status-error",size:13,class:"text-danger"}))])]),t.value?(d(),m("div",sh,[e.step.status==="error"&&e.step.error?(d(),m("div",ah,[N(x(pu),{size:13,class:"mt-0.5 shrink-0"}),f("span",rh,k(e.step.error),1)])):M("",!0),e.step.detail?(d(),G(gr,{key:1,detail:e.step.detail},null,8,["detail"])):M("",!0)])):M("",!0)],2))}}),ih={class:"space-y-2.5"},ha=ce({__name:"TurnParts",props:{parts:{},streaming:{type:Boolean}},setup(e){const t=e,u=n=>t.streaming===!0&&n===t.parts.length-1;return(n,s)=>(d(),m("div",ih,[(d(!0),m(X,null,ie(e.parts,(a,r)=>(d(),m(X,{key:r},[a.type==="reasoning"?(d(),G(yr,{key:0,reasoning:a.text,streaming:u(r),"default-open":!1},null,8,["reasoning","streaming"])):a.type==="tool"?(d(),G(oh,{key:1,step:a.step},null,8,["step"])):(d(),G(mr,{key:2,text:a.text,streaming:u(r),class:J(["text-[14px] leading-relaxed text-fg",u(r)?"caret":""])},null,8,["text","streaming","class"]))],64))),128))]))}}),lh=["aria-label","title"],kr=ce({__name:"CopyButton",props:{text:{}},setup(e){const t=e,u=S(!1);let n=null;async function s(){try{await navigator.clipboard.writeText(t.text)}catch{const a=document.createElement("textarea");a.value=t.text,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy")}catch{}document.body.removeChild(a)}u.value=!0,n&&clearTimeout(n),n=setTimeout(()=>u.value=!1,1200)}return(a,r)=>(d(),m("button",{"data-test":"copy-button",type:"button","aria-label":a.$t("copy.copy"),title:u.value?a.$t("copy.copied"):a.$t("copy.copy"),class:"rounded p-1 leading-none text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:Ae(s,["stop"])},[u.value?(d(),G(x(uu),{key:0,size:14,class:"text-run"})):(d(),G(x(uo),{key:1,size:14}))],8,lh))}}),ch={class:"mt-1 flex flex-wrap gap-2"},dh=["src","alt"],fh={key:1,"data-test":"att-file",class:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-[13px]"},ph={class:"max-w-[180px] truncate"},hh={class:"text-fg-muted"},bh=ce({__name:"MessageAttachments",props:{attachments:{}},setup(e){function t(u){return u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(0)} KB`:`${(u/1024/1024).toFixed(1)} MB`}return(u,n)=>(d(),m("div",ch,[(d(!0),m(X,null,ie(e.attachments,s=>(d(),m(X,{key:s.id},[s.kind==="image"&&s.previewUrl?(d(),m("img",{key:0,"data-test":"att-image",src:s.previewUrl,alt:s.filename,class:"max-h-40 max-w-[200px] rounded-lg border border-border object-cover"},null,8,dh)):(d(),m("div",fh,[N(x(Zt),{size:16,class:"shrink-0 text-fg-muted"}),f("span",ph,k(s.filename),1),f("span",hh,k(t(s.size)),1)]))],64))),128))]))}}),mh={class:"relative flex-1 overflow-hidden"},gh={class:"mx-auto max-w-3xl space-y-5"},xh={key:0,"data-test":"loading-older",class:"flex justify-center py-1 text-[11px] text-fg-muted"},vh=["data-scheduled-task"],yh={class:"flex max-w-[80%] flex-col items-end"},kh=["title"],_h={class:"whitespace-pre-wrap text-[14px] leading-relaxed text-fg"},wh={key:1,class:"mt-1 flex items-center gap-2"},Eh={"data-test":"msg-failed",class:"text-xs text-danger"},Ah=["title","onClick"],$h={key:1,class:"cv-row group flex gap-2.5"},Ch={class:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-lg border border-border bg-surface"},Dh={"data-test":"msg-actions",class:"flex items-center gap-1.5 pt-0.5 text-fg-muted"},Th={key:1,"data-test":"msg-time",class:"font-mono text-[10.5px] tabular-nums"},Sh={key:2,"data-test":"msg-cancelled",class:"inline-flex items-center gap-1 text-[11px] text-warn"},Fh={key:3,"data-test":"msg-failed",class:"text-[11px] text-danger"},Ih={key:1,class:"flex gap-2.5"},Mh={class:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-lg border border-border bg-surface"},zh={"data-test":"msg-streaming",class:"min-w-0 flex-1"},Oh=48,Lh=240,Rh=ce({__name:"MessageList",props:{messages:{},liveTurn:{},hasMoreOlder:{type:Boolean},loadingOlder:{type:Boolean},sessionKey:{},scrollToScheduled:{}},emits:["resend","loadOlder"],setup(e,{emit:t}){const u=e,n=t;function s(c){var y;return c.scheduled??((y=c.structured)==null?void 0:y.scheduled)}const a=S(null),r=S(!0);let o=null;function i(){const c=a.value;c&&(r.value=c.scrollHeight-c.scrollTop-c.clientHeight<=Oh,c.scrollTop<=Lh&&u.hasMoreOlder&&!u.loadingOlder&&o===null&&(o=c.scrollHeight-c.scrollTop,n("loadOlder")))}me(()=>u.loadingOlder,(c,y)=>{if(!(y&&!c)||o===null)return;const p=o;o=null,qe(()=>{const g=a.value;g&&(g.scrollTop=g.scrollHeight-p)})});let l=0;function h(c=!1){const y=a.value;if(!y||(typeof y.scrollTo=="function"?y.scrollTo({top:y.scrollHeight,behavior:c?"smooth":"auto"}):y.scrollTop=y.scrollHeight,r.value=!0,c||typeof requestAnimationFrame!="function"))return;l&&cancelAnimationFrame(l);let p=0;const g=()=>{l=0;const C=a.value;C&&(C.scrollHeight-C.scrollTop-C.clientHeight>1&&(C.scrollTop=C.scrollHeight),++p<4&&(l=requestAnimationFrame(g)))};l=requestAnimationFrame(g)}return me(()=>u.sessionKey,()=>{r.value=!0,o=null,qe(()=>h(!1))}),me(()=>{var c;return(c=u.scrollToScheduled)==null?void 0:c.nonce},()=>{var y;const c=(y=u.scrollToScheduled)==null?void 0:y.taskId;c&&qe(()=>{var g;const p=(g=a.value)==null?void 0:g.querySelector(`[data-scheduled-task="${c}"]`);p&&typeof p.scrollIntoView=="function"&&(p.scrollIntoView({behavior:"smooth",block:"center"}),r.value=!1)})}),me(()=>{const c=u.liveTurn,y=c==null?void 0:c.parts[c.parts.length-1],p=y?y.type==="tool"?y.step.status:y.text.length:0;return[u.messages.length,(c==null?void 0:c.parts.length)??0,p]},()=>{r.value&&qe(()=>h(!1))}),(c,y)=>(d(),m("div",mh,[f("div",{ref_key:"scroller",ref:a,"data-test":"msg-scroller",class:"thin-scroll h-full overflow-y-auto px-3 py-4 lg:px-5 lg:py-5",onScroll:i},[f("div",gh,[e.loadingOlder?(d(),m("div",xh,[N(x(zt),{size:13,class:"animate-spin motion-reduce:animate-none"})])):M("",!0),(d(!0),m(X,null,ie(e.messages,(p,g)=>{var C,$,E,A,v,w,D;return d(),m(X,{key:p.id!==void 0?`p${p.id}`:`o${p.createdAt}:${g}`},[p.direction==="in"?(d(),m("div",{key:0,class:"cv-row flex justify-end","data-scheduled-task":(C=s(p))==null?void 0:C.taskId},[f("div",yh,[s(p)?(d(),m("span",{key:0,"data-test":"msg-scheduled-badge",class:"mb-1 inline-flex items-center gap-1 rounded-full bg-accent/10 px-2 py-0.5 text-[10.5px] font-medium text-accent",title:`${c.$t("chat.scheduledFor")} ${x(Un)(s(p).executeAt)}`},[N(x(ka),{size:11}),pe(k(c.$t("chat.scheduled")),1)],8,kh)):M("",!0),f("div",{"data-test":"msg-in",class:J(["rounded-2xl rounded-tr-md border border-accent/15 bg-accent/10 px-3.5 py-2",p.failed?"ring-1 ring-danger":""])},[f("p",_h,k(p.text),1),($=p.attachments)!=null&&$.length?(d(),G(bh,{key:0,attachments:p.attachments},null,8,["attachments"])):M("",!0)],2),p.failed?(d(),m("div",wh,[f("span",Eh,k(c.$t("chat.failedToSend")),1),f("button",{type:"button","data-test":"msg-resend",class:"inline-flex items-center gap-1 text-xs font-medium text-accent hover:opacity-80",title:c.$t("chat.resendThis"),onClick:P=>n("resend",p)},[N(x(xo),{size:12}),pe(k(c.$t("chat.resend")),1)],8,Ah)])):M("",!0)])],8,vh)):(d(),m("div",$h,[f("div",Ch,[N(x(Fn),{size:13,class:"text-accent"})]),f("div",{"data-test":"msg-out",class:J(["min-w-0 flex-1 space-y-2.5",p.failed?"rounded-lg ring-1 ring-danger":""])},[(A=(E=p.structured)==null?void 0:E.parts)!=null&&A.length?(d(),G(ha,{key:0,parts:p.structured.parts},null,8,["parts"])):(d(),m(X,{key:1},[(w=(v=p.structured)==null?void 0:v.toolSteps)!=null&&w.length?(d(),G(Xp,{key:0,steps:p.structured.toolSteps},null,8,["steps"])):M("",!0),(D=p.structured)!=null&&D.reasoning?(d(),G(yr,{key:1,reasoning:p.structured.reasoning,"default-open":!1},null,8,["reasoning"])):M("",!0),p.text?(d(),G(mr,{key:2,text:p.text,class:"text-[14px] leading-relaxed text-fg"},null,8,["text"])):M("",!0)],64)),f("div",Dh,[p.text?(d(),G(kr,{key:0,text:p.text},null,8,["text"])):M("",!0),x(Cs)(p.createdAt)?(d(),m("span",Th,k(x(Cs)(p.createdAt)),1)):M("",!0),p.status==="cancelled"?(d(),m("span",Sh,[N(x(Qr),{size:12}),pe(" "+k(c.$t("chat.stopped")),1)])):M("",!0),p.failed?(d(),m("span",Fh,k(c.$t("chat.failed")),1)):M("",!0)])],2)]))],64)}),128)),e.liveTurn&&e.liveTurn.parts.length?(d(),m("div",Ih,[f("div",Mh,[N(x(Fn),{size:13,class:"text-accent"})]),f("div",zh,[N(ha,{parts:e.liveTurn.parts,streaming:!0},null,8,["parts"])])])):M("",!0)])],544),_e(f("button",{"data-test":"jump-latest",type:"button",class:"absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full border border-border bg-raised px-3 py-1 text-xs text-fg-muted shadow hover:bg-fg/5",onClick:y[0]||(y[0]=p=>h(!0))},k(c.$t("chat.jumpLatest")),513),[[Pn,!r.value]])]))}}),Nh=Kr(Rh,[["__scopeId","data-v-c68894eb"]]),_r="xacpx.composer-drafts.v1";function wr(){try{const e=sessionStorage.getItem(_r);return e?JSON.parse(e):{}}catch{return{}}}function Ph(e){try{sessionStorage.setItem(_r,JSON.stringify(e))}catch{}}function ba(e){return e?wr()[e]??"":""}function ma(e,t){if(!e)return;const u=wr();t?u[e]=t:delete u[e],Ph(u)}const Bh={class:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Uh={class:"flex items-baseline justify-between tabular-nums"},qh={class:"text-fg"},jh={class:"text-fg-muted"},Hh={class:"mb-1 mt-3 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Vh={class:"space-y-0.5"},Wh={key:0,class:"flex justify-between tabular-nums"},Gh={class:"text-fg-muted"},Kh={class:"text-fg"},Zh={class:"mb-1 mt-3 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Yh={class:"flex justify-between tabular-nums"},Xh={class:"text-fg-muted"},Jh={class:"text-fg"},Qh=ce({__name:"UsagePopover",props:{used:{},size:{},pct:{},cost:{},breakdown:{},anchor:{}},emits:["dismiss"],setup(e,{emit:t}){const u=e,n=t,s=S(null),a=S({visibility:"hidden"}),r=[{key:"inputTokens",label:"chat.usage.input"},{key:"outputTokens",label:"chat.usage.output"},{key:"cachedReadTokens",label:"chat.usage.cacheRead"},{key:"cachedWriteTokens",label:"chat.usage.cacheWrite"},{key:"thoughtTokens",label:"chat.usage.thinking"},{key:"totalTokens",label:"chat.usage.total"}];function o(y){return typeof y=="number"?y.toLocaleString():null}function i(){var g,C;const y=(g=u.cost)==null?void 0:g.amount;if(typeof y!="number")return null;const p=(C=u.cost)==null?void 0:C.currency;try{if(p)return new Intl.NumberFormat(void 0,{style:"currency",currency:p,maximumFractionDigits:4}).format(y)}catch{}return p?`${y} ${p}`:String(y)}function l(){const y=s.value;if(!y)return;const p={width:y.offsetWidth||240,height:y.offsetHeight||160},g={width:window.innerWidth,height:window.innerHeight};if(u.anchor){const C=xr(u.anchor,p,g);a.value={top:`${C.top}px`,left:`${C.left}px`,visibility:"visible"}}else a.value={top:`${Math.max(8,g.height/2-p.height/2)}px`,left:`${Math.max(8,g.width/2-p.width/2)}px`,visibility:"visible"}}function h(y){y.key==="Escape"&&n("dismiss")}function c(y){s.value&&!s.value.contains(y.target)&&n("dismiss")}return ut(()=>{l(),window.addEventListener("keydown",h),window.addEventListener("resize",l),setTimeout(()=>document.addEventListener("pointerdown",c),0)}),eu(()=>{window.removeEventListener("keydown",h),window.removeEventListener("resize",l),document.removeEventListener("pointerdown",c)}),(y,p)=>(d(),G(tu,{to:"body"},[f("div",{ref_key:"card",ref:s,"data-test":"usage-popover",class:"fixed z-[60] w-60 rounded-lg border border-border bg-raised p-3 text-sm shadow-e2",style:yu(a.value),role:"dialog"},[f("p",Bh,k(y.$t("chat.usage.contextWindow")),1),f("div",Uh,[f("span",qh,k(e.used.toLocaleString())+" / "+k(e.size.toLocaleString()),1),f("span",jh,k(e.pct)+"%",1)]),e.breakdown?(d(),m(X,{key:0},[f("p",Hh,k(y.$t("chat.usage.tokens")),1),f("dl",Vh,[(d(),m(X,null,ie(r,g=>(d(),m(X,{key:g.key},[o(e.breakdown[g.key])!==null?(d(),m("div",Wh,[f("dt",Gh,k(y.$t(g.label)),1),f("dd",Kh,k(o(e.breakdown[g.key])),1)])):M("",!0)],64))),64))])],64)):M("",!0),i()!==null?(d(),m(X,{key:1},[f("p",Zh,k(y.$t("chat.usage.cost")),1),f("div",Yh,[f("span",Xh,k(y.$t("chat.usage.cumulative")),1),f("span",Jh,k(i()),1)])],64)):M("",!0)],4)]))}}),e2=wt("session-controls",()=>{const e=S(void 0),t=S([]),u=S(!1),n=S("");function s(){e.value=void 0,t.value=[],n.value=""}async function a(o,i){if(!o||!i){s();return}u.value=!0,n.value="";try{const l=await se.rpc(o,"control.session.model.get",{sessionAlias:i});if(Yt(l)){s();return}e.value=typeof l.current=="string"?l.current:void 0,t.value=Array.isArray(l.available)?l.available:[]}catch{s()}finally{u.value=!1}}async function r(o,i,l){n.value="";const h=e.value;e.value=l;try{const c=await se.rpc(o,"control.session.model.set",{sessionAlias:i,modelId:l});return Yt(c)?(e.value=h,n.value=c.error.message,!1):!0}catch(c){return e.value=h,n.value=c instanceof Error?c.message:"set-failed",!1}}return{current:e,available:t,loading:u,error:n,reset:s,loadModel:a,setModel:r}}),t2={class:"rounded-lg border border-border bg-surface shadow-e2 focus-within:border-accent/50 transition-colors"},u2={key:0,class:"flex flex-wrap gap-2 px-2.5 pt-2.5 pb-1"},n2=["src","alt"],s2={class:"max-w-[120px] truncate text-fg"},a2={key:1,class:"text-fg-muted"},r2={key:2,class:"text-danger font-semibold"},o2=["title","onClick"],i2={key:1,"data-test":"attach-rejected",class:"block px-3 pt-2 text-xs text-danger"},l2={key:2,"data-test":"cmd-menu",role:"listbox",class:"mx-2.5 mt-2 max-h-56 overflow-auto rounded-md border border-border bg-raised py-1 shadow-e2"},c2=["aria-selected","onMousedown","onMouseenter"],d2={class:"shrink-0 font-medium text-fg"},f2={key:0,class:"truncate text-fg-muted"},p2=["placeholder"],h2={class:"flex items-center justify-between px-2.5 pb-2.5 pt-0.5"},b2={key:0,class:"relative flex items-center gap-2"},m2=["disabled"],g2={class:"font-mono text-[11.5px] font-medium text-fg"},x2={key:0,"data-test":"model-menu",class:"absolute bottom-full left-0 z-10 mb-1 max-h-48 min-w-40 overflow-y-auto rounded-lg border border-border bg-raised shadow-lg"},v2=["onClick"],y2={class:"font-mono"},k2={key:1,"data-test":"model-error",class:"text-xs text-danger"},_2=["title"],w2={class:"relative h-1 w-8 shrink-0 overflow-hidden rounded-full bg-border"},E2={class:"shrink-0 text-[11.5px] font-medium tabular-nums text-fg-muted"},A2={key:1},$2={class:"flex items-center gap-1.5"},C2=["title"],D2=["disabled"],T2=ce({__name:"PromptInput",props:{busy:{type:Boolean},draftKey:{},instanceId:{},sessionAlias:{}},emits:["send","cancel"],setup(e,{emit:t}){const u=e,n=t,s=Da(),a=e2(),r=Et(),o=Z(()=>{const _=r.sessionUsage;if(!_||_.size<=0)return null;const j=Math.min(100,Math.round(_.used/_.size*100)),ee=j>=90?"danger":j>=75?"warn":"accent";return{used:_.used,size:_.size,pct:j,tone:ee,cost:_.cost,breakdown:_.breakdown}}),i=S(!1),l=S(null);function h(_){const j=_.currentTarget.getBoundingClientRect();l.value={top:j.top,left:j.left,width:j.width,height:j.height},i.value=!i.value}const c=S(!1);me(()=>[u.instanceId,u.sessionAlias],([_,j])=>{a.loadModel(_??null,j??null),c.value=!1},{immediate:!0});async function y(_){c.value=!1,u.instanceId&&u.sessionAlias&&await a.setModel(u.instanceId,u.sessionAlias,_)}const p=S(ba(u.draftKey??"")),g=S(null),C=S(null),$=S(!1),E=S(0),A=Z(()=>{const _=p.value;return!_.startsWith("/")||_.includes(`
|
|
283
|
+
`)}),n=Z(()=>({add:u.value.add.filter(s=>s.length>0).length,del:u.value.del.filter(s=>s.length>0).length}));return(s,a)=>(d(),m("div",up,[e.detail.type==="diff"?(d(),m(X,{key:0},[f("div",np,[f("span",sp,[N(x(Nu),{size:14,class:"shrink-0"}),f("span",ap,k(e.detail.path),1)]),f("span",rp,[n.value.add?(d(),m("span",op,"+"+k(n.value.add),1)):M("",!0),n.value.del?(d(),m("span",ip,"−"+k(n.value.del),1)):M("",!0)])]),N(Ht,null,{default:mt(()=>[f("div",lp,[(d(!0),m(X,null,ie(u.value.del,(r,o)=>(d(),m("div",{key:"d"+o,"data-test":"diff-del",class:"whitespace-pre text-danger"},"- "+k(r),1))),128)),(d(!0),m(X,null,ie(u.value.add,(r,o)=>(d(),m("div",{key:"a"+o,"data-test":"diff-add",class:"whitespace-pre text-run"},"+ "+k(r),1))),128))])]),_:1})],64)):e.detail.type==="command"?(d(),m(X,{key:1},[f("div",cp,"$ "+k(e.detail.command),1),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",dp,k(e.detail.output),1)]),_:1})):M("",!0),e.detail.exitCode!==void 0?(d(),m("div",fp,"exit "+k(e.detail.exitCode),1)):M("",!0)],64)):e.detail.type==="read"?(d(),m(X,{key:2},[f("div",pp,[N(x(Nu),{size:14,class:"shrink-0"}),f("span",hp,k(e.detail.path),1),e.detail.lines?(d(),m("span",bp,k(e.detail.lines),1)):M("",!0)]),e.detail.preview?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",mp,k(e.detail.preview),1)]),_:1})):M("",!0)],64)):e.detail.type==="search"?(d(),m(X,{key:3},[f("div",gp,[N(x(ju),{size:14,class:"shrink-0"}),f("span",xp,k(e.detail.query),1)]),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",vp,k(e.detail.output),1)]),_:1})):M("",!0)],64)):e.detail.type==="fields"?(d(),m(X,{key:4},[f("dl",yp,[(d(!0),m(X,null,ie(e.detail.fields,r=>(d(),m(X,{key:r.label},[f("dt",kp,k(r.label),1),f("dd",{"data-test":"field-"+r.label,class:"font-mono text-fg break-all"},k(r.value),9,_p)],64))),128))]),e.detail.output?(d(),G(Ht,{key:0},{default:mt(()=>[f("pre",wp,k(e.detail.output),1)]),_:1})):M("",!0)],64)):e.detail.type==="text"?(d(),G(Ht,{key:5},{default:mt(()=>[f("p",Ep,k(e.detail.text),1)]),_:1})):M("",!0)]))}}),Ap=ce({__name:"FueDot",props:{pulsing:{type:Boolean,default:!0}},setup(e){return(t,u)=>(d(),m("span",{"data-test":"fue-dot",class:J(["inline-block h-2 w-2 rounded-full bg-accent",e.pulsing?"animate-pulse motion-reduce:animate-none":""]),"aria-hidden":"true"},null,2))}}),Vt=8;function xr(e,t,u,n=Vt){const s=e.top+e.height+n,a=e.top-t.height-n,r=u.height-(e.top+e.height),o=e.top,h=s+t.height>u.height-Vt&&o>r?"above":"below",c=h==="above"?Math.max(Vt,a):s,y=e.left+e.width/2-t.width/2,p=Math.max(Vt,u.width-t.width-Vt),g=Math.min(Math.max(Vt,y),p);return{top:c,left:g,placement:h}}const $p={class:"flex items-center gap-2 font-medium text-fg"},Cp={class:"mt-1 text-xs text-fg-muted"},Dp={class:"mt-2 flex justify-end"},Tp=ce({__name:"FueCallout",props:{title:{},body:{},anchor:{}},emits:["dismiss"],setup(e,{emit:t}){const u=e,n=t,s=S(null),a=S({visibility:"hidden"});function r(){const i=s.value;if(!i)return;const l={width:i.offsetWidth||256,height:i.offsetHeight||96},h={width:window.innerWidth,height:window.innerHeight};if(u.anchor){const c=xr(u.anchor,l,h);a.value={top:`${c.top}px`,left:`${c.left}px`,visibility:"visible"}}else a.value={top:`${Math.max(8,h.height/2-l.height/2)}px`,left:`${Math.max(8,h.width/2-l.width/2)}px`,visibility:"visible"}}function o(i){i.key==="Escape"&&n("dismiss")}return ut(()=>{r(),window.addEventListener("keydown",o),window.addEventListener("resize",r)}),eu(()=>{window.removeEventListener("keydown",o),window.removeEventListener("resize",r)}),(i,l)=>(d(),G(tu,{to:"body"},[f("div",{ref_key:"card",ref:s,"data-test":"fue-callout",class:"fixed z-50 w-64 rounded-lg border border-border bg-raised p-3 text-sm shadow-lg",style:yu(a.value),role:"dialog"},[f("p",$p,[l[1]||(l[1]=f("span",{class:"inline-block h-2 w-2 rounded-full bg-accent","aria-hidden":"true"},null,-1)),pe(" "+k(e.title),1)]),f("p",Cp,k(e.body),1),f("div",Dp,[f("button",{"data-test":"fue-dismiss",type:"button",class:"rounded bg-accent px-2 py-1 text-xs font-medium text-white hover:bg-accent-hover",onClick:l[0]||(l[0]=h=>n("dismiss"))},k(i.$t("fue.gotIt")),1)])],4)]))}}),vr="xacpx.fue.v1.";function Sp(e){try{return localStorage.getItem(vr+e)==="1"}catch{return!1}}function Fp(e){try{localStorage.setItem(vr+e,"1")}catch{}}function Ip(e){const t=S(Sp(e)?"acknowledged":"unseen");function u(){t.value==="unseen"&&(t.value="engaging")}function n(){t.value="acknowledged",Fp(e)}return{status:t,engage:u,dismiss:n}}const Qn={read:Yr,search:ju,execute:_o,edit:mo,think:Bn,other:_a},Mp={running:zt,success:uu,error:nt},zp=["read","search","execute","edit","think","other"],Op=["running","success","error"],pa=5;function Lp(e){const t=new Map,u=new Map;for(const n of e)t.set(n.kind,(t.get(n.kind)??0)+1),u.set(n.status,(u.get(n.status)??0)+1);return{kinds:zp.filter(n=>t.has(n)).map(n=>({icon:Qn[n],count:t.get(n),label:n})),statuses:Op.filter(n=>u.has(n)).map(n=>({icon:Mp[n],count:u.get(n),label:n}))}}const Rp={class:"overflow-hidden rounded-lg border border-border bg-surface text-xs shadow-e1"},Np={class:"inline-flex items-center gap-1.5 text-[11.5px] font-semibold text-fg-muted"},Pp={key:3,"data-test":"tool-count",class:"font-mono text-[10.5px] text-fg-muted"},Bp={"data-test":"tool-summary",class:"ml-1 flex items-center gap-1.5 text-[10.5px] text-fg-muted"},Up=["data-test"],qp={class:"tabular-nums"},jp={key:0,class:"text-fg-muted"},Hp=["data-test"],Vp={class:"tabular-nums"},Wp={key:1,class:"space-y-1 border-t border-border px-3 pb-2.5 pt-2"},Gp=["onClick"],Kp={class:"truncate font-mono text-[11px] text-fg"},Zp={key:0,class:"ml-auto font-mono text-[10.5px] text-fg-muted"},Yp={key:0,class:"px-2 pb-2 pt-1"},Xp=ce({__name:"ToolCallPanel",props:{steps:{}},setup(e){const t=e,u=S(t.steps.length<=pa),n=S(new Set);function s(p){n.value.has(p)?n.value.delete(p):n.value.add(p),n.value=new Set(n.value)}const a=Z(()=>Lp(t.steps)),r=Ip("tool-group-collapse"),o=Z(()=>t.steps.length>pa),i=Z(()=>o.value&&r.status.value!=="acknowledged"),l=S(null),h=S(null);function c(){var p;if(u.value=!u.value,i.value){const g=(p=l.value)==null?void 0:p.getBoundingClientRect();g&&(h.value={top:g.top,left:g.left,width:g.width,height:g.height}),r.engage()}}function y(p){return p===void 0?"":p>=1e3?`${(p/1e3).toFixed(1)}s`:`${p}ms`}return(p,g)=>(d(),m("div",Rp,[f("button",{ref_key:"header",ref:l,type:"button",class:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-bg",onClick:c},[u.value?(d(),G(x(st),{key:0,size:13,class:"text-fg-muted"})):(d(),G(x(Mt),{key:1,size:13,class:"text-fg-muted"})),f("span",Np,[N(x(_a),{size:13}),pe(" "+k(p.$t("tools.toolSteps")),1)]),i.value?(d(),G(Ap,{key:2,pulsing:x(r).status.value==="unseen"},null,8,["pulsing"])):(d(),m("span",Pp,k(e.steps.length),1)),f("span",Bp,[(d(!0),m(X,null,ie(a.value.kinds,C=>(d(),m("span",{key:"k"+C.label,"data-test":"sum-"+C.label,class:"inline-flex items-center gap-0.5"},[(d(),G(Ft(C.icon),{size:11})),f("span",qp,k(C.count),1)],8,Up))),128)),a.value.statuses.length?(d(),m("span",jp,"·")):M("",!0),(d(!0),m(X,null,ie(a.value.statuses,C=>(d(),m("span",{key:"s"+C.label,"data-test":"sum-"+C.label,class:J(["inline-flex items-center gap-0.5",C.label==="success"?"text-run":C.label==="error"?"text-danger":"text-fg-muted"])},[(d(),G(Ft(C.icon),{size:11,class:J(C.label==="running"?"animate-spin motion-reduce:animate-none":"")},null,8,["class"])),f("span",Vp,k(C.count),1)],10,Hp))),128))])],512),x(r).status.value==="engaging"?(d(),G(Tp,{key:0,title:p.$t("tools.collapsed"),body:p.$t("tools.collapsedBody"),anchor:h.value,onDismiss:g[0]||(g[0]=C=>x(r).dismiss())},null,8,["title","body","anchor"])):M("",!0),u.value?(d(),m("ul",Wp,[(d(!0),m(X,null,ie(e.steps,C=>(d(),m("li",{key:C.toolCallId},[f("button",{type:"button","data-test":"tool-row",class:"flex w-full items-center gap-2 rounded text-left text-[12px] hover:bg-fg/5",onClick:$=>s(C.toolCallId)},[f("span",{class:J(["grid h-4 w-4 shrink-0 place-items-center rounded-full",C.status==="success"?"bg-run/15":C.status==="running"?"bg-accent/15":"bg-danger/15"])},[C.status==="success"?(d(),G(x(uu),{key:0,"data-test":"step-status-success",size:9,class:"text-run"})):C.status==="running"?(d(),G(x(zt),{key:1,"data-test":"step-status-running",size:9,class:"animate-spin motion-reduce:animate-none text-accent"})):(d(),G(x(pu),{key:2,"data-test":"step-status-error",size:9,class:"text-danger"}))],2),(d(),G(Ft(x(Qn)[C.kind]),{size:12,class:"shrink-0 text-fg-muted"})),f("span",Kp,k(C.title),1),C.durationMs!==void 0?(d(),m("span",Zp,k(y(C.durationMs)),1)):M("",!0)],8,Gp),n.value.has(C.toolCallId)&&C.detail?(d(),m("div",Yp,[N(gr,{detail:C.detail},null,8,["detail"])])):M("",!0)]))),128))])):M("",!0)]))}}),Jp={class:"overflow-hidden rounded-lg border border-border bg-surface text-xs shadow-e1"},Qp={key:2,"data-test":"reasoning-shimmer",class:"ml-1 inline-block h-1.5 w-1.5 animate-pulse motion-reduce:animate-none rounded-full bg-fg-muted","aria-hidden":"true"},eh={key:0,"data-test":"reasoning-body",class:"whitespace-pre-wrap border-t border-border px-3 pb-2.5 pt-2 text-[12px] leading-relaxed text-fg-muted"},yr=ce({__name:"ReasoningPanel",props:{reasoning:{},defaultOpen:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){const u=S(e.defaultOpen??!1),n=Z(()=>u.value);return(s,a)=>(d(),m("div",Jp,[f("button",{type:"button",class:"flex w-full items-center gap-1.5 px-3 py-2 text-left text-fg-muted",onClick:a[0]||(a[0]=r=>u.value=!u.value)},[n.value?(d(),G(x(st),{key:0,size:13})):(d(),G(x(Mt),{key:1,size:13})),N(x(Bn),{size:13,class:J(e.streaming?"text-accent":"")},null,8,["class"]),f("span",{class:J(["text-[12px] font-medium",e.streaming?"shimmer-text":""])},k(e.streaming?s.$t("reasoning.reasoningStreaming"):s.$t("reasoning.reasoning")),3),e.streaming?(d(),m("span",Qp)):M("",!0)]),n.value?(d(),m("p",eh,k(e.reasoning),1)):M("",!0)]))}}),th={class:"truncate font-mono text-[11.5px] text-fg"},uh={class:"ml-auto flex shrink-0 items-center gap-2"},nh={key:0,class:"font-mono text-[10.5px] text-fg-muted"},sh={key:0,class:"border-t border-border px-3 pb-2.5 pt-2"},ah={key:0,"data-test":"tool-step-error",class:"mb-1.5 flex items-start gap-1.5 rounded bg-danger/10 px-2 py-1.5 text-danger"},rh={class:"whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed"},oh=ce({__name:"ToolStepCard",props:{step:{}},setup(e){const t=S(!0);function u(n){return n===void 0?"":n>=1e3?`${(n/1e3).toFixed(1)}s`:`${n}ms`}return(n,s)=>(d(),m("div",{"data-test":"tool-step-card",class:J(["overflow-hidden rounded-lg border bg-surface text-xs shadow-e1",e.step.status==="error"?"border-danger/40":"border-border"])},[f("button",{type:"button","data-test":"tool-step-header",class:"flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-bg",onClick:s[0]||(s[0]=a=>t.value=!t.value)},[t.value?(d(),G(x(st),{key:0,size:13,class:"text-fg-muted"})):(d(),G(x(Mt),{key:1,size:13,class:"text-fg-muted"})),(d(),G(Ft(x(Qn)[e.step.kind]),{size:13,class:"shrink-0 text-fg-muted"})),f("span",th,k(e.step.title),1),f("span",uh,[e.step.durationMs!==void 0?(d(),m("span",nh,k(u(e.step.durationMs)),1)):M("",!0),e.step.status==="success"?(d(),G(x(uu),{key:1,"data-test":"step-status-success",size:13,class:"text-run"})):e.step.status==="running"?(d(),G(x(zt),{key:2,"data-test":"step-status-running",size:13,class:"animate-spin motion-reduce:animate-none text-accent"})):(d(),G(x(pu),{key:3,"data-test":"step-status-error",size:13,class:"text-danger"}))])]),t.value?(d(),m("div",sh,[e.step.status==="error"&&e.step.error?(d(),m("div",ah,[N(x(pu),{size:13,class:"mt-0.5 shrink-0"}),f("span",rh,k(e.step.error),1)])):M("",!0),e.step.detail?(d(),G(gr,{key:1,detail:e.step.detail},null,8,["detail"])):M("",!0)])):M("",!0)],2))}}),ih={class:"space-y-2.5"},ha=ce({__name:"TurnParts",props:{parts:{},streaming:{type:Boolean}},setup(e){const t=e,u=n=>t.streaming===!0&&n===t.parts.length-1;return(n,s)=>(d(),m("div",ih,[(d(!0),m(X,null,ie(e.parts,(a,r)=>(d(),m(X,{key:r},[a.type==="reasoning"&&a.text.trim()?(d(),G(yr,{key:0,reasoning:a.text,streaming:u(r),"default-open":!1},null,8,["reasoning","streaming"])):a.type==="tool"?(d(),G(oh,{key:1,step:a.step},null,8,["step"])):(d(),G(mr,{key:2,text:a.text,streaming:u(r),class:J(["text-[14px] leading-relaxed text-fg",u(r)?"caret":""])},null,8,["text","streaming","class"]))],64))),128))]))}}),lh=["aria-label","title"],kr=ce({__name:"CopyButton",props:{text:{}},setup(e){const t=e,u=S(!1);let n=null;async function s(){try{await navigator.clipboard.writeText(t.text)}catch{const a=document.createElement("textarea");a.value=t.text,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy")}catch{}document.body.removeChild(a)}u.value=!0,n&&clearTimeout(n),n=setTimeout(()=>u.value=!1,1200)}return(a,r)=>(d(),m("button",{"data-test":"copy-button",type:"button","aria-label":a.$t("copy.copy"),title:u.value?a.$t("copy.copied"):a.$t("copy.copy"),class:"rounded p-1 leading-none text-fg-muted hover:bg-fg/5 hover:text-fg",onClick:Ae(s,["stop"])},[u.value?(d(),G(x(uu),{key:0,size:14,class:"text-run"})):(d(),G(x(uo),{key:1,size:14}))],8,lh))}}),ch={class:"mt-1 flex flex-wrap gap-2"},dh=["src","alt"],fh={key:1,"data-test":"att-file",class:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2 text-[13px]"},ph={class:"max-w-[180px] truncate"},hh={class:"text-fg-muted"},bh=ce({__name:"MessageAttachments",props:{attachments:{}},setup(e){function t(u){return u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(0)} KB`:`${(u/1024/1024).toFixed(1)} MB`}return(u,n)=>(d(),m("div",ch,[(d(!0),m(X,null,ie(e.attachments,s=>(d(),m(X,{key:s.id},[s.kind==="image"&&s.previewUrl?(d(),m("img",{key:0,"data-test":"att-image",src:s.previewUrl,alt:s.filename,class:"max-h-40 max-w-[200px] rounded-lg border border-border object-cover"},null,8,dh)):(d(),m("div",fh,[N(x(Zt),{size:16,class:"shrink-0 text-fg-muted"}),f("span",ph,k(s.filename),1),f("span",hh,k(t(s.size)),1)]))],64))),128))]))}}),mh={class:"relative flex-1 overflow-hidden"},gh={class:"mx-auto max-w-3xl space-y-5"},xh={key:0,"data-test":"loading-older",class:"flex justify-center py-1 text-[11px] text-fg-muted"},vh=["data-scheduled-task"],yh={class:"flex max-w-[80%] flex-col items-end"},kh=["title"],_h={class:"whitespace-pre-wrap text-[14px] leading-relaxed text-fg"},wh={key:1,class:"mt-1 flex items-center gap-2"},Eh={"data-test":"msg-failed",class:"text-xs text-danger"},Ah=["title","onClick"],$h={key:1,class:"cv-row group flex gap-2.5"},Ch={class:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-lg border border-border bg-surface"},Dh={"data-test":"msg-actions",class:"flex items-center gap-1.5 pt-0.5 text-fg-muted"},Th={key:1,"data-test":"msg-time",class:"font-mono text-[10.5px] tabular-nums"},Sh={key:2,"data-test":"msg-cancelled",class:"inline-flex items-center gap-1 text-[11px] text-warn"},Fh={key:3,"data-test":"msg-failed",class:"text-[11px] text-danger"},Ih={key:1,class:"flex gap-2.5"},Mh={class:"mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-lg border border-border bg-surface"},zh={"data-test":"msg-streaming",class:"min-w-0 flex-1"},Oh=48,Lh=240,Rh=ce({__name:"MessageList",props:{messages:{},liveTurn:{},hasMoreOlder:{type:Boolean},loadingOlder:{type:Boolean},sessionKey:{},scrollToScheduled:{}},emits:["resend","loadOlder"],setup(e,{emit:t}){const u=e,n=t;function s(c){var y;return c.scheduled??((y=c.structured)==null?void 0:y.scheduled)}const a=S(null),r=S(!0);let o=null;function i(){const c=a.value;c&&(r.value=c.scrollHeight-c.scrollTop-c.clientHeight<=Oh,c.scrollTop<=Lh&&u.hasMoreOlder&&!u.loadingOlder&&o===null&&(o=c.scrollHeight-c.scrollTop,n("loadOlder")))}me(()=>u.loadingOlder,(c,y)=>{if(!(y&&!c)||o===null)return;const p=o;o=null,qe(()=>{const g=a.value;g&&(g.scrollTop=g.scrollHeight-p)})});let l=0;function h(c=!1){const y=a.value;if(!y||(typeof y.scrollTo=="function"?y.scrollTo({top:y.scrollHeight,behavior:c?"smooth":"auto"}):y.scrollTop=y.scrollHeight,r.value=!0,c||typeof requestAnimationFrame!="function"))return;l&&cancelAnimationFrame(l);let p=0;const g=()=>{l=0;const C=a.value;C&&(C.scrollHeight-C.scrollTop-C.clientHeight>1&&(C.scrollTop=C.scrollHeight),++p<4&&(l=requestAnimationFrame(g)))};l=requestAnimationFrame(g)}return me(()=>u.sessionKey,()=>{r.value=!0,o=null,qe(()=>h(!1))}),me(()=>{var c;return(c=u.scrollToScheduled)==null?void 0:c.nonce},()=>{var y;const c=(y=u.scrollToScheduled)==null?void 0:y.taskId;c&&qe(()=>{var g;const p=(g=a.value)==null?void 0:g.querySelector(`[data-scheduled-task="${c}"]`);p&&typeof p.scrollIntoView=="function"&&(p.scrollIntoView({behavior:"smooth",block:"center"}),r.value=!1)})}),me(()=>{const c=u.liveTurn,y=c==null?void 0:c.parts[c.parts.length-1],p=y?y.type==="tool"?y.step.status:y.text.length:0;return[u.messages.length,(c==null?void 0:c.parts.length)??0,p]},()=>{r.value&&qe(()=>h(!1))}),(c,y)=>(d(),m("div",mh,[f("div",{ref_key:"scroller",ref:a,"data-test":"msg-scroller",class:"thin-scroll h-full overflow-y-auto px-3 py-4 lg:px-5 lg:py-5",onScroll:i},[f("div",gh,[e.loadingOlder?(d(),m("div",xh,[N(x(zt),{size:13,class:"animate-spin motion-reduce:animate-none"})])):M("",!0),(d(!0),m(X,null,ie(e.messages,(p,g)=>{var C,$,E,A,v,w,D,P;return d(),m(X,{key:p.id!==void 0?`p${p.id}`:`o${p.createdAt}:${g}`},[p.direction==="in"?(d(),m("div",{key:0,class:"cv-row flex justify-end","data-scheduled-task":(C=s(p))==null?void 0:C.taskId},[f("div",yh,[s(p)?(d(),m("span",{key:0,"data-test":"msg-scheduled-badge",class:"mb-1 inline-flex items-center gap-1 rounded-full bg-accent/10 px-2 py-0.5 text-[10.5px] font-medium text-accent",title:`${c.$t("chat.scheduledFor")} ${x(Un)(s(p).executeAt)}`},[N(x(ka),{size:11}),pe(k(c.$t("chat.scheduled")),1)],8,kh)):M("",!0),f("div",{"data-test":"msg-in",class:J(["rounded-2xl rounded-tr-md border border-accent/15 bg-accent/10 px-3.5 py-2",p.failed?"ring-1 ring-danger":""])},[f("p",_h,k(p.text),1),($=p.attachments)!=null&&$.length?(d(),G(bh,{key:0,attachments:p.attachments},null,8,["attachments"])):M("",!0)],2),p.failed?(d(),m("div",wh,[f("span",Eh,k(c.$t("chat.failedToSend")),1),f("button",{type:"button","data-test":"msg-resend",class:"inline-flex items-center gap-1 text-xs font-medium text-accent hover:opacity-80",title:c.$t("chat.resendThis"),onClick:F=>n("resend",p)},[N(x(xo),{size:12}),pe(k(c.$t("chat.resend")),1)],8,Ah)])):M("",!0)])],8,vh)):(d(),m("div",$h,[f("div",Ch,[N(x(Fn),{size:13,class:"text-accent"})]),f("div",{"data-test":"msg-out",class:J(["min-w-0 flex-1 space-y-2.5",p.failed?"rounded-lg ring-1 ring-danger":""])},[(A=(E=p.structured)==null?void 0:E.parts)!=null&&A.length?(d(),G(ha,{key:0,parts:p.structured.parts},null,8,["parts"])):(d(),m(X,{key:1},[(w=(v=p.structured)==null?void 0:v.toolSteps)!=null&&w.length?(d(),G(Xp,{key:0,steps:p.structured.toolSteps},null,8,["steps"])):M("",!0),(P=(D=p.structured)==null?void 0:D.reasoning)!=null&&P.trim()?(d(),G(yr,{key:1,reasoning:p.structured.reasoning,"default-open":!1},null,8,["reasoning"])):M("",!0),p.text?(d(),G(mr,{key:2,text:p.text,class:"text-[14px] leading-relaxed text-fg"},null,8,["text"])):M("",!0)],64)),f("div",Dh,[p.text?(d(),G(kr,{key:0,text:p.text},null,8,["text"])):M("",!0),x(Cs)(p.createdAt)?(d(),m("span",Th,k(x(Cs)(p.createdAt)),1)):M("",!0),p.status==="cancelled"?(d(),m("span",Sh,[N(x(Qr),{size:12}),pe(" "+k(c.$t("chat.stopped")),1)])):M("",!0),p.failed?(d(),m("span",Fh,k(c.$t("chat.failed")),1)):M("",!0)])],2)]))],64)}),128)),e.liveTurn&&e.liveTurn.parts.length?(d(),m("div",Ih,[f("div",Mh,[N(x(Fn),{size:13,class:"text-accent"})]),f("div",zh,[N(ha,{parts:e.liveTurn.parts,streaming:!0},null,8,["parts"])])])):M("",!0)])],544),_e(f("button",{"data-test":"jump-latest",type:"button",class:"absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full border border-border bg-raised px-3 py-1 text-xs text-fg-muted shadow hover:bg-fg/5",onClick:y[0]||(y[0]=p=>h(!0))},k(c.$t("chat.jumpLatest")),513),[[Pn,!r.value]])]))}}),Nh=Kr(Rh,[["__scopeId","data-v-a7278286"]]),_r="xacpx.composer-drafts.v1";function wr(){try{const e=sessionStorage.getItem(_r);return e?JSON.parse(e):{}}catch{return{}}}function Ph(e){try{sessionStorage.setItem(_r,JSON.stringify(e))}catch{}}function ba(e){return e?wr()[e]??"":""}function ma(e,t){if(!e)return;const u=wr();t?u[e]=t:delete u[e],Ph(u)}const Bh={class:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Uh={class:"flex items-baseline justify-between tabular-nums"},qh={class:"text-fg"},jh={class:"text-fg-muted"},Hh={class:"mb-1 mt-3 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Vh={class:"space-y-0.5"},Wh={key:0,class:"flex justify-between tabular-nums"},Gh={class:"text-fg-muted"},Kh={class:"text-fg"},Zh={class:"mb-1 mt-3 text-[11px] font-semibold uppercase tracking-wide text-fg-muted"},Yh={class:"flex justify-between tabular-nums"},Xh={class:"text-fg-muted"},Jh={class:"text-fg"},Qh=ce({__name:"UsagePopover",props:{used:{},size:{},pct:{},cost:{},breakdown:{},anchor:{}},emits:["dismiss"],setup(e,{emit:t}){const u=e,n=t,s=S(null),a=S({visibility:"hidden"}),r=[{key:"inputTokens",label:"chat.usage.input"},{key:"outputTokens",label:"chat.usage.output"},{key:"cachedReadTokens",label:"chat.usage.cacheRead"},{key:"cachedWriteTokens",label:"chat.usage.cacheWrite"},{key:"thoughtTokens",label:"chat.usage.thinking"},{key:"totalTokens",label:"chat.usage.total"}];function o(y){return typeof y=="number"?y.toLocaleString():null}function i(){var g,C;const y=(g=u.cost)==null?void 0:g.amount;if(typeof y!="number")return null;const p=(C=u.cost)==null?void 0:C.currency;try{if(p)return new Intl.NumberFormat(void 0,{style:"currency",currency:p,maximumFractionDigits:4}).format(y)}catch{}return p?`${y} ${p}`:String(y)}function l(){const y=s.value;if(!y)return;const p={width:y.offsetWidth||240,height:y.offsetHeight||160},g={width:window.innerWidth,height:window.innerHeight};if(u.anchor){const C=xr(u.anchor,p,g);a.value={top:`${C.top}px`,left:`${C.left}px`,visibility:"visible"}}else a.value={top:`${Math.max(8,g.height/2-p.height/2)}px`,left:`${Math.max(8,g.width/2-p.width/2)}px`,visibility:"visible"}}function h(y){y.key==="Escape"&&n("dismiss")}function c(y){s.value&&!s.value.contains(y.target)&&n("dismiss")}return ut(()=>{l(),window.addEventListener("keydown",h),window.addEventListener("resize",l),setTimeout(()=>document.addEventListener("pointerdown",c),0)}),eu(()=>{window.removeEventListener("keydown",h),window.removeEventListener("resize",l),document.removeEventListener("pointerdown",c)}),(y,p)=>(d(),G(tu,{to:"body"},[f("div",{ref_key:"card",ref:s,"data-test":"usage-popover",class:"fixed z-[60] w-60 rounded-lg border border-border bg-raised p-3 text-sm shadow-e2",style:yu(a.value),role:"dialog"},[f("p",Bh,k(y.$t("chat.usage.contextWindow")),1),f("div",Uh,[f("span",qh,k(e.used.toLocaleString())+" / "+k(e.size.toLocaleString()),1),f("span",jh,k(e.pct)+"%",1)]),e.breakdown?(d(),m(X,{key:0},[f("p",Hh,k(y.$t("chat.usage.tokens")),1),f("dl",Vh,[(d(),m(X,null,ie(r,g=>(d(),m(X,{key:g.key},[o(e.breakdown[g.key])!==null?(d(),m("div",Wh,[f("dt",Gh,k(y.$t(g.label)),1),f("dd",Kh,k(o(e.breakdown[g.key])),1)])):M("",!0)],64))),64))])],64)):M("",!0),i()!==null?(d(),m(X,{key:1},[f("p",Zh,k(y.$t("chat.usage.cost")),1),f("div",Yh,[f("span",Xh,k(y.$t("chat.usage.cumulative")),1),f("span",Jh,k(i()),1)])],64)):M("",!0)],4)]))}}),e2=wt("session-controls",()=>{const e=S(void 0),t=S([]),u=S(!1),n=S("");function s(){e.value=void 0,t.value=[],n.value=""}async function a(o,i){if(!o||!i){s();return}u.value=!0,n.value="";try{const l=await se.rpc(o,"control.session.model.get",{sessionAlias:i});if(Yt(l)){s();return}e.value=typeof l.current=="string"?l.current:void 0,t.value=Array.isArray(l.available)?l.available:[]}catch{s()}finally{u.value=!1}}async function r(o,i,l){n.value="";const h=e.value;e.value=l;try{const c=await se.rpc(o,"control.session.model.set",{sessionAlias:i,modelId:l});return Yt(c)?(e.value=h,n.value=c.error.message,!1):!0}catch(c){return e.value=h,n.value=c instanceof Error?c.message:"set-failed",!1}}return{current:e,available:t,loading:u,error:n,reset:s,loadModel:a,setModel:r}}),t2={class:"rounded-lg border border-border bg-surface shadow-e2 focus-within:border-accent/50 transition-colors"},u2={key:0,class:"flex flex-wrap gap-2 px-2.5 pt-2.5 pb-1"},n2=["src","alt"],s2={class:"max-w-[120px] truncate text-fg"},a2={key:1,class:"text-fg-muted"},r2={key:2,class:"text-danger font-semibold"},o2=["title","onClick"],i2={key:1,"data-test":"attach-rejected",class:"block px-3 pt-2 text-xs text-danger"},l2={key:2,"data-test":"cmd-menu",role:"listbox",class:"mx-2.5 mt-2 max-h-56 overflow-auto rounded-md border border-border bg-raised py-1 shadow-e2"},c2=["aria-selected","onMousedown","onMouseenter"],d2={class:"shrink-0 font-medium text-fg"},f2={key:0,class:"truncate text-fg-muted"},p2=["placeholder"],h2={class:"flex items-center justify-between px-2.5 pb-2.5 pt-0.5"},b2={key:0,class:"relative flex items-center gap-2"},m2=["disabled"],g2={class:"font-mono text-[11.5px] font-medium text-fg"},x2={key:0,"data-test":"model-menu",class:"absolute bottom-full left-0 z-10 mb-1 max-h-48 min-w-40 overflow-y-auto rounded-lg border border-border bg-raised shadow-lg"},v2=["onClick"],y2={class:"font-mono"},k2={key:1,"data-test":"model-error",class:"text-xs text-danger"},_2=["title"],w2={class:"relative h-1 w-8 shrink-0 overflow-hidden rounded-full bg-border"},E2={class:"shrink-0 text-[11.5px] font-medium tabular-nums text-fg-muted"},A2={key:1},$2={class:"flex items-center gap-1.5"},C2=["title"],D2=["disabled"],T2=ce({__name:"PromptInput",props:{busy:{type:Boolean},draftKey:{},instanceId:{},sessionAlias:{}},emits:["send","cancel"],setup(e,{emit:t}){const u=e,n=t,s=Da(),a=e2(),r=Et(),o=Z(()=>{const _=r.sessionUsage;if(!_||_.size<=0)return null;const j=Math.min(100,Math.round(_.used/_.size*100)),ee=j>=90?"danger":j>=75?"warn":"accent";return{used:_.used,size:_.size,pct:j,tone:ee,cost:_.cost,breakdown:_.breakdown}}),i=S(!1),l=S(null);function h(_){const j=_.currentTarget.getBoundingClientRect();l.value={top:j.top,left:j.left,width:j.width,height:j.height},i.value=!i.value}const c=S(!1);me(()=>[u.instanceId,u.sessionAlias],([_,j])=>{a.loadModel(_??null,j??null),c.value=!1},{immediate:!0});async function y(_){c.value=!1,u.instanceId&&u.sessionAlias&&await a.setModel(u.instanceId,u.sessionAlias,_)}const p=S(ba(u.draftKey??"")),g=S(null),C=S(null),$=S(!1),E=S(0),A=Z(()=>{const _=p.value;return!_.startsWith("/")||_.includes(`
|
|
284
284
|
`)||_.slice(1).includes(" ")?null:_.slice(1).toLowerCase()}),v=Z(()=>{const _=A.value;return _===null?[]:r.sessionCommands.filter(j=>j.name.toLowerCase().startsWith(_)).slice(0,8)});me(v,_=>{$.value=_.length>0,E.value=0});function w(_){p.value=`/${_} `,$.value=!1,qe(()=>{var j;return(j=g.value)==null?void 0:j.focus()})}function D(){var _;(_=C.value)==null||_.click()}async function P(_){const j=_.target;j.files&&await s.addFiles(Array.from(j.files)),j.value=""}async function F(_){var ee;const j=Array.from(((ee=_.clipboardData)==null?void 0:ee.files)??[]);j.length>0&&(_.preventDefault(),await s.addFiles(j))}async function V(_){var ee;const j=Array.from(((ee=_.dataTransfer)==null?void 0:ee.files)??[]);j.length>0&&(_.preventDefault(),await s.addFiles(j))}me(p,_=>ma(u.draftKey??"",_)),me(()=>u.draftKey,(_,j)=>{j&&ma(j,p.value),p.value=ba(_??"")}),me(()=>s.insertRequest,_=>{!_||_.key!==(u.draftKey??"")||(p.value=p.value.trim()?`${p.value.trimEnd()} ${_.text}`:_.text,qe(()=>{var j;return(j=g.value)==null?void 0:j.focus()}))});const R=S([]);let O=-1;function ae(){if(u.busy||s.uploading)return;const _=p.value.trim(),j=s.pending.filter(fe=>fe.status==="ready");if(!_&&j.length===0)return;const ee=j.map(fe=>({id:fe.id,filePath:fe.filePath,fileName:fe.filename,mimeType:fe.mimeType,kind:fe.kind,size:fe.size,...fe.previewUrl?{previewUrl:fe.previewUrl}:{}}));n("send",_,ee),s.clearAttachments(),_&&R.value[R.value.length-1]!==_&&R.value.push(_),O=-1,p.value=""}function I(_){if(R.value.length!==0){if(_===-1)O=O===-1?R.value.length-1:Math.max(0,O-1);else{if(O===-1)return;if(O=O+1,O>=R.value.length){O=-1,p.value="";return}}p.value=R.value[O]}}function B(_){var ee,fe;if(_.isComposing)return;if($.value&&v.value.length>0){if(_.key==="ArrowDown"){E.value=(E.value+1)%v.value.length,_.preventDefault();return}if(_.key==="ArrowUp"){E.value=(E.value-1+v.value.length)%v.value.length,_.preventDefault();return}if(_.key==="Enter"||_.key==="Tab"){const Ne=v.value[E.value];Ne&&w(Ne.name),_.preventDefault();return}if(_.key==="Escape"){$.value=!1,_.preventDefault();return}}if(_.key==="Escape"){u.busy&&(n("cancel"),_.preventDefault());return}if(_.key==="Enter"&&!_.shiftKey){ae(),_.preventDefault();return}const j=(((ee=g.value)==null?void 0:ee.selectionStart)??0)===0&&(((fe=g.value)==null?void 0:fe.selectionEnd)??0)===0;if(_.key==="ArrowUp"&&j){I(-1),_.preventDefault();return}if(_.key==="ArrowDown"&&O!==-1&&j){I(1),_.preventDefault();return}}function L(){O=-1}return(_,j)=>(d(),m("form",{class:"relative border-t border-border px-0 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] lg:p-3 lg:pb-[calc(0.75rem+env(safe-area-inset-bottom))]",onSubmit:Ae(ae,["prevent"]),onDrop:Ae(V,["prevent"]),onDragover:j[4]||(j[4]=Ae(()=>{},["prevent"]))},[f("input",{ref_key:"fileInput",ref:C,type:"file",multiple:"",class:"hidden","data-test":"attach-input",onChange:P},null,544),f("div",t2,[x(s).pending.length?(d(),m("div",u2,[(d(!0),m(X,null,ie(x(s).pending,ee=>(d(),m("div",{key:ee.id,class:"flex items-center gap-1.5 rounded-md border border-border bg-raised px-2 py-1 text-[12px]"},[ee.previewUrl?(d(),m("img",{key:0,src:ee.previewUrl,class:"h-6 w-6 rounded object-cover",alt:ee.filename},null,8,n2)):M("",!0),f("span",s2,k(ee.filename),1),ee.status==="uploading"?(d(),m("span",a2,"…")):ee.status==="error"?(d(),m("span",r2,"!")):M("",!0),f("button",{type:"button",title:_.$t("chat.attach.remove"),class:"text-fg-muted hover:text-fg transition-colors",onClick:fe=>x(s).removeAttachment(ee.id)},[N(x(nt),{size:12})],8,o2)]))),128))])):M("",!0),x(s).rejection?(d(),m("span",i2,k(x(s).rejection.reason==="too-many"?_.$t("chat.attach.tooMany"):_.$t("chat.attach.tooLarge",{name:x(s).rejection.filename})),1)):M("",!0),$.value&&v.value.length?(d(),m("ul",l2,[(d(!0),m(X,null,ie(v.value,(ee,fe)=>(d(),m("li",{key:ee.name,"data-test":"cmd-item",role:"option","aria-selected":fe===E.value,class:J(["flex cursor-pointer items-baseline gap-2 px-3 py-1.5 text-[13px]",fe===E.value?"bg-accent/10":""]),onMousedown:Ae(Ne=>w(ee.name),["prevent"]),onMouseenter:Ne=>E.value=fe},[f("span",d2,"/"+k(ee.name),1),ee.description?(d(),m("span",f2,k(ee.description),1)):M("",!0)],42,c2))),128))])):M("",!0),_e(f("textarea",{ref_key:"textarea",ref:g,"onUpdate:modelValue":j[0]||(j[0]=ee=>p.value=ee),rows:"2",class:"w-full resize-none bg-transparent px-3.5 pt-2.5 pb-1 text-[16px] lg:text-[14px] leading-relaxed text-fg placeholder:text-fg-muted focus:outline-none",placeholder:e.busy?_.$t("chat.working"):_.$t("chat.message"),onInput:L,onKeydown:B,onPaste:F},null,40,p2),[[Oe,p.value]]),f("div",h2,[e.instanceId&&e.sessionAlias?(d(),m("div",b2,[f("button",{type:"button","data-test":"model-chip",class:"flex items-center gap-1.5 px-1.5 py-1 rounded-md text-fg-muted hover:bg-raised transition-colors disabled:opacity-60",disabled:!x(a).available.length,onClick:j[1]||(j[1]=ee=>c.value=!c.value)},[N(x(Bn),{size:14,class:"text-accent"}),f("span",g2,k(x(a).current||_.$t("chat.model")),1),x(a).available.length?(d(),G(x(st),{key:0,size:13})):M("",!0)],8,m2),c.value&&x(a).available.length?(d(),m("ul",x2,[(d(!0),m(X,null,ie(x(a).available,ee=>(d(),m("li",{key:ee},[f("button",{type:"button","data-test":"model-option",class:J(["flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",ee===x(a).current?"bg-accent/10 text-accent":"hover:bg-fg/10 text-fg-muted"]),onClick:fe=>y(ee)},[f("span",y2,k(ee),1),ee===x(a).current?(d(),G(x(uu),{key:0,size:14,class:"ml-auto"})):M("",!0)],10,v2)]))),128))])):M("",!0),x(a).error?(d(),m("span",k2,k(x(a).error),1)):M("",!0),o.value?(d(),m("button",{key:2,type:"button","data-test":"context-meter",class:"flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded pl-0.5 hover:opacity-80",title:_.$t("chat.contextUsage",{used:o.value.used.toLocaleString(),size:o.value.size.toLocaleString()}),onClick:h},[N(x(io),{size:13,class:J(["shrink-0",o.value.tone==="danger"?"text-danger":o.value.tone==="warn"?"text-warn":"text-accent"])},null,8,["class"]),f("span",w2,[f("span",{class:J(["absolute inset-y-0 left-0 rounded-full",o.value.tone==="danger"?"bg-danger":o.value.tone==="warn"?"bg-warn":"bg-accent"]),style:yu({width:o.value.pct+"%"})},null,6)]),f("span",E2,k(o.value.pct)+"%",1)],8,_2)):M("",!0),o.value&&i.value?(d(),G(Qh,{key:3,used:o.value.used,size:o.value.size,pct:o.value.pct,cost:o.value.cost,breakdown:o.value.breakdown,anchor:l.value,onDismiss:j[2]||(j[2]=ee=>i.value=!1)},null,8,["used","size","pct","cost","breakdown","anchor"])):M("",!0)])):(d(),m("span",A2)),f("div",$2,[f("button",{type:"button","data-test":"attach-btn",title:_.$t("chat.attach.add"),class:"flex items-center gap-1.5 px-1.5 py-1 rounded-md text-fg-muted hover:bg-raised transition-colors",onClick:D},[N(x(bo),{size:15})],8,C2),e.busy?(d(),m("button",{key:0,type:"button","data-test":"composer-stop",class:"flex items-center gap-1.5 pl-3 pr-2.5 py-1.5 rounded-md bg-danger text-white text-[12.5px] font-semibold hover:opacity-90 transition-all",onClick:j[3]||(j[3]=ee=>n("cancel"))},k(_.$t("chat.stop")),1)):(d(),m("button",{key:1,type:"submit","data-test":"composer-send",disabled:x(s).uploading||!p.value.trim()&&!x(s).pending.filter(ee=>ee.status==="ready").length,class:"flex items-center gap-1.5 pl-3 pr-2.5 py-1.5 rounded-md bg-accent text-white text-[12.5px] font-semibold shadow-e1 hover:bg-accent-hover hover:shadow-e2 transition-all disabled:bg-fg/10 disabled:text-fg-muted disabled:shadow-none"},[pe(k(_.$t("chat.send"))+" ",1),N(x(vo),{size:14})],8,D2))])])])],32))}}),S2={key:0,"data-test":"plan-panel",class:"rounded-md border border-border bg-surface p-2 text-sm"},F2=["aria-expanded","aria-label"],I2={class:"ml-auto font-mono tabular-nums"},M2=["data-test"],z2=ce({__name:"PlanPanel",props:{entries:{},active:{type:Boolean,default:void 0}},setup(e){const t=e,u=S(t.active??!0),n=S(null),s=Z(()=>t.entries.filter(l=>l.status==="completed").length),a=Z(()=>{let l=-1;return t.entries.forEach((h,c)=>{h.status==="in_progress"&&(l=c)}),l>=0?l:(t.entries.forEach((h,c)=>{h.status==="completed"&&(l=c)}),l>=0?l:t.entries.length-1)}),r=l=>l==="completed"?ya:l==="in_progress"?zt:to,o=l=>l==="completed"?"text-run":l==="in_progress"?"text-accent":"text-fg-muted";async function i(){var c;if(!u.value)return;await qe();const l=n.value;if(!l)return;const h=l.children[a.value];(c=h==null?void 0:h.scrollIntoView)==null||c.call(h,{block:"nearest"})}return me(()=>t.entries,i,{flush:"post"}),me(u,i),me(()=>t.active,l=>{l!==void 0&&(u.value=l)}),(l,h)=>e.entries.length?(d(),m("div",S2,[f("button",{type:"button","data-test":"plan-toggle","aria-expanded":u.value,"aria-controls":"plan-list","aria-label":l.$t("plan.togglePlan"),class:"mb-1 flex w-full items-center gap-1.5 text-xs font-semibold uppercase text-fg-muted hover:text-fg transition-colors",onClick:h[0]||(h[0]=c=>u.value=!u.value)},[u.value?(d(),G(x(st),{key:0,size:12,class:"shrink-0"})):(d(),G(x(Mt),{key:1,size:12,class:"shrink-0"})),pe(" "+k(l.$t("plan.title"))+" ",1),f("span",I2,k(s.value)+"/"+k(e.entries.length),1)],8,F2),_e(f("ul",{id:"plan-list",ref_key:"listEl",ref:n,class:"max-h-48 overflow-y-auto thin-scroll space-y-0.5"},[(d(!0),m(X,null,ie(e.entries,(c,y)=>(d(),m("li",{key:y,"data-test":y===a.value?"plan-active":void 0,class:"flex items-start gap-1.5"},[(d(),G(Ft(r(c.status)),{size:13,class:J([o(c.status),"mt-0.5 shrink-0",c.status==="in_progress"?"animate-spin motion-reduce:animate-none":""])},null,8,["class"])),f("span",{class:J(["min-w-0",c.status==="completed"?"text-fg-muted line-through":"text-fg"])},k(c.content),3)],8,M2))),128))],512),[[Pn,u.value]])])):M("",!0)}}),O2={class:"flex h-full flex-1 flex-col"},L2={key:0,class:"flex flex-1 items-center justify-center text-fg-muted"},R2={class:"shrink-0 flex min-h-11 lg:h-11 items-center gap-2.5 border-b border-border bg-surface/60 px-3 lg:px-5 py-1.5 lg:py-0 backdrop-blur-md"},N2={class:"hidden lg:block text-[14px] font-semibold tracking-tight text-fg"},P2={key:0,class:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden"},B2=["title"],U2={class:"min-w-0 truncate"},q2={key:1,"data-test":"ctx-chip-instance",class:"flex min-w-0 max-w-[9rem] items-center gap-1 whitespace-nowrap rounded-md border border-border bg-surface py-0.5 pl-1.5 pr-2 text-[10.5px] font-medium text-fg-muted"},j2={class:"min-w-0 truncate"},H2={key:2,"data-test":"ctx-chip-agent",class:"flex min-w-0 max-w-[9rem] items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-surface py-0.5 pl-1.5 pr-2 text-[10.5px] font-medium text-fg-muted"},V2={class:"min-w-0 truncate"},W2=["title"],G2={key:0,class:"min-w-0 truncate font-mono"},K2={key:1,class:"shrink-0 italic"},Z2={class:"shrink-0 text-warn"},Y2={key:0,"data-test":"chat-error",class:"bg-danger/10 px-4 py-1 text-xs text-danger"},X2={class:"shrink-0 space-y-2 bg-gradient-to-t from-bg to-transparent px-2 lg:px-5 pb-4 pt-1.5"},J2={key:0,"data-test":"turn-hud",class:"flex items-center gap-2 rounded-lg border border-run/20 bg-run/8 px-3 py-1.5"},Q2={class:"text-[12px] font-semibold text-run"},eb={class:"font-mono text-[12px] font-semibold tabular-nums text-run"},tb={key:0,class:"text-[11.5px] text-fg-muted"},ub=ce({__name:"ChatPane",emits:["show-files"],setup(e,{emit:t}){const u=t,n=Et(),s=ft(),a=Hu(),r=Da();function o($,E=[]){n.send($,E)}me(()=>n.instanceId,$=>{$&&r.bindInstance($)},{immediate:!0}),me(()=>[n.instanceId,n.sessionAlias],([$,E],A)=>{A&&($!==A[0]||E!==A[1])&&r.clearAttachments()});const i=Z(()=>n.instanceId?s.byId(n.instanceId):void 0),l=Z(()=>{var $;return($=i.value)==null?void 0:$.sessions.find(E=>E.alias===n.sessionAlias)});me(()=>{var $;return[n.instanceId,($=l.value)==null?void 0:$.workspace]},([$,E])=>{$&&E?a.loadGitSummary($,E):a.gitSummary=null},{immediate:!0});const h=S(Date.now()),c=setInterval(()=>{h.value=Date.now()},1e3);Ru(()=>clearInterval(c));const y=Z(()=>{if(!n.liveTurn)return"";const $=Math.max(0,Math.floor((h.value-n.liveTurn.startedAt)/1e3));return`${Math.floor($/60)}:${String($%60).padStart(2,"0")}`}),p=Z(()=>n.liveToolSteps.filter($=>$.status==="running").length),g=["Working","Thinking","Pondering","Cogitating","Reasoning","Computing","Churning","Crunching","Percolating","Noodling","Mulling","Brewing","Processing","Deliberating","Ruminating","Synthesizing","Wrangling","Tinkering"],C=Z(()=>{if(!n.liveTurn)return g[0];const $=Math.max(0,Math.floor((h.value-n.liveTurn.startedAt)/1e3));return g[Math.floor($/10)%g.length]});return($,E)=>{var A,v,w,D;return d(),m("div",O2,[x(n).sessionAlias?(d(),m(X,{key:1},[f("div",R2,[f("h1",N2,k(x(n).sessionAlias),1),l.value||i.value?(d(),m("div",P2,[(A=l.value)!=null&&A.workspace?(d(),m("button",{key:0,"data-test":"ctx-chip-workspace",class:"flex min-w-0 max-w-[10rem] items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-surface py-0.5 pl-1.5 pr-2 text-[10.5px] font-medium text-fg-muted hover:bg-fg/5",title:$.$t("chat.browseFiles"),onClick:E[0]||(E[0]=P=>u("show-files"))},[N(x(In),{size:11,class:"shrink-0 text-warn"}),f("span",U2,k(l.value.workspace),1)],8,B2)):M("",!0),(v=i.value)!=null&&v.name?(d(),m("span",q2,[E[4]||(E[4]=f("span",{class:"shrink-0 font-mono text-accent"},"@",-1)),f("span",j2,k(i.value.name),1)])):M("",!0),(w=l.value)!=null&&w.agent?(d(),m("span",H2,[N(x(Fn),{size:11,class:"shrink-0 text-accent"}),f("span",V2,k(l.value.agent),1)])):M("",!0),x(a).gitSummary?(d(),m("button",{key:3,"data-test":"git-summary",class:"flex min-w-0 max-w-[13rem] items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-surface py-0.5 pl-1.5 pr-2 text-[10.5px] font-medium text-fg-muted hover:bg-fg/5",title:x(a).gitSummary.branch||$.$t("chat.viewChanges"),onClick:E[1]||(E[1]=P=>{x(a).tab="changes",u("show-files")})},[N(x(Mn),{size:11,class:"shrink-0 text-warn"}),x(a).gitSummary.branch?(d(),m("span",G2,k(x(a).gitSummary.branch),1)):x(a).gitSummary.detached?(d(),m("span",K2,k($.$t("files.detached")),1)):M("",!0),E[5]||(E[5]=f("span",{class:"h-1 w-1 shrink-0 rounded-full bg-warn","aria-hidden":"true"},null,-1)),f("span",Z2,k(x(a).gitSummary.changedCount)+" "+k($.$t("chat.changed")),1)],8,W2)):M("",!0)])):M("",!0)]),x(n).error?(d(),m("div",Y2,[pe(k(x(n).error)+" ",1),f("button",{class:"ml-2 text-danger underline",onClick:E[2]||(E[2]=P=>x(n).error="")},k($.$t("common.dismiss")),1)])):M("",!0),N(Nh,{messages:x(n).messages,"live-turn":x(n).liveTurn,"session-key":`${x(n).instanceId}\0${x(n).sessionAlias}`,"scroll-to-scheduled":x(n).scrollRequest,"has-more-older":x(n).hasMoreOlder,"loading-older":x(n).loadingOlder,onResend:x(n).resend,onLoadOlder:x(n).loadOlder},null,8,["messages","live-turn","session-key","scroll-to-scheduled","has-more-older","loading-older","onResend","onLoadOlder"]),f("div",X2,[x(n).busy?(d(),m("div",J2,[E[6]||(E[6]=f("span",{class:"h-2 w-2 rounded-full bg-run pulse-dot","aria-hidden":"true"},null,-1)),f("span",Q2,k(C.value)+"…",1),f("span",eb,k(y.value),1),p.value>0?(d(),m("span",tb,"· "+k(p.value)+" "+k(p.value===1?$.$t("chat.tool"):$.$t("chat.tools")),1)):M("",!0),E[7]||(E[7]=f("span",{class:"flex-1"},null,-1)),f("button",{"data-test":"cancel-turn",class:"flex items-center gap-1.5 text-[11.5px] font-medium text-danger transition-opacity hover:opacity-80",onClick:E[3]||(E[3]=(...P)=>x(n).cancel&&x(n).cancel(...P))},[N(x(nt),{size:13}),pe(k($.$t("common.cancel")),1)])])):M("",!0),(D=x(n).sessionPlan)!=null&&D.length?(d(),G(z2,{key:1,entries:x(n).sessionPlan,active:x(n).busy},null,8,["entries","active"])):M("",!0),N(T2,{busy:x(n).busy,"draft-key":`${x(n).instanceId}\0${x(n).sessionAlias}`,"instance-id":x(n).instanceId,"session-alias":x(n).sessionAlias,onSend:o,onCancel:x(n).cancel},null,8,["busy","draft-key","instance-id","session-alias","onCancel"])])],64)):(d(),m("div",L2,k($.$t("chat.selectSession")),1))])}}}),nb={class:"flex h-full flex-1 flex-col bg-bg","data-test":"file-viewer-center"},sb={class:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface/60 px-3 backdrop-blur-md"},ab=["aria-label"],rb=["aria-label"],ob={class:"truncate font-mono text-[12.5px] text-fg"},ib={class:"shrink-0 text-[11px] text-fg-muted"},lb={key:0,class:"shrink-0 rounded bg-warn/10 px-1 text-[10.5px] text-warn"},cb={key:1,class:"shrink-0 rounded bg-fg/5 px-1 text-[10.5px] text-fg-muted"},db={class:"truncate font-mono text-[12.5px] text-fg"},fb={class:"ml-auto flex shrink-0 items-center gap-1"},pb=["aria-label"],hb={class:"min-h-0 flex-1 overflow-auto thin-scroll"},bb={key:0,"data-test":"fv-file-body",class:"font-mono text-[12.5px] leading-relaxed"},mb={class:"sticky left-0 w-14 shrink-0 select-none border-r border-border bg-surface px-3 text-right text-fg-muted tabular-nums"},gb={class:"whitespace-pre px-4 text-fg"},xb={key:1,class:"overflow-x-auto p-4 font-mono text-[12.5px] leading-relaxed text-fg whitespace-pre"},vb={key:2,class:"p-6 text-sm text-fg-muted"},yb={key:0,"data-test":"fv-diff-body",class:"p-4 font-mono text-[12.5px] leading-relaxed whitespace-pre"},kb={key:1,class:"p-6 text-sm text-fg-muted"},_b={key:2,class:"px-4 py-1 text-xs text-warn"},wb=5e3,Eb=ce({__name:"FileViewer",emits:["back","close"],setup(e,{emit:t}){const u=t,n=Hu(),s=Z(()=>{const o=n.file;return!o||o.binary?[]:o.content.split(`
|
|
285
285
|
`)});function a(o){return o===void 0?"":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/1024/1024).toFixed(1)} MB`}function r(o){return o.startsWith("+")&&!o.startsWith("+++")?"text-run":o.startsWith("-")&&!o.startsWith("---")?"text-danger":o.startsWith("@@")?"text-info":(o.startsWith("diff ")||o.startsWith("index "),"text-fg-muted")}return(o,i)=>(d(),m("div",nb,[f("div",sb,[f("button",{"data-test":"fv-back-list","aria-label":o.$t("files.backToList"),class:"flex lg:hidden items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-fg-muted transition-colors hover:bg-raised hover:text-fg",onClick:i[0]||(i[0]=l=>u("back"))},[N(x(vs),{size:14}),pe(k(o.$t("files.title")),1)],8,ab),f("button",{"data-test":"fv-back","aria-label":o.$t("files.back"),class:"hidden lg:flex items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-fg-muted transition-colors hover:bg-raised hover:text-fg",onClick:i[1]||(i[1]=l=>u("close"))},[N(x(vs),{size:14}),pe(k(o.$t("files.back")),1)],8,rb),i[3]||(i[3]=f("span",{class:"h-4 w-px bg-border","aria-hidden":"true"},null,-1)),x(n).file?(d(),m(X,{key:0},[N(x(Zt),{size:14,class:"shrink-0 text-accent"}),f("span",ob,k(x(n).file.path),1),f("span",ib,k(a(x(n).file.size)),1),x(n).file.truncated?(d(),m("span",lb,k(o.$t("files.truncated")),1)):M("",!0),x(n).file.binary?(d(),m("span",cb,k(o.$t("files.binary")),1)):M("",!0)],64)):x(n).diffPath?(d(),m(X,{key:1},[N(x(ro),{size:14,class:"shrink-0 text-accent"}),f("span",db,k(x(n).diffPath),1)],64)):M("",!0),f("div",fb,[x(n).file&&!x(n).file.binary?(d(),G(kr,{key:0,text:x(n).file.content},null,8,["text"])):M("",!0),f("button",{"data-test":"fv-close","aria-label":o.$t("files.closeFile"),class:"grid h-7 w-7 place-items-center rounded text-fg-muted transition-colors hover:bg-raised hover:text-fg lg:hidden",onClick:i[2]||(i[2]=l=>u("close"))},[N(x(nt),{size:16})],8,pb)])]),f("div",hb,[x(n).file?(d(),m(X,{key:0},[!x(n).file.binary&&s.value.length<=wb?(d(),m("div",bb,[(d(!0),m(X,null,ie(s.value,(l,h)=>(d(),m("div",{key:h,"data-test":"fv-line",class:"flex"},[f("span",mb,k(h+1),1),f("span",gb,k(l||" "),1)]))),128))])):x(n).file.binary?(d(),m("div",vb,k(o.$t("files.binaryNotShown")),1)):(d(),m("pre",xb,k(x(n).file.content),1))],64)):x(n).diffPath&&x(n).diff?(d(),m(X,{key:1},[x(n).diff.diff?(d(),m("pre",yb,[(d(!0),m(X,null,ie(x(n).diff.diff.split(`
|
|
286
286
|
`),(l,h)=>(d(),m("span",{key:h,class:J(["block",r(l)])},k(l),3))),128))])):(d(),m("div",kb,k(o.$t("files.noDiffContent")),1)),x(n).diff.truncated?(d(),m("div",_b,k(o.$t("files.diffTruncated")),1)):M("",!0)],64)):M("",!0)])]))}}),Ab={"data-test":"scheduled-item",class:"rounded-md border border-border bg-bg text-sm"},$b={class:"flex items-center gap-1 px-2 py-1.5"},Cb=["data-test"],Db=["data-test"],Tb={class:"min-w-0 flex-1 truncate text-[12.5px] text-fg"},Sb={class:"flex shrink-0 items-center gap-0.5"},Fb=["title","aria-label"],Ib=["title","aria-label"],Mb=["data-test"],zb={class:"whitespace-pre-wrap text-[12.5px] text-fg"},Ob={class:"font-mono text-[10.5px] tabular-nums text-fg-muted"},Lb=["data-test"],ga=ce({__name:"ScheduledTaskRow",props:{task:{}},emits:["view"],setup(e,{emit:t}){const u=e,n=t,{t:s}=It(),a=_u(),r=Et(),o=S(!1);function i(c){switch(c){case"pending":return{label:s("tasks.statusUpcoming"),cls:"text-fg-muted",icon:ka};case"triggering":return{label:s("tasks.statusRunning"),cls:"text-run",icon:zt,spin:!0};case"executed":return{label:s("tasks.statusDone"),cls:"text-run",icon:ya};case"failed":return{label:s("tasks.statusFailed"),cls:"text-danger",icon:eo};case"missed":return{label:s("tasks.statusMissed"),cls:"text-warn",icon:pu};case"cancelled":return{label:s("tasks.statusCancelled"),cls:"text-fg-muted",icon:va}}}function l(){r.requestScrollToScheduled(u.task.id),n("view")}async function h(c){await ku({title:s("tasks.cancelScheduledTitle"),message:s("tasks.cancelScheduledBody"),confirmLabel:s("tasks.cancelTask"),cancelLabel:s("tasks.keep"),tone:"danger"})&&await a.cancelScheduled(c)}return(c,y)=>(d(),m("li",Ab,[f("div",$b,[f("button",{type:"button","data-test":`scheduled-toggle-${e.task.id}`,class:"flex min-w-0 flex-1 items-center gap-1.5 text-left cursor-pointer",onClick:y[0]||(y[0]=p=>o.value=!o.value)},[N(x(Mt),{size:12,class:J(["shrink-0 text-fg-muted transition-transform",o.value?"rotate-90":""])},null,8,["class"]),f("span",{"data-test":`scheduled-status-${e.task.id}`,class:J(["inline-flex shrink-0 items-center gap-1 text-[11px] font-medium",i(e.task.status).cls])},[(d(),G(Ft(i(e.task.status).icon),{size:12,class:J(i(e.task.status).spin?"animate-spin motion-reduce:animate-none":"")},null,8,["class"])),pe(" "+k(i(e.task.status).label),1)],10,Db),f("span",Tb,k(e.task.message),1)],8,Cb),f("span",Sb,[e.task.status==="executed"?(d(),m("button",{key:0,"data-test":"view-scheduled",title:c.$t("tasks.viewRunTitle"),"aria-label":c.$t("tasks.viewRun"),class:"grid h-6 w-6 place-items-center rounded text-fg-muted transition-colors hover:bg-accent/15 hover:text-accent",onClick:l},[N(x(ao),{size:13})],8,Fb)):M("",!0),e.task.status==="pending"?(d(),m("button",{key:1,"data-test":"cancel-scheduled",title:c.$t("tasks.cancelScheduled"),"aria-label":c.$t("tasks.cancelScheduled"),class:"grid h-6 w-6 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger",onClick:y[1]||(y[1]=p=>h(e.task.id))},[N(x(hu),{size:13})],8,Ib)):M("",!0)])]),o.value?(d(),m("div",{key:0,"data-test":`scheduled-detail-${e.task.id}`,class:"space-y-1 border-t border-border px-2 py-1.5"},[f("p",zb,k(e.task.message),1),f("p",Ob,k(x(Un)(e.task.executeAt)),1),e.task.status==="failed"&&e.task.lastError?(d(),m("p",{key:0,"data-test":`scheduled-error-${e.task.id}`,class:"rounded bg-danger/10 px-2 py-1 text-[11px] text-danger"},k(e.task.lastError),9,Lb)):M("",!0)],8,Mb)):M("",!0)]))}}),Rb={class:"shrink-0 border-b border-border bg-surface p-3"},Nb={class:"mb-2 flex items-center gap-1.5"},Pb={class:"text-xs font-semibold uppercase tracking-wide text-fg-muted"},Bb={key:0,class:"rounded-full bg-bg px-1.5 font-mono text-[10px] tabular-nums text-fg-muted"},Ub=["title","aria-label"],qb={class:"space-y-1"},jb={key:0,class:"rounded-md border border-dashed border-border px-2 py-2 text-center text-[11px] text-fg-muted"},Hb={class:"flex flex-col gap-1"},Vb={class:"text-[10px] font-semibold uppercase tracking-wide text-fg-muted"},Wb={class:"flex flex-col gap-1"},Gb={class:"text-[10px] font-semibold uppercase tracking-wide text-fg-muted"},Kb=["placeholder"],Zb={class:"flex items-center gap-1.5 pt-0.5"},Yb=["disabled"],Xb=["aria-label"],Jb={class:"flex items-center justify-between border-b border-border px-4 py-3"},Qb={class:"text-sm font-semibold text-fg"},em=["aria-label"],tm={class:"flex-1 space-y-1 overflow-y-auto p-3"},xa=3,um=ce({__name:"ScheduledTasks",setup(e){const t=_u(),u=Et(),n=S(""),s=S(""),a=S(!1),r=Z(()=>t.scheduled.slice(0,xa)),o=Z(()=>Math.max(0,t.scheduled.length-xa)),i=S(!1);async function l(){if(!u.instanceId||!u.sessionAlias||!n.value||!s.value)return;const h=new Date(n.value).toISOString();await t.createScheduled(u.instanceId,u.sessionAlias,h,s.value),n.value="",s.value="",a.value=!1}return(h,c)=>(d(),m("div",Rb,[f("div",Nb,[N(x(Xr),{size:13,class:"shrink-0 text-fg-muted"}),f("h3",Pb,k(h.$t("tasks.scheduled")),1),x(t).scheduled.length?(d(),m("span",Bb,k(x(t).scheduled.length),1)):M("",!0),f("button",{type:"button","data-test":"scheduled-compose-toggle",title:h.$t("tasks.newScheduled"),"aria-label":h.$t("tasks.newScheduled"),class:J(["ml-auto grid h-6 w-6 place-items-center rounded-md transition-colors hover:bg-raised hover:text-fg",a.value?"bg-raised text-fg":"text-fg-muted"]),onClick:c[0]||(c[0]=y=>a.value=!a.value)},[N(x(qu),{size:14,class:J(["transition-transform",a.value?"rotate-45":""])},null,8,["class"])],10,Ub)]),f("ul",qb,[(d(!0),m(X,null,ie(r.value,y=>(d(),G(ga,{key:y.id,task:y},null,8,["task"]))),128)),x(t).scheduled.length===0?(d(),m("li",jb,k(h.$t("tasks.noScheduled")),1)):M("",!0)]),o.value>0?(d(),m("button",{key:0,type:"button","data-test":"scheduled-view-all",class:"mt-1.5 flex w-full items-center justify-center gap-1 rounded-md border border-border bg-bg px-2 py-1 text-[11px] font-medium text-fg-muted transition-colors hover:bg-accent/10 hover:text-accent",onClick:c[1]||(c[1]=y=>i.value=!0)},[pe(k(h.$t("tasks.viewAll",{count:x(t).scheduled.length}))+" ",1),N(x(st),{size:12})])):M("",!0),a.value?(d(),m("form",{key:1,"data-test":"scheduled-composer",class:"mt-2 space-y-2 rounded-lg border border-border bg-bg p-2.5",onSubmit:Ae(l,["prevent"])},[f("label",Hb,[f("span",Vb,k(h.$t("tasks.whenLabel")),1),_e(f("input",{"onUpdate:modelValue":c[2]||(c[2]=y=>n.value=y),type:"datetime-local",class:"w-full rounded-md border border-border bg-surface px-2 py-1 text-xs text-fg focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent"},null,512),[[Oe,n.value]])]),f("label",Wb,[f("span",Gb,k(h.$t("tasks.messageLabel")),1),_e(f("input",{"onUpdate:modelValue":c[3]||(c[3]=y=>s.value=y),placeholder:h.$t("tasks.messagePlaceholder"),class:"w-full rounded-md border border-border bg-surface px-2 py-1 text-xs text-fg placeholder:text-fg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent"},null,8,Kb),[[Oe,s.value]])]),f("div",Zb,[f("button",{type:"submit",disabled:!n.value||!s.value,class:"flex-1 rounded-md bg-accent px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-accent-hover disabled:cursor-not-allowed disabled:opacity-40"},k(h.$t("tasks.schedule")),9,Yb),f("button",{type:"button",class:"rounded-md border border-border px-2 py-1 text-xs text-fg-muted transition-colors hover:bg-raised hover:text-fg",onClick:c[4]||(c[4]=y=>a.value=!1)},k(h.$t("common.cancel")),1)])],32)):M("",!0),(d(),G(tu,{to:"body"},[N(Vr,{"enter-active-class":"transition-opacity duration-200 ease-out motion-reduce:transition-none","enter-from-class":"opacity-0","leave-active-class":"transition-opacity duration-150 ease-in motion-reduce:transition-none","leave-to-class":"opacity-0"},{default:mt(()=>[i.value?(d(),m("div",{key:0,"data-test":"scheduled-drawer",class:"fixed inset-0 z-50 flex justify-end bg-black/50",onClick:c[7]||(c[7]=Ae(y=>i.value=!1,["self"])),onKeydown:c[8]||(c[8]=Nn(y=>i.value=!1,["esc"]))},[f("aside",{class:"flex h-full w-full max-w-md flex-col border-l border-border bg-raised shadow-xl",role:"dialog","aria-label":h.$t("tasks.allScheduled")},[f("header",Jb,[f("h2",Qb,k(h.$t("tasks.scheduledCount",{count:x(t).scheduled.length})),1),f("button",{class:"rounded p-1 text-fg-muted hover:bg-fg/5 hover:text-fg","aria-label":h.$t("tasks.close"),"data-test":"scheduled-drawer-close",onClick:c[5]||(c[5]=y=>i.value=!1)},[N(x(nt),{size:16})],8,em)]),f("ul",tm,[(d(!0),m(X,null,ie(x(t).scheduled,y=>(d(),G(ga,{key:y.id,task:y,onView:c[6]||(c[6]=p=>i.value=!1)},null,8,["task"]))),128))])],8,Xb)],32)):M("",!0)]),_:1})]))]))}}),nm={class:"flex min-h-0 flex-col bg-surface"},sm={class:"shrink-0 px-3 pt-3 pb-2 text-xs font-semibold uppercase text-fg-muted"},am={class:"min-h-0 flex-1 space-y-1 overflow-y-auto thin-scroll px-3 pb-3"},rm={class:"flex min-w-0 items-center gap-1.5"},om={class:"truncate"},im=["title","aria-label","onClick"],lm={key:0,class:"text-xs text-fg-muted"},cm={key:1,class:"pt-0.5 text-center text-[10.5px] text-fg-muted"},Sn=10,dm=ce({__name:"OrchestrationTasks",setup(e){const{t}=It(),u=_u(),n=Z(()=>[...u.orchestration].sort((r,o)=>o.createdAt.localeCompare(r.createdAt)).slice(0,Sn));async function s(r){await ku({title:t("tasks.cancelTitle"),message:t("tasks.cancelBody"),confirmLabel:t("tasks.cancelConfirm"),cancelLabel:t("tasks.keepRunning"),tone:"danger"})&&await u.cancelOrchestration(r)}function a(r){const o=r.toLowerCase();return o.includes("run")||o.includes("active")?"text-run":o.includes("fail")||o.includes("error")||o.includes("cancel")?"text-danger":o.includes("wait")||o.includes("pending")||o.includes("block")?"text-warn":"text-fg-muted"}return(r,o)=>(d(),m("div",nm,[f("h3",sm,k(r.$t("tasks.orchestration")),1),f("ul",am,[(d(!0),m(X,null,ie(n.value,i=>(d(),m("li",{key:i.taskId,class:"flex items-center justify-between text-sm text-fg"},[f("span",rm,[N(x(Pu),{size:14,class:"shrink-0 text-fg-muted"}),f("span",om,[pe(k(i.task)+" ",1),f("span",{class:J(["text-xs",a(i.status)])},"("+k(i.status)+")",3)])]),f("button",{"data-test":"cancel-orchestration",title:r.$t("tasks.cancelTask"),"aria-label":r.$t("tasks.cancelOrchestrationAria"),class:"ml-2 grid h-6 w-6 shrink-0 place-items-center rounded text-fg-muted transition-colors hover:bg-danger/15 hover:text-danger",onClick:l=>s(i.taskId)},[N(x(va),{size:13})],8,im)]))),128)),x(u).orchestration.length===0?(d(),m("li",lm,k(r.$t("tasks.noOrchestration")),1)):M("",!0),x(u).orchestration.length>Sn?(d(),m("li",cm,k(r.$t("tasks.moreOrchestration",{count:x(u).orchestration.length-Sn})),1)):M("",!0)])]))}}),fm={key:0,class:"flex h-full flex-col"},pm={key:1,class:"p-4 text-sm text-fg-muted"},hm=ce({__name:"TaskPanel",setup(e){const t=Et(),u=_u();return me(()=>[t.instanceId,t.sessionAlias],([n,s])=>{n&&s&&u.loadFor(n,s)},{immediate:!0}),(n,s)=>x(t).instanceId&&x(t).sessionAlias?(d(),m("div",fm,[N(um),N(dm,{class:"min-h-0 flex-1"})])):(d(),m("div",pm,k(n.$t("taskPanel.noSession")),1))}}),bm={class:"flex h-full flex-col bg-surface text-sm text-fg-muted"},mm={key:0,class:"flex flex-1 items-center justify-center p-4 text-center text-xs text-fg-muted"},gm={class:"flex shrink-0 items-center gap-2 border-b border-border p-2"},xm=["title"],vm={class:"truncate font-medium"},ym={class:"flex shrink-0 items-center gap-1"},km=["title","aria-label","disabled"],_m={key:0,"data-test":"files-error",class:"shrink-0 bg-danger/10 px-2 py-1 text-xs text-danger"},wm={key:1,class:"flex min-h-0 flex-1 flex-col"},Em={class:"flex shrink-0 items-center gap-1 border-b border-border px-2 py-1"},Am=["placeholder"],$m=["aria-label"],Cm={key:0,"data-test":"fs-results",class:"min-h-0 flex-1 overflow-y-auto thin-scroll"},Dm={class:"p-2.5 text-[11px] font-mono leading-5 space-y-px"},Tm=["onClick"],Sm={class:"truncate font-sans text-[12px] text-fg-muted"},Fm={key:0,class:"px-1.5 py-1 text-xs text-fg-muted"},Im={key:0,class:"px-2.5 pb-1 text-xs text-warn"},Mm={class:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-2.5 py-1.5 font-mono text-[11px] text-fg-muted"},zm=["title","aria-label","disabled"],Om=["onClick"],Lm={class:"min-h-0 flex-1 overflow-y-auto thin-scroll p-2.5 text-[11px] font-mono leading-5 space-y-px"},Rm=["onClick"],Nm={key:1,class:"w-[11px] shrink-0"},Pm=["title"],Bm={key:5,class:"shrink-0 font-mono text-[10.5px] text-fg-muted tabular-nums"},Um={key:0,class:"px-1.5 py-1 text-xs text-fg-muted"},qm={key:2,class:"flex min-h-0 flex-1 flex-col"},jm={class:"shrink-0 border-b border-border"},Hm={key:0,"data-test":"changes-branch",class:"truncate font-mono text-[11.5px] font-medium text-fg"},Vm={key:1,"data-test":"changes-branch",class:"truncate font-mono text-[11.5px] italic text-fg-muted"},Wm={key:2,class:"text-[10.5px] font-semibold uppercase tracking-wider text-fg-muted"},Gm={key:3,"data-test":"worktree-linked",class:"shrink-0 rounded-full border border-accent/30 bg-accent/10 px-1.5 py-px text-[9px] font-semibold uppercase tracking-wide text-accent"},Km={key:4,class:"flex shrink-0 items-center gap-1.5 font-mono text-[10.5px] tabular-nums"},Zm={class:"text-fg-muted"},Ym={class:"text-run"},Xm={class:"text-danger"},Jm=["title"],Qm={class:"truncate font-mono",dir:"rtl"},eg={class:"min-h-0 flex-1 overflow-y-auto thin-scroll p-2.5 space-y-px"},tg=["onClick"],ug={key:0,class:"px-1.5 py-1 text-xs text-fg-muted"},ng={key:1,"data-test":"changes-not-git",class:"flex min-h-0 flex-1 flex-col items-center justify-center gap-1.5 p-6 text-center text-xs text-fg-muted"},sg={class:"text-[11px] text-fg-muted/70"},ag={key:2,class:"p-3 text-xs text-fg-muted"},rg={key:3,class:"shrink-0 border-t border-border px-3 py-1 text-xs text-fg-muted"},og=ce({__name:"FilesPanel",props:{instanceId:{}},setup(e){const t=e,u=Hu(),n=ft(),s=Et(),a=Z(()=>u.path?u.path.split("/"):[]),r=Z(()=>a.value.length===0);function o(){r.value||u.up(a.value.length-2)}const i=Z(()=>{var V;const F=t.instanceId?n.byId(t.instanceId):void 0;return((V=F==null?void 0:F.sessions.find(R=>R.alias===s.sessionAlias))==null?void 0:V.workspace)??null}),l=Z(()=>{const F=u.diff;return F?{branch:F.branch,detached:F.detached===!0,worktree:F.worktree}:null}),h=Z(()=>{const F=u.diff;if(!F)return null;let V=0,R=0;for(const O of F.diff?F.diff.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as w,u as k,c as a,a as e,b as C,e as c,t as l,n as f,w as _,v as M,f as b,g as v,h as $,r as d,i as B,o as n}from"./index-
|
|
1
|
+
import{d as w,u as k,c as a,a as e,b as C,e as c,t as l,n as f,w as _,v as M,f as b,g as v,h as $,r as d,i as B,o as n}from"./index-Bn9S3sSl.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";const j={class:"relative flex min-h-dvh items-center justify-center overflow-hidden bg-bg px-4"},D={class:"relative flex items-center border-b border-border bg-raised px-3.5 py-2.5"},L={class:"pointer-events-none absolute inset-x-0 flex items-center justify-center gap-1.5 text-xs text-fg-muted"},N={class:"px-4 pb-5 pt-4"},S={class:"flex items-center gap-2"},A=["title","aria-label"],T={key:0,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},I={key:1,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},U={id:"login-hint",class:"mb-5 mt-1 text-[11.5px] leading-relaxed text-fg-muted"},E={class:"relative"},F=["type","placeholder","aria-label","disabled"],G=["title","aria-label","aria-pressed"],H={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},O={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},X={key:0,"data-test":"login-error",role:"alert",class:"mt-3 flex items-start gap-1.5 text-xs text-danger"},z=["disabled"],K={key:0,class:"ml-auto text-[11px] text-fg-muted"},x="xacpx-relay add token",P=w({__name:"LoginView",setup(R){const u=k(),h=B(),p=d(""),s=d(!1),i=d(!1),r=d(!1);async function m(){if(!s.value){s.value=!0;try{await u.login(p.value)&&h.replace("/")}finally{s.value=!1}}}async function y(){var o;try{await((o=navigator.clipboard)==null?void 0:o.writeText(x)),r.value=!0,window.setTimeout(()=>r.value=!1,1200)}catch{}}return(o,t)=>(n(),a("div",j,[t[11]||(t[11]=e("div",{"aria-hidden":"true",class:"login-glow"},null,-1)),t[12]||(t[12]=e("div",{"aria-hidden":"true",class:"login-grid"},null,-1)),e("form",{"data-test":"login-window",class:"relative w-[22rem] max-w-full overflow-hidden rounded-2xl border border-border bg-surface font-mono shadow-e3",onSubmit:$(m,["prevent"])},[e("div",D,[t[3]||(t[3]=e("div",{"aria-hidden":"true",class:"flex gap-[7px]"},[e("span",{class:"h-[11px] w-[11px] rounded-full opacity-90",style:{background:"#ff5f56"}}),e("span",{class:"h-[11px] w-[11px] rounded-full opacity-90",style:{background:"#ffbd2e"}}),e("span",{class:"h-[11px] w-[11px] rounded-full opacity-90",style:{background:"#27c93f"}})],-1)),e("div",L,[t[2]||(t[2]=C('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" aria-hidden="true" data-v-5bca4cb2><defs data-v-5bca4cb2><linearGradient id="loginBrandX" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse" data-v-5bca4cb2><stop stop-color="#4F9BF5" data-v-5bca4cb2></stop><stop offset="1" stop-color="#69D689" data-v-5bca4cb2></stop></linearGradient></defs><path d="M5 5 L19 19 M19 5 L5 19" stroke="url(#loginBrandX)" stroke-width="3.4" stroke-linecap="round" data-v-5bca4cb2></path></svg>',1)),c(" xacpx-relay — "+l(o.$t("login.window")),1)])]),e("div",N,[e("div",S,[e("p",{class:"flex-1 text-[12.5px] text-fg"},[t[4]||(t[4]=e("span",{class:"select-none text-run"},"$",-1)),c(" "+l(x))]),e("button",{type:"button","data-test":"copy-command",title:o.$t("login.copyCommand"),"aria-label":o.$t("login.copyCommand"),class:f(["flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-bg",r.value?"text-run":"text-fg-muted hover:text-fg"]),onClick:y},[r.value?(n(),a("svg",I,[...t[6]||(t[6]=[e("path",{d:"M20 6 9 17l-5-5"},null,-1)])])):(n(),a("svg",T,[...t[5]||(t[5]=[e("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])]))],10,A)]),e("p",U,l(o.$t("login.runHint")),1),t[10]||(t[10]=e("div",{"aria-hidden":"true",class:"mb-2 flex items-center gap-1.5 text-xs text-fg-muted"},[e("span",{class:"text-run"},"▸"),c(" access-token ")],-1)),e("div",E,[_(e("input",{id:"access-token","onUpdate:modelValue":t[0]||(t[0]=g=>p.value=g),"data-test":"token-input",type:i.value?"text":"password",placeholder:o.$t("login.tokenPlaceholder"),"aria-label":o.$t("login.tokenLabel"),"aria-describedby":"login-hint",autocomplete:"off",disabled:s.value,class:"login-input w-full rounded-lg border border-border bg-bg py-2.5 pl-3 pr-10 text-sm tracking-[0.05em] text-fg placeholder:tracking-normal placeholder:text-fg-muted disabled:opacity-50"},null,8,F),[[M,p.value]]),e("button",{type:"button","data-test":"toggle-visibility",title:o.$t("login.toggleVisibility"),"aria-label":o.$t("login.toggleVisibility"),"aria-pressed":i.value,class:"absolute right-1.5 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-muted transition-colors hover:bg-surface hover:text-fg",onClick:t[1]||(t[1]=g=>i.value=!i.value)},[i.value?(n(),a("svg",O,[...t[8]||(t[8]=[e("path",{d:"M9.9 4.2A11 11 0 0 1 12 4c6.5 0 10 7 10 7a13 13 0 0 1-1.7 2.7M6.6 6.6A13 13 0 0 0 2 11s3.5 7 10 7a11 11 0 0 0 3.4-.5M3 3l18 18M9.9 9.9a3 3 0 0 0 4.2 4.2"},null,-1)])])):(n(),a("svg",H,[...t[7]||(t[7]=[e("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"},null,-1),e("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,G)]),b(u).error?(n(),a("p",X,[t[9]||(t[9]=e("span",{class:"font-bold"},"!",-1)),e("span",null,l(b(u).error),1)])):v("",!0),e("button",{type:"submit","data-test":"signin",disabled:s.value,class:"login-btn group mt-5 flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-[13.5px] font-semibold text-fg transition-colors hover:bg-run/10 hover:text-run disabled:cursor-default disabled:text-fg-muted disabled:hover:bg-transparent disabled:hover:text-fg-muted"},[e("span",{class:f(["login-arrow group-hover:translate-x-0.5",s.value?"text-fg-muted":"text-run"])},"▸",2),e("span",null,l(s.value?o.$t("login.signingIn"):o.$t("login.signIn")),1),s.value?v("",!0):(n(),a("span",K,"⏎ enter"))],8,z)])],32)]))}}),J=V(P,[["__scopeId","data-v-5bca4cb2"]]);export{J as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B,d as P,u as A,V as D,B as E,q as I,l as b,c as r,a as t,t as s,x as $,R as M,f as n,n as h,F as R,y as U,W as j,w as z,D as H,g as w,e as C,r as c,I as F,U as q,i as W,o as l}from"./index-
|
|
1
|
+
import{j as B,d as P,u as A,V as D,B as E,q as I,l as b,c as r,a as t,t as s,x as $,R as M,f as n,n as h,F as R,y as U,W as j,w as z,D as H,g as w,e as C,r as c,I as F,U as q,i as W,o as l}from"./index-Bn9S3sSl.js";import{u as G}from"./theme-rA-1YbeM.js";/**
|
|
2
2
|
* @license lucide-vue-next v1.0.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-D_ws_UNl.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/LoginView-BDsZDCu4.css","assets/DashboardView-DUUqMJTb.js","assets/theme-rA-1YbeM.js","assets/DashboardView-DQH2-6ZB.css","assets/SettingsView-D-nJtS5E.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/**
|
|
3
3
|
* @vue/shared v3.5.35
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -77,7 +77,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-CH3Gr
|
|
|
77
77
|
* vue-router v4.6.4
|
|
78
78
|
* (c) 2025 Eduardo San Martin Morote
|
|
79
79
|
* @license MIT
|
|
80
|
-
*/let Zh=()=>location.protocol+"//"+location.host;function Tc(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,l=r.slice(i);return l[0]!=="/"&&(l="/"+l),Yi(l,"")}return Yi(n,e)+s+r}function zh(e,t,n,s){let r=[],o=[],i=null;const l=({state:d})=>{const _=Tc(e,location),C=n.value,y=t.value;let w=0;if(d){if(n.value=_,t.value=d,i&&i===C){i=null;return}w=y?d.position-y.position:0}else s(_);r.forEach(M=>{M(n.value,C,{delta:w,type:ao.pop,direction:w?w>0?Ur.forward:Ur.back:Ur.unknown})})};function a(){i=n.value}function c(d){r.push(d);const _=()=>{const C=r.indexOf(d);C>-1&&r.splice(C,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(ue({},d.state,{scroll:vr()}),"")}}function f(){for(const d of o)d();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:c,destroy:f}}function Zi(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?vr():null}}function em(e){const{history:t,location:n}=window,s={value:Tc(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(a,c,u){const f=e.indexOf("#"),d=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+a:Zh()+e+a;try{t[u?"replaceState":"pushState"](c,"",d),r.value=c}catch(_){console.error(_),n[u?"replace":"assign"](d)}}function i(a,c){o(a,ue({},t.state,Zi(r.value.back,a,r.value.forward,!0),c,{position:r.value.position}),!0),s.value=a}function l(a,c){const u=ue({},r.value,t.state,{forward:a,scroll:vr()});o(u.current,u,!0),o(a,ue({},Zi(s.value,a,null),{position:u.position+1},c),!1),s.value=a}return{location:s,state:r,push:l,replace:i}}function tm(e){e=Uh(e);const t=em(e),n=zh(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=ue({location:"",base:e,go:s,createHref:Hh.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let bn=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Oe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Oe||{});const nm={type:bn.Static,value:""},sm=/[a-zA-Z0-9_]/;function rm(e){if(!e)return[[]];if(e==="/")return[[nm]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${c}": ${_}`)}let n=Oe.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let l=0,a,c="",u="";function f(){c&&(n===Oe.Static?o.push({type:bn.Static,value:c}):n===Oe.Param||n===Oe.ParamRegExp||n===Oe.ParamRegExpEnd?(o.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),o.push({type:bn.Param,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function d(){c+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==Oe.ParamRegExp){s=n,n=Oe.EscapeNext;continue}switch(n){case Oe.Static:a==="/"?(c&&f(),i()):a===":"?(f(),n=Oe.Param):d();break;case Oe.EscapeNext:d(),n=s;break;case Oe.Param:a==="("?n=Oe.ParamRegExp:sm.test(a)?d():(f(),n=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Oe.ParamRegExp:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:n=Oe.ParamRegExpEnd:u+=a;break;case Oe.ParamRegExpEnd:f(),n=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:t("Unknown state");break}}return n===Oe.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),f(),i(),r}const zi="[^/]+?",om={sensitive:!1,strict:!1,start:!0,end:!0};var Xe=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Xe||{});const im=/[.+*?^${}()[\]/\\]/g;function lm(e,t){const n=ue({},om,t),s=[];let r=n.start?"^":"";const o=[];for(const c of e){const u=c.length?[]:[Xe.Root];n.strict&&!c.length&&(r+="/");for(let f=0;f<c.length;f++){const d=c[f];let _=Xe.Segment+(n.sensitive?Xe.BonusCaseSensitive:0);if(d.type===bn.Static)f||(r+="/"),r+=d.value.replace(im,"\\$&"),_+=Xe.Static;else if(d.type===bn.Param){const{value:C,repeatable:y,optional:w,regexp:M}=d;o.push({name:C,repeatable:y,optional:w});const R=M||zi;if(R!==zi){_+=Xe.BonusCustomRegExp;try{`${R}`}catch(b){throw new Error(`Invalid custom RegExp for param "${C}" (${R}): `+b.message)}}let E=y?`((?:${R})(?:/(?:${R}))*)`:`(${R})`;f||(E=w&&c.length<2?`(?:/${E})`:"/"+E),w&&(E+="?"),r+=E,_+=Xe.Dynamic,w&&(_+=Xe.BonusOptional),y&&(_+=Xe.BonusRepeatable),R===".*"&&(_+=Xe.BonusWildcard)}u.push(_)}s.push(u)}if(n.strict&&n.end){const c=s.length-1;s[c][s[c].length-1]+=Xe.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const i=new RegExp(r,n.sensitive?"":"i");function l(c){const u=c.match(i),f={};if(!u)return null;for(let d=1;d<u.length;d++){const _=u[d]||"",C=o[d-1];f[C.name]=_&&C.repeatable?_.split("/"):_}return f}function a(c){let u="",f=!1;for(const d of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of d)if(_.type===bn.Static)u+=_.value;else if(_.type===bn.Param){const{value:C,repeatable:y,optional:w}=_,M=C in c?c[C]:"";if(Et(M)&&!y)throw new Error(`Provided param "${C}" is an array but it is not repeatable (* or + modifiers)`);const R=Et(M)?M.join("/"):M;if(!R)if(w)d.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${C}"`);u+=R}}return u||"/"}return{re:i,score:s,keys:o,parse:l,stringify:a}}function am(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Xe.Static+Xe.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Xe.Static+Xe.Segment?1:-1:0}function Sc(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const o=am(s[n],r[n]);if(o)return o;n++}if(Math.abs(r.length-s.length)===1){if(el(s))return 1;if(el(r))return-1}return r.length-s.length}function el(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const cm={strict:!1,end:!0,sensitive:!1};function um(e,t,n){const s=lm(rm(e.path),n),r=ue(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function fm(e,t){const n=[],s=new Map;t=Ki(cm,t);function r(f){return s.get(f)}function o(f,d,_){const C=!_,y=nl(f);y.aliasOf=_&&_.record;const w=Ki(t,f),M=[y];if("alias"in f){const b=typeof f.alias=="string"?[f.alias]:f.alias;for(const I of b)M.push(nl(ue({},y,{components:_?_.record.components:y.components,path:I,aliasOf:_?_.record:y})))}let R,E;for(const b of M){const{path:I}=b;if(d&&I[0]!=="/"){const O=d.record.path,L=O[O.length-1]==="/"?"":"/";b.path=d.record.path+(I&&L+I)}if(R=um(b,d,w),_?_.alias.push(R):(E=E||R,E!==R&&E.alias.push(R),C&&f.name&&!sl(R)&&i(f.name)),Ac(R)&&a(R),y.children){const O=y.children;for(let L=0;L<O.length;L++)o(O[L],R,_&&_.children[L])}_=_||R}return E?()=>{i(E)}:cs}function i(f){if(Ec(f)){const d=s.get(f);d&&(s.delete(f),n.splice(n.indexOf(d),1),d.children.forEach(i),d.alias.forEach(i))}else{const d=n.indexOf(f);d>-1&&(n.splice(d,1),f.record.name&&s.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function l(){return n}function a(f){const d=mm(f,n);n.splice(d,0,f),f.record.name&&!sl(f)&&s.set(f.record.name,f)}function c(f,d){let _,C={},y,w;if("name"in f&&f.name){if(_=s.get(f.name),!_)throw Vn(Ae.MATCHER_NOT_FOUND,{location:f});w=_.record.name,C=ue(tl(d.params,_.keys.filter(E=>!E.optional).concat(_.parent?_.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),f.params&&tl(f.params,_.keys.map(E=>E.name))),y=_.stringify(C)}else if(f.path!=null)y=f.path,_=n.find(E=>E.re.test(y)),_&&(C=_.parse(y),w=_.record.name);else{if(_=d.name?s.get(d.name):n.find(E=>E.re.test(d.path)),!_)throw Vn(Ae.MATCHER_NOT_FOUND,{location:f,currentLocation:d});w=_.record.name,C=ue({},d.params,f.params),y=_.stringify(C)}const M=[];let R=_;for(;R;)M.unshift(R.record),R=R.parent;return{name:w,path:y,params:C,matched:M,meta:hm(M)}}e.forEach(f=>o(f));function u(){n.length=0,s.clear()}return{addRoute:o,resolve:c,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:r}}function tl(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function nl(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:dm(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function dm(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function sl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function hm(e){return e.reduce((t,n)=>ue(t,n.meta),{})}function mm(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;Sc(e,t[o])<0?s=o:n=o+1}const r=pm(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function pm(e){let t=e;for(;t=t.parent;)if(Ac(t)&&Sc(e,t)===0)return t}function Ac({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function rl(e){const t=ut(Er),n=ut(yc),s=Ce(()=>{const a=Ie(e.to);return t.resolve(a)}),r=Ce(()=>{const{matched:a}=s.value,{length:c}=a,u=a[c-1],f=n.matched;if(!u||!f.length)return-1;const d=f.findIndex(Un.bind(null,u));if(d>-1)return d;const _=ol(a[c-2]);return c>1&&ol(u)===_&&f[f.length-1].path!==_?f.findIndex(Un.bind(null,a[c-2])):d}),o=Ce(()=>r.value>-1&&bm(n.params,s.value.params)),i=Ce(()=>r.value>-1&&r.value===n.matched.length-1&&vc(n.params,s.value.params));function l(a={}){if(Em(a)){const c=t[Ie(e.replace)?"replace":"push"](Ie(e.to)).catch(cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:Ce(()=>s.value.href),isActive:o,isExactActive:i,navigate:l}}function gm(e){return e.length===1?e[0]:e}const _m=An({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:rl,setup(e,{slots:t}){const n=Cs(rl(e)),{options:s}=ut(Er),r=Ce(()=>({[il(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[il(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&gm(t.default(n));return e.custom?o:nn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),vm=_m;function Em(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function bm(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Et(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function ol(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const il=(e,t,n)=>e??t??n,ym=An({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=ut(uo),r=Ce(()=>e.route||s.value),o=ut(Qi,0),i=Ce(()=>{let c=Ie(o);const{matched:u}=r.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),l=Ce(()=>r.value.matched[i.value]);Us(Qi,Ce(()=>i.value+1)),Us(Jh,l),Us(uo,r);const a=ct();return Zt(()=>[a.value,l.value,e.name],([c,u,f],[d,_,C])=>{u&&(u.instances[f]=c,_&&_!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),c&&u&&(!_||!Un(u,_)||!d)&&(u.enterCallbacks[f]||[]).forEach(y=>y(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,f=l.value,d=f&&f.components[u];if(!d)return ll(n.default,{Component:d,route:c});const _=f.props[u],C=_?_===!0?c.params:typeof _=="function"?_(c):_:null,w=nn(d,ue({},C,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(f.instances[u]=null)},ref:a}));return ll(n.default,{Component:w,route:c})||w}}});function ll(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Tm=ym;function Sm(e){const t=fm(e.routes,e),n=e.parseQuery||Xh,s=e.stringifyQuery||Ji,r=e.history,o=Jn(),i=Jn(),l=Jn(),a=ko(Kt);let c=Kt;On&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Fr.bind(null,x=>""+x),f=Fr.bind(null,Ph),d=Fr.bind(null,bs);function _(x,Y){let j,X;return Ec(x)?(j=t.getRecordMatcher(x),X=Y):X=x,t.addRoute(X,j)}function C(x){const Y=t.getRecordMatcher(x);Y&&t.removeRoute(Y)}function y(){return t.getRoutes().map(x=>x.record)}function w(x){return!!t.getRecordMatcher(x)}function M(x,Y){if(Y=ue({},Y||a.value),typeof x=="string"){const g=xr(n,x,Y.path),N=t.resolve({path:g.path},Y),U=r.createHref(g.fullPath);return ue(g,N,{params:d(N.params),hash:bs(g.hash),redirectedFrom:void 0,href:U})}let j;if(x.path!=null)j=ue({},x,{path:xr(n,x.path,Y.path).path});else{const g=ue({},x.params);for(const N in g)g[N]==null&&delete g[N];j=ue({},x,{params:f(g)}),Y.params=f(Y.params)}const X=t.resolve(j,Y),re=x.hash||"";X.params=u(d(X.params));const p=Dh(s,ue({},x,{hash:Ih(re),path:X.path})),v=r.createHref(p);return ue({fullPath:p,hash:re,query:s===Ji?qh(x.query):x.query||{}},X,{redirectedFrom:void 0,href:v})}function R(x){return typeof x=="string"?xr(n,x,a.value.path):ue({},x)}function E(x,Y){if(c!==x)return Vn(Ae.NAVIGATION_CANCELLED,{from:Y,to:x})}function b(x){return L(x)}function I(x){return b(ue(R(x),{replace:!0}))}function O(x,Y){const j=x.matched[x.matched.length-1];if(j&&j.redirect){const{redirect:X}=j;let re=typeof X=="function"?X(x,Y):X;return typeof re=="string"&&(re=re.includes("?")||re.includes("#")?re=R(re):{path:re},re.params={}),ue({query:x.query,hash:x.hash,params:re.path!=null?{}:x.params},re)}}function L(x,Y){const j=c=M(x),X=a.value,re=x.state,p=x.force,v=x.replace===!0,g=O(j,X);if(g)return L(ue(R(g),{state:typeof g=="object"?ue({},re,g.state):re,force:p,replace:v}),Y||j);const N=j;N.redirectedFrom=Y;let U;return!p&&Mh(s,X,j)&&(U=Vn(Ae.NAVIGATION_DUPLICATED,{to:N,from:X}),Te(X,X,!0,!1)),(U?Promise.resolve(U):K(N,X)).catch(k=>Pt(k)?Pt(k,Ae.NAVIGATION_GUARD_REDIRECT)?k:Qe(k):le(k,N,X)).then(k=>{if(k){if(Pt(k,Ae.NAVIGATION_GUARD_REDIRECT))return L(ue({replace:v},R(k.to),{state:typeof k.to=="object"?ue({},re,k.to.state):re,force:p}),Y||N)}else k=V(N,X,!0,v,re);return Z(N,X,k),k})}function F(x,Y){const j=E(x,Y);return j?Promise.reject(j):Promise.resolve()}function T(x){const Y=ze.values().next().value;return Y&&typeof Y.runWithContext=="function"?Y.runWithContext(x):x()}function K(x,Y){let j;const[X,re,p]=Qh(x,Y);j=Vr(X.reverse(),"beforeRouteLeave",x,Y);for(const g of X)g.leaveGuards.forEach(N=>{j.push(Qt(N,x,Y))});const v=F.bind(null,x,Y);return j.push(v),De(j).then(()=>{j=[];for(const g of o.list())j.push(Qt(g,x,Y));return j.push(v),De(j)}).then(()=>{j=Vr(re,"beforeRouteUpdate",x,Y);for(const g of re)g.updateGuards.forEach(N=>{j.push(Qt(N,x,Y))});return j.push(v),De(j)}).then(()=>{j=[];for(const g of p)if(g.beforeEnter)if(Et(g.beforeEnter))for(const N of g.beforeEnter)j.push(Qt(N,x,Y));else j.push(Qt(g.beforeEnter,x,Y));return j.push(v),De(j)}).then(()=>(x.matched.forEach(g=>g.enterCallbacks={}),j=Vr(p,"beforeRouteEnter",x,Y,T),j.push(v),De(j))).then(()=>{j=[];for(const g of i.list())j.push(Qt(g,x,Y));return j.push(v),De(j)}).catch(g=>Pt(g,Ae.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function Z(x,Y,j){l.list().forEach(X=>T(()=>X(x,Y,j)))}function V(x,Y,j,X,re){const p=E(x,Y);if(p)return p;const v=Y===Kt,g=On?history.state:{};j&&(X||v?r.replace(x.fullPath,ue({scroll:v&&g&&g.scroll},re)):r.push(x.fullPath,re)),a.value=x,Te(x,Y,j,v),Qe()}let Q;function he(){Q||(Q=r.listen((x,Y,j)=>{if(!et.listening)return;const X=M(x),re=O(X,et.currentRoute.value);if(re){L(ue(re,{replace:!0,force:!0}),X).catch(cs);return}c=X;const p=a.value;On&&Bh(qi(p.fullPath,j.delta),vr()),K(X,p).catch(v=>Pt(v,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_CANCELLED)?v:Pt(v,Ae.NAVIGATION_GUARD_REDIRECT)?(L(ue(R(v.to),{force:!0}),X).then(g=>{Pt(g,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&!j.delta&&j.type===ao.pop&&r.go(-1,!1)}).catch(cs),Promise.reject()):(j.delta&&r.go(-j.delta,!1),le(v,X,p))).then(v=>{v=v||V(X,p,!1),v&&(j.delta&&!Pt(v,Ae.NAVIGATION_CANCELLED)?r.go(-j.delta,!1):j.type===ao.pop&&Pt(v,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),Z(X,p,v)}).catch(cs)}))}let Ne=Jn(),oe=Jn(),ee;function le(x,Y,j){Qe(x);const X=oe.list();return X.length?X.forEach(re=>re(x,Y,j)):console.error(x),Promise.reject(x)}function Be(){return ee&&a.value!==Kt?Promise.resolve():new Promise((x,Y)=>{Ne.add([x,Y])})}function Qe(x){return ee||(ee=!x,he(),Ne.list().forEach(([Y,j])=>x?j(x):Y()),Ne.reset()),x}function Te(x,Y,j,X){const{scrollBehavior:re}=e;if(!On||!re)return Promise.resolve();const p=!j&&jh(qi(x.fullPath,0))||(X||!j)&&history.state&&history.state.scroll||null;return fr().then(()=>re(x,Y,p)).then(v=>v&&$h(v)).catch(v=>le(v,x,Y))}const Se=x=>r.go(x);let ot;const ze=new Set,et={currentRoute:a,listening:!0,addRoute:_,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:w,getRoutes:y,resolve:M,options:e,push:b,replace:I,go:Se,back:()=>Se(-1),forward:()=>Se(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:oe.add,isReady:Be,install(x){x.component("RouterLink",vm),x.component("RouterView",Tm),x.config.globalProperties.$router=et,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>Ie(a)}),On&&!ot&&a.value===Kt&&(ot=!0,b(r.location).catch(X=>{}));const Y={};for(const X in Kt)Object.defineProperty(Y,X,{get:()=>a.value[X],enumerable:!0});x.provide(Er,et),x.provide(yc,ha(Y)),x.provide(uo,a);const j=x.unmount;ze.add(x),x.unmount=function(){ze.delete(x),ze.size<1&&(c=Kt,Q&&Q(),Q=null,a.value=Kt,ot=!1,ee=!1),j()}}};function De(x){return x.reduce((Y,j)=>Y.then(()=>T(j)),Promise.resolve())}return et}function e_(){return ut(Er)}class Cc extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Ln(e,t,n){const r=await fetch(t,{method:e,credentials:"include",headers:e==="GET"?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=r.status===204?void 0:await r.json().catch(()=>{});if(!r.ok)throw new Cc((o==null?void 0:o.error)??"request-failed",r.status);return o}const Hr={get:e=>Ln("GET",e),post:(e,t)=>Ln("POST",e,t),patch:(e,t)=>Ln("PATCH",e,t),del:e=>Ln("DELETE",e),rpc:(e,t,n={})=>Ln("POST",`/api/instances/${e}/rpc`,{type:t,payload:n}).then(s=>s.result),upload:(e,t)=>Ln("POST",`/api/instances/${e}/rpc`,{type:"control.upload",payload:t}).then(n=>n.result)},Am=fc("auth",()=>{const e=ct(null),t=ct("");async function n(o){t.value="";try{return e.value=await Hr.post("/api/login",{token:o}),!0}catch(i){return t.value=i instanceof Cc?i.code:"request-failed",e.value=null,!1}}async function s(){try{return e.value=await Hr.get("/api/me"),!0}catch{return e.value=null,!1}}async function r(){await Hr.post("/api/logout").catch(()=>{}),e.value=null}return{account:e,error:t,login:n,fetchMe:s,logout:r}}),Cm=[{path:"/login",name:"login",component:()=>Ws(()=>import("./LoginView-CH3Gr1EY.js"),__vite__mapDeps([0,1,2]))},{path:"/",name:"dashboard",component:()=>Ws(()=>import("./DashboardView-pxxhASTg.js"),__vite__mapDeps([3,1,4,5]))},{path:"/settings",name:"settings",component:()=>Ws(()=>import("./SettingsView-Deilrt-x.js"),__vite__mapDeps([6,4]))}],Nc=Sm({history:tm(),routes:Cm});Nc.beforeEach(async e=>{if(e.name==="login")return!0;const t=Am();return t.account||await t.fetchMe()?!0:{name:"login"}});/*!
|
|
80
|
+
*/let Zh=()=>location.protocol+"//"+location.host;function Tc(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let i=r.includes(e.slice(o))?e.slice(o).length:1,l=r.slice(i);return l[0]!=="/"&&(l="/"+l),Yi(l,"")}return Yi(n,e)+s+r}function zh(e,t,n,s){let r=[],o=[],i=null;const l=({state:d})=>{const _=Tc(e,location),C=n.value,y=t.value;let w=0;if(d){if(n.value=_,t.value=d,i&&i===C){i=null;return}w=y?d.position-y.position:0}else s(_);r.forEach(M=>{M(n.value,C,{delta:w,type:ao.pop,direction:w?w>0?Ur.forward:Ur.back:Ur.unknown})})};function a(){i=n.value}function c(d){r.push(d);const _=()=>{const C=r.indexOf(d);C>-1&&r.splice(C,1)};return o.push(_),_}function u(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(ue({},d.state,{scroll:vr()}),"")}}function f(){for(const d of o)d();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:c,destroy:f}}function Zi(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?vr():null}}function em(e){const{history:t,location:n}=window,s={value:Tc(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(a,c,u){const f=e.indexOf("#"),d=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+a:Zh()+e+a;try{t[u?"replaceState":"pushState"](c,"",d),r.value=c}catch(_){console.error(_),n[u?"replace":"assign"](d)}}function i(a,c){o(a,ue({},t.state,Zi(r.value.back,a,r.value.forward,!0),c,{position:r.value.position}),!0),s.value=a}function l(a,c){const u=ue({},r.value,t.state,{forward:a,scroll:vr()});o(u.current,u,!0),o(a,ue({},Zi(s.value,a,null),{position:u.position+1},c),!1),s.value=a}return{location:s,state:r,push:l,replace:i}}function tm(e){e=Uh(e);const t=em(e),n=zh(e,t.state,t.location,t.replace);function s(o,i=!0){i||n.pauseListeners(),history.go(o)}const r=ue({location:"",base:e,go:s,createHref:Hh.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let bn=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Oe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Oe||{});const nm={type:bn.Static,value:""},sm=/[a-zA-Z0-9_]/;function rm(e){if(!e)return[[]];if(e==="/")return[[nm]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${c}": ${_}`)}let n=Oe.Static,s=n;const r=[];let o;function i(){o&&r.push(o),o=[]}let l=0,a,c="",u="";function f(){c&&(n===Oe.Static?o.push({type:bn.Static,value:c}):n===Oe.Param||n===Oe.ParamRegExp||n===Oe.ParamRegExpEnd?(o.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),o.push({type:bn.Param,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function d(){c+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==Oe.ParamRegExp){s=n,n=Oe.EscapeNext;continue}switch(n){case Oe.Static:a==="/"?(c&&f(),i()):a===":"?(f(),n=Oe.Param):d();break;case Oe.EscapeNext:d(),n=s;break;case Oe.Param:a==="("?n=Oe.ParamRegExp:sm.test(a)?d():(f(),n=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Oe.ParamRegExp:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:n=Oe.ParamRegExpEnd:u+=a;break;case Oe.ParamRegExpEnd:f(),n=Oe.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:t("Unknown state");break}}return n===Oe.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),f(),i(),r}const zi="[^/]+?",om={sensitive:!1,strict:!1,start:!0,end:!0};var Xe=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Xe||{});const im=/[.+*?^${}()[\]/\\]/g;function lm(e,t){const n=ue({},om,t),s=[];let r=n.start?"^":"";const o=[];for(const c of e){const u=c.length?[]:[Xe.Root];n.strict&&!c.length&&(r+="/");for(let f=0;f<c.length;f++){const d=c[f];let _=Xe.Segment+(n.sensitive?Xe.BonusCaseSensitive:0);if(d.type===bn.Static)f||(r+="/"),r+=d.value.replace(im,"\\$&"),_+=Xe.Static;else if(d.type===bn.Param){const{value:C,repeatable:y,optional:w,regexp:M}=d;o.push({name:C,repeatable:y,optional:w});const R=M||zi;if(R!==zi){_+=Xe.BonusCustomRegExp;try{`${R}`}catch(b){throw new Error(`Invalid custom RegExp for param "${C}" (${R}): `+b.message)}}let E=y?`((?:${R})(?:/(?:${R}))*)`:`(${R})`;f||(E=w&&c.length<2?`(?:/${E})`:"/"+E),w&&(E+="?"),r+=E,_+=Xe.Dynamic,w&&(_+=Xe.BonusOptional),y&&(_+=Xe.BonusRepeatable),R===".*"&&(_+=Xe.BonusWildcard)}u.push(_)}s.push(u)}if(n.strict&&n.end){const c=s.length-1;s[c][s[c].length-1]+=Xe.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const i=new RegExp(r,n.sensitive?"":"i");function l(c){const u=c.match(i),f={};if(!u)return null;for(let d=1;d<u.length;d++){const _=u[d]||"",C=o[d-1];f[C.name]=_&&C.repeatable?_.split("/"):_}return f}function a(c){let u="",f=!1;for(const d of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const _ of d)if(_.type===bn.Static)u+=_.value;else if(_.type===bn.Param){const{value:C,repeatable:y,optional:w}=_,M=C in c?c[C]:"";if(Et(M)&&!y)throw new Error(`Provided param "${C}" is an array but it is not repeatable (* or + modifiers)`);const R=Et(M)?M.join("/"):M;if(!R)if(w)d.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${C}"`);u+=R}}return u||"/"}return{re:i,score:s,keys:o,parse:l,stringify:a}}function am(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Xe.Static+Xe.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Xe.Static+Xe.Segment?1:-1:0}function Sc(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const o=am(s[n],r[n]);if(o)return o;n++}if(Math.abs(r.length-s.length)===1){if(el(s))return 1;if(el(r))return-1}return r.length-s.length}function el(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const cm={strict:!1,end:!0,sensitive:!1};function um(e,t,n){const s=lm(rm(e.path),n),r=ue(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function fm(e,t){const n=[],s=new Map;t=Ki(cm,t);function r(f){return s.get(f)}function o(f,d,_){const C=!_,y=nl(f);y.aliasOf=_&&_.record;const w=Ki(t,f),M=[y];if("alias"in f){const b=typeof f.alias=="string"?[f.alias]:f.alias;for(const I of b)M.push(nl(ue({},y,{components:_?_.record.components:y.components,path:I,aliasOf:_?_.record:y})))}let R,E;for(const b of M){const{path:I}=b;if(d&&I[0]!=="/"){const O=d.record.path,L=O[O.length-1]==="/"?"":"/";b.path=d.record.path+(I&&L+I)}if(R=um(b,d,w),_?_.alias.push(R):(E=E||R,E!==R&&E.alias.push(R),C&&f.name&&!sl(R)&&i(f.name)),Ac(R)&&a(R),y.children){const O=y.children;for(let L=0;L<O.length;L++)o(O[L],R,_&&_.children[L])}_=_||R}return E?()=>{i(E)}:cs}function i(f){if(Ec(f)){const d=s.get(f);d&&(s.delete(f),n.splice(n.indexOf(d),1),d.children.forEach(i),d.alias.forEach(i))}else{const d=n.indexOf(f);d>-1&&(n.splice(d,1),f.record.name&&s.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function l(){return n}function a(f){const d=mm(f,n);n.splice(d,0,f),f.record.name&&!sl(f)&&s.set(f.record.name,f)}function c(f,d){let _,C={},y,w;if("name"in f&&f.name){if(_=s.get(f.name),!_)throw Vn(Ae.MATCHER_NOT_FOUND,{location:f});w=_.record.name,C=ue(tl(d.params,_.keys.filter(E=>!E.optional).concat(_.parent?_.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),f.params&&tl(f.params,_.keys.map(E=>E.name))),y=_.stringify(C)}else if(f.path!=null)y=f.path,_=n.find(E=>E.re.test(y)),_&&(C=_.parse(y),w=_.record.name);else{if(_=d.name?s.get(d.name):n.find(E=>E.re.test(d.path)),!_)throw Vn(Ae.MATCHER_NOT_FOUND,{location:f,currentLocation:d});w=_.record.name,C=ue({},d.params,f.params),y=_.stringify(C)}const M=[];let R=_;for(;R;)M.unshift(R.record),R=R.parent;return{name:w,path:y,params:C,matched:M,meta:hm(M)}}e.forEach(f=>o(f));function u(){n.length=0,s.clear()}return{addRoute:o,resolve:c,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:r}}function tl(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function nl(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:dm(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function dm(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function sl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function hm(e){return e.reduce((t,n)=>ue(t,n.meta),{})}function mm(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;Sc(e,t[o])<0?s=o:n=o+1}const r=pm(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function pm(e){let t=e;for(;t=t.parent;)if(Ac(t)&&Sc(e,t)===0)return t}function Ac({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function rl(e){const t=ut(Er),n=ut(yc),s=Ce(()=>{const a=Ie(e.to);return t.resolve(a)}),r=Ce(()=>{const{matched:a}=s.value,{length:c}=a,u=a[c-1],f=n.matched;if(!u||!f.length)return-1;const d=f.findIndex(Un.bind(null,u));if(d>-1)return d;const _=ol(a[c-2]);return c>1&&ol(u)===_&&f[f.length-1].path!==_?f.findIndex(Un.bind(null,a[c-2])):d}),o=Ce(()=>r.value>-1&&bm(n.params,s.value.params)),i=Ce(()=>r.value>-1&&r.value===n.matched.length-1&&vc(n.params,s.value.params));function l(a={}){if(Em(a)){const c=t[Ie(e.replace)?"replace":"push"](Ie(e.to)).catch(cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:Ce(()=>s.value.href),isActive:o,isExactActive:i,navigate:l}}function gm(e){return e.length===1?e[0]:e}const _m=An({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:rl,setup(e,{slots:t}){const n=Cs(rl(e)),{options:s}=ut(Er),r=Ce(()=>({[il(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[il(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&gm(t.default(n));return e.custom?o:nn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),vm=_m;function Em(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function bm(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Et(r)||r.length!==s.length||s.some((o,i)=>o.valueOf()!==r[i].valueOf()))return!1}return!0}function ol(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const il=(e,t,n)=>e??t??n,ym=An({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=ut(uo),r=Ce(()=>e.route||s.value),o=ut(Qi,0),i=Ce(()=>{let c=Ie(o);const{matched:u}=r.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),l=Ce(()=>r.value.matched[i.value]);Us(Qi,Ce(()=>i.value+1)),Us(Jh,l),Us(uo,r);const a=ct();return Zt(()=>[a.value,l.value,e.name],([c,u,f],[d,_,C])=>{u&&(u.instances[f]=c,_&&_!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=_.leaveGuards),u.updateGuards.size||(u.updateGuards=_.updateGuards))),c&&u&&(!_||!Un(u,_)||!d)&&(u.enterCallbacks[f]||[]).forEach(y=>y(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,f=l.value,d=f&&f.components[u];if(!d)return ll(n.default,{Component:d,route:c});const _=f.props[u],C=_?_===!0?c.params:typeof _=="function"?_(c):_:null,w=nn(d,ue({},C,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(f.instances[u]=null)},ref:a}));return ll(n.default,{Component:w,route:c})||w}}});function ll(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Tm=ym;function Sm(e){const t=fm(e.routes,e),n=e.parseQuery||Xh,s=e.stringifyQuery||Ji,r=e.history,o=Jn(),i=Jn(),l=Jn(),a=ko(Kt);let c=Kt;On&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Fr.bind(null,x=>""+x),f=Fr.bind(null,Ph),d=Fr.bind(null,bs);function _(x,Y){let j,X;return Ec(x)?(j=t.getRecordMatcher(x),X=Y):X=x,t.addRoute(X,j)}function C(x){const Y=t.getRecordMatcher(x);Y&&t.removeRoute(Y)}function y(){return t.getRoutes().map(x=>x.record)}function w(x){return!!t.getRecordMatcher(x)}function M(x,Y){if(Y=ue({},Y||a.value),typeof x=="string"){const g=xr(n,x,Y.path),N=t.resolve({path:g.path},Y),U=r.createHref(g.fullPath);return ue(g,N,{params:d(N.params),hash:bs(g.hash),redirectedFrom:void 0,href:U})}let j;if(x.path!=null)j=ue({},x,{path:xr(n,x.path,Y.path).path});else{const g=ue({},x.params);for(const N in g)g[N]==null&&delete g[N];j=ue({},x,{params:f(g)}),Y.params=f(Y.params)}const X=t.resolve(j,Y),re=x.hash||"";X.params=u(d(X.params));const p=Dh(s,ue({},x,{hash:Ih(re),path:X.path})),v=r.createHref(p);return ue({fullPath:p,hash:re,query:s===Ji?qh(x.query):x.query||{}},X,{redirectedFrom:void 0,href:v})}function R(x){return typeof x=="string"?xr(n,x,a.value.path):ue({},x)}function E(x,Y){if(c!==x)return Vn(Ae.NAVIGATION_CANCELLED,{from:Y,to:x})}function b(x){return L(x)}function I(x){return b(ue(R(x),{replace:!0}))}function O(x,Y){const j=x.matched[x.matched.length-1];if(j&&j.redirect){const{redirect:X}=j;let re=typeof X=="function"?X(x,Y):X;return typeof re=="string"&&(re=re.includes("?")||re.includes("#")?re=R(re):{path:re},re.params={}),ue({query:x.query,hash:x.hash,params:re.path!=null?{}:x.params},re)}}function L(x,Y){const j=c=M(x),X=a.value,re=x.state,p=x.force,v=x.replace===!0,g=O(j,X);if(g)return L(ue(R(g),{state:typeof g=="object"?ue({},re,g.state):re,force:p,replace:v}),Y||j);const N=j;N.redirectedFrom=Y;let U;return!p&&Mh(s,X,j)&&(U=Vn(Ae.NAVIGATION_DUPLICATED,{to:N,from:X}),Te(X,X,!0,!1)),(U?Promise.resolve(U):K(N,X)).catch(k=>Pt(k)?Pt(k,Ae.NAVIGATION_GUARD_REDIRECT)?k:Qe(k):le(k,N,X)).then(k=>{if(k){if(Pt(k,Ae.NAVIGATION_GUARD_REDIRECT))return L(ue({replace:v},R(k.to),{state:typeof k.to=="object"?ue({},re,k.to.state):re,force:p}),Y||N)}else k=V(N,X,!0,v,re);return Z(N,X,k),k})}function F(x,Y){const j=E(x,Y);return j?Promise.reject(j):Promise.resolve()}function T(x){const Y=ze.values().next().value;return Y&&typeof Y.runWithContext=="function"?Y.runWithContext(x):x()}function K(x,Y){let j;const[X,re,p]=Qh(x,Y);j=Vr(X.reverse(),"beforeRouteLeave",x,Y);for(const g of X)g.leaveGuards.forEach(N=>{j.push(Qt(N,x,Y))});const v=F.bind(null,x,Y);return j.push(v),De(j).then(()=>{j=[];for(const g of o.list())j.push(Qt(g,x,Y));return j.push(v),De(j)}).then(()=>{j=Vr(re,"beforeRouteUpdate",x,Y);for(const g of re)g.updateGuards.forEach(N=>{j.push(Qt(N,x,Y))});return j.push(v),De(j)}).then(()=>{j=[];for(const g of p)if(g.beforeEnter)if(Et(g.beforeEnter))for(const N of g.beforeEnter)j.push(Qt(N,x,Y));else j.push(Qt(g.beforeEnter,x,Y));return j.push(v),De(j)}).then(()=>(x.matched.forEach(g=>g.enterCallbacks={}),j=Vr(p,"beforeRouteEnter",x,Y,T),j.push(v),De(j))).then(()=>{j=[];for(const g of i.list())j.push(Qt(g,x,Y));return j.push(v),De(j)}).catch(g=>Pt(g,Ae.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function Z(x,Y,j){l.list().forEach(X=>T(()=>X(x,Y,j)))}function V(x,Y,j,X,re){const p=E(x,Y);if(p)return p;const v=Y===Kt,g=On?history.state:{};j&&(X||v?r.replace(x.fullPath,ue({scroll:v&&g&&g.scroll},re)):r.push(x.fullPath,re)),a.value=x,Te(x,Y,j,v),Qe()}let Q;function he(){Q||(Q=r.listen((x,Y,j)=>{if(!et.listening)return;const X=M(x),re=O(X,et.currentRoute.value);if(re){L(ue(re,{replace:!0,force:!0}),X).catch(cs);return}c=X;const p=a.value;On&&Bh(qi(p.fullPath,j.delta),vr()),K(X,p).catch(v=>Pt(v,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_CANCELLED)?v:Pt(v,Ae.NAVIGATION_GUARD_REDIRECT)?(L(ue(R(v.to),{force:!0}),X).then(g=>{Pt(g,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&!j.delta&&j.type===ao.pop&&r.go(-1,!1)}).catch(cs),Promise.reject()):(j.delta&&r.go(-j.delta,!1),le(v,X,p))).then(v=>{v=v||V(X,p,!1),v&&(j.delta&&!Pt(v,Ae.NAVIGATION_CANCELLED)?r.go(-j.delta,!1):j.type===ao.pop&&Pt(v,Ae.NAVIGATION_ABORTED|Ae.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),Z(X,p,v)}).catch(cs)}))}let Ne=Jn(),oe=Jn(),ee;function le(x,Y,j){Qe(x);const X=oe.list();return X.length?X.forEach(re=>re(x,Y,j)):console.error(x),Promise.reject(x)}function Be(){return ee&&a.value!==Kt?Promise.resolve():new Promise((x,Y)=>{Ne.add([x,Y])})}function Qe(x){return ee||(ee=!x,he(),Ne.list().forEach(([Y,j])=>x?j(x):Y()),Ne.reset()),x}function Te(x,Y,j,X){const{scrollBehavior:re}=e;if(!On||!re)return Promise.resolve();const p=!j&&jh(qi(x.fullPath,0))||(X||!j)&&history.state&&history.state.scroll||null;return fr().then(()=>re(x,Y,p)).then(v=>v&&$h(v)).catch(v=>le(v,x,Y))}const Se=x=>r.go(x);let ot;const ze=new Set,et={currentRoute:a,listening:!0,addRoute:_,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:w,getRoutes:y,resolve:M,options:e,push:b,replace:I,go:Se,back:()=>Se(-1),forward:()=>Se(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:oe.add,isReady:Be,install(x){x.component("RouterLink",vm),x.component("RouterView",Tm),x.config.globalProperties.$router=et,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>Ie(a)}),On&&!ot&&a.value===Kt&&(ot=!0,b(r.location).catch(X=>{}));const Y={};for(const X in Kt)Object.defineProperty(Y,X,{get:()=>a.value[X],enumerable:!0});x.provide(Er,et),x.provide(yc,ha(Y)),x.provide(uo,a);const j=x.unmount;ze.add(x),x.unmount=function(){ze.delete(x),ze.size<1&&(c=Kt,Q&&Q(),Q=null,a.value=Kt,ot=!1,ee=!1),j()}}};function De(x){return x.reduce((Y,j)=>Y.then(()=>T(j)),Promise.resolve())}return et}function e_(){return ut(Er)}class Cc extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function Ln(e,t,n){const r=await fetch(t,{method:e,credentials:"include",headers:e==="GET"?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=r.status===204?void 0:await r.json().catch(()=>{});if(!r.ok)throw new Cc((o==null?void 0:o.error)??"request-failed",r.status);return o}const Hr={get:e=>Ln("GET",e),post:(e,t)=>Ln("POST",e,t),patch:(e,t)=>Ln("PATCH",e,t),del:e=>Ln("DELETE",e),rpc:(e,t,n={})=>Ln("POST",`/api/instances/${e}/rpc`,{type:t,payload:n}).then(s=>s.result),upload:(e,t)=>Ln("POST",`/api/instances/${e}/rpc`,{type:"control.upload",payload:t}).then(n=>n.result)},Am=fc("auth",()=>{const e=ct(null),t=ct("");async function n(o){t.value="";try{return e.value=await Hr.post("/api/login",{token:o}),!0}catch(i){return t.value=i instanceof Cc?i.code:"request-failed",e.value=null,!1}}async function s(){try{return e.value=await Hr.get("/api/me"),!0}catch{return e.value=null,!1}}async function r(){await Hr.post("/api/logout").catch(()=>{}),e.value=null}return{account:e,error:t,login:n,fetchMe:s,logout:r}}),Cm=[{path:"/login",name:"login",component:()=>Ws(()=>import("./LoginView-D_ws_UNl.js"),__vite__mapDeps([0,1,2]))},{path:"/",name:"dashboard",component:()=>Ws(()=>import("./DashboardView-DUUqMJTb.js"),__vite__mapDeps([3,1,4,5]))},{path:"/settings",name:"settings",component:()=>Ws(()=>import("./SettingsView-D-nJtS5E.js"),__vite__mapDeps([6,4]))}],Nc=Sm({history:tm(),routes:Cm});Nc.beforeEach(async e=>{if(e.name==="login")return!0;const t=Am();return t.account||await t.fetchMe()?!0:{name:"login"}});/*!
|
|
81
81
|
* shared v9.14.5
|
|
82
82
|
* (c) 2025 kazuya kawaguchi
|
|
83
83
|
* Released under the MIT License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as n,r as c}from"./index-
|
|
1
|
+
import{k as n,r as c}from"./index-Bn9S3sSl.js";const a="relay-theme";function m(){var t;const e=localStorage.getItem(a);return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}const i=n("theme",()=>{const e=c(m());function t(){document.documentElement.classList.toggle("dark",e.value==="dark"),document.documentElement.style.colorScheme=e.value}function o(r){e.value=r,localStorage.setItem(a,r),t()}function l(){o(e.value==="dark"?"light":"dark")}return t(),{mode:e,set:o,toggle:l,apply:t}});export{i as u};
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
})();
|
|
31
31
|
</script>
|
|
32
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
+
<script type="module" crossorigin src="/assets/index-Bn9S3sSl.js"></script>
|
|
33
33
|
<link rel="stylesheet" crossorigin href="/assets/index-BppLIa87.css">
|
|
34
34
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
35
35
|
<body>
|
package/dist/relay-web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const n=(n,l)=>(n=new URL(n+".js",l).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(l,r)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let o={};const a=e=>n(e,i),t={module:{uri:i},exports:o,require:a};s[i]=Promise.all(l.map(e=>t[e]||a(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"d2af46f4bb347977f19595bda6caaed4"},{url:"pwa-512x512.png",revision:"f16a01bab067f36b39a42485d686e3be"},{url:"pwa-192x192.png",revision:"fa77320642032c636d96f216b9ed84a3"},{url:"mask-icon.svg",revision:"78d0341702fa97ead2e057c910ac730e"},{url:"index.html",revision:"
|
|
1
|
+
if(!self.define){let e,s={};const n=(n,l)=>(n=new URL(n+".js",l).href,s[n]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()}).then(()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e}));self.define=(l,r)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let o={};const a=e=>n(e,i),t={module:{uri:i},exports:o,require:a};s[i]=Promise.all(l.map(e=>t[e]||a(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"d2af46f4bb347977f19595bda6caaed4"},{url:"pwa-512x512.png",revision:"f16a01bab067f36b39a42485d686e3be"},{url:"pwa-192x192.png",revision:"fa77320642032c636d96f216b9ed84a3"},{url:"mask-icon.svg",revision:"78d0341702fa97ead2e057c910ac730e"},{url:"index.html",revision:"f87f710d1f2462574610db2c9e0467ab"},{url:"icon.svg",revision:"108e2c2390e392bf1df806b0fac8630b"},{url:"favicon.ico",revision:"f3b082619625b4e8aba703acb01d86c9"},{url:"apple-touch-icon-180x180.png",revision:"e55c4a308bb7b81b46fc17ca3cecc9df"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/theme-rA-1YbeM.js",revision:null},{url:"assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2",revision:null},{url:"assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2",revision:null},{url:"assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2",revision:null},{url:"assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2",revision:null},{url:"assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2",revision:null},{url:"assets/jetbrains-mono-greek-400-normal-C190GLew.woff2",revision:null},{url:"assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2",revision:null},{url:"assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2",revision:null},{url:"assets/inter-vietnamese-700-normal-DlLaEgI2.woff2",revision:null},{url:"assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2",revision:null},{url:"assets/inter-vietnamese-500-normal-DOriooB6.woff2",revision:null},{url:"assets/inter-vietnamese-400-normal-DMkecbls.woff2",revision:null},{url:"assets/inter-latin-ext-700-normal-Ca8adRJv.woff2",revision:null},{url:"assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2",revision:null},{url:"assets/inter-latin-ext-500-normal-CV4jyFjo.woff2",revision:null},{url:"assets/inter-latin-ext-400-normal-C1nco2VV.woff2",revision:null},{url:"assets/inter-latin-700-normal-Yt3aPRUw.woff2",revision:null},{url:"assets/inter-latin-600-normal-LgqL8muc.woff2",revision:null},{url:"assets/inter-latin-500-normal-Cerq10X2.woff2",revision:null},{url:"assets/inter-latin-400-normal-C38fXH4l.woff2",revision:null},{url:"assets/inter-greek-ext-700-normal-qfdV9bQt.woff2",revision:null},{url:"assets/inter-greek-ext-600-normal-DRtmH8MT.woff2",revision:null},{url:"assets/inter-greek-ext-500-normal-C4iEst2y.woff2",revision:null},{url:"assets/inter-greek-ext-400-normal-DGGRlc-M.woff2",revision:null},{url:"assets/inter-greek-700-normal-C3JjAnD8.woff2",revision:null},{url:"assets/inter-greek-600-normal-plRanbMR.woff2",revision:null},{url:"assets/inter-greek-500-normal-BIZE56-Y.woff2",revision:null},{url:"assets/inter-greek-400-normal-B4URO6DV.woff2",revision:null},{url:"assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2",revision:null},{url:"assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2",revision:null},{url:"assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2",revision:null},{url:"assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2",revision:null},{url:"assets/inter-cyrillic-700-normal-CjBOestx.woff2",revision:null},{url:"assets/inter-cyrillic-600-normal-CWCymEST.woff2",revision:null},{url:"assets/inter-cyrillic-500-normal-BasfLYem.woff2",revision:null},{url:"assets/inter-cyrillic-400-normal-obahsSVq.woff2",revision:null},{url:"assets/index-BppLIa87.css",revision:null},{url:"assets/index-Bn9S3sSl.js",revision:null},{url:"assets/_plugin-vue_export-helper-DlAUqK2U.js",revision:null},{url:"assets/SettingsView-D-nJtS5E.js",revision:null},{url:"assets/LoginView-D_ws_UNl.js",revision:null},{url:"assets/LoginView-BDsZDCu4.css",revision:null},{url:"assets/DashboardView-DUUqMJTb.js",revision:null},{url:"assets/DashboardView-DQH2-6ZB.css",revision:null},{url:"apple-touch-icon-180x180.png",revision:"e55c4a308bb7b81b46fc17ca3cecc9df"},{url:"favicon.ico",revision:"f3b082619625b4e8aba703acb01d86c9"},{url:"icon.svg",revision:"108e2c2390e392bf1df806b0fac8630b"},{url:"mask-icon.svg",revision:"78d0341702fa97ead2e057c910ac730e"},{url:"pwa-192x192.png",revision:"fa77320642032c636d96f216b9ed84a3"},{url:"pwa-512x512.png",revision:"f16a01bab067f36b39a42485d686e3be"},{url:"pwa-64x64.png",revision:"d2af46f4bb347977f19595bda6caaed4"},{url:"manifest.webmanifest",revision:"b4ffc8074149528886e792c1f7aec4ef"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api/,/^\/ws/]}))});
|