@hachej/boring-workspace 0.1.14 → 0.1.17

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.
@@ -177,7 +177,7 @@ function Io(e, t, n) {
177
177
  const o = e.pluginId ?? t.id;
178
178
  switch (e.type) {
179
179
  case "left-tab": {
180
- const m = e, { type: a, id: d, pluginId: i, ...u } = m;
180
+ const f = e, { type: a, id: d, pluginId: i, ...u } = f;
181
181
  n.panels.register(d, {
182
182
  ...u,
183
183
  placement: "left-tab",
@@ -186,8 +186,8 @@ function Io(e, t, n) {
186
186
  return;
187
187
  }
188
188
  case "panel": {
189
- const { id: m, ...a } = e.panel;
190
- n.panels.register(m, {
189
+ const { id: f, ...a } = e.panel;
190
+ n.panels.register(f, {
191
191
  ...a,
192
192
  pluginId: o
193
193
  });
@@ -203,8 +203,8 @@ function Io(e, t, n) {
203
203
  n.catalogs.register(e.catalog, o);
204
204
  return;
205
205
  case "surface-resolver": {
206
- const { id: m, ...a } = e.resolver;
207
- (s = n.surfaceResolvers) == null || s.register(m, {
206
+ const { id: f, ...a } = e.resolver;
207
+ (s = n.surfaceResolvers) == null || s.register(f, {
208
208
  ...a,
209
209
  pluginId: o
210
210
  });
@@ -237,8 +237,8 @@ function Do(e) {
237
237
  }
238
238
  for (const s of n) {
239
239
  for (const c of s.panels ?? []) {
240
- const { id: m, ...a } = c;
241
- e.registries.panels.register(m, {
240
+ const { id: f, ...a } = c;
241
+ e.registries.panels.register(f, {
242
242
  ...a,
243
243
  pluginId: s.id
244
244
  });
@@ -336,21 +336,21 @@ class Mn {
336
336
  }
337
337
  resolve(t) {
338
338
  let n, r = -1 / 0, o = !1, s = -1;
339
- return this.registrationOrder.forEach((c, m) => {
339
+ return this.registrationOrder.forEach((c, f) => {
340
340
  const a = this.resolvers.get(c);
341
341
  let d;
342
342
  try {
343
343
  d = a.resolve(t);
344
- } catch (f) {
344
+ } catch (m) {
345
345
  console.warn(
346
346
  `[SurfaceResolverRegistry] resolver "${c}" failed:`,
347
- f instanceof Error ? f.message : f
347
+ m instanceof Error ? m.message : m
348
348
  );
349
349
  return;
350
350
  }
351
351
  if (!d) return;
352
352
  const i = d.score ?? 0, u = a.source === "app";
353
- (i > r || i === r && u && !o || i === r && u === o && m >= s) && (n = d, r = i, o = u, s = m);
353
+ (i > r || i === r && u && !o || i === r && u === o && f >= s) && (n = d, r = i, o = u, s = f);
354
354
  }), n;
355
355
  }
356
356
  emit() {
@@ -368,14 +368,14 @@ function Fo({
368
368
  }) {
369
369
  const s = A(null), c = A(null);
370
370
  s.current || (s.current = new On()), c.current || (c.current = new Mn());
371
- const m = n ?? s.current, a = r ?? c.current, d = J(
371
+ const f = n ?? s.current, a = r ?? c.current, d = J(
372
372
  () => ({
373
373
  panelRegistry: e,
374
374
  commandRegistry: t,
375
- catalogRegistry: m,
375
+ catalogRegistry: f,
376
376
  surfaceResolverRegistry: a
377
377
  }),
378
- [e, t, m, a]
378
+ [e, t, f, a]
379
379
  );
380
380
  return /* @__PURE__ */ l(Ge.Provider, { value: d, children: o });
381
381
  }
@@ -527,11 +527,11 @@ function Jo(e) {
527
527
  for (const u of [...i])
528
528
  try {
529
529
  u(d);
530
- } catch (f) {
531
- console.error(`[bridge] listener for "${String(a)}" threw:`, f);
530
+ } catch (m) {
531
+ console.error(`[bridge] listener for "${String(a)}" threw:`, m);
532
532
  }
533
533
  }
534
- const m = {
534
+ const f = {
535
535
  getOpenPanels() {
536
536
  return e.getState().panels;
537
537
  },
@@ -547,20 +547,20 @@ function Jo(e) {
547
547
  async openFile(a, d) {
548
548
  const i = qo.safeParse({ path: a, mode: d == null ? void 0 : d.mode });
549
549
  if (!i.success) return s("VALIDATION", i.error.issues[0].message);
550
- const u = e.getState(), f = i.data.mode ?? "edit", p = `file:${a}`;
550
+ const u = e.getState(), m = i.data.mode ?? "edit", p = `file:${a}`;
551
551
  if (u.panels.find((g) => g.id === p)) {
552
552
  const g = u.activePanel;
553
553
  return u.activatePanel(p), u.visibleFiles.includes(a) || u.openFile(a, p), c("panel:activated", { panelId: p, previousPanelId: g }), o();
554
554
  }
555
- return u.panels.length >= Qe ? s("MAX_PANELS", `cannot exceed ${Qe} open panels`) : (u.openFile(a, p), u.openPanel({ id: p, component: "editor", params: { path: a, mode: f } }), c("file:opened", { path: a, mode: f }), c("panel:opened", { panelId: p, params: { path: a, mode: f } }), o());
555
+ return u.panels.length >= Qe ? s("MAX_PANELS", `cannot exceed ${Qe} open panels`) : (u.openFile(a, p), u.openPanel({ id: p, component: "editor", params: { path: a, mode: m } }), c("file:opened", { path: a, mode: m }), c("panel:opened", { panelId: p, params: { path: a, mode: m } }), o());
556
556
  },
557
557
  async openPanel(a) {
558
558
  const d = Vo.safeParse(a);
559
559
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
560
560
  const i = e.getState();
561
- if (i.panels.find((f) => f.id === a.id)) {
562
- const f = i.activePanel;
563
- return i.activatePanel(a.id), c("panel:activated", { panelId: a.id, previousPanelId: f }), o();
561
+ if (i.panels.find((m) => m.id === a.id)) {
562
+ const m = i.activePanel;
563
+ return i.activatePanel(a.id), c("panel:activated", { panelId: a.id, previousPanelId: m }), o();
564
564
  }
565
565
  return i.panels.length >= Qe ? s("MAX_PANELS", `cannot exceed ${Qe} open panels`) : (i.openPanel({
566
566
  id: a.id,
@@ -571,7 +571,7 @@ function Jo(e) {
571
571
  async closePanel(a) {
572
572
  const d = Ko.safeParse({ id: a });
573
573
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
574
- const i = e.getState(), u = i.panels.find((f) => f.id === a);
574
+ const i = e.getState(), u = i.panels.find((m) => m.id === a);
575
575
  return u ? u.essential ? s("ESSENTIAL", `panel ${a} is essential and cannot be closed`) : (i.closePanel(a), c("panel:closed", { panelId: a }), o()) : s("NOT_FOUND", `panel ${a} not found`);
576
576
  },
577
577
  async closeWorkbenchLeftPane() {
@@ -580,13 +580,13 @@ function Jo(e) {
580
580
  async showNotification(a, d = "info") {
581
581
  const i = Ho.safeParse({ msg: a, level: d });
582
582
  if (!i.success) return s("VALIDATION", i.error.issues[0].message);
583
- const u = i.data.level ?? "info", f = u === "warn" ? "warning" : u;
584
- return e.getState().showNotification({ message: i.data.msg, type: f }), c("notification:shown", { message: i.data.msg, level: u }), o();
583
+ const u = i.data.level ?? "info", m = u === "warn" ? "warning" : u;
584
+ return e.getState().showNotification({ message: i.data.msg, type: m }), c("notification:shown", { message: i.data.msg, level: u }), o();
585
585
  },
586
586
  async navigateToLine(a, d) {
587
587
  const i = Go.safeParse({ file: a, line: d });
588
588
  if (!i.success) return s("VALIDATION", i.error.issues[0].message);
589
- const u = await m.openFile(a);
589
+ const u = await f.openFile(a);
590
590
  return u.status === "error" ? u : (e.getState().navigateToLine(a, i.data.line), o());
591
591
  },
592
592
  async expandToFile(a) {
@@ -610,12 +610,12 @@ function Jo(e) {
610
610
  select(a, d) {
611
611
  let i = a(e.getState());
612
612
  return e.subscribe((u) => {
613
- const f = a(u);
614
- Object.is(f, i) || (i = f, d(f));
613
+ const m = a(u);
614
+ Object.is(m, i) || (i = m, d(m));
615
615
  });
616
616
  }
617
617
  };
618
- return m;
618
+ return f;
619
619
  }
620
620
  const Xo = 100, Qo = 3e3;
621
621
  function Qt(e) {
@@ -687,11 +687,11 @@ function es(e) {
687
687
  authToken: o,
688
688
  pollMode: s = !1,
689
689
  pollInterval: c = Qo,
690
- onAuthError: m,
690
+ onAuthError: f,
691
691
  onVersionMismatch: a,
692
692
  onConnectionChange: d
693
693
  } = e;
694
- let i = null, u = null, f = null, p = null, h = !1, g = !1, S = 0;
694
+ let i = null, u = null, m = null, p = null, h = !1, g = !1, S = 0;
695
695
  function I(_) {
696
696
  g || h !== _ && (h = _, d == null || d(_));
697
697
  }
@@ -705,13 +705,13 @@ function es(e) {
705
705
  body: JSON.stringify(M)
706
706
  });
707
707
  if (g) return;
708
- (L.status === 401 || L.status === 403) && (m == null || m(L.status));
708
+ (L.status === 401 || L.status === 403) && (f == null || f(L.status));
709
709
  } catch {
710
710
  }
711
711
  }
712
712
  function w(_) {
713
- f !== null && clearTimeout(f), f = setTimeout(() => {
714
- f = null, D(_);
713
+ m !== null && clearTimeout(m), m = setTimeout(() => {
714
+ m = null, D(_);
715
715
  }, Xo);
716
716
  }
717
717
  function T(_, M) {
@@ -771,7 +771,7 @@ function es(e) {
771
771
  const _ = `${t}/api/v1/ui/commands/next?poll=true`, M = await fetch(_, { headers: Qt(o) });
772
772
  if (g) return;
773
773
  if (M.status === 401 || M.status === 403) {
774
- m == null || m(M.status);
774
+ f == null || f(M.status);
775
775
  return;
776
776
  }
777
777
  if (!M.ok) return;
@@ -807,7 +807,7 @@ function es(e) {
807
807
  g = !1, !s && typeof EventSource < "u" ? j() : (W(), u = setInterval(W, c)), V();
808
808
  },
809
809
  disconnect() {
810
- i && (i.close(), i = null), u !== null && (clearInterval(u), u = null), f !== null && (clearTimeout(f), f = null), p && (p(), p = null), I(!1), g = !0;
810
+ i && (i.close(), i = null), u !== null && (clearInterval(u), u = null), m !== null && (clearTimeout(m), m = null), p && (p(), p = null), I(!1), g = !0;
811
811
  },
812
812
  pushState(_) {
813
813
  D(_);
@@ -899,9 +899,9 @@ function kt(e, t) {
899
899
  params: jn(e.params, "params")
900
900
  }, s = !t.isWorkbenchOpen();
901
901
  s && t.openWorkbench();
902
- const c = (m) => {
902
+ const c = (f) => {
903
903
  try {
904
- m.openPanel(o);
904
+ f.openPanel(o);
905
905
  } catch (a) {
906
906
  console.warn(
907
907
  "[uiCommandDispatcher] openPanel dispatch failed:",
@@ -927,9 +927,9 @@ function os() {
927
927
  function n(o, s) {
928
928
  const c = e.get(o);
929
929
  if (c)
930
- for (const m of [...c])
930
+ for (const f of [...c])
931
931
  try {
932
- m(s);
932
+ f(s);
933
933
  } catch (a) {
934
934
  console.error(`[events] listener for "${String(o)}" threw:`, a);
935
935
  }
@@ -977,8 +977,8 @@ function en(e, t) {
977
977
  return r ? `${e}${e.includes("?") ? "&" : "?"}${r}` : e;
978
978
  }
979
979
  function vs(e) {
980
- const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), s = e.fetcher ?? (typeof fetch < "u" ? fetch : null), c = e.reconnectDelayMs ?? hs, m = e.maxReconnects ?? gs, a = e.pollIntervalMs ?? ps;
981
- let d = !1, i = null, u = null, f = null, p = null, h = 0, g = !1;
980
+ const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), s = e.fetcher ?? (typeof fetch < "u" ? fetch : null), c = e.reconnectDelayMs ?? hs, f = e.maxReconnects ?? gs, a = e.pollIntervalMs ?? ps;
981
+ let d = !1, i = null, u = null, m = null, p = null, h = 0, g = !1;
982
982
  function S(w) {
983
983
  w && typeof w == "object" && typeof w.kind == "string" && kt(w, n);
984
984
  }
@@ -987,10 +987,10 @@ function vs(e) {
987
987
  g = !0;
988
988
  const w = async () => {
989
989
  if (!d) {
990
- f = new AbortController();
990
+ m = new AbortController();
991
991
  try {
992
992
  const T = await s(en(`${t}/api/v1/ui/commands/next?poll=true`, r), {
993
- signal: f.signal
993
+ signal: m.signal
994
994
  });
995
995
  if (d) return;
996
996
  if (T.ok) {
@@ -999,7 +999,7 @@ function vs(e) {
999
999
  }
1000
1000
  } catch {
1001
1001
  } finally {
1002
- f = null;
1002
+ m = null;
1003
1003
  }
1004
1004
  d || (u = setTimeout(w, a));
1005
1005
  }
@@ -1023,7 +1023,7 @@ function vs(e) {
1023
1023
  h = 0;
1024
1024
  }), i.addEventListener("error", () => {
1025
1025
  if (!d) {
1026
- if (i == null || i.close(), i = null, h += 1, h > m) {
1026
+ if (i == null || i.close(), i = null, h += 1, h > f) {
1027
1027
  I();
1028
1028
  return;
1029
1029
  }
@@ -1033,7 +1033,7 @@ function vs(e) {
1033
1033
  }
1034
1034
  }
1035
1035
  return D(), () => {
1036
- d = !0, i && (i.close(), i = null), u && (clearTimeout(u), u = null), f && (f.abort(), f = null), p && (clearTimeout(p), p = null);
1036
+ d = !0, i && (i.close(), i = null), u && (clearTimeout(u), u = null), m && (m.abort(), m = null), p && (clearTimeout(p), p = null);
1037
1037
  };
1038
1038
  }
1039
1039
  const ys = 1e4, bs = 3, ws = 1e3;
@@ -1061,11 +1061,11 @@ class xs {
1061
1061
  async request(t, n, r, o, s) {
1062
1062
  var a, d;
1063
1063
  const c = o ?? this.timeout;
1064
- let m = null;
1064
+ let f = null;
1065
1065
  for (let i = 0; i <= this.maxRetries; i++) {
1066
1066
  i > 0 && await Ss(this.retryBaseMs * 2 ** (i - 1));
1067
- const u = new AbortController(), f = () => u.abort();
1068
- s == null || s.addEventListener("abort", f, { once: !0 });
1067
+ const u = new AbortController(), m = () => u.abort();
1068
+ s == null || s.addEventListener("abort", m, { once: !0 });
1069
1069
  const p = setTimeout(() => u.abort(), c);
1070
1070
  try {
1071
1071
  const h = r != null, g = await fetch(`${this.baseUrl}${n}`, {
@@ -1074,10 +1074,10 @@ class xs {
1074
1074
  body: h ? JSON.stringify(r) : void 0,
1075
1075
  signal: u.signal
1076
1076
  });
1077
- if (clearTimeout(p), s == null || s.removeEventListener("abort", f), g.status === 401 || g.status === 403)
1077
+ if (clearTimeout(p), s == null || s.removeEventListener("abort", m), g.status === 401 || g.status === 403)
1078
1078
  throw (a = this.onAuthError) == null || a.call(this, g.status), new Ie(g.status, `Auth error: ${g.status}`);
1079
1079
  if (tn(g.status)) {
1080
- m = new Ie(g.status, `HTTP ${g.status}: ${g.statusText}`);
1080
+ f = new Ie(g.status, `HTTP ${g.status}: ${g.statusText}`);
1081
1081
  continue;
1082
1082
  }
1083
1083
  if (!g.ok) {
@@ -1090,22 +1090,22 @@ class xs {
1090
1090
  }
1091
1091
  return await g.json();
1092
1092
  } catch (h) {
1093
- if (clearTimeout(p), s == null || s.removeEventListener("abort", f), h instanceof Ie && !tn(h.status))
1093
+ if (clearTimeout(p), s == null || s.removeEventListener("abort", m), h instanceof Ie && !tn(h.status))
1094
1094
  throw h;
1095
1095
  if (h instanceof DOMException && h.name === "AbortError") {
1096
1096
  if (s != null && s.aborted)
1097
1097
  throw h;
1098
- (d = this.onTimeout) == null || d.call(this, n), m = new Ie(0, `Request timeout after ${c}ms: ${n}`);
1098
+ (d = this.onTimeout) == null || d.call(this, n), f = new Ie(0, `Request timeout after ${c}ms: ${n}`);
1099
1099
  continue;
1100
1100
  }
1101
1101
  if (h instanceof TypeError) {
1102
- m = h;
1102
+ f = h;
1103
1103
  continue;
1104
1104
  }
1105
1105
  throw h;
1106
1106
  }
1107
1107
  }
1108
- throw m ?? new Ie(0, "Request failed after retries");
1108
+ throw f ?? new Ie(0, "Request failed after retries");
1109
1109
  }
1110
1110
  async getTree(t, n) {
1111
1111
  return (await this.request(
@@ -1210,14 +1210,14 @@ const Ps = "filesystem:file.changed", Cs = "filesystem:file.created", Es = "file
1210
1210
  function As() {
1211
1211
  const e = Rn(), t = $e(), n = Le();
1212
1212
  F(() => {
1213
- const r = U.on(re.changed, (m) => {
1214
- Be(e, t, n, m.path);
1215
- }), o = U.on(re.created, (m) => {
1216
- ht(e, t, n), m.kind === "file" && Be(e, t, n, m.path);
1217
- }), s = U.on(re.moved, (m) => {
1218
- ht(e, t, n), Be(e, t, n, m.from), Be(e, t, n, m.to), nn(e, t, n);
1219
- }), c = U.on(re.deleted, (m) => {
1220
- ht(e, t, n), Be(e, t, n, m.path), nn(e, t, n);
1213
+ const r = U.on(re.changed, (f) => {
1214
+ Be(e, t, n, f.path);
1215
+ }), o = U.on(re.created, (f) => {
1216
+ ht(e, t, n), f.kind === "file" && Be(e, t, n, f.path);
1217
+ }), s = U.on(re.moved, (f) => {
1218
+ ht(e, t, n), Be(e, t, n, f.from), Be(e, t, n, f.to), nn(e, t, n);
1219
+ }), c = U.on(re.deleted, (f) => {
1220
+ ht(e, t, n), Be(e, t, n, f.path), nn(e, t, n);
1221
1221
  });
1222
1222
  return () => {
1223
1223
  r(), o(), s(), c();
@@ -1239,7 +1239,7 @@ function Is() {
1239
1239
  if (typeof window > "u" || typeof EventSource > "u") return;
1240
1240
  const r = $s(Fs(e, "/api/v1/fs/events"), t);
1241
1241
  let o, s = !1;
1242
- const c = /* @__PURE__ */ new Set(), m = [], a = 256;
1242
+ const c = /* @__PURE__ */ new Set(), f = [], a = 256;
1243
1243
  try {
1244
1244
  o = new EventSource(r, { withCredentials: !0 });
1245
1245
  } catch {
@@ -1247,8 +1247,8 @@ function Is() {
1247
1247
  }
1248
1248
  const d = (p) => {
1249
1249
  if (c.has(p)) return !1;
1250
- if (c.add(p), m.push(p), m.length > a) {
1251
- const h = m.shift();
1250
+ if (c.add(p), f.push(p), f.length > a) {
1251
+ const h = f.shift();
1252
1252
  h !== void 0 && c.delete(h);
1253
1253
  }
1254
1254
  return !0;
@@ -1262,11 +1262,11 @@ function Is() {
1262
1262
  typeof (h == null ? void 0 : h.eventId) != "string" || typeof h.change != "object" || h.change == null || d(h.eventId) && Ds(h.change);
1263
1263
  }, u = () => {
1264
1264
  s = !0, o == null || o.close();
1265
- }, f = () => {
1266
- c.clear(), m.length = 0, n.invalidateQueries({ predicate: (p) => Rs(p.queryKey) });
1265
+ }, m = () => {
1266
+ c.clear(), f.length = 0, n.invalidateQueries({ predicate: (p) => Rs(p.queryKey) });
1267
1267
  };
1268
- return o.addEventListener("change", i), o.addEventListener("unsupported", u), o.addEventListener("resync-required", f), () => {
1269
- o && (o.removeEventListener("change", i), o.removeEventListener("unsupported", u), o.removeEventListener("resync-required", f), s || o.close(), o = null);
1268
+ return o.addEventListener("change", i), o.addEventListener("unsupported", u), o.addEventListener("resync-required", m), () => {
1269
+ o && (o.removeEventListener("change", i), o.removeEventListener("unsupported", u), o.removeEventListener("resync-required", m), s || o.close(), o = null);
1270
1270
  };
1271
1271
  }, [e, t, n]);
1272
1272
  }
@@ -1329,11 +1329,11 @@ function Ls({
1329
1329
  }
1330
1330
  }
1331
1331
  }));
1332
- const m = J(
1332
+ const f = J(
1333
1333
  () => o ?? new xs({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1334
1334
  [o, e, t, n, r]
1335
1335
  ), a = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
1336
- return /* @__PURE__ */ l(So, { client: c.current, children: /* @__PURE__ */ l(Xn.Provider, { value: e, children: /* @__PURE__ */ l(Qn.Provider, { value: a, children: /* @__PURE__ */ b(Jn.Provider, { value: m, children: [
1336
+ return /* @__PURE__ */ l(So, { client: c.current, children: /* @__PURE__ */ l(Xn.Provider, { value: e, children: /* @__PURE__ */ l(Qn.Provider, { value: a, children: /* @__PURE__ */ b(Jn.Provider, { value: f, children: [
1337
1337
  /* @__PURE__ */ l(_s, {}),
1338
1338
  s
1339
1339
  ] }) }) }) });
@@ -1385,8 +1385,8 @@ function tr(e) {
1385
1385
  });
1386
1386
  }
1387
1387
  function zs(e, t) {
1388
- const n = Ce(), r = $e(), o = Le(), [s, c] = R(e), m = A(void 0);
1389
- return F(() => (clearTimeout(m.current), m.current = setTimeout(() => c(e), 300), () => clearTimeout(m.current)), [e]), Rt({
1388
+ const n = Ce(), r = $e(), o = Le(), [s, c] = R(e), f = A(void 0);
1389
+ return F(() => (clearTimeout(f.current), f.current = setTimeout(() => c(e), 300), () => clearTimeout(f.current)), [e]), Rt({
1390
1390
  queryKey: [r, o, "search", s, t],
1391
1391
  queryFn: ({ signal: a }) => n.search(s, t, a),
1392
1392
  enabled: s.length > 0,
@@ -1683,16 +1683,16 @@ function Lc() {
1683
1683
  function Js(e) {
1684
1684
  const { api: t } = e, [n, r] = R(t.title ?? t.id);
1685
1685
  F(() => {
1686
- var f;
1686
+ var m;
1687
1687
  const i = () => r(t.title ?? t.id);
1688
1688
  i();
1689
- const u = (f = t.onDidTitleChange) == null ? void 0 : f.call(t, i);
1689
+ const u = (m = t.onDidTitleChange) == null ? void 0 : m.call(t, i);
1690
1690
  return () => {
1691
1691
  var p;
1692
1692
  return (p = u == null ? void 0 : u.dispose) == null ? void 0 : p.call(u);
1693
1693
  };
1694
1694
  }, [t]);
1695
- const o = n.endsWith(" ●"), s = o ? n.slice(0, -2) : n, c = Gs(s), [m, a] = R(!1);
1695
+ const o = n.endsWith(" ●"), s = o ? n.slice(0, -2) : n, c = Gs(s), [f, a] = R(!1);
1696
1696
  Pt(me.editorSaveStart, (i) => {
1697
1697
  i.panelId === t.id && a(!0);
1698
1698
  }), Pt(me.editorSaveEnd, (i) => {
@@ -1711,7 +1711,7 @@ function Js(e) {
1711
1711
  ),
1712
1712
  title: o ? `${s} (unsaved changes)` : s,
1713
1713
  children: [
1714
- m ? /* @__PURE__ */ l(
1714
+ f ? /* @__PURE__ */ l(
1715
1715
  jr,
1716
1716
  {
1717
1717
  "data-testid": "tab-saving-spinner",
@@ -1821,9 +1821,9 @@ function ei(e) {
1821
1821
  movePanel(n, r) {
1822
1822
  const o = t(), s = o.getPanel(n);
1823
1823
  if (!s) return;
1824
- const c = s.view.contentComponent, m = s.params, a = s.title;
1824
+ const c = s.view.contentComponent, f = s.params, a = s.title;
1825
1825
  o.removePanel(s);
1826
- const d = { id: n, component: c, params: m, title: a };
1826
+ const d = { id: n, component: c, params: f, title: a };
1827
1827
  if ("groupId" in r) {
1828
1828
  const i = o.groups.find((u) => u.id === r.groupId);
1829
1829
  o.addPanel({
@@ -1895,7 +1895,7 @@ function ni(e, t, n, r, o, s) {
1895
1895
  if (u.panel) {
1896
1896
  if (!r.has(u.panel)) {
1897
1897
  console.error(
1898
- `[DockviewShell] Panel "${u.panel}" not found in registry. Available: ${r.list().map((f) => f.id).join(", ")}`
1898
+ `[DockviewShell] Panel "${u.panel}" not found in registry. Available: ${r.list().map((m) => m.id).join(", ")}`
1899
1899
  );
1900
1900
  continue;
1901
1901
  }
@@ -1911,16 +1911,16 @@ function ni(e, t, n, r, o, s) {
1911
1911
  const u = c.getPanel(i.panel ?? i.id);
1912
1912
  u != null && u.group && (i.locked && (u.group.locked = "no-drop-target"), i.hideHeader && (u.group.header.hidden = !0), sn(c, i));
1913
1913
  }
1914
- const m = t.groups.filter(
1914
+ const f = t.groups.filter(
1915
1915
  (i) => {
1916
1916
  var u;
1917
1917
  return typeof ((u = i.constraints) == null ? void 0 : u.maxWidthViewportRatio) == "number";
1918
1918
  }
1919
1919
  );
1920
1920
  let a;
1921
- if (m.length > 0) {
1921
+ if (f.length > 0) {
1922
1922
  const i = () => {
1923
- for (const u of m)
1923
+ for (const u of f)
1924
1924
  sn(c, u);
1925
1925
  };
1926
1926
  window.addEventListener("resize", i), a = () => window.removeEventListener("resize", i);
@@ -1932,11 +1932,11 @@ function ni(e, t, n, r, o, s) {
1932
1932
  i && clearTimeout(i), i = setTimeout(() => {
1933
1933
  o(c.toJSON());
1934
1934
  }, Xs);
1935
- }, f = c.onDidLayoutChange(u), p = () => {
1935
+ }, m = c.onDidLayoutChange(u), p = () => {
1936
1936
  i && (clearTimeout(i), o(c.toJSON()));
1937
1937
  };
1938
1938
  window.addEventListener("beforeunload", p), d = () => {
1939
- p(), f.dispose(), window.removeEventListener("beforeunload", p), a == null || a();
1939
+ p(), m.dispose(), window.removeEventListener("beforeunload", p), a == null || a();
1940
1940
  };
1941
1941
  } else
1942
1942
  d = () => {
@@ -1952,10 +1952,10 @@ function ri({
1952
1952
  allowedPanels: o,
1953
1953
  className: s,
1954
1954
  prefixHeaderActions: c,
1955
- rightHeaderActions: m,
1955
+ rightHeaderActions: f,
1956
1956
  watermarkComponent: a
1957
1957
  }) {
1958
- const d = Ft(), i = Ys(), u = A(null), f = A(null), p = A(void 0), h = J(() => {
1958
+ const d = Ft(), i = Ys(), u = A(null), m = A(null), p = A(void 0), h = J(() => {
1959
1959
  const D = d.getComponents();
1960
1960
  return o ? Object.fromEntries(
1961
1961
  Object.entries(D).filter(([w]) => o.includes(w))
@@ -1999,7 +1999,7 @@ function ri({
1999
1999
  const I = x(
2000
2000
  (D) => {
2001
2001
  if (!i) {
2002
- f.current = D;
2002
+ m.current = D;
2003
2003
  return;
2004
2004
  }
2005
2005
  S(D);
@@ -2007,7 +2007,7 @@ function ri({
2007
2007
  [i, S]
2008
2008
  );
2009
2009
  return F(() => {
2010
- i && f.current && (S(f.current), f.current = null);
2010
+ i && m.current && (S(m.current), m.current = null);
2011
2011
  }, [i, S]), i ? /* @__PURE__ */ l(ir.Provider, { value: g, children: /* @__PURE__ */ l(
2012
2012
  xo,
2013
2013
  {
@@ -2015,7 +2015,7 @@ function ri({
2015
2015
  components: h,
2016
2016
  defaultTabComponent: Js,
2017
2017
  prefixHeaderActionsComponent: c,
2018
- rightHeaderActionsComponent: m,
2018
+ rightHeaderActionsComponent: f,
2019
2019
  watermarkComponent: a,
2020
2020
  onReady: I
2021
2021
  }
@@ -2162,7 +2162,7 @@ async function ui(e) {
2162
2162
  }
2163
2163
  if (!n) throw new Error("Clipboard not available");
2164
2164
  }
2165
- const cr = () => import("./FileTree-Dl-qUAB0.js").then((e) => ({ default: e.FileTree }));
2165
+ const cr = () => import("./FileTree-Dvaud3jU.js").then((e) => ({ default: e.FileTree }));
2166
2166
  function di() {
2167
2167
  cr();
2168
2168
  }
@@ -2175,12 +2175,12 @@ function an({
2175
2175
  className: o
2176
2176
  }) {
2177
2177
  var Kt;
2178
- const s = Ce(), { data: c, error: m, isLoading: a } = tr(e), [d, i] = R(/* @__PURE__ */ new Map()), u = gt(e), f = J(
2178
+ const s = Ce(), { data: c, error: f, isLoading: a } = tr(e), [d, i] = R(/* @__PURE__ */ new Map()), u = gt(e), m = J(
2179
2179
  () => vt(c, d.get(u)),
2180
2180
  [c, d, u]
2181
2181
  ), p = J(
2182
- () => ci(f, r),
2183
- [f, r]
2182
+ () => ci(m, r),
2183
+ [m, r]
2184
2184
  ), { mutateAsync: h } = nr(), { mutateAsync: g } = Bs(), { mutateAsync: S } = Us(), { mutateAsync: I } = qs(), [D, w] = R(/* @__PURE__ */ new Map()), T = J(() => {
2185
2185
  if (d.size === 0) return D;
2186
2186
  const y = new Map(D);
@@ -2418,12 +2418,12 @@ function an({
2418
2418
  ee
2419
2419
  ]), Lr = !Re && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2420
2420
  return /* @__PURE__ */ b("div", { className: "flex h-full min-h-0 flex-col", children: [
2421
- m && /* @__PURE__ */ l(
2421
+ f && /* @__PURE__ */ l(
2422
2422
  We,
2423
2423
  {
2424
2424
  className: "m-2 rounded-md p-3",
2425
2425
  title: "Failed to load files",
2426
- description: m.message
2426
+ description: f.message
2427
2427
  }
2428
2428
  ),
2429
2429
  /* @__PURE__ */ l(
@@ -2537,9 +2537,9 @@ function mi({
2537
2537
  bridge: o,
2538
2538
  api: s,
2539
2539
  chromeless: c = !1,
2540
- className: m
2540
+ className: f
2541
2541
  }) {
2542
- const a = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, i = (e == null ? void 0 : e.chromeless) ?? c, u = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, f = r ?? s, [p, h] = R(""), [g, S] = R(""), I = A(void 0);
2542
+ const a = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, i = (e == null ? void 0 : e.chromeless) ?? c, u = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, m = r ?? s, [p, h] = R(""), [g, S] = R(""), I = A(void 0);
2543
2543
  F(() => (clearTimeout(I.current), I.current = setTimeout(() => S(p), 200), () => clearTimeout(I.current)), [p]);
2544
2544
  const D = u !== void 0 ? u || void 0 : g || void 0;
2545
2545
  return i ? /* @__PURE__ */ l(
@@ -2548,9 +2548,9 @@ function mi({
2548
2548
  rootDir: a,
2549
2549
  searchQuery: D,
2550
2550
  bridge: d,
2551
- className: ie("px-1 pt-1 [&_[role=treeitem]]:!indent-0", m)
2551
+ className: ie("px-1 pt-1 [&_[role=treeitem]]:!indent-0", f)
2552
2552
  }
2553
- ) : /* @__PURE__ */ l(ii, { title: "Files", panelApi: f, children: /* @__PURE__ */ b("div", { className: "flex h-full flex-col", children: [
2553
+ ) : /* @__PURE__ */ l(ii, { title: "Files", panelApi: m, children: /* @__PURE__ */ b("div", { className: "flex h-full flex-col", children: [
2554
2554
  /* @__PURE__ */ l("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ l(
2555
2555
  In,
2556
2556
  {
@@ -2567,7 +2567,7 @@ function mi({
2567
2567
  rootDir: a,
2568
2568
  searchQuery: D,
2569
2569
  bridge: d,
2570
- className: m
2570
+ className: f
2571
2571
  }
2572
2572
  ) })
2573
2573
  ] }) });
@@ -2659,7 +2659,7 @@ function wi() {
2659
2659
  }
2660
2660
  const Si = 250, xi = 3e3, ki = 3e4;
2661
2661
  function Pi(e, t) {
2662
- const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: s } = t, [c, m] = R(!1), [a, d] = R(!1), [i, u] = R(null), [f, p] = R(!1), [h, g] = R(!1), S = A(void 0), I = A(null), D = A(0), w = A(null), T = A(o);
2662
+ const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: s } = t, [c, f] = R(!1), [a, d] = R(!1), [i, u] = R(null), [m, p] = R(!1), [h, g] = R(!1), S = A(void 0), I = A(null), D = A(0), w = A(null), T = A(o);
2663
2663
  T.current = o;
2664
2664
  const j = A(n);
2665
2665
  j.current = n;
@@ -2678,7 +2678,7 @@ function Pi(e, t) {
2678
2678
  await Promise.race([
2679
2679
  K.save().then(() => "saved"),
2680
2680
  ae
2681
- ]) === "saved" && (D.current = Date.now(), u(Date.now()), m(!1), (ve = T.current) == null || ve.call(T, e, !1));
2681
+ ]) === "saved" && (D.current = Date.now(), u(Date.now()), f(!1), (ve = T.current) == null || ve.call(T, e, !1));
2682
2682
  } catch {
2683
2683
  } finally {
2684
2684
  Z && clearTimeout(Z), U.emit(me.editorSaveEnd, { panelId: r }), d(!1), I.current = null;
@@ -2689,7 +2689,7 @@ function Pi(e, t) {
2689
2689
  clearTimeout(S.current), S.current = setTimeout(W, Si);
2690
2690
  }, [W]), O = x(() => {
2691
2691
  var K;
2692
- e && (m(!0), (K = T.current) == null || K.call(T, e, !0), V());
2692
+ e && (f(!0), (K = T.current) == null || K.call(T, e, !0), V());
2693
2693
  }, [e, V]), _ = x(async () => {
2694
2694
  var K;
2695
2695
  if (clearTimeout(S.current), I.current) return I.current;
@@ -2718,7 +2718,7 @@ function Pi(e, t) {
2718
2718
  lastSavedAt: i,
2719
2719
  markDirty: O,
2720
2720
  flushSave: _,
2721
- shouldSync: f,
2721
+ shouldSync: m,
2722
2722
  ackSync: M,
2723
2723
  externalChangeWhileDirty: h,
2724
2724
  ackExternalChange: L,
@@ -2756,9 +2756,9 @@ function Mc(e) {
2756
2756
  return n.push(r[e.key] ?? e.key.toUpperCase()), n.join(t ? "" : "+");
2757
2757
  }
2758
2758
  function ur(e) {
2759
- const { path: t, panelId: n = t, initialContent: r = null } = e, { data: o, isLoading: s, error: c } = js(t), { mutateAsync: m } = nr(), [a, d] = R(r), i = A(""), u = A(!1), f = A(null), p = A(null), h = A(null), g = A(0), [S, I] = R(null);
2759
+ const { path: t, panelId: n = t, initialContent: r = null } = e, { data: o, isLoading: s, error: c } = js(t), { mutateAsync: f } = nr(), [a, d] = R(r), i = A(""), u = A(!1), m = A(null), p = A(null), h = A(null), g = A(0), [S, I] = R(null);
2760
2760
  F(() => {
2761
- f.current !== t && (d(r), i.current = r ?? "", u.current = !1, p.current = null, I(null), f.current = t);
2761
+ m.current !== t && (d(r), i.current = r ?? "", u.current = !1, p.current = null, I(null), m.current = t);
2762
2762
  }, [t, r]), F(() => {
2763
2763
  (o == null ? void 0 : o.content) != null && a === null && (d(o.content), i.current = o.content, p.current = o.mtimeMs ?? null);
2764
2764
  }, [o, a]);
@@ -2768,7 +2768,7 @@ function ur(e) {
2768
2768
  var K;
2769
2769
  const E = ++g.current;
2770
2770
  try {
2771
- const H = await m({
2771
+ const H = await f({
2772
2772
  path: t,
2773
2773
  content: i.current,
2774
2774
  expectedMtimeMs: p.current ?? void 0
@@ -2810,12 +2810,12 @@ function ur(e) {
2810
2810
  var K;
2811
2811
  const E = ++g.current;
2812
2812
  try {
2813
- const H = i.current, Z = await m({ path: t, content: H });
2813
+ const H = i.current, Z = await f({ path: t, content: H });
2814
2814
  if (g.current !== E) return;
2815
2815
  typeof Z.mtimeMs == "number" && (p.current = Z.mtimeMs, (K = h.current) == null || K.call(h, Z.mtimeMs)), u.current = !1, I(null);
2816
2816
  } catch {
2817
2817
  }
2818
- }, [t, m]), M = x(async () => {
2818
+ }, [t, f]), M = x(async () => {
2819
2819
  !D || !u.current || await D.save();
2820
2820
  }, [D]), L = x(async () => {
2821
2821
  await w.flushSave();
@@ -2868,12 +2868,12 @@ function dr({
2868
2868
  conflict: o,
2869
2869
  onChange: s,
2870
2870
  onReload: c,
2871
- onOverwrite: m,
2871
+ onOverwrite: f,
2872
2872
  editorComponent: a,
2873
2873
  editorProps: d = {},
2874
2874
  loadingFallback: i,
2875
2875
  errorMessage: u,
2876
- className: f
2876
+ className: m
2877
2877
  }) {
2878
2878
  if (!e)
2879
2879
  return /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(Dn, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
@@ -2883,13 +2883,13 @@ function dr({
2883
2883
  /* @__PURE__ */ l(lt, { className: "size-3.5" }),
2884
2884
  /* @__PURE__ */ l("span", { children: "Loading file..." })
2885
2885
  ] });
2886
- return /* @__PURE__ */ b("div", { className: `flex h-full min-h-0 flex-col ${f ?? ""}`, children: [
2886
+ return /* @__PURE__ */ b("div", { className: `flex h-full min-h-0 flex-col ${m ?? ""}`, children: [
2887
2887
  o && /* @__PURE__ */ l(
2888
2888
  Ti,
2889
2889
  {
2890
2890
  conflict: o,
2891
2891
  onReload: c,
2892
- onOverwrite: m
2892
+ onOverwrite: f
2893
2893
  }
2894
2894
  ),
2895
2895
  /* @__PURE__ */ l(at, { fallback: p, children: n || t === null ? p : /* @__PURE__ */ l(
@@ -2936,14 +2936,14 @@ function cn({ params: e, api: t, className: n }) {
2936
2936
  content: o,
2937
2937
  isLoading: s,
2938
2938
  error: c,
2939
- conflict: m,
2939
+ conflict: f,
2940
2940
  setContent: a,
2941
2941
  onReloadFromServer: d,
2942
2942
  onOverwrite: i,
2943
2943
  tabTitle: u
2944
2944
  } = ur({ path: r, panelId: t == null ? void 0 : t.id });
2945
2945
  t && u && t.setTitle(u);
2946
- const f = Ai(r);
2946
+ const m = Ai(r);
2947
2947
  return /* @__PURE__ */ l(
2948
2948
  dr,
2949
2949
  {
@@ -2951,24 +2951,24 @@ function cn({ params: e, api: t, className: n }) {
2951
2951
  content: o,
2952
2952
  isLoading: s,
2953
2953
  error: c,
2954
- conflict: m,
2954
+ conflict: f,
2955
2955
  onChange: a,
2956
2956
  onReload: d,
2957
2957
  onOverwrite: i,
2958
2958
  editorComponent: Ni,
2959
- editorProps: { language: f, wordWrap: !0, className: n }
2959
+ editorProps: { language: m, wordWrap: !0, className: n }
2960
2960
  }
2961
2961
  );
2962
2962
  }
2963
2963
  const Ii = He(
2964
- () => import("./MarkdownEditor-yc6mFsnI.js").then((e) => ({ default: e.MarkdownEditor }))
2964
+ () => import("./MarkdownEditor-sLkqTXDj.js").then((e) => ({ default: e.MarkdownEditor }))
2965
2965
  );
2966
2966
  function Di({ params: e, api: t, className: n }) {
2967
2967
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
2968
2968
  content: o,
2969
2969
  isLoading: s,
2970
2970
  error: c,
2971
- conflict: m,
2971
+ conflict: f,
2972
2972
  setContent: a,
2973
2973
  onReloadFromServer: d,
2974
2974
  onOverwrite: i,
@@ -2981,7 +2981,7 @@ function Di({ params: e, api: t, className: n }) {
2981
2981
  content: o,
2982
2982
  isLoading: s,
2983
2983
  error: c,
2984
- conflict: m,
2984
+ conflict: f,
2985
2985
  onChange: a,
2986
2986
  onReload: d,
2987
2987
  onOverwrite: i,
@@ -2997,34 +2997,34 @@ function Ze(e) {
2997
2997
  return e.split("/").pop() ?? e;
2998
2998
  }
2999
2999
  function Fi({ path: e, kind: t, className: n }) {
3000
- const r = $e(), o = Le(), [s, c] = R(null), [m, a] = R(null), [d, i] = R(!0), u = J(
3000
+ const r = $e(), o = Le(), [s, c] = R(null), [f, a] = R(null), [d, i] = R(!0), u = J(
3001
3001
  () => Ri(r, `/api/v1/files/raw?path=${encodeURIComponent(e)}`),
3002
3002
  [r, e]
3003
3003
  );
3004
3004
  return F(() => {
3005
- const f = new AbortController();
3005
+ const m = new AbortController();
3006
3006
  let p = null;
3007
3007
  i(!0), a(null), c(null);
3008
3008
  const h = {};
3009
3009
  return o && (h["x-boring-workspace-id"] = o), fetch(u, {
3010
3010
  credentials: "include",
3011
3011
  headers: h,
3012
- signal: f.signal
3012
+ signal: m.signal
3013
3013
  }).then(async (g) => {
3014
3014
  if (!g.ok) throw new Error(`HTTP ${g.status}`);
3015
3015
  const S = await g.blob();
3016
3016
  p = URL.createObjectURL(S), c(p);
3017
3017
  }).catch((g) => {
3018
- f.signal.aborted || a(g instanceof Error ? g.message : "Failed to load preview");
3018
+ m.signal.aborted || a(g instanceof Error ? g.message : "Failed to load preview");
3019
3019
  }).finally(() => {
3020
- f.signal.aborted || i(!1);
3020
+ m.signal.aborted || i(!1);
3021
3021
  }), () => {
3022
- f.abort(), p && URL.revokeObjectURL(p);
3022
+ m.abort(), p && URL.revokeObjectURL(p);
3023
3023
  };
3024
3024
  }, [u, o]), e ? d ? /* @__PURE__ */ b("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3025
3025
  /* @__PURE__ */ l(lt, { className: "size-3.5" }),
3026
3026
  /* @__PURE__ */ l("span", { children: "Loading preview..." })
3027
- ] }) : m || !s ? /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(We, { title: "Failed to load preview", description: m ?? "Preview unavailable." }) }) : /* @__PURE__ */ b("div", { className: ie("flex h-full min-h-0 flex-col bg-background", n), children: [
3027
+ ] }) : f || !s ? /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(We, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) }) : /* @__PURE__ */ b("div", { className: ie("flex h-full min-h-0 flex-col bg-background", n), children: [
3028
3028
  /* @__PURE__ */ b("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3029
3029
  /* @__PURE__ */ l("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: Ze(e) }),
3030
3030
  /* @__PURE__ */ l(
@@ -3095,25 +3095,26 @@ function mr(e, t) {
3095
3095
  }
3096
3096
  return s.join("/");
3097
3097
  }
3098
- function jt(e, t) {
3099
- return Li(e, `/api/v1/files/raw?path=${encodeURIComponent(t)}`);
3098
+ function jt(e, t, n) {
3099
+ const r = new URLSearchParams({ path: t });
3100
+ return n && r.set("workspaceId", n), Li(e, `/api/v1/files/raw?${r.toString()}`);
3100
3101
  }
3101
- function Ke(e, t, n) {
3102
- const r = mr(t, n);
3103
- if (!r) return n;
3104
- const { suffix: o } = fr(n.trim()), s = o.indexOf("#"), c = s === -1 ? "" : o.slice(s);
3105
- return `${jt(e, r)}${c}`;
3102
+ function Ke(e, t, n, r) {
3103
+ const o = mr(t, n);
3104
+ if (!o) return n;
3105
+ const { suffix: s } = fr(n.trim()), c = s.indexOf("#"), f = c === -1 ? "" : s.slice(c);
3106
+ return `${jt(e, o, r)}${f}`;
3106
3107
  }
3107
- function yt(e, t, n) {
3108
- return e.replace(/url\(\s*(["']?)([^"')]+)\1\s*\)/gi, (r, o, s) => `url(${o}${Ke(n, t, s)}${o})`).replace(/@import\s+(url\(\s*)?(["'])([^"']+)\2\s*\)?/gi, (r, o, s, c) => {
3109
- const m = Ke(n, t, c);
3110
- return o ? `@import ${o}${s}${m}${s})` : r.replace(`${s}${c}${s}`, `${s}${m}${s}`);
3108
+ function yt(e, t, n, r) {
3109
+ return e.replace(/url\(\s*(["']?)([^"')]+)\1\s*\)/gi, (o, s, c) => `url(${s}${Ke(n, t, c, r)}${s})`).replace(/@import\s+(url\(\s*)?(["'])([^"']+)\2\s*\)?/gi, (o, s, c, f) => {
3110
+ const a = Ke(n, t, f, r);
3111
+ return s ? `@import ${s}${c}${a}${c})` : o.replace(`${c}${f}${c}`, `${c}${a}${c}`);
3111
3112
  });
3112
3113
  }
3113
- function Mi(e, t, n) {
3114
- return e.split(",").map((r) => {
3115
- const o = r.trim(), [s, ...c] = o.split(/\s+/);
3116
- return s ? [Ke(n, t, s), ...c].join(" ") : r;
3114
+ function Mi(e, t, n, r) {
3115
+ return e.split(",").map((o) => {
3116
+ const s = o.trim(), [c, ...f] = s.split(/\s+/);
3117
+ return c ? [Ke(n, t, c, r), ...f].join(" ") : o;
3117
3118
  }).join(", ");
3118
3119
  }
3119
3120
  async function pr(e, t, n) {
@@ -3126,28 +3127,28 @@ async function pr(e, t, n) {
3126
3127
  return r.text();
3127
3128
  }
3128
3129
  async function Wi(e) {
3129
- const { html: t, path: n, apiBaseUrl: r, headers: o, signal: s } = e, c = new DOMParser().parseFromString(t, "text/html");
3130
+ const { html: t, path: n, apiBaseUrl: r, headers: o, workspaceRequestId: s, signal: c } = e, f = new DOMParser().parseFromString(t, "text/html");
3130
3131
  await Promise.all(
3131
- Array.from(c.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (a) => {
3132
- const d = a.getAttribute("href");
3133
- if (!d) return;
3134
- const i = mr(n, d);
3135
- if (i)
3132
+ Array.from(f.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (d) => {
3133
+ const i = d.getAttribute("href");
3134
+ if (!i) return;
3135
+ const u = mr(n, i);
3136
+ if (u)
3136
3137
  try {
3137
- const u = await pr(jt(r, i), o, s), f = c.createElement("style");
3138
- f.setAttribute("data-boring-html-viewer-href", d), f.textContent = yt(u, i, r), a.replaceWith(f);
3138
+ const m = await pr(jt(r, u, s), o, c), p = f.createElement("style");
3139
+ p.setAttribute("data-boring-html-viewer-href", i), p.textContent = yt(m, u, r, s), d.replaceWith(p);
3139
3140
  } catch {
3140
- a.setAttribute("href", Ke(r, n, d));
3141
+ d.setAttribute("href", Ke(r, n, i, s));
3141
3142
  }
3142
3143
  })
3143
3144
  );
3144
- for (const a of Array.from(c.querySelectorAll("style")))
3145
- a.hasAttribute("data-boring-html-viewer-href") || (a.textContent = yt(a.textContent ?? "", n, r));
3146
- for (const a of Array.from(c.querySelectorAll("[style]"))) {
3147
- const d = a.getAttribute("style");
3148
- d && a.setAttribute("style", yt(d, n, r));
3145
+ for (const d of Array.from(f.querySelectorAll("style")))
3146
+ d.hasAttribute("data-boring-html-viewer-href") || (d.textContent = yt(d.textContent ?? "", n, r, s));
3147
+ for (const d of Array.from(f.querySelectorAll("[style]"))) {
3148
+ const i = d.getAttribute("style");
3149
+ i && d.setAttribute("style", yt(i, n, r, s));
3149
3150
  }
3150
- const m = [
3151
+ const a = [
3151
3152
  ["img", "src"],
3152
3153
  ["source", "src"],
3153
3154
  ["video", "src"],
@@ -3159,37 +3160,38 @@ async function Wi(e) {
3159
3160
  ["embed", "src"],
3160
3161
  ["link", "href"]
3161
3162
  ];
3162
- for (const [a, d] of m)
3163
- for (const i of Array.from(c.querySelectorAll(`${a}[${d}]`))) {
3164
- const u = i.getAttribute(d);
3165
- u && i.setAttribute(d, Ke(r, n, u));
3163
+ for (const [d, i] of a)
3164
+ for (const u of Array.from(f.querySelectorAll(`${d}[${i}]`))) {
3165
+ const m = u.getAttribute(i);
3166
+ m && u.setAttribute(i, Ke(r, n, m, s));
3166
3167
  }
3167
- for (const a of Array.from(c.querySelectorAll("[srcset]"))) {
3168
- const d = a.getAttribute("srcset");
3169
- d && a.setAttribute("srcset", Mi(d, n, r));
3168
+ for (const d of Array.from(f.querySelectorAll("[srcset]"))) {
3169
+ const i = d.getAttribute("srcset");
3170
+ i && d.setAttribute("srcset", Mi(i, n, r, s));
3170
3171
  }
3171
3172
  return `<!doctype html>
3172
- ${c.documentElement.outerHTML}`;
3173
+ ${f.documentElement.outerHTML}`;
3173
3174
  }
3174
3175
  function ji({ path: e, className: t }) {
3175
- const n = $e(), r = Le(), [o, s] = R(null), [c, m] = R(null), [a, d] = R(!0), i = J(
3176
- () => jt(n, e),
3177
- [n, e]
3176
+ const n = $e(), r = Le(), [o, s] = R(null), [c, f] = R(null), [a, d] = R(!0), i = J(
3177
+ () => jt(n, e, r),
3178
+ [n, e, r]
3178
3179
  );
3179
3180
  return F(() => {
3180
3181
  const u = new AbortController();
3181
- d(!0), m(null), s(null);
3182
- const f = {};
3183
- return r && (f["x-boring-workspace-id"] = r), pr(i, f, u.signal).then(async (p) => {
3182
+ d(!0), f(null), s(null);
3183
+ const m = {};
3184
+ return r && (m["x-boring-workspace-id"] = r), pr(i, m, u.signal).then(async (p) => {
3184
3185
  s(await Wi({
3185
3186
  html: p,
3186
3187
  path: e,
3187
3188
  apiBaseUrl: n,
3188
- headers: f,
3189
+ headers: m,
3190
+ workspaceRequestId: r,
3189
3191
  signal: u.signal
3190
3192
  }));
3191
3193
  }).catch((p) => {
3192
- u.signal.aborted || m(p instanceof Error ? p.message : "Failed to load HTML preview");
3194
+ u.signal.aborted || f(p instanceof Error ? p.message : "Failed to load HTML preview");
3193
3195
  }).finally(() => {
3194
3196
  u.signal.aborted || d(!1);
3195
3197
  }), () => u.abort();
@@ -3642,23 +3644,23 @@ function vr(e = {}) {
3642
3644
  activePanel: i.id
3643
3645
  })),
3644
3646
  closePanel: (i) => a((u) => ({
3645
- panels: u.panels.filter((f) => f.id !== i),
3647
+ panels: u.panels.filter((m) => m.id !== i),
3646
3648
  activePanel: u.activePanel === i ? null : u.activePanel
3647
3649
  })),
3648
3650
  activatePanel: (i) => a({ activePanel: i }),
3649
- openFile: (i, u) => a((f) => ({
3651
+ openFile: (i, u) => a((m) => ({
3650
3652
  activeFile: i,
3651
- visibleFiles: f.visibleFiles.includes(i) ? f.visibleFiles : [...f.visibleFiles, i],
3652
- activePanel: u ?? f.activePanel
3653
+ visibleFiles: m.visibleFiles.includes(i) ? m.visibleFiles : [...m.visibleFiles, i],
3654
+ activePanel: u ?? m.activePanel
3653
3655
  })),
3654
- markDirty: (i, u) => a((f) => ({
3656
+ markDirty: (i, u) => a((m) => ({
3655
3657
  dirtyFiles: {
3656
- ...f.dirtyFiles,
3658
+ ...m.dirtyFiles,
3657
3659
  [i]: { panelId: u, savedAt: null }
3658
3660
  }
3659
3661
  })),
3660
3662
  markClean: (i) => a((u) => {
3661
- const { [i]: f, ...p } = u.dirtyFiles;
3663
+ const { [i]: m, ...p } = u.dirtyFiles;
3662
3664
  return { dirtyFiles: p };
3663
3665
  }),
3664
3666
  showNotification: (i) => a((u) => ({
@@ -3672,7 +3674,7 @@ function vr(e = {}) {
3672
3674
  ]
3673
3675
  })),
3674
3676
  dismissNotification: (i) => a((u) => ({
3675
- notifications: u.notifications.filter((f) => f.id !== i)
3677
+ notifications: u.notifications.filter((m) => m.id !== i)
3676
3678
  })),
3677
3679
  navigateToLine: (i, u) => a({ activeFile: i }),
3678
3680
  resetLayout: () => {
@@ -3747,9 +3749,9 @@ function ya() {
3747
3749
  }
3748
3750
  function ba({ children: e }) {
3749
3751
  const [t, n] = R([]), r = x((c) => {
3750
- n((m) => [...m.filter((a) => a.id !== c.id), c]);
3752
+ n((f) => [...f.filter((a) => a.id !== c.id), c]);
3751
3753
  }, []), o = x((c) => {
3752
- n((m) => m.filter((a) => a.id !== c));
3754
+ n((f) => f.filter((a) => a.id !== c));
3753
3755
  }, []), s = J(
3754
3756
  () => ({ blockers: t, addBlocker: r, removeBlocker: o }),
3755
3757
  [t, r, o]
@@ -3770,7 +3772,7 @@ function xa(e) {
3770
3772
  isWorkbenchOpen: o,
3771
3773
  openWorkbench: s,
3772
3774
  closeWorkbench: c,
3773
- bridgeEndpoint: m,
3775
+ bridgeEndpoint: f,
3774
3776
  ...a
3775
3777
  } = e, d = x(
3776
3778
  (g) => {
@@ -3783,9 +3785,9 @@ function xa(e) {
3783
3785
  [r, o, s, c, e.onOpenArtifact]
3784
3786
  ), i = wa(a.requestHeaders), u = n.filter((g) => !g.sessionId || g.sessionId === a.sessionId);
3785
3787
  F(() => {
3786
- if (!(m === null || !r || !o || !s))
3788
+ if (!(f === null || !r || !o || !s))
3787
3789
  return vs({
3788
- endpoint: Sa(m),
3790
+ endpoint: Sa(f),
3789
3791
  query: i ? { workspaceId: i } : void 0,
3790
3792
  ctx: {
3791
3793
  surface: r,
@@ -3794,8 +3796,8 @@ function xa(e) {
3794
3796
  closeWorkbench: c
3795
3797
  }
3796
3798
  });
3797
- }, [m, r, o, s, c, i]);
3798
- const f = x(() => {
3799
+ }, [f, r, o, s, c, i]);
3800
+ const m = x(() => {
3799
3801
  var g;
3800
3802
  window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: a.sessionId } })), (g = e.onComposerStop) == null || g.call(e);
3801
3803
  }, [a.sessionId, e.onComposerStop]), p = x(
@@ -3825,7 +3827,7 @@ function xa(e) {
3825
3827
  onOpenArtifact: d,
3826
3828
  onData: h,
3827
3829
  composerBlockers: u,
3828
- onComposerStop: f,
3830
+ onComposerStop: m,
3829
3831
  onComposerBlockerAction: p
3830
3832
  }
3831
3833
  );
@@ -3852,22 +3854,22 @@ function wn(e) {
3852
3854
  return t.setHours(0, 0, 0, 0), t.getTime();
3853
3855
  }
3854
3856
  function Ca(e) {
3855
- const n = wn(/* @__PURE__ */ new Date()), r = n - bn, o = n - 7 * bn, s = [], c = [], m = [], a = [], d = [];
3856
- for (const f of e) {
3857
- const p = ot(f.updatedAt);
3857
+ const n = wn(/* @__PURE__ */ new Date()), r = n - bn, o = n - 7 * bn, s = [], c = [], f = [], a = [], d = [];
3858
+ for (const m of e) {
3859
+ const p = ot(m.updatedAt);
3858
3860
  if (!p) {
3859
- d.push(f);
3861
+ d.push(m);
3860
3862
  continue;
3861
3863
  }
3862
3864
  const h = wn(p);
3863
- h >= n ? s.push(f) : h >= r ? c.push(f) : h >= o ? m.push(f) : a.push(f);
3865
+ h >= n ? s.push(m) : h >= r ? c.push(m) : h >= o ? f.push(m) : a.push(m);
3864
3866
  }
3865
- const i = (f, p) => {
3867
+ const i = (m, p) => {
3866
3868
  var S, I;
3867
- const h = ((S = ot(f.updatedAt)) == null ? void 0 : S.getTime()) ?? 0;
3869
+ const h = ((S = ot(m.updatedAt)) == null ? void 0 : S.getTime()) ?? 0;
3868
3870
  return (((I = ot(p.updatedAt)) == null ? void 0 : I.getTime()) ?? 0) - h;
3869
3871
  }, u = [];
3870
- return s.length && u.push({ key: "today", label: "Today", items: s.sort(i) }), c.length && u.push({ key: "yesterday", label: "Yesterday", items: c.sort(i) }), m.length && u.push({ key: "week", label: "This week", items: m.sort(i) }), a.length && u.push({ key: "earlier", label: "Earlier", items: a.sort(i) }), d.length && u.push({ key: "undated", label: "Other", items: d }), u;
3872
+ return s.length && u.push({ key: "today", label: "Today", items: s.sort(i) }), c.length && u.push({ key: "yesterday", label: "Yesterday", items: c.sort(i) }), f.length && u.push({ key: "week", label: "This week", items: f.sort(i) }), a.length && u.push({ key: "earlier", label: "Earlier", items: a.sort(i) }), d.length && u.push({ key: "undated", label: "Other", items: d }), u;
3871
3873
  }
3872
3874
  function Ea(e) {
3873
3875
  const t = ot(e);
@@ -3882,8 +3884,8 @@ function Ea(e) {
3882
3884
  if (s < 7) return `${s}d`;
3883
3885
  const c = Math.floor(s / 7);
3884
3886
  if (c < 5) return `${c}w`;
3885
- const m = Math.floor(s / 30);
3886
- return m < 12 ? `${m}mo` : `${Math.floor(s / 365)}y`;
3887
+ const f = Math.floor(s / 30);
3888
+ return f < 12 ? `${f}mo` : `${Math.floor(s / 365)}y`;
3887
3889
  }
3888
3890
  function Ta({
3889
3891
  sessions: e,
@@ -3894,7 +3896,7 @@ function Ta({
3894
3896
  onClose: s,
3895
3897
  className: c
3896
3898
  }) {
3897
- const m = J(() => Ca(e), [e]);
3899
+ const f = J(() => Ca(e), [e]);
3898
3900
  return /* @__PURE__ */ b(
3899
3901
  "div",
3900
3902
  {
@@ -3923,7 +3925,7 @@ function Ta({
3923
3925
  /* @__PURE__ */ l("br", {}),
3924
3926
  "Start a new chat to begin."
3925
3927
  ] }),
3926
- m.map((a, d) => /* @__PURE__ */ b("section", { className: ie(d > 0 && "mt-2"), children: [
3928
+ f.map((a, d) => /* @__PURE__ */ b("section", { className: ie(d > 0 && "mt-2"), children: [
3927
3929
  /* @__PURE__ */ l("div", { className: "px-4 pb-1 pt-2 text-[10.5px] font-medium uppercase tracking-[0.14em] text-muted-foreground/70", children: a.label }),
3928
3930
  /* @__PURE__ */ l("ul", { role: "list", className: "flex flex-col", children: a.items.map((i) => /* @__PURE__ */ l(
3929
3931
  Na,
@@ -4015,12 +4017,12 @@ function br({
4015
4017
  s.subscribe,
4016
4018
  s.getSnapshot,
4017
4019
  s.getSnapshot
4018
- ), m = J(
4020
+ ), f = J(
4019
4021
  () => c.filter((E) => E.placement === "left-tab"),
4020
4022
  [c]
4021
4023
  ), a = J(() => {
4022
4024
  const E = [];
4023
- for (const K of m) {
4025
+ for (const K of f) {
4024
4026
  const H = K.icon;
4025
4027
  E.push({
4026
4028
  id: K.id,
@@ -4030,11 +4032,11 @@ function br({
4030
4032
  });
4031
4033
  }
4032
4034
  return E;
4033
- }, [m]), [d, i] = R(n ?? ""), u = a.some((E) => E.id === d) ? d : ((M = a[0]) == null ? void 0 : M.id) ?? "", [f, p] = R(!1), [h, g] = R(""), [S, I] = R(""), D = A(null), w = A(void 0);
4035
+ }, [f]), [d, i] = R(n ?? ""), u = a.some((E) => E.id === d) ? d : ((M = a[0]) == null ? void 0 : M.id) ?? "", [m, p] = R(!1), [h, g] = R(""), [S, I] = R(""), D = A(null), w = A(void 0);
4034
4036
  F(() => (clearTimeout(w.current), w.current = setTimeout(() => I(h), 180), () => clearTimeout(w.current)), [h]), F(() => {
4035
4037
  var E;
4036
- f && ((E = D.current) == null || E.focus());
4037
- }, [f]), F(() => {
4038
+ m && ((E = D.current) == null || E.focus());
4039
+ }, [m]), F(() => {
4038
4040
  a.length > 0 && !a.some((E) => E.id === d) && i(a[0].id);
4039
4041
  }, [d, a]);
4040
4042
  const T = x(() => {
@@ -4072,7 +4074,7 @@ function br({
4072
4074
  variant: "ghost",
4073
4075
  size: "icon-xs",
4074
4076
  onClick: T,
4075
- className: ie(f && "bg-foreground/5 text-foreground"),
4077
+ className: ie(m && "bg-foreground/5 text-foreground"),
4076
4078
  "aria-label": "Search",
4077
4079
  title: "Search",
4078
4080
  children: /* @__PURE__ */ l(Gt, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
@@ -4091,7 +4093,7 @@ function br({
4091
4093
  }
4092
4094
  )
4093
4095
  ] }),
4094
- O && f && /* @__PURE__ */ b("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
4096
+ O && m && /* @__PURE__ */ b("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
4095
4097
  /* @__PURE__ */ l(Gt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
4096
4098
  /* @__PURE__ */ l(
4097
4099
  In,
@@ -4193,9 +4195,9 @@ function Wa(e, t) {
4193
4195
  if (!s || typeof s != "object") return;
4194
4196
  const c = s.panels;
4195
4197
  if (!(!c || typeof c != "object")) {
4196
- for (const m of Object.values(c)) {
4197
- if (!m || typeof m != "object") return;
4198
- const a = m.contentComponent;
4198
+ for (const f of Object.values(c)) {
4199
+ if (!f || typeof f != "object") return;
4200
+ const a = f.contentComponent;
4199
4201
  if (typeof a != "string" || t && !t.has(a)) return;
4200
4202
  }
4201
4203
  return s;
@@ -4209,14 +4211,14 @@ function Sr({
4209
4211
  onLayoutChange: o,
4210
4212
  onReady: s,
4211
4213
  prefixHeaderActions: c,
4212
- rightHeaderActions: m,
4214
+ rightHeaderActions: f,
4213
4215
  watermarkComponent: a,
4214
4216
  className: d
4215
4217
  }) {
4216
4218
  const i = !!(o || r), u = J(() => {
4217
4219
  if (!i)
4218
4220
  return Wa(t, n ? new Set(n) : void 0);
4219
- }, [i, t, n]), f = x(
4221
+ }, [i, t, n]), m = x(
4220
4222
  (p) => {
4221
4223
  if (o) {
4222
4224
  o(p);
@@ -4240,11 +4242,11 @@ function Sr({
4240
4242
  {
4241
4243
  layout: Ma,
4242
4244
  persistedLayout: r ?? u,
4243
- onLayoutChange: f,
4245
+ onLayoutChange: m,
4244
4246
  onReady: s,
4245
4247
  allowedPanels: n,
4246
4248
  prefixHeaderActions: c,
4247
- rightHeaderActions: m,
4249
+ rightHeaderActions: f,
4248
4250
  watermarkComponent: a
4249
4251
  },
4250
4252
  `${t}:${i ? "ext" : "auto"}`
@@ -4292,7 +4294,7 @@ function za({
4292
4294
  storageKey: o,
4293
4295
  onReady: s,
4294
4296
  onChange: c,
4295
- onClose: m,
4297
+ onClose: f,
4296
4298
  extraPanels: a,
4297
4299
  className: d
4298
4300
  }) {
@@ -4303,7 +4305,7 @@ function za({
4303
4305
  } catch {
4304
4306
  return !1;
4305
4307
  }
4306
- }), [f, p] = R(() => {
4308
+ }), [m, p] = R(() => {
4307
4309
  if (!o) return t;
4308
4310
  try {
4309
4311
  const v = localStorage.getItem(`${o}:sidebarWidth`);
@@ -4317,8 +4319,8 @@ function za({
4317
4319
  w.current = s;
4318
4320
  const T = A(c);
4319
4321
  T.current = c;
4320
- const j = A(m);
4321
- j.current = m;
4322
+ const j = A(f);
4323
+ j.current = f;
4322
4324
  const W = A(/* @__PURE__ */ new Set()), V = Ft(), O = $o(), _ = A(V);
4323
4325
  _.current = V;
4324
4326
  const M = A(O);
@@ -4524,9 +4526,9 @@ function za({
4524
4526
  }), [De, ae]), _e = x(
4525
4527
  (v) => {
4526
4528
  if (i) return;
4527
- v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId), S.current = { startX: v.clientX, startWidth: f };
4529
+ v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId), S.current = { startX: v.clientX, startWidth: m };
4528
4530
  },
4529
- [i, f]
4531
+ [i, m]
4530
4532
  ), Ye = x(
4531
4533
  (v) => {
4532
4534
  const k = S.current;
@@ -4548,10 +4550,10 @@ function za({
4548
4550
  return F(() => {
4549
4551
  if (o)
4550
4552
  try {
4551
- localStorage.setItem(`${o}:sidebarWidth`, String(f));
4553
+ localStorage.setItem(`${o}:sidebarWidth`, String(m));
4552
4554
  } catch {
4553
4555
  }
4554
- }, [o, f]), F(() => {
4556
+ }, [o, m]), F(() => {
4555
4557
  if (o)
4556
4558
  try {
4557
4559
  localStorage.setItem(`${o}:sidebarCollapsed`, i ? "1" : "0");
@@ -4572,7 +4574,7 @@ function za({
4572
4574
  "data-boring-workspace-part": "surface-sidebar",
4573
4575
  "data-boring-state": "expanded",
4574
4576
  className: "flex h-full min-h-0 flex-col",
4575
- style: { width: f, minWidth: f, maxWidth: f },
4577
+ style: { width: m, minWidth: m, maxWidth: m },
4576
4578
  "aria-label": "Workbench left pane",
4577
4579
  children: /* @__PURE__ */ l(
4578
4580
  br,
@@ -4618,7 +4620,7 @@ function za({
4618
4620
  storageKey: o,
4619
4621
  onReady: Te,
4620
4622
  allowedPanels: L,
4621
- rightHeaderActions: m ? () => /* @__PURE__ */ l(Ba, { onClose: m }) : void 0
4623
+ rightHeaderActions: f ? () => /* @__PURE__ */ l(Ba, { onClose: f }) : void 0
4622
4624
  }
4623
4625
  )
4624
4626
  }
@@ -4642,7 +4644,7 @@ function za({
4642
4644
  api: I,
4643
4645
  collapsed: i,
4644
4646
  onExpandFiles: () => u(!1),
4645
- onClose: m
4647
+ onClose: f
4646
4648
  }
4647
4649
  )
4648
4650
  ] })
@@ -4676,9 +4678,9 @@ function Ua({
4676
4678
  if (!e) return;
4677
4679
  const c = () => s(e.panels.length === 0);
4678
4680
  c();
4679
- const m = e.onDidAddPanel(c), a = e.onDidRemovePanel(c);
4681
+ const f = e.onDidAddPanel(c), a = e.onDidRemovePanel(c);
4680
4682
  return () => {
4681
- m.dispose(), a.dispose();
4683
+ f.dispose(), a.dispose();
4682
4684
  };
4683
4685
  }, [e]), o ? /* @__PURE__ */ b(ke, { children: [
4684
4686
  /* @__PURE__ */ b("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
@@ -4777,10 +4779,10 @@ function jc({ children: e, defaultTheme: t, onThemeChange: n }) {
4777
4779
  ), c = x(() => {
4778
4780
  const d = o.getState().preferences.theme === "light" ? "dark" : "light";
4779
4781
  s(d);
4780
- }, [o, s]), m = Wt();
4781
- F(() => (document.documentElement.setAttribute("data-theme", m), () => {
4782
+ }, [o, s]), f = Wt();
4783
+ F(() => (document.documentElement.setAttribute("data-theme", f), () => {
4782
4784
  document.documentElement.removeAttribute("data-theme");
4783
- }), [m]);
4785
+ }), [f]);
4784
4786
  const a = J(() => ({ setTheme: s, toggleTheme: c }), [s, c]);
4785
4787
  return /* @__PURE__ */ l(zt.Provider, { value: a, children: e });
4786
4788
  }
@@ -4890,11 +4892,11 @@ function nc({
4890
4892
  children: s
4891
4893
  }) {
4892
4894
  return e.flatMap(
4893
- (m) => {
4895
+ (f) => {
4894
4896
  var a;
4895
- return ((a = m.outputs) == null ? void 0 : a.filter((d) => d.type === "provider").map((d) => ({ plugin: m, output: d }))) ?? [];
4897
+ return ((a = f.outputs) == null ? void 0 : a.filter((d) => d.type === "provider").map((d) => ({ plugin: f, output: d }))) ?? [];
4896
4898
  }
4897
- ).reduceRight((m, { plugin: a, output: d }) => {
4899
+ ).reduceRight((f, { plugin: a, output: d }) => {
4898
4900
  const i = d.component;
4899
4901
  return /* @__PURE__ */ l(
4900
4902
  i,
@@ -4903,7 +4905,7 @@ function nc({
4903
4905
  authHeaders: n,
4904
4906
  onAuthError: r,
4905
4907
  apiTimeout: o,
4906
- children: m
4908
+ children: f
4907
4909
  },
4908
4910
  `${a.id}:provider:${d.id}`
4909
4911
  );
@@ -4927,12 +4929,12 @@ function Bc({
4927
4929
  panels: o,
4928
4930
  commands: s,
4929
4931
  catalogs: c,
4930
- capabilities: m,
4932
+ capabilities: f,
4931
4933
  apiBaseUrl: a = "",
4932
4934
  authHeaders: d,
4933
4935
  apiTimeout: i,
4934
4936
  defaultTheme: u,
4935
- onThemeChange: f,
4937
+ onThemeChange: m,
4936
4938
  workspaceId: p,
4937
4939
  storageKey: h,
4938
4940
  persistenceEnabled: g = !0,
@@ -4976,7 +4978,7 @@ function Bc({
4976
4978
  };
4977
4979
  }, [S, T]);
4978
4980
  const { panelRegistry: O, commandRegistry: _, catalogRegistry: M, surfaceResolverRegistry: L, pluginMetas: E, pluginsWithBindings: K } = J(() => {
4979
- const ne = new Vs(m), ce = new Hs(), v = new On(), k = new Mn();
4981
+ const ne = new Vs(f), ce = new Hs(), v = new On(), k = new Mn();
4980
4982
  for (const oe of Ka) {
4981
4983
  const { id: Y, ...le } = oe;
4982
4984
  ne.register(Y, le);
@@ -5011,8 +5013,8 @@ function Bc({
5011
5013
  pluginMetas: q,
5012
5014
  pluginsWithBindings: ee
5013
5015
  };
5014
- }, [m, t, n, r, o]), H = A(f);
5015
- H.current = f;
5016
+ }, [f, t, n, r, o]), H = A(m);
5017
+ H.current = m;
5016
5018
  const Z = x(
5017
5019
  (ne) => {
5018
5020
  var ce;
@@ -5163,7 +5165,7 @@ function sc({
5163
5165
  }) {
5164
5166
  const s = J(() => n || r ? [] : oa(Ut(), e, t), [n, r, e, t]), c = x((d, i) => {
5165
5167
  xn(d.id, i), d.onSelect(i), o();
5166
- }, [o]), m = x(
5168
+ }, [o]), f = x(
5167
5169
  (d) => {
5168
5170
  kn(d.id, d.title), d.run(), o();
5169
5171
  },
@@ -5181,7 +5183,7 @@ function sc({
5181
5183
  return {
5182
5184
  recentEntries: s,
5183
5185
  handleCatalogSelect: c,
5184
- handleCommandSelect: m,
5186
+ handleCommandSelect: f,
5185
5187
  handleRecentSelect: a
5186
5188
  };
5187
5189
  }
@@ -5192,10 +5194,10 @@ function ic({
5192
5194
  setMode: r,
5193
5195
  setQuery: o
5194
5196
  }) {
5195
- const s = A(null), c = A(null), m = A(!1);
5197
+ const s = A(null), c = A(null), f = A(!1);
5196
5198
  F(() => {
5197
5199
  if (!e) return;
5198
- const f = (h) => {
5200
+ const m = (h) => {
5199
5201
  h.key === "Escape" && (h.preventDefault(), h.stopPropagation(), t(!1));
5200
5202
  }, p = (h) => {
5201
5203
  const g = h.target;
@@ -5203,8 +5205,8 @@ function ic({
5203
5205
  const S = document.querySelector('[data-slot="dialog-content"]');
5204
5206
  S && !S.contains(g) && (h.preventDefault(), h.stopPropagation(), t(!1));
5205
5207
  };
5206
- return window.addEventListener("keydown", f, { capture: !0 }), window.addEventListener("pointerdown", p, { capture: !0 }), () => {
5207
- window.removeEventListener("keydown", f, { capture: !0 }), window.removeEventListener("pointerdown", p, { capture: !0 });
5208
+ return window.addEventListener("keydown", m, { capture: !0 }), window.addEventListener("pointerdown", p, { capture: !0 }), () => {
5209
+ window.removeEventListener("keydown", m, { capture: !0 }), window.removeEventListener("pointerdown", p, { capture: !0 });
5208
5210
  };
5209
5211
  }, [e, t]);
5210
5212
  const a = x(() => {
@@ -5221,24 +5223,24 @@ function ic({
5221
5223
  }), F(() => {
5222
5224
  if (e)
5223
5225
  o(""), r("catalogs"), requestAnimationFrame(() => {
5224
- var f;
5225
- (f = s.current) == null || f.focus();
5226
+ var m;
5227
+ (m = s.current) == null || m.focus();
5226
5228
  });
5227
- else if (m.current) {
5228
- const f = c.current;
5229
- f && f.isConnected && f.focus(), c.current = null;
5229
+ else if (f.current) {
5230
+ const m = c.current;
5231
+ m && m.isConnected && m.focus(), c.current = null;
5230
5232
  }
5231
- m.current = e;
5233
+ f.current = e;
5232
5234
  }, [e, r, o]);
5233
- const d = x((f) => {
5234
- r(f), o((p) => p.replace(/^>\s*/, "")), requestAnimationFrame(() => {
5235
+ const d = x((m) => {
5236
+ r(m), o((p) => p.replace(/^>\s*/, "")), requestAnimationFrame(() => {
5235
5237
  var p;
5236
5238
  return (p = s.current) == null ? void 0 : p.focus();
5237
5239
  });
5238
5240
  }, [r, o]), i = x(() => {
5239
5241
  d(n === "commands" ? "catalogs" : "commands");
5240
- }, [n, d]), u = x((f) => {
5241
- f.key === "Tab" && (f.preventDefault(), f.stopPropagation(), i());
5242
+ }, [n, d]), u = x((m) => {
5243
+ m.key === "Tab" && (m.preventDefault(), m.stopPropagation(), i());
5242
5244
  }, [i]);
5243
5245
  return {
5244
5246
  inputRef: s,
@@ -5257,28 +5259,28 @@ function ac({
5257
5259
  o("");
5258
5260
  return;
5259
5261
  }
5260
- const m = setTimeout(() => o(n), 180);
5261
- return () => clearTimeout(m);
5262
+ const f = setTimeout(() => o(n), 180);
5263
+ return () => clearTimeout(f);
5262
5264
  }, [t, n]), F(() => {
5263
5265
  if (t || !r) {
5264
5266
  c([]);
5265
5267
  return;
5266
5268
  }
5267
- const m = new AbortController(), a = [...e];
5269
+ const f = new AbortController(), a = [...e];
5268
5270
  c((i) => {
5269
- const u = new Map(i.map((f) => [f.catalog.id, f]));
5270
- return a.map((f) => {
5271
- const p = u.get(f.id);
5271
+ const u = new Map(i.map((m) => [m.catalog.id, m]));
5272
+ return a.map((m) => {
5273
+ const p = u.get(m.id);
5272
5274
  return {
5273
- catalog: f,
5275
+ catalog: m,
5274
5276
  rows: (p == null ? void 0 : p.rows) ?? [],
5275
5277
  loading: !0
5276
5278
  };
5277
5279
  });
5278
5280
  });
5279
5281
  const d = (i, u) => {
5280
- m.signal.aborted || c(
5281
- (f) => f.map(
5282
+ f.signal.aborted || c(
5283
+ (m) => m.map(
5282
5284
  (p) => p.catalog.id === i.id ? { catalog: i, ...u } : p
5283
5285
  )
5284
5286
  );
@@ -5290,20 +5292,20 @@ function ac({
5290
5292
  filters: {},
5291
5293
  limit: it,
5292
5294
  offset: 0,
5293
- signal: m.signal
5295
+ signal: f.signal
5294
5296
  });
5295
5297
  Promise.resolve(u).then(
5296
- (f) => {
5298
+ (m) => {
5297
5299
  d(i, {
5298
- rows: f.items.slice(0, it),
5300
+ rows: m.items.slice(0, it),
5299
5301
  loading: !1
5300
5302
  });
5301
5303
  },
5302
- (f) => {
5304
+ (m) => {
5303
5305
  d(i, {
5304
5306
  rows: [],
5305
5307
  loading: !1,
5306
- error: pn(f)
5308
+ error: pn(m)
5307
5309
  });
5308
5310
  }
5309
5311
  );
@@ -5315,20 +5317,20 @@ function ac({
5315
5317
  });
5316
5318
  }
5317
5319
  return () => {
5318
- m.abort();
5320
+ f.abort();
5319
5321
  };
5320
5322
  }, [e, r, t]), s;
5321
5323
  }
5322
5324
  function cc(e) {
5323
- const [t, n] = R(!1), [r, o] = R(""), [s, c] = R("catalogs"), m = _o(), a = Lo(), d = Ja(), i = J(() => {
5325
+ const [t, n] = R(!1), [r, o] = R(""), [s, c] = R("catalogs"), f = _o(), a = Lo(), d = Ja(), i = J(() => {
5324
5326
  const V = {};
5325
5327
  for (const O of (d == null ? void 0 : d.registeredPlugins) ?? [])
5326
5328
  O.label && (V[O.id] = O.label);
5327
5329
  return V;
5328
- }, [d == null ? void 0 : d.registeredPlugins]), u = s === "commands", f = r.trim(), p = ac({
5329
- catalogs: m,
5330
+ }, [d == null ? void 0 : d.registeredPlugins]), u = s === "commands", m = r.trim(), p = ac({
5331
+ catalogs: f,
5330
5332
  isCommandMode: u,
5331
- searchQuery: f
5333
+ searchQuery: m
5332
5334
  }), { inputRef: h, switchMode: g, handleInputKeyDown: S } = ic({
5333
5335
  open: t,
5334
5336
  setOpen: n,
@@ -5341,16 +5343,16 @@ function cc(e) {
5341
5343
  return;
5342
5344
  }
5343
5345
  o(V);
5344
- }, []), D = J(() => u ? ra(a, f) : [], [a, u, f]), {
5346
+ }, []), D = J(() => u ? ra(a, m) : [], [a, u, m]), {
5345
5347
  recentEntries: w,
5346
5348
  handleCatalogSelect: T,
5347
5349
  handleCommandSelect: j,
5348
5350
  handleRecentSelect: W
5349
5351
  } = sc({
5350
- catalogs: m,
5352
+ catalogs: f,
5351
5353
  commands: a,
5352
5354
  isCommandMode: u,
5353
- searchQuery: f,
5355
+ searchQuery: m,
5354
5356
  close: () => n(!1)
5355
5357
  });
5356
5358
  return /* @__PURE__ */ l(ao, { open: t, onOpenChange: n, children: /* @__PURE__ */ b(
@@ -5391,7 +5393,7 @@ function cc(e) {
5391
5393
  {
5392
5394
  isCommandMode: u,
5393
5395
  recentEntries: w,
5394
- searchQuery: f,
5396
+ searchQuery: m,
5395
5397
  onRecentSelect: W
5396
5398
  }
5397
5399
  ),