nexus-shell 0.2.3 → 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 J = (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 j, useState as A, useRef as M, useEffect as O } from "react";
6
- import { Model as K, Actions as G, DockLocation as Oe, Layout as Ae } 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 Le, MessageCircle as be, X as B, User as xe, Terminal as ve, Send as ze, ChevronRight as ye, Sun as Me, Moon as Pe, GraduationCap as Re, ChevronUp as we, Search as X, Info as Ke, HelpCircle as $e, AlertCircle as je, Check as Fe, Camera as Ue, Edit2 as _e, Loader2 as Ne, ChevronsUpDown as Be, ChevronDown as ke, Clock as Je } from "lucide-react";
9
- import { clsx as He } from "clsx";
10
- import { twMerge as We } from "tailwind-merge";
11
- import { create as U } from "zustand";
12
- import { TableVirtuoso as Ge, Virtuoso as Ve } from "react-virtuoso";
13
- function S(...o) {
14
- return We(He(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 Ye = [
17
- { id: "settings", label: "Settings", icon: Le }
18
- ], qe = ({
19
- items: o = [],
20
- bottomItems: e = Ye,
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 Ye = [
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,64 +49,64 @@ const Ye = [
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
- }), Qe = (o) => {
72
- const e = F((s) => s.panels), n = F((s) => s.activeSidebar), t = F((s) => s.toggleSidebar), a = j(
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
- qe,
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
- }, Xe = /* @__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
- ] }), Ze = ({
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 = Xe,
101
+ emptyState: u = et,
102
102
  className: i
103
103
  }) => {
104
- const [d, m] = A(""), [f, p] = A(0), N = M(null), k = M(null), w = d.startsWith("/") ? n.filter(
104
+ const [d, m] = A(""), [f, p] = A(0), N = z(null), k = z(null), w = d.startsWith("/") ? o.filter(
105
105
  (g) => `/${g.command}`.startsWith(d.toLowerCase().split(" ")[0])
106
106
  ) : [], h = w.length > 0;
107
107
  O(() => {
108
108
  k.current && (k.current.scrollTop = k.current.scrollHeight);
109
- }, [o]), O(() => {
109
+ }, [n]), O(() => {
110
110
  p(0);
111
111
  }, [d]);
112
112
  const x = () => {
@@ -144,7 +144,7 @@ const Ye = [
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(
@@ -165,7 +165,7 @@ const Ye = [
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((g) => {
168
+ children: n.length === 0 ? u : n.map((g) => {
169
169
  const C = g.role === "user";
170
170
  return /* @__PURE__ */ c(
171
171
  "div",
@@ -173,7 +173,7 @@ const Ye = [
173
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
- C ? /* @__PURE__ */ r(xe, { size: 10 }) : /* @__PURE__ */ r(ve, { size: 10 }),
176
+ C ? /* @__PURE__ */ r(ve, { size: 10 }) : /* @__PURE__ */ r(ye, { size: 10 }),
177
177
  /* @__PURE__ */ r("span", { children: g.author ?? (C ? "You" : "Assistant") })
178
178
  ] }),
179
179
  /* @__PURE__ */ r(
@@ -245,7 +245,7 @@ const Ye = [
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(ze, { size: 14 })
248
+ children: /* @__PURE__ */ r(Pe, { size: 14 })
249
249
  }
250
250
  )
251
251
  ] })
@@ -254,30 +254,30 @@ const Ye = [
254
254
  }
255
255
  );
256
256
  };
