@omniviewdev/runtime 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- var pt = Object.defineProperty;
2
- var gt = (t, e, n) => e in t ? pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var x = (t, e, n) => gt(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { jsx as A, jsxs as H } from "react/jsx-runtime";
5
- import C, { useContext as J, createContext as ae, useState as j, useRef as M, useCallback as U, useSyncExternalStore as ht, useEffect as W, useMemo as yt } from "react";
6
- import { Link as mt, useNavigate as Et, useLocation as St, createMemoryRouter as _t, RouterProvider as Ct } from "react-router-dom";
1
+ var mt = Object.defineProperty;
2
+ var Et = (t, e, n) => e in t ? mt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var L = (t, e, n) => Et(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsx as R, jsxs as q, Fragment as St } from "react/jsx-runtime";
5
+ import C, { useContext as X, createContext as ue, useState as K, useRef as W, useCallback as M, useSyncExternalStore as vt, useEffect as j, useMemo as Ct } from "react";
6
+ import { Link as _t, useNavigate as wt, useLocation as bt, createMemoryRouter as Rt, RouterProvider as It } from "react-router-dom";
7
7
  import "./index-D2mKAO8s.js";
8
- import { P as wt, G as vt, V as bt, S as Rt, a as Le, U as It, R as Ot, b as At, c as Ue, d as Tt, L as Ft, e as Dt, f as Nt, g as Pt, h as xt, i as Lt, j as Ut, C as kt, k as qt, l as Mt, m as $t, n as Wt, Q as Gt, o as jt, p as Oe, q as Qt, r as ke, F as Kt, s as Ht, t as qe, D as Me, u as Bt, v as zt, w as Vt, x as $e, y as Yt, z as Jt, A as We, B as Xt, E as Zt, H as en, I as tn, J as nn, K as rn, M as Ae, N as sn, O as on, T as an, W as cn, X as un } from "./graphservice-CUg1PUsC.js";
9
- import { P as ln, W as dn, S as fn, C as pn, L as gn, F as hn, a as yn, U as Ge, D as je, G as mn, b as Qe, c as Ke, A as He } from "./models-4EtitZnM.js";
10
- import { O as D, a as Be } from "./events-Bcx6NsMp.js";
11
- import { useQueryClient as K, useMutation as P, useQuery as N, keepPreviousData as ze, useQueries as En } from "@tanstack/react-query";
12
- import { useToast as Sn, Button as ee } from "@omniviewdev/base-ui";
13
- import { w as _n } from "./legacyEnum-DORXlU_y.js";
14
- const Se = C.createContext(void 0), F = {
8
+ import { P as Ot, G as At, V as Tt, S as Dt, a as qe, U as xt, R as Ft, b as Nt, c as $e, d as Pt, L as Lt, e as kt, f as Mt, g as Ut, h as qt, i as $t, j as Wt, C as Gt, k as jt, l as Qt, m as Kt, n as Ht, Q as Bt, o as zt, p as De, q as Vt, r as We, F as Yt, s as Jt, t as Ge, D as je, u as Xt, v as Zt, w as en, x as Qe, y as tn, z as nn, A as Ke, B as rn, E as sn, H as on, I as an, J as cn, K as un, M as xe, N as ln, O as dn, T as fn, W as pn, X as hn } from "./graphservice-CUg1PUsC.js";
9
+ import { P as gn, W as yn, S as mn, C as En, L as Sn, F as vn, a as Cn, U as He, D as Be, G as _n, b as ze, c as Ve, A as Ye } from "./models-4EtitZnM.js";
10
+ import { O as x, a as Je } from "./events-Bcx6NsMp.js";
11
+ import { useQueryClient as B, useMutation as N, useQuery as F, keepPreviousData as Xe, useQueries as wn } from "@tanstack/react-query";
12
+ import { useToast as bn, Card as Rn, Toolbar as Fe, Text as ee, IconButton as ne, EmptyState as In, Button as pe, Code as On } from "@omniviewdev/base-ui";
13
+ import { w as An } from "./legacyEnum-DORXlU_y.js";
14
+ const _e = C.createContext(void 0), D = {
15
15
  // Plugin
16
16
  PLUGIN_NOT_FOUND: "omniview:plugin/not-found",
17
17
  PLUGIN_NOT_LOADED: "omniview:plugin/not-loaded",
@@ -46,88 +46,88 @@ const Se = C.createContext(void 0), F = {
46
46
  INTERNAL: "omniview:internal",
47
47
  VALIDATION: "omniview:validation",
48
48
  NOT_IMPLEMENTED: "omniview:not-implemented"
49
- }, Te = {
50
- INVALID_REQUEST: [F.VALIDATION, 400, "correctRequest"],
51
- UNSUPPORTED: [F.NOT_IMPLEMENTED, 501, "refreshContract"],
52
- FORBIDDEN: [F.RESOURCE_FORBIDDEN, 403, "none"],
53
- UNAUTHORIZED: [F.RESOURCE_UNAUTHORIZED, 401, "none"],
54
- NOT_FOUND: [F.RESOURCE_NOT_FOUND, 404, "none"],
55
- CONFLICT: [F.RESOURCE_CONFLICT, 409, "refreshContract"],
56
- ALREADY_EXISTS: [F.RESOURCE_CONFLICT, 409, "refreshContract"],
57
- CANCELLED: [F.CANCELLED, 499, "none"],
58
- TIMEOUT: [F.RESOURCE_TIMEOUT, 408, "none"],
59
- UNAVAILABLE: [F.CONNECTION_FAILED, 503, "reconnect"],
60
- CONNECTION_ERROR: [F.CONNECTION_FAILED, 503, "reconnect"],
61
- CERTIFICATE_ERROR: [F.CONNECTION_FAILED, 502, "reconnect"],
62
- RESOURCE_LIMIT: [F.RESOURCE_LIMIT, 429, "correctRequest"],
63
- CONTINUATION_EXPIRED: [F.RESOURCE_CONTINUATION_EXPIRED, 410, "restartQuery"],
64
- RESET_REQUIRED: [F.RESOURCE_RESET_REQUIRED, 409, "restartQuery"],
65
- PARTIAL_RESULT: [F.RESOURCE_PARTIAL, 422, "none"],
66
- PROVIDER_ERROR: [F.RESOURCE_PROVIDER_ERROR, 502, "none"],
67
- INTERNAL: [F.INTERNAL, 500, "none"]
49
+ }, Ne = {
50
+ INVALID_REQUEST: [D.VALIDATION, 400, "correctRequest"],
51
+ UNSUPPORTED: [D.NOT_IMPLEMENTED, 501, "refreshContract"],
52
+ FORBIDDEN: [D.RESOURCE_FORBIDDEN, 403, "none"],
53
+ UNAUTHORIZED: [D.RESOURCE_UNAUTHORIZED, 401, "none"],
54
+ NOT_FOUND: [D.RESOURCE_NOT_FOUND, 404, "none"],
55
+ CONFLICT: [D.RESOURCE_CONFLICT, 409, "refreshContract"],
56
+ ALREADY_EXISTS: [D.RESOURCE_CONFLICT, 409, "refreshContract"],
57
+ CANCELLED: [D.CANCELLED, 499, "none"],
58
+ TIMEOUT: [D.RESOURCE_TIMEOUT, 408, "none"],
59
+ UNAVAILABLE: [D.CONNECTION_FAILED, 503, "reconnect"],
60
+ CONNECTION_ERROR: [D.CONNECTION_FAILED, 503, "reconnect"],
61
+ CERTIFICATE_ERROR: [D.CONNECTION_FAILED, 502, "reconnect"],
62
+ RESOURCE_LIMIT: [D.RESOURCE_LIMIT, 429, "correctRequest"],
63
+ CONTINUATION_EXPIRED: [D.RESOURCE_CONTINUATION_EXPIRED, 410, "restartQuery"],
64
+ RESET_REQUIRED: [D.RESOURCE_RESET_REQUIRED, 409, "restartQuery"],
65
+ PARTIAL_RESULT: [D.RESOURCE_PARTIAL, 422, "none"],
66
+ PROVIDER_ERROR: [D.RESOURCE_PROVIDER_ERROR, 502, "none"],
67
+ INTERNAL: [D.INTERNAL, 500, "none"]
68
68
  };
69
- function de(t) {
69
+ function he(t) {
70
70
  return typeof t == "object" && t !== null ? t : void 0;
71
71
  }
72
- function $(t, e) {
72
+ function G(t, e) {
73
73
  return typeof t == "string" && t.length > 0 && t.length <= e;
74
74
  }
75
- function fe() {
76
- return { type: F.CANCELLED, code: "CANCELLED", title: "Cancelled", status: 499, detail: "The operation was cancelled.", recovery: "none" };
75
+ function ge() {
76
+ return { type: D.CANCELLED, code: "CANCELLED", title: "Cancelled", status: 499, detail: "The operation was cancelled.", recovery: "none" };
77
77
  }
78
- function se(t, e) {
78
+ function ie(t, e) {
79
79
  if (e > 4) return;
80
- if (t === "cancelled") return fe();
80
+ if (t === "cancelled") return ge();
81
81
  if (typeof t == "string") {
82
82
  const r = t.trim();
83
83
  if (!r.startsWith("{")) return;
84
84
  try {
85
- return se(JSON.parse(r), e + 1);
85
+ return ie(JSON.parse(r), e + 1);
86
86
  } catch {
87
87
  return;
88
88
  }
89
89
  }
90
- const n = de(t);
90
+ const n = he(t);
91
91
  if (n) {
92
- if (n.name === "AbortError" || n.name === "CancelError") return fe();
93
- if ($(n.type, 256) && $(n.title, 256) && typeof n.status == "number" && Number.isInteger(n.status) && n.status >= 100 && n.status <= 599 && typeof n.detail == "string" && n.detail.length <= 4096) {
92
+ if (n.name === "AbortError" || n.name === "CancelError") return ge();
93
+ if (G(n.type, 256) && G(n.title, 256) && typeof n.status == "number" && Number.isInteger(n.status) && n.status >= 100 && n.status <= 599 && typeof n.detail == "string" && n.detail.length <= 4096) {
94
94
  const r = { type: n.type, title: n.title, status: n.status, detail: n.detail };
95
- $(n.code, 64) && (r.code = n.code), $(n.requestId, 256) && (r.requestId = n.requestId), $(n.instance, 512) && (r.instance = n.instance), Array.isArray(n.suggestions) && (r.suggestions = n.suggestions.filter((i) => $(i, 512)).slice(0, 8)), Array.isArray(n.actions) && (r.actions = n.actions.filter((i) => {
96
- const o = de(i);
97
- return !!o && ["navigate", "retry", "open-url", "copy"].includes(String(o.type)) && $(o.label, 256) && (o.target === void 0 || $(o.target, 4096));
95
+ G(n.code, 64) && (r.code = n.code), G(n.requestId, 256) && (r.requestId = n.requestId), G(n.instance, 512) && (r.instance = n.instance), Array.isArray(n.suggestions) && (r.suggestions = n.suggestions.filter((i) => G(i, 512)).slice(0, 8)), Array.isArray(n.actions) && (r.actions = n.actions.filter((i) => {
96
+ const o = he(i);
97
+ return !!o && ["navigate", "retry", "open-url", "copy"].includes(String(o.type)) && G(o.label, 256) && (o.target === void 0 || G(o.target, 4096));
98
98
  }).slice(0, 8)), ["correctRequest", "refreshContract", "restartQuery", "reconnect", "none"].includes(String(n.recovery)) && (r.recovery = n.recovery);
99
- const s = de(n.location);
99
+ const s = he(n.location);
100
100
  return (s == null ? void 0 : s.unit) === "utf8-byte" && typeof s.start == "number" && typeof s.end == "number" && Number.isSafeInteger(s.start) && Number.isSafeInteger(s.end) && s.start >= 0 && s.end >= s.start && (r.location = { start: s.start, end: s.end, unit: "utf8-byte" }), r;
101
101
  }
102
102
  if (typeof n.code == "string" && typeof n.title == "string" && typeof n.message == "string") {
103
103
  let r = n.code;
104
- if (r === "PERMISSION_DENIED" && (r = "FORBIDDEN"), ["INVALID_INPUT", "FILTER_UNKNOWN_FIELD", "FILTER_INVALID_OPERATOR"].includes(r) && (r = "INVALID_REQUEST"), Object.prototype.hasOwnProperty.call(Te, r) || (r = "INTERNAL"), r === "CANCELLED") return fe();
105
- const [s, i, o] = Te[r], a = r === "FORBIDDEN" || r === "UNAUTHORIZED" || r === "INTERNAL" || r === "PROVIDER_ERROR";
104
+ if (r === "PERMISSION_DENIED" && (r = "FORBIDDEN"), ["INVALID_INPUT", "FILTER_UNKNOWN_FIELD", "FILTER_INVALID_OPERATOR"].includes(r) && (r = "INVALID_REQUEST"), Object.prototype.hasOwnProperty.call(Ne, r) || (r = "INTERNAL"), r === "CANCELLED") return ge();
105
+ const [s, i, o] = Ne[r], a = r === "FORBIDDEN" || r === "UNAUTHORIZED" || r === "INTERNAL" || r === "PROVIDER_ERROR";
106
106
  return {
107
107
  type: s,
108
108
  status: i,
109
109
  code: r,
110
110
  recovery: o,
111
- title: a ? r === "FORBIDDEN" ? "Access denied" : r === "UNAUTHORIZED" ? "Authentication required" : "Operation failed" : $(n.title, 256) ? n.title : "Operation failed",
112
- detail: a ? "The operation could not be completed." : $(n.message, 4096) ? n.message : "The operation could not be completed.",
113
- ...!a && Array.isArray(n.suggestions) ? { suggestions: n.suggestions.filter((c) => $(c, 512)).slice(0, 8) } : {}
111
+ title: a ? r === "FORBIDDEN" ? "Access denied" : r === "UNAUTHORIZED" ? "Authentication required" : "Operation failed" : G(n.title, 256) ? n.title : "Operation failed",
112
+ detail: a ? "The operation could not be completed." : G(n.message, 4096) ? n.message : "The operation could not be completed.",
113
+ ...!a && Array.isArray(n.suggestions) ? { suggestions: n.suggestions.filter((c) => G(c, 512)).slice(0, 8) } : {}
114
114
  };
115
115
  }
116
- return se(n.message, e + 1) ?? se(n.cause, e + 1);
116
+ return ie(n.message, e + 1) ?? ie(n.cause, e + 1);
117
117
  }
118
118
  }
119
- function Q(t) {
120
- return se(t, 0) ?? {
121
- type: F.INTERNAL,
119
+ function H(t) {
120
+ return ie(t, 0) ?? {
121
+ type: D.INTERNAL,
122
122
  title: t == null ? "Unknown error" : "Error",
123
123
  status: 500,
124
124
  detail: t == null ? "An unknown error occurred." : "The operation could not be completed."
125
125
  };
126
126
  }
127
- function oe(t) {
128
- return Q(t).type === F.CANCELLED;
127
+ function ae(t) {
128
+ return H(t).type === D.CANCELLED;
129
129
  }
130
- function Cn(t) {
130
+ function Tn(t) {
131
131
  switch (t.type) {
132
132
  case "navigate":
133
133
  return {
@@ -164,7 +164,7 @@ function Cn(t) {
164
164
  };
165
165
  }
166
166
  }
167
- function Ve(t, e) {
167
+ function Ze(t, e) {
168
168
  var s, i;
169
169
  const n = [
170
170
  t.detail,
@@ -175,73 +175,73 @@ function Ve(t, e) {
175
175
  message: e || (t.title !== "Error" ? t.title : "Operation failed"),
176
176
  status: "error",
177
177
  details: n,
178
- actions: (i = t.actions) == null ? void 0 : i.map(Cn)
178
+ actions: (i = t.actions) == null ? void 0 : i.map(Tn)
179
179
  };
180
180
  }
181
- function B(t, e, n) {
182
- if (oe(e)) return;
183
- const r = Q(e);
184
- t(Ve(r, n));
181
+ function z(t, e, n) {
182
+ if (ae(e)) return;
183
+ const r = H(e);
184
+ t(Ze(r, n));
185
185
  }
186
- function k(t, e) {
186
+ function U(t, e) {
187
187
  return (n) => {
188
- if (oe(n)) return;
189
- const r = Q(n);
190
- t(Ve(r, r.title !== "Error" ? r.title : e));
188
+ if (ae(n)) return;
189
+ const r = H(n);
190
+ t(Ze(r, r.title !== "Error" ? r.title : e));
191
191
  };
192
192
  }
193
- function es(t) {
194
- const { children: e, pluginId: n } = t, [r, s] = C.useState({}), [i, o] = C.useState(new ln()), [a, c] = C.useState(!1), [l, u] = C.useState(null), d = C.useRef(0), g = C.useRef(0);
195
- console.debug("[PluginContextProvider] render", { pluginId: n, metaLoaded: a, metaError: !!l });
196
- const h = C.useCallback(() => {
193
+ function cs(t) {
194
+ const { children: e, pluginId: n } = t, [r, s] = C.useState({}), [i, o] = C.useState(new gn()), [a, c] = C.useState(!1), [d, l] = C.useState(null), f = C.useRef(0), h = C.useRef(0);
195
+ console.debug("[PluginContextProvider] render", { pluginId: n, metaLoaded: a, metaError: !!d });
196
+ const g = C.useCallback(() => {
197
197
  if (n === void 0 || n === "")
198
198
  return;
199
- const y = ++d.current;
200
- console.debug(`[PluginContextProvider] fetching settings for "${n}"`), wt(n).then((f) => {
201
- y === d.current && (console.debug(`[PluginContextProvider] settings loaded for "${n}"`, Object.keys(f)), s(f));
202
- }).catch((f) => {
203
- if (y !== d.current) return;
204
- const p = Q(f);
199
+ const S = ++f.current;
200
+ console.debug(`[PluginContextProvider] fetching settings for "${n}"`), Ot(n).then((u) => {
201
+ S === f.current && (console.debug(`[PluginContextProvider] settings loaded for "${n}"`, Object.keys(u)), s(u));
202
+ }).catch((u) => {
203
+ if (S !== f.current) return;
204
+ const p = H(u);
205
205
  console.error(`[PluginContextProvider] error fetching settings for "${n}":`, p.detail);
206
206
  });
207
- }, [n]), E = C.useCallback(() => {
207
+ }, [n]), m = C.useCallback(() => {
208
208
  if (n === void 0 || n === "") {
209
209
  console.debug("[PluginContextProvider] skipping meta fetch — empty pluginId");
210
210
  return;
211
211
  }
212
- const y = ++g.current;
213
- console.debug(`[PluginContextProvider] fetching meta for "${n}"`), u(null), vt(n).then((f) => {
214
- y === g.current && (console.debug(`[PluginContextProvider] meta loaded for "${n}"`, { name: f == null ? void 0 : f.name, version: f == null ? void 0 : f.version }), o(f), c(!0));
215
- }).catch((f) => {
216
- if (y !== g.current) return;
217
- const p = Q(f);
218
- console.error(`[PluginContextProvider] error fetching meta for "${n}":`, p.detail), u(p.detail), c(!1);
212
+ const S = ++h.current;
213
+ console.debug(`[PluginContextProvider] fetching meta for "${n}"`), l(null), At(n).then((u) => {
214
+ S === h.current && (console.debug(`[PluginContextProvider] meta loaded for "${n}"`, { name: u == null ? void 0 : u.name, version: u == null ? void 0 : u.version }), o(u), c(!0));
215
+ }).catch((u) => {
216
+ if (S !== h.current) return;
217
+ const p = H(u);
218
+ console.error(`[PluginContextProvider] error fetching meta for "${n}":`, p.detail), l(p.detail), c(!1);
219
219
  });
220
220
  }, [n]);
221
221
  return C.useEffect(() => {
222
222
  if (a) return;
223
- const y = () => {
224
- h(), E();
225
- }, f = [
226
- D("plugin/init_complete", y),
227
- D("plugin/dev_install_complete", (p) => {
228
- var w;
229
- ((w = p.data) == null ? void 0 : w.id) === n && y();
223
+ const S = () => {
224
+ g(), m();
225
+ }, u = [
226
+ x("plugin/init_complete", S),
227
+ x("plugin/dev_install_complete", (p) => {
228
+ var _;
229
+ ((_ = p.data) == null ? void 0 : _.id) === n && S();
230
230
  }),
231
- D("plugin/inventory_changed", y)
231
+ x("plugin/inventory_changed", S)
232
232
  ];
233
233
  return () => {
234
- for (const p of f) p();
234
+ for (const p of u) p();
235
235
  };
236
- }, [n, a, h, E]), C.useEffect(() => (console.debug(`[PluginContextProvider] useEffect — pluginId changed to "${n}"`), c(!1), u(null), s({}), h(), E(), () => {
237
- ++d.current, ++g.current;
238
- }), [n, h, E]), l ? /* @__PURE__ */ A("div", { style: {
236
+ }, [n, a, g, m]), C.useEffect(() => (console.debug(`[PluginContextProvider] useEffect — pluginId changed to "${n}"`), c(!1), l(null), s({}), g(), m(), () => {
237
+ ++f.current, ++h.current;
238
+ }), [n, g, m]), d ? /* @__PURE__ */ R("div", { style: {
239
239
  display: "flex",
240
240
  flex: 1,
241
241
  alignItems: "center",
242
242
  justifyContent: "center",
243
243
  padding: 24
244
- }, children: /* @__PURE__ */ H("div", { style: {
244
+ }, children: /* @__PURE__ */ q("div", { style: {
245
245
  maxWidth: 480,
246
246
  width: "100%",
247
247
  border: "1px solid #7F1D1D",
@@ -250,19 +250,19 @@ function es(t) {
250
250
  padding: 20,
251
251
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
252
252
  }, children: [
253
- /* @__PURE__ */ H("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
254
- /* @__PURE__ */ H("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "#EF4444", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
255
- /* @__PURE__ */ A("circle", { cx: "12", cy: "12", r: "10" }),
256
- /* @__PURE__ */ A("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
257
- /* @__PURE__ */ A("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
253
+ /* @__PURE__ */ q("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
254
+ /* @__PURE__ */ q("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "#EF4444", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
255
+ /* @__PURE__ */ R("circle", { cx: "12", cy: "12", r: "10" }),
256
+ /* @__PURE__ */ R("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
257
+ /* @__PURE__ */ R("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
258
258
  ] }),
259
- /* @__PURE__ */ A("span", { style: { fontSize: 14, fontWeight: 600, color: "#FECACA" }, children: "Plugin failed to load" })
259
+ /* @__PURE__ */ R("span", { style: { fontSize: 14, fontWeight: 600, color: "#FECACA" }, children: "Plugin failed to load" })
260
260
  ] }),
261
- /* @__PURE__ */ A("p", { style: { fontSize: 13, color: "#A1A1AA", margin: "0 0 16px" }, children: l }),
262
- /* @__PURE__ */ A(
261
+ /* @__PURE__ */ R("p", { style: { fontSize: 13, color: "#A1A1AA", margin: "0 0 16px" }, children: d }),
262
+ /* @__PURE__ */ R(
263
263
  "button",
264
264
  {
265
- onClick: () => E(),
265
+ onClick: () => m(),
266
266
  style: {
267
267
  background: "transparent",
268
268
  color: "#F87171",
@@ -276,13 +276,13 @@ function es(t) {
276
276
  children: "Retry"
277
277
  }
278
278
  )
279
- ] }) }) : a ? /* @__PURE__ */ A(Se.Provider, { value: { pluginId: n, settings: r, meta: i }, children: e }) : /* @__PURE__ */ H("div", { style: {
279
+ ] }) }) : a ? /* @__PURE__ */ R(_e.Provider, { value: { pluginId: n, settings: r, meta: i }, children: e }) : /* @__PURE__ */ q("div", { style: {
280
280
  display: "flex",
281
281
  flex: 1,
282
282
  alignItems: "center",
283
283
  justifyContent: "center"
284
284
  }, children: [
285
- /* @__PURE__ */ A("div", { style: {
285
+ /* @__PURE__ */ R("div", { style: {
286
286
  width: 24,
287
287
  height: 24,
288
288
  border: "2px solid #3F3F46",
@@ -290,38 +290,38 @@ function es(t) {
290
290
  borderRadius: "50%",
291
291
  animation: "plugin-spin 0.8s linear infinite"
292
292
  } }),
293
- /* @__PURE__ */ A("style", { children: "@keyframes plugin-spin { to { transform: rotate(360deg); } }" })
293
+ /* @__PURE__ */ R("style", { children: "@keyframes plugin-spin { to { transform: rotate(360deg); } }" })
294
294
  ] });
295
295
  }
296
- function _e() {
297
- const t = J(Se);
296
+ function we() {
297
+ const t = X(_e);
298
298
  if (!t)
299
299
  throw new Error("usePluginContext must be used within a PluginContextProvider");
300
300
  return t;
301
301
  }
302
- function ts() {
303
- return _e().settings;
302
+ function us() {
303
+ return we().settings;
304
304
  }
305
- const Ye = ae(void 0), ns = ({ children: t }) => {
306
- const [e, n] = j({}), r = M(0), s = U(() => {
305
+ const et = ue(void 0), ls = ({ children: t }) => {
306
+ const [e, n] = K({}), r = W(0), s = M(() => {
307
307
  const o = r.current + 1;
308
- r.current = o, bt().then((a) => {
308
+ r.current = o, Tt().then((a) => {
309
309
  o === r.current && n(a);
310
310
  }).catch((a) => {
311
311
  o === r.current && console.error("Error fetching settings:", a);
312
312
  });
313
313
  }, []);
314
314
  C.useEffect(() => {
315
- const o = D("settings/changed", () => s());
315
+ const o = x("settings/changed", () => s());
316
316
  return s(), () => {
317
317
  r.current += 1, o();
318
318
  };
319
319
  }, [s]);
320
- const i = U(() => {
320
+ const i = M(() => {
321
321
  s();
322
322
  }, [s]);
323
- return /* @__PURE__ */ A(Ye.Provider, { value: { settings: e, reload: i }, children: t });
324
- }, wn = {
323
+ return /* @__PURE__ */ R(et.Provider, { value: { settings: e, reload: i }, children: t });
324
+ }, Dn = {
325
325
  height: 32,
326
326
  focused: 0,
327
327
  tabs: [],
@@ -345,22 +345,22 @@ const Ye = ae(void 0), ns = ({ children: t }) => {
345
345
  },
346
346
  fullscreenDrawer: () => {
347
347
  }
348
- }, vn = C.createContext(wn), bn = ae(void 0), Rn = C.createContext(void 0), Je = C.createContext(void 0), In = 3e4, rs = ({ children: t }) => {
348
+ }, xn = C.createContext(Dn), Fn = ue(void 0), Nn = C.createContext(void 0), tt = C.createContext(void 0), Pn = 3e4, ds = ({ children: t }) => {
349
349
  const [e, n] = C.useState([]), r = C.useCallback((a) => {
350
350
  n((c) => [a, ...c]);
351
351
  }, []), s = C.useCallback((a, c) => {
352
352
  n(
353
- (l) => l.map((u) => u.id === a ? { ...u, ...c } : u)
353
+ (d) => d.map((l) => l.id === a ? { ...l, ...c } : l)
354
354
  );
355
355
  }, []), i = C.useCallback((a) => {
356
- n((c) => c.filter((l) => l.id !== a));
356
+ n((c) => c.filter((d) => d.id !== a));
357
357
  }, []);
358
358
  C.useEffect(() => {
359
359
  const a = [];
360
360
  for (const c of e)
361
361
  if (c.status !== "running") {
362
- const l = Date.now() - (c.completedAt ?? c.startedAt), u = Math.max(0, In - l);
363
- a.push(setTimeout(() => i(c.id), u));
362
+ const d = Date.now() - (c.completedAt ?? c.startedAt), l = Math.max(0, Pn - d);
363
+ a.push(setTimeout(() => i(c.id), l));
364
364
  }
365
365
  return () => a.forEach(clearTimeout);
366
366
  }, [e, i]);
@@ -368,57 +368,57 @@ const Ye = ae(void 0), ns = ({ children: t }) => {
368
368
  () => ({ operations: e, addOperation: r, updateOperation: s, removeOperation: i }),
369
369
  [e, r, s, i]
370
370
  );
371
- return /* @__PURE__ */ A(Je.Provider, { value: o, children: t });
371
+ return /* @__PURE__ */ R(tt.Provider, { value: o, children: t });
372
372
  };
373
- var ye = function(t, e) {
374
- return ye = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
373
+ var Se = function(t, e) {
374
+ return Se = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
375
375
  n.__proto__ = r;
376
376
  } || function(n, r) {
377
377
  for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (n[s] = r[s]);
378
- }, ye(t, e);
378
+ }, Se(t, e);
379
379
  };
380
- function On(t, e) {
380
+ function Ln(t, e) {
381
381
  if (typeof e != "function" && e !== null)
382
382
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
383
- ye(t, e);
383
+ Se(t, e);
384
384
  function n() {
385
385
  this.constructor = t;
386
386
  }
387
387
  t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n());
388
388
  }
389
- var pe = "Invariant Violation", Fe = Object.setPrototypeOf, An = Fe === void 0 ? function(t, e) {
389
+ var ye = "Invariant Violation", Pe = Object.setPrototypeOf, kn = Pe === void 0 ? function(t, e) {
390
390
  return t.__proto__ = e, t;
391
- } : Fe, Tn = (
391
+ } : Pe, Mn = (
392
392
  /** @class */
393
393
  function(t) {
394
- On(e, t);
394
+ Ln(e, t);
395
395
  function e(n) {
396
- n === void 0 && (n = pe);
397
- var r = t.call(this, typeof n == "number" ? pe + ": " + n + " (see https://github.com/apollographql/invariant-packages)" : n) || this;
398
- return r.framesToPop = 1, r.name = pe, An(r, e.prototype), r;
396
+ n === void 0 && (n = ye);
397
+ var r = t.call(this, typeof n == "number" ? ye + ": " + n + " (see https://github.com/apollographql/invariant-packages)" : n) || this;
398
+ return r.framesToPop = 1, r.name = ye, kn(r, e.prototype), r;
399
399
  }
400
400
  return e;
401
401
  }(Error)
402
402
  );
403
- function me(t, e) {
403
+ function ve(t, e) {
404
404
  if (!t)
405
- throw new Tn(e);
405
+ throw new Mn(e);
406
406
  }
407
- var Xe = ["debug", "log", "warn", "error", "silent"], Fn = Xe.indexOf("log");
408
- function te(t) {
407
+ var nt = ["debug", "log", "warn", "error", "silent"], Un = nt.indexOf("log");
408
+ function re(t) {
409
409
  return function() {
410
- if (Xe.indexOf(t) >= Fn) {
410
+ if (nt.indexOf(t) >= Un) {
411
411
  var e = console[t] || console.log;
412
412
  return e.apply(console, arguments);
413
413
  }
414
414
  };
415
415
  }
416
416
  (function(t) {
417
- t.debug = te("debug"), t.log = te("log"), t.warn = te("warn"), t.error = te("error");
418
- })(me || (me = {}));
419
- const Ze = ae(void 0), Dn = () => J(Ze);
420
- function ss(t) {
421
- const e = Dn(), n = C.useRef(null), r = e == null ? void 0 : e.getExtensionPoint(t), s = U(
417
+ t.debug = re("debug"), t.log = re("log"), t.warn = re("warn"), t.error = re("error");
418
+ })(ve || (ve = {}));
419
+ const rt = ue(void 0), qn = () => X(rt);
420
+ function fs(t) {
421
+ const e = qn(), n = C.useRef(null), r = e == null ? void 0 : e.getExtensionPoint(t), s = M(
422
422
  (o) => {
423
423
  const a = [];
424
424
  return e && a.push(e.subscribe(o)), r && a.push(r.subscribe(o)), () => {
@@ -427,13 +427,13 @@ function ss(t) {
427
427
  };
428
428
  },
429
429
  [e, t, r]
430
- ), i = U(() => {
430
+ ), i = M(() => {
431
431
  const o = e == null ? void 0 : e.getExtensionPoint(t);
432
432
  if (!o) {
433
433
  if (n.current && n.current.store === void 0)
434
434
  return n.current.sentinel;
435
- const l = {};
436
- return n.current = { store: void 0, version: -1, sentinel: l }, l;
435
+ const d = {};
436
+ return n.current = { store: void 0, version: -1, sentinel: d }, d;
437
437
  }
438
438
  const a = n.current;
439
439
  if (a && a.store === o && a.version === o.version)
@@ -441,30 +441,30 @@ function ss(t) {
441
441
  const c = {};
442
442
  return n.current = { store: o, version: o.version, sentinel: c }, c;
443
443
  }, [e, t]);
444
- return ht(s, i), e == null ? void 0 : e.getExtensionPoint(t);
444
+ return vt(s, i), e == null ? void 0 : e.getExtensionPoint(t);
445
445
  }
446
- const os = ({ registry: t, children: e }) => {
446
+ const ps = ({ registry: t, children: e }) => {
447
447
  const n = C.useRef(t);
448
- return me(
448
+ return ve(
449
449
  n.current === t,
450
450
  "You can't change the extension registry after it has been rendered"
451
- ), /* @__PURE__ */ A(Ze.Provider, { value: n.current, children: e });
452
- }, ge = (t) => {
451
+ ), /* @__PURE__ */ R(rt.Provider, { value: n.current, children: e });
452
+ }, me = (t) => {
453
453
  if (!t || typeof t != "string")
454
454
  throw new TypeError(`extensionName is required to be a string and can't be: "${t}" (${typeof t})`);
455
455
  return t.trim();
456
456
  };
457
- class Nn {
457
+ class $n {
458
458
  constructor(e) {
459
- x(this, "id");
460
- x(this, "mode");
461
- x(this, "_pluginId");
462
- x(this, "_version", 0);
463
- x(this, "_contributions", /* @__PURE__ */ new Map());
464
- x(this, "_lookupCache", /* @__PURE__ */ new Map());
465
- x(this, "_matcher");
466
- x(this, "_select");
467
- x(this, "_listeners", /* @__PURE__ */ new Set());
459
+ L(this, "id");
460
+ L(this, "mode");
461
+ L(this, "_pluginId");
462
+ L(this, "_version", 0);
463
+ L(this, "_contributions", /* @__PURE__ */ new Map());
464
+ L(this, "_lookupCache", /* @__PURE__ */ new Map());
465
+ L(this, "_matcher");
466
+ L(this, "_select");
467
+ L(this, "_listeners", /* @__PURE__ */ new Set());
468
468
  this.id = e.id, this.mode = e.mode ?? "multiple", this._pluginId = e.pluginId, this._matcher = e.matcher, this._select = e.select;
469
469
  }
470
470
  get pluginId() {
@@ -574,11 +574,11 @@ class Nn {
574
574
  e();
575
575
  }
576
576
  }
577
- class is {
577
+ class hs {
578
578
  constructor(e) {
579
- x(this, "_stores", /* @__PURE__ */ new Map());
580
- x(this, "_storeUnsubs", /* @__PURE__ */ new Map());
581
- x(this, "_listeners", /* @__PURE__ */ new Set());
579
+ L(this, "_stores", /* @__PURE__ */ new Map());
580
+ L(this, "_storeUnsubs", /* @__PURE__ */ new Map());
581
+ L(this, "_listeners", /* @__PURE__ */ new Set());
582
582
  if (e != null && e.initialStores)
583
583
  for (const n of e.initialStores)
584
584
  this.addExtensionPoint(n);
@@ -588,28 +588,28 @@ class is {
588
588
  * Throws if the extension point ID already exists.
589
589
  */
590
590
  addExtensionPoint(e) {
591
- const n = ge(e.id);
591
+ const n = me(e.id);
592
592
  if (this._stores.has(n)) {
593
593
  const s = this._stores.get(n);
594
594
  throw new Error(
595
595
  `Extension point "${n}" already exists (owned by "${s.pluginId ?? "unknown"}")`
596
596
  );
597
597
  }
598
- const r = new Nn({ ...e, id: n });
598
+ const r = new $n({ ...e, id: n });
599
599
  this._stores.set(n, r), this._storeUnsubs.set(n, r.subscribe(() => this._notify())), this._notify();
600
600
  }
601
601
  /**
602
602
  * Get an extension point store by ID.
603
603
  */
604
604
  getExtensionPoint(e) {
605
- const n = ge(e);
605
+ const n = me(e);
606
606
  return this._stores.get(n);
607
607
  }
608
608
  /**
609
609
  * Check if an extension point exists.
610
610
  */
611
611
  hasExtensionPoint(e) {
612
- const n = ge(e);
612
+ const n = me(e);
613
613
  return this._stores.has(n);
614
614
  }
615
615
  /**
@@ -650,151 +650,296 @@ class is {
650
650
  e();
651
651
  }
652
652
  }
653
- const et = ae(void 0), Pn = {
653
+ const $ = {
654
+ Panel: {
655
+ position: "fixed",
656
+ right: "var(--ov-space-3)",
657
+ bottom: 36,
658
+ zIndex: "calc(var(--ov-z-toast, 9999) + 1)",
659
+ width: "min(480px, calc(100vw - 24px))",
660
+ minWidth: 0,
661
+ maxHeight: "min(560px, calc(100dvh - 64px))",
662
+ display: "flex",
663
+ flexDirection: "column",
664
+ overflow: "hidden",
665
+ padding: 0
666
+ },
667
+ Header: {
668
+ flex: "none",
669
+ gap: "var(--ov-space-2)",
670
+ paddingInline: "var(--ov-space-3)",
671
+ background: "var(--ov-color-bg-surface-raised)",
672
+ borderBottom: "1px solid var(--ov-color-border-muted)"
673
+ },
674
+ HeaderActions: { marginLeft: "auto" },
675
+ List: { minHeight: 0, overflowY: "auto", overscrollBehavior: "contain" },
676
+ Notice: { borderTop: "1px solid var(--ov-color-border-muted)" },
677
+ Row: {
678
+ display: "flex",
679
+ alignItems: "center",
680
+ gap: "var(--ov-space-1)",
681
+ padding: "var(--ov-space-2) var(--ov-space-2) var(--ov-space-2) var(--ov-space-3)"
682
+ },
683
+ ErrorIcon: { flex: "none", color: "var(--ov-color-danger)" },
684
+ Message: { flex: 1, minWidth: 0, justifyContent: "flex-start", textAlign: "left" },
685
+ MessageText: { minWidth: 0, overflowWrap: "anywhere" },
686
+ Details: { padding: "0 var(--ov-space-3) var(--ov-space-3) 36px" },
687
+ Code: {
688
+ display: "block",
689
+ margin: "var(--ov-space-2) 0",
690
+ padding: "var(--ov-space-3)",
691
+ maxHeight: 240,
692
+ overflow: "auto",
693
+ whiteSpace: "pre-wrap",
694
+ overflowWrap: "anywhere",
695
+ lineHeight: 1.5,
696
+ userSelect: "text"
697
+ },
698
+ Actions: { display: "flex", flexWrap: "wrap", gap: "var(--ov-space-2)" },
699
+ CopyError: {
700
+ margin: 0,
701
+ padding: "var(--ov-space-3)",
702
+ borderTop: "1px solid var(--ov-color-border-muted)"
703
+ }
704
+ }, st = ue(void 0), Wn = {
654
705
  default: "info",
655
706
  info: "info",
656
707
  success: "success",
657
708
  warning: "warning",
658
709
  error: "danger"
659
- }, as = ({ children: t }) => {
660
- const { toast: e } = Sn(), [n, r] = C.useState([]), [s, i] = C.useState([]), [o, a] = C.useState(!1), [c, l] = C.useState(), [u, d] = C.useState(""), g = C.useRef(Date.now()), h = (y) => {
661
- r((f) => [...f, y]);
662
- }, E = (y, f, p) => {
663
- const w = typeof y == "object";
664
- let m = "", v = "info", b, S = 5e3, _;
665
- if (w) {
666
- if (m = y.message, y.showOnce) {
667
- if (n.includes(m))
710
+ }, gs = ({ children: t }) => {
711
+ const { toast: e } = bn(), [n, r] = C.useState([]), [s, i] = C.useState([]), [o, a] = C.useState(!1), [c, d] = C.useState(), [l, f] = C.useState(""), h = C.useRef(Date.now()), g = C.useRef(null);
712
+ C.useEffect(() => {
713
+ var _;
714
+ if (!o)
715
+ return;
716
+ const u = document.activeElement;
717
+ (_ = g.current) == null || _.focus();
718
+ const p = (y) => {
719
+ y.key === "Escape" && (y.stopPropagation(), a(!1));
720
+ };
721
+ return document.addEventListener("keydown", p), () => {
722
+ document.removeEventListener("keydown", p), u instanceof HTMLElement && u.isConnected && u.focus();
723
+ };
724
+ }, [o]);
725
+ const m = (u) => {
726
+ r((p) => [...p, u]);
727
+ }, S = (u, p, _) => {
728
+ const y = typeof u == "object";
729
+ let E = "", w = "info", v, b = 5e3, I;
730
+ if (y) {
731
+ if (E = u.message, u.showOnce) {
732
+ if (n.includes(E))
668
733
  return;
669
- h(m);
734
+ m(E);
670
735
  }
671
- v = y.status, b = y.details, S = y.autoHideDuration ?? 5e3, _ = y.actions;
736
+ w = u.status, v = u.details, b = u.autoHideDuration ?? 5e3, I = u.actions;
672
737
  } else
673
- m = y, v = f, b = p;
674
- let R;
675
- if (v === "error") {
676
- const O = {
677
- id: ++g.current,
678
- message: m,
679
- details: b,
738
+ E = u, w = p, v = _;
739
+ let A;
740
+ if (w === "error") {
741
+ const k = {
742
+ id: ++h.current,
743
+ message: E,
744
+ details: v,
680
745
  created: (/* @__PURE__ */ new Date()).toISOString(),
681
- actions: _
746
+ actions: I
682
747
  };
683
- i((q) => [...q, O].slice(-20)), R = { label: "Details", onClick: () => {
684
- l(O.id), a(!0);
748
+ i((P) => [...P, k].slice(-20)), A = { label: "Details", onClick: () => {
749
+ d(k.id), a(!0);
685
750
  } };
686
751
  }
687
- e(v === "error" ? m : b ?? m, {
688
- severity: Pn[v] ?? "info",
689
- title: v !== "error" && b ? m : void 0,
690
- duration: S,
691
- action: R ?? (_ == null ? void 0 : _[0])
752
+ e(w === "error" ? E : v ?? E, {
753
+ severity: Wn[w] ?? "info",
754
+ title: w !== "error" && v ? E : void 0,
755
+ duration: b,
756
+ action: A ?? (I == null ? void 0 : I[0])
692
757
  });
693
758
  };
694
- return /* @__PURE__ */ H(et.Provider, { value: { showSnackbar: E, openNotifications: () => a(!0), notificationCount: s.length }, children: [
759
+ return /* @__PURE__ */ q(st.Provider, { value: { showSnackbar: S, openNotifications: () => {
760
+ a(!0);
761
+ }, notificationCount: s.length }, children: [
695
762
  t,
696
- o && /* @__PURE__ */ H("aside", { "aria-label": "Notifications", style: {
697
- position: "fixed",
698
- right: 16,
699
- bottom: 64,
700
- zIndex: 1400,
701
- width: "min(600px, calc(100vw - 32px))",
702
- maxHeight: "70vh",
703
- overflow: "auto",
704
- padding: 16,
705
- background: "var(--ov-color-bg-surface, #202020)",
706
- color: "var(--ov-color-fg-default, #eee)",
707
- border: "1px solid currentColor",
708
- borderRadius: 8
709
- }, children: [
710
- /* @__PURE__ */ A("h2", { children: "Notifications" }),
711
- /* @__PURE__ */ A(ee, { size: "sm", variant: "ghost", onClick: () => a(!1), children: "Close" }),
712
- /* @__PURE__ */ A(ee, { size: "sm", variant: "ghost", onClick: () => {
713
- i([]), l(void 0), d("");
714
- }, children: "Clear history" }),
715
- s.length === 0 && /* @__PURE__ */ A("p", { children: "No recent errors." }),
716
- s.slice().reverse().map((y) => {
717
- var f;
718
- return /* @__PURE__ */ H("details", { open: c === y.id, onToggle: (p) => {
719
- p.currentTarget.open && l(y.id);
720
- }, children: [
721
- /* @__PURE__ */ H("summary", { children: [
722
- y.message,
723
- " — ",
724
- /* @__PURE__ */ A("time", { dateTime: y.created, children: new Date(y.created).toLocaleString() })
763
+ o && /* @__PURE__ */ q(
764
+ Rn,
765
+ {
766
+ ref: g,
767
+ style: $.Panel,
768
+ size: "sm",
769
+ variant: "outline",
770
+ surface: "overlay",
771
+ elevation: 3,
772
+ "aria-label": "Notifications",
773
+ tabIndex: -1,
774
+ children: [
775
+ /* @__PURE__ */ q(Fe, { size: "sm", style: $.Header, children: [
776
+ /* @__PURE__ */ R(ee, { size: "sm", weight: "semibold", children: "Notifications" }),
777
+ /* @__PURE__ */ R(ee, { size: "xs", tone: "muted", children: s.length }),
778
+ /* @__PURE__ */ q(Fe.Group, { style: $.HeaderActions, children: [
779
+ /* @__PURE__ */ R(
780
+ ne,
781
+ {
782
+ size: "sm",
783
+ variant: "ghost",
784
+ "aria-label": "Clear history",
785
+ title: "Clear history",
786
+ disabled: s.length === 0,
787
+ onClick: () => {
788
+ i([]), d(void 0), f("");
789
+ },
790
+ children: /* @__PURE__ */ R("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ R("path", { d: "m3 3 6 6m0-6L3 9M13 6h8M3 14h18M3 20h18" }) })
791
+ }
792
+ ),
793
+ /* @__PURE__ */ R(
794
+ ne,
795
+ {
796
+ size: "sm",
797
+ variant: "ghost",
798
+ "aria-label": "Close notifications",
799
+ title: "Close notifications",
800
+ onClick: () => {
801
+ a(!1);
802
+ },
803
+ children: /* @__PURE__ */ R("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ R("path", { d: "m6 9 6 6 6-6" }) })
804
+ }
805
+ )
806
+ ] })
725
807
  ] }),
726
- /* @__PURE__ */ A("pre", { style: { whiteSpace: "pre-wrap", overflowWrap: "anywhere", userSelect: "text" }, children: y.details || y.message }),
727
- /* @__PURE__ */ A(ee, { size: "sm", variant: "ghost", onClick: async () => {
728
- d("");
729
- try {
730
- await navigator.clipboard.writeText(`${y.message}
731
- ${y.created}
732
- ${y.details ?? ""}`);
733
- } catch {
734
- d("Copy failed. Select the diagnostic text and copy it manually.");
735
- }
736
- }, children: "Copy details" }),
737
- (f = y.actions) == null ? void 0 : f.map((p, w) => /* @__PURE__ */ A(ee, { size: "sm", variant: "ghost", onClick: p.onClick, children: p.label }, `${p.label}-${w}`))
738
- ] }, y.id);
739
- }),
740
- u && /* @__PURE__ */ A("p", { role: "status", children: u })
741
- ] })
808
+ /* @__PURE__ */ q("div", { style: $.List, children: [
809
+ s.length === 0 && /* @__PURE__ */ R(In, { size: "sm", title: "No recent errors", description: "Error details will appear here." }),
810
+ s.slice().reverse().map((u) => {
811
+ var _, y;
812
+ const p = c === u.id;
813
+ return /* @__PURE__ */ q("div", { style: $.Notice, children: [
814
+ /* @__PURE__ */ q("div", { style: $.Row, children: [
815
+ /* @__PURE__ */ q("svg", { style: $.ErrorIcon, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-label": "Error", role: "img", children: [
816
+ /* @__PURE__ */ R("circle", { cx: "12", cy: "12", r: "9" }),
817
+ /* @__PURE__ */ R("path", { d: "m9 9 6 6m0-6-6 6" })
818
+ ] }),
819
+ /* @__PURE__ */ R(
820
+ pe,
821
+ {
822
+ size: "sm",
823
+ variant: "ghost",
824
+ style: $.Message,
825
+ "aria-expanded": p,
826
+ "aria-controls": `notification-${u.id}`,
827
+ title: u.message,
828
+ onClick: () => {
829
+ d(p ? void 0 : u.id), f("");
830
+ },
831
+ children: /* @__PURE__ */ R(ee, { size: "sm", style: $.MessageText, truncate: !p, children: u.message })
832
+ }
833
+ ),
834
+ /* @__PURE__ */ R(
835
+ ne,
836
+ {
837
+ size: "sm",
838
+ variant: "ghost",
839
+ "aria-label": p ? "Collapse details" : "Expand details",
840
+ title: p ? "Collapse details" : "Expand details",
841
+ "aria-expanded": p,
842
+ "aria-controls": `notification-${u.id}`,
843
+ onClick: () => {
844
+ d(p ? void 0 : u.id), f("");
845
+ },
846
+ children: /* @__PURE__ */ R("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ R("path", { d: p ? "m6 15 6-6 6 6" : "m6 9 6 6 6-6" }) })
847
+ }
848
+ ),
849
+ /* @__PURE__ */ R(
850
+ ne,
851
+ {
852
+ size: "sm",
853
+ variant: "ghost",
854
+ "aria-label": `Dismiss ${u.message}`,
855
+ title: "Dismiss notification",
856
+ onClick: () => {
857
+ i((E) => E.filter((w) => w.id !== u.id)), p && (d(void 0), f(""));
858
+ },
859
+ children: /* @__PURE__ */ R("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ R("path", { d: "m6 6 12 12m0-12L6 18" }) })
860
+ }
861
+ )
862
+ ] }),
863
+ /* @__PURE__ */ R("div", { id: `notification-${u.id}`, hidden: !p, style: $.Details, children: p && /* @__PURE__ */ q(St, { children: [
864
+ /* @__PURE__ */ R(ee, { size: "xs", tone: "muted", children: /* @__PURE__ */ R("time", { dateTime: u.created, children: new Date(u.created).toLocaleString() }) }),
865
+ /* @__PURE__ */ R(On, { size: "sm", style: $.Code, children: (_ = u.details) != null && _.length ? u.details : u.message }),
866
+ /* @__PURE__ */ q("div", { style: $.Actions, children: [
867
+ /* @__PURE__ */ R(pe, { size: "sm", variant: "ghost", onClick: async () => {
868
+ f("");
869
+ try {
870
+ await navigator.clipboard.writeText(`${u.message}
871
+ ${u.created}
872
+ ${u.details ?? ""}`);
873
+ } catch {
874
+ f("Copy failed. Select the diagnostic text and copy it manually.");
875
+ }
876
+ }, children: "Copy details" }),
877
+ (y = u.actions) == null ? void 0 : y.map((E, w) => /* @__PURE__ */ R(pe, { size: "sm", variant: "outline", onClick: E.onClick, children: E.label }, `${E.label}-${w}`))
878
+ ] })
879
+ ] }) })
880
+ ] }, u.id);
881
+ })
882
+ ] }),
883
+ l && /* @__PURE__ */ R(ee, { as: "p", size: "sm", role: "status", style: $.CopyError, children: l })
884
+ ]
885
+ }
886
+ )
742
887
  ] });
743
- }, G = () => {
744
- const t = J(et);
888
+ }, Q = () => {
889
+ const t = X(st);
745
890
  if (t === void 0)
746
891
  throw new Error("useCustomSnackbar must be used within a CustomSnackbarProvider");
747
892
  return t;
748
893
  };
749
894
  function T(t) {
750
- const e = J(Se), n = (e == null ? void 0 : e.pluginId) ?? t;
895
+ const e = X(_e), n = (e == null ? void 0 : e.pluginId) ?? t;
751
896
  if (!n)
752
897
  throw new Error(
753
898
  "pluginID must be provided either via PluginContext or as an explicit parameter"
754
899
  );
755
900
  return n;
756
901
  }
757
- const cs = ({ pluginID: t, connectionID: e }) => {
758
- const n = T(t), r = K(), { showSnackbar: s } = G(), i = [n, "connection", "detail", e], { mutateAsync: o } = P({
759
- mutationFn: async () => Rt(n, e),
760
- onSuccess(d) {
761
- r.setQueryData(i, d), r.invalidateQueries({
902
+ const ys = ({ pluginID: t, connectionID: e }) => {
903
+ const n = T(t), r = B(), { showSnackbar: s } = Q(), i = [n, "connection", "detail", e], { mutateAsync: o } = N({
904
+ mutationFn: async () => Dt(n, e),
905
+ onSuccess(f) {
906
+ r.setQueryData(i, f), r.invalidateQueries({
762
907
  queryKey: ["EDITOR_SCHEMAS", n, e]
763
908
  });
764
909
  },
765
- onError: k(s, "Failed to start connection")
766
- }), { mutateAsync: a } = P({
767
- mutationFn: async () => Le(n, e),
768
- onSuccess(d) {
769
- r.setQueryData(i, d);
910
+ onError: U(s, "Failed to start connection")
911
+ }), { mutateAsync: a } = N({
912
+ mutationFn: async () => qe(n, e),
913
+ onSuccess(f) {
914
+ r.setQueryData(i, f);
770
915
  },
771
- onError: k(s, "Failed to stop connection")
772
- }), { mutateAsync: c } = P({
773
- mutationFn: async (d) => It(n, d),
774
- onSuccess(d, { name: g }) {
775
- s({ message: `Connection ${g} successfully updated`, status: "success" }), r.setQueryData(i, d), r.setQueriesData(
916
+ onError: U(s, "Failed to stop connection")
917
+ }), { mutateAsync: c } = N({
918
+ mutationFn: async (f) => xt(n, f),
919
+ onSuccess(f, { name: h }) {
920
+ s({ message: `Connection ${h} successfully updated`, status: "success" }), r.setQueryData(i, f), r.setQueriesData(
776
921
  { queryKey: [n, "connection", "list"] },
777
- (h) => h == null ? void 0 : h.map((E) => E.id === e ? d : E)
922
+ (g) => g == null ? void 0 : g.map((m) => m.id === e ? f : m)
778
923
  );
779
924
  },
780
- onError: k(s, "Failed to update connection")
781
- }), { mutateAsync: l } = P({
782
- mutationFn: async () => Ot(n, e),
925
+ onError: U(s, "Failed to update connection")
926
+ }), { mutateAsync: d } = N({
927
+ mutationFn: async () => Ft(n, e),
783
928
  onSuccess() {
784
929
  s({ message: "Connection successfully removed", status: "success" }), r.setQueryData(i, void 0), r.setQueriesData(
785
930
  { queryKey: [n, "connection", "list"] },
786
- (d) => d == null ? void 0 : d.filter((g) => g.id !== e)
931
+ (f) => f == null ? void 0 : f.filter((h) => h.id !== e)
787
932
  );
788
933
  },
789
- onError: k(s, "Failed to remove connection")
934
+ onError: U(s, "Failed to remove connection")
790
935
  });
791
936
  return {
792
937
  /**
793
938
  * Get the connection
794
939
  */
795
- connection: N({
940
+ connection: F({
796
941
  queryKey: i,
797
- queryFn: async () => At(n, e)
942
+ queryFn: async () => Nt(n, e)
798
943
  }),
799
944
  /**
800
945
  * Start the connection
@@ -811,61 +956,61 @@ const cs = ({ pluginID: t, connectionID: e }) => {
811
956
  /**
812
957
  * Delete the connection
813
958
  */
814
- deleteConnection: l
959
+ deleteConnection: d
815
960
  };
816
- }, xn = (t) => [t, "connection", "list"], us = ({ plugin: t }) => {
817
- const e = T(t), n = K(), { showSnackbar: r } = G(), s = xn(e), { mutateAsync: i } = P({
818
- mutationFn: async (l) => Ue(e, l.id),
819
- onError: k(r, "Failed to start connection watch")
820
- }), { mutateAsync: o } = P({
821
- mutationFn: async (l) => Tt(e, l.id),
822
- onError: k(r, "Failed to stop connection watch")
823
- }), a = C.useCallback((l) => {
824
- const u = l.data;
825
- console.log("got update to connections", u), n.setQueryData(s, u);
961
+ }, Gn = (t) => [t, "connection", "list"], ms = ({ plugin: t }) => {
962
+ const e = T(t), n = B(), { showSnackbar: r } = Q(), s = Gn(e), { mutateAsync: i } = N({
963
+ mutationFn: async (d) => $e(e, d.id),
964
+ onError: U(r, "Failed to start connection watch")
965
+ }), { mutateAsync: o } = N({
966
+ mutationFn: async (d) => Pt(e, d.id),
967
+ onError: U(r, "Failed to stop connection watch")
968
+ }), a = C.useCallback((d) => {
969
+ const l = d.data;
970
+ console.log("got update to connections", l), n.setQueryData(s, l);
826
971
  }, [n, s]);
827
972
  return C.useEffect(() => {
828
- const l = D(`${e}/connection/sync`, a);
973
+ const d = x(`${e}/connection/sync`, a);
829
974
  return () => {
830
- l();
975
+ d();
831
976
  };
832
977
  }, [e, a]), {
833
- connections: N({
978
+ connections: F({
834
979
  queryKey: s,
835
980
  queryFn: async () => {
836
981
  try {
837
- return await Ft(e);
838
- } catch (l) {
839
- console.log(l), k(r, "Failed to load connections")(l);
982
+ return await Lt(e);
983
+ } catch (d) {
984
+ console.log(d), U(r, "Failed to load connections")(d);
840
985
  }
841
986
  return [];
842
987
  },
843
988
  staleTime: 3e4,
844
- placeholderData: ze
989
+ placeholderData: Xe
845
990
  }),
846
991
  startWatch: i,
847
992
  stopWatch: o
848
993
  };
849
- }, ls = ({ pluginID: t, connectionID: e }) => {
994
+ }, Es = ({ pluginID: t, connectionID: e }) => {
850
995
  const n = T(t);
851
996
  return {
852
997
  /**
853
998
  * Get the connection
854
999
  */
855
- namespaces: N({
1000
+ namespaces: F({
856
1001
  queryKey: [n, "connection", "namespaces", e],
857
- queryFn: async () => Dt(n, e)
1002
+ queryFn: async () => kt(n, e)
858
1003
  })
859
1004
  };
860
- }, I = _n(dn, "WatchState");
861
- function Ee(t) {
1005
+ }, O = An(yn, "WatchState");
1006
+ function Ce(t) {
862
1007
  const e = Object.values(t.states), n = e.length;
863
1008
  let r = 0, s = 0, i = 0, o = 0;
864
- for (const u of e)
865
- u === I.WatchStateSynced && r++, (u === I.WatchStateError || u === I.WatchStateFailed) && s++, u === I.WatchStateForbidden && i++, u === I.WatchStateSkipped && o++;
1009
+ for (const l of e)
1010
+ l === O.WatchStateSynced && r++, (l === O.WatchStateError || l === O.WatchStateFailed) && s++, l === O.WatchStateForbidden && i++, l === O.WatchStateSkipped && o++;
866
1011
  const a = n - o, c = e.filter(
867
- (u) => u === I.WatchStateSynced || u === I.WatchStateError || u === I.WatchStateStopped || u === I.WatchStateFailed || u === I.WatchStateForbidden
868
- ).length, l = a > 0 ? c / a : 0;
1012
+ (l) => l === O.WatchStateSynced || l === O.WatchStateError || l === O.WatchStateStopped || l === O.WatchStateFailed || l === O.WatchStateForbidden
1013
+ ).length, d = a > 0 ? c / a : 0;
869
1014
  return {
870
1015
  pluginID: t.pluginID,
871
1016
  connectionID: t.connectionID,
@@ -876,24 +1021,24 @@ function Ee(t) {
876
1021
  forbiddenCount: i,
877
1022
  skippedCount: o,
878
1023
  doneCount: c,
879
- progress: l
1024
+ progress: d
880
1025
  };
881
1026
  }
882
- function ie(t) {
1027
+ function ce(t) {
883
1028
  return t.watchedTotal > 0 && t.doneCount >= t.watchedTotal;
884
1029
  }
885
- function tt(t) {
886
- return t.some((e) => !ie(e));
1030
+ function ot(t) {
1031
+ return t.some((e) => !ce(e));
887
1032
  }
888
- function nt(t) {
1033
+ function it(t) {
889
1034
  const e = t.reduce((r, s) => r + s.watchedTotal, 0);
890
1035
  return e === 0 ? 0 : t.reduce((r, s) => r + s.doneCount, 0) / e;
891
1036
  }
892
- function Ce(t) {
1037
+ function be(t) {
893
1038
  return `${t.pluginId}/${t.connection}`;
894
1039
  }
895
- function rt(t, e) {
896
- const n = Ce(e);
1040
+ function at(t, e) {
1041
+ const n = be(e);
897
1042
  t.has(n) || t.set(n, {
898
1043
  states: {},
899
1044
  pluginID: e.pluginId,
@@ -902,163 +1047,163 @@ function rt(t, e) {
902
1047
  const r = t.get(n);
903
1048
  return r.states[e.resourceKey] = e.state, r;
904
1049
  }
905
- function ds() {
906
- const [t, e] = j(/* @__PURE__ */ new Set()), [n, r] = j({}), [s, i] = j(/* @__PURE__ */ new Map()), o = M(/* @__PURE__ */ new Map()), [a, c] = j(/* @__PURE__ */ new Map());
907
- W(() => {
908
- const m = D("plugin/crash_recovery_failed", (b) => {
909
- const S = b.data, _ = S == null ? void 0 : S.pluginID;
910
- _ && c((R) => {
911
- const O = new Map(R);
912
- return O.set(_, S.error ?? "Crash recovery failed"), O;
1050
+ function Ss() {
1051
+ const [t, e] = K(/* @__PURE__ */ new Set()), [n, r] = K({}), [s, i] = K(/* @__PURE__ */ new Map()), o = W(/* @__PURE__ */ new Map()), [a, c] = K(/* @__PURE__ */ new Map());
1052
+ j(() => {
1053
+ const y = x("plugin/crash_recovery_failed", (w) => {
1054
+ const v = w.data, b = v == null ? void 0 : v.pluginID;
1055
+ b && c((I) => {
1056
+ const A = new Map(I);
1057
+ return A.set(b, v.error ?? "Crash recovery failed"), A;
913
1058
  });
914
- }), v = D("plugin/recovered", (b) => {
915
- const S = b.data, _ = S == null ? void 0 : S.pluginID;
916
- _ && c((R) => {
917
- if (!R.has(_)) return R;
918
- const O = new Map(R);
919
- return O.delete(_), O;
1059
+ }), E = x("plugin/recovered", (w) => {
1060
+ const v = w.data, b = v == null ? void 0 : v.pluginID;
1061
+ b && c((I) => {
1062
+ if (!I.has(b)) return I;
1063
+ const A = new Map(I);
1064
+ return A.delete(b), A;
920
1065
  });
921
1066
  });
922
1067
  return () => {
923
- m(), v();
1068
+ y(), E();
924
1069
  };
925
- }, []), W(() => {
926
- Nt().then((m) => {
927
- if (!m) return;
928
- const v = {}, b = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map();
929
- for (const [_, R] of Object.entries(m))
930
- if (R) {
931
- v[_] = R.map((O) => O.connection);
932
- for (const O of R) {
933
- if (!O.started) continue;
934
- const q = `${_}/${O.connection.id}`;
935
- b.add(q);
936
- const L = {
937
- pluginID: _,
938
- connectionID: O.connection.id,
1070
+ }, []), j(() => {
1071
+ Mt().then((y) => {
1072
+ if (!y) return;
1073
+ const E = {}, w = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Map();
1074
+ for (const [b, I] of Object.entries(y))
1075
+ if (I) {
1076
+ E[b] = I.map((A) => A.connection);
1077
+ for (const A of I) {
1078
+ if (!A.started) continue;
1079
+ const k = `${b}/${A.connection.id}`;
1080
+ w.add(k);
1081
+ const P = {
1082
+ pluginID: b,
1083
+ connectionID: A.connection.id,
939
1084
  states: {}
940
1085
  };
941
- if (O.resources)
942
- for (const [le, ft] of Object.entries(O.resources))
943
- L.states[le] = ft;
944
- o.current.set(q, L), S.set(q, Ee(L));
1086
+ if (A.resources)
1087
+ for (const [fe, yt] of Object.entries(A.resources))
1088
+ P.states[fe] = yt;
1089
+ o.current.set(k, P), v.set(k, Ce(P));
945
1090
  }
946
1091
  }
947
- r(v), e(b), i(S);
1092
+ r(E), e(w), i(v);
948
1093
  }).catch(() => {
949
1094
  });
950
- }, []), W(() => D("connection/status", (v) => {
951
- const b = v.data, S = `${b.pluginID}/${b.connectionID}`;
952
- b.status === "DISCONNECTED" ? (e((_) => {
953
- const R = new Set(_);
954
- return R.delete(S), R;
955
- }), i((_) => {
956
- const R = new Map(_);
957
- return R.delete(S), R;
958
- }), o.current.delete(S)) : e((_) => {
959
- const R = new Set(_);
960
- return R.add(S), R;
961
- }), xt().then((_) => {
962
- if (!_) return;
963
- const R = {};
964
- for (const [O, q] of Object.entries(_))
965
- q != null && (R[O] = q);
966
- r(R);
1095
+ }, []), j(() => x("connection/status", (E) => {
1096
+ const w = E.data, v = `${w.pluginID}/${w.connectionID}`;
1097
+ w.status === "DISCONNECTED" ? (e((b) => {
1098
+ const I = new Set(b);
1099
+ return I.delete(v), I;
1100
+ }), i((b) => {
1101
+ const I = new Map(b);
1102
+ return I.delete(v), I;
1103
+ }), o.current.delete(v)) : e((b) => {
1104
+ const I = new Set(b);
1105
+ return I.add(v), I;
1106
+ }), qt().then((b) => {
1107
+ if (!b) return;
1108
+ const I = {};
1109
+ for (const [A, k] of Object.entries(b))
1110
+ k != null && (I[A] = k);
1111
+ r(I);
967
1112
  }).catch(() => {
968
1113
  });
969
1114
  }), []);
970
- const l = U((m) => {
971
- const v = m.data, b = Ce(v);
972
- e((R) => {
973
- if (R.has(b)) return R;
974
- const O = new Set(R);
975
- return O.add(b), O;
1115
+ const d = M((y) => {
1116
+ const E = y.data, w = be(E);
1117
+ e((I) => {
1118
+ if (I.has(w)) return I;
1119
+ const A = new Set(I);
1120
+ return A.add(w), A;
976
1121
  });
977
- const S = rt(o.current, v), _ = Ee(S);
978
- i((R) => {
979
- const O = new Map(R);
980
- return O.set(b, _), O;
1122
+ const v = at(o.current, E), b = Ce(v);
1123
+ i((I) => {
1124
+ const A = new Map(I);
1125
+ return A.set(w, b), A;
981
1126
  });
982
1127
  }, []);
983
- W(() => D("watch/STATE", l), [l]);
984
- const u = U(async (m, v) => {
985
- await Le(m, v);
986
- }, []), d = U(async (m, v) => {
987
- await Ue(m, v);
988
- }, []), g = U(async (m) => {
989
- const v = a.get(m);
990
- c((b) => {
991
- if (!b.has(m)) return b;
992
- const S = new Map(b);
993
- return S.delete(m), S;
1128
+ j(() => x("watch/STATE", d), [d]);
1129
+ const l = M(async (y, E) => {
1130
+ await qe(y, E);
1131
+ }, []), f = M(async (y, E) => {
1132
+ await $e(y, E);
1133
+ }, []), h = M(async (y) => {
1134
+ const E = a.get(y);
1135
+ c((w) => {
1136
+ if (!w.has(y)) return w;
1137
+ const v = new Map(w);
1138
+ return v.delete(y), v;
994
1139
  });
995
1140
  try {
996
- await Pt(m);
997
- } catch (b) {
998
- throw c((S) => {
999
- const _ = new Map(S);
1000
- return _.set(m, v ?? "Reload failed"), _;
1001
- }), b;
1141
+ await Ut(y);
1142
+ } catch (w) {
1143
+ throw c((v) => {
1144
+ const b = new Map(v);
1145
+ return b.set(y, E ?? "Reload failed"), b;
1146
+ }), w;
1002
1147
  }
1003
- }, [a]), h = [];
1004
- for (const m of t) {
1005
- const [v, b] = m.split("/", 2), _ = (n[v] ?? []).find((le) => le.id === b), R = s.get(m), O = R != null && !ie(R), q = R != null && R.errorCount > 0, L = a.get(v);
1006
- h.push({
1007
- pluginID: v,
1008
- connectionID: b,
1009
- name: (_ == null ? void 0 : _.name) ?? b,
1010
- avatar: (_ == null ? void 0 : _.avatar) ?? "",
1148
+ }, [a]), g = [];
1149
+ for (const y of t) {
1150
+ const [E, w] = y.split("/", 2), b = (n[E] ?? []).find((fe) => fe.id === w), I = s.get(y), A = I != null && !ce(I), k = I != null && I.errorCount > 0, P = a.get(E);
1151
+ g.push({
1152
+ pluginID: E,
1153
+ connectionID: w,
1154
+ name: (b == null ? void 0 : b.name) ?? w,
1155
+ avatar: (b == null ? void 0 : b.avatar) ?? "",
1011
1156
  isStarted: !0,
1012
- sync: R,
1013
- isSyncing: O,
1014
- hasErrors: q || L != null,
1015
- pluginFailed: L != null,
1016
- pluginError: L
1157
+ sync: I,
1158
+ isSyncing: A,
1159
+ hasErrors: k || P != null,
1160
+ pluginFailed: P != null,
1161
+ pluginError: P
1017
1162
  });
1018
1163
  }
1019
- const E = /* @__PURE__ */ new Map();
1020
- for (const m of h) {
1021
- const v = E.get(m.pluginID) ?? [];
1022
- v.push(m), E.set(m.pluginID, v);
1164
+ const m = /* @__PURE__ */ new Map();
1165
+ for (const y of g) {
1166
+ const E = m.get(y.pluginID) ?? [];
1167
+ E.push(y), m.set(y.pluginID, E);
1023
1168
  }
1024
- const y = Array.from(s.values()), f = h.filter((m) => m.isSyncing), p = h.filter((m) => m.hasErrors), w = h.filter((m) => m.pluginFailed);
1169
+ const S = Array.from(s.values()), u = g.filter((y) => y.isSyncing), p = g.filter((y) => y.hasErrors), _ = g.filter((y) => y.pluginFailed);
1025
1170
  return {
1026
- entries: h,
1027
- grouped: E,
1028
- connectedCount: h.length,
1029
- syncingCount: f.length,
1171
+ entries: g,
1172
+ grouped: m,
1173
+ connectedCount: g.length,
1174
+ syncingCount: u.length,
1030
1175
  errorCount: p.length,
1031
- failedCount: w.length,
1032
- hasSyncing: tt(y),
1033
- aggregateProgress: nt(y),
1034
- disconnect: u,
1035
- retryWatch: d,
1036
- retryPlugin: g
1176
+ failedCount: _.length,
1177
+ hasSyncing: ot(S),
1178
+ aggregateProgress: it(S),
1179
+ disconnect: l,
1180
+ retryWatch: f,
1181
+ retryPlugin: h
1037
1182
  };
1038
1183
  }
1039
- function Ln(t, e) {
1184
+ function jn(t, e) {
1040
1185
  return e === null ? t === null : Array.isArray(e) ? Array.isArray(t) : typeof e == "object" ? typeof t == "object" && t !== null && !Array.isArray(t) : typeof t == typeof e;
1041
1186
  }
1042
- function fs(t, e, n) {
1043
- const r = T(t), s = K(), i = [r, "data", e], o = N({
1187
+ function vs(t, e, n) {
1188
+ const r = T(t), s = B(), i = [r, "data", e], o = F({
1044
1189
  queryKey: i,
1045
1190
  queryFn: async () => {
1046
- const c = await Lt(r, e);
1047
- return c == null ? n : Ln(c, n) ? c : (console.warn(
1191
+ const c = await $t(r, e);
1192
+ return c == null ? n : jn(c, n) ? c : (console.warn(
1048
1193
  `[usePluginData] stored value for "${e}" has unexpected type (expected ${Array.isArray(n) ? "array" : typeof n}, got ${Array.isArray(c) ? "array" : typeof c}). Using default.`
1049
1194
  ), n);
1050
1195
  }
1051
- }), a = P({
1196
+ }), a = N({
1052
1197
  mutationFn: async (c) => {
1053
- await Ut(r, e, c);
1198
+ await Wt(r, e, c);
1054
1199
  },
1055
1200
  onMutate: async (c) => {
1056
1201
  await s.cancelQueries({ queryKey: i });
1057
- const l = s.getQueryData(i);
1058
- return s.setQueryData(i, c), { previous: l };
1202
+ const d = s.getQueryData(i);
1203
+ return s.setQueryData(i, c), { previous: d };
1059
1204
  },
1060
- onError: (c, l, u) => {
1061
- (u == null ? void 0 : u.previous) !== void 0 && s.setQueryData(i, u.previous);
1205
+ onError: (c, d, l) => {
1206
+ (l == null ? void 0 : l.previous) !== void 0 && s.setQueryData(i, l.previous);
1062
1207
  },
1063
1208
  onSettled: () => {
1064
1209
  s.invalidateQueries({ queryKey: i });
@@ -1072,23 +1217,23 @@ function fs(t, e, n) {
1072
1217
  isLoading: o.isLoading
1073
1218
  };
1074
1219
  }
1075
- const ps = () => {
1076
- const t = J(bn);
1220
+ const Cs = () => {
1221
+ const t = X(Fn);
1077
1222
  if (!t) throw new Error("useRightDrawer must be used within a RightDrawerProvider");
1078
1223
  return t;
1079
- }, st = () => {
1080
- const t = J(vn);
1224
+ }, ct = () => {
1225
+ const t = X(xn);
1081
1226
  if (t === void 0)
1082
1227
  throw new Error("useBottomDrawer must be used within a BottomDrawerProvider");
1083
1228
  return t;
1084
- }, gs = ({ pluginID: t }) => {
1085
- const e = T(t), { showSnackbar: n } = G(), { createTab: r, updateTab: s } = st();
1229
+ }, _s = ({ pluginID: t }) => {
1230
+ const e = T(t), { showSnackbar: n } = Q(), { createTab: r, updateTab: s } = ct();
1086
1231
  return {
1087
- createSession: P({
1088
- mutationFn: async ({ connectionID: o, icon: a, label: c, opts: l }) => {
1089
- const u = `pending-${crypto.randomUUID()}`;
1232
+ createSession: N({
1233
+ mutationFn: async ({ connectionID: o, icon: a, label: c, opts: d }) => {
1234
+ const l = `pending-${crypto.randomUUID()}`;
1090
1235
  r({
1091
- id: u,
1236
+ id: l,
1092
1237
  title: c ?? "Connecting...",
1093
1238
  variant: "terminal",
1094
1239
  icon: a ?? "LuSquareTerminal",
@@ -1096,97 +1241,97 @@ const ps = () => {
1096
1241
  status: "connecting",
1097
1242
  pluginID: e,
1098
1243
  connectionID: o,
1099
- opts: { ...l }
1244
+ opts: { ...d }
1100
1245
  }
1101
1246
  });
1102
- const d = fn.createFrom({
1247
+ const f = mn.createFrom({
1103
1248
  command: ["/bin/bash"],
1104
1249
  tty: !0,
1105
- ...l
1250
+ ...d
1106
1251
  });
1107
1252
  try {
1108
- const g = await kt(e, o, d);
1109
- if (!g) throw new Error("Failed to create session: null response");
1253
+ const h = await Gt(e, o, f);
1254
+ if (!h) throw new Error("Failed to create session: null response");
1110
1255
  s(
1111
- { id: u },
1256
+ { id: l },
1112
1257
  {
1113
- id: g.id,
1114
- title: c ?? `Session ${g.id.substring(0, 8)}`,
1115
- properties: { status: "connected", pluginID: e, connectionID: o, opts: { ...l } }
1258
+ id: h.id,
1259
+ title: c ?? `Session ${h.id.substring(0, 8)}`,
1260
+ properties: { status: "connected", pluginID: e, connectionID: o, opts: { ...d } }
1116
1261
  }
1117
1262
  );
1118
- } catch (g) {
1119
- const h = Q(g);
1263
+ } catch (h) {
1264
+ const g = H(h);
1120
1265
  s(
1121
- { id: u },
1266
+ { id: l },
1122
1267
  {
1123
- properties: { status: "error", error: h.detail, pluginID: e, connectionID: o, opts: { ...l } }
1268
+ properties: { status: "error", error: g.detail, pluginID: e, connectionID: o, opts: { ...d } }
1124
1269
  }
1125
- ), B(n, g, "Failed to start session");
1270
+ ), z(n, h, "Failed to start session");
1126
1271
  }
1127
1272
  }
1128
1273
  }).mutateAsync
1129
1274
  };
1130
- }, hs = ({ pluginID: t }) => {
1131
- const e = T(t), { showSnackbar: n } = G(), { createTab: r } = st(), s = P({
1275
+ }, ws = ({ pluginID: t }) => {
1276
+ const e = T(t), { showSnackbar: n } = Q(), { createTab: r } = ct(), s = N({
1132
1277
  mutationFn: async ({
1133
1278
  connectionID: o,
1134
1279
  resourceKey: a,
1135
1280
  resourceID: c,
1136
- resourceData: l,
1137
- icon: u,
1138
- label: d,
1139
- target: g,
1140
- follow: h = !0,
1141
- tailLines: E = 1e3,
1142
- params: y
1281
+ resourceData: d,
1282
+ icon: l,
1283
+ label: f,
1284
+ target: h,
1285
+ follow: g = !0,
1286
+ tailLines: m = 1e3,
1287
+ params: S
1143
1288
  }) => {
1144
- const f = pn.createFrom({
1289
+ const u = En.createFrom({
1145
1290
  resource_key: a,
1146
1291
  resource_id: c,
1147
- resource_data: l,
1148
- options: gn.createFrom({
1149
- target: g ?? "",
1150
- follow: h,
1292
+ resource_data: d,
1293
+ options: Sn.createFrom({
1294
+ target: h ?? "",
1295
+ follow: g,
1151
1296
  include_previous: !1,
1152
1297
  include_timestamps: !0,
1153
- tail_lines: E,
1298
+ tail_lines: m,
1154
1299
  since_seconds: 0,
1155
1300
  limit_bytes: 0,
1156
1301
  include_source_events: !0,
1157
- params: y ?? {}
1302
+ params: S ?? {}
1158
1303
  })
1159
- }), p = await qt(e, o, f);
1304
+ }), p = await jt(e, o, u);
1160
1305
  if (!p) throw new Error("Failed to create log session: null response");
1161
1306
  return r({
1162
1307
  id: p.id,
1163
- title: d ?? `Logs ${p.id.substring(0, 8)}`,
1308
+ title: f ?? `Logs ${p.id.substring(0, 8)}`,
1164
1309
  variant: "logs",
1165
- icon: u ?? "LuLogs"
1310
+ icon: l ?? "LuLogs"
1166
1311
  }), p;
1167
1312
  },
1168
- onError: k(n, "Failed to start log session")
1169
- }), i = P({
1313
+ onError: U(n, "Failed to start log session")
1314
+ }), i = N({
1170
1315
  mutationFn: async (o) => {
1171
- await Mt(o);
1316
+ await Qt(o);
1172
1317
  },
1173
- onError: k(n, "Failed to close log session")
1318
+ onError: U(n, "Failed to close log session")
1174
1319
  });
1175
1320
  return {
1176
1321
  createLogSession: s.mutateAsync,
1177
1322
  closeLogSession: i.mutateAsync
1178
1323
  };
1179
- }, ys = () => N({
1324
+ }, bs = () => F({
1180
1325
  queryKey: ["metric", "providers"],
1181
- queryFn: $t,
1326
+ queryFn: Kt,
1182
1327
  staleTime: 3e4
1183
- }), Un = (t) => N({
1328
+ }), Qn = (t) => F({
1184
1329
  queryKey: ["metric", "providers", t],
1185
- queryFn: () => Wt(t),
1330
+ queryFn: () => Ht(t),
1186
1331
  enabled: !!t,
1187
1332
  staleTime: 3e4
1188
- }), ms = (t) => {
1189
- var f, p;
1333
+ }), Rs = (t) => {
1334
+ var u, p;
1190
1335
  const {
1191
1336
  connectionID: e,
1192
1337
  resourceKey: n,
@@ -1197,15 +1342,15 @@ const ps = () => {
1197
1342
  shape: a = 0,
1198
1343
  // CURRENT
1199
1344
  timeRange: c,
1200
- refreshInterval: l = 0,
1201
- enabled: u = !0
1345
+ refreshInterval: d = 0,
1346
+ enabled: l = !0
1202
1347
  } = t, {
1203
- data: d,
1204
- isLoading: g
1205
- } = Un(n), h = d ?? [], E = c ? Math.max(
1348
+ data: f,
1349
+ isLoading: h
1350
+ } = Qn(n), g = f ?? [], m = c ? Math.max(
1206
1351
  Math.floor((c.end.getTime() - c.start.getTime()) / 250),
1207
1352
  15e3
1208
- ) * 1e6 : 0, y = N({
1353
+ ) * 1e6 : 0, S = F({
1209
1354
  queryKey: [
1210
1355
  "metric",
1211
1356
  "query",
@@ -1215,11 +1360,11 @@ const ps = () => {
1215
1360
  s,
1216
1361
  o,
1217
1362
  a,
1218
- (f = c == null ? void 0 : c.start) == null ? void 0 : f.getTime(),
1363
+ (u = c == null ? void 0 : c.start) == null ? void 0 : u.getTime(),
1219
1364
  (p = c == null ? void 0 : c.end) == null ? void 0 : p.getTime()
1220
1365
  ],
1221
1366
  queryFn: async () => {
1222
- const w = await Gt(
1367
+ const _ = await Bt(
1223
1368
  e,
1224
1369
  n,
1225
1370
  r,
@@ -1229,27 +1374,27 @@ const ps = () => {
1229
1374
  a,
1230
1375
  ((c == null ? void 0 : c.start) ?? /* @__PURE__ */ new Date(0)).toISOString(),
1231
1376
  ((c == null ? void 0 : c.end) ?? /* @__PURE__ */ new Date(0)).toISOString(),
1232
- E
1233
- ), m = {};
1234
- for (const [v, b] of Object.entries(w))
1235
- b != null && (m[v] = b);
1236
- return m;
1377
+ m
1378
+ ), y = {};
1379
+ for (const [E, w] of Object.entries(_))
1380
+ w != null && (y[E] = w);
1381
+ return y;
1237
1382
  },
1238
- enabled: u && !!e && !!n && (n.startsWith("cluster::") || !!r) && h.length > 0,
1239
- refetchInterval: l > 0 ? l : void 0,
1383
+ enabled: l && !!e && !!n && (n.startsWith("cluster::") || !!r) && g.length > 0,
1384
+ refetchInterval: d > 0 ? d : void 0,
1240
1385
  staleTime: 5e3,
1241
1386
  // Keep previous data visible while fetching new data (e.g. on time range change)
1242
1387
  // to prevent the chart from blinking empty.
1243
- placeholderData: ze
1388
+ placeholderData: Xe
1244
1389
  });
1245
1390
  return {
1246
- data: y.data ?? void 0,
1247
- providers: h,
1248
- isLoading: g || y.isLoading,
1249
- error: y.error,
1250
- refetch: y.refetch
1391
+ data: S.data ?? void 0,
1392
+ providers: g,
1393
+ isLoading: h || S.isLoading,
1394
+ error: S.error,
1395
+ refetch: S.refetch
1251
1396
  };
1252
- }, Es = (t) => {
1397
+ }, Is = (t) => {
1253
1398
  const {
1254
1399
  pluginID: e,
1255
1400
  connectionID: n,
@@ -1259,11 +1404,11 @@ const ps = () => {
1259
1404
  resourceData: o = {},
1260
1405
  metricIDs: a = [],
1261
1406
  interval: c = 1e4,
1262
- enabled: l = !0
1263
- } = t, u = T(e), [d, g] = j(null), [h, E] = j(null), [y, f] = j(!1), [p, w] = j(null), m = M(null), v = U(async () => {
1264
- if (!(!l || !u || !n || !r || !s))
1407
+ enabled: d = !0
1408
+ } = t, l = T(e), [f, h] = K(null), [g, m] = K(null), [S, u] = K(!1), [p, _] = K(null), y = W(null), E = M(async () => {
1409
+ if (!(!d || !l || !n || !r || !s))
1265
1410
  try {
1266
- const S = await jt(u, n, {
1411
+ const v = await zt(l, n, {
1267
1412
  resource_key: r,
1268
1413
  resource_id: s,
1269
1414
  resource_namespace: i,
@@ -1272,177 +1417,177 @@ const ps = () => {
1272
1417
  interval: c * 1e6
1273
1418
  // ms to nanoseconds for Go time.Duration
1274
1419
  });
1275
- E(S), f(!0), w(null);
1276
- const _ = D(`core/metrics/data/${S}`, (O) => {
1277
- const q = O.data;
1420
+ m(v), u(!0), _(null);
1421
+ const b = x(`core/metrics/data/${v}`, (A) => {
1422
+ const k = A.data;
1278
1423
  try {
1279
- const L = JSON.parse(q);
1280
- L.results && g(L.results);
1281
- } catch (L) {
1282
- console.error("Failed to parse metric stream data:", L);
1424
+ const P = JSON.parse(k);
1425
+ P.results && h(P.results);
1426
+ } catch (P) {
1427
+ console.error("Failed to parse metric stream data:", P);
1283
1428
  }
1284
- }), R = D(`core/metrics/error/${S}`, (O) => {
1285
- const q = O.data;
1429
+ }), I = x(`core/metrics/error/${v}`, (A) => {
1430
+ const k = A.data;
1286
1431
  try {
1287
- const L = JSON.parse(q);
1288
- w(L.error || "Unknown error");
1432
+ const P = JSON.parse(k);
1433
+ _(P.error || "Unknown error");
1289
1434
  } catch {
1290
- w("Failed to parse metric stream error");
1435
+ _("Failed to parse metric stream error");
1291
1436
  }
1292
1437
  });
1293
- m.current = () => {
1294
- _(), R();
1438
+ y.current = () => {
1439
+ b(), I();
1295
1440
  };
1296
- } catch (S) {
1297
- w(S instanceof Error ? S.message : String(S));
1441
+ } catch (v) {
1442
+ _(v instanceof Error ? v.message : String(v));
1298
1443
  }
1299
- }, [u, n, r, s, i, a, c, l]), b = U(async () => {
1300
- if (h)
1444
+ }, [l, n, r, s, i, a, c, d]), w = M(async () => {
1445
+ if (g)
1301
1446
  try {
1302
- await Oe(h);
1303
- } catch (S) {
1304
- console.error("Failed to unsubscribe:", S);
1447
+ await De(g);
1448
+ } catch (v) {
1449
+ console.error("Failed to unsubscribe:", v);
1305
1450
  }
1306
- m.current && (m.current(), m.current = null), E(null), f(!1);
1307
- }, [h]);
1308
- return W(() => () => {
1309
- h && Oe(h).catch(console.error), m.current && m.current();
1310
- }, [h]), {
1311
- data: d,
1312
- subscriptionID: h,
1313
- isStreaming: y,
1451
+ y.current && (y.current(), y.current = null), m(null), u(!1);
1452
+ }, [g]);
1453
+ return j(() => () => {
1454
+ g && De(g).catch(console.error), y.current && y.current();
1455
+ }, [g]), {
1456
+ data: f,
1457
+ subscriptionID: g,
1458
+ isStreaming: S,
1314
1459
  error: p,
1315
- start: v,
1316
- stop: b
1460
+ start: E,
1461
+ stop: w
1317
1462
  };
1318
- }, Y = ["networker", "portforward", "all-sessions"];
1319
- function Ss() {
1320
- const { showSnackbar: t } = G(), e = K(), n = N({
1321
- queryKey: [...Y],
1322
- queryFn: async () => Qt().catch((i) => {
1323
- if (Q(i).detail.includes("not found")) return [];
1463
+ }, J = ["networker", "portforward", "all-sessions"];
1464
+ function Os() {
1465
+ const { showSnackbar: t } = Q(), e = B(), n = F({
1466
+ queryKey: [...J],
1467
+ queryFn: async () => Vt().catch((i) => {
1468
+ if (H(i).detail.includes("not found")) return [];
1324
1469
  throw i;
1325
1470
  }),
1326
1471
  retry: !1
1327
1472
  });
1328
- W(() => {
1329
- const i = D("core/networker/portforward/created", () => {
1330
- e.invalidateQueries({ queryKey: [...Y] });
1331
- }), o = D("core/networker/portforward/closed", () => {
1332
- e.invalidateQueries({ queryKey: [...Y] });
1473
+ j(() => {
1474
+ const i = x("core/networker/portforward/created", () => {
1475
+ e.invalidateQueries({ queryKey: [...J] });
1476
+ }), o = x("core/networker/portforward/closed", () => {
1477
+ e.invalidateQueries({ queryKey: [...J] });
1333
1478
  });
1334
1479
  return () => {
1335
1480
  i(), o();
1336
1481
  };
1337
1482
  }, [e]);
1338
- const r = n.data ?? [], s = P({
1339
- mutationFn: async (i) => ke(i),
1340
- onError: k(t, "Failed to close port forwarding session"),
1483
+ const r = n.data ?? [], s = N({
1484
+ mutationFn: async (i) => We(i),
1485
+ onError: U(t, "Failed to close port forwarding session"),
1341
1486
  onSuccess: async () => {
1342
- await e.invalidateQueries({ queryKey: [...Y] });
1487
+ await e.invalidateQueries({ queryKey: [...J] });
1343
1488
  }
1344
1489
  });
1345
1490
  return {
1346
1491
  sessions: n,
1347
1492
  activeSessions: r,
1348
1493
  closeSession: s.mutateAsync,
1349
- openInBrowser: (i) => Be(`http://localhost:${i}`)
1494
+ openInBrowser: (i) => Je(`http://localhost:${i}`)
1350
1495
  };
1351
1496
  }
1352
- function _s({ pluginID: t, connectionID: e, resourceID: n }) {
1353
- const r = T(t), s = ["networker", "portforward", "sessions", r, e, n], { showSnackbar: i } = G(), o = K(), a = N({
1497
+ function As({ pluginID: t, connectionID: e, resourceID: n }) {
1498
+ const r = T(t), s = ["networker", "portforward", "sessions", r, e, n], { showSnackbar: i } = Q(), o = B(), a = F({
1354
1499
  queryKey: s,
1355
- queryFn: async () => Kt(r, e, hn.createFrom({
1500
+ queryFn: async () => Yt(r, e, vn.createFrom({
1356
1501
  resource_id: n,
1357
1502
  connection_id: e
1358
- })).catch((u) => {
1359
- const d = Q(u);
1360
- return d.detail.includes("not found") ? [] : (i({ message: "Failed to fetch port forward sessions", status: "error", details: d.detail }), []);
1503
+ })).catch((l) => {
1504
+ const f = H(l);
1505
+ return f.detail.includes("not found") ? [] : (i({ message: "Failed to fetch port forward sessions", status: "error", details: f.detail }), []);
1361
1506
  }),
1362
1507
  retry: !1
1363
- }), c = P({
1364
- mutationFn: async ({ opts: u }) => {
1365
- const d = yn.createFrom({
1366
- local_port: u.localPort || 0,
1367
- remote_port: u.remotePort,
1368
- protocol: u.protocol || "TCP",
1508
+ }), c = N({
1509
+ mutationFn: async ({ opts: l }) => {
1510
+ const f = Cn.createFrom({
1511
+ local_port: l.localPort || 0,
1512
+ remote_port: l.remotePort,
1513
+ protocol: l.protocol || "TCP",
1369
1514
  connection_type: "RESOURCE",
1370
1515
  connection: {
1371
- resource_data: u.resource,
1516
+ resource_data: l.resource,
1372
1517
  connection_id: e,
1373
1518
  plugin_id: r,
1374
- resource_id: u.resourceId,
1375
- resource_key: u.resourceKey
1519
+ resource_id: l.resourceId,
1520
+ resource_key: l.resourceKey
1376
1521
  },
1377
- labels: u.labels ?? {},
1378
- params: u.parameters ?? {}
1379
- }), g = await Ht(r, e, d);
1380
- if (!g) throw new Error("Failed to start port forwarding: null response");
1381
- return u.openInBrowser && Be(`http://localhost:${g.local_port}`), g;
1522
+ labels: l.labels ?? {},
1523
+ params: l.parameters ?? {}
1524
+ }), h = await Jt(r, e, f);
1525
+ if (!h) throw new Error("Failed to start port forwarding: null response");
1526
+ return l.openInBrowser && Je(`http://localhost:${h.local_port}`), h;
1382
1527
  },
1383
- onError: k(i, "Failed to start port forwarding session"),
1528
+ onError: U(i, "Failed to start port forwarding session"),
1384
1529
  onSuccess: async () => {
1385
1530
  await Promise.all([
1386
1531
  o.invalidateQueries({ queryKey: s }),
1387
- o.invalidateQueries({ queryKey: [...Y] })
1532
+ o.invalidateQueries({ queryKey: [...J] })
1388
1533
  ]);
1389
1534
  }
1390
- }), l = P({
1391
- mutationFn: async ({ opts: u }) => ke(u.sessionID),
1392
- onError: k(i, "Failed to close port forwarding session"),
1535
+ }), d = N({
1536
+ mutationFn: async ({ opts: l }) => We(l.sessionID),
1537
+ onError: U(i, "Failed to close port forwarding session"),
1393
1538
  onSuccess: async () => {
1394
1539
  await Promise.all([
1395
1540
  o.invalidateQueries({ queryKey: s }),
1396
- o.invalidateQueries({ queryKey: [...Y] })
1541
+ o.invalidateQueries({ queryKey: [...J] })
1397
1542
  ]);
1398
1543
  }
1399
1544
  });
1400
1545
  return {
1401
1546
  sessions: a,
1402
1547
  forward: c.mutateAsync,
1403
- close: l.mutateAsync
1548
+ close: d.mutateAsync
1404
1549
  };
1405
1550
  }
1406
- const Cs = () => {
1407
- const t = C.useContext(Rn);
1551
+ const Ts = () => {
1552
+ const t = C.useContext(Nn);
1408
1553
  if (!t) throw new Error("useConfirmationModal must be used within a ConfirmationModalProvider");
1409
1554
  return t;
1410
- }, ws = ({
1555
+ }, Ds = ({
1411
1556
  pluginID: t,
1412
1557
  connectionID: e,
1413
1558
  resourceKey: n,
1414
1559
  resourceID: r,
1415
1560
  namespace: s = ""
1416
1561
  }) => {
1417
- const i = T(t), o = K(), { showSnackbar: a } = G(), c = ["RESOURCE", i, e, n, r, s], { mutateAsync: l } = P({
1418
- mutationFn: async (g) => qe(i, e, n, Ge.createFrom({
1419
- input: g.input,
1562
+ const i = T(t), o = B(), { showSnackbar: a } = Q(), c = ["RESOURCE", i, e, n, r, s], { mutateAsync: d } = N({
1563
+ mutationFn: async (h) => Ge(i, e, n, He.createFrom({
1564
+ input: h.input,
1420
1565
  id: r,
1421
1566
  namespace: s
1422
1567
  })),
1423
1568
  onSuccess: async () => {
1424
1569
  a(`Resource ${r} updated`, "success"), await o.invalidateQueries({ queryKey: c });
1425
1570
  },
1426
- onError: k(a, `Failed to update resource ${r}`)
1427
- }), { mutateAsync: u } = P({
1428
- mutationFn: async (g = {}) => Me(i, e, n, je.createFrom({
1571
+ onError: U(a, `Failed to update resource ${r}`)
1572
+ }), { mutateAsync: l } = N({
1573
+ mutationFn: async (h = {}) => je(i, e, n, Be.createFrom({
1429
1574
  id: r,
1430
1575
  namespace: s,
1431
- gracePeriodSeconds: g.gracePeriodSeconds
1576
+ gracePeriodSeconds: h.gracePeriodSeconds
1432
1577
  })),
1433
1578
  onSuccess: async () => {
1434
1579
  a(`Resource ${r} deleted`, "success"), await o.invalidateQueries({ queryKey: c });
1435
1580
  },
1436
- onError: k(a, `Failed to delete resource ${r}`)
1581
+ onError: U(a, `Failed to delete resource ${r}`)
1437
1582
  });
1438
1583
  return {
1439
1584
  /**
1440
1585
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1441
1586
  * when the resource is updated or deleted via the returned update and remove mutation functions.
1442
1587
  */
1443
- resource: N({
1588
+ resource: F({
1444
1589
  queryKey: c,
1445
- queryFn: async () => Bt(i, e, n, mn.createFrom({
1590
+ queryFn: async () => Xt(i, e, n, _n.createFrom({
1446
1591
  id: r,
1447
1592
  namespace: s
1448
1593
  })),
@@ -1454,49 +1599,49 @@ const Cs = () => {
1454
1599
  *
1455
1600
  * @params opts Optional parameters to pass to the resource update
1456
1601
  */
1457
- update: l,
1602
+ update: d,
1458
1603
  /**
1459
1604
  * Delete an existing resource. A set of optional parameters can be passed to customize the delete behavior,
1460
1605
  * which if specified, will add additional default behavior set via the hook options.
1461
1606
  *
1462
1607
  * @params {object} opts Optional parameters to pass to the resource delete
1463
1608
  */
1464
- remove: u
1609
+ remove: l
1465
1610
  };
1466
- }, vs = (t) => {
1611
+ }, xs = (t) => {
1467
1612
  const e = ["component", t.plugin, t.resource, t.area];
1468
1613
  return {
1469
1614
  /**
1470
1615
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1471
1616
  * when the resource is updated or deleted via the returned update and remove mutation functions.
1472
1617
  */
1473
- component: N({
1618
+ component: F({
1474
1619
  queryKey: e,
1475
- queryFn: async () => zt(t)
1620
+ queryFn: async () => Zt(t)
1476
1621
  })
1477
1622
  };
1478
- }, bs = ({ pluginID: t, connectionID: e }) => {
1623
+ }, Fs = ({ pluginID: t, connectionID: e }) => {
1479
1624
  const n = T(t);
1480
1625
  return {
1481
1626
  /**
1482
1627
  * The resource groups for the given plugin and connection.
1483
1628
  */
1484
- groups: N({
1629
+ groups: F({
1485
1630
  queryKey: [n, "resource_groups", "list"],
1486
- queryFn: async () => Vt(n, e),
1631
+ queryFn: async () => en(n, e),
1487
1632
  retry: !1
1488
1633
  })
1489
1634
  };
1490
- }, Rs = ({
1635
+ }, Ns = ({
1491
1636
  pluginID: t,
1492
1637
  connectionID: e,
1493
1638
  searches: n
1494
1639
  }) => {
1495
1640
  const r = T(t), s = (o) => [r, e, o.key, o.namespaces, "list"];
1496
- return En({
1641
+ return wn({
1497
1642
  queries: n.map((o) => ({
1498
1643
  queryKey: s(o),
1499
- queryFn: async () => $e(r, e, o.key, Qe.createFrom({
1644
+ queryFn: async () => Qe(r, e, o.key, ze.createFrom({
1500
1645
  order: [{ field: "name", descending: !1 }],
1501
1646
  pagination: { page: 1, pageSize: 200 },
1502
1647
  namespaces: o.namespaces
@@ -1504,40 +1649,40 @@ const Cs = () => {
1504
1649
  retry: !1
1505
1650
  }))
1506
1651
  });
1507
- }, Is = ({ pluginID: t, resourceKey: e }) => {
1652
+ }, Ps = ({ pluginID: t, resourceKey: e }) => {
1508
1653
  const n = T(t);
1509
1654
  return {
1510
1655
  /**
1511
1656
  * The current settings from the provider.
1512
1657
  */
1513
- resourceType: N({
1658
+ resourceType: F({
1514
1659
  queryKey: [n, "resources", e],
1515
- queryFn: async () => Yt(n, e),
1660
+ queryFn: async () => tn(n, e),
1516
1661
  retry: !1
1517
1662
  })
1518
1663
  };
1519
- }, Os = ({ pluginID: t, connectionID: e }) => {
1664
+ }, Ls = ({ pluginID: t, connectionID: e }) => {
1520
1665
  const n = T(t);
1521
1666
  return {
1522
1667
  /**
1523
1668
  * The resource types for the given plugin and connection.
1524
1669
  */
1525
- types: N({
1670
+ types: F({
1526
1671
  queryKey: [n, "resources", "list", e],
1527
- queryFn: async () => Jt(n, e),
1672
+ queryFn: async () => nn(n, e),
1528
1673
  retry: !1
1529
1674
  })
1530
1675
  };
1531
1676
  };
1532
- var ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1533
- function kn(t) {
1677
+ var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
1678
+ function Kn(t) {
1534
1679
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1535
1680
  }
1536
- var qn = "Expected a function", ot = "__lodash_hash_undefined__", Mn = "[object Function]", $n = "[object GeneratorFunction]", Wn = "[object Symbol]", Gn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jn = /^\w*$/, Qn = /^\./, Kn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Hn = /[\\^$.*+?()[\]{}|]/g, Bn = /\\(\\)?/g, zn = /^\[object .+?Constructor\]$/, Vn = typeof ne == "object" && ne && ne.Object === Object && ne, Yn = typeof self == "object" && self && self.Object === Object && self, we = Vn || Yn || Function("return this")();
1537
- function Jn(t, e) {
1681
+ var Hn = "Expected a function", ut = "__lodash_hash_undefined__", Bn = "[object Function]", zn = "[object GeneratorFunction]", Vn = "[object Symbol]", Yn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Jn = /^\w*$/, Xn = /^\./, Zn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, er = /[\\^$.*+?()[\]{}|]/g, tr = /\\(\\)?/g, nr = /^\[object .+?Constructor\]$/, rr = typeof se == "object" && se && se.Object === Object && se, sr = typeof self == "object" && self && self.Object === Object && self, Re = rr || sr || Function("return this")();
1682
+ function or(t, e) {
1538
1683
  return t == null ? void 0 : t[e];
1539
1684
  }
1540
- function Xn(t) {
1685
+ function ir(t) {
1541
1686
  var e = !1;
1542
1687
  if (t != null && typeof t.toString != "function")
1543
1688
  try {
@@ -1546,177 +1691,177 @@ function Xn(t) {
1546
1691
  }
1547
1692
  return e;
1548
1693
  }
1549
- var Zn = Array.prototype, er = Function.prototype, it = Object.prototype, he = we["__core-js_shared__"], De = function() {
1550
- var t = /[^.]+$/.exec(he && he.keys && he.keys.IE_PROTO || "");
1694
+ var ar = Array.prototype, cr = Function.prototype, lt = Object.prototype, Ee = Re["__core-js_shared__"], Le = function() {
1695
+ var t = /[^.]+$/.exec(Ee && Ee.keys && Ee.keys.IE_PROTO || "");
1551
1696
  return t ? "Symbol(src)_1." + t : "";
1552
- }(), at = er.toString, ve = it.hasOwnProperty, ct = it.toString, tr = RegExp(
1553
- "^" + at.call(ve).replace(Hn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1554
- ), Ne = we.Symbol, nr = Zn.splice, rr = ut(we, "Map"), Z = ut(Object, "create"), Pe = Ne ? Ne.prototype : void 0, xe = Pe ? Pe.toString : void 0;
1555
- function z(t) {
1697
+ }(), dt = cr.toString, Ie = lt.hasOwnProperty, ft = lt.toString, ur = RegExp(
1698
+ "^" + dt.call(Ie).replace(er, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1699
+ ), ke = Re.Symbol, lr = ar.splice, dr = pt(Re, "Map"), te = pt(Object, "create"), Me = ke ? ke.prototype : void 0, Ue = Me ? Me.toString : void 0;
1700
+ function V(t) {
1556
1701
  var e = -1, n = t ? t.length : 0;
1557
1702
  for (this.clear(); ++e < n; ) {
1558
1703
  var r = t[e];
1559
1704
  this.set(r[0], r[1]);
1560
1705
  }
1561
1706
  }
1562
- function sr() {
1563
- this.__data__ = Z ? Z(null) : {};
1707
+ function fr() {
1708
+ this.__data__ = te ? te(null) : {};
1564
1709
  }
1565
- function or(t) {
1710
+ function pr(t) {
1566
1711
  return this.has(t) && delete this.__data__[t];
1567
1712
  }
1568
- function ir(t) {
1713
+ function hr(t) {
1569
1714
  var e = this.__data__;
1570
- if (Z) {
1715
+ if (te) {
1571
1716
  var n = e[t];
1572
- return n === ot ? void 0 : n;
1717
+ return n === ut ? void 0 : n;
1573
1718
  }
1574
- return ve.call(e, t) ? e[t] : void 0;
1719
+ return Ie.call(e, t) ? e[t] : void 0;
1575
1720
  }
1576
- function ar(t) {
1721
+ function gr(t) {
1577
1722
  var e = this.__data__;
1578
- return Z ? e[t] !== void 0 : ve.call(e, t);
1723
+ return te ? e[t] !== void 0 : Ie.call(e, t);
1579
1724
  }
1580
- function cr(t, e) {
1725
+ function yr(t, e) {
1581
1726
  var n = this.__data__;
1582
- return n[t] = Z && e === void 0 ? ot : e, this;
1583
- }
1584
- z.prototype.clear = sr;
1585
- z.prototype.delete = or;
1586
- z.prototype.get = ir;
1587
- z.prototype.has = ar;
1588
- z.prototype.set = cr;
1589
- function X(t) {
1727
+ return n[t] = te && e === void 0 ? ut : e, this;
1728
+ }
1729
+ V.prototype.clear = fr;
1730
+ V.prototype.delete = pr;
1731
+ V.prototype.get = hr;
1732
+ V.prototype.has = gr;
1733
+ V.prototype.set = yr;
1734
+ function Z(t) {
1590
1735
  var e = -1, n = t ? t.length : 0;
1591
1736
  for (this.clear(); ++e < n; ) {
1592
1737
  var r = t[e];
1593
1738
  this.set(r[0], r[1]);
1594
1739
  }
1595
1740
  }
1596
- function ur() {
1741
+ function mr() {
1597
1742
  this.__data__ = [];
1598
1743
  }
1599
- function lr(t) {
1600
- var e = this.__data__, n = ce(e, t);
1744
+ function Er(t) {
1745
+ var e = this.__data__, n = le(e, t);
1601
1746
  if (n < 0)
1602
1747
  return !1;
1603
1748
  var r = e.length - 1;
1604
- return n == r ? e.pop() : nr.call(e, n, 1), !0;
1749
+ return n == r ? e.pop() : lr.call(e, n, 1), !0;
1605
1750
  }
1606
- function dr(t) {
1607
- var e = this.__data__, n = ce(e, t);
1751
+ function Sr(t) {
1752
+ var e = this.__data__, n = le(e, t);
1608
1753
  return n < 0 ? void 0 : e[n][1];
1609
1754
  }
1610
- function fr(t) {
1611
- return ce(this.__data__, t) > -1;
1755
+ function vr(t) {
1756
+ return le(this.__data__, t) > -1;
1612
1757
  }
1613
- function pr(t, e) {
1614
- var n = this.__data__, r = ce(n, t);
1758
+ function Cr(t, e) {
1759
+ var n = this.__data__, r = le(n, t);
1615
1760
  return r < 0 ? n.push([t, e]) : n[r][1] = e, this;
1616
1761
  }
1617
- X.prototype.clear = ur;
1618
- X.prototype.delete = lr;
1619
- X.prototype.get = dr;
1620
- X.prototype.has = fr;
1621
- X.prototype.set = pr;
1622
- function V(t) {
1762
+ Z.prototype.clear = mr;
1763
+ Z.prototype.delete = Er;
1764
+ Z.prototype.get = Sr;
1765
+ Z.prototype.has = vr;
1766
+ Z.prototype.set = Cr;
1767
+ function Y(t) {
1623
1768
  var e = -1, n = t ? t.length : 0;
1624
1769
  for (this.clear(); ++e < n; ) {
1625
1770
  var r = t[e];
1626
1771
  this.set(r[0], r[1]);
1627
1772
  }
1628
1773
  }
1629
- function gr() {
1774
+ function _r() {
1630
1775
  this.__data__ = {
1631
- hash: new z(),
1632
- map: new (rr || X)(),
1633
- string: new z()
1776
+ hash: new V(),
1777
+ map: new (dr || Z)(),
1778
+ string: new V()
1634
1779
  };
1635
1780
  }
1636
- function hr(t) {
1637
- return ue(this, t).delete(t);
1781
+ function wr(t) {
1782
+ return de(this, t).delete(t);
1638
1783
  }
1639
- function yr(t) {
1640
- return ue(this, t).get(t);
1784
+ function br(t) {
1785
+ return de(this, t).get(t);
1641
1786
  }
1642
- function mr(t) {
1643
- return ue(this, t).has(t);
1787
+ function Rr(t) {
1788
+ return de(this, t).has(t);
1644
1789
  }
1645
- function Er(t, e) {
1646
- return ue(this, t).set(t, e), this;
1790
+ function Ir(t, e) {
1791
+ return de(this, t).set(t, e), this;
1647
1792
  }
1648
- V.prototype.clear = gr;
1649
- V.prototype.delete = hr;
1650
- V.prototype.get = yr;
1651
- V.prototype.has = mr;
1652
- V.prototype.set = Er;
1653
- function ce(t, e) {
1793
+ Y.prototype.clear = _r;
1794
+ Y.prototype.delete = wr;
1795
+ Y.prototype.get = br;
1796
+ Y.prototype.has = Rr;
1797
+ Y.prototype.set = Ir;
1798
+ function le(t, e) {
1654
1799
  for (var n = t.length; n--; )
1655
- if (Tr(t[n][0], e))
1800
+ if (Mr(t[n][0], e))
1656
1801
  return n;
1657
1802
  return -1;
1658
1803
  }
1659
- function Sr(t, e) {
1660
- e = vr(e, t) ? [e] : wr(e);
1804
+ function Or(t, e) {
1805
+ e = xr(e, t) ? [e] : Dr(e);
1661
1806
  for (var n = 0, r = e.length; t != null && n < r; )
1662
- t = t[Or(e[n++])];
1807
+ t = t[Lr(e[n++])];
1663
1808
  return n && n == r ? t : void 0;
1664
1809
  }
1665
- function _r(t) {
1666
- if (!dt(t) || Rr(t))
1810
+ function Ar(t) {
1811
+ if (!gt(t) || Nr(t))
1667
1812
  return !1;
1668
- var e = Fr(t) || Xn(t) ? tr : zn;
1669
- return e.test(Ar(t));
1813
+ var e = Ur(t) || ir(t) ? ur : nr;
1814
+ return e.test(kr(t));
1670
1815
  }
1671
- function Cr(t) {
1816
+ function Tr(t) {
1672
1817
  if (typeof t == "string")
1673
1818
  return t;
1674
- if (Re(t))
1675
- return xe ? xe.call(t) : "";
1819
+ if (Ae(t))
1820
+ return Ue ? Ue.call(t) : "";
1676
1821
  var e = t + "";
1677
1822
  return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
1678
1823
  }
1679
- function wr(t) {
1680
- return lt(t) ? t : Ir(t);
1824
+ function Dr(t) {
1825
+ return ht(t) ? t : Pr(t);
1681
1826
  }
1682
- function ue(t, e) {
1827
+ function de(t, e) {
1683
1828
  var n = t.__data__;
1684
- return br(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
1829
+ return Fr(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
1685
1830
  }
1686
- function ut(t, e) {
1687
- var n = Jn(t, e);
1688
- return _r(n) ? n : void 0;
1831
+ function pt(t, e) {
1832
+ var n = or(t, e);
1833
+ return Ar(n) ? n : void 0;
1689
1834
  }
1690
- function vr(t, e) {
1691
- if (lt(t))
1835
+ function xr(t, e) {
1836
+ if (ht(t))
1692
1837
  return !1;
1693
1838
  var n = typeof t;
1694
- return n == "number" || n == "symbol" || n == "boolean" || t == null || Re(t) ? !0 : jn.test(t) || !Gn.test(t) || e != null && t in Object(e);
1839
+ return n == "number" || n == "symbol" || n == "boolean" || t == null || Ae(t) ? !0 : Jn.test(t) || !Yn.test(t) || e != null && t in Object(e);
1695
1840
  }
1696
- function br(t) {
1841
+ function Fr(t) {
1697
1842
  var e = typeof t;
1698
1843
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
1699
1844
  }
1700
- function Rr(t) {
1701
- return !!De && De in t;
1845
+ function Nr(t) {
1846
+ return !!Le && Le in t;
1702
1847
  }
1703
- var Ir = be(function(t) {
1704
- t = Nr(t);
1848
+ var Pr = Oe(function(t) {
1849
+ t = $r(t);
1705
1850
  var e = [];
1706
- return Qn.test(t) && e.push(""), t.replace(Kn, function(n, r, s, i) {
1707
- e.push(s ? i.replace(Bn, "$1") : r || n);
1851
+ return Xn.test(t) && e.push(""), t.replace(Zn, function(n, r, s, i) {
1852
+ e.push(s ? i.replace(tr, "$1") : r || n);
1708
1853
  }), e;
1709
1854
  });
1710
- function Or(t) {
1711
- if (typeof t == "string" || Re(t))
1855
+ function Lr(t) {
1856
+ if (typeof t == "string" || Ae(t))
1712
1857
  return t;
1713
1858
  var e = t + "";
1714
1859
  return e == "0" && 1 / t == -1 / 0 ? "-0" : e;
1715
1860
  }
1716
- function Ar(t) {
1861
+ function kr(t) {
1717
1862
  if (t != null) {
1718
1863
  try {
1719
- return at.call(t);
1864
+ return dt.call(t);
1720
1865
  } catch {
1721
1866
  }
1722
1867
  try {
@@ -1726,9 +1871,9 @@ function Ar(t) {
1726
1871
  }
1727
1872
  return "";
1728
1873
  }
1729
- function be(t, e) {
1874
+ function Oe(t, e) {
1730
1875
  if (typeof t != "function" || e && typeof e != "function")
1731
- throw new TypeError(qn);
1876
+ throw new TypeError(Hn);
1732
1877
  var n = function() {
1733
1878
  var r = arguments, s = e ? e.apply(this, r) : r[0], i = n.cache;
1734
1879
  if (i.has(s))
@@ -1736,52 +1881,52 @@ function be(t, e) {
1736
1881
  var o = t.apply(this, r);
1737
1882
  return n.cache = i.set(s, o), o;
1738
1883
  };
1739
- return n.cache = new (be.Cache || V)(), n;
1884
+ return n.cache = new (Oe.Cache || Y)(), n;
1740
1885
  }
1741
- be.Cache = V;
1742
- function Tr(t, e) {
1886
+ Oe.Cache = Y;
1887
+ function Mr(t, e) {
1743
1888
  return t === e || t !== t && e !== e;
1744
1889
  }
1745
- var lt = Array.isArray;
1746
- function Fr(t) {
1747
- var e = dt(t) ? ct.call(t) : "";
1748
- return e == Mn || e == $n;
1890
+ var ht = Array.isArray;
1891
+ function Ur(t) {
1892
+ var e = gt(t) ? ft.call(t) : "";
1893
+ return e == Bn || e == zn;
1749
1894
  }
1750
- function dt(t) {
1895
+ function gt(t) {
1751
1896
  var e = typeof t;
1752
1897
  return !!t && (e == "object" || e == "function");
1753
1898
  }
1754
- function Dr(t) {
1899
+ function qr(t) {
1755
1900
  return !!t && typeof t == "object";
1756
1901
  }
1757
- function Re(t) {
1758
- return typeof t == "symbol" || Dr(t) && ct.call(t) == Wn;
1902
+ function Ae(t) {
1903
+ return typeof t == "symbol" || qr(t) && ft.call(t) == Vn;
1759
1904
  }
1760
- function Nr(t) {
1761
- return t == null ? "" : Cr(t);
1905
+ function $r(t) {
1906
+ return t == null ? "" : Tr(t);
1762
1907
  }
1763
- function Pr(t, e, n) {
1764
- var r = t == null ? void 0 : Sr(t, e);
1908
+ function Wr(t, e, n) {
1909
+ var r = t == null ? void 0 : Or(t, e);
1765
1910
  return r === void 0 ? n : r;
1766
1911
  }
1767
- var xr = Pr;
1768
- const re = /* @__PURE__ */ kn(xr);
1769
- function Lr(t, e, n) {
1912
+ var Gr = Wr;
1913
+ const oe = /* @__PURE__ */ Kn(Gr);
1914
+ function jr(t, e, n) {
1770
1915
  const r = t ?? { result: [], success: !0, totalCount: 0 }, s = [...r.result ?? []];
1771
1916
  for (const i of e) {
1772
- const o = re(i.payload.data, n);
1917
+ const o = oe(i.payload.data, n);
1773
1918
  switch (i.type) {
1774
1919
  case "ADD": {
1775
- s.findIndex((c) => re(c, n) === o) === -1 && s.push(i.payload.data);
1920
+ s.findIndex((c) => oe(c, n) === o) === -1 && s.push(i.payload.data);
1776
1921
  break;
1777
1922
  }
1778
1923
  case "UPDATE": {
1779
- const a = s.findIndex((c) => re(c, n) === o);
1924
+ const a = s.findIndex((c) => oe(c, n) === o);
1780
1925
  a !== -1 && (s[a] = i.payload.data);
1781
1926
  break;
1782
1927
  }
1783
1928
  case "DELETE": {
1784
- const a = s.findIndex((c) => re(c, n) === o);
1929
+ const a = s.findIndex((c) => oe(c, n) === o);
1785
1930
  a !== -1 && s.splice(a, 1);
1786
1931
  break;
1787
1932
  }
@@ -1789,126 +1934,126 @@ function Lr(t, e, n) {
1789
1934
  }
1790
1935
  return { ...r, result: s };
1791
1936
  }
1792
- function Ur(t, e, n, r, s, i) {
1793
- const o = (i == null ? void 0 : i.syncWindowMs) ?? 500, a = M([]), c = M(null), l = M(null), u = M(s);
1794
- u.current = s;
1795
- const d = U(() => {
1796
- const h = a.current;
1797
- if (a.current = [], c.current !== null && (clearTimeout(c.current), c.current = null), l.current !== null && (cancelAnimationFrame(l.current), l.current = null), !(h.length === 0 || !r)) {
1937
+ function Qr(t, e, n, r, s, i) {
1938
+ const o = (i == null ? void 0 : i.syncWindowMs) ?? 500, a = W([]), c = W(null), d = W(null), l = W(s);
1939
+ l.current = s;
1940
+ const f = M(() => {
1941
+ const g = a.current;
1942
+ if (a.current = [], c.current !== null && (clearTimeout(c.current), c.current = null), d.current !== null && (cancelAnimationFrame(d.current), d.current = null), !(g.length === 0 || !r)) {
1798
1943
  t.setQueryData(
1799
1944
  e,
1800
- (E) => Lr(E, h, r)
1945
+ (m) => jr(m, g, r)
1801
1946
  );
1802
- for (const E of h)
1803
- (E.type === "ADD" || E.type === "UPDATE") && t.setQueryData(
1804
- n(E.payload.id, E.payload.namespace),
1805
- { result: E.payload.data }
1947
+ for (const m of g)
1948
+ (m.type === "ADD" || m.type === "UPDATE") && t.setQueryData(
1949
+ n(m.payload.id, m.payload.namespace),
1950
+ { result: m.payload.data }
1806
1951
  );
1807
1952
  }
1808
- }, [t, e, n, r]), g = U(
1809
- (h) => {
1810
- a.current.push(h), !(c.current !== null || l.current !== null) && (c.current = setTimeout(d, o), u.current !== 1 && (l.current = requestAnimationFrame(d)));
1953
+ }, [t, e, n, r]), h = M(
1954
+ (g) => {
1955
+ a.current.push(g), !(c.current !== null || d.current !== null) && (c.current = setTimeout(f, o), l.current !== 1 && (d.current = requestAnimationFrame(f)));
1811
1956
  },
1812
- [d, o]
1957
+ [f, o]
1813
1958
  );
1814
- return W(() => () => {
1815
- c.current !== null && (clearTimeout(c.current), c.current = null), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
1816
- }, []), g;
1959
+ return j(() => () => {
1960
+ c.current !== null && (clearTimeout(c.current), c.current = null), d.current !== null && (cancelAnimationFrame(d.current), d.current = null);
1961
+ }, []), h;
1817
1962
  }
1818
- const As = ({
1963
+ const ks = ({
1819
1964
  pluginID: t,
1820
1965
  connectionID: e,
1821
1966
  resourceKey: n,
1822
1967
  idAccessor: r,
1823
1968
  namespaces: s
1824
1969
  }) => {
1825
- const i = T(t), o = K(), { showSnackbar: a } = G(), c = C.useMemo(() => s ?? [], [s]), l = C.useMemo(
1970
+ const i = T(t), o = B(), { showSnackbar: a } = Q(), c = C.useMemo(() => s ?? [], [s]), d = C.useMemo(
1826
1971
  () => [i, e, n, c, "list"],
1827
1972
  [i, e, n, c]
1828
- ), u = C.useCallback(
1829
- (f, p) => [i, e, n, p, f],
1973
+ ), l = C.useCallback(
1974
+ (u, p) => [i, e, n, p, u],
1830
1975
  [i, e, n]
1831
- ), { mutateAsync: d } = P({
1832
- mutationFn: async (f) => We(i, e, n, Ke.createFrom({
1833
- input: f.input,
1834
- namespace: f.namespace ?? (c.length === 1 ? c[0] : "")
1976
+ ), { mutateAsync: f } = N({
1977
+ mutationFn: async (u) => Ke(i, e, n, Ve.createFrom({
1978
+ input: u.input,
1979
+ namespace: u.namespace ?? (c.length === 1 ? c[0] : "")
1835
1980
  })),
1836
- onSuccess: async (f) => {
1837
- var v;
1838
- const p = f == null ? void 0 : f.result;
1839
- let w = "";
1840
- (v = p == null ? void 0 : p.metadata) != null && v.name ? w = p.metadata.name : p != null && p.id ? w = p.id : p != null && p.name ? w = p.name : p != null && p.ID ? w = p.ID : p != null && p.Name && (w = p.Name);
1841
- const m = w ? `Resource ${w} created` : "Resource created";
1842
- a(m, "success"), await o.invalidateQueries({ queryKey: l });
1981
+ onSuccess: async (u) => {
1982
+ var E;
1983
+ const p = u == null ? void 0 : u.result;
1984
+ let _ = "";
1985
+ (E = p == null ? void 0 : p.metadata) != null && E.name ? _ = p.metadata.name : p != null && p.id ? _ = p.id : p != null && p.name ? _ = p.name : p != null && p.ID ? _ = p.ID : p != null && p.Name && (_ = p.Name);
1986
+ const y = _ ? `Resource ${_} created` : "Resource created";
1987
+ a(y, "success"), await o.invalidateQueries({ queryKey: d });
1843
1988
  },
1844
- onError: k(a, "Failed to create resource")
1845
- }), g = N({
1846
- queryKey: l,
1847
- queryFn: async () => $e(i, e, n, Qe.createFrom({
1989
+ onError: U(a, "Failed to create resource")
1990
+ }), h = F({
1991
+ queryKey: d,
1992
+ queryFn: async () => Qe(i, e, n, ze.createFrom({
1848
1993
  order: [{ field: "name", descending: !1 }],
1849
1994
  pagination: { page: 1, pageSize: 200 },
1850
1995
  namespaces: c
1851
1996
  })),
1852
- placeholderData: (f, p) => f,
1997
+ placeholderData: (u, p) => u,
1853
1998
  retry: !1
1854
- }), [h, E] = C.useState(
1855
- I.WatchStateIdle
1999
+ }), [g, m] = C.useState(
2000
+ O.WatchStateIdle
1856
2001
  );
1857
- C.useEffect(() => D(
2002
+ C.useEffect(() => x(
1858
2003
  `${i}/${e}/watch/STATE`,
1859
2004
  (p) => {
1860
- const w = p.data;
1861
- w.resourceKey === n && E(w.state);
2005
+ const _ = p.data;
2006
+ _.resourceKey === n && m(_.state);
1862
2007
  }
1863
2008
  ), [i, e, n]);
1864
- const y = Ur(o, l, u, r, h);
2009
+ const S = Qr(o, d, l, r, g);
1865
2010
  return C.useEffect(() => {
1866
2011
  if (!r)
1867
2012
  return;
1868
- Xt(i, e, n);
1869
- const f = D(
2013
+ rn(i, e, n);
2014
+ const u = x(
1870
2015
  `${i}/${e}/${n}/ADD`,
1871
- (m) => y({ type: "ADD", payload: m.data })
1872
- ), p = D(
2016
+ (y) => S({ type: "ADD", payload: y.data })
2017
+ ), p = x(
1873
2018
  `${i}/${e}/${n}/UPDATE`,
1874
- (m) => y({ type: "UPDATE", payload: m.data })
1875
- ), w = D(
2019
+ (y) => S({ type: "UPDATE", payload: y.data })
2020
+ ), _ = x(
1876
2021
  `${i}/${e}/${n}/DELETE`,
1877
- (m) => y({ type: "DELETE", payload: m.data })
2022
+ (y) => S({ type: "DELETE", payload: y.data })
1878
2023
  );
1879
2024
  return () => {
1880
- f(), p(), w(), Zt(i, e, n);
2025
+ u(), p(), _(), sn(i, e, n);
1881
2026
  };
1882
- }, [i, e, n, y]), {
2027
+ }, [i, e, n, S]), {
1883
2028
  /**
1884
2029
  * Fetch result for the resource. The client will automatically cache the result, and update the cache
1885
2030
  * when the resources are updated or deleted via the returned create and remove mutation functions, or
1886
2031
  * the per-resource hook mutation functions.
1887
2032
  */
1888
- resources: g,
2033
+ resources: h,
1889
2034
  /**
1890
2035
  * Create a new resource. A set of optional parameters can be passed to customize the create behavior,
1891
2036
  * which if specified, will add additional default behavior set via the hook options.
1892
2037
  *
1893
2038
  * @params opts Optional parameters to pass to the resource create operation
1894
2039
  */
1895
- create: d,
2040
+ create: f,
1896
2041
  /** Current watch state for this resource type */
1897
- watchState: h,
2042
+ watchState: g,
1898
2043
  /** Whether the watch is currently syncing */
1899
- isSyncing: h === I.WatchStateSyncing,
2044
+ isSyncing: g === O.WatchStateSyncing,
1900
2045
  /** Whether the watch has fully synced */
1901
- isSynced: h === I.WatchStateSynced,
2046
+ isSynced: g === O.WatchStateSynced,
1902
2047
  /** Whether the watch encountered an error */
1903
- watchError: h === I.WatchStateError
2048
+ watchError: g === O.WatchStateError
1904
2049
  };
1905
- }, Ts = ({ pluginID: t }) => {
1906
- const e = T(t), { showSnackbar: n } = G(), r = P({
1907
- mutationFn: async ({ opts: o, input: a }) => We(
2050
+ }, Ms = ({ pluginID: t }) => {
2051
+ const e = T(t), { showSnackbar: n } = Q(), r = N({
2052
+ mutationFn: async ({ opts: o, input: a }) => Ke(
1908
2053
  e,
1909
2054
  o.connectionID,
1910
2055
  o.resourceKey,
1911
- Ke.createFrom({
2056
+ Ve.createFrom({
1912
2057
  input: a.input,
1913
2058
  namespace: a.namespace ?? o.namespace ?? ""
1914
2059
  })
@@ -1917,14 +2062,14 @@ const As = ({
1917
2062
  n(`Resource ${a.resourceID} created`, "success");
1918
2063
  },
1919
2064
  onError(o, { opts: a }) {
1920
- B(n, o, `Failed to create resource ${a.resourceID}`);
2065
+ z(n, o, `Failed to create resource ${a.resourceID}`);
1921
2066
  }
1922
- }), s = P({
1923
- mutationFn: async ({ opts: o, input: a }) => qe(
2067
+ }), s = N({
2068
+ mutationFn: async ({ opts: o, input: a }) => Ge(
1924
2069
  e,
1925
2070
  o.connectionID,
1926
2071
  o.resourceKey,
1927
- Ge.createFrom({
2072
+ He.createFrom({
1928
2073
  input: a.input,
1929
2074
  id: o.resourceID,
1930
2075
  namespace: o.namespace ?? ""
@@ -1934,14 +2079,14 @@ const As = ({
1934
2079
  n(`Resource ${a.resourceID} updated`, "success");
1935
2080
  },
1936
2081
  onError(o, { opts: a }) {
1937
- B(n, o, `Failed to update resource ${a.resourceID}`);
2082
+ z(n, o, `Failed to update resource ${a.resourceID}`);
1938
2083
  }
1939
- }), i = P({
1940
- mutationFn: async ({ opts: o, input: a }) => Me(
2084
+ }), i = N({
2085
+ mutationFn: async ({ opts: o, input: a }) => je(
1941
2086
  e,
1942
2087
  o.connectionID,
1943
2088
  o.resourceKey,
1944
- je.createFrom({
2089
+ Be.createFrom({
1945
2090
  id: o.resourceID,
1946
2091
  namespace: o.namespace ?? "",
1947
2092
  gracePeriodSeconds: a.gracePeriodSeconds
@@ -1951,7 +2096,7 @@ const As = ({
1951
2096
  n(`Resource ${a.resourceID} deleted`, "success");
1952
2097
  },
1953
2098
  onError(o, { opts: a }) {
1954
- B(n, o, `Failed to delete resource ${a.resourceID}`);
2099
+ z(n, o, `Failed to delete resource ${a.resourceID}`);
1955
2100
  }
1956
2101
  });
1957
2102
  return {
@@ -1959,15 +2104,15 @@ const As = ({
1959
2104
  update: s.mutateAsync,
1960
2105
  remove: i.mutateAsync
1961
2106
  };
1962
- }, Fs = ({
2107
+ }, Us = ({
1963
2108
  pluginID: t,
1964
2109
  connectionID: e,
1965
2110
  resourceKey: n,
1966
2111
  enabled: r = !0
1967
2112
  }) => {
1968
- const s = T(t), i = N({
2113
+ const s = T(t), i = F({
1969
2114
  queryKey: ["RESOURCE_ACTIONS", s, e, n],
1970
- queryFn: () => en(s, e, n),
2115
+ queryFn: () => on(s, e, n),
1971
2116
  enabled: r && !!s && !!e && !!n,
1972
2117
  staleTime: 5 * 60 * 1e3
1973
2118
  // actions don't change often
@@ -1977,18 +2122,18 @@ const As = ({
1977
2122
  isLoading: i.isLoading,
1978
2123
  error: i.error
1979
2124
  };
1980
- }, Ds = ({
2125
+ }, qs = ({
1981
2126
  pluginID: t,
1982
2127
  connectionID: e,
1983
2128
  resourceKey: n
1984
2129
  }) => {
1985
- const r = T(t), s = K(), { showSnackbar: i } = G(), o = P({
1986
- mutationFn: async ({ actionID: a, id: c = "", namespace: l = "", params: u = {} }) => tn(
2130
+ const r = T(t), s = B(), { showSnackbar: i } = Q(), o = N({
2131
+ mutationFn: async ({ actionID: a, id: c = "", namespace: d = "", params: l = {} }) => an(
1987
2132
  r,
1988
2133
  e,
1989
2134
  n,
1990
2135
  a,
1991
- He.createFrom({ id: c, namespace: l, params: u })
2136
+ Ye.createFrom({ id: c, namespace: d, params: l })
1992
2137
  ),
1993
2138
  onSuccess: (a) => {
1994
2139
  a != null && a.message && i(a.message, "success"), s.invalidateQueries({
@@ -1996,7 +2141,7 @@ const As = ({
1996
2141
  });
1997
2142
  },
1998
2143
  onError: (a, c) => {
1999
- B(i, a, `Failed to execute action "${c.actionID}"`);
2144
+ z(i, a, `Failed to execute action "${c.actionID}"`);
2000
2145
  }
2001
2146
  });
2002
2147
  return {
@@ -2004,14 +2149,14 @@ const As = ({
2004
2149
  isExecuting: o.isPending,
2005
2150
  error: o.error
2006
2151
  };
2007
- }, Ns = ({
2152
+ }, $s = ({
2008
2153
  pluginID: t,
2009
2154
  connectionID: e,
2010
2155
  enabled: n = !0
2011
2156
  }) => {
2012
- const r = T(t), s = N({
2157
+ const r = T(t), s = F({
2013
2158
  queryKey: ["EDITOR_SCHEMAS", r, e],
2014
- queryFn: () => nn(r, e),
2159
+ queryFn: () => cn(r, e),
2015
2160
  enabled: n && !!r && !!e,
2016
2161
  staleTime: 10 * 60 * 1e3,
2017
2162
  // schemas are fairly stable per connection
@@ -2023,115 +2168,115 @@ const As = ({
2023
2168
  error: s.error,
2024
2169
  refetch: s.refetch
2025
2170
  };
2026
- }, Ps = ({
2171
+ }, Ws = ({
2027
2172
  pluginID: t,
2028
2173
  connectionID: e,
2029
2174
  enabled: n = !0
2030
2175
  }) => {
2031
- const r = T(t), s = K(), i = [r, e, "watch-state"], o = M([]), a = M(!1), c = U((g) => {
2032
- s.setQueryData(i, (h) => {
2033
- if (!h) return h;
2034
- const E = { ...h.resources, [g.resourceKey]: g.state }, y = { ...h.resourceCounts, [g.resourceKey]: g.resourceCount };
2035
- let f = 0, p = 0;
2036
- for (const w of Object.values(E))
2037
- w === I.WatchStateSynced && f++, (w === I.WatchStateError || w === I.WatchStateFailed) && p++;
2038
- return { ...h, resources: E, resourceCounts: y, totalResources: Object.keys(E).length, syncedCount: f, errorCount: p };
2176
+ const r = T(t), s = B(), i = [r, e, "watch-state"], o = W([]), a = W(!1), c = M((h) => {
2177
+ s.setQueryData(i, (g) => {
2178
+ if (!g) return g;
2179
+ const m = { ...g.resources, [h.resourceKey]: h.state }, S = { ...g.resourceCounts, [h.resourceKey]: h.resourceCount };
2180
+ let u = 0, p = 0;
2181
+ for (const _ of Object.values(m))
2182
+ _ === O.WatchStateSynced && u++, (_ === O.WatchStateError || _ === O.WatchStateFailed) && p++;
2183
+ return { ...g, resources: m, resourceCounts: S, totalResources: Object.keys(m).length, syncedCount: u, errorCount: p };
2039
2184
  });
2040
- }, [s, r, e]), l = N({
2185
+ }, [s, r, e]), d = F({
2041
2186
  queryKey: i,
2042
2187
  queryFn: async () => {
2043
- const g = await rn(r, e);
2044
- if (!g) throw new Error("Failed to get watch state: null response");
2045
- const h = {};
2046
- let E = 0, y = 0;
2047
- for (const [p, w] of Object.entries(g.resources ?? {}))
2048
- w != null && (h[p] = w, w === I.WatchStateSynced && E++, w === I.WatchStateError && y++);
2049
- const f = {};
2050
- for (const [p, w] of Object.entries(g.resourceCounts ?? {}))
2051
- w != null && (f[p] = w);
2188
+ const h = await un(r, e);
2189
+ if (!h) throw new Error("Failed to get watch state: null response");
2190
+ const g = {};
2191
+ let m = 0, S = 0;
2192
+ for (const [p, _] of Object.entries(h.resources ?? {}))
2193
+ _ != null && (g[p] = _, _ === O.WatchStateSynced && m++, _ === O.WatchStateError && S++);
2194
+ const u = {};
2195
+ for (const [p, _] of Object.entries(h.resourceCounts ?? {}))
2196
+ _ != null && (u[p] = _);
2052
2197
  return {
2053
- connection: g.connectionId,
2054
- resources: h,
2055
- resourceCounts: f,
2056
- totalResources: Object.keys(h).length,
2057
- syncedCount: E,
2058
- errorCount: y
2198
+ connection: h.connectionId,
2199
+ resources: g,
2200
+ resourceCounts: u,
2201
+ totalResources: Object.keys(g).length,
2202
+ syncedCount: m,
2203
+ errorCount: S
2059
2204
  };
2060
2205
  },
2061
2206
  enabled: n && !!r && !!e,
2062
- refetchInterval: (g) => {
2063
- const h = g.state.data;
2064
- if (!h || h.totalResources === 0) return 3e3;
2065
- let E = 0;
2066
- for (const y of Object.values(h.resources))
2067
- (y === I.WatchStateSynced || y === I.WatchStateError || y === I.WatchStateStopped || y === I.WatchStateFailed || y === I.WatchStateForbidden || y === I.WatchStateSkipped) && E++;
2068
- return E >= h.totalResources ? !1 : 3e3;
2207
+ refetchInterval: (h) => {
2208
+ const g = h.state.data;
2209
+ if (!g || g.totalResources === 0) return 3e3;
2210
+ let m = 0;
2211
+ for (const S of Object.values(g.resources))
2212
+ (S === O.WatchStateSynced || S === O.WatchStateError || S === O.WatchStateStopped || S === O.WatchStateFailed || S === O.WatchStateForbidden || S === O.WatchStateSkipped) && m++;
2213
+ return m >= g.totalResources ? !1 : 3e3;
2069
2214
  }
2070
2215
  });
2071
- W(() => {
2072
- if (!l.data || a.current) return;
2216
+ j(() => {
2217
+ if (!d.data || a.current) return;
2073
2218
  a.current = !0;
2074
- const g = o.current;
2219
+ const h = o.current;
2075
2220
  o.current = [];
2076
- for (const h of g)
2077
- c(h);
2078
- }, [l.data, c]), W(() => {
2221
+ for (const g of h)
2222
+ c(g);
2223
+ }, [d.data, c]), j(() => {
2079
2224
  if (!n || !r || !e)
2080
2225
  return;
2081
2226
  a.current = !1, o.current = [];
2082
- const g = D(
2227
+ const h = x(
2083
2228
  `${r}/${e}/watch/STATE`,
2084
- (h) => {
2085
- const E = h.data;
2086
- a.current ? c(E) : o.current.push(E);
2229
+ (g) => {
2230
+ const m = g.data;
2231
+ a.current ? c(m) : o.current.push(m);
2087
2232
  }
2088
2233
  );
2089
2234
  return () => {
2090
- g(), a.current = !1, o.current = [];
2235
+ h(), a.current = !1, o.current = [];
2091
2236
  };
2092
2237
  }, [r, e, n, c]);
2093
- const u = l.data;
2094
- let d = 0;
2095
- if (u != null && u.resources)
2096
- for (const g of Object.values(u.resources))
2097
- (g === I.WatchStateSynced || g === I.WatchStateError || g === I.WatchStateStopped || g === I.WatchStateFailed || g === I.WatchStateForbidden || g === I.WatchStateSkipped) && d++;
2238
+ const l = d.data;
2239
+ let f = 0;
2240
+ if (l != null && l.resources)
2241
+ for (const h of Object.values(l.resources))
2242
+ (h === O.WatchStateSynced || h === O.WatchStateError || h === O.WatchStateStopped || h === O.WatchStateFailed || h === O.WatchStateForbidden || h === O.WatchStateSkipped) && f++;
2098
2243
  return {
2099
2244
  /** Full summary query result */
2100
- summary: l,
2245
+ summary: d,
2101
2246
  /** Get the state of a specific resource type's watch */
2102
- getResourceState: (g) => u == null ? void 0 : u.resources[g],
2247
+ getResourceState: (h) => l == null ? void 0 : l.resources[h],
2103
2248
  /** Whether all registered watches have reached a terminal state */
2104
- isFullySynced: u ? u.totalResources > 0 && d === u.totalResources : !1,
2249
+ isFullySynced: l ? l.totalResources > 0 && f === l.totalResources : !1,
2105
2250
  /** Sync progress as a 0-1 fraction (terminal states / total) */
2106
- syncProgress: u && u.totalResources > 0 ? d / u.totalResources : 0,
2251
+ syncProgress: l && l.totalResources > 0 ? f / l.totalResources : 0,
2107
2252
  /** Number of watches that encountered errors */
2108
- errorCount: (u == null ? void 0 : u.errorCount) ?? 0
2253
+ errorCount: (l == null ? void 0 : l.errorCount) ?? 0
2109
2254
  };
2110
- }, xs = () => {
2111
- const [t, e] = j(/* @__PURE__ */ new Map()), n = M(/* @__PURE__ */ new Map()), r = M(/* @__PURE__ */ new Map()), s = U((l) => {
2112
- const u = l.data, d = Ce(u), g = rt(n.current, u), h = Ee(g);
2113
- if (e((E) => {
2114
- const y = new Map(E);
2115
- return y.set(d, h), y;
2116
- }), r.current.has(d) && (clearTimeout(r.current.get(d)), r.current.delete(d)), ie(h)) {
2117
- const E = setTimeout(() => {
2118
- e((y) => {
2119
- const f = new Map(y);
2120
- return f.delete(d), f;
2121
- }), n.current.delete(d), r.current.delete(d);
2255
+ }, Gs = () => {
2256
+ const [t, e] = K(/* @__PURE__ */ new Map()), n = W(/* @__PURE__ */ new Map()), r = W(/* @__PURE__ */ new Map()), s = M((d) => {
2257
+ const l = d.data, f = be(l), h = at(n.current, l), g = Ce(h);
2258
+ if (e((m) => {
2259
+ const S = new Map(m);
2260
+ return S.set(f, g), S;
2261
+ }), r.current.has(f) && (clearTimeout(r.current.get(f)), r.current.delete(f)), ce(g)) {
2262
+ const m = setTimeout(() => {
2263
+ e((S) => {
2264
+ const u = new Map(S);
2265
+ return u.delete(f), u;
2266
+ }), n.current.delete(f), r.current.delete(f);
2122
2267
  }, 5e3);
2123
- r.current.set(d, E);
2268
+ r.current.set(f, m);
2124
2269
  }
2125
2270
  }, []);
2126
- W(() => {
2127
- const l = D("watch/STATE", s);
2271
+ j(() => {
2272
+ const d = x("watch/STATE", s);
2128
2273
  return () => {
2129
- l();
2130
- for (const u of r.current.values())
2131
- clearTimeout(u);
2274
+ d();
2275
+ for (const l of r.current.values())
2276
+ clearTimeout(l);
2132
2277
  };
2133
2278
  }, [s]);
2134
- const i = Array.from(t.values()), o = tt(i), a = i.find((l) => !ie(l)) ?? i[0] ?? null, c = nt(i);
2279
+ const i = Array.from(t.values()), o = ot(i), a = i.find((d) => !ce(d)) ?? i[0] ?? null, c = it(i);
2135
2280
  return {
2136
2281
  /** All tracked syncs */
2137
2282
  syncs: i,
@@ -2142,73 +2287,73 @@ const As = ({
2142
2287
  /** Aggregate progress across all connections (0-1) */
2143
2288
  aggregateProgress: c
2144
2289
  };
2145
- }, kr = () => {
2146
- const t = C.useContext(Je);
2290
+ }, Kr = () => {
2291
+ const t = C.useContext(tt);
2147
2292
  if (!t) throw new Error("useOperations must be used within an OperationsProvider");
2148
2293
  return t;
2149
- }, Ls = ({ pluginID: t, connectionID: e, resourceKey: n }) => {
2150
- const r = T(t), { showSnackbar: s } = G(), { addOperation: i, updateOperation: o } = kr(), a = C.useRef(/* @__PURE__ */ new Set()), c = C.useCallback((d, g = !1) => {
2151
- var h, E, y;
2152
- d.disposed || (d.disposed = !0, (h = d.unsubscribe) == null || h.call(d), (E = d.open) == null || E.cancel(), (y = d.attach) == null || y.cancel(), d.handle && (Ae(d.handle).catch(() => {
2153
- }), g && o(d.handle, { status: "cancelled", message: "Cancelled", completedAt: Date.now() })), a.current.delete(d));
2294
+ }, js = ({ pluginID: t, connectionID: e, resourceKey: n }) => {
2295
+ const r = T(t), { showSnackbar: s } = Q(), { addOperation: i, updateOperation: o } = Kr(), a = C.useRef(/* @__PURE__ */ new Set()), c = C.useCallback((f, h = !1) => {
2296
+ var g, m, S;
2297
+ f.disposed || (f.disposed = !0, (g = f.unsubscribe) == null || g.call(f), (m = f.open) == null || m.cancel(), (S = f.attach) == null || S.cancel(), f.handle && (xe(f.handle).catch(() => {
2298
+ }), h && o(f.handle, { status: "cancelled", message: "Cancelled", completedAt: Date.now() })), a.current.delete(f));
2154
2299
  }, [o]);
2155
2300
  C.useEffect(() => () => {
2156
- for (const d of a.current) c(d, !0);
2301
+ for (const f of a.current) c(f, !0);
2157
2302
  }, [r, e, n, c]);
2158
- const l = C.useCallback(async ({ actionID: d, id: g, namespace: h, label: E, params: y = {} }) => {
2159
- const f = { disposed: !1, terminal: !1, sequence: 0 };
2160
- a.current.add(f);
2303
+ const d = C.useCallback(async ({ actionID: f, id: h, namespace: g, label: m, params: S = {} }) => {
2304
+ const u = { disposed: !1, terminal: !1, sequence: 0 };
2305
+ a.current.add(u);
2161
2306
  try {
2162
- f.open = sn(r, e, n, d, He.createFrom({ id: g, namespace: h, params: y }));
2163
- const p = await f.open;
2164
- if (f.open = void 0, f.disposed)
2165
- return Ae(p).catch(() => {
2307
+ u.open = ln(r, e, n, f, Ye.createFrom({ id: h, namespace: g, params: S }));
2308
+ const p = await u.open;
2309
+ if (u.open = void 0, u.disposed)
2310
+ return xe(p).catch(() => {
2166
2311
  }), p;
2167
- f.handle = p, i({ id: p, label: E, resourceKey: n, resourceName: g, namespace: h, connectionID: e, status: "running", startedAt: Date.now() });
2168
- const w = (v) => {
2169
- if (f.disposed || !Number.isSafeInteger(v.sequence) || v.sequence <= f.sequence) return;
2170
- f.sequence = v.sequence;
2171
- const b = v.event, S = b.data ?? {};
2172
- if (b.type === "error") {
2173
- f.terminal = !0;
2174
- const _ = Q(b.error);
2175
- o(p, { status: oe(_) ? "cancelled" : "error", message: _.title, completedAt: Date.now() }), B(s, _, E), c(f);
2176
- } else if (b.type === "complete") {
2177
- f.terminal = !0;
2178
- const _ = typeof S.message == "string" ? S.message : `${E} completed`;
2179
- o(p, { status: "completed", message: _, completedAt: Date.now() }), s(_, "success"), c(f);
2312
+ u.handle = p, i({ id: p, label: m, resourceKey: n, resourceName: h, namespace: g, connectionID: e, status: "running", startedAt: Date.now() });
2313
+ const _ = (E) => {
2314
+ if (u.disposed || !Number.isSafeInteger(E.sequence) || E.sequence <= u.sequence) return;
2315
+ u.sequence = E.sequence;
2316
+ const w = E.event, v = w.data ?? {};
2317
+ if (w.type === "error") {
2318
+ u.terminal = !0;
2319
+ const b = H(w.error);
2320
+ o(p, { status: ae(b) ? "cancelled" : "error", message: b.title, completedAt: Date.now() }), z(s, b, m), c(u);
2321
+ } else if (w.type === "complete") {
2322
+ u.terminal = !0;
2323
+ const b = typeof v.message == "string" ? v.message : `${m} completed`;
2324
+ o(p, { status: "completed", message: b, completedAt: Date.now() }), s(b, "success"), c(u);
2180
2325
  } else
2181
2326
  o(p, {
2182
- message: typeof S.message == "string" ? S.message : void 0,
2183
- progress: typeof S.ready == "number" && typeof S.desired == "number" ? { ready: S.ready, desired: S.desired } : void 0
2327
+ message: typeof v.message == "string" ? v.message : void 0,
2328
+ progress: typeof v.ready == "number" && typeof v.desired == "number" ? { ready: v.ready, desired: v.desired } : void 0
2184
2329
  });
2185
2330
  };
2186
- f.unsubscribe = D(`action/stream/${p}`, (v) => w(v.data)), f.attach = on(p);
2187
- const m = await f.attach;
2188
- return f.attach = void 0, w(m), p;
2331
+ u.unsubscribe = x(`action/stream/${p}`, (E) => _(E.data)), u.attach = dn(p);
2332
+ const y = await u.attach;
2333
+ return u.attach = void 0, _(y), p;
2189
2334
  } catch (p) {
2190
- if (f.terminal && f.handle) return f.handle;
2191
- throw f.disposed || (f.handle && o(f.handle, { status: oe(p) ? "cancelled" : "error", message: Q(p).title, completedAt: Date.now() }), B(s, p, `Failed to start "${d}"`)), c(f), p;
2335
+ if (u.terminal && u.handle) return u.handle;
2336
+ throw u.disposed || (u.handle && o(u.handle, { status: ae(p) ? "cancelled" : "error", message: H(p).title, completedAt: Date.now() }), z(s, p, `Failed to start "${f}"`)), c(u), p;
2192
2337
  }
2193
- }, [r, e, n, i, o, s, c]), u = C.useCallback((d) => {
2194
- for (const g of a.current) if (g.handle === d) {
2195
- c(g, !0);
2338
+ }, [r, e, n, i, o, s, c]), l = C.useCallback((f) => {
2339
+ for (const h of a.current) if (h.handle === f) {
2340
+ c(h, !0);
2196
2341
  return;
2197
2342
  }
2198
2343
  }, [c]);
2199
- return { startStreamAction: l, cancelStreamAction: u };
2344
+ return { startStreamAction: d, cancelStreamAction: l };
2200
2345
  };
2201
- function qr(t, e) {
2346
+ function Hr(t, e) {
2202
2347
  return `${t}/${e}/graph/CHANGED`;
2203
2348
  }
2204
- function Ie(t, e, n, r) {
2205
- const s = K(), i = M(n);
2349
+ function Te(t, e, n, r) {
2350
+ const s = B(), i = W(n);
2206
2351
  i.current = n;
2207
2352
  const o = JSON.stringify(n);
2208
- W(() => {
2353
+ j(() => {
2209
2354
  if (!r || !t || !e)
2210
2355
  return;
2211
- const a = D(qr(t, e), () => {
2356
+ const a = x(Hr(t, e), () => {
2212
2357
  s.invalidateQueries({ queryKey: i.current, exact: !0 });
2213
2358
  });
2214
2359
  return () => {
@@ -2216,7 +2361,7 @@ function Ie(t, e, n, r) {
2216
2361
  };
2217
2362
  }, [s, t, e, o, r]);
2218
2363
  }
2219
- const Mr = {
2364
+ const Br = {
2220
2365
  owns: { outgoing: "Owns", incoming: "Owned by" },
2221
2366
  runs_on: { outgoing: "Runs on", incoming: "Running here" },
2222
2367
  uses: { outgoing: "Uses", incoming: "Used by" },
@@ -2225,19 +2370,19 @@ const Mr = {
2225
2370
  member_of: { outgoing: "Member of", incoming: "Members" },
2226
2371
  selects: { outgoing: "Selects", incoming: "Selected by" }
2227
2372
  };
2228
- function Us(t, e) {
2229
- const n = Mr[t];
2373
+ function Qs(t, e) {
2374
+ const n = Br[t];
2230
2375
  if (n)
2231
2376
  return n[e];
2232
2377
  const r = t.replace(/_/g, " ");
2233
2378
  return e === "outgoing" ? r : `${r} (incoming)`;
2234
2379
  }
2235
- function $r(t, e) {
2380
+ function zr(t, e) {
2236
2381
  return t.pluginId === e.pluginId && t.connectionId === e.connectionId && t.resourceKey === e.resourceKey && t.id === e.id && (t.namespace ?? "") === (e.namespace ?? "");
2237
2382
  }
2238
- function Wr(t, e) {
2383
+ function Vr(t, e) {
2239
2384
  return e.map((n) => {
2240
- const r = $r(n.source, t);
2385
+ const r = zr(n.source, t);
2241
2386
  return {
2242
2387
  resource: r ? n.target : n.source,
2243
2388
  type: n.type,
@@ -2246,7 +2391,7 @@ function Wr(t, e) {
2246
2391
  };
2247
2392
  });
2248
2393
  }
2249
- const ks = ({
2394
+ const Ks = ({
2250
2395
  pluginID: t,
2251
2396
  connectionID: e,
2252
2397
  resourceKey: n,
@@ -2257,31 +2402,31 @@ const ks = ({
2257
2402
  enabled: a = !0,
2258
2403
  refetchInterval: c = !1
2259
2404
  }) => {
2260
- const l = T(t), u = ["RESOURCE_RELATED", l, e, n, s, r, i, o ?? null], d = a && !!l && !!e && !!n && !!r;
2261
- Ie(l, e, u, d);
2262
- const g = N({
2263
- queryKey: u,
2264
- queryFn: async () => an(l, e, n, s, r, i, o ?? null),
2265
- enabled: d,
2405
+ const d = T(t), l = ["RESOURCE_RELATED", d, e, n, s, r, i, o ?? null], f = a && !!d && !!e && !!n && !!r;
2406
+ Te(d, e, l, f);
2407
+ const h = F({
2408
+ queryKey: l,
2409
+ queryFn: async () => fn(d, e, n, s, r, i, o ?? null),
2410
+ enabled: f,
2266
2411
  refetchInterval: c
2267
- }), h = {
2268
- pluginId: l,
2412
+ }), g = {
2413
+ pluginId: d,
2269
2414
  connectionId: e,
2270
2415
  resourceKey: n,
2271
2416
  id: r,
2272
2417
  namespace: s
2273
- }, E = g.data ?? [];
2418
+ }, m = h.data ?? [];
2274
2419
  return {
2275
2420
  /** One entry per edge, from the viewed resource's side. */
2276
- related: Wr(h, E),
2421
+ related: Vr(g, m),
2277
2422
  /** The raw graph edges. */
2278
- edges: E,
2279
- isLoading: g.isLoading,
2280
- isFetching: g.isFetching,
2281
- error: g.error,
2282
- refetch: g.refetch
2423
+ edges: m,
2424
+ isLoading: h.isLoading,
2425
+ isFetching: h.isFetching,
2426
+ error: h.error,
2427
+ refetch: h.refetch
2283
2428
  };
2284
- }, qs = ({
2429
+ }, Hs = ({
2285
2430
  pluginID: t,
2286
2431
  connectionID: e,
2287
2432
  resourceKey: n,
@@ -2291,22 +2436,22 @@ const ks = ({
2291
2436
  enabled: o = !0,
2292
2437
  refetchInterval: a = !1
2293
2438
  }) => {
2294
- const c = T(t), l = ["RESOURCE_DEPENDENCY_TREE", c, e, n, s, r, i], u = o && !!c && !!e && !!n && !!r;
2295
- Ie(c, e, l, u);
2296
- const d = N({
2297
- queryKey: l,
2298
- queryFn: async () => cn(c, e, n, s, r, i),
2299
- enabled: u,
2439
+ const c = T(t), d = ["RESOURCE_DEPENDENCY_TREE", c, e, n, s, r, i], l = o && !!c && !!e && !!n && !!r;
2440
+ Te(c, e, d, l);
2441
+ const f = F({
2442
+ queryKey: d,
2443
+ queryFn: async () => pn(c, e, n, s, r, i),
2444
+ enabled: l,
2300
2445
  refetchInterval: a
2301
2446
  });
2302
2447
  return {
2303
- tree: d.data ?? null,
2304
- isLoading: d.isLoading,
2305
- isFetching: d.isFetching,
2306
- error: d.error,
2307
- refetch: d.refetch
2448
+ tree: f.data ?? null,
2449
+ isLoading: f.isLoading,
2450
+ isFetching: f.isFetching,
2451
+ error: f.error,
2452
+ refetch: f.refetch
2308
2453
  };
2309
- }, Ms = ({
2454
+ }, Bs = ({
2310
2455
  pluginID: t,
2311
2456
  connectionID: e,
2312
2457
  resourceKey: n,
@@ -2316,53 +2461,53 @@ const ks = ({
2316
2461
  downDepth: o = 3,
2317
2462
  enabled: a = !0
2318
2463
  }) => {
2319
- const c = T(t), l = ["RESOURCE_GRAPH", c, e, n, s, r, i, o], u = a && !!c && !!e && !!n && !!r;
2320
- Ie(c, e, l, u);
2321
- const d = N({
2322
- queryKey: l,
2323
- queryFn: async () => un(c, e, n, s, r, i, o),
2324
- enabled: u
2464
+ const c = T(t), d = ["RESOURCE_GRAPH", c, e, n, s, r, i, o], l = a && !!c && !!e && !!n && !!r;
2465
+ Te(c, e, d, l);
2466
+ const f = F({
2467
+ queryKey: d,
2468
+ queryFn: async () => hn(c, e, n, s, r, i, o),
2469
+ enabled: l
2325
2470
  });
2326
2471
  return {
2327
- graph: d.data ?? null,
2328
- isLoading: d.isLoading,
2329
- isFetching: d.isFetching,
2330
- error: d.error,
2331
- refetch: d.refetch
2472
+ graph: f.data ?? null,
2473
+ isLoading: f.isLoading,
2474
+ isFetching: f.isFetching,
2475
+ error: f.error,
2476
+ refetch: f.refetch
2332
2477
  };
2333
- }, $s = () => {
2334
- const t = C.useContext(Ye);
2478
+ }, zs = () => {
2479
+ const t = C.useContext(et);
2335
2480
  if (!t)
2336
2481
  throw new Error("useSettings must be used within a SettingsProvider");
2337
2482
  return t;
2338
- }, Ws = ({ to: t, withinContext: e, ...n }) => {
2339
- const { pluginId: r } = _e();
2483
+ }, Vs = ({ to: t, withinContext: e, ...n }) => {
2484
+ const { pluginId: r } = we();
2340
2485
  r || console.error("Link used outside of a plugin context");
2341
2486
  const s = `/_plugin/${r}${t.startsWith("/") ? "" : "/"}${t}`;
2342
- return C.useMemo(() => /* @__PURE__ */ A(mt, { style: { textDecoration: "none", color: "inherit" }, ...n, to: s }), [n, s]);
2487
+ return C.useMemo(() => /* @__PURE__ */ R(_t, { style: { textDecoration: "none", color: "inherit" }, ...n, to: s }), [n, s]);
2343
2488
  };
2344
- function Gs() {
2345
- const t = Et(), e = St(), { pluginId: n } = _e();
2489
+ function Ys() {
2490
+ const t = wt(), e = bt(), { pluginId: n } = we();
2346
2491
  n || console.error("usePluginRouter used outside of a plugin context");
2347
- const r = `/_plugin/${n}`, s = e.pathname.startsWith(r) ? e.pathname.slice(r.length) || "/" : e.pathname, i = U((o, a) => {
2492
+ const r = `/_plugin/${n}`, s = e.pathname.startsWith(r) ? e.pathname.slice(r.length) || "/" : e.pathname, i = M((o, a) => {
2348
2493
  const { ...c } = a ?? {};
2349
2494
  o.startsWith("/") ? t(`${r}${o}`, c) : t(o, c);
2350
2495
  }, [t, r]);
2351
- return yt(() => ({
2496
+ return Ct(() => ({
2352
2497
  location: e,
2353
2498
  navigate: i,
2354
2499
  pluginPath: s
2355
2500
  }), [e, i, s]);
2356
2501
  }
2357
- class js {
2502
+ class Js {
2358
2503
  }
2359
- class Qs {
2504
+ class Xs {
2360
2505
  constructor() {
2361
- x(this, "_extensions");
2506
+ L(this, "_extensions");
2362
2507
  /**
2363
2508
  * The root component to render for the application window.
2364
2509
  */
2365
- x(this, "root");
2510
+ L(this, "root");
2366
2511
  /**
2367
2512
  * Various pages to render under the root component. These can be navigated to using
2368
2513
  * the built-in navigation system both programatically and through Links.
@@ -2392,8 +2537,8 @@ class Qs {
2392
2537
  * ```
2393
2538
  *
2394
2539
  */
2395
- x(this, "pages");
2396
- x(this, "_routes");
2540
+ L(this, "pages");
2541
+ L(this, "_routes");
2397
2542
  }
2398
2543
  get extensions() {
2399
2544
  return this._extensions || [];
@@ -2415,9 +2560,9 @@ class Qs {
2415
2560
  */
2416
2561
  get Window() {
2417
2562
  if (!this._routes && this.root)
2418
- return /* @__PURE__ */ A(this.root, {});
2419
- const e = _t(this._routes || []);
2420
- return /* @__PURE__ */ A(Ct, { router: e });
2563
+ return /* @__PURE__ */ R(this.root, {});
2564
+ const e = Rt(this._routes || []);
2565
+ return /* @__PURE__ */ R(It, { router: e });
2421
2566
  }
2422
2567
  /**
2423
2568
  * Register extension points for other plugins to extend the functionality
@@ -2449,91 +2594,91 @@ class Qs {
2449
2594
  return this._routes = e, this;
2450
2595
  }
2451
2596
  }
2452
- var Gr = /* @__PURE__ */ ((t) => (t.MISSING_MANIFEST = "MISSING_MANIFEST", t.MISSING_PLUGIN = "MISSING_PLUGIN", t.MISSING_ENTRYPOINT = "MISSING_ENTRYPOINT", t))(Gr || {});
2453
- const Ks = (t) => {
2597
+ var Yr = /* @__PURE__ */ ((t) => (t.MISSING_MANIFEST = "MISSING_MANIFEST", t.MISSING_PLUGIN = "MISSING_PLUGIN", t.MISSING_ENTRYPOINT = "MISSING_ENTRYPOINT", t))(Yr || {});
2598
+ const Zs = (t) => {
2454
2599
  const e = t.split("::");
2455
2600
  return e.length === 1 ? { group: "core", version: "", kind: e[0] } : {
2456
2601
  group: e[0] || "core",
2457
2602
  version: e[1] || "",
2458
2603
  kind: e[2] || e[0]
2459
2604
  };
2460
- }, Hs = (t) => !t || t === "core" ? "Core" : t.charAt(0).toUpperCase() + t.slice(1);
2605
+ }, eo = (t) => !t || t === "core" ? "Core" : t.charAt(0).toUpperCase() + t.slice(1);
2461
2606
  export {
2462
- Y as ALL_SESSIONS_KEY,
2463
- vn as BottomDrawerContext,
2464
- Rn as ConfirmationModalContext,
2465
- F as ErrorTypes,
2466
- is as ExtensionPointRegistry,
2467
- Nn as ExtensionPointStore,
2468
- os as ExtensionProvider,
2469
- Ws as Link,
2470
- Je as OperationsContext,
2471
- rs as OperationsProvider,
2472
- Se as PluginContext,
2473
- es as PluginContextProvider,
2474
- Gr as PluginErrorCode,
2475
- Qs as PluginWindow,
2476
- js as PluginWindowRootProps,
2477
- bn as RightDrawerContext,
2478
- Ye as SettingsContext,
2479
- ns as SettingsProvider,
2480
- as as SnackbarProvider,
2481
- I as WatchState,
2482
- Cn as actionToSnackbar,
2483
- Lr as applyBatch,
2484
- xn as connectionListQueryKey,
2485
- k as createErrorHandler,
2486
- wn as defaultState,
2487
- Hs as formatGroup,
2488
- qr as graphChangedEvent,
2489
- oe as isCancelledError,
2490
- Q as parseAppError,
2491
- Ks as parseResourceKey,
2492
- Us as relationshipLabel,
2493
- B as showAppError,
2494
- Wr as toRelatedResources,
2495
- xs as useActiveSyncs,
2496
- st as useBottomDrawer,
2497
- Cs as useConfirmationModal,
2498
- cs as useConnection,
2499
- ls as useConnectionNamespaces,
2500
- ds as useConnectionStatus,
2501
- us as useConnections,
2502
- qs as useDependencyTree,
2503
- Ns as useEditorSchemas,
2504
- Ur as useEventBatcher,
2505
- gs as useExec,
2506
- Ds as useExecuteAction,
2507
- ss as useExtensionPoint,
2508
- Dn as useExtensionRegistry,
2509
- hs as useLogs,
2510
- ys as useMetricProviders,
2511
- Un as useMetricProvidersForResource,
2512
- Es as useMetricStream,
2513
- kr as useOperations,
2514
- _e as usePluginContext,
2515
- fs as usePluginData,
2516
- Gs as usePluginRouter,
2517
- ts as usePluginSettings,
2518
- Ss as usePortForwardSessions,
2519
- Ie as useRefetchOnGraphChange,
2520
- ks as useRelatedResources,
2607
+ J as ALL_SESSIONS_KEY,
2608
+ xn as BottomDrawerContext,
2609
+ Nn as ConfirmationModalContext,
2610
+ D as ErrorTypes,
2611
+ hs as ExtensionPointRegistry,
2612
+ $n as ExtensionPointStore,
2613
+ ps as ExtensionProvider,
2614
+ Vs as Link,
2615
+ tt as OperationsContext,
2616
+ ds as OperationsProvider,
2617
+ _e as PluginContext,
2618
+ cs as PluginContextProvider,
2619
+ Yr as PluginErrorCode,
2620
+ Xs as PluginWindow,
2621
+ Js as PluginWindowRootProps,
2622
+ Fn as RightDrawerContext,
2623
+ et as SettingsContext,
2624
+ ls as SettingsProvider,
2625
+ gs as SnackbarProvider,
2626
+ O as WatchState,
2627
+ Tn as actionToSnackbar,
2628
+ jr as applyBatch,
2629
+ Gn as connectionListQueryKey,
2630
+ U as createErrorHandler,
2631
+ Dn as defaultState,
2632
+ eo as formatGroup,
2633
+ Hr as graphChangedEvent,
2634
+ ae as isCancelledError,
2635
+ H as parseAppError,
2636
+ Zs as parseResourceKey,
2637
+ Qs as relationshipLabel,
2638
+ z as showAppError,
2639
+ Vr as toRelatedResources,
2640
+ Gs as useActiveSyncs,
2641
+ ct as useBottomDrawer,
2642
+ Ts as useConfirmationModal,
2643
+ ys as useConnection,
2644
+ Es as useConnectionNamespaces,
2645
+ Ss as useConnectionStatus,
2646
+ ms as useConnections,
2647
+ Hs as useDependencyTree,
2648
+ $s as useEditorSchemas,
2649
+ Qr as useEventBatcher,
2650
+ _s as useExec,
2651
+ qs as useExecuteAction,
2652
+ fs as useExtensionPoint,
2653
+ qn as useExtensionRegistry,
2654
+ ws as useLogs,
2655
+ bs as useMetricProviders,
2656
+ Qn as useMetricProvidersForResource,
2657
+ Is as useMetricStream,
2658
+ Kr as useOperations,
2659
+ we as usePluginContext,
2660
+ vs as usePluginData,
2661
+ Ys as usePluginRouter,
2662
+ us as usePluginSettings,
2663
+ Os as usePortForwardSessions,
2664
+ Te as useRefetchOnGraphChange,
2665
+ Ks as useRelatedResources,
2521
2666
  T as useResolvedPluginId,
2522
- ws as useResource,
2523
- Fs as useResourceActions,
2524
- vs as useResourceAreaComponent,
2525
- Ms as useResourceGraph,
2526
- bs as useResourceGroups,
2527
- ms as useResourceMetrics,
2528
- Ts as useResourceMutations,
2529
- _s as useResourcePortForwarder,
2530
- Rs as useResourceSearch,
2531
- Is as useResourceType,
2532
- Os as useResourceTypes,
2533
- As as useResources,
2534
- ps as useRightDrawer,
2535
- $s as useSettings,
2536
- G as useSnackbar,
2537
- Ls as useStreamAction,
2538
- Ps as useWatchState
2667
+ Ds as useResource,
2668
+ Us as useResourceActions,
2669
+ xs as useResourceAreaComponent,
2670
+ Bs as useResourceGraph,
2671
+ Fs as useResourceGroups,
2672
+ Rs as useResourceMetrics,
2673
+ Ms as useResourceMutations,
2674
+ As as useResourcePortForwarder,
2675
+ Ns as useResourceSearch,
2676
+ Ps as useResourceType,
2677
+ Ls as useResourceTypes,
2678
+ ks as useResources,
2679
+ Cs as useRightDrawer,
2680
+ zs as useSettings,
2681
+ Q as useSnackbar,
2682
+ js as useStreamAction,
2683
+ Ws as useWatchState
2539
2684
  };