@ynput/ayon-frontend-shared 0.8.1 → 0.10.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.
Files changed (50) hide show
  1. package/dist/DetailsPanel.es.js +39 -39
  2. package/dist/ListTable.es.js +738 -651
  3. package/dist/NewEntity.es.js +4 -2
  4. package/dist/ProjectTreeTable.es.js +4208 -4185
  5. package/dist/ProjectsTable.es.js +5 -4
  6. package/dist/Slicer.es.js +327 -294
  7. package/dist/Views.es.js +725 -713
  8. package/dist/chunks/ColumnDropIndicator.es.js +33 -27
  9. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +44 -38
  10. package/dist/chunks/EntityPickerDialog.es.js +19 -19
  11. package/dist/chunks/Feed.es.js +112 -110
  12. package/dist/chunks/FilmstripEntityCard.es.js +2 -2
  13. package/dist/chunks/GroupSettingsFallback.es.js +3 -2
  14. package/dist/chunks/MetaWidget.es.js +828 -809
  15. package/dist/chunks/NewEntityContextInstance.es.js +6 -5
  16. package/dist/chunks/ReviewablesSelector.es.js +76 -76
  17. package/dist/chunks/SimpleTable.es.js +151 -149
  18. package/dist/chunks/Slicer.es.js +637 -617
  19. package/dist/chunks/TableExportContextInstance.es.js +415 -471
  20. package/dist/chunks/ThumbnailSimple.es.js +11 -11
  21. package/dist/chunks/Watchers.es.js +46 -46
  22. package/dist/chunks/getUris.es.js +1069 -1057
  23. package/dist/chunks/searchTerms.es.js +617 -581
  24. package/dist/chunks/useCreateContextMenu.es.js +15 -13
  25. package/dist/chunks/useLocalStorage.es.js +78 -0
  26. package/dist/components.es.js +916 -884
  27. package/dist/context.es.js +348 -337
  28. package/dist/hooks.es.js +218 -187
  29. package/dist/index.es.js +11 -10
  30. package/dist/types/Actions.d.ts +17 -16
  31. package/dist/types/ContextMenu.d.ts +18 -17
  32. package/dist/types/DetailsPanel.d.ts +17 -16
  33. package/dist/types/EntityPickerDialog.d.ts +17 -16
  34. package/dist/types/Feed.d.ts +18 -17
  35. package/dist/types/ListTable.d.ts +28 -18
  36. package/dist/types/NewEntity.d.ts +19 -16
  37. package/dist/types/ProjectTreeTable.d.ts +62 -19
  38. package/dist/types/ProjectsTable.d.ts +18 -17
  39. package/dist/types/RepresentationsList.d.ts +17 -16
  40. package/dist/types/SimpleTable.d.ts +18 -17
  41. package/dist/types/Slicer.d.ts +24 -17
  42. package/dist/types/Views.d.ts +23 -17
  43. package/dist/types/api.d.ts +18 -17
  44. package/dist/types/components.d.ts +64 -18
  45. package/dist/types/context.d.ts +28 -18
  46. package/dist/types/hooks.d.ts +20 -17
  47. package/dist/types/index.d.ts +17 -16
  48. package/dist/types/util.d.ts +38 -16
  49. package/dist/util.es.js +116 -113
  50. package/package.json +2 -2
@@ -1,47 +1,47 @@
1
1
  import { jsxs as C, jsx as p } from "react/jsx-runtime";
2
- import ne, { createContext as y, useContext as f, useState as I, useEffect as E, useRef as P, useCallback as V, useMemo as G, forwardRef as Z } from "react";
3
- import { debounce as re, isEqual as Ee } from "lodash";
4
- import { confirmDialog as Ie } from "primereact/confirmdialog";
5
- import { toast as B } from "react-toastify";
6
- import { v4 as Pe } from "uuid";
7
- import { bv as D, a as Ve } from "./searchTerms.es.js";
2
+ import ne, { createContext as y, useContext as w, useState as I, useEffect as P, useRef as k, useCallback as V, useMemo as z, forwardRef as X } from "react";
3
+ import { debounce as re, isEqual as Ce } from "lodash";
4
+ import { confirmDialog as Pe } from "primereact/confirmdialog";
5
+ import { toast as F } from "react-toastify";
6
+ import { v4 as Ee } from "uuid";
7
+ import { bv as D, a as Ie } from "./searchTerms.es.js";
8
8
  import { f as ke } from "./realtimeUpdatesUtils.es.js";
9
9
  import "axios";
10
- import { cV as Ae, aU as Te, dD as De, dG as se } from "./getUris.es.js";
11
- import { useStore as Re } from "react-redux";
12
- import { Button as q, Icon as K, theme as le, Dialog as $e, InputText as ue } from "@ynput/ayon-react-components";
10
+ import { cV as Ve, aU as Ae, dD as Te, dG as se } from "./getUris.es.js";
11
+ import { useStore as De } from "react-redux";
12
+ import { Button as B, Icon as G, theme as le, Dialog as Re, InputText as ue } from "@ynput/ayon-react-components";
13
13
  import v from "styled-components";
14
14
  import O from "clsx";
15
- import { a as Ne, K as ae } from "./platform.es.js";
15
+ import { a as $e, K as ae } from "./platform.es.js";
16
16
  import "@module-federation/enhanced/runtime";
17
17
  import "@ynput/ayon-addon/host";
18
18
  import "./ContextMenuContextInstance.es.js";
19
19
  import { createPortal as _e } from "react-dom";
20
20
  import { Dialog as je } from "primereact/dialog";
21
- import Le, { ReadyState as Oe } from "react-use-websocket";
21
+ import Ne, { ReadyState as Oe } from "react-use-websocket";
22
22
  import "react-router-dom";
23
23
  import "semver";
24
- const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ C("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
24
+ const Le = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ */ C("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
25
25
  e,
26
- /* @__PURE__ */ p(q, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
27
- ] }), Ue = y(void 0), co = () => f(Ue) || {}, We = y({
26
+ /* @__PURE__ */ p(B, { onClick: () => window.location.reload(), variant: "filled", children: "Refresh" })
27
+ ] }), Me = y(void 0), io = () => w(Me) || {}, Ue = y({
28
28
  isLoading: !0,
29
29
  modules: [],
30
30
  remotesInitialized: !1,
31
31
  addonDev: { status: "off" }
32
- }), lo = () => {
33
- const e = f(We);
32
+ }), co = () => {
33
+ const e = w(Ue);
34
34
  if (e === void 0)
35
35
  throw new Error("useRemoteModules must be used within a RemoteModulesProvider");
36
36
  return e;
37
- }, J = "addonDev", M = "ayon-addon-dev", Fe = ["localhost", "127.0.0.1", "[::1]"], H = `use ?${J}=<addon>@http://localhost:<port>`, pe = (e) => {
37
+ }, W = "addonDev", L = "ayon-addon-dev", Fe = ["localhost", "127.0.0.1", "[::1]"], H = `use ?${W}=<addon>@http://localhost:<port>`, pe = (e) => {
38
38
  try {
39
39
  const { protocol: t, hostname: o } = new URL(e);
40
40
  return ["http:", "https:"].includes(t) && Fe.includes(o);
41
41
  } catch {
42
42
  return !1;
43
43
  }
44
- }, Be = (e) => {
44
+ }, We = (e) => {
45
45
  const t = e.indexOf("@");
46
46
  if (t <= 0) return { request: e, reason: H };
47
47
  const o = e.slice(0, t), r = e.slice(t + 1).replace(/\/+$/, "");
@@ -55,25 +55,25 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
55
55
  request: e,
56
56
  reason: `${n.hostname} is not this machine: only dev servers on localhost, 127.0.0.1 or [::1] can be loaded`
57
57
  } : { request: e, reason: `the dev server URL must be http(s): ${H}` };