257
- let et = 0;
258
- const tt = () => `msg-${Date.now()}-${et += 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 ?? tt() }]
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
- })), rt = ({ 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
- Ze,
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,
@@ -292,15 +292,15 @@ const tt = () => `msg-${Date.now()}-${et += 1}`, Q = U((o) => ({
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
- }, nt = ({
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
@@ -325,7 +325,7 @@ const tt = () => `msg-${Date.now()}-${et += 1}`, Q = U((o) => ({
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
  }
@@ -364,19 +364,19 @@ const tt = () => `msg-${Date.now()}-${et += 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 tt = () => `msg-${Date.now()}-${et += 1}`, Q = U((o) => ({
398
398
  }
399
399
  );
400
400
  };
401
- class ot {
401
+ class at {
402
402
  constructor() {
403
- J(this, "menus", /* @__PURE__ */ new Map());
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,15 +414,15 @@ class ot {
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 ot();
423
- class st {
422
+ const le = new at();
423
+ class lt {
424
424
  constructor() {
425
- J(this, "commands", /* @__PURE__ */ new Map());
425
+ H(this, "commands", /* @__PURE__ */ new Map());
426
426
  }
427
427
  registerCommand(e) {
428
428
  if (this.commands.has(e.id)) {
@@ -431,9 +431,9 @@ class st {
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 st {
442
442
  return Array.from(this.commands.values());
443
443
  }
444
444
  }
445
- const W = new st(), 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 = W.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
- }, at = (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(nt, { ...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
- W.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,12 +486,12 @@ const W = new st(), 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
497
  children: /* @__PURE__ */ r(B, { size: 14 })
@@ -501,14 +501,44 @@ const W = new st(), Ce = (o) => o.map((e) => {
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
- ), lt = [
505
- { id: "light", label: "Light", icon: Me },
506
- { id: "dark", label: "Dark", icon: Pe },
507
- { id: "gt", label: "Georgia Tech", icon: Re }
508
- ], it = ({
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 = lt,
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 W = new st(), 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 W = new st(), 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
- }), dt = (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
- it,
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), ct = ({
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 W = new st(), 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,42 +649,42 @@ const W = new st(), 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
- })), ut = (o) => {
634
- const e = ie((t) => t.widgets), n = j(
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 ? () => W.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(ct, { ...o, widgets: n });
642
- }, mt = ({
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 = M(null), m = M(null);
684
+ const [u, i] = A(""), d = z(null), m = z(null);
652
685
  O(() => {
653
686
  d.current && (d.current.scrollTop = d.current.scrollHeight);
654
- }, [o]);
687
+ }, [n]);
655
688
  const f = (p) => {
656
689
  if (p.key !== "Enter") return;
657
690
  const N = u.trim();
@@ -668,25 +701,25 @@ const W = new st(), 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
725
  children: /* @__PURE__ */ r(B, { size: 14 })
@@ -705,7 +738,7 @@ const W = new st(), Ce = (o) => o.map((e) => {
705
738
  var p;
706
739
  return (p = m.current) == null ? void 0 : p.focus();
707
740
  },
708
- children: o.map((p, N) => /* @__PURE__ */ r("div", { className: "whitespace-pre-wrap break-all text-foreground/90", children: p }, N))
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: [
@@ -728,24 +761,24 @@ const W = new st(), 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
- })), ft = [
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
- ], pt = ({
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
- mt,
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,25 +790,25 @@ const W = new st(), Ce = (o) => o.map((e) => {
757
790
  return;
758
791
  }
759
792
  if (d === "help") {
760
- ft.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 gt {
802
+ class yt {
770
803
  constructor() {
771
- J(this, "components", /* @__PURE__ */ new Map());
804
+ H(this, "components", /* @__PURE__ */ new Map());
772
805
  }
773
806
  /**
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 gt {
790
823
  return Array.from(this.components.keys());
791
824
  }
792
825
  }
793
- const ht = new gt(), _ = {
826
+ const wt = new yt(), _ = {
794
827
  global: { tabEnableClose: !0, tabSetEnableMaximize: !1, tabSetEnableDivide: !0 },
795
828
  borders: [
796
829
  {
@@ -816,49 +849,49 @@ const ht = new gt(), _ = {
816
849
  }
817
850
  ]
818
851
  }
819
- }, fe = "nexus-shell-layout", bt = 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 = K.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 = K.fromJson(_);
870
+ o = R.fromJson(_);
838
871
  } catch (t) {
839
- console.warn("Failed to load layout from storage, using default", t), n = K.fromJson(_);
872
+ console.warn("Failed to load layout from storage, using default", t), o = R.fromJson(_);
840
873
  }
841
874
  else
842
- n = K.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 = K.fromJson(t);
885
+ s = R.fromJson(t);
853
886
  } catch (l) {
854
- console.warn("Failed to parse init layout json, using default", l), s = K.fromJson(_);
887
+ console.warn("Failed to parse init layout json, using default", l), s = R.fromJson(_);
855
888
  }
856
889
  else
857
- s = K.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 ht = new gt(), _ = {
872
905
  if (typeof window < "u")
873
906
  try {
874
907
  const l = localStorage.getItem(t);
875
- l ? s = K.fromJson(JSON.parse(l)) : s = K.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 = K.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 = K.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
  });
@@ -940,36 +973,36 @@ const ht = new gt(), _ = {
940
973
  G.addNode(
941
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
- })), _t = ({
970
- panels: o,
1002
+ })), Gt = ({
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,
@@ -979,22 +1012,22 @@ const ht = new gt(), _ = {
979
1012
  disableLocalStorage: d = !1,
980
1013
  onLayoutChange: m
981
1014
  }) => {
982
- const { model: f, setModel: p, initLayout: N, isTabDirty: k, setTabDirty: w } = bt(), h = Y((E) => E.theme), x = F((E) => E.setPanels), b = Q((E) => E.setSlashCommands), y = ie((E) => E.setWidgets);
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);
983
1016
  O(() => {
984
- o && x(o);
985
- }, [o, x]), O(() => {
1017
+ n && x(n);
1018
+ }, [n, x]), O(() => {
986
1019
  e && b(e);
987
1020
  }, [e, b]), O(() => {
988
- n && le.setMenus(n);
989
- }, [n]), O(() => {
1021
+ o && le.setMenus(o);
1022
+ }, [o]), O(() => {
990
1023
  t && y(t);
991
1024
  }, [t, y]), O(() => {
992
1025
  u || !i && !d || N(i, d);
993
1026
  }, []);
994
- const g = (E) => {
1027
+ const g = (D) => {
995
1028
  try {
996
- const L = E.getComponent(), T = E.getConfig() || {}, P = L ? ht.get(L) : void 0;
997
- return P ? /* @__PURE__ */ r(P, { node: E, ...T }) : /* @__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
1032
  L
1000
1033
  ] });
@@ -1004,14 +1037,14 @@ const ht = new gt(), _ = {
1004
1037
  L instanceof Error ? L.message : "Unknown error"
1005
1038
  ] });
1006
1039
  }
1007
- }, C = (E) => {
1008
- if (E.type !== G.DELETE_TAB) return E;
1009
- const L = f.getNodeById(E.data.node);
1010
- if (!L || !k(L.getId())) return E;
1011
- Te.getState().openConfirm(
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(
1012
1045
  `Tab "${L.getName()}" has unsaved changes. Are you sure you want to close it?`
1013
1046
  ).then((T) => {
1014
- T && (w(L.getId(), !1), f.doAction(E));
1047
+ T && (w(L.getId(), !1), f.doAction(D));
1015
1048
  });
1016
1049
  };
1017
1050
  return /* @__PURE__ */ c(
@@ -1020,7 +1053,7 @@ const ht = new gt(), _ = {
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
- at,
1056
+ it,
1024
1057
  {
1025
1058
  title: a,
1026
1059
  center: l,
@@ -1028,36 +1061,38 @@ const ht = new gt(), _ = {
1028
1061
  }
1029
1062
  ),
1030
1063
  /* @__PURE__ */ c("div", { className: "flex-1 flex overflow-hidden", children: [
1031
- /* @__PURE__ */ r(Qe, {}),
1032
- /* @__PURE__ */ r(dt, {}),
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
- Ae,
1068
+ Me,
1036
1069
  {
1037
1070
  model: u || f,
1038
1071
  factory: g,
1039
- onModelChange: (E) => {
1040
- u || p(E), m == null || m(E.toJson());
1072
+ onModelChange: (D) => {
1073
+ u || p(D), m == null || m(D.toJson());
1041
1074
  },
1042
1075
  onAction: C
1043
1076
  }
1044
1077
  ) }),
1045
- /* @__PURE__ */ r(pt, {})
1078
+ /* @__PURE__ */ r(vt, {})
1046
1079
  ] }),
1047
- /* @__PURE__ */ r(rt, {})
1080
+ /* @__PURE__ */ r(ot, {})
1048
1081
  ] }),
1049
- /* @__PURE__ */ r(ut, {})
1082
+ /* @__PURE__ */ r(ht, {})
1050
1083
  ]
1051
1084
  }
1052
1085
  );
1053
- }, Bt = [
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), xt = [
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 ht = new gt(), _ = {
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
- ], vt = {
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,35 +1123,35 @@ const ht = new gt(), _ = {
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
- }, Jt = (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 && xt.forEach((d) => W.registerCommand(d)), t == null || t.forEach((d) => W.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 ? vt : {},
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 yt {
1150
+ class St {
1118
1151
  constructor() {
1119
- J(this, "plugins", /* @__PURE__ */ new Map());
1120
- J(this, "loaders", /* @__PURE__ */ new Map());
1121
- J(this, "statuses", /* @__PURE__ */ new Map());
1152
+ H(this, "plugins", /* @__PURE__ */ new Map());
1153
+ H(this, "loaders", /* @__PURE__ */ new Map());
1154
+ H(this, "statuses", /* @__PURE__ */ new Map());
1122
1155
  }
1123
1156
  registerPlugin(e) {
1124
1157
  if (this.plugins.has(e.id)) {
@@ -1127,25 +1160,25 @@ class yt {
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 yt {
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 yt {
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 yt {
1177
1210
  return Array.from(this.plugins.values());
1178
1211
  }
1179
1212
  }
1180
- const Ht = new yt(), 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
- }, H = 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 Ht = new yt(), 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
- }), Wt = () => {
1260
+ }), Qt = () => {
1228
1261
  O(() => {
1229
- const o = (e) => {
1230
- const n = W.getCommands();
1231
- for (const t of n)
1232
- if (t.keybinding && wt(e, t.keybinding)) {
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 wt(o, e) {
1273
+ function Tt(n, e) {
1241
1274
  var p;
1242
- const n = e.split("+"), t = (p = n.pop()) == null ? void 0 : p.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, m = o.altKey, f = o.metaKey;
1243
- return o.key.toLowerCase() === t && i === a && d === s && m === l && f === u;
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 Nt = (o, e) => {
1246
- const n = e.toLowerCase();
1247
- return o.label.toLowerCase().includes(n) || o.id.toLowerCase().includes(n);
1248
- }, kt = ({
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
- filter: l = Nt,
1288
+ filter: l = Et,
1256
1289
  className: u
1257
1290
  }) => {
1258
- const [i, d] = A(""), [m, f] = A(0), p = M(null), N = j(
1291
+ const [i, d] = A(""), [m, f] = A(0), p = z(null), N = j(
1259
1292
  () => e.filter((w) => l(w, i)),
1260
1293
  [e, i, l]
1261
1294
  );
1262
1295
  if (O(() => {
1263
1296
  var w;
1264
- o && (d(""), f(0), (w = p.current) == null || w.focus());
1265
- }, [o]), O(() => {
1297
+ n && (d(""), f(0), (w = p.current) == null || w.focus());
1298
+ }, [n]), O(() => {
1266
1299
  f(0);
1267
- }, [i]), !o) return null;
1300
+ }, [i]), !n) return null;
1268
1301
  const k = (w) => {
1269
1302
  w.key === "ArrowDown" ? (w.preventDefault(), f((h) => N.length ? (h + 1) % N.length : 0)) : w.key === "ArrowUp" ? (w.preventDefault(), f(
1270
1303
  (h) => N.length ? (h - 1 + N.length) % N.length : 0
1271
- )) : w.key === "Enter" ? (w.preventDefault(), N[m] && n(N[m])) : w.key === "Escape" && (w.preventDefault(), t == null || t());
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",
@@ -1291,7 +1324,7 @@ const Nt = (o, e) => {
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
  {
@@ -1320,7 +1353,7 @@ const Nt = (o, e) => {
1320
1353
  {
1321
1354
  role: "option",
1322
1355
  "aria-selected": h === m,
1323
- onClick: () => n(w),
1356
+ onClick: () => o(w),
1324
1357
  onMouseEnter: () => f(h),
1325
1358
  className: S(
1326
1359
  "px-4 py-2 cursor-pointer flex justify-between items-center text-sm",
@@ -1356,41 +1389,41 @@ const Nt = (o, e) => {
1356
1389
  )
1357
1390
  }
1358
1391
  );
1359
- }, Gt = ({
1360
- shortcutKey: o = "p",
1392
+ }, Xt = ({
1393
+ shortcutKey: n = "p",
1361
1394
  ...e
1362
1395
  }) => {
1363
- const [n, t] = A(!1);
1396
+ const [o, t] = A(!1);
1364
1397
  return O(() => {
1365
- if (o === null) return;
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
- kt,
1403
+ }, [n]), /* @__PURE__ */ r(
1404
+ Dt,
1372
1405
  {
1373
1406
  ...e,
1374
- open: n,
1375
- commands: W.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
  );
1382
- }, Ct = {
1383
- alert: je,
1384
- confirm: $e,
1385
- prompt: Ke
1386
- }, St = {
1415
+ }, It = {
1416
+ alert: Fe,
1417
+ confirm: Ue,
1418
+ prompt: je
1419
+ }, Ot = {
1387
1420
  alert: "text-destructive",
1388
1421
  confirm: "text-amber-500",
1389
1422
  prompt: "text-blue-500"
1390
- }, Tt = ({
1391
- open: o,
1423
+ }, At = ({
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,
@@ -1400,24 +1433,24 @@ const Nt = (o, e) => {
1400
1433
  placeholder: d = "Enter value…",
1401
1434
  className: m
1402
1435
  }) => {
1403
- const [f, p] = A(a), N = M(null);
1436
+ const [f, p] = A(a), N = z(null);
1404
1437
  if (O(() => {
1405
- if (!o || (p(a), e !== "prompt")) return;
1438
+ if (!n || (p(a), e !== "prompt")) return;
1406
1439
  const x = window.setTimeout(() => {
1407
1440
  var b, y;
1408
1441
  (b = N.current) == null || b.focus(), (y = N.current) == null || y.select();
1409
1442
  }, 50);
1410
1443
  return () => window.clearTimeout(x);
1411
- }, [o, e, a]), O(() => {
1412
- if (!o) return;
1444
+ }, [n, e, a]), O(() => {
1445
+ if (!n) return;
1413
1446
  const x = (b) => {
1414
1447
  b.key === "Escape" && (b.preventDefault(), l == null || l());
1415
1448
  };
1416
1449
  return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
1417
- }, [o, l]), !o) return null;
1450
+ }, [n, l]), !n) return null;
1418
1451
  const k = () => s == null ? void 0 : s(e === "prompt" ? f : void 0), w = (x) => {
1419
1452
  x.key === "Enter" && (x.preventDefault(), k());
1420
- }, h = Ct[e];
1453
+ }, h = It[e];
1421
1454
  return /* @__PURE__ */ r(
1422
1455
  "div",
1423
1456
  {
@@ -1428,7 +1461,7 @@ const Nt = (o, e) => {
1428
1461
  {
1429
1462
  role: "dialog",
1430
1463
  "aria-modal": "true",
1431
- "aria-label": n,
1464
+ "aria-label": o,
1432
1465
  onClick: (x) => x.stopPropagation(),
1433
1466
  onKeyDown: w,
1434
1467
  className: S(
@@ -1447,9 +1480,9 @@ const Nt = (o, e) => {
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", St[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
  ] }),
@@ -1458,7 +1491,7 @@ const Nt = (o, e) => {
1458
1491
  {
1459
1492
  ref: N,
1460
1493
  type: "text",
1461
- "aria-label": n,
1494
+ "aria-label": o,
1462
1495
  value: f,
1463
1496
  placeholder: d,
1464
1497
  onChange: (x) => p(x.target.value),
@@ -1491,33 +1524,32 @@ const Nt = (o, e) => {
1491
1524
  )
1492
1525
  }
1493
1526
  );
1494
- }, Vt = (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
- Tt,
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
- }, Dt = [
1514
- { id: "light", label: "Light" },
1515
- { id: "dark", label: "Dark" },
1516
- { id: "gt", label: "GT" }
1517
- ], Et = ({
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 = Dt,
1552
+ options: o = Lt,
1521
1553
  className: t,
1522
1554
  "aria-label": a = "Theme"
1523
1555
  }) => /* @__PURE__ */ r(
@@ -1529,34 +1561,34 @@ const Nt = (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
- ), Yt = (o) => {
1548
- const e = Y((t) => t.theme), n = Y((t) => t.setTheme);
1549
- return /* @__PURE__ */ r(Et, { ...o, value: e, onChange: n });
1550
- }, It = ({
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: m } = o, [f, p] = A(!1), [N, k] = A(!1), [w, h] = A(u), [x, b] = A(i ?? ""), y = M(null), g = M(null);
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);
1560
1592
  O(() => {
1561
1593
  f && (h(u), b(i ?? ""), k(!1));
1562
1594
  }, [f, u, i]), O(() => {
@@ -1567,12 +1599,12 @@ const Nt = (o, e) => {
1567
1599
  return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
1568
1600
  }, [f]);
1569
1601
  const C = (T) => {
1570
- T.preventDefault(), n == null || n({ name: w, role: x }), k(!1);
1571
- }, E = (T) => {
1602
+ T.preventDefault(), o == null || o({ name: w, role: x }), k(!1);
1603
+ }, D = (T) => {
1572
1604
  var v;
1573
1605
  const P = (v = T.target.files) == null ? void 0 : v[0];
1574
1606
  P && (t == null || t(P)), T.target.value = "";
1575
- }, L = (T) => m ? /* @__PURE__ */ r("img", { src: m, alt: u, className: "w-full h-full object-cover" }) : /* @__PURE__ */ r(xe, { size: T, className: "text-muted-foreground" });
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" });
1576
1608
  return /* @__PURE__ */ c("div", { ref: y, className: "relative inline-block text-left", children: [
1577
1609
  /* @__PURE__ */ c(
1578
1610
  "button",
@@ -1611,7 +1643,7 @@ const Nt = (o, e) => {
1611
1643
  {
1612
1644
  type: "file",
1613
1645
  ref: g,
1614
- onChange: E,
1646
+ onChange: D,
1615
1647
  accept: "image/*",
1616
1648
  "aria-label": "Upload avatar",
1617
1649
  className: "hidden"
@@ -1673,13 +1705,13 @@ const Nt = (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",
@@ -1695,14 +1727,14 @@ const Nt = (o, e) => {
1695
1727
  ),
1696
1728
  children: [
1697
1729
  L(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" }) })
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",
@@ -1710,7 +1742,7 @@ const Nt = (o, e) => {
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
  ] }),
@@ -1745,13 +1777,13 @@ const Nt = (o, e) => {
1745
1777
  }
1746
1778
  )
1747
1779
  ] });
1748
- }, qt = (o) => {
1749
- const e = H((d) => d.name), n = H((d) => d.role), t = H((d) => d.email), a = H((d) => d.avatarUrl), s = H((d) => d.customAvatar), l = H((d) => d.updateProfile), u = H((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
- It,
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
1789
  const m = new FileReader();
@@ -1761,14 +1793,14 @@ const Nt = (o, e) => {
1761
1793
  }
1762
1794
  }
1763
1795
  );
1764
- }, Qt = ({ 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
- ] }), Ot = ({ x: o, y: e, items: n, onClose: t, className: a }) => {
1771
- const s = M(null);
1802
+ ] }), Pt = ({ x: n, y: e, items: o, onClose: t, className: a }) => {
1803
+ const s = z(null);
1772
1804
  return O(() => {
1773
1805
  const l = (i) => {
1774
1806
  s.current && !s.current.contains(i.target) && t();
@@ -1783,12 +1815,12 @@ const Nt = (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",
@@ -1815,10 +1847,10 @@ const Nt = (o, e) => {
1815
1847
  ] }, `${l.label}-${u}`))
1816
1848
  }
1817
1849
  );
1818
- }, Xt = ({
1819
- columns: o,
1850
+ }, nr = ({
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,48 +1859,48 @@ const Nt = (o, e) => {
1827
1859
  placeholder: i = "No data available",
1828
1860
  className: d
1829
1861
  }) => {
1830
- const [m, f] = A(""), [p, N] = A(null), [k, w] = A(-1), h = M(null);
1862
+ const [m, f] = A(""), [p, N] = A(null), [k, w] = A(-1), h = z(null);
1831
1863
  O(() => {
1832
1864
  w(-1);
1833
1865
  }, [m, p]);
1834
1866
  const x = j(() => {
1835
1867
  if (!m) return e;
1836
1868
  const v = m.toLowerCase();
1837
- return e.filter((D) => Object.values(D).some((I) => I == null ? !1 : String(I).toLowerCase().includes(v)));
1869
+ return e.filter((E) => Object.values(E).some((I) => I == null ? !1 : String(I).toLowerCase().includes(v)));
1838
1870
  }, [e, m]), b = j(() => {
1839
1871
  if (!p) return x;
1840
- const { key: v, direction: D } = p;
1841
- return [...x].sort((I, $) => {
1842
- const R = I[v], z = $[v];
1843
- if (R === z) return 0;
1844
- if (R == null) return 1;
1845
- if (z == null) return -1;
1846
- const Z = Number(R), ee = Number(z);
1847
- if (!isNaN(Z) && !isNaN(ee))
1848
- return D === "asc" ? Z - ee : ee - Z;
1849
- const de = String(R).toLowerCase(), ce = String(z).toLowerCase();
1850
- return D === "asc" ? de.localeCompare(ce) : ce.localeCompare(de);
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;
1877
+ if (M == null) return -1;
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
- }, [x, p]), y = (v, D) => {
1853
- D !== !1 && N((I) => !I || I.key !== v ? { key: v, direction: "asc" } : I.direction === "asc" ? { key: v, direction: "desc" } : null);
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);
1854
1886
  }, g = (v) => {
1855
1887
  if (!(b.length === 0 || u)) {
1856
1888
  if (v.key === "ArrowDown")
1857
- v.preventDefault(), w((D) => {
1858
- const I = D + 1;
1889
+ v.preventDefault(), w((E) => {
1890
+ const I = E + 1;
1859
1891
  return I >= b.length ? 0 : I;
1860
1892
  });
1861
1893
  else if (v.key === "ArrowUp")
1862
- v.preventDefault(), w((D) => {
1863
- const I = D - 1;
1894
+ v.preventDefault(), w((E) => {
1895
+ const I = E - 1;
1864
1896
  return I < 0 ? b.length - 1 : I;
1865
1897
  });
1866
1898
  else if ((v.key === "Enter" || v.key === " ") && (v.preventDefault(), k >= 0 && k < b.length)) {
1867
- const D = b[k];
1868
- n && n(D);
1899
+ const E = b[k];
1900
+ o && o(E);
1869
1901
  }
1870
1902
  }
1871
- }, C = (v) => v.sortable === !1 ? null : (p == null ? void 0 : p.key) !== v.key ? /* @__PURE__ */ r(Be, { size: 14, className: "text-muted-foreground/60 ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity" }) : p.direction === "asc" ? /* @__PURE__ */ r(we, { size: 14, className: "text-primary ml-1.5" }) : /* @__PURE__ */ r(ke, { size: 14, className: "text-primary ml-1.5" }), E = () => /* @__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",
@@ -1885,25 +1917,25 @@ const Nt = (o, e) => {
1885
1917
  ] })
1886
1918
  },
1887
1919
  v.key
1888
- )) }), L = (v, D) => {
1920
+ )) }), L = (v, E) => {
1889
1921
  const I = t !== void 0 && v[a] === t;
1890
1922
  return /* @__PURE__ */ r(
1891
1923
  "tr",
1892
1924
  {
1893
1925
  role: "row",
1894
1926
  "aria-selected": I,
1895
- onClick: () => n && n(v),
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
1930
  I && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1899
- k === D && "bg-accent/60 ring-1 ring-inset ring-ring"
1931
+ k === E && "bg-accent/60 ring-1 ring-inset ring-ring"
1900
1932
  ),
1901
- children: o.map((R) => {
1902
- const z = v[R.key];
1903
- return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: R.render ? R.render(z, v) : z != null ? String(z) : "" }, R.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
1940
  }, T = j(() => ({
1909
1941
  Table: (v) => /* @__PURE__ */ r(
@@ -1914,53 +1946,53 @@ const Nt = (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, ...I }) => {
1920
- if (!D || !v) return /* @__PURE__ */ r("tr", { ...I });
1921
- const $ = D.selectedRowId !== void 0 && v[D.rowKey] === D.selectedRowId, R = D.focusedIndex === I["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
1957
  ...I,
1926
1958
  onClick: () => {
1927
- var z;
1928
- return (z = D.onRowClick) == null ? void 0 : z.call(D, v);
1959
+ var M;
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
- $ && "bg-primary/10 text-primary hover:bg-primary/15 font-medium border-l-2 border-l-primary",
1933
- R && "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
1970
  }), []), P = () => 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 }),
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
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
- Ge,
1977
+ Ye,
1946
1978
  {
1947
1979
  data: b,
1948
1980
  context: {
1949
1981
  selectedRowId: t,
1950
1982
  focusedIndex: k,
1951
1983
  rowKey: a,
1952
- onRowClick: n
1984
+ onRowClick: o
1953
1985
  },
1954
1986
  components: T,
1955
- fixedHeaderContent: E,
1956
- itemContent: (v, D) => /* @__PURE__ */ r(he, { children: o.map((I) => {
1957
- const $ = D[I.key];
1958
- return /* @__PURE__ */ r("td", { role: "gridcell", className: "p-3 align-middle truncate max-w-xs", children: I.render ? I.render($, D) : $ != null ? String($) : "" }, I.key);
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: E() }),
1963
- /* @__PURE__ */ r("tbody", { children: b.map((v, D) => L(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",
@@ -1977,7 +2009,7 @@ const Nt = (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
  {
@@ -2009,18 +2041,18 @@ const Nt = (o, e) => {
2009
2041
  ]
2010
2042
  }
2011
2043
  );
2012
- }, Zt = ({
2013
- results: o,
2044
+ }, or = ({
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, m] = A(!1), [f, p] = A(0), N = M(null), k = M(null), w = j(() => t || [...new Set(o.map((y) => y.category))], [t, o]), h = j(
2022
- () => w.flatMap((y) => o.filter((g) => g.category === y)),
2023
- [w, 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
2057
  O(() => {
2026
2058
  const y = (g) => {
@@ -2033,9 +2065,9 @@ const Nt = (o, e) => {
2033
2065
  return () => window.clearTimeout(y);
2034
2066
  }, [u, s, e]), O(() => {
2035
2067
  p(0);
2036
- }, [o]);
2068
+ }, [n]);
2037
2069
  const x = (y) => {
2038
- n(y), m(!1), i("");
2070
+ o(y), m(!1), i("");
2039
2071
  }, b = (y) => {
2040
2072
  var g;
2041
2073
  if (!d) {
@@ -2049,7 +2081,7 @@ const Nt = (o, e) => {
2049
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"
@@ -2098,11 +2130,11 @@ const Nt = (o, e) => {
2098
2130
  u,
2099
2131
  '"'
2100
2132
  ] }) : w.map((y) => {
2101
- const g = o.filter((C) => C.category === y);
2133
+ const g = n.filter((C) => C.category === y);
2102
2134
  return g.length === 0 ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
2103
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 }),
2104
2136
  g.map((C) => {
2105
- const E = C.icon, L = h.indexOf(C), T = L === f;
2137
+ const D = C.icon, L = h.indexOf(C), T = L === f;
2106
2138
  return /* @__PURE__ */ c(
2107
2139
  "div",
2108
2140
  {
@@ -2115,14 +2147,14 @@ const Nt = (o, e) => {
2115
2147
  T ? "bg-accent text-accent-foreground border-primary" : "border-transparent hover:bg-accent/40"
2116
2148
  ),
2117
2149
  children: [
2118
- E && /* @__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
2155
  T && "bg-background text-primary"
2124
2156
  ),
2125
- children: /* @__PURE__ */ r(E, { 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: [
@@ -2155,16 +2187,16 @@ const Nt = (o, e) => {
2155
2187
  }
2156
2188
  )
2157
2189
  ] });
2158
- }, er = ({
2159
- placeholder: o = "Search...",
2190
+ }, sr = ({
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, m] = A(!1), [f, p] = A(-1), N = M(null);
2199
+ const [u, i] = A(""), [d, m] = A(!1), [f, p] = A(-1), N = z(null);
2168
2200
  O(() => {
2169
2201
  const h = setTimeout(() => {
2170
2202
  e(u);
@@ -2179,13 +2211,13 @@ const Nt = (o, e) => {
2179
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
2223
  i(h.target.value), m(!0), p(-1);
@@ -2223,7 +2255,7 @@ const Nt = (o, e) => {
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) => {
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) => {
2227
2259
  const x = h.icon;
2228
2260
  return /* @__PURE__ */ r(
2229
2261
  "div",
@@ -2245,14 +2277,14 @@ const Nt = (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), []), At = (o) => {
2249
- if (!o) return ["background"];
2250
- const e = [o.isBranch ? "branch" : "leaf"];
2251
- return o.kind && e.push(o.kind), e;
2252
- }, tr = ({
2253
- 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,
2254
2286
  onToggle: e,
2255
- onActivate: n,
2287
+ onActivate: o,
2256
2288
  onMoveNode: t,
2257
2289
  actions: a = [],
2258
2290
  indent: s = 12,
@@ -2260,10 +2292,10 @@ const Nt = (o, e) => {
2260
2292
  "aria-label": u = "Tree",
2261
2293
  className: i
2262
2294
  }) => {
2263
- const [d, m] = A(null), [f, p] = A(null), N = j(() => De(o), [o]);
2295
+ const [d, m] = A(null), [f, p] = A(null), N = j(() => Ie(n), [n]);
2264
2296
  O(() => {
2265
2297
  p(null);
2266
- }, [o]);
2298
+ }, [n]);
2267
2299
  const k = a.filter(
2268
2300
  (x) => !x.showFor || d && x.showFor.some((b) => d.scopes.includes(b))
2269
2301
  ).map((x) => ({
@@ -2275,7 +2307,7 @@ const Nt = (o, e) => {
2275
2307
  a.length !== 0 && (x.preventDefault(), x.stopPropagation(), m({
2276
2308
  x: x.clientX,
2277
2309
  y: x.clientY,
2278
- scopes: At(b),
2310
+ scopes: $t(b),
2279
2311
  context: { nodeId: (b == null ? void 0 : b.id) ?? null, node: b }
2280
2312
  }));
2281
2313
  }, h = (x) => {
@@ -2301,9 +2333,9 @@ const Nt = (o, e) => {
2301
2333
  C && C !== b.id && y && (t == null || t(C, b.id));
2302
2334
  },
2303
2335
  onClick: () => y && (e == null ? void 0 : e(b)),
2304
- onDoubleClick: () => n == null ? void 0 : n(b),
2336
+ onDoubleClick: () => o == null ? void 0 : o(b),
2305
2337
  onKeyDown: (g) => {
2306
- g.key === "Enter" && (g.preventDefault(), y ? e == null || e(b) : n == null || n(b));
2338
+ g.key === "Enter" && (g.preventDefault(), y ? e == null || e(b) : o == null || o(b));
2307
2339
  },
2308
2340
  onContextMenu: (g) => w(g, b),
2309
2341
  style: { paddingLeft: `${b.level * s + 8}px` },
@@ -2314,7 +2346,7 @@ const Nt = (o, e) => {
2314
2346
  b.className
2315
2347
  ),
2316
2348
  children: [
2317
- /* @__PURE__ */ r("div", { className: "w-4 h-4 mr-1 flex items-center justify-center shrink-0", children: y && (b.isOpen ? /* @__PURE__ */ r(ke, { size: 14 }) : /* @__PURE__ */ r(ye, { size: 14 })) }),
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 })) }),
2318
2350
  b.icon && /* @__PURE__ */ r("div", { className: "mr-2 flex items-center shrink-0", children: b.icon }),
2319
2351
  /* @__PURE__ */ r("span", { className: "truncate", children: b.label })
2320
2352
  ]
@@ -2331,7 +2363,7 @@ const Nt = (o, e) => {
2331
2363
  onContextMenu: (x) => w(x, null),
2332
2364
  children: [
2333
2365
  l ? /* @__PURE__ */ r(
2334
- Ve,
2366
+ qe,
2335
2367
  {
2336
2368
  style: { height: "100%" },
2337
2369
  totalCount: N.length,
@@ -2339,7 +2371,7 @@ const Nt = (o, e) => {
2339
2371
  }
2340
2372
  ) : /* @__PURE__ */ r("div", { className: "h-full overflow-auto", children: N.map((x, b) => h(b)) }),
2341
2373
  d && k.length > 0 && /* @__PURE__ */ r(
2342
- Ot,
2374
+ Pt,
2343
2375
  {
2344
2376
  x: d.x,
2345
2377
  y: d.y,
@@ -2352,54 +2384,57 @@ const Nt = (o, e) => {
2352
2384
  );
2353
2385
  };
2354
2386
  export {
2355
- qe as ActivityBar,
2356
- Qt as AppTitle,
2357
- Ze as ChatPane,
2358
- kt as CommandPalette,
2359
- st as CommandRegistry,
2360
- Qe as ConnectedActivityBar,
2361
- rt as ConnectedChatPane,
2362
- Gt as ConnectedCommandPalette,
2363
- at as ConnectedMenuBar,
2364
- Vt as ConnectedModal,
2365
- dt as ConnectedSidebarPane,
2366
- ut as ConnectedStatusBar,
2367
- pt as ConnectedTerminalPane,
2368
- Yt as ConnectedThemeSwitcher,
2369
- qt as ConnectedUserProfile,
2370
- Ot as ContextMenu,
2371
- Bt as DEFAULT_COMMAND_IDS,
2372
- lt as DEFAULT_SETTINGS_THEMES,
2373
- Dt as DEFAULT_THEME_OPTIONS,
2374
- Xt as DataGrid,
2375
- nt as MenuBar,
2376
- ot as MenuRegistry,
2377
- Tt as Modal,
2378
- _t as NexusWorkspaceShell,
2379
- Zt as QuickSearch,
2380
- er as SearchWidget,
2381
- it as SettingsPanel,
2382
- _t as ShellLayout,
2383
- re as SidebarPane,
2384
- ct as StatusBar,
2385
- mt as TerminalPane,
2386
- Et as ThemeSwitcher,
2387
- tr as TreeWidget,
2388
- It as UserProfile,
2387
+ Xe as ActivityBar,
2388
+ rr as AppTitle,
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,
2396
+ Xt as ConnectedCommandPalette,
2397
+ it as ConnectedMenuBar,
2398
+ Zt as ConnectedModal,
2399
+ pt as ConnectedSidebarPane,
2400
+ ht as ConnectedStatusBar,
2401
+ vt as ConnectedTerminalPane,
2402
+ er as ConnectedThemeSwitcher,
2403
+ tr as ConnectedUserProfile,
2404
+ Pt as ContextMenu,
2405
+ Vt as DEFAULT_COMMAND_IDS,
2406
+ mt as DEFAULT_SETTINGS_THEMES,
2407
+ Lt as DEFAULT_THEME_OPTIONS,
2408
+ nr as DataGrid,
2409
+ st as MenuBar,
2410
+ at as MenuRegistry,
2411
+ At as Modal,
2412
+ Gt as NexusWorkspaceShell,
2413
+ or as QuickSearch,
2414
+ sr as SearchWidget,
2415
+ ft as SettingsPanel,
2416
+ Gt as ShellLayout,
2417
+ ne as SidebarPane,
2418
+ gt as StatusBar,
2419
+ bt as TerminalPane,
2420
+ Mt as ThemeSwitcher,
2421
+ ar as TreeWidget,
2422
+ zt as UserProfile,
2389
2423
  S as cn,
2390
- W as commandRegistry,
2391
- ht as componentRegistry,
2392
- Jt as initializeShell,
2424
+ J as commandRegistry,
2425
+ wt as componentRegistry,
2426
+ Yt as initializeShell,
2393
2427
  le as menuRegistry,
2394
- Ht as pluginRegistry,
2428
+ qt as pluginRegistry,
2429
+ ct as themeClass,
2395
2430
  Q as useChatStore,
2396
- Wt as useKeyboardShortcuts,
2397
- bt as useLayoutStore,
2398
- Te as useModalStore,
2431
+ Qt as useKeyboardShortcuts,
2432
+ Nt as useLayoutStore,
2433
+ Ee as useModalStore,
2399
2434
  ae as useRightSidebarStore,
2400
- F as useSidebarStore,
2435
+ U as useSidebarStore,
2401
2436
  ie as useStatusBarStore,
2402
2437
  V as useTerminalStore,
2403
2438
  Y as useThemeStore,
2404
- H as useUserProfileStore
2439
+ W as useUserProfileStore
2405
2440
  };