@ynput/ayon-frontend-shared 0.6.9 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +767 -740
  3. package/dist/ListTable.es.js +430 -430
  4. package/dist/NewEntity.es.js +43 -42
  5. package/dist/ProjectTreeTable.es.js +3496 -3342
  6. package/dist/Slicer.es.js +301 -276
  7. package/dist/Views.es.js +537 -521
  8. package/dist/api.es.js +429 -412
  9. package/dist/chunks/Actions.es.js +19 -18
  10. package/dist/chunks/ColumnDropIndicator.es.js +19 -18
  11. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  12. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  14. package/dist/chunks/DetailsDialog.es.js +26 -24
  15. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  16. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  17. package/dist/chunks/EntityPath.es.js +72 -71
  18. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  19. package/dist/chunks/EntityTooltip.es.js +11 -10
  20. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  21. package/dist/chunks/Feed.es.js +864 -859
  22. package/dist/chunks/FilterErrorActions.es.js +4 -3
  23. package/dist/chunks/Menu.es.js +633 -289
  24. package/dist/chunks/MenuContext.es.js +1 -1
  25. package/dist/chunks/MetaWidget.es.js +2751 -2217
  26. package/dist/chunks/PlayableIcon.es.js +79 -78
  27. package/dist/chunks/ProjectContext.es.js +7 -7
  28. package/dist/chunks/RepresentationsList.es.js +1 -1
  29. package/dist/chunks/ReviewablesSelector.es.js +625 -609
  30. package/dist/chunks/SimpleForm.es.js +1 -1
  31. package/dist/chunks/SimpleTable.es.js +386 -363
  32. package/dist/chunks/Slicer.es.js +954 -821
  33. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  34. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  35. package/dist/chunks/ThumbnailSimple.es.js +96 -95
  36. package/dist/chunks/VideoPlayer.es.js +1 -1
  37. package/dist/chunks/Watchers.es.js +850 -797
  38. package/dist/chunks/getBundleMode.es.js +1 -1
  39. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  40. package/dist/chunks/getUris.es.js +3704 -3504
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  42. package/dist/chunks/searchTerms.es.js +649 -563
  43. package/dist/chunks/sortLists.es.js +22 -0
  44. package/dist/chunks/useAttributeEnums.es.js +21 -21
  45. package/dist/chunks/useHierarchySelection.es.js +6 -5
  46. package/dist/chunks/useLoadModule.es.js +24 -23
  47. package/dist/chunks/viewUpdateHelper.es.js +19 -18
  48. package/dist/components.es.js +628 -593
  49. package/dist/context.es.js +525 -499
  50. package/dist/hooks.es.js +54 -53
  51. package/dist/index.es.js +4 -4
  52. package/dist/types/ContextMenu.d.ts +4 -1
  53. package/dist/types/Feed.d.ts +1 -1
  54. package/dist/types/ListTable.d.ts +1 -1
  55. package/dist/types/ProjectTreeTable.d.ts +144 -14
  56. package/dist/types/SimpleTable.d.ts +2 -1
  57. package/dist/types/Slicer.d.ts +32 -5
  58. package/dist/types/Views.d.ts +6 -0
  59. package/dist/types/api.d.ts +2252 -510
  60. package/dist/types/components.d.ts +52 -4
  61. package/dist/types/context.d.ts +96 -2
  62. package/dist/types/hooks.d.ts +36 -1
  63. package/dist/types/util.d.ts +54 -0
  64. package/dist/util.es.js +129 -119
  65. package/package.json +4 -4
  66. package/dist/chunks/MenuItem.es.js +0 -420
@@ -1,24 +1,25 @@
1
- import { jsx as m, jsxs as z, Fragment as J } from "react/jsx-runtime";
2
- import { useMemo as W, useCallback as Q, useState as L, useEffect as V, useRef as X, forwardRef as q, useContext as Ee } from "react";
3
- import { snakeCase as Te, upperFirst as Se, intersectionBy as le } from "lodash";
1
+ import { jsx as g, jsxs as R, Fragment as ae } from "react/jsx-runtime";
2
+ import { useMemo as I, useCallback as Y, useState as O, useEffect as q, useRef as ne, forwardRef as ee, useContext as Se } from "react";
3
+ import { getMixedCounts as Te, BorderedSection as J, Button as _, applyMixedChange as je, StatusSelect as De, AssigneeSelect as Fe, TagsSelect as Ce, EnumDropdown as Ae, Icon as V, getMimeTypeIcon as Ne, theme as $e, getFileSizeString as Me, WatcherSelect as ze } from "@ynput/ayon-react-components";
4
+ import { snakeCase as Re, upperFirst as Ue, intersectionBy as he } from "lodash";
4
5
  import "primereact/confirmdialog";
5
- import { toast as G } from "react-toastify";
6
- import { c as K } from "./copyToClipboard.es.js";
6
+ import { toast as te } from "react-toastify";
7
+ import { c as oe } from "./copyToClipboard.es.js";
7
8
  import "uuid";
8
- import { ax as ce, aZ as De, bi as de, b0 as je, b1 as Fe, b2 as Ce, bk as Ae, bo as Ne, bx as $e, bh as Re, a as B, bp as ze } from "./searchTerms.es.js";
9
- import p, { keyframes as pe, css as ue } from "styled-components";
9
+ import { aF as fe, b6 as Le, bs as ve, b9 as Pe, ba as We, bb as Oe, bB as Ie, by as Ve, bJ as Be, br as He, a as K, bz as _e } from "./searchTerms.es.js";
10
+ import p, { keyframes as ye, css as be } from "styled-components";
10
11
  import U from "clsx";
11
- import { BorderedSection as H, Button as O, StatusSelect as Me, AssigneeSelect as Ue, TagsSelect as Le, EnumDropdown as Pe, Icon as P, getMimeTypeIcon as We, theme as Oe, getFileSizeString as Ie, WatcherSelect as Ve } from "@ynput/ayon-react-components";
12
- import { o as Be, M as He, T as _e, n as Qe, B as qe, D as Ge } from "./MetaWidget.es.js";
12
+ import { r as Qe, t as qe, M as Ge, T as Ke, q as Je, B as Ze, D as Xe } from "./MetaWidget.es.js";
13
13
  import "./PlayableIcon.es.js";
14
- import { di as Ke, bW as Ze, c8 as me, bg as Je, ao as Xe, bv as Ye, d6 as et } from "./getUris.es.js";
14
+ import { dq as Ye, c0 as et, ce as xe, bk as tt, as as ot, bz as rt, dd as at } from "./getUris.es.js";
15
15
  import "@module-federation/enhanced/runtime";
16
- import { o as Z, d as tt, x as ot, T as rt } from "./DeleteEntitiesContextInstance.es.js";
16
+ import { o as re, d as nt, x as it, T as st } from "./TableExportContextInstance.es.js";
17
17
  import "semver";
18
18
  import "./ContextMenuContextInstance.es.js";
19
19
  import "react-dom";
20
20
  import "react-redux";
21
- import { format as at } from "date-fns";
21
+ import "react-router-dom";
22
+ import { format as lt } from "date-fns";
22
23
  import "lexical";
23
24
  import "@lexical/markdown";
24
25
  import "match-sorter";
@@ -30,16 +31,16 @@ import "@lexical/utils";
30
31
  import "@lexical/react/LexicalBlockWithAlignableContents";
31
32
  import "@lexical/react/LexicalDecoratorBlockNode";
32
33
  import "@tanstack/react-table";