58
- }, uo = () => {
59
- const e = new URLSearchParams(window.location.search).get(J);
58
+ }, lo = () => {
59
+ const e = new URLSearchParams(window.location.search).get(W);
60
60
  if (e === "off" || e === "")
61
- return localStorage.removeItem(M), null;
61
+ return localStorage.removeItem(L), null;
62
62
  if (e) {
63
- const t = Be(e);
64
- return "override" in t ? localStorage.setItem(M, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${J}=${e}: ${t.reason}`), t;
63
+ const t = We(e);
64
+ return "override" in t ? localStorage.setItem(L, JSON.stringify(t.override)) : console.warn(`[addon dev] ignored ?${W}=${e}: ${t.reason}`), t;
65
65
  }
66
66
  try {
67
- const t = JSON.parse(localStorage.getItem(M) || "null");
67
+ const t = JSON.parse(localStorage.getItem(L) || "null");
68
68
  return t && pe(t.url) ? { override: t } : null;
69
69
  } catch {
70
70
  return null;
71
71
  }
72
- }, Je = () => localStorage.removeItem(M), qe = (e, { addon: t, url: o }) => {
72
+ }, Be = () => localStorage.removeItem(L), qe = (e, { addon: t, url: o }) => {
73
73
  const r = e ?? {}, n = ["name", "version", "remote", "buildId"].filter(
74
- (a) => typeof r[a] != "string" || !r[a]
74
+ (s) => typeof r[s] != "string" || !r[s]
75
75
  );
76
- return (!Array.isArray(r.modules) || r.modules.some((a) => typeof a != "string" || !a)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${J}=${r.name}@${o}` : null;
76
+ return (!Array.isArray(r.modules) || r.modules.some((s) => typeof s != "string" || !s)) && n.push("modules"), typeof e != "object" || !e || n.length ? `${o}/ayon-addon.json is invalid (no ${n.join(", ")}): is it served by \`ayon-addon dev --ayon\`?` : r.name !== t ? `the dev server at ${o} serves "${r.name}", not "${t}": open ?${W}=${r.name}@${o}` : null;
77
77
  }, He = async (e) => {
78
78
  const { url: t } = e;
79
79
  let o;
@@ -96,7 +96,7 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
96
96
  const n = qe(r, e);
97
97
  if (n) throw new Error(n);
98
98
  return r;
99
- }, po = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", ie = v.div`
99
+ }, uo = (e) => e?.attrib?.developerMode || e?.data?.isService ? null : e?.data?.isDeveloper ? "only users in developer mode can load addons from a dev server: turn on Developer Mode in the header, then reload" : "only users in developer mode can load addons from a dev server, and this user is not a developer: an admin can turn on Developer in Studio settings > Users", ie = v.div`
100
100
  position: fixed;
101
101
  left: 8px;
102
102
  bottom: 8px;
@@ -116,11 +116,11 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
116
116
  color: var(--md-sys-color-on-error-container);
117
117
  background: var(--md-sys-color-error-container);
118
118
  }
119
- `, ze = 2e3, go = ({ state: e }) => {
119
+ `, Je = 2e3, po = ({ state: e }) => {
120
120
  const [t, o] = I(!1), r = e.status === "active" ? e.info.buildId : void 0;
121
- E(() => {
121
+ P(() => {
122
122
  if (e.status !== "active" && e.status !== "error") return;
123
- const d = setInterval(() => {
123
+ const c = setInterval(() => {
124
124
  He(e.override).then(
125
125
  (g) => {
126
126
  g.buildId !== r && (o(!0), window.location.reload());
@@ -129,71 +129,71 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
129
129
  }
130
130
  // the dev server restarting or still failing; keep polling
131
131
  );
132
- }, ze);
133
- return () => clearInterval(d);
132
+ }, Je);
133
+ return () => clearInterval(c);
134
134
  }, [e, r]);
135
- const a = /* @__PURE__ */ p(q, { variant: "text", icon: "close", onClick: () => {
136
- Je();
137
- const d = new URL(window.location.href);
138
- d.searchParams.delete("addonDev"), window.location.href = d.toString();
135
+ const s = /* @__PURE__ */ p(B, { variant: "text", icon: "close", onClick: () => {
136
+ Be();
137
+ const c = new URL(window.location.href);
138
+ c.searchParams.delete("addonDev"), window.location.href = c.toString();
139
139
  }, "data-tooltip": "Stop: load the installed addon" });
140
140
  if (e.status === "rejected")
141
141
  return /* @__PURE__ */ C(ie, { className: "error", "data-addon-dev-rejected": e.request, children: [
142
- /* @__PURE__ */ p(K, { icon: "error" }),
142
+ /* @__PURE__ */ p(G, { icon: "error" }),
143
143
  /* @__PURE__ */ C("span", { children: [
144
144
  "Addon dev: ignored ?addonDev=",
145
145
  e.request,
146
146
  ": ",
147
147
  e.reason
148
148
  ] }),
149
- a
149
+ s
150
150
  ] });
151
- const { addon: i, url: s } = e.override, c = "error" in e ? e.error : void 0;
152
- return /* @__PURE__ */ C(ie, { className: c ? "error" : void 0, "data-addon-dev": i, children: [
153
- /* @__PURE__ */ p(K, { icon: c ? "error" : "code" }),
151
+ const { addon: d, url: a } = e.override, i = "error" in e ? e.error : void 0;
152
+ return /* @__PURE__ */ C(ie, { className: i ? "error" : void 0, "data-addon-dev": d, children: [
153
+ /* @__PURE__ */ p(G, { icon: i ? "error" : "code" }),
154
154
  e.status === "error" ? /* @__PURE__ */ C("span", { children: [
155
155
  "Addon dev: ",
156
- i,
156
+ d,
157
157
  " could not load from ",
158
- s,
158
+ a,
159
159
  ": ",
160
- c
160
+ i
161
161
  ] }) : /* @__PURE__ */ C("span", { children: [
162
162
  "Addon dev: ",
163
- /* @__PURE__ */ p("strong", { children: i }),
163
+ /* @__PURE__ */ p("strong", { children: d }),
164
164
  " from ",
165
- s,
165
+ a,
166
166
  e.status === "active" && ` (${e.info.version}, build ${e.info.buildId})`,
167
- c && `: ${c}`,
167
+ i && `: ${i}`,
168
168
  t && ", reloading..."
169
169
  ] }),
170
- a
170
+ s
171
171
  ] });
172
- }, Ge = y(void 0), wo = () => {
173
- const e = f(Ge);
172
+ }, ze = y(void 0), go = () => {
173
+ const e = w(ze);
174
174
  if (e === void 0)
175
175
  throw new Error("usePowerpack must be used within a PowerpackProvider");
176
176
  return e;
177
- }, Ke = y(void 0), fo = () => {
178
- const e = f(Ke);
177
+ }, Ge = y(void 0), fo = () => {
178
+ const e = w(Ge);
179
179
  if (e === void 0)
180
180
  throw new Error("useURIContext must be used within a URIProvider");
181
181
  return e;
182
- }, U = (e, t = null) => {
182
+ }, M = (e, t = null) => {
183
183
  if (!e) return t;
184
184
  try {
185
185
  return JSON.parse(e);
186
186
  } catch {
187
187
  return t;
188
188
  }
189
- }, ho = (e, t) => {
189
+ }, Ke = (e, t) => {
190
190
  if (typeof window > "u") return t;
191
191
  try {
192
- return U(sessionStorage.getItem(e), t);
192
+ return M(sessionStorage.getItem(e), t);
193
193
  } catch {
194
194
  return t;
195
195
  }
196
- }, vo = (e, t) => {
196
+ }, Ye = (e, t) => {
197
197
  if (!(typeof window > "u"))
198
198
  try {
199
199
  sessionStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } }));
@@ -201,152 +201,94 @@ const Me = ({ message: e = "Refresh to see latest changes." }) => /* @__PURE__ *
201
201
  console.error(o);
202
202
  }
203
203
  };
204
- function Ye(e, t) {
205
- const o = P(t);
204
+ function Xe(e, t) {
205
+ const o = k(t);
206
206
  o.current = t;
207
- const [r, n] = I(() => typeof window > "u" ? t : U(sessionStorage.getItem(e), t));
208
- E(() => {
209
- const i = sessionStorage.getItem(e);
210
- n(U(i, o.current)), i || sessionStorage.setItem(e, JSON.stringify(o.current));
211
- function s(c) {
212
- if ("key" in c && c.key && c.key !== e) return;
213
- const d = c.detail?.key;
214
- if (d && d !== e) return;
207
+ const [r, n] = I(() => typeof window > "u" ? t : M(sessionStorage.getItem(e), t));
208
+ P(() => {
209
+ const d = sessionStorage.getItem(e);
210
+ n(M(d, o.current)), d || sessionStorage.setItem(e, JSON.stringify(o.current));
211
+ function a(i) {
212
+ if ("key" in i && i.key && i.key !== e) return;
213
+ const c = i.detail?.key;
214
+ if (c && c !== e) return;
215
215
  const g = sessionStorage.getItem(e);
216
- n(U(g, o.current));
216
+ n(M(g, o.current));
217
217
  }
218
- return window.addEventListener("session-storage", s), window.addEventListener("storage", s), () => {
219
- window.removeEventListener("session-storage", s), window.removeEventListener("storage", s);
218
+ return window.addEventListener("session-storage", a), window.addEventListener("storage", a), () => {
219
+ window.removeEventListener("session-storage", a), window.removeEventListener("storage", a);
220
220
  };
221
221
  }, [e]);
222
- const a = V(
223
- (i) => {
222
+ const s = V(
223
+ (d) => {
224
224
  try {
225
- n((s) => {
226
- const c = typeof i == "function" ? i(s) : i;
227
- return sessionStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), c;
225
+ n((a) => {
226
+ const i = typeof d == "function" ? d(a) : d;
227
+ return sessionStorage.setItem(e, JSON.stringify(i)), typeof window < "u" && window.dispatchEvent(new CustomEvent("session-storage", { detail: { key: e } })), i;
228
228
  });
229
- } catch (s) {
230
- console.error(s);
229
+ } catch (a) {
230
+ console.error(a);
231
231
  }
232
232
  },
233
233
  [e]
234
234
  );
235
- return [r, a];
235
+ return [r, s];
236
236
  }
237
- const W = (e, t = null) => {
238
- if (!e) return t;
239
- try {
240
- return JSON.parse(e);
241
- } catch {
242
- return t;
243
- }
244
- }, Xe = (e, t) => {
245
- if (typeof window > "u") return t;
246
- try {
247
- return W(localStorage.getItem(e), t);
248
- } catch {
249
- return t;
250
- }
251
- }, Ze = (e, t) => {
252
- if (!(typeof window > "u"))
253
- try {
254
- localStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new Event("storage"));
255
- } catch (o) {
256
- console.error(o);
257
- }
258
- };
259
- function mo(e, t) {
260
- const o = P(t);
261
- o.current = t;
262
- const [r, n] = I(() => {
263
- const i = localStorage.getItem(e);
264
- return W(i, t);
265
- });
266
- E(() => {
267
- const i = localStorage.getItem(e);
268
- n(W(i, o.current)), i || localStorage.setItem(e, JSON.stringify(o.current));
269
- function s(c) {
270
- if (c.key && c.key !== e) return;
271
- const d = localStorage.getItem(e);
272
- n(W(d, o.current));
273
- }
274
- return window.addEventListener("storage", s), () => {
275
- window.removeEventListener("storage", s);
276
- };
277
- }, [e]);
278
- const a = V(
279
- (i) => {
280
- try {
281
- n((s) => {
282
- const c = typeof i == "function" ? i(s) : i;
283
- return localStorage.setItem(e, JSON.stringify(c)), typeof window < "u" && setTimeout(() => {
284
- window.dispatchEvent(new Event("storage"));
285
- }, 0), c;
286
- });
287
- } catch (s) {
288
- console.error(s);
289
- }
290
- },
291
- [e]
292
- );
293
- return [r, a];
294
- }
295
- const Qe = y(void 0), et = ["feed", "subtasks", "details", "files"], tt = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, ot = (e) => typeof e == "string" && tt.test(e), nt = (e) => typeof e == "string" && (et.includes(e) || ot(e)), yo = (e) => {
237
+ const Ze = y(void 0), Qe = ["feed", "subtasks", "details", "files"], et = /^[^.\s]+\.[A-Za-z][A-Za-z0-9_]*$/, tt = (e) => typeof e == "string" && et.test(e), ot = (e) => typeof e == "string" && (Qe.includes(e) || tt(e)), wo = (e) => {
296
238
  const { startFrame: t, endFrame: o } = e.activityData || {}, r = e.origin?.id ?? e.entityId;
297
239
  if (!Number.isSafeInteger(t) || !r) return null;
298
- const n = t, a = Number.isSafeInteger(o) ? Math.max(n, o) : n;
299
- return { entityId: r, startFrame: n, endFrame: a };
300
- }, rt = () => {
301
- const e = f(Qe);
240
+ const n = t, s = Number.isSafeInteger(o) ? Math.max(n, o) : n;
241
+ return { entityId: r, startFrame: n, endFrame: s };
242
+ }, nt = () => {
243
+ const e = w(Ze);
302
244
  if (e === void 0)
303
245
  throw new Error("useDetailsPanel must be used within a DetailsPanelProvider");
304
246
  return e;
305
- }, Y = "details/tabs-by-scope", xo = (e, t) => {
306
- const o = Xe(Y, {});
307
- Ze(Y, { ...o, [e]: t });
308
- }, So = (e) => {
309
- const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = rt(), [n, a] = Ye(Y, {}), i = n[e], s = nt(i) ? i : r(e), c = V(
247
+ }, K = "details/tabs-by-scope", ho = (e, t) => {
248
+ const o = Ke(K, {});
249
+ Ye(K, { ...o, [e]: t });
250
+ }, vo = (e) => {
251
+ const { getOpenForScope: t, setPanelOpen: o, getTabForScope: r } = nt(), [n, s] = Xe(K, {}), d = n[e], a = ot(d) ? d : r(e), i = V(
310
252
  (g) => {
311
- a((w) => ({ ...w, [e]: g }));
253
+ s((f) => ({ ...f, [e]: g }));
312
254
  },
313
- [e, a]
314
- ), d = s === "feed";
255
+ [e, s]
256
+ ), c = a === "feed";
315
257
  return {
316
258
  isOpen: t(e),
317
259
  setOpen: (g) => o(e, g),
318
- currentTab: s,
319
- setTab: c,
320
- isFeed: d
260
+ currentTab: a,
261
+ setTab: i,
262
+ isFeed: c
321
263
  };
322
- }, st = y(
264
+ }, rt = y(
323
265
  void 0
324
- ), bo = () => {
325
- const e = f(st);
266
+ ), mo = () => {
267
+ const e = w(rt);
326
268
  if (!e)
327
269
  throw new Error("useSubtasksModulesContext must be used within a SubtasksModulesProvider");
328
270
  return e;
329
- }, at = y({}), Co = () => {
330
- const e = f(at);
271
+ }, st = y({}), yo = () => {
272
+ const e = w(st);
331
273
  if (!e)
332
274
  throw new Error("useThumbnailUploadContext must be used within a ThumbnailUploadProvider");
333
275
  return e;
334
- }, it = y(void 0), Eo = () => {
335
- const e = f(it);
276
+ }, at = y(void 0), xo = () => {
277
+ const e = w(at);
336
278
  if (e === void 0)
337
279
  throw new Error("useSettingsPanel must be used within a SettingsPanelProvider");
338
280
  return e;
339
- }, ct = y(void 0);
340
- function dt() {
341
- const e = f(ct);
281
+ }, it = y(void 0);
282
+ function ct() {
283
+ const e = w(it);
342
284
  if (e === void 0)
343
285
  throw new Error("usePiPWindow must be used within a PiPContext");
344
286
  return e;
345
287
  }
346
- function lt({ pipWindow: e, children: t }) {
288
+ function dt({ pipWindow: e, children: t }) {
347
289
  return _e(t, e.document.body);
348
290
  }
349
- const ut = v(je)`
291
+ const lt = v(je)`
350
292
  width: 25vw;
351
293
  height: 70vh;
352
294
  border: solid 1px var(--md-sys-color-outline-variant);
@@ -359,7 +301,7 @@ const ut = v(je)`
359
301
  opacity: 1;
360
302
  }
361
303
  }
