meshy-node 0.2.3 → 0.2.5
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/README.md +1 -1
- package/dashboard/assets/DashboardPage-DeFE8aKR.js +120 -0
- package/dashboard/assets/DashboardShared-B08ZGEU3.js +59 -0
- package/dashboard/assets/{DiffTab-BNtQFb4c.js → DiffTab-D6XXV_vj.js} +3 -3
- package/dashboard/assets/{FilesTab-DT4JyvzA.js → FilesTab-DUebfVJo.js} +12 -12
- package/dashboard/assets/PreviewTab-CfNP0Ll3.js +16 -0
- package/dashboard/assets/SharedConversationPage-D2ncPenP.js +7 -0
- package/dashboard/assets/{file-B9Sgu9EP.js → file-C-p99c1E.js} +1 -1
- package/dashboard/assets/folder-C0oopt2q.js +11 -0
- package/dashboard/assets/{index-Br6dysEj.js → index-B7PaE6U7.js} +26 -25
- package/dashboard/assets/index-CxJE8HAC.css +1 -0
- package/dashboard/index.html +2 -2
- package/main.cjs +2297 -1168
- package/package.json +1 -1
- package/runtime-metadata.json +5 -5
- package/dashboard/assets/DashboardPage-CcD2IDII.js +0 -183
- package/dashboard/assets/PreviewTab-DhvYgvSm.js +0 -16
- package/dashboard/assets/index-Dl1FKoUn.css +0 -1
package/package.json
CHANGED
package/runtime-metadata.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageName": "meshy-node",
|
|
3
|
-
"packageVersion": "0.2.
|
|
3
|
+
"packageVersion": "0.2.5",
|
|
4
4
|
"packages": {
|
|
5
5
|
"workspace": {
|
|
6
6
|
"name": "meshy",
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.5"
|
|
8
8
|
},
|
|
9
9
|
"node": {
|
|
10
10
|
"name": "meshy-node",
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.5"
|
|
12
12
|
},
|
|
13
13
|
"core": {
|
|
14
14
|
"name": "@meshy/core",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"url": "https://github.com/penwa_microsoft/meshy",
|
|
28
|
-
"branch": "
|
|
29
|
-
"commit": "
|
|
28
|
+
"branch": "shareChat",
|
|
29
|
+
"commit": "b60443c"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilesTab-DT4JyvzA.js","assets/index-Br6dysEj.js","assets/index-Dl1FKoUn.css","assets/file-B9Sgu9EP.js","assets/PreviewTab-DhvYgvSm.js","assets/DiffTab-BNtQFb4c.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as B,r as o,j as e,a as A,b as bn,d as jn,e as yn,D as vn,f as Nn,g as kn,B as ke,h as wn,i as P,X as qe,C as Pe,k as Xt,l as Is,m as We,R as Cn,T as Sn,n as Us,P as _n,u as yt,W as An,o as Tn,p as Ot,q as En,s as Dn,t as zs,O as Mn,v as Pn,w as Bs,x as Vs,y as $n,z as Rn,A as Ln,F as Fn,E as On,G as ue,S as we,H as Ce,I as Me,J as Se,K as ye,L as qs,M as Ws,N as In,Q as Hs,U as Fe,V as Oe,_ as Zt,Y as Un,Z as Ks,$ as Js,a0 as Gs,a1 as zn,a2 as Qt,a3 as Bn,a4 as Vn,a5 as qn,a6 as Wn,a7 as Hn,a8 as Kn,a9 as Jn,aa as Gn,ab as Yn,ac as Xn,ad as Zn,ae as Qn,af as ea,ag as ta,ah as sa,ai as ra,aj as na,ak as aa,al as oa,am as la,an as ia,ao as da}from"./index-Br6dysEj.js";/**
|
|
3
|
-
* @license lucide-react v1.7.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 ca=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],ua=B("archive",ca);/**
|
|
8
|
-
* @license lucide-react v1.7.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 ma=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xa=B("arrow-up",ma);/**
|
|
13
|
-
* @license lucide-react v1.7.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 fa=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],ha=B("brain",fa);/**
|
|
18
|
-
* @license lucide-react v1.7.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 pa=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ze=B("chevron-right",pa);/**
|
|
23
|
-
* @license lucide-react v1.7.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 ga=[["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"}]],ba=B("circle-question-mark",ga);/**
|
|
28
|
-
* @license lucide-react v1.7.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 ja=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ya=B("circle",ja);/**
|
|
33
|
-
* @license lucide-react v1.7.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 va=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vt=B("copy",va);/**
|
|
38
|
-
* @license lucide-react v1.7.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 Na=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],ka=B("flag",Na);/**
|
|
43
|
-
* @license lucide-react v1.7.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 wa=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ca=B("folder",wa);/**
|
|
48
|
-
* @license lucide-react v1.7.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const Sa=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],_a=B("funnel",Sa);/**
|
|
53
|
-
* @license lucide-react v1.7.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const Aa=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],vs=B("git-branch",Aa);/**
|
|
58
|
-
* @license lucide-react v1.7.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const Ta=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ea=B("globe",Ta);/**
|
|
63
|
-
* @license lucide-react v1.7.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const Da=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],It=B("history",Da);/**
|
|
68
|
-
* @license lucide-react v1.7.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const Ma=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Ut=B("image-plus",Ma);/**
|
|
73
|
-
* @license lucide-react v1.7.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const Pa=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],$a=B("laptop",Pa);/**
|
|
78
|
-
* @license lucide-react v1.7.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const Ra=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],La=B("list-checks",Ra);/**
|
|
83
|
-
* @license lucide-react v1.7.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const Fa=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fe=B("loader-circle",Fa);/**
|
|
88
|
-
* @license lucide-react v1.7.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const Oa=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],Ys=B("message-square-plus",Oa);/**
|
|
93
|
-
* @license lucide-react v1.7.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const Ia=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Xs=B("panel-left-close",Ia);/**
|
|
98
|
-
* @license lucide-react v1.7.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const Ua=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],za=B("panel-left-open",Ua);/**
|
|
103
|
-
* @license lucide-react v1.7.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const Ba=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],Zs=B("panel-right-close",Ba);/**
|
|
108
|
-
* @license lucide-react v1.7.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const Va=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],qa=B("panel-right-open",Va);/**
|
|
113
|
-
* @license lucide-react v1.7.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const Wa=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Nt=B("pencil",Wa);/**
|
|
118
|
-
* @license lucide-react v1.7.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const Ha=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ka=B("plus",Ha);/**
|
|
123
|
-
* @license lucide-react v1.7.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const Ja=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ga=B("rotate-ccw",Ja);/**
|
|
128
|
-
* @license lucide-react v1.7.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const Ya=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ns=B("search",Ya);/**
|
|
133
|
-
* @license lucide-react v1.7.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const Xa=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Qs=B("send",Xa);/**
|
|
138
|
-
* @license lucide-react v1.7.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const Za=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Qa=B("shield-alert",Za);/**
|
|
143
|
-
* @license lucide-react v1.7.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const eo=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],to=B("shield-check",eo);/**
|
|
148
|
-
* @license lucide-react v1.7.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const so=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ro=B("sliders-horizontal",so);/**
|
|
153
|
-
* @license lucide-react v1.7.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const no=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ao=B("trash-2",no);/**
|
|
158
|
-
* @license lucide-react v1.7.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const oo=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],lo=B("user",oo);/**
|
|
163
|
-
* @license lucide-react v1.7.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const io=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],er=B("wrench",io),co=new Set(["assigned","running"]);function uo(t,s){return t.reduce((r,n)=>n.assignedTo===s&&co.has(n.status)?r+1:r,0)}function Ke(t){return(t==null?void 0:t.toLowerCase())==="devtunnel"}function mo(t){return t?Ke(t)?"DevTunnel":t.charAt(0).toUpperCase()+t.slice(1):"Direct"}function es(t,s){return Ke(s??t.transportType)||!!t.devtunnelEndpoint}function tr(t,s){return!Ke(s??t.transportType)}function sr(t,s){const r=s??t.transportType;return Ke(r)?"DevTunnel":t.devtunnelEndpoint?"Direct + DevTunnel":mo(r)}function ks(t,s){return!t&&!s}function xo({routeTaskId:t,creatingTask:s,internalSelectedTaskId:r,sortedTaskIds:n}){return t||(s?null:r??n[0]??null)}function fo(t,s){return[s,...t.filter(r=>r.id!==s.id)]}function ho(t,s){const r=s.taskId,n=s.updates;return typeof r!="string"||!n||typeof n!="object"?t:t.map(a=>a.id===r?{...a,...n}:a)}const po=new Set(["completed","failed","cancelled","archived"]);function go(t,s){const r=new Set(s);return new Set(Array.from(t).filter(n=>r.has(n)))}function bo(t,s){const r=new Set(s);if(r.size===0)return!1;const n=t.filter(a=>r.has(a.id));return n.length===r.size&&n.every(a=>po.has(a.status))}function jo(t,s){var n;const r=new Set(s);return((n=t.find(a=>!r.has(a.id)))==null?void 0:n.id)??null}function ct(t){return typeof t=="object"&&t!==null}function yo(t){if(!ct(t))return null;if(t.type==="text"&&typeof t.text=="string"){const s=t.text.trim();return s?{type:"text",text:s}:null}if(t.type==="image"&&typeof t.mediaType=="string"&&typeof t.data=="string"){const s=t.mediaType.trim(),r=t.data;return!s||!r?null:{type:"image",mediaType:s,data:r,...typeof t.filename=="string"&&t.filename.trim()?{filename:t.filename.trim()}:{}}}if(t.type==="tool_result"&&typeof t.toolUseId=="string"&&typeof t.content=="string"){const s=t.toolUseId.trim(),r=t.content.trim();return!s||!r?null:{type:"tool_result",toolUseId:s,content:r,...typeof t.isError=="boolean"?{isError:t.isError}:{}}}return null}function vo(t){if(!ct(t))return null;if(t.type==="text"&&typeof t.text=="string"){const n=t.text.trim();return n?{type:"text",text:n}:null}if(t.type!=="image"||!ct(t.source)){if(t.type==="tool_result"&&typeof t.tool_use_id=="string"&&typeof t.content=="string"){const n=t.tool_use_id.trim(),a=t.content.trim();return!n||!a?null:{type:"tool_result",toolUseId:n,content:a,...typeof t.is_error=="boolean"?{isError:t.is_error}:{}}}return null}const s=typeof t.source.media_type=="string"?t.source.media_type.trim():"",r=typeof t.source.data=="string"?t.source.data:"";return!s||!r?null:{type:"image",mediaType:s,data:r}}function Ye(t){if(typeof t=="string"){const s=t.trim();return s?[{type:"text",text:s}]:[]}return Array.isArray(t)?t.map(s=>yo(s)??vo(s)).filter(s=>s!==null):[]}function rr(t,s){const r=t.trim();return[...r?[{type:"text",text:r}]:[],...s]}function No(t){return{role:"user",content:t.map(s=>s.type==="text"?{type:"text",text:s.text}:s.type==="tool_result"?{type:"tool_result",tool_use_id:s.toolUseId,content:s.content,...typeof s.isError=="boolean"?{is_error:s.isError}:{}}:{type:"image",source:{type:"base64",media_type:s.mediaType,data:s.data}})}}function $t(t,s=new Date().toISOString()){return{type:"user",message:No(t),timestamp:s}}function rt(t){if(t.type!=="user"||t.isSynthetic===!0)return null;if(typeof t.message=="string"){const s=Ye(t.message);return s.length>0?s:null}if(ct(t.message)&&Array.isArray(t.message.content)){const s=Ye(t.message.content);return s.length>0?s:null}if(Array.isArray(t.content)){const s=Ye(t.content);return s.length>0?s:null}return null}function ko(t){return Ye(t.payload.initialMessage)}function Qe(t){return t.map(s=>{if(s.type==="text")return`t:${s.text}`;if(s.type==="tool_result")return`r:${s.toolUseId}:${s.isError===!0?"1":"0"}:${s.content}`;const r=s.data.slice(0,32),n=s.data.slice(-32);return`i:${s.mediaType}:${s.data.length}:${r}:${n}`}).join("|")}function wo(t){return t.map(s=>s.type==="text"?s.text:s.type==="tool_result"?s.content:"").filter(Boolean).join(`
|
|
168
|
-
`)}function ts(t){return`data:${t.mediaType};base64,${t.data}`}function Co(t){var a,l;if(!t)return[];const s=[],r=t.items;if(r)for(const d of Array.from(r)){if((d==null?void 0:d.kind)!=="file"||!((a=d.type)!=null&&a.startsWith("image/")))continue;const c=(l=d.getAsFile)==null?void 0:l.call(d);c&&c.type.startsWith("image/")&&s.push(c)}if(s.length>0)return s;const n=t.files;return n?Array.from(n).filter(d=>d.type.startsWith("image/")):[]}function So(t){return new Promise((s,r)=>{const n=new FileReader;n.onload=()=>{if(typeof n.result!="string"){r(new Error(`Failed to read ${t.name}`));return}s(n.result)},n.onerror=()=>r(n.error??new Error(`Failed to read ${t.name}`)),n.readAsDataURL(t)})}async function ws(t){return Promise.all(Array.from(t).map(async s=>{if(!s.type.startsWith("image/"))throw new Error(`${s.name} is not an image`);const r=await So(s),n=r.indexOf(",");if(n===-1)throw new Error(`Failed to parse ${s.name}`);return{type:"image",mediaType:s.type||"image/png",data:r.slice(n+1),filename:s.name}}))}function nt(t){return typeof t=="object"&&t!==null}function _o(t){return nt(t)&&typeof t.name=="string"&&t.name.toLowerCase()==="askuserquestion"}function Ao(t){return!nt(t)||typeof t.label!="string"||!t.label.trim()?null:{label:t.label.trim(),description:typeof t.description=="string"?t.description.trim():""}}function To(t){if(!nt(t)||typeof t.question!="string"||!t.question.trim())return null;const s=Array.isArray(t.options)?t.options.map(Ao).filter(r=>r!==null):[];return s.length===0?null:{header:typeof t.header=="string"&&t.header.trim()?t.header.trim():void 0,question:t.question.trim(),multiSelect:t.multiSelect===!0,options:s}}function zt(t){if(!nt(t)||!Array.isArray(t.questions))return null;const s=t.questions.map(To).filter(r=>r!==null);return s.length===0?null:{questions:s}}function Je(t){return JSON.stringify({questions:t.questions})}function kt(t){const s=zt(t);if(s)return s;if(_o(t)){const r=nt(t.input)?t.input:void 0,n=zt(r);return n?{...n,...typeof t.id=="string"&&t.id.trim()?{toolUseId:t.id.trim()}:{}}:null}return null}function Eo(t){var a;const s=t.trim();if(!s)return[];const r=[s],n=s.matchAll(/```(?:json)?\s*([\s\S]*?)```/gi);for(const l of n){const d=(a=l[1])==null?void 0:a.trim();d&&r.push(d)}return r}function wt(t){for(const s of Eo(t))try{const r=JSON.parse(s),n=zt(r);if(n)return n}catch{}return null}function Do(t){return t.questions.map(s=>s.options.length>0?[0]:[])}function Mo(t,s){return t.questions.every((r,n)=>(s[n]??[]).length>0)}function Po(t,s){const n=t.questions.map((a,l)=>{const d=[...new Set(s[l]??[])].sort((c,m)=>c-m).filter(c=>a.options[c]!==void 0);return{header:a.header??null,question:a.question,multiSelect:a.multiSelect,selectedOptions:d.map(c=>a.options[c]).filter(c=>c!==void 0)}}).map(a=>{const l=a.header??a.question,d=a.selectedOptions.map(c=>c.label).join(a.multiSelect?", ":"");return`${l}: ${d}`}).join(`
|
|
169
|
-
`);return t.toolUseId?[{type:"tool_result",toolUseId:t.toolUseId,content:n,isError:!1}]:[{type:"text",text:n}]}function et(t){return typeof t=="object"&&t!==null}function $o(t){if(!t)return;const s=["file_path","path","command"].map(r=>t[r]).find(r=>typeof r=="string"&&r.trim().length>0);return s==null?void 0:s.trim()}function Ro(t){const s=t.toLowerCase();return s.includes(" permission to write ")?"Write":s.includes(" permission to edit ")?"Edit":s.includes(" permission to run ")||s.includes(" permission to execute ")?"Bash":"Action"}function Bt(t){const s=t.trim();if(!s.startsWith("Awaiting your permission to "))return null;const r=s.match(/`([^`]+)`/);return{requests:[{toolName:Ro(s),target:r==null?void 0:r[1],summary:s}]}}function Lo(t){if(!Array.isArray(t.permission_denials))return null;const s=[];for(const r of t.permission_denials){if(!et(r)||typeof r.tool_name!="string")continue;const n=et(r.tool_input)?r.tool_input:void 0,a=$o(n),l=typeof t.result=="string"&&t.result.trim().length>0?t.result.trim():`Awaiting your permission to use ${r.tool_name}${a?` on \`${a}\``:""}.`;s.push({toolName:r.tool_name,...typeof r.tool_use_id=="string"?{toolUseId:r.tool_use_id}:{},...a?{target:a}:{},summary:l})}return s.length>0?{requests:s}:null}function Cs(t){if(!Array.isArray(t))return null;for(const s of t){if(!et(s)||s.type!=="text"||typeof s.text!="string")continue;const r=Bt(s.text);if(r)return r}return null}function ss(t){if(!et(t))return null;const s=Lo(t);if(s)return s;if(typeof t.result=="string"){const n=Bt(t.result);if(n)return n}if(typeof t.message=="string"){const n=Bt(t.message);if(n)return n}if(et(t.message)){const n=ss(t.message);if(n)return n;const a=Cs(t.message.content);if(a)return a}const r=Cs(t.content);return r||null}function Fo(t){return JSON.stringify(t.requests.map(s=>({toolName:s.toolName,target:s.target??null,summary:s.summary})))}function Oo(t,s){return t.requests.map(r=>{const n=r.target?` for \`${r.target}\``:"",a=s==="approve"?`Approved. Proceed with the requested ${r.toolName} action${n}.`:`Denied. Do not proceed with the requested ${r.toolName} action${n}. Ask for another approach if needed.`;return r.toolUseId?{type:"tool_result",toolUseId:r.toolUseId,content:a,isError:s==="deny"}:s==="approve"?{type:"text",text:a}:{type:"text",text:a}})}function nr(t){return rt(t)!==null}function ut(t){if(t.type==="user"){const s=rt(t),r=typeof t.timestamp=="string"?t.timestamp:"";if(s)return`user:${r}:${Qe(s)}`}return JSON.stringify(t)}function Vt(t){const s=kt(t);return s?`question:${Je(s)}`:null}function Io(t){const s=ss(t);return s?`permission:${Fo(s)}`:null}function Ss(t){if(!Array.isArray(t))return null;const s=new Set;for(const r of t){const n=Vt(r);if(n){s.add(n);continue}if(typeof r=="object"&&r!==null&&r.type==="text"&&typeof r.text=="string"){const a=wt(r.text);a&&s.add(Je(a))}}return s.size===0?null:Array.from(s).sort().join("|")}function Uo(t){const s=Vt(t);if(s)return s;if(typeof t.message=="string"){const r=wt(t.message);return r?Je(r):null}if(typeof t.message=="object"&&t.message!==null){const r=Vt(t.message);return r||Ss(t.message.content)}return Ss(t.content)}function zo(t){return Io(t)}function Bo(t,s,r){const n=typeof s.timestamp=="string"?s.timestamp:"";return`${t}-${n}-${r}`}function Vo(t,s){const r=s.map(a=>({...a})),n=new Set(r.map(ut));for(const a of t){const l=ut(a);n.has(l)||(r.push(a),n.add(l))}return r}function qo(t,s){const r=ut(s);return t.some(n=>ut(n)===r)?t:[...t,{...s}]}function Wo(t,s){const r=new Map;for(const n of s){const a=rt(n);if(!a)continue;const l=Qe(a);r.set(l,(r.get(l)??0)+1)}return t.filter(n=>{const a=Qe(n.content),l=r.get(a)??0;return l<=0?!0:(r.set(a,l-1),!1)})}function Ho(t,s){const r=Qe(s),n=t.findIndex(a=>Qe(a.content)===r);return n===-1?t:t.filter((a,l)=>l!==n)}function Ko(t){return t.some(nr)}function Jo(t){const s=[];let r=null;for(const n of t){if(nr(n)){r=null,s.push(n);continue}const a=zo(n)??Uo(n);a&&a===r||(s.push(n),a&&(r=a))}return s}const Le=o.forwardRef(({className:t,type:s,...r},n)=>e.jsx("input",{type:s,className:A("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...r}));Le.displayName="Input";var Go=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yo=Go.reduce((t,s)=>{const r=bn(`Primitive.${s}`),n=o.forwardRef((a,l)=>{const{asChild:d,...c}=a,m=d?r:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(m,{...c,ref:l})});return n.displayName=`Primitive.${s}`,{...t,[s]:n}},{}),Xo="Label",ar=o.forwardRef((t,s)=>e.jsx(Yo.label,{...t,ref:s,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=t.onMouseDown)==null||a.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));ar.displayName=Xo;var or=ar;const Zo=jn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ee=o.forwardRef(({className:t,...s},r)=>e.jsx(or,{ref:r,className:A(Zo(),t),...s}));Ee.displayName=or.displayName;function Qo({onAdded:t}){const[s,r]=o.useState(""),[n,a]=o.useState(!1),[l,d]=o.useState(null),c=o.useCallback(async m=>{if(m.preventDefault(),!!s.trim()){a(!0),d(null);try{await yn({leaderEndpoint:s.trim(),transport:"devtunnel"}),t()}catch(x){d(x instanceof Error?x.message:"Failed to join node")}finally{a(!1)}}},[s,t]);return e.jsx(vn,{className:"overflow-hidden border-border/60 bg-transparent p-0 shadow-none sm:max-w-xl",children:e.jsxs("div",{className:"overflow-hidden rounded-[28px] border border-border/60 bg-background/95 p-0 shadow-[0_40px_120px_-60px_rgba(0,0,0,0.88)] backdrop-blur-xl",children:[e.jsx("div",{className:"border-b border-border/60 px-6 py-5",children:e.jsxs(Nn,{className:"space-y-2 text-left",children:[e.jsx(kn,{className:"text-2xl tracking-tight",children:"Join node"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verify the remote leader's DevTunnel endpoint, sync this node's tasks to that leader, and join the cluster as a follower."})]})}),e.jsxs("form",{onSubmit:c,className:"space-y-4 px-6 py-5",children:[l&&e.jsx("div",{className:"rounded-[20px] border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:l}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ee,{htmlFor:"leader-endpoint",children:"Leader endpoint"}),e.jsx(ke,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px] uppercase tracking-[0.16em]",children:"DevTunnel only"})]}),e.jsx(Le,{id:"leader-endpoint",type:"url",value:s,onChange:m=>r(m.target.value),placeholder:"https://your-leader.devtunnels.ms",className:"h-11 rounded-2xl border-border/70 bg-background/70"})]}),e.jsx("div",{className:"rounded-[20px] border border-border/60 bg-background/45 px-4 py-3 text-sm text-muted-foreground",children:"This does not switch the local node transport or auto-enable a local DevTunnel. Leaving later will detach this node from the remote leader and make it leader of its own cluster again."}),e.jsx(wn,{className:"border-t border-border/60 pt-4",children:e.jsx(P,{type:"submit",disabled:!s.trim()||n,className:"rounded-2xl",children:n?"Joining...":"Join node"})})]})]})})}function lr(){const[t,s]=o.useState([]),[r,n]=o.useState(null),a=o.useRef(null),l=o.useCallback(()=>{var u;(u=a.current)==null||u.click()},[]),d=o.useCallback(async u=>{const p=Array.from(u.target.files??[]);if(p.length!==0)try{const g=await ws(p);s(b=>[...b,...g]),n(null)}catch(g){n(g instanceof Error?g.message:"Failed to attach image")}finally{u.target.value=""}},[]),c=o.useCallback(async u=>{const p=Co(u.clipboardData);if(p.length!==0){u.preventDefault();try{const g=await ws(p);s(b=>[...b,...g]),n(null)}catch(g){n(g instanceof Error?g.message:"Failed to attach image")}}},[]),m=o.useCallback(u=>{s(p=>p.filter((g,b)=>b!==u))},[]),x=o.useCallback(()=>{s([]),n(null)},[]);return{images:t,error:r,fileInputRef:a,pickImages:l,handleFileChange:d,handlePaste:c,removeImage:m,clearImages:x}}function el({onSend:t,disabled:s,disabledReason:r="Chat is waiting on the agent.",placeholder:n="Send a follow-up message...",contextItems:a=[],running:l=!1,onStop:d}){const[c,m]=o.useState(""),x=o.useRef(null),{images:u,error:p,fileInputRef:g,pickImages:b,handleFileChange:h,handlePaste:N,removeImage:_,clearImages:y}=lr(),C=o.useCallback(()=>{x.current&&(x.current.style.height="auto")},[]),M=o.useCallback(()=>{const $=rr(c,u);$.length===0||s||(t($),m(""),y(),C())},[c,u,s,t,y,C]),O=o.useCallback($=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),M())},[M]),T=o.useCallback(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${Math.min(x.current.scrollHeight,220)}px`)},[]),K=!s&&!l&&(c.trim().length>0||u.length>0),Y=l&&!!d,I=l?d?"Task is running — click to stop":"Task is running...":s?r:"Enter sends, Shift+Enter adds a line";return e.jsxs("div",{className:"border-t border-border/60 bg-background/55 px-2 py-1.5 backdrop-blur-xl sm:px-4 sm:py-2",children:[a.length>0&&e.jsx("div",{className:"flex flex-wrap items-center gap-2 px-3 pb-2.5",children:a.map($=>e.jsxs("div",{className:"inline-flex max-w-full items-center gap-1.5 rounded-full border border-border/60 bg-muted/40 px-3 py-1 text-xs",children:[e.jsx("span",{className:"shrink-0 text-[9px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:$.label}),e.jsx("span",{className:`truncate text-foreground/90 ${$.mono?"font-mono text-[11px]":""}`,children:$.value})]},`${$.label}:${$.value}`))}),e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-border/65 bg-card/85 shadow-[0_28px_90px_-62px_rgba(0,0,0,var(--panel-shadow-alpha))] sm:rounded-[40px]",children:[e.jsx("input",{ref:g,type:"file",accept:"image/*",multiple:!0,onChange:h,className:"hidden"}),u.length>0&&e.jsx("div",{className:"px-3 pt-3 sm:px-6 sm:pt-6",children:e.jsx("div",{className:"flex flex-wrap gap-3",children:u.map(($,L)=>e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:ts($),alt:$.filename??`attachment ${L+1}`,className:"h-24 w-24 rounded-[22px] border border-border/70 object-cover"}),e.jsx("button",{type:"button",onClick:()=>_(L),className:"absolute -top-2 -right-2 flex h-7 w-7 items-center justify-center rounded-full border border-border/70 bg-background text-muted-foreground transition-colors hover:text-foreground","aria-label":`Remove ${$.filename??`image ${L+1}`}`,children:e.jsx(qe,{className:"h-3.5 w-3.5"})})]},`${$.filename??"image"}-${L}`))})}),e.jsxs("div",{className:"flex items-end gap-2 px-3 pt-3 pb-3 sm:px-6 sm:pt-4 sm:pb-4",children:[e.jsx("textarea",{ref:x,value:c,onChange:$=>m($.target.value),onKeyDown:O,onPaste:N,onInput:T,placeholder:n,disabled:s,rows:1,className:"min-h-[2.5rem] flex-1 resize-none bg-transparent px-0 py-1 text-sm leading-7 text-foreground placeholder:text-muted-foreground/70 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"}),e.jsxs(P,{type:"button",variant:"ghost",onClick:b,disabled:s,className:"mb-0.5 h-9 shrink-0 gap-1.5 rounded-full px-2 text-xs text-muted-foreground hover:text-foreground sm:px-3",title:"Attach images",children:[e.jsx(Ut,{className:"h-4 w-4 sm:h-3.5 sm:w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Images"})]}),e.jsx("span",{title:I,children:e.jsx(P,{onClick:l?d:M,disabled:l?!Y:!K,size:"icon","aria-label":l?"Stop running task":"Send message",className:"mb-0.5 h-9 w-9 shrink-0 rounded-full bg-primary/85 text-primary-foreground shadow-sm hover:bg-primary",children:l?e.jsx(fe,{className:"h-4 w-4 animate-spin"}):e.jsx(Qs,{className:"h-4 w-4"})})})]}),p&&e.jsx("div",{className:"border-t border-destructive/20 bg-destructive/10 px-3 py-2 text-xs text-destructive sm:px-6 sm:py-3",children:p})]})]})}function tt({payload:t,disabled:s=!1,bypassEnabled:r=!1,onBypassChange:n,onSubmit:a}){const[l,d]=o.useState(()=>r?Do(t):t.questions.map(()=>[])),[c,m]=o.useState(!1),[x,u]=o.useState(!1);o.useEffect(()=>{r&&d(h=>h.map((N,_)=>{var y;return N.length>0?N:(y=t.questions[_])!=null&&y.options.length?[0]:[]}))},[r,t]);const p=Mo(t,l)&&!s&&!c&&!x&&!!a,g=(h,N)=>{s||x||c||d(_=>_.map((y,C)=>{if(C!==h)return y;const M=t.questions[C];return M?M.multiSelect?y.includes(N)?y.filter(O=>O!==N):[...y,N].sort((O,T)=>O-T):[N]:y}))},b=async()=>{if(!p||!a)return;m(!0);const h=await a(Po(t,l));m(!1),h&&u(!0)};return e.jsxs("div",{className:"rounded-[24px] border border-primary/20 bg-primary/5 p-4 shadow-[0_24px_80px_-60px_hsl(var(--primary)/0.9)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-primary/20 bg-primary/10 text-primary",children:e.jsx(ba,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-primary/80",children:"Ask User Question"}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"Select the answer you want to send back to the agent."})]})]}),e.jsxs(P,{type:"button",variant:r?"secondary":"outline",size:"sm",onClick:()=>n==null?void 0:n(!r),className:"rounded-full",children:[e.jsx(to,{className:"h-4 w-4"}),r?"Bypass on":"Bypass future questions"]})]}),e.jsx("div",{className:"mt-4 space-y-4",children:t.questions.map((h,N)=>{const _=l[N]??[];return e.jsxs("div",{className:"space-y-3 rounded-[20px] border border-border/60 bg-background/75 p-4",children:[e.jsxs("div",{children:[h.header&&e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:h.header}),e.jsx("div",{className:"mt-1 text-sm font-medium leading-6 text-foreground",children:h.question}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:h.multiSelect?"Select one or more options.":"Select one option."})]}),e.jsx("div",{className:"space-y-2",children:h.options.map((y,C)=>{const M=_.includes(C);return e.jsxs("button",{type:"button",onClick:()=>g(N,C),disabled:s||c||x,"aria-pressed":M,className:A("flex w-full items-start gap-3 rounded-[18px] border px-4 py-3 text-left transition-colors",M?"border-primary/50 bg-primary/10 text-foreground":"border-border/60 bg-background/80 text-foreground hover:border-primary/30 hover:bg-primary/5"),children:[e.jsx("span",{className:A("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",M?"border-primary bg-primary text-primary-foreground":"border-border/70 bg-background text-transparent"),children:e.jsx(Pe,{className:"h-3.5 w-3.5"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium leading-5",children:y.label}),y.description&&e.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:y.description})]})]},`${y.label}-${C}`)})})]},`${h.header??"question"}-${N}`)})}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:r?"Bypass is enabled. New question cards will default to the first option.":"Enable bypass if you want future question cards to preselect the first option."}),e.jsx(P,{type:"button",onClick:()=>void b(),disabled:!p,className:"rounded-full px-5",children:x?"Sent":c?"Sending...":t.questions.length>1?"Send answers":"Send answer"})]})]})}function tl({payload:t,disabled:s=!1,onSubmit:r}){const[n,a]=o.useState(null),[l,d]=o.useState(!1),c=!s&&!l&&!!r,m=async x=>{if(!c||!r)return;a(x);const u=await r(Oo(t,x));a(null),u&&d(!0)};return e.jsxs("div",{className:"rounded-[24px] border border-amber-500/25 bg-amber-500/5 p-4 shadow-[0_24px_80px_-60px_rgba(245,158,11,0.8)]",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-amber-500/25 bg-amber-500/10 text-amber-600 dark:text-amber-400",children:e.jsx(Qa,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-amber-700/80 dark:text-amber-300/80",children:"Permission Request"}),e.jsx("div",{className:"mt-1 space-y-3",children:t.requests.map((x,u)=>e.jsxs("div",{className:"rounded-[18px] border border-border/60 bg-background/75 px-4 py-3",children:[e.jsx("div",{className:"text-sm font-medium leading-6 text-foreground",children:x.summary}),(x.toolName||x.target)&&e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx("span",{children:x.toolName}),x.target&&e.jsx("span",{className:"font-mono normal-case tracking-normal",children:x.target})]})]},`${x.toolUseId??x.toolName}-${u}`))})]})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-end gap-2",children:[e.jsxs(P,{type:"button",variant:"outline",onClick:()=>void m("deny"),disabled:!c||n!==null,className:"rounded-full",children:[e.jsx(qe,{className:"h-4 w-4"}),l?"Sent":n==="deny"?"Sending...":"Deny"]}),e.jsxs(P,{type:"button",onClick:()=>void m("approve"),disabled:!c||n!==null,className:"rounded-full",children:[e.jsx(Pe,{className:"h-4 w-4"}),l?"Sent":n==="approve"?"Sending...":"Approve"]})]})]})}function _s({event:t,questionBypassEnabled:s=!1,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a=!1}){const l=t.type,d=ss(t),c=kt(t);if(d)return e.jsx(Xe,{children:e.jsx(tl,{payload:d,onSubmit:n,disabled:a})});if(c)return e.jsx(Xe,{children:e.jsx(tt,{payload:c,bypassEnabled:s,onBypassChange:r,onSubmit:n,disabled:a})});if(l==="user"){const m=sl(t),x=m.filter(p=>p.type==="tool_result");if(x.length>0&&m.every(p=>p.type==="tool_result"))return e.jsx(Xe,{children:x.map((p,g)=>e.jsx(dr,{block:p,questionBypassEnabled:s,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a},g))});const u=rt(t);return u?e.jsx(ol,{content:u}):null}return l==="assistant"?e.jsx(ll,{event:t,questionBypassEnabled:s,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a}):null}function sl(t){const s=t.message,r=s==null?void 0:s.content;if(Array.isArray(r))return r.filter(a=>typeof a=="object"&&a!==null);const n=t.content;return Array.isArray(n)?n.filter(a=>typeof a=="object"&&a!==null):[]}function Rt(t){var r;const s=t.replace(/\r\n/g,`
|
|
170
|
-
`).split(`
|
|
171
|
-
`);for(;s.length>0&&((r=s[0])==null?void 0:r.trim())==="";)s.shift();return s.join(`
|
|
172
|
-
`)}function ir({text:t,className:s=""}){const[r,n]=o.useState(!1);if(!t)return null;const a=async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return e.jsx("button",{type:"button",onClick:a,"aria-label":r?"Copied":"Copy message",className:`flex h-6 w-6 items-center justify-center rounded-full border border-border/60 bg-background/80 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${s}`,children:r?e.jsx(Pe,{className:"h-3 w-3 text-emerald-500"}):e.jsx(vt,{className:"h-3 w-3"})})}async function rl(t){let r=await(await fetch(t)).blob();r.type!=="image/png"&&(r=await nl(r)),await navigator.clipboard.write([new ClipboardItem({[r.type]:r})])}async function nl(t){const s=await createImageBitmap(t),r=document.createElement("canvas");r.width=s.width,r.height=s.height;const n=r.getContext("2d");if(!n)throw new Error("canvas 2d context unavailable");return n.drawImage(s,0,0),await new Promise((a,l)=>{r.toBlob(d=>d?a(d):l(new Error("toBlob failed")),"image/png")})}function al({dataUrl:t,className:s=""}){const[r,n]=o.useState(!1),a=async l=>{l.stopPropagation();try{await rl(t),n(!0),setTimeout(()=>n(!1),1500)}catch(d){console.error("copy image failed",d)}};return e.jsx("button",{type:"button",onClick:a,"aria-label":r?"Copied":"Copy image",className:`flex h-6 w-6 items-center justify-center rounded-full border border-border/60 bg-background/80 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${s}`,children:r?e.jsx(Pe,{className:"h-3 w-3 text-emerald-500"}):e.jsx(vt,{className:"h-3 w-3"})})}function ol({content:t}){const s=wo(t),r=t.filter(n=>n.type==="image");return e.jsx("div",{className:"animate-message-rise flex justify-end",children:e.jsxs("div",{className:"group relative flex max-w-[88%] items-start gap-3",children:[e.jsx(ir,{text:s,className:"absolute -left-8 top-2"}),e.jsxs("div",{className:"space-y-1 rounded-[26px] rounded-tr-md border border-primary/25 bg-primary px-4 py-3 text-[13px] leading-5 text-primary-foreground shadow-[0_20px_70px_-42px_hsl(var(--primary)/0.95)]",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.28em] text-primary-foreground/75",children:"You"}),s&&e.jsx("div",{className:"whitespace-pre-wrap",children:s}),r.length>0&&e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:r.map((n,a)=>{const l=ts(n);return e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:l,alt:n.filename??`attachment ${a+1}`,className:"max-h-72 w-full rounded-2xl border border-primary-foreground/15 object-cover"}),e.jsx(al,{dataUrl:l,className:"absolute right-2 top-2"})]},`${n.filename??"image"}-${a}`)})})]}),e.jsx("div",{className:"mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-primary/20 bg-primary/10 text-primary",children:e.jsx(lo,{className:"h-4 w-4"})})]})})}function Xe({children:t}){return e.jsx("div",{className:"animate-message-rise flex justify-start",children:e.jsxs("div",{className:"flex max-w-[92%] items-start gap-3",children:[e.jsx("div",{className:"mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-border/70 bg-muted/70 text-muted-foreground",children:e.jsx(Xt,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.28em] text-muted-foreground",children:"Agent"}),t]})]})})}function ll({event:t,questionBypassEnabled:s,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a}){const l=t.message;if(!l)return null;const d=kt(l);if(d)return e.jsx(Xe,{children:e.jsx(tt,{payload:d,bypassEnabled:s,onBypassChange:r,onSubmit:n,disabled:a})});const c=l.content;if(!c||!Array.isArray(c))return null;const m=new Set,x=c.filter(h=>h.type==="text").map(h=>({...h,text:Rt(String(h.text??"")),questionPayload:wt(Rt(String(h.text??"")))})).filter(h=>h.text.length>0||h.questionPayload),u=c.filter(h=>h.type==="thinking").map(h=>Rt(String(h.thinking??""))).filter(Boolean).join(`
|
|
173
|
-
|
|
174
|
-
`),p=c.filter(h=>h.type==="tool_use"),g=c.filter(h=>h.type==="tool_result");return x.length>0||u.length>0||p.length>0||g.length>0?e.jsxs(Xe,{children:[u.length>0&&e.jsx(ul,{text:u}),x.map((h,N)=>{if(h.questionPayload){const _=Je(h.questionPayload);return m.has(_)?null:(m.add(_),e.jsx(tt,{payload:h.questionPayload,bypassEnabled:s,onBypassChange:r,onSubmit:n,disabled:a},N))}return e.jsxs("div",{className:"group relative rounded-[26px] rounded-tl-md border border-border/70 bg-card/80 px-4 py-3 text-[13px] leading-5 text-foreground shadow-[0_20px_70px_-58px_rgba(0,0,0,0.9)] backdrop-blur-sm",children:[e.jsx(ir,{text:h.text,className:"absolute right-2 top-2"}),e.jsx("div",{className:"whitespace-pre-wrap",children:h.text})]},N)}),p.map((h,N)=>e.jsx(ml,{block:h,renderedQuestionSignatures:m,questionBypassEnabled:s,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a},N)),g.map((h,N)=>e.jsx(dr,{block:h,renderedQuestionSignatures:m,questionBypassEnabled:s,onQuestionBypassChange:r,onSubmitQuestionResponse:n,questionResponseDisabled:a},N))]}):null}function il(t){return t.replace(/\s+/g," ").trim()}function Be(t,s=132){const r=il(t);return r?r.length>s?`${r.slice(0,s-3)}...`:r:""}function qt(t,s=84){if(typeof t=="string")return Be(t,s);if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)){const r=t.slice(0,3).map(n=>qt(n,28)).filter(Boolean).join(", ");return Be(r||JSON.stringify(t),s)}if(typeof t=="object"&&t!==null){const r=Object.entries(t).slice(0,3).map(([n,a])=>`${n}: ${qt(a,32)}`).join(" · ");return Be(r||JSON.stringify(t),s)}return""}function dl(t){if(!t)return"No input";const s=Object.entries(t).slice(0,4).map(([r,n])=>`${r}: ${qt(n,40)}`).filter(r=>r.trim().length>0).join(" · ");return Be(s||JSON.stringify(t),156)||"No input"}function cl({expanded:t}){return e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-border/60 bg-background/70 px-2 py-1 text-[10px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:[t?"Less":"More",t?e.jsx(Is,{className:"h-3 w-3"}):e.jsx(We,{className:"h-3 w-3"})]})}function rs({title:t,preview:s,icon:r,children:n,accentClassName:a,previewClassName:l="font-mono text-[11px] text-muted-foreground/90"}){const[d,c]=o.useState(!1);return e.jsxs("div",{className:`overflow-hidden rounded-[22px] border border-border/60 ${a}`,children:[e.jsxs("button",{type:"button",onClick:()=>c(m=>!m),className:"flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-background/30",children:[e.jsx("div",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border/60 bg-background/70 text-muted-foreground",children:r}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-muted-foreground",children:t})}),e.jsx("div",{className:`mt-1 whitespace-pre-wrap break-words text-[12px] leading-5 ${l}`,children:s})]}),e.jsx(cl,{expanded:d})]}),d&&e.jsx("div",{className:"border-t border-border/60 px-4 py-3",children:n})]})}function ul({text:t}){const s=Be(t,156);return e.jsx(rs,{title:"Thinking",preview:s,icon:e.jsx(ha,{className:"h-3.5 w-3.5"}),accentClassName:"bg-muted/35",previewClassName:"text-[12px] leading-5 text-muted-foreground/90",children:e.jsx("div",{className:"whitespace-pre-wrap text-[13px] leading-5 text-muted-foreground/90",children:t})})}function ml({block:t,renderedQuestionSignatures:s,questionBypassEnabled:r,onQuestionBypassChange:n,onSubmitQuestionResponse:a,questionResponseDisabled:l}){const d=String(t.name??"tool"),c=t.input,m=kt(t);if(m){const u=Je(m);return s!=null&&s.has(u)?null:(s==null||s.add(u),e.jsx(tt,{payload:m,bypassEnabled:r,onBypassChange:n,onSubmit:a,disabled:l}))}const x=dl(c);if(d==="TodoWrite"){const u=xl(c==null?void 0:c.todos);if(u.length>0)return e.jsx(fl,{todos:u})}return e.jsx(rs,{title:`Tool: ${d}`,preview:x,icon:e.jsx(er,{className:"h-3.5 w-3.5"}),accentClassName:"bg-muted/25",children:e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-xs leading-5 text-muted-foreground",children:JSON.stringify(c??{},null,2)})})}function dr({block:t,renderedQuestionSignatures:s,questionBypassEnabled:r,onQuestionBypassChange:n,onSubmitQuestionResponse:a,questionResponseDisabled:l}){const d=t.content,c=typeof d=="string"?d:Array.isArray(d)?d.map(u=>String(u.text??"")).join(`
|
|
175
|
-
`):"";if(!c)return null;const m=wt(c);if(m){const u=Je(m);return s!=null&&s.has(u)?null:(s==null||s.add(u),e.jsx(tt,{payload:m,bypassEnabled:r,onBypassChange:n,onSubmit:a,disabled:l}))}const x=Be(c,156);return e.jsx(rs,{title:"Result",preview:x,icon:e.jsx(er,{className:"h-3.5 w-3.5"}),accentClassName:"bg-background/65",children:e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-xs leading-5 text-muted-foreground",children:c})})}function xl(t){return Array.isArray(t)?t.map(s=>{if(typeof s!="object"||s===null)return null;const r=s,n=typeof r.content=="string"?r.content:"";if(!n)return null;const a=typeof r.activeForm=="string"?r.activeForm:n,l=typeof r.status=="string"?r.status:"pending";return{content:n,activeForm:a,status:l==="completed"||l==="in_progress"?l:"pending"}}).filter(s=>s!==null):[]}function fl({todos:t}){const s=t.filter(a=>a.status==="completed").length,r=t.length,n=t.find(a=>a.status==="in_progress");return e.jsxs("div",{className:"overflow-hidden rounded-[22px] border border-border/60 bg-muted/20",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-border/50 px-4 py-3",children:[e.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border/60 bg-background/70 text-muted-foreground",children:e.jsx(La,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-muted-foreground",children:"Todos"}),e.jsx("div",{className:"mt-0.5 truncate text-[12px] leading-5 text-muted-foreground/90",children:n?n.activeForm:r===0?"No items":s===r?"All complete":"Up next"})]}),e.jsxs("div",{className:"shrink-0 rounded-full border border-border/60 bg-background/70 px-2 py-0.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:[s,"/",r]})]}),e.jsx("ul",{className:"divide-y divide-border/40",children:t.map((a,l)=>e.jsxs("li",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx(hl,{status:a.status}),e.jsx("span",{className:a.status==="completed"?"text-[13px] leading-5 text-muted-foreground line-through decoration-muted-foreground/60":a.status==="in_progress"?"text-[13px] font-medium leading-5 text-foreground":"text-[13px] leading-5 text-foreground/85",children:a.status==="in_progress"?a.activeForm:a.content})]},`${l}-${a.content}`))})]})}function hl({status:t}){return t==="completed"?e.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-500 dark:text-emerald-400",children:e.jsx(Pe,{className:"h-3 w-3"})}):t==="in_progress"?e.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center text-primary",children:e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"})}):e.jsx("span",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/60",children:e.jsx(ya,{className:"h-3 w-3"})})}var cr="AlertDialog",[pl]=Bs(cr,[Us]),$e=Us(),ur=t=>{const{__scopeAlertDialog:s,...r}=t,n=$e(s);return e.jsx(Cn,{...n,...r,modal:!0})};ur.displayName=cr;var gl="AlertDialogTrigger",mr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,a=$e(r);return e.jsx(Sn,{...a,...n,ref:s})});mr.displayName=gl;var bl="AlertDialogPortal",xr=t=>{const{__scopeAlertDialog:s,...r}=t,n=$e(s);return e.jsx(_n,{...n,...r})};xr.displayName=bl;var jl="AlertDialogOverlay",fr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,a=$e(r);return e.jsx(Mn,{...a,...n,ref:s})});fr.displayName=jl;var Ve="AlertDialogContent",[yl,vl]=pl(Ve),Nl=Pn("AlertDialogContent"),hr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,children:n,...a}=t,l=$e(r),d=o.useRef(null),c=yt(s,d),m=o.useRef(null);return e.jsx(An,{contentName:Ve,titleName:pr,docsSlug:"alert-dialog",children:e.jsx(yl,{scope:r,cancelRef:m,children:e.jsxs(Tn,{role:"alertdialog",...l,...a,ref:c,onOpenAutoFocus:Ot(a.onOpenAutoFocus,x=>{var u;x.preventDefault(),(u=m.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:[e.jsx(Nl,{children:n}),e.jsx(wl,{contentRef:d})]})})})});hr.displayName=Ve;var pr="AlertDialogTitle",gr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,a=$e(r);return e.jsx(En,{...a,...n,ref:s})});gr.displayName=pr;var br="AlertDialogDescription",jr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,a=$e(r);return e.jsx(Dn,{...a,...n,ref:s})});jr.displayName=br;var kl="AlertDialogAction",yr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,a=$e(r);return e.jsx(zs,{...a,...n,ref:s})});yr.displayName=kl;var vr="AlertDialogCancel",Nr=o.forwardRef((t,s)=>{const{__scopeAlertDialog:r,...n}=t,{cancelRef:a}=vl(vr,r),l=$e(r),d=yt(s,a);return e.jsx(zs,{...l,...n,ref:d})});Nr.displayName=vr;var wl=({contentRef:t})=>{const s=`\`${Ve}\` requires a description for the component to be accessible for screen reader users.
|
|
176
|
-
|
|
177
|
-
You can add a description to the \`${Ve}\` by passing a \`${br}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
178
|
-
|
|
179
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ve}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
180
|
-
|
|
181
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return o.useEffect(()=>{var n;document.getElementById((n=t.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(s)},[s,t]),null},Cl=ur,Sl=mr,_l=xr,kr=fr,wr=hr,Cr=yr,Sr=Nr,_r=gr,Ar=jr;const Wt=Cl,As=Sl,Al=_l,Tr=o.forwardRef(({className:t,...s},r)=>e.jsx(kr,{className:A("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:r}));Tr.displayName=kr.displayName;const mt=o.forwardRef(({className:t,...s},r)=>e.jsxs(Al,{children:[e.jsx(Tr,{}),e.jsx(wr,{ref:r,className:A("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s})]}));mt.displayName=wr.displayName;const xt=({className:t,...s})=>e.jsx("div",{className:A("flex flex-col space-y-2 text-center sm:text-left",t),...s});xt.displayName="AlertDialogHeader";const ft=({className:t,...s})=>e.jsx("div",{className:A("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});ft.displayName="AlertDialogFooter";const ht=o.forwardRef(({className:t,...s},r)=>e.jsx(_r,{ref:r,className:A("text-lg font-semibold",t),...s}));ht.displayName=_r.displayName;const pt=o.forwardRef(({className:t,...s},r)=>e.jsx(Ar,{ref:r,className:A("text-sm text-muted-foreground",t),...s}));pt.displayName=Ar.displayName;const gt=o.forwardRef(({className:t,...s},r)=>e.jsx(Cr,{ref:r,className:A(Vs(),t),...s}));gt.displayName=Cr.displayName;const bt=o.forwardRef(({className:t,...s},r)=>e.jsx(Sr,{ref:r,className:A(Vs({variant:"outline"}),"mt-2 sm:mt-0",t),...s}));bt.displayName=Sr.displayName;const Ht="bypass",ns=[{value:"claudecode",label:"claudecode",supportsFollowUp:!0},{value:"codex",label:"codex",supportsFollowUp:!0},{value:"mars",label:"mars",disabled:!0,description:"coming soon"},{value:"eureka",label:"eureka",disabled:!0,description:"coming soon"}],Er=[{value:"bypass",label:"Bypass"},{value:"plan",label:"Plan"},{value:"edit",label:"Edit"},{value:"dangerous",label:"Dangerous"}],Tl=new Set(ns.filter(t=>t.supportsFollowUp).map(t=>t.value));function El(t,s,r){return t!=="auto"?s.find(n=>n.id===t)??null:r.length===1?r[0]??null:null}function Dl(t){return t.trim()||"."}function Ts({value:t,onChange:s,project:r,assignTo:n,nodes:a,assignableNodes:l,layout:d="default",chipClassName:c,chipActiveClassName:m,chipInactiveClassName:x,labelClassName:u,triggerClassName:p}){const[g,b]=o.useState(!1),[h,N]=o.useState(null),[_,y]=o.useState(""),[C,M]=o.useState(!1),[O,T]=o.useState(!1),[K,Y]=o.useState(!1),[I,$]=o.useState(null),[L,se]=o.useState(""),[S,V]=o.useState(""),[ee,U]=o.useState(""),[de,J]=o.useState(!1),W=o.useRef(null),X=o.useRef(0),me=o.useMemo(()=>El(n,a,l),[n,a,l]),q=me==null?void 0:me.id,Z=o.useMemo(()=>Dl(r),[r]),te=o.useMemo(()=>q?`${q}
|
|
182
|
-
${Z}`:"",[q,Z]),le=o.useCallback(async(k=0,E=!1)=>{const D=X.current+1,ve=te;if(X.current=D,!q){N(null),y("");return}$(null),E||y(""),E?T(!0):M(!0);try{const xe=await $n(q,{path:Z,limit:20,offset:k,allowAbsolute:!0});if(D!==X.current)return;y(ve),N(ie=>E&&ie?{...xe,branches:[...ie.branches,...xe.branches]}:xe)}catch(xe){if(D!==X.current)return;$(xe instanceof Error?xe.message:"Failed to load branch info"),E||(N(null),y(""))}finally{D===X.current&&(M(!1),T(!1))}},[q,te,Z]);o.useEffect(()=>{if(!q){X.current+=1,N(null),y(""),$(null);return}le()},[q,Z,le]),o.useEffect(()=>{const k=t.trim(),E=_===te?h:null,D=E!=null&&E.available&&E.currentBranch?E.currentBranch:"";k!==D&&s(D)},[h,te,_,s,t]),o.useEffect(()=>{if(!g)return;const k=D=>{W.current&&(W.current.contains(D.target)||b(!1))},E=D=>{D.key==="Escape"&&b(!1)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",E)}},[g]),o.useEffect(()=>{g&&(V(""),U(""),J(!1))},[g,q,Z]);const ae=o.useCallback(async()=>{if(!q)return;const k=L.trim(),E=de?ee.trim():S.trim();if(!(!k||!E)){Y(!0),$(null);try{const D=await Rn(q,{path:Z,branchName:k,startPoint:E,limit:20,offset:0,allowAbsolute:!0});y(te),N(D),s(D.currentBranch??D.createdBranch),se(""),V(""),U(""),J(!1),b(!1)}catch(D){$(D instanceof Error?D.message:"Failed to create branch")}finally{Y(!1)}}},[q,te,Z,de,ee,L,s,S]),f=_===te?h:null,Q=o.useCallback(()=>{f!=null&&f.hasMore&&le(f.branches.length,!0)},[f,le]),F=t.trim()||(f==null?void 0:f.currentBranch)||(f&&!f.available?"No git repo":"Branch"),oe=de?ee.trim():S.trim(),v=!!(f!=null&&f.available&&L.trim()&&oe&&!K),re=d==="composer"?e.jsxs(P,{type:"button",variant:"ghost",onClick:()=>b(k=>!k),title:F,"aria-label":`Branch: ${F}`,className:A(c,p,"min-w-0 max-w-full",t.trim()?m:x),children:[C&&!f?e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):e.jsx(vs,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:A("min-w-0 truncate",u),children:F})]}):e.jsxs(P,{type:"button",variant:"outline",onClick:()=>b(k=>!k),className:"h-11 w-full justify-between rounded-2xl border-border/70 bg-background/70 px-4",title:F,children:[e.jsx("span",{className:A("truncate",t.trim()?"font-mono text-foreground":"text-muted-foreground"),children:F}),e.jsx("span",{className:"ml-3 shrink-0 text-xs text-muted-foreground",children:me?me.name:"Manual"})]});return e.jsxs("div",{className:A("relative inline-block",d==="composer"?"min-w-0 shrink-0":"w-full"),ref:W,children:[d==="default"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Branch"}),re]}):re,g&&e.jsxs("div",{className:A("absolute z-50 mt-2 w-[240px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 shadow-lg backdrop-blur",d==="composer"?"left-0":"left-0 right-0 w-auto min-w-[240px]"),children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/60 px-3 py-2",children:[e.jsx(vs,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",title:f!=null&&f.repoRoot?`${f.currentBranch??F} · ${f.repoRoot}`:(f==null?void 0:f.currentBranch)??F,children:(f==null?void 0:f.currentBranch)??F}),C?e.jsx(fe,{className:"h-3 w-3 shrink-0 animate-spin text-muted-foreground"}):null]}),me?C&&!f?e.jsxs("div",{className:"flex items-center justify-center px-3 py-4 text-[11px] text-muted-foreground",children:[e.jsx(fe,{className:"mr-1.5 h-3 w-3 animate-spin"}),"Loading..."]}):f&&!f.available?e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Not a git repository."}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-2 px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Le,{value:L,onChange:k=>se(k.target.value),placeholder:"New branch name",className:"h-8 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx(P,{type:"button",size:"sm",onClick:()=>void ae(),disabled:!v,title:v?"Create branch":"Enter a name and pick a base","aria-label":"Create branch",className:"h-8 w-8 shrink-0 rounded-md p-0",children:K?e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ka,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Base from"}),!de&&e.jsxs("button",{type:"button",onClick:()=>J(!0),className:"flex items-center gap-1 rounded px-1 py-0.5 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground",children:[e.jsx(Nt,{className:"h-2.5 w-2.5"}),"Manual"]})]}),de?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{value:ee,onChange:k=>U(k.target.value),placeholder:"upstream/release/1.0",className:"h-8 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx("button",{type:"button",onClick:()=>{J(!1),U("")},className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Cancel manual input","aria-label":"Cancel manual input",children:e.jsx(qe,{className:"h-3.5 w-3.5"})})]}):f!=null&&f.branches.length?e.jsxs("div",{className:"max-h-44 overflow-y-auto rounded-md border border-border/40 bg-background/40",children:[f.branches.map(k=>{const E=S===k.ref,D=k.branch==="main"||k.branch==="master";return e.jsxs("button",{type:"button",onClick:()=>V(k.ref),className:A("flex w-full items-center gap-2 border-b border-border/20 px-2.5 py-1.5 text-left text-[11px] last:border-b-0 hover:bg-background/60",E&&"bg-background/70"),title:k.ref,children:[e.jsx("span",{className:A("shrink-0 text-[10px]",D?"text-amber-500 dark:text-amber-400":"text-muted-foreground/60"),"aria-hidden":!0,children:D?"★":"·"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",children:k.ref}),E?e.jsx(Pe,{className:"h-3 w-3 shrink-0 text-primary"}):null]},k.ref)}),f.hasMore&&e.jsxs("button",{type:"button",onClick:Q,disabled:O,className:"flex w-full items-center justify-center gap-1 border-t border-border/20 py-1 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground disabled:opacity-50",children:[O?e.jsx(fe,{className:"h-3 w-3 animate-spin"}):e.jsx(It,{className:"h-3 w-3"}),"Load more"]})]}):e.jsx("div",{className:"rounded-md border border-dashed border-border/40 px-2.5 py-2 text-[11px] text-muted-foreground",children:"No remote branches found."})]})]})}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Select a specific node first."}),I&&e.jsx("div",{className:"border-t border-destructive/20 bg-destructive/10 px-3 py-1.5 text-[11px] text-destructive",children:I})]})]})}const Ml=20,Pl=3,Kt="meshy-working-dir-recents-by-node";function $l(t){return t.startsWith("/")||t.startsWith("\\\\")||/^[A-Za-z]:[\\/]/.test(t)}function Rl(t){const s=t.trim();return s||"."}function Jt(t){const s=[],r=new Set;for(const n of t){const a=n.trim();if(!(!a||r.has(a))&&(r.add(a),s.push(a),s.length===Pl))break}return s}function Ll(t,s){const r=s.trim();return Jt(r?[r,...t]:t)}function Dr(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,n]of Object.entries(t)){if(!r||!Array.isArray(n))continue;const a=n.filter(d=>typeof d=="string"),l=Jt(a);l.length>0&&(s[r]=l)}return s}function Fl(t,s,r){if(!s)return t;const n=t[s]??[],a=Ll(n,r);if(a.length===0){if(!(s in t))return t;const{[s]:l,...d}=t;return d}return{...t,[s]:a}}function Ol(t,s){var r;return s?((r=t[s])==null?void 0:r[0])??"":""}function Il(t){if(!t||typeof window>"u")return"";try{const s=window.localStorage.getItem(Kt);return s?Ol(Dr(JSON.parse(s)),t):""}catch{return""}}function Ul(t,s,r){return t!=="auto"?s.find(n=>n.id===t)??null:r.length===1?r[0]??null:null}function zl(t,s){const r=s.trim();return r?$l(r)||!t?r:`${t.replace(/[/\\]+$/,"")}/${r}`:""}function Bl(t,s){return t?t.isAbsolute?t.currentPath:t.currentPath==="."||t.currentPath===""?t.rootPath||(s==null?void 0:s.workDir)||"Node root":t.currentPath:(s==null?void 0:s.workDir)??"Node root"}function Es({value:t,onChange:s,assignTo:r,nodes:n,assignableNodes:a,layout:l="default",chipClassName:d,chipActiveClassName:c,chipInactiveClassName:m,labelClassName:x,triggerClassName:u}){const[p,g]=o.useState(!1),[b,h]=o.useState(null),[N,_]=o.useState(!1),[y,C]=o.useState(!1),[M,O]=o.useState(null),[T,K]=o.useState(""),[Y,I]=o.useState(!1),[$,L]=o.useState({}),se=o.useRef(null),S=o.useMemo(()=>Ul(r,n,a),[r,n,a]),V=S==null?void 0:S.id,ee=o.useMemo(()=>V?$[V]??[]:[],[$,V]),U=o.useMemo(()=>t.trim()?zl(S==null?void 0:S.workDir,t):"Use node default",[t,S==null?void 0:S.workDir]);o.useEffect(()=>{if(!(typeof window>"u"))try{const f=window.localStorage.getItem(Kt);if(!f)return;const Q=JSON.parse(f);L(Dr(Q))}catch{}},[]);const de=o.useCallback(f=>{V&&L(Q=>{const F=Fl(Q,V,f);if(F===Q)return Q;if(typeof window<"u")try{window.localStorage.setItem(Kt,JSON.stringify(F))}catch{}return F})},[V]),J=o.useCallback((f,Q=!0)=>{const F=f.trim();s(F),Q&&F&&de(F),g(!1)},[s,de]),W=o.useCallback(async(f,Q=0,F=!1)=>{if(V){O(null),F?C(!0):_(!0);try{const oe=await Ln(V,{path:f,limit:Ml,offset:Q,directoriesOnly:!0,allowAbsolute:!0});h(v=>F&&v?{...oe,entries:[...v.entries,...oe.entries]}:oe)}catch(oe){O(oe instanceof Error?oe.message:"Failed to browse directories"),F||h(null)}finally{_(!1),C(!1)}}},[V]),X=o.useRef(t);X.current=t;const me=o.useRef(W);me.current=W,o.useEffect(()=>{if(!p)return;const f=X.current;K(f),I(!1),h(null),O(null),V&&me.current(Rl(f))},[p,V]),o.useEffect(()=>{if(!p)return;const f=F=>{se.current&&(se.current.contains(F.target)||g(!1))},Q=F=>{F.key==="Escape"&&g(!1)};return document.addEventListener("mousedown",f),document.addEventListener("keydown",Q),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",Q)}},[p]);const q=o.useCallback(f=>{W(f)},[W]),Z=o.useCallback(()=>{b&&W(b.currentPath,b.entries.length,!0)},[b,W]),te=l==="composer"?e.jsxs(P,{type:"button",variant:"ghost",onClick:()=>g(f=>!f),title:U,"aria-label":`Working directory: ${U}`,className:A(d,u,"min-w-0 max-w-full",t.trim()?c:m),children:[e.jsx(Fn,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:A("min-w-0 truncate",x),children:U})]}):e.jsxs(P,{type:"button",variant:"outline",onClick:()=>g(f=>!f),className:"h-11 w-full justify-between rounded-2xl border-border/70 bg-background/70 px-4",title:U,children:[e.jsx("span",{className:A("truncate",t.trim()?"font-mono text-foreground":"text-muted-foreground"),children:U}),e.jsx("span",{className:"ml-3 shrink-0 text-xs text-muted-foreground",children:S?S.name:"Manual"})]}),le=Bl(b,S),ae=!!(b!=null&&b.parentPath);return e.jsxs("div",{className:A("relative inline-block",l==="composer"?"min-w-0 max-w-[60%] shrink":"w-full"),ref:se,children:[l==="default"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Working directory"}),te]}):te,p&&e.jsxs("div",{className:A("absolute z-50 mt-2 w-[240px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 shadow-lg backdrop-blur",l==="composer"?"left-0":"left-0 right-0 w-auto min-w-[240px]"),children:[ee.length>0&&e.jsxs("div",{className:"border-b border-border/60 px-3 py-2",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(It,{className:"h-2.5 w-2.5"}),"Recent"]}),e.jsx("div",{className:"flex flex-col",children:ee.map(f=>e.jsx("button",{type:"button",onClick:()=>J(f),className:"truncate rounded px-1.5 py-0.5 text-left font-mono text-[11px] text-foreground hover:bg-background/60",title:f,children:f},f))})]}),e.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/60 px-2.5 py-1.5",children:[e.jsx("button",{type:"button",onClick:()=>(b==null?void 0:b.parentPath)&&q(b.parentPath),disabled:!ae||N,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border/60 text-muted-foreground transition-colors hover:bg-background/60 hover:text-foreground disabled:opacity-40",title:"Parent directory",children:e.jsx(xa,{className:"h-3 w-3"})}),e.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:le,children:le}),b&&e.jsx("button",{type:"button",onClick:()=>J(b.isAbsolute?b.currentPath:b.currentPath==="."?"":b.currentPath),className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium text-foreground hover:bg-background/60",title:"Use this folder",children:"Use"})]}),e.jsxs("div",{className:"max-h-56 overflow-y-auto",children:[S?N?e.jsxs("div",{className:"flex items-center justify-center px-3 py-4 text-[11px] text-muted-foreground",children:[e.jsx(fe,{className:"mr-1.5 h-3 w-3 animate-spin"}),"Loading..."]}):b&&b.entries.length>0?e.jsxs(e.Fragment,{children:[b.entries.map(f=>e.jsxs("div",{className:"group flex items-stretch border-b border-border/30 last:border-b-0",children:[e.jsxs("button",{type:"button",onClick:()=>J(f.path),className:"flex min-w-0 flex-1 items-center gap-2 px-2.5 py-1.5 text-left hover:bg-background/55",title:`Use ${f.path}`,children:[e.jsx(Ca,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"truncate text-[11px] text-foreground",children:f.name})]}),e.jsx("button",{type:"button",onClick:()=>q(f.path),className:"flex w-9 shrink-0 items-center justify-center border-l border-border/30 text-muted-foreground hover:bg-background/70 hover:text-foreground",title:"Open subfolder","aria-label":`Open ${f.name}`,children:e.jsx(Ze,{className:"h-3.5 w-3.5"})})]},f.path)),b.hasMore&&e.jsxs("button",{type:"button",onClick:Z,disabled:y,className:"flex w-full items-center justify-center gap-1 border-t border-border/40 py-1 text-[10px] text-muted-foreground hover:bg-background/60 hover:text-foreground disabled:opacity-50",children:[y?e.jsx(fe,{className:"h-3 w-3 animate-spin"}):e.jsx(It,{className:"h-3 w-3"}),"Load more"]})]}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:M??"No subfolders."}):e.jsx("div",{className:"px-3 py-4 text-center text-[11px] text-muted-foreground",children:"Select a node to browse."}),M&&b&&b.entries.length>0&&e.jsx("div",{className:"border-t border-border/60 px-3 py-1.5 text-[11px] text-destructive",children:M})]}),e.jsx("div",{className:"flex items-center gap-1 border-t border-border/60 bg-background/40 px-2.5 py-1.5",children:Y?e.jsxs(e.Fragment,{children:[e.jsx(Le,{value:T,onChange:f=>K(f.target.value),onKeyDown:f=>{f.key==="Enter"&&T.trim()?(f.preventDefault(),J(T)):f.key==="Escape"&&(f.preventDefault(),I(!1),K(t))},autoFocus:!0,placeholder:"Path (relative or absolute)",className:"h-7 flex-1 rounded-md border-border/60 bg-background/70 font-mono text-[11px]"}),e.jsx("button",{type:"button",onClick:()=>J(T),disabled:!T.trim(),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-foreground hover:bg-background/60 disabled:opacity-40",title:"Apply","aria-label":"Apply manual path",children:e.jsx(Pe,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>{I(!1),K(t)},className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Cancel","aria-label":"Cancel manual path",children:e.jsx(qe,{className:"h-3.5 w-3.5"})})]}):e.jsxs("button",{type:"button",onClick:()=>{K(t),I(!0)},className:"flex h-7 flex-1 items-center justify-between rounded-md px-1.5 text-[11px] text-muted-foreground hover:bg-background/60 hover:text-foreground",title:"Enter a manual path",children:[e.jsx("span",{children:"Manual input"}),e.jsx(Nt,{className:"h-3 w-3"})]})})]})]})}function Vl(t,s={}){const r=t.filter(n=>n.status==="online");return s.currentNodeRole!=="follower"||!s.leaderNodeId?r:r.filter(n=>n.id!==s.leaderNodeId)}function Ds(){return ns.map(t=>e.jsx(ye,{value:t.value,disabled:t.disabled,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t.label}),t.description&&e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:t.description})]})},t.value))}function Ms(){return Er.map(t=>e.jsx(ye,{value:t.value,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{children:t.label}),t.description&&e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:t.description})]})},t.value))}function Mr({isCurrent:t}){return t?e.jsx($a,{className:"h-3.5 w-3.5 shrink-0 text-emerald-500 dark:text-emerald-400","aria-label":"current node"}):e.jsx(Ea,{className:"h-3.5 w-3.5 shrink-0 text-sky-500 dark:text-sky-400","aria-label":"remote follower node"})}function Ps(t,s){return t.map(r=>{const n=!!s&&r.id===s;return e.jsx(ye,{value:r.id,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Mr,{isCurrent:n}),e.jsx("span",{className:"truncate",children:r.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n?"current":"remote"})]})},r.id)})}function ql(t){var s;return((s=ns.find(r=>r.value===t))==null?void 0:s.label)??t}function Wl(t){var s;return((s=Er.find(r=>r.value===t))==null?void 0:s.label)??t}function Pr(t,s,r=!1){const n=t.trim();if(n)return n;const a=s.trim().split(`
|
|
183
|
-
`).map(l=>l.trim()).find(Boolean);return a?a.length>72?`${a.slice(0,69).trimEnd()}...`:a:r?"Image task":""}function Hl(t){var d;const s=t.title.trim(),r=Pr(t.title,t.description,t.images.length>0),n=t.description.trim()||r,a=t.mode??Ht,l=rr(t.description,t.images);return!r||!n||!t.agent?null:{title:r,description:n,agent:t.agent,project:t.project.trim()||null,branch:((d=t.branch)==null?void 0:d.trim())||null,payload:{initialMessage:l,mode:a,titleSource:s?"manual":"derived"},priority:t.priority,assignTo:t.assignTo==="auto"?void 0:t.assignTo}}function Kl({nodes:t,currentNodeRole:s,currentNodeId:r,leaderNodeId:n,onCreated:a,onCancel:l,className:d,footerClassName:c,submitLabel:m="Create chat",cancelLabel:x="Cancel",autoFocus:u=!1,layout:p="default"}){const[g,b]=o.useState(""),[h,N]=o.useState(""),[_,y]=o.useState("claudecode"),[C,M]=o.useState(Ht),[O,T]=o.useState(""),[K,Y]=o.useState(""),[I,$]=o.useState("normal"),L=o.useMemo(()=>Vl(t,{currentNodeRole:s,leaderNodeId:n}),[t,s,n]),se=o.useMemo(()=>{var R;return r&&L.some(he=>he.id===r)?r:((R=L[0])==null?void 0:R.id)??""},[L,r]),[S,V]=o.useState(se),[ee,U]=o.useState(!1),[de,J]=o.useState(!1),{images:W,error:X,fileInputRef:me,pickImages:q,handleFileChange:Z,handlePaste:te,removeImage:le}=lr(),ae=o.useMemo(()=>L.find(R=>R.id===S)??null,[S,L]),f=!!(r&&(ae==null?void 0:ae.id)===r),Q=ql(_),F=Wl(C);o.useEffect(()=>{S&&L.some(R=>R.id===S)||V(se)},[S,L,se]),o.useEffect(()=>{T(Il(S)),Y("")},[S]),o.useEffect(()=>{Y("")},[O]);const oe=o.useCallback(async R=>{R.preventDefault();const he=Hl({title:g,description:h,agent:_,project:O,branch:K,priority:I,assignTo:S,mode:C,images:W});if(he){U(!0);try{const je=await On(he);a(je)}catch(je){ue.error(je instanceof Error?je.message:"Failed to create task")}finally{U(!1)}}},[g,h,_,O,K,I,S,C,W,a]),v=Pr(g,h,W.length>0),re=!!(v&&_&&S&&(h.trim()||W.length>0)),k=o.useCallback(R=>{var he;R.nativeEvent.isComposing||R.key==="Enter"&&(R.ctrlKey||R.metaKey)&&re&&!ee&&(R.preventDefault(),(he=R.currentTarget.form)==null||he.requestSubmit())},[re,ee]),E=W.length>0&&e.jsx("div",{className:"flex flex-wrap gap-3",children:W.map((R,he)=>e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:ts(R),alt:R.filename??`attachment ${he+1}`,className:"h-24 w-24 rounded-2xl border border-border/70 object-cover"}),e.jsx("button",{type:"button",onClick:()=>le(he),className:"absolute -top-2 -right-2 flex h-6 w-6 items-center justify-center rounded-full border border-border/70 bg-background text-muted-foreground transition-colors hover:text-foreground","aria-label":`Remove ${R.filename??`image ${he+1}`}`,children:e.jsx(qe,{className:"h-3.5 w-3.5"})})]},`${R.filename??"image"}-${he}`))}),D=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Assign to"}),e.jsxs(we,{value:S,onValueChange:V,children:[e.jsx(Ce,{className:"h-11 rounded-2xl border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select node"})}),e.jsx(Se,{children:Ps(L,r)})]})]}),ve=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Agent"}),e.jsxs(we,{value:_,onValueChange:y,children:[e.jsx(Ce,{className:"h-11 rounded-2xl border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select agent"})}),e.jsx(Se,{children:Ds()})]})]}),xe=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Mode"}),e.jsxs(we,{value:C,onValueChange:R=>M(R),children:[e.jsx(Ce,{className:"h-11 rounded-2xl border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select mode"})}),e.jsx(Se,{children:Ms()})]})]}),ie=e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{className:"text-sm font-medium",children:"Priority"}),e.jsxs(we,{value:I,onValueChange:$,children:[e.jsx(Ce,{className:"h-11 rounded-2xl border-border/70 bg-background/70",children:e.jsx(Me,{placeholder:"Select priority"})}),e.jsxs(Se,{children:[e.jsx(ye,{value:"low",children:"Low"}),e.jsx(ye,{value:"normal",children:"Normal"}),e.jsx(ye,{value:"high",children:"High"}),e.jsx(ye,{value:"critical",children:"Critical"})]})]})]}),be=e.jsx(Es,{value:O,onChange:T,assignTo:S,nodes:t,assignableNodes:L}),St=e.jsx(Ts,{value:K,onChange:Y,project:O,assignTo:S,nodes:t,assignableNodes:L});return p==="composer"?e.jsxs("form",{onSubmit:oe,className:A("space-y-4",d),children:[e.jsx("input",{ref:me,type:"file",accept:"image/*",multiple:!0,onChange:Z,className:"hidden"}),(()=>{const R="chat-composer__chip h-9 w-auto gap-1.5 rounded-full px-3.5 text-xs shadow-none transition-colors",he="border-transparent bg-transparent text-muted-foreground hover:bg-background/40 hover:text-foreground",je="border-border/70 bg-background/55 text-foreground",Te=_==="claudecode",De=C===Ht;return e.jsxs("div",{className:"chat-composer space-y-2",children:[e.jsxs("div",{className:"rounded-[24px] border border-border/60 bg-background/45 shadow-[0_20px_80px_-40px_rgba(0,0,0,0.6)]",children:[e.jsxs("div",{className:"chat-composer__header flex min-w-0 items-center justify-between gap-3 px-4 pt-3",children:[e.jsxs(we,{value:S,onValueChange:V,children:[e.jsx(Ce,{className:A(R,je,"chat-composer__node-trigger border-transparent bg-transparent hover:bg-background/40"),title:`Assigned node: ${(ae==null?void 0:ae.name)??"unassigned"}`,"aria-label":`Assigned node: ${(ae==null?void 0:ae.name)??"unassigned"}`,children:ae?e.jsxs(e.Fragment,{children:[e.jsx(Mr,{isCurrent:f}),e.jsx("span",{className:"min-w-0 truncate",children:ae.name}),e.jsx("span",{className:"chat-composer__header-meta shrink-0 text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:f?"current":"remote"})]}):e.jsx(Me,{placeholder:"Select node"})}),e.jsx(Se,{children:Ps(L,r)})]}),de?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Le,{id:"task-title-composer",type:"text",value:g,onChange:ge=>b(ge.target.value),onKeyDown:ge=>{(ge.key==="Enter"||ge.key==="Escape")&&(ge.preventDefault(),J(!1))},autoFocus:!0,placeholder:"Chat title",className:"h-8 w-48 min-w-0 rounded-full border-border/70 bg-background/55 px-3 text-xs shadow-none"}),e.jsx(P,{type:"button",variant:"ghost",size:"icon",onClick:()=>J(!1),"aria-label":"Save title",className:"h-8 w-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",children:e.jsx(Pe,{className:"h-3.5 w-3.5"})})]}):e.jsxs("button",{type:"button",onClick:()=>J(!0),className:"chat-composer__title-button flex min-w-0 items-center gap-1.5 rounded-full px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-background/55 hover:text-foreground",title:v||"Title","aria-label":v?`Edit title: ${v}`:"Edit title",children:[e.jsx("span",{className:"chat-composer__title-text max-w-[220px] truncate",children:v||"Title"}),e.jsx(Nt,{className:"h-3 w-3 shrink-0"})]})]}),e.jsx("textarea",{id:"task-description",value:h,onChange:ge=>N(ge.target.value),onKeyDown:k,onPaste:te,placeholder:"Ask anything...",rows:4,autoFocus:u,"aria-label":"Opening prompt",className:"min-h-[140px] w-full resize-none rounded-[24px] bg-transparent px-5 pt-2 pb-2 text-[15px] leading-7 text-foreground ring-offset-background placeholder:text-muted-foreground/70 focus-visible:outline-none"}),e.jsxs("div",{className:"chat-composer__rail flex flex-nowrap items-center gap-2 px-3 pb-3",children:[e.jsx(P,{type:"button",variant:"ghost",size:"icon",onClick:q,"aria-label":"Add images",className:"h-9 w-9 shrink-0 rounded-full text-muted-foreground hover:text-foreground",children:e.jsx(Ut,{className:"h-4 w-4"})}),e.jsx("span",{className:"mx-0.5 h-5 w-px bg-border/60","aria-hidden":!0}),e.jsxs(we,{value:_,onValueChange:y,children:[e.jsxs(Ce,{className:A(R,"chat-composer__icon-trigger",Te?he:je),title:`Agent: ${Q}`,"aria-label":`Agent: ${Q}`,children:[e.jsx(Xt,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label truncate",children:Q})]}),e.jsx(Se,{children:Ds()})]}),e.jsxs(we,{value:C,onValueChange:ge=>M(ge),children:[e.jsxs(Ce,{className:A(R,"chat-composer__icon-trigger",De?he:je),title:`Mode: ${F}`,"aria-label":`Mode: ${F}`,children:[e.jsx(ro,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label truncate",children:F})]}),e.jsx(Se,{children:Ms()})]}),e.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[e.jsxs(we,{value:I,onValueChange:$,children:[e.jsx(Ce,{"aria-label":`Priority: ${I}`,title:`Priority: ${I}`,className:A("h-9 w-9 justify-center gap-0 rounded-full p-0 text-xs shadow-none [&>svg:last-child]:hidden",I==="normal"?"border-transparent bg-transparent text-muted-foreground hover:bg-background/40":"border-border/70 bg-background/55",I==="critical"&&"text-destructive",I==="high"&&"text-amber-600 dark:text-amber-400",I==="low"&&"text-muted-foreground"),children:e.jsx(ka,{className:A("h-4 w-4",I==="critical"&&"fill-destructive/20")})}),e.jsxs(Se,{children:[e.jsx(ye,{value:"low",children:"Low"}),e.jsx(ye,{value:"normal",children:"Normal"}),e.jsx(ye,{value:"high",children:"High"}),e.jsx(ye,{value:"critical",children:"Critical"})]})]}),l&&e.jsxs(P,{type:"button",variant:"ghost",size:"sm",onClick:l,"aria-label":x,className:"chat-composer__cancel h-9 rounded-full px-4 text-xs text-muted-foreground",children:[e.jsx(qe,{className:"chat-composer__cancel-icon h-4 w-4 shrink-0"}),e.jsx("span",{className:"chat-composer__footer-label",children:x})]}),e.jsxs(P,{type:"submit",size:"icon",disabled:!re||ee,className:"h-10 w-10 rounded-full shadow-[0_8px_30px_-8px_hsl(var(--primary)/0.6)]",children:[ee?e.jsx(fe,{className:"h-4 w-4 animate-spin"}):e.jsx(Qs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:ee?"Creating chat":m})]})]})]})]}),e.jsx("div",{className:"chat-composer__location flex flex-wrap items-center gap-2 px-1",children:(()=>{const ge="border-border/40 bg-muted/40 text-foreground/80 hover:bg-muted/60 hover:text-foreground";return e.jsxs(e.Fragment,{children:[e.jsx(Es,{value:O,onChange:T,assignTo:S,nodes:t,assignableNodes:L,layout:"composer",chipClassName:R,chipActiveClassName:ge,chipInactiveClassName:ge,triggerClassName:"chat-composer__icon-trigger",labelClassName:"chat-composer__location-label"}),e.jsx(Ts,{value:K,onChange:Y,project:O,assignTo:S,nodes:t,assignableNodes:L,layout:"composer",chipClassName:R,chipActiveClassName:ge,chipInactiveClassName:ge,triggerClassName:"chat-composer__icon-trigger",labelClassName:"chat-composer__location-label"})]})})()})]})})(),(E||X)&&e.jsxs("div",{className:"space-y-3 rounded-[20px] border border-border/60 bg-background/45 p-4",children:[E,X&&e.jsx("div",{className:"text-xs text-destructive",children:X}),!X&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Ctrl/Cmd+Enter starts the chat. Enter adds a new line. Paste screenshots directly into the prompt box or use the Images button."})]})]}):e.jsxs("form",{onSubmit:oe,className:A("space-y-5",d),children:[e.jsx("input",{ref:me,type:"file",accept:"image/*",multiple:!0,onChange:Z,className:"hidden"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{htmlFor:"task-description",className:"text-sm font-medium",children:"Opening prompt"}),e.jsx("textarea",{id:"task-description",value:h,onChange:R=>N(R.target.value),onKeyDown:k,onPaste:te,placeholder:"Describe what the agent should do. This becomes the first message in the chat.",rows:6,autoFocus:u,className:"flex min-h-[144px] w-full resize-none rounded-[22px] border border-border/70 bg-background/70 px-4 py-3 text-sm leading-6 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs(P,{type:"button",variant:"outline",onClick:q,className:"rounded-2xl",children:[e.jsx(Ut,{className:"h-4 w-4"}),"Add images"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Ctrl/Cmd+Enter starts the chat. Enter adds a new line. Upload or paste screenshots and reference images with the opening prompt."})]}),E,X&&e.jsx("p",{className:"text-xs text-destructive",children:X})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_220px_220px]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ee,{htmlFor:"task-title",className:"text-sm font-medium",children:"Chat title"}),e.jsx(Le,{id:"task-title",type:"text",value:g,onChange:R=>b(R.target.value),placeholder:"Optional. Leave blank to derive it from the prompt.",className:"h-11 rounded-2xl border-border/70 bg-background/70"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:v?`Will appear as: ${v}`:"A title will be generated from the first line of the prompt."})]}),ve,xe]}),be,St,e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[ie,D]}),e.jsxs("div",{className:A("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",c),children:[l&&e.jsx(P,{type:"button",variant:"ghost",onClick:l,className:"rounded-2xl",children:x}),e.jsx(P,{type:"submit",disabled:!re||ee,className:"rounded-2xl px-5",children:ee?"Creating...":m})]})]})}const Jl=[{value:"active",label:"Active"},{value:"running",label:"Running"},{value:"waiting",label:"Waiting"},{value:"closed",label:"Closed"},{value:"archived",label:"Archived"}],jt=new Set(["pending","assigned"]),$r=new Set(["running"]),Gl=new Set(["completed","failed","cancelled"]);function Yl(t,s){switch(s){case"running":return $r.has(t.status);case"waiting":return jt.has(t.status);case"closed":return Gl.has(t.status);case"archived":return t.status==="archived";case"active":default:return t.status!=="archived"}}function Xl(t,s){const r=s.trim().toLowerCase();return r?[t.title,t.description,t.id,t.agent,t.assignedTo??"",t.assignedNodeName??"",t.project??"",t.effectiveProjectPath??""].some(n=>n.toLowerCase().includes(r)):!0}function as(t,s,r){if(!t)return"unassigned";const n=s==null?void 0:s.find(a=>a.id===t);return(n==null?void 0:n.name)??r??t.slice(0,8)}function Zl(t,s,r){return as(t,s,r).toLowerCase()}function Ql(t,s){return[...t].sort((r,n)=>r.id===s?-1:n.id===s?1:r.name.localeCompare(n.name))}function ei(t){if(!t||typeof t!="object")return null;const s=t;return{draftNewTask:s.draftNewTask===!0,returnRoute:typeof s.returnRoute=="string"?s.returnRoute:void 0,returnTaskId:typeof s.returnTaskId=="string"||s.returnTaskId===null?s.returnTaskId:void 0}}function ti(t){switch(t){case"running":return"bg-amber-500";case"completed":return"bg-emerald-500";case"failed":return"bg-destructive";case"cancelled":case"archived":return"bg-slate-400";case"assigned":return"bg-teal-500";case"pending":default:return"bg-muted-foreground"}}function si(t){return t==="default workspace"?t:t.replace(/\\/g,"/").split("/").filter(Boolean).at(-1)??t}function ri(t){const s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.floor(s/6e4)}m`:s<864e5?`${Math.floor(s/36e5)}h`:`${Math.floor(s/864e5)}d`}function ni(t){return new Date(t).toLocaleString()}function ai(t){const s=Math.floor(t/1e3),r=Math.floor(s/3600),n=Math.floor(s%3600/60),a=s%60;return`${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}:${String(a).padStart(2,"0")}`}async function He(t,s="Copied to clipboard"){var r,n,a;try{if((n=(r=globalThis.navigator)==null?void 0:r.clipboard)!=null&&n.writeText)return await globalThis.navigator.clipboard.writeText(t),ue.success(s),!0;const l=globalThis.document,d=(a=l==null?void 0:l.execCommand)==null?void 0:a.bind(l);if(!(l!=null&&l.body)||typeof l.createElement!="function"||typeof d!="function")throw new Error("Clipboard access is unavailable");const c=l.createElement("textarea"),m=l.activeElement,x=m&&typeof m.focus=="function"?m:null;c.value=t,c.setAttribute("readonly","true"),c.style.position="fixed",c.style.opacity="0",c.style.pointerEvents="none",l.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);const u=d("copy");if(l.body.removeChild(c),x==null||x.focus(),!u)throw new Error("Clipboard access is unavailable");return ue.success(s),!0}catch(l){return ue.error(l instanceof Error?l.message:"Failed to copy"),!1}}function oi(t,s){const r=new Map;for(const a of t){const l=a.assignedTo??null,d=l??"__unassigned__",c=l?s.get(l)??a.assignedNodeName??l.slice(0,8):"Unassigned",m=a.effectiveProjectPath??a.project??"default workspace";r.has(d)||r.set(d,{nodeId:l,nodeName:c,dirMap:new Map});const x=r.get(d);x.dirMap.has(m)||x.dirMap.set(m,[]),x.dirMap.get(m).push(a)}const n=Array.from(r.values()).map(({nodeId:a,nodeName:l,dirMap:d})=>{const c=Array.from(d.entries()).map(([m,x])=>({path:m,tasks:x})).sort((m,x)=>x.tasks.length-m.tasks.length||m.path.localeCompare(x.path));return{nodeId:a,nodeName:l,dirs:c}});return n.sort((a,l)=>a.nodeId===null?1:l.nodeId===null?-1:a.nodeName.localeCompare(l.nodeName)),n}function ze({label:t,value:s}){return e.jsxs("div",{className:"min-w-[7.25rem] flex-1 rounded-[20px] border border-border/60 bg-background/45 px-3 py-3",children:[e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:t}),e.jsx("div",{className:"mt-1 text-lg font-semibold tracking-tight text-foreground",children:s})]})}function Lt({label:t}){return e.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-muted-foreground",children:t})}function Ae({label:t,value:s,mono:r,action:n}){return e.jsxs("div",{className:"grid grid-cols-[5.25rem,minmax(0,1fr)] items-start gap-3",children:[e.jsx("span",{className:"pt-0.5 text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:t}),e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("span",{className:A("min-w-0 flex-1 break-all text-sm text-foreground",r&&"font-mono text-[11px] leading-5"),children:s}),n]})]})}function Gt({label:t,value:s,mono:r}){return e.jsxs("div",{className:"rounded-[18px] border border-border/60 bg-background/60 px-3 py-3",children:[e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:t}),e.jsx("div",{className:A("mt-1 text-sm font-medium text-foreground",r&&"font-mono text-[11px]"),children:s})]})}function Rr({capabilities:t,action:s}){return e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Capabilities"}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:t.length>0?t.map(r=>e.jsx(ke,{variant:"secondary",className:"rounded-full",children:r},r)):e.jsx("span",{className:"text-sm text-muted-foreground",children:"None declared"})})]}),s&&e.jsx("div",{className:"shrink-0 self-start",children:s})]})}const li=o.lazy(async()=>({default:(await Zt(()=>import("./FilesTab-DT4JyvzA.js"),__vite__mapDeps([0,1,2,3]))).FilesTab})),ii=o.lazy(async()=>({default:(await Zt(()=>import("./PreviewTab-DhvYgvSm.js"),__vite__mapDeps([4,1,2]))).PreviewTab})),di=o.lazy(async()=>({default:(await Zt(()=>import("./DiffTab-BNtQFb4c.js"),__vite__mapDeps([5,1,2,3]))).DiffTab}));function ci({onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d,activeTab:c,setActiveTab:m,creatingTask:x,activeTask:u,assignedNode:p,taskLoading:g,taskError:b,displayEvents:h,hasUserMessageInLogs:N,initialPrompt:_,supportsFollowUp:y,taskUnavailable:C,chatDisabled:M,chatDisabledReason:O,questionBypassEnabled:T,isRunning:K,hasPendingFollowUp:Y,canCancel:I,canRetry:$,onRetry:L,onCancel:se,onStartCreateTask:S,onCancelCreateTask:V,onCreateTask:ee,onSendMessage:U,onQuestionBypassChange:de,onSubmitQuestionResponse:J,messagesEndRef:W}){const[X,me]=o.useState(!1),[q,Z]=o.useState(!1),[te,le]=o.useState(!1),ae=o.useRef(0),f=o.useRef(!1),Q=o.useCallback(k=>{const E=k.currentTarget,D=ae.current;if(ae.current=E.scrollTop,f.current)return;if(E.scrollHeight-E.scrollTop-E.clientHeight<30){Z(!1),f.current=!0,setTimeout(()=>{f.current=!1},300);return}E.scrollTop<D&&D-E.scrollTop>10&&Z(!0),E.scrollTop<=0&&Z(!0)},[]),F=(u==null?void 0:u.effectiveProjectPath)??(u==null?void 0:u.project)??"default workspace",oe=u?(p==null?void 0:p.name)??as(u.assignedTo,l==null?void 0:l.nodes,u.assignedNodeName):"unassigned",v=u?[{label:"Working dir",value:F,mono:!0},...u.branch?[{label:"Branch",value:u.branch,mono:!0}]:[],{label:"Agent",value:u.agent,mono:!0},{label:"Node",value:oe}]:[],re=u!=null&&u.description&&u.description!==u.title?u.description:null;return x?e.jsx(ui,{onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d,onCancel:V,onCreated:ee}):!u&&g?e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-2xl sm:rounded-[32px] border border-border/60 bg-background/78 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[e.jsx("div",{className:"shrink-0 border-b border-border/60 px-4 py-4 sm:px-5",children:e.jsx(dt,{onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d})}),e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full border border-primary/20 bg-primary/10 text-primary",children:e.jsx(fe,{className:"h-7 w-7 animate-spin"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:"Loading conversation"}),e.jsxs("div",{className:"flex items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(fe,{className:"h-4 w-4 animate-spin"}),"Fetching the selected chat thread..."]})]})]})})]}):u?e.jsxs(qs,{value:c,onValueChange:m,className:"flex h-full min-h-0 flex-col overflow-hidden rounded-2xl sm:rounded-[32px] border border-border/60 bg-background/78 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-2.5 sm:px-5",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx(dt,{onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d})}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("h2",{className:"min-w-0 truncate text-base font-semibold tracking-tight text-foreground sm:text-lg",title:u.title,children:u.title}),e.jsx(Ws,{status:u.status}),e.jsx(In,{priority:u.priority}),e.jsx(P,{variant:"ghost",size:"icon",className:"ml-auto h-6 w-6 shrink-0 rounded-full text-muted-foreground",onClick:()=>me(k=>!k),children:X?e.jsx(Is,{className:"h-3.5 w-3.5"}):e.jsx(We,{className:"h-3.5 w-3.5"})})]}),X&&e.jsxs("div",{className:"mt-2 space-y-2",children:[re&&e.jsx("p",{className:"max-w-3xl text-sm leading-5 text-muted-foreground",children:re}),b&&e.jsx("div",{className:"w-fit rounded-full border border-destructive/25 bg-destructive/10 px-3 py-1 text-xs text-destructive",children:b}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-col text-xs text-muted-foreground",children:[e.jsxs("span",{children:["updated ",ni(u.updatedAt)]}),e.jsx("span",{className:"font-mono",children:u.id.slice(0,8)})]}),e.jsx("div",{className:"flex items-center gap-2",children:$&&e.jsxs(P,{variant:"outline",size:"sm",onClick:L,className:"shrink-0 rounded-full",children:[e.jsx(Ga,{className:"h-3.5 w-3.5"}),"Retry"]})})]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[e.jsxs(Hs,{className:"h-auto max-w-full overflow-x-auto rounded-full bg-muted/70 p-1",children:[e.jsx(Fe,{value:"transcript",className:"rounded-full px-2.5 sm:px-4",children:"Transcript"}),e.jsx(Fe,{value:"files",className:"rounded-full px-2.5 sm:px-4",children:"Files"}),e.jsx(Fe,{value:"preview",className:"rounded-full px-2.5 sm:px-4",children:"Preview"}),e.jsx(Fe,{value:"diff",className:"rounded-full px-2.5 sm:px-4",children:"Diff"})]}),K&&e.jsx(ke,{variant:"outline",className:"hidden rounded-full border-amber-500/30 bg-amber-500/10 text-amber-700 sm:inline-flex dark:text-amber-300",children:"Working"}),Y&&e.jsx(ke,{variant:"outline",className:"hidden rounded-full border-primary/30 bg-primary/10 text-primary sm:inline-flex",children:"Queued"}),C&&e.jsx(ke,{variant:"outline",className:"hidden rounded-full border-destructive/25 bg-destructive/10 text-destructive sm:inline-flex",children:"Unavailable"})]})]}),e.jsx(Oe,{value:"transcript",className:"mt-0 min-h-0 flex-1",children:e.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-5",onScroll:Q,children:e.jsxs("div",{className:"mx-auto flex max-w-[72rem] flex-col gap-5",children:[_&&!N&&e.jsx(_s,{event:_,questionBypassEnabled:T,onQuestionBypassChange:de,onSubmitQuestionResponse:J,questionResponseDisabled:!y||M}),h.map((k,E)=>e.jsx(_s,{event:k,questionBypassEnabled:T,onQuestionBypassChange:de,onSubmitQuestionResponse:J,questionResponseDisabled:!y||M},Bo("transcript",k,E))),h.length===0&&e.jsxs("div",{className:"rounded-[28px] border border-dashed border-border/70 bg-background/35 px-5 py-8 text-center",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:"Transcript is warming up"}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:g?"Fetching task output...":"The opening prompt has been stored, but the agent has not emitted conversation output yet."})]}),(!y&&u.result||u.error)&&e.jsxs("div",{className:"space-y-3",children:[!y&&u.result&&e.jsxs("div",{className:"rounded-[26px] border border-border/70 bg-card/80 px-4 py-4",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Stored result"}),e.jsx("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap text-xs leading-5 text-muted-foreground",children:JSON.stringify(u.result,null,2)})]}),u.error&&e.jsxs("div",{className:"rounded-[26px] border border-destructive/20 bg-destructive/10 px-4 py-4 text-destructive",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em]",children:"Stored error"}),e.jsx("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap text-xs leading-5",children:u.error})]})]}),(K||Y)&&h.length>0&&e.jsxs("div",{className:"flex items-center gap-3 rounded-[24px] border border-border/60 bg-background/45 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(fe,{className:"h-4 w-4 animate-spin"}),"The agent is still working on this conversation."]}),e.jsx("div",{ref:W})]})}),y?q?e.jsx(P,{size:"icon",onClick:()=>Z(!1),className:"absolute bottom-4 right-4 z-10 h-12 w-12 rounded-full shadow-lg",children:e.jsx(Nt,{className:"h-5 w-5"})}):e.jsx("div",{className:"shrink-0",children:e.jsx("div",{className:"mx-auto w-full max-w-[72rem]",children:e.jsx(el,{onSend:U,disabled:M,disabledReason:O,contextItems:v,placeholder:M?O:"Continue the conversation...",running:K||Y,onStop:I?()=>le(!0):void 0})})}):e.jsx("div",{className:"shrink-0 border-t border-border/60 px-4 py-4 text-sm text-muted-foreground sm:px-5",children:"This task does not expose follow-up chat messages. Use Files, Preview, or Diff to inspect the result."})]})}),e.jsx(Oe,{value:"files",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(o.Suspense,{fallback:e.jsx(Lt,{label:"Loading files..."}),children:e.jsx(li,{taskId:u.id})})}),e.jsx(Oe,{value:"preview",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(o.Suspense,{fallback:e.jsx(Lt,{label:"Loading preview..."}),children:e.jsx(ii,{taskId:u.id})})}),e.jsx(Oe,{value:"diff",className:"mt-0 min-h-0 flex-1 overflow-hidden",children:e.jsx(o.Suspense,{fallback:e.jsx(Lt,{label:"Loading diff..."}),children:e.jsx(di,{taskId:u.id})})}),e.jsx(Wt,{open:te,onOpenChange:le,children:e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsx(ht,{children:"Stop this task?"}),e.jsx(pt,{children:"The task will stop and move to a cancelled state."})]}),e.jsxs(ft,{children:[e.jsx(bt,{children:"Keep running"}),e.jsx(gt,{onClick:se,children:"Stop task"})]})]})})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-2xl sm:rounded-[32px] border border-border/60 bg-background/78 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[e.jsx("div",{className:"shrink-0 border-b border-border/60 px-4 py-4 sm:px-5",children:e.jsx(dt,{onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d})}),e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsxs("div",{className:"w-full max-w-2xl text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full border border-primary/20 bg-primary/10 text-primary",children:e.jsx(Xt,{className:"h-7 w-7"})}),e.jsx("h2",{className:"mt-5 text-xl font-semibold tracking-tight text-foreground sm:text-3xl",children:"No chat selected"}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm leading-6 text-muted-foreground",children:"Open a task from the left sidebar to continue the conversation, or start a new task to create a fresh chat thread."}),e.jsxs(P,{onClick:S,className:"mt-6 rounded-full px-5",children:[e.jsx(Ys,{className:"h-4 w-4"}),"Start new chat"]}),b&&e.jsx("div",{className:"mx-auto mt-4 max-w-lg rounded-[20px] border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:b})]})})]})}function ui({onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d,onCancel:c,onCreated:m}){var x,u,p;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-2xl sm:rounded-[32px] border border-border/60 bg-background/78 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[e.jsx("div",{className:"shrink-0 border-b border-border/60 px-4 py-4 sm:px-5",children:e.jsx(dt,{onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d})}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center overflow-y-auto px-6 py-10 sm:px-8",children:e.jsx("div",{className:"w-full max-w-2xl",children:e.jsx(Kl,{nodes:(l==null?void 0:l.nodes)??[],currentNodeRole:(x=l==null?void 0:l.self)==null?void 0:x.role,currentNodeId:((u=l==null?void 0:l.self)==null?void 0:u.id)??null,leaderNodeId:((p=l==null?void 0:l.leader)==null?void 0:p.id)??null,onCreated:m,onCancel:c,submitLabel:"Start chat",autoFocus:!0,layout:"composer"})})})]})}function dt({onToggleTasks:t,desktopTasksOpen:s,mobileTasksPanelOpen:r,operationsOpen:n,onToggleOperations:a,cluster:l,sseConnected:d}){var c;return e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e.jsx(mi,{desktopTasksOpen:s,mobileTasksPanelOpen:r,onToggleTasks:t}),e.jsx(ke,{variant:"outline",className:"hidden rounded-full border-border/70 bg-background/60 sm:inline-flex",children:d?"Live":"Retrying"}),((c=l==null?void 0:l.leader)==null?void 0:c.name)&&e.jsxs(ke,{variant:"outline",className:"hidden rounded-full border-border/70 bg-background/60 sm:inline-flex",children:["leader ",l.leader.name]})]}),e.jsxs(P,{variant:"outline",onClick:a,className:"shrink-0 rounded-full border-border/70 bg-background/60 px-3 sm:px-4",children:[n?e.jsx(Zs,{className:"h-4 w-4"}):e.jsx(qa,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:n?"Hide cluster":"Show cluster"})]})]})}function mi({desktopTasksOpen:t,mobileTasksPanelOpen:s,onToggleTasks:r}){var a,l;const n=(l=(a=globalThis.window)==null?void 0:a.matchMedia("(min-width: 1024px)"))!=null&&l.matches?t:s;return e.jsxs(P,{variant:"outline",onClick:r,className:"rounded-full border-border/70 bg-background/60 px-3 sm:px-4",children:[n?e.jsx(Xs,{className:"h-4 w-4"}):e.jsx(za,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:n?"Hide tasks":"Show tasks"})]})}const xi={node:"border-teal-500/30 bg-teal-500/10 text-teal-700 dark:text-teal-300",task:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",election:"border-indigo-500/30 bg-indigo-500/10 text-indigo-700 dark:text-indigo-300",cluster:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"};function fi(t){return t.split(".")[0]??"unknown"}function hi(t){return new Date(t).toLocaleTimeString("en-US",{hour12:!1})}function Ft(t,s){return(s==null?void 0:s.get(t))??t}function pi(t,s){const r=t.data;switch(t.type){case"node.joined":return`${r.name} joined the cluster`;case"node.left":return`${Ft(r.nodeId,s)} left (${r.reason})`;case"node.status":return`${Ft(r.nodeId,s)} is now ${r.status}`;case"task.created":return`"${r.title}" created`;case"task.assigned":return`task assigned to ${Ft(r.nodeId,s)}`;case"task.status":return`task ${r.taskId.slice(0,8)} -> ${r.status}`;case"election.started":return`candidate ${r.candidateId.slice(0,8)} term ${r.term}`;case"election.complete":return`leader elected, term ${r.term}`;case"cluster.state":return`${r.nodeCount} nodes, term ${r.term}`;default:return JSON.stringify(r)}}function gi(t){return JSON.stringify(t,null,2)}function bi({events:t,maxHeight:s="400px",emptyTitle:r="No live events yet",emptyDescription:n="Cluster activity appears here as it happens.",nodeNameById:a}){return t.length===0?e.jsx("div",{className:"flex h-28 items-center justify-center rounded-[20px] border border-dashed border-border/70 bg-background/40 text-center",children:e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground/70",children:n})]})}):e.jsx("div",{className:"overflow-y-auto pr-1",style:{maxHeight:s},children:e.jsx("div",{className:"space-y-2",children:t.map(l=>{const d=fi(l.type);return e.jsx("div",{className:"rounded-[20px] border border-border/60 bg-background/45 px-4 py-3 transition-colors hover:border-border hover:bg-background/65",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:hi(l.timestamp)}),e.jsx(ke,{variant:"outline",className:A("w-fit text-[10px] font-medium uppercase tracking-[0.16em]",xi[d]),children:l.type})]}),e.jsx(P,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 rounded-full text-muted-foreground",onClick:()=>void He(gi(l),"Event copied"),"aria-label":`Copy ${l.type} event`,title:"Copy event",children:e.jsx(vt,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"text-sm leading-6 text-foreground/85",children:pi(l,a)})]})},l.id)})})})}function $s({cluster:t,systemInfo:s,nodeNameById:r,nodeBlockingTaskCounts:n,eventTypeFilter:a,onEventTypeFilterChange:l,eventTypeOptions:d,filteredEvents:c,sseConnected:m,clusterLoading:x,clusterError:u,promotePending:p,onPromote:g,onAddNode:b,leavePending:h,onLeaveCluster:N,onToggleNodeDevTunnel:_,devTunnelNodeId:y,onClose:C}){var L,se,S,V,ee;const M=((L=t==null?void 0:t.self)==null?void 0:L.role)==="leader",O=((se=t==null?void 0:t.self)==null?void 0:se.role)==="follower"&&!(t!=null&&t.leader),T=(t==null?void 0:t.self)??null,Y=Ql((t==null?void 0:t.nodes)??[],T==null?void 0:T.id).filter(U=>U.id!==(T==null?void 0:T.id)),I=(T==null?void 0:T.role)==="leader"&&Y.length===0,$=(T==null?void 0:T.role)==="follower";return e.jsx("aside",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[32px] border border-border/60 bg-background/84 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:e.jsxs(qs,{defaultValue:"overview",className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-semibold tracking-tight",children:"Operations"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Node, cluster, and live events."})]}),e.jsx(P,{variant:"ghost",size:"icon",onClick:C,className:"rounded-full",children:e.jsx(Zs,{className:"h-4 w-4"})})]}),e.jsxs(Hs,{className:"mt-4 grid h-auto w-full grid-cols-3 rounded-full bg-muted/70 p-1",children:[e.jsx(Fe,{value:"overview",className:"rounded-full px-3 text-xs",children:"Overview"}),e.jsx(Fe,{value:"nodes",className:"rounded-full px-3 text-xs",children:"Nodes"}),e.jsx(Fe,{value:"events",className:"rounded-full px-3 text-xs",children:"Live events"})]})]}),e.jsx(Oe,{value:"overview",className:"mt-0 min-h-0 flex-1",children:e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto px-4 py-5",children:e.jsxs("div",{className:"space-y-7",children:[T&&e.jsx(Rs,{node:T,systemInfo:s,blockingTaskCount:n.get(T.id)??0,devTunnelNodeId:y,onToggleNodeDevTunnel:_,showActions:!1,defaultExpanded:!1}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:"Cluster snapshot"}),e.jsx(ke,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:m?"Connected":"Reconnecting"})]}),x&&!t?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(fe,{className:"h-4 w-4 animate-spin"}),"Loading cluster state..."]}):u&&!t?e.jsx("div",{className:"rounded-[22px] border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:u}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(ze,{label:"Term",value:String((t==null?void 0:t.term)??0)}),e.jsx(ze,{label:"Nodes",value:String((t==null?void 0:t.nodes.length)??0)}),e.jsx(ze,{label:"Pending",value:String((t==null?void 0:t.taskSummary.pending)??0)}),e.jsx(ze,{label:"Running",value:String((t==null?void 0:t.taskSummary.running)??0)}),e.jsx(ze,{label:"Completed",value:String((t==null?void 0:t.taskSummary.completed)??0)}),e.jsx(ze,{label:"Failed",value:String((t==null?void 0:t.taskSummary.failed)??0)})]}),e.jsxs("div",{className:"space-y-3 rounded-[24px] border border-border/60 bg-background/45 px-4 py-4",children:[e.jsx(Ae,{label:"Leader",value:((S=t==null?void 0:t.leader)==null?void 0:S.name)??"None"}),e.jsx(Ae,{label:"Leader URL",value:((V=t==null?void 0:t.leader)==null?void 0:V.endpoint)??"Unavailable",mono:!0,action:(ee=t==null?void 0:t.leader)!=null&&ee.endpoint?e.jsx(st,{label:"Copy leader URL",onClick:()=>{var U;return void He(((U=t.leader)==null?void 0:U.endpoint)??"","Leader URL copied")}}):void 0}),e.jsx(Ae,{label:"Feed",value:m?"Receiving live updates":"Reconnecting to event stream"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:O&&e.jsxs(P,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"rounded-full",children:[p&&e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"}),"Promote self"]})})]})]})]})})}),e.jsx(Oe,{value:"nodes",className:"mt-0 min-h-0 flex-1",children:e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-y-auto px-4 py-5",children:e.jsxs("div",{className:"space-y-7",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:"This node"}),I?e.jsx(P,{variant:"outline",size:"sm",onClick:b,className:"rounded-full",children:"Join node"}):$?e.jsxs(P,{variant:"outline",size:"sm",onClick:N,disabled:h,className:"rounded-full",children:[h&&e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"}),"Leave cluster"]}):null]}),T&&e.jsx(Rs,{node:T,systemInfo:s,blockingTaskCount:n.get(T.id)??0,devTunnelNodeId:y,onToggleNodeDevTunnel:_,showActions:!0,defaultExpanded:!0})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"text-sm font-medium text-foreground",children:["Peer nodes (",Y.length,")"]}),Y.length>0?e.jsx("div",{className:"space-y-3",children:Y.map(U=>e.jsx(ji,{node:U,isLeader:!!M,blockingTaskCount:n.get(U.id)??0,devTunnelNodeId:y,onToggleNodeDevTunnel:_},U.id))}):e.jsx("div",{className:"rounded-[24px] border border-dashed border-border/70 bg-background/35 px-4 py-5 text-sm text-muted-foreground",children:"No peer nodes are connected yet."})]})]})})}),e.jsx(Oe,{value:"events",className:"mt-0 min-h-0 flex-1",children:e.jsxs("div",{className:"flex h-full min-h-0 flex-col px-4 py-5",children:[e.jsxs("div",{className:"mb-4 space-y-3",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Un,{className:A("h-4 w-4",m?"text-emerald-500":"text-destructive")}),"Live events"]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(we,{value:a,onValueChange:l,children:[e.jsx(Ce,{className:"h-9 min-w-[11rem] flex-1 rounded-full border-border/70 bg-background/55 text-[12px] sm:max-w-[15rem]",children:e.jsx(Me,{placeholder:"Event type"})}),e.jsx(Se,{children:d.map(U=>e.jsx(ye,{value:U,className:"text-[12px]",children:U==="all"?"All event types":U},U))})]}),e.jsx(ke,{variant:"outline",className:"rounded-full border-border/70 bg-background/60",children:m?"Connected":"Reconnecting"})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(bi,{events:c,maxHeight:"100%",emptyTitle:a==="all"?"No live events yet":"No matching events",emptyDescription:a==="all"?"Cluster activity appears here as it happens.":`No "${a}" events are in the current stream.`,nodeNameById:r})})]})})]})})}function Rs({node:t,systemInfo:s,blockingTaskCount:r,devTunnelNodeId:n,onToggleNodeDevTunnel:a,showActions:l=!0,defaultExpanded:d=!1}){const[c,m]=o.useState(d),x=(s==null?void 0:s.dashboardOrigin)??t.dashboardOrigin,u=t.devtunnelEndpoint??t.endpoint,p=x??t.endpoint,g=(s==null?void 0:s.workDir)??t.workDir,b=sr(t,s==null?void 0:s.transportType),h=es(t,s==null?void 0:s.transportType),N=h&&Ke((s==null?void 0:s.transportType)??t.transportType)?!0:tr(t,s==null?void 0:s.transportType),_=r>0;return e.jsxs("section",{className:"rounded-[28px] border border-primary/20 bg-primary/8 shadow-[0_24px_80px_-60px_hsl(var(--primary)/0.9)]",children:[e.jsxs("button",{type:"button",onClick:()=>m(y=>!y),className:"w-full px-4 py-3.5 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c?e.jsx(We,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ze,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx(Ks,{status:t.status}),e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Current node"}),e.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:y=>y.stopPropagation(),className:"ml-auto shrink-0 text-muted-foreground transition-colors hover:text-primary",title:"Open Dashboard",children:e.jsx(Js,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 pl-6",children:[e.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:t.name}),e.jsx(Gs,{role:t.role}),e.jsx(ke,{variant:"outline",className:"rounded-full border-primary/30 bg-background/60 text-[10px] capitalize",children:t.status})]})]}),c&&e.jsxs("div",{className:"space-y-4 border-t border-primary/15 px-4 pb-4 pt-3",children:[e.jsxs("div",{className:"space-y-3 rounded-[20px] border border-primary/20 bg-background/72 px-3.5 py-3.5",children:[e.jsx(Ae,{label:"Node ID",value:t.id,mono:!0}),x&&e.jsx(Ae,{label:"Dashboard",value:x,mono:!0,action:e.jsx(st,{label:"Copy dashboard URL",onClick:()=>void He(x,"Dashboard URL copied")})}),e.jsx(Ae,{label:"Node URL",value:u,mono:!0,action:e.jsx(st,{label:"Copy node URL",onClick:()=>void He(u,"Node URL copied")})}),g&&e.jsx(Ae,{label:"Workspace",value:g,mono:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(Gt,{label:"Transport",value:b}),s&&e.jsx(Gt,{label:"Uptime",value:ai(s.uptime),mono:!0})]}),e.jsx(Rr,{capabilities:t.capabilities,action:l&&N?e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>a(t),disabled:n===t.id||_,className:"rounded-full",title:_?"Finish assigned or running tasks before changing remote access":void 0,children:[n===t.id&&e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"}),h?"Disable Remote Access":"Enable Remote Access"]}):void 0}),l&&N&&_&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[r," active task",r===1?"":"s"," on this node."]})]})]})}function ji({node:t,isLeader:s,blockingTaskCount:r,devTunnelNodeId:n,onToggleNodeDevTunnel:a}){const[l,d]=o.useState(!1),c=t.dashboardOrigin,m=t.devtunnelEndpoint??t.endpoint,x=c??t.endpoint,u=sr(t),p=es(t),g=tr(t),b=r>0;return e.jsxs("div",{className:"rounded-[24px] border border-border/60 bg-background/45",children:[e.jsxs("button",{type:"button",onClick:()=>d(h=>!h),className:"w-full px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l?e.jsx(We,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ze,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx(Ks,{status:t.status}),e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Peer node"}),e.jsx("a",{href:x,target:"_blank",rel:"noreferrer",onClick:h=>h.stopPropagation(),className:"ml-auto shrink-0 text-muted-foreground transition-colors hover:text-primary",title:"Open Dashboard",children:e.jsx(Js,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 pl-6",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:t.name}),e.jsx(Gs,{role:t.role}),e.jsx(ke,{variant:"outline",className:"rounded-full border-border/70 bg-background/60 text-[10px] capitalize",children:t.status})]})]}),l&&e.jsxs("div",{className:"space-y-4 border-t border-border/50 px-4 pb-4 pt-3",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ae,{label:"Node ID",value:t.id,mono:!0}),c&&e.jsx(Ae,{label:"Dashboard",value:c,mono:!0,action:e.jsx(st,{label:"Copy dashboard URL",onClick:()=>void He(c,"Dashboard URL copied")})}),e.jsx(Ae,{label:"Node URL",value:m,mono:!0,action:e.jsx(st,{label:"Copy node URL",onClick:()=>void He(m,"Node URL copied")})}),t.workDir&&e.jsx(Ae,{label:"Workspace",value:t.workDir,mono:!0}),e.jsx(Gt,{label:"Transport",value:u})]}),e.jsx(Rr,{capabilities:t.capabilities,action:s&&g?e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>a(t),disabled:n===t.id||b,className:"rounded-full",title:b?"Finish assigned or running tasks before changing remote access":void 0,children:[n===t.id&&e.jsx(fe,{className:"h-3.5 w-3.5 animate-spin"}),p?"Disable Remote Access":"Enable Remote Access"]}):void 0}),s&&g&&b&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[r," active task",r===1?"":"s"," on this node."]})]})]})}function st({label:t,onClick:s}){return e.jsx(P,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 rounded-full text-muted-foreground",onClick:s,"aria-label":t,title:t,children:e.jsx(vt,{className:"h-3.5 w-3.5"})})}function yi(t,s,r,n){var d;if(!t)return{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Select a task to continue the conversation."};const a=((d=s==null?void 0:s.self)==null?void 0:d.role)==="follower";return t.assignedTo!==null&&t.assignedNodeAvailable===!1?{taskUnavailable:!0,chatDisabled:!0,chatDisabledReason:`${t.assignedNodeName??"Assigned node"} is unavailable. Leave the cluster on that node or re-run the task elsewhere.`}:a?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Follower nodes are read-only. Use the leader dashboard to manage chat, or leave the cluster first."}:r||n?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:"Waiting for the current turn to finish..."}:jt.has(t.status)||t.status==="archived"?{taskUnavailable:!1,chatDisabled:!0,chatDisabledReason:jt.has(t.status)?"Task has not started yet...":"Archived tasks are read-only."}:{taskUnavailable:!1,chatDisabled:!1,chatDisabledReason:"Continue the conversation..."}}var Ct="Checkbox",[vi]=Bs(Ct),[Ni,os]=vi(Ct);function ki(t){const{__scopeCheckbox:s,checked:r,children:n,defaultChecked:a,disabled:l,form:d,name:c,onCheckedChange:m,required:x,value:u="on",internal_do_not_use_render:p}=t,[g,b]=Bn({prop:r,defaultProp:a??!1,onChange:m,caller:Ct}),[h,N]=o.useState(null),[_,y]=o.useState(null),C=o.useRef(!1),M=h?!!d||!!h.closest("form"):!0,O={checked:g,disabled:l,setChecked:b,control:h,setControl:N,name:c,form:d,value:u,hasConsumerStoppedPropagationRef:C,required:x,defaultChecked:Re(a)?!1:a,isFormControl:M,bubbleInput:_,setBubbleInput:y};return e.jsx(Ni,{scope:s,...O,children:wi(p)?p(O):n})}var Lr="CheckboxTrigger",Fr=o.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:r,...n},a)=>{const{control:l,value:d,disabled:c,checked:m,required:x,setControl:u,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:b,bubbleInput:h}=os(Lr,t),N=yt(a,u),_=o.useRef(m);return o.useEffect(()=>{const y=l==null?void 0:l.form;if(y){const C=()=>p(_.current);return y.addEventListener("reset",C),()=>y.removeEventListener("reset",C)}},[l,p]),e.jsx(Qt.button,{type:"button",role:"checkbox","aria-checked":Re(m)?"mixed":m,"aria-required":x,"data-state":Br(m),"data-disabled":c?"":void 0,disabled:c,value:d,...n,ref:N,onKeyDown:Ot(s,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:Ot(r,y=>{p(C=>Re(C)?!0:!C),h&&b&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})});Fr.displayName=Lr;var ls=o.forwardRef((t,s)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:l,required:d,disabled:c,value:m,onCheckedChange:x,form:u,...p}=t;return e.jsx(ki,{__scopeCheckbox:r,checked:a,defaultChecked:l,disabled:c,required:d,onCheckedChange:x,name:n,form:u,value:m,internal_do_not_use_render:({isFormControl:g})=>e.jsxs(e.Fragment,{children:[e.jsx(Fr,{...p,ref:s,__scopeCheckbox:r}),g&&e.jsx(zr,{__scopeCheckbox:r})]})})});ls.displayName=Ct;var Or="CheckboxIndicator",Ir=o.forwardRef((t,s)=>{const{__scopeCheckbox:r,forceMount:n,...a}=t,l=os(Or,r);return e.jsx(zn,{present:n||Re(l.checked)||l.checked===!0,children:e.jsx(Qt.span,{"data-state":Br(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...t.style}})})});Ir.displayName=Or;var Ur="CheckboxBubbleInput",zr=o.forwardRef(({__scopeCheckbox:t,...s},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:l,defaultChecked:d,required:c,disabled:m,name:x,value:u,form:p,bubbleInput:g,setBubbleInput:b}=os(Ur,t),h=yt(r,b),N=Vn(l),_=qn(n);o.useEffect(()=>{const C=g;if(!C)return;const M=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(M,"checked").set,K=!a.current;if(N!==l&&T){const Y=new Event("click",{bubbles:K});C.indeterminate=Re(l),T.call(C,Re(l)?!1:l),C.dispatchEvent(Y)}},[g,N,l,a]);const y=o.useRef(Re(l)?!1:l);return e.jsx(Qt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??y.current,required:c,disabled:m,name:x,value:u,form:p,...s,tabIndex:-1,ref:h,style:{...s.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});zr.displayName=Ur;function wi(t){return typeof t=="function"}function Re(t){return t==="indeterminate"}function Br(t){return Re(t)?"indeterminate":t?"checked":"unchecked"}const Yt=o.forwardRef(({className:t,...s},r)=>e.jsx(ls,{ref:r,className:A("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(Ir,{className:A("flex items-center justify-center text-current"),children:e.jsx(Pe,{className:"h-3.5 w-3.5"})})}));Yt.displayName=ls.displayName;function Ls({toolbarTasks:t,activeTaskId:s,tasksLoading:r,tasksError:n,isLeader:a,scope:l,agentFilter:d,nodeFilter:c,agentOptions:m,nodeOptions:x,nodeNameById:u,searchQuery:p,selectedTaskIds:g,allVisibleTasksSelected:b,someVisibleTasksSelected:h,canBatchArchive:N,onSearchChange:_,onScopeChange:y,onAgentFilterChange:C,onNodeFilterChange:M,onToggleTaskSelected:O,onToggleAllVisibleTasks:T,onBatchArchive:K,onBatchDelete:Y,onCreateTask:I,onSelectTask:$,onClose:L}){const[se,S]=o.useState(!!p),[V,ee]=o.useState(!1),U=o.useRef(null),de=o.useRef(null),J=g.size,W=l!=="active"||c!=="all"||d!=="all",X=p.trim().length>0,[me,q]=o.useState(new Set),[Z,te]=o.useState(new Set),le=o.useMemo(()=>oi(t,u),[t,u]),ae=le.length===1,f=!ae||W||X,Q=ae&&(W||X),F=o.useCallback(v=>{q(re=>{const k=new Set(re);return k.has(v)?k.delete(v):k.add(v),k})},[]),oe=o.useCallback(v=>{te(re=>{const k=new Set(re);return k.has(v)?k.delete(v):k.add(v),k})},[]);return o.useEffect(()=>{p&&S(!0)},[p]),o.useEffect(()=>{var v;se&&((v=U.current)==null||v.focus())},[se]),o.useEffect(()=>{if(!se)return;const v=k=>{var D;const E=k.target;E instanceof Node&&((D=de.current)!=null&&D.contains(E)||S(!1))},re=k=>{k.key==="Escape"&&S(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",re),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",re)}},[se]),e.jsxs("aside",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[32px] border border-border/60 bg-background/80 shadow-[0_30px_120px_-60px_rgba(0,0,0,var(--panel-shadow-alpha))] backdrop-blur-xl",children:[e.jsxs("div",{className:"shrink-0 border-b border-border/60 px-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-lg font-semibold tracking-tight text-foreground",children:"Tasks"}),e.jsx(P,{variant:"ghost",size:"icon",onClick:L,className:"rounded-full",children:e.jsx(Xs,{className:"h-4 w-4"})})]}),e.jsxs("div",{ref:de,className:"mt-4 flex items-center gap-2",children:[e.jsxs(P,{onClick:I,className:A("justify-start rounded-[22px] px-4 py-6 text-left shadow-[0_24px_60px_-32px_hsl(var(--primary)/0.95)] transition-[flex] duration-200",se?"flex-[2]":"flex-1"),children:[e.jsx(Ys,{className:"h-4 w-4"}),"New chat"]}),se?e.jsxs("div",{className:"flex min-w-0 flex-[3] items-center gap-2",children:[e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx(Ns,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Le,{ref:U,value:p,onChange:v=>_(v.target.value),placeholder:"Search tasks",className:"h-11 rounded-full border-border/70 bg-background/60 pl-11 text-sm"})]}),e.jsx(P,{variant:"outline",size:"icon",onClick:()=>S(!1),className:"rounded-full border-border/70 bg-background/60",children:e.jsx(Wn,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(P,{variant:"outline",onClick:()=>S(!0),className:A("rounded-full border-border/70 bg-background/60 px-4 text-sm",p&&"border-primary/40 bg-primary/8 text-primary"),children:[e.jsx(Ns,{className:"h-4 w-4"}),"Search"]}),e.jsx(P,{variant:V||W?"secondary":"outline",size:"icon",onClick:()=>ee(v=>!v),className:A("shrink-0 rounded-full border-border/70 bg-background/60",W&&"border-primary/40 bg-primary/8 text-primary"),title:"Filters",children:e.jsx(_a,{className:"h-4 w-4"})})]})]}),(V||W)&&e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-3",children:[e.jsxs(we,{value:l,onValueChange:v=>y(v),children:[e.jsx(Ce,{className:"h-9 rounded-full border-border/70 bg-background/55 text-[12px]",children:e.jsx(Me,{})}),e.jsx(Se,{children:Jl.map(v=>e.jsx(ye,{value:v.value,className:"text-[12px]",children:v.label},v.value))})]}),e.jsxs(we,{value:c,onValueChange:M,children:[e.jsx(Ce,{className:"h-9 rounded-full border-border/70 bg-background/55 text-[12px]",children:e.jsx(Me,{placeholder:"Node"})}),e.jsx(Se,{children:x.map(v=>e.jsx(ye,{value:v.value,className:"text-[12px]",children:v.label},v.value))})]}),e.jsxs(we,{value:d,onValueChange:C,children:[e.jsx(Ce,{className:"h-9 rounded-full border-border/70 bg-background/55 text-[12px]",children:e.jsx(Me,{placeholder:"Agent"})}),e.jsx(Se,{children:m.map(v=>e.jsx(ye,{value:v,className:"text-[12px]",children:v==="all"?"All agents":v},v))})]})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:le.length>0?e.jsxs("div",{className:"space-y-1",children:[a&&e.jsxs("div",{className:"mb-1 flex items-center justify-between px-1 py-1",children:[e.jsxs("label",{className:"flex items-center gap-2 text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:[e.jsx(Yt,{checked:h&&!b?"indeterminate":b,onCheckedChange:v=>T(v===!0),"aria-label":"Select all visible tasks"}),e.jsx("span",{children:"Select all"})]}),J>0&&e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>T(!1),className:"h-7 rounded-full px-3 text-xs",children:"Clear"})]}),le.map(v=>{const re=v.nodeId??"__unassigned__",k=f&&!Q&&me.has(re);return e.jsxs("div",{className:"space-y-1",children:[f&&e.jsxs("button",{type:"button",onClick:()=>F(re),"aria-expanded":!k,className:"flex w-full items-center gap-1.5 rounded-xl px-2 py-1.5 text-left text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:[k?e.jsx(Ze,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(We,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:v.nodeName}),e.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground/60",children:v.dirs.reduce((E,D)=>E+D.tasks.length,0)})]}),!k&&v.dirs.map(E=>{const D=`${re}::${E.path}`,ve=Z.has(D),xe=si(E.path);return e.jsxs("div",{className:A("space-y-1",f&&"pl-3"),children:[e.jsxs("button",{type:"button",onClick:()=>oe(D),"aria-expanded":!ve,title:E.path,className:"flex w-full items-center gap-1.5 rounded-xl px-2 py-1 text-left text-[11px] font-medium text-muted-foreground/80 transition-colors hover:bg-muted/40 hover:text-foreground",children:[ve?e.jsx(Ze,{className:"h-3 w-3 shrink-0"}):e.jsx(We,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate font-mono",children:xe}),e.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground/50",children:E.tasks.length})]}),!ve&&e.jsx("div",{className:A("space-y-2",f?"pl-2":"pl-0"),children:E.tasks.map(ie=>e.jsxs("div",{className:A("flex items-start gap-3 rounded-[24px] border px-3 py-3 transition-all",ie.id===s?"border-primary/45 bg-primary/9 shadow-[0_24px_80px_-54px_hsl(var(--primary)/0.95)]":"border-border/60 bg-background/40 hover:border-border hover:bg-background/60"),children:[a&&e.jsx("div",{className:"flex shrink-0 pt-1",onClick:be=>be.stopPropagation(),children:e.jsx(Yt,{checked:g.has(ie.id),onCheckedChange:be=>O(ie.id,be===!0),"aria-label":`Select ${ie.title}`})}),e.jsx("button",{type:"button",onClick:()=>$(ie.id),className:"min-w-0 flex-1 text-left",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:A("mt-1 h-2.5 w-2.5 shrink-0 rounded-full",ti(ie.status))}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:ie.title}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:ie.agent}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border"}),e.jsx("span",{children:ri(ie.updatedAt)})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx(Ws,{status:ie.status}),ie.assignedNodeAvailable===!1&&e.jsx(ke,{variant:"outline",className:"border-destructive/25 bg-destructive/10 text-[10px] text-destructive",children:"unavailable"})]})]})]})})]},ie.id))})]},D)})]},re)})]}):e.jsx("div",{className:"rounded-[24px] border border-dashed border-border/70 bg-background/35 px-4 py-5 text-sm text-muted-foreground",children:r?"Loading tasks...":n||"No tasks match this view."})}),a&&J>0?e.jsxs("div",{className:"shrink-0 border-t border-border/60 px-4 py-4",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Batch actions"}),e.jsxs("div",{className:"mt-2 text-sm font-semibold text-foreground",children:[J," task",J!==1?"s":""," selected"]}),!N&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Only completed, failed, cancelled, or archived tasks can be archived."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(Wt,{children:[e.jsx(As,{asChild:!0,children:e.jsxs(P,{variant:"outline",size:"sm",disabled:!N,className:"rounded-full",children:[e.jsx(ua,{className:"h-3.5 w-3.5"}),"Archive"]})}),e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(ht,{children:["Archive ",J," task",J!==1?"s":"","?"]}),e.jsx(pt,{children:"Archived tasks stay hidden from the default task view and can be reopened from the archived scope."})]}),e.jsxs(ft,{children:[e.jsx(bt,{children:"Cancel"}),e.jsx(gt,{onClick:K,disabled:!N,children:"Archive"})]})]})]}),e.jsxs(Wt,{children:[e.jsx(As,{asChild:!0,children:e.jsxs(P,{variant:"destructive",size:"sm",className:"rounded-full",children:[e.jsx(ao,{className:"h-3.5 w-3.5"}),"Delete"]})}),e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(ht,{children:["Delete ",J," task",J!==1?"s":"","?"]}),e.jsx(pt,{children:"This removes the selected tasks and their saved logs."})]}),e.jsxs(ft,{children:[e.jsx(bt,{children:"Cancel"}),e.jsx(gt,{onClick:Y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]}):null]})}function Fs(t,s,r){const n=o.useRef(s);n.current=s,o.useEffect(()=>{let d=0,c=0;const m=p=>{const g=p.touches[0];g&&(d=g.clientX,c=g.clientY)},x=p=>{var N,_,y,C;const g=p.changedTouches[0];if(!g)return;const b=g.clientX-d;Math.abs(g.clientY-c)>100||Math.abs(b)<50||(b>0?(_=(N=n.current).onSwipeRight)==null||_.call(N):(C=(y=n.current).onSwipeLeft)==null||C.call(y))},u=(t==null?void 0:t.current)??document;return u.addEventListener("touchstart",m,{passive:!0}),u.addEventListener("touchend",x,{passive:!0}),()=>{u.removeEventListener("touchstart",m),u.removeEventListener("touchend",x)}},[t,r==null?void 0:r.threshold,r==null?void 0:r.maxVertical])}const Ci="(min-width: 1024px)",Si="(min-width: 1280px)";function Os(t){var s,r,n;return((n=(r=(s=globalThis.window)==null?void 0:s.matchMedia)==null?void 0:r.call(s,t))==null?void 0:n.matches)??!1}function _i(){const[t,s]=o.useState(!0),[r,n]=o.useState(!1),[a,l]=o.useState(()=>Os(Si)),d=o.useRef(null),c=o.useRef(null);Fs(d,{onSwipeLeft:()=>n(!1)}),Fs(c,{onSwipeRight:()=>l(!1)});const m=o.useCallback(()=>{if(Os(Ci)){s(x=>!x);return}n(x=>!x)},[]);return{desktopTasksOpen:t,mobileTasksPanelOpen:r,mobileTasksPanelRef:d,operationsOpen:a,operationsPanelRef:c,setMobileTasksPanelOpen:n,setOperationsOpen:l,toggleTasksPanel:m}}function Ai(t,s){return s.data.nodeId===t.self.id||s.data.name===t.self.name||s.data.endpoint===t.self.endpoint}function Ti({cluster:t,subscribe:s}){o.useEffect(()=>{var r;if(((r=t==null?void 0:t.self)==null?void 0:r.role)==="leader")return s("node",n=>{const a=String(n.data.name??n.data.nodeId??"node"),l=Ai(t,n);n.type==="node.joined"&&!l&&ue.success(`${a} joined the cluster`),n.type==="node.left"&&!l&&ue.message(`${a} left the cluster`)})},[t,s])}function Ei(){var ps,gs,bs;const{id:t}=Hn(),s=Kn(),r=Jn(),{cluster:n,systemInfo:a,events:l,sseConnected:d,subscribe:c,refresh:m,loading:x,error:u}=Gn(),p=o.useMemo(()=>ei(s.state),[s.state]),[g,b]=o.useState([]),[h,N]=o.useState(!0),[_,y]=o.useState(null),[C,M]=o.useState(null),[O,T]=o.useState("active"),[K,Y]=o.useState("all"),[I,$]=o.useState("all"),[L,se]=o.useState(""),S=o.useDeferredValue(L),{desktopTasksOpen:V,mobileTasksPanelOpen:ee,mobileTasksPanelRef:U,operationsOpen:de,operationsPanelRef:J,setMobileTasksPanelOpen:W,setOperationsOpen:X,toggleTasksPanel:me}=_i(),[q,Z]=o.useState(()=>!!(p!=null&&p.draftNewTask)),[te,le]=o.useState(()=>p!=null&&p.draftNewTask?{route:p.returnRoute??"/",taskId:p.returnTaskId??null}:null),[ae,f]=o.useState(!1),[Q,F]=o.useState("transcript"),[oe,v]=o.useState("all"),[re,k]=o.useState(!1),[E,D]=o.useState(null),[ve,xe]=o.useState([]),[ie,be]=o.useState([]),[St,R]=o.useState(!1),[he,je]=o.useState(null),[Te,De]=o.useState(new Set),[ge,is]=o.useState(!1),[Vr,ds]=o.useState(!1),[qr,cs]=o.useState(null),us=o.useRef(null),Ge=o.useRef(null),Ie=((ps=n==null?void 0:n.self)==null?void 0:ps.role)==="leader",_t=(gs=n==null?void 0:n.self)==null?void 0:gs.id;Ti({cluster:n,subscribe:c});const pe=o.useCallback(async()=>{try{const i=await Yn({assignedTo:!Ie&&_t?_t:void 0,limit:100});b(i),y(null)}catch(i){y(i instanceof Error?i.message:"Failed to load tasks")}finally{N(!1)}},[Ie,_t]);Xn(pe,1e4),o.useEffect(()=>{pe()},[pe]),o.useEffect(()=>c("task",pe),[c,pe]);const ce=o.useMemo(()=>[...g].sort((i,j)=>j.updatedAt-i.updatedAt),[g]),Wr=o.useMemo(()=>{const i=new Map;for(const j of(n==null?void 0:n.nodes)??[]){const w=uo(ce,j.id);w>0&&i.set(j.id,w)}return i},[n==null?void 0:n.nodes,ce]),_e=o.useMemo(()=>ce.filter(i=>!Yl(i,O)||K!=="all"&&i.agent!==K||I==="unassigned"&&i.assignedTo||I!=="all"&&I!=="unassigned"&&Zl(i.assignedTo,n==null?void 0:n.nodes,i.assignedNodeName)!==I?!1:S.trim()?Xl(i,S):!0),[ce,O,K,I,S]);o.useEffect(()=>{De(i=>{const j=go(i,_e.map(w=>w.id));return j.size===i.size?i:j})},[_e]),o.useEffect(()=>{Ie||De(new Set)},[Ie]);const Hr=o.useMemo(()=>["all",...Array.from(new Set(ce.map(i=>i.agent))).sort()],[ce]),Kr=o.useMemo(()=>{const j=Array.from(new Set(ce.map(w=>w.assignedTo).filter(w=>!!w))).map(w=>{const ne=ce.find(z=>z.assignedTo===w);return(n==null?void 0:n.nodes.find(z=>z.id===w))??{id:w,name:as(w,n==null?void 0:n.nodes,ne==null?void 0:ne.assignedNodeName)}}).sort((w,ne)=>w.name.localeCompare(ne.name));return[{value:"all",label:"All nodes"},{value:"unassigned",label:"Unassigned"},...j.map(w=>({value:w.name.toLowerCase(),label:w.name}))]},[ce,n==null?void 0:n.nodes]),ms=o.useMemo(()=>{const i=new Map;for(const j of(n==null?void 0:n.nodes)??[])i.set(j.id,j.name);for(const j of ce)j.assignedTo&&j.assignedNodeName&&!i.has(j.assignedTo)&&i.set(j.assignedTo,j.assignedNodeName);return i},[n==null?void 0:n.nodes,ce]),At=o.useMemo(()=>["all",...Array.from(new Set(l.map(i=>i.type))).sort()],[l]),Jr=o.useMemo(()=>oe==="all"?l:l.filter(i=>i.type===oe),[l,oe]),Gr=_e.length>0&&_e.every(i=>Te.has(i.id)),Yr=_e.some(i=>Te.has(i.id)),Xr=bo(_e,Te);o.useEffect(()=>{p!=null&&p.draftNewTask&&(Z(!0),le({route:p.returnRoute??"/",taskId:p.returnTaskId??null}))},[p]),o.useEffect(()=>{oe!=="all"&&!At.includes(oe)&&v("all")},[oe,At]),o.useEffect(()=>{ks(t,q)&&!C&&ce[0]&&M(ce[0].id)},[t,q,C,ce]),o.useEffect(()=>{var i;ks(t,q)&&(C&&g.some(j=>j.id===C)||M(((i=ce[0])==null?void 0:i.id)??null))},[t,q,C,ce,g]);const G=xo({routeTaskId:t,creatingTask:q,internalSelectedTaskId:C,sortedTaskIds:ce.map(i=>i.id)}),Ue=o.useMemo(()=>g.find(i=>i.id===G)??null,[g,G]);o.useEffect(()=>{Ge.current=G??null},[G]);const at=o.useCallback(()=>{D(null),xe([]),be([]),je(null)},[]),Ne=o.useCallback(async()=>{const i=G;if(i)try{const j=await Zn(i);if(Ge.current!==i)return;D(j),je(null)}catch(j){if(Ge.current!==i)return;D(null),xe([]),be([]),je(j instanceof Error?j.message:"Failed to load task")}finally{Ge.current===i&&R(!1)}},[G]),ot=o.useCallback(async()=>{const i=G;if(i)try{const j=await Qn(i);if(Ge.current!==i)return;xe(w=>Vo(w,j.logs)),be(w=>Wo(w,j.logs))}catch{}},[G]);o.useEffect(()=>{if(!G){D(null),xe([]),be([]),je(null),R(!1);return}F("transcript"),D(Ue),xe([]),be([]),je(null),R(!0),Ne(),ot()},[G,ot,Ne]),o.useEffect(()=>{var j;if(!G||q||h||g.some(w=>w.id===G))return;const i=((j=ce[0])==null?void 0:j.id)??null;M(i),at(),o.startTransition(()=>{r(i?`/tasks/${i}`:"/",{state:null})})},[G,at,q,r,ce,g,h]),o.useEffect(()=>{Ue&&D(i=>!i||i.id!==Ue.id?i:{...i,...Ue})},[Ue]),o.useEffect(()=>c("task.updated",i=>{b(j=>ho(j,i.data))}),[c]),o.useEffect(()=>{if(G)return c("task",i=>{const j=i.data.taskId;if(!(typeof j!="string"||j!==G)){if(i.type==="task.output"){const w=i.data.event;if(w){xe(z=>qo(z,w));const ne=rt(w);ne&&be(z=>Ho(z,ne))}}i.type==="task.updated"&&Ne(),i.type==="task.status"&&(Ne(),ot())}})},[c,G,Ne,ot]),o.useEffect(()=>{var i;Q==="transcript"&&((i=us.current)==null||i.scrollIntoView({behavior:"smooth"}))},[ve,ie,Q]);const H=E??Ue,Zr=H!=null&&H.assignedTo?(n==null?void 0:n.nodes.find(i=>i.id===H.assignedTo))??null:null,Tt=ie.length>0,Qr=H?Tl.has(H.agent):!1,Et=(H==null?void 0:H.status)==="running",en=H?jt.has(H.status)||$r.has(H.status):!1,tn=!!(H&&Ie&&H.status==="failed"),Dt=o.useMemo(()=>yi(H,n,Tt,!!Et),[H,n,Tt,Et]),sn=o.useMemo(()=>Ko(ve),[ve]),Mt=o.useMemo(()=>Jo([...ve,...ie.map(i=>$t(i.content,i.timestamp))]),[ve,ie]),rn=o.useMemo(()=>{if(!H)return null;const i=ko(H);if(i.length>0)return $t(i,new Date(H.createdAt).toISOString());if(Mt.length>0)return null;const j=Ye(H.description||H.title);return j.length>0?$t(j,new Date(H.createdAt).toISOString()):null},[H,Mt]),Pt=o.useCallback(()=>{const i={route:t?`/tasks/${t}`:"/",taskId:G};le(i),Z(!0),o.startTransition(()=>{r("/",{state:{draftNewTask:!0,returnRoute:i.route,returnTaskId:i.taskId}})})},[t,G,r]),nn=o.useCallback(()=>{var j;const i=(te==null?void 0:te.taskId)??((j=ce[0])==null?void 0:j.id)??null;Z(!1),le(null),M(i),o.startTransition(()=>{r((te==null?void 0:te.route)??"/",{state:null})})},[te,ce,r]),xs=o.useCallback(i=>{Z(!1),le(null),M(i),o.startTransition(()=>{r(`/tasks/${i}`,{state:null})})},[r]),an=o.useCallback(i=>{Z(!1),le(null),b(j=>fo(j,i)),D(i),xe([]),be([]),je(null),R(!1),F("transcript"),M(i.id),pe(),o.startTransition(()=>{r(`/tasks/${i.id}`,{state:null})})},[pe,r]),lt=o.useCallback(async i=>{if(!G)return!1;const j=`local-${Date.now()}-${Math.random().toString(16).slice(2)}`;be(w=>[...w,{id:j,content:i,timestamp:new Date().toISOString()}]);try{return await ea(G,i),Ne(),!0}catch(w){return be(ne=>ne.filter(z=>z.id!==j)),ue.error(w instanceof Error?w.message:"Failed to send message"),!1}},[G,Ne]),on=o.useCallback(i=>{lt(i)},[lt]),ln=o.useCallback(i=>lt(i),[lt]),dn=o.useCallback(async()=>{if(H)try{await ta(H.id),Ne(),pe()}catch(i){ue.error(i instanceof Error?i.message:"Failed to cancel task")}},[H,Ne,pe]),cn=o.useCallback(async()=>{if(H)try{await sa(H.id),Ne(),pe()}catch(i){ue.error(i instanceof Error?i.message:"Failed to retry task")}},[H,Ne,pe]),it=o.useCallback((i,j=!1)=>{const w=jo(_e,i);return M(w),(j||!w)&&at(),o.startTransition(()=>{r(w?`/tasks/${w}`:"/",{state:null})}),w},[at,_e,r]),un=o.useCallback((i,j)=>{De(w=>{const ne=new Set(w);return j?ne.add(i):ne.delete(i),ne})},[]),mn=o.useCallback(i=>{if(!i){De(new Set);return}De(new Set(_e.map(j=>j.id)))},[_e]),xn=o.useCallback(async()=>{const i=Array.from(Te);if(i.length!==0)try{const{results:j}=await ra(i),w=j.filter(z=>!z.ok),ne=j.filter(z=>z.ok).map(z=>z.id);G&&ne.includes(G)&&it(ne),w.length>0?ue.error(`Failed to archive ${w.length} task(s): ${w.map(z=>z.error??z.id).join(", ")}`):ue.success(`Archived ${ne.length} task(s)`),De(new Set(w.map(z=>z.id))),pe()}catch(j){ue.error(j instanceof Error?j.message:"Failed to archive tasks")}},[G,pe,it,Te]),fn=o.useCallback(async()=>{const i=Array.from(Te);if(i.length!==0)try{const{results:j}=await na(i),w=j.filter(z=>!z.ok),ne=j.filter(z=>z.ok).map(z=>z.id);G&&ne.includes(G)&&it(ne,!0),w.length>0?ue.error(`Failed to delete ${w.length} task(s): ${w.map(z=>z.error??z.id).join(", ")}`):ue.success(`Deleted ${ne.length} task(s)`),De(new Set(w.map(z=>z.id))),pe()}catch(j){ue.error(j instanceof Error?j.message:"Failed to delete tasks")}},[G,pe,it,Te]),hn=o.useCallback(async()=>{is(!0);try{await aa(),m()}catch(i){ue.error(i instanceof Error?i.message:"Failed to promote node")}finally{is(!1)}},[m]),pn=o.useCallback(async()=>{ds(!0);try{await oa(),ue.success("This node left the remote cluster and is leading itself again."),pe(),Ne(),m()}catch(i){ue.error(i instanceof Error?i.message:"Failed to leave cluster")}finally{ds(!1)}},[Ne,pe,m]),gn=o.useCallback(async i=>{var js;const j=!es(i),w=i.id===((js=n==null?void 0:n.self)==null?void 0:js.id),ne=w?(a==null?void 0:a.transportType)??i.transportType:i.transportType,z=w&&!j&&Ke(ne);cs(i.id);try{z?await la("direct"):await ia(i.id,j),ue.success(j?`Enabled remote access on ${i.name}`:`Disabled remote access on ${i.name}`),m()}catch(ys){ue.error(ys instanceof Error?ys.message:"Failed to update remote access")}finally{cs(null)}},[(bs=n==null?void 0:n.self)==null?void 0:bs.id,m,a==null?void 0:a.transportType]),fs={toolbarTasks:_e,activeTaskId:G,tasksLoading:h,tasksError:_,isLeader:Ie,scope:O,agentFilter:K,nodeFilter:I,agentOptions:Hr,nodeOptions:Kr,nodeNameById:ms,searchQuery:L,selectedTaskIds:Te,allVisibleTasksSelected:Gr,someVisibleTasksSelected:Yr,canBatchArchive:Xr,onSearchChange:se,onScopeChange:T,onAgentFilterChange:Y,onNodeFilterChange:$,onToggleTaskSelected:un,onToggleAllVisibleTasks:mn,onBatchArchive:xn,onBatchDelete:fn,onCreateTask:Pt,onSelectTask:xs,onClose:me},hs={cluster:n,systemInfo:a,nodeNameById:ms,nodeBlockingTaskCounts:Wr,eventTypeFilter:oe,onEventTypeFilterChange:v,eventTypeOptions:At,filteredEvents:Jr,sseConnected:d,clusterLoading:x,clusterError:u,promotePending:ge,onPromote:hn,onAddNode:()=>f(!0),leavePending:Vr,onLeaveCluster:pn,onToggleNodeDevTunnel:gn,devTunnelNodeId:qr,onClose:()=>X(!1)};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden pb-2",children:[e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsx("div",{className:A("hidden lg:block lg:shrink-0 lg:transition-all lg:duration-300",V?"lg:mr-3 lg:w-[24rem]":"lg:w-0 lg:overflow-hidden"),children:V&&e.jsx(Ls,{...fs})}),e.jsx("section",{className:"min-h-0 min-w-0 flex-1",children:e.jsx(ci,{onToggleTasks:me,desktopTasksOpen:V,mobileTasksPanelOpen:ee,operationsOpen:de,onToggleOperations:()=>X(i=>!i),cluster:n,sseConnected:d,activeTab:Q,setActiveTab:F,creatingTask:q,activeTask:H,assignedNode:Zr,taskLoading:St,taskError:he,displayEvents:Mt,hasUserMessageInLogs:sn,initialPrompt:rn,supportsFollowUp:Qr,taskUnavailable:Dt.taskUnavailable,chatDisabled:Dt.chatDisabled,chatDisabledReason:Dt.chatDisabledReason,questionBypassEnabled:re,isRunning:!!Et,hasPendingFollowUp:Tt,canCancel:!!en,canRetry:!!tn,onRetry:cn,onCancel:dn,onStartCreateTask:Pt,onCancelCreateTask:nn,onCreateTask:an,onSendMessage:on,onQuestionBypassChange:k,onSubmitQuestionResponse:ln,messagesEndRef:us})}),e.jsx("div",{className:A("hidden xl:block xl:shrink-0 xl:transition-all xl:duration-300",de?"xl:ml-3 xl:w-[26rem]":"xl:w-0 xl:overflow-hidden"),children:de&&e.jsx($s,{...hs})})]}),de&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close operations panel",onClick:()=>X(!1),className:"fixed inset-0 z-30 bg-black/45 backdrop-blur-sm xl:hidden"}),e.jsx("div",{ref:J,className:"fixed inset-y-0 right-0 z-40 w-full p-2 sm:max-w-sm sm:p-3 xl:hidden",children:e.jsx($s,{...hs})})]}),ee&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Close task list",onClick:()=>W(!1),className:"fixed inset-0 z-30 bg-black/45 backdrop-blur-sm lg:hidden"}),e.jsx("div",{ref:U,className:"fixed inset-y-0 left-0 z-40 w-full p-2 sm:max-w-sm sm:p-3 lg:hidden",children:e.jsx(Ls,{...fs,onCreateTask:()=>{W(!1),Pt()},onSelectTask:i=>{W(!1),xs(i)},onClose:()=>W(!1)})})]}),e.jsx(da,{open:ae,onOpenChange:f,children:e.jsx(Qo,{onAdded:()=>{f(!1),m()}})})]})}const Mi=Object.freeze(Object.defineProperty({__proto__:null,DashboardPage:Ei},Symbol.toStringTag,{value:"Module"}));export{Ze as C,Mi as D,Ca as F,vs as G};
|