blade-code 0.10.140 → 0.10.141
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/blade.js +2 -2
- package/dist/{chunk-svsgtj41.js → chunk-0b67y4j1.js} +2 -2
- package/dist/{chunk-eqe3smcg.js → chunk-0chvj0qt.js} +2 -2
- package/dist/chunk-0s0er9wr.js +1 -0
- package/dist/{chunk-nxsarfy6.js → chunk-28tzj187.js} +1 -1
- package/dist/chunk-2b3j2egw.js +1 -0
- package/dist/{chunk-cf3dvysj.js → chunk-34fmx68h.js} +1 -1
- package/dist/{chunk-y5bqd8gh.js → chunk-3da7sqx6.js} +1 -1
- package/dist/chunk-3kszepm6.js +2 -0
- package/dist/chunk-44edbaa1.js +1 -0
- package/dist/{chunk-w5057h27.js → chunk-4dtshx9v.js} +2 -2
- package/dist/{chunk-rrtptbzv.js → chunk-4pexd8a7.js} +2 -2
- package/dist/{chunk-hj1yrssp.js → chunk-4w8v677q.js} +1 -1
- package/dist/chunk-514va7ce.js +2 -0
- package/dist/{chunk-pg7cgvs8.js → chunk-5q4z0sfr.js} +2 -2
- package/dist/{chunk-ffkzessq.js → chunk-5v3eng7c.js} +1 -1
- package/dist/chunk-5vxhttdq.js +10 -0
- package/dist/{chunk-xagh2qb6.js → chunk-6w8p6c0g.js} +2 -2
- package/dist/{chunk-7eepxhcp.js → chunk-7azws27d.js} +28 -28
- package/dist/chunk-7g76xzzg.js +2 -0
- package/dist/{chunk-hvmrcd84.js → chunk-7wcxjbyg.js} +1 -1
- package/dist/{chunk-c562kd2m.js → chunk-7xhw74hk.js} +1 -1
- package/dist/{chunk-mnk0b4nz.js → chunk-7xtxvrh8.js} +1 -1
- package/dist/{chunk-q9qts6bq.js → chunk-83je3g6c.js} +3 -3
- package/dist/chunk-8tvf39jm.js +1 -0
- package/dist/{chunk-2g8avyq6.js → chunk-9kj19a8t.js} +1 -1
- package/dist/{chunk-9ced7jf0.js → chunk-9tk6wq70.js} +1 -1
- package/dist/{chunk-kmg8ad2j.js → chunk-9xbwtjac.js} +1 -1
- package/dist/{chunk-e6j4vzta.js → chunk-ae0fws1f.js} +2 -2
- package/dist/chunk-be1fyzb3.js +181 -0
- package/dist/{chunk-eh901zhx.js → chunk-cbgsjzdw.js} +2 -2
- package/dist/chunk-enf0egke.js +1 -0
- package/dist/{chunk-ma1mn6hn.js → chunk-erhaedch.js} +1 -1
- package/dist/{chunk-19zsecpx.js → chunk-f2jm4x5q.js} +2 -2
- package/dist/{chunk-cww9pp1q.js → chunk-f2y0gxyq.js} +2 -2
- package/dist/chunk-f5t7a64t.js +1 -0
- package/dist/{chunk-6zxm9pen.js → chunk-frvdjy8y.js} +1 -1
- package/dist/{chunk-ppmy3n74.js → chunk-fx4xr1g6.js} +360 -357
- package/dist/{chunk-zfaenqqx.js → chunk-fx9vm1n5.js} +2 -2
- package/dist/{chunk-85b3kacc.js → chunk-gm2yfq3r.js} +2 -2
- package/dist/chunk-h273dnvq.js +1 -0
- package/dist/{chunk-pwct7cj7.js → chunk-h5xad96g.js} +1 -1
- package/dist/{chunk-r4q06wbs.js → chunk-hv8nt7wj.js} +1 -1
- package/dist/{chunk-1myft5nb.js → chunk-j1pptwsq.js} +1 -1
- package/dist/chunk-j7784bxm.js +1 -0
- package/dist/{chunk-gq727fet.js → chunk-jbpasjg9.js} +1 -1
- package/dist/chunk-jr402gf8.js +1 -0
- package/dist/{chunk-g38d2ezm.js → chunk-jsv3e4k6.js} +1 -1
- package/dist/{chunk-pw9axk0e.js → chunk-k1tfry97.js} +2 -2
- package/dist/{chunk-8fx20am1.js → chunk-k3ne93k8.js} +2 -2
- package/dist/{chunk-0c2y17xy.js → chunk-kf9j9z9k.js} +1 -1
- package/dist/{chunk-n8qg68y2.js → chunk-n34qsnks.js} +1 -1
- package/dist/{chunk-5cw3bevx.js → chunk-n9819k4p.js} +1 -1
- package/dist/{chunk-tagzy876.js → chunk-ppp4gpy4.js} +1 -1
- package/dist/{chunk-5jq1mrqd.js → chunk-pv6cgfv1.js} +1 -1
- package/dist/{chunk-50m1czz9.js → chunk-pzxg2sdv.js} +1 -1
- package/dist/{chunk-0kghtvxj.js → chunk-r5dmdsjb.js} +2 -2
- package/dist/{chunk-es0cbtx1.js → chunk-rv80nkve.js} +2 -2
- package/dist/{chunk-n6tvswa8.js → chunk-ryyzbd76.js} +2 -2
- package/dist/chunk-s56t6kzj.js +2 -0
- package/dist/{chunk-w2m4yczv.js → chunk-sd9bze9x.js} +1 -1
- package/dist/{chunk-tecbx0ek.js → chunk-sdapqhj0.js} +1 -1
- package/dist/chunk-se0q0p3v.js +1 -0
- package/dist/chunk-sz5g7eh5.js +1 -0
- package/dist/{chunk-2ff55pvt.js → chunk-tp4yy3a6.js} +3 -3
- package/dist/{chunk-kxwc5wrx.js → chunk-tqg9y2p6.js} +1 -1
- package/dist/{chunk-d1qe06f0.js → chunk-tya95jej.js} +1 -1
- package/dist/{chunk-08z32sky.js → chunk-v1mamd1x.js} +2 -2
- package/dist/{chunk-g4kydkyz.js → chunk-v67st2xb.js} +2 -2
- package/dist/chunk-wemdt9n6.js +6 -0
- package/dist/{chunk-0sx7ak0b.js → chunk-wm896gnx.js} +1 -1
- package/dist/chunk-yjbpfd3b.js +1 -0
- package/dist/{chunk-g5scqxq3.js → chunk-ze1ra6f9.js} +2 -2
- package/dist/{chunk-15fpc0qg.js → chunk-zj32chp7.js} +1 -1
- package/dist/chunk-znrafpad.js +1 -0
- package/dist/chunk-zqjm9yd8.js +1 -0
- package/dist/{chunk-8vqhcx3s.js → chunk-zrgfvc4k.js} +1 -1
- package/dist/web/assets/ChatView-BBYsaZIk.js +63 -0
- package/dist/web/assets/{CodeBlockHighlighter-BM1MZv6w.js → CodeBlockHighlighter-BC17_i4m.js} +1 -1
- package/dist/web/assets/{FilePreview-P77KS9tr.js → FilePreview-DuvfuHLi.js} +1 -1
- package/dist/web/assets/{KanbanBoard-B0c7sE2y.js → KanbanBoard-B-Z7lSaC.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-DHa0FqU0.js → MarkdownRenderer-DF-nYnJu.js} +3 -3
- package/dist/web/assets/{ScrollArea-C6yf2fqq.js → ScrollArea-dipnxnqf.js} +1 -1
- package/dist/web/assets/{SessionHistorySurface-CXYBWqlN.js → SessionHistorySurface-CnMBkiZW.js} +1 -1
- package/dist/web/assets/{SettingsModal-BVjVlENY.js → SettingsModal-DLA1WQ6g.js} +1 -1
- package/dist/web/assets/{Sidebar-DDW9Xs6e.js → Sidebar-tu4OcImk.js} +1 -1
- package/dist/web/assets/{TaskSwitcher-D74_5q1F.js → TaskSwitcher-D2TIUyr3.js} +1 -1
- package/dist/web/assets/{TerminalPanel-DNEKapEi.js → TerminalPanel-CcJVvSnz.js} +1 -1
- package/dist/web/assets/{archive-Ao0WD7pU.js → archive-EoUobrxu.js} +1 -1
- package/dist/web/assets/{arrow-left-a5_iLemp.js → arrow-left-Y8E5lnQ1.js} +1 -1
- package/dist/web/assets/{calendar-clock-BKbdz6Cu.js → calendar-clock-Cl0Spu99.js} +1 -1
- package/dist/web/assets/{chevron-right-8qYRfCj4.js → chevron-right-DmM1dl1s.js} +1 -1
- package/dist/web/assets/{chevrons-up-down-BXNG4GvK.js → chevrons-up-down-DFQNAYac.js} +1 -1
- package/dist/web/assets/{clock-3-DEL1ixyh.js → clock-3-D3dzsSrc.js} +1 -1
- package/dist/web/assets/{copy-Bd5v-KkM.js → copy-BwNmbccC.js} +1 -1
- package/dist/web/assets/{download-CIKvpDBW.js → download-DHzGZhJT.js} +1 -1
- package/dist/web/assets/{external-link-B33h3DQN.js → external-link-Dr_8T3Ah.js} +1 -1
- package/dist/web/assets/{folder-lOczceoh.js → folder-DcgRdL_P.js} +1 -1
- package/dist/web/assets/index-BZZUIkal.js +203 -0
- package/dist/web/assets/{pause-nnvVbgsj.js → pause-DXzNhd_w.js} +1 -1
- package/dist/web/assets/{pencil-_yfoOmUq.js → pencil-CYRCKPnu.js} +1 -1
- package/dist/web/assets/{play-BilJ7SDs.js → play-CfNxuNSd.js} +1 -1
- package/dist/web/assets/{plus-BqqpYKaK.js → plus-DBUPwsji.js} +1 -1
- package/dist/web/assets/{session-events-FPOvcMBw.js → session-events-DTVYDdaH.js} +23 -23
- package/dist/web/assets/{settings-CmJXtYTH.js → settings-K2UJIIf_.js} +1 -1
- package/dist/web/assets/{team-Bb04o2Tb.js → team-BoulGGnJ.js} +1 -1
- package/dist/web/assets/{teamService-B5w9cpsa.js → teamService-Cfm0Cd6e.js} +1 -1
- package/dist/web/assets/{terminal-DOjdChj0.js → terminal-C9ZyLrcq.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-1nreg14s.js +0 -1
- package/dist/chunk-2d3zksr0.js +0 -1
- package/dist/chunk-3kvt23m3.js +0 -1
- package/dist/chunk-4rh40xhc.js +0 -1
- package/dist/chunk-4xr4hz19.js +0 -2
- package/dist/chunk-61yd46c0.js +0 -1
- package/dist/chunk-8774agqd.js +0 -1
- package/dist/chunk-8brb7c6j.js +0 -6
- package/dist/chunk-abpmpyqa.js +0 -1
- package/dist/chunk-ascjys4e.js +0 -2
- package/dist/chunk-bb0z7c3g.js +0 -1
- package/dist/chunk-m9dv5177.js +0 -10
- package/dist/chunk-mwgx87vw.js +0 -1
- package/dist/chunk-ntq4h4jh.js +0 -1
- package/dist/chunk-r324qme7.js +0 -1
- package/dist/chunk-ra6ksfdy.js +0 -1
- package/dist/chunk-tnts2de5.js +0 -1
- package/dist/chunk-w0710yj4.js +0 -1
- package/dist/chunk-we13xwds.js +0 -180
- package/dist/chunk-zp5097qk.js +0 -2
- package/dist/web/assets/ChatView-BlAGPVC-.js +0 -63
- package/dist/web/assets/index-hZ37pkxs.js +0 -203
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownRenderer-DF-nYnJu.js","assets/index-BZZUIkal.js","assets/vendor-react-DofNRwfy.js","assets/vendor-radix-D6QrtXqd.js","assets/session-events-DTVYDdaH.js","assets/index-DC2p1vGD.css","assets/copy-BwNmbccC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as h,j as e}from"./vendor-react-DofNRwfy.js";import{c as Y,u as B,a as f,s as ze,b as mt,d as le,H as $e,P as ht,G as qe,L as _,S as Ge,T as ne,C as be,D as We,e as Je,f as xt,g as Ye,h as Xe,i as Ze,j as I,k as pt,l as ae,B as ft,m as Ne,n as ue,R as xe,F as bt,_ as et,o as vt,p as tt,q as gt,r as st,t as kt,X as at,v as yt,A as Ee,w as jt,x as wt,W as Nt,y as St,z as Ct}from"./index-BZZUIkal.js";import{_ as Me,M as ie,Z as K,a2 as Tt,A as Et,a3 as Mt,Q as At,X as Rt,Y as Ft}from"./session-events-DTVYDdaH.js";import{A as Dt,E as It}from"./external-link-Dr_8T3Ah.js";import{S as $t}from"./ScrollArea-dipnxnqf.js";import{C as rt}from"./copy-BwNmbccC.js";import{C as oe}from"./chevron-right-DmM1dl1s.js";import{A as Ae,a as _t,C as Bt}from"./chevrons-up-down-DFQNAYac.js";import{f as Pt,g as Lt,h as Ut,i as nt}from"./vendor-radix-D6QrtXqd.js";import{P as Ot}from"./pause-DXzNhd_w.js";import{P as Kt}from"./play-CfNxuNSd.js";import{P as it}from"./pencil-CYRCKPnu.js";import{C as Vt}from"./clock-3-D3dzsSrc.js";import{t as U,A as _e}from"./team-BoulGGnJ.js";import{teamService as Be}from"./teamService-Cfm0Cd6e.js";/**
|
|
3
|
+
* @license lucide-react v0.300.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const Ht=Y("Files",[["path",{d:"M15.5 2H8.6c-.4 0-.8.2-1.1.5-.3.3-.5.7-.5 1.1v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8c.4 0 .8-.2 1.1-.5.3-.3.5-.7.5-1.1V6.5L15.5 2z",key:"cennsq"}],["path",{d:"M3 7.6v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8",key:"ms809a"}],["path",{d:"M15 2v5h5",key:"qq6kwv"}]]);/**
|
|
8
|
+
* @license lucide-react v0.300.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const Qt=Y("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
13
|
+
* @license lucide-react v0.300.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const zt=Y("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
18
|
+
* @license lucide-react v0.300.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const qt=Y("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
23
|
+
* @license lucide-react v0.300.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const Gt=Y("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
|
|
28
|
+
* @license lucide-react v0.300.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const Wt=Y("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
33
|
+
* @license lucide-react v0.300.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const Jt=Y("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
38
|
+
* @license lucide-react v0.300.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const Yt=Y("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
43
|
+
* @license lucide-react v0.300.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const Xt=Y("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);function Pe(t){return t.split("/").filter(Boolean).at(-1)||t}function Zt(){const t=B(),s=f(j=>j.sessions),a=f(j=>j.currentSessionRef),r=f(j=>j.historySurfaceSelection),o=f(j=>j.taskDeliveryActions),i=f(j=>j.deliverTask),l=Me(j=>j.openFilePreview),[u,x]=h.useState(!1),c=s.find(j=>ze({sessionId:j.sessionId,projectPath:j.projectPath},a));if(ie(r)||!(c!=null&&c.taskIsolation))return null;const v=c.taskDiffStat,b=c.taskIsolation==="worktree",d=mt(c),y=o[le(d)],p=c.taskDelivery,N=(p==null?void 0:p.status)==="conflicted",m=!!(v&&(v.changedFiles>0||v.commits>0)),S=!["queued","running"].includes(c.taskStatus),g=(p==null?void 0:p.status)==="applied"||(p==null?void 0:p.status)==="discarded",w=b&&m&&S&&!g,n=v?v.additions+v.deletions:0,E=n>0&&v?v.additions/n*100:0,D=j=>{K(f.getState())||i(d,j).catch(()=>{})},F=()=>{K(f.getState())||l({tab:"diff"})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex min-h-10 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]/60 px-3 py-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-muted))] backdrop-blur-sm sm:px-5",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[e.jsx($e,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-ink-faint))]"}),e.jsx("span",{className:"truncate text-[hsl(var(--deck-ink))]",children:Pe(c.taskSourceProjectPath||c.projectPath)})]}),e.jsx("span",{className:"text-[hsl(var(--deck-ink-faint))]/60",children:"/"}),e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[b?e.jsx(ht,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-accent))]"}):e.jsx($e,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:b?"text-[hsl(var(--deck-accent))]":void 0,children:t(b?"artifact.env.isolated":"artifact.env.local")})]}),c.taskWorktreeBranch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[hsl(var(--deck-ink-faint))]/60",children:"/"}),e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 truncate",title:c.taskWorktreeBranch,children:[e.jsx(qe,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-ink-faint))]"}),e.jsx("span",{className:"truncate",children:c.taskWorktreeBranch})]})]})]}),v&&e.jsxs("div",{className:"ml-auto flex max-w-full items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[hsl(var(--deck-ink-muted))]",children:[e.jsx(Ht,{className:"h-3 w-3 text-[hsl(var(--deck-ink-faint))]"}),e.jsx("span",{className:"tabular-nums",children:v.changedFiles})]}),n>0&&e.jsxs("span",{className:"relative hidden h-1.5 w-14 overflow-hidden rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] sm:inline-flex","aria-hidden":"true",children:[e.jsx("span",{className:"h-full bg-[hsl(var(--deck-accent))]",style:{width:`${E}%`}}),e.jsx("span",{className:"h-full bg-red-500/80",style:{width:`${100-E}%`}})]}),e.jsxs("span",{className:"tabular-nums text-[hsl(var(--deck-accent))]",children:["+",v.additions]}),e.jsxs("span",{className:"tabular-nums text-red-600 dark:text-red-400",children:["-",v.deletions]}),v.commits>0&&e.jsx("span",{className:"hidden tabular-nums text-[hsl(var(--deck-ink-faint))] sm:inline",children:t("artifact.commits",{count:v.commits})}),m&&(p==null?void 0:p.status)!=="discarded"&&e.jsx("button",{type:"button",onClick:F,className:"inline-flex items-center gap-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2 py-1 text-[hsl(var(--deck-ink))] transition hover:border-[hsl(var(--deck-accent)/0.55)] hover:text-[hsl(var(--deck-accent))]",children:t("artifact.review")}),w&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",disabled:!!y,onClick:()=>D("apply"),className:"inline-flex items-center gap-1 rounded-md bg-[hsl(var(--deck-accent))] px-2 py-1 font-semibold text-white transition hover:brightness-95 disabled:cursor-wait disabled:opacity-65",children:[y==="apply"?e.jsx(_,{className:"h-3 w-3 animate-spin"}):e.jsx(Ge,{className:"h-3 w-3"}),t(y==="apply"?"artifact.applying":N?"artifact.retryApply":"artifact.apply")]}),e.jsx("button",{type:"button",disabled:!!y,onClick:()=>x(!0),className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[hsl(var(--deck-ink-faint))] transition hover:bg-red-500/10 hover:text-red-600 disabled:cursor-wait disabled:opacity-50 dark:hover:text-red-400","aria-label":t("artifact.discard"),title:t("artifact.discard"),children:y==="discard"?e.jsx(_,{className:"h-3 w-3 animate-spin"}):e.jsx(ne,{className:"h-3 w-3"})})]}),(p==null?void 0:p.status)==="applied"&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-emerald-500/10 px-2 py-1 font-semibold text-emerald-700 dark:text-emerald-300",children:[e.jsx(be,{className:"h-3 w-3"}),t("artifact.applied")]}),(p==null?void 0:p.status)==="discarded"&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-[hsl(var(--deck-surface-2))] px-2 py-1 text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(ne,{className:"h-3 w-3"}),t("artifact.discarded")]})]}),(p==null?void 0:p.status)==="conflicted"&&e.jsxs("div",{className:"flex w-full items-start gap-1.5 border-t border-amber-500/20 pt-1.5 text-amber-700 dark:text-amber-300",role:"alert",children:[e.jsx(Dt,{className:"mt-0.5 h-3 w-3 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 space-y-0.5",children:[e.jsx("span",{className:"block",children:p.message||t("artifact.conflict")}),e.jsx("span",{className:"block text-[hsl(var(--deck-ink-faint))]",children:t("artifact.conflictHint")})]})]})]}),e.jsx(We,{open:u,onOpenChange:x,children:e.jsxs(Je,{className:"w-[calc(100%_-_2rem)] max-w-md border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink))]",children:[e.jsxs(xt,{children:[e.jsx(Ye,{children:t("artifact.discardDialog.title")}),e.jsx(Xe,{className:"text-[hsl(var(--deck-ink-muted))]",children:t("artifact.discardDialog.description",{project:Pe(c.taskSourceProjectPath||c.projectPath),count:(v==null?void 0:v.changedFiles)??0})})]}),e.jsx("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs leading-relaxed text-red-700 dark:text-red-300",children:t("artifact.discardDialog.warning")}),e.jsxs(Ze,{className:"gap-2 sm:space-x-0",children:[e.jsx("button",{type:"button",onClick:()=>x(!1),className:"rounded-md border border-[hsl(var(--deck-border))] px-3 py-2 text-sm hover:bg-[hsl(var(--deck-surface-2))]",children:t("artifact.discardDialog.cancel")}),e.jsxs("button",{type:"button",onClick:()=>{x(!1),D("discard")},className:"inline-flex items-center justify-center gap-1.5 rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white hover:bg-red-700",children:[e.jsx(ne,{className:"h-3.5 w-3.5"}),t("artifact.discardDialog.confirm")]})]})]})})]})}const es=new Set(["completed","stale","failed","aborted","interrupted"]),ts={completed:"chat.review.status.completed",stale:"chat.review.status.stale",failed:"chat.review.status.failed",aborted:"chat.review.status.aborted",interrupted:"chat.review.status.interrupted"},ss={completed:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 border-emerald-500/20",stale:"bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/20",failed:"bg-red-500/10 text-red-700 dark:text-red-300 border-red-500/20",aborted:"bg-zinc-500/10 text-zinc-700 dark:text-zinc-300 border-zinc-500/20",interrupted:"bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/20"};function pe(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function as(t){const s=pe(t),a=pe(s==null?void 0:s.codeLocation),r=s==null?void 0:s.priority,o=s==null?void 0:s.confidenceScore,i=a==null?void 0:a.lineStart,l=a==null?void 0:a.lineEnd;if(!(typeof(s==null?void 0:s.title)!="string"||typeof s.body!="string"||r!==0&&r!==1&&r!==2&&r!==3||typeof o!="number"||!Number.isFinite(o)||typeof(a==null?void 0:a.path)!="string"||!Number.isInteger(i)||!Number.isInteger(l)))return{title:s.title,body:s.body,priority:r,confidenceScore:o,codeLocation:{path:a.path,lineStart:i,lineEnd:l}}}function rs(t){const s=pe(t),a=pe(s==null?void 0:s.target);if((s==null?void 0:s.phase)!=="completed"||typeof s.status!="string"||!es.has(s.status)||typeof(a==null?void 0:a.label)!="string"||a.kind!=="uncommitted"&&a.kind!=="base"&&a.kind!=="commit"||typeof s.overallExplanation!="string"||!Array.isArray(s.findings))return;const r=s.findings.map(as);if(!r.some(o=>o===void 0))return{status:s.status,target:{kind:a.kind,label:a.label,...typeof a.reference=="string"?{reference:a.reference}:{}},overallExplanation:s.overallExplanation,findings:r,...typeof s.error=="string"?{error:s.error}:{}}}function ns(t){const{path:s,lineStart:a,lineEnd:r}=t.codeLocation;return a===r?`${s}:L${a}`:`${s}:L${a}-${r}`}function is({report:t}){const s=B(),a=t.target.kind==="uncommitted"?s("chat.review.target.uncommitted"):t.target.kind==="base"?s("chat.review.target.base",{ref:t.target.reference??t.target.label}):s("chat.review.target.commit",{ref:t.target.reference??t.target.label});return e.jsxs("section",{"data-code-review-report":!0,className:"overflow-hidden rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]",children:[e.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface-2))]/60 px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[13px] font-semibold text-[hsl(var(--deck-ink))]",children:s("chat.review.title")}),e.jsxs("p",{className:"mt-0.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[s("chat.review.target"),": ",a]})]}),e.jsxs("span",{className:I("rounded-full border px-2.5 py-1 font-mono text-[10.5px] font-medium",ss[t.status]),children:[s("chat.review.status"),": ",s(ts[t.status])]})]}),e.jsxs("div",{className:"space-y-4 px-4 py-3.5",children:[e.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-6 text-[hsl(var(--deck-ink-muted))]",children:t.overallExplanation}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("h4",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:s("chat.review.findings")}),e.jsx("span",{className:"font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:t.findings.length})]}),t.findings.length===0?e.jsx("div",{className:"rounded-lg bg-[hsl(var(--deck-surface-2))] px-3 py-2.5 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:s("chat.review.noFindings")}):e.jsx("ol",{className:"space-y-2",children:t.findings.map((r,o)=>e.jsxs("li",{className:"rounded-lg border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-3 py-2.5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsx("h5",{className:"text-[12.5px] font-medium leading-5 text-[hsl(var(--deck-ink))]",children:r.title}),e.jsx("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:s("chat.review.confidence",{value:r.confidenceScore.toFixed(2)})})]}),e.jsx("code",{className:"mt-1 block text-[10.5px] text-[hsl(var(--deck-accent))]",children:ns(r)}),e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-[12px] leading-5 text-[hsl(var(--deck-ink-muted))]",children:r.body})]},`${r.codeLocation.path}:${r.codeLocation.lineStart}:${o}`))})]}),t.error&&e.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 px-3 py-2 text-[11px] text-red-700 dark:text-red-300",children:[e.jsxs("span",{className:"font-medium",children:[s("chat.review.error"),":"]})," ",t.error]})]})]})}function os({elicitation:t,messageId:s}){const a=B(),r=f(g=>g.currentSessionRef),o=f(g=>g.setElicitation),[i,l]=h.useState(()=>ls(t.details.fields??[])),[u,x]=h.useState(()=>ds(t.details.fields??[])),[c,v]=h.useState(!1),[b,d]=h.useState(),y=t.details.fields??[],p=h.useMemo(()=>y.every(g=>{var n;if(!g.required)return!0;if(ve(g))return!!((n=u[g.name])!=null&&n.trim()||g.defaultValue!==void 0);const w=i[g.name]??g.defaultValue;return Array.isArray(w)?w.length>0:w!==void 0}),[y,u,i]);if(t.status!=="pending")return e.jsx("div",{className:"rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-3 py-2 font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:a(t.status==="cancelled"?"interaction.elicitation.cancelled":"interaction.elicitation.responded")});const N=async(g,w)=>{if(!K(f.getState())&&!(!r||c)){v(!0),d(void 0);try{await ae.respondToElicitation(r,t.toolCallId,{action:g,...w?{content:w}:{}}),o(s,{...t,status:"responded"})}catch(n){d(n instanceof Error?n.message:a("interaction.elicitation.failed"))}finally{v(!1)}}},m=async()=>{try{await N("accept",us(y,i,u))}catch(g){d(g instanceof Error?g.message:String(g))}},S=()=>{if(K(f.getState()))return;const g=t.details.url;if(!g){d("MCP URL is unavailable");return}if(!window.open(g,"_blank","noopener,noreferrer")){d("The browser blocked the external window");return}N("accept")};return e.jsxs("div",{"data-pending-interaction":"elicitation",tabIndex:-1,role:"alert",className:"space-y-4 rounded-lg border border-amber-300/70 bg-amber-50/70 p-4 outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-800/70 dark:bg-amber-950/25",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(pt,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{className:"font-mono text-[12px] font-semibold text-[hsl(var(--deck-ink))]",children:[a("interaction.elicitation.title")," · ",t.details.serverName]}),e.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t.details.message}),e.jsx("div",{className:"font-mono text-[11px] text-amber-700 dark:text-amber-300",children:a("interaction.elicitation.warning")})]})]}),t.details.mode==="url"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] p-3 font-mono text-[11px]",children:[e.jsx("div",{className:"text-[hsl(var(--deck-ink-muted))]",children:t.details.domain}),e.jsx("div",{className:"mt-1 break-all text-[hsl(var(--deck-ink))]",children:t.details.url})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(re,{onClick:S,disabled:c,primary:!0,label:a("interaction.elicitation.open"),icon:e.jsx(It,{className:"h-3.5 w-3.5"})}),e.jsx(re,{onClick:()=>void N("decline"),disabled:c,label:a("interaction.elicitation.decline")}),e.jsx(re,{onClick:()=>void N("cancel"),disabled:c,label:a("interaction.elicitation.cancel")})]})]}):e.jsxs("div",{className:"space-y-4",children:[y.map(g=>e.jsx(cs,{field:g,value:i[g.name],rawValue:u[g.name]??"",onValueChange:w=>l(n=>({...n,[g.name]:w})),onRawChange:w=>x(n=>({...n,[g.name]:w}))},g.name)),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(re,{onClick:()=>void m(),disabled:c||!p,primary:!0,label:a("interaction.elicitation.submit"),icon:c?e.jsx(_,{className:"h-3.5 w-3.5 animate-spin"}):null}),e.jsx(re,{onClick:()=>void N("decline"),disabled:c,label:a("interaction.elicitation.decline")}),e.jsx(re,{onClick:()=>void N("cancel"),disabled:c,label:a("interaction.elicitation.cancel")})]})]}),b&&e.jsx("div",{className:"rounded-md border border-red-300/70 bg-red-50 px-2.5 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300",children:b})]})}function cs({field:t,value:s,rawValue:a,onValueChange:r,onRawChange:o}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{htmlFor:`mcp-elicitation-${t.name}`,className:"block font-mono text-[12px] font-medium text-[hsl(var(--deck-ink))]",children:[t.title,t.required?" *":""]}),t.description&&e.jsx("div",{className:"font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:t.description}),t.type==="select"||t.type==="multi-select"||t.type==="boolean"?e.jsx("div",{id:`mcp-elicitation-${t.name}`,className:"flex flex-wrap gap-2",children:ms(t).map(i=>{const l=Array.isArray(s)?s.includes(i.value):s===i.typedValue;return e.jsx("button",{type:"button","aria-pressed":l,onClick:()=>{if(t.type==="multi-select"){const u=Array.isArray(s)?s:[];r(u.includes(i.value)?u.filter(x=>x!==i.value):[...u,i.value])}else r(i.typedValue)},className:I("rounded-md border px-3 py-2 font-mono text-[12px] transition-colors",l?"border-emerald-500 bg-emerald-50 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-200":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:i.label},i.value)})}):e.jsx("input",{id:`mcp-elicitation-${t.name}`,type:hs(t),value:a,onChange:i=>o(i.target.value),min:t.minimum,max:t.maximum,minLength:t.minLength,maxLength:t.maxLength,required:t.required,placeholder:t.defaultValue===void 0?t.required?"Required":"Optional":String(t.defaultValue),className:"w-full rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-3 py-2 font-mono text-[12px] text-[hsl(var(--deck-ink))] outline-none transition-colors focus:border-amber-500 focus:ring-1 focus:ring-amber-500"})]})}function re({onClick:t,disabled:s,primary:a=!1,label:r,icon:o}){return e.jsxs("button",{type:"button",onClick:t,disabled:s,className:I("inline-flex min-h-8 items-center gap-1.5 rounded-md px-3 py-1.5 font-mono text-[12px] transition-colors disabled:cursor-wait disabled:opacity-50",a?"bg-amber-600 text-white hover:bg-amber-700":"border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:[o,r]})}function ls(t){return Object.fromEntries(t.filter(s=>!ve(s)&&s.defaultValue!==void 0).map(s=>[s.name,Array.isArray(s.defaultValue)?[...s.defaultValue]:s.defaultValue]))}function ds(t){return Object.fromEntries(t.filter(s=>ve(s)&&s.defaultValue!==void 0).map(s=>[s.name,String(s.defaultValue)]))}function us(t,s,a){var o;const r={};for(const i of t){if(ve(i)){const u=((o=a[i.name])==null?void 0:o.trim())??"";if(!u){if(i.defaultValue!==void 0)r[i.name]=i.defaultValue;else if(i.required)throw new Error(`${i.title} is required`);continue}if(i.type==="number"||i.type==="integer"){const x=Number(u);if(!Number.isFinite(x))throw new Error(`${i.title} must be a finite number`);if(i.type==="integer"&&!Number.isSafeInteger(x))throw new Error(`${i.title} must be a safe integer`);r[i.name]=x}else r[i.name]=u;continue}const l=s[i.name]??i.defaultValue;if(l===void 0){if(i.required)throw new Error(`${i.title} is required`);continue}if(Array.isArray(l)){if(i.minItems!==void 0&&l.length<i.minItems)throw new Error(`${i.title} requires at least ${i.minItems} choices`);if(i.maxItems!==void 0&&l.length>i.maxItems)throw new Error(`${i.title} allows at most ${i.maxItems} choices`)}r[i.name]=l}return r}function ms(t){return t.type==="boolean"?[{value:"true",label:"Yes",typedValue:!0},{value:"false",label:"No",typedValue:!1}]:(t.options??[]).map(s=>({...s,typedValue:s.value}))}function ve(t){return t.type==="string"||t.type==="number"||t.type==="integer"}function hs(t){return t.type==="number"||t.type==="integer"?"number":t.format==="email"?"email":t.format==="uri"?"url":t.format==="date"?"date":t.format==="date-time"?"datetime-local":"text"}function xs(t){if(!t||typeof t!="object"||Array.isArray(t))return;const s=t;if(!(!s.output||typeof s.output!="object"||Array.isArray(s.output)))return{output:s.output,...typeof s.schemaDigest=="string"?{schemaDigest:s.schemaDigest}:{}}}function ps({report:t}){const s=B(),[a,r]=h.useState(!1),o=JSON.stringify(t.output,null,2),i=async()=>{try{await navigator.clipboard.writeText(o),r(!0),window.setTimeout(()=>r(!1),1400)}catch{}};return e.jsxs("section",{"data-structured-output":!0,className:"overflow-hidden rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]",children:[e.jsxs("header",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(ft,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),e.jsx("span",{className:"font-mono text-[11px] font-semibold text-[hsl(var(--deck-ink))]",children:s("chat.structuredOutput.title")}),t.schemaDigest&&e.jsxs("span",{title:t.schemaDigest,className:"truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:["sha256:",t.schemaDigest.slice(0,10)]})]}),e.jsx("button",{type:"button",onClick:i,"aria-label":s("chat.structuredOutput.copy"),title:s("chat.structuredOutput.copy"),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a?e.jsx(be,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-accent))]"}):e.jsx(rt,{className:"h-3.5 w-3.5"})})]}),e.jsx("pre",{className:"max-h-[440px] overflow-auto whitespace-pre p-3 font-mono text-[11px] leading-5 text-[hsl(var(--deck-ink))]",children:o})]})}const fs=h.lazy(()=>et(()=>import("./MarkdownRenderer-DF-nYnJu.js").then(t=>t.M),__vite__mapDeps([0,1,2,3,4,5,6])).then(t=>({default:t.MarkdownRenderer})));function Le({text:t,label:s}){const[a,r]=h.useState(!1);if(!t.trim())return null;const o=async()=>{try{await navigator.clipboard.writeText(t),r(!0),window.setTimeout(()=>r(!1),1400)}catch{}};return e.jsx("button",{type:"button","aria-label":s,title:s,onClick:o,className:"flex h-6 w-6 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a?e.jsx(be,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-accent))]"}):e.jsx(rt,{className:"h-3.5 w-3.5"})})}function bs(){return e.jsx("div",{className:"flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] shadow-[0_1px_0_hsl(var(--deck-hairline))]",children:e.jsx(Ne,{size:20,pulse:!1})})}function vs(){return e.jsx("div",{className:"flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-full border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas-veil))]",children:e.jsx("span",{className:"font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:"U"})})}function Ue(t){let s=t;return s=s.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g,""),s=s.replace(/<file path="[^"]*">[\s\S]*?<\/file>/g,""),s=s.replace(/<attached_files>[\s\S]*?<\/attached_files>/g,""),s=s.trim(),s}function gs(t){if(typeof t=="string")return{text:Ue(t),images:[]};const s=t.filter(r=>r.type==="text").map(r=>r.text).join(`
|
|
48
|
+
`),a=t.filter(r=>r.type==="image_url").map(r=>r.image_url.url);return{text:Ue(s),images:a}}function Re(t){return typeof t=="string"?t:t.filter(s=>s.type==="text").map(s=>s.text).join(`
|
|
49
|
+
`)}function ks(t){const s=t.agentContent;return s?Tt(s):Re(t.content)}function Oe({content:t,syntaxHighlight:s=!0}){return e.jsx(h.Suspense,{fallback:e.jsx("pre",{className:"text-[14px] text-[hsl(var(--deck-ink))] font-mono whitespace-pre-wrap",children:t}),children:e.jsx(fs,{content:t,syntaxHighlight:s})})}function Fe({status:t}){if(!t)return null;const s={running:"bg-[#FEF3C7] text-[#92400E] dark:bg-[#F59E0B]/20 dark:text-[#FBBF24]",success:"bg-[#DCFCE7] text-[#15803D] dark:bg-[#22C55E]/20 dark:text-[#22C55E]",error:"bg-[#FEE2E2] text-[#b91c1c] dark:bg-[#EF4444]/20 dark:text-[#fca5a5]",pending:"bg-[#E5E7EB] text-[#6B7280] dark:bg-[#27272a] dark:text-[#a1a1aa]",info:"bg-[#DBEAFE] text-[#1D4ED8] dark:bg-[#3B82F6]/20 dark:text-[#60A5FA]"},a={running:"Running",success:"Success",error:"Error",pending:"Pending",info:"Info"};return e.jsx("span",{className:I("text-[11px] px-2 py-0.5 rounded-full font-mono",s[t]),children:a[t]})}function ys(t){if(!t)return"";if(typeof t=="string")try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}return JSON.stringify(t,null,2)}const Ke=500;function ot(t,s){if(t.length<=s)return t;let a=Math.max(0,s);return a>0&&/[\uD800-\uDBFF]/.test(t.charAt(a-1))&&(a-=1),t.slice(0,a)}function Ve(t,s){if(t.length<=s)return t;let a=Math.max(0,t.length-s);return/[\uDC00-\uDFFF]/.test(t.charAt(a))&&(a+=1),t.slice(a)}function ke(t,s){if(t.length<=s)return t;if(s<=0)return"";const a=`
|
|
50
|
+
... (display clipped) ...
|
|
51
|
+
`,r=s-a.length;if(r<=0)return Ve(t,s);const o=Math.floor(r/3);return`${ot(t,o)}${a}${Ve(t,r-o)}`}function js(t){const s=t.split(`
|
|
52
|
+
`),a=s.at(-1),r=a!=null&&a.startsWith("Output truncated")?a:void 0,o=r?s.slice(0,-1).join(`
|
|
53
|
+
`):t,i=r?`
|
|
54
|
+
${r}`:"",l=Math.max(0,Ke-i.length),x=o.indexOf(`
|
|
55
|
+
stderr:
|
|
56
|
+
`);let c;if(x>=0&&o.includes(`
|
|
57
|
+
stdout:
|
|
58
|
+
`)){const v=o.slice(0,x),b=o.slice(x+1),d=Math.max(0,l-1),y=Math.floor(d/2);c=`${ke(v,y)}
|
|
59
|
+
${ke(b,d-y)}`}else c=ke(o,l);return{body:ot(c,l),...r?{notice:r}:{},truncated:!!r||t.length>Ke}}function ws({tool:t}){const[s,a]=h.useState(!1),r=ys(t.arguments),o=t.output?js(t.output):void 0;return e.jsxs("div",{"data-tool-name":t.toolName,"data-tool-status":t.status,"data-tool-truncated":o!=null&&o.truncated?"true":"false",className:"bg-white dark:bg-[#18181b] border border-[hsl(var(--deck-border))] rounded-lg overflow-hidden",children:[e.jsxs("button",{type:"button","aria-expanded":s,"data-tool-call-id":t.toolCallId,onClick:()=>a(i=>!i),className:"w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--deck-surface-2))] hover:bg-[hsl(var(--deck-surface))] transition-colors",children:[e.jsxs("div",{className:"flex gap-2 items-center min-w-0",children:[s?e.jsx(ue,{className:"h-4 w-4 text-[hsl(var(--deck-ink-faint))] shrink-0"}):e.jsx(oe,{className:"h-4 w-4 text-[hsl(var(--deck-ink-faint))] shrink-0"}),e.jsx("span",{className:"text-[12px] text-[hsl(var(--deck-ink))] font-mono shrink-0",children:t.toolName}),t.summary&&e.jsx("span",{className:"text-[11px] text-[hsl(var(--deck-ink-muted))] font-mono truncate",children:t.summary})]}),e.jsx(Fe,{status:t.status})]}),t.status==="running"&&t.progressMessage&&e.jsxs("div",{className:"border-t border-[hsl(var(--deck-border))] px-3 py-2 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 font-mono text-[10px] text-[hsl(var(--deck-ink-muted))]",children:[e.jsx("span",{className:"truncate",children:t.progressMessage}),t.progressTotal!==void 0&&t.progress!==void 0&&e.jsxs("span",{className:"shrink-0",children:[Math.max(0,Math.min(100,Math.round(t.progress/t.progressTotal*100))),"%"]})]}),t.progressTotal!==void 0&&t.progress!==void 0&&e.jsx("div",{role:"progressbar","aria-label":`${t.toolName} progress`,"aria-valuemin":0,"aria-valuemax":t.progressTotal,"aria-valuenow":Math.min(t.progress,t.progressTotal),className:"h-1 overflow-hidden rounded-full bg-[hsl(var(--deck-border))]",children:e.jsx("div",{className:"h-full rounded-full bg-amber-500 transition-[width] duration-150",style:{width:`${Math.max(0,Math.min(100,t.progress/t.progressTotal*100))}%`}})})]}),s&&e.jsxs("div",{className:"px-3 py-2 space-y-2 border-t border-[hsl(var(--deck-border))]",children:[r&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] text-[hsl(var(--deck-ink-muted))] font-mono",children:"Arguments"}),e.jsx("pre",{className:"text-[11px] text-[hsl(var(--deck-ink))] bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-md p-2 overflow-x-auto whitespace-pre-wrap font-mono max-h-[120px] overflow-y-auto",children:r})]}),o&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] text-[hsl(var(--deck-ink-muted))] font-mono",children:"Output"}),e.jsxs("pre",{"data-tool-output":!0,className:"text-[11px] text-[hsl(var(--deck-ink))] bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-md p-2 overflow-x-auto whitespace-pre-wrap font-mono max-h-[120px] overflow-y-auto",children:[o.body,o.notice&&e.jsxs(e.Fragment,{children:[`
|
|
60
|
+
`,e.jsx("span",{"data-tool-truncation-notice":!0,children:o.notice})]})]})]})]})]})}function ct({toolCalls:t}){return t.length===0?null:e.jsx("div",{className:"space-y-2",children:t.map(s=>e.jsx(ws,{tool:s},s.toolCallId))})}function Ns({toolCalls:t,toolCallIds:s}){const a=B(),[r,o]=h.useState(!1),i=h.useMemo(()=>new Map(t.map(b=>[b.toolCallId,b])),[t]),l=s.flatMap(b=>{const d=i.get(b);return d?[d]:[]});if(l.length===0)return null;const u=l.filter(b=>b.status==="running").length,x=l.filter(b=>b.status==="error").length,c=[...l].reverse().find(b=>b.status==="running"&&!!b.progressMessage),v=u>0?a(l.length===1?"chat.timeline.tools.runningOne":"chat.timeline.tools.running",{count:l.length}):x>0?a(l.length===1?"chat.timeline.tools.completedOneWithError":"chat.timeline.tools.completedWithErrors",{count:l.length,errors:x}):a(l.length===1?"chat.timeline.tools.completedOne":"chat.timeline.tools.completed",{count:l.length});return e.jsxs("div",{"data-agent-tool-group":!0,className:"py-0.5",children:[e.jsxs("button",{type:"button","aria-expanded":r,onClick:()=>o(b=>!b),className:"group flex min-h-7 w-full items-center gap-1.5 rounded-md px-1.5 text-left font-mono text-[11.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))]/65 hover:text-[hsl(var(--deck-ink-muted))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[r?e.jsx(ue,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(oe,{className:"h-3.5 w-3.5 shrink-0"}),u>0&&e.jsx(_,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),e.jsx("span",{children:v}),(c==null?void 0:c.progressMessage)&&e.jsxs("span",{className:"min-w-0 truncate text-[10.5px] text-[hsl(var(--deck-ink-muted))]",children:[c.progressMessage,c.progress!==void 0&&c.progressTotal!==void 0&&` · ${Math.max(0,Math.min(100,Math.round(c.progress/c.progressTotal*100)))}%`]})]}),(c==null?void 0:c.progress)!==void 0&&c.progressTotal!==void 0&&e.jsx("div",{role:"progressbar","aria-label":`${c.toolName} progress`,"aria-valuemin":0,"aria-valuemax":c.progressTotal,"aria-valuenow":Math.min(c.progress,c.progressTotal),className:"mx-1.5 h-0.5 overflow-hidden rounded-full bg-[hsl(var(--deck-border))]",children:e.jsx("div",{className:"h-full rounded-full bg-amber-500 transition-[width] duration-150",style:{width:`${Math.max(0,Math.min(100,c.progress/c.progressTotal*100))}%`}})}),r&&e.jsx("div",{"data-agent-tool-group-details":!0,className:"mt-2 space-y-2 pl-1",children:e.jsx(ct,{toolCalls:l})})]})}function Ss({content:t}){const s=B(),[a,r]=h.useState(!1);return t?e.jsxs("div",{"data-agent-thinking":!0,className:"py-0.5",children:[e.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>r(o=>!o),className:"flex min-h-7 w-full items-center gap-1.5 rounded-md px-1.5 text-left font-mono text-[11.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))]/65 hover:text-[hsl(var(--deck-ink-muted))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a?e.jsx(ue,{className:"h-4 w-4 text-[hsl(var(--deck-ink-faint))]"}):e.jsx(oe,{className:"h-4 w-4 text-[hsl(var(--deck-ink-faint))]"}),e.jsx("span",{children:s("chat.timeline.thinking")})]}),a&&e.jsx("div",{className:"ml-1 mt-1 border-l border-[hsl(var(--deck-border))] py-1 pl-3",children:e.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] leading-5 text-[hsl(var(--deck-ink-muted))]",children:t})})]}):null}function Cs({tasks:t}){if(t.length===0)return null;const s=t.filter(r=>r.status==="completed").length,a=s===t.length;return e.jsx("div",{className:"bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-lg px-3 py-2",children:e.jsx("div",{className:"flex gap-2 items-center",children:e.jsx("span",{className:"text-[12px] text-[hsl(var(--deck-ink-muted))] font-mono",children:a?"✓ All tasks done":`Tasks: ${s}/${t.length}`})})})}function Ts({toolCalls:t}){const s=Me(i=>i.openFilePreview),a=f(i=>ie(i.historySurfaceSelection)),r=h.useMemo(()=>{const i=new Map,l=["Write","SearchReplace","Edit","ApplyPatch"];for(const u of t){if(u.status!=="success")continue;const x=u.metadata;if(u.toolName==="ApplyPatch"&&Array.isArray(x==null?void 0:x.changes)){for(const v of x.changes)v&&typeof v=="object"&&"path"in v&&typeof v.path=="string"&&i.set(v.path,{path:v.path,toolName:u.toolName});continue}const c=x==null?void 0:x.file_path;c&&l.includes(u.toolName)&&i.set(c,{path:c,toolName:u.toolName})}return Array.from(i.values())},[t]);if(a||r.length===0)return null;const o=i=>{K(f.getState())||s({tab:"diff",targetPath:i})};return e.jsxs("div",{className:"bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-lg px-3 py-2",children:[e.jsxs("div",{className:"text-[11px] text-[hsl(var(--deck-ink-muted))] font-mono mb-1.5",children:["Changed files (",r.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(({path:i})=>{const l=i.split("/").pop()||i;return e.jsxs("button",{onClick:()=>o(i),className:"flex items-center gap-1 px-2 py-1 text-[11px] font-mono bg-[#E5E7EB] dark:bg-[#27272a] text-[hsl(var(--deck-ink))] rounded hover:bg-[#D1D5DB] dark:hover:bg-[#3f3f46] transition-colors",title:i,children:[e.jsx(bt,{className:"w-3 h-3"}),l]},i)})})]})}function Es({subagent:t}){var Q,X,J,ee;const s=B(),[a,r]=h.useState(null),[o,i]=h.useState(!1),[l,u]=h.useState(null),[x,c]=h.useState(!1),[v,b]=h.useState(""),[d,y]=h.useState(!1),[p,N]=h.useState(null),[m,S]=h.useState(null),[g,w]=h.useState(null),n=f(A=>A.currentSessionRef),E=f(A=>A.isStreaming),D=f(A=>A.isTemporarySession),F=f(A=>ie(A.historySurfaceSelection));if(!t)return null;const j=t.status==="running",O=a!==null?a:j,G=t.toolCalls||l||[],C=t.output||t.thinking||G.length>0||t.sessionId,T=m&&m.status!=="running"?m:g,M=(T==null?void 0:T.id)??t.sessionId,P=((Q=T==null?void 0:T.restartRecovery)==null?void 0:Q.outcome)==="failed",L=!j&&!E&&!D&&!F&&!P&&(m==null?void 0:m.status)!=="running"&&!!(M&&n);h.useEffect(()=>{if(F||!O||j||!t.sessionId||!(n!=null&&n.projectPath)||l!==null||t.toolCalls&&t.toolCalls.length>0)return;let A=!0;return i(!0),ae.getMessages({sessionId:t.sessionId,projectPath:n.projectPath}).then(z=>{var H,$;if(!A)return;const q=At(z),V=new Map;for(const W of q)if(($=(H=W.agentContent)==null?void 0:H.toolCalls)!=null&&$.length)for(const R of W.agentContent.toolCalls)V.has(R.toolCallId)||V.set(R.toolCallId,R);u(Array.from(V.values()))}).finally(()=>{A&&i(!1)}),()=>{A=!1}},[O,F,j,t.sessionId,t.toolCalls,l,n==null?void 0:n.projectPath]),h.useEffect(()=>{if(F||!t.sessionId||!n)return;let A=!0;const z=t.rootAgentId??t.sessionId,q=t.resumeDepth??0;return ae.listSubagents(n).then(V=>{if(!A)return;w(V.find($=>$.id===t.sessionId)??null);const H=V.filter($=>$.id!==t.sessionId&&$.rootAgentId===z&&$.resumeDepth>q).sort(($,W)=>W.resumeDepth-$.resumeDepth||W.lastActiveAt-$.lastActiveAt)[0];H&&S(H)}).catch(()=>{}),()=>{A=!1}},[n==null?void 0:n.sessionId,n==null?void 0:n.projectPath,F,t.sessionId,t.rootAgentId,t.resumeDepth]),h.useEffect(()=>{if(F||!m||m.status!=="running"||!n)return;let A=!0;const z=async()=>{try{const H=(await ae.listSubagents(n)).find($=>$.id===m.id);A&&H&&S(H)}catch{}},q=window.setInterval(()=>{z()},1e3);return()=>{A=!1,window.clearInterval(q)}},[n,F,m==null?void 0:m.id,m==null?void 0:m.status]);const Z=async()=>{if(!K(f.getState())&&!(!n||!M||!v.trim()||d)){y(!0),N(null);try{const A=await ae.resumeSubagent(n,M,v.trim());S(A.session),b(""),c(!1),r(!0)}catch(A){N(A instanceof Error?A.message:s("chat.subagent.resumeFailed"))}finally{y(!1)}}};return e.jsxs("div",{"data-subagent-id":t.id,"data-subagent-session-id":t.sessionId,className:"bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-lg px-3 py-2",children:[e.jsxs("button",{type:"button",onClick:()=>r(!O),className:"flex gap-2 justify-between items-center w-full transition-opacity cursor-pointer hover:opacity-80",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[j&&e.jsx(_,{className:"h-3 w-3 animate-spin text-[hsl(var(--deck-ink-muted))]"}),e.jsxs("span",{className:"text-[12px] text-[hsl(var(--deck-ink-muted))] font-mono",children:[t.type,": ",t.description]}),e.jsx(Fe,{status:t.status==="completed"?"success":t.status==="failed"?"error":"running"}),t.type==="verification"&&t.verificationVerdict&&e.jsx("span",{"data-verification-verdict":t.verificationVerdict,className:I("rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",t.verificationVerdict==="pass"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":t.verificationVerdict==="fail"?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-amber-500/10 text-amber-600 dark:text-amber-400"),children:t.verificationVerdict}),t.resumedFrom&&e.jsx("span",{className:"rounded bg-[#EDE9FE] px-1.5 py-0.5 text-[10px] font-mono text-[#6D28D9] dark:bg-[#2E1065] dark:text-[#C4B5FD]",title:s("chat.subagent.resumedFromTitle",{id:t.resumedFrom}),children:s("chat.subagent.resumedDepth",{depth:t.resumeDepth??1})})]}),C&&e.jsx(ue,{className:I("h-3.5 w-3.5 text-[hsl(var(--deck-ink-muted))] transition-transform",O&&"rotate-180")})]}),!O&&!j&&t.output&&e.jsx("div",{"data-subagent-output-summary":!0,className:"mt-2 max-h-10 overflow-hidden whitespace-pre-wrap break-words font-mono text-[11px] text-[hsl(var(--deck-ink))]",children:t.output}),O&&e.jsxs("div",{className:"mt-2 space-y-2",children:[(t.output||t.thinking)&&e.jsxs(e.Fragment,{children:[t.output&&e.jsx("pre",{className:"text-[11px] text-[hsl(var(--deck-ink))] bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-md p-2 overflow-x-auto whitespace-pre-wrap font-mono max-h-[160px] overflow-y-auto",children:t.output}),t.thinking&&e.jsx("pre",{className:"text-[11px] text-[hsl(var(--deck-ink-muted))] bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-md p-2 overflow-x-auto whitespace-pre-wrap font-mono max-h-[120px] overflow-y-auto",children:t.thinking})]}),o&&e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[hsl(var(--deck-ink-muted))] font-mono",children:[e.jsx(_,{className:"w-3 h-3 animate-spin"}),s("chat.subagent.loadingLogs")]}),!o&&G.length>0&&e.jsx(ct,{toolCalls:G}),m&&e.jsxs("div",{className:"rounded-md border border-[#DDD6FE] bg-[#F5F3FF] p-2 text-[11px] font-mono text-[#5B21B6] dark:border-[#4C1D95] dark:bg-[#1E1B4B] dark:text-[#C4B5FD]",children:[e.jsx("div",{children:s("chat.subagent.resumedAs",{id:m.id,status:m.status,depth:m.resumeDepth??1})}),(((X=m.result)==null?void 0:X.message)||((J=m.result)==null?void 0:J.error))&&e.jsx("div",{className:"mt-1 whitespace-pre-wrap text-[hsl(var(--deck-ink))]",children:m.result.message||m.result.error})]}),P&&((ee=T==null?void 0:T.result)==null?void 0:ee.error)&&e.jsx("div",{role:"alert",className:"text-[11px] text-red-600",children:T.result.error}),L&&e.jsxs("div",{className:"space-y-2",children:[x?e.jsxs("div",{className:"space-y-2 rounded-md border border-[#E5E7EB] bg-white p-2 dark:border-[#27272a] dark:bg-[#111113]",children:[e.jsx("textarea",{"aria-label":s("chat.subagent.followUpAria"),value:v,onChange:A=>b(A.target.value),placeholder:s("chat.subagent.followUpPlaceholder"),rows:3,className:"w-full resize-y rounded border border-[#D1D5DB] bg-white p-2 text-[11px] text-[#111827] outline-none focus:border-[#8B5CF6] dark:border-[#3f3f46] dark:bg-[#18181b] dark:text-[#f4f4f5]"}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:()=>{c(!1),N(null)},className:"rounded px-2 py-1 text-[11px] text-[#6B7280] hover:bg-[#F3F4F6] dark:hover:bg-[#27272a]",children:s("chat.subagent.cancel")}),e.jsxs("button",{type:"button",onClick:()=>void Z(),disabled:!v.trim()||d,className:"flex items-center gap-1 rounded bg-[#7C3AED] px-2 py-1 text-[11px] font-medium text-white disabled:opacity-50",children:[d&&e.jsx(_,{className:"w-3 h-3 animate-spin"}),s("chat.subagent.resumeAgent")]})]})]}):e.jsxs("button",{type:"button","aria-label":s("chat.subagent.resumeAria"),onClick:()=>c(!0),className:"flex items-center gap-1.5 rounded-md border border-[#D1D5DB] px-2 py-1 text-[11px] font-medium text-[#374151] transition-colors hover:bg-[#F3F4F6] dark:border-[#3f3f46] dark:text-[#d4d4d8] dark:hover:bg-[#27272a]",children:[e.jsx(xe,{className:"w-3 h-3"}),s("chat.subagent.resume")]}),p&&e.jsx("div",{role:"alert",className:"text-[11px] text-red-600",children:p})]})]})]})}function Ms({confirmation:t,messageId:s}){const a=B(),[r,o]=h.useState(!1),[i,l]=h.useState(null),u=f(v=>v.currentSessionRef),x=f(v=>v.setConfirmation);if(!t)return null;const c=async(v,b)=>{if(!K(f.getState())&&!(!u||r)){o(!0),l(null);try{await ae.respondPermission(u,t.toolCallId,{approved:v,scope:b}),x(s,{...t,status:v?"approved":"denied"})}catch(d){l(d instanceof Error?d.message:a("interaction.permission.failed"))}finally{o(!1)}}};return t.status!=="pending"?null:e.jsxs("div",{"data-pending-interaction":"permission",tabIndex:-1,role:"alert",className:"space-y-3 rounded-lg border border-amber-300/70 bg-amber-50/70 p-4 outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-800/70 dark:bg-amber-950/25",children:[e.jsx("div",{className:"text-[13px] text-[hsl(var(--deck-ink))] font-mono",children:a("interaction.permission.title",{tool:t.toolName})}),e.jsx("div",{className:"text-[12px] text-[hsl(var(--deck-ink-muted))] font-mono",children:t.description}),t.diff&&e.jsx("pre",{className:"text-[11px] text-[hsl(var(--deck-ink))] bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-md p-2 overflow-x-auto whitespace-pre-wrap font-mono max-h-[200px] overflow-y-auto",children:t.diff}),i&&e.jsx("div",{role:"alert",className:"rounded-md border border-red-300/70 bg-red-50 px-2.5 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300",children:i}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void c(!0,"once"),disabled:r,className:"min-h-8 px-3 py-1.5 text-[12px] font-mono bg-[#22C55E] text-white rounded-md hover:bg-[#16A34A] disabled:cursor-wait disabled:opacity-50",children:r?e.jsx(_,{className:"h-3.5 w-3.5 animate-spin"}):a("interaction.permission.once")}),t.allowRemember!==!1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void c(!0,"session"),disabled:r,className:"min-h-8 px-3 py-1.5 text-[12px] font-mono bg-[#3B82F6] text-white rounded-md hover:bg-[#2563EB] disabled:cursor-wait disabled:opacity-50",children:a("interaction.permission.session")}),e.jsx("button",{type:"button",onClick:()=>void c(!0,"project"),disabled:r,className:"min-h-8 px-3 py-1.5 text-[12px] font-mono bg-[#6366F1] text-white rounded-md hover:bg-[#4F46E5] disabled:cursor-wait disabled:opacity-50",children:a("interaction.permission.project")})]}),e.jsx("button",{type:"button",onClick:()=>void c(!1),disabled:r,className:"min-h-8 px-3 py-1.5 text-[12px] font-mono bg-[#EF4444] text-white rounded-md hover:bg-[#DC2626] disabled:cursor-wait disabled:opacity-50",children:a("interaction.permission.deny")})]})]})}function As({question:t,messageId:s}){const a=B(),[r,o]=h.useState({}),[i,l]=h.useState({}),[u,x]=h.useState(!1),[c,v]=h.useState(null),b=f(m=>m.currentSessionRef),d=f(m=>m.setQuestion),y=h.useMemo(()=>t?t.questions.reduce((m,S)=>{var E;const g=(E=i[S.header])==null?void 0:E.trim(),w=r[S.header];if(S.multiSelect){const D=Array.isArray(w)?[...w]:[];return g&&D.push(g),D.length>0&&(m[S.header]=D),m}const n=g||(typeof w=="string"?w:"");return n&&(m[S.header]=n),m},{}):{},[r,i,t]),p=(t==null?void 0:t.questions.every(m=>m.header in y))??!1;if(!t)return null;const N=async()=>{if(!K(f.getState())&&!(!b||u||!p)){x(!0),v(null);try{await ae.respondToQuestion(b,t.toolCallId,y),d(s,{...t,status:"answered",answers:y})}catch(m){v(m instanceof Error?m.message:a("interaction.question.failed"))}finally{x(!1)}}};return t.status!=="pending"?e.jsx("div",{className:"bg-[hsl(var(--deck-surface-2))] border border-[hsl(var(--deck-border))] rounded-lg px-3 py-2",children:e.jsx("div",{className:"text-[12px] text-[hsl(var(--deck-ink-muted))] font-mono",children:a("interaction.question.answered")})}):e.jsxs("div",{"data-pending-interaction":"question",tabIndex:-1,role:"alert",className:"space-y-4 rounded-lg border border-amber-300/70 bg-amber-50/70 p-4 outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-800/70 dark:bg-amber-950/25",children:[t.questions.map((m,S)=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-[13px] text-[hsl(var(--deck-ink))] font-mono",children:m.question}),e.jsxs("div",{className:"space-y-1",children:[m.options.map((g,w)=>e.jsxs("button",{type:"button",onClick:()=>{if(m.multiSelect){const n=r[m.header]||[],E=n.includes(g.label)?n.filter(D=>D!==g.label):[...n,g.label];o({...r,[m.header]:E})}else o({...r,[m.header]:g.label}),l({...i,[m.header]:""})},className:I("w-full text-left px-3 py-2 rounded-md border text-[12px] font-mono transition-colors","border-[hsl(var(--deck-border))]",(m.multiSelect?(r[m.header]||[]).includes(g.label):r[m.header]===g.label)?"bg-[#DCFCE7] text-[#166534] dark:bg-[#22C55E]/20 dark:text-[#E5E5E5]":"bg-[hsl(var(--deck-surface-2))] text-[hsl(var(--deck-ink-muted))]"),children:[e.jsx("div",{children:g.label}),e.jsx("div",{className:"text-[11px] text-[hsl(var(--deck-ink-faint))] mt-1",children:g.description})]},w)),e.jsx("input",{"aria-label":`${m.header} other response`,value:i[m.header]??"",onChange:g=>l({...i,[m.header]:g.target.value}),placeholder:a("interaction.question.other"),className:"w-full rounded-md border border-[#E5E7EB] bg-white px-3 py-2 text-[12px] text-[#111827] outline-none focus:border-[#22C55E] dark:border-[#27272a] dark:bg-[#111113] dark:text-[#E5E5E5]"})]})]},S)),c&&e.jsx("div",{role:"alert",className:"rounded-md border border-red-300/70 bg-red-50 px-2.5 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300",children:c}),e.jsxs("button",{type:"button",onClick:()=>void N(),disabled:u||!p,className:"inline-flex min-h-8 items-center gap-1.5 px-3 py-1.5 text-[12px] font-mono bg-[#22C55E] text-white rounded-md hover:bg-[#16A34A] disabled:cursor-wait disabled:opacity-50",children:[u&&e.jsx(_,{className:"h-3.5 w-3.5 animate-spin"}),a("interaction.question.submit")]})]})}function Rs({message:t}){const s=t.agentContent,a=f(p=>p.isStreaming&&p.currentAssistantMessageId===t.id);if(!s){const p=Re(t.content);return p?e.jsx(Oe,{content:p}):null}const{toolCalls:r,tasks:o,confirmation:i,question:l,elicitation:u}=s,x=Et(s),c=Mt(s);if(!(c.length>0||o.length>0||x.length>0||i||l||u)&&a)return e.jsxs("div",{className:"flex items-center gap-2 text-[hsl(var(--deck-ink-muted))]",children:[e.jsx(_,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{className:"text-[12px] font-mono",children:"Thinking..."})]});const d=r.length>0&&r.every(p=>p.status==="success"||p.status==="error")&&!a,y=!a;return e.jsxs("div",{className:"space-y-3",children:[c.map(p=>p.type==="thinking"?e.jsx("div",{"data-agent-timeline-block":"thinking",children:e.jsx(Ss,{content:p.content})},p.id):p.type==="text"?e.jsx("div",{"data-agent-timeline-block":"text",children:e.jsx(Oe,{content:p.content,syntaxHighlight:y})},p.id):e.jsx("div",{"data-agent-timeline-block":"tool_group",children:e.jsx(Ns,{toolCalls:r,toolCallIds:p.toolCallIds})},p.id)),o.length>0&&e.jsx(Cs,{tasks:o}),x.map(p=>e.jsx(Es,{subagent:p},p.id)),i&&e.jsx(Ms,{confirmation:i,messageId:t.id}),l&&e.jsx(As,{question:l,messageId:t.id}),u&&e.jsx(os,{elicitation:u,messageId:t.id}),d&&e.jsx(Ts,{toolCalls:r})]})}function Fs({message:t,showAvatar:s=!0}){var u,x,c,v;const a=t.role==="user";if(t.role==="system"){const b=Re(t.content);return e.jsx("div",{"data-chat-message-id":t.id,"data-chat-role":"system",className:"flex justify-center p-2 w-full",children:e.jsx("div",{className:"text-xs text-[hsl(var(--deck-ink-muted))] bg-[#F3F4F6] dark:bg-[#18181b] px-3 py-1 rounded-full font-mono",children:b})})}if(a){const b=(u=t.metadata)!=null&&u.userShellCommand&&typeof t.metadata.userShellCommand=="object"?t.metadata.userShellCommand:(x=t.metadata)!=null&&x.userShellExecution&&typeof t.metadata.userShellExecution=="object"?t.metadata.userShellExecution:void 0;if(b){const p=typeof b.command=="string"?b.command:"",N=b.status==="running"?"running":b.status==="completed"?"success":"error",m=typeof b.output=="string"?b.output:[typeof b.stdout=="string"?b.stdout:"",typeof b.stderr=="string"&&b.stderr?`stderr:
|
|
61
|
+
${b.stderr}`:""].filter(Boolean).join(`
|
|
62
|
+
`);return e.jsx("div",{"data-chat-message-id":t.id,"data-chat-role":"user","data-user-shell-command":!0,className:"flex w-full justify-end p-4",children:e.jsxs("div",{className:"w-full max-w-[85%] overflow-hidden rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-3 py-2",children:[e.jsxs("div",{className:"min-w-0 truncate font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:[e.jsx("span",{className:"mr-2 text-amber-600 dark:text-amber-400",children:"$"}),p]}),e.jsx(Fe,{status:N})]}),e.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))]",children:m||"(no output)"}),typeof b.exitCode=="number"&&e.jsxs("div",{className:"border-t border-[hsl(var(--deck-border))] px-3 py-1.5 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:["exit ",b.exitCode,typeof b.durationMs=="number"?` · ${(b.durationMs/1e3).toFixed(3)}s`:"",b.truncated===!0?" · truncated":""]})]})})}const{text:d,images:y}=gs(t.content);return e.jsxs("div",{"data-chat-message-id":t.id,"data-chat-role":"user",className:"group flex gap-2 justify-end p-4 w-full items-start",children:[e.jsx("div",{className:"mt-1 flex shrink-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:e.jsx(Le,{text:d,label:"Copy message"})}),e.jsxs("div",{className:"bg-[hsl(var(--deck-surface-2))] rounded-lg px-4 py-3 max-w-[85%]",children:[d&&e.jsx("p",{className:"text-[14px] text-[hsl(var(--deck-ink))] font-mono leading-relaxed whitespace-pre-wrap",children:d}),y.length>0&&e.jsx("div",{className:I("grid gap-2",y.length===1?"grid-cols-1 mt-0":"grid-cols-2 mt-3"),children:y.map((p,N)=>e.jsx("img",{src:p,alt:`attachment-${N+1}`,className:"object-cover w-full max-h-64 rounded-md"},`${p}-${N}`))})]}),e.jsx(vs,{})]})}const o=ks(t),i=rs((c=t.metadata)==null?void 0:c.codeReview),l=xs((v=t.metadata)==null?void 0:v.structuredOutput);return e.jsxs("div",{"data-chat-message-id":t.id,"data-chat-role":"assistant",className:I("group flex gap-4 justify-start w-full",s?"p-4":"px-4 pt-0 pb-3"),children:[s?e.jsx(bs,{}):e.jsx("div",{className:"w-8 shrink-0"}),e.jsxs("div",{className:"overflow-hidden flex-1 min-w-0",children:[i?e.jsx(is,{report:i}):l?e.jsx(ps,{report:l}):e.jsx(Rs,{message:t}),!l&&o.trim()&&e.jsx("div",{className:"mt-1.5 flex opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:e.jsx(Le,{text:o,label:"Copy response"})})]})]})}const Ds=h.memo(Fs);function Is(t,s,a){return Math.max(0,t+(a-s))}function $s(t,s,a){return Math.min(s,Math.max(0,t)+Math.max(0,a))}function _s(t,s,a,r){const o=new Map(t.filter(l=>!!l.id).map(l=>[l.id,l])),i=new Set(a);for(const l of s){if(!l.id)continue;const u=o.get(l.id);u!==l&&(!u||!r||r(u)!==r(l))&&i.add(l.id)}return i}function He(t,s){return t?t.querySelector(`[data-chat-message-id="${CSS.escape(s)}"]`):null}function Bs({turns:t,viewportRef:s,containerRef:a,onRevealTurn:r}){const o=B(),[i,l]=h.useState(null),[u,x]=h.useState(!1),c=h.useRef(null),v=h.useCallback(()=>{var m;const d=s.current,y=a.current;if(!d||!y||t.length===0)return;const p=d.getBoundingClientRect().top;let N=((m=t[0])==null?void 0:m.id)??null;for(const S of t){const g=He(y,S.id);if(g)if(g.getBoundingClientRect().top-p<=24)N=S.id;else break}l(N)},[t,s,a]);h.useEffect(()=>{const d=s.current;if(!d)return;const y=()=>{c.current===null&&(c.current=window.requestAnimationFrame(()=>{c.current=null,v()}))};return v(),d.addEventListener("scroll",y,{passive:!0}),()=>{d.removeEventListener("scroll",y),c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)}},[v,s]);const b=h.useCallback(d=>{const y=()=>{const N=He(a.current,d.id);N&&(N.scrollIntoView({behavior:"smooth",block:"start"}),l(d.id))};r(d.index)?y():window.requestAnimationFrame(()=>window.requestAnimationFrame(y))},[a,r]);return t.length<2?null:e.jsx("nav",{"aria-label":o("chat.turns.aria"),className:"absolute right-1 top-1/2 z-20 hidden -translate-y-1/2 sm:block",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),onFocusCapture:()=>x(!0),onBlurCapture:d=>{d.currentTarget.contains(d.relatedTarget)||x(!1)},children:e.jsxs("div",{className:"relative flex items-center justify-end",children:[e.jsx("ul",{className:I("flex flex-col items-center gap-2 py-2 transition-opacity",u?"opacity-0":"opacity-100"),"aria-hidden":u,children:t.map(d=>e.jsx("li",{children:e.jsx("span",{className:I("block rounded-full transition-all",d.id===i?"h-2 w-2 bg-[hsl(var(--deck-accent))]":"h-1.5 w-1.5 bg-[hsl(var(--deck-ink-faint))]/40")})},d.id))}),e.jsx("div",{className:I("absolute right-0 max-h-[min(70vh,520px)] w-[280px] overflow-y-auto rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/95 p-1 shadow-xl backdrop-blur transition-all",u?"pointer-events-auto translate-x-0 opacity-100":"pointer-events-none translate-x-2 opacity-0"),children:t.map((d,y)=>e.jsxs("button",{type:"button",onClick:()=>b(d),className:I("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",d.id===i?"bg-[hsl(var(--deck-hairline))]/70 text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-hairline))]/50 hover:text-[hsl(var(--deck-ink))]"),children:[e.jsx("span",{className:I("mt-1 h-1.5 w-1.5 shrink-0 rounded-full",d.id===i?"bg-[hsl(var(--deck-accent))]":"bg-[hsl(var(--deck-ink-faint))]/40")}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block font-mono text-[9.5px] uppercase tracking-[0.12em] text-[hsl(var(--deck-ink-faint))]",children:o("chat.turns.label",{n:y+1})}),e.jsx("span",{className:"line-clamp-2 text-[12px] leading-4",children:d.preview})]})]},d.id))})]})})}const Qe=80;function Ps(t){return typeof t=="string"?t:Array.isArray(t)?t.filter(s=>s.type==="text").map(s=>s.text).join(" "):""}function Ls(t){const s=Ps(t).replace(/\s+/g," ").trim();return s?s.length>Qe?`${s.slice(0,Qe-1)}…`:s:""}function Us(t){const s=[];for(let a=0;a<t.length;a+=1){const r=t[a];if(r.role!=="user"||!r.id)continue;const o=Ls(r.content);o&&s.push({id:r.id,index:a,preview:o})}return s}const ye=120,je=80,Os=96;function ce(t){return(t==null?void 0:t.querySelector("[data-radix-scroll-area-viewport]"))??null}function Ks(t){return JSON.stringify([t.role,t.content,t.metadata,t.agentContent])}function Vs({messages:t,isLoading:s}){const a=B(),r=h.useRef(null),o=h.useRef(null),i=h.useRef(!0),l=h.useRef(!1),u=h.useRef(t),x=h.useRef(t),c=h.useRef(new Set),v=h.useRef(t.length),b=h.useRef(null),[d,y]=h.useState(ye),[p,N]=h.useState(!1),[m,S]=h.useState(0),g=t.length>0;u.current=t,h.useEffect(()=>{const C=ce(r.current);if(!C||l.current&&!i.current)return;const T=window.requestAnimationFrame(()=>{C.scrollTop=C.scrollHeight,l.current=!0,i.current=!0,c.current=new Set,S(0),N(!1)});return()=>window.cancelAnimationFrame(T)},[t]),h.useEffect(()=>{const C=ce(r.current);if(!C)return;o.current=C;const T=()=>{if(!l.current)return;const P=C.scrollHeight-C.scrollTop-C.clientHeight<=Os,L=i.current;i.current=P,N(!P),P?(c.current=new Set,S(0)):L&&(x.current=u.current,c.current=new Set,S(0))};return T(),C.addEventListener("scroll",T,{passive:!0}),()=>C.removeEventListener("scroll",T)},[g,s]),h.useEffect(()=>{const C=x.current;if(x.current=t,i.current){c.current.size>0&&(c.current=new Set,S(0));return}const T=_s(C,t,c.current,Ks);c.current=T,S(T.size)},[t]),h.useEffect(()=>{const C=v.current;v.current=t.length,y(T=>T>=C&&t.length>C?t.length:Math.min(Math.max(T,ye),t.length||ye))},[t.length]);const w=Math.max(t.length-d,0),n=w,E=h.useMemo(()=>t.slice(n),[t,n]),D=h.useMemo(()=>Us(t),[t]);if(h.useLayoutEffect(()=>{var M;const C=b.current;if(!C)return;const T=ce(r.current);if(b.current=null,!!T){if((M=C.element)!=null&&M.isConnected){const P=C.element.getBoundingClientRect().top-C.viewportTop;T.scrollTop+=P;return}T.scrollTop=Is(C.scrollTop,C.scrollHeight,T.scrollHeight)}},[d]),s)return e.jsx("div",{role:"status","aria-live":"polite","aria-busy":"true",className:"flex overflow-hidden flex-1 justify-center items-center px-5 py-8 min-h-0",children:e.jsxs("div",{className:"w-full max-w-[560px]",children:[e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 animate-pulse rounded-full bg-[hsl(var(--deck-accent-soft))] blur-xl"}),e.jsx(Ne,{size:42,className:"relative"})]}),e.jsxs("div",{className:"mt-4 inline-flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-[0.16em] text-[hsl(var(--deck-accent))]",children:[e.jsx(vt,{className:"w-3 h-3"}),a("chat.list.loading.eyebrow")]}),e.jsx("h2",{className:"mt-2 text-[15px] font-medium text-[hsl(var(--deck-ink))]",children:a("chat.list.loading.title")}),e.jsx("p",{className:"mt-1 max-w-sm text-[11.5px] leading-5 text-[hsl(var(--deck-ink-faint))]",children:a("chat.list.loading.hint")})]}),e.jsx("div",{"aria-hidden":"true",className:"mt-7 space-y-4 rounded-xl border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))]/45 px-4 py-5",children:[72,88,64].map((C,T)=>e.jsxs("div",{className:I("flex gap-3",T%2===1&&"flex-row-reverse"),children:[e.jsx("span",{className:"h-7 w-7 shrink-0 animate-pulse rounded-md bg-[hsl(var(--deck-surface-2))]"}),e.jsx("span",{className:"h-10 animate-pulse rounded-lg bg-[hsl(var(--deck-surface-2))]",style:{width:`${C}%`,animationDelay:`${T*120}ms`}})]},C))})]})});if(t.length===0&&!s)return e.jsx("div",{className:"flex flex-1 justify-center items-center",children:e.jsxs("div",{className:"flex flex-col gap-4 items-center text-center",children:[e.jsx(Ne,{size:44}),e.jsxs("div",{children:[e.jsx("div",{className:"deck-eyebrow text-[hsl(var(--deck-accent))]",children:a("chat.list.empty.eyebrow")}),e.jsx("div",{className:"mt-2 text-[15px] font-medium text-[hsl(var(--deck-ink))]",children:a("chat.list.empty.title")}),e.jsx("div",{className:"mt-1 max-w-xs text-[12px] text-[hsl(var(--deck-ink-muted))]",children:a("chat.list.empty.hint")})]})]})});const F=()=>{const C=ce(r.current);C&&(C.scrollTop=C.scrollHeight,i.current=!0,l.current=!0,c.current=new Set,S(0),N(!1))},j=()=>{var T;const C=ce(r.current);if(C){const M=((T=r.current)==null?void 0:T.querySelector("[data-chat-message-id]"))??null;b.current={element:M,viewportTop:(M==null?void 0:M.getBoundingClientRect().top)??0,scrollHeight:C.scrollHeight,scrollTop:C.scrollTop}}y(M=>$s(M,t.length,je))},O=C=>C>=n?!0:(y(t.length),!1),G=m===1?a("chat.list.unreadMessage"):a("chat.list.unreadMessages",{count:m});return e.jsxs("div",{ref:r,className:"relative flex-1 min-h-0",children:[e.jsx($t,{className:"h-full",children:e.jsxs("div",{className:"flex flex-col px-4 pb-4 w-full md:px-6",children:[w>0&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx("button",{type:"button",onClick:j,"aria-label":a("chat.list.showEarlierWithRemaining",{count:Math.min(w,je),remaining:w}),className:"rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-1.5 font-mono text-[12px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:a("chat.list.showEarlier",{count:Math.min(w,je)})})}),E.map((C,T)=>{const M=n+T,P=M>0?t[M-1]:null,L=!P||P.role!==C.role||P.role==="user";return e.jsx(Ds,{message:C,showAvatar:L},C.id||`msg-${M}`)})]})}),e.jsx(Bs,{turns:D,viewportRef:o,containerRef:r,onRevealTurn:O}),p&&e.jsxs("button",{type:"button",onClick:F,"aria-live":"polite","aria-label":m>0?G:a("chat.list.jumpLatest"),className:"absolute bottom-4 left-1/2 z-10 inline-flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-[hsl(var(--deck-border-strong))] bg-[hsl(var(--deck-surface))]/95 px-3 py-1.5 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] shadow-lg backdrop-blur transition-colors hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx(Ae,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-accent))]"}),m>0?G:a("chat.list.jumpLatest")]})]})}const lt=h.memo(Vs);function Hs({queue:t,mutation:s,onMutate:a,onRefresh:r}){const o=B(),[i,l]=h.useState(!1),u=h.useRef(null),x=h.useRef(null),c=h.useRef(null);h.useLayoutEffect(()=>{var p,N,m;if(s.pending||!u.current)return;const d=u.current;u.current=null,(m=Array.from(((p=x.current)==null?void 0:p.querySelectorAll("[data-follow-up-focus-id]"))??[]).find(S=>S.dataset.followUpFocusId===d)??((N=x.current)==null?void 0:N.querySelector("button")))==null||m.focus()},[s.pending,t==null?void 0:t.version]);const v=h.useCallback(async d=>{u.current=d.messageId,await a(d)},[a]),b=h.useCallback((d,y)=>{v({type:"move",messageId:d,toPosition:y})},[v]);return!t||t.pending===0&&!s.errorMessage?null:e.jsxs("section",{ref:x,"data-blade-follow-up-queue":!0,className:"mx-4 mb-2 overflow-hidden rounded-lg border border-amber-300/70 bg-amber-50/70 shadow-sm dark:border-amber-900/60 dark:bg-amber-950/25 md:mx-6","aria-label":o("chat.followUpQueue.title"),children:[e.jsxs("button",{type:"button","aria-label":o(i?"chat.followUpQueue.hide":"chat.followUpQueue.show"),"aria-expanded":i,onClick:()=>l(d=>!d),className:"flex min-h-10 w-full items-center gap-2 px-3 text-left font-mono text-[11px] text-amber-950 transition-colors hover:bg-amber-100/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-amber-500 dark:text-amber-100 dark:hover:bg-amber-900/35",children:[e.jsx(qt,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"font-semibold",children:o("chat.followUpQueue.count",{count:t.pending})}),t.locked>0&&e.jsx("span",{className:"text-amber-700/80 dark:text-amber-300/75",children:o("chat.followUpQueue.lockedCount",{count:t.locked})}),e.jsx(oe,{className:`ml-auto h-3.5 w-3.5 transition-transform ${i?"rotate-90":""}`,"aria-hidden":!0})]}),i&&e.jsxs("div",{className:"border-t border-amber-300/60 px-2 py-2 dark:border-amber-900/50",children:[s.errorMessage&&e.jsxs("div",{role:"alert",className:"mb-2 flex items-center gap-2 rounded-md border border-red-200 bg-red-50 px-2.5 py-2 text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/35 dark:text-red-300",children:[e.jsx("span",{className:"min-w-0 flex-1",children:s.errorCode==="revision_conflict"?o("chat.followUpQueue.stale"):s.errorMessage}),r&&e.jsx("button",{type:"button","aria-label":o("chat.followUpQueue.refresh"),onClick:()=>void r(),className:"rounded p-1 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 dark:hover:bg-red-900/60",children:e.jsx(tt,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),e.jsx("ol",{className:"space-y-1.5",children:t.items.map((d,y)=>{const p=t.items[y-1],N=t.items[y+1],m=d.mutable&&(p==null?void 0:p.mutable)===!0,S=d.mutable&&(N==null?void 0:N.mutable)===!0,g=s.pending;return e.jsxs("li",{"data-follow-up-id":d.id,"data-follow-up-state":d.state,"data-follow-up-focus-id":d.id,tabIndex:-1,draggable:d.mutable&&!s.pending,onDragStart:()=>{c.current=d.mutable?d.id:null},onDragOver:w=>{const n=c.current,E=t.items.find(D=>D.id===n);E!=null&&E.mutable&&d.mutable&&w.preventDefault()},onDrop:w=>{w.preventDefault();const n=c.current;c.current=null;const E=t.items.find(j=>j.id===n);if(!(E!=null&&E.mutable)||!d.mutable||E.id===d.id)return;const D=Math.min(E.position,d.position),F=Math.max(E.position,d.position);t.items.slice(D,F+1).some(j=>!j.mutable)||b(E.id,d.position)},onDragEnd:()=>{c.current=null},className:"flex min-w-0 items-center gap-2 rounded-md border border-amber-200/70 bg-white/75 px-2.5 py-2 dark:border-amber-900/50 dark:bg-zinc-950/45",children:[e.jsx("span",{className:"w-5 shrink-0 text-center font-mono text-[10px] text-amber-700 dark:text-amber-400",children:y+1}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-xs text-[hsl(var(--deck-ink))]",children:d.kind==="internal"?o("chat.followUpQueue.internal"):d.preview||o("chat.followUpQueue.attachmentOnly")}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-[9px] uppercase tracking-[0.08em] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{children:o(`chat.followUpQueue.delivery.${d.delivery}`)}),!d.mutable&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Gt,{className:"h-2.5 w-2.5","aria-hidden":!0}),o("chat.followUpQueue.locked")]}),d.attachmentCount>0&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(gt,{className:"h-2.5 w-2.5","aria-hidden":!0}),d.attachmentCount]})]})]}),g&&s.messageId===d.id?e.jsx(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-amber-600"}):e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx("button",{type:"button","aria-label":o("chat.followUpQueue.moveUp",{id:d.id}),disabled:g||!m,onClick:()=>b(d.id,y-1),className:"rounded p-1 text-amber-800 transition-colors hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 disabled:opacity-30 dark:text-amber-300 dark:hover:bg-amber-900/50",children:e.jsx(_t,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsx("button",{type:"button","aria-label":o("chat.followUpQueue.moveDown",{id:d.id}),disabled:g||!S,onClick:()=>b(d.id,y+1),className:"rounded p-1 text-amber-800 transition-colors hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 disabled:opacity-30 dark:text-amber-300 dark:hover:bg-amber-900/50",children:e.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsx("button",{type:"button","aria-label":o("chat.followUpQueue.remove",{id:d.id}),disabled:g||!d.mutable,onClick:()=>void v({type:"remove",messageId:d.id}),className:"rounded p-1 text-red-600 transition-colors hover:bg-red-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:opacity-30 dark:text-red-400 dark:hover:bg-red-950/60",children:e.jsx(ne,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})]},d.id)})})]})]})}const Se=Pt,Ce=Lt,Te=Ut,fe=h.forwardRef(({className:t,sideOffset:s=4,...a},r)=>e.jsx(nt,{ref:r,sideOffset:s,className:I("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",t),...a}));fe.displayName=nt.displayName;const Qs={active:{labelKey:"goal.status.active",dot:"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.5)]",accent:"text-[hsl(var(--deck-accent))]"},verifying:{labelKey:"goal.status.active",dot:"animate-pulse bg-sky-400",accent:"text-sky-600 dark:text-sky-300"},paused:{labelKey:"goal.status.paused",dot:"bg-amber-400",accent:"text-amber-600 dark:text-amber-300"},blocked:{labelKey:"goal.status.blocked",dot:"bg-rose-500",accent:"text-rose-600 dark:text-rose-300"},usage_limited:{labelKey:"goal.status.usageLimited",dot:"bg-orange-500",accent:"text-orange-600 dark:text-orange-300"},budget_limited:{labelKey:"goal.status.budgetLimited",dot:"bg-orange-500",accent:"text-orange-600 dark:text-orange-300"},complete:{labelKey:"goal.status.complete",dot:"bg-emerald-500",accent:"text-emerald-600 dark:text-emerald-300"}};function me(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function zs(t){if(t<60)return`${t}s`;const s=Math.floor(t/60),a=t%60;return a===0?`${s}m`:`${s}m ${a}s`}function qs(){var C,T,M,P,L,Z,Q,X,J,ee,A,z,q,V,H,$,W;const t=B(),{locale:s}=st(),a=f(R=>R.goal),r=f(R=>R.pauseGoal),o=f(R=>R.resumeGoal),i=f(R=>R.editGoal),l=f(R=>R.clearGoal),u=f(R=>ie(R.historySurfaceSelection)),[x,c]=h.useState(!1),[v,b]=h.useState(!1),[d,y]=h.useState(""),[p,N]=h.useState(null),[m,S]=h.useState(!1);if(h.useEffect(()=>{c(!1),b(!1),y((a==null?void 0:a.objective)??""),S(!1)},[a==null?void 0:a.goalId]),u||!a)return null;const g=Qs[a.status],w=["active","verifying","paused","blocked"].includes(a.status),n=a.status==="active"||a.status==="verifying",E=a.status==="paused"||a.status==="blocked",D=p!==null,F=async(R,te)=>{if(!K(f.getState())){N(R);try{await te()}finally{N(null)}}},j=()=>{y(a.objective),b(!0),c(!0)},O=async R=>{R.preventDefault();const te=d.trim();if(!te||te===a.objective){b(!1);return}await F("edit",()=>i(te)),b(!1)},G=async()=>{await F("delete",l),S(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(Se,{delayDuration:250,children:e.jsxs("section",{"aria-label":t("goal.aria.section"),className:"mx-3 mb-1 shrink-0","data-blade-goal-status":a.status,"data-blade-goal-recovery":(C=a.prematureStop)==null?void 0:C.consecutiveCount,"data-blade-goal-recovery-pattern":(T=a.prematureStop)==null?void 0:T.pattern,"data-blade-goal-verification-stall":(M=a.verificationStall)==null?void 0:M.consecutiveCount,"data-blade-goal-frontier-task-list":(P=a.executionFrontier)==null?void 0:P.taskListId,"data-blade-goal-frontier-total":(L=a.executionFrontier)==null?void 0:L.total,"data-blade-goal-frontier-completed":(Z=a.executionFrontier)==null?void 0:Z.completed,"data-blade-goal-frontier-in-progress":(Q=a.executionFrontier)==null?void 0:Q.inProgress,"data-blade-goal-frontier-pending":(X=a.executionFrontier)==null?void 0:X.pending,"data-blade-goal-frontier-blocked":(J=a.executionFrontier)==null?void 0:J.blocked,"data-blade-goal-frontier-next-task":(A=(ee=a.executionFrontier)==null?void 0:ee.nextTask)==null?void 0:A.id,"data-blade-goal-frontier-digest":(z=a.executionFrontier)==null?void 0:z.digestSha256.slice(0,16),"data-blade-goal-frontier-stall":(q=a.frontierStall)==null?void 0:q.category,"data-blade-goal-frontier-stall-count":(V=a.frontierStall)==null?void 0:V.consecutiveCount,"data-blade-goal-execution-host-failure":(H=a.executionHostFailure)==null?void 0:H.category,"data-blade-goal-execution-host-failure-count":($=a.executionHostFailure)==null?void 0:$.consecutiveCount,children:[e.jsxs("div",{className:I("flex h-9 items-center gap-2 rounded-lg border px-3 transition-colors","border-[hsl(var(--deck-border))]/60 bg-[hsl(var(--deck-surface))]/80 backdrop-blur-sm",x&&"rounded-b-none border-b-0"),children:[a.status==="complete"?e.jsx(kt,{className:"h-3.5 w-3.5 shrink-0 text-emerald-500"}):e.jsx(Jt,{className:I("h-3.5 w-3.5 shrink-0",g.accent)}),e.jsx("span",{className:I("h-1.5 w-1.5 shrink-0 rounded-full",g.dot)}),e.jsx("span",{className:I("shrink-0 text-[10px] font-medium leading-none",g.accent),children:a.status==="verifying"?s==="zh"?"验证中":"Verifying":t(g.labelKey)}),e.jsx("span",{className:"h-3 w-px shrink-0 bg-[hsl(var(--deck-hairline))]"}),e.jsx("button",{type:"button","aria-label":t(x?"goal.action.collapse":"goal.action.expand"),className:"min-w-0 flex-1 truncate text-left text-[12px] leading-5 text-[hsl(var(--deck-ink))]/85 outline-none transition-colors hover:text-[hsl(var(--deck-ink))]",onClick:()=>c(R=>!R),"aria-expanded":x,title:a.objective,children:a.objective}),a.tokensUsed>0&&e.jsxs("span",{className:"hidden shrink-0 text-[10px] tabular-nums text-[hsl(var(--deck-ink-muted))] sm:inline",children:[me(a.tokensUsed),a.tokenBudget!==void 0&&`/${me(a.tokenBudget)}`]}),e.jsxs("div",{className:"flex shrink-0 items-center",children:[n&&e.jsx(he,{label:t("goal.action.pause"),disabled:D,onClick:()=>void F("pause",r),children:p==="pause"?e.jsx(_,{className:"animate-spin"}):e.jsx(Ot,{})}),E&&e.jsx(he,{label:t("goal.action.resume"),disabled:D,onClick:()=>void F("resume",o),children:p==="resume"?e.jsx(_,{className:"animate-spin"}):e.jsx(Kt,{})}),e.jsx(he,{label:t(w?"goal.action.edit":"goal.action.expand"),disabled:!w&&!x,onClick:w?j:()=>c(R=>!R),children:w?e.jsx(it,{}):e.jsx(Bt,{})}),e.jsx(he,{label:t("goal.action.delete"),disabled:D,destructive:!0,onClick:()=>S(!0),children:e.jsx(ne,{})})]})]}),x&&e.jsx("div",{className:"rounded-b-lg border border-t-0 border-[hsl(var(--deck-border))]/60 bg-[hsl(var(--deck-surface))]/80 px-4 py-3 backdrop-blur-sm",children:v?e.jsxs("form",{onSubmit:O,children:[e.jsx("textarea",{id:"goal-objective",value:d,onChange:R=>y(R.target.value),onKeyDown:R=>{R.key==="Escape"&&b(!1)},rows:3,autoFocus:!0,className:"w-full resize-none rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-3 py-2 text-[12px] leading-5 text-[hsl(var(--deck-ink))] outline-none transition-shadow focus:border-[hsl(var(--deck-accent))] focus:ring-1 focus:ring-[hsl(var(--deck-accent-glow))]"}),e.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>b(!1),className:"inline-flex h-7 items-center gap-1 rounded-md px-2.5 text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-hairline))]/60",children:[e.jsx(at,{className:"h-3 w-3"}),t("goal.action.cancel")]}),e.jsxs("button",{type:"submit",disabled:!d.trim()||p==="edit",className:"inline-flex h-7 items-center gap-1 rounded-md bg-[hsl(var(--deck-accent))] px-2.5 text-[11px] font-medium text-white transition-colors hover:bg-[hsl(var(--deck-accent))]/90 disabled:cursor-not-allowed disabled:opacity-50",children:[p==="edit"?e.jsx(_,{className:"h-3 w-3 animate-spin"}):e.jsx(be,{className:"h-3 w-3"}),t("goal.action.save")]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"whitespace-pre-wrap text-[12px] leading-5 text-[hsl(var(--deck-ink))]/90",children:a.objective}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[10px] text-[hsl(var(--deck-ink-muted))]",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Qt,{className:"h-3 w-3"}),me(a.tokensUsed),a.tokenBudget!==void 0&&` / ${me(a.tokenBudget)}`," ",t("goal.metrics.tokens")]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Yt,{className:"h-3 w-3"}),zs(a.timeUsedSeconds)]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(xe,{className:"h-3 w-3"}),a.continuationCount===1?t("goal.metrics.continuationOne",{n:a.continuationCount}):t("goal.metrics.continuationMany",{n:a.continuationCount})]})]}),a.prematureStop&&e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1.5 font-mono text-[10px] text-amber-700 dark:text-amber-300",children:[e.jsx(xe,{className:"h-3 w-3"}),s==="zh"?"恢复提示":"Recovery nudge"," ",a.prematureStop.consecutiveCount," ·"," ",a.prematureStop.pattern.replaceAll("_"," ")]}),a.executionHostFailure&&e.jsxs("div",{className:"mt-2 rounded-md border border-amber-200/50 bg-amber-50/60 px-2.5 py-2 text-[11px] text-amber-900 dark:border-amber-400/15 dark:bg-amber-400/[0.05] dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:t("goal.executionHostFailure.title")}),e.jsxs("p",{className:"mt-1 font-mono opacity-80",children:[t(`goal.executionHostFailure.category.${a.executionHostFailure.category}`)," ","· ",a.executionHostFailure.consecutiveCount,"/3"]})]}),a.completionVerification&&e.jsxs("div",{"data-goal-verification":a.completionVerification.status,className:"mt-2 rounded-md border border-sky-200/50 bg-sky-50/60 px-2.5 py-2 text-[11px] text-sky-900 dark:border-sky-400/15 dark:bg-sky-400/[0.05] dark:text-sky-100",children:[e.jsxs("p",{className:"font-mono font-medium",children:["#",a.completionVerification.attempt," ·"," ",a.completionVerification.status.toUpperCase()," ·"," ",((W=a.completionVerification.verifierSessionId)==null?void 0:W.slice(0,12))??"-",a.verificationStall?s==="zh"?` · 重复 ${a.verificationStall.consecutiveCount}/3`:` · repeat ${a.verificationStall.consecutiveCount}/3`:""]}),a.completionVerification.summary&&e.jsx("p",{className:"mt-1 line-clamp-3 whitespace-pre-wrap opacity-80",children:a.completionVerification.summary}),a.completionVerification.evidenceSha256&&e.jsxs("p",{className:"mt-1 font-mono text-[10px] opacity-60",children:["sha256:",a.completionVerification.evidenceSha256.slice(0,12)]})]}),a.statusReason&&e.jsx("div",{className:"mt-2 rounded-md border border-amber-200/50 bg-amber-50/60 px-2.5 py-1.5 text-[11px] text-amber-800 dark:border-amber-400/15 dark:bg-amber-400/[0.05] dark:text-amber-200",children:a.statusReason})]})})]})}),e.jsx(We,{open:m,onOpenChange:S,children:e.jsxs(Je,{className:"max-w-[400px] border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]",children:[e.jsx(Ye,{children:t("goal.dialog.title")}),e.jsx(Xe,{children:t("goal.dialog.description")}),e.jsxs(Ze,{className:"mt-2",children:[e.jsx("button",{type:"button",onClick:()=>S(!1),className:"inline-flex h-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] px-3 text-[12px] text-[hsl(var(--deck-ink))] hover:bg-[hsl(var(--deck-hairline))]/60",children:t("goal.action.cancel")}),e.jsxs("button",{type:"button",disabled:p==="delete",onClick:()=>void G(),className:"inline-flex gap-1.5 justify-center items-center px-3 h-8 text-[12px] font-medium text-white bg-rose-600 rounded-md hover:bg-rose-500 disabled:opacity-50",children:[p==="delete"&&e.jsx(_,{className:"w-3.5 h-3.5 animate-spin"}),t("goal.action.delete")]})]})]})})]})}function he({label:t,children:s,disabled:a,destructive:r,onClick:o}){return e.jsxs(Ce,{children:[e.jsx(Te,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":t,disabled:a,onClick:o,className:I("flex h-6 w-6 items-center justify-center rounded-md text-[hsl(var(--deck-ink-muted))] outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent-glow))]/50 disabled:cursor-not-allowed disabled:opacity-35 [&_svg]:h-3.5 [&_svg]:w-3.5",r?"hover:bg-rose-500/10 hover:text-rose-500":"hover:bg-[hsl(var(--deck-hairline))]/60 hover:text-[hsl(var(--deck-ink))]"),children:s})}),e.jsx(fe,{side:"top",className:"text-[10px]",children:t})]})}function Gs(){const t=B(),s=f(c=>c.currentSessionRef),a=f(c=>c.sessions),r=f(c=>c.messages),o=f(c=>ie(c.historySurfaceSelection)),i=h.useMemo(()=>{var v,b,d,y,p;const c=s?(v=yt(a,s))==null?void 0:v.pendingInteraction:void 0;if(c)return c.type;for(let N=r.length-1;N>=0;N-=1){const m=(b=r[N])==null?void 0:b.agentContent;if(((d=m==null?void 0:m.confirmation)==null?void 0:d.status)==="pending")return"permission";if(((y=m==null?void 0:m.question)==null?void 0:y.status)==="pending")return"question";if(((p=m==null?void 0:m.elicitation)==null?void 0:p.status)==="pending")return"elicitation"}return null},[s,r,a]);if(o||!i)return null;const l=()=>{const c=document.querySelector(`[data-pending-interaction="${i}"]`);c==null||c.scrollIntoView({block:"center",behavior:"smooth"}),window.setTimeout(()=>c==null?void 0:c.focus(),250)},u=i==="question",x=i==="elicitation";return e.jsxs("div",{role:"alert",className:"mx-3 mb-2 flex flex-wrap items-center gap-2 rounded-lg border border-amber-300/80 bg-amber-50/95 px-3 py-2 font-mono text-amber-950 shadow-sm backdrop-blur dark:border-amber-800/80 dark:bg-amber-950/90 dark:text-amber-100 sm:mx-5",children:[e.jsx(Ee,{className:"h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.jsxs("div",{className:"min-w-[180px] flex-1",children:[e.jsx("div",{className:"text-[11.5px] font-semibold",children:t(u?"interaction.bar.questionTitle":x?"interaction.bar.elicitationTitle":"interaction.bar.permissionTitle")}),e.jsx("div",{className:"mt-0.5 text-[10px] leading-4 text-amber-800 dark:text-amber-300",children:t(u?"interaction.bar.questionHint":x?"interaction.bar.elicitationHint":"interaction.bar.permissionHint")})]}),e.jsxs("button",{type:"button",onClick:l,className:"inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-md border border-amber-400/80 bg-white/80 px-2.5 text-[10.5px] font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-700 dark:bg-amber-950/70 dark:hover:bg-amber-900",children:[e.jsx(Ae,{className:"h-3 w-3"}),t("interaction.bar.review")]})]})}function de(t){return Math.max(0,Math.ceil((t??0)/1e3))}function Ws(t,s=Date.now()){var r;const a=(r=t.snapshot)==null?void 0:r.nextActionAt;return a===void 0?void 0:de(a-s)}function dt(t,s=Date.now()){const a=t==null?void 0:t.snapshot;if(!a)return null;const r=Ws(t,s)??0,o=a.retry,i=a.admission,l=a.stall,u=a.fallback,x={seconds:r,attempt:(o==null?void 0:o.attempt)??0,maxRetries:(o==null?void 0:o.maxRetries)??0,budgetSeconds:de(o==null?void 0:o.recoveryRemainingMs),position:(i==null?void 0:i.queuePosition)??0,depth:i?Math.max(i.queueDepth,i.queuePosition):0,scope:(i==null?void 0:i.scope)??"",waitSeconds:de(i==null?void 0:i.waitMs),stallSeconds:de(l==null?void 0:l.durationMs),timeoutSeconds:de(l==null?void 0:l.timeoutMs),from:(u==null?void 0:u.from.model)??"",to:(u==null?void 0:u.to.model)??"",candidate:(u==null?void 0:u.candidate)??0,candidateCount:(u==null?void 0:u.candidateCount)??0};switch(a.activity){case"admission_wait":return{titleKey:"chat.providerRecovery.admission",detailKey:"chat.providerRecovery.admissionDetail",compactKey:"chat.providerRecovery.admissionCompact",params:x};case"retry_wait":return{titleKey:a.reason==="rate_limit"?"chat.providerRecovery.rateLimit":"chat.providerRecovery.retryWait",detailKey:"chat.providerRecovery.retryDetail",compactKey:"chat.providerRecovery.retryCompact",params:x};case"retry_attempt":return{titleKey:"chat.providerRecovery.retryAttempt",detailKey:"chat.providerRecovery.retryDetail",compactKey:"chat.providerRecovery.retryCompact",params:x};case"circuit_open":return{titleKey:a.reason==="rate_limit"?"chat.providerRecovery.rateLimitCircuit":"chat.providerRecovery.circuit",detailKey:"chat.providerRecovery.circuitDetail",compactKey:a.reason==="rate_limit"?"chat.providerRecovery.rateLimitCircuitCompact":"chat.providerRecovery.circuitCompact",params:x};case"circuit_probe":return{titleKey:"chat.providerRecovery.probe",detailKey:"chat.providerRecovery.probeDetail",compactKey:"chat.providerRecovery.probeCompact",params:x};case"stream_stall":return{titleKey:l!=null&&l.outputStarted?"chat.providerRecovery.stallAfterOutput":"chat.providerRecovery.stall",detailKey:"chat.providerRecovery.stallDetail",compactKey:"chat.providerRecovery.stallCompact",params:x};case"fallback":return{titleKey:"chat.providerRecovery.fallback",detailKey:"chat.providerRecovery.fallbackDetail",compactKey:"chat.providerRecovery.fallbackCompact",params:x}}}function Js({recovery:t,stopping:s,onStop:a}){var x;const r=B(),[o,i]=h.useState(Date.now()),l=(x=t==null?void 0:t.snapshot)==null?void 0:x.nextActionAt;h.useEffect(()=>{if(l===void 0)return;i(Date.now());const c=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(c)},[l]);const u=dt(t,o);return u?e.jsxs("section",{role:"status","aria-live":"polite","data-provider-recovery-banner":!0,className:"mx-4 mb-2 flex min-h-12 items-center gap-3 rounded-lg border border-amber-300/70 bg-amber-50/80 px-3 py-2 text-amber-950 shadow-sm dark:border-amber-800/60 dark:bg-amber-950/35 dark:text-amber-100 md:mx-6",children:[e.jsx(_,{className:"h-4 w-4 shrink-0 animate-spin","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-semibold",children:r(u.titleKey,u.params)}),e.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] opacity-80",children:r(u.detailKey,u.params)})]}),e.jsxs("button",{type:"button","data-provider-recovery-stop":!0,onClick:a,disabled:s,className:"inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-md border border-amber-400/70 bg-white/70 px-2.5 text-xs font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 disabled:cursor-wait disabled:opacity-60 dark:border-amber-700 dark:bg-amber-950/50 dark:hover:bg-amber-900/50",children:[s?e.jsx(_,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):e.jsx(jt,{className:"h-3 w-3 fill-current","aria-hidden":!0}),r(s?"chat.input.action.stopping":"chat.providerRecovery.stop")]})]}):null}const Ys=h.lazy(()=>et(()=>import("./MarkdownRenderer-DF-nYnJu.js").then(t=>t.M),__vite__mapDeps([0,1,2,3,4,5,6])).then(t=>({default:t.MarkdownRenderer})));function Xs(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function Zs(){const t=B(),s=f(r=>r.sideConversation),a=f(r=>r.dismissSideConversation);return s?e.jsx("section",{"aria-label":t("chat.side.title"),"data-blade-side-conversation":!0,"data-status":s.status,className:"shrink-0 border-y border-[hsl(var(--deck-accent)/0.28)] bg-[hsl(var(--deck-accent-soft)/0.42)]",children:e.jsxs("div",{className:"px-4 py-3 md:px-6",children:[e.jsxs("header",{className:"flex min-h-7 items-start gap-2",children:[e.jsx(Wt,{"aria-hidden":!0,className:"mt-0.5 h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[e.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase text-[hsl(var(--deck-accent))]",children:t("chat.side.title")}),s.durationMs!==void 0&&e.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(Vt,{"aria-hidden":!0,className:"h-3 w-3"}),Xs(s.durationMs)]})]}),e.jsx("p",{className:"mt-0.5 break-words font-mono text-[11px] leading-4 text-[hsl(var(--deck-ink-muted))]",children:s.question})]}),e.jsx("button",{type:"button",onClick:a,"aria-label":t("chat.side.dismiss"),title:t("chat.side.dismiss"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(at,{"aria-hidden":!0,className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{"aria-live":"polite","aria-busy":s.status==="loading",className:"mt-2 max-h-[min(36vh,320px)] overflow-y-auto border-l-2 border-[hsl(var(--deck-accent)/0.42)] pl-3 pr-1",children:[s.status==="loading"&&e.jsxs("div",{role:"status",className:"flex min-h-9 items-center gap-2 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[e.jsx(_,{"aria-hidden":!0,className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("chat.side.loading")]}),s.status==="error"&&e.jsxs("div",{role:"alert",className:"flex min-h-9 items-start gap-2 font-mono text-[11px] leading-5 text-red-700 dark:text-red-300",children:[e.jsx(Ee,{"aria-hidden":!0,className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"break-words",children:s.error??t("chat.side.failed")})]}),s.status==="completed"&&s.response&&e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"whitespace-pre-wrap break-words font-mono text-[12px] leading-5 text-[hsl(var(--deck-ink))]",children:s.response}),children:e.jsx(Ys,{content:s.response,className:"text-[12px] leading-5 [&_h1]:text-[14px] [&_h2]:text-[13px] [&_h3]:text-[12px]"})})]})]})}):null}function we(t){return Number.isFinite(t)?Math.max(0,t):0}function ea(t){const s=we(t.totalInputTokens),a=we(t.cacheReadTokens),r=we(t.cacheWriteTokens),o=Math.min(a,s),i=Math.min(r,Math.max(0,s-o)),l=Math.max(0,s-o-i),u=s>0&&(a>0||r>0);return{totalInputTokens:s,cacheReadTokens:o,cacheWriteTokens:i,uncachedInputTokens:l,...u?{hitRate:o/s}:{}}}function ta(t){return t===void 0||!Number.isFinite(t)?"—":`${Math.round(Math.max(0,Math.min(1,t))*100)}%`}const sa={running:"status.phase.running",compacting:"status.phase.compacting",recovering_context:"status.phase.recoveringContext",switching_model:"status.phase.switchingModel",waiting_permission:"status.phase.waitingPermission",error:"status.phase.error",idle:""},aa={model_changed:"status.cacheBreak.model",system_prompt_changed:"status.cacheBreak.system",tools_changed:"status.cacheBreak.tools",request_policy_changed:"status.cacheBreak.policy",ttl_expired:"status.cacheBreak.ttl",server_side:"status.cacheBreak.server"},se=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString(),ra=t=>{const s=Math.max(0,Math.ceil(t/1e3)),a=Math.floor(s/60),r=s%60;return a>0?`${a}m ${r}s`:`${r}s`};function ut(){const t=B(),s=f(n=>n.tokenUsage),a=f(n=>n.isStreaming),r=f(n=>n.agentPhase),o=f(n=>n.providerRecovery),i=f(n=>n.turnActivity),l=f(n=>n.pendingResume),u=f(n=>n.actionStationarity),x=f(n=>n.turnRecovery),c=sa[r]??"",v=dt(o),b=(l==null?void 0:l.delayMs)!==void 0?` · retry in ${ra(l.delayMs)}`:"",d=(x==null?void 0:x.state)==="requires_attention"?t("status.recovery.review"):"",y=(x==null?void 0:x.state)==="requires_attention"?t(x.reason==="interrupted_tool_call"?"status.recovery.interruptedTool":"status.recovery.successfulTool"):"",p=d||(u?`${t(u.phase==="halted"?"status.phase.actionStationarityStopped":"status.phase.actionStationarityRecovering")} · ${u.toolName} · ${u.runLength}/${u.haltThreshold}`:v?t(v.compactKey,v.params):l?`Recovery attempt ${l.attempt}/${l.maxAttempts}${b}`:c?t(c):""),N=s.maxContextTokens>0?Math.round(s.totalTokens/s.maxContextTokens*100):0,m=ea(s),S=ta(m.hitRate),g=Math.min(N,100),w=N>95?"danger":N>80?"warn":"safe";return e.jsxs("div",{"data-chat-status-bar":!0,className:"flex items-center gap-2 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]/70 px-3 py-2 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] backdrop-blur-sm sm:gap-4 sm:px-5",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:t("status.context")}),e.jsxs("span",{className:"flex gap-1 items-baseline tabular-nums",children:[e.jsx("span",{className:I("text-[12px] font-medium",w==="safe"&&"text-[hsl(var(--deck-ink))]",w==="warn"&&"text-amber-600 dark:text-amber-400",w==="danger"&&"text-red-600 dark:text-red-400"),children:se(s.totalTokens)}),e.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:["/ ",se(s.maxContextTokens)]})]}),s.isDefaultMaxTokens&&e.jsx(Se,{children:e.jsxs(Ce,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(zt,{className:"h-3 w-3 cursor-help text-[hsl(var(--deck-ink-faint))]"})}),e.jsx(fe,{side:"top",className:"max-w-[220px]",children:e.jsx("p",{className:"text-xs",children:t("status.tokenLimitTooltip")})})]})}),e.jsxs("div",{className:"relative hidden h-2 w-32 overflow-hidden rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] sm:block","aria-hidden":"true",children:[e.jsx("div",{className:I("absolute inset-y-0 left-0 transition-[width] duration-300",w==="safe"&&"bg-[hsl(var(--deck-accent))]",w==="warn"&&"bg-amber-500",w==="danger"&&"bg-red-500"),style:{width:`${g}%`}}),e.jsx("div",{className:"flex absolute inset-0 pointer-events-none",children:[25,50,75].map(n=>e.jsx("span",{className:"absolute inset-y-0 w-px bg-[hsl(var(--deck-canvas-veil))]/60",style:{left:`${n}%`}},n))})]}),e.jsxs("span",{className:I("w-10 text-right tabular-nums text-[hsl(var(--deck-ink-faint))]",w==="warn"&&"text-amber-600 dark:text-amber-400",w==="danger"&&"text-red-600 dark:text-red-400"),children:[N,"%"]})]}),e.jsx(Se,{children:e.jsxs(Ce,{children:[e.jsx(Te,{asChild:!0,children:e.jsxs("div",{className:"flex shrink-0 cursor-help items-baseline gap-2 border-l border-[hsl(var(--deck-hairline))] pl-2 sm:pl-4","data-testid":"prompt-cache-hit-rate","aria-label":`${t("status.cache")} ${S}`,children:[e.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:t("status.cache")}),e.jsx("span",{className:I("tabular-nums",m.hitRate===void 0?"text-[hsl(var(--deck-ink-faint))]":"font-medium text-[hsl(var(--deck-accent))]"),children:S})]})}),e.jsx(fe,{side:"top",className:"max-w-[280px]",children:m.hitRate===void 0?e.jsx("p",{className:"text-xs",children:t("status.cacheUnavailable")}):e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsx("p",{children:t("status.cacheTooltip")}),e.jsx("p",{className:"font-mono tabular-nums",children:t("status.cacheDetails",{read:se(m.cacheReadTokens),write:se(m.cacheWriteTokens),uncached:se(m.uncachedInputTokens)})}),s.cacheBreak&&e.jsx("p",{className:"text-[hsl(var(--deck-accent))]",children:t("status.cacheBreak",{reason:t(aa[s.cacheBreak.reason]??"status.cacheBreak.server"),previous:se(s.cacheBreak.previousCacheReadTokens),current:se(s.cacheBreak.cacheReadTokens)})})]})})]})}),e.jsx("div",{className:"flex-1"}),(d||a&&p&&(!(i!=null&&i.snapshot)||u))&&e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:I("shrink-0",d?"h-2 w-2 rounded-sm bg-amber-500":"deck-pulse-dot")}),e.jsxs("span",{className:I("truncate",d?"text-amber-600 dark:text-amber-400":"text-[hsl(var(--deck-accent))]"),children:[p,y?e.jsxs("span",{className:"hidden sm:inline",children:[" · ",y]}):null]})]})]})}function na(){const{locale:t}=st(),s=wt(n=>n.agentTeamsEnabled),a=f(n=>n.teams),r=f(n=>n.currentSessionRef),o=f(n=>ie(n.historySurfaceSelection)),i=f(n=>n.loadTeams),[l,u]=h.useState({}),[x,c]=h.useState({}),[v,b]=h.useState({}),[d,y]=h.useState(null),[p,N]=h.useState(null),[m,S]=h.useState(null);if(h.useEffect(()=>{o||i(r??void 0)},[s,r,o,i]),o||!s||!r||a.length===0)return null;const g=async n=>{var D;if(K(f.getState()))return;const E=(D=v[n])==null?void 0:D.trim();if(!(!E||d)){y(n),S(null);try{await Be.sendMessage(r,n,x[n]??"*",E),b(F=>({...F,[n]:""})),await i(r)}catch(F){S(F instanceof Error?F.message:U(t,"actionFailed"))}finally{y(null)}}},w=async n=>{if(!K(f.getState())&&!p){N(n),S(null);try{await Be.delete(r,n),await i(r)}catch(E){S(E instanceof Error?E.message:U(t,"actionFailed"))}finally{N(null)}}};return e.jsxs("section",{"aria-label":U(t,"title"),"data-blade-team-panel":!0,className:"shrink-0 border-y border-emerald-300/50 bg-emerald-50/55 dark:border-emerald-800/55 dark:bg-emerald-950/20",children:[m&&e.jsx("div",{role:"alert",className:"border-b border-red-200 bg-red-50 px-4 py-2 font-mono text-[10px] text-red-700 dark:border-red-900 dark:bg-red-950/30 dark:text-red-300 md:px-6",children:m}),a.filter(n=>n.status!=="deleted").map(n=>{var F;const E=l[n.name]??n.status==="running",D=n.tasks.filter(j=>j.status==="completed").length;return e.jsxs("div",{className:"border-b border-emerald-200/40 last:border-0 dark:border-emerald-900/40",children:[e.jsxs("div",{className:"flex min-h-11 items-center gap-2 px-4 py-2 md:px-6",children:[e.jsx("button",{type:"button",onClick:()=>u(j=>({...j,[n.name]:!E})),"aria-label":E?U(t,"collapse"):U(t,"expand"),className:"flex h-7 w-7 items-center justify-center rounded-md text-emerald-700 hover:bg-emerald-100 dark:text-emerald-300 dark:hover:bg-emerald-900/50",children:E?e.jsx(ue,{className:"h-4 w-4"}):e.jsx(oe,{className:"h-4 w-4"})}),e.jsx(Xt,{className:"h-4 w-4 shrink-0 text-emerald-700 dark:text-emerald-300"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("h2",{className:"truncate font-mono text-[11px] font-semibold uppercase text-emerald-800 dark:text-emerald-200",children:n.name}),e.jsxs("span",{className:"font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[n.status," · ",n.members.length-1," ",U(t,"members")," · ",D,"/",n.tasks.length," ",U(t,"tasks")]})]}),n.description&&e.jsx("p",{className:"truncate font-mono text-[10px] text-[hsl(var(--deck-ink-muted))]",children:n.description})]}),e.jsx("button",{type:"button",onClick:()=>void w(n.name),disabled:p===n.name,"aria-label":U(t,"delete"),title:U(t,"delete"),className:"flex h-7 w-7 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] hover:bg-red-50 hover:text-red-600 disabled:opacity-40 dark:hover:bg-red-950/40",children:e.jsx(ne,{className:"h-3.5 w-3.5"})})]}),E&&e.jsxs("div",{className:"max-h-[min(40vh,360px)] overflow-y-auto border-t border-emerald-200/40 px-4 py-3 md:px-6 dark:border-emerald-900/40",children:[e.jsxs("div",{className:"grid gap-x-6 gap-y-2 lg:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-1 font-mono text-[9.5px] font-semibold uppercase text-[hsl(var(--deck-ink-faint))]",children:U(t,"members")}),n.members.map(j=>e.jsxs("div",{className:"flex min-h-7 items-center gap-2 border-b border-[hsl(var(--deck-hairline)/0.55)] py-1 last:border-0",children:[e.jsx("span",{"aria-label":j.status,className:`h-1.5 w-1.5 shrink-0 rounded-full ${j.status==="running"?"bg-emerald-500":j.status==="completed"||j.status==="leader"?"bg-sky-500":j.status==="failed"?"bg-red-500":"bg-zinc-400"}`}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-[hsl(var(--deck-ink))]",children:j.name}),e.jsx("span",{className:"font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:j.subagentType}),j.worktreePath&&e.jsx(qe,{className:"h-3 w-3 text-[hsl(var(--deck-ink-faint))]","aria-label":U(t,"worktree")})]},j.id))]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-1 font-mono text-[9.5px] font-semibold uppercase text-[hsl(var(--deck-ink-faint))]",children:U(t,"tasks")}),n.tasks.length===0?e.jsx("p",{className:"font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:U(t,"noTasks")}):n.tasks.map(j=>e.jsxs("div",{className:"flex min-h-7 items-center gap-2 border-b border-[hsl(var(--deck-hairline)/0.55)] py-1 last:border-0",children:[e.jsxs("span",{className:"w-5 shrink-0 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:["#",j.id]}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-[hsl(var(--deck-ink))]",children:j.subject}),e.jsx("span",{className:"font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:j.status})]},j.id))]})]}),n.peerMessagingEnabled&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-emerald-200/40 pt-3 dark:border-emerald-900/40",children:[e.jsxs("select",{"aria-label":U(t,"recipient"),value:x[n.name]??"*",onChange:j=>c(O=>({...O,[n.name]:j.target.value})),className:"h-8 max-w-32 rounded-md border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))] px-2 font-mono text-[10px]",children:[e.jsx("option",{value:"*",children:U(t,"broadcast")}),n.members.filter(j=>j.status!=="leader").map(j=>e.jsx("option",{value:j.name,children:j.name},j.id))]}),e.jsx("input",{value:v[n.name]??"",onChange:j=>b(O=>({...O,[n.name]:j.target.value})),onKeyDown:j=>{j.key==="Enter"&&g(n.name)},placeholder:U(t,"messagePlaceholder"),className:"h-8 min-w-0 flex-1 rounded-md border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))] px-2 font-mono text-[10.5px] outline-none focus:border-emerald-500"}),e.jsx("button",{type:"button",onClick:()=>void g(n.name),disabled:!((F=v[n.name])!=null&&F.trim())||d===n.name,"aria-label":U(t,"send"),title:U(t,"send"),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-emerald-700 text-white hover:bg-emerald-800 disabled:opacity-40 dark:bg-emerald-600",children:e.jsx(Ge,{className:"h-3.5 w-3.5"})})]})]})]},n.name)})]})}const ia={starting:"chat.turnActivity.starting",thinking:"chat.turnActivity.thinking",responding:"chat.turnActivity.responding",executing_tools:"chat.turnActivity.executingTools",compacting:"chat.turnActivity.compacting",continuing:"chat.turnActivity.continuing"};function oa(t){const s=Math.max(0,Math.floor(t/1e3));if(s<60)return`${s}s`;const a=Math.floor(s/60),r=s%60;return a<60?`${a}m ${r}s`:`${Math.floor(a/60)}h ${a%60}m ${r}s`}function ca(t,s=Date.now()){const a=t==null?void 0:t.snapshot;if(!a)return null;const r=a.activeTools.length+a.activeToolOverflow,o=a.activeTools.slice(0,2).map(l=>l.progress!==void 0&&l.total!==void 0?`${l.name} ${l.progress}/${l.total}`:l.name),i=Math.max(0,a.activeTools.length-o.length+a.activeToolOverflow);return{phaseKey:ia[a.phase],phaseParams:{count:r},tools:o,hiddenTools:i,completedTools:a.toolCallsCompleted,startedTools:a.toolCallsStarted,turn:a.turn,maxTurns:a.maxTurns,elapsed:oa(s-a.startedAt)}}function la({activity:t,memory:s=null}){var x;const a=B(),[r,o]=h.useState(Date.now()),i=(x=t==null?void 0:t.snapshot)==null?void 0:x.startedAt;h.useEffect(()=>{if(i===void 0)return;o(Date.now());const c=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(c)},[i]);const l=ca(t,r);if(!l)return(s==null?void 0:s.outcome)!=="written"?null:e.jsxs("section",{role:"status","aria-live":"polite","data-memory-consolidation-notice":!0,className:"mx-4 mb-2 flex min-h-10 items-center gap-3 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/80 px-3 py-2 text-[hsl(var(--deck-ink))] shadow-sm md:mx-6",children:[e.jsx(_e,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]","aria-hidden":!0}),e.jsx("span",{className:"text-xs font-semibold",children:a("chat.memoryConsolidation.saved",{count:s.entries})})]});const u=[(s==null?void 0:s.outcome)==="written"?a("chat.memoryConsolidation.saved",{count:s.entries}):void 0,...l.tools,l.hiddenTools>0?`+${l.hiddenTools}`:void 0,l.startedTools>0?a("chat.turnActivity.toolCount",{completed:l.completedTools,started:l.startedTools}):void 0,l.turn>0?l.maxTurns===null?a("chat.turnActivity.turn",{turn:l.turn}):a("chat.turnActivity.turnBounded",{turn:l.turn,maxTurns:l.maxTurns}):void 0].filter(c=>c!==void 0);return e.jsxs("section",{role:"status","aria-live":"polite","data-turn-activity-strip":!0,className:"mx-4 mb-2 flex min-h-10 items-center gap-3 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/80 px-3 py-2 text-[hsl(var(--deck-ink))] shadow-sm md:mx-6",children:[e.jsx(_e,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))] motion-safe:animate-pulse","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs font-semibold",children:a(l.phaseKey,l.phaseParams)}),u.length>0&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px] text-[hsl(var(--deck-ink-muted))]",children:u.join(" · ")})]}),e.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-[hsl(var(--deck-ink-muted))]",children:l.elapsed})]})}function da(t){const s=[...t].reverse().find(o=>o.role==="user");if(!s)return null;if(typeof s.content=="string")return{content:s.content,attachments:[]};const a=s.content.filter(o=>o.type==="text").map(o=>o.text).join(`
|
|
63
|
+
`),r=s.content.filter(o=>o.type==="image_url").map((o,i)=>{var u;const l=((u=o.image_url.url.match(/^data:([^;,]+)[;,]/))==null?void 0:u[1])??"application/octet-stream";return{id:`recovery-${s.id}-${i}`,name:`attachment-${i+1}`,mimeType:l,dataUrl:o.image_url.url}});return{content:a,attachments:r}}function ua({messages:t,isLoading:s,isStreaming:a,isStopping:r,errorMessage:o}){const i=B(),[l,u]=h.useState(!1),x=i(o?"status.phase.error":r?"chat.input.action.stopping":a?"status.phase.running":"preview.files.status.ready");return e.jsxs("details",{"data-preview-status-disclosure":!0,open:l,onToggle:c=>u(c.currentTarget.open),className:"group hidden",children:[e.jsxs("summary",{className:"flex h-9 cursor-pointer list-none items-center gap-2 px-3 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[a&&e.jsx("span",{className:"deck-pulse-dot"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:x}),e.jsx(oe,{className:"h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-90"})]}),l&&e.jsxs("div",{"data-preview-activity-details":!0,className:"flex h-[min(44vh,420px)] min-h-0 flex-col border-t border-[hsl(var(--deck-hairline))]",children:[o&&e.jsx("div",{role:"alert",className:"border-b border-red-200/60 bg-red-50/80 px-3 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300",children:o}),e.jsx(lt,{messages:t,isLoading:s}),e.jsx(ut,{})]})]})}function Ta(){var Ie;const t=B(),s=f(k=>k.messages),a=f(k=>k.currentSessionRef),r=f(k=>k.isStreaming),o=f(k=>k.isStopping),i=f(k=>k.providerRecovery),l=f(k=>k.turnActivity),u=f(k=>k.memoryConsolidation),x=f(k=>k.actionStationarity),c=f(k=>k.sessionEventConnectionState),v=f(k=>k.pendingSteeringCount),b=f(k=>k.pendingInputDelivery),d=f(k=>k.recoveredSteeringCount),y=f(k=>k.followUpQueue),p=f(k=>k.followUpQueueMutation),N=f(k=>k.mutateFollowUpQueue),m=f(k=>k.refreshFollowUpQueue),S=f(k=>!!k.historySurfaceSelection),g=f(k=>k.isLoading),w=f(k=>k.error),n=f(k=>k.errorContext),E=f(k=>k.sessions),D=f(k=>k.sendMessage),F=f(k=>k.abortSession),j=f(k=>k.retryTask),O=f(k=>k.retryingTaskKeys),G=Me(k=>k.openSettings),C=f(k=>k.reconnectSessionEvents),T=f(k=>k.clearError),[M,P]=h.useState(null),L=a?E.find(k=>k.sessionId===a.sessionId&&k.projectPath===a.projectPath):void 0,Z=!!w&&((n==null?void 0:n.kind)==="navigation"||!(n!=null&&n.sessionRef)||ze(n.sessionRef,a)),Q=(n==null?void 0:n.failureCode)??((Ie=L==null?void 0:L.taskFailure)==null?void 0:Ie.code),X=((n==null?void 0:n.kind)==="execution"||n!=null&&n.failureCode)&&Q?t(Rt(Q)):w==="queue_full"?t("chat.error.queueFull"):w==="turn_unavailable"||w==="turn_active"?t("chat.error.turnChanged"):w,J=c==="connecting"||c==="reconnecting",ee=r&&c!=="connected",A=a?`session:${le(a)}`:"session:temporary",z=h.useMemo(()=>da(s),[s]),q=a?le(a):"temporary-session",V=!!(a&&(L!=null&&L.taskRetryAvailable)&&(!Q||Ft(Q)))&&((n==null?void 0:n.kind)==="execution"||(n==null?void 0:n.kind)==="task_action"),H=(n==null?void 0:n.kind)==="execution"&&(Q==="authentication"||Q==="permission"||Q==="model_unavailable"),$=a?O.includes(le(a)):!1;h.useEffect(()=>{P(null)},[q]);const W=async k=>K(f.getState())?!1:D({content:k.content,modelId:k.modelId,reasoningEffort:k.reasoningEffort,serviceTier:k.serviceTier,responseVerbosity:k.responseVerbosity,communicationStyle:k.communicationStyle,...k.outputSchema?{outputSchema:k.outputSchema}:{},attachments:k.attachments.map(ge=>({type:"image",content:ge.dataUrl,mimeType:ge.mimeType,name:ge.name}))}),R=()=>{if(!K(f.getState()))return F()},te=async()=>{if(!K(f.getState())){if(H){T(),G("models");return}if(V&&a){T(),await j(a).catch(()=>{});return}if((n==null?void 0:n.kind)==="execution"&&z){P({...z,revision:Date.now()}),T();return}T(),requestAnimationFrame(()=>Ct())}},De=V?t($?"chat.error.action.retryingTask":"chat.error.action.retryTask"):H?t("chat.error.action.checkModels"):(n==null?void 0:n.kind)==="execution"&&z?t("chat.error.action.editResend"):(n==null?void 0:n.kind)==="submission"?t("chat.error.action.returnDraft"):null;return e.jsxs("div",{"data-chat-view":!0,className:"flex h-full flex-col bg-[hsl(var(--deck-canvas))]",children:[e.jsxs("div",{"data-chat-history":!0,className:"contents",children:[Z&&e.jsxs("div",{role:"alert","data-blade-session-error":!0,className:"flex min-h-11 flex-wrap items-center gap-2 border-b border-red-200/60 bg-red-50/80 px-4 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300 sm:px-5",children:[e.jsx(Ee,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 break-words",children:[e.jsx("span",{className:"font-semibold",children:t((n==null?void 0:n.kind)==="submission"?"chat.error.title.submission":(n==null?void 0:n.kind)==="execution"?"chat.error.title.execution":(n==null?void 0:n.kind)==="navigation"?"chat.error.title.navigation":"chat.error.title.generic")})," ",X]}),De&&e.jsxs("button",{type:"button",onClick:()=>void te(),disabled:$,className:"inline-flex min-h-7 shrink-0 items-center gap-1.5 rounded-md border border-red-300/70 bg-white/65 px-2.5 font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60 dark:border-red-800 dark:bg-red-950/45 dark:hover:bg-red-900/60",children:[V?$?e.jsx(_,{className:"h-3 w-3 animate-spin"}):e.jsx(xe,{className:"h-3 w-3"}):e.jsx(it,{className:"h-3 w-3"}),De]}),e.jsx("button",{type:"button",onClick:T,"aria-label":t("chat.error.dismiss"),className:"p-1 text-red-500 rounded transition-colors hover:bg-red-100/60 hover:text-red-700 dark:hover:bg-red-950/60 dark:hover:text-red-100",children:"✕"})]}),(J||c==="offline")&&e.jsxs("div",{role:c==="offline"?"alert":"status","aria-live":"polite",className:"flex min-h-10 flex-wrap items-center gap-2 border-b border-amber-300/60 bg-amber-50/80 px-4 py-2 font-mono text-[11px] text-amber-900 dark:border-amber-800/60 dark:bg-amber-950/35 dark:text-amber-200 sm:px-5",children:[J?e.jsx(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e.jsx(Nt,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:t(J?"chat.connection.reconnecting":"chat.connection.offline")}),c==="offline"&&e.jsxs("button",{type:"button",onClick:()=>{K(f.getState())||C().catch(()=>{})},className:"inline-flex min-h-7 items-center gap-1.5 rounded-md border border-amber-400/70 bg-white/60 px-2.5 font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-700 dark:bg-amber-950/50 dark:hover:bg-amber-900/50",children:[e.jsx(tt,{className:"h-3 w-3"}),t("chat.connection.retry")]})]}),e.jsx(Zt,{}),e.jsx(lt,{messages:s,isLoading:g},a?le(a):"temporary-session"),e.jsx(na,{}),e.jsx(Zs,{})]}),e.jsxs("div",{"data-chat-composer-dock":!0,className:"contents",children:[e.jsx(ua,{messages:s,isLoading:g,isStreaming:r,isStopping:o,errorMessage:Z?X:null},q),e.jsx(Gs,{}),e.jsx(qs,{}),e.jsx(Hs,{queue:S?null:y,mutation:p,onMutate:N,onRefresh:m}),e.jsx(Js,{recovery:S?null:i,stopping:o,onStop:R}),e.jsx(la,{activity:S||i!=null&&i.snapshot||x||L!=null&&L.pendingInteraction?null:l,memory:S?null:u}),e.jsx(St,{draftKey:A,draft:M==null?void 0:M.content,draftAttachments:M==null?void 0:M.attachments,draftRevision:M==null?void 0:M.revision,onSend:W,onAbort:R,disabled:g||ee,isStreaming:r,isStopping:o,pendingSteeringCount:v,pendingInputDelivery:b,recoveredSteeringCount:d,workspacePath:a==null?void 0:a.projectPath},A),e.jsx("div",{"data-chat-primary-status":!0,className:"contents",children:e.jsx(ut,{})})]})]})}export{Ta as ChatView};
|
package/dist/web/assets/{CodeBlockHighlighter-BM1MZv6w.js → CodeBlockHighlighter-BC17_i4m.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as I,j as Ke}from"./vendor-react-DofNRwfy.js";import{f as Ve,p as Se,a as xe,n as Ae,h as Je,s as Qe,d as Ne}from"./MarkdownRenderer-
|
|
1
|
+
import{R as I,j as Ke}from"./vendor-react-DofNRwfy.js";import{f as Ve,p as Se,a as xe,n as Ae,h as Je,s as Qe,d as Ne}from"./MarkdownRenderer-DF-nYnJu.js";import"./index-BZZUIkal.js";import"./vendor-radix-D6QrtXqd.js";import"./session-events-DTVYDdaH.js";import"./copy-BwNmbccC.js";function Pe(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function et(e,t){if(e==null)return{};var n,a,o=Pe(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function se(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function tt(e){if(Array.isArray(e))return se(e)}function nt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function at(e,t){if(e){if(typeof e=="string")return se(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}function ot(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(e){return tt(e)||nt(e)||at(e)||ot()}function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(e)}function rt(e,t){if(Z(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Z(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function it(e){var t=rt(e,"string");return Z(t)=="symbol"?t:t+""}function Te(e,t,n){return(t=it(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ce.apply(null,arguments)}function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ee(Object(n),!0).forEach(function(a){Te(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function st(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var ie={};function lt(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return ie[t]||(ie[t]=st(e)),ie[t]}function ct(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=e.filter(function(r){return r!=="token"}),o=lt(a);return o.reduce(function(r,s){return H(H({},r),n[s])},t)}function Fe(e){return e.join(" ")}function ut(e,t){var n=0;return function(a){return n+=1,a.map(function(o,r){return Ie({node:o,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(r)})})}}function Ie(e){var t=e.node,n=e.stylesheet,a=e.style,o=a===void 0?{}:a,r=e.useInlineStyles,s=e.key,i=t.properties,c=t.type,l=t.tagName,u=t.value;if(c==="text")return u;if(l){var g=ut(n,r),d;if(!r)d=H(H({},i),{},{className:Fe(i.className)});else{var p=Object.keys(n).reduce(function(b,w){return w.split(".").forEach(function(N){b.includes(N)||b.push(N)}),b},[]),f=i.className&&i.className.includes("token")?["token"]:[],v=i.className&&f.concat(i.className.filter(function(b){return!p.includes(b)}));d=H(H({},i),{},{className:Fe(v)||void 0,style:ct(i.className,Object.assign({},i.style,o),n)})}var y=g(t.children);return I.createElement(l,ce({key:s},d),y)}}const dt=function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1};var gt=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$e(Object(n),!0).forEach(function(a){Te(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}var pt=/\n/g;function ft(e){return e.match(pt)}function ht(e){var t=e.lines,n=e.startingLineNumber,a=e.style;return t.map(function(o,r){var s=r+n;return I.createElement("span",{key:"line-".concat(r),className:"react-syntax-highlighter-line-number",style:typeof a=="function"?a(s):a},"".concat(s,`
|
|
3
3
|
`))})}function bt(e){var t=e.codeString,n=e.codeStyle,a=e.containerStyle,o=a===void 0?{float:"left",paddingRight:"10px"}:a,r=e.numberStyle,s=r===void 0?{}:r,i=e.startingLineNumber;return I.createElement("code",{style:Object.assign({},n,o)},ht({lines:t.replace(/\n$/,"").split(`
|
|
4
4
|
`),style:s,startingLineNumber:i}))}function mt(e){return"".concat(e.toString().length,".25em")}function Re(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function De(e,t,n){var a={display:"inline-block",minWidth:mt(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},o=typeof e=="function"?e(t):e,r=R(R({},a),o);return r}function J(e){var t=e.children,n=e.lineNumber,a=e.lineNumberStyle,o=e.largestLineNumber,r=e.showInlineLineNumbers,s=e.lineProps,i=s===void 0?{}:s,c=e.className,l=c===void 0?[]:c,u=e.showLineNumbers,g=e.wrapLongLines,d=e.wrapLines,p=d===void 0?!1:d,f=p?R({},typeof i=="function"?i(n):i):{};if(f.className=f.className?[].concat(le(f.className.trim().split(/\s+/)),le(l)):l,n&&r){var v=De(a,n,o);t.unshift(Re(n,v))}return g&u&&(f.style=R({display:"flex"},f.style)),{type:"element",tagName:"span",properties:f,children:t}}function ze(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var a=0;a<e.length;a++){var o=e[a];if(o.type==="text")n.push(J({children:[o],className:le(new Set(t))}));else if(o.children){var r,s=t.concat(((r=o.properties)===null||r===void 0?void 0:r.className)||[]);ze(o.children,s).forEach(function(i){return n.push(i)})}}return n}function yt(e,t,n,a,o,r,s,i,c){var l,u=ze(e.value),g=[],d=-1,p=0;function f(S,k){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return J({children:S,lineNumber:k,lineNumberStyle:i,largestLineNumber:s,showInlineLineNumbers:o,lineProps:n,className:x,showLineNumbers:a,wrapLongLines:c,wrapLines:t})}function v(S,k){if(a&&k&&o){var x=De(i,k,s);S.unshift(Re(k,x))}return S}function y(S,k){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||x.length>0?f(S,k,x):v(S,k)}for(var b=function(){var k=u[p],x=k.children[0].value,E=ft(x);if(E){var j=x.split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B5mUEr6D.js","assets/vendor-react-DofNRwfy.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as le,j as _,Z as Ke,r as at,L as Be,N as q,af as gr,ag as kr,S as wr,p as Vt,R as Kt,B as yr,a as W,J as Jt,d as jr,ah as Nr,z as Sr,u as je,U as mt,n as Qt,F as Xt,ai as Cr,s as Je,aj as dt,l as Er,X as Tr,x as Rr,_ as Lr}from"./index-
|
|
2
|
+
import{c as le,j as _,Z as Ke,r as at,L as Be,N as q,af as gr,ag as kr,S as wr,p as Vt,R as Kt,B as yr,a as W,J as Jt,d as jr,ah as Nr,z as Sr,u as je,U as mt,n as Qt,F as Xt,ai as Cr,s as Je,aj as dt,l as Er,X as Tr,x as Rr,_ as Lr}from"./index-BZZUIkal.js";import{r as i,j as e}from"./vendor-react-DofNRwfy.js";import{x as Pr,a4 as Ct,M as Qe,Z,_ as Et}from"./session-events-DTVYDdaH.js";import{a as Ir,A as Dr,C as Fr}from"./chevrons-up-down-DFQNAYac.js";import{A as $r,E as Tt}from"./external-link-Dr_8T3Ah.js";import{A as Mr}from"./arrow-left-Y8E5lnQ1.js";import{A as Ar,F as _r}from"./folder-DcgRdL_P.js";import{C as Yt}from"./chevron-right-DmM1dl1s.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
3
3
|
* @license lucide-react v0.300.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as b}from"./vendor-react-DofNRwfy.js";import{c as J,u as U,b as j,d as z,E as ce,I as ve,j as P,L as E,R as ge,w as je,J as Ne,K as ye,t as we,A as Se,D as Pe,e as Te,f as Ce,g as De,h as Ie,M as ie,i as Ae,N as ne,a as s,O as _e,Q as Ke,U as Ee,V as Me,W as Fe,p as Oe,Y as Re}from"./index-
|
|
1
|
+
import{j as e,r as b}from"./vendor-react-DofNRwfy.js";import{c as J,u as U,b as j,d as z,E as ce,I as ve,j as P,L as E,R as ge,w as je,J as Ne,K as ye,t as we,A as Se,D as Pe,e as Te,f as Ce,g as De,h as Ie,M as ie,i as Ae,N as ne,a as s,O as _e,Q as Ke,U as Ee,V as Me,W as Fe,p as Oe,Y as Re}from"./index-BZZUIkal.js";import{M as Le,_ as Q,Z as O}from"./session-events-DTVYDdaH.js";import{C as le}from"./calendar-clock-Cl0Spu99.js";import{P as qe}from"./pencil-CYRCKPnu.js";import{A as ze}from"./archive-EoUobrxu.js";import{C as Be}from"./clock-3-D3dzsSrc.js";import{P as Ve}from"./play-CfNxuNSd.js";import{P as Qe}from"./pause-DXzNhd_w.js";import{P as Ue}from"./plus-DBUPwsji.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|