@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,25 +1,25 @@
1
- import { jsx as E, jsxs as G, Fragment as $e } from "react/jsx-runtime";
2
- import { useState as U, useCallback as O, useMemo as P, useContext as Ct, useEffect as ue, forwardRef as Lt, useRef as we, useId as wt, useImperativeHandle as Et, useLayoutEffect as _e } from "react";
3
- import { Splitter as Dt, SplitterPanel as kt } from "primereact/splitter";
4
- import B from "styled-components";
5
- import { i as Rt, P as At, d as ze, U as it } from "./MetaWidget.es.js";
1
+ import { jsx as E, jsxs as W, Fragment as Ue } from "react/jsx-runtime";
2
+ import { useState as G, useCallback as F, useMemo as N, useContext as wt, useEffect as ie, forwardRef as Et, useRef as Re, useId as Dt, useImperativeHandle as Rt, useLayoutEffect as Oe } from "react";
3
+ import { Splitter as kt, SplitterPanel as At } from "primereact/splitter";
4
+ import V from "styled-components";
5
+ import { i as Mt, P as _t, d as Be, U as lt } from "./MetaWidget.es.js";
6
6
  import "@module-federation/enhanced/runtime";
7
- import { menuItemsAt as Mt } from "@ynput/ayon-addon/host";
8
- import { toast as Qe } from "react-toastify";
9
- import { InputText as _t, Button as Pt, Icon as Ot } from "@ynput/ayon-react-components";
10
- import { bs as Je, bD as Nt, bB as rt, bA as Ft, bG as jt } from "./searchTerms.es.js";
11
- import { dx as lt, cP as $t, b_ as zt, bE as Ut } from "./getUris.es.js";
7
+ import { menuItemsAt as Pt } from "@ynput/ayon-addon/host";
8
+ import { toast as Je } from "react-toastify";
9
+ import { InputText as Ot, Button as Nt, Icon as Ft } from "@ynput/ayon-react-components";
10
+ import { bs as Ze, bF as jt, bD as ct, bC as $t, bI as zt, bA as Ut } from "./searchTerms.es.js";
11
+ import { dx as dt, cP as Bt, b_ as Vt, bE as Ht } from "./getUris.es.js";
12
12
  import "primereact/confirmdialog";
13
13
  import "lodash";
14
14
  import "uuid";
15
15
  import "axios";
16
- import { l as ct, s as Ue, q as be, c as Bt, b as Be, m as Vt, ae as Ht, ad as Gt, u as dt, al as Wt, _ as Xe } from "./TableExportContextInstance.es.js";
16
+ import { l as ut, n as Ve, o as Te, c as Wt, b as He, m as Gt, ab as Kt, aa as qt, u as pt, ai as Yt, X as et } from "./TableExportContextInstance.es.js";
17
17
  import "semver";
18
18
  import "./ContextMenuContextInstance.es.js";
19
- import Y from "clsx";
19
+ import Q from "clsx";
20
20
  import "react-dom";
21
21
  import "react-router-dom";
22
- import { E as qt, u as Kt } from "./EntityPickerDialog.es.js";
22
+ import { E as Qt, u as Xt } from "./EntityPickerDialog.es.js";
23
23
  import "./FilmstripEntityCard.es.js";
24
24
  import "date-fns";
25
25
  import "lexical";
@@ -32,60 +32,60 @@ import "@lexical/selection";
32
32
  import "@lexical/utils";
33
33
  import "@lexical/react/LexicalBlockWithAlignableContents";
34
34
  import "@lexical/react/LexicalDecoratorBlockNode";
35
- import { useContributions as Yt, prefetchPiece as Qt, runContribution as Jt } from "@ynput/ayon-addon";
35
+ import { useContributions as Jt, prefetchPiece as Zt, runContribution as en } from "@ynput/ayon-addon";
36
36
  import "@tanstack/react-table";
37
37
  import "react-redux";
