nexus-shell 0.2.2 → 0.2.4

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.
@@ -1,24 +1,24 @@
1
- var Ee = Object.defineProperty;
2
- var Ie = (o, e, n) => e in o ? Ee(o, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[e] = n;
3
- var H = (o, e, n) => Ie(o, typeof e != "symbol" ? e + "" : e, n);
4
- import { jsxs as c, jsx as r, Fragment as he } from "react/jsx-runtime";
5
- import se, { useMemo as R, useState as A, useRef as P, useEffect as z } from "react";
6
- import { Model as $, Actions as G, DockLocation as Oe, Layout as ze } from "flexlayout-react";
1
+ var Oe = Object.defineProperty;
2
+ var Ae = (n, e, o) => e in n ? Oe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o;
3
+ var H = (n, e, o) => Ae(n, typeof e != "symbol" ? e + "" : e, o);
4
+ import { jsxs as c, jsx as r, Fragment as be } from "react/jsx-runtime";
5
+ import se, { useMemo as j, useState as A, useRef as z, useEffect as O } from "react";
6
+ import { Model as R, Actions as G, DockLocation as Le, Layout as Me } from "flexlayout-react";
7
7
  import "flexlayout-react/style/light.css";
8
- import { Settings as Ae, MessageCircle as be, X as J, User as xe, Terminal as ve, Send as Le, ChevronRight as ye, Sun as Me, Moon as Pe, GraduationCap as Ke, ChevronUp as we, Search as X, Info as $e, HelpCircle as je, AlertCircle as Re, Check as Fe, Camera as Ue, Edit2 as _e, Loader2 as Ne, ChevronsUpDown as Je, ChevronDown as ke, Clock as He, Plus as We, FolderPlus as Be, Edit as Ge, Trash2 as Ve, Folder as Ye, File as qe } from "lucide-react";
9
- import { clsx as Qe } from "clsx";
10
- import { twMerge as Xe } from "tailwind-merge";
11
- import { create as U } from "zustand";
12
- import { TableVirtuoso as Ze, Virtuoso as et } from "react-virtuoso";
13
- function S(...o) {
14
- return Xe(Qe(o));
8
+ import { Settings as ze, MessageCircle as xe, X as B, User as ve, Terminal as ye, Send as Pe, ChevronRight as we, GraduationCap as ue, Moon as $e, Sun as Re, Palette as Ke, ChevronUp as Ne, Search as Z, Info as je, HelpCircle as Ue, AlertCircle as Fe, Check as _e, Camera as Be, Edit2 as He, Loader2 as ke, ChevronsUpDown as We, ChevronDown as Ce, Clock as Je } from "lucide-react";
9
+ import { clsx as Ge } from "clsx";
10
+ import { twMerge as Ve } from "tailwind-merge";
11
+ import { create as F } from "zustand";
12
+ import { TableVirtuoso as Ye, Virtuoso as qe } from "react-virtuoso";
13
+ function S(...n) {
14
+ return Ve(Ge(n));
15
15
  }
16
- const tt = [
17
- { id: "settings", label: "Settings", icon: Ae }
18
- ], rt = ({
19
- items: o = [],
20
- bottomItems: e = tt,
21
- activeId: n = null,
16
+ const Qe = [
17
+ { id: "settings", label: "Settings", icon: ze }
18
+ ], Xe = ({
19
+ items: n = [],
20
+ bottomItems: e = Qe,
21
+ activeId: o = null,
22
22
  onSelect: t,
23
23
  className: a,
24
24
  "aria-label": s = "Activity Bar"
@@ -30,10 +30,10 @@ const tt = [
30
30
  onClick: () => t == null ? void 0 : t(u),
31
31
  "aria-label": i,
32
32
  title: i,
33
- "aria-pressed": n === u,
33
+ "aria-pressed": o === u,
34
34
  className: S(
35
35
  "p-2 cursor-pointer rounded text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
36
- n === u && "text-foreground border-l-2 border-primary rounded-none"
36
+ o === u && "text-foreground border-l-2 border-primary rounded-none"
37
37
  ),
38
38
  children: /* @__PURE__ */ r(d, { size: 20 })
39
39
  },
@@ -49,88 +49,88 @@ const tt = [
49
49
  a
50
50
  ),
51
51
  children: [
52
- /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col space-y-4", children: o.map(l) }),
52
+ /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col space-y-4", children: n.map(l) }),
53
53
  e.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-col space-y-4", children: e.map(l) })
54
54
  ]
55
55
  }
56
56
  );
57
- }, q = "nexus-shell-sidebar", F = U((o) => {
57
+ }, q = "nexus-shell-sidebar", U = F((n) => {
58
58
  const e = localStorage.getItem(q);
59
59
  return {
60
60
  activeSidebar: e !== null ? e : null,
61
61
  panels: [],
62
62
  setActiveSidebar: (t) => {
63
- t === null ? localStorage.removeItem(q) : localStorage.setItem(q, t), o({ activeSidebar: t });
63
+ t === null ? localStorage.removeItem(q) : localStorage.setItem(q, t), n({ activeSidebar: t });
64
64
  },
65
- toggleSidebar: (t) => o((a) => {
65
+ toggleSidebar: (t) => n((a) => {
66
66
  const s = a.activeSidebar === t ? null : t;
67
67
  return s === null ? localStorage.removeItem(q) : localStorage.setItem(q, s), { activeSidebar: s };
68
68
  }),
69
- setPanels: (t) => o({ panels: t })
69
+ setPanels: (t) => n({ panels: t })
70
70
  };
71
- }), nt = (o) => {
72
- const e = F((s) => s.panels), n = F((s) => s.activeSidebar), t = F((s) => s.toggleSidebar), a = R(
71
+ }), Ze = (n) => {
72
+ const e = U((s) => s.panels), o = U((s) => s.activeSidebar), t = U((s) => s.toggleSidebar), a = j(
73
73
  () => e.map(({ id: s, label: l, icon: u }) => ({ id: s, label: l, icon: u })),
74
74
  [e]
75
75
  );
76
76
  return /* @__PURE__ */ r(
77
- rt,
77
+ Xe,
78
78
  {
79
- ...o,
79
+ ...n,
80
80
  items: a,
81
- activeId: n,
81
+ activeId: o,
82
82
  onSelect: t
83
83
  }
84
84
  );
85
- }, ot = /* @__PURE__ */ c("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
86
- /* @__PURE__ */ r(be, { size: 28, className: "mb-3 opacity-40" }),
85
+ }, et = /* @__PURE__ */ c("div", { className: "h-full flex flex-col items-center justify-center text-center px-6 text-muted-foreground", children: [
86
+ /* @__PURE__ */ r(xe, { size: 28, className: "mb-3 opacity-40" }),
87
87
  /* @__PURE__ */ r("p", { className: "text-xs", children: "No messages yet." }),
88
88
  /* @__PURE__ */ c("p", { className: "text-[11px] mt-1 opacity-70", children: [
89
89
  "Type a message, or ",
90
90
  /* @__PURE__ */ r("span", { className: "font-mono", children: "/" }),
91
91
  " for commands."
92
92
  ] })
93
- ] }), st = ({
94
- messages: o = [],
93
+ ] }), tt = ({
94
+ messages: n = [],
95
95
  onSend: e,
96
- slashCommands: n = [],
96
+ slashCommands: o = [],
97
97
  onSlashCommand: t,
98
98
  onClose: a,
99
99
  title: s = "Chat",
100
100
  placeholder: l = "Send a message…",
101
- emptyState: u = ot,
101
+ emptyState: u = et,
102
102
  className: i
103
103
  }) => {
104
- const [d, f] = A(""), [p, m] = A(0), k = P(null), C = P(null), x = d.startsWith("/") ? n.filter(
105
- (y) => `/${y.command}`.startsWith(d.toLowerCase().split(" ")[0])
106
- ) : [], h = x.length > 0;
107
- z(() => {
108
- C.current && (C.current.scrollTop = C.current.scrollHeight);
109
- }, [o]), z(() => {
110
- m(0);
104
+ const [d, m] = A(""), [f, p] = A(0), N = z(null), k = z(null), w = d.startsWith("/") ? o.filter(
105
+ (g) => `/${g.command}`.startsWith(d.toLowerCase().split(" ")[0])
106
+ ) : [], h = w.length > 0;
107
+ O(() => {
108
+ k.current && (k.current.scrollTop = k.current.scrollHeight);
109
+ }, [n]), O(() => {
110
+ p(0);
111
111
  }, [d]);
112
- const T = () => {
113
- const y = d.trim();
114
- y && (e == null || e(y), f(""));
115
- }, I = (y) => {
116
- var g;
117
- t == null || t(y), f(`/${y.command} `), (g = k.current) == null || g.focus();
118
- }, N = (y) => {
112
+ const x = () => {
113
+ const g = d.trim();
114
+ g && (e == null || e(g), m(""));
115
+ }, b = (g) => {
116
+ var C;
117
+ t == null || t(g), m(`/${g.command} `), (C = N.current) == null || C.focus();
118
+ }, y = (g) => {
119
119
  if (h) {
120
- if (y.key === "ArrowDown") {
121
- y.preventDefault(), m((g) => (g + 1) % x.length);
120
+ if (g.key === "ArrowDown") {
121
+ g.preventDefault(), p((C) => (C + 1) % w.length);
122
122
  return;
123
123
  }
124
- if (y.key === "ArrowUp") {
125
- y.preventDefault(), m((g) => (g - 1 + x.length) % x.length);
124
+ if (g.key === "ArrowUp") {
125
+ g.preventDefault(), p((C) => (C - 1 + w.length) % w.length);
126
126
  return;
127
127
  }
128
- if (y.key === "Tab" || y.key === "Enter" && !y.shiftKey) {
129
- y.preventDefault(), I(x[p]);
128
+ if (g.key === "Tab" || g.key === "Enter" && !g.shiftKey) {
129
+ g.preventDefault(), b(w[f]);
130
130
  return;
131
131
  }
132
132
  }
133
- y.key === "Enter" && !y.shiftKey && (y.preventDefault(), T());
133
+ g.key === "Enter" && !g.shiftKey && (g.preventDefault(), x());
134
134
  };
135
135
  return /* @__PURE__ */ c(
136
136
  "aside",
@@ -144,7 +144,7 @@ const tt = [
144
144
  children: [
145
145
  /* @__PURE__ */ c("div", { className: "h-10 flex items-center justify-between px-4 shrink-0", children: [
146
146
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
147
- /* @__PURE__ */ r(be, { size: 13 }),
147
+ /* @__PURE__ */ r(xe, { size: 13 }),
148
148
  /* @__PURE__ */ r("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: s })
149
149
  ] }),
150
150
  a && /* @__PURE__ */ r(
@@ -154,41 +154,41 @@ const tt = [
154
154
  onClick: a,
155
155
  "aria-label": "Close Chat",
156
156
  className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
157
- children: /* @__PURE__ */ r(J, { size: 14 })
157
+ children: /* @__PURE__ */ r(B, { size: 14 })
158
158
  }
159
159
  )
160
160
  ] }),
161
161
  /* @__PURE__ */ r(
162
162
  "div",
163
163
  {
164
- ref: C,
164
+ ref: k,
165
165
  role: "log",
166
166
  "aria-label": `${s} transcript`,
167
167
  className: "flex-1 overflow-y-auto border-t border-border/50 bg-background/50 px-3 py-3 space-y-3",
168
- children: o.length === 0 ? u : o.map((y) => {
169
- const g = y.role === "user";
168
+ children: n.length === 0 ? u : n.map((g) => {
169
+ const C = g.role === "user";
170
170
  return /* @__PURE__ */ c(
171
171
  "div",
172
172
  {
173
- className: S("flex flex-col", g ? "items-end" : "items-start"),
173
+ className: S("flex flex-col", C ? "items-end" : "items-start"),
174
174
  children: [
175
175
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-1 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: [
176
- g ? /* @__PURE__ */ r(xe, { size: 10 }) : /* @__PURE__ */ r(ve, { size: 10 }),
177
- /* @__PURE__ */ r("span", { children: y.author ?? (g ? "You" : "Assistant") })
176
+ C ? /* @__PURE__ */ r(ve, { size: 10 }) : /* @__PURE__ */ r(ye, { size: 10 }),
177
+ /* @__PURE__ */ r("span", { children: g.author ?? (C ? "You" : "Assistant") })
178
178
  ] }),
179
179
  /* @__PURE__ */ r(
180
180
  "div",
181
181
  {
182
182
  className: S(
183
183
  "max-w-[85%] rounded-lg px-3 py-2 text-xs whitespace-pre-wrap break-words",
184
- g ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
184
+ C ? "bg-primary text-primary-foreground" : "bg-card border border-border text-foreground"
185
185
  ),
186
- children: y.text
186
+ children: g.text
187
187
  }
188
188
  )
189
189
  ]
190
190
  },
191
- y.id
191
+ g.id
192
192
  );
193
193
  })
194
194
  }
@@ -200,26 +200,26 @@ const tt = [
200
200
  role: "listbox",
201
201
  "aria-label": "Slash commands",
202
202
  className: "absolute bottom-full left-2 right-2 mb-1 bg-popover border border-border rounded-md shadow-lg overflow-hidden z-20",
203
- children: x.map((y, g) => /* @__PURE__ */ c(
203
+ children: w.map((g, C) => /* @__PURE__ */ c(
204
204
  "div",
205
205
  {
206
206
  role: "option",
207
- "aria-selected": g === p,
208
- onMouseEnter: () => m(g),
209
- onClick: () => I(y),
207
+ "aria-selected": C === f,
208
+ onMouseEnter: () => p(C),
209
+ onClick: () => b(g),
210
210
  className: S(
211
211
  "px-3 py-1.5 text-xs cursor-pointer flex items-baseline justify-between gap-3",
212
- g === p ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
212
+ C === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
213
213
  ),
214
214
  children: [
215
215
  /* @__PURE__ */ c("span", { className: "font-mono", children: [
216
216
  "/",
217
- y.command
217
+ g.command
218
218
  ] }),
219
- /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground truncate", children: y.description })
219
+ /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground truncate", children: g.description })
220
220
  ]
221
221
  },
222
- y.command
222
+ g.command
223
223
  ))
224
224
  }
225
225
  ),
@@ -227,13 +227,13 @@ const tt = [
227
227
  /* @__PURE__ */ r(
228
228
  "textarea",
229
229
  {
230
- ref: k,
230
+ ref: N,
231
231
  rows: 1,
232
232
  value: d,
233
233
  "aria-label": `${s} message`,
234
234
  placeholder: l,
235
- onChange: (y) => f(y.target.value),
236
- onKeyDown: N,
235
+ onChange: (g) => m(g.target.value),
236
+ onKeyDown: y,
237
237
  className: "flex-1 resize-none bg-background border border-border rounded-md px-3 py-2 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50 max-h-32"
238
238
  }
239
239
  ),
@@ -241,11 +241,11 @@ const tt = [
241
241
  "button",
242
242
  {
243
243
  type: "button",
244
- onClick: T,
244
+ onClick: x,
245
245
  disabled: !d.trim(),
246
246
  "aria-label": "Send message",
247
247
  className: "p-2 rounded-md bg-primary text-primary-foreground disabled:opacity-40 disabled:cursor-not-allowed hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
248
- children: /* @__PURE__ */ r(Le, { size: 14 })
248
+ children: /* @__PURE__ */ r(Pe, { size: 14 })
249
249
  }
250
250
  )
251
251
  ] })
@@ -254,53 +254,53 @@ const tt = [
254
254
  }
255
255
  );
256
256
  };
257
- let at = 0;
258
- const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
257
+ let rt = 0;
258
+ const nt = () => `msg-${Date.now()}-${rt += 1}`, Q = F((n) => ({
259
259
  messages: [],
260
260
  slashCommands: [],
261
- setMessages: (e) => o({ messages: e }),
262
- addMessage: (e) => o((n) => ({
263
- messages: [...n.messages, { ...e, id: e.id ?? lt() }]
261
+ setMessages: (e) => n({ messages: e }),
262
+ addMessage: (e) => n((o) => ({
263
+ messages: [...o.messages, { ...e, id: e.id ?? nt() }]
264
264
  })),
265
- clearMessages: () => o({ messages: [] }),
266
- setSlashCommands: (e) => o({ slashCommands: e }),
267
- registerSlashCommand: (e) => o((n) => ({ slashCommands: [...n.slashCommands, e] }))
268
- })), te = "nexus-shell-right-sidebar", ae = U((o) => ({
269
- isChatOpen: localStorage.getItem(te) === "true",
265
+ clearMessages: () => n({ messages: [] }),
266
+ setSlashCommands: (e) => n({ slashCommands: e }),
267
+ registerSlashCommand: (e) => n((o) => ({ slashCommands: [...o.slashCommands, e] }))
268
+ })), re = "nexus-shell-right-sidebar", ae = F((n) => ({
269
+ isChatOpen: localStorage.getItem(re) === "true",
270
270
  setChatOpen: (t) => {
271
- localStorage.setItem(te, String(t)), o({ isChatOpen: t });
271
+ localStorage.setItem(re, String(t)), n({ isChatOpen: t });
272
272
  },
273
- toggleChat: () => o((t) => {
273
+ toggleChat: () => n((t) => {
274
274
  const a = !t.isChatOpen;
275
- return localStorage.setItem(te, String(a)), { isChatOpen: a };
275
+ return localStorage.setItem(re, String(a)), { isChatOpen: a };
276
276
  })
277
- })), it = ({ onSend: o, ...e }) => {
278
- const n = ae((i) => i.isChatOpen), t = ae((i) => i.setChatOpen), a = Q((i) => i.messages), s = Q((i) => i.slashCommands), l = Q((i) => i.addMessage);
279
- return n ? /* @__PURE__ */ r(
280
- st,
277
+ })), ot = ({ onSend: n, ...e }) => {
278
+ const o = ae((i) => i.isChatOpen), t = ae((i) => i.setChatOpen), a = Q((i) => i.messages), s = Q((i) => i.slashCommands), l = Q((i) => i.addMessage);
279
+ return o ? /* @__PURE__ */ r(
280
+ tt,
281
281
  {
282
282
  ...e,
283
283
  messages: a,
284
284
  slashCommands: s,
285
285
  onSend: (i) => {
286
286
  if (l({ role: "user", text: i }), i.startsWith("/")) {
287
- const [d, ...f] = i.slice(1).split(/\s+/), p = s.find((m) => m.command === d);
288
- if (p) {
289
- p.execute(f);
287
+ const [d, ...m] = i.slice(1).split(/\s+/), f = s.find((p) => p.command === d);
288
+ if (f) {
289
+ f.execute(m);
290
290
  return;
291
291
  }
292
292
  l({ role: "assistant", text: `Unknown command: /${d}` });
293
293
  return;
294
294
  }
295
- o == null || o(i);
295
+ n == null || n(i);
296
296
  },
297
297
  onClose: () => t(!1)
298
298
  }
299
299
  ) : null;
300
- }, dt = ({
301
- menus: o = {},
300
+ }, st = ({
301
+ menus: n = {},
302
302
  onSelect: e,
303
- title: n,
303
+ title: o,
304
304
  center: t,
305
305
  right: a,
306
306
  className: s
@@ -317,15 +317,15 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
317
317
  role: "menuitem",
318
318
  tabIndex: 0,
319
319
  onClick: () => !d.submenu && (e == null ? void 0 : e(d)),
320
- onKeyDown: (f) => {
321
- !d.submenu && (f.key === "Enter" || f.key === " ") && (f.preventDefault(), e == null || e(d));
320
+ onKeyDown: (m) => {
321
+ !d.submenu && (m.key === "Enter" || m.key === " ") && (m.preventDefault(), e == null || e(d));
322
322
  },
323
323
  className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
324
324
  children: [
325
325
  /* @__PURE__ */ r("span", { children: d.label }),
326
326
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
327
327
  l(d),
328
- d.submenu && /* @__PURE__ */ r(ye, { size: 10 })
328
+ d.submenu && /* @__PURE__ */ r(we, { size: 10 })
329
329
  ] })
330
330
  ]
331
331
  }
@@ -335,22 +335,22 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
335
335
  {
336
336
  role: "menu",
337
337
  className: "absolute left-full top-0 hidden group-hover/sub:block z-[60] min-w-[180px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 ml-[-2px]",
338
- children: d.submenu.map((f) => /* @__PURE__ */ c(
338
+ children: d.submenu.map((m) => /* @__PURE__ */ c(
339
339
  "div",
340
340
  {
341
341
  role: "menuitem",
342
342
  tabIndex: 0,
343
- onClick: () => e == null ? void 0 : e(f),
344
- onKeyDown: (p) => {
345
- (p.key === "Enter" || p.key === " ") && (p.preventDefault(), e == null || e(f));
343
+ onClick: () => e == null ? void 0 : e(m),
344
+ onKeyDown: (f) => {
345
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), e == null || e(m));
346
346
  },
347
347
  className: "px-3 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer text-xs flex justify-between items-center focus:outline-none focus:bg-accent",
348
348
  children: [
349
- /* @__PURE__ */ r("span", { children: f.label }),
350
- l(f)
349
+ /* @__PURE__ */ r("span", { children: m.label }),
350
+ l(m)
351
351
  ]
352
352
  },
353
- f.id
353
+ m.id
354
354
  ))
355
355
  }
356
356
  )
@@ -364,19 +364,19 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
364
364
  "aria-label": "Application Header",
365
365
  className: S(
366
366
  "bg-muted border-b flex items-center justify-between px-4 select-none shrink-0 transition-all z-50 relative",
367
- n !== void 0 ? "h-12 bg-card/65 backdrop-blur-sm" : "h-8",
367
+ o !== void 0 ? "h-12 bg-card/65 backdrop-blur-sm" : "h-8",
368
368
  s
369
369
  ),
370
370
  children: [
371
371
  /* @__PURE__ */ c("div", { className: "flex items-center flex-1 min-w-0", children: [
372
- n !== void 0 ? /* @__PURE__ */ r("div", { className: "mr-12 flex items-center shrink-0", children: n }) : /* @__PURE__ */ r("div", { className: "font-semibold mr-6 text-sm shrink-0", children: "Nexus Shell" }),
372
+ o !== void 0 ? /* @__PURE__ */ r("div", { className: "mr-12 flex items-center shrink-0", children: o }) : /* @__PURE__ */ r("div", { className: "font-semibold mr-6 text-sm shrink-0", children: "Nexus Shell" }),
373
373
  /* @__PURE__ */ r(
374
374
  "nav",
375
375
  {
376
376
  role: "navigation",
377
377
  "aria-label": "Main Menu",
378
378
  className: "flex space-x-1 text-sm shrink-0",
379
- children: Object.entries(o).map(([i, d]) => /* @__PURE__ */ c("div", { className: "relative group", children: [
379
+ children: Object.entries(n).map(([i, d]) => /* @__PURE__ */ c("div", { className: "relative group", children: [
380
380
  /* @__PURE__ */ r(
381
381
  "div",
382
382
  {
@@ -398,13 +398,13 @@ const lt = () => `msg-${Date.now()}-${at += 1}`, Q = U((o) => ({
398
398
  }
399
399
  );
400
400
  };
401
- class ct {
401
+ class at {
402
402
  constructor() {
403
403
  H(this, "menus", /* @__PURE__ */ new Map());
404
404
  }
405
- registerMenu(e, n) {
405
+ registerMenu(e, o) {
406
406
  var t;
407
- this.menus.has(e) || this.menus.set(e, []), (t = this.menus.get(e)) == null || t.push(n);
407
+ this.menus.has(e) || this.menus.set(e, []), (t = this.menus.get(e)) == null || t.push(o);
408
408
  }
409
409
  setMenus(e) {
410
410
  this.menus = new Map(Object.entries(e));
@@ -414,13 +414,13 @@ class ct {
414
414
  }
415
415
  getAllMenus() {
416
416
  const e = {};
417
- return this.menus.forEach((n, t) => {
418
- e[t] = n;
417
+ return this.menus.forEach((o, t) => {
418
+ e[t] = o;
419
419
  }), e;
420
420
  }
421
421
  }
422
- const le = new ct();
423
- class ut {
422
+ const le = new at();
423
+ class lt {
424
424
  constructor() {
425
425
  H(this, "commands", /* @__PURE__ */ new Map());
426
426
  }
@@ -431,9 +431,9 @@ class ut {
431
431
  }
432
432
  this.commands.set(e.id, e);
433
433
  }
434
- executeCommand(e, ...n) {
434
+ executeCommand(e, ...o) {
435
435
  const t = this.commands.get(e);
436
- t ? t.execute(...n) : console.warn(`Command ${e} not found.`);
436
+ t ? t.execute(...o) : console.warn(`Command ${e} not found.`);
437
437
  }
438
438
  getCommand(e) {
439
439
  return this.commands.get(e);
@@ -442,43 +442,43 @@ class ut {
442
442
  return Array.from(this.commands.values());
443
443
  }
444
444
  }
445
- const B = new ut(), Ce = (o) => o.map((e) => {
446
- var n;
445
+ const J = new lt(), Se = (n) => n.map((e) => {
446
+ var o;
447
447
  return {
448
448
  ...e,
449
- keybinding: e.keybinding ?? (e.commandId ? (n = B.getCommand(e.commandId)) == null ? void 0 : n.keybinding : void 0),
450
- submenu: e.submenu ? Ce(e.submenu) : void 0
449
+ keybinding: e.keybinding ?? (e.commandId ? (o = J.getCommand(e.commandId)) == null ? void 0 : o.keybinding : void 0),
450
+ submenu: e.submenu ? Se(e.submenu) : void 0
451
451
  };
452
- }), Se = (o, e) => {
453
- for (const n of o) {
454
- if (n.id === e) return n;
455
- const t = n.submenu && Se(n.submenu, e);
452
+ }), Te = (n, e) => {
453
+ for (const o of n) {
454
+ if (o.id === e) return o;
455
+ const t = o.submenu && Te(o.submenu, e);
456
456
  if (t) return t;
457
457
  }
458
- }, mt = (o) => {
459
- const e = le.getAllMenus(), n = Object.fromEntries(
460
- Object.entries(e).map(([a, s]) => [a, Ce(s)])
458
+ }, it = (n) => {
459
+ const e = le.getAllMenus(), o = Object.fromEntries(
460
+ Object.entries(e).map(([a, s]) => [a, Se(s)])
461
461
  );
462
- return /* @__PURE__ */ r(dt, { ...o, menus: n, onSelect: (a) => {
462
+ return /* @__PURE__ */ r(st, { ...n, menus: o, onSelect: (a) => {
463
463
  for (const s of Object.values(e)) {
464
- const l = Se(s, a.id);
464
+ const l = Te(s, a.id);
465
465
  if (l != null && l.commandId) {
466
- B.executeCommand(l.commandId);
466
+ J.executeCommand(l.commandId);
467
467
  return;
468
468
  }
469
469
  }
470
470
  } });
471
- }, re = ({
472
- title: o,
471
+ }, ne = ({
472
+ title: n,
473
473
  children: e,
474
- onClose: n,
474
+ onClose: o,
475
475
  width: t = "300px",
476
476
  className: a
477
477
  }) => /* @__PURE__ */ c(
478
478
  "aside",
479
479
  {
480
480
  role: "tabpanel",
481
- "aria-label": `${o} Panel`,
481
+ "aria-label": `${n} Panel`,
482
482
  style: { width: t },
483
483
  className: S(
484
484
  "h-full bg-muted border-r flex flex-col select-none shrink-0",
@@ -486,29 +486,59 @@ const B = new ut(), Ce = (o) => o.map((e) => {
486
486
  ),
487
487
  children: [
488
488
  /* @__PURE__ */ c("div", { className: "h-10 flex items-center justify-between px-4 text-[11px] font-bold text-muted-foreground uppercase tracking-widest", children: [
489
- /* @__PURE__ */ r("span", { className: "truncate", children: o }),
490
- n && /* @__PURE__ */ r(
489
+ /* @__PURE__ */ r("span", { className: "truncate", children: n }),
490
+ o && /* @__PURE__ */ r(
491
491
  "button",
492
492
  {
493
493
  type: "button",
494
- onClick: n,
494
+ onClick: o,
495
495
  "aria-label": "Close Panel",
496
496
  className: "p-1 hover:bg-accent hover:text-foreground rounded transition-colors focus:outline-none focus:ring-2 focus:ring-ring shrink-0",
497
- children: /* @__PURE__ */ r(J, { size: 14 })
497
+ children: /* @__PURE__ */ r(B, { size: 14 })
498
498
  }
499
499
  )
500
500
  ] }),
501
501
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-auto border-t border-border/50 bg-background/50", children: e })
502
502
  ]
503
503
  }
504
- ), ft = [
505
- { id: "light", label: "Light", icon: Me },
506
- { id: "dark", label: "Dark", icon: Pe },
507
- { id: "gt", label: "Georgia Tech", icon: Ke }
508
- ], pt = ({
509
- theme: o,
504
+ ), X = [
505
+ {
506
+ id: "light",
507
+ label: "Light",
508
+ shortLabel: "Light",
509
+ description: "Neutral light theme. The default."
510
+ },
511
+ {
512
+ id: "dark",
513
+ label: "Dark",
514
+ shortLabel: "Dark",
515
+ description: "Low-glare dark theme on a soft grey base."
516
+ },
517
+ {
518
+ id: "gt",
519
+ label: "Georgia Tech",
520
+ shortLabel: "GT",
521
+ description: "Buzz Gold (#EAAA00) on Tech Tower White."
522
+ },
523
+ {
524
+ id: "tamu",
525
+ label: "Texas A&M",
526
+ shortLabel: "TAMU",
527
+ description: "Aggie Maroon (#500000) on white."
528
+ }
529
+ ], dt = X.map((n) => `theme-${n.id}`), ct = (n) => `theme-${n}`, ut = {
530
+ light: Re,
531
+ dark: $e,
532
+ gt: ue,
533
+ tamu: ue
534
+ }, mt = X.map((n) => ({
535
+ id: n.id,
536
+ label: n.label,
537
+ icon: ut[n.id] ?? Ke
538
+ })), ft = ({
539
+ theme: n,
510
540
  onThemeChange: e,
511
- themes: n = ft,
541
+ themes: o = mt,
512
542
  className: t
513
543
  }) => /* @__PURE__ */ r("div", { className: S("p-4 space-y-6", t), children: /* @__PURE__ */ c("section", { children: [
514
544
  /* @__PURE__ */ r("h3", { className: "text-[11px] font-bold text-muted-foreground uppercase mb-3", children: "Theme" }),
@@ -518,16 +548,16 @@ const B = new ut(), Ce = (o) => o.map((e) => {
518
548
  role: "radiogroup",
519
549
  "aria-label": "Theme",
520
550
  className: "grid grid-cols-1 gap-2",
521
- children: n.map(({ id: a, label: s, icon: l }) => /* @__PURE__ */ c(
551
+ children: o.map(({ id: a, label: s, icon: l }) => /* @__PURE__ */ c(
522
552
  "button",
523
553
  {
524
554
  type: "button",
525
555
  role: "radio",
526
- "aria-checked": o === a,
556
+ "aria-checked": n === a,
527
557
  onClick: () => e(a),
528
558
  className: S(
529
559
  "flex items-center space-x-3 px-3 py-2 rounded-md border text-sm transition-all focus:outline-none focus:ring-2 focus:ring-ring",
530
- o === a ? "bg-primary text-primary-foreground border-primary" : "bg-background hover:bg-accent border-border"
560
+ n === a ? "bg-primary text-primary-foreground border-primary" : "bg-background hover:bg-accent border-border"
531
561
  ),
532
562
  children: [
533
563
  /* @__PURE__ */ r(l, { size: 16 }),
@@ -538,43 +568,46 @@ const B = new ut(), Ce = (o) => o.map((e) => {
538
568
  ))
539
569
  }
540
570
  )
541
- ] }) }), ue = "nexus-shell-theme", me = (o) => {
542
- const e = window.document.documentElement;
543
- e.classList.remove("theme-light", "theme-dark", "theme-gt"), e.classList.add(`theme-${o}`);
544
- }, Y = U((o) => {
545
- const n = localStorage.getItem(ue) || "light";
546
- return me(n), {
547
- theme: n,
571
+ ] }) }), me = "nexus-shell-theme", fe = (n) => {
572
+ const e = window.document.documentElement, o = [
573
+ ...dt,
574
+ ...Array.from(e.classList).filter((t) => t.startsWith("theme-"))
575
+ ];
576
+ e.classList.remove(...o), e.classList.add(ct(n));
577
+ }, Y = F((n) => {
578
+ const o = localStorage.getItem(me) || "light";
579
+ return fe(o), {
580
+ theme: o,
548
581
  setTheme: (t) => {
549
- localStorage.setItem(ue, t), me(t), o({ theme: t });
582
+ localStorage.setItem(me, t), fe(t), n({ theme: t });
550
583
  }
551
584
  };
552
- }), gt = (o) => {
553
- const e = F((d) => d.activeSidebar), n = F((d) => d.panels), t = F((d) => d.setActiveSidebar), a = Y((d) => d.theme), s = Y((d) => d.setTheme);
585
+ }), pt = (n) => {
586
+ const e = U((d) => d.activeSidebar), o = U((d) => d.panels), t = U((d) => d.setActiveSidebar), a = Y((d) => d.theme), s = Y((d) => d.setTheme);
554
587
  if (!e) return null;
555
588
  const l = () => t(null);
556
589
  if (e === "settings")
557
- return /* @__PURE__ */ r(re, { ...o, title: "Settings", onClose: l, children: /* @__PURE__ */ r(
558
- pt,
590
+ return /* @__PURE__ */ r(ne, { ...n, title: "Settings", onClose: l, children: /* @__PURE__ */ r(
591
+ ft,
559
592
  {
560
593
  theme: a,
561
594
  onThemeChange: (d) => s(d)
562
595
  }
563
596
  ) });
564
- const u = n.find((d) => d.id === e);
597
+ const u = o.find((d) => d.id === e);
565
598
  if (!u)
566
- return /* @__PURE__ */ r(re, { ...o, title: e, onClose: l, children: /* @__PURE__ */ r("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
599
+ return /* @__PURE__ */ r(ne, { ...n, title: e, onClose: l, children: /* @__PURE__ */ r("div", { className: "p-4 text-sm italic text-muted-foreground", children: "Panel content not found." }) });
567
600
  const i = typeof u.component == "function" ? u.component : null;
568
- return /* @__PURE__ */ r(re, { ...o, title: u.label, onClose: l, children: i ? /* @__PURE__ */ r(i, {}) : u.component });
569
- }, ne = (o, e) => (e.priority ?? 0) - (o.priority ?? 0), ht = ({
570
- widgets: o = [],
601
+ return /* @__PURE__ */ r(ne, { ...n, title: u.label, onClose: l, children: i ? /* @__PURE__ */ r(i, {}) : u.component });
602
+ }, oe = (n, e) => (e.priority ?? 0) - (n.priority ?? 0), gt = ({
603
+ widgets: n = [],
571
604
  className: e,
572
- "aria-label": n = "Status Bar"
605
+ "aria-label": o = "Status Bar"
573
606
  }) => {
574
607
  const t = {
575
- left: o.filter((s) => s.alignment === "left").sort(ne),
576
- center: o.filter((s) => s.alignment === "center").sort(ne),
577
- right: o.filter((s) => s.alignment === "right").sort(ne)
608
+ left: n.filter((s) => s.alignment === "left").sort(oe),
609
+ center: n.filter((s) => s.alignment === "center").sort(oe),
610
+ right: n.filter((s) => s.alignment === "right").sort(oe)
578
611
  }, a = (s) => {
579
612
  const l = s.icon, u = !!s.onClick;
580
613
  return /* @__PURE__ */ c(
@@ -604,7 +637,7 @@ const B = new ut(), Ce = (o) => o.map((e) => {
604
637
  "footer",
605
638
  {
606
639
  role: "status",
607
- "aria-label": n,
640
+ "aria-label": o,
608
641
  className: S(
609
642
  "h-6 bg-primary text-primary-foreground text-[11px] flex items-center justify-between px-1 select-none shrink-0 border-t border-white/5",
610
643
  e
@@ -616,46 +649,46 @@ const B = new ut(), Ce = (o) => o.map((e) => {
616
649
  ]
617
650
  }
618
651
  );
619
- }, ie = U((o) => ({
652
+ }, ie = F((n) => ({
620
653
  widgets: [],
621
- setWidgets: (e) => o({ widgets: e }),
622
- addWidget: (e) => o((n) => ({
623
- widgets: [...n.widgets, e].sort(
654
+ setWidgets: (e) => n({ widgets: e }),
655
+ addWidget: (e) => n((o) => ({
656
+ widgets: [...o.widgets, e].sort(
624
657
  (t, a) => (a.priority || 0) - (t.priority || 0)
625
658
  )
626
659
  })),
627
- removeWidget: (e) => o((n) => ({
628
- widgets: n.widgets.filter((t) => t.id !== e)
660
+ removeWidget: (e) => n((o) => ({
661
+ widgets: o.widgets.filter((t) => t.id !== e)
629
662
  })),
630
- updateWidget: (e, n) => o((t) => ({
631
- widgets: t.widgets.map((a) => a.id === e ? { ...a, ...n } : a)
663
+ updateWidget: (e, o) => n((t) => ({
664
+ widgets: t.widgets.map((a) => a.id === e ? { ...a, ...o } : a)
632
665
  }))
633
- })), bt = (o) => {
634
- const e = ie((t) => t.widgets), n = R(
666
+ })), ht = (n) => {
667
+ const e = ie((t) => t.widgets), o = j(
635
668
  () => e.map(({ commandId: t, ...a }) => ({
636
669
  ...a,
637
- onClick: a.onClick ?? (t ? () => B.executeCommand(t) : void 0)
670
+ onClick: a.onClick ?? (t ? () => J.executeCommand(t) : void 0)
638
671
  })),
639
672
  [e]
640
673
  );
641
- return /* @__PURE__ */ r(ht, { ...o, widgets: n });
642
- }, xt = ({
643
- history: o = [],
674
+ return /* @__PURE__ */ r(gt, { ...n, widgets: o });
675
+ }, bt = ({
676
+ history: n = [],
644
677
  onCommand: e,
645
- onClose: n,
678
+ onClose: o,
646
679
  height: t = "250px",
647
680
  prompt: a = "$",
648
681
  title: s = "Terminal",
649
682
  className: l
650
683
  }) => {
651
- const [u, i] = A(""), d = P(null), f = P(null);
652
- z(() => {
684
+ const [u, i] = A(""), d = z(null), m = z(null);
685
+ O(() => {
653
686
  d.current && (d.current.scrollTop = d.current.scrollHeight);
654
- }, [o]);
655
- const p = (m) => {
656
- if (m.key !== "Enter") return;
657
- const k = u.trim();
658
- k && (e == null || e(k), i(""));
687
+ }, [n]);
688
+ const f = (p) => {
689
+ if (p.key !== "Enter") return;
690
+ const N = u.trim();
691
+ N && (e == null || e(N), i(""));
659
692
  };
660
693
  return /* @__PURE__ */ c(
661
694
  "div",
@@ -668,28 +701,28 @@ const B = new ut(), Ce = (o) => o.map((e) => {
668
701
  children: [
669
702
  /* @__PURE__ */ c("div", { className: "h-8 flex items-center justify-between px-3 border-b border-border/50 shrink-0", children: [
670
703
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2 text-muted-foreground", children: [
671
- /* @__PURE__ */ r(ve, { size: 13 }),
704
+ /* @__PURE__ */ r(ye, { size: 13 }),
672
705
  /* @__PURE__ */ r("span", { className: "text-[11px] font-bold uppercase tracking-widest", children: s })
673
706
  ] }),
674
- n && /* @__PURE__ */ c("div", { className: "flex items-center space-x-1", children: [
707
+ o && /* @__PURE__ */ c("div", { className: "flex items-center space-x-1", children: [
675
708
  /* @__PURE__ */ r(
676
709
  "button",
677
710
  {
678
711
  type: "button",
679
- onClick: n,
712
+ onClick: o,
680
713
  "aria-label": "Collapse Terminal",
681
714
  className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
682
- children: /* @__PURE__ */ r(we, { size: 14 })
715
+ children: /* @__PURE__ */ r(Ne, { size: 14 })
683
716
  }
684
717
  ),
685
718
  /* @__PURE__ */ r(
686
719
  "button",
687
720
  {
688
721
  type: "button",
689
- onClick: n,
722
+ onClick: o,
690
723
  "aria-label": "Close Terminal",
691
724
  className: "p-1 rounded hover:bg-accent hover:text-foreground text-muted-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
692
- children: /* @__PURE__ */ r(J, { size: 14 })
725
+ children: /* @__PURE__ */ r(B, { size: 14 })
693
726
  }
694
727
  )
695
728
  ] })
@@ -702,10 +735,10 @@ const B = new ut(), Ce = (o) => o.map((e) => {
702
735
  "aria-label": `${s} output`,
703
736
  className: "flex-1 overflow-y-auto px-3 py-2 space-y-0.5",
704
737
  onClick: () => {
705
- var m;
706
- return (m = f.current) == null ? void 0 : m.focus();
738
+ var p;
739
+ return (p = m.current) == null ? void 0 : p.focus();
707
740
  },
708
- children: o.map((m, k) => /* @__PURE__ */ r("div", { className: "whitespace-pre-wrap break-all text-foreground/90", children: m }, k))
741
+ children: n.map((p, N) => /* @__PURE__ */ r("div", { className: "whitespace-pre-wrap break-all text-foreground/90", children: p }, N))
709
742
  }
710
743
  ),
711
744
  /* @__PURE__ */ c("div", { className: "flex items-center px-3 py-2 border-t border-border/50 shrink-0", children: [
@@ -713,12 +746,12 @@ const B = new ut(), Ce = (o) => o.map((e) => {
713
746
  /* @__PURE__ */ r(
714
747
  "input",
715
748
  {
716
- ref: f,
749
+ ref: m,
717
750
  type: "text",
718
751
  "aria-label": `${s} input`,
719
752
  value: u,
720
- onChange: (m) => i(m.target.value),
721
- onKeyDown: p,
753
+ onChange: (p) => i(p.target.value),
754
+ onKeyDown: f,
722
755
  spellCheck: !1,
723
756
  autoComplete: "off",
724
757
  className: "flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground"
@@ -728,24 +761,24 @@ const B = new ut(), Ce = (o) => o.map((e) => {
728
761
  ]
729
762
  }
730
763
  );
731
- }, V = U((o) => ({
764
+ }, V = F((n) => ({
732
765
  isOpen: !1,
733
766
  history: ["Welcome to Nexus Shell Terminal v0.1.0", 'Type "help" for a list of commands.'],
734
- setOpen: (e) => o({ isOpen: e }),
735
- toggle: () => o((e) => ({ isOpen: !e.isOpen })),
736
- addHistory: (e) => o((n) => ({ history: [...n.history, e] })),
737
- clearHistory: () => o({ history: [] })
738
- })), vt = [
767
+ setOpen: (e) => n({ isOpen: e }),
768
+ toggle: () => n((e) => ({ isOpen: !e.isOpen })),
769
+ addHistory: (e) => n((o) => ({ history: [...o.history, e] })),
770
+ clearHistory: () => n({ history: [] })
771
+ })), xt = [
739
772
  "Available commands:",
740
773
  " help — show this message",
741
774
  " clear — clear the terminal"
742
- ], yt = ({
743
- onCommand: o,
775
+ ], vt = ({
776
+ onCommand: n,
744
777
  ...e
745
778
  }) => {
746
- const n = V((i) => i.isOpen), t = V((i) => i.history), a = V((i) => i.setOpen), s = V((i) => i.addHistory), l = V((i) => i.clearHistory);
747
- return n ? /* @__PURE__ */ r(
748
- xt,
779
+ const o = V((i) => i.isOpen), t = V((i) => i.history), a = V((i) => i.setOpen), s = V((i) => i.addHistory), l = V((i) => i.clearHistory);
780
+ return o ? /* @__PURE__ */ r(
781
+ bt,
749
782
  {
750
783
  ...e,
751
784
  history: t,
@@ -757,16 +790,16 @@ const B = new ut(), Ce = (o) => o.map((e) => {
757
790
  return;
758
791
  }
759
792
  if (d === "help") {
760
- vt.forEach(s);
793
+ xt.forEach(s);
761
794
  return;
762
795
  }
763
- (o == null ? void 0 : o(i)) !== !0 && s(`command not found: ${i.split(" ")[0]}`);
796
+ (n == null ? void 0 : n(i)) !== !0 && s(`command not found: ${i.split(" ")[0]}`);
764
797
  },
765
798
  onClose: () => a(!1)
766
799
  }
767
800
  ) : null;
768
801
  };
769
- class wt {
802
+ class yt {
770
803
  constructor() {
771
804
  H(this, "components", /* @__PURE__ */ new Map());
772
805
  }
@@ -774,8 +807,8 @@ class wt {
774
807
  * Register a component with a unique ID.
775
808
  * This ID is what you use in your FlexLayout models.
776
809
  */
777
- register(e, n) {
778
- this.components.has(e) && console.warn(`Component with ID "${e}" is already registered.`), this.components.set(e, n);
810
+ register(e, o) {
811
+ this.components.has(e) && console.warn(`Component with ID "${e}" is already registered.`), this.components.set(e, o);
779
812
  }
780
813
  /**
781
814
  * Retrieve a registered component by its ID.
@@ -790,7 +823,7 @@ class wt {
790
823
  return Array.from(this.components.keys());
791
824
  }
792
825
  }
793
- const Nt = new wt(), _ = {
826
+ const wt = new yt(), _ = {
794
827
  global: { tabEnableClose: !0, tabSetEnableMaximize: !1, tabSetEnableDivide: !0 },
795
828
  borders: [
796
829
  {
@@ -816,49 +849,49 @@ const Nt = new wt(), _ = {
816
849
  }
817
850
  ]
818
851
  }
819
- }, fe = "nexus-shell-layout", kt = U((o, e) => {
820
- let n;
852
+ }, pe = "nexus-shell-layout", Nt = F((n, e) => {
853
+ let o;
821
854
  if (typeof window < "u")
822
855
  try {
823
- const t = localStorage.getItem(fe);
856
+ const t = localStorage.getItem(pe);
824
857
  if (t) {
825
858
  const a = JSON.parse(t);
826
- n = $.fromJson(a);
859
+ o = R.fromJson(a);
827
860
  const s = /* @__PURE__ */ new Set(["dialogue-library", "argument-inspector"]), l = [];
828
- n.visitNodes((u) => {
861
+ o.visitNodes((u) => {
829
862
  if (u.getType() === "tab") {
830
863
  const i = u;
831
864
  s.has(i.getComponent()) && l.push(i.getId());
832
865
  }
833
866
  }), l.forEach((u) => {
834
- n.doAction(G.deleteTab(u));
867
+ o.doAction(G.deleteTab(u));
835
868
  });
836
869
  } else
837
- n = $.fromJson(_);
870
+ o = R.fromJson(_);
838
871
  } catch (t) {
839
- console.warn("Failed to load layout from storage, using default", t), n = $.fromJson(_);
872
+ console.warn("Failed to load layout from storage, using default", t), o = R.fromJson(_);
840
873
  }
841
874
  else
842
- n = $.fromJson(_);
875
+ o = R.fromJson(_);
843
876
  return {
844
- model: n,
877
+ model: o,
845
878
  dirtyTabs: /* @__PURE__ */ new Set(),
846
- storageKey: fe,
879
+ storageKey: pe,
847
880
  disableLocalStorage: !1,
848
881
  initLayout: (t, a) => {
849
882
  let s;
850
883
  if (t && Object.keys(t).length > 0)
851
884
  try {
852
- s = $.fromJson(t);
885
+ s = R.fromJson(t);
853
886
  } catch (l) {
854
- console.warn("Failed to parse init layout json, using default", l), s = $.fromJson(_);
887
+ console.warn("Failed to parse init layout json, using default", l), s = R.fromJson(_);
855
888
  }
856
889
  else
857
- s = $.fromJson(_);
858
- o({ model: s, disableLocalStorage: a || !1 });
890
+ s = R.fromJson(_);
891
+ n({ model: s, disableLocalStorage: a || !1 });
859
892
  },
860
893
  setModel: (t) => {
861
- o({ model: t });
894
+ n({ model: t });
862
895
  const a = e().storageKey;
863
896
  if (typeof window < "u" && !e().disableLocalStorage)
864
897
  try {
@@ -872,16 +905,16 @@ const Nt = new wt(), _ = {
872
905
  if (typeof window < "u")
873
906
  try {
874
907
  const l = localStorage.getItem(t);
875
- l ? s = $.fromJson(JSON.parse(l)) : s = $.fromJson(a || _);
908
+ l ? s = R.fromJson(JSON.parse(l)) : s = R.fromJson(a || _);
876
909
  } catch (l) {
877
- console.warn("Failed to load layout from storage for key", t, l), s = $.fromJson(a || _);
910
+ console.warn("Failed to load layout from storage for key", t, l), s = R.fromJson(a || _);
878
911
  }
879
912
  else
880
- s = $.fromJson(a || _);
881
- o({ storageKey: t, model: s });
913
+ s = R.fromJson(a || _);
914
+ n({ storageKey: t, model: s });
882
915
  },
883
916
  setTabDirty: (t, a) => {
884
- o((s) => {
917
+ n((s) => {
885
918
  const l = new Set(s.dirtyTabs);
886
919
  return a ? l.add(t) : l.delete(t), { dirtyTabs: l };
887
920
  });
@@ -892,84 +925,84 @@ const Nt = new wt(), _ = {
892
925
  let i = u == null ? void 0 : u.getId();
893
926
  if (!i)
894
927
  try {
895
- const p = l.getFirstTabSet();
896
- i = p == null ? void 0 : p.getId();
897
- } catch (p) {
898
- console.warn("Failed to get first tabset fallback", p);
928
+ const f = l.getFirstTabSet();
929
+ i = f == null ? void 0 : f.getId();
930
+ } catch (f) {
931
+ console.warn("Failed to get first tabset fallback", f);
899
932
  }
900
- const f = { ...{}, ...s };
933
+ const m = { ...{}, ...s };
901
934
  if (["nexus-dashboard", "nexus-docs"].includes(t)) {
902
- let p = null;
903
- if (l.visitNodes((m) => {
904
- if (m.getType() === "tab") {
905
- const k = m;
906
- k.getComponent() === t && (p = k.getId());
935
+ let f = null;
936
+ if (l.visitNodes((p) => {
937
+ if (p.getType() === "tab") {
938
+ const N = p;
939
+ N.getComponent() === t && (f = N.getId());
907
940
  }
908
- }), p) {
909
- l.doAction(G.selectTab(p));
941
+ }), f) {
942
+ l.doAction(G.selectTab(f));
910
943
  return;
911
944
  }
912
945
  }
913
- if (f.mapId) {
914
- let p = null;
915
- if (l.visitNodes((m) => {
916
- var k;
917
- if (m.getType() === "tab") {
918
- const C = m;
919
- ((k = C.getConfig()) == null ? void 0 : k.mapId) === f.mapId && (p = C.getId());
946
+ if (m.mapId) {
947
+ let f = null;
948
+ if (l.visitNodes((p) => {
949
+ var N;
950
+ if (p.getType() === "tab") {
951
+ const k = p;
952
+ ((N = k.getConfig()) == null ? void 0 : N.mapId) === m.mapId && (f = k.getId());
920
953
  }
921
- }), p) {
922
- l.doAction(G.selectTab(p));
954
+ }), f) {
955
+ l.doAction(G.selectTab(f));
923
956
  return;
924
957
  }
925
958
  }
926
- if (f.projectId) {
927
- let p = null;
928
- if (l.visitNodes((m) => {
929
- var k;
930
- if (m.getType() === "tab") {
931
- const C = m;
932
- ((k = C.getConfig()) == null ? void 0 : k.projectId) === f.projectId && (p = C.getId());
959
+ if (m.projectId) {
960
+ let f = null;
961
+ if (l.visitNodes((p) => {
962
+ var N;
963
+ if (p.getType() === "tab") {
964
+ const k = p;
965
+ ((N = k.getConfig()) == null ? void 0 : N.projectId) === m.projectId && (f = k.getId());
933
966
  }
934
- }), p) {
935
- l.doAction(G.selectTab(p));
967
+ }), f) {
968
+ l.doAction(G.selectTab(f));
936
969
  return;
937
970
  }
938
971
  }
939
972
  i && l.doAction(
940
973
  G.addNode(
941
- { type: "tab", component: t, name: a || t, config: f },
974
+ { type: "tab", component: t, name: a || t, config: m },
942
975
  i,
943
- Oe.CENTER,
976
+ Le.CENTER,
944
977
  -1
945
978
  )
946
979
  );
947
980
  }
948
981
  };
949
- }), Te = U((o, e) => ({
982
+ }), Ee = F((n, e) => ({
950
983
  isOpen: !1,
951
984
  type: "alert",
952
985
  title: "",
953
986
  message: "",
954
987
  defaultValue: "",
955
988
  resolve: null,
956
- openAlert: (n, t = "Alert") => new Promise((a) => {
957
- o({ isOpen: !0, type: "alert", title: t, message: n, defaultValue: "", resolve: a });
989
+ openAlert: (o, t = "Alert") => new Promise((a) => {
990
+ n({ isOpen: !0, type: "alert", title: t, message: o, defaultValue: "", resolve: a });
958
991
  }),
959
- openConfirm: (n, t = "Confirm") => new Promise((a) => {
960
- o({ isOpen: !0, type: "confirm", title: t, message: n, defaultValue: "", resolve: a });
992
+ openConfirm: (o, t = "Confirm") => new Promise((a) => {
993
+ n({ isOpen: !0, type: "confirm", title: t, message: o, defaultValue: "", resolve: a });
961
994
  }),
962
- openPrompt: (n, t = "", a = "Prompt") => new Promise((s) => {
963
- o({ isOpen: !0, type: "prompt", title: a, message: n, defaultValue: t, resolve: s });
995
+ openPrompt: (o, t = "", a = "Prompt") => new Promise((s) => {
996
+ n({ isOpen: !0, type: "prompt", title: a, message: o, defaultValue: t, resolve: s });
964
997
  }),
965
- close: (n = null) => {
998
+ close: (o = null) => {
966
999
  const { resolve: t } = e();
967
- t && t(n), o({ isOpen: !1, resolve: null });
1000
+ t && t(o), n({ isOpen: !1, resolve: null });
968
1001
  }
969
1002
  })), Gt = ({
970
- panels: o,
1003
+ panels: n,
971
1004
  slashCommands: e,
972
- menuConfig: n,
1005
+ menuConfig: o,
973
1006
  statusBarConfig: t,
974
1007
  title: a,
975
1008
  rightMenuBarContent: s,
@@ -977,41 +1010,41 @@ const Nt = new wt(), _ = {
977
1010
  layoutModel: u,
978
1011
  initialLayoutJson: i,
979
1012
  disableLocalStorage: d = !1,
980
- onLayoutChange: f
1013
+ onLayoutChange: m
981
1014
  }) => {
982
- const { model: p, setModel: m, initLayout: k, isTabDirty: C, setTabDirty: x } = kt(), h = Y((b) => b.theme), T = F((b) => b.setPanels), I = Q((b) => b.setSlashCommands), N = ie((b) => b.setWidgets);
983
- z(() => {
984
- o && T(o);
985
- }, [o, T]), z(() => {
986
- e && I(e);
987
- }, [e, I]), z(() => {
988
- n && le.setMenus(n);
989
- }, [n]), z(() => {
990
- t && N(t);
991
- }, [t, N]), z(() => {
992
- u || !i && !d || k(i, d);
1015
+ const { model: f, setModel: p, initLayout: N, isTabDirty: k, setTabDirty: w } = Nt(), h = Y((D) => D.theme), x = U((D) => D.setPanels), b = Q((D) => D.setSlashCommands), y = ie((D) => D.setWidgets);
1016
+ O(() => {
1017
+ n && x(n);
1018
+ }, [n, x]), O(() => {
1019
+ e && b(e);
1020
+ }, [e, b]), O(() => {
1021
+ o && le.setMenus(o);
1022
+ }, [o]), O(() => {
1023
+ t && y(t);
1024
+ }, [t, y]), O(() => {
1025
+ u || !i && !d || N(i, d);
993
1026
  }, []);
994
- const y = (b) => {
1027
+ const g = (D) => {
995
1028
  try {
996
- const E = b.getComponent(), w = b.getConfig() || {}, L = E ? Nt.get(E) : void 0;
997
- return L ? /* @__PURE__ */ r(L, { node: b, ...w }) : /* @__PURE__ */ c("div", { className: "p-4 text-sm", children: [
1029
+ const L = D.getComponent(), T = D.getConfig() || {}, P = L ? wt.get(L) : void 0;
1030
+ return P ? /* @__PURE__ */ r(P, { node: D, ...T }) : /* @__PURE__ */ c("div", { className: "p-4 text-sm", children: [
998
1031
  "Unknown Component: ",
999
- E
1032
+ L
1000
1033
  ] });
1001
- } catch (E) {
1002
- return console.error("Error in component factory:", E), /* @__PURE__ */ c("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
1034
+ } catch (L) {
1035
+ return console.error("Error in component factory:", L), /* @__PURE__ */ c("div", { className: "p-8 text-destructive bg-destructive/10 border border-destructive/20 h-full flex items-center justify-center", children: [
1003
1036
  "Error rendering component: ",
1004
- E instanceof Error ? E.message : "Unknown error"
1037
+ L instanceof Error ? L.message : "Unknown error"
1005
1038
  ] });
1006
1039
  }
1007
- }, g = (b) => {
1008
- if (b.type !== G.DELETE_TAB) return b;
1009
- const E = p.getNodeById(b.data.node);
1010
- if (!E || !C(E.getId())) return b;
1011
- Te.getState().openConfirm(
1012
- `Tab "${E.getName()}" has unsaved changes. Are you sure you want to close it?`
1013
- ).then((w) => {
1014
- w && (x(E.getId(), !1), p.doAction(b));
1040
+ }, C = (D) => {
1041
+ if (D.type !== G.DELETE_TAB) return D;
1042
+ const L = f.getNodeById(D.data.node);
1043
+ if (!L || !k(L.getId())) return D;
1044
+ Ee.getState().openConfirm(
1045
+ `Tab "${L.getName()}" has unsaved changes. Are you sure you want to close it?`
1046
+ ).then((T) => {
1047
+ T && (w(L.getId(), !1), f.doAction(D));
1015
1048
  });
1016
1049
  };
1017
1050
  return /* @__PURE__ */ c(
@@ -1020,7 +1053,7 @@ const Nt = new wt(), _ = {
1020
1053
  className: `flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden theme-${h}`,
1021
1054
  children: [
1022
1055
  /* @__PURE__ */ r(
1023
- mt,
1056
+ it,
1024
1057
  {
1025
1058
  title: a,
1026
1059
  center: l,
@@ -1028,36 +1061,38 @@ const Nt = new wt(), _ = {
1028
1061
  }
1029
1062
  ),
1030
1063
  /* @__PURE__ */ c("div", { className: "flex-1 flex overflow-hidden", children: [
1031
- /* @__PURE__ */ r(nt, {}),
1032
- /* @__PURE__ */ r(gt, {}),
1064
+ /* @__PURE__ */ r(Ze, {}),
1065
+ /* @__PURE__ */ r(pt, {}),
1033
1066
  /* @__PURE__ */ c("div", { className: "flex-1 flex flex-col min-w-0 bg-card", children: [
1034
1067
  /* @__PURE__ */ r("div", { className: "flex-1 relative h-full w-full", children: /* @__PURE__ */ r(
1035
- ze,
1068
+ Me,
1036
1069
  {
1037
- model: u || p,
1038
- factory: y,
1039
- onModelChange: (b) => {
1040
- u || m(b), f == null || f(b.toJson());
1070
+ model: u || f,
1071
+ factory: g,
1072
+ onModelChange: (D) => {
1073
+ u || p(D), m == null || m(D.toJson());
1041
1074
  },
1042
- onAction: g
1075
+ onAction: C
1043
1076
  }
1044
1077
  ) }),
1045
- /* @__PURE__ */ r(yt, {})
1078
+ /* @__PURE__ */ r(vt, {})
1046
1079
  ] }),
1047
- /* @__PURE__ */ r(it, {})
1080
+ /* @__PURE__ */ r(ot, {})
1048
1081
  ] }),
1049
- /* @__PURE__ */ r(bt, {})
1082
+ /* @__PURE__ */ r(ht, {})
1050
1083
  ]
1051
1084
  }
1052
1085
  );
1053
- }, Vt = [
1086
+ }, De = X.map((n) => ({
1087
+ id: `theme.${n.id}`,
1088
+ label: `Preferences: ${n.label} Theme`,
1089
+ execute: () => Y.getState().setTheme(n.id)
1090
+ })), Vt = [
1054
1091
  "view.toggleTerminal",
1055
1092
  "view.toggleChat",
1056
1093
  "view.toggleSidebar",
1057
- "theme.light",
1058
- "theme.dark",
1059
- "theme.gt"
1060
- ], oe = (o) => () => Y.getState().setTheme(o), Ct = [
1094
+ ...De.map((n) => n.id)
1095
+ ], kt = [
1061
1096
  {
1062
1097
  id: "view.toggleTerminal",
1063
1098
  label: "View: Toggle Terminal",
@@ -1075,14 +1110,12 @@ const Nt = new wt(), _ = {
1075
1110
  keybinding: "Control+b",
1076
1111
  execute: () => {
1077
1112
  var t;
1078
- const { activeSidebar: o, panels: e, setActiveSidebar: n } = F.getState();
1079
- n(o ? null : ((t = e[0]) == null ? void 0 : t.id) ?? null);
1113
+ const { activeSidebar: n, panels: e, setActiveSidebar: o } = U.getState();
1114
+ o(n ? null : ((t = e[0]) == null ? void 0 : t.id) ?? null);
1080
1115
  }
1081
1116
  },
1082
- { id: "theme.light", label: "Preferences: Light Theme", execute: oe("light") },
1083
- { id: "theme.dark", label: "Preferences: Dark Theme", execute: oe("dark") },
1084
- { id: "theme.gt", label: "Preferences: Georgia Tech Theme", execute: oe("gt") }
1085
- ], St = {
1117
+ ...De
1118
+ ], Ct = {
1086
1119
  View: [
1087
1120
  { id: "view.terminal", label: "Toggle Terminal", commandId: "view.toggleTerminal" },
1088
1121
  { id: "view.chat", label: "Toggle Chat", commandId: "view.toggleChat" },
@@ -1090,31 +1123,31 @@ const Nt = new wt(), _ = {
1090
1123
  {
1091
1124
  id: "view.theme",
1092
1125
  label: "Theme",
1093
- submenu: [
1094
- { id: "view.theme.light", label: "Light", commandId: "theme.light" },
1095
- { id: "view.theme.dark", label: "Dark", commandId: "theme.dark" },
1096
- { id: "view.theme.gt", label: "Georgia Tech", commandId: "theme.gt" }
1097
- ]
1126
+ submenu: X.map((n) => ({
1127
+ id: `view.theme.${n.id}`,
1128
+ label: n.label,
1129
+ commandId: `theme.${n.id}`
1130
+ }))
1098
1131
  }
1099
1132
  ]
1100
- }, Yt = (o = {}) => {
1133
+ }, Yt = (n = {}) => {
1101
1134
  const {
1102
1135
  panels: e,
1103
- menus: n,
1136
+ menus: o,
1104
1137
  commands: t,
1105
1138
  statusBar: a,
1106
1139
  slashCommands: s,
1107
1140
  defaultCommands: l = !0,
1108
1141
  defaultMenus: u = !0
1109
- } = o;
1110
- l && Ct.forEach((d) => B.registerCommand(d)), t == null || t.forEach((d) => B.registerCommand(d));
1142
+ } = n;
1143
+ l && kt.forEach((d) => J.registerCommand(d)), t == null || t.forEach((d) => J.registerCommand(d));
1111
1144
  const i = {
1112
- ...l && u ? St : {},
1113
- ...n ?? {}
1145
+ ...l && u ? Ct : {},
1146
+ ...o ?? {}
1114
1147
  };
1115
- Object.keys(i).length > 0 && le.setMenus(i), e && F.getState().setPanels(e), a && ie.getState().setWidgets(a), s && Q.getState().setSlashCommands(s);
1148
+ Object.keys(i).length > 0 && le.setMenus(i), e && U.getState().setPanels(e), a && ie.getState().setWidgets(a), s && Q.getState().setSlashCommands(s);
1116
1149
  };
1117
- class Tt {
1150
+ class St {
1118
1151
  constructor() {
1119
1152
  H(this, "plugins", /* @__PURE__ */ new Map());
1120
1153
  H(this, "loaders", /* @__PURE__ */ new Map());
@@ -1127,25 +1160,25 @@ class Tt {
1127
1160
  }
1128
1161
  this.plugins.set(e.id, e), this.statuses.set(e.id, "registered"), console.log(`Plugin ${e.name} (${e.id}) registered.`);
1129
1162
  }
1130
- registerLazyPlugin(e, n) {
1163
+ registerLazyPlugin(e, o) {
1131
1164
  if (this.loaders.has(e) || this.plugins.has(e)) {
1132
1165
  console.warn(`Plugin ${e} is already registered or has a loader.`);
1133
1166
  return;
1134
1167
  }
1135
- this.loaders.set(e, n), this.statuses.set(e, "inactive"), console.log(`Lazy plugin loader for ${e} registered.`);
1168
+ this.loaders.set(e, o), this.statuses.set(e, "inactive"), console.log(`Lazy plugin loader for ${e} registered.`);
1136
1169
  }
1137
1170
  async activatePlugin(e) {
1138
- let n = this.plugins.get(e);
1139
- if (!n && this.loaders.has(e))
1171
+ let o = this.plugins.get(e);
1172
+ if (!o && this.loaders.has(e))
1140
1173
  try {
1141
- n = await this.loaders.get(e)(), this.plugins.set(e, n), this.statuses.set(e, "registered"), console.log(`Lazy plugin ${e} loaded.`);
1174
+ o = await this.loaders.get(e)(), this.plugins.set(e, o), this.statuses.set(e, "registered"), console.log(`Lazy plugin ${e} loaded.`);
1142
1175
  } catch (t) {
1143
1176
  console.error(`Failed to load lazy plugin ${e}`, t), this.statuses.set(e, "failed");
1144
1177
  return;
1145
1178
  }
1146
- if (n)
1179
+ if (o)
1147
1180
  try {
1148
- this.statuses.set(e, "activating"), n.activate(), this.statuses.set(e, "active"), console.log(`Plugin ${n.name} activated.`);
1181
+ this.statuses.set(e, "activating"), o.activate(), this.statuses.set(e, "active"), console.log(`Plugin ${o.name} activated.`);
1149
1182
  } catch (t) {
1150
1183
  console.error(`Failed to activate plugin ${e}`, t), this.statuses.set(e, "failed");
1151
1184
  }
@@ -1153,10 +1186,10 @@ class Tt {
1153
1186
  console.warn(`Plugin ${e} not found for activation.`), this.statuses.set(e, "failed");
1154
1187
  }
1155
1188
  async deactivatePlugin(e) {
1156
- const n = this.plugins.get(e);
1157
- if (n)
1189
+ const o = this.plugins.get(e);
1190
+ if (o)
1158
1191
  try {
1159
- n.deactivate(), this.statuses.set(e, "deactivated"), console.log(`Plugin ${n.name} deactivated.`);
1192
+ o.deactivate(), this.statuses.set(e, "deactivated"), console.log(`Plugin ${o.name} deactivated.`);
1160
1193
  } catch (t) {
1161
1194
  console.error(`Failed to deactivate plugin ${e}`, t), this.statuses.set(e, "failed");
1162
1195
  }
@@ -1166,8 +1199,8 @@ class Tt {
1166
1199
  }
1167
1200
  getPluginStatuses() {
1168
1201
  const e = {};
1169
- return this.statuses.forEach((n, t) => {
1170
- e[t] = n;
1202
+ return this.statuses.forEach((o, t) => {
1203
+ e[t] = o;
1171
1204
  }), e;
1172
1205
  }
1173
1206
  getPlugin(e) {
@@ -1177,26 +1210,26 @@ class Tt {
1177
1210
  return Array.from(this.plugins.values());
1178
1211
  }
1179
1212
  }
1180
- const qt = new Tt(), pe = "nexus-shell-user-profile", ge = {
1213
+ const qt = new St(), ge = "nexus-shell-user-profile", he = {
1181
1214
  name: "David Tech",
1182
1215
  role: "Shell Architect",
1183
1216
  email: "david@techmuch.io",
1184
1217
  avatarUrl: "",
1185
1218
  customAvatar: ""
1186
- }, W = U((o) => {
1187
- let e = { ...ge };
1219
+ }, W = F((n) => {
1220
+ let e = { ...he };
1188
1221
  if (typeof window < "u")
1189
1222
  try {
1190
- const t = localStorage.getItem(pe);
1191
- t && (e = { ...ge, ...JSON.parse(t) });
1223
+ const t = localStorage.getItem(ge);
1224
+ t && (e = { ...he, ...JSON.parse(t) });
1192
1225
  } catch (t) {
1193
1226
  console.error("Failed to parse saved user profile:", t);
1194
1227
  }
1195
- const n = (t) => {
1228
+ const o = (t) => {
1196
1229
  if (typeof window < "u")
1197
1230
  try {
1198
1231
  localStorage.setItem(
1199
- pe,
1232
+ ge,
1200
1233
  JSON.stringify({
1201
1234
  name: t.name,
1202
1235
  role: t.role,
@@ -1211,64 +1244,64 @@ const qt = new Tt(), pe = "nexus-shell-user-profile", ge = {
1211
1244
  };
1212
1245
  return {
1213
1246
  ...e,
1214
- updateProfile: (t) => o((a) => {
1247
+ updateProfile: (t) => n((a) => {
1215
1248
  const s = { ...a, ...t };
1216
- return n(s), t;
1249
+ return o(s), t;
1217
1250
  }),
1218
- setCustomAvatar: (t) => o((a) => {
1251
+ setCustomAvatar: (t) => n((a) => {
1219
1252
  const s = { ...a, customAvatar: t };
1220
- return n(s), { customAvatar: t };
1253
+ return o(s), { customAvatar: t };
1221
1254
  }),
1222
- clearCustomAvatar: () => o((t) => {
1255
+ clearCustomAvatar: () => n((t) => {
1223
1256
  const a = { ...t, customAvatar: "" };
1224
- return n(a), { customAvatar: "" };
1257
+ return o(a), { customAvatar: "" };
1225
1258
  })
1226
1259
  };
1227
1260
  }), Qt = () => {
1228
- z(() => {
1229
- const o = (e) => {
1230
- const n = B.getCommands();
1231
- for (const t of n)
1232
- if (t.keybinding && Dt(e, t.keybinding)) {
1261
+ O(() => {
1262
+ const n = (e) => {
1263
+ const o = J.getCommands();
1264
+ for (const t of o)
1265
+ if (t.keybinding && Tt(e, t.keybinding)) {
1233
1266
  e.preventDefault(), t.execute();
1234
1267
  break;
1235
1268
  }
1236
1269
  };
1237
- return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
1270
+ return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
1238
1271
  }, []);
1239
1272
  };
1240
- function Dt(o, e) {
1241
- var m;
1242
- const n = e.split("+"), t = (m = n.pop()) == null ? void 0 : m.toLowerCase(), a = n.includes("Control") || n.includes("Ctrl"), s = n.includes("Shift"), l = n.includes("Alt"), u = n.includes("Meta") || n.includes("Cmd"), i = o.ctrlKey, d = o.shiftKey, f = o.altKey, p = o.metaKey;
1243
- return o.key.toLowerCase() === t && i === a && d === s && f === l && p === u;
1273
+ function Tt(n, e) {
1274
+ var p;
1275
+ const o = e.split("+"), t = (p = o.pop()) == null ? void 0 : p.toLowerCase(), a = o.includes("Control") || o.includes("Ctrl"), s = o.includes("Shift"), l = o.includes("Alt"), u = o.includes("Meta") || o.includes("Cmd"), i = n.ctrlKey, d = n.shiftKey, m = n.altKey, f = n.metaKey;
1276
+ return n.key.toLowerCase() === t && i === a && d === s && m === l && f === u;
1244
1277
  }
1245
- const Et = (o, e) => {
1246
- const n = e.toLowerCase();
1247
- return o.label.toLowerCase().includes(n) || o.id.toLowerCase().includes(n);
1248
- }, It = ({
1249
- open: o,
1278
+ const Et = (n, e) => {
1279
+ const o = e.toLowerCase();
1280
+ return n.label.toLowerCase().includes(o) || n.id.toLowerCase().includes(o);
1281
+ }, Dt = ({
1282
+ open: n,
1250
1283
  commands: e,
1251
- onSelect: n,
1284
+ onSelect: o,
1252
1285
  onClose: t,
1253
1286
  inline: a = !1,
1254
1287
  placeholder: s = "Type a command to run…",
1255
1288
  filter: l = Et,
1256
1289
  className: u
1257
1290
  }) => {
1258
- const [i, d] = A(""), [f, p] = A(0), m = P(null), k = R(
1259
- () => e.filter((x) => l(x, i)),
1291
+ const [i, d] = A(""), [m, f] = A(0), p = z(null), N = j(
1292
+ () => e.filter((w) => l(w, i)),
1260
1293
  [e, i, l]
1261
1294
  );
1262
- if (z(() => {
1263
- var x;
1264
- o && (d(""), p(0), (x = m.current) == null || x.focus());
1265
- }, [o]), z(() => {
1266
- p(0);
1267
- }, [i]), !o) return null;
1268
- const C = (x) => {
1269
- x.key === "ArrowDown" ? (x.preventDefault(), p((h) => k.length ? (h + 1) % k.length : 0)) : x.key === "ArrowUp" ? (x.preventDefault(), p(
1270
- (h) => k.length ? (h - 1 + k.length) % k.length : 0
1271
- )) : x.key === "Enter" ? (x.preventDefault(), k[f] && n(k[f])) : x.key === "Escape" && (x.preventDefault(), t == null || t());
1295
+ if (O(() => {
1296
+ var w;
1297
+ n && (d(""), f(0), (w = p.current) == null || w.focus());
1298
+ }, [n]), O(() => {
1299
+ f(0);
1300
+ }, [i]), !n) return null;
1301
+ const k = (w) => {
1302
+ w.key === "ArrowDown" ? (w.preventDefault(), f((h) => N.length ? (h + 1) % N.length : 0)) : w.key === "ArrowUp" ? (w.preventDefault(), f(
1303
+ (h) => N.length ? (h - 1 + N.length) % N.length : 0
1304
+ )) : w.key === "Enter" ? (w.preventDefault(), N[m] && o(N[m])) : w.key === "Escape" && (w.preventDefault(), t == null || t());
1272
1305
  };
1273
1306
  return /* @__PURE__ */ r(
1274
1307
  "div",
@@ -1284,18 +1317,18 @@ const Et = (o, e) => {
1284
1317
  role: "dialog",
1285
1318
  "aria-modal": !a,
1286
1319
  "aria-label": "Command Palette",
1287
- onClick: (x) => x.stopPropagation(),
1320
+ onClick: (w) => w.stopPropagation(),
1288
1321
  className: S(
1289
1322
  "w-full max-w-xl bg-popover text-popover-foreground border shadow-2xl rounded-xl overflow-hidden animate-in fade-in zoom-in duration-200",
1290
1323
  u
1291
1324
  ),
1292
1325
  children: [
1293
1326
  /* @__PURE__ */ c("div", { className: "flex items-center px-4 border-b", children: [
1294
- /* @__PURE__ */ r(X, { size: 18, className: "text-muted-foreground mr-3" }),
1327
+ /* @__PURE__ */ r(Z, { size: 18, className: "text-muted-foreground mr-3" }),
1295
1328
  /* @__PURE__ */ r(
1296
1329
  "input",
1297
1330
  {
1298
- ref: m,
1331
+ ref: p,
1299
1332
  type: "text",
1300
1333
  role: "combobox",
1301
1334
  "aria-expanded": !0,
@@ -1303,8 +1336,8 @@ const Et = (o, e) => {
1303
1336
  "aria-label": "Command",
1304
1337
  placeholder: s,
1305
1338
  value: i,
1306
- onChange: (x) => d(x.target.value),
1307
- onKeyDown: C,
1339
+ onChange: (w) => d(w.target.value),
1340
+ onKeyDown: k,
1308
1341
  className: "flex-1 h-14 bg-transparent outline-none text-base text-foreground placeholder:text-muted-foreground"
1309
1342
  }
1310
1343
  )
@@ -1315,23 +1348,23 @@ const Et = (o, e) => {
1315
1348
  id: "command-palette-list",
1316
1349
  role: "listbox",
1317
1350
  className: "max-h-[300px] overflow-y-auto py-2",
1318
- children: k.length === 0 ? /* @__PURE__ */ r("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: i ? `No commands found matching "${i}"` : "No commands available." }) : k.map((x, h) => /* @__PURE__ */ c(
1351
+ children: N.length === 0 ? /* @__PURE__ */ r("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: i ? `No commands found matching "${i}"` : "No commands available." }) : N.map((w, h) => /* @__PURE__ */ c(
1319
1352
  "div",
1320
1353
  {
1321
1354
  role: "option",
1322
- "aria-selected": h === f,
1323
- onClick: () => n(x),
1324
- onMouseEnter: () => p(h),
1355
+ "aria-selected": h === m,
1356
+ onClick: () => o(w),
1357
+ onMouseEnter: () => f(h),
1325
1358
  className: S(
1326
1359
  "px-4 py-2 cursor-pointer flex justify-between items-center text-sm",
1327
- h === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1360
+ h === m ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
1328
1361
  ),
1329
1362
  children: [
1330
- /* @__PURE__ */ r("span", { children: x.label }),
1331
- x.keybinding && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: x.keybinding })
1363
+ /* @__PURE__ */ r("span", { children: w.label }),
1364
+ w.keybinding && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border/50", children: w.keybinding })
1332
1365
  ]
1333
1366
  },
1334
- x.id
1367
+ w.id
1335
1368
  ))
1336
1369
  }
1337
1370
  ),
@@ -1357,40 +1390,40 @@ const Et = (o, e) => {
1357
1390
  }
1358
1391
  );
1359
1392
  }, Xt = ({
1360
- shortcutKey: o = "p",
1393
+ shortcutKey: n = "p",
1361
1394
  ...e
1362
1395
  }) => {
1363
- const [n, t] = A(!1);
1364
- return z(() => {
1365
- if (o === null) return;
1396
+ const [o, t] = A(!1);
1397
+ return O(() => {
1398
+ if (n === null) return;
1366
1399
  const a = (s) => {
1367
- (s.metaKey || s.ctrlKey) && s.shiftKey && s.key.toLowerCase() === o && (s.preventDefault(), t((l) => !l));
1400
+ (s.metaKey || s.ctrlKey) && s.shiftKey && s.key.toLowerCase() === n && (s.preventDefault(), t((l) => !l));
1368
1401
  };
1369
1402
  return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
1370
- }, [o]), /* @__PURE__ */ r(
1371
- It,
1403
+ }, [n]), /* @__PURE__ */ r(
1404
+ Dt,
1372
1405
  {
1373
1406
  ...e,
1374
- open: n,
1375
- commands: B.getCommands(),
1407
+ open: o,
1408
+ commands: J.getCommands(),
1376
1409
  onSelect: (a) => {
1377
1410
  a.execute(), t(!1);
1378
1411
  },
1379
1412
  onClose: () => t(!1)
1380
1413
  }
1381
1414
  );
1415
+ }, It = {
1416
+ alert: Fe,
1417
+ confirm: Ue,
1418
+ prompt: je
1382
1419
  }, Ot = {
1383
- alert: Re,
1384
- confirm: je,
1385
- prompt: $e
1386
- }, zt = {
1387
1420
  alert: "text-destructive",
1388
1421
  confirm: "text-amber-500",
1389
1422
  prompt: "text-blue-500"
1390
1423
  }, At = ({
1391
- open: o,
1424
+ open: n,
1392
1425
  type: e = "alert",
1393
- title: n,
1426
+ title: o,
1394
1427
  message: t,
1395
1428
  defaultValue: a = "",
1396
1429
  onConfirm: s,
@@ -1398,26 +1431,26 @@ const Et = (o, e) => {
1398
1431
  confirmLabel: u,
1399
1432
  cancelLabel: i = "Cancel",
1400
1433
  placeholder: d = "Enter value…",
1401
- className: f
1434
+ className: m
1402
1435
  }) => {
1403
- const [p, m] = A(a), k = P(null);
1404
- if (z(() => {
1405
- if (!o || (m(a), e !== "prompt")) return;
1406
- const T = window.setTimeout(() => {
1407
- var I, N;
1408
- (I = k.current) == null || I.focus(), (N = k.current) == null || N.select();
1436
+ const [f, p] = A(a), N = z(null);
1437
+ if (O(() => {
1438
+ if (!n || (p(a), e !== "prompt")) return;
1439
+ const x = window.setTimeout(() => {
1440
+ var b, y;
1441
+ (b = N.current) == null || b.focus(), (y = N.current) == null || y.select();
1409
1442
  }, 50);
1410
- return () => window.clearTimeout(T);
1411
- }, [o, e, a]), z(() => {
1412
- if (!o) return;
1413
- const T = (I) => {
1414
- I.key === "Escape" && (I.preventDefault(), l == null || l());
1443
+ return () => window.clearTimeout(x);
1444
+ }, [n, e, a]), O(() => {
1445
+ if (!n) return;
1446
+ const x = (b) => {
1447
+ b.key === "Escape" && (b.preventDefault(), l == null || l());
1415
1448
  };
1416
- return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
1417
- }, [o, l]), !o) return null;
1418
- const C = () => s == null ? void 0 : s(e === "prompt" ? p : void 0), x = (T) => {
1419
- T.key === "Enter" && (T.preventDefault(), C());
1420
- }, h = Ot[e];
1449
+ return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
1450
+ }, [n, l]), !n) return null;
1451
+ const k = () => s == null ? void 0 : s(e === "prompt" ? f : void 0), w = (x) => {
1452
+ x.key === "Enter" && (x.preventDefault(), k());
1453
+ }, h = It[e];
1421
1454
  return /* @__PURE__ */ r(
1422
1455
  "div",
1423
1456
  {
@@ -1428,12 +1461,12 @@ const Et = (o, e) => {
1428
1461
  {
1429
1462
  role: "dialog",
1430
1463
  "aria-modal": "true",
1431
- "aria-label": n,
1432
- onClick: (T) => T.stopPropagation(),
1433
- onKeyDown: x,
1464
+ "aria-label": o,
1465
+ onClick: (x) => x.stopPropagation(),
1466
+ onKeyDown: w,
1434
1467
  className: S(
1435
1468
  "relative flex flex-col w-full max-w-md p-6 bg-card border border-border shadow-2xl rounded-2xl animate-in fade-in zoom-in-95 ring-1 ring-white/10",
1436
- f
1469
+ m
1437
1470
  ),
1438
1471
  children: [
1439
1472
  /* @__PURE__ */ r(
@@ -1443,25 +1476,25 @@ const Et = (o, e) => {
1443
1476
  onClick: l,
1444
1477
  "aria-label": "Close",
1445
1478
  className: "absolute top-4 right-4 p-1 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
1446
- children: /* @__PURE__ */ r(J, { size: 18 })
1479
+ children: /* @__PURE__ */ r(B, { size: 18 })
1447
1480
  }
1448
1481
  ),
1449
1482
  /* @__PURE__ */ c("div", { className: "flex items-start space-x-4 mb-4", children: [
1450
- /* @__PURE__ */ r("div", { className: S("p-2 bg-muted rounded-full shrink-0", zt[e]), children: /* @__PURE__ */ r(h, { size: 24 }) }),
1483
+ /* @__PURE__ */ r("div", { className: S("p-2 bg-muted rounded-full shrink-0", Ot[e]), children: /* @__PURE__ */ r(h, { size: 24 }) }),
1451
1484
  /* @__PURE__ */ c("div", { className: "flex-1 mt-1", children: [
1452
- /* @__PURE__ */ r("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: n }),
1485
+ /* @__PURE__ */ r("h2", { className: "text-lg font-semibold tracking-tight pr-6", children: o }),
1453
1486
  t && /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground mt-1 whitespace-pre-wrap", children: t })
1454
1487
  ] })
1455
1488
  ] }),
1456
1489
  e === "prompt" && /* @__PURE__ */ r("div", { className: "mt-2 mb-4", children: /* @__PURE__ */ r(
1457
1490
  "input",
1458
1491
  {
1459
- ref: k,
1492
+ ref: N,
1460
1493
  type: "text",
1461
- "aria-label": n,
1462
- value: p,
1494
+ "aria-label": o,
1495
+ value: f,
1463
1496
  placeholder: d,
1464
- onChange: (T) => m(T.target.value),
1497
+ onChange: (x) => p(x.target.value),
1465
1498
  className: "w-full bg-background border border-border rounded-lg px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary/50 transition-all placeholder:text-muted-foreground/50"
1466
1499
  }
1467
1500
  ) }),
@@ -1479,7 +1512,7 @@ const Et = (o, e) => {
1479
1512
  "button",
1480
1513
  {
1481
1514
  type: "button",
1482
- onClick: C,
1515
+ onClick: k,
1483
1516
  autoFocus: e !== "prompt",
1484
1517
  className: "px-4 py-2 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
1485
1518
  children: u ?? (e === "alert" ? "OK" : "Confirm")
@@ -1491,33 +1524,32 @@ const Et = (o, e) => {
1491
1524
  )
1492
1525
  }
1493
1526
  );
1494
- }, Zt = (o) => {
1495
- const { isOpen: e, type: n, title: t, message: a, defaultValue: s, close: l } = Te();
1527
+ }, Zt = (n) => {
1528
+ const { isOpen: e, type: o, title: t, message: a, defaultValue: s, close: l } = Ee();
1496
1529
  return /* @__PURE__ */ r(
1497
1530
  At,
1498
1531
  {
1499
- ...o,
1532
+ ...n,
1500
1533
  open: e,
1501
- type: n,
1534
+ type: o,
1502
1535
  title: t,
1503
1536
  message: a,
1504
1537
  defaultValue: s,
1505
1538
  onConfirm: (d) => {
1506
- n === "prompt" ? l(d ?? "") : n === "confirm" ? l(!0) : l();
1539
+ o === "prompt" ? l(d ?? "") : o === "confirm" ? l(!0) : l();
1507
1540
  },
1508
1541
  onCancel: () => {
1509
- n === "prompt" ? l(null) : n === "confirm" ? l(!1) : l();
1542
+ o === "prompt" ? l(null) : o === "confirm" ? l(!1) : l();
1510
1543
  }
1511
1544
  }
1512
1545
  );
1513
- }, Lt = [
1514
- { id: "light", label: "Light" },
1515
- { id: "dark", label: "Dark" },
1516
- { id: "gt", label: "GT" }
1517
- ], Mt = ({
1518
- value: o,
1546
+ }, Lt = X.map((n) => ({
1547
+ id: n.id,
1548
+ label: n.shortLabel
1549
+ })), Mt = ({
1550
+ value: n,
1519
1551
  onChange: e,
1520
- options: n = Lt,
1552
+ options: o = Lt,
1521
1553
  className: t,
1522
1554
  "aria-label": a = "Theme"
1523
1555
  }) => /* @__PURE__ */ r(
@@ -1529,63 +1561,63 @@ const Et = (o, e) => {
1529
1561
  "flex items-center border border-border rounded-lg p-0.5 bg-secondary/80 select-none",
1530
1562
  t
1531
1563
  ),
1532
- children: n.map((s) => /* @__PURE__ */ r(
1564
+ children: o.map((s) => /* @__PURE__ */ r(
1533
1565
  "button",
1534
1566
  {
1535
1567
  role: "radio",
1536
- "aria-checked": o === s.id,
1568
+ "aria-checked": n === s.id,
1537
1569
  onClick: () => e(s.id),
1538
1570
  className: S(
1539
1571
  "px-2.5 py-1 text-[9px] font-extrabold uppercase rounded-md transition-all font-mono cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-ring",
1540
- o === s.id ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-accent hover:text-foreground"
1572
+ n === s.id ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-accent hover:text-foreground"
1541
1573
  ),
1542
1574
  children: s.label
1543
1575
  },
1544
1576
  s.id
1545
1577
  ))
1546
1578
  }
1547
- ), er = (o) => {
1548
- const e = Y((t) => t.theme), n = Y((t) => t.setTheme);
1549
- return /* @__PURE__ */ r(Mt, { ...o, value: e, onChange: n });
1550
- }, Pt = ({
1551
- profile: o,
1579
+ ), er = (n) => {
1580
+ const e = Y((t) => t.theme), o = Y((t) => t.setTheme);
1581
+ return /* @__PURE__ */ r(Mt, { ...n, value: e, onChange: o });
1582
+ }, zt = ({
1583
+ profile: n,
1552
1584
  actions: e = [],
1553
- onProfileChange: n,
1585
+ onProfileChange: o,
1554
1586
  onAvatarChange: t,
1555
1587
  onClick: a,
1556
1588
  showName: s = !0,
1557
1589
  className: l
1558
1590
  }) => {
1559
- const { name: u, role: i, email: d, avatarUrl: f } = o, [p, m] = A(!1), [k, C] = A(!1), [x, h] = A(u), [T, I] = A(i ?? ""), N = P(null), y = P(null);
1560
- z(() => {
1561
- p && (h(u), I(i ?? ""), C(!1));
1562
- }, [p, u, i]), z(() => {
1563
- if (!p) return;
1564
- const w = (L) => {
1565
- N.current && !N.current.contains(L.target) && m(!1);
1591
+ const { name: u, role: i, email: d, avatarUrl: m } = n, [f, p] = A(!1), [N, k] = A(!1), [w, h] = A(u), [x, b] = A(i ?? ""), y = z(null), g = z(null);
1592
+ O(() => {
1593
+ f && (h(u), b(i ?? ""), k(!1));
1594
+ }, [f, u, i]), O(() => {
1595
+ if (!f) return;
1596
+ const T = (P) => {
1597
+ y.current && !y.current.contains(P.target) && p(!1);
1566
1598
  };
1567
- return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
1568
- }, [p]);
1569
- const g = (w) => {
1570
- w.preventDefault(), n == null || n({ name: x, role: T }), C(!1);
1571
- }, b = (w) => {
1599
+ return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
1600
+ }, [f]);
1601
+ const C = (T) => {
1602
+ T.preventDefault(), o == null || o({ name: w, role: x }), k(!1);
1603
+ }, D = (T) => {
1572
1604
  var v;
1573
- const L = (v = w.target.files) == null ? void 0 : v[0];
1574
- L && (t == null || t(L)), w.target.value = "";
1575
- }, E = (w) => f ? /* @__PURE__ */ r("img", { src: f, alt: u, className: "w-full h-full object-cover" }) : /* @__PURE__ */ r(xe, { size: w, className: "text-muted-foreground" });
1576
- return /* @__PURE__ */ c("div", { ref: N, className: "relative inline-block text-left", children: [
1605
+ const P = (v = T.target.files) == null ? void 0 : v[0];
1606
+ P && (t == null || t(P)), T.target.value = "";
1607
+ }, L = (T) => m ? /* @__PURE__ */ r("img", { src: m, alt: u, className: "w-full h-full object-cover" }) : /* @__PURE__ */ r(ve, { size: T, className: "text-muted-foreground" });
1608
+ return /* @__PURE__ */ c("div", { ref: y, className: "relative inline-block text-left", children: [
1577
1609
  /* @__PURE__ */ c(
1578
1610
  "button",
1579
1611
  {
1580
1612
  type: "button",
1581
- onClick: () => a ? a() : m((w) => !w),
1613
+ onClick: () => a ? a() : p((T) => !T),
1582
1614
  "aria-haspopup": a ? void 0 : "menu",
1583
- "aria-expanded": a ? void 0 : p,
1615
+ "aria-expanded": a ? void 0 : f,
1584
1616
  "aria-label": "User Profile Menu",
1585
1617
  className: S(
1586
1618
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none transition-all duration-200 select-none",
1587
1619
  s ? "flex items-center space-x-2 px-2 py-1 rounded-md hover:bg-accent/50 hover:text-accent-foreground text-left cursor-pointer border border-transparent hover:border-border/30" : "w-7 h-7 rounded-full bg-secondary/80 border border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-secondary cursor-pointer",
1588
- p && (s ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
1620
+ f && (s ? "bg-accent/60 border-border/40" : "border-primary/50 text-foreground ring-1 ring-primary/20"),
1589
1621
  l
1590
1622
  ),
1591
1623
  children: [
@@ -1596,7 +1628,7 @@ const Et = (o, e) => {
1596
1628
  "rounded-full overflow-hidden border border-border/50 bg-muted flex items-center justify-center shrink-0 shadow-sm",
1597
1629
  s ? "w-6 h-6" : "w-full h-full"
1598
1630
  ),
1599
- children: E(s ? 13 : 12)
1631
+ children: L(s ? 13 : 12)
1600
1632
  }
1601
1633
  ),
1602
1634
  s && /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 leading-tight pr-1", children: [
@@ -1610,14 +1642,14 @@ const Et = (o, e) => {
1610
1642
  "input",
1611
1643
  {
1612
1644
  type: "file",
1613
- ref: y,
1614
- onChange: b,
1645
+ ref: g,
1646
+ onChange: D,
1615
1647
  accept: "image/*",
1616
1648
  "aria-label": "Upload avatar",
1617
1649
  className: "hidden"
1618
1650
  }
1619
1651
  ),
1620
- p && /* @__PURE__ */ r(
1652
+ f && /* @__PURE__ */ r(
1621
1653
  "div",
1622
1654
  {
1623
1655
  role: "menu",
@@ -1625,7 +1657,7 @@ const Et = (o, e) => {
1625
1657
  "absolute z-50 w-64 rounded-lg border border-border/50 bg-card text-card-foreground shadow-lg backdrop-blur-md p-2 flex flex-col gap-1 mt-1.5 animate-in fade-in slide-in-from-top-2 duration-150 origin-top-right",
1626
1658
  s ? "left-0" : "right-0"
1627
1659
  ),
1628
- children: k ? /* @__PURE__ */ c("form", { onSubmit: g, className: "p-2 flex flex-col gap-2", children: [
1660
+ children: N ? /* @__PURE__ */ c("form", { onSubmit: C, className: "p-2 flex flex-col gap-2", children: [
1629
1661
  /* @__PURE__ */ r("span", { className: "text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: "Edit Profile" }),
1630
1662
  /* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: [
1631
1663
  /* @__PURE__ */ r("label", { htmlFor: "profile-name", className: "text-[9px] font-semibold text-muted-foreground", children: "Name" }),
@@ -1634,8 +1666,8 @@ const Et = (o, e) => {
1634
1666
  {
1635
1667
  id: "profile-name",
1636
1668
  type: "text",
1637
- value: x,
1638
- onChange: (w) => h(w.target.value),
1669
+ value: w,
1670
+ onChange: (T) => h(T.target.value),
1639
1671
  required: !0,
1640
1672
  className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
1641
1673
  }
@@ -1648,8 +1680,8 @@ const Et = (o, e) => {
1648
1680
  {
1649
1681
  id: "profile-role",
1650
1682
  type: "text",
1651
- value: T,
1652
- onChange: (w) => I(w.target.value),
1683
+ value: x,
1684
+ onChange: (T) => b(T.target.value),
1653
1685
  className: "w-full px-2 py-1 text-xs border rounded bg-background focus:ring-1 focus:ring-primary focus:outline-none"
1654
1686
  }
1655
1687
  )
@@ -1659,10 +1691,10 @@ const Et = (o, e) => {
1659
1691
  "button",
1660
1692
  {
1661
1693
  type: "button",
1662
- onClick: () => C(!1),
1694
+ onClick: () => k(!1),
1663
1695
  className: "px-2 py-1 text-[10px] rounded hover:bg-accent text-muted-foreground flex items-center gap-1 border border-border/30",
1664
1696
  children: [
1665
- /* @__PURE__ */ r(J, { size: 10 }),
1697
+ /* @__PURE__ */ r(B, { size: 10 }),
1666
1698
  " Cancel"
1667
1699
  ]
1668
1700
  }
@@ -1673,20 +1705,20 @@ const Et = (o, e) => {
1673
1705
  type: "submit",
1674
1706
  className: "px-2 py-1 text-[10px] rounded bg-primary text-primary-foreground hover:bg-primary/95 flex items-center gap-1 font-semibold",
1675
1707
  children: [
1676
- /* @__PURE__ */ r(Fe, { size: 10 }),
1708
+ /* @__PURE__ */ r(_e, { size: 10 }),
1677
1709
  " Save"
1678
1710
  ]
1679
1711
  }
1680
1712
  )
1681
1713
  ] })
1682
- ] }) : /* @__PURE__ */ c(he, { children: [
1714
+ ] }) : /* @__PURE__ */ c(be, { children: [
1683
1715
  /* @__PURE__ */ c("div", { className: "p-2 flex items-center gap-3 border-b border-border/40 pb-2.5 mb-1", children: [
1684
1716
  /* @__PURE__ */ c(
1685
1717
  "div",
1686
1718
  {
1687
1719
  onClick: () => {
1688
- var w;
1689
- return t && ((w = y.current) == null ? void 0 : w.click());
1720
+ var T;
1721
+ return t && ((T = g.current) == null ? void 0 : T.click());
1690
1722
  },
1691
1723
  title: t ? "Upload avatar image" : void 0,
1692
1724
  className: S(
@@ -1694,23 +1726,23 @@ const Et = (o, e) => {
1694
1726
  t && "cursor-pointer"
1695
1727
  ),
1696
1728
  children: [
1697
- E(24),
1698
- t && /* @__PURE__ */ r("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ r(Ue, { size: 14, className: "text-white" }) })
1729
+ L(24),
1730
+ t && /* @__PURE__ */ r("div", { className: "absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity", children: /* @__PURE__ */ r(Be, { size: 14, className: "text-white" }) })
1699
1731
  ]
1700
1732
  }
1701
1733
  ),
1702
1734
  /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 leading-normal flex-1", children: [
1703
1735
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
1704
1736
  /* @__PURE__ */ r("span", { className: "text-xs font-bold truncate text-foreground", children: u }),
1705
- n && /* @__PURE__ */ r(
1737
+ o && /* @__PURE__ */ r(
1706
1738
  "button",
1707
1739
  {
1708
1740
  type: "button",
1709
- onClick: () => C(!0),
1741
+ onClick: () => k(!0),
1710
1742
  title: "Edit Profile",
1711
1743
  "aria-label": "Edit Profile",
1712
1744
  className: "p-1 text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded transition-colors",
1713
- children: /* @__PURE__ */ r(_e, { size: 10 })
1745
+ children: /* @__PURE__ */ r(He, { size: 10 })
1714
1746
  }
1715
1747
  )
1716
1748
  ] }),
@@ -1718,58 +1750,58 @@ const Et = (o, e) => {
1718
1750
  d && /* @__PURE__ */ r("span", { className: "text-[9px] text-muted-foreground/60 truncate font-mono mt-0.5", children: d })
1719
1751
  ] })
1720
1752
  ] }),
1721
- e.map((w) => {
1722
- const L = w.icon;
1753
+ e.map((T) => {
1754
+ const P = T.icon;
1723
1755
  return /* @__PURE__ */ c(
1724
1756
  "button",
1725
1757
  {
1726
1758
  type: "button",
1727
1759
  role: "menuitem",
1728
1760
  onClick: () => {
1729
- w.onSelect(), m(!1);
1761
+ T.onSelect(), p(!1);
1730
1762
  },
1731
1763
  className: S(
1732
1764
  "w-full px-2 py-1.5 text-left rounded-md text-[11px] font-medium flex items-center gap-2 cursor-pointer transition-colors",
1733
- w.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
1734
- w.divider && "border-t border-border/20 pt-2 mt-1"
1765
+ T.destructive ? "text-destructive hover:bg-destructive/10" : "hover:bg-accent/60 hover:text-accent-foreground",
1766
+ T.divider && "border-t border-border/20 pt-2 mt-1"
1735
1767
  ),
1736
1768
  children: [
1737
- L && /* @__PURE__ */ r(L, { size: 12, className: "opacity-70" }),
1738
- w.label
1769
+ P && /* @__PURE__ */ r(P, { size: 12, className: "opacity-70" }),
1770
+ T.label
1739
1771
  ]
1740
1772
  },
1741
- w.id
1773
+ T.id
1742
1774
  );
1743
1775
  })
1744
1776
  ] })
1745
1777
  }
1746
1778
  )
1747
1779
  ] });
1748
- }, tr = (o) => {
1749
- const e = W((d) => d.name), n = W((d) => d.role), t = W((d) => d.email), a = W((d) => d.avatarUrl), s = W((d) => d.customAvatar), l = W((d) => d.updateProfile), u = W((d) => d.setCustomAvatar);
1780
+ }, tr = (n) => {
1781
+ const e = W((d) => d.name), o = W((d) => d.role), t = W((d) => d.email), a = W((d) => d.avatarUrl), s = W((d) => d.customAvatar), l = W((d) => d.updateProfile), u = W((d) => d.setCustomAvatar);
1750
1782
  return /* @__PURE__ */ r(
1751
- Pt,
1783
+ zt,
1752
1784
  {
1753
- ...o,
1754
- profile: { name: e, role: n, email: t, avatarUrl: s || a },
1785
+ ...n,
1786
+ profile: { name: e, role: o, email: t, avatarUrl: s || a },
1755
1787
  onProfileChange: l,
1756
1788
  onAvatarChange: (d) => {
1757
- const f = new FileReader();
1758
- f.onloadend = () => {
1759
- typeof f.result == "string" && u(f.result);
1760
- }, f.readAsDataURL(d);
1789
+ const m = new FileReader();
1790
+ m.onloadend = () => {
1791
+ typeof m.result == "string" && u(m.result);
1792
+ }, m.readAsDataURL(d);
1761
1793
  }
1762
1794
  }
1763
1795
  );
1764
- }, rr = ({ title: o, subtitle: e, icon: n, className: t }) => /* @__PURE__ */ c("div", { className: S("flex items-center space-x-3 select-none", t), children: [
1765
- n && /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-lg bg-primary/10 border border-primary/30 flex items-center justify-center text-primary shadow-inner shrink-0", children: n }),
1796
+ }, rr = ({ title: n, subtitle: e, icon: o, className: t }) => /* @__PURE__ */ c("div", { className: S("flex items-center space-x-3 select-none", t), children: [
1797
+ o && /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-lg bg-primary/10 border border-primary/30 flex items-center justify-center text-primary shadow-inner shrink-0", children: o }),
1766
1798
  /* @__PURE__ */ c("div", { className: "min-w-0", children: [
1767
- /* @__PURE__ */ r("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: o }),
1799
+ /* @__PURE__ */ r("h1", { className: "text-xs font-black uppercase tracking-wider text-foreground font-mono truncate", children: n }),
1768
1800
  e && /* @__PURE__ */ r("p", { className: "text-[9px] text-muted-foreground font-semibold truncate", children: e })
1769
1801
  ] })
1770
- ] }), Kt = ({ x: o, y: e, items: n, onClose: t, className: a }) => {
1771
- const s = P(null);
1772
- return z(() => {
1802
+ ] }), Pt = ({ x: n, y: e, items: o, onClose: t, className: a }) => {
1803
+ const s = z(null);
1804
+ return O(() => {
1773
1805
  const l = (i) => {
1774
1806
  s.current && !s.current.contains(i.target) && t();
1775
1807
  }, u = (i) => {
@@ -1783,12 +1815,12 @@ const Et = (o, e) => {
1783
1815
  {
1784
1816
  ref: s,
1785
1817
  role: "menu",
1786
- style: { top: e, left: o },
1818
+ style: { top: e, left: n },
1787
1819
  className: S(
1788
1820
  "fixed z-[1000] min-w-[160px] bg-popover text-popover-foreground border shadow-md rounded-md py-1 animate-in fade-in zoom-in-95 duration-100",
1789
1821
  a
1790
1822
  ),
1791
- children: n.map((l, u) => /* @__PURE__ */ c(se.Fragment, { children: [
1823
+ children: o.map((l, u) => /* @__PURE__ */ c(se.Fragment, { children: [
1792
1824
  l.divider && /* @__PURE__ */ r("div", { className: "h-[1px] bg-border my-1" }),
1793
1825
  /* @__PURE__ */ c(
1794
1826
  "div",
@@ -1816,9 +1848,9 @@ const Et = (o, e) => {
1816
1848
  }
1817
1849
  );
1818
1850
  }, nr = ({
1819
- columns: o,
1851
+ columns: n,
1820
1852
  data: e,
1821
- onRowClick: n,
1853
+ onRowClick: o,
1822
1854
  selectedRowId: t,
1823
1855
  rowKey: a = "id",
1824
1856
  virtualized: s = !0,
@@ -1827,85 +1859,85 @@ const Et = (o, e) => {
1827
1859
  placeholder: i = "No data available",
1828
1860
  className: d
1829
1861
  }) => {
1830
- const [f, p] = A(""), [m, k] = A(null), [C, x] = A(-1), h = P(null);
1831
- z(() => {
1832
- x(-1);
1833
- }, [f, m]);
1834
- const T = R(() => {
1835
- if (!f) return e;
1836
- const v = f.toLowerCase();
1837
- return e.filter((D) => Object.values(D).some((O) => O == null ? !1 : String(O).toLowerCase().includes(v)));
1838
- }, [e, f]), I = R(() => {
1839
- if (!m) return T;
1840
- const { key: v, direction: D } = m;
1841
- return [...T].sort((O, j) => {
1842
- const K = O[v], M = j[v];
1843
- if (K === M) return 0;
1844
- if (K == null) return 1;
1862
+ const [m, f] = A(""), [p, N] = A(null), [k, w] = A(-1), h = z(null);
1863
+ O(() => {
1864
+ w(-1);
1865
+ }, [m, p]);
1866
+ const x = j(() => {
1867
+ if (!m) return e;
1868
+ const v = m.toLowerCase();
1869
+ return e.filter((E) => Object.values(E).some((I) => I == null ? !1 : String(I).toLowerCase().includes(v)));
1870
+ }, [e, m]), b = j(() => {
1871
+ if (!p) return x;
1872
+ const { key: v, direction: E } = p;
1873
+ return [...x].sort((I, K) => {
1874
+ const $ = I[v], M = K[v];
1875
+ if ($ === M) return 0;
1876
+ if ($ == null) return 1;
1845
1877
  if (M == null) return -1;
1846
- const Z = Number(K), ee = Number(M);
1847
- if (!isNaN(Z) && !isNaN(ee))
1848
- return D === "asc" ? Z - ee : ee - Z;
1849
- const de = String(K).toLowerCase(), ce = String(M).toLowerCase();
1850
- return D === "asc" ? de.localeCompare(ce) : ce.localeCompare(de);
1878
+ const ee = Number($), te = Number(M);
1879
+ if (!isNaN(ee) && !isNaN(te))
1880
+ return E === "asc" ? ee - te : te - ee;
1881
+ const de = String($).toLowerCase(), ce = String(M).toLowerCase();
1882
+ return E === "asc" ? de.localeCompare(ce) : ce.localeCompare(de);
1851
1883
  });
1852
- }, [T, m]), N = (v, D) => {
1853
- D !== !1 && k((O) => !O || O.key !== v ? { key: v, direction: "asc" } : O.direction === "asc" ? { key: v, direction: "desc" } : null);
1854
- }, y = (v) => {
1855
- if (!(I.length === 0 || u)) {
1884
+ }, [x, p]), y = (v, E) => {
1885
+ E !== !1 && N((I) => !I || I.key !== v ? { key: v, direction: "asc" } : I.direction === "asc" ? { key: v, direction: "desc" } : null);
1886
+ }, g = (v) => {
1887
+ if (!(b.length === 0 || u)) {
1856
1888
  if (v.key === "ArrowDown")
1857
- v.preventDefault(), x((D) => {
1858
- const O = D + 1;
1859
- return O >= I.length ? 0 : O;
1889
+ v.preventDefault(), w((E) => {
1890
+ const I = E + 1;
1891
+ return I >= b.length ? 0 : I;
1860
1892
  });
1861
1893
  else if (v.key === "ArrowUp")
1862
- v.preventDefault(), x((D) => {
1863
- const O = D - 1;
1864
- return O < 0 ? I.length - 1 : O;
1894
+ v.preventDefault(), w((E) => {
1895
+ const I = E - 1;
1896
+ return I < 0 ? b.length - 1 : I;
1865
1897
  });
1866
- else if ((v.key === "Enter" || v.key === " ") && (v.preventDefault(), C >= 0 && C < I.length)) {
1867
- const D = I[C];
1868
- n && n(D);
1898
+ else if ((v.key === "Enter" || v.key === " ") && (v.preventDefault(), k >= 0 && k < b.length)) {
1899
+ const E = b[k];
1900
+ o && o(E);
1869
1901
  }
1870
1902
  }
1871
- }, g = (v) => v.sortable === !1 ? null : (m == null ? void 0 : m.key) !== v.key ? /* @__PURE__ */ r(Je, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : m.direction === "asc" ? /* @__PURE__ */ r(we, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ r(ke, { size: 14, className: "text-primary ml-1.5" }), b = () => /* @__PURE__ */ r("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: o.map((v) => /* @__PURE__ */ r(
1903
+ }, C = (v) => v.sortable === !1 ? null : (p == null ? void 0 : p.key) !== v.key ? /* @__PURE__ */ r(We, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : p.direction === "asc" ? /* @__PURE__ */ r(Ne, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ r(Ce, { size: 14, className: "text-primary ml-1.5" }), D = () => /* @__PURE__ */ r("tr", { role: "row", className: "border-b border-border bg-muted/30 select-none", children: n.map((v) => /* @__PURE__ */ r(
1872
1904
  "th",
1873
1905
  {
1874
1906
  role: "columnheader",
1875
- "aria-sort": (m == null ? void 0 : m.key) === v.key ? m.direction === "asc" ? "ascending" : "descending" : "none",
1907
+ "aria-sort": (p == null ? void 0 : p.key) === v.key ? p.direction === "asc" ? "ascending" : "descending" : "none",
1876
1908
  className: S(
1877
1909
  "p-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider text-left transition-colors",
1878
1910
  v.sortable !== !1 && "cursor-pointer hover:bg-accent/30 hover:text-foreground group"
1879
1911
  ),
1880
1912
  style: { width: v.width },
1881
- onClick: () => N(v.key, v.sortable),
1913
+ onClick: () => y(v.key, v.sortable),
1882
1914
  children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1883
1915
  /* @__PURE__ */ r("span", { children: v.header }),
1884
- g(v)
1916
+ C(v)
1885
1917
  ] })
1886
1918
  },
1887
1919
  v.key
1888
- )) }), E = (v, D) => {
1889
- const O = t !== void 0 && v[a] === t;
1920
+ )) }), L = (v, E) => {
1921
+ const I = t !== void 0 && v[a] === t;
1890
1922
  return /* @__PURE__ */ r(
1891
1923
  "tr",
1892
1924
  {
1893
1925
  role: "row",
1894
- "aria-selected": O,
1895
- onClick: () => n && n(v),
1926
+ "aria-selected": I,
1927
+ onClick: () => o && o(v),
1896
1928
  className: S(
1897
1929
  "border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
1898
- O && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1899
- C === D && "bg-accent/60 ring-1 ring-inset ring-ring"
1930
+ I && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1931
+ k === E && "bg-accent/60 ring-1 ring-inset ring-ring"
1900
1932
  ),
1901
- children: o.map((K) => {
1902
- const M = v[K.key];
1903
- return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: K.render ? K.render(M, v) : M != null ? String(M) : "" }, K.key);
1933
+ children: n.map(($) => {
1934
+ const M = v[$.key];
1935
+ return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: $.render ? $.render(M, v) : M != null ? String(M) : "" }, $.key);
1904
1936
  })
1905
1937
  },
1906
- String(v[a] || D)
1938
+ String(v[a] || E)
1907
1939
  );
1908
- }, w = R(() => ({
1940
+ }, T = j(() => ({
1909
1941
  Table: (v) => /* @__PURE__ */ r(
1910
1942
  "table",
1911
1943
  {
@@ -1914,53 +1946,53 @@ const Et = (o, e) => {
1914
1946
  className: "w-full border-collapse text-left bg-background text-foreground"
1915
1947
  }
1916
1948
  ),
1917
- TableHead: se.forwardRef((v, D) => /* @__PURE__ */ r("thead", { ref: D, ...v, className: "sticky top-0 bg-background z-10 shadow-[0_1px_0_0_rgba(0,0,0,0.1)] dark:shadow-[0_1px_0_0_rgba(255,255,255,0.05)]" })),
1918
- TableBody: se.forwardRef((v, D) => /* @__PURE__ */ r("tbody", { ref: D, ...v })),
1919
- TableRow: ({ item: v, context: D, ...O }) => {
1920
- if (!D || !v) return /* @__PURE__ */ r("tr", { ...O });
1921
- const j = D.selectedRowId !== void 0 && v[D.rowKey] === D.selectedRowId, K = D.focusedIndex === O["data-index"];
1949
+ TableHead: se.forwardRef((v, E) => /* @__PURE__ */ r("thead", { ref: E, ...v, className: "sticky top-0 bg-background z-10 shadow-[0_1px_0_0_rgba(0,0,0,0.1)] dark:shadow-[0_1px_0_0_rgba(255,255,255,0.05)]" })),
1950
+ TableBody: se.forwardRef((v, E) => /* @__PURE__ */ r("tbody", { ref: E, ...v })),
1951
+ TableRow: ({ item: v, context: E, ...I }) => {
1952
+ if (!E || !v) return /* @__PURE__ */ r("tr", { ...I });
1953
+ const K = E.selectedRowId !== void 0 && v[E.rowKey] === E.selectedRowId, $ = E.focusedIndex === I["data-index"];
1922
1954
  return /* @__PURE__ */ r(
1923
1955
  "tr",
1924
1956
  {
1925
- ...O,
1957
+ ...I,
1926
1958
  onClick: () => {
1927
1959
  var M;
1928
- return (M = D.onRowClick) == null ? void 0 : M.call(D, v);
1960
+ return (M = E.onRowClick) == null ? void 0 : M.call(E, v);
1929
1961
  },
1930
1962
  className: S(
1931
1963
  "border-b border-border/40 hover:bg-accent/40 transition-colors cursor-pointer text-sm outline-none",
1932
- j && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1933
- K && "bg-accent/60 ring-1 ring-inset ring-ring"
1964
+ K && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1965
+ $ && "bg-accent/60 ring-1 ring-inset ring-ring"
1934
1966
  )
1935
1967
  }
1936
1968
  );
1937
1969
  }
1938
- }), []), L = () => u ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
1939
- /* @__PURE__ */ r(Ne, { className: "animate-spin text-primary", size: 24 }),
1970
+ }), []), P = () => u ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-64 space-y-3", children: [
1971
+ /* @__PURE__ */ r(ke, { className: "animate-spin text-primary", size: 24 }),
1940
1972
  /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground", children: "Loading dataset..." })
1941
- ] }) : I.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
1973
+ ] }) : b.length === 0 ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-48 text-center px-4", children: [
1942
1974
  /* @__PURE__ */ r("span", { className: "text-sm font-medium text-foreground", children: i }),
1943
1975
  /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground mt-1", children: "No items matched your search query." })
1944
1976
  ] }) : s ? /* @__PURE__ */ r("div", { className: "flex-1 min-h-[300px] h-full relative", children: /* @__PURE__ */ r(
1945
- Ze,
1977
+ Ye,
1946
1978
  {
1947
- data: I,
1979
+ data: b,
1948
1980
  context: {
1949
1981
  selectedRowId: t,
1950
- focusedIndex: C,
1982
+ focusedIndex: k,
1951
1983
  rowKey: a,
1952
- onRowClick: n
1984
+ onRowClick: o
1953
1985
  },
1954
- components: w,
1955
- fixedHeaderContent: b,
1956
- itemContent: (v, D) => /* @__PURE__ */ r(he, { children: o.map((O) => {
1957
- const j = D[O.key];
1958
- return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: O.render ? O.render(j, D) : j != null ? String(j) : "" }, O.key);
1986
+ components: T,
1987
+ fixedHeaderContent: D,
1988
+ itemContent: (v, E) => /* @__PURE__ */ r(be, { children: n.map((I) => {
1989
+ const K = E[I.key];
1990
+ return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: I.render ? I.render(K, E) : K != null ? String(K) : "" }, I.key);
1959
1991
  }) })
1960
1992
  }
1961
1993
  ) }) : /* @__PURE__ */ r("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ c("table", { role: "grid", className: "w-full border-collapse text-left bg-background text-foreground", children: [
1962
- /* @__PURE__ */ r("thead", { children: b() }),
1963
- /* @__PURE__ */ r("tbody", { children: I.map((v, D) => E(v, D)) })
1994
+ /* @__PURE__ */ r("thead", { children: D() }),
1995
+ /* @__PURE__ */ r("tbody", { children: b.map((v, E) => L(v, E)) })
1964
1996
  ] }) });
1965
1997
  return /* @__PURE__ */ c(
1966
1998
  "div",
@@ -1969,7 +2001,7 @@ const Et = (o, e) => {
1969
2001
  role: "region",
1970
2002
  "aria-label": "Data Grid",
1971
2003
  tabIndex: 0,
1972
- onKeyDown: y,
2004
+ onKeyDown: g,
1973
2005
  className: S(
1974
2006
  "flex flex-col h-full bg-background border border-border rounded-lg shadow-sm overflow-hidden focus:outline-none focus:ring-1 focus:ring-ring focus:border-transparent",
1975
2007
  d
@@ -1977,79 +2009,79 @@ const Et = (o, e) => {
1977
2009
  children: [
1978
2010
  l && /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-3 border-b border-border bg-muted/20", children: [
1979
2011
  /* @__PURE__ */ c("div", { className: "relative flex-1 max-w-sm", children: [
1980
- /* @__PURE__ */ r(X, { size: 14, className: "absolute left-2.5 top-2.5 text-muted-foreground" }),
2012
+ /* @__PURE__ */ r(Z, { size: 14, className: "absolute left-2.5 top-2.5 text-muted-foreground" }),
1981
2013
  /* @__PURE__ */ r(
1982
2014
  "input",
1983
2015
  {
1984
2016
  type: "text",
1985
2017
  placeholder: "Filter table rows...",
1986
2018
  className: "w-full bg-secondary/40 border border-border rounded-md pl-8 pr-7 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary focus:border-transparent transition-all",
1987
- value: f,
1988
- onChange: (v) => p(v.target.value)
2019
+ value: m,
2020
+ onChange: (v) => f(v.target.value)
1989
2021
  }
1990
2022
  ),
1991
- f && /* @__PURE__ */ r(
2023
+ m && /* @__PURE__ */ r(
1992
2024
  "button",
1993
2025
  {
1994
- onClick: () => p(""),
2026
+ onClick: () => f(""),
1995
2027
  className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
1996
2028
  "aria-label": "Clear filter",
1997
- children: /* @__PURE__ */ r(J, { size: 12 })
2029
+ children: /* @__PURE__ */ r(B, { size: 12 })
1998
2030
  }
1999
2031
  )
2000
2032
  ] }),
2001
2033
  /* @__PURE__ */ c("div", { className: "text-[11px] text-muted-foreground font-medium ml-4", children: [
2002
- I.length,
2034
+ b.length,
2003
2035
  " of ",
2004
2036
  e.length,
2005
2037
  " records"
2006
2038
  ] })
2007
2039
  ] }),
2008
- L()
2040
+ P()
2009
2041
  ]
2010
2042
  }
2011
2043
  );
2012
2044
  }, or = ({
2013
- results: o,
2045
+ results: n,
2014
2046
  onQueryChange: e,
2015
- onSelect: n,
2047
+ onSelect: o,
2016
2048
  categories: t,
2017
2049
  placeholder: a = "Search…",
2018
2050
  debounceMs: s = 200,
2019
2051
  className: l
2020
2052
  }) => {
2021
- const [u, i] = A(""), [d, f] = A(!1), [p, m] = A(0), k = P(null), C = P(null), x = R(() => t || [...new Set(o.map((N) => N.category))], [t, o]), h = R(
2022
- () => x.flatMap((N) => o.filter((y) => y.category === N)),
2023
- [x, o]
2053
+ const [u, i] = A(""), [d, m] = A(!1), [f, p] = A(0), N = z(null), k = z(null), w = j(() => t || [...new Set(n.map((y) => y.category))], [t, n]), h = j(
2054
+ () => w.flatMap((y) => n.filter((g) => g.category === y)),
2055
+ [w, n]
2024
2056
  );
2025
- z(() => {
2026
- const N = (y) => {
2027
- k.current && !k.current.contains(y.target) && f(!1);
2057
+ O(() => {
2058
+ const y = (g) => {
2059
+ N.current && !N.current.contains(g.target) && m(!1);
2028
2060
  };
2029
- return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
2030
- }, []), z(() => {
2061
+ return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
2062
+ }, []), O(() => {
2031
2063
  if (!e) return;
2032
- const N = window.setTimeout(() => e(u), s);
2033
- return () => window.clearTimeout(N);
2034
- }, [u, s, e]), z(() => {
2035
- m(0);
2036
- }, [o]);
2037
- const T = (N) => {
2038
- n(N), f(!1), i("");
2039
- }, I = (N) => {
2040
- var y;
2064
+ const y = window.setTimeout(() => e(u), s);
2065
+ return () => window.clearTimeout(y);
2066
+ }, [u, s, e]), O(() => {
2067
+ p(0);
2068
+ }, [n]);
2069
+ const x = (y) => {
2070
+ o(y), m(!1), i("");
2071
+ }, b = (y) => {
2072
+ var g;
2041
2073
  if (!d) {
2042
- (N.key === "ArrowDown" || N.key === "Enter") && f(!0);
2074
+ (y.key === "ArrowDown" || y.key === "Enter") && m(!0);
2043
2075
  return;
2044
2076
  }
2045
- N.key === "ArrowDown" ? (N.preventDefault(), m((g) => h.length ? (g + 1) % h.length : 0)) : N.key === "ArrowUp" ? (N.preventDefault(), m(
2046
- (g) => h.length ? (g - 1 + h.length) % h.length : 0
2047
- )) : N.key === "Enter" ? (N.preventDefault(), h[p] && T(h[p])) : N.key === "Escape" && (N.preventDefault(), f(!1), (y = C.current) == null || y.blur());
2077
+ y.key === "ArrowDown" ? (y.preventDefault(), p((C) => h.length ? (C + 1) % h.length : 0)) : y.key === "ArrowUp" ? (y.preventDefault(), p(
2078
+ (C) => h.length ? (C - 1 + h.length) % h.length : 0
2079
+ )) : y.key === "Enter" ? (y.preventDefault(), h[f] && x(h[f])) : y.key === "Escape" && (y.preventDefault(), m(!1), (g = k.current) == null || g.blur());
2048
2080
  };
2049
- return /* @__PURE__ */ c("div", { ref: k, className: S("relative w-full", l), children: [
2081
+ return /* @__PURE__ */ c("div", { ref: N, className: S("relative w-full", l), children: [
2050
2082
  /* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
2051
2083
  /* @__PURE__ */ r(
2052
- X,
2084
+ Z,
2053
2085
  {
2054
2086
  size: 13,
2055
2087
  className: "absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
@@ -2058,18 +2090,18 @@ const Et = (o, e) => {
2058
2090
  /* @__PURE__ */ r(
2059
2091
  "input",
2060
2092
  {
2061
- ref: C,
2093
+ ref: k,
2062
2094
  type: "text",
2063
2095
  role: "combobox",
2064
2096
  "aria-expanded": d,
2065
2097
  "aria-label": a,
2066
2098
  value: u,
2067
2099
  placeholder: a,
2068
- onChange: (N) => {
2069
- i(N.target.value), f(!0);
2100
+ onChange: (y) => {
2101
+ i(y.target.value), m(!0);
2070
2102
  },
2071
- onFocus: () => f(!0),
2072
- onKeyDown: I,
2103
+ onFocus: () => m(!0),
2104
+ onKeyDown: b,
2073
2105
  className: "w-full h-7 pl-8 pr-7 bg-secondary/35 border border-border/40 rounded-md text-xs text-foreground placeholder:text-muted-foreground/75 focus:outline-none focus:ring-1 focus:ring-primary/40 focus:bg-background/95 focus:border-primary/50 transition-all font-sans"
2074
2106
  }
2075
2107
  ),
@@ -2078,12 +2110,12 @@ const Et = (o, e) => {
2078
2110
  {
2079
2111
  type: "button",
2080
2112
  onClick: () => {
2081
- var N;
2082
- i(""), (N = C.current) == null || N.focus();
2113
+ var y;
2114
+ i(""), (y = k.current) == null || y.focus();
2083
2115
  },
2084
2116
  "aria-label": "Clear search",
2085
2117
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
2086
- children: /* @__PURE__ */ r(J, { size: 11 })
2118
+ children: /* @__PURE__ */ r(B, { size: 11 })
2087
2119
  }
2088
2120
  )
2089
2121
  ] }),
@@ -2097,44 +2129,44 @@ const Et = (o, e) => {
2097
2129
  'No results found matching "',
2098
2130
  u,
2099
2131
  '"'
2100
- ] }) : x.map((N) => {
2101
- const y = o.filter((g) => g.category === N);
2102
- return y.length === 0 ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
2103
- /* @__PURE__ */ r("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children: N }),
2104
- y.map((g) => {
2105
- const b = g.icon, E = h.indexOf(g), w = E === p;
2132
+ ] }) : w.map((y) => {
2133
+ const g = n.filter((C) => C.category === y);
2134
+ return g.length === 0 ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
2135
+ /* @__PURE__ */ r("div", { className: "px-3 py-1 text-[9px] font-bold uppercase tracking-wider text-muted-foreground/80 bg-muted/40 border-y border-border/20 first:border-t-0", children: y }),
2136
+ g.map((C) => {
2137
+ const D = C.icon, L = h.indexOf(C), T = L === f;
2106
2138
  return /* @__PURE__ */ c(
2107
2139
  "div",
2108
2140
  {
2109
2141
  role: "option",
2110
- "aria-selected": w,
2111
- onClick: () => T(g),
2112
- onMouseEnter: () => m(E),
2142
+ "aria-selected": T,
2143
+ onClick: () => x(C),
2144
+ onMouseEnter: () => p(L),
2113
2145
  className: S(
2114
2146
  "px-3 py-2 cursor-pointer flex items-start space-x-2.5 transition-colors border-l-2",
2115
- w ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
2147
+ T ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
2116
2148
  ),
2117
2149
  children: [
2118
- b && /* @__PURE__ */ r(
2150
+ D && /* @__PURE__ */ r(
2119
2151
  "div",
2120
2152
  {
2121
2153
  className: S(
2122
2154
  "mt-0.5 p-1 rounded bg-muted/50",
2123
- w && "bg-background text-primary"
2155
+ T && "bg-background text-primary"
2124
2156
  ),
2125
- children: /* @__PURE__ */ r(b, { size: 12 })
2157
+ children: /* @__PURE__ */ r(D, { size: 12 })
2126
2158
  }
2127
2159
  ),
2128
2160
  /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
2129
- /* @__PURE__ */ r("div", { className: "text-xs font-medium truncate", children: g.title }),
2130
- g.description && /* @__PURE__ */ r("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: g.description })
2161
+ /* @__PURE__ */ r("div", { className: "text-xs font-medium truncate", children: C.title }),
2162
+ C.description && /* @__PURE__ */ r("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5", children: C.description })
2131
2163
  ] })
2132
2164
  ]
2133
2165
  },
2134
- `${g.category}-${g.id}`
2166
+ `${C.category}-${C.id}`
2135
2167
  );
2136
2168
  })
2137
- ] }, N);
2169
+ ] }, y);
2138
2170
  }) }),
2139
2171
  h.length > 0 && /* @__PURE__ */ c("div", { className: "px-3 py-1.5 border-t border-border bg-muted/20 flex items-center justify-between text-[9px] text-muted-foreground select-none shrink-0 font-mono", children: [
2140
2172
  /* @__PURE__ */ c("div", { className: "flex space-x-2", children: [
@@ -2156,42 +2188,42 @@ const Et = (o, e) => {
2156
2188
  )
2157
2189
  ] });
2158
2190
  }, sr = ({
2159
- placeholder: o = "Search...",
2191
+ placeholder: n = "Search...",
2160
2192
  onSearch: e,
2161
- results: n,
2193
+ results: o,
2162
2194
  onSelect: t,
2163
2195
  suggestions: a = [],
2164
2196
  loading: s = !1,
2165
2197
  className: l
2166
2198
  }) => {
2167
- const [u, i] = A(""), [d, f] = A(!1), [p, m] = A(-1), k = P(null);
2168
- z(() => {
2199
+ const [u, i] = A(""), [d, m] = A(!1), [f, p] = A(-1), N = z(null);
2200
+ O(() => {
2169
2201
  const h = setTimeout(() => {
2170
2202
  e(u);
2171
2203
  }, 300);
2172
2204
  return () => clearTimeout(h);
2173
2205
  }, [u, e]);
2174
- const C = a.filter(
2206
+ const k = a.filter(
2175
2207
  (h) => h.toLowerCase().includes(u.toLowerCase()) && h.toLowerCase() !== u.toLowerCase()
2176
- ), x = (h) => {
2177
- d && C.length > 0 && (h.key === "ArrowDown" ? (h.preventDefault(), m((T) => (T + 1) % C.length)) : h.key === "ArrowUp" ? (h.preventDefault(), m((T) => (T - 1 + C.length) % C.length)) : h.key === "Enter" && p >= 0 && (h.preventDefault(), i(C[p]), f(!1)));
2208
+ ), w = (h) => {
2209
+ d && k.length > 0 && (h.key === "ArrowDown" ? (h.preventDefault(), p((x) => (x + 1) % k.length)) : h.key === "ArrowUp" ? (h.preventDefault(), p((x) => (x - 1 + k.length) % k.length)) : h.key === "Enter" && f >= 0 && (h.preventDefault(), i(k[f]), m(!1)));
2178
2210
  };
2179
- return /* @__PURE__ */ c("div", { ref: k, className: S("flex flex-col h-full bg-background", l), children: [
2211
+ return /* @__PURE__ */ c("div", { ref: N, className: S("flex flex-col h-full bg-background", l), children: [
2180
2212
  /* @__PURE__ */ c("div", { className: "p-3 border-b border-border/50", children: [
2181
2213
  /* @__PURE__ */ c("div", { className: "relative", children: [
2182
- /* @__PURE__ */ r("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: s ? /* @__PURE__ */ r(Ne, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ r(X, { size: 14 }) }),
2214
+ /* @__PURE__ */ r("div", { className: "absolute left-2.5 top-2.5 text-muted-foreground", children: s ? /* @__PURE__ */ r(ke, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ r(Z, { size: 14 }) }),
2183
2215
  /* @__PURE__ */ r(
2184
2216
  "input",
2185
2217
  {
2186
2218
  type: "text",
2187
2219
  className: "w-full bg-secondary/50 border border-border rounded-md pl-9 pr-8 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",
2188
- placeholder: o,
2220
+ placeholder: n,
2189
2221
  value: u,
2190
2222
  onChange: (h) => {
2191
- i(h.target.value), f(!0), m(-1);
2223
+ i(h.target.value), m(!0), p(-1);
2192
2224
  },
2193
- onKeyDown: x,
2194
- onFocus: () => f(!0)
2225
+ onKeyDown: w,
2226
+ onFocus: () => m(!0)
2195
2227
  }
2196
2228
  ),
2197
2229
  u && /* @__PURE__ */ r(
@@ -2201,37 +2233,37 @@ const Et = (o, e) => {
2201
2233
  i(""), e("");
2202
2234
  },
2203
2235
  className: "absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",
2204
- children: /* @__PURE__ */ r(J, { size: 14 })
2236
+ children: /* @__PURE__ */ r(B, { size: 14 })
2205
2237
  }
2206
2238
  )
2207
2239
  ] }),
2208
- d && C.length > 0 && /* @__PURE__ */ r("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: C.map((h, T) => /* @__PURE__ */ c(
2240
+ d && k.length > 0 && /* @__PURE__ */ r("div", { className: "absolute left-3 right-3 mt-1 bg-popover border shadow-lg rounded-md z-50 py-1 overflow-hidden", children: k.map((h, x) => /* @__PURE__ */ c(
2209
2241
  "div",
2210
2242
  {
2211
2243
  className: S(
2212
2244
  "px-3 py-1.5 text-xs cursor-pointer flex items-center space-x-2",
2213
- T === p ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
2245
+ x === f ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
2214
2246
  ),
2215
2247
  onClick: () => {
2216
- i(h), f(!1);
2248
+ i(h), m(!1);
2217
2249
  },
2218
2250
  children: [
2219
- /* @__PURE__ */ r(He, { size: 12, className: "text-muted-foreground" }),
2251
+ /* @__PURE__ */ r(Je, { size: 12, className: "text-muted-foreground" }),
2220
2252
  /* @__PURE__ */ r("span", { children: h })
2221
2253
  ]
2222
2254
  },
2223
2255
  h
2224
2256
  )) })
2225
2257
  ] }),
2226
- /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ r("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: u ? `No results found for "${u}"` : "Type to start searching..." }) : /* @__PURE__ */ r("div", { className: "py-2", children: n.map((h) => {
2227
- const T = h.icon;
2258
+ /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ r("div", { className: "p-8 text-center text-xs text-muted-foreground italic", children: u ? `No results found for "${u}"` : "Type to start searching..." }) : /* @__PURE__ */ r("div", { className: "py-2", children: o.map((h) => {
2259
+ const x = h.icon;
2228
2260
  return /* @__PURE__ */ r(
2229
2261
  "div",
2230
2262
  {
2231
2263
  onClick: () => t(h),
2232
2264
  className: "px-4 py-2 hover:bg-accent/50 cursor-pointer group transition-colors border-l-2 border-transparent hover:border-primary",
2233
2265
  children: /* @__PURE__ */ c("div", { className: "flex items-start space-x-3", children: [
2234
- T && /* @__PURE__ */ r("div", { className: "mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors", children: /* @__PURE__ */ r(T, { size: 14, className: "text-muted-foreground group-hover:text-primary" }) }),
2266
+ x && /* @__PURE__ */ r("div", { className: "mt-0.5 p-1 rounded bg-muted group-hover:bg-background transition-colors", children: /* @__PURE__ */ r(x, { size: 14, className: "text-muted-foreground group-hover:text-primary" }) }),
2235
2267
  /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
2236
2268
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
2237
2269
  /* @__PURE__ */ r("span", { className: "text-xs font-medium truncate", children: h.title }),
@@ -2245,103 +2277,77 @@ const Et = (o, e) => {
2245
2277
  );
2246
2278
  }) }) })
2247
2279
  ] });
2248
- }, De = (o, e = 0) => o.reduce((n, t) => (n.push({ ...t, level: e }), t.isOpen && t.children && n.push(...De(t.children, e + 1)), n), []), ar = ({
2249
- data: o,
2280
+ }, Ie = (n, e = 0) => n.reduce((o, t) => (o.push({ ...t, level: e }), t.isOpen && t.children && o.push(...Ie(t.children, e + 1)), o), []), $t = (n) => {
2281
+ if (!n) return ["background"];
2282
+ const e = [n.isBranch ? "branch" : "leaf"];
2283
+ return n.kind && e.push(n.kind), e;
2284
+ }, ar = ({
2285
+ data: n,
2250
2286
  onToggle: e,
2251
- onActivate: n,
2287
+ onActivate: o,
2252
2288
  onMoveNode: t,
2253
- actions: a,
2254
- onNewFile: s,
2255
- onNewFolder: l,
2256
- onRename: u,
2257
- onDelete: i,
2258
- indent: d = 12,
2259
- virtualized: f = !0,
2260
- className: p
2289
+ actions: a = [],
2290
+ indent: s = 12,
2291
+ virtualized: l = !0,
2292
+ "aria-label": u = "Tree",
2293
+ className: i
2261
2294
  }) => {
2262
- const [m, k] = A(null), [C, x] = A(null), h = R(() => De(o), [o]);
2263
- z(() => {
2264
- x(null);
2265
- }, [o]);
2266
- const I = (a ?? [
2267
- {
2268
- id: "new-file",
2269
- label: "New File",
2270
- icon: /* @__PURE__ */ r(We, { size: 14 }),
2271
- onSelect: ({ nodeId: g }) => s == null ? void 0 : s(g)
2272
- },
2273
- {
2274
- id: "new-folder",
2275
- label: "New Folder",
2276
- icon: /* @__PURE__ */ r(Be, { size: 14 }),
2277
- onSelect: ({ nodeId: g }) => l == null ? void 0 : l(g)
2278
- },
2279
- {
2280
- id: "rename",
2281
- label: "Rename",
2282
- icon: /* @__PURE__ */ r(Ge, { size: 14 }),
2283
- divider: !0,
2284
- showFor: ["file", "folder"],
2285
- onSelect: ({ nodeId: g }) => g && (u == null ? void 0 : u(g))
2286
- },
2287
- {
2288
- id: "delete",
2289
- label: "Delete",
2290
- icon: /* @__PURE__ */ r(Ve, { size: 14, className: "text-destructive" }),
2291
- showFor: ["file", "folder"],
2292
- onSelect: ({ nodeId: g }) => g && (i == null ? void 0 : i(g))
2293
- }
2294
- ]).filter(
2295
- (g) => !g.showFor || m && g.showFor.includes(m.scope)
2296
- ).map((g) => ({
2297
- label: g.label,
2298
- icon: g.icon,
2299
- divider: g.divider,
2300
- onClick: () => m && g.onSelect(m.context)
2301
- })), N = (g, b, E) => {
2302
- g.preventDefault(), g.stopPropagation(), k({
2303
- x: g.clientX,
2304
- y: g.clientY,
2305
- scope: E,
2295
+ const [d, m] = A(null), [f, p] = A(null), N = j(() => Ie(n), [n]);
2296
+ O(() => {
2297
+ p(null);
2298
+ }, [n]);
2299
+ const k = a.filter(
2300
+ (x) => !x.showFor || d && x.showFor.some((b) => d.scopes.includes(b))
2301
+ ).map((x) => ({
2302
+ label: x.label,
2303
+ icon: x.icon,
2304
+ divider: x.divider,
2305
+ onClick: () => d && x.onSelect(d.context)
2306
+ })), w = (x, b) => {
2307
+ a.length !== 0 && (x.preventDefault(), x.stopPropagation(), m({
2308
+ x: x.clientX,
2309
+ y: x.clientY,
2310
+ scopes: $t(b),
2306
2311
  context: { nodeId: (b == null ? void 0 : b.id) ?? null, node: b }
2307
- });
2308
- }, y = (g) => {
2309
- const b = h[g], E = b.type === "folder";
2312
+ }));
2313
+ }, h = (x) => {
2314
+ const b = N[x], y = !!b.isBranch;
2310
2315
  return /* @__PURE__ */ c(
2311
2316
  "div",
2312
2317
  {
2313
2318
  role: "treeitem",
2314
- "aria-expanded": E ? !!b.isOpen : void 0,
2319
+ "aria-expanded": y ? !!b.isOpen : void 0,
2315
2320
  "aria-level": b.level + 1,
2316
2321
  tabIndex: 0,
2317
2322
  draggable: !0,
2318
- onDragStart: (w) => {
2319
- w.dataTransfer.setData("text/plain", b.id), w.dataTransfer.effectAllowed = "move";
2323
+ onDragStart: (g) => {
2324
+ g.dataTransfer.setData("text/plain", b.id), g.dataTransfer.effectAllowed = "move";
2320
2325
  },
2321
- onDragOver: (w) => {
2322
- E && (w.preventDefault(), x(b.id));
2326
+ onDragOver: (g) => {
2327
+ y && (g.preventDefault(), p(b.id));
2323
2328
  },
2324
- onDragLeave: () => x(null),
2325
- onDrop: (w) => {
2326
- w.preventDefault(), x(null);
2327
- const L = w.dataTransfer.getData("text/plain");
2328
- L && L !== b.id && E && (t == null || t(L, b.id));
2329
+ onDragLeave: () => p(null),
2330
+ onDrop: (g) => {
2331
+ g.preventDefault(), p(null);
2332
+ const C = g.dataTransfer.getData("text/plain");
2333
+ C && C !== b.id && y && (t == null || t(C, b.id));
2329
2334
  },
2330
- onClick: () => E && (e == null ? void 0 : e(b)),
2331
- onDoubleClick: () => n == null ? void 0 : n(b),
2332
- onKeyDown: (w) => {
2333
- w.key === "Enter" && (w.preventDefault(), E ? e == null || e(b) : n == null || n(b));
2335
+ onClick: () => y && (e == null ? void 0 : e(b)),
2336
+ onDoubleClick: () => o == null ? void 0 : o(b),
2337
+ onKeyDown: (g) => {
2338
+ g.key === "Enter" && (g.preventDefault(), y ? e == null || e(b) : o == null || o(b));
2334
2339
  },
2335
- onContextMenu: (w) => N(w, b, b.type),
2336
- style: { paddingLeft: `${b.level * d + 8}px` },
2340
+ onContextMenu: (g) => w(g, b),
2341
+ style: { paddingLeft: `${b.level * s + 8}px` },
2337
2342
  className: S(
2338
2343
  "flex items-center py-1 px-2 cursor-pointer hover:bg-accent hover:text-accent-foreground select-none text-xs",
2339
2344
  "transition-colors duration-150 relative focus:outline-none focus:ring-1 focus:ring-ring",
2340
- C === b.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm"
2345
+ f === b.id && "bg-primary/20 ring-1 ring-primary/50 rounded-sm",
2346
+ b.className
2341
2347
  ),
2342
2348
  children: [
2343
- /* @__PURE__ */ r("div", { className: "w-4 h-4 mr-1 flex items-center justify-center", children: E && (b.isOpen ? /* @__PURE__ */ r(ke, { size: 14 }) : /* @__PURE__ */ r(ye, { size: 14 })) }),
2344
- /* @__PURE__ */ r("div", { className: "mr-2", children: E ? /* @__PURE__ */ r(Ye, { size: 14, className: "text-blue-400 fill-blue-400/20" }) : /* @__PURE__ */ r(qe, { size: 14, className: "text-muted-foreground" }) }),
2349
+ /* @__PURE__ */ r("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: y && (b.isOpen ? /* @__PURE__ */ r(Ce, { size: 14 }) : /* @__PURE__ */ r(we, { size: 14 })) }),
2350
+ b.icon && /* @__PURE__ */ r("div", { className: "mr-2 flex items-center shrink-0", children: b.icon }),
2345
2351
  /* @__PURE__ */ r("span", { className: "truncate", children: b.label })
2346
2352
  ]
2347
2353
  },
@@ -2352,24 +2358,25 @@ const Et = (o, e) => {
2352
2358
  "div",
2353
2359
  {
2354
2360
  role: "tree",
2355
- className: S("h-full w-full bg-muted/30", p),
2356
- onContextMenu: (g) => N(g, null, "background"),
2361
+ "aria-label": u,
2362
+ className: S("h-full w-full bg-muted/30", i),
2363
+ onContextMenu: (x) => w(x, null),
2357
2364
  children: [
2358
- f ? /* @__PURE__ */ r(
2359
- et,
2365
+ l ? /* @__PURE__ */ r(
2366
+ qe,
2360
2367
  {
2361
2368
  style: { height: "100%" },
2362
- totalCount: h.length,
2363
- itemContent: y
2369
+ totalCount: N.length,
2370
+ itemContent: h
2364
2371
  }
2365
- ) : /* @__PURE__ */ r("div", { className: "h-full overflow-auto", children: h.map((g, b) => y(b)) }),
2366
- m && I.length > 0 && /* @__PURE__ */ r(
2367
- Kt,
2372
+ ) : /* @__PURE__ */ r("div", { className: "h-full overflow-auto", children: N.map((x, b) => h(b)) }),
2373
+ d && k.length > 0 && /* @__PURE__ */ r(
2374
+ Pt,
2368
2375
  {
2369
- x: m.x,
2370
- y: m.y,
2371
- items: I,
2372
- onClose: () => k(null)
2376
+ x: d.x,
2377
+ y: d.y,
2378
+ items: k,
2379
+ onClose: () => m(null)
2373
2380
  }
2374
2381
  )
2375
2382
  ]
@@ -2377,52 +2384,55 @@ const Et = (o, e) => {
2377
2384
  );
2378
2385
  };
2379
2386
  export {
2380
- rt as ActivityBar,
2387
+ Xe as ActivityBar,
2381
2388
  rr as AppTitle,
2382
- st as ChatPane,
2383
- It as CommandPalette,
2384
- ut as CommandRegistry,
2385
- nt as ConnectedActivityBar,
2386
- it as ConnectedChatPane,
2389
+ X as BUNDLED_THEMES,
2390
+ dt as BUNDLED_THEME_CLASSES,
2391
+ tt as ChatPane,
2392
+ Dt as CommandPalette,
2393
+ lt as CommandRegistry,
2394
+ Ze as ConnectedActivityBar,
2395
+ ot as ConnectedChatPane,
2387
2396
  Xt as ConnectedCommandPalette,
2388
- mt as ConnectedMenuBar,
2397
+ it as ConnectedMenuBar,
2389
2398
  Zt as ConnectedModal,
2390
- gt as ConnectedSidebarPane,
2391
- bt as ConnectedStatusBar,
2392
- yt as ConnectedTerminalPane,
2399
+ pt as ConnectedSidebarPane,
2400
+ ht as ConnectedStatusBar,
2401
+ vt as ConnectedTerminalPane,
2393
2402
  er as ConnectedThemeSwitcher,
2394
2403
  tr as ConnectedUserProfile,
2395
- Kt as ContextMenu,
2404
+ Pt as ContextMenu,
2396
2405
  Vt as DEFAULT_COMMAND_IDS,
2397
- ft as DEFAULT_SETTINGS_THEMES,
2406
+ mt as DEFAULT_SETTINGS_THEMES,
2398
2407
  Lt as DEFAULT_THEME_OPTIONS,
2399
2408
  nr as DataGrid,
2400
- dt as MenuBar,
2401
- ct as MenuRegistry,
2409
+ st as MenuBar,
2410
+ at as MenuRegistry,
2402
2411
  At as Modal,
2403
2412
  Gt as NexusWorkspaceShell,
2404
2413
  or as QuickSearch,
2405
2414
  sr as SearchWidget,
2406
- pt as SettingsPanel,
2415
+ ft as SettingsPanel,
2407
2416
  Gt as ShellLayout,
2408
- re as SidebarPane,
2409
- ht as StatusBar,
2410
- xt as TerminalPane,
2417
+ ne as SidebarPane,
2418
+ gt as StatusBar,
2419
+ bt as TerminalPane,
2411
2420
  Mt as ThemeSwitcher,
2412
2421
  ar as TreeWidget,
2413
- Pt as UserProfile,
2422
+ zt as UserProfile,
2414
2423
  S as cn,
2415
- B as commandRegistry,
2416
- Nt as componentRegistry,
2424
+ J as commandRegistry,
2425
+ wt as componentRegistry,
2417
2426
  Yt as initializeShell,
2418
2427
  le as menuRegistry,
2419
2428
  qt as pluginRegistry,
2429
+ ct as themeClass,
2420
2430
  Q as useChatStore,
2421
2431
  Qt as useKeyboardShortcuts,
2422
- kt as useLayoutStore,
2423
- Te as useModalStore,
2432
+ Nt as useLayoutStore,
2433
+ Ee as useModalStore,
2424
2434
  ae as useRightSidebarStore,
2425
- F as useSidebarStore,
2435
+ U as useSidebarStore,
2426
2436
  ie as useStatusBarStore,
2427
2437
  V as useTerminalStore,
2428
2438
  Y as useThemeStore,