@omniviewdev/runtime 0.7.3 → 0.7.4

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