362
- `, pt = v(q)`
304
+ `, ut = v(B)`
363
305
  width: 26px;
364
306
  height: 26px;
365
307
  margin-left: auto;
@@ -375,12 +317,12 @@ const ut = v(je)`
375
317
  &:hover {
376
318
  background-color: #3d3e40;
377
319
  }
378
- `, Io = ({ children: e }) => {
379
- const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = dt(), a = o && ne.isValidElement(e) ? ne.cloneElement(e, { id: o }) : e;
320
+ `, So = ({ children: e }) => {
321
+ const { pipWindow: t, pipId: o, isSupported: r, closePipWindow: n } = ct(), s = o && ne.isValidElement(e) ? ne.cloneElement(e, { id: o }) : e;
380
322
  return !r && o ? /* @__PURE__ */ p(
381
- ut,
323
+ lt,
382
324
  {
383
- header: /* @__PURE__ */ p(pt, { icon: "close", className: "close", onClick: n }),
325
+ header: /* @__PURE__ */ p(ut, { icon: "close", className: "close", onClick: n }),
384
326
  headerStyle: {
385
327
  padding: 4,
386
328
  backgroundColor: "#202124",
@@ -401,109 +343,109 @@ const ut = v(je)`
401
343
  },
402
344
  onHide: n,