38
- import { b as ge, H as Xt, a as Zt, e as en, S as tn } from "./SimpleTable.es.js";
39
- import { D as nn, L as sn, s as on } from "./sortLists.es.js";
40
- import { a as Ze, g as Pe } from "./getEntityTypeIcon.es.js";
41
- import { g as an } from "./iconUtils.es.js";
42
- import { u as rn, a as ln } from "./useAttributeEnums.es.js";
43
- import { b as cn, s as dn } from "./buildHierarchicalTableRows.es.js";
44
- import { n as Ce } from "./entityDefinitions.es.js";
45
- import { a as un, K as pn } from "./platform.es.js";
46
- import { u as mn } from "./NewEntityContextInstance.es.js";
47
- import { u as fn } from "./VersionUploadContextInstance.es.js";
48
- import { M as hn, a as gn } from "./Menu.es.js";
49
- const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) => ({
50
- id: ut,
38
+ import { b as be, H as tn, a as nn, e as sn, S as on } from "./SimpleTable.es.js";
39
+ import { D as an, L as rn, s as ln } from "./sortLists.es.js";
40
+ import { a as tt, g as Ne } from "./getEntityTypeIcon.es.js";
41
+ import { g as cn } from "./iconUtils.es.js";
42
+ import { u as dn, a as un } from "./useAttributeEnums.es.js";
43
+ import { b as pn, s as mn } from "./buildHierarchicalTableRows.es.js";
44
+ import { n as Ee } from "./entityDefinitions.es.js";
45
+ import { a as fn, K as hn } from "./platform.es.js";
46
+ import { u as gn } from "./NewEntityContextInstance.es.js";
47
+ import { u as yn } from "./VersionUploadContextInstance.es.js";
48
+ import { M as bn, a as Sn } from "./Menu.es.js";
49
+ const mt = "default", De = { id: "label", label: "Name", desc: !1 }, Fe = (e) => ({
50
+ id: mt,
51
51
  label: e,
52
52
  desc: !1
53
- }), yn = ["hierarchy", "assignees", "author"], bn = ["status", "type", "taskType", "folderType"], Ve = (e) => yn.includes(e) ? [Le] : e === "entityList" ? sn : e.startsWith("attrib.") ? [Oe("Attribute order"), Le] : bn.includes(e) ? [Oe("Anatomy order"), Le] : [Oe("Default order"), Le], pt = (e) => {
54
- if (e === "entityList") return nn;
55
- const [t] = Ve(e);
53
+ }), Tn = ["hierarchy", "assignees", "author"], vn = ["status", "type", "taskType", "folderType"], We = (e) => Tn.includes(e) ? [De] : e === "entityList" ? rn : e.startsWith("attrib.") ? [Fe("Attribute order"), De] : vn.includes(e) ? [Fe("Anatomy order"), De] : [Fe("Default order"), De], ft = (e) => {
54
+ if (e === "entityList") return an;
55
+ const [t] = We(e);
56
56
  return { by: t.id, desc: t.desc };
57
- }, eo = (e, t) => {
57
+ }, so = (e, t) => {
58
58
  const { by: s, desc: a } = t || {};
59
- return Ve(e).some((u) => u.id === s) ? { by: s, desc: !!a } : pt(e);
60
- }, Sn = ["noValue", "hasValue"], Tn = (e) => e.id.startsWith("folder-"), vn = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Ne = (e) => e.label || e.name || "", mt = (e, t, { by: s, desc: a }) => {
61
- const u = (l) => Sn.includes(l.id) || t === "entityList" && Tn(l), c = e.filter(u), p = e.filter((l) => !u(l));
62
- let g;
59
+ return We(e).some((u) => u.id === s) ? { by: s, desc: !!a } : ft(e);
60
+ }, In = ["noValue", "hasValue"], xn = (e) => e.id.startsWith("folder-"), Cn = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), je = (e) => e.label || e.name || "", ht = (e, t, { by: s, desc: a }) => {
61
+ const u = (l) => In.includes(l.id) || t === "entityList" && xn(l), c = e.filter(u), p = e.filter((l) => !u(l));
62
+ let h;
63
63
  if (t === "entityList")
64
- g = on(
64
+ h = ln(
65
65
  p.map((l) => ({
66
66
  row: l,
67
- label: Ne(l),
67
+ label: je(l),
68
68
  active: l.data?.active ?? !0,
69
69
  createdAt: l.data?.createdAt,
70
70
  updatedAt: l.data?.updatedAt
71
71
  })),
72
72
  { by: s, desc: a }
73
73
  ).map(({ row: l }) => l);
74
- else if (s === ut)
75
- g = a ? [...p].reverse() : p;
74
+ else if (s === mt)
75
+ h = a ? [...p].reverse() : p;
76
76
  else {
77
77
  const l = a ? -1 : 1;
78
- g = [...p].sort(
79
- (m, y) => vn.compare(Ne(m), Ne(y)) * l
78
+ h = [...p].sort(
79
+ (m, g) => Cn.compare(je(m), je(g)) * l
80
80
  );
81
81
  }
82
- return [...c, ...g].map(
83
- (l) => l.subRows?.length ? { ...l, subRows: mt(l.subRows, t, { by: s, desc: a }) } : l
82
+ return [...c, ...h].map(
83
+ (l) => l.subRows?.length ? { ...l, subRows: ht(l.subRows, t, { by: s, desc: a }) } : l
84
84
  );
85
- }, In = (e, t, s) => {
86
- const a = pt(t);
87
- return s.by !== "label" && s.by === a.by && s.desc === a.desc ? e : mt(e, t, s);
88
- }, xn = ({
85
+ }, Ln = (e, t, s) => {
86
+ const a = ft(t);
87
+ return s.by !== "label" && s.by === a.by && s.desc === a.desc ? e : ht(e, t, s);
88
+ }, wn = ({
89
89
  options: e,
90
90
  sort: t,
91
91
  onChange: s,
@@ -97,13 +97,13 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
97
97
  label: u,
98
98
  icon: c,
99
99
  items: e.map((p) => {
100
- const g = t.by === p.id;
100
+ const h = t.by === p.id;
101
101
  return {
102
102
  id: `${a}-${p.id}`,
103
103
  label: p.label,
104
104
  onClick: () => s({ by: p.id, desc: p.desc }),
105
- selected: g,
106
- endActions: g ? [
105
+ selected: h,
106
+ endActions: h ? [
107
107
  {
108
108
  icon: t.desc ? "arrow_downward" : "arrow_upward",
109
109
  tooltip: t.desc ? "Descending" : "Ascending",
@@ -112,68 +112,68 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
112
112
  ] : void 0
113
113
  };
114
114
  })
115
- }), Cn = 180, ft = 100, ht = 34, Ln = (e, t = [], s = ft) => e.map((a) => t.includes(a) ? ht : s), wn = (e, t, s, a) => {
116
- const u = e.reduce((m, y) => m + y, 0), c = a.filter(Boolean).length;
115
+ }), En = 180, gt = 100, yt = 34, Dn = (e, t = [], s = gt) => e.map((a) => t.includes(a) ? yt : s), Rn = (e, t, s, a) => {
116
+ const u = e.reduce((m, g) => m + g, 0), c = a.filter(Boolean).length;
117
117
  if (!c || u === s) return e;
118
118
  if (u < s) {
119
119
  const m = (s - u) / c;
120
- return e.map((y, C) => a[C] ? y + m : y);
120
+ return e.map((g, x) => a[x] ? g + m : g);
121
121
  }
122
- const p = e.map((m, y) => a[y] ? m - t[y] : 0), g = p.reduce((m, y) => m + y, 0);
123
- if (!g) return e;
122
+ const p = e.map((m, g) => a[g] ? m - t[g] : 0), h = p.reduce((m, g) => m + g, 0);
123
+ if (!h) return e;
124
124
  const l = u - s;
125
- return e.map((m, y) => m - l * (p[y] / g));
126
- }, En = (e, t, s = [], a = 0, u = Cn) => {
125
+ return e.map((m, g) => m - l * (p[g] / h));
126
+ }, kn = (e, t, s = [], a = 0, u = En) => {
127
127
  if (!t.length)
128
128
  return { heights: [], mins: [], sizes: [], minSize: 2, height: a };
129
- const c = t.filter((b) => !s.includes(b)).length, p = (t.length - c) * ht, g = a && c ? Math.min(
129
+ const c = t.filter((y) => !s.includes(y)).length, p = (t.length - c) * yt, h = a && c ? Math.min(
130
130
  u,
131
131
  Math.max(
132
- ft,
132
+ gt,
133
133
  Math.floor((a - p) / c)
134
134
  )
135
- ) : u, l = Ln(t, s), m = t.map(
136
- (b, i) => s.includes(b) ? l[i] : Math.max(e[b] ?? g, l[i])
137
- ), y = t.map((b) => !s.includes(b)), C = l.reduce((b, i) => b + i, 0), f = y.some(Boolean) ? Math.max(a, C) : C, h = wn(m, l, f, y);
135
+ ) : u, l = Dn(t, s), m = t.map(
136
+ (y, i) => s.includes(y) ? l[i] : Math.max(e[y] ?? h, l[i])
137
+ ), g = t.map((y) => !s.includes(y)), x = l.reduce((y, i) => y + i, 0), f = g.some(Boolean) ? Math.max(a, x) : x, b = Rn(m, l, f, g);
138
138
  return {
139
- heights: h,
139
+ heights: b,
140
140
  mins: l,
141
- sizes: h.map((b) => b / f * 100),
141
+ sizes: b.map((y) => y / f * 100),
142
142
  // primereact must allow the drag past the min; clampDraggedHeights puts it back
143
143
  minSize: 2,
144
144
  height: f
145
145
  };
146
- }, Dn = (e, t, s) => {
146
+ }, An = (e, t, s) => {
147
147
  const a = e.map((l, m) => Math.max(l / 100 * t, s[m])), u = Math.max(
148
148
  t,
149
149
  s.reduce((l, m) => l + m, 0)
150
150
  ), c = a.reduce((l, m) => l + m, 0) - u;
151
151
  if (c <= 0) return a;
152
- const p = a.map((l, m) => l - s[m]), g = p.reduce((l, m) => l + m, 0);
153
- return g ? a.map((l, m) => l - c * (p[m] / g)) : a;
154
- }, kn = "slicer-splitter", et = {
152
+ const p = a.map((l, m) => l - s[m]), h = p.reduce((l, m) => l + m, 0);
153
+ return h ? a.map((l, m) => l - c * (p[m] / h)) : a;
154
+ }, Mn = "slicer-splitter", nt = {
155
155
  minSize: 2,
156
156
  size: 12
157
- }, to = () => {
158
- const [e, t] = ct(kn, [
159
- et.size,
160
- 100 - et.size
157
+ }, oo = () => {
158
+ const [e, t] = ut(Mn, [
159
+ nt.size,
160
+ 100 - nt.size
161
161
  ]);
162
162
  return [e, (a) => {
163
163
  t(a.sizes);
164
164
  }];
165
- }, Rn = (e, t, s = [], a = 0) => {
166
- const [u, c] = ct(
165
+ }, _n = (e, t, s = [], a = 0) => {
166
+ const [u, c] = ut(
167
167
  `slicer-panel-heights-${e}`,
168
168
  {}
169
- ), [p, g] = U(0), l = Array.isArray(u) ? {} : u, {
169
+ ), [p, h] = G(0), l = Array.isArray(u) ? {} : u, {
170
170
  sizes: m,
171
- mins: y,
172
- minSize: C,
171
+ mins: g,
172
+ minSize: x,
173
173
  height: f,
174
- heights: h
175
- } = En(l, t, s, a), b = (i) => {
176
- const I = Dn(i.sizes, f, y);
174
+ heights: b
175
+ } = kn(l, t, s, a), y = (i) => {
176
+ const I = An(i.sizes, f, g);
177
177
  c({
178
178
  ...l,
179
179
  ...Object.fromEntries(
@@ -181,29 +181,29 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
181
181
  )
182
182
  }), I.some(
183
183
  (d, o) => Math.abs(d - i.sizes[o] / 100 * f) > 1
184
- ) && g((d) => d + 1);
184
+ ) && h((d) => d + 1);
185
185
  };
186
186
  return {
187
187
  sizes: m,
188
- minSize: C,
188
+ minSize: x,
189
189
  height: f,
190
- panelHeights: h,
190
+ panelHeights: b,
191
191
  layoutKey: `${t.join("|")}#${s.join("|")}#${p}`,
192
- handleResizeEnd: b
192
+ handleResizeEnd: y
193
193
  };
194
- }, An = ({
194
+ }, Pn = ({
195
195
  projectName: e,
196
196
  movingEntities: t,
197
197
  onClose: s,
198
198
  onMoveComplete: a
199
199
  }) => {
200
- const [u] = lt(), c = Rt(), { folders: p } = Ue(), g = c?.tableData || [], l = O(
201
- (b) => c?.getEntityById(b) || p.find((i) => i.id === b),
200
+ const [u] = dt(), c = Mt(), { folders: p } = Ve(), h = c?.tableData || [], l = F(
201
+ (y) => c?.getEntityById(y) || p.find((i) => i.id === y),
202
202
  [p, c]
203
- ), m = O(
204
- async (b) => {
205
- if (!t || b.length === 0) return;
206
- const i = b[0];
203
+ ), m = F(
204
+ async (y) => {
205
+ if (!t || y.length === 0) return;
206
+ const i = y[0];
207
207
  try {
208
208
  const I = t.entities.map(
209
209
  (o, n) => ({
@@ -225,7 +225,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
225
225
  }
226
226
  a?.(i);
227
227
  } catch (I) {
228
- let r = Je(I) || "Failed to move entities";
228
+ let r = Ze(I) || "Failed to move entities";
229
229
  if (r.includes("already exists"))
230
230
  if (t.entities.length > 1)
231
231
  r = "Cannot move some entities - one or more entities with the same name already exist in the target location";
@@ -236,16 +236,16 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
236
236
  const o = r.match(/name '.*?, (.+?)' already exists/);
237
237
  r = `Cannot move "${o ? o[1] : "this folder"}" - a folder with this name already exists in the target location`;
238
238
  }
239
- Qe.error(r);
239
+ Je.error(r);
240
240
  } finally {
241
241
  s();
242
242
  }
243
243
  },
244
244
  [t, e, u, s, a]
245
- ), y = O(async () => {
245
+ ), g = F(async () => {
246
246
  if (t)
247
247
  try {
248
- const b = t.entities.map(
248
+ const y = t.entities.map(
249
249
  (r, d) => ({
250
250
  id: `move-to-root-${r.entityId}-${Date.now()}-${d}`,
251
251
  type: "update",
@@ -256,49 +256,49 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
256
256
  ), I = (await u({
257
257
  projectName: e,
258
258
  operationsRequestModel: {
259
- operations: b
259
+ operations: y
260
260
  }
261
261
  }).unwrap())?.operations?.filter((r) => r.success === !1) || [];
262
262
  if (I.length > 0) {
263
263
  const r = I.map((d) => d.detail).join(", ");
264
264
  throw new Error(r || "Some move operations failed");
265
265
  }
266
- } catch (b) {
267
- let i = Je(b) || "Failed to move entities to root";
268
- Qe.error(i);
266
+ } catch (y) {
267
+ let i = Ze(y) || "Failed to move entities to root";
268
+ Je.error(i);
269
269
  } finally {
270
270
  s();
271
271
  }
272
- }, [t, e, u, s]), C = O(() => {
272
+ }, [t, e, u, s]), x = F(() => {
273
273
  if (!t) return [];
274
- const b = [];
274
+ const y = [];
275
275
  return t.entities.forEach((i) => {
276
- b.push(i.entityId);
276
+ y.push(i.entityId);
277
277
  }), p.forEach((i) => {
278
278
  t.entities.some((r) => {
279
279
  const d = l(r.entityId);
280
- return d?.name ? g.filter((n) => r.entityType === "folder" ? n.entityType === "folder" && n.parentId === i.id : r.entityType === "task" ? n.entityType === "task" && n.folderId === i.id : !1).some(
280
+ return d?.name ? h.filter((n) => r.entityType === "folder" ? n.entityType === "folder" && n.parentId === i.id : r.entityType === "task" ? n.entityType === "task" && n.folderId === i.id : !1).some(
281
281
  (n) => n.name === d.name && n.entityId !== r.entityId
282
282
  ) : !1;
283
- }) && b.push(i.id);
284
- }), [...new Set(b)];
285
- }, [t, p, g, l]), f = O(
286
- (b) => {
283
+ }) && y.push(i.id);
284
+ }), [...new Set(y)];
285
+ }, [t, p, h, l]), f = F(
286
+ (y) => {
287
287
  if (!t) return;
288
288
  if (t.entities.some(
289
- (o) => o.entityType === "folder" && o.entityId === b
289
+ (o) => o.entityType === "folder" && o.entityId === y
290
290
  ))
291
291
  return "Cannot move folder to itself";
292
292
  if (t.entities.some(
293
- (o) => o.currentParentId === b
293
+ (o) => o.currentParentId === y
294
294
  ))
295
295
  return "Cannot move to the same location";
296
- const r = p.find((o) => o.id === b);
296
+ const r = p.find((o) => o.id === y);
297
297
  if (r) {
298
298
  const o = t.entities.find((n) => {
299
299
  const v = l(n.entityId);
300
- return v?.name ? g.filter((x) => n.entityType === "folder" ? x.entityType === "folder" && x.parentId === r.id : n.entityType === "task" ? x.entityType === "task" && x.folderId === r.id : !1).some(
301
- (x) => x.name === v.name && x.entityId !== n.entityId
300
+ return v?.name ? h.filter((C) => n.entityType === "folder" ? C.entityType === "folder" && C.parentId === r.id : n.entityType === "task" ? C.entityType === "task" && C.folderId === r.id : !1).some(
301
+ (C) => C.name === v.name && C.entityId !== n.entityId
302
302
  ) : !1;
303
303
  });
304
304
  if (o)
@@ -308,29 +308,29 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
308
308
  (o) => o.entityType === "folder"
309
309
  ) ? "Cannot move folder to its child" : "Cannot move to this location";
310
310
  },
311
- [t, p, g, l]
312
- ), h = P(() => t?.entities.every((b) => b.entityType === "folder") || !1, [t]);
311
+ [t, p, h, l]
312
+ ), b = N(() => t?.entities.every((y) => y.entityType === "folder") || !1, [t]);
313
313
  return {
314
314
  handleMoveSubmit: m,
315
- handleMoveToRoot: y,
316
- getDisabledFolderIds: C,
315
+ handleMoveToRoot: g,
316
+ getDisabledFolderIds: x,
317
317
  getDisabledMessage: f,
318
- canMoveToRoot: h
318
+ canMoveToRoot: b
319
319
  };
320
- }, Mn = ({
320
+ }, On = ({
321
321
  projectName: e,
322
322
  movingEntities: t,
323
323
  onClose: s,
324
324
  onMoveComplete: a
325
325
  }) => {
326
- const { handleMoveSubmit: u, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: g } = An({
326
+ const { handleMoveSubmit: u, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: h } = Pn({
327
327
  projectName: e,
328
328
  movingEntities: t ?? null,
329
329
  onClose: s,
330
330
  onMoveComplete: a
331
331
  });
332
332
  return t?.entities.length ? /* @__PURE__ */ E(
333
- qt,
333
+ Qt,
334
334
  {
335
335
  projectName: e,
336
336
  entityType: "folder",
@@ -341,55 +341,55 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
341
341
  ),
342
342
  onMoveToRoot: c,
343
343
  disabledIds: p(),
344
- getDisabledMessage: g
344
+ getDisabledMessage: h
345
345
  }
346
346
  ) : null;
347
- }, _n = ({ projectName: e, useExtraSlices: t }) => {
348
- const [s, { isLoading: a, isFetching: u }] = $t(), { formatAssignees: c } = t();
347
+ }, Nn = ({ projectName: e, useExtraSlices: t }) => {
348
+ const [s, { isLoading: a, isFetching: u }] = Bt(), { formatAssignees: c } = t();
349
349
  return {
350
350
  getData: async () => {
351
- const g = await s({ projectName: e || "" }, !0).unwrap();
352
- return c(g);
351
+ const h = await s({ projectName: e || "" }, !0).unwrap();
352
+ return c(h);
353
353
  },
354
354
  isLoading: a || u
355
355
  };
356
- }, Pn = ({ scopes: e, useExtraSlices: t }) => {
357
- const { isLoading: s, productTypes: a, ...u } = be(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: g, formatTypes: l, formatAttribute: m } = t();
358
- return { project: u, getStatuses: async () => c(u, e), getTypes: async () => l(u), getTaskTypes: async () => p(u), getProductTypes: async () => g(a), getAttribute: async (i) => m ? m(i).map(
359
- (I) => Nt(I.icon ?? void 0) ? { ...I, icon: void 0, img: I.icon, imgShape: "circle" } : I
356
+ }, Fn = ({ scopes: e, useExtraSlices: t }) => {
357
+ const { isLoading: s, productTypes: a, ...u } = Te(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: h, formatTypes: l, formatAttribute: m } = t();
358
+ return { project: u, getStatuses: async () => c(u, e), getTypes: async () => l(u), getTaskTypes: async () => p(u), getProductTypes: async () => h(a), getAttribute: async (i) => m ? m(i).map(
359
+ (I) => jt(I.icon ?? void 0) ? { ...I, icon: void 0, img: I.icon, imgShape: "circle" } : I
360
360
  ) : void 0, isLoading: s };
361
- }, On = ({ entityTypes: e, request: t }) => {
361
+ }, jn = ({ entityTypes: e, request: t }) => {
362
362
  const {
363
363
  attributes: s,
364
364
  isLoading: { siteInfo: a }
365
- } = Bt(), u = Ct(At), c = u?.attribFields?.length ? u.attribFields : s, { projectName: p } = be();
366
- return { attributes: rn(c, { projectName: p, request: t ?? [] }).filter((m) => rt(m.data)).filter((m) => e.some((y) => m.scope?.includes(y))).map(
367
- (m) => m.data.enum?.some((y) => y.hidden) ? { ...m, data: { ...m.data, enum: Ft(m.data.enum) } } : m
365
+ } = Wt(), u = wt(_t), c = u?.attribFields?.length ? u.attribFields : s, { projectName: p } = Te();
366
+ return { attributes: dn(c, { projectName: p, request: t ?? [] }).filter((m) => ct(m.data)).filter((m) => e.some((g) => m.scope?.includes(g))).map(
367
+ (m) => m.data.enum?.some((g) => g.hidden) ? { ...m, data: { ...m.data, enum: $t(m.data.enum) } } : m
368
368
  ), isLoading: a };
369
- }, Nn = "snippet_folder", ye = "folder", Fn = (e) => `${ye}-${e}`, Fe = (e) => [...e].sort((t, s) => {
369
+ }, $n = "snippet_folder", Se = "folder", zn = (e) => `${Se}-${e}`, $e = (e) => [...e].sort((t, s) => {
370
370
  if (t.active && !s.active) return -1;
371
371
  if (!t.active && s.active) return 1;
372
372
  const a = new Date(t.createdAt || 0);
373
373
  return new Date(s.createdAt || 0).getTime() - a.getTime();
374
- }), jn = (e = !0) => {
375
- const { projectName: t } = be(), { powerLicense: s } = Be(), {
374
+ }), Un = (e = !0) => {
375
+ const { projectName: t } = Te(), { powerLicense: s } = He(), {
376
376
  data: a,
377
377
  isLoading: u,
378
378
  isFetching: c
379
- } = zt(
379
+ } = Vt(
380
380
  { projectName: t || "" },
381
381
  {
382
382
  initialPageParam: { cursor: "" },
383
383
  skip: !t || !e
384
384
  }
385
- ), { data: p = [], isLoading: g } = Ut(
385
+ ), { data: p = [], isLoading: h } = Ht(
386
386
  { projectName: t || "" },
387
387
  { skip: !t || !s || !e }
388
- ), l = P(() => {
388
+ ), l = N(() => {
389
389
  if (!a?.pages) return [];
390
- const C = a.pages.flatMap((f) => f.lists);
390
+ const x = a.pages.flatMap((f) => f.lists);
391
391
  if (s && p.length > 0) {
392
- const f = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Set();
392
+ const f = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set();
393
393
  for (const n of p)
394
394
  f.set(n.id, {
395
395
  id: n.id,
@@ -397,20 +397,20 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
397
397
  children: /* @__PURE__ */ new Map(),
398
398
  items: [],
399
399
  hasAnyItems: !1
400
- }), n.parentId || h.add(n.id);
400
+ }), n.parentId || b.add(n.id);
401
401
  for (const n of p)
402
402
  if (n.parentId && f.has(n.parentId)) {
403
403
  const v = f.get(n.parentId), T = f.get(n.id);
404
404
  v.children.set(n.id, T);
405
405
  }
406
- const b = [];
407
- for (const n of C) {
406
+ const y = [];
407
+ for (const n of x) {
408
408
  const v = n.entityListFolderId;
409
409
  if (v && f.has(v)) {
410
410
  const T = f.get(v);
411
411
  T.items.push(n), T.hasAnyItems = !0;
412
412
  } else
413
- b.push(n);
413
+ y.push(n);
414
414
  }
415
415
  for (const n of f.values())
416
416
  if (n.hasAnyItems) {
@@ -428,7 +428,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
428
428
  name: n.label,
429
429
  label: n.label,
430
430
  ...T.length > 0 && { parents: T },
431
- icon: Ze(n),
431
+ icon: tt(n),
432
432
  subRows: [],
433
433
  data: {
434
434
  id: n.id,
@@ -442,49 +442,49 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
442
442
  updatedAt: n.updatedAt
443
443
  }
444
444
  }), I = (n) => n.sort((v, T) => {
445
- const x = p.findIndex((Q) => Q.id === v.id), D = p.findIndex((Q) => Q.id === T.id);
446
- return x === -1 && D === -1 ? v.folder.label.localeCompare(T.folder.label) : x === -1 ? 1 : D === -1 ? -1 : x - D;
445
+ const C = p.findIndex((z) => z.id === v.id), D = p.findIndex((z) => z.id === T.id);
446
+ return C === -1 && D === -1 ? v.folder.label.localeCompare(T.folder.label) : C === -1 ? 1 : D === -1 ? -1 : C - D;
447
447
  }), r = (n) => {
448
448
  const v = n.items.map((T) => T.id);
449
449
  for (const T of n.children.values())
450
450
  v.push(...r(T));
451
451
  return v;
452
- }, d = cn({
452
+ }, d = pn({
453
453
  folderNodes: f,
454
- rootFolderIds: h,
454
+ rootFolderIds: b,
455
455
  showEmptyFolders: !1,
456
- buildFolderRowId: Fn,
456
+ buildFolderRowId: zn,
457
457
  createItemRow: i,
458
458
  sortFolderNodes: I,
459
- sortItems: Fe,
459
+ sortItems: $e,
460
460
  getFolderLabel: (n) => n.label,
461
- getFolderIcon: (n) => n.data?.icon || Nn,
461
+ getFolderIcon: (n) => n.data?.icon || $n,
462
462
  getFolderColor: (n) => n.data?.color,
463
463
  getItemCount: (n) => n.items.length + Array.from(n.children.values()).reduce((v, T) => v + T.items.length, 0)
464
464
  });
465
465
  for (const n of d) {
466
- if (n.id.startsWith(ye + "-")) {
467
- const T = n.id.substring((ye + "-").length), x = f.get(T);
468
- x && (n.data = { ...n.data, childListIds: r(x) });
466
+ if (n.id.startsWith(Se + "-")) {
467
+ const T = n.id.substring((Se + "-").length), C = f.get(T);
468
+ C && (n.data = { ...n.data, childListIds: r(C) });
469
469
  }
470
470
  const v = [...n.subRows || []];
471
471
  for (; v.length > 0; ) {
472
472
  const T = v.shift();
473
- if (T.id.startsWith(ye + "-")) {
474
- const x = T.id.substring((ye + "-").length), D = f.get(x);
473
+ if (T.id.startsWith(Se + "-")) {
474
+ const C = T.id.substring((Se + "-").length), D = f.get(C);
475
475
  D && (T.data = { ...T.data, childListIds: r(D) });
476
476
  }
477
477
  T.subRows && v.push(...T.subRows);
478
478
  }
479
479
  }
480
- const o = Fe(b).map((n) => i(n));
480
+ const o = $e(y).map((n) => i(n));
481
481
  return [...d, ...o];
482
482
  }
483
- return Fe(C).map((f) => ({
483
+ return $e(x).map((f) => ({
484
484
  id: f.id,
485
485
  name: f.label,
486
486
  label: f.label,
487
- icon: Ze(f),
487
+ icon: tt(f),
488
488
  subRows: [],
489
489
  data: {
490
490
  id: f.id,
@@ -499,18 +499,18 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
499
499
  }));
500
500
  }, [a, s, p]), m = s && p.length > 0;
501
501
  return {
502
- getData: O(async () => l, [l]),
503
- isLoading: u || c || g,
502
+ getData: F(async () => l, [l]),
503
+ isLoading: u || c || h,
504
504
  isExpandable: m
505
505
  };
506
- }, $n = (e, t, s, a) => e.id === "noValue" ? t.get(it)?.count ?? (a ? 0 : void 0) : e.id === "hasValue" ? a ? s : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (a ? 0 : void 0), gt = (e, t, s, a) => t ? e.map((u) => {
507
- const c = $n(u, t, s, a);
506
+ }, Bn = (e, t, s, a) => e.id === "noValue" ? t.get(lt)?.count ?? (a ? 0 : void 0) : e.id === "hasValue" ? a ? s : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (a ? 0 : void 0), bt = (e, t, s, a) => t ? e.map((u) => {
507
+ const c = Bn(u, t, s, a);
508
508
  return {
509
509
  ...u,
510
510
  badge: c != null ? String(c) : u.badge,
511
- subRows: u.subRows?.length ? gt(u.subRows, t, s, a) : u.subRows
511
+ subRows: u.subRows?.length ? bt(u.subRows, t, s, a) : u.subRows
512
512
  };
513
- }) : e, zn = (e) => ({
513
+ }) : e, Vn = (e) => ({
514
514
  id: "noValue",
515
515
  name: "noValue",
516
516
  label: `No ${e}`,
@@ -519,7 +519,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
519
519
  data: {
520
520
  id: "noValue"
521
521
  }
522
- }), Un = (e) => ({
522
+ }), Hn = (e) => ({
523
523
  id: "hasValue",
524
524
  name: "hasValue",
525
525
  label: `Some ${e}`,
@@ -528,7 +528,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
528
528
  data: {
529
529
  id: "hasValue"
530
530
  }
531
- }), tt = [
531
+ }), st = [
532
532
  {
533
533
  label: "Hierarchy",
534
534
  value: "hierarchy",
@@ -547,17 +547,17 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
547
547
  {
548
548
  label: "Task Type",
549
549
  value: "taskType",
550
- icon: Pe("task")
550
+ icon: Ne("task")
551
551
  },
552
552
  {
553
553
  label: "Folder Type",
554
554
  value: "folderType",
555
- icon: Pe("folder")
555
+ icon: Ne("folder")
556
556
  },
557
557
  {
558
558
  label: "Product Type",
559
559
  value: "productType",
560
- icon: Pe("product")
560
+ icon: Ne("product")
561
561
  },
562
562
  {
563
563
  label: "Author",
@@ -569,7 +569,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
569
569
  value: "entityList",
570
570
  icon: "list_alt"
571
571
  }
572
- ], Bn = ({
572
+ ], Wn = ({
573
573
  sliceFields: e,
574
574
  usedSliceTypes: t = [],
575
575
  entityTypes: s = [],
@@ -577,21 +577,21 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
577
577
  filled: u = 0,
578
578
  countsComplete: c = !1,
579
579
  sliceType: p,
580
- onSliceTypeChange: g,
580
+ onSliceTypeChange: h,
581
581
  sort: l
582
582
  }) => {
583
583
  const {
584
584
  sliceType: m,
585
- onSliceTypeChange: y,
586
- useExtraSlices: C,
585
+ onSliceTypeChange: g,
586
+ useExtraSlices: x,
587
587
  isLoadingExtraSlices: f
588
- } = ze(), h = p ?? m, b = g ?? y, { projectName: i } = be(), { formatAttribute: I } = C(), r = e.filter((w) => tt.some((R) => R.value === w.value)).map((w) => ({
589
- ...tt.find((F) => F.value === w.value),
588
+ } = Be(), b = p ?? m, y = h ?? g, { projectName: i } = Te(), { formatAttribute: I } = x(), r = e.filter((w) => st.some((_) => _.value === w.value)).map((w) => ({
589
+ ...st.find((P) => P.value === w.value),
590
590
  ...w
591
- })), d = e.some((w) => w.value === "attributes"), o = h?.startsWith("attrib.") ? h.slice(7) : void 0, n = P(
591
+ })), d = e.some((w) => w.value === "attributes"), o = b?.startsWith("attrib.") ? b.slice(7) : void 0, n = N(
592
592
  () => o ? [o] : [],
593
593
  [o]
594
- ), { attributes: v, isLoading: T } = On({
594
+ ), { attributes: v, isLoading: T } = jn({
595
595
  entityTypes: s,
596
596
  request: n
597
597
  });
@@ -599,63 +599,63 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
599
599
  (w) => r.push({
600
600
  label: w.data.title || w.name,
601
601
  value: "attrib." + w.name,
602
- icon: an(w.name, w.data.type, rt(w.data))
602
+ icon: cn(w.name, w.data.type, ct(w.data))
603
603
  })
604
604
  );
605
- const [x, D] = U(!1), pe = !!v.find((w) => w.name === o)?.enumIsLoading, {
606
- project: me,
607
- getStatuses: se,
608
- getTypes: fe,
609
- getTaskTypes: ee,
605
+ const [C, D] = G(!1), ne = !!v.find((w) => w.name === o)?.enumIsLoading, {
606
+ project: ue,
607
+ getStatuses: re,
608
+ getTypes: pe,
609
+ getTaskTypes: se,
610
610
  getProductTypes: oe,
611
- getAttribute: J,
612
- isLoading: W
613
- } = Pn({ scopes: s, useExtraSlices: C }), {
614
- data: X,
615
- getData: ae,
611
+ getAttribute: me,
612
+ isLoading: U
613
+ } = Fn({ scopes: s, useExtraSlices: x }), {
614
+ data: fe,
615
+ getData: K,
616
616
  isFetching: L
617
- } = Kt({
617
+ } = Xt({
618
618
  projectName: i || "",
619
- folderTypes: me?.folderTypes || [],
619
+ folderTypes: ue?.folderTypes || [],
620
620
  includeColors: !0
621
- }), { getData: A, isLoading: k } = _n({
621
+ }), { getData: k, isLoading: A } = Nn({
622
622
  projectName: i,
623
- useExtraSlices: C
623
+ useExtraSlices: x
624
624
  }), {
625
- getData: te,
626
- isLoading: Se,
627
- isExpandable: Ee
628
- } = jn(h === "entityList"), ne = L || W || k || f && h !== "hierarchy" || Se && h === "entityList" || T || pe, Z = {
625
+ getData: q,
626
+ isLoading: ve,
627
+ isExpandable: ke
628
+ } = Un(b === "entityList"), ae = L || U || A || f && b !== "hierarchy" || ve && b === "entityList" || T || ne, X = {
629
629
  hierarchy: {
630
- getData: ae,
630
+ getData: K,
631
631
  isLoading: L,
632
632
  isExpandable: !0
633
633
  },
634
634
  assignees: {
635
- getData: A,
636
- isLoading: k,
635
+ getData: k,
636
+ isLoading: A,
637
637
  isExpandable: !1,
638
638
  noValue: !0,
639
639
  hasValue: !0
640
640
  },
641
641
  author: {
642
- getData: A,
643
- isLoading: k,
642
+ getData: k,
643
+ isLoading: A,
644
644
  isExpandable: !1
645
645
  },
646
646
  status: {
647
- getData: se,
648
- isLoading: W,
647
+ getData: re,
648
+ isLoading: U,
649
649
  isExpandable: !1
650
650
  },
651
651
  type: {
652
- getData: fe,
653
- isLoading: W,
652
+ getData: pe,
653
+ isLoading: U,
654
654
  isExpandable: !0
655
655
  },
656
656
  taskType: {
657
- getData: ee,
658
- isLoading: W,
657
+ getData: se,
658
+ isLoading: U,
659
659
  isExpandable: !1
660
660
  },
661
661
  productType: {
@@ -664,96 +664,96 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
664
664
  isExpandable: !1
665
665
  },
666
666
  entityList: {
667
- getData: te,
668
- isLoading: Se,
669
- isExpandable: Ee
667
+ getData: q,
668
+ isLoading: ve,
669
+ isExpandable: ke
670
670
  }
671
671
  };
672
672
  for (const w of v)
673
- Z["attrib." + w.name] = {
674
- getData: () => J(w),
673
+ X["attrib." + w.name] = {
674
+ getData: () => me(w),
675
675
  isLoading: T || !!w.enumIsLoading,
676
676
  isExpandable: !1,
677
677
  isAttribute: !0
678
678
  };
679
- const ie = { data: [], isExpandable: !1 }, [V, _] = U(ie), q = Z[h], re = r.find(
680
- (w) => Z[w.value] && !t.includes(w.value)
679
+ const Ie = { data: [], isExpandable: !1 }, [J, Z] = G(Ie), M = X[b], le = r.find(
680
+ (w) => X[w.value] && !t.includes(w.value)
681
681
  )?.value;
682
- ue(() => {
683
- ne || q || !re || b(re, !1);
684
- }, [ne, q, re]);
685
- const De = (w, R) => {
686
- const F = Z[w];
687
- if (!F) {
682
+ ie(() => {
683
+ ae || M || !le || y(le, !1);
684
+ }, [ae, M, le]);
685
+ const he = (w, _) => {
686
+ const P = X[w];
687
+ if (!P) {
688
688
  console.warn(`Slice type ${w} not found`);
689
689
  return;
690
690
  }
691
- (F.isAttribute && d || e.some((le) => le.value === w)) && b(w, R);
691
+ (P.isAttribute && d || e.some((te) => te.value === w)) && y(w, _);
692
692
  };
693
- ue(() => {
694
- if (ne) return;
693
+ ie(() => {
694
+ if (ae) return;
695
695
  (async () => {
696
696
  try {
697
- if (!q) return;
697
+ if (!M) return;
698
698
  D(!0);
699
- const R = await q.getData();
700
- if (R === void 0)
699
+ const _ = await M.getData();
700
+ if (_ === void 0)
701
701
  throw window.alert(
702
702
  "Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
703
- ), b(re ?? "hierarchy", !1), new Error("Slice data is undefined");
704
- q.hasValue && R.unshift(Un(h)), q.noValue && R.unshift(zn(h)), _({
705
- data: R,
706
- isExpandable: q.isExpandable
703
+ ), y(le ?? "hierarchy", !1), new Error("Slice data is undefined");
704
+ M.hasValue && _.unshift(Hn(b)), M.noValue && _.unshift(Vn(b)), Z({
705
+ data: _,
706
+ isExpandable: M.isExpandable
707
707
  });
708
- } catch (R) {
709
- console.error("Error fetching slice data:", R), _(ie);
708
+ } catch (_) {
709
+ console.error("Error fetching slice data:", _), Z(Ie);
710
710
  } finally {
711
711
  D(!1);
712
712
  }
713
713
  })();
714
- }, [h, i, ne, h === "hierarchy" ? X : null]);
715
- const K = l?.by, Te = !!l?.desc, N = P(
716
- () => K ? In(V.data, h, { by: K, desc: Te }) : V.data,
717
- [V.data, h, K, Te]
718
- ), j = P(
719
- () => gt(N, a, u, c),
720
- [N, a, u, c]
721
- ), He = P(() => {
722
- const w = /* @__PURE__ */ new Map(), R = [...j];
723
- for (; R.length > 0; ) {
724
- const F = R.shift();
725
- if (F && (w.set(F.id, F), F.subRows && F.subRows.length > 0))
726
- for (const le of F.subRows)
727
- R.push(le);
714
+ }, [b, i, ae, b === "hierarchy" ? fe : null]);
715
+ const ge = l?.by, ee = !!l?.desc, ce = N(
716
+ () => ge ? Ln(J.data, b, { by: ge, desc: ee }) : J.data,
717
+ [J.data, b, ge, ee]
718
+ ), O = N(
719
+ () => bt(ce, a, u, c),
720
+ [ce, a, u, c]
721
+ ), B = N(() => {
722
+ const w = /* @__PURE__ */ new Map(), _ = [...O];
723
+ for (; _.length > 0; ) {
724
+ const P = _.shift();
725
+ if (P && (w.set(P.id, P), P.subRows && P.subRows.length > 0))
726
+ for (const te of P.subRows)
727
+ _.push(te);
728
728
  }
729
729
  return w;
730
- }, [j]);
730
+ }, [O]);
731
731
  return {
732
732
  sliceOptions: r,
733
- table: { ...V, data: j },
734
- sliceMap: He,
735
- isLoading: Z[h] && Z[h].isLoading || x || ne,
736
- sliceType: h,
737
- handleSliceTypeChange: De
733
+ table: { ...J, data: O },
734
+ sliceMap: B,
735
+ isLoading: X[b] && X[b].isLoading || C || ae,
736
+ sliceType: b,
737
+ handleSliceTypeChange: he
738
738
  };
739
- }, Vn = /* @__PURE__ */ new Map(), Hn = (e, t, s, a) => {
740
- const u = P(() => ({ id: t, desc: !1 }), [t]), c = P(
741
- () => (s ?? []).filter((b) => b !== t).map((b) => ({ id: b, desc: !1 })),
739
+ }, Gn = /* @__PURE__ */ new Map(), Kn = (e, t, s, a) => {
740
+ const u = N(() => ({ id: t, desc: !1 }), [t]), c = N(
741
+ () => (s ?? []).filter((y) => y !== t).map((y) => ({ id: y, desc: !1 })),
742
742
  [s, t]
743
- ), p = !!a || !e, g = e?.entity === "version" ? { entity: "version", groupBy: u, extraGroupBys: c, args: e.args, skip: p } : {
743
+ ), p = !!a || !e, h = e?.entity === "version" ? { entity: "version", groupBy: u, extraGroupBys: c, args: e.args, skip: p } : {
744
744
  entity: "task",
745
745
  groupBy: u,
746
746
  extraGroupBys: c,
747
747
  args: e?.args ?? { projectName: "" },
748
748
  skip: p
749
- }, { counts: l, total: m, complete: y } = ln(g), C = l?.get(it)?.count ?? 0, f = Math.max(m - C, 0);
749
+ }, { counts: l, total: m, complete: g } = un(h), x = l?.get(lt)?.count ?? 0, f = Math.max(m - x, 0);
750
750
  return {
751
- counts: p ? void 0 : l ?? (y ? Vn : void 0),
751
+ counts: p ? void 0 : l ?? (g ? Gn : void 0),
752
752
  total: m,
753
753
  filled: f,
754
- complete: !p && y
754
+ complete: !p && g
755
755
  };
756
- }, Gn = B.div`
756
+ }, qn = V.div`
757
757
  display: flex;
758
758
  align-items: center;
759
759
 
@@ -761,27 +761,27 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
761
761
  flex: 1;
762
762
  min-width: 0;
763
763
  }
764
- `, Wn = B(_t)`
764
+ `, Yn = V(Ot)`
765
765
  flex: 1;
766
766
  min-width: 0;
767
767
  height: 28px;
768
768
  min-height: 28px;
769
- `, qn = ({ open: e, value: t, subject: s, onChange: a }) => {
770
- const u = () => a(e ? void 0 : ""), c = (g) => {
771
- g.key === "Escape" && a(void 0);
772
- }, p = (g) => {
773
- const l = jt(g.clipboardData.getData("text"));
769
+ `, Qn = ({ open: e, value: t, subject: s, onChange: a }) => {
770
+ const u = () => a(e ? void 0 : ""), c = (h) => {
771
+ h.key === "Escape" && a(void 0);
772
+ }, p = (h) => {
773
+ const l = zt(h.clipboardData.getData("text"));
774
774
  if (l === null) return;
775
- g.preventDefault();
776
- const m = g.currentTarget, y = m.selectionStart ?? t.length, C = m.selectionEnd ?? t.length, f = y + l.length;
777
- a(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => m.setSelectionRange(f, f));
775
+ h.preventDefault();
776
+ const m = h.currentTarget, g = m.selectionStart ?? t.length, x = m.selectionEnd ?? t.length, f = g + l.length;
777
+ a(t.slice(0, g) + l + t.slice(x)), requestAnimationFrame(() => m.setSelectionRange(f, f));
778
778
  };
779
- return /* @__PURE__ */ G(Gn, { className: Y({ open: e }), children: [
779
+ return /* @__PURE__ */ W(qn, { className: Q({ open: e }), children: [
780
780
  e && /* @__PURE__ */ E(
781
- Wn,
781
+ Yn,
782
782
  {
783
783
  value: t,
784
- onChange: (g) => a(g.target.value),
784
+ onChange: (h) => a(h.target.value),
785
785
  placeholder: "Search",
786
786
  autoFocus: !0,
787
787
  onKeyDown: c,
@@ -789,22 +789,22 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
789
789
  }
790
790
  ),
791
791
  /* @__PURE__ */ E(
792
- ge,
792
+ be,
793
793
  {
794
794
  icon: e ? "close" : "search",
795
795
  onClick: u,
796
- className: Y({ open: e }),
796
+ className: Q({ open: e }),
797
797
  "data-tooltip": e ? "Close search" : `Search ${s}`
798
798
  }
799
799
  )
800
800
  ] });
801
- }, je = (e, t) => {
802
- e.toggleExpanded(t), e.subRows?.forEach((s) => je(s, t));
803
- }, nt = (e) => e.map((t) => t.id).filter(Boolean), Kn = (e, t, s, a) => {
804
- const { onOpenNew: u } = mn(), { projectName: c } = be(), { setEntities: p } = Vt(), g = fn(), [l] = lt(), { deleteEntities: m } = Ht(), [y, C] = U(null), f = O(
801
+ }, ze = (e, t) => {
802
+ e.toggleExpanded(t), e.subRows?.forEach((s) => ze(s, t));
803
+ }, ot = (e) => e.map((t) => t.id).filter(Boolean), Xn = (e, t, s, a) => {
804
+ const { onOpenNew: u } = gn(), { projectName: c } = Te(), { setEntities: p } = Gt(), h = yn(), [l] = dt(), { deleteEntities: m } = Kt(), [g, x] = G(null), f = F(
805
805
  (r, d) => d.map((o) => t?.get(o) || (o === r.id ? r : void 0)).filter((o) => !!o),
806
806
  [t]
807
- ), h = P(
807
+ ), b = N(
808
808
  () => ({
809
809
  onShowDetails: (r, d = [r.id]) => {
810
810
  p({
@@ -822,11 +822,11 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
822
822
  }))
823
823
  });
824
824
  },
825
- onRename: (r) => C(r),
825
+ onRename: (r) => x(r),
826
826
  onOpenViewer: (r) => s?.(r, c),
827
827
  onUploadVersion: (r) => {
828
828
  const d = r.data?.entityType === "task", o = d ? r.parentId || r.data?.parentId : r.id;
829
- o && g?.onOpenVersionUpload({
829
+ o && h?.onOpenVersionUpload({
830
830
  folderId: o,
831
831
  taskId: d ? r.id : void 0
832
832
  });
@@ -854,49 +854,49 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
854
854
  c,
855
855
  p,
856
856
  m,
857
- g
857
+ h
858
858
  ]
859
- ), b = O(
859
+ ), y = F(
860
860
  (r) => {
861
- y && (l({
861
+ g && (l({
862
862
  projectName: c,
863
863
  operationsRequestModel: {
864
864
  operations: [
865
865
  {
866
866
  type: "update",
867
- entityType: y.data?.entityType === "task" ? "task" : "folder",
868
- entityId: y.id,
867
+ entityType: g.data?.entityType === "task" ? "task" : "folder",
868
+ entityId: g.id,
869
869
  data: { label: r }
870
870
  }
871
871
  ]
872
872
  }
873
- }), C(null));
873
+ }), x(null));
874
874
  },
875
- [c, y, l]
876
- ), i = P(
875
+ [c, g, l]
876
+ ), i = N(
877
877
  () => [
878
878
  (r, { row: d, selectedRows: o }) => ({
879
879
  label: "Show details",
880
880
  icon: "dock_to_left",
881
- shortcut: un("click", [pn.Alt]),
882
- command: () => h.onShowDetails(d.original, o)
881
+ shortcut: fn("click", [hn.Alt]),
882
+ command: () => b.onShowDetails(d.original, o)
883
883
  }),
884
884
  (r, { row: d }) => ({
885
885
  label: "Rename label",
886
886
  icon: "titlecase",
887
887
  shortcut: "R",
888
- command: () => h.onRename(d.original)
888
+ command: () => b.onRename(d.original)
889
889
  }),
890
890
  (r, { row: d }) => ({
891
891
  label: "Open in viewer",
892
892
  icon: "play_circle",
893
- command: () => h.onOpenViewer(d.original),
893
+ command: () => b.onOpenViewer(d.original),
894
894
  hidden: !s
895
895
  }),
896
896
  (r, { selectedTableRows: d }) => ({
897
897
  label: "Expand all children",
898
898
  icon: "expand_all",
899
- command: () => d.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => je(o, !0)),
899
+ command: () => d.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => ze(o, !0)),
900
900
  hidden: !d.some(
901
901
  (o) => o.getCanExpand() && !o.getIsExpanded()
902
902
  )
@@ -904,66 +904,66 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
904
904
  (r, { selectedTableRows: d }) => ({
905
905
  label: "Collapse all children",
906
906
  icon: "collapse_all",
907
- command: () => d.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => je(o, !1)),
907
+ command: () => d.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => ze(o, !1)),
908
908
  hidden: !d.some(
909
909
  (o) => o.getCanExpand() && o.getIsExpanded()
910
910
  )
911
911
  }),
912
912
  (r, { row: d, selectedRows: o }) => {
913
- const n = h.onAddToList?.(d.original, o);
913
+ const n = b.onAddToList?.(d.original, o);
914
914
  return n ? Array.isArray(n) ? n : [n] : void 0;
915
915
  },
916
916
  (r, { row: d }) => ({
917
917
  label: "Upload version",
918
918
  icon: "upload",
919
- command: () => h.onUploadVersion(d.original)
919
+ command: () => b.onUploadVersion(d.original)
920
920
  }),
921
921
  (r, { row: d, selectedRows: o }) => ({
922
922
  label: "Move",
923
923
  icon: "drive_file_move",
924
- command: () => h.onMove(f(d.original, o)),
924
+ command: () => b.onMove(f(d.original, o)),
925
925
  hidden: !a
926
926
  }),
927
927
  (r, { row: d, selectedRows: o }) => ({
928
- label: Ce.folder.createLabel,
929
- icon: Ce.folder.icon,
928
+ label: Ee.folder.createLabel,
929
+ icon: Ee.folder.icon,
930
930
  command: () => u?.("folder", {
931
- parentFolderIds: nt(
931
+ parentFolderIds: ot(
932
932
  f(d.original, o)
933
933
  )
934
934
  })
935
935
  }),
936
936
  (r, { row: d, selectedRows: o }) => ({
937
- label: Ce.task.createLabel,
938
- icon: Ce.task.icon,
937
+ label: Ee.task.createLabel,
938
+ icon: Ee.task.icon,
939
939
  command: () => u?.("task", {
940
- parentFolderIds: nt(
940
+ parentFolderIds: ot(
941
941
  f(d.original, o)
942
942
  )
943
943
  })
944
944
  })
945
945
  ],
946
- [h, f, u]
947
- ), I = O(
946
+ [b, f, u]
947
+ ), I = F(
948
948
  (r, { row: d, selectedRows: o }) => ({
949
949
  label: "Delete",
950
950
  icon: "delete",
951
951
  danger: !0,
952
- command: () => h.onDelete(f(d.original, o))
952
+ command: () => b.onDelete(f(d.original, o))
953
953
  }),
954
- [h, f]
954
+ [b, f]
955
955
  );
956
956
  return {
957
957
  rowContextMenuBuilders: i,
958
958
  deleteContextMenuBuilder: I,
959
- onOptionClick: h.onShowDetails,
960
- onRename: h.onRename,
961
- renamingRow: y,
962
- renameInitialValue: y?.label || y?.name || "",
963
- onSubmitRename: b,
964
- onCancelRename: () => C(null)
959
+ onOptionClick: b.onShowDetails,
960
+ onRename: b.onRename,
961
+ renamingRow: g,
962
+ renameInitialValue: g?.label || g?.name || "",
963
+ onSubmitRename: y,
964
+ onCancelRename: () => x(null)
965
965
  };
966
- }, Yn = B(Pt)`
966
+ }, Jn = V(Nt)`
967
967
  /* put above the menu so it's still clickable */
968
968
  /* NOTE: this will need fixing as this also puts it above dialogs */
969
969
  /* z-index: 1001; */
@@ -994,7 +994,7 @@ const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) =>
994
994
  }
995
995
  }
996
996
  `;
997
- B.div`
997
+ V.div`
998
998
  display: flex;
999
999
  flex-direction: column;
1000
1000
  gap: var(--base-gap-large);
@@ -1016,30 +1016,30 @@ B.div`
1016
1016
  font-weight: 600;
1017
1017
  }
1018
1018
  `;
1019
- const Qn = (e, t, s) => {
1019
+ const Zn = (e, t, s) => {
1020
1020
  const a = `${t}${s === 1 ? "" : "s"}`;
1021
1021
  return e === "created" ? `new ${a}` : e === "deleted" ? `${a} deleted` : `${s} ${a} ${e.replaceAll("_", " ")}`;
1022
- }, Jn = (e) => {
1022
+ }, es = (e) => {
1023
1023
  const t = /* @__PURE__ */ new Map();
1024
1024
  return e.forEach((a) => {
1025
1025
  const [, u, c] = a.topic.split(".");
1026
1026
  if (!u || !c) return;
1027
- const p = `${u}.${c}`, g = t.get(p) || {
1027
+ const p = `${u}.${c}`, h = t.get(p) || {
1028
1028
  entityType: u,
1029
1029
  updateType: c,
1030
1030
  ids: /* @__PURE__ */ new Set()
1031
1031
  };
1032
- g.ids.add(a.entityId || String(a.id)), t.set(p, g);
1032
+ h.ids.add(a.entityId || String(a.id)), t.set(p, h);
1033
1033
  }), `${Array.from(t.values()).map(
1034
- ({ entityType: a, updateType: u, ids: c }) => Qn(u, a, c.size)
1034
+ ({ entityType: a, updateType: u, ids: c }) => Zn(u, a, c.size)
1035
1035
  ).join(", ")} since last sync`;
1036
- }, Xn = Lt(
1036
+ }, ts = Et(
1037
1037
  ({ projectNames: e, topics: t, onSync: s, shouldSyncOnUpdate: a, hideWhenNoUpdates: u = !1, ...c }, p) => {
1038
- const [g, l] = U(!1), [m, y] = Gt(), { setMenuOpen: C } = dt(), f = we(null), h = we(), b = wt();
1039
- ue(() => () => {
1040
- const x = h.current;
1041
- h.current = void 0, x !== void 0 && clearTimeout(x);
1042
- }, []), Et(p, () => f.current, []);
1038
+ const [h, l] = G(!1), [m, g] = qt(), { setMenuOpen: x } = pt(), f = Re(null), b = Re(), y = Dt();
1039
+ ie(() => () => {
1040
+ const C = b.current;
1041
+ b.current = void 0, C !== void 0 && clearTimeout(C);
1042
+ }, []), Rt(p, () => f.current, []);
1043
1043
  const i = async () => {
1044
1044
  l(!0);
1045
1045
  try {
@@ -1047,51 +1047,51 @@ const Qn = (e, t, s) => {
1047
1047
  } finally {
1048
1048
  l(!1);
1049
1049
  }
1050
- }, { updates: I, hasUpdates: r } = Wt({
1050
+ }, { updates: I, hasUpdates: r } = Yt({
1051
1051
  projectNames: e,
1052
1052
  topics: t,
1053
- isSyncing: g,
1053
+ isSyncing: h,
1054
1054
  shouldSyncOnUpdate: a
1055
1055
  });
1056
- if (ue(() => {
1057
- const x = (D) => {
1058
- D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || dn(D) || (D.preventDefault(), D.stopPropagation(), i());
1056
+ if (ie(() => {
1057
+ const C = (D) => {
1058
+ D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || mn(D) || (D.preventDefault(), D.stopPropagation(), i());
1059
1059
  };
1060
- return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1060
+ return window.addEventListener("keydown", C), () => window.removeEventListener("keydown", C);
1061
1061
  }, [i]), u && !r) return null;
1062
- const d = Jn(I), o = Object.values(m).some(Boolean);
1062
+ const d = es(I), o = Object.values(m).some(Boolean);
1063
1063
  Object.values(m).every(Boolean);
1064
1064
  const n = () => {
1065
- h.current && clearTimeout(h.current);
1065
+ b.current && clearTimeout(b.current);
1066
1066
  };
1067
- return /* @__PURE__ */ G($e, { children: [
1067
+ return /* @__PURE__ */ W(Ue, { children: [
1068
1068
  /* @__PURE__ */ E(
1069
- Yn,
1069
+ Jn,
1070
1070
  {
1071
1071
  ...c,
1072
1072
  icon: "sync",
1073
1073
  ref: f,
1074
1074
  onClick: i,
1075
1075
  onMouseEnter: () => {
1076
- n(), C(b);
1076
+ n(), x(y);
1077
1077
  },
1078
1078
  onMouseLeave: () => {
1079
- n(), h.current = setTimeout(() => C(!1), 100);
1079
+ n(), b.current = setTimeout(() => x(!1), 100);
1080
1080
  },
1081
- className: Y(c.className, {
1082
- syncing: g,
1081
+ className: Q(c.className, {
1082
+ syncing: h,
1083
1083
  "has-updates": r,
1084
- "auto-sync": o && !Xe
1084
+ "auto-sync": o && !et
1085
1085
  }),
1086
1086
  "data-shortcut": "Shift+R",
1087
1087
  "data-tooltip": r ? d : "Refresh data",
1088
1088
  variant: r ? "filled" : "surface"
1089
1089
  }
1090
1090
  ),
1091
- !Xe
1091
+ !et
1092
1092
  ] });
1093
1093
  }
1094
- ), st = B.div`
1094
+ ), at = V.div`
1095
1095
  display: flex;
1096
1096
  align-items: center;
1097
1097
  gap: var(--base-gap-small);
@@ -1099,7 +1099,7 @@ const Qn = (e, t, s) => {
1099
1099
  flex: 1;
1100
1100
  min-width: 0;
1101
1101
  color: var(--md-sys-color-outline);
1102
- `, Zn = B.span`
1102
+ `, ns = V.span`
1103
1103
  display: flex;
1104
1104
  align-items: center;
1105
1105
  gap: 2px;
@@ -1112,56 +1112,56 @@ const Qn = (e, t, s) => {
1112
1112
  border-radius: 50%;
1113
1113
  object-fit: cover;
1114
1114
  }
1115
- `, es = ({ rowSelection: e, sliceMap: t }) => {
1116
- const s = we(null), [a, u] = U(0);
1117
- _e(() => {
1115
+ `, ss = ({ rowSelection: e, sliceMap: t }) => {
1116
+ const s = Re(null), [a, u] = G(0);
1117
+ Oe(() => {
1118
1118
  const i = s.current;
1119
1119
  if (!i) return;
1120
1120
  const I = new ResizeObserver(([r]) => u(r.contentRect.width));
1121
1121
  return I.observe(i), () => I.disconnect();
1122
1122
  }, []);
1123
- const c = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), p = (i) => !!i.icon || !!i.img || !!i.startContent, [g, l] = U(!0), m = c.length > 1 || !g, [y, C] = U(c.length), f = c.map((i) => i.id).join("|");
1124
- if (_e(() => {
1125
- l(!0), C(c.length);
1126
- }, [a, f]), _e(() => {
1123
+ const c = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), p = (i) => !!i.icon || !!i.img || !!i.startContent, [h, l] = G(!0), m = c.length > 1 || !h, [g, x] = G(c.length), f = c.map((i) => i.id).join("|");
1124
+ if (Oe(() => {
1125
+ l(!0), x(c.length);
1126
+ }, [a, f]), Oe(() => {
1127
1127
  const i = s.current;
1128
1128
  if (!i || !c.length) return;
1129
- const I = Array.from(i.querySelectorAll("[data-chip]")), r = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, d = (x, D) => x.offsetLeft - i.offsetLeft + x.offsetWidth <= D;
1129
+ const I = Array.from(i.querySelectorAll("[data-chip]")), r = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, d = (C, D) => C.offsetLeft - i.offsetLeft + C.offsetWidth <= D;
1130
1130
  if (c.length === 1) {
1131
- g && I[0] && !d(I[0], i.clientWidth) && p(c[0]) && l(!1);
1131
+ h && I[0] && !d(I[0], i.clientWidth) && p(c[0]) && l(!1);
1132
1132
  return;
1133
1133
  }
1134
1134
  const o = I[I.length - 1];
1135
1135
  if (o && d(o, i.clientWidth)) return;
1136
- const n = i.clientWidth - r, v = I.filter((x) => d(x, n)).length, T = Math.max(1, v);
1137
- T !== y && C(T);
1138
- }), !c.length) return /* @__PURE__ */ E(st, { ref: s });
1139
- const h = c.slice(0, y), b = c.length - h.length;
1140
- return /* @__PURE__ */ G(st, { ref: s, children: [
1141
- h.map((i) => /* @__PURE__ */ G(
1142
- Zn,
1136
+ const n = i.clientWidth - r, v = I.filter((C) => d(C, n)).length, T = Math.max(1, v);
1137
+ T !== g && x(T);
1138
+ }), !c.length) return /* @__PURE__ */ E(at, { ref: s });
1139
+ const b = c.slice(0, g), y = c.length - b.length;
1140
+ return /* @__PURE__ */ W(at, { ref: s, children: [
1141
+ b.map((i) => /* @__PURE__ */ W(
1142
+ ns,
1143
1143
  {
1144
1144
  "data-chip": !0,
1145
1145
  title: i.label || i.name,
1146
1146
  "aria-label": i.label || i.name,
1147
1147
  children: [
1148
- i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(Ot, { icon: i.icon, style: { color: i.iconColor } })),
1148
+ i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(Ft, { icon: i.icon, style: { color: i.iconColor } })),
1149
1149
  !(m && p(i)) && /* @__PURE__ */ E("span", { children: i.label || i.name })
1150
1150
  ]
1151
1151
  },
1152
1152
  i.id
1153
1153
  )),
1154
- b > 0 && /* @__PURE__ */ G("span", { "data-overflow": !0, children: [
1154
+ y > 0 && /* @__PURE__ */ W("span", { "data-overflow": !0, children: [
1155
1155
  "+",
1156
- b
1156
+ y
1157
1157
  ] })
1158
1158
  ] });
1159
- }, ts = B.div`
1159
+ }, os = V.div`
1160
1160
  height: 28px;
1161
1161
  border-radius: 4px;
1162
1162
  background: var(--md-sys-color-surface-container);
1163
1163
  width: 100px;
1164
- `, ns = B.div`
1164
+ `, as = V.div`
1165
1165
  display: flex;
1166
1166
  align-items: center;
1167
1167
  gap: var(--base-gap-small);
@@ -1173,7 +1173,7 @@ const Qn = (e, t, s) => {
1173
1173
  flex: 1;
1174
1174
  min-width: 0;
1175
1175
  }
1176
- `, ss = B(Xt)`
1176
+ `, is = V(tn)`
1177
1177
  .slicer-dropdown {
1178
1178
  flex: 0 1 auto;
1179
1179
  min-width: 48px;
@@ -1194,7 +1194,7 @@ const Qn = (e, t, s) => {
1194
1194
  .power-feature .icon {
1195
1195
  color: var(--md-sys-color-tertiary);
1196
1196
  }
1197
- `, os = B.div`
1197
+ `, rs = V.div`
1198
1198
  display: flex;
1199
1199
  align-items: center;
1200
1200
  gap: var(--base-gap-small);
@@ -1207,7 +1207,7 @@ const Qn = (e, t, s) => {
1207
1207
  text-overflow: ellipsis;
1208
1208
  white-space: nowrap;
1209
1209
  }
1210
- `, ot = "__splitSlicer__", at = ({
1210
+ `, it = "__splitSlicer__", rt = ({
1211
1211
  panel: e,
1212
1212
  visibleSlices: t,
1213
1213
  sliceFields: s,
@@ -1215,16 +1215,16 @@ const Qn = (e, t, s) => {
1215
1215
  pinnedSliceType: u,
1216
1216
  countsSource: c,
1217
1217
  onAddToList: p,
1218
- openMoveDialog: g,
1218
+ openMoveDialog: h,
1219
1219
  splitEnabled: l,
1220
1220
  canCollapse: m,
1221
- isPrimary: y,
1222
- search: C,
1221
+ isPrimary: g,
1222
+ search: x,
1223
1223
  onSearchChange: f
1224
1224
  }) => {
1225
1225
  const {
1226
- SlicerDropdown: h,
1227
- addSlicePanel: b,
1226
+ SlicerDropdown: b,
1227
+ addSlicePanel: y,
1228
1228
  removeSlicePanel: i,
1229
1229
  collapsedPanels: I,
1230
1230
  togglePanelCollapsed: r,
@@ -1233,128 +1233,140 @@ const Qn = (e, t, s) => {
1233
1233
  setPanelSelection: n,
1234
1234
  getPanelExpanded: v,
1235
1235
  setPanelExpanded: T,
1236
- onSliceTypeChange: x,
1236
+ onSliceTypeChange: C,
1237
1237
  isViewSyncPending: D,
1238
- onOpenViewer: Q,
1239
- onAddToList: pe,
1240
- page: me,
1241
- getSliceSort: se,
1242
- setSliceSort: fe,
1243
- projectName: ee
1244
- } = ze(), { refetch: oe } = Ue(), { powerLicense: J, setPowerpackDialog: W } = Be(), X = o(e.id), ae = v(e.id), L = (S) => {
1238
+ onOpenViewer: z,
1239
+ onAddToList: ne,
1240
+ page: ue,
1241
+ getSliceSort: re,
1242
+ setSliceSort: pe,
1243
+ projectName: se,
1244
+ setSearchMatchesByPanel: oe
1245
+ } = Be(), { refetch: me } = Ve(), { powerLicense: U, setPowerpackDialog: fe } = He(), K = o(e.id), L = v(e.id), k = (S) => {
1245
1246
  n(e.id, S);
1246
- }, A = O(
1247
+ }, A = F(
1247
1248
  (S) => T(e.id, S),
1248
1249
  [T, e.id]
1249
- ), k = P(
1250
+ ), q = N(
1250
1251
  () => typeof c == "function" ? c(e.sliceType) : c,
1251
1252
  [c, e.sliceType]
1252
- ), te = P(() => {
1253
- const S = t.map(($) => $.sliceType);
1253
+ ), ve = N(() => {
1254
+ const S = t.map((j) => j.sliceType);
1254
1255
  if (typeof c != "function") return S;
1255
- const M = ($) => JSON.stringify([$?.entity, $?.args]), ce = M(k);
1256
- return S.filter(($) => $ === e.sliceType || M(c($)) === ce);
1257
- }, [c, k, t, e.sliceType]), { counts: Se, filled: Ee, complete: ne } = Hn(
1258
- k,
1256
+ const R = (j) => JSON.stringify([j?.entity, j?.args]), Y = R(q);
1257
+ return S.filter((j) => j === e.sliceType || R(c(j)) === Y);
1258
+ }, [c, q, t, e.sliceType]), { counts: ke, filled: ae, complete: X } = Kn(
1259
+ q,
1259
1260
  e.sliceType,
1260
- te
1261
- ), Z = O(
1262
- (S, M) => {
1263
- y ? x(S, M) : d(e.id, S);
1261
+ ve
1262
+ ), Ie = F(
1263
+ (S, R) => {
1264
+ g ? C(S, R) : d(e.id, S);
1264
1265
  },
1265
- [y, x, d, e.id]
1266
- ), ie = P(
1266
+ [g, C, d, e.id]
1267
+ ), J = N(
1267
1268
  () => t.filter((S) => S.id !== e.id).map((S) => S.sliceType),
1268
1269
  [t, e.id]
1269
1270
  ), {
1270
- sliceOptions: V,
1271
- sliceType: _,
1272
- handleSliceTypeChange: q,
1273
- table: { data: re, isExpandable: De },
1274
- sliceMap: K,
1275
- isLoading: Te
1276
- } = Bn({
1271
+ sliceOptions: Z,
1272
+ sliceType: M,
1273
+ handleSliceTypeChange: le,
1274
+ table: { data: he, isExpandable: ge },
1275
+ sliceMap: ee,
1276
+ isLoading: ce
1277
+ } = Wn({
1277
1278
  sliceFields: s,
1278
- usedSliceTypes: ie,
1279
+ usedSliceTypes: J,
1279
1280
  entityTypes: a,
1280
- counts: Se,
1281
- filled: Ee,
1282
- countsComplete: ne,
1281
+ counts: ke,
1282
+ filled: ae,
1283
+ countsComplete: X,
1283
1284
  sliceType: e.sliceType,
1284
- onSliceTypeChange: Z,
1285
- sort: se(e.sliceType)
1286
- }), N = _ === "hierarchy", j = !!m && I.includes(e.id), w = V.find((S) => S.value === _)?.label || _, R = C !== void 0, F = C ?? "", le = N ? "Folders" : w, H = Kn(
1287
- p || pe,
1288
- K,
1289
- Q,
1290
- g
1291
- ), { contributions: Ge } = Yt("slicer.menuItem"), ke = P(
1292
- () => Ge.filter(
1293
- (S) => !S.sliceTypes?.length || S.sliceTypes.includes(_)
1285
+ onSliceTypeChange: Ie,
1286
+ sort: re(e.sliceType)
1287
+ }), O = M === "hierarchy", B = !!m && I.includes(e.id), _ = Z.find((S) => S.value === M)?.label || M, P = x !== void 0, te = x ?? "", Ge = O ? "Folders" : _, xe = N(() => O || ce ? null : Ut(he, te)?.join(`
1288
+ `) ?? null, [O, ce, he, te]);
1289
+ ie(() => {
1290
+ if (xe === null) return;
1291
+ const S = xe ? xe.split(`
1292
+ `) : [];
1293
+ return oe((R) => ({ ...R, [e.id]: S })), () => oe((R) => {
1294
+ const Y = { ...R };
1295
+ return delete Y[e.id], Y;
1296
+ });
1297
+ }, [xe, e.id, oe]);
1298
+ const H = Xn(
1299
+ p || ne,
1300
+ ee,
1301
+ z,
1302
+ h
1303
+ ), { contributions: Ke } = Jt("slicer.menuItem"), Ae = N(
1304
+ () => Ke.filter(
1305
+ (S) => !S.sliceTypes?.length || S.sliceTypes.includes(M)
1294
1306
  ),
1295
- [Ge, _]
1296
- ), Re = (S, M, ce = "bottom") => {
1297
- if (!M.length) return [];
1298
- const $ = _ === "hierarchy", Ie = M.map((z) => {
1299
- const de = K.get(z), xe = de?.data?.entityType;
1307
+ [Ke, M]
1308
+ ), Me = (S, R, Y = "bottom") => {
1309
+ if (!R.length) return [];
1310
+ const j = M === "hierarchy", Le = R.map(($) => {
1311
+ const de = ee.get($), we = de?.data?.entityType;
1300
1312
  return {
1301
- id: z,
1313
+ id: $,
1302
1314
  name: de?.name,
1303
1315
  label: de?.label || de?.name || void 0,
1304
1316
  // hierarchy rows are folders and tasks, like useHierarchyContextMenuItems reads them
1305
- entityType: $ ? xe === "task" ? "task" : "folder" : xe
1317
+ entityType: j ? we === "task" ? "task" : "folder" : we
1306
1318
  };
1307
- }), It = $ ? Ie.map(({ id: z, name: de, entityType: xe }) => ({
1308
- id: z,
1309
- entityType: xe,
1310
- projectName: ee,
1319
+ }), Ct = j ? Le.map(({ id: $, name: de, entityType: we }) => ({
1320
+ id: $,
1321
+ entityType: we,
1322
+ projectName: se,
1311
1323
  name: de,
1312
- label: K.get(z)?.label || void 0
1313
- })) : [], xt = { projectName: ee, sliceType: _, selected: Ie, entities: It, menu: S };
1314
- return Mt(ke, ce).filter((z) => !z.in?.length || z.in.includes(S)).map((z) => ({
1315
- id: z.key,
1316
- label: z.label,
1317
- icon: z.icon,
1318
- [S === "context" ? "command" : "onClick"]: () => Jt(z, xt)
1324
+ label: ee.get($)?.label || void 0
1325
+ })) : [], Lt = { projectName: se, sliceType: M, selected: Le, entities: Ct, menu: S };
1326
+ return Pt(Ae, Y).filter(($) => !$.in?.length || $.in.includes(S)).map(($) => ({
1327
+ id: $.key,
1328
+ label: $.label,
1329
+ icon: $.icon,
1330
+ [S === "context" ? "command" : "onClick"]: () => en($, Lt)
1319
1331
  }));
1320
- }, We = (S) => (M, { rowId: ce, selectedRows: $ }) => (S === "top" && ke.forEach((Ie) => Qt(Ie.run)), Re(
1332
+ }, qe = (S) => (R, { rowId: Y, selectedRows: j }) => (S === "top" && Ae.forEach((Le) => Zt(Le.run)), Me(
1321
1333
  "context",
1322
- $.includes(ce) ? $ : [ce],
1334
+ j.includes(Y) ? j : [Y],
1323
1335
  S
1324
- )), yt = ke.length ? [
1325
- We("top"),
1326
- ...N ? H.rowContextMenuBuilders : [],
1327
- We("bottom"),
1328
- ...N ? [H.deleteContextMenuBuilder] : []
1329
- ] : N ? [...H.rowContextMenuBuilders, H.deleteContextMenuBuilder] : [], qe = P(
1330
- () => V.map((S) => S.value).filter((S) => !t.some((M) => M.sliceType === S)),
1331
- [V, t]
1332
- ), ve = !!l && qe.length > 0, Ae = P(() => {
1333
- const S = V.map(
1334
- (M) => ie.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
1336
+ )), St = Ae.length ? [
1337
+ qe("top"),
1338
+ ...O ? H.rowContextMenuBuilders : [],
1339
+ qe("bottom"),
1340
+ ...O ? [H.deleteContextMenuBuilder] : []
1341
+ ] : O ? [...H.rowContextMenuBuilders, H.deleteContextMenuBuilder] : [], Ye = N(
1342
+ () => Z.map((S) => S.value).filter((S) => !t.some((R) => R.sliceType === S)),
1343
+ [Z, t]
1344
+ ), Ce = !!l && Ye.length > 0, _e = N(() => {
1345
+ const S = Z.map(
1346
+ (R) => J.includes(R.value) ? { ...R, disabled: !0, disabledMessage: "Already used by another panel" } : R
1335
1347
  );
1336
- return ve && S.push({ label: "Split slicer", value: ot, icon: "splitscreen_add" }), S;
1337
- }, [V, ie, ve]), Me = () => {
1338
- if (!J) return W("slicer");
1339
- b(qe[0]);
1340
- }, { menuOpen: bt, toggleMenuOpen: Ke } = dt(), he = `slicer-menu-${me}-${e.id}`.replace(/[^\w-]/g, "-"), St = bt === he, Ye = Object.keys(X).filter((S) => X[S]), Tt = [
1341
- ...Re("dropdown", Ye, "top"),
1348
+ return Ce && S.push({ label: "Split slicer", value: it, icon: "splitscreen_add" }), S;
1349
+ }, [Z, J, Ce]), Pe = () => {
1350
+ if (!U) return fe("slicer");
1351
+ y(Ye[0]);
1352
+ }, { menuOpen: Tt, toggleMenuOpen: Qe } = pt(), ye = `slicer-menu-${ue}-${e.id}`.replace(/[^\w-]/g, "-"), vt = Tt === ye, Xe = Object.keys(K).filter((S) => K[S]), It = [
1353
+ ...Me("dropdown", Xe, "top"),
1342
1354
  {
1343
1355
  id: "search",
1344
- label: `Search ${le}`,
1356
+ label: `Search ${Ge}`,
1345
1357
  icon: "search",
1346
1358
  onClick: () => f("")
1347
1359
  },
1348
- ...ve && y ? [
1360
+ ...Ce && g ? [
1349
1361
  {
1350
1362
  id: "split",
1351
1363
  label: "Split slicer",
1352
1364
  icon: "splitscreen_add",
1353
1365
  powerFeature: "slicer",
1354
- onClick: Me
1366
+ onClick: Pe
1355
1367
  }
1356
1368
  ] : [],
1357
- ...y ? [] : [
1369
+ ...g ? [] : [
1358
1370
  {
1359
1371
  id: "remove-panel",
1360
1372
  label: "Remove panel",
@@ -1362,105 +1374,105 @@ const Qn = (e, t, s) => {
1362
1374
  onClick: () => i(e.id)
1363
1375
  }
1364
1376
  ],
1365
- xn({
1377
+ wn({
1366
1378
  id: "sort",
1367
- options: Ve(_),
1368
- sort: se(_),
1369
- onChange: (S) => fe(_, S)
1379
+ options: We(M),
1380
+ sort: re(M),
1381
+ onChange: (S) => pe(M, S)
1370
1382
  }),
1371
- ...Re("dropdown", Ye)
1372
- ], vt = (S) => {
1373
- const M = String(S[0]);
1374
- if (M === ot) {
1375
- Me();
1383
+ ...Me("dropdown", Xe)
1384
+ ], xt = (S) => {
1385
+ const R = String(S[0]);
1386
+ if (R === it) {
1387
+ Pe();
1376
1388
  return;
1377
1389
  }
1378
- q(M, !!y && u === _);
1390
+ le(R, !!g && u === M);
1379
1391
  };
1380
- return /* @__PURE__ */ G(Zt, { children: [
1381
- /* @__PURE__ */ G(
1382
- ss,
1392
+ return /* @__PURE__ */ W(nn, { children: [
1393
+ /* @__PURE__ */ W(
1394
+ is,
1383
1395
  {
1384
- className: Y({ collapsed: j }),
1385
- onClick: j ? () => r(e.id) : void 0,
1396
+ className: Q({ collapsed: B }),
1397
+ onClick: B ? () => r(e.id) : void 0,
1386
1398
  children: [
1387
1399
  m && /* @__PURE__ */ E(
1388
- ge,
1400
+ be,
1389
1401
  {
1390
1402
  icon: "expand_more",
1391
- className: Y("collapse-toggle", { collapsed: j }),
1392
- "data-tooltip": j ? "Expand panel" : "Collapse panel",
1403
+ className: Q("collapse-toggle", { collapsed: B }),
1404
+ "data-tooltip": B ? "Expand panel" : "Collapse panel",
1393
1405
  "data-tooltip-delay": 0,
1394
1406
  onClick: () => r(e.id)
1395
1407
  }
1396
1408
  ),
1397
- j ? (
1409
+ B ? (
1398
1410
  // the dropdown cannot be used from a collapsed panel, but the dimension it
1399
1411
  // shows has to read the same as the dropdown does when open
1400
- /* @__PURE__ */ E(os, { children: /* @__PURE__ */ E("span", { children: w }) })
1401
- ) : D ? /* @__PURE__ */ E(ts, {}) : !R && /* @__PURE__ */ E(
1402
- h,
1412
+ /* @__PURE__ */ E(rs, { children: /* @__PURE__ */ E("span", { children: _ }) })
1413
+ ) : D ? /* @__PURE__ */ E(os, {}) : !P && /* @__PURE__ */ E(
1414
+ b,
1403
1415
  {
1404
- options: Ae,
1405
- value: [_],
1416
+ options: _e,
1417
+ value: [M],
1406
1418
  sliceTypes: s.map((S) => S.value),
1407
- onChange: (S) => vt(S),
1408
- className: Y("slicer-dropdown", { "single-option": Ae.length === 1 }),
1409
- disableOpen: Ae.length === 1
1419
+ onChange: (S) => xt(S),
1420
+ className: Q("slicer-dropdown", { "single-option": _e.length === 1 }),
1421
+ disableOpen: _e.length === 1
1410
1422
  }
1411
1423
  ),
1412
- j && /* @__PURE__ */ E(es, { rowSelection: X, sliceMap: K }),
1413
- /* @__PURE__ */ G(
1414
- ns,
1424
+ B && /* @__PURE__ */ E(ss, { rowSelection: K, sliceMap: ee }),
1425
+ /* @__PURE__ */ W(
1426
+ as,
1415
1427
  {
1416
- className: Y({ searching: R }),
1428
+ className: Q({ searching: P }),
1417
1429
  onClick: (S) => S.stopPropagation(),
1418
1430
  children: [
1419
- !j && !R && /* @__PURE__ */ G($e, { children: [
1431
+ !B && !P && /* @__PURE__ */ W(Ue, { children: [
1420
1432
  /* @__PURE__ */ E(
1421
- ge,
1433
+ be,
1422
1434
  {
1423
1435
  icon: "more_horiz",
1424
- id: he,
1425
- className: Y("slicer-menu", { active: St }),
1436
+ id: ye,
1437
+ className: Q("slicer-menu", { active: vt }),
1426
1438
  "data-tooltip": "More",
1427
1439
  "data-tooltip-delay": 0,
1428
- onClick: () => Ke(he)
1440
+ onClick: () => Qe(ye)
1429
1441
  }
1430
1442
  ),
1431
- /* @__PURE__ */ E(hn, { targetId: he, id: he, align: "left", children: /* @__PURE__ */ E(gn, { menu: Tt, onClose: () => Ke(!1) }) })
1443
+ /* @__PURE__ */ E(bn, { targetId: ye, id: ye, align: "left", children: /* @__PURE__ */ E(Sn, { menu: It, onClose: () => Qe(!1) }) })
1432
1444
  ] }),
1433
- !j && /* @__PURE__ */ E(
1434
- qn,
1445
+ !B && /* @__PURE__ */ E(
1446
+ Qn,
1435
1447
  {
1436
- open: R,
1437
- value: F,
1438
- subject: le,
1448
+ open: P,
1449
+ value: te,
1450
+ subject: Ge,
1439
1451
  onChange: f
1440
1452
  }
1441
1453
  ),
1442
- N && /* @__PURE__ */ E(
1443
- Xn,
1454
+ O && /* @__PURE__ */ E(
1455
+ ts,
1444
1456
  {
1445
1457
  topics: ["entity.folder.created"],
1446
1458
  onSync: async () => {
1447
- await oe();
1459
+ await me();
1448
1460
  },
1449
1461
  hideWhenNoUpdates: !0
1450
1462
  }
1451
1463
  ),
1452
- ve && y && !R && /* @__PURE__ */ E(
1453
- ge,
1464
+ Ce && g && !P && /* @__PURE__ */ E(
1465
+ be,
1454
1466
  {
1455
1467
  icon: "splitscreen_add",
1456
- className: Y({ "power-feature": !J }),
1457
- "data-tooltip": J ? "Split slicer" : "Power feature - Slicer",
1468
+ className: Q({ "power-feature": !U }),
1469
+ "data-tooltip": U ? "Split slicer" : "Power feature - Slicer",
1458
1470
  "data-tooltip-delay": 0,
1459
- onClick: Me
1471
+ onClick: Pe
1460
1472
  }
1461
1473
  ),
1462
- !y && !R && /* @__PURE__ */ E(
1463
- ge,
1474
+ !g && !P && /* @__PURE__ */ E(
1475
+ be,
1464
1476
  {
1465
1477
  icon: "close",
1466
1478
  "data-tooltip": "Remove panel",
@@ -1474,37 +1486,37 @@ const Qn = (e, t, s) => {
1474
1486
  ]
1475
1487
  }
1476
1488
  ),
1477
- !j && /* @__PURE__ */ E(
1478
- en,
1489
+ !B && /* @__PURE__ */ E(
1490
+ sn,
1479
1491
  {
1480
- rowSelection: X,
1481
- onRowSelectionChange: L,
1482
- expanded: ae,
1492
+ rowSelection: K,
1493
+ onRowSelectionChange: k,
1494
+ expanded: L,
1483
1495
  setExpanded: A,
1484
- data: K,
1496
+ data: ee,
1485
1497
  children: /* @__PURE__ */ E(
1486
- tn,
1498
+ on,
1487
1499
  {
1488
- data: re,
1489
- isExpandable: De,
1490
- isLoading: Te || D,
1491
- forceUpdateTable: _,
1492
- globalFilter: F,
1500
+ data: he,
1501
+ isExpandable: ge,
1502
+ isLoading: ce || D,
1503
+ forceUpdateTable: M,
1504
+ globalFilter: te,
1493
1505
  rowIdPrefix: `slicer-${e.id}`,
1494
- onRename: N ? (S, M) => H.onRename(M.original) : void 0,
1495
- renamingId: N ? H.renamingRow?.id : null,
1496
- renameInitialValue: N ? H.renameInitialValue : void 0,
1497
- onSubmitRename: N ? (S, M) => H.onSubmitRename(M) : void 0,
1498
- onCancelRename: N ? H.onCancelRename : void 0,
1499
- onRowOptionClick: N ? H.onOptionClick : void 0,
1500
- rowContextMenuBuilders: yt,
1501
- addonShortcuts: { table: "slicer", projectName: ee }
1506
+ onRename: O ? (S, R) => H.onRename(R.original) : void 0,
1507
+ renamingId: O ? H.renamingRow?.id : null,
1508
+ renameInitialValue: O ? H.renameInitialValue : void 0,
1509
+ onSubmitRename: O ? (S, R) => H.onSubmitRename(R) : void 0,
1510
+ onCancelRename: O ? H.onCancelRename : void 0,
1511
+ onRowOptionClick: O ? H.onOptionClick : void 0,
1512
+ rowContextMenuBuilders: St,
1513
+ addonShortcuts: { table: "slicer", projectName: se }
1502
1514
  }
1503
1515
  )
1504
1516
  }
1505
1517
  )
1506
1518
  ] });
1507
- }, as = B.div`
1519
+ }, ls = V.div`
1508
1520
  height: 100%;
1509
1521
  width: 100%;
1510
1522
  overflow-y: auto;
@@ -1518,7 +1530,7 @@ const Qn = (e, t, s) => {
1518
1530
  }
1519
1531
  `
1520
1532
  ).join("")}
1521
- `, no = ({
1533
+ `, ao = ({
1522
1534
  sliceFields: e = [],
1523
1535
  entityTypes: t = ["task"],
1524
1536
  pinnedSliceType: s,
@@ -1526,92 +1538,100 @@ const Qn = (e, t, s) => {
1526
1538
  onAddToList: u,
1527
1539
  enableSplit: c
1528
1540
  }) => {
1529
- const { slices: p, page: g, setPanelExpanded: l, projectName: m, collapsedPanels: y } = ze(), { powerLicense: C } = Be(), f = !!c, h = f && C ? p : p.slice(0, 1), [b, i] = U(null), I = O((L) => {
1530
- i("entities" in L ? L : { entities: [L] });
1531
- }, []), r = O(() => {
1532
- i(null);
1533
- }, []), { getParentFolderIds: d } = Ue(), o = O(
1541
+ const {
1542
+ slices: p,
1543
+ page: h,
1544
+ setPanelExpanded: l,
1545
+ projectName: m,
1546
+ collapsedPanels: g,
1547
+ searchByPanel: x,
1548
+ setSearchByPanel: f
1549
+ } = Be(), { powerLicense: b } = He(), y = !!c, i = y && b ? p : p.slice(0, 1), [I, r] = G(null), d = F((L) => {
1550
+ r("entities" in L ? L : { entities: [L] });
1551
+ }, []), o = F(() => {
1552
+ r(null);
1553
+ }, []), { getParentFolderIds: n } = Ve(), v = F(
1534
1554
  (L) => {
1535
- const A = [L, ...d(L)];
1555
+ const k = [L, ...n(L)];
1536
1556
  l(
1537
1557
  "hierarchy",
1538
- (k) => typeof k == "boolean" ? k || Object.fromEntries(A.map((te) => [te, !0])) : {
1539
- ...k,
1540
- ...Object.fromEntries(A.map((te) => [te, !0]))
1558
+ (A) => typeof A == "boolean" ? A || Object.fromEntries(k.map((q) => [q, !0])) : {
1559
+ ...A,
1560
+ ...Object.fromEntries(k.map((q) => [q, !0]))
1541
1561
  }
1542
1562
  );
1543
1563
  },
1544
- [d, l]
1545
- ), n = we(null), [v, T] = U(0);
1546
- ue(() => {
1547
- const L = n.current;
1564
+ [n, l]
1565
+ ), T = Re(null), [C, D] = G(0);
1566
+ ie(() => {
1567
+ const L = T.current;
1548
1568
  if (!L) return;
1549
- const A = new ResizeObserver(([k]) => T(k.contentRect.height));
1550
- return A.observe(L), () => A.disconnect();
1551
- }, [h.length]);
1552
- const x = h.map((L) => L.id), D = h.length > 1, {
1553
- sizes: Q,
1554
- minSize: pe,
1555
- height: me,
1569
+ const k = new ResizeObserver(([A]) => D(A.contentRect.height));
1570
+ return k.observe(L), () => k.disconnect();
1571
+ }, [i.length]);
1572
+ const z = i.map((L) => L.id), ne = i.length > 1, {
1573
+ sizes: ue,
1574
+ minSize: re,
1575
+ height: pe,
1556
1576
  layoutKey: se,
1557
- handleResizeEnd: fe
1558
- } = Rn(g, x, D ? y : [], v), ee = x.slice(0, -1).map(
1559
- (L, A) => D && (y.includes(L) || y.includes(x[A + 1])) ? A : -1
1560
- ).filter((L) => L >= 0), [oe, J] = U({}), W = O(
1561
- (L, A) => J((k) => ({ ...k, [L]: A })),
1562
- []
1563
- ), X = x.join("|");
1564
- ue(() => {
1565
- J((L) => {
1566
- const A = Object.keys(L).filter((k) => x.includes(k));
1567
- return A.length === Object.keys(L).length ? L : Object.fromEntries(A.map((k) => [k, L[k]]));
1577
+ handleResizeEnd: oe
1578
+ } = _n(h, z, ne ? g : [], C), me = z.slice(0, -1).map(
1579
+ (L, k) => ne && (g.includes(L) || g.includes(z[k + 1])) ? k : -1
1580
+ ).filter((L) => L >= 0), U = F(
1581
+ (L, k) => f((A) => ({ ...A, [L]: k })),
1582
+ [f]
1583
+ ), fe = z.join("|");
1584
+ ie(() => {
1585
+ f((L) => {
1586
+ const k = Object.keys(L).filter((A) => z.includes(A));
1587
+ return k.length === Object.keys(L).length ? L : Object.fromEntries(k.map((A) => [A, L[A]]));
1568
1588
  });
1569
- }, [X]);
1570
- const ae = {
1571
- visibleSlices: h,
1572
- canCollapse: D,
1589
+ }, [fe, f]);
1590
+ const K = {
1591
+ visibleSlices: i,
1592
+ canCollapse: ne,
1573
1593
  sliceFields: e,
1574
1594
  entityTypes: t,
1575
1595
  pinnedSliceType: s,
1576
1596
  countsSource: a,
1577
1597
  onAddToList: u,
1578
- openMoveDialog: I,
1579
- splitEnabled: f
1598
+ openMoveDialog: d,
1599
+ splitEnabled: y
1580
1600
  };
1581
- return /* @__PURE__ */ G($e, { children: [
1582
- h.length === 1 ? /* @__PURE__ */ E(
1583
- at,
1601
+ return /* @__PURE__ */ W(Ue, { children: [
1602
+ i.length === 1 ? /* @__PURE__ */ E(
1603
+ rt,
1584
1604
  {
1585
- panel: h[0],
1605
+ panel: i[0],
1586
1606
  isPrimary: !0,
1587
- search: oe[h[0].id],
1588
- onSearchChange: (L) => W(h[0].id, L),
1589
- ...ae
1607
+ search: x[i[0].id],
1608
+ onSearchChange: (L) => U(i[0].id, L),
1609
+ ...K
1590
1610
  }
1591
- ) : /* @__PURE__ */ E(as, { ref: n, $deadGutters: ee, children: /* @__PURE__ */ E(
1592
- Dt,
1611
+ ) : /* @__PURE__ */ E(ls, { ref: T, $deadGutters: me, children: /* @__PURE__ */ E(
1612
+ kt,
1593
1613
  {
1594
1614
  layout: "vertical",
1595
- onResizeEnd: fe,
1615
+ onResizeEnd: oe,
1596
1616
  style: {
1597
1617
  width: "100%",
1598
- height: me,
1618
+ height: pe,
1599
1619
  overflow: "hidden"
1600
1620
  },
1601
- children: h.map((L, A) => /* @__PURE__ */ E(
1602
- kt,
1621
+ children: i.map((L, k) => /* @__PURE__ */ E(
1622
+ At,
1603
1623
  {
1604
- size: Q[A],
1605
- minSize: pe,
1624
+ size: ue[k],
1625
+ minSize: re,
1606
1626
  style: { overflow: "hidden" },
1607
1627
  children: /* @__PURE__ */ E(
1608
- at,
1628
+ rt,
1609
1629
  {
1610
1630
  panel: L,
1611
- isPrimary: A === 0,
1612
- search: oe[L.id],
1613
- onSearchChange: (k) => W(L.id, k),
1614
- ...ae
1631
+ isPrimary: k === 0,
1632
+ search: x[L.id],
1633
+ onSearchChange: (A) => U(L.id, A),
1634
+ ...K
1615
1635
  }
1616
1636
  )
1617
1637
  },
@@ -1621,36 +1641,36 @@ const Qn = (e, t, s) => {
1621
1641
  se
1622
1642
  ) }),
1623
1643
  /* @__PURE__ */ E(
1624
- Mn,
1644
+ On,
1625
1645
  {
1626
1646
  projectName: m,
1627
- movingEntities: b,
1628
- onClose: r,
1629
- onMoveComplete: o
1647
+ movingEntities: I,
1648
+ onClose: o,
1649
+ onMoveComplete: v
1630
1650
  }
1631
1651
  )
1632
1652
  ] });
1633
1653
  };
1634
1654
  export {
1635
- Cn as S,
1636
- ft as a,
1637
- et as b,
1638
- kn as c,
1639
- ut as d,
1640
- no as e,
1641
- Fn as f,
1642
- Dn as g,
1643
- tt as h,
1644
- pt as i,
1645
- Ve as j,
1646
- En as k,
1647
- Kn as l,
1648
- Hn as m,
1649
- Rn as n,
1650
- to as o,
1651
- Xn as p,
1652
- xn as q,
1653
- eo as r,
1654
- In as s,
1655
- jn as u
1655
+ En as S,
1656
+ gt as a,
1657
+ nt as b,
1658
+ Mn as c,
1659
+ mt as d,
1660
+ ao as e,
1661
+ zn as f,
1662
+ An as g,
1663
+ st as h,
1664
+ ft as i,
1665
+ We as j,
1666
+ kn as k,
1667
+ Xn as l,
1668
+ Kn as m,
1669
+ _n as n,
1670
+ oo as o,
1671
+ ts as p,
1672
+ wn as q,
1673
+ so as r,
1674
+ Ln as s,
1675
+ Un as u
1656
1676
  };