33
- import { g as nt, h as Y } from "./humanizeFieldName.es.js";
34
- import { a as it, A as st } from "./ThumbnailSimple.es.js";
35
- import ge from "axios";
36
- import { p as I } from "./parseFilename.es.js";
37
- import { classNames as lt } from "primereact/utils";
38
- import { u as ct } from "./useCreateContextMenu.es.js";
39
- import { g as dt } from "./getThumbnailUrl.es.js";
40
- const ee = [], pt = (e) => {
41
- const { data: t, isError: r } = Ce(void 0, { skip: !e });
42
- return W(
34
+ import { g as ct, h as ie } from "./humanizeFieldName.es.js";
35
+ import { a as dt, A as pt } from "./ThumbnailSimple.es.js";
36
+ import we from "axios";
37
+ import { p as Q } from "./parseFilename.es.js";
38
+ import { classNames as ut } from "primereact/utils";
39
+ import { u as mt } from "./useCreateContextMenu.es.js";
40
+ import { g as gt } from "./getThumbnailUrl.es.js";
41
+ const se = [], ht = (e) => {
42
+ const { data: t, isError: r } = Oe(void 0, { skip: !e });
43
+ return I(
43
44
  () => ({
44
45
  // a failed registry is settled too: every param is sent, same fallback as the batch
45
46
  isRegistryLoaded: !!t || r,
@@ -47,55 +48,55 @@ const ee = [], pt = (e) => {
47
48
  }),
48
49
  [t, r, e]
49
50
  );
50
- }, Vo = () => {
51
- const [e] = je(), [t] = Fe();
52
- return Q(
51
+ }, Go = () => {
52
+ const [e] = Pe(), [t] = We();
53
+ return Y(
53
54
  async (r, o) => {
54
55
  const n = (await t(void 0, !0).unwrap().catch(() => {
55
56
  }))?.find(({ name: a }) => a === r.enumResolver)?.acceptedParams;
56
57
  try {
57
58
  const a = await e(
58
- ce(r, { projectName: o }, n),
59
+ fe(r, { projectName: o }, n),
59
60
  !0
60
61
  ).unwrap();
61
62
  if (a.error) throw new Error(a.error);
62
- return de(a.items);
63
+ return ve(a.items);
63
64
  } catch (a) {
64
- throw ut(a);
65
+ throw ft(a);
65
66
  }
66
67
  },
67
68
  [e, t]
68
69
  );
69
- }, ut = (e) => {
70
+ }, ft = (e) => {
70
71
  if (e instanceof Error) return e;
71
72
  const {
72
73
  message: t,
73
74
  data: r,
74
75
  status: o,
75
- error: l
76
+ error: c
76
77
  } = e || {};
77
- return typeof r?.detail == "string" ? new Error(r.detail) : typeof l == "string" ? new Error(l) : typeof t == "string" ? new Error(t) : new Error(o ? `Request failed (${o})` : "Request failed");
78
- }, mt = (e, { projectName: t, skip: r } = {}) => {
79
- const o = e?.enumResolver, { acceptedParams: l, isRegistryLoaded: n } = pt(o), a = W(
80
- () => ce(e, { projectName: t }, l),
78
+ return typeof r?.detail == "string" ? new Error(r.detail) : typeof c == "string" ? new Error(c) : typeof t == "string" ? new Error(t) : new Error(o ? `Request failed (${o})` : "Request failed");
79
+ }, vt = (e, { projectName: t, skip: r } = {}) => {
80
+ const o = e?.enumResolver, { acceptedParams: c, isRegistryLoaded: n } = ht(o), a = I(
81
+ () => fe(e, { projectName: t }, c),
81
82
  // eslint-disable-next-line react-hooks/exhaustive-deps
82
- [o, e?.enumResolverSettings, t, l]
83
+ [o, e?.enumResolverSettings, t, c]
83
84
  ), {
84
- currentData: c,
85
- isFetching: g,
86
- isError: s
87
- } = De(a, {
85
+ currentData: d,
86
+ isFetching: h,
87
+ isError: i
88
+ } = Le(a, {
88
89
  // waiting for the registry keeps the cache key final: no request is sent with params that get dropped
89
90
  skip: !o || !!r || !n
90
- }), u = W(() => o ? c ? de(c.items) : ee : e?.enum || ee, [o, c, e?.enum]), i = !!o && !g && (s || !!c?.error);
91
+ }), u = I(() => o ? d ? ve(d.items) : se : e?.enum || se, [o, d, e?.enum]), f = !!o && !h && (i || !!d?.error);
91
92
  return {
92
93
  options: u,
93
94
  // a background refetch (tag invalidation) keeps the cached options, so it is not a load
94
- isLoading: !!o && !r && (!n || g && !c),
95
- isError: i,
96
- errorMessage: i ? c?.error : void 0
95
+ isLoading: !!o && !r && (!n || h && !d),
96
+ isError: f,
97
+ errorMessage: f ? d?.error : void 0
97
98
  };
98
- }, gt = [
99
+ }, yt = [
99
100
  "id",
100
101
  "name",
101
102
  "label",
@@ -110,14 +111,14 @@ const ee = [], pt = (e) => {
110
111
  "projectName",
111
112
  "path",
112
113
  "description"
113
- ], te = [
114
+ ], le = [
114
115
  "id",
115
116
  "entityType",
116
117
  "projectName",
117
118
  "path",
118
119
  "createdAt",
119
120
  "updatedAt"
120
- ], ht = [
121
+ ], bt = [
121
122
  "name",
122
123
  "label",
123
124
  "taskType",
@@ -125,68 +126,68 @@ const ee = [], pt = (e) => {
125
126
  "productType",
126
127
  "tags",
127
128
  "status"
128
- ], ft = (e, t) => {
129
- const [r, o] = L([]), [l, n] = L(null), a = () => {
130
- const s = {}, u = /* @__PURE__ */ new Set();
131
- e.forEach((h) => {
129
+ ], xt = (e, t) => {
130
+ const [r, o] = O([]), [c, n] = O(null), a = () => {
131
+ const i = {}, u = /* @__PURE__ */ new Set();
132
+ e.forEach((s) => {
132
133
  const v = {
133
- id: h.id,
134
- name: h.name,
135
- label: h.label,
136
- entityType: h.entityType,
137
- createdAt: h.createdAt,
138
- updatedAt: h.updatedAt,
139
- projectName: h.projectName,
140
- status: h.status,
141
- tags: h.tags || [],
142
- path: h.path,
143
- folderType: h.folder?.folderType,
144
- productType: h.product?.productType,
145
- taskType: h.task?.taskType,
146
- description: h.attrib?.description?.toString() ?? ""
134
+ id: s.id,
135
+ name: s.name,
136
+ label: s.label,
137
+ entityType: s.entityType,
138
+ createdAt: s.createdAt,
139
+ updatedAt: s.updatedAt,
140
+ projectName: s.projectName,
141
+ status: s.status,
142
+ tags: s.tags || [],
143
+ path: s.path,
144
+ folderType: s.folder?.folderType,
145
+ productType: s.product?.productType,
146
+ taskType: s.task?.taskType,
147
+ description: s.attrib?.description?.toString() ?? ""
147
148
  };
148
- Object.keys(v).forEach((f) => {
149
- gt.includes(f) && (s[f] = s[f] || [], s[f].push(v[f]));
150
- }), h.attrib && Object.keys(h.attrib).forEach((f) => {
151
- if (f !== "description") {
152
- const w = `attrib.${f}`;
153
- s[w] = s[w] || [], s[w].push(h.attrib?.[f]);
149
+ Object.keys(v).forEach((m) => {
150
+ yt.includes(m) && (i[m] = i[m] || [], i[m].push(v[m]));
151
+ }), s.attrib && Object.keys(s.attrib).forEach((m) => {
152
+ if (m !== "description") {
153
+ const w = `attrib.${m}`;
154
+ i[w] = i[w] || [], i[w].push(s.attrib?.[m]);
154
155
  }
155
156
  });
156
157
  });
157
- const i = Object.entries(s).reduce((h, [v, f]) => {
158
- const { value: w, isMixed: y } = nt(f);
159
- return h[v] = w, y && u.add(v), h;
158
+ const f = Object.entries(i).reduce((s, [v, m]) => {
159
+ const { value: w, isMixed: T } = ct(m);
160
+ return s[v] = w, T && u.add(v), s;
160
161
  }, {});
161
- n(i), o(Array.from(u));
162
+ n(f), o(Array.from(u));
162
163
  };
163
- return V(() => {
164
+ return q(() => {
164
165
  t || e.length === 0 || a();
165
166
  }, [e, t]), {
166
- formData: l,
167
+ formData: c,
167
168
  mixedFields: r,
168
- updateFormData: (s, u) => {
169
- n((i) => i && {
170
- ...i,
171
- [s]: u
169
+ updateFormData: (i, u) => {
170
+ n((f) => f && {
171
+ ...f,
172
+ [i]: u
172
173
  });
173
174
  },
174
- clearMixedField: (s) => {
175
- o((u) => u.filter((i) => i !== s));
175
+ clearMixedField: (i) => {
176
+ o((u) => u.filter((f) => f !== i));
176
177
  }
177
178
  };
178
- }, vt = ({
179
+ }, wt = ({
179
180
  attributes: e,
180
181
  folderTypes: t,
181
182
  taskTypes: r,
182
183
  statuses: o,
183
- tags: l,
184
+ tags: c,
184
185
  entityType: n,
185
186
  folderHasVersions: a,
186
- attribAccess: c
187
+ attribAccess: d
187
188
  }) => {
188
- const g = W(() => {
189
- const { readableAttributes: i, writableAttributes: h, writableFields: v } = c || {}, w = [
189
+ const h = I(() => {
190
+ const { readableAttributes: f, writableAttributes: s, writableFields: v } = d || {}, w = [
190
191
  {
191
192
  name: "name",
192
193
  data: {
@@ -210,10 +211,10 @@ const ee = [], pt = (e) => {
210
211
  type: "string",
211
212
  title: "Folder Type",
212
213
  description: "Type of the folder",
213
- enum: t.map((d) => ({
214
- value: d.name,
215
- label: d.name,
216
- icon: d.icon
214
+ enum: t.map((l) => ({
215
+ value: l.name,
216
+ label: l.name,
217
+ icon: l.icon
217
218
  }))
218
219
  }
219
220
  },
@@ -224,10 +225,10 @@ const ee = [], pt = (e) => {
224
225
  type: "string",
225
226
  title: "Task Type",
226
227
  description: "Type of the task",
227
- enum: r.map((d) => ({
228
- value: d.name,
229
- label: d.name,
230
- icon: d.icon
228
+ enum: r.map((l) => ({
229
+ value: l.name,
230
+ label: l.name,
231
+ icon: l.icon
231
232
  }))
232
233
  }
233
234
  },
@@ -237,11 +238,11 @@ const ee = [], pt = (e) => {
237
238
  type: "string",
238
239
  title: "Status",
239
240
  description: "The state the entity is in, is it approved or in progress etc.",
240
- enum: o.map((d) => ({
241
- value: d.name,
242
- label: d.name,
243
- icon: d.icon,
244
- color: d.color
241
+ enum: o.map((l) => ({
242
+ value: l.name,
243
+ label: l.name,
244
+ icon: l.icon,
245
+ color: l.color
245
246
  }))
246
247
  }
247
248
  },
@@ -250,111 +251,112 @@ const ee = [], pt = (e) => {
250
251
  data: {
251
252
  type: "list_of_strings",
252
253
  title: "Tags",
253
- enum: l.map((d) => ({
254
- value: d.name,
255
- label: d.name,
256
- color: d.color
254
+ widget: "tags",
255
+ enum: c.map((l) => ({
256
+ value: l.name,
257
+ label: l.name,
258
+ color: l.color
257
259
  }))
258
260
  }
259
261
  }
260
262
  ].map(
261
- (d) => d.name === "folderType" && n === "folder" && a ? {
262
- ...d,
263
+ (l) => l.name === "folderType" && n === "folder" && a ? {
264
+ ...l,
263
265
  readonly: !0,
264
266
  data: {
265
- ...d.data,
267
+ ...l.data,
266
268
  description: "Folder type is locked because the folder has published versions."
267
269
  }
268
- } : d
269
- ), y = n === "version" ? [
270
+ } : l
271
+ ), T = n === "version" ? [
270
272
  ...w.map(
271
- (d) => ["tags", "status"].includes(d.name) ? d : { ...d, readonly: !0 }
273
+ (l) => ["tags", "status"].includes(l.name) ? l : { ...l, readonly: !0 }
272
274
  )
273
- ] : w, x = v ? y.map(
274
- (d) => v.includes(d.name) || v.includes(Te(d.name)) ? d : { ...d, readonly: !0 }
275
- ) : y, F = n ? e.filter((d) => d.scope?.includes(n) && d.name !== "description").filter((d) => !i || i.includes(d.name)).map((d) => ({
276
- name: "attrib." + d.name,
277
- data: d.data,
278
- ...n === "version" && d.builtin ? { readonly: !0 } : {},
279
- ...h && !h.includes(d.name) ? { readonly: !0 } : {}
280
- })) : [], T = te.map((d) => ({
281
- name: d,
275
+ ] : w, S = v ? T.map(
276
+ (l) => v.includes(l.name) || v.includes(Re(l.name)) ? l : { ...l, readonly: !0 }
277
+ ) : T, b = n ? e.filter((l) => l.scope?.includes(n) && l.name !== "description").filter((l) => !f || f.includes(l.name)).map((l) => ({
278
+ name: "attrib." + l.name,
279
+ data: l.data,
280
+ ...n === "version" && l.builtin ? { readonly: !0 } : {},
281
+ ...s && !s.includes(l.name) ? { readonly: !0 } : {}
282
+ })) : [], k = le.map((l) => ({
283
+ name: l,
282
284
  readonly: !0,
283
285
  data: {
284
286
  type: "string",
285
- title: Se(d)
287
+ title: Ue(l)
286
288
  }
287
- })), A = [
288
- ...x,
289
- ...F,
290
- ...T
291
- ], k = ["path", "name"];
292
- return [...A].sort((d, D) => {
293
- const N = k.indexOf(d.name), C = k.indexOf(D.name);
294
- return N === -1 && C === -1 ? 0 : N === -1 ? 1 : C === -1 ? -1 : N - C;
289
+ })), C = [
290
+ ...S,
291
+ ...b,
292
+ ...k
293
+ ], E = ["path", "name"];
294
+ return [...C].sort((l, N) => {
295
+ const $ = E.indexOf(l.name), z = E.indexOf(N.name);
296
+ return $ === -1 && z === -1 ? 0 : $ === -1 ? 1 : z === -1 ? -1 : $ - z;
295
297
  });
296
298
  }, [
297
299
  e,
298
300
  t,
299
301
  r,
300
302
  o,
301
- l,
303
+ c,
302
304
  n,
303
305
  a,
304
- c
305
- ]), s = g.filter(
306
- (i) => ht.includes(i.name) || i.name.startsWith("attrib.")
307
- ), u = g.filter(
308
- (i) => te.includes(i.name)
306
+ d
307
+ ]), i = h.filter(
308
+ (f) => bt.includes(f.name) || f.name.startsWith("attrib.")
309
+ ), u = h.filter(
310
+ (f) => le.includes(f.name)
309
311
  );
310
312
  return {
311
- fields: g,
312
- editableFields: s,
313
+ fields: h,
314
+ editableFields: i,
313
315
  readOnlyFieldsData: u
314
316
  };
315
- }, yt = ({ entities: e, entityType: t }) => {
316
- const [r] = Ke(), { onUpdateEntity: o } = Z();
317
+ }, kt = ({ entities: e, entityType: t }) => {
318
+ const [r] = Ye(), { onUpdateEntity: o } = re();
317
319
  return { updateEntity: async (n, a) => {
318
320
  if (a == null) {
319
321
  console.error("value is null or undefined");
320
322
  return;
321
323
  }
322
324
  try {
323
- const c = e.map((g) => ({
324
- id: g.id,
325
- projectName: g.projectName,
325
+ const d = e.map((h) => ({
326
+ id: h.id,
327
+ projectName: h.projectName,
326
328
  data: {
327
- [n]: a
329
+ [n]: typeof a == "function" ? a(h.id) : a
328
330
  },
329
- currentAssignees: g.users,
331
+ currentAssignees: h.users,
330
332
  meta: {
331
- folderId: g.folderId
333
+ folderId: h.folderId
332
334
  }
333
335
  }));
334
- await r({ operations: c, entityType: t }), o?.({ operations: c, entityType: t });
336
+ await r({ operations: d, entityType: t }), o?.({ operations: d, entityType: t });
335
337
  } catch {
336
- G.error(`Error updating ${t}`);
338
+ te.error(`Error updating ${t}`);
337
339
  }
338
340
  } };
339
- }, _ = (e) => e.reduce(
341
+ }, X = (e) => e.reduce(
340
342
  (t, r) => r ? t ? t.filter((o) => r.includes(o)) : r : t,
341
343
  void 0
342
- ), bt = ({ entities: e, entityType: t }) => {
343
- const { data: o } = Ze(), l = W(() => {
344
+ ), Et = ({ entities: e, entityType: t }) => {
345
+ const { data: o } = et(), c = I(() => {
344
346
  if (!o?.projects) return {};
345
- const a = [...new Set(e.map((s) => s.projectName))].map(
346
- (s) => o.projects?.[s] || {}
347
- ), c = a.map((s) => s.attrib_read), g = a.map((s) => s.attrib_write);
347
+ const a = [...new Set(e.map((i) => i.projectName))].map(
348
+ (i) => o.projects?.[i] || {}
349
+ ), d = a.map((i) => i.attrib_read), h = a.map((i) => i.attrib_write);
348
350
  return {
349
- readableAttributes: _(
350
- c.map((s) => s?.enabled ? s.attributes ?? [] : void 0)
351
+ readableAttributes: X(
352
+ d.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
351
353
  ),
352
- writableAttributes: _(
353
- g.map((s) => s?.enabled ? s.attributes ?? [] : void 0)
354
+ writableAttributes: X(
355
+ h.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
354
356
  ),
355
- writableFields: _(g.map((s) => s?.enabled ? s.fields ?? [] : void 0))
357
+ writableFields: X(h.map((i) => i?.enabled ? i.fields ?? [] : void 0))
356
358
  };
357
- }, [o, e]), { updateEntity: n } = yt({
359
+ }, [o, e]), { updateEntity: n } = kt({
358
360
  entities: e.map((a) => ({
359
361
  id: a.id,
360
362
  projectName: a.projectName || "",
@@ -366,45 +368,45 @@ const ee = [], pt = (e) => {
366
368
  });
367
369
  return {
368
370
  enableEditing: !0,
369
- attribAccess: l,
371
+ attribAccess: c,
370
372
  updateEntity: n
371
373
  };
372
- }, xt = (e, t) => {
373
- const r = me({ projects: [...new Set(e).values()] });
374
+ }, St = (e, t) => {
375
+ const r = xe({ projects: [...new Set(e).values()] });
374
376
  if (!r || !r.data)
375
377
  return [];
376
378
  let o;
377
- for (const l of Object.values(r.data)) {
378
- const n = l.statuses?.filter(
379
- (a) => t.every((c) => !a.scope || a.scope?.includes(c))
379
+ for (const c of Object.values(r.data)) {
380
+ const n = c.statuses?.filter(
381
+ (a) => t.every((d) => !a.scope || a.scope?.includes(d))
380
382
  ) || [];
381
383
  if (o === void 0) {
382
384
  o = n;
383
385
  continue;
384
386
  }
385
- o = le(o, n, "name");
387
+ o = he(o, n, "name");
386
388
  }
387
389
  return o;
388
- }, Bo = (e, t) => {
390
+ }, Ko = (e, t) => {
389
391
  let r = Object.values(e || {});
390
392
  return r.length == 0 || r[0].scope === void 0 ? r : r.filter(
391
- (o) => t.every((l) => o.scope === void 0 || o.scope.includes(l))
393
+ (o) => t.every((c) => o.scope === void 0 || o.scope.includes(c))
392
394
  );
393
- }, wt = (e, t) => {
394
- const r = me({ projects: [...new Set(e).values()] });
395
+ }, Tt = (e, t) => {
396
+ const r = xe({ projects: [...new Set(e).values()] });
395
397
  if (!r || !r.data)
396
398
  return [];
397
399
  let o;
398
- for (const l of Object.values(r.data)) {
400
+ for (const c of Object.values(r.data)) {
399
401
  let n = [];
400
- if (t === "task" ? n = l.taskTypes || [] : t === "folder" && (n = l.folderTypes || []), o === void 0) {
402
+ if (t === "task" ? n = c.taskTypes || [] : t === "folder" && (n = c.folderTypes || []), o === void 0) {
401
403
  o = n;
402
404
  continue;
403
405
  }
404
- o = le(o, n, "name");
406
+ o = he(o, n, "name");
405
407
  }
406
408
  return o || [];
407
- }, oe = p.div`
409
+ }, ce = p.div`
408
410
  width: 100%;
409
411
  overflow: hidden;
410
412
  text-overflow: ellipsis;
@@ -414,7 +416,7 @@ const ee = [], pt = (e) => {
414
416
  input {
415
417
  text-align: left;
416
418
  }
417
- `, kt = p(Be)`
419
+ `, jt = p(Qe)`
418
420
  .enum,
419
421
  .edit-trigger {
420
422
  &:hover {
@@ -424,144 +426,179 @@ const ee = [], pt = (e) => {
424
426
  &:hover {
425
427
  background-color: unset;
426
428
  }
427
- `, Et = ({
429
+ `, Dt = p(qe)`
430
+ &.enum:hover {
431
+ background-color: unset;
432
+ }
433
+ `, Ft = ({
428
434
  field: e,
429
435
  value: t,
430
436
  isEditing: r,
431
437
  isReadOnly: o,
432
- isMixed: l,
438
+ isMixed: c,
433
439
  onChange: n,
434
- onCancelEdit: a,
435
- onExpand: c,
436
- entities: g = [],
437
- entityType: s = "task",
438
- projectName: u
440
+ onMixedChange: a,
441
+ onCancelEdit: d,
442
+ onExpand: h,
443
+ entities: i = [],
444
+ entityType: u = "task",
445
+ projectName: f
439
446
  }) => {
440
- const { type: i, widget: h } = e.data, v = {
447
+ const { type: s, widget: v } = e.data, m = {
441
448
  isEditing: r && !o,
442
449
  isReadOnly: o,
443
450
  isInherited: !1,
444
- onChange: ($) => n(e.name, $)
445
- }, f = g.map(($) => $.projectName), w = xt(f, [s]), y = wt(f, s), x = u || f[0], {
446
- options: F,
447
- isLoading: T,
448
- isError: A,
449
- errorMessage: k
450
- } = mt(e.data, { projectName: x }), S = A ? Re(k) : void 0, d = e.name === "attrib.endDate" && g.length > 0 && g.every(($) => $.data?.schedulerSyncData?.allDay === !0);
451
- let D = t ?? "";
452
- const N = e.data.title || e.name, C = t == null || t === "" || Array.isArray(t) && t.length === 0;
453
- if (i !== "boolean" && o && !l && C)
454
- return /* @__PURE__ */ m(oe, { children: "-" });
451
+ onChange: (A) => n(e.name, A)
452
+ }, w = i.map((A) => A.projectName), T = St(w, [u]), S = Tt(w, u), b = f || w[0], {
453
+ options: k,
454
+ isLoading: C,
455
+ isError: E,
456
+ errorMessage: D
457
+ } = vt(e.data, { projectName: b }), l = E ? He(D) : void 0, N = I(() => {
458
+ if (!(!a || i.length < 2 || s !== "list_of_strings"))
459
+ return Te(
460
+ i.map((A) => {
461
+ const L = e.name === "tags" ? A.tags : e.name.startsWith("attrib.") ? A.attrib?.[e.name.slice(7)] : void 0;
462
+ return Array.isArray(L) ? L.map(String) : [];
463
+ })
464
+ );
465
+ }, [a, i, s, e.name]), $ = N && {
466
+ mixedCounts: N,
467
+ mixedTotal: i.length,
468
+ mixedLabel: `${u}s`,
469
+ onMixedChange: (A) => a?.(e.name, A)
470
+ }, z = e.name === "attrib.endDate" && i.length > 0 && i.every((A) => A.data?.schedulerSyncData?.allDay === !0);
471
+ let F = t ?? "";
472
+ const y = e.data.title || e.name, j = t == null || t === "" || Array.isArray(t) && t.length === 0;
473
+ if (s !== "boolean" && o && !c && j)
474
+ return /* @__PURE__ */ g(ce, { children: "-" });
455
475
  switch (!0) {
456
- case i === "boolean":
457
- return /* @__PURE__ */ m(qe, { value: !!D, ...v, style: { margin: 0 } });
458
- case i === "datetime":
459
- return /* @__PURE__ */ m(
460
- Qe,
476
+ case s === "boolean":
477
+ return /* @__PURE__ */ g(Ze, { value: !!F, ...m, style: { margin: 0 } });
478
+ case s === "datetime":
479
+ return /* @__PURE__ */ g(
480
+ Je,
461
481
  {
462
- value: D,
463
- ...v,
482
+ value: F,
483
+ ...m,
464
484
  isEditing: !0,
465
- onCancelEdit: a,
485
+ onCancelEdit: d,
466
486
  style: { width: "fit-content" },
467
487
  autoFocus: !1,
468
- isMidnightExclusive: d
488
+ isMidnightExclusive: z
469
489
  }
470
490
  );
471
- case Ae(e.data): {
472
- const $ = i?.includes("list");
473
- let b = [];
474
- $ ? b = Array.isArray(D) ? D : [] : l ? b = [] : b = [D];
475
- let E = F.map((j) => ({
476
- value: j.value,
477
- label: j.label,
478
- icon: Ne(j.icon),
479
- color: j.color,
480
- group: j.group,
481
- hidden: j.hidden
491
+ case v === "tags":
492
+ return /* @__PURE__ */ g(
493
+ Dt,
494
+ {
495
+ value: Array.isArray(F) ? F : [],
496
+ options: k,
497
+ projectName: b,
498
+ isProjectTags: e.name === "tags" && new Set(w).size <= 1,
499
+ pt: { template: { style: { height: 32 }, className: "enum" } },
500
+ placeholder: c ? `Mixed ${y}` : `Select ${y}...`,
501
+ ...$,
502
+ onCancelEdit: d,
503
+ align: "right",
504
+ ...m
505
+ }
506
+ );
507
+ case Ie(e.data): {
508
+ const A = s?.includes("list");
509
+ let L = [];
510
+ A ? L = Array.isArray(F) ? F : [] : c ? L = [] : L = [F];
511
+ let P = k.map((x) => ({
512
+ value: x.value,
513
+ label: x.label,
514
+ icon: Ve(x.icon),
515
+ color: x.color,
516
+ group: x.group,
517
+ hidden: x.hidden
482
518
  }));
483
- return e.name === "status" && g.length > 0 && w && w.length > 0 && (E = w.map((j) => ({
484
- value: j.name,
485
- label: j.name,
486
- icon: j.icon,
487
- color: j.color
488
- }))), e.name === "taskType" && g.length > 0 && y && y.length > 0 && (E = y.map((j) => ({
489
- value: j.name,
490
- label: j.name,
491
- icon: j.icon,
492
- color: j.color
493
- }))), e.allowNone && b.length && !$ && D && D !== "" && (E = [
519
+ return e.name === "status" && i.length > 0 && T && T.length > 0 && (P = T.map((x) => ({
520
+ value: x.name,
521
+ label: x.name,
522
+ icon: x.icon,
523
+ color: x.color
524
+ }))), e.name === "taskType" && i.length > 0 && S && S.length > 0 && (P = S.map((x) => ({
525
+ value: x.name,
526
+ label: x.name,
527
+ icon: x.icon,
528
+ color: x.color
529
+ }))), e.allowNone && L.length && !A && F && F !== "" && (P = [
494
530
  { value: "", label: `No ${e.data.title || e.name}` },
495
- ...E
496
- ]), /* @__PURE__ */ m(
497
- kt,
531
+ ...P
532
+ ]), /* @__PURE__ */ g(
533
+ jt,
498
534
  {
499
- "data-tooltip": S,
500
- value: b,
501
- options: E,
502
- type: i,
535
+ "data-tooltip": l,
536
+ value: L,
537
+ options: P,
538
+ type: s,
503
539
  pt: {
504
540
  template: {
505
541
  style: { height: 32 },
506
542
  className: "enum"
507
543
  }
508
544
  },
509
- placeholder: S ? `Could not load ${N}` : l ? `Mixed ${N}` : `Select ${N}...`,
510
- error: $e(S),
511
- onCancelEdit: a,
545
+ placeholder: l ? `Could not load ${y}` : c ? `Mixed ${y}` : `Select ${y}...`,
546
+ error: Be(l),
547
+ onCancelEdit: d,
512
548
  align: "right",
513
549
  enableCustomValues: e.enableCustomValues,
514
- isLoadingOptions: T,
515
- search: e.enableSearch ?? E.length >= 5,
516
- sortBySelected: !E,
517
- ...v
550
+ isLoadingOptions: C,
551
+ search: e.enableSearch ?? P.length >= 5,
552
+ sortBySelected: !P,
553
+ ...$,
554
+ ...m
518
555
  }
519
556
  );
520
557
  }
521
- case (i === "string" || i === "integer" || i === "float"):
558
+ case (s === "string" || s === "integer" || s === "float"):
522
559
  default:
523
- return h === "markdown" ? /* @__PURE__ */ m(
524
- He,
560
+ return v === "markdown" ? /* @__PURE__ */ g(
561
+ Ge,
525
562
  {
526
- value: D.toString(),
527
- onCancelEdit: a,
528
- onExpand: c,
529
- showExpand: !!c,
530
- ...v
563
+ value: F.toString(),
564
+ onCancelEdit: d,
565
+ onExpand: h,
566
+ showExpand: !!h,
567
+ ...m
531
568
  }
532
- ) : /* @__PURE__ */ m(oe, { children: /* @__PURE__ */ m(
533
- _e,
569
+ ) : /* @__PURE__ */ g(ce, { children: /* @__PURE__ */ g(
570
+ Ke,
534
571
  {
535
- value: D.toString(),
536
- onCancelEdit: a,
537
- type: i,
538
- ...v
572
+ value: F.toString(),
573
+ onCancelEdit: d,
574
+ type: s,
575
+ ...m
539
576
  }
540
577
  ) });
541
578
  }
542
- }, Tt = p.div`
579
+ }, Ct = p.div`
543
580
  color: var(--md-sys-color-outline);
544
581
  white-space: nowrap;
545
582
  overflow: hidden;
546
583
  text-overflow: ellipsis;
547
584
  font-size: 14px;
548
- `, he = ({
585
+ `, ke = ({
549
586
  name: e,
550
587
  data: t,
551
588
  showDetailedTooltip: r = !1,
552
589
  ...o
553
590
  }) => {
554
- const l = t.title ? Y(t.title) : Y(e), n = r ? `${l} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || l;
555
- return /* @__PURE__ */ m(
556
- Tt,
591
+ const c = t.title ? ie(t.title) : ie(e), n = r ? `${c} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || c;
592
+ return /* @__PURE__ */ g(
593
+ Ct,
557
594
  {
558
595
  "data-tooltip": r ? n : void 0,
559
596
  "data-tooltip-delay": 700,
560
597
  ...o,
561
- children: l
598
+ children: c
562
599
  }
563
600
  );
564
- }, fe = p.div`
601
+ }, Ee = p.div`
565
602
  display: grid;
566
603
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1fr) 32px;
567
604
  row-gap: 2px;
@@ -595,7 +632,7 @@ const ee = [], pt = (e) => {
595
632
  margin-top: 6px;
596
633
  }
597
634
  }
598
- `, St = p.div`
635
+ `, At = p.div`
599
636
  height: 32px;
600
637
  overflow: hidden;
601
638
  width: 100%;
@@ -631,7 +668,7 @@ const ee = [], pt = (e) => {
631
668
  &.readonly {
632
669
  pointer-events: none;
633
670
  }
634
- `, Dt = p.div`
671
+ `, Nt = p.div`
635
672
  display: flex;
636
673
  flex-direction: column;
637
674
  gap: var(--base-gap-small);
@@ -641,7 +678,7 @@ const ee = [], pt = (e) => {
641
678
  height: 32px;
642
679
  padding: 2px;
643
680
  }
644
- `, jt = p(fe)`
681
+ `, $t = p(Ee)`
645
682
  &.loading {
646
683
  width: 100%;
647
684
  height: 33px;
@@ -649,110 +686,114 @@ const ee = [], pt = (e) => {
649
686
  border-radius: 4px;
650
687
  margin-bottom: 4px;
651
688
  }
652
- `, Ft = ({
689
+ `, Mt = ({
653
690
  title: e,
654
691
  isLoading: t,
655
692
  form: r,
656
693
  fields: o,
657
- enableEditing: l,
694
+ enableEditing: c,
658
695
  mixedFields: n,
659
696
  onChange: a,
660
- entities: c = [],
661
- projectName: g,
662
- entityType: s = "task"
697
+ onMixedChange: d,
698
+ entities: h = [],
699
+ projectName: i,
700
+ entityType: u = "task"
663
701
  }) => {
664
- const [u, i] = L(null), h = W(
665
- () => c.map((y) => y?.id).join("|"),
666
- [c]
702
+ const [f, s] = O(null), v = I(
703
+ () => h.map((b) => b?.id).join("|"),
704
+ [h]
667
705
  );
668
- V(() => {
669
- i(null);
670
- }, [h]);
671
- const v = (y) => {
672
- l && !o.find((x) => x.name === y)?.readonly ? i(y) : console.log("Editing not allowed:", {
673
- enableEditing: l,
674
- fieldReadonly: o.find((x) => x.name === y)?.readonly
706
+ q(() => {
707
+ s(null);
708
+ }, [v]);
709
+ const m = (b) => {
710
+ c && !o.find((k) => k.name === b)?.readonly ? s(b) : console.log("Editing not allowed:", {
711
+ enableEditing: c,
712
+ fieldReadonly: o.find((k) => k.name === b)?.readonly
675
713
  });
676
- }, f = (y, x) => {
677
- i(null), a?.(y, x);
678
- }, w = () => {
679
- i(null);
714
+ }, w = (b, k) => {
715
+ s(null), a?.(b, k);
716
+ }, T = (b, k) => {
717
+ s(null), d?.(b, k);
718
+ }, S = () => {
719
+ s(null);
680
720
  };
681
- return t ? /* @__PURE__ */ m(H, { title: "Attributes", withPadding: !0, children: Array.from({ length: 10 }).map((y, x) => /* @__PURE__ */ z(jt, { children: [
682
- /* @__PURE__ */ m("div", { className: "loading" }),
683
- /* @__PURE__ */ m("div", { className: "loading" })
684
- ] }, x)) }) : /* @__PURE__ */ m(
685
- H,
721
+ return t ? /* @__PURE__ */ g(J, { title: "Attributes", withPadding: !0, children: Array.from({ length: 10 }).map((b, k) => /* @__PURE__ */ R($t, { children: [
722
+ /* @__PURE__ */ g("div", { className: "loading" }),
723
+ /* @__PURE__ */ g("div", { className: "loading" })
724
+ ] }, k)) }) : /* @__PURE__ */ g(
725
+ J,
686
726
  {
687
727
  title: "Attributes",
688
728
  autoHeight: !0,
689
729
  showHeader: !0,
690
730
  withPadding: !0,
691
731
  pt: { content: { style: { minHeight: "unset" } } },
692
- children: o.filter((y) => !y.hidden).map((y) => {
693
- const x = r[y.name], F = u === y.name, T = y.readonly || !l, A = n?.includes(y.name) || !1;
694
- return /* @__PURE__ */ z(
695
- fe,
732
+ children: o.filter((b) => !b.hidden).map((b) => {
733
+ const k = r[b.name], C = f === b.name, E = b.readonly || !c, D = n?.includes(b.name) || !1;
734
+ return /* @__PURE__ */ R(
735
+ Ee,
696
736
  {
697
- className: U("field-row", { "multi-line": y.data.widget === "markdown" }),
737
+ className: U("field-row", { "multi-line": b.data.widget === "markdown" }),
698
738
  children: [
699
- /* @__PURE__ */ m(
700
- he,
739
+ /* @__PURE__ */ g(
740
+ ke,
701
741
  {
702
- name: y.name,
703
- data: y.data,
742
+ name: b.name,
743
+ data: b.data,
704
744
  showDetailedTooltip: !0,
705
745
  className: "field-label"
706
746
  }
707
747
  ),
708
- /* @__PURE__ */ m(
709
- St,
748
+ /* @__PURE__ */ g(
749
+ At,
710
750
  {
711
751
  className: U("field-value", {
712
- editing: F,
713
- readonly: T
752
+ editing: C,
753
+ readonly: E
714
754
  }),
715
- onClick: (k) => {
716
- k.target.closest("a") || (k.preventDefault(), !F && !T && y.data.type !== "boolean" && v(y.name));
755
+ onClick: (l) => {
756
+ l.target.closest("a") || (l.preventDefault(), !C && !E && b.data.type !== "boolean" && m(b.name));
717
757
  },
718
- children: /* @__PURE__ */ m(
719
- Et,
758
+ children: /* @__PURE__ */ g(
759
+ Ft,
720
760
  {
721
- field: y,
722
- value: x,
723
- isEditing: F,
724
- isReadOnly: T,
725
- isMixed: A,
726
- onChange: f,
727
- onCancelEdit: w,
761
+ field: b,
762
+ value: k,
763
+ isEditing: C,
764
+ isReadOnly: E,
765
+ isMixed: D,
766
+ onChange: w,
767
+ onMixedChange: d && T,
768
+ onCancelEdit: S,
728
769
  onExpand: () => {
729
770
  },
730
- entities: c,
731
- projectName: g,
732
- entityType: s
771
+ entities: h,
772
+ projectName: i,
773
+ entityType: u
733
774
  }
734
775
  )
735
776
  }
736
777
  ),
737
- /* @__PURE__ */ m(Dt, { className: "field-tools", children: /* @__PURE__ */ m(
738
- O,
778
+ /* @__PURE__ */ g(Nt, { className: "field-tools", children: /* @__PURE__ */ g(
779
+ _,
739
780
  {
740
781
  className: "tool",
741
782
  variant: "text",
742
783
  icon: "content_copy",
743
- onClick: (k) => {
744
- k.preventDefault(), k.stopPropagation(), K((x ?? "").toString(), !0);
784
+ onClick: (l) => {
785
+ l.preventDefault(), l.stopPropagation(), oe((k ?? "").toString(), !0);
745
786
  }
746
787
  }
747
788
  ) })
748
789
  ]
749
790
  },
750
- y.name
791
+ b.name
751
792
  );
752
793
  })
753
794
  }
754
795
  );
755
- }, re = p.div`
796
+ }, de = p.div`
756
797
  display: grid;
757
798
  grid-template-columns: minmax(200px, 1fr) 1fr 32px;
758
799
  row-gap: 2px;
@@ -775,7 +816,7 @@ const ee = [], pt = (e) => {
775
816
  &:hover .copy-icon {
776
817
  opacity: 1;
777
818
  }
778
- `, Ct = p.div`
819
+ `, zt = p.div`
779
820
  text-align: left;
780
821
  color: var(--md-sys-color-on-surface);
781
822
  white-space: nowrap;
@@ -784,7 +825,7 @@ const ee = [], pt = (e) => {
784
825
  justify-self: end;
785
826
  font-size: 14px;
786
827
  width: 100%;
787
- `, ae = p.div`
828
+ `, pe = p.div`
788
829
  height: 20px;
789
830
  background: var(--md-sys-color-surface-container-low);
790
831
  border-radius: 4px;
@@ -801,55 +842,55 @@ const ee = [], pt = (e) => {
801
842
  opacity: 0.5;
802
843
  }
803
844
  }
804
- `, At = ({
845
+ `, Rt = ({
805
846
  fields: e,
806
847
  form: t,
807
848
  mixedFields: r = [],
808
849
  isLoading: o
809
850
  }) => {
810
- const l = (n, a) => {
851
+ const c = (n, a) => {
811
852
  if (n == null)
812
853
  return "-";
813
854
  if (a === "createdAt" || a === "updatedAt")
814
855
  try {
815
- return at(new Date(n), "PPpp");
856
+ return lt(new Date(n), "PPpp");
816
857
  } catch {
817
858
  return n.toString();
818
859
  }
819
860
  return n.toString();
820
861
  };
821
- return o ? /* @__PURE__ */ m(H, { title: "Details", withPadding: !0, children: Array.from({ length: 6 }).map((n, a) => /* @__PURE__ */ z(re, { children: [
822
- /* @__PURE__ */ m(ae, { style: { width: "80px" } }),
823
- /* @__PURE__ */ m(ae, { style: { width: "120px", justifySelf: "end" } }),
824
- /* @__PURE__ */ m("div", { style: { width: "24px" } })
825
- ] }, a)) }) : /* @__PURE__ */ m(H, { title: "Details", autoHeight: !0, showHeader: !0, withPadding: !0, children: e.filter((n) => !n.hidden).map((n) => {
826
- const a = t[n.name], c = r.includes(n.name), g = c ? "Multiple values" : l(a, n.name);
827
- return /* @__PURE__ */ z(re, { children: [
828
- /* @__PURE__ */ m(he, { name: n.name, data: n.data, showDetailedTooltip: !0 }),
829
- /* @__PURE__ */ m(
830
- Ct,
862
+ return o ? /* @__PURE__ */ g(J, { title: "Details", withPadding: !0, children: Array.from({ length: 6 }).map((n, a) => /* @__PURE__ */ R(de, { children: [
863
+ /* @__PURE__ */ g(pe, { style: { width: "80px" } }),
864
+ /* @__PURE__ */ g(pe, { style: { width: "120px", justifySelf: "end" } }),
865
+ /* @__PURE__ */ g("div", { style: { width: "24px" } })
866
+ ] }, a)) }) : /* @__PURE__ */ g(J, { title: "Details", autoHeight: !0, showHeader: !0, withPadding: !0, children: e.filter((n) => !n.hidden).map((n) => {
867
+ const a = t[n.name], d = r.includes(n.name), h = d ? "Multiple values" : c(a, n.name);
868
+ return /* @__PURE__ */ R(de, { children: [
869
+ /* @__PURE__ */ g(ke, { name: n.name, data: n.data, showDetailedTooltip: !0 }),
870
+ /* @__PURE__ */ g(
871
+ zt,
831
872
  {
832
873
  style: {
833
- color: c ? "var(--md-sys-color-on-surface-variant)" : "var(--md-sys-color-on-surface)",
834
- fontStyle: c ? "italic" : "normal"
874
+ color: d ? "var(--md-sys-color-on-surface-variant)" : "var(--md-sys-color-on-surface)",
875
+ fontStyle: d ? "italic" : "normal"
835
876
  },
836
- children: g
877
+ children: h
837
878
  }
838
879
  ),
839
- /* @__PURE__ */ m(
840
- O,
880
+ /* @__PURE__ */ g(
881
+ _,
841
882
  {
842
883
  className: "copy-icon",
843
884
  variant: "text",
844
885
  icon: "content_copy",
845
- onClick: (s) => {
846
- s.stopPropagation(), K((a ?? "").toString(), !0);
886
+ onClick: (i) => {
887
+ i.stopPropagation(), oe((a ?? "").toString(), !0);
847
888
  }
848
889
  }
849
890
  )
850
891
  ] }, n.name);
851
892
  }) });
852
- }, Nt = p.div`
893
+ }, Ut = p.div`
853
894
  display: flex;
854
895
  flex-direction: column;
855
896
  height: 100%;
@@ -858,94 +899,106 @@ const ee = [], pt = (e) => {
858
899
  padding-right: 8px;
859
900
  padding-left: 8px;
860
901
  margin-top: 16px;
861
- `, Ho = ({ entities: e = [], isLoading: t }) => {
862
- const { formData: r, mixedFields: o, updateFormData: l, clearMixedField: n } = ft(
902
+ `, Jo = ({ entities: e = [], isLoading: t }) => {
903
+ const { formData: r, mixedFields: o, updateFormData: c, clearMixedField: n } = xt(
863
904
  e,
864
905
  t
865
- ), { attributes: a } = tt(), {
866
- folderTypes: c = [],
867
- taskTypes: g = [],
868
- statuses: s = [],
906
+ ), { attributes: a } = nt(), {
907
+ folderTypes: d = [],
908
+ taskTypes: h = [],
909
+ statuses: i = [],
869
910
  tags: u = [],
870
- productTypes: i
871
- } = ot(), { openSlideOut: h } = Z(), [, v] = it(), f = (e || []).filter((R) => R.entityType === "folder"), { data: w } = Je(
911
+ productTypes: f
912
+ } = it(), { openSlideOut: s } = re(), [, v] = dt(), m = (e || []).filter((x) => x.entityType === "folder"), { data: w } = tt(
872
913
  {
873
- entityIds: f.map((R) => R.id),
914
+ entityIds: m.map((x) => x.id),
874
915
  projectName: r?.projectName || "",
875
916
  referenceTypes: ["origin", "mention", "relation"],
876
917
  activityTypes: ["version.publish"]
877
918
  },
878
919
  {
879
- skip: !r?.projectName || f.length === 0
920
+ skip: !r?.projectName || m.length === 0
880
921
  }
881
- ), y = !!w?.pages?.[0]?.activities?.length, x = r?.entityType || "task", { enableEditing: F, attribAccess: T, updateEntity: A } = bt({
922
+ ), T = !!w?.pages?.[0]?.activities?.length, S = r?.entityType || "task", { enableEditing: b, attribAccess: k, updateEntity: C } = Et({
882
923
  entities: e,
883
- entityType: x
884
- }), { editableFields: k, readOnlyFieldsData: S } = vt({
924
+ entityType: S
925
+ }), { editableFields: E, readOnlyFieldsData: D } = wt({
885
926
  attributes: a,
886
- folderTypes: c,
887
- taskTypes: g,
888
- statuses: s,
927
+ folderTypes: d,
928
+ taskTypes: h,
929
+ statuses: i,
889
930
  tags: u,
890
931
  entityType: r?.entityType,
891
- folderHasVersions: y,
892
- attribAccess: T
893
- }), { writableAttributes: d } = T, D = !d || d.includes("description"), N = (R, M) => {
894
- R === "tags" && (Array.isArray(M) || (M == null || M === "" ? M = [] : M = [String(M)])), R.startsWith("attrib.") && (M = {
895
- [R.replace("attrib.", "")]: M
896
- }, R = "attrib"), l(R, M), A(R, M);
897
- }, C = r?.projectName || e[0]?.projectName, $ = e[0]?.id, b = W(
898
- () => C && $ ? { projectName: C, entityType: x, entityId: $, productTypes: i, taskTypes: g } : void 0,
899
- [C, x, $, i, g]
900
- ), E = ({ type: R, id: M }) => {
901
- R === "user" || R === "team" || !C || h({ entityId: M, entityType: R, projectName: C });
902
- }, j = ({ type: R, id: M, label: ye }, be) => {
903
- const { x: xe, y: we, width: ke } = be.getBoundingClientRect();
904
- v({ id: M, name: M, type: R, label: ye, pos: { left: xe + ke / 2, top: we } });
905
- }, ve = (R) => {
906
- l("description", R), n("description"), A("attrib", { description: R });
932
+ folderHasVersions: T,
933
+ attribAccess: k
934
+ }), { writableAttributes: l } = k, N = !l || l.includes("description"), $ = (x, M) => {
935
+ x === "tags" && (Array.isArray(M) || (M == null || M === "" ? M = [] : M = [String(M)])), x.startsWith("attrib.") && (M = {
936
+ [x.replace("attrib.", "")]: M
937
+ }, x = "attrib"), c(x, M), C(x, M);
938
+ }, z = (x, M) => {
939
+ const B = x.startsWith("attrib.") ? x.replace("attrib.", "") : void 0, Z = (W) => {
940
+ const H = B ? W.attrib?.[B] : W.tags;
941
+ return Array.isArray(H) ? H.map(String) : [];
942
+ }, G = new Map(
943
+ e.map((W) => [W.id, je(Z(W), M)])
944
+ );
945
+ c(x, [...new Set([...G.values()].flat())]), C(B ? "attrib" : x, (W) => {
946
+ const H = G.get(W) || [];
947
+ return B ? { [B]: H } : H;
948
+ });
949
+ }, F = r?.projectName || e[0]?.projectName, y = e[0]?.id, j = I(
950
+ () => F && y ? { projectName: F, entityType: S, entityId: y, productTypes: f, taskTypes: h } : void 0,
951
+ [F, S, y, f, h]
952
+ ), A = ({ type: x, id: M }) => {
953
+ x === "user" || x === "team" || !F || s({ entityId: M, entityType: x, projectName: F });
954
+ }, L = ({ type: x, id: M, label: B }, Z) => {
955
+ const { x: G, y: W, width: H } = Z.getBoundingClientRect();
956
+ v({ id: M, name: M, type: x, label: B, pos: { left: G + H / 2, top: W } });
957
+ }, P = (x) => {
958
+ c("description", x), n("description"), C("attrib", { description: x });
907
959
  };
908
- return /* @__PURE__ */ z(Nt, { children: [
909
- /* @__PURE__ */ m(
910
- Ge,
960
+ return /* @__PURE__ */ R(Ut, { children: [
961
+ /* @__PURE__ */ g(
962
+ Xe,
911
963
  {
912
964
  description: r?.description || "",
913
965
  isMixed: o.includes("description"),
914
- enableEditing: D,
915
- onChange: ve,
966
+ enableEditing: N,
967
+ onChange: P,
916
968
  isLoading: t,
917
- mentionsContext: b,
918
- onMentionClick: E,
919
- onMentionHover: j
969
+ mentionsContext: j,
970
+ onMentionClick: A,
971
+ onMentionHover: L
920
972
  }
921
973
  ),
922
- /* @__PURE__ */ m(st, {}),
923
- /* @__PURE__ */ m(
924
- Ft,
974
+ /* @__PURE__ */ g(pt, {}),
975
+ /* @__PURE__ */ g(
976
+ Mt,
925
977
  {
926
- fields: k,
978
+ fields: E,
927
979
  form: r || {},
928
980
  mixedFields: o,
929
981
  isLoading: t,
930
- enableEditing: F,
931
- onChange: N,
982
+ enableEditing: b,
983
+ onChange: $,
984
+ onMixedChange: z,
932
985
  entities: e,
933
- entityType: x
986
+ entityType: S
934
987
  }
935
988
  ),
936
- /* @__PURE__ */ m(
937
- At,
989
+ /* @__PURE__ */ g(
990
+ Rt,
938
991
  {
939
- fields: S,
992
+ fields: D,
940
993
  form: r || {},
941
994
  mixedFields: o,
942
995
  isLoading: t
943
996
  }
944
997
  )
945
998
  ] });
946
- }, _o = p.div`
999
+ }, Zo = p.div`
947
1000
  position: relative;
948
- `, Qo = p.div`
1001
+ `, Xo = p.div`
949
1002
  position: relative;
950
1003
  padding: 8px;
951
1004
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
@@ -977,13 +1030,13 @@ const ee = [], pt = (e) => {
977
1030
  /* align center */
978
1031
  align-items: center;
979
1032
  }
980
- `, qo = p(O)`
1033
+ `, Yo = p(_)`
981
1034
  position: absolute;
982
1035
  right: 4px;
983
1036
  top: 4px;
984
1037
  width: fit-content;
985
1038
  z-index: 50;
986
- `, Go = p.header`
1039
+ `, er = p.header`
987
1040
  display: flex;
988
1041
  align-items: center;
989
1042
  gap: var(--base-gap-large);
@@ -998,7 +1051,7 @@ const ee = [], pt = (e) => {
998
1051
  display: none;
999
1052
  }
1000
1053
  }
1001
- `, Ko = p.div`
1054
+ `, tr = p.div`
1002
1055
  display: flex;
1003
1056
  align-items: center;
1004
1057
  gap: var(--base-gap-small);
@@ -1006,7 +1059,7 @@ const ee = [], pt = (e) => {
1006
1059
  h2 {
1007
1060
  min-width: fit-content;
1008
1061
  }
1009
- `, Zo = p.div`
1062
+ `, or = p.div`
1010
1063
  position: relative;
1011
1064
  height: 100%;
1012
1065
 
@@ -1021,7 +1074,7 @@ const ee = [], pt = (e) => {
1021
1074
  flex-direction: column;
1022
1075
  gap: var(--base-gap-small);
1023
1076
  }
1024
- `, Jo = p.div`
1077
+ `, rr = p.div`
1025
1078
  display: flex;
1026
1079
  flex-direction: column;
1027
1080
  height: 100%;
@@ -1059,7 +1112,7 @@ const ee = [], pt = (e) => {
1059
1112
  align-items: center;
1060
1113
  gap: var(--base-gap-medium);
1061
1114
  }
1062
- `, Xo = p.div`
1115
+ `, ar = p.div`
1063
1116
  display: flex;
1064
1117
  justify-content: space-between;
1065
1118
  align-items: flex-start;
@@ -1068,10 +1121,10 @@ const ee = [], pt = (e) => {
1068
1121
  label {
1069
1122
  color: var(--md-sys-color-outline);
1070
1123
  }
1071
- `, Yo = p.div`
1124
+ `, nr = p.div`
1072
1125
  display: flex;
1073
1126
  flex-direction: column;
1074
- `, er = p(Me)`
1127
+ `, ir = p(De)`
1075
1128
  width: fit-content;
1076
1129
  .status-field.value {
1077
1130
  position: relative;
@@ -1082,11 +1135,11 @@ const ee = [], pt = (e) => {
1082
1135
  margin-bottom: 2px;
1083
1136
  color: ${(e) => e.$textColor};
1084
1137
  }
1085
- `, tr = p(Ue)`
1138
+ `, sr = p(Fe)`
1086
1139
  width: fit-content;
1087
1140
  justify-self: end;
1088
1141
  max-width: 100%;
1089
- `, or = p(Le)`
1142
+ `, lr = p(Ce)`
1090
1143
  height: 24px;
1091
1144
  .template-value {
1092
1145
  padding: 0 2px;
@@ -1100,7 +1153,7 @@ const ee = [], pt = (e) => {
1100
1153
  display: none;
1101
1154
  }
1102
1155
  }
1103
- `, rr = p.div`
1156
+ `, cr = p.div`
1104
1157
  display: flex;
1105
1158
  align-items: center;
1106
1159
  gap: 4px;
@@ -1120,7 +1173,7 @@ const ee = [], pt = (e) => {
1120
1173
  border-radius: 3px;
1121
1174
  padding: 0 4px;
1122
1175
  }
1123
- `, ar = p(Pe)`
1176
+ `, dr = p(Ae)`
1124
1177
  width: max-content;
1125
1178
  justify-self: end;
1126
1179
  /* remove text and dropdown icon */
@@ -1144,12 +1197,12 @@ const ee = [], pt = (e) => {
1144
1197
  background-color: var(--md-sys-color-surface-container-low-hover);
1145
1198
  }
1146
1199
  }
1147
- `, nr = p.footer`
1200
+ `, pr = p.footer`
1148
1201
  display: flex;
1149
1202
  align-items: center;
1150
1203
  gap: var(--base-gap-small);
1151
1204
  justify-content: space-between;
1152
- `, ir = p.div`
1205
+ `, ur = p.div`
1153
1206
  height: 100%;
1154
1207
 
1155
1208
  > input[type='file'] {
@@ -1160,7 +1213,7 @@ const ee = [], pt = (e) => {
1160
1213
  input[type='file'] {
1161
1214
  display: none;
1162
1215
  }
1163
- `, sr = p.div`
1216
+ `, mr = p.div`
1164
1217
  z-index: 100;
1165
1218
  position: absolute;
1166
1219
  inset: 0;
@@ -1172,7 +1225,7 @@ const ee = [], pt = (e) => {
1172
1225
  display: flex;
1173
1226
  align-items: center;
1174
1227
  justify-content: center;
1175
- `, lr = p.div`
1228
+ `, gr = p.div`
1176
1229
  flex: 1;
1177
1230
  height: 100%;
1178
1231
  border-radius: var(--border-radius-l);
@@ -1201,11 +1254,11 @@ const ee = [], pt = (e) => {
1201
1254
  /* show children */
1202
1255
  opacity: 1;
1203
1256
  }
1204
- `, cr = p(O)`
1257
+ `, hr = p(_)`
1205
1258
  position: absolute;
1206
1259
  top: 4px;
1207
1260
  right: 4px;
1208
- `, dr = p.div`
1261
+ `, fr = p.div`
1209
1262
  display: flex;
1210
1263
  flex-direction: column;
1211
1264
  align-items: center;
@@ -1218,7 +1271,7 @@ const ee = [], pt = (e) => {
1218
1271
  top: 12px;
1219
1272
  position: relative;
1220
1273
  }
1221
- `, pr = p.div`
1274
+ `, vr = p.div`
1222
1275
  height: 8px;
1223
1276
  position: absolute;
1224
1277
  border-radius: 4px;
@@ -1227,14 +1280,14 @@ const ee = [], pt = (e) => {
1227
1280
  background-color: var(--md-sys-color-primary);
1228
1281
 
1229
1282
  transition: right 0.2s;
1230
- `, $t = pe`
1283
+ `, Lt = ye`
1231
1284
  from {
1232
1285
  transform: rotate(0deg);
1233
1286
  }
1234
1287
  to {
1235
1288
  transform: rotate(360deg);
1236
1289
  }
1237
- `, Rt = p.div`
1290
+ `, Pt = p.div`
1238
1291
  position: relative;
1239
1292
  display: flex;
1240
1293
  justify-content: center;
@@ -1243,10 +1296,10 @@ const ee = [], pt = (e) => {
1243
1296
  overflow: hidden;
1244
1297
 
1245
1298
  background-color: var(--md-sys-color-surface-container-low);
1246
- `, zt = p(P)`
1247
- animation: ${$t} 1s linear infinite;
1299
+ `, Wt = p(V)`
1300
+ animation: ${Lt} 1s linear infinite;
1248
1301
  opacity: 0.6;
1249
- `, Mt = p.img`
1302
+ `, Ot = p.img`
1250
1303
  position: absolute;
1251
1304
  inset: 0;
1252
1305
  object-fit: cover;
@@ -1258,56 +1311,56 @@ const ee = [], pt = (e) => {
1258
1311
  &.hidden {
1259
1312
  opacity: 0;
1260
1313
  }
1261
- `, Ut = ({ mimetype: e = "", src: t, ...r }) => {
1262
- const [o, l] = L(!1), [n, a] = L(!1), c = X(null), g = X(0);
1263
- return V(() => {
1264
- const s = g.current + 1;
1265
- g.current = s, a(!1), l(!1);
1266
- const u = c.current;
1267
- let i = !1, h = 0, v = 0, f = 0;
1268
- const w = (T) => {
1269
- i || s !== g.current || (i = !0, cancelAnimationFrame(h), window.clearInterval(v), window.clearTimeout(f), T());
1270
- }, y = () => {
1271
- !u || s !== g.current || u.complete && u.naturalWidth > 0 && w(() => {
1272
- a(!0), l(!1);
1314
+ `, It = ({ mimetype: e = "", src: t, ...r }) => {
1315
+ const [o, c] = O(!1), [n, a] = O(!1), d = ne(null), h = ne(0);
1316
+ return q(() => {
1317
+ const i = h.current + 1;
1318
+ h.current = i, a(!1), c(!1);
1319
+ const u = d.current;
1320
+ let f = !1, s = 0, v = 0, m = 0;
1321
+ const w = (k) => {
1322
+ f || i !== h.current || (f = !0, cancelAnimationFrame(s), window.clearInterval(v), window.clearTimeout(m), k());
1323
+ }, T = () => {
1324
+ !u || i !== h.current || u.complete && u.naturalWidth > 0 && w(() => {
1325
+ a(!0), c(!1);
1273
1326
  });
1274
- }, x = () => w(() => {
1275
- a(!0), l(!1);
1276
- }), F = () => w(() => {
1277
- a(!0), l(!0);
1327
+ }, S = () => w(() => {
1328
+ a(!0), c(!1);
1329
+ }), b = () => w(() => {
1330
+ a(!0), c(!0);
1278
1331
  });
1279
- return u && (u.addEventListener("load", x), u.addEventListener("error", F), typeof u.decode == "function" && u.decode().then(
1332
+ return u && (u.addEventListener("load", S), u.addEventListener("error", b), typeof u.decode == "function" && u.decode().then(
1280
1333
  () => w(() => {
1281
- a(!0), l(!1);
1334
+ a(!0), c(!1);
1282
1335
  })
1283
1336
  ).catch(() => {
1284
- y();
1285
- })), h = requestAnimationFrame(y), v = window.setInterval(y, 250), f = window.setTimeout(() => {
1337
+ T();
1338
+ })), s = requestAnimationFrame(T), v = window.setInterval(T, 250), m = window.setTimeout(() => {
1286
1339
  w(() => {
1287
- u && u.naturalWidth > 0 ? (a(!0), l(!1)) : a(!0);
1340
+ u && u.naturalWidth > 0 ? (a(!0), c(!1)) : a(!0);
1288
1341
  });
1289
1342
  }, 1e4), () => {
1290
- cancelAnimationFrame(h), window.clearInterval(v), window.clearTimeout(f), u && (u.removeEventListener("load", x), u.removeEventListener("error", F));
1343
+ cancelAnimationFrame(s), window.clearInterval(v), window.clearTimeout(m), u && (u.removeEventListener("load", S), u.removeEventListener("error", b));
1291
1344
  };
1292
- }, [t]), /* @__PURE__ */ z(Rt, { ...r, className: U("file-thumbnail", r.className), children: [
1293
- n ? /* @__PURE__ */ m(P, { icon: We(e) }) : /* @__PURE__ */ m(zt, { icon: "progress_activity" }),
1294
- /* @__PURE__ */ m(
1295
- Mt,
1345
+ }, [t]), /* @__PURE__ */ R(Pt, { ...r, className: U("file-thumbnail", r.className), children: [
1346
+ n ? /* @__PURE__ */ g(V, { icon: Ne(e) }) : /* @__PURE__ */ g(Wt, { icon: "progress_activity" }),
1347
+ /* @__PURE__ */ g(
1348
+ Ot,
1296
1349
  {
1297
- ref: c,
1350
+ ref: d,
1298
1351
  src: t,
1299
1352
  ...r,
1300
- onError: (s) => {
1301
- s.currentTarget === c.current && (a(!0), l(!0));
1353
+ onError: (i) => {
1354
+ i.currentTarget === d.current && (a(!0), c(!0));
1302
1355
  },
1303
- onLoad: (s) => {
1304
- s.currentTarget === c.current && (a(!0), l(!1));
1356
+ onLoad: (i) => {
1357
+ i.currentTarget === d.current && (a(!0), c(!1));
1305
1358
  },
1306
1359
  className: U({ hidden: !n || o })
1307
1360
  }
1308
1361
  )
1309
1362
  ] });
1310
- }, Lt = p.div`
1363
+ }, Vt = p.div`
1311
1364
  display: flex;
1312
1365
  align-items: center;
1313
1366
  overflow: hidden;
@@ -1374,7 +1427,7 @@ const ee = [], pt = (e) => {
1374
1427
  background-color: var(--md-sys-color-primary-container);
1375
1428
  }
1376
1429
  }
1377
- `, Pt = p.div`
1430
+ `, Bt = p.div`
1378
1431
  display: flex;
1379
1432
  flex-direction: column;
1380
1433
  flex: 1;
@@ -1399,15 +1452,15 @@ const ee = [], pt = (e) => {
1399
1452
  .name {
1400
1453
  color: var(--md-sys-color-outline);
1401
1454
  }
1402
- `, Wt = p.div`
1455
+ `, Ht = p.div`
1403
1456
  display: flex;
1404
1457
  align-items: center;
1405
1458
  gap: var(--base-gap-small);
1406
1459
 
1407
1460
  h4 {
1408
- ${Oe.titleSmall}
1461
+ ${$e.titleSmall}
1409
1462
  }
1410
- `, Ot = p(O)`
1463
+ `, _t = p(_)`
1411
1464
  /* hidden by default and show on card hover */
1412
1465
  display: none;
1413
1466
  .icon {
@@ -1419,78 +1472,78 @@ const ee = [], pt = (e) => {
1419
1472
  }
1420
1473
 
1421
1474
  margin: -2px;
1422
- `, It = p(Ut)`
1475
+ `, Qt = p(It)`
1423
1476
  width: 71px;
1424
1477
  height: 40px;
1425
1478
 
1426
1479
  border-radius: var(--border-radius-m);
1427
1480
 
1428
1481
  object-fit: cover;
1429
- `, Vt = p(P)`
1482
+ `, qt = p(V)`
1430
1483
  font-size: 25px;
1431
1484
 
1432
1485
  cursor: grab;
1433
1486
 
1434
1487
  /* default hidden */
1435
1488
  opacity: 0;
1436
- `, ur = q(
1489
+ `, yr = ee(
1437
1490
  ({
1438
1491
  availability: e,
1439
1492
  projectName: t,
1440
1493
  fileId: r,
1441
1494
  filename: o,
1442
- label: l,
1495
+ label: c,
1443
1496
  processing: n,
1444
1497
  mimetype: a,
1445
- isDragOverlay: c,
1446
- isDropPlaceholder: g,
1447
- isSelected: s,
1498
+ isDragOverlay: d,
1499
+ isDropPlaceholder: h,
1500
+ isSelected: i,
1448
1501
  isDragging: u,
1449
- dragProps: i = {},
1450
- sortingDisabled: h,
1502
+ dragProps: f = {},
1503
+ sortingDisabled: s,
1451
1504
  onEdit: v,
1452
- ...f
1505
+ ...m
1453
1506
  }, w) => {
1454
- const y = (i || c) && !h, x = e === "conversionRecommended", F = x && !!n;
1455
- let T = o;
1456
- x && (T = "Unoptimized - conversion recommended"), F && (T = "Unoptimized - queued for conversion");
1457
- let A = l;
1458
- return x && (A = o), /* @__PURE__ */ z(
1459
- Lt,
1507
+ const T = (f || d) && !s, S = e === "conversionRecommended", b = S && !!n;
1508
+ let k = o;
1509
+ S && (k = "Unoptimized - conversion recommended"), b && (k = "Unoptimized - queued for conversion");
1510
+ let C = c;
1511
+ return S && (C = o), /* @__PURE__ */ R(
1512
+ Vt,
1460
1513
  {
1461
1514
  id: r,
1462
1515
  ref: w,
1463
1516
  className: U({
1464
- draggable: y,
1465
- "drop-placeholder": g,
1466
- "drag-overlay": c,
1517
+ draggable: T,
1518
+ "drop-placeholder": h,
1519
+ "drag-overlay": d,
1467
1520
  dragging: u,
1468
1521
  // is anything dragging
1469
- selected: s,
1522
+ selected: i,
1470
1523
  editable: !!v
1471
1524
  }),
1472
- ...f,
1525
+ ...m,
1473
1526
  children: [
1474
- /* @__PURE__ */ m(
1475
- It,
1527
+ /* @__PURE__ */ g(
1528
+ Qt,
1476
1529
  {
1477
1530
  src: `/api/projects/${t}/files/${r}/thumbnail`,
1478
1531
  mimetype: a
1479
1532
  }
1480
1533
  ),
1481
- /* @__PURE__ */ z(Pt, { children: [
1482
- /* @__PURE__ */ z(Wt, { children: [
1483
- /* @__PURE__ */ m("h4", { children: A }),
1484
- !!v && /* @__PURE__ */ m(Ot, { icon: "edit", variant: "text", className: "edit", onClick: v })
1534
+ /* @__PURE__ */ R(Bt, { children: [
1535
+ /* @__PURE__ */ R(Ht, { children: [
1536
+ /* @__PURE__ */ g("h4", { children: C }),
1537
+ !!v && /* @__PURE__ */ g(_t, { icon: "edit", variant: "text", className: "edit", onClick: v })
1485
1538
  ] }),
1486
- /* @__PURE__ */ m("span", { className: "name", children: T })
1539
+ /* @__PURE__ */ g("span", { className: "name", children: k })
1487
1540
  ] }),
1488
- y && /* @__PURE__ */ m(Vt, { className: "handle", ...i, icon: "drag_indicator" })
1541
+ T && /* @__PURE__ */ g(qt, { className: "handle", ...f, icon: "drag_indicator" })
1489
1542
  ]
1490
1543
  }
1491
1544
  );
1492
1545
  }
1493
- ), Bt = pe`
1546
+ ), Gt = ye`
1494
1547
  from {
1495
1548
  transform: rotate(360deg);
1496
1549
  }
@@ -1499,7 +1552,7 @@ const ee = [], pt = (e) => {
1499
1552
  transform: rotate(0deg);
1500
1553
  }
1501
1554
 
1502
- `, Ht = p.div`
1555
+ `, Kt = p.div`
1503
1556
  position: relative;
1504
1557
  width: 100%;
1505
1558
  min-height: 50px;
@@ -1565,13 +1618,13 @@ const ee = [], pt = (e) => {
1565
1618
  & > * {
1566
1619
  z-index: 10;
1567
1620
  }
1568
- `, _t = p.div`
1621
+ `, Jt = p.div`
1569
1622
  position: absolute;
1570
1623
  inset: 0;
1571
1624
  background-color: var(--md-sys-color-primary-container);
1572
1625
  z-index: 0;
1573
1626
  transition: right 0.2s;
1574
- `, Qt = p.div`
1627
+ `, Zt = p.div`
1575
1628
  position: relative;
1576
1629
  width: 71px;
1577
1630
  height: 40px;
@@ -1590,7 +1643,7 @@ const ee = [], pt = (e) => {
1590
1643
 
1591
1644
  &.spinning {
1592
1645
  /* spin animation */
1593
- animation: ${Bt} 1s infinite linear;
1646
+ animation: ${Gt} 1s infinite linear;
1594
1647
  }
1595
1648
  }
1596
1649
 
@@ -1602,63 +1655,63 @@ const ee = [], pt = (e) => {
1602
1655
  object-fit: cover;
1603
1656
  opacity: 0.5;
1604
1657
  }
1605
- `, ne = ({
1658
+ `, ue = ({
1606
1659
  name: e,
1607
1660
  progress: t,
1608
1661
  size: r,
1609
1662
  type: o,
1610
- fileId: l,
1663
+ fileId: c,
1611
1664
  src: n,
1612
1665
  error: a,
1613
- tooltip: c,
1614
- onRemove: g,
1615
- ...s
1666
+ tooltip: d,
1667
+ onRemove: h,
1668
+ ...i
1616
1669
  }) => {
1617
- let u = "", i = !1, h = "";
1670
+ let u = "", f = !1, s = "";
1618
1671
  switch (o) {
1619
1672
  case "processing":
1620
- u = "Transcoding", i = !0, h = "settings";
1673
+ u = "Transcoding", f = !0, s = "settings";
1621
1674
  break;
1622
1675
  case "unsupported":
1623
- u = "Unsupported - conversion required", h = "visibility_off";
1676
+ u = "Unsupported - conversion required", s = "visibility_off";
1624
1677
  break;
1625
1678
  case "upload":
1626
- u = "Uploading", i = !0, h = "sync";
1679
+ u = "Uploading", f = !0, s = "sync";
1627
1680
  break;
1628
1681
  case "queued":
1629
- u = "Queued - waiting to be transcoded", h = "hourglass";
1682
+ u = "Queued - waiting to be transcoded", s = "hourglass";
1630
1683
  break;
1631
1684
  case "waiting":
1632
- u = "Waiting for upload", h = "schedule";
1685
+ u = "Waiting for upload", s = "schedule";
1633
1686
  break;
1634
1687
  case "importing":
1635
- u = "Importing", h = "upload_file";
1688
+ u = "Importing", s = "upload_file";
1636
1689
  break;
1637
1690
  case "validating":
1638
- u = "Validating", h = "checklist";
1691
+ u = "Validating", s = "checklist";
1639
1692
  break;
1640
1693
  }
1641
- a && (i = !1, h = "error");
1694
+ a && (f = !1, s = "error");
1642
1695
  const v = t !== void 0 ? `- ${t}%` : "";
1643
- return /* @__PURE__ */ z(
1644
- Ht,
1696
+ return /* @__PURE__ */ R(
1697
+ Kt,
1645
1698
  {
1646
1699
  className: U({ finished: t === 100, error: !!a, [o]: !0 }),
1647
- id: l,
1648
- ...s,
1700
+ id: c,
1701
+ ...i,
1649
1702
  children: [
1650
- /* @__PURE__ */ z(Qt, { children: [
1651
- n && /* @__PURE__ */ m("img", { src: n }),
1652
- h && /* @__PURE__ */ m(P, { icon: h, className: U({ spinning: i }) })
1703
+ /* @__PURE__ */ R(Zt, { children: [
1704
+ n && /* @__PURE__ */ g("img", { src: n }),
1705
+ s && /* @__PURE__ */ g(V, { icon: s, className: U({ spinning: f }) })
1653
1706
  ] }),
1654
- /* @__PURE__ */ z("span", { className: "content", children: [
1655
- /* @__PURE__ */ m("span", { className: "name", children: e }),
1656
- /* @__PURE__ */ m("span", { className: "message", children: a || `${u} ${v}` })
1707
+ /* @__PURE__ */ R("span", { className: "content", children: [
1708
+ /* @__PURE__ */ g("span", { className: "name", children: e }),
1709
+ /* @__PURE__ */ g("span", { className: "message", children: a || `${u} ${v}` })
1657
1710
  ] }),
1658
- r && /* @__PURE__ */ m("span", { className: "size", children: Ie(r) }),
1659
- c && /* @__PURE__ */ m(P, { icon: "info", className: "info", "data-tooltip": c, "data-tooltip-as": "markdown" }),
1660
- (a || o === "waiting") && /* @__PURE__ */ m(O, { icon: "close", variant: "text", onClick: g }),
1661
- /* @__PURE__ */ m(_t, { className: "progress", style: { right: `${100 - (t ?? 0)}%` } })
1711
+ r && /* @__PURE__ */ g("span", { className: "size", children: Me(r) }),
1712
+ d && /* @__PURE__ */ g(V, { icon: "info", className: "info", "data-tooltip": d, "data-tooltip-as": "markdown" }),
1713
+ (a || o === "waiting") && /* @__PURE__ */ g(_, { icon: "close", variant: "text", onClick: h }),
1714
+ /* @__PURE__ */ g(Jt, { className: "progress", style: { right: `${100 - (t ?? 0)}%` } })
1662
1715
  ]
1663
1716
  },
1664
1717
  e
@@ -1671,15 +1724,15 @@ p.div`
1671
1724
  min-height: 100%;
1672
1725
  padding-bottom: var(--padding-m);
1673
1726
  `;
1674
- const mr = p.div`
1727
+ const br = p.div`
1675
1728
  position: relative;
1676
1729
  overflow: hidden;
1677
1730
  border-radius: var(--border-radius-m);
1678
1731
  width: 100%;
1679
1732
  min-height: 50px;
1680
- `, gr = p.div`
1733
+ `, xr = p.div`
1681
1734
  word-break: break-all;
1682
- `, qt = p.div`
1735
+ `, Xt = p.div`
1683
1736
  display: flex;
1684
1737
  flex-direction: column;
1685
1738
  gap: var(--base-gap-small);
@@ -1696,7 +1749,7 @@ const mr = p.div`
1696
1749
  &.dragging {
1697
1750
  opacity: 0;
1698
1751
  }
1699
- `, Gt = p.div`
1752
+ `, Yt = p.div`
1700
1753
  position: relative;
1701
1754
  min-height: 50px;
1702
1755
  display: flex;
@@ -1725,7 +1778,7 @@ const mr = p.div`
1725
1778
  opacity: 0;
1726
1779
  cursor: pointer;
1727
1780
  }
1728
- `, Kt = p.div`
1781
+ `, eo = p.div`
1729
1782
  position: absolute;
1730
1783
  inset: var(--padding-s);
1731
1784
  background-color: var(--md-sys-color-surface-container-lowest);
@@ -1747,8 +1800,8 @@ const mr = p.div`
1747
1800
  .icon {
1748
1801
  font-size: 32px;
1749
1802
  }
1750
- `, ie = (e) => {
1751
- if (ge.isAxiosError(e)) {
1803
+ `, me = (e) => {
1804
+ if (we.isAxiosError(e)) {
1752
1805
  const t = e.response?.data;
1753
1806
  if (typeof t == "string" && t)
1754
1807
  return t;
@@ -1760,226 +1813,226 @@ const mr = p.div`
1760
1813
  return e.message || e.response?.statusText || "Unknown upload error";
1761
1814
  }
1762
1815
  return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown upload error";
1763
- }, Zt = ({
1816
+ }, to = ({
1764
1817
  projectName: e,
1765
1818
  versionId: t,
1766
1819
  taskId: r,
1767
1820
  folderId: o,
1768
- productId: l,
1821
+ productId: c,
1769
1822
  dispatch: n,
1770
1823
  onUpload: a,
1771
- onProgress: c
1824
+ onProgress: d
1772
1825
  }) => {
1773
- const [g, s] = L({}), u = Q(
1774
- (h) => {
1775
- t && s((v) => ({
1826
+ const [h, i] = O({}), u = Y(
1827
+ (s) => {
1828
+ t && i((v) => ({
1776
1829
  ...v,
1777
- [t]: v[t]?.filter((f) => f.name !== h) || []
1830
+ [t]: v[t]?.filter((m) => m.name !== s) || []
1778
1831
  }));
1779
1832
  },
1780
1833
  [t]
1781
1834
  );
1782
1835
  return {
1783
- handleFileUpload: Q(
1784
- async (h, v) => {
1785
- const f = v || t;
1786
- if (!f || !e) return;
1787
- const w = Array.from(h), y = w.map((k) => ({
1788
- name: I(k.name),
1789
- size: k.size,
1836
+ handleFileUpload: Y(
1837
+ async (s, v) => {
1838
+ const m = v || t;
1839
+ if (!m || !e) return;
1840
+ const w = Array.from(s), T = w.map((E) => ({
1841
+ name: Q(E.name),
1842
+ size: E.size,
1790
1843
  progress: 0
1791
- })), x = [...g[f] || [], ...y];
1792
- s({ ...g, [f]: x });
1793
- const F = (k) => (S) => {
1794
- if (!f) return;
1795
- console.log(`Upload successful for ${k.name}`);
1796
- const d = S.data;
1844
+ })), S = [...h[m] || [], ...T];
1845
+ i({ ...h, [m]: S });
1846
+ const b = (E) => (D) => {
1847
+ if (!m) return;
1848
+ console.log(`Upload successful for ${E.name}`);
1849
+ const l = D.data;
1797
1850
  e && (n(
1798
1851
  // @ts-ignore
1799
- Xe.util.updateQueryData(
1852
+ ot.util.updateQueryData(
1800
1853
  "getReviewablesForVersion",
1801
- { projectName: e, versionId: f },
1802
- (D) => {
1803
- D.reviewables || (D.reviewables = []), D.reviewables.push(d);
1854
+ { projectName: e, versionId: m },
1855
+ (N) => {
1856
+ N.reviewables || (N.reviewables = []), N.reviewables.push(l);
1804
1857
  }
1805
1858
  )
1806
- ), l && n(B.util.invalidateTags([{ type: "viewer", id: l }])), n(B.util.invalidateTags([{ type: "viewer", id: f }])), o && n(B.util.invalidateTags([{ type: "viewer", id: o }])), r && n(B.util.invalidateTags([{ type: "viewer", id: r }])), u(I(k.name)));
1807
- }, T = (k) => (S) => {
1808
- f && (console.error(`Upload failed for ${k.name}: ${S}`), s((d) => {
1809
- const N = (d[f] || []).map((C) => C.name !== I(k.name) ? C : {
1810
- ...C,
1811
- error: ie(S)
1859
+ ), c && n(K.util.invalidateTags([{ type: "viewer", id: c }])), n(K.util.invalidateTags([{ type: "viewer", id: m }])), o && n(K.util.invalidateTags([{ type: "viewer", id: o }])), r && n(K.util.invalidateTags([{ type: "viewer", id: r }])), u(Q(E.name)));
1860
+ }, k = (E) => (D) => {
1861
+ m && (console.error(`Upload failed for ${E.name}: ${D}`), i((l) => {
1862
+ const $ = (l[m] || []).map((z) => z.name !== Q(E.name) ? z : {
1863
+ ...z,
1864
+ error: me(D)
1812
1865
  });
1813
1866
  return {
1814
- ...d,
1815
- [f]: N
1867
+ ...l,
1868
+ [m]: $
1816
1869
  };
1817
1870
  }));
1818
- }, A = (k) => f ? (S) => s((d) => {
1819
- const N = (d[f] || []).map((b) => b.name !== I(k.name) ? b : {
1820
- ...b,
1821
- progress: S.total ? Math.round(S.loaded / S.total * 100) : 0
1822
- }), C = N.reduce(
1823
- (b, E) => b + (E.progress || 0),
1871
+ }, C = (E) => m ? (D) => i((l) => {
1872
+ const $ = (l[m] || []).map((y) => y.name !== Q(E.name) ? y : {
1873
+ ...y,
1874
+ progress: D.total ? Math.round(D.loaded / D.total * 100) : 0
1875
+ }), z = $.reduce(
1876
+ (y, j) => y + (j.progress || 0),
1824
1877
  0
1825
- ), $ = Math.round(C / N.length);
1826
- return c?.($), {
1827
- ...d,
1828
- [f]: N
1878
+ ), F = Math.round(z / $.length);
1879
+ return d?.(F), {
1880
+ ...l,
1881
+ [m]: $
1829
1882
  };
1830
1883
  }) : () => {
1831
1884
  };
1832
1885
  try {
1833
- const k = w.map((S) => {
1834
- const d = I(S.name), D = d.split(".").slice(0, -1).join(".") || "unnamed", N = `/api/projects/${e}/versions/${f}/reviewables?label=${D}`, C = { "content-type": S.type, "x-file-name": d };
1835
- return ge.post(N, S, { headers: C, onUploadProgress: A(S) }).then(F(S)).catch(($) => {
1836
- throw T(S)($), $;
1886
+ const E = w.map((D) => {
1887
+ const l = Q(D.name), N = l.split(".").slice(0, -1).join(".") || "unnamed", $ = `/api/projects/${e}/versions/${m}/reviewables?label=${N}`, z = { "content-type": D.type, "x-file-name": l };
1888
+ return we.post($, D, { headers: z, onUploadProgress: C(D) }).then(b(D)).catch((F) => {
1889
+ throw k(D)(F), F;
1837
1890
  });
1838
1891
  });
1839
- await Promise.all(k), a && a();
1840
- } catch (k) {
1841
- throw console.error(k), G.error(`Failed to upload file/s: ${ie(k)}`), k;
1892
+ await Promise.all(E), a && a();
1893
+ } catch (E) {
1894
+ throw console.error(E), te.error(`Failed to upload file/s: ${me(E)}`), E;
1842
1895
  }
1843
1896
  },
1844
1897
  [
1845
1898
  t,
1846
1899
  e,
1847
- g,
1900
+ h,
1848
1901
  n,
1849
- l,
1902
+ c,
1850
1903
  o,
1851
1904
  r,
1852
1905
  u,
1853
1906
  a,
1854
- c
1907
+ d
1855
1908
  ]
1856
1909
  ),
1857
1910
  handleRemoveUpload: u,
1858
- uploading: g
1911
+ uploading: h
1859
1912
  };
1860
- }, hr = ({
1913
+ }, wr = ({
1861
1914
  projectName: e,
1862
1915
  taskId: t,
1863
1916
  folderId: r,
1864
1917
  versionId: o,
1865
- productId: l,
1918
+ productId: c,
1866
1919
  onUpload: n,
1867
1920
  onFilesAdded: a,
1868
- children: c,
1869
- dispatch: g,
1870
- variant: s = "normal",
1921
+ children: d,
1922
+ dispatch: h,
1923
+ variant: i = "normal",
1871
1924
  pendingFiles: u = [],
1872
- setPendingFiles: i,
1873
- className: h,
1925
+ setPendingFiles: f,
1926
+ className: s,
1874
1927
  readOnly: v = !1,
1875
- pt: f,
1928
+ pt: m,
1876
1929
  ...w
1877
1930
  }) => {
1878
- const [y, x] = L(!1), {
1879
- handleFileUpload: F,
1880
- handleRemoveUpload: T,
1881
- uploading: A
1882
- } = Zt({
1931
+ const [T, S] = O(!1), {
1932
+ handleFileUpload: b,
1933
+ handleRemoveUpload: k,
1934
+ uploading: C
1935
+ } = to({
1883
1936
  projectName: e,
1884
1937
  versionId: o,
1885
1938
  taskId: t,
1886
1939
  folderId: r,
1887
- productId: l,
1888
- dispatch: g,
1940
+ productId: c,
1941
+ dispatch: h,
1889
1942
  onUpload: n
1890
- }), k = !!o;
1891
- V(() => {
1892
- if (k && o && u.length > 0 && i) {
1893
- const b = u.map((E) => E.file);
1894
- u.forEach((E) => {
1895
- E.preview && URL.revokeObjectURL(E.preview);
1896
- }), i([]), F(b);
1943
+ }), E = !!o;
1944
+ q(() => {
1945
+ if (E && o && u.length > 0 && f) {
1946
+ const y = u.map((j) => j.file);
1947
+ u.forEach((j) => {
1948
+ j.preview && URL.revokeObjectURL(j.preview);
1949
+ }), f([]), b(y);
1897
1950
  }
1898
- }, [k, o, u.length, F, i]);
1899
- const S = (b) => b.type.startsWith("image/"), d = (b) => b.map((E) => ({
1900
- file: E,
1901
- preview: S(E) ? URL.createObjectURL(E) : void 0
1902
- })), D = async (b) => {
1903
- const E = Array.from(b);
1904
- if (a?.(E), !k || !o) {
1905
- i && i((j) => [...j, ...d(E)]);
1951
+ }, [E, o, u.length, b, f]);
1952
+ const D = (y) => y.type.startsWith("image/"), l = (y) => y.map((j) => ({
1953
+ file: j,
1954
+ preview: D(j) ? URL.createObjectURL(j) : void 0
1955
+ })), N = async (y) => {
1956
+ const j = Array.from(y);
1957
+ if (a?.(j), !E || !o) {
1958
+ f && f((A) => [...A, ...l(j)]);
1906
1959
  return;
1907
1960
  }
1908
- await F(b);
1909
- }, N = (b) => {
1910
- const E = b.target.files;
1911
- E && D(E);
1912
- }, C = (b) => {
1913
- b.preventDefault(), x(!1);
1914
- const E = b.dataTransfer.files;
1915
- E && D(E);
1916
- }, $ = s === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
1917
- return /* @__PURE__ */ z(J, { children: [
1918
- /* @__PURE__ */ m(
1919
- qt,
1961
+ await b(y);
1962
+ }, $ = (y) => {
1963
+ const j = y.target.files;
1964
+ j && N(j);
1965
+ }, z = (y) => {
1966
+ y.preventDefault(), S(!1);
1967
+ const j = y.dataTransfer.files;
1968
+ j && N(j);
1969
+ }, F = i === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
1970
+ return /* @__PURE__ */ R(ae, { children: [
1971
+ /* @__PURE__ */ g(
1972
+ Xt,
1920
1973
  {
1921
- className: U(h, s, { dragging: y }),
1974
+ className: U(s, i, { dragging: T }),
1922
1975
  ...w,
1923
- onDragEnter: () => !v && x(!0),
1924
- onDragOver: (b) => b.preventDefault(),
1925
- onDrop: (b) => {
1926
- v && (b.preventDefault(), b.stopPropagation());
1976
+ onDragEnter: () => !v && S(!0),
1977
+ onDragOver: (y) => y.preventDefault(),
1978
+ onDrop: (y) => {
1979
+ v && (y.preventDefault(), y.stopPropagation());
1927
1980
  },
1928
- children: /* @__PURE__ */ z(J, { children: [
1929
- c,
1930
- !k && u?.map((b) => /* @__PURE__ */ m(
1931
- ne,
1981
+ children: /* @__PURE__ */ R(ae, { children: [
1982
+ d,
1983
+ !E && u?.map((y) => /* @__PURE__ */ g(
1984
+ ue,
1932
1985
  {
1933
- name: b.file.name,
1934
- size: b.file.size,
1935
- src: b.preview,
1986
+ name: y.file.name,
1987
+ size: y.file.size,
1988
+ src: y.preview,
1936
1989
  type: "waiting",
1937
1990
  onRemove: () => {
1938
- i && i((E) => E.filter((j) => j.file.name !== b.file.name));
1991
+ f && f((j) => j.filter((A) => A.file.name !== y.file.name));
1939
1992
  }
1940
1993
  },
1941
- b.file.name
1994
+ y.file.name
1942
1995
  )),
1943
- o && A[o]?.map((b) => /* @__PURE__ */ m(
1944
- ne,
1996
+ o && C[o]?.map((y) => /* @__PURE__ */ g(
1997
+ ue,
1945
1998
  {
1946
- ...b,
1999
+ ...y,
1947
2000
  type: "upload",
1948
- onRemove: () => T(b.name)
2001
+ onRemove: () => k(y.name)
1949
2002
  },
1950
- b.name
2003
+ y.name
1951
2004
  )),
1952
- !v && /* @__PURE__ */ z(
1953
- Gt,
2005
+ !v && /* @__PURE__ */ R(
2006
+ Yt,
1954
2007
  {
1955
2008
  id: "upload",
1956
- className: U("upload", s),
1957
- style: $,
1958
- ...f?.upload,
2009
+ className: U("upload", i),
2010
+ style: F,
2011
+ ...m?.upload,
1959
2012
  children: [
1960
- /* @__PURE__ */ m("span", { children: "Drop or click to upload" }),
1961
- /* @__PURE__ */ m("input", { type: "file", multiple: !0, onChange: N })
2013
+ /* @__PURE__ */ g("span", { children: "Drop or click to upload" }),
2014
+ /* @__PURE__ */ g("input", { type: "file", multiple: !0, onChange: $ })
1962
2015
  ]
1963
2016
  }
1964
2017
  )
1965
2018
  ] })
1966
2019
  }
1967
2020
  ),
1968
- y && !v && /* @__PURE__ */ z(
1969
- Kt,
2021
+ T && !v && /* @__PURE__ */ R(
2022
+ eo,
1970
2023
  {
1971
- onDragOver: (b) => b.preventDefault(),
1972
- onDragLeave: () => x(!1),
1973
- onDrop: C,
1974
- ...f?.dropzone,
2024
+ onDragOver: (y) => y.preventDefault(),
2025
+ onDragLeave: () => S(!1),
2026
+ onDrop: z,
2027
+ ...m?.dropzone,
1975
2028
  children: [
1976
- /* @__PURE__ */ m(P, { icon: "upload" }),
1977
- /* @__PURE__ */ m("span", { children: "Upload reviewable" })
2029
+ /* @__PURE__ */ g(V, { icon: "upload" }),
2030
+ /* @__PURE__ */ g("span", { children: "Upload reviewable" })
1978
2031
  ]
1979
2032
  }
1980
2033
  )
1981
2034
  ] });
1982
- }, fr = p.div`
2035
+ }, kr = p.div`
1983
2036
  position: relative;
1984
2037
  border-radius: var(--border-radius-m);
1985
2038
  display: flex;
@@ -1994,9 +2047,9 @@ const mr = p.div`
1994
2047
  }
1995
2048
 
1996
2049
  flex: 1;
1997
- `, vr = p.div`
2050
+ `, Er = p.div`
1998
2051
  position: relative;
1999
- `, yr = p.span`
2052
+ `, Sr = p.span`
2000
2053
  position: relative;
2001
2054
  padding: 0px 2px;
2002
2055
  border-radius: var(--border-radius-m);
@@ -2018,29 +2071,29 @@ const mr = p.div`
2018
2071
  color: var(--md-sys-color-on-surface);
2019
2072
  }
2020
2073
  }
2021
- `, br = p.span`
2074
+ `, Tr = p.span`
2022
2075
  text-overflow: ellipsis;
2023
2076
  overflow: hidden;
2024
2077
  display: inline-block;
2025
2078
  white-space: nowrap;
2026
- `, se = ue`
2079
+ `, ge = be`
2027
2080
  background-color: var(--md-sys-color-surface-container);
2028
2081
  &,
2029
2082
  .icon {
2030
2083
  color: var(--md-sys-color-on-surface);
2031
2084
  }
2032
- `, Jt = p.div`
2085
+ `, oo = p.div`
2033
2086
  & > span,
2034
2087
  & > li {
2035
2088
  cursor: pointer;
2036
2089
  &:hover {
2037
- ${se}
2090
+ ${ge}
2038
2091
  }
2039
2092
  }
2040
2093
 
2041
2094
  &.open {
2042
2095
  & > span {
2043
- ${se}
2096
+ ${ge}
2044
2097
  }
2045
2098
  }
2046
2099
 
@@ -2052,7 +2105,7 @@ const mr = p.div`
2052
2105
  }
2053
2106
  }
2054
2107
  }
2055
- `, xr = p.div`
2108
+ `, jr = p.div`
2056
2109
  position: absolute;
2057
2110
  top: 100%;
2058
2111
  left: 0px;
@@ -2061,7 +2114,7 @@ const mr = p.div`
2061
2114
 
2062
2115
  z-index: 200;
2063
2116
  padding-top: 4px;
2064
- `, wr = p.ul`
2117
+ `, Dr = p.ul`
2065
2118
  display: flex;
2066
2119
  flex-direction: column;
2067
2120
  gap: var(--base-gap-small);
@@ -2076,46 +2129,46 @@ const mr = p.div`
2076
2129
 
2077
2130
  max-height: 500px;
2078
2131
  overflow: auto;
2079
- `, kr = p.li`
2132
+ `, Fr = p.li`
2080
2133
  padding: var(--base-gap-small);
2081
2134
  border-radius: var(--border-radius-m);
2082
2135
  color: var(--md-sys-color-on-surface);
2083
2136
  min-width: max-content;
2084
2137
  width: 100%;
2085
- `, Er = q(
2086
- ({ children: e, segment: t, isOpen: r, scope: o, projectName: l, ...n }, a) => {
2087
- const { openSlideOut: c } = Z(), g = t?.type !== "product" && t?.type !== "project", s = () => {
2088
- if (!g) return;
2089
- const { type: v, id: f } = t || {};
2090
- !v || v === "project" || v === "product" || !f || c({
2138
+ `, Cr = ee(
2139
+ ({ children: e, segment: t, isOpen: r, scope: o, projectName: c, ...n }, a) => {
2140
+ const { openSlideOut: d } = re(), h = t?.type !== "product" && t?.type !== "project", i = () => {
2141
+ if (!h) return;
2142
+ const { type: v, id: m } = t || {};
2143
+ !v || v === "project" || v === "product" || !m || d({
2091
2144
  entityType: v,
2092
- entityId: f,
2093
- projectName: l
2145
+ entityId: m,
2146
+ projectName: c
2094
2147
  });
2095
2148
  }, u = (v) => [
2096
2149
  {
2097
2150
  label: `ID: ${v}`,
2098
2151
  icon: "content_copy",
2099
- command: () => K(v)
2152
+ command: () => oe(v)
2100
2153
  }
2101
- ], [i] = ct();
2102
- return /* @__PURE__ */ m(
2103
- Jt,
2154
+ ], [f] = mt();
2155
+ return /* @__PURE__ */ g(
2156
+ oo,
2104
2157
  {
2105
- onClick: s,
2158
+ onClick: i,
2106
2159
  onContextMenu: (v) => {
2107
2160
  if (!t) return;
2108
- const f = u(t.id);
2109
- i(v, f);
2161
+ const m = u(t.id);
2162
+ f(v, m);
2110
2163
  },
2111
- className: lt({ link: g, open: r }),
2164
+ className: ut({ link: h, open: r }),
2112
2165
  ...n,
2113
2166
  ref: a,
2114
2167
  children: e
2115
2168
  }
2116
2169
  );
2117
2170
  }
2118
- ), Xt = p.div`
2171
+ ), ro = p.div`
2119
2172
  position: relative;
2120
2173
  width: 100%;
2121
2174
  height: 52px;
@@ -2205,7 +2258,7 @@ const mr = p.div`
2205
2258
  border: none;
2206
2259
  border-color: transparent;
2207
2260
  }
2208
- `, Yt = p.img`
2261
+ `, ao = p.img`
2209
2262
  width: 100%;
2210
2263
  height: 100%;
2211
2264
  object-fit: contain;
@@ -2217,63 +2270,63 @@ const mr = p.div`
2217
2270
  inset: 0;
2218
2271
 
2219
2272
  transition: scale 0.2s, opacity 0.2s;
2220
- `, eo = ({
2273
+ `, no = ({
2221
2274
  projectName: e = "",
2222
2275
  entityType: t = "",
2223
2276
  entityId: r = "",
2224
2277
  icon: o,
2225
- color: l,
2278
+ color: c,
2226
2279
  thumbnailHash: n,
2227
2280
  isLoading: a,
2228
- shimmer: c,
2229
- className: g,
2230
- disabled: s,
2281
+ shimmer: d,
2282
+ className: h,
2283
+ disabled: i,
2231
2284
  src: u,
2232
- hoverIcon: i,
2233
- showBorder: h = !0,
2285
+ hoverIcon: f,
2286
+ showBorder: s = !0,
2234
2287
  ...v
2235
2288
  }) => {
2236
- const f = t === "project", w = ["product"].includes(t), y = f ? !!e : !!r;
2237
- let x = "";
2238
- t && (n || f) && y && (u ? x = u : x = dt({ projectName: e, entityType: t, entityId: r, thumbnailHash: n }) ?? "");
2239
- const [F, T] = L(!1), [A, k] = L(!1);
2240
- return V(() => {
2241
- if (x === "") {
2242
- k(!0), T(!0);
2289
+ const m = t === "project", w = ["product"].includes(t), T = m ? !!e : !!r;
2290
+ let S = "";
2291
+ t && (n || m) && T && (u ? S = u : S = gt({ projectName: e, entityType: t, entityId: r, thumbnailHash: n }) ?? "");
2292
+ const [b, k] = O(!1), [C, E] = O(!1);
2293
+ return q(() => {
2294
+ if (S === "") {
2295
+ E(!0), k(!0);
2243
2296
  return;
2244
2297
  }
2245
- k(!1), T(!1);
2246
- }, [x]), /* @__PURE__ */ z(
2247
- Xt,
2298
+ E(!1), k(!1);
2299
+ }, [S]), /* @__PURE__ */ R(
2300
+ ro,
2248
2301
  {
2249
- className: U(g, "thumbnail", {
2250
- loading: c && (a || !A),
2251
- loaded: A,
2252
- error: F,
2302
+ className: U(h, "thumbnail", {
2303
+ loading: d && (a || !C),
2304
+ loaded: C,
2305
+ error: b,
2253
2306
  clickable: !!v.onClick,
2254
- border: h
2307
+ border: s
2255
2308
  }),
2256
2309
  ...v,
2257
2310
  children: [
2258
- (!a || !A) && !s && /* @__PURE__ */ m(P, { style: { color: l || void 0 }, icon: o || "image", className: "type-icon" }),
2259
- t && e && !w && y && /* @__PURE__ */ m(
2260
- Yt,
2311
+ (!a || !C) && !i && /* @__PURE__ */ g(V, { style: { color: c || void 0 }, icon: o || "image", className: "type-icon" }),
2312
+ t && e && !w && T && /* @__PURE__ */ g(
2313
+ ao,
2261
2314
  {
2262
2315
  alt: `Entity thumbnail ${r || e}`,
2263
- src: x,
2316
+ src: S,
2264
2317
  onLoad: () => {
2265
- k(!0), T(!1);
2318
+ E(!0), k(!1);
2266
2319
  },
2267
2320
  onError: () => {
2268
- k(!0), T(!0);
2321
+ E(!0), k(!0);
2269
2322
  }
2270
2323
  }
2271
2324
  ),
2272
- i && /* @__PURE__ */ m(P, { icon: i, className: "hover-icon" })
2325
+ f && /* @__PURE__ */ g(V, { icon: f, className: "hover-icon" })
2273
2326
  ]
2274
2327
  }
2275
2328
  );
2276
- }, to = p.div`
2329
+ }, io = p.div`
2277
2330
  display: flex;
2278
2331
  z-index: 10;
2279
2332
  height: 100%;
@@ -2294,7 +2347,7 @@ const mr = p.div`
2294
2347
  font-size: 24px;
2295
2348
  }
2296
2349
 
2297
- ${({ $length: e }) => e > 1 && ue`
2350
+ ${({ $length: e }) => e > 1 && be`
2298
2351
  :not(:last-child) {
2299
2352
  box-shadow: 0 0 4px 0px black;
2300
2353
  }
@@ -2310,74 +2363,74 @@ const mr = p.div`
2310
2363
  object-fit: cover;
2311
2364
  }
2312
2365
  }
2313
- `, Tr = ({
2366
+ `, Ar = ({
2314
2367
  thumbnails: e = [],
2315
2368
  isLoading: t,
2316
2369
  className: r,
2317
2370
  style: o,
2318
- ...l
2371
+ ...c
2319
2372
  }) => {
2320
- const { onContextMenu: n } = Ee(rt);
2373
+ const { onContextMenu: n } = Se(st);
2321
2374
  e = e.slice(0, 5);
2322
2375
  const a = e.length > 1;
2323
- return e.length ? /* @__PURE__ */ m(
2324
- to,
2376
+ return e.length ? /* @__PURE__ */ g(
2377
+ io,
2325
2378
  {
2326
2379
  $length: e.length,
2327
2380
  className: U("stacked-thumbnails", r, { stacking: a }),
2328
2381
  children: e.map(
2329
- (c, g) => c ? /* @__PURE__ */ m(
2330
- eo,
2382
+ (d, h) => d ? /* @__PURE__ */ g(
2383
+ no,
2331
2384
  {
2332
- projectName: c.projectName,
2333
- entityType: c.type,
2334
- entityId: c.id,
2335
- icon: c.icon,
2336
- color: c.color,
2337
- style: { ...o, zIndex: -g },
2338
- thumbnailHash: c.thumbnailHash,
2385
+ projectName: d.projectName,
2386
+ entityType: d.type,
2387
+ entityId: d.id,
2388
+ icon: d.icon,
2389
+ color: d.color,
2390
+ style: { ...o, zIndex: -h },
2391
+ thumbnailHash: d.thumbnailHash,
2339
2392
  isLoading: t,
2340
- src: c.src,
2393
+ src: d.src,
2341
2394
  onContextMenu: n,
2342
- ...l
2395
+ ...c
2343
2396
  },
2344
- c.id || c.src || g
2397
+ d.id || d.src || h
2345
2398
  ) : null
2346
2399
  )
2347
2400
  }
2348
2401
  ) : null;
2349
- }, Sr = q(
2350
- ({ entities: e, entityType: t, onWatchersUpdate: r, userName: o, ...l }, n) => {
2351
- const a = e.map((i) => ({
2352
- entityId: i.id,
2402
+ }, Nr = ee(
2403
+ ({ entities: e, entityType: t, onWatchersUpdate: r, userName: o, ...c }, n) => {
2404
+ const a = e.map((f) => ({
2405
+ entityId: f.id,
2353
2406
  entityType: t,
2354
- projectName: i.projectName
2355
- })), { data: c = [] } = Ye(
2407
+ projectName: f.projectName
2408
+ })), { data: d = [] } = rt(
2356
2409
  {
2357
2410
  entities: a
2358
2411
  },
2359
2412
  { skip: !e.length }
2360
- ), g = Array.from(new Set(c.flatMap((i) => i.watchers))), [s] = et(), u = async (i) => {
2361
- const h = i.filter((w) => !g.includes(w)), v = g.filter((w) => !i.includes(w)), f = c.map((w) => {
2362
- const y = w.watchers.filter((x) => !v.includes(x));
2363
- return y.push(...h), {
2413
+ ), h = Array.from(new Set(d.flatMap((f) => f.watchers))), [i] = at(), u = async (f) => {
2414
+ const s = f.filter((w) => !h.includes(w)), v = h.filter((w) => !f.includes(w)), m = d.map((w) => {
2415
+ const T = w.watchers.filter((S) => !v.includes(S));
2416
+ return T.push(...s), {
2364
2417
  ...w,
2365
- watchers: y
2418
+ watchers: T
2366
2419
  };
2367
2420
  });
2368
2421
  try {
2369
- await s({ entities: f }).unwrap(), r && r(h, v);
2422
+ await i({ entities: m }).unwrap(), r && r(s, v);
2370
2423
  } catch {
2371
- G.error("Failed to update watchers");
2424
+ te.error("Failed to update watchers");
2372
2425
  }
2373
2426
  };
2374
- return /* @__PURE__ */ m(
2375
- Ve,
2427
+ return /* @__PURE__ */ g(
2428
+ ze,
2376
2429
  {
2377
2430
  align: "right",
2378
- ...l,
2379
- options: ze(l.options, g),
2380
- value: g,
2431
+ ...c,
2432
+ options: _e(c.options, h),
2433
+ value: h,
2381
2434
  currentUser: o,
2382
2435
  onChange: u,
2383
2436
  ref: n,
@@ -2387,54 +2440,54 @@ const mr = p.div`
2387
2440
  }
2388
2441
  );
2389
2442
  export {
2390
- Jo as A,
2391
- Ko as B,
2392
- cr as C,
2393
- lr as D,
2394
- or as E,
2395
- br as F,
2396
- Qo as G,
2397
- _o as H,
2398
- rr as I,
2399
- er as J,
2400
- tr as K,
2401
- mr as L,
2402
- xr as M,
2403
- ar as N,
2404
- qo as O,
2405
- pr as P,
2406
- Xo as Q,
2407
- ur as R,
2408
- yr as S,
2409
- Zo as T,
2410
- dr as U,
2411
- nr as V,
2412
- Sr as W,
2413
- Yo as X,
2414
- gr as a,
2415
- hr as b,
2416
- ne as c,
2417
- ir as d,
2418
- sr as e,
2419
- fr as f,
2420
- wr as g,
2421
- Er as h,
2422
- kr as i,
2423
- vr as j,
2424
- Bo as k,
2425
- mt as l,
2426
- yt as m,
2427
- Vo as n,
2428
- xt as o,
2429
- wt as p,
2430
- Ft as q,
2431
- At as r,
2432
- Ho as s,
2433
- he as t,
2434
- Zt as u,
2435
- Ut as v,
2436
- Tr as w,
2437
- eo as x,
2438
- bt as y,
2439
- Go as z
2443
+ rr as A,
2444
+ tr as B,
2445
+ hr as C,
2446
+ gr as D,
2447
+ lr as E,
2448
+ Tr as F,
2449
+ Xo as G,
2450
+ Zo as H,
2451
+ cr as I,
2452
+ ir as J,
2453
+ sr as K,
2454
+ br as L,
2455
+ jr as M,
2456
+ dr as N,
2457
+ Yo as O,
2458
+ vr as P,
2459
+ ar as Q,
2460
+ yr as R,
2461
+ Sr as S,
2462
+ or as T,
2463
+ fr as U,
2464
+ pr as V,
2465
+ Nr as W,
2466
+ nr as X,
2467
+ xr as a,
2468
+ wr as b,
2469
+ ue as c,
2470
+ ur as d,
2471
+ mr as e,
2472
+ kr as f,
2473
+ Dr as g,
2474
+ Cr as h,
2475
+ Fr as i,
2476
+ Er as j,
2477
+ Ko as k,
2478
+ vt as l,
2479
+ kt as m,
2480
+ Go as n,
2481
+ St as o,
2482
+ Tt as p,
2483
+ Mt as q,
2484
+ Rt as r,
2485
+ Jo as s,
2486
+ ke as t,
2487
+ to as u,
2488
+ It as v,
2489
+ Ar as w,
2490
+ no as x,
2491
+ Et as y,
2492
+ er as z
2440
2493
  };