403
345
  position: "right",
404
- children: a
346
+ children: s
405
347
  }
406
- ) : t && /* @__PURE__ */ p(lt, { pipWindow: t, children: /* @__PURE__ */ p("div", { className: "pipRoot", children: a }) });
407
- }, gt = y(void 0), Po = () => {
408
- const e = f(gt);
348
+ ) : t && /* @__PURE__ */ p(dt, { pipWindow: t, children: /* @__PURE__ */ p("div", { className: "pipRoot", children: s }) });
349
+ }, pt = y(void 0), bo = () => {
350
+ const e = w(pt);
409
351
  if (!e)
410
352
  throw new Error("useAddonProjectContext must be used within a AddonProjectContext");
411
353
  return e;
412
- }, wt = y(void 0), Vo = () => {
413
- const e = f(wt);
354
+ }, gt = y(void 0), Co = () => {
355
+ const e = w(gt);
414
356
  if (!e)
415
357
  throw new Error("useAddonContext must be used within a AddonContext");
416
358
  return e;
417
- }, ft = y(void 0), ko = () => {
418
- const e = f(ft);
359
+ }, ft = y(void 0), Po = () => {
360
+ const e = w(ft);
419
361
  if (e === void 0)
420
362
  throw new Error("useMenuContext must be used within a MenuProvider");
421
363
  return e;
422
- }, ge = y(void 0), Ao = () => {
423
- const e = f(ge);
364
+ }, ge = y(void 0), Eo = () => {
365
+ const e = w(ge);
424
366
  if (e === void 0)
425
367
  throw new Error("useSocketContext must be used within a SocketProvider");
426
368
  return e;
427
- }, ht = window.location.protocol.replace("http", "ws"), vt = `${ht}//${window.location.host}/ws`, To = ({
369
+ }, wt = window.location.protocol.replace("http", "ws"), ht = `${wt}//${window.location.host}/ws`, Io = ({
428
370
  children: e,
429
371
  userName: t,
430
372
  projectName: o,
431
373
  dispatch: r
432
374
  }) => {
433
- const [n, a] = I(!1), [i, s] = I([]), [c] = Ae(), d = P(!1);
434
- E(() => {
435
- d.current = n;
375
+ const [n, s] = I(!1), [d, a] = I([]), [i] = Ve(), c = k(!1);
376
+ P(() => {
377
+ c.current = n;
436
378
  }, [n]);
437
379
  const g = {
438
- shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (c({ full: !1 }).unwrap(), !0)
439
- }, { sendMessage: w, readyState: m, getWebSocket: u } = Le(
440
- vt,
380
+ shouldReconnect: () => !t || !localStorage.getItem("accessToken") ? !1 : (i({ full: !1 }).unwrap(), !0)
381
+ }, { sendMessage: f, readyState: m, getWebSocket: u } = Ne(
382
+ ht,
441
383
  g,
442
384
  !!t
443
385
  ), l = () => {
444
- w(
386
+ f(
445
387
  JSON.stringify({
446
388
  topic: "auth",
447
389
  token: localStorage.getItem("accessToken"),
448
- subscribe: i,
390
+ subscribe: d,
449
391
  project: o
450
392
  })
451
393
  );
452
394
  };
453
- E(() => {
454
- console.debug("Topics changed", i), l();
455
- }, [i, o]);
456
- const x = P(i);
457
- x.current = i;
458
- const h = G(
459
- () => re((b) => {
460
- Ee(x.current, b) || (console.log("WS: Subscriptions changed"), s(b));
395
+ P(() => {
396
+ console.debug("Topics changed", d), l();
397
+ }, [d, o]);
398
+ const x = k(d);
399
+ x.current = d;
400
+ const h = z(
401
+ () => re((S) => {
402
+ Ce(x.current, S) || (console.log("WS: Subscriptions changed"), a(S));
461
403
  }, 200),
462
404
  []
463
405
  );
464
- E(() => (D.setOnSubscriptionsChange((b) => h(b)), h(D.getSubscriptions("")), () => {
406
+ P(() => (D.setOnSubscriptionsChange((S) => h(S)), h(D.getSubscriptions("")), () => {
465
407
  D.setOnSubscriptionsChange(null), h.cancel();
466
408
  }), [h]);
467
- const [S, $] = I(!1), [R, j] = I(!1);
468
- E(() => {
469
- S && !R && (B.warning(/* @__PURE__ */ p(Me, {}), {
409
+ const [b, j] = I(!1), [R, $] = I(!1);
410
+ P(() => {
411
+ b && !R && (F.warning(/* @__PURE__ */ p(Le, {}), {
470
412
  autoClose: !1,
471
413
  closeButton: !1
472
- }), j(!0));
473
- }, [S, R]);
474
- const k = P({ callCount: 0, windowStart: Date.now() }), N = re(() => {
475
- console.log("Resetting API state due to server restart"), a(!1), r(Ve.util.resetApiState());
476
- }, 1e3), A = V(
477
- (b) => {
478
- const L = Date.now();
479
- if (L - k.current.windowStart >= 1e3 && (k.current.windowStart = L, k.current.callCount = 0), k.current.callCount > 1e3)
480
- return $(!0), console.log(
414
+ }), $(!0));
415
+ }, [b, R]);
416
+ const E = k({ callCount: 0, windowStart: Date.now() }), N = re(() => {
417
+ console.log("Resetting API state due to server restart"), s(!1), r(Ie.util.resetApiState());
418
+ }, 1e3), _ = V(
419
+ (S) => {
420
+ const q = Date.now();
421
+ if (q - E.current.windowStart >= 1e3 && (E.current.windowStart = q, E.current.callCount = 0), E.current.callCount > 1e3)
422
+ return j(!0), console.log(
481
423
  "Overload: Over 1000 messages per second. Ignoring subsequent messages."
482
424
  );
483
- let _;
425
+ let A;
484
426
  try {
485
- _ = JSON.parse(b.data);
486
- } catch (Ce) {
487
- console.error("Failed to parse websocket message:", Ce, b.data);
427
+ A = JSON.parse(S.data);
428
+ } catch (be) {
429
+ console.error("Failed to parse websocket message:", be, S.data);
488
430
  return;
489
431
  }
490
- const { topic: T, sender: oe, summary: Se, status: be } = _ || {};
491
- if (d.current && (T === "heartbeat" || T === "server.started" && be === "finished")) {
432
+ const { topic: T, sender: oe, summary: xe, status: Se } = A || {};
433
+ if (c.current && (T === "heartbeat" || T === "server.started" && Se === "finished")) {
492
434
  console.log("Server replica booted"), N();
493
435
  return;
494
436
  }
495
437
  if (T !== "heartbeat") {
496
- if (T === "server.restart_requested" && (console.log("Server restart requested"), a(!0)), ["import.data"].includes(T)) {
438
+ if (T === "server.restart_requested" && (console.log("Server restart requested"), s(!0)), ["import.data"].includes(T)) {
497
439
  if (oe !== window.senderId) return;
498
440
  } else if (oe === window.senderId)
499
441
  return;
500
- k.current.callCount += 1, console.log("Event RX", _), T === "shout" && _?.summary?.text && B.info(Se.text), D.publish(T, _);
442
+ E.current.callCount += 1, console.log("Event RX", A), T === "shout" && A?.summary?.text && F.info(xe.text), D.publish(T, A);
501
443
  }
502
444
  },
503
- [a]
445
+ [s]
504
446
  );
505
- return E(() => {
506
- m === Oe.OPEN && (u().onmessage = A, l(), D.publish("client.connected", {
447
+ return P(() => {
448
+ m === Oe.OPEN && (u().onmessage = _, l(), D.publish("client.connected", {
507
449
  topic: "client.connected"
508
450
  }));
509
451
  }, [m, u]), /* @__PURE__ */ p(
@@ -517,19 +459,19 @@ const ut = v(je)`
517
459
  children: e
518
460
  }
519
461
  );
520
- }, we = y(void 0), Do = () => {
521
- const e = f(we);
462
+ }, fe = y(void 0), ko = () => {
463
+ const e = w(fe);
522
464
  if (e === void 0)
523
465
  throw new Error("useProjectContext must be used within a ProjectContextProvider");
524
466
  return e;
525
- }, Ro = () => f(we), fe = y(
467
+ }, Vo = () => w(fe), we = y(
526
468
  void 0
527
- ), $o = () => {
528
- const e = f(fe);
469
+ ), Ao = () => {
470
+ const e = w(we);
529
471
  if (e === void 0)
530
472
  throw new Error("useProjectFoldersContext must be used within a ProjectFoldersContextProvider");
531
473
  return e;
532
- }, No = () => f(fe), Q = y(void 0), ee = (e) => ({
474
+ }, To = () => w(we), Z = y(void 0), Q = (e) => ({
533
475
  created: e,
534
476
  label_changed: e,
535
477
  renamed: e,
@@ -538,7 +480,7 @@ const ut = v(je)`
538
480
  tags_changed: e,
539
481
  attrib_changed: e,
540
482
  deleted: e
541
- }), he = (e, t) => e === t || e.startsWith(`${t}.`), X = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), ve = (e) => {
483
+ }), he = (e, t) => e === t || e.startsWith(`${t}.`), Y = (e, t) => t.length === 0 ? !0 : t.includes(e || ""), ve = (e) => {
542
484
  const t = e.split(".").pop();
543
485
  if (t && [
544
486
  "created",
@@ -551,44 +493,44 @@ const ut = v(je)`
551
493
  "deleted"
552
494
  ].includes(t))
553
495
  return t;
554
- }, _o = ({
496
+ }, Do = ({
555
497
  projectNames: e,
556
498
  topics: t,
557
499
  isSyncing: o = !1,
558
500
  shouldSyncOnUpdate: r
559
501
  }) => {
560
- const n = f(Q);
502
+ const n = w(Z);
561
503
  if (!n)
562
504
  throw new Error("useSyncUpdates must be used within an EntityUpdatesProvider");
563
- const a = e || n.projectNames, i = P(0), s = P(!1), c = n.updates.filter(
564
- (d) => X(d.project, a) && t.some((g) => he(d.topic, g)) && (r?.(d) ?? !0)
505
+ const s = e || n.projectNames, d = k(0), a = k(!1), i = n.updates.filter(
506
+ (c) => Y(c.project, s) && t.some((g) => he(c.topic, g)) && (r?.(c) ?? !0)
565
507
  );
566
- return E(() => {
567
- o && !s.current ? i.current = n.getLatestId() : !o && s.current && n.acknowledge(t, a, i.current), s.current = o;
568
- }, [n, o, a, t]), {
569
- updates: c,
570
- hasUpdates: c.length > 0,
571
- updateCount: c.length
508
+ return P(() => {
509
+ o && !a.current ? d.current = n.getLatestId() : !o && a.current && n.acknowledge(t, s, d.current), a.current = o;
510
+ }, [n, o, s, t]), {
511
+ updates: i,
512
+ hasUpdates: i.length > 0,
513
+ updateCount: i.length
572
514
  };
573
- }, jo = () => {
574
- const e = f(Q);
515
+ }, Ro = () => {
516
+ const e = w(Z);
575
517
  if (!e)
576
518
  throw new Error("useAutoSyncSettings must be used within an EntityUpdatesProvider");
577
519
  const { autoSyncSettings: t, setAutoSyncSettings: o } = e;
578
520
  return [t, (n) => {
579
- const { settings: a, global: i } = n;
580
- o(i !== void 0 ? ee(i) : (s) => ({ ...s, ...a }));
521
+ const { settings: s, global: d } = n;
522
+ o(d !== void 0 ? Q(d) : (a) => ({ ...a, ...s }));
581
523
  }];
582
- }, Lo = (e, t) => {
524
+ }, $o = (e, t) => {
583
525
  if (!t) return !1;
584
526
  const o = ve(e);
585
527
  return o ? t[o] : !1;
586
- }, mt = () => Pe().replace(/-/g, ""), yt = (e = {}) => ({
587
- id: mt(),
528
+ }, vt = () => Ee().replace(/-/g, ""), mt = (e = {}) => ({
529
+ id: vt(),
588
530
  label: "Working",
589
531
  working: !0,
590
532
  settings: e
591
- }), xt = v.li`
533
+ }), yt = v.li`
592
534
  position: relative;
593
535
  padding: 4px 6px 4px 12px;
594
536
  user-select: none;
@@ -641,7 +583,7 @@ const ut = v(je)`
641
583
  display: flex;
642
584
  }
643
585
  }
644
- `, z = v(q)`
586
+ `, J = v(B)`
645
587
  &.hasIcon {
646
588
  padding: 2px;
647
589
  }
@@ -659,67 +601,67 @@ const ut = v(je)`
659
601
  }
660
602
  }
661
603
  }
662
- `, St = Z(
604
+ `, xt = X(
663
605
  ({
664
606
  id: e,
665
607
  label: t,
666
608
  startContent: o,
667
609
  endContent: r,
668
610
  isSelected: n,
669
- isEditable: a,
670
- isSaveable: i,
671
- highlighted: s,
672
- onEdit: c,
673
- onSave: d,
611
+ isEditable: s,
612
+ isSaveable: d,
613
+ highlighted: a,
614
+ onEdit: i,
615
+ onSave: c,
674
616
  onResetView: g,
675
- className: w,
617
+ className: f,
676
618
  ...m
677
619
  }, u) => {
678
- const { viewAlias: l } = te(), x = (h, S) => {
679
- h.stopPropagation(), S ? Ie({
620
+ const { viewAlias: l } = ee(), x = (h, b) => {
621
+ h.stopPropagation(), b ? Pe({
680
622
  message: `Save current ${l} settings and overwrite this ${l}?`,
681
623
  header: "Confirm save",
682
- accept: () => d && d(h, e)
683
- }) : d && d(h, e);
624
+ accept: () => c && c(h, e)
625
+ }) : c && c(h, e);
684
626
  };
685
627
  return /* @__PURE__ */ C(
686
- xt,
628
+ yt,
687
629
  {
688
630
  ...m,
689
631
  id: e,
690
- className: O(w, { selected: n }),
632
+ className: O(f, { selected: n }),
691
633
  ref: u,
692
634
  children: [
693
635
  o && o,
694
636
  /* @__PURE__ */ p("span", { className: "label", children: t }),
695
637
  g && /* @__PURE__ */ p(
696
- z,
638
+ J,
697
639
  {
698
640
  icon: "restart_alt",
699
641
  variant: "text",
700
642
  className: "reset",
701
643
  onClick: g,
702
644
  "data-tooltip": "Reset to Default",
703
- "data-shortcut": Ne("0", [ae.Shift, ae.Ctrl])
645
+ "data-shortcut": $e("0", [ae.Shift, ae.Ctrl])
704
646
  }
705
647
  ),
706
- a && i && !n && /* @__PURE__ */ p(
707
- z,
648
+ s && d && !n && /* @__PURE__ */ p(
649
+ J,
708
650
  {
709
651
  icon: "save",
710
652
  variant: "text",
711
- className: O("save", { active: s === "save" }),
712
- onClick: (h) => x(h, s !== "save"),
653
+ className: O("save", { active: a === "save" }),
654
+ onClick: (h) => x(h, a !== "save"),
713
655
  "data-tooltip": `Save ${l} settings from current ${l}`
714
656
  }
715
657
  ),
716
- a && c && /* @__PURE__ */ p(
717
- z,
658
+ s && i && /* @__PURE__ */ p(
659
+ J,
718
660
  {
719
661
  variant: "text",
720
662
  icon: "more_horiz",
721
- className: O("more", { active: s === "edit" }),
722
- onClick: (h) => c(h, e),
663
+ className: O("more", { active: a === "edit" }),
664
+ onClick: (h) => i(h, e),
723
665
  "data-tooltip": `Edit ${l}`
724
666
  }
725
667
  ),
@@ -728,10 +670,10 @@ const ut = v(je)`
728
670
  }
729
671
  );
730
672
  }
731
- ), bt = v.div`
673
+ ), St = v.div`
732
674
  overflow: auto;
733
675
  max-height: 40vh;
734
- `, Ct = v.ul`
676
+ `, bt = v.ul`
735
677
  /* reset defaults */
736
678
  margin: 0;
737
679
  padding: 0;
@@ -741,7 +683,7 @@ const ut = v(je)`
741
683
  flex-direction: column;
742
684
  gap: var(--base-gap-small);
743
685
  margin-bottom: var(--padding-s);
744
- `, Et = v.li`
686
+ `, Ct = v.li`
745
687
  height: 1px;
746
688
  background-color: var(--md-sys-color-outline-variant);
747
689
  margin: 4px 0;
@@ -750,7 +692,7 @@ v.li`
750
692
  ${le.labelSmall}
751
693
  color: var(--md-sys-color-outline);
752
694
  `;
753
- const It = v.li`
695
+ const Pt = v.li`
754
696
  ${le.labelSmall}
755
697
  color: var(--md-sys-color-outline);
756
698
  user-select: none;
@@ -786,9 +728,9 @@ const It = v.li`
786
728
  &:hover .icon {
787
729
  display: inline-flex;
788
730
  }
789
- `, Pt = Z(
731
+ `, Et = X(
790
732
  ({ title: e, collapsed: t, className: o, ...r }, n) => /* @__PURE__ */ C(
791
- It,
733
+ Pt,
792
734
  {
793
735
  ...r,
794
736
  className: O("views-section-header", { collapsed: t }, o),
@@ -796,13 +738,13 @@ const It = v.li`
796
738
  children: [
797
739
  /* @__PURE__ */ p("span", { children: e }),
798
740
  /* @__PURE__ */ p("span", { className: "spacer" }),
799
- /* @__PURE__ */ p(K, { className: "icon", icon: "expand_more" })
741
+ /* @__PURE__ */ p(G, { className: "icon", icon: "expand_more" })
800
742
  ]
801
743
  }
802
744
  )
803
- ), Oo = "_divider_", Vt = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", Mo = Z(
804
- ({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(bt, { children: /* @__PURE__ */ p(Ct, { ...o, ref: r, children: e.map((n, a) => n === "_divider_" ? /* @__PURE__ */ p(Et, {}, a) : Vt(n) ? /* @__PURE__ */ p(
805
- Pt,
745
+ ), _o = "_divider_", It = (e) => typeof e == "object" && e !== null && "type" in e && e.type === "section", jo = X(
746
+ ({ items: e, selected: t, ...o }, r) => /* @__PURE__ */ p(St, { children: /* @__PURE__ */ p(bt, { ...o, ref: r, children: e.map((n, s) => n === "_divider_" ? /* @__PURE__ */ p(Ct, {}, s) : It(n) ? /* @__PURE__ */ p(
747
+ Et,
806
748
  {
807
749
  id: n.id,
808
750
  title: n.title,
@@ -811,96 +753,101 @@ const It = v.li`
811
753
  },
812
754
  n.id
813
755
  ) : /* @__PURE__ */ p(
814
- St,
756
+ xt,
815
757
  {
816
758
  tabIndex: 0,
817
759
  isSelected: n.id === t,
818
- autoFocus: a === 0,
760
+ autoFocus: s === 0,
819
761
  ...n
820
762
  },
821
- (n.id || "") + a.toString()
763
+ (n.id || "") + s.toString()
822
764
  )) }) })
823
- ), kt = y(null), te = () => {
824
- const e = f(kt);
765
+ ), kt = y(null), ee = () => {
766
+ const e = w(kt);
825
767
  if (!e)
826
768
  throw new Error("useViewsContext must be used within a ViewsProvider");
827
769
  return e;
828
770
  };
829
- let F = !1;
771
+ let U = !1;
830
772
  const ce = () => {
831
- F || (F = !0, queueMicrotask(() => {
832
- F = !1;
773
+ U || (U = !0, queueMicrotask(() => {
774
+ U = !1;
833
775
  }));
834
- }, At = async (e, t, o, r = {}, n, a, i, s) => {
776
+ }, Vt = async (e, t, o, r = {}, n, s, d, a) => {
835
777
  const {
836
- viewSettings: c,
837
- viewType: d,
778
+ viewSettings: i,
779
+ viewType: c,
838
780
  projectName: g,
839
- selectedView: w,
781
+ selectedView: f,
840
782
  setSelectedView: m,
841
783
  workingView: u,
842
784
  onSettingsChanged: l,
843
- isErrorWorkingView: x
785
+ isErrorWorkingView: x,
786
+ updateControlledSettings: h
844
787
  } = n;
845
- if (!d) throw new Error("No view type provided for updating view settings");
846
- const h = w?.id, S = w?.working;
788
+ if (h) {
789
+ h(e);
790
+ return;
791
+ }
792
+ if (!c) throw new Error("No view type provided for updating view settings");
793
+ const b = f?.id, j = f?.working;
847
794
  try {
848
795
  t(o);
849
- const { settings: $, workingViewId: R } = i(), j = $ ?? c;
850
- if (j === void 0 && !x) {
796
+ const { settings: R, workingViewId: $ } = d(), E = R ?? i;
797
+ if (E === void 0 && !x) {
851
798
  console.warn(
852
799
  "updateViewSettings: no settings baseline available, aborting to prevent data loss."
853
800
  );
854
801
  return;
855
802
  }
856
- const k = { ...j, ...e }, N = yt(k), A = R ?? u?.id;
857
- A && (N.id = A);
858
- const b = N.id, L = a(
803
+ const N = { ...E, ...e }, _ = mt(N), S = $ ?? u?.id;
804
+ S && (_.id = S);
805
+ const te = _.id, A = s(
859
806
  {
860
- payload: A ? { settings: k } : N,
861
- viewType: d,
807
+ payload: S ? { settings: N } : _,
808
+ viewType: c,
862
809
  projectName: g
863
810
  },
864
- A
811
+ S
865
812
  );
866
- s(), (!S || w?.id !== A) && (w && l(!0), m(b)), await L, t(null), r.successMessage && B.success(r.successMessage);
867
- } catch ($) {
868
- t(null), h && m(h), w && !S && l(!1);
869
- const R = r.errorMessage || `Failed to update view settings: ${$}`;
870
- B.error(R);
813
+ a(), (!j || f?.id !== S) && (f && l(!0), m(te)), await A, t(null), r.successMessage && F.success(r.successMessage);
814
+ } catch (R) {
815
+ t(null), b && m(b), f && !j && l(!1);
816
+ const $ = r.errorMessage || `Failed to update view settings: ${R}`;
817
+ F.error($);
871
818
  }
872
- }, Tt = () => {
873
- const [e] = Te(), [t] = De(), o = te(), r = Re(), n = V(
874
- async (s, c) => {
875
- if (c) {
876
- const d = {};
877
- return ["label", "owner", "settings"].forEach((w) => {
878
- s.payload[w] !== void 0 && (d[w] = s.payload[w]);
819
+ }, At = () => {
820
+ const [e] = Ae(), [t] = Te(), o = ee(), r = De(), n = V(
821
+ async (a, i) => {
822
+ if (i) {
823
+ const c = {};
824
+ return ["label", "owner", "settings"].forEach((f) => {
825
+ a.payload[f] !== void 0 && (c[f] = a.payload[f]);
879
826
  }), await t({
880
- viewType: s.viewType,
881
- projectName: s.projectName,
882
- viewId: c,
883
- genericViewPatchModel: d
827
+ viewType: a.viewType,
828
+ projectName: a.projectName,
829
+ viewId: i,
830
+ genericViewPatchModel: c
884
831
  }).unwrap();
885
832
  } else
886
833
  return await e({
887
- viewType: s.viewType,
888
- projectName: s.projectName,
889
- genericViewPostModel: s.payload
834
+ viewType: a.viewType,
835
+ projectName: a.projectName,
836
+ genericViewPostModel: a.payload
890
837
  }).unwrap();
891
838
  },
892
839
  [e, t]
893
- ), a = V(() => {
894
- const { viewType: s, projectName: c, selectedView: d, workingView: g } = o;
895
- if (!s) return {};
896
- const w = r.getState(), m = se.endpoints.getWorkingView.select({
897
- viewType: s,
898
- projectName: c
899
- })(w), l = m?.data?.id || g?.id, x = se.endpoints.getDefaultView.select({
900
- viewType: s,
901
- projectName: c
902
- })(w), h = x?.data?.id || d?.id;
903
- return (!!l && h === l || F) && m?.data?.settings ? {
840
+ ), s = V(() => {
841
+ const { viewType: a, projectName: i, selectedView: c, workingView: g } = o;
842
+ if (!a) return {};
843
+ const f = r.getState(), m = se.endpoints.getWorkingView.select({
844
+ viewType: a,
845
+ projectName: i
846
+ })(f), l = m?.data?.id || g?.id, x = se.endpoints.getDefaultView.select({
847
+ viewType: a,
848
+ projectName: i
849
+ })(f), h = x?.data?.id || c?.id;
850
+ return (!!l && h === l || U) && m?.data?.settings ? {
904
851
  settings: m.data.settings,
905
852
  workingViewId: l
906
853
  } : x?.data?.settings ? {
@@ -910,11 +857,11 @@ const ce = () => {
910
857
  }, [r, o]);
911
858
  return {
912
859
  updateViewSettings: V(
913
- async (...s) => await At(...s, o, n, a, ce),
914
- [o, n, a]
860
+ async (...a) => await Vt(...a, o, n, s, ce),
861
+ [o, n, s]
915
862
  ),
916
863
  onCreateView: n,
917
- getLatestSettings: a,
864
+ getLatestSettings: s,
918
865
  markCacheDirty: ce
919
866
  };
920
867
  }, de = (e, t) => t.split(".").reduce((o, r) => o?.[r], e), me = (e, t, o) => {
@@ -923,64 +870,64 @@ const ce = () => {
923
870
  ...e,
924
871
  [r]: n.length ? me(e[r] || {}, n.join("."), o) : o
925
872
  } : e;
926
- }, Dt = (e, t) => {
927
- const { viewSettings: o, isLoadingViews: r } = te(), { updateViewSettings: n, getLatestSettings: a } = Tt(), [i, s] = I(null), c = P(null), d = o, g = i !== null ? i : de(d, e) ?? t, w = V((u) => {
928
- c.current = u, s(u);
873
+ }, Tt = (e, t) => {
874
+ const { viewSettings: o, isLoadingViews: r } = ee(), { updateViewSettings: n, getLatestSettings: s } = At(), [d, a] = I(null), i = k(null), c = o, g = d !== null ? d : de(c, e) ?? t, f = V((u) => {
875
+ i.current = u, a(u);
929
876
  }, []), m = V(
930
877
  (u) => {
931
878
  if (r) return;
932
- const l = a().settings ?? d ?? {}, x = c.current !== null ? c.current : de(l, e) ?? t, h = typeof u == "function" ? u(
879
+ const l = s().settings ?? c ?? {}, x = i.current !== null ? i.current : de(l, e) ?? t, h = typeof u == "function" ? u(
933
880
  x
934
881
  ) : u;
935
882
  n(
936
883
  me(l, e, h),
937
- w,
884
+ f,
938
885
  h,
939
886
  {}
940
887
  );
941
888
  },
942
889
  [
943
890
  t,
944
- a,
891
+ s,
945
892
  r,
946
893
  e,
947
- d,
948
- w,
894
+ c,
895
+ f,
949
896
  n
950
897
  ]
951
898
  );
952
899
  return [g, m];
953
- }, Uo = !0, Rt = { ...ee(!0), created: !1 }, Wo = ({ children: e, projectNames: t }) => {
954
- const o = P(0), [r = ee(!1), n] = Dt("autoSync"), [a, i] = I([]), s = G(
955
- () => Rt,
900
+ }, No = !0, Dt = { ...Q(!0), created: !1 }, Oo = ({ children: e, projectNames: t }) => {
901
+ const o = k(0), [r = Q(!1), n] = Tt("autoSync"), [s, d] = I([]), a = z(
902
+ () => Dt,
956
903
  [r]
957
904
  );
958
- E(() => {
959
- let d = 0;
905
+ P(() => {
906
+ let c = 0;
960
907
  const g = ke(
961
908
  (m) => {
962
- const u = m.map(({ project: l, topic: x, updateType: h, message: S }) => ({
909
+ const u = m.map(({ project: l, topic: x, updateType: h, message: b }) => ({
963
910
  id: ++o.current,
964
911
  project: l,
965
912
  topic: x,
966
913
  updateType: h,
967
- entityId: S.summary?.entityId,
968
- message: S
914
+ entityId: b.summary?.entityId,
915
+ message: b
969
916
  }));
970
- i((l) => [...l, ...u]);
917
+ d((l) => [...l, ...u]);
971
918
  },
972
919
  ({ key: m }) => String(m),
973
920
  0
974
- ), w = D.subscribeAll((m, u) => {
975
- if (!u?.topic || !X(u.project, t)) return;
921
+ ), f = D.subscribeAll((m, u) => {
922
+ if (!u?.topic || !Y(u.project, t)) return;
976
923
  const l = ve(u.topic);
977
- !l || s[l] || l === "created" && ![
924
+ !l || a[l] || l === "created" && ![
978
925
  "entity.folder.created",
979
926
  "entity.task.created",
980
927
  "entity.product.created",
981
928
  "entity.version.created"
982
929
  ].includes(u.topic) || g.add({
983
- key: ++d,
930
+ key: ++c,
984
931
  project: u.project,
985
932
  topic: u.topic,
986
933
  updateType: l,
@@ -988,30 +935,30 @@ const ce = () => {
988
935
  });
989
936
  });
990
937
  return () => {
991
- D.unsubscribe(w), g.clear();
938
+ D.unsubscribe(f), g.clear();
992
939
  };
993
- }, [s, t]);
994
- const c = G(
940
+ }, [a, t]);
941
+ const i = z(
995
942
  () => ({
996
- updates: a,
943
+ updates: s,
997
944
  projectNames: t,
998
- acknowledge: (d, g, w) => {
999
- i(
945
+ acknowledge: (c, g, f) => {
946
+ d(
1000
947
  (m) => m.filter(
1001
- (u) => u.id > w || !d.some((l) => he(u.topic, l)) || !X(u.project, g)
948
+ (u) => u.id > f || !c.some((l) => he(u.topic, l)) || !Y(u.project, g)
1002
949
  )
1003
950
  );
1004
951
  },
1005
952
  getLatestId: () => o.current,
1006
- autoSyncSettings: s,
953
+ autoSyncSettings: a,
1007
954
  setAutoSyncSettings: n
1008
955
  }),
1009
- [s, t, n, a]
956
+ [a, t, n, s]
1010
957
  );
1011
- return /* @__PURE__ */ p(Q.Provider, { value: c, children: e });
1012
- }, Fo = 1, $t = v.div`
958
+ return /* @__PURE__ */ p(Z.Provider, { value: i, children: e });
959
+ }, Lo = 1, Rt = v.div`
1013
960
  min-width: 350px;
1014
- `, Nt = v.div`
961
+ `, $t = v.div`
1015
962
  margin-top: 12px;
1016
963
  min-height: 60px;
1017
964
  min-width: 350px;
@@ -1022,32 +969,32 @@ const ce = () => {
1022
969
  margin-top: 12px;
1023
970
  font-weight: 600;
1024
971
  color: var(--md-sys-color-error);
1025
- `, Bo = ({
972
+ `, Mo = ({
1026
973
  entityLabel: e,
1027
974
  childrenDetails: t,
1028
975
  totalLine: o,
1029
976
  message: r
1030
- }) => /* @__PURE__ */ C($t, { children: [
977
+ }) => /* @__PURE__ */ C(Rt, { children: [
1031
978
  /* @__PURE__ */ p("p", { children: r || `Are you sure you want to delete ${e}? This action cannot be undone.` }),
1032
- t.length > 0 && /* @__PURE__ */ C(Nt, { children: [
979
+ t.length > 0 && /* @__PURE__ */ C($t, { children: [
1033
980
  /* @__PURE__ */ p(_t, { children: "The following will also be affected:" }),
1034
- t.map((n, a) => /* @__PURE__ */ p("p", { children: n }, a))
981
+ t.map((n, s) => /* @__PURE__ */ p("p", { children: n }, s))
1035
982
  ] }),
1036
983
  o && /* @__PURE__ */ p(jt, { children: o })
1037
- ] }), Jo = v($e)`
984
+ ] }), Uo = v(Re)`
1038
985
  max-height: min(600px, 90vh);
1039
- `, qo = v.div`
986
+ `, Fo = v.div`
1040
987
  display: flex;
1041
988
  flex-direction: column;
1042
989
  width: 100%;
1043
- `, Ho = v.label`
990
+ `, Wo = v.label`
1044
991
  margin: 2px 0 14px 0;
1045
- `, zo = v.div`
992
+ `, Bo = v.div`
1046
993
  display: flex;
1047
994
  padding-top: 14px;
1048
995
  gap: 8px;
1049
996
  justify-content: flex-end;
1050
- `, Go = v.div`
997
+ `, qo = v.div`
1051
998
  display: flex;
1052
999
  flex-direction: column;
1053
1000
  gap: 8px;
@@ -1056,118 +1003,115 @@ const ce = () => {
1056
1003
  /* scroll container clips the inputs' 2px focus outline — inset it, then pull back to keep alignment */
1057
1004
  padding: 4px;
1058
1005
  margin: -4px;
1059
- `, Ko = v.label`
1006
+ `, Ho = v.label`
1060
1007
  display: flex;
1061
1008
  align-items: center;
1062
1009
  justify-content: space-between;
1063
1010
  gap: 12px;
1064
- `, Yo = v(ue)`
1011
+ `, Jo = v(ue)`
1065
1012
  width: 180px;
1066
- `, Xo = v(ue)`
1013
+ `, zo = v(ue)`
1067
1014
  width: 100%;
1068
1015
  /* room for the 2px focus outline */
1069
1016
  margin: 2px 0;
1070
- `, Lt = /* @__PURE__ */ new Set([
1017
+ `, Nt = /* @__PURE__ */ new Set([
1071
1018
  "folder",
1072
1019
  "task",
1073
1020
  "product",
1074
1021
  "version",
1075
1022
  "representation",
1076
1023
  "workfile"
1077
- ]), Zo = (e) => !!e && Lt.has(e), ye = y(null), Qo = () => {
1078
- const e = f(ye);
1024
+ ]), Go = (e) => !!e && Nt.has(e), ye = y(null), Ko = () => {
1025
+ const e = w(ye);
1079
1026
  if (!e)
1080
1027
  throw new Error("useDeleteEntitiesContext must be used within a DeleteEntitiesProvider");
1081
1028
  return e;
1082
- }, en = () => f(ye), tn = "tableExport", Ot = y(null), on = () => f(Ot);
1029
+ }, Yo = () => w(ye), Xo = "tableExport", Ot = y(null), Zo = () => w(Ot);
1083
1030
  export {
1084
- Io as $,
1085
- go as A,
1086
- Y as B,
1087
- Xo as C,
1088
- Bo as D,
1089
- nt as E,
1090
- qo as F,
1091
- fo as G,
1092
- Qe as H,
1093
- st as I,
1094
- it as J,
1095
- ct as K,
1096
- gt as L,
1031
+ wo as $,
1032
+ po as A,
1033
+ Ze as B,
1034
+ zo as C,
1035
+ Mo as D,
1036
+ rt as E,
1037
+ Fo as F,
1038
+ at as G,
1039
+ it as H,
1040
+ pt as I,
1041
+ gt as J,
1042
+ ze as K,
1043
+ Me as L,
1097
1044
  ft as M,
1098
- wt as N,
1099
- Ge as O,
1100
- we as P,
1101
- Ue as Q,
1102
- We as R,
1103
- Jo as S,
1104
- at as T,
1105
- Ke as U,
1106
- ye as V,
1107
- tn as W,
1108
- Ot as X,
1109
- Q as Y,
1110
- Wo as Z,
1111
- Uo as _,
1112
- lo as a,
1113
- ge as a0,
1114
- To as a1,
1115
- yo as a2,
1116
- Lo as a3,
1117
- ve as a4,
1118
- ot as a5,
1119
- Zo as a6,
1120
- X as a7,
1121
- he as a8,
1122
- xo as a9,
1123
- ee as aa,
1124
- Vo as ab,
1125
- Po as ac,
1126
- jo as ad,
1127
- Qo as ae,
1128
- en as af,
1129
- dt as ag,
1130
- So as ah,
1131
- Eo as ai,
1132
- Ao as aj,
1133
- bo as ak,
1134
- _o as al,
1135
- on as am,
1136
- Co as an,
1137
- yt as ao,
1138
- Oo as ap,
1139
- kt as aq,
1140
- te as ar,
1141
- Pt as as,
1142
- Mo as at,
1143
- St as au,
1045
+ ye as N,
1046
+ Xo as O,
1047
+ fe as P,
1048
+ Ot as Q,
1049
+ Ue as R,
1050
+ Uo as S,
1051
+ st as T,
1052
+ Ge as U,
1053
+ Z as V,
1054
+ Oo as W,
1055
+ No as X,
1056
+ So as Y,
1057
+ ge as Z,
1058
+ Io as _,
1059
+ co as a,
1060
+ $o as a0,
1061
+ ve as a1,
1062
+ tt as a2,
1063
+ Go as a3,
1064
+ Y as a4,
1065
+ he as a5,
1066
+ ho as a6,
1067
+ Q as a7,
1068
+ Co as a8,
1069
+ bo as a9,
1070
+ Ro as aa,
1071
+ Ko as ab,
1072
+ Yo as ac,
1073
+ ct as ad,
1074
+ vo as ae,
1075
+ xo as af,
1076
+ Eo as ag,
1077
+ mo as ah,
1078
+ Do as ai,
1079
+ Zo as aj,
1080
+ yo as ak,
1081
+ mt as al,
1082
+ _o as am,
1083
+ kt as an,
1084
+ ee as ao,
1085
+ Et as ap,
1086
+ jo as aq,
1087
+ xt as ar,
1088
+ At as as,
1089
+ vt as at,
1090
+ Vt as au,
1144
1091
  Tt as av,
1145
- mt as aw,
1146
- At as ax,
1147
- Dt as ay,
1148
- wo as b,
1149
- co as c,
1150
- Fo as d,
1151
- Ho as e,
1152
- Go as f,
1153
- Ko as g,
1154
- Yo as h,
1155
- zo as i,
1156
- fe as j,
1157
- Ro as k,
1158
- Ye as l,
1159
- rt as m,
1160
- Xe as n,
1161
- mo as o,
1162
- Ze as p,
1163
- Do as q,
1164
- ho as r,
1165
- $o as s,
1166
- No as t,
1167
- ko as u,
1168
- uo as v,
1169
- vo as w,
1170
- po as x,
1171
- He as y,
1172
- Me as z
1092
+ go as b,
1093
+ io as c,
1094
+ Lo as d,
1095
+ Wo as e,
1096
+ qo as f,
1097
+ Ho as g,
1098
+ Jo as h,
1099
+ Bo as i,
1100
+ we as j,
1101
+ Vo as k,
1102
+ Xe as l,
1103
+ nt as m,
1104
+ Ao as n,
1105
+ ko as o,
1106
+ To as p,
1107
+ lo as q,
1108
+ Ke as r,
1109
+ uo as s,
1110
+ He as t,
1111
+ Po as u,
1112
+ Le as v,
1113
+ Ye as w,
1114
+ K as x,
1115
+ ot as y,
1116
+ fo as z
1173
1117
  };