@omniviewdev/runtime 0.5.0 → 0.6.0

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