@ynput/ayon-frontend-shared 0.7.0 → 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 (36) hide show
  1. package/dist/DetailsPanel.es.js +765 -739
  2. package/dist/ListTable.es.js +80 -80
  3. package/dist/NewEntity.es.js +2 -2
  4. package/dist/ProjectTreeTable.es.js +1424 -1409
  5. package/dist/Views.es.js +572 -570
  6. package/dist/api.es.js +300 -298
  7. package/dist/chunks/Actions.es.js +5 -5
  8. package/dist/chunks/DetailsDialog.es.js +3 -3
  9. package/dist/chunks/EntityPath.es.js +14 -14
  10. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  11. package/dist/chunks/EntityTooltip.es.js +18 -18
  12. package/dist/chunks/Feed.es.js +2 -2
  13. package/dist/chunks/MetaWidget.es.js +2422 -2149
  14. package/dist/chunks/PlayableIcon.es.js +20 -20
  15. package/dist/chunks/ProjectContext.es.js +6 -6
  16. package/dist/chunks/RepresentationsList.es.js +1 -1
  17. package/dist/chunks/ReviewablesSelector.es.js +2 -2
  18. package/dist/chunks/Slicer.es.js +2 -2
  19. package/dist/chunks/TableExportContextInstance.es.js +1 -1
  20. package/dist/chunks/ThumbnailSimple.es.js +12 -12
  21. package/dist/chunks/Watchers.es.js +907 -855
  22. package/dist/chunks/getUris.es.js +1272 -1209
  23. package/dist/chunks/searchTerms.es.js +30 -66
  24. package/dist/chunks/useAttributeEnums.es.js +37 -37
  25. package/dist/chunks/viewUpdateHelper.es.js +10 -10
  26. package/dist/components.es.js +132 -131
  27. package/dist/context.es.js +76 -76
  28. package/dist/hooks.es.js +51 -50
  29. package/dist/types/ProjectTreeTable.d.ts +21 -1
  30. package/dist/types/Slicer.d.ts +6 -4
  31. package/dist/types/Views.d.ts +4 -0
  32. package/dist/types/api.d.ts +411 -438
  33. package/dist/types/components.d.ts +22 -0
  34. package/dist/types/context.d.ts +2 -0
  35. package/dist/types/hooks.d.ts +36 -1
  36. package/package.json +3 -3
@@ -1,67 +1,67 @@
1
- import { jsxs as k, jsx as i, Fragment as Ie } from "react/jsx-runtime";
2
- import { Toolbar as ze, Panel as vt, Button as Z, Spacer as Ge, Icon as fe, getTextColor as Ee, Dialog as yt, SEARCH_FILTER_ID as Qe, buildFilterId as Se, getFilterFromId as kt, SearchFilter as wt, AssigneeField as xt } from "@ynput/ayon-react-components";
3
- import { useEffect as H, useRef as ee, useMemo as D, useState as J, useContext as St, useId as Ct } from "react";
4
- import T, { keyframes as Tt } from "styled-components";
5
- import { bz as Nt, bH as Et } from "./chunks/searchTerms.es.js";
6
- import { bp as Dt, bN as It, c2 as Pt, cy as qe, bx as Ke, v as Ft, bR as At, cd as Ot } from "./chunks/getUris.es.js";
1
+ import { jsxs as k, jsx as i, Fragment as xe } from "react/jsx-runtime";
2
+ import { Toolbar as Qe, Panel as yt, Button as Y, Spacer as qe, Icon as we, getMixedCounts as Me, getTextColor as Fe, applyMixedChange as kt, Dialog as wt, SEARCH_FILTER_ID as Ke, buildFilterId as Ee, getFilterFromId as xt, SearchFilter as St, AssigneeField as Ct } from "@ynput/ayon-react-components";
3
+ import { useEffect as B, useRef as Z, useMemo as C, useState as X, useContext as Tt, useId as Nt } from "react";
4
+ import T, { keyframes as Et } from "styled-components";
5
+ import { bz as Dt, bH as It } from "./chunks/searchTerms.es.js";
6
+ import { bq as Pt, bO as Ft, c3 as At, cz as Je, by as Xe, v as Ot, bS as jt, ce as Rt } from "./chunks/getUris.es.js";
7
7
  import "primereact/confirmdialog";
8
- import { o as Rt, y as jt, H as Vt, G as Ut, z as $t, w as Je, A as Lt, B as _t, E as Mt, I as Ht, J as Bt, K as Wt, N as zt, W as Gt, s as Qt } from "./chunks/Watchers.es.js";
9
- import { O as Ca, Q as Ta, V as Na, X as Ea, T as Da } from "./chunks/Watchers.es.js";
10
- import { E as qt, R as Kt, a as Jt } from "./chunks/EntityPath.es.js";
11
- import { union as ue, upperFirst as Xe } from "lodash";
8
+ import { o as Vt, y as $t, H as Lt, G as Ut, z as _t, w as Ye, A as Mt, B as Ht, E as Bt, I as Wt, J as zt, K as Gt, N as Qt, W as qt, s as Kt } from "./chunks/Watchers.es.js";
9
+ import { O as Da, Q as Ia, V as Pa, X as Fa, T as Aa } from "./chunks/Watchers.es.js";
10
+ import { E as Jt, R as Xt, a as Yt } from "./chunks/EntityPath.es.js";
11
+ import { union as ue, upperFirst as Ze } from "lodash";
12
12
  import "react-toastify";
13
13
  import "uuid";
14
- import { a as Xt, b as Yt, A as _e, e as Zt } from "./chunks/activeEntities.es.js";
14
+ import { a as Zt, b as es, A as He, e as ts } from "./chunks/activeEntities.es.js";
15
15
  import "@module-federation/enhanced/runtime";
16
- import { o as q, u as en, T as tn, a8 as nn, a2 as sn, aa as an, G as on, a9 as rn, Z as ln } from "./chunks/TableExportContextInstance.es.js";
16
+ import { o as K, u as ss, T as ns, a8 as as, a2 as os, aa as is, G as rs, a9 as ls, Z as cs } from "./chunks/TableExportContextInstance.es.js";
17
17
  import "semver";
18
- import { T as cn, P as Ye } from "./chunks/ProjectContext.es.js";
18
+ import { T as ds, P as et } from "./chunks/ProjectContext.es.js";
19
19
  import "react-dom";
20
20
  import "react-redux";
21
21
  import "react-router-dom";
22
- import ie from "clsx";
23
- import { A as dn } from "./chunks/Actions.es.js";
22
+ import le from "clsx";
23
+ import { A as us } from "./chunks/Actions.es.js";
24
+ import { f as ps, k as hs, r as ms, m as gs } from "./chunks/MetaWidget.es.js";
24
25
  import "./chunks/ContextMenuContextInstance.es.js";
25
- import { g as Ce } from "./chunks/getEntityTypeIcon.es.js";
26
- import { _ as un } from "./chunks/PlayableIcon.es.js";
27
- import { R as pn } from "./chunks/RepresentationsList.es.js";
28
- import { I as hn } from "./chunks/InfoMessage.es.js";
29
- import { M as mn, a as gn } from "./chunks/Menu.es.js";
30
- import { D as fn } from "./chunks/DetailsDialog.es.js";
31
- import { u as bn } from "./chunks/VersionUploadContextInstance.es.js";
32
- import { p as vn } from "./chunks/pluralize.es.js";
33
- import { c as yn } from "./chunks/copyToClipboard.es.js";
34
- import { u as kn } from "./chunks/useQueryArgumentChangeLoading.es.js";
35
- import { d as Ze, c as wn } from "./chunks/Feed.es.js";
36
- import { A as xn, C as Sn } from "./chunks/ThumbnailSimple.es.js";
37
- import { o as Cn, k as Tn } from "./chunks/MetaWidget.es.js";
38
- import { t as Nn, c as En } from "./chunks/queryFilterToClientFilter.es.js";
39
- import { u as Dn } from "./chunks/useDateRangeFilter.es.js";
40
- import { e as In } from "./chunks/expandRelativeDates.es.js";
26
+ import { g as De } from "./chunks/getEntityTypeIcon.es.js";
27
+ import { _ as fs } from "./chunks/PlayableIcon.es.js";
28
+ import { R as bs } from "./chunks/RepresentationsList.es.js";
29
+ import { I as vs } from "./chunks/InfoMessage.es.js";
30
+ import { M as ys, a as ks } from "./chunks/Menu.es.js";
31
+ import { D as ws } from "./chunks/DetailsDialog.es.js";
32
+ import { u as xs } from "./chunks/VersionUploadContextInstance.es.js";
33
+ import { p as Ss } from "./chunks/pluralize.es.js";
34
+ import { c as Cs } from "./chunks/copyToClipboard.es.js";
35
+ import { u as Ts } from "./chunks/useQueryArgumentChangeLoading.es.js";
36
+ import { d as tt, c as Ns } from "./chunks/Feed.es.js";
37
+ import { A as Es, C as Ds } from "./chunks/ThumbnailSimple.es.js";
38
+ import { t as Is, c as Ps } from "./chunks/queryFilterToClientFilter.es.js";
39
+ import { u as Fs } from "./chunks/useDateRangeFilter.es.js";
40
+ import { e as As } from "./chunks/expandRelativeDates.es.js";
41
41
  import "axios";
42
42
  import "@dnd-kit/core";
43
43
  import "@dnd-kit/sortable";
44
44
  import "@dnd-kit/utilities";
45
45
  import "custom-protocol-check";
46
46
  import "./chunks/SimpleForm.es.js";
47
- import { Dialog as Pn } from "primereact/dialog";
48
- function Fn({
47
+ import { Dialog as Os } from "primereact/dialog";
48
+ function js({
49
49
  entityData: e,
50
- project: n,
50
+ project: s,
51
51
  activeEntityType: t,
52
52
  entitiesToQuery: o = []
53
53
  }) {
54
- H(() => {
55
- if (!e?.parents || !n) return;
56
- const s = new URL(window.location.href), a = s.searchParams;
57
- a.set("project", n), t && a.set("type", t);
58
- const r = (o || []).filter((f) => f.projectName === n).map((f) => f.id).filter(Boolean)[0];
54
+ B(() => {
55
+ if (!e?.parents || !s) return;
56
+ const n = new URL(window.location.href), a = n.searchParams;
57
+ a.set("project", s), t && a.set("type", t);
58
+ const r = (o || []).filter((f) => f.projectName === s).map((f) => f.id).filter(Boolean)[0];
59
59
  r && a.set("id", r);
60
- const c = `${s.pathname}?${a.toString()}${s.hash}`, m = `${window.location.pathname}${window.location.search}${window.location.hash}`;
60
+ const c = `${n.pathname}?${a.toString()}${n.hash}`, m = `${window.location.pathname}${window.location.search}${window.location.hash}`;
61
61
  c !== m && window.history.replaceState(window.history.state, "", c);
62
- }, [e, n, t, o]);
62
+ }, [e, s, t, o]);
63
63
  }
64
- const An = T(ze)`
64
+ const Rs = T(Qe)`
65
65
  display: flex;
66
66
  justify-content: space-between;
67
67
  align-items: flex-start;
@@ -73,7 +73,7 @@ const An = T(ze)`
73
73
  & > * {
74
74
  min-width: max-content;
75
75
  }
76
- `, On = T.div`
76
+ `, Vs = T.div`
77
77
  display: flex;
78
78
  align-items: flex-start;
79
79
  gap: 4px;
@@ -82,31 +82,31 @@ const An = T(ze)`
82
82
  right: 0;
83
83
  padding: var(--padding-m);
84
84
  background-color: var(--md-sys-color-surface-container-low);
85
- `, Rn = T(vt)`
85
+ `, $s = T(yt)`
86
86
  gap: 0px;
87
87
  height: 100%;
88
88
  padding: 0px;
89
89
  box-shadow: -2px 0 6px #00000047;
90
90
  z-index: 300;
91
- `, jn = T(ze)`
91
+ `, Ls = T(Qe)`
92
92
  border-radius: 8px 8px 0 0;
93
93
  gap: var(--base-gap-small) !important;
94
94
  position: relative;
95
95
  z-index: 100;
96
96
  grid-column: span 2;
97
- `, Vn = ["product", "representation"], Un = ["task"], $n = ({
97
+ `, Us = ["product", "representation"], _s = ["task"], Ms = ({
98
98
  entityType: e,
99
- currentTab: n,
99
+ currentTab: s,
100
100
  onTabChange: t,
101
101
  isLoading: o
102
102
  }) => {
103
- const s = !Vn.includes(e), a = Un.includes(e);
104
- return /* @__PURE__ */ k(jn, { className: o ? "loading" : "", children: [
105
- s && /* @__PURE__ */ i(
106
- Z,
103
+ const n = !Us.includes(e), a = _s.includes(e);
104
+ return /* @__PURE__ */ k(Ls, { className: o ? "loading" : "", children: [
105
+ n && /* @__PURE__ */ i(
106
+ Y,
107
107
  {
108
108
  icon: "forum",
109
- selected: n === "feed",
109
+ selected: s === "feed",
110
110
  onClick: () => t("feed"),
111
111
  "data-tooltip": "Activity Feed",
112
112
  "data-tooltip-delay": 0,
@@ -114,45 +114,45 @@ const An = T(ze)`
114
114
  }
115
115
  ),
116
116
  a && /* @__PURE__ */ i(
117
- Z,
117
+ Y,
118
118
  {
119
119
  icon: "checklist",
120
- selected: n === "subtasks",
120
+ selected: s === "subtasks",
121
121
  onClick: () => t("subtasks"),
122
122
  "data-tooltip": "Subtasks",
123
123
  "data-tooltip-delay": 0,
124
124
  variant: "text"
125
125
  }
126
126
  ),
127
- /* @__PURE__ */ i(Ge, {}),
127
+ /* @__PURE__ */ i(qe, {}),
128
128
  e === "version" && /* @__PURE__ */ i(
129
- Z,
129
+ Y,
130
130
  {
131
131
  icon: "order_play",
132
132
  onClick: () => t("files"),
133
- selected: n === "files",
133
+ selected: s === "files",
134
134
  "data-tooltip": "Version files",
135
135
  "data-tooltip-delay": 0,
136
136
  variant: "text"
137
137
  }
138
138
  ),
139
139
  /* @__PURE__ */ i(
140
- Z,
140
+ Y,
141
141
  {
142
142
  onClick: () => t("details"),
143
- selected: n === "details",
143
+ selected: s === "details",
144
144
  style: { padding: "6px 8px" },
145
145
  variant: "text",
146
146
  children: "Details"
147
147
  }
148
148
  )
149
149
  ] });
150
- }, Ln = T.div`
150
+ }, Hs = T.div`
151
151
  display: flex;
152
152
  align-items: center;
153
153
  gap: var(--base-gap-small);
154
154
  overflow: hidden;
155
- `, _n = T.button`
155
+ `, Bs = T.button`
156
156
  display: inline-flex;
157
157
  align-items: center;
158
158
  gap: var(--base-gap-small);
@@ -174,56 +174,56 @@ const An = T(ze)`
174
174
  text-overflow: ellipsis;
175
175
  white-space: nowrap;
176
176
  }
177
- `, Mn = ({ entity: e, taskTypes: n }) => {
178
- const { openSlideOut: t } = q(), { projectName: o } = e, s = e.task?.name ? e.task : void 0;
179
- if (!s?.id) return null;
180
- const a = n.find((r) => r.name === s.taskType);
181
- return /* @__PURE__ */ k(Ln, { className: "linked-task", children: [
177
+ `, Ws = ({ entity: e, taskTypes: s }) => {
178
+ const { openSlideOut: t } = K(), { projectName: o } = e, n = e.task?.name ? e.task : void 0;
179
+ if (!n?.id) return null;
180
+ const a = s.find((r) => r.name === n.taskType);
181
+ return /* @__PURE__ */ k(Hs, { className: "linked-task", children: [
182
182
  /* @__PURE__ */ i("span", { children: "Task" }),
183
183
  /* @__PURE__ */ k(
184
- _n,
184
+ Bs,
185
185
  {
186
- onClick: () => t({ entityId: s.id, entityType: "task", projectName: o }),
186
+ onClick: () => t({ entityId: n.id, entityType: "task", projectName: o }),
187
187
  children: [
188
- /* @__PURE__ */ i(fe, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
189
- /* @__PURE__ */ i("span", { className: "label", children: s.label || s.name })
188
+ /* @__PURE__ */ i(we, { icon: a?.icon || "task_alt", style: { color: a?.color || void 0 } }),
189
+ /* @__PURE__ */ i("span", { className: "label", children: n.label || n.name })
190
190
  ]
191
191
  }
192
192
  )
193
193
  ] });
194
- }, et = (e, n, t) => {
194
+ }, st = (e, s, t) => {
195
195
  if (!e[0]) return [];
196
- if (n === "representation") return [{ icon: "view_in_ar" }];
197
- const o = (s) => {
198
- switch (n) {
196
+ if (s === "representation") return [{ icon: "view_in_ar" }];
197
+ const o = (n) => {
198
+ switch (s) {
199
199
  case "folder":
200
- return s.folder?.folderType ? t.folder[s.folder.folderType] : Ce("folder");
200
+ return n.folder?.folderType ? t.folder[n.folder.folderType] : De("folder");
201
201
  case "task":
202
- return s.task?.taskType ? t.task[s.task.taskType] : Ce("task");
202
+ return n.task?.taskType ? t.task[n.task.taskType] : De("task");
203
203
  case "version":
204
- return s.product?.productType ? t.product[s.product.productType] : Ce("version");
204
+ return n.product?.productType ? t.product[n.product.productType] : De("version");
205
205
  }
206
206
  };
207
- return e.slice(0, 6).map((s) => ({
208
- icon: o(s),
209
- id: s.id,
210
- type: n,
211
- thumbnailHash: s.thumbnailHash,
212
- projectName: s.projectName
207
+ return e.slice(0, 6).map((n) => ({
208
+ icon: o(n),
209
+ id: n.id,
210
+ type: s,
211
+ thumbnailHash: n.thumbnailHash,
212
+ projectName: n.projectName
213
213
  }));
214
- }, Te = (e) => e.filter((n) => !!n.icon).reduce((n, t) => ({ ...n, [t.name]: t.icon }), {}), tt = (e) => ({
215
- task: Te(e.taskTypes),
216
- folder: Te(e.folderTypes),
217
- product: Te(e.productTypes)
218
- }), nt = (e, n) => {
214
+ }, Ie = (e) => e.filter((s) => !!s.icon).reduce((s, t) => ({ ...s, [t.name]: t.icon }), {}), nt = (e) => ({
215
+ task: Ie(e.taskTypes),
216
+ folder: Ie(e.folderTypes),
217
+ product: Ie(e.productTypes)
218
+ }), at = (e, s) => {
219
219
  const t = e.length > 1, o = e[0];
220
220
  if (t)
221
221
  return {
222
- title: `${e.length} ${n}s`,
223
- subTitle: e.map((s) => s.name).join(", ")
222
+ title: `${e.length} ${s}s`,
223
+ subTitle: e.map((n) => n.name).join(", ")
224
224
  };
225
225
  if (!o) return { title: "loading...", subTitle: "loading..." };
226
- switch (n) {
226
+ switch (s) {
227
227
  case "folder":
228
228
  return {
229
229
  title: o.label || o.name || "Unknown Folder",
@@ -250,12 +250,12 @@ const An = T(ze)`
250
250
  subTitle: o.entityType || "Unknown Type"
251
251
  };
252
252
  }
253
- }, Hn = ({
253
+ }, zs = ({
254
254
  entityType: e,
255
- entitySubTypes: n,
255
+ entitySubTypes: s,
256
256
  entities: t = [],
257
257
  disabledAssignees: o = [],
258
- users: s = [],
258
+ users: n = [],
259
259
  disabledStatuses: a,
260
260
  tagsOptions: r = [],
261
261
  isFetching: c,
@@ -265,20 +265,20 @@ const An = T(ze)`
265
265
  projectInfo: g,
266
266
  onOpenViewer: b,
267
267
  onEntityFocus: x,
268
- thumbnailInputRef: R,
269
- versionsInputRef: j
268
+ thumbnailInputRef: $,
269
+ versionsInputRef: U
270
270
  }) => {
271
- const { useSearchParams: P, useNavigate: d, bundleMode: u } = q(), h = d(), [N, A] = P(), E = ee(null), y = D(() => tt(g), [g]), w = Rt(
271
+ const { useSearchParams: A, useNavigate: d, bundleMode: u } = K(), h = d(), [N, j] = A(), E = Z(null), y = C(() => nt(g), [g]), w = Vt(
272
272
  t.map((l) => l.projectName),
273
273
  [e]
274
- ), O = D(() => e === "task" ? ue(...t.map((l) => l.task?.assignees || [])) : e === "version" ? ue(
274
+ ), R = C(() => e === "task" ? ue(...t.map((l) => l.task?.assignees || [])) : e === "version" ? ue(
275
275
  ...t.map((l) => {
276
- const C = l.version?.author;
277
- return Array.isArray(C) ? C : C ? [C] : [];
276
+ const S = l.version?.author;
277
+ return Array.isArray(S) ? S : S ? [S] : [];
278
278
  })
279
279
  ) : [], [t, e]);
280
280
  let V = t[0];
281
- const L = t.length === 0 || !V || c;
281
+ const M = t.length === 0 || !V || c;
282
282
  V || (V = {
283
283
  parents: [],
284
284
  id: "placeholder",
@@ -294,87 +294,109 @@ const An = T(ze)`
294
294
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
295
295
  path: ""
296
296
  });
297
- const te = t.length > 1 ? void 0 : V?.projectName;
297
+ const ee = t.length > 1 ? void 0 : V?.projectName;
298
298
  t.filter((l) => l.projectName === V?.projectName && l.id).map((l) => l.id);
299
- const { data: ne } = Dt({ attributeName: "priority" }), se = Xt(ne, e), ae = D(
300
- () => et(t, e, y),
299
+ const { data: te } = Pt({ attributeName: "priority" }), se = Zt(te, e), ne = C(
300
+ () => st(t, e, y),
301
301
  [t, e, y]
302
- ), I = D(() => t.map((l) => l.status), [t]), oe = D(() => t.map((l) => l.attrib?.priority), [t]), X = D(() => t.map((l) => l.tags), [t]), re = D(
303
- () => r.reduce((l, C) => (l[C.name] = C, l), {}),
302
+ ), P = C(() => t.map((l) => l.status), [t]), ae = C(() => t.map((l) => l.attrib?.priority), [t]), W = C(() => t.map((l) => l.tags), [t]), ce = C(
303
+ () => r.reduce((l, S) => (l[S.name] = S, l), {}),
304
304
  [r]
305
- ), K = t.length > 1, le = !K && !!V?.hasReviewables, $ = ae.length === 1, { attribAccess: U, updateEntity: ce } = jt({
305
+ ), oe = C(() => ue(...W), [W]), pe = t.every((l) => l.projectName === V?.projectName), L = ps(
306
+ pe ? V?.projectName : void 0,
307
+ r
308
+ ), F = t.length > 1, de = C(() => Me(W), [W]), he = C(
309
+ () => Me(t.map((l) => l.task?.assignees || [])),
310
+ [t]
311
+ ), ve = !F && !!V?.hasReviewables, ye = ne.length === 1, { attribAccess: D, updateEntity: me } = $t({
306
312
  entities: t,
307
313
  entityType: e
308
- }), { writableFields: B } = U, be = !B || B.includes("status"), he = !B || B.includes("tags"), S = e === "task" && (!B || B.includes("assignees")), Y = (l, C) => {
309
- if (!(l !== "attrib" && B && !B.includes(l)) && !(l === "assignees" && !S))
310
- return C == null ? console.error("value is null or undefined") : ce(l, C);
311
- }, ve = () => {
312
- let l, C = V.id, z = e + "Id";
313
- e === "version" && V.product?.id && (l = [V.id], C = V.product?.id, z = "productId"), C && b({
314
- [z]: C,
315
- projectName: te,
314
+ }), { writableFields: G } = D, Se = !G || G.includes("status"), J = !G || G.includes("tags"), ie = e === "task" && (!G || G.includes("assignees")), re = (l, S) => {
315
+ if (!(l !== "attrib" && G && !G.includes(l)) && !(l === "assignees" && !ie))
316
+ return S == null ? console.error("value is null or undefined") : me(l, S);
317
+ }, z = (l, S) => {
318
+ const I = new Map(
319
+ t.map((q) => [q.id, (l === "tags" ? q.tags : q.task?.assignees) || []])
320
+ );
321
+ l === "tags" && L?.addTags(S.add), re(l, (q) => kt(I.get(q) || [], S));
322
+ }, _ = () => {
323
+ let l, S = V.id, I = e + "Id";
324
+ e === "version" && V.product?.id && (l = [V.id], S = V.product?.id, I = "productId"), S && b({
325
+ [I]: S,
326
+ projectName: ee,
316
327
  versionIds: l
317
328
  });
318
- }, me = (e === "task" || e === "version") && (O.length > 0 || e === "task"), Q = [...Nt(s, O)];
319
- if (me) {
320
- const l = s.map((z) => z.name), C = O.filter((z) => !l.includes(z));
321
- C.length && Q.push(...C.map((z) => ({ name: z, fullName: z })));
329
+ }, Q = (e === "task" || e === "version") && (R.length > 0 || e === "task"), ke = [...Dt(n, R)];
330
+ if (Q) {
331
+ const l = n.map((I) => I.name), S = R.filter((I) => !l.includes(I));
332
+ S.length && ke.push(...S.map((I) => ({ name: I, fullName: I })));
322
333
  }
323
- const { title: de, subTitle: ye } = nt(t, e), W = w?.length !== 0 && w?.find((l) => l.name === I[0]);
324
- return /* @__PURE__ */ i(Vt, { children: /* @__PURE__ */ i(
325
- qt,
334
+ const { title: Ce, subTitle: ge } = at(t, e), fe = w?.length !== 0 && w?.find((l) => l.name === P[0]);
335
+ return /* @__PURE__ */ i(Lt, { children: /* @__PURE__ */ i(
336
+ Jt,
326
337
  {
327
338
  entities: t,
328
339
  entityType: e,
329
- projectName: te,
330
- thumbnailInputRef: R,
331
- versionsInputRef: j,
340
+ projectName: ee,
341
+ thumbnailInputRef: $,
342
+ versionsInputRef: U,
332
343
  onVersionCreated: (l) => x?.(l, "version"),
333
- children: /* @__PURE__ */ k(Ut, { className: ie("details-panel-header", { isCompact: m }), children: [
344
+ children: /* @__PURE__ */ k(Ut, { className: le("details-panel-header", { isCompact: m }), children: [
334
345
  /* @__PURE__ */ k(
335
- $t,
346
+ _t,
336
347
  {
337
- className: ie("titles", { isCompact: m, loading: L }, "no-shimmer"),
348
+ className: le("titles", { isCompact: m, loading: M }, "no-shimmer"),
338
349
  children: [
339
350
  /* @__PURE__ */ k("div", { style: { position: "relative" }, children: [
340
351
  /* @__PURE__ */ i(
341
- Je,
352
+ Ye,
342
353
  {
343
- isLoading: L,
344
- shimmer: L,
345
- thumbnails: ae,
346
- onClick: $ ? ve : void 0,
347
- hoverIcon: le ? "play_circle" : void 0
354
+ isLoading: M,
355
+ shimmer: M,
356
+ thumbnails: ne,
357
+ onClick: ye ? _ : void 0,
358
+ hoverIcon: ve ? "play_circle" : void 0
348
359
  }
349
360
  ),
350
- le && /* @__PURE__ */ i(un, {})
361
+ ve && /* @__PURE__ */ i(fs, {})
351
362
  ] }),
352
- /* @__PURE__ */ k(Lt, { className: ie({ loading: L }), children: [
353
- /* @__PURE__ */ k(_t, { children: [
354
- /* @__PURE__ */ i("h2", { children: de }),
355
- he ? /* @__PURE__ */ i(
356
- Mt,
357
- {
358
- ref: E,
359
- value: ue(...X),
360
- tags: re,
361
- options: [],
362
- editable: !0,
363
- editor: !0,
364
- onChange: (l) => Y("tags", l),
365
- align: "right",
366
- styleDropdown: { display: L ? "none" : "unset" },
367
- className: "tags-select",
368
- itemClassName: "details-tag"
369
- }
370
- ) : /* @__PURE__ */ i(Ht, { className: "tags-select", children: ue(...X).length ? ue(...X).map((l) => {
371
- const C = re[l]?.color;
363
+ /* @__PURE__ */ k(Mt, { className: le({ loading: M }), children: [
364
+ /* @__PURE__ */ k(Ht, { children: [
365
+ /* @__PURE__ */ i("h2", { children: Ce }),
366
+ J ? /* @__PURE__ */ k(xe, { children: [
367
+ /* @__PURE__ */ i(
368
+ Bt,
369
+ {
370
+ ref: E,
371
+ value: ue(...W),
372
+ tags: ce,
373
+ options: [],
374
+ editable: !0,
375
+ editor: !0,
376
+ onChange: (l) => {
377
+ L?.addTags(l.filter((S) => !oe.includes(S))), re("tags", l);
378
+ },
379
+ mixedCounts: F ? de : void 0,
380
+ mixedTotal: t.length,
381
+ mixedLabel: `${e}s`,
382
+ onMixedChange: (l) => z("tags", l),
383
+ onEditOption: L?.onEditOption,
384
+ editOptionTooltip: "Change the colour in the project tags",
385
+ align: "right",
386
+ styleDropdown: { display: M ? "none" : "unset" },
387
+ className: "tags-select",
388
+ itemClassName: "details-tag"
389
+ }
390
+ ),
391
+ L && /* @__PURE__ */ i(hs, { ...L.dialog })
392
+ ] }) : /* @__PURE__ */ i(Wt, { className: "tags-select", children: ue(...W).length ? ue(...W).map((l) => {
393
+ const S = ce[l]?.color;
372
394
  return /* @__PURE__ */ i(
373
395
  "span",
374
396
  {
375
397
  style: {
376
- backgroundColor: C || void 0,
377
- color: C ? Ee(C) : void 0
398
+ backgroundColor: S || void 0,
399
+ color: S ? Fe(S) : void 0
378
400
  },
379
401
  children: l
380
402
  },
@@ -384,13 +406,13 @@ const An = T(ze)`
384
406
  ] }),
385
407
  /* @__PURE__ */ k("div", { className: "sub-title", children: [
386
408
  /* @__PURE__ */ k("span", { className: "entity-type", children: [
387
- Xe(e),
409
+ Ze(e),
388
410
  " - "
389
411
  ] }),
390
- /* @__PURE__ */ i("h3", { children: ye })
412
+ /* @__PURE__ */ i("h3", { children: ge })
391
413
  ] }),
392
- e === "version" && !K && !L && V && /* @__PURE__ */ i(
393
- Mn,
414
+ e === "version" && !F && !M && V && /* @__PURE__ */ i(
415
+ Ws,
394
416
  {
395
417
  entity: V,
396
418
  taskTypes: g.taskTypes
@@ -402,77 +424,81 @@ const An = T(ze)`
402
424
  }
403
425
  ),
404
426
  /* @__PURE__ */ i(
405
- Bt,
427
+ zt,
406
428
  {
407
- value: I,
429
+ value: P,
408
430
  options: w || [],
409
431
  disabledValues: a,
410
- disableOpen: !be,
432
+ disableOpen: !Se,
411
433
  invert: !0,
412
434
  style: { maxWidth: "unset" },
413
- onChange: (l) => Y("status", l),
414
- className: ie("status-select", { loading: L }),
435
+ onChange: (l) => re("status", l),
436
+ className: le("status-select", { loading: M }),
415
437
  align: m ? "right" : "left",
416
- $textColor: Ee(W !== void 0 ? W.color : "#OOO")
438
+ $textColor: Fe(fe !== void 0 ? fe.color : "#OOO")
417
439
  }
418
440
  ),
419
- !m && (!me || L ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
420
- Wt,
441
+ !m && (!Q || M ? /* @__PURE__ */ i("div", {}) : /* @__PURE__ */ i(
442
+ Gt,
421
443
  {
422
- value: O,
423
- options: Q,
444
+ value: R,
445
+ options: ke,
424
446
  disabledValues: o.map((l) => l.name),
425
- isMultiple: K && O.length > 1 && e === "task",
426
- readOnly: !S,
427
- emptyMessage: S ? "Assign user" : "-",
447
+ isMultiple: F && R.length > 1 && e === "task",
448
+ readOnly: !ie,
449
+ emptyMessage: ie ? "Assign user" : "-",
428
450
  align: "right",
429
- onChange: (l) => Y("assignees", l),
451
+ onChange: (l) => re("assignees", l),
452
+ mixedCounts: F && e === "task" ? he : void 0,
453
+ mixedTotal: t.length,
454
+ mixedLabel: `${e}s`,
455
+ onMixedChange: (l) => z("assignees", l),
430
456
  className: "assignee-select",
431
- "data-tooltip": O.length ? e === "task" ? "Assigned users" : "Author" : ""
457
+ "data-tooltip": R.length ? e === "task" ? "Assigned users" : "Author" : ""
432
458
  }
433
459
  )),
434
460
  /* @__PURE__ */ i(
435
- dn,
461
+ us,
436
462
  {
437
463
  entities: t,
438
464
  entityType: e,
439
- entitySubTypes: n,
440
- isLoadingEntity: !!c || !!L,
465
+ entitySubTypes: s,
466
+ isLoadingEntity: !!c || !!M,
441
467
  searchParams: N,
442
468
  bundleMode: u,
443
- onSetSearchParams: A,
469
+ onSetSearchParams: j,
444
470
  onNavigate: h
445
471
  }
446
472
  ),
447
473
  se ? /* @__PURE__ */ i(
448
- zt,
474
+ Qt,
449
475
  {
450
476
  options: se,
451
477
  placeholder: "No priority",
452
- value: oe,
453
- onChange: (l) => Y("attrib", { priority: l[0] }),
478
+ value: ae,
479
+ onChange: (l) => re("attrib", { priority: l[0] }),
454
480
  align: "right"
455
481
  }
456
482
  ) : /* @__PURE__ */ i("div", { style: { height: 32 } }),
457
483
  /* @__PURE__ */ i(
458
- $n,
484
+ Ms,
459
485
  {
460
486
  entityType: e,
461
487
  currentTab: f,
462
488
  onTabChange: p,
463
- isLoading: L
489
+ isLoading: M
464
490
  }
465
491
  )
466
492
  ] })
467
493
  }
468
494
  ) });
469
- }, Bn = T.div`
495
+ }, Gs = T.div`
470
496
  display: flex;
471
497
  flex-direction: column;
472
498
 
473
499
  height: 100%;
474
500
  overflow: hidden;
475
- `, Me = T.div`
501
+ `, Be = T.div`
476
502
  position: relative;
477
503
  flex: 1;
478
504
  display: flex;
@@ -486,40 +512,40 @@ const An = T(ze)`
486
512
  &:first-child {
487
513
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
488
514
  }
489
- `, Wn = ({
515
+ `, Qs = ({
490
516
  entities: e = [],
491
- scope: n,
517
+ scope: s,
492
518
  isLoadingVersion: t
493
519
  }) => {
494
520
  const o = e[0];
495
521
  if (!o) return null;
496
- let s = "Reviewables";
497
- return e.length > 1 && (s += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ k(Bn, { children: [
498
- /* @__PURE__ */ k(Me, { children: [
499
- /* @__PURE__ */ i("h4", { children: s }),
522
+ let n = "Reviewables";
523
+ return e.length > 1 && (n += ` (${o.name})`), e.some((a) => a.entityType !== "version") ? null : /* @__PURE__ */ k(Gs, { children: [
524
+ /* @__PURE__ */ k(Be, { children: [
525
+ /* @__PURE__ */ i("h4", { children: n }),
500
526
  /* @__PURE__ */ i(
501
- Kt,
527
+ Xt,
502
528
  {
503
529
  projectName: o.projectName,
504
530
  productId: o.product?.id,
505
531
  versionId: o.id,
506
532
  isLoadingVersion: t,
507
- scope: n
533
+ scope: s
508
534
  }
509
535
  )
510
536
  ] }),
511
- /* @__PURE__ */ k(Me, { children: [
537
+ /* @__PURE__ */ k(Be, { children: [
512
538
  /* @__PURE__ */ i("h4", { children: "Representations" }),
513
- /* @__PURE__ */ i(pn, { entities: e })
539
+ /* @__PURE__ */ i(bs, { entities: e })
514
540
  ] })
515
541
  ] });
516
- }, zn = ({
542
+ }, qs = ({
517
543
  latestVersion: e,
518
- resolveVersionJump: n
544
+ resolveVersionJump: s
519
545
  }) => {
520
- const t = n?.(e.id);
546
+ const t = s?.(e.id);
521
547
  return /* @__PURE__ */ i(
522
- hn,
548
+ vs,
523
549
  {
524
550
  variant: "info",
525
551
  compact: !0,
@@ -533,21 +559,21 @@ const An = T(ze)`
533
559
  } : void 0
534
560
  }
535
561
  );
536
- }, Gn = (e) => {
537
- const n = e?.version?.version, t = e?.product?.latestVersion;
538
- if (!(e?.entityType !== "version" || !n || n <= 0 || !t?.active))
539
- return t.version > n ? t : void 0;
540
- }, Qn = () => ({
541
- onOpenVersionUpload: bn()?.onOpenVersionUpload ?? null
542
- }), qn = (e, n, t) => {
562
+ }, Ks = (e) => {
563
+ const s = e?.version?.version, t = e?.product?.latestVersion;
564
+ if (!(e?.entityType !== "version" || !s || s <= 0 || !t?.active))
565
+ return t.version > s ? t : void 0;
566
+ }, Js = () => ({
567
+ onOpenVersionUpload: xs()?.onOpenVersionUpload ?? null
568
+ }), Xs = (e, s, t) => {
543
569
  const o = e === "folder" || e === "task" ? "overview" : e === "product" || e === "version" || e === "representation" ? "products" : null;
544
- return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${n}` : null;
545
- }, Kn = ({
570
+ return o ? `${typeof window < "u" ? window.location.origin : ""}/projects/${t}/${o}?project=${t}&type=${e}&id=${s}` : null;
571
+ }, Ys = ({
546
572
  entityType: e,
547
- entityId: n,
573
+ entityId: s,
548
574
  projectName: t,
549
575
  selectedEntities: o,
550
- deleteEntities: s,
576
+ deleteEntities: n,
551
577
  canUploadThumbnail: a,
552
578
  canUploadVersion: r,
553
579
  canOpenPip: c,
@@ -557,17 +583,17 @@ const An = T(ze)`
557
583
  onPip: g,
558
584
  onOpenViewer: b,
559
585
  onUploadThumbnail: x,
560
- onUploadVersion: R,
561
- onShare: j,
562
- onViewData: P,
586
+ onUploadVersion: $,
587
+ onShare: U,
588
+ onViewData: A,
563
589
  onDelete: d
564
590
  }) => {
565
- const u = D(() => o.length ? o.filter((h) => !!h?.entityId).map((h) => ({
591
+ const u = C(() => o.length ? o.filter((h) => !!h?.entityId).map((h) => ({
566
592
  entityId: h.entityId,
567
593
  entityType: h.entityType || e,
568
594
  hasReviewables: h.hasReviewables
569
- })) : n ? [{ entityId: n, entityType: e }] : [], [o, n, e]);
570
- return D(() => {
595
+ })) : s ? [{ entityId: s, entityType: e }] : [], [o, s, e]);
596
+ return C(() => {
571
597
  const h = [];
572
598
  if (m && h.push({
573
599
  id: "open-in-viewer",
@@ -588,7 +614,7 @@ const An = T(ze)`
588
614
  id: "upload-version",
589
615
  label: "Upload version",
590
616
  icon: "upload",
591
- onClick: R
617
+ onClick: $
592
618
  }), p?.openAddToListDialog && t && u.length) {
593
619
  const E = u[0]?.entityType || e, y = p.openAddToListDialog;
594
620
  if (h.push({
@@ -597,34 +623,34 @@ const An = T(ze)`
597
623
  icon: "list_alt_add",
598
624
  onClick: () => y(E, u)
599
625
  }), (E === "version" || E === "representation") && p.hasReviewAddon) {
600
- const O = u.some((V) => V.hasReviewables === !0);
626
+ const R = u.some((V) => V.hasReviewables === !0);
601
627
  h.push({
602
628
  id: "add-to-review-list",
603
629
  label: "Add to session",
604
630
  icon: "list_alt_add",
605
- disabled: !O,
606
- ...O ? {} : { "data-tooltip": "No reviewables on selected version" },
631
+ disabled: !R,
632
+ ...R ? {} : { "data-tooltip": "No reviewables on selected version" },
607
633
  onClick: () => y(E, u, { isReview: !0 })
608
634
  });
609
635
  }
610
636
  }
611
- const N = u[0], A = N?.entityId && t ? qn(
637
+ const N = u[0], j = N?.entityId && t ? Xs(
612
638
  N.entityType || e,
613
639
  N.entityId,
614
640
  t
615
641
  ) : null;
616
- if (A && h.push({
642
+ if (j && h.push({
617
643
  id: "share",
618
644
  label: "Share",
619
645
  icon: "share",
620
- onClick: () => j(A)
646
+ onClick: () => U(j)
621
647
  }), h.push({
622
648
  id: "view-data",
623
649
  label: "View data",
624
650
  icon: "database",
625
- onClick: P
626
- }), f && s.length > 0) {
627
- const E = new Set(s.map((O) => O.entityType)), y = E.size === 1 ? [...E][0] : "item", w = s.length === 1 ? `Delete ${y}` : `Delete ${vn(s.length, y)}`;
651
+ onClick: A
652
+ }), f && n.length > 0) {
653
+ const E = new Set(n.map((R) => R.entityType)), y = E.size === 1 ? [...E][0] : "item", w = n.length === 1 ? `Delete ${y}` : `Delete ${Ss(n.length, y)}`;
628
654
  h.push({
629
655
  id: "delete",
630
656
  label: w,
@@ -633,14 +659,14 @@ const An = T(ze)`
633
659
  onClick: d
634
660
  });
635
661
  }
636
- return { items: h, shareLink: A };
662
+ return { items: h, shareLink: j };
637
663
  }, [
638
664
  c,
639
665
  m,
640
666
  a,
641
667
  r,
642
668
  f,
643
- s,
669
+ n,
644
670
  p,
645
671
  t,
646
672
  u,
@@ -648,23 +674,23 @@ const An = T(ze)`
648
674
  g,
649
675
  b,
650
676
  x,
651
- R,
652
- j,
653
- P,
677
+ $,
678
+ U,
679
+ A,
654
680
  d
655
681
  ]);
656
- }, Jn = T.div`
682
+ }, Zs = T.div`
657
683
  display: flex;
658
684
  flex-direction: column;
659
685
  gap: 16px;
660
- `, He = T.div`
686
+ `, We = T.div`
661
687
  display: flex;
662
688
  flex-direction: column;
663
689
  gap: 6px;
664
- `, Be = T.span`
690
+ `, ze = T.span`
665
691
  font-size: 13px;
666
692
  color: var(--md-sys-color-on-surface);
667
- `, We = T.button`
693
+ `, Ge = T.button`
668
694
  display: flex;
669
695
  align-items: center;
670
696
  gap: 12px;
@@ -693,47 +719,47 @@ const An = T(ze)`
693
719
  text-overflow: ellipsis;
694
720
  white-space: nowrap;
695
721
  }
696
- `, Xn = ({ link: e, entityLabel: n, visible: t, onHide: o }) => {
722
+ `, en = ({ link: e, entityLabel: s, visible: t, onHide: o }) => {
697
723
  if (!t) return null;
698
- const s = `[${n}](${e})`, a = (r) => {
699
- yn(r, !0), o();
724
+ const n = `[${s}](${e})`, a = (r) => {
725
+ Cs(r, !0), o();
700
726
  };
701
- return /* @__PURE__ */ i(yt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ k(Jn, { children: [
702
- /* @__PURE__ */ k(He, { children: [
703
- /* @__PURE__ */ i(Be, { children: "Link" }),
704
- /* @__PURE__ */ k(We, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
727
+ return /* @__PURE__ */ i(wt, { isOpen: !0, onClose: o, size: "sm", header: "Share", children: /* @__PURE__ */ k(Zs, { children: [
728
+ /* @__PURE__ */ k(We, { children: [
729
+ /* @__PURE__ */ i(ze, { children: "Link" }),
730
+ /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(e), "aria-label": "Copy link", children: [
705
731
  /* @__PURE__ */ i("span", { className: "value", children: e }),
706
- /* @__PURE__ */ i(fe, { icon: "content_copy" })
732
+ /* @__PURE__ */ i(we, { icon: "content_copy" })
707
733
  ] })
708
734
  ] }),
709
- /* @__PURE__ */ k(He, { children: [
710
- /* @__PURE__ */ i(Be, { children: "Markdown Link" }),
711
- /* @__PURE__ */ k(We, { type: "button", onClick: () => a(s), "aria-label": "Copy markdown link", children: [
712
- /* @__PURE__ */ i("span", { className: "value", children: s }),
713
- /* @__PURE__ */ i(fe, { icon: "content_copy" })
735
+ /* @__PURE__ */ k(We, { children: [
736
+ /* @__PURE__ */ i(ze, { children: "Markdown Link" }),
737
+ /* @__PURE__ */ k(Ge, { type: "button", onClick: () => a(n), "aria-label": "Copy markdown link", children: [
738
+ /* @__PURE__ */ i("span", { className: "value", children: n }),
739
+ /* @__PURE__ */ i(we, { icon: "content_copy" })
714
740
  ] })
715
741
  ] })
716
742
  ] }) });
717
- }, Yn = (e, n, t, o) => {
718
- const s = { projectName: t, quickView: !0 };
743
+ }, tn = (e, s, t, o) => {
744
+ const n = { projectName: t, quickView: !0 };
719
745
  switch (e) {
720
746
  case "folder":
721
- return { ...s, folderId: n };
747
+ return { ...n, folderId: s };
722
748
  case "task":
723
- return { ...s, taskId: n };
749
+ return { ...n, taskId: s };
724
750
  case "product":
725
- return { ...s, productId: n };
751
+ return { ...n, productId: s };
726
752
  case "version":
727
- return o ? { ...s, productId: o, versionIds: [n] } : null;
753
+ return o ? { ...n, productId: o, versionIds: [s] } : null;
728
754
  default:
729
755
  return null;
730
756
  }
731
- }, Zn = ({
757
+ }, sn = ({
732
758
  entityType: e,
733
- entityId: n,
759
+ entityId: s,
734
760
  entityIds: t,
735
761
  entityLabel: o,
736
- projectName: s,
762
+ projectName: n,
737
763
  selectedEntities: a = [],
738
764
  entityListsContext: r,
739
765
  onOpenPip: c,
@@ -742,154 +768,154 @@ const An = T(ze)`
742
768
  taskId: p,
743
769
  folderId: g
744
770
  }) => {
745
- const b = ee(null), [x, R] = J(!1), [j, P] = J(null), { menuOpen: d, toggleMenuOpen: u, setMenuOpen: h } = en(), { triggerThumbnailUpload: N, canUploadVersion: A } = St(tn), { onOpenVersionUpload: E } = Qn(), y = Ct(), w = D(() => {
746
- const $ = n || t?.[0] || "noentity";
747
- return `details-more-menu-${y}-${$}-${s || "noproject"}`;
748
- }, [y, n, t, s]), O = d === w, V = !!n && !!s && !!N, L = !!A && !!E, te = () => {
771
+ const b = Z(null), [x, $] = X(!1), [U, A] = X(null), { menuOpen: d, toggleMenuOpen: u, setMenuOpen: h } = ss(), { triggerThumbnailUpload: N, canUploadVersion: j } = Tt(ns), { onOpenVersionUpload: E } = Js(), y = Nt(), w = C(() => {
772
+ const L = s || t?.[0] || "noentity";
773
+ return `details-more-menu-${y}-${L}-${n || "noproject"}`;
774
+ }, [y, s, t, n]), R = d === w, V = !!s && !!n && !!N, M = !!j && !!E, ee = () => {
749
775
  E?.({ productId: f, taskId: p, folderId: g });
750
- }, ne = n && s ? Yn(e, n, s, f) : null, se = !!m && !!ne, ae = nn(), I = D(() => (a.length ? a : n ? [{ entityId: n, entityType: e, projectName: s }] : []).map((U) => {
751
- const ce = U.entityType || e, B = U.projectName || s;
752
- return !sn(ce) || !U.entityId || !B ? null : {
753
- id: U.entityId,
754
- entityType: ce,
755
- name: U.name,
756
- label: U.label,
757
- projectName: B,
758
- folderId: U.folderId,
759
- parentId: U.parentId
776
+ }, te = s && n ? tn(e, s, n, f) : null, se = !!m && !!te, ne = as(), P = C(() => (a.length ? a : s ? [{ entityId: s, entityType: e, projectName: n }] : []).map((F) => {
777
+ const de = F.entityType || e, he = F.projectName || n;
778
+ return !os(de) || !F.entityId || !he ? null : {
779
+ id: F.entityId,
780
+ entityType: de,
781
+ name: F.name,
782
+ label: F.label,
783
+ projectName: he,
784
+ folderId: F.folderId,
785
+ parentId: F.parentId
760
786
  };
761
- }).filter((U) => U !== null), [a, n, e, s]), oe = !!ae && I.length > 0, X = () => {
762
- h(!1), ae?.deleteEntities(I);
763
- }, { items: re } = Kn({
787
+ }).filter((F) => F !== null), [a, s, e, n]), ae = !!ne && P.length > 0, W = () => {
788
+ h(!1), ne?.deleteEntities(P);
789
+ }, { items: ce } = Ys({
764
790
  entityType: e,
765
- entityId: n,
766
- projectName: s,
791
+ entityId: s,
792
+ projectName: n,
767
793
  selectedEntities: a,
768
- deleteEntities: I,
794
+ deleteEntities: P,
769
795
  canUploadThumbnail: V,
770
- canUploadVersion: L,
796
+ canUploadVersion: M,
771
797
  canOpenPip: !!c,
772
798
  canOpenViewer: se,
773
- canDelete: oe,
799
+ canDelete: ae,
774
800
  entityListsContext: r,
775
801
  onPip: () => c?.(),
776
- onOpenViewer: () => ne && m?.(ne),
802
+ onOpenViewer: () => te && m?.(te),
777
803
  onUploadThumbnail: () => N?.(),
778
- onUploadVersion: te,
779
- onShare: ($) => P($),
780
- onViewData: () => R(!0),
781
- onDelete: X
782
- }), K = t?.length ? t : n ? [n] : [], le = o || n || "";
783
- return /* @__PURE__ */ k(Ie, { children: [
804
+ onUploadVersion: ee,
805
+ onShare: (L) => A(L),
806
+ onViewData: () => $(!0),
807
+ onDelete: W
808
+ }), oe = t?.length ? t : s ? [s] : [], pe = o || s || "";
809
+ return /* @__PURE__ */ k(xe, { children: [
784
810
  /* @__PURE__ */ i(
785
- Z,
811
+ Y,
786
812
  {
787
813
  ref: b,
788
814
  icon: "more_horiz",
789
815
  variant: "text",
790
816
  "data-tooltip": "More actions",
791
817
  "aria-label": "More actions",
792
- className: ie({ active: O }),
818
+ className: le({ active: R }),
793
819
  onClick: () => u(w)
794
820
  }
795
821
  ),
796
- /* @__PURE__ */ i(mn, { id: w, target: b.current, align: "right", children: /* @__PURE__ */ i(gn, { menu: re, onClose: () => h(!1) }) }),
797
- x && s && K.length > 0 && /* @__PURE__ */ i(
798
- fn,
822
+ /* @__PURE__ */ i(ys, { id: w, target: b.current, align: "right", children: /* @__PURE__ */ i(ks, { menu: ce, onClose: () => h(!1) }) }),
823
+ x && n && oe.length > 0 && /* @__PURE__ */ i(
824
+ ws,
799
825
  {
800
- projectName: s,
826
+ projectName: n,
801
827
  entityType: e,
802
- entityIds: K,
828
+ entityIds: oe,
803
829
  visible: x,
804
- onHide: () => R(!1)
830
+ onHide: () => $(!1)
805
831
  }
806
832
  ),
807
- j && /* @__PURE__ */ i(
808
- Xn,
833
+ U && /* @__PURE__ */ i(
834
+ en,
809
835
  {
810
- link: j,
811
- entityLabel: le,
836
+ link: U,
837
+ entityLabel: pe,
812
838
  visible: !0,
813
- onHide: () => P(null)
839
+ onHide: () => A(null)
814
840
  }
815
841
  )
816
842
  ] });
817
- }, es = (e, n) => {
843
+ }, nn = (e, s) => {
818
844
  const t = [e];
819
845
  let o = e;
820
846
  for (; o.parentId && o.parentId !== "root"; ) {
821
- const s = n.get(o.parentId);
822
- if (!s)
847
+ const n = s.get(o.parentId);
848
+ if (!n)
823
849
  break;
824
- t.unshift(s), o = s;
850
+ t.unshift(n), o = n;
825
851
  }
826
852
  return t;
827
- }, ts = (e, n) => {
853
+ }, an = (e, s) => {
828
854
  const t = [];
829
- let o = n.get(e.folder?.id || "");
830
- if ((o ? es(o, n) : []).forEach((a) => {
855
+ let o = s.get(e.folder?.id || "");
856
+ if ((o ? nn(o, s) : []).forEach((a) => {
831
857
  t.push({ type: "folder", label: a.label || a.name, id: a.id });
832
858
  }), e.entityType === "version") {
833
859
  const a = `${e.product?.name} - ${e.name}`;
834
860
  t.push({ type: "version", label: a, id: e.id });
835
861
  }
836
862
  return e.entityType === "task" && t.push({ type: "task", label: e.label || e.name, id: e.id }), t;
837
- }, ns = ({
863
+ }, on = ({
838
864
  entity: e,
839
- entityType: n,
865
+ entityType: s,
840
866
  projectName: t,
841
867
  isLoading: o
842
868
  }) => {
843
- const { data: { folders: s = [] } = {}, isFetching: a } = It(
869
+ const { data: { folders: n = [] } = {}, isFetching: a } = Ft(
844
870
  // TODO: this is major overkill, we are only using label, name and id
845
871
  // We add a patch field that allows us to specify what ws message changes should cause an update to this query
846
872
  // @ts-expect-error - patch is not part of the query args
847
873
  { projectName: t, patch: ["id", "name", "label"] },
848
874
  { skip: !t || o }
849
- ), r = kn(
875
+ ), r = Ts(
850
876
  { projectName: t || "", isLoading: o },
851
877
  a
852
- ), { data: c } = Pt(
878
+ ), { data: c } = At(
853
879
  { productId: e.product?.id || "", projectName: t },
854
- { skip: n !== "version" || !e.product?.id }
855
- ), m = D(
880
+ { skip: s !== "version" || !e.product?.id }
881
+ ), m = C(
856
882
  () => c?.project.product?.versionList ? [...c.project.product?.versionList || []].sort((g, b) => g.name === "HERO" ? -1 : b.name === "HERO" ? 1 : b.name.localeCompare(g.name)).map((g) => ({
857
883
  type: "version",
858
884
  label: g.name,
859
885
  id: g.id
860
886
  })) : [],
861
887
  [c]
862
- ), f = D(
863
- () => new Map(s.map((g) => [g.id, g])),
864
- [s]
888
+ ), f = C(
889
+ () => new Map(n.map((g) => [g.id, g])),
890
+ [n]
865
891
  );
866
- return [D(
867
- () => r ? [] : ts(e, f),
868
- [r, s, e]
892
+ return [C(
893
+ () => r ? [] : an(e, f),
894
+ [r, n, e]
869
895
  ), m];
870
- }, st = (e, n) => {
871
- let t = Object.entries(e).filter(([s]) => n ? n.includes(s) : !0).map(([, s]) => s?.statuses || []).flat();
872
- const o = new Map(t.map((s) => [s.name, s]));
896
+ }, ot = (e, s) => {
897
+ let t = Object.entries(e).filter(([n]) => s ? s.includes(n) : !0).map(([, n]) => n?.statuses || []).flat();
898
+ const o = new Map(t.map((n) => [n.name, n]));
873
899
  return Array.from(o.values());
874
- }, at = ({
900
+ }, it = ({
875
901
  scope: e = "dashboard",
876
- entities: n,
902
+ entities: s,
877
903
  entityType: t,
878
904
  thumbnailHash: o,
879
- projectName: s,
905
+ projectName: n,
880
906
  projectInfo: a,
881
907
  annotations: r,
882
908
  removeAnnotation: c,
883
909
  exportAnnotationComposite: m,
884
910
  ...f
885
911
  }) => {
886
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = q(), b = g.name || "", x = g.attrib?.fullName || "";
912
+ const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g.name || "", x = g.attrib?.fullName || "";
887
913
  return /* @__PURE__ */ k(
888
- Ze,
914
+ tt,
889
915
  {
890
916
  scope: e,
891
- entities: n,
892
- projectName: s,
917
+ entities: s,
918
+ projectName: n,
893
919
  entityType: t,
894
920
  projectInfo: a,
895
921
  userName: b,
@@ -897,43 +923,43 @@ const An = T(ze)`
897
923
  ...p,
898
924
  ...f,
899
925
  children: [
900
- /* @__PURE__ */ i(wn, { ...f, statuses: f.statuses }),
901
- /* @__PURE__ */ i(xn, {})
926
+ /* @__PURE__ */ i(Ns, { ...f, statuses: f.statuses }),
927
+ /* @__PURE__ */ i(Es, {})
902
928
  ]
903
929
  }
904
930
  );
905
- }, ss = ({
931
+ }, rn = ({
906
932
  children: e,
907
- scope: n = "dashboard",
933
+ scope: s = "dashboard",
908
934
  entities: t,
909
935
  entityType: o,
910
- projectName: s,
936
+ projectName: n,
911
937
  projectInfo: a,
912
938
  annotations: r,
913
939
  removeAnnotation: c,
914
940
  exportAnnotationComposite: m,
915
941
  ...f
916
942
  }) => {
917
- const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = q(), b = g?.name ?? "", x = g?.attrib?.fullName ?? "", [R, j] = J(null);
943
+ const p = { annotations: r, removeAnnotation: c, exportAnnotationComposite: m }, { user: g } = K(), b = g?.name ?? "", x = g?.attrib?.fullName ?? "", [$, U] = X(null);
918
944
  return /* @__PURE__ */ i(
919
- Ze,
945
+ tt,
920
946
  {
921
- scope: n,
947
+ scope: s,
922
948
  entities: t,
923
- projectName: s,
949
+ projectName: n,
924
950
  entityType: o,
925
951
  projectInfo: a,
926
952
  userName: b,
927
953
  userFullName: x,
928
954
  ...p,
929
- editingId: R,
930
- setEditingId: j,
955
+ editingId: $,
956
+ setEditingId: U,
931
957
  ...f,
932
958
  children: e
933
959
  }
934
960
  );
935
- }, ot = (e, n) => {
936
- if (!e || Object.keys(e).length === 0 || !n?.length)
961
+ }, rt = (e, s) => {
962
+ if (!e || Object.keys(e).length === 0 || !s?.length)
937
963
  return {
938
964
  folderTypes: [],
939
965
  taskTypes: [],
@@ -942,8 +968,8 @@ const An = T(ze)`
942
968
  linkTypes: [],
943
969
  productTypes: []
944
970
  };
945
- if (n.length === 1) {
946
- const a = e[n[0]];
971
+ if (s.length === 1) {
972
+ const a = e[s[0]];
947
973
  return {
948
974
  folderTypes: a?.folderTypes || [],
949
975
  taskTypes: a?.taskTypes || [],
@@ -958,7 +984,7 @@ const An = T(ze)`
958
984
  return a.flat().forEach((c) => {
959
985
  c && c.name && (r[c.name] = c);
960
986
  }), Object.values(r);
961
- }, s = {
987
+ }, n = {
962
988
  statuses: [],
963
989
  folderTypes: [],
964
990
  taskTypes: [],
@@ -966,33 +992,33 @@ const An = T(ze)`
966
992
  linkTypes: [],
967
993
  productTypes: []
968
994
  };
969
- return n.forEach((a) => {
995
+ return s.forEach((a) => {
970
996
  const r = e[a];
971
- r && (Object.keys(s).forEach((c) => {
972
- c === "productTypes" ? r.productTypes && s[c].push(r) : Array.isArray(r[c]) && s[c].push(r[c]);
997
+ r && (Object.keys(n).forEach((c) => {
998
+ c === "productTypes" ? r.productTypes && n[c].push(r) : Array.isArray(r[c]) && n[c].push(r[c]);
973
999
  }), Object.keys(r).forEach((c) => {
974
- c in s || (t[c] = r[c]);
1000
+ c in n || (t[c] = r[c]);
975
1001
  }));
976
- }), Object.keys(s).forEach((a) => {
977
- (a === "productTypes" || s[a].length > 0) && (t[a] = o(s[a]));
1002
+ }), Object.keys(n).forEach((a) => {
1003
+ (a === "productTypes" || n[a].length > 0) && (t[a] = o(n[a]));
978
1004
  }), t;
979
- }, as = T.div`
1005
+ }, ln = T.div`
980
1006
  display: flex;
981
1007
  align-items: center;
982
1008
  padding: 4px 8px;
983
1009
  gap: var(--base-gap-small);
984
- `, os = T.span`
1010
+ `, cn = T.span`
985
1011
  font-weight: 600;
986
1012
  user-select: none;
987
- `, is = T.div`
1013
+ `, dn = T.div`
988
1014
  display: flex;
989
1015
  gap: var(--base-gap-small);
990
- `, Ne = T(Z)`
1016
+ `, Pe = T(Y)`
991
1017
  background-color: unset;
992
1018
  &.hasIcon {
993
1019
  padding: 4px;
994
1020
  }
995
- `, rs = T.div`
1021
+ `, un = T.div`
996
1022
  display: flex;
997
1023
  align-items: center;
998
1024
  gap: var(--base-gap-small);
@@ -1009,10 +1035,10 @@ const An = T(ze)`
1009
1035
  box-shadow: 0 0 0 1px var(--md-sys-color-primary-container);
1010
1036
  background-color: var(--md-sys-color-surface-container-lowest);
1011
1037
  }
1012
- `, ls = T(Cn)`
1038
+ `, pn = T(ms)`
1013
1039
  width: 28px;
1014
1040
  height: 28px;
1015
- `, cs = T.input`
1041
+ `, hn = T.input`
1016
1042
  flex: 1;
1017
1043
  min-width: 0;
1018
1044
  border: none;
@@ -1025,58 +1051,58 @@ const An = T(ze)`
1025
1051
  &::placeholder {
1026
1052
  color: var(--md-sys-color-outline);
1027
1053
  }
1028
- `, ds = T(Z)`
1054
+ `, mn = T(Y)`
1029
1055
  background-color: unset;
1030
1056
  min-width: unset;
1031
1057
  &.hasIcon {
1032
1058
  padding: 2px;
1033
1059
  }
1034
- `, Pe = (e) => !!e && "key" in e, pe = (e, n) => Pe(e) ? e.key === n : !!e.conditions?.some((t) => pe(t, n)), De = (e) => {
1035
- if (Pe(e)) return String(e.value || "");
1036
- const n = e.operator === "or" ? ", " : ".";
1037
- return e.conditions?.map((t) => De(t)).join(n) || "";
1038
- }, it = (e, n, t) => {
1060
+ `, Oe = (e) => !!e && "key" in e, be = (e, s) => Oe(e) ? e.key === s : !!e.conditions?.some((t) => be(t, s)), Ae = (e) => {
1061
+ if (Oe(e)) return String(e.value || "");
1062
+ const s = e.operator === "or" ? ", " : ".";
1063
+ return e.conditions?.map((t) => Ae(t)).join(s) || "";
1064
+ }, lt = (e, s, t) => {
1039
1065
  const o = e.split(",").map((r) => r.trim()).filter(Boolean);
1040
1066
  if (o.length > 1)
1041
1067
  return {
1042
1068
  operator: "or",
1043
- conditions: o.map((r) => it(r, n, t))
1069
+ conditions: o.map((r) => lt(r, s, t))
1044
1070
  };
1045
- const s = o[0] || e.trim();
1046
- if (!s || s === "," || s === ".")
1071
+ const n = o[0] || e.trim();
1072
+ if (!n || n === "," || n === ".")
1047
1073
  return {
1048
- key: n,
1074
+ key: s,
1049
1075
  operator: t,
1050
1076
  value: ""
1051
1077
  };
1052
- const a = s.split(".").map((r) => r.trim()).filter(Boolean);
1078
+ const a = n.split(".").map((r) => r.trim()).filter(Boolean);
1053
1079
  return a.length > 1 ? {
1054
1080
  operator: "and",
1055
1081
  conditions: a.map((r) => ({
1056
- key: n,
1082
+ key: s,
1057
1083
  operator: t,
1058
1084
  value: r
1059
1085
  }))
1060
1086
  } : {
1061
- key: n,
1087
+ key: s,
1062
1088
  operator: t,
1063
1089
  value: a[0] || ""
1064
1090
  };
1065
- }, us = ({
1091
+ }, gn = ({
1066
1092
  label: e,
1067
- filters: n,
1093
+ filters: s,
1068
1094
  currentFilter: t,
1069
1095
  onFilterChange: o,
1070
- isLoading: s
1096
+ isLoading: n
1071
1097
  }) => {
1072
- const [a, r] = J(null), [c, m] = J(""), f = ee(null), p = (d) => typeof d == "object" && d !== null && !Array.isArray(d);
1073
- H(() => {
1098
+ const [a, r] = X(null), [c, m] = X(""), f = Z(null), p = (d) => typeof d == "object" && d !== null && !Array.isArray(d);
1099
+ B(() => {
1074
1100
  a && f.current && f.current.focus();
1075
- }, [a]), H(() => {
1101
+ }, [a]), B(() => {
1076
1102
  if (a && p(t)) {
1077
1103
  if (document.activeElement === f.current) return;
1078
- const d = t.conditions?.find((u) => pe(u, a));
1079
- m(d ? De(d) : "");
1104
+ const d = t.conditions?.find((u) => be(u, a));
1105
+ m(d ? Ae(d) : "");
1080
1106
  }
1081
1107
  }, [a, t]);
1082
1108
  const g = (d, u) => {
@@ -1088,62 +1114,62 @@ const An = T(ze)`
1088
1114
  ...t,
1089
1115
  conditions: h,
1090
1116
  operator: t.operator || "and"
1091
- }, A = String(d.id), E = h.findIndex((w) => pe(w, A)), y = d.type || "boolean";
1117
+ }, j = String(d.id), E = h.findIndex((w) => be(w, j)), y = d.type || "boolean";
1092
1118
  if (y === "boolean")
1093
- E > -1 ? h.splice(E, 1) : h.push({ key: A, operator: d.operator || "eq", value: !0 });
1119
+ E > -1 ? h.splice(E, 1) : h.push({ key: j, operator: d.operator || "eq", value: !0 });
1094
1120
  else if (y === "enum") {
1095
1121
  const w = Array.isArray(u) ? u : [u];
1096
1122
  if (w.length === 0 || w.length === 1 && w[0] === void 0)
1097
1123
  E > -1 && h.splice(E, 1);
1098
1124
  else {
1099
- const O = {
1100
- key: A,
1125
+ const R = {
1126
+ key: j,
1101
1127
  operator: d.operator || "in",
1102
1128
  value: w
1103
1129
  };
1104
- E > -1 ? h[E] = O : h.push(O);
1130
+ E > -1 ? h[E] = R : h.push(R);
1105
1131
  }
1106
1132
  } else if (y === "search") {
1107
1133
  const w = typeof u == "string" ? u : "";
1108
1134
  if (!w)
1109
1135
  E > -1 && h.splice(E, 1);
1110
1136
  else {
1111
- const O = it(w, A, d.operator || "like");
1112
- E > -1 ? h[E] = O : h.push(O);
1137
+ const R = lt(w, j, d.operator || "like");
1138
+ E > -1 ? h[E] = R : h.push(R);
1113
1139
  }
1114
1140
  }
1115
1141
  o(N);
1116
1142
  }, b = (d) => {
1117
1143
  const u = String(d.id);
1118
1144
  if (a !== u && (r(u), p(t))) {
1119
- const h = t.conditions?.find((N) => pe(N, u));
1120
- m(h ? De(h) : "");
1145
+ const h = t.conditions?.find((N) => be(N, u));
1146
+ m(h ? Ae(h) : "");
1121
1147
  }
1122
1148
  }, x = (d, u) => {
1123
1149
  m(u), g(d, u);
1124
- }, R = (d) => {
1150
+ }, $ = (d) => {
1125
1151
  m(""), r(null), g(d, "");
1126
- }, j = (d) => p(t) ? t.conditions?.some((u) => pe(u, String(d.id))) : d.id === t, P = (d) => p(t) ? t.conditions?.find(
1127
- (h) => Pe(h) && h.key === String(d.id)
1152
+ }, U = (d) => p(t) ? t.conditions?.some((u) => be(u, String(d.id))) : d.id === t, A = (d) => p(t) ? t.conditions?.find(
1153
+ (h) => Oe(h) && h.key === String(d.id)
1128
1154
  )?.value || [] : [];
1129
- return /* @__PURE__ */ k(as, { className: ie("panel-tabs", { loading: s }), children: [
1130
- /* @__PURE__ */ i(os, { className: "panel-header-label", children: e }),
1131
- /* @__PURE__ */ i(Ge, {}),
1132
- /* @__PURE__ */ i(is, { className: "panel-header-filters", children: n.map((d) => {
1133
- const u = j(d), h = d.type || "boolean";
1155
+ return /* @__PURE__ */ k(ln, { className: le("panel-tabs", { loading: n }), children: [
1156
+ /* @__PURE__ */ i(cn, { className: "panel-header-label", children: e }),
1157
+ /* @__PURE__ */ i(qe, {}),
1158
+ /* @__PURE__ */ i(dn, { className: "panel-header-filters", children: s.map((d) => {
1159
+ const u = U(d), h = d.type || "boolean";
1134
1160
  if (h === "enum")
1135
1161
  return /* @__PURE__ */ i(
1136
- ls,
1162
+ pn,
1137
1163
  {
1138
1164
  options: d.options || [],
1139
- value: P(d),
1165
+ value: A(d),
1140
1166
  onChange: (N) => g(d, N),
1141
1167
  isEditing: !0,
1142
1168
  autoOpen: !1,
1143
1169
  align: "right",
1144
1170
  type: "list_of_strings",
1145
1171
  valueTemplate: () => /* @__PURE__ */ i(
1146
- Ne,
1172
+ Pe,
1147
1173
  {
1148
1174
  selected: u,
1149
1175
  icon: d.icon,
@@ -1159,12 +1185,12 @@ const An = T(ze)`
1159
1185
  if (h === "search") {
1160
1186
  const N = a === String(d.id);
1161
1187
  return /* @__PURE__ */ k(
1162
- rs,
1188
+ un,
1163
1189
  {
1164
- className: ie("panel-filter", "panel-filter-search", { expanded: N }),
1190
+ className: le("panel-filter", "panel-filter-search", { expanded: N }),
1165
1191
  children: [
1166
1192
  /* @__PURE__ */ i(
1167
- Ne,
1193
+ Pe,
1168
1194
  {
1169
1195
  selected: u || N,
1170
1196
  onClick: () => b(d),
@@ -1173,24 +1199,24 @@ const An = T(ze)`
1173
1199
  "data-tooltip-delay": 0
1174
1200
  }
1175
1201
  ),
1176
- N && /* @__PURE__ */ k(Ie, { children: [
1202
+ N && /* @__PURE__ */ k(xe, { children: [
1177
1203
  /* @__PURE__ */ i(
1178
- cs,
1204
+ hn,
1179
1205
  {
1180
1206
  ref: f,
1181
1207
  value: c,
1182
- onChange: (A) => x(d, A.target.value),
1183
- onKeyDown: (A) => {
1184
- A.key === "Escape" && R(d);
1208
+ onChange: (j) => x(d, j.target.value),
1209
+ onKeyDown: (j) => {
1210
+ j.key === "Escape" && $(d);
1185
1211
  },
1186
1212
  placeholder: d.placeholder || "Search..."
1187
1213
  }
1188
1214
  ),
1189
1215
  /* @__PURE__ */ i(
1190
- ds,
1216
+ mn,
1191
1217
  {
1192
1218
  icon: "close",
1193
- onClick: () => R(d),
1219
+ onClick: () => $(d),
1194
1220
  "data-tooltip": "Clear",
1195
1221
  "data-tooltip-delay": 0
1196
1222
  }
@@ -1202,7 +1228,7 @@ const An = T(ze)`
1202
1228
  );
1203
1229
  }
1204
1230
  return /* @__PURE__ */ i(
1205
- Ne,
1231
+ Pe,
1206
1232
  {
1207
1233
  selected: u,
1208
1234
  onClick: () => g(d),
@@ -1215,21 +1241,21 @@ const An = T(ze)`
1215
1241
  );
1216
1242
  }) })
1217
1243
  ] });
1218
- }, rt = ["done", "isDone"], lt = (e) => !!e && "key" in e, ps = (e, n) => {
1219
- const t = [], o = [], s = (a) => {
1244
+ }, ct = ["done", "isDone"], dt = (e) => !!e && "key" in e, fn = (e, s) => {
1245
+ const t = [], o = [], n = (a) => {
1220
1246
  if (!a) return;
1221
- if (lt(a)) {
1247
+ if (dt(a)) {
1222
1248
  const c = a.key;
1223
1249
  if (c === "search") {
1224
1250
  const p = String(a.value ?? "");
1225
1251
  p && o.push({ id: p, label: p });
1226
1252
  return;
1227
1253
  }
1228
- const m = n.find((p) => p.id === c);
1254
+ const m = s.find((p) => p.id === c);
1229
1255
  if (!m) return;
1230
- if (rt.includes(c)) {
1256
+ if (ct.includes(c)) {
1231
1257
  a.value !== void 0 && t.push({
1232
- id: Se(c),
1258
+ id: Ee(c),
1233
1259
  label: m.label,
1234
1260
  icon: m.icon,
1235
1261
  type: "boolean",
@@ -1241,7 +1267,7 @@ const An = T(ze)`
1241
1267
  if (m.type === "datetime") {
1242
1268
  const p = Array.isArray(a.value) ? a.value[0] : a.value;
1243
1269
  t.push({
1244
- id: Se(c),
1270
+ id: Ee(c),
1245
1271
  label: m.label,
1246
1272
  type: "datetime",
1247
1273
  icon: m.icon,
@@ -1258,7 +1284,7 @@ const An = T(ze)`
1258
1284
  }
1259
1285
  const f = Array.isArray(a.value) ? a.value : [a.value];
1260
1286
  t.push({
1261
- id: Se(c),
1287
+ id: Ee(c),
1262
1288
  label: m.label,
1263
1289
  type: m.type,
1264
1290
  icon: m.icon,
@@ -1270,33 +1296,33 @@ const An = T(ze)`
1270
1296
  });
1271
1297
  return;
1272
1298
  }
1273
- const r = Nn(a, n);
1299
+ const r = Is(a, s);
1274
1300
  if (r) {
1275
1301
  t.push(r);
1276
1302
  return;
1277
1303
  }
1278
- a.conditions?.forEach(s);
1304
+ a.conditions?.forEach(n);
1279
1305
  };
1280
- return e?.conditions?.forEach(s), o.length && t.push({ id: Qe, label: "", values: o }), t;
1281
- }, hs = (e) => {
1282
- const n = [], t = [];
1306
+ return e?.conditions?.forEach(n), o.length && t.push({ id: Ke, label: "", values: o }), t;
1307
+ }, bn = (e) => {
1308
+ const s = [], t = [];
1283
1309
  return e.forEach((o) => {
1284
- const s = kt(o.id), a = (o.values || []).map((r) => r.id);
1310
+ const n = xt(o.id), a = (o.values || []).map((r) => r.id);
1285
1311
  if (a.length)
1286
- if (s === Qe)
1312
+ if (n === Ke)
1287
1313
  a.forEach(
1288
1314
  (r) => t.push({ key: "search", operator: "like", value: String(r) })
1289
1315
  );
1290
- else if (rt.includes(s)) {
1316
+ else if (ct.includes(n)) {
1291
1317
  const r = a[0] === "true";
1292
- n.push({ key: s, operator: "eq", value: r });
1318
+ s.push({ key: n, operator: "eq", value: r });
1293
1319
  } else if (o.type === "datetime") {
1294
- const r = En(s, o);
1295
- r && n.push(r);
1320
+ const r = Ps(n, o);
1321
+ r && s.push(r);
1296
1322
  } else
1297
- n.push({ key: s, operator: "in", value: a.map(String) });
1298
- }), t.length === 1 ? n.push(t[0]) : t.length > 1 && n.push({ operator: "or", conditions: t }), { operator: "and", conditions: n };
1299
- }, ct = (e) => lt(e) ? e.key !== "search" || typeof e.value != "string" ? e : Et(e.value, (n) => ({ ...e, value: n })) ?? e : { ...e, conditions: e.conditions?.map(ct) }, ms = T.div`
1323
+ s.push({ key: n, operator: "in", value: a.map(String) });
1324
+ }), t.length === 1 ? s.push(t[0]) : t.length > 1 && s.push({ operator: "or", conditions: t }), { operator: "and", conditions: s };
1325
+ }, ut = (e) => dt(e) ? e.key !== "search" || typeof e.value != "string" ? e : It(e.value, (s) => ({ ...e, value: s })) ?? e : { ...e, conditions: e.conditions?.map(ut) }, vn = T.div`
1300
1326
  padding: 4px 8px;
1301
1327
  padding-bottom: 0;
1302
1328
 
@@ -1304,16 +1330,16 @@ const An = T(ze)`
1304
1330
  opacity: 0.5;
1305
1331
  pointer-events: none;
1306
1332
  }
1307
- `, gs = ({
1333
+ `, yn = ({
1308
1334
  subtasksFilter: e,
1309
- setSubtasksFilter: n,
1335
+ setSubtasksFilter: s,
1310
1336
  users: t,
1311
1337
  isLoading: o,
1312
- totalCount: s = 0,
1338
+ totalCount: n = 0,
1313
1339
  doneCount: a = 0,
1314
1340
  onSearchTextChange: r
1315
1341
  }) => {
1316
- const c = D(
1342
+ const c = C(
1317
1343
  () => [
1318
1344
  {
1319
1345
  id: "isDone",
@@ -1357,38 +1383,38 @@ const An = T(ze)`
1357
1383
  // },
1358
1384
  ],
1359
1385
  [t]
1360
- ), m = D(() => ps(e, c), [e, c]), [f, p] = J(m), g = ee(null), b = Dn();
1361
- H(() => {
1386
+ ), m = C(() => fn(e, c), [e, c]), [f, p] = X(m), g = Z(null), b = Fs();
1387
+ B(() => {
1362
1388
  p(m);
1363
1389
  }, [JSON.stringify(m)]);
1364
1390
  const x = (u) => {
1365
- const h = hs(u);
1366
- n(h), r?.("");
1367
- }, R = (u) => {
1391
+ const h = bn(u);
1392
+ s(h), r?.("");
1393
+ }, $ = (u) => {
1368
1394
  b.wrapFilterChange(u, f, p);
1369
- }, j = (u, h) => {
1395
+ }, U = (u, h) => {
1370
1396
  h || r?.(u);
1371
1397
  };
1372
- let P = "";
1373
- s > 0 && (P = `${a}/${s}`);
1374
- const d = D(
1375
- () => [{ id: "isDone", label: P, tooltip: "Status" }],
1376
- [P]
1398
+ let A = "";
1399
+ n > 0 && (A = `${a}/${n}`);
1400
+ const d = C(
1401
+ () => [{ id: "isDone", label: A, tooltip: "Status" }],
1402
+ [A]
1377
1403
  );
1378
- return /* @__PURE__ */ k(ms, { className: o ? "loading" : void 0, children: [
1404
+ return /* @__PURE__ */ k(vn, { className: o ? "loading" : void 0, children: [
1379
1405
  /* @__PURE__ */ i(
1380
- wt,
1406
+ St,
1381
1407
  {
1382
1408
  ref: g,
1383
1409
  compact: !0,
1384
1410
  options: c,
1385
1411
  filters: f,
1386
- onChange: R,
1412
+ onChange: $,
1387
1413
  onFinish: x,
1388
1414
  enableGlobalSearch: !0,
1389
1415
  enableMultipleSameFilters: !1,
1390
1416
  enableAutosuggestion: !1,
1391
- onSearchChange: j,
1417
+ onSearchChange: U,
1392
1418
  quickActions: d,
1393
1419
  placeholder: "Search and filter subtasks...",
1394
1420
  pt: {
@@ -1406,7 +1432,7 @@ const An = T(ze)`
1406
1432
  }
1407
1433
  ),
1408
1434
  /* @__PURE__ */ i(
1409
- Sn,
1435
+ Ds,
1410
1436
  {
1411
1437
  isOpen: !!b.customRangeFilterId,
1412
1438
  header: c.find((u) => u.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
@@ -1419,42 +1445,42 @@ const An = T(ze)`
1419
1445
  }
1420
1446
  )
1421
1447
  ] });
1422
- }, fs = ({ ...e }) => {
1423
- const [n, t] = J({}), [o, s] = J(""), [a, r] = J([]), { dispatch: c } = q(), { data: m = [] } = qe({ projectName: e.projectName }), f = e.subtasks?.length || 0, p = e.subtasks?.filter((b) => b.isDone).length || 0, g = D(() => {
1424
- let b = n;
1448
+ }, kn = ({ ...e }) => {
1449
+ const [s, t] = X({}), [o, n] = X(""), [a, r] = X([]), { dispatch: c } = K(), { data: m = [] } = Je({ projectName: e.projectName }), f = e.subtasks?.length || 0, p = e.subtasks?.filter((b) => b.isDone).length || 0, g = C(() => {
1450
+ let b = s;
1425
1451
  if (o) {
1426
1452
  const x = { key: "search", operator: "like", value: o };
1427
1453
  b = {
1428
- ...n,
1429
- conditions: [...n.conditions || [], x],
1454
+ ...s,
1455
+ conditions: [...s.conditions || [], x],
1430
1456
  operator: "and"
1431
1457
  };
1432
1458
  }
1433
- return In(ct(b));
1434
- }, [n, o]);
1435
- return /* @__PURE__ */ k(Ie, { children: [
1459
+ return As(ut(b));
1460
+ }, [s, o]);
1461
+ return /* @__PURE__ */ k(xe, { children: [
1436
1462
  /* @__PURE__ */ i(
1437
- us,
1463
+ gn,
1438
1464
  {
1439
1465
  label: `Subtasks (${f})`,
1440
1466
  filters: [],
1441
- currentFilter: n,
1467
+ currentFilter: s,
1442
1468
  onFilterChange: t
1443
1469
  }
1444
1470
  ),
1445
1471
  /* @__PURE__ */ i(
1446
- gs,
1472
+ yn,
1447
1473
  {
1448
- subtasksFilter: n,
1474
+ subtasksFilter: s,
1449
1475
  setSubtasksFilter: t,
1450
1476
  users: m,
1451
1477
  totalCount: f,
1452
1478
  doneCount: p,
1453
- onSearchTextChange: s
1479
+ onSearchTextChange: n
1454
1480
  }
1455
1481
  ),
1456
1482
  /* @__PURE__ */ i(
1457
- Tn,
1483
+ gs,
1458
1484
  {
1459
1485
  ...e,
1460
1486
  style: { padding: 8, height: "unset" },
@@ -1467,14 +1493,14 @@ const An = T(ze)`
1467
1493
  }
1468
1494
  )
1469
1495
  ] });
1470
- }, bs = ["product", "representation"], vs = ({
1496
+ }, wn = ["product", "representation"], xn = ({
1471
1497
  entityType: e,
1472
- entitySubTypes: n = [],
1498
+ entitySubTypes: s = [],
1473
1499
  // entities is data we already have from kanban
1474
1500
  entitiesData: t = [],
1475
1501
  // entityIds are used to get the full details data for the entities
1476
1502
  entities: o = [],
1477
- tagsOptions: s = [],
1503
+ tagsOptions: n = [],
1478
1504
  disabledStatuses: a,
1479
1505
  projectUsers: r,
1480
1506
  disabledProjectUsers: c,
@@ -1484,320 +1510,320 @@ const An = T(ze)`
1484
1510
  isSlideOut: g = !1,
1485
1511
  style: b = {},
1486
1512
  scope: x,
1487
- isCompact: R = !1,
1488
- onClose: j,
1489
- onWatchersUpdate: P,
1513
+ isCompact: $ = !1,
1514
+ onClose: U,
1515
+ onWatchersUpdate: A,
1490
1516
  onOpenViewer: d,
1491
1517
  onEntityFocus: u,
1492
1518
  onOpen: h,
1493
1519
  onUriOpen: N,
1494
1520
  // when the details panel is opened from uri
1495
1521
  // annotations
1496
- annotations: A,
1522
+ annotations: j,
1497
1523
  removeAnnotation: E,
1498
1524
  exportAnnotationComposite: y,
1499
1525
  entityListId: w,
1500
- guestCategories: O = {},
1526
+ guestCategories: R = {},
1501
1527
  entityListsContext: V,
1502
- resolveVersionJump: L
1528
+ resolveVersionJump: M
1503
1529
  }) => {
1504
1530
  const {
1505
- closeSlideOut: te,
1506
- openPip: ne,
1531
+ closeSlideOut: ee,
1532
+ openPip: te,
1507
1533
  user: se,
1508
- isGuest: ae,
1509
- entities: I,
1510
- setEntities: oe,
1511
- slideOut: X,
1512
- useSearchParams: re,
1513
- SubtasksManager: K,
1514
- useNavigate: le
1515
- } = q(), { currentTab: $, setTab: U, isFeed: ce } = an(x), [B, be] = re(), he = ee(!1), S = I?.entityType ?? e, Y = I?.entities ?? o, ve = I?.entitySubTypes ?? n, me = I?.entities ? [] : t, Q = I?.entities ? I.entities.map((v) => v.projectName) : p;
1516
- Yt(
1517
- S ? Y.map((v) => ({ ...v, entityType: S })) : [],
1518
- g ? _e.slideOut : _e.detailsPanel
1519
- ), H(() => {
1520
- h && !he.current && (he.current = !0, h());
1521
- }, []), H(() => {
1522
- bs.includes(S) && $ !== "details" && U("details");
1523
- }, [S, $, U]), H(() => {
1524
- o.length && I && oe(null);
1525
- }, [o, I, oe]);
1526
- const de = D(
1527
- () => ot(f, Q),
1528
- [f, Q]
1529
- ), ye = D(() => tt(de), [de]);
1530
- H(() => {
1531
- $ === "files" && S !== "version" && U("feed"), $ === "subtasks" && S !== "task" && U("feed");
1532
- }, [S, $, x]);
1533
- let W = Y.length ? Y.map((v) => ({ id: v.id, projectName: v.projectName })) : (
1534
+ isGuest: ne,
1535
+ entities: P,
1536
+ setEntities: ae,
1537
+ slideOut: W,
1538
+ useSearchParams: ce,
1539
+ SubtasksManager: oe,
1540
+ useNavigate: pe
1541
+ } = K(), { currentTab: L, setTab: F, isFeed: de } = is(x), [he, ve] = ce(), ye = Z(!1), D = P?.entityType ?? e, me = P?.entities ?? o, G = P?.entitySubTypes ?? s, Se = P?.entities ? [] : t, J = P?.entities ? P.entities.map((v) => v.projectName) : p;
1542
+ es(
1543
+ D ? me.map((v) => ({ ...v, entityType: D })) : [],
1544
+ g ? He.slideOut : He.detailsPanel
1545
+ ), B(() => {
1546
+ h && !ye.current && (ye.current = !0, h());
1547
+ }, []), B(() => {
1548
+ wn.includes(D) && L !== "details" && F("details");
1549
+ }, [D, L, F]), B(() => {
1550
+ o.length && P && ae(null);
1551
+ }, [o, P, ae]);
1552
+ const ie = C(
1553
+ () => rt(f, J),
1554
+ [f, J]
1555
+ ), re = C(() => nt(ie), [ie]);
1556
+ B(() => {
1557
+ L === "files" && D !== "version" && F("feed"), L === "subtasks" && D !== "task" && F("feed");
1558
+ }, [D, L, x]);
1559
+ let z = me.length ? me.map((v) => ({ id: v.id, projectName: v.projectName })) : (
1534
1560
  // @ts-expect-error = not sure what's going on with activeEntitiesData, we should try and remove it
1535
- me.map((v) => ({ id: v.id, projectName: v.projectName }))
1561
+ Se.map((v) => ({ id: v.id, projectName: v.projectName }))
1536
1562
  );
1537
- W = W.filter((v) => v.id);
1563
+ z = z.filter((v) => v.id);
1538
1564
  const {
1539
- data: l = [],
1540
- isFetching: C,
1541
- isError: z,
1542
- originalArgs: dt
1543
- } = Ke(
1544
- { entityType: S, entities: W },
1565
+ data: _ = [],
1566
+ isFetching: Q,
1567
+ isError: ke,
1568
+ originalArgs: Ce
1569
+ } = Xe(
1570
+ { entityType: D, entities: z },
1545
1571
  {
1546
- skip: !W.length || !Ft.includes(S)
1572
+ skip: !z.length || !Ot.includes(D)
1547
1573
  }
1548
1574
  );
1549
- H(() => {
1550
- g || te();
1551
- }, [dt, g]);
1552
- const ke = ee(null);
1553
- H(() => {
1554
- I || (ke.current = null);
1555
- }, [I]), H(() => {
1556
- if (!C && (I?.source === "uri" || I?.source === "url") && I?.entities?.length && N) {
1557
- const v = I.entities[0].id;
1558
- if (ke.current === v) return;
1559
- const F = l.find((M) => M.id === v);
1560
- if (!F) return;
1561
- ke.current = v, N(F, I.source);
1575
+ B(() => {
1576
+ g || ee();
1577
+ }, [Ce, g]);
1578
+ const ge = Z(null);
1579
+ B(() => {
1580
+ P || (ge.current = null);
1581
+ }, [P]), B(() => {
1582
+ if (!Q && (P?.source === "uri" || P?.source === "url") && P?.entities?.length && N) {
1583
+ const v = P.entities[0].id;
1584
+ if (ge.current === v) return;
1585
+ const O = _.find((H) => H.id === v);
1586
+ if (!O) return;
1587
+ ge.current = v, N(O, P.source);
1562
1588
  }
1563
- }, [l, C, I, N]);
1564
- const Fe = st(f), G = Q[0], Ae = f[G] || {}, _ = l[0] || {}, ge = l[l.length - 1], we = Q[Q.length - 1], Oe = x === "inbox" && S === "version" && l.length === 1 ? Gn(l[0]) : void 0, [Re, ut] = ns({
1565
- entity: _,
1566
- entityType: S,
1567
- projectName: G,
1568
- isLoading: C
1569
- }), { setEntityUri: pt, setUri: je } = on();
1570
- H(() => {
1571
- if (!ge?.parents || !we) return;
1572
- const { folderPath: v, taskName: F, versionName: M, productName: Le } = Zt(
1573
- ge.parents,
1574
- S,
1575
- ge.name
1589
+ }, [_, Q, P, N]);
1590
+ const fe = ot(f), l = J[0], S = f[l] || {}, I = _[0] || {}, q = _[_.length - 1], Te = J[J.length - 1], je = x === "inbox" && D === "version" && _.length === 1 ? Ks(_[0]) : void 0, [Re, pt] = on({
1591
+ entity: I,
1592
+ entityType: D,
1593
+ projectName: l,
1594
+ isLoading: Q
1595
+ }), { setEntityUri: ht, setUri: Ve } = rs();
1596
+ B(() => {
1597
+ if (!q?.parents || !Te) return;
1598
+ const { folderPath: v, taskName: O, versionName: H, productName: _e } = ts(
1599
+ q.parents,
1600
+ D,
1601
+ q.name
1576
1602
  );
1577
- return pt({
1578
- projectName: we,
1603
+ return ht({
1604
+ projectName: Te,
1579
1605
  folderPath: v,
1580
- taskName: F,
1581
- productName: Le,
1582
- versionName: M
1606
+ taskName: O,
1607
+ productName: _e,
1608
+ versionName: H
1583
1609
  }), () => {
1584
- je("");
1610
+ Ve("");
1585
1611
  };
1586
- }, [l, Q, S]), Fn({
1587
- entityData: ge,
1588
- project: we,
1589
- activeEntityType: S,
1590
- entitiesToQuery: W
1612
+ }, [_, J, D]), js({
1613
+ entityData: q,
1614
+ project: Te,
1615
+ activeEntityType: D,
1616
+ entitiesToQuery: z
1591
1617
  });
1592
- const ht = () => {
1593
- be(
1618
+ const mt = () => {
1619
+ ve(
1594
1620
  (v) => {
1595
- const F = new URLSearchParams(v);
1596
- return F.delete("project"), F.delete("type"), F.delete("id"), F;
1621
+ const O = new URLSearchParams(v);
1622
+ return O.delete("project"), O.delete("type"), O.delete("id"), O;
1597
1623
  },
1598
1624
  { replace: !0 }
1599
1625
  );
1600
- }, xe = () => {
1601
- j?.(), oe(null), je(""), ht(), te();
1626
+ }, Ne = () => {
1627
+ U?.(), ae(null), Ve(""), mt(), ee();
1602
1628
  };
1603
- H(() => {
1604
- const v = (F) => {
1605
- if (F.key === "Escape" && j) {
1606
- const M = F.target;
1607
- if (["INPUT", "TEXTAREA", "SELECT"].includes(M.tagName) || M.isContentEditable || g === !1 && (M.closest("#viewer-dialog") || X)) return;
1608
- xe();
1629
+ B(() => {
1630
+ const v = (O) => {
1631
+ if (O.key === "Escape" && U) {
1632
+ const H = O.target;
1633
+ if (["INPUT", "TEXTAREA", "SELECT"].includes(H.tagName) || H.isContentEditable || g === !1 && (H.closest("#viewer-dialog") || W)) return;
1634
+ Ne();
1609
1635
  }
1610
1636
  };
1611
1637
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
1612
- }, [xe, g, X]);
1613
- const { requestPipWindow: mt } = rn(), Ve = ee(null), Ue = ee(null), gt = l.length === 1 && S !== "representation", ft = D(() => {
1614
- const v = _?.label || _?.name || "", F = _?.parents || [], M = [G];
1615
- switch (S) {
1638
+ }, [Ne, g, W]);
1639
+ const { requestPipWindow: gt } = ls(), $e = Z(null), Le = Z(null), ft = _.length === 1 && D !== "representation", bt = C(() => {
1640
+ const v = I?.label || I?.name || "", O = I?.parents || [], H = [l];
1641
+ switch (D) {
1616
1642
  case "folder":
1617
1643
  case "task":
1618
1644
  case "product":
1619
- M.push(F.at(-1), v);
1645
+ H.push(O.at(-1), v);
1620
1646
  break;
1621
1647
  case "version":
1622
- M.push(F.at(-2), F.at(-1), v);
1648
+ H.push(O.at(-2), O.at(-1), v);
1623
1649
  break;
1624
1650
  case "representation":
1625
- M.push(F.at(-3), F.at(-2), F.at(-1), v);
1651
+ H.push(O.at(-3), O.at(-2), O.at(-1), v);
1626
1652
  break;
1627
1653
  default:
1628
- M.push(v);
1654
+ H.push(v);
1629
1655
  }
1630
- return M.filter(Boolean).join(" - ");
1631
- }, [_, S, G]), bt = () => {
1632
- ne({
1633
- entityType: S,
1634
- entities: W,
1656
+ return H.filter(Boolean).join(" - ");
1657
+ }, [I, D, l]), vt = () => {
1658
+ te({
1659
+ entityType: D,
1660
+ entities: z,
1635
1661
  scope: x
1636
- }), mt(500, 500);
1637
- }, $e = () => !(Q.length > 1 || ae && (!w || !Object.prototype.hasOwnProperty.call(
1638
- O,
1662
+ }), gt(500, 500);
1663
+ }, Ue = () => !(J.length > 1 || ne && (!w || !Object.prototype.hasOwnProperty.call(
1664
+ R,
1639
1665
  se.attrib?.email || ""
1640
1666
  )));
1641
1667
  return /* @__PURE__ */ i(
1642
- cn,
1668
+ ds,
1643
1669
  {
1644
- thumbnailInputRef: Ve,
1645
- versionsInputRef: Ue,
1646
- canUploadVersion: gt,
1647
- children: /* @__PURE__ */ k(Rn, { className: "details-panel", children: [
1648
- /* @__PURE__ */ k(An, { children: [
1670
+ thumbnailInputRef: $e,
1671
+ versionsInputRef: Le,
1672
+ canUploadVersion: ft,
1673
+ children: /* @__PURE__ */ k($s, { className: "details-panel", children: [
1674
+ /* @__PURE__ */ k(Rs, { children: [
1649
1675
  /* @__PURE__ */ i(
1650
- Jt,
1676
+ Yt,
1651
1677
  {
1652
1678
  segments: Re,
1653
- versions: ut,
1654
- projectName: G,
1679
+ versions: pt,
1680
+ projectName: l,
1655
1681
  hideProjectName: g,
1656
- isLoading: C || !Re.length,
1657
- entityType: S,
1682
+ isLoading: Q || !Re.length,
1683
+ entityType: D,
1658
1684
  scope: x,
1659
- entityTypeIcons: ye
1685
+ entityTypeIcons: re
1660
1686
  }
1661
1687
  ),
1662
- /* @__PURE__ */ k(On, { className: "right-tools", children: [
1688
+ /* @__PURE__ */ k(Vs, { className: "right-tools", children: [
1663
1689
  /* @__PURE__ */ i(
1664
- Zn,
1690
+ sn,
1665
1691
  {
1666
- entityType: S,
1667
- entityId: _?.id,
1668
- entityIds: W.map((v) => v.id).filter(Boolean),
1669
- entityLabel: ft,
1670
- projectName: G,
1671
- selectedEntities: l.filter((v) => !!v?.id).map((v) => {
1672
- const F = v.entityType || S;
1692
+ entityType: D,
1693
+ entityId: I?.id,
1694
+ entityIds: z.map((v) => v.id).filter(Boolean),
1695
+ entityLabel: bt,
1696
+ projectName: l,
1697
+ selectedEntities: _.filter((v) => !!v?.id).map((v) => {
1698
+ const O = v.entityType || D;
1673
1699
  return {
1674
1700
  entityId: v.id,
1675
- entityType: F,
1701
+ entityType: O,
1676
1702
  hasReviewables: !!v.hasReviewables,
1677
1703
  name: v.name,
1678
1704
  label: v.label,
1679
- projectName: v.projectName || G,
1680
- folderId: F === "task" ? v.folder?.id : void 0
1705
+ projectName: v.projectName || l,
1706
+ folderId: O === "task" ? v.folder?.id : void 0
1681
1707
  };
1682
1708
  }),
1683
1709
  entityListsContext: V,
1684
- onOpenPip: bt,
1710
+ onOpenPip: vt,
1685
1711
  onOpenViewer: d,
1686
- productId: _?.product?.id,
1687
- taskId: _?.task?.id,
1688
- folderId: _?.folder?.id
1712
+ productId: I?.product?.id,
1713
+ taskId: I?.task?.id,
1714
+ folderId: I?.folder?.id
1689
1715
  }
1690
1716
  ),
1691
1717
  /* @__PURE__ */ i(
1692
- Gt,
1718
+ qt,
1693
1719
  {
1694
- entities: W,
1695
- entityType: S,
1720
+ entities: z,
1721
+ entityType: D,
1696
1722
  options: r || [],
1697
- onWatchersUpdate: P && P,
1723
+ onWatchersUpdate: A && A,
1698
1724
  userName: se.name
1699
1725
  }
1700
1726
  ),
1701
- j && /* @__PURE__ */ i(
1702
- Z,
1727
+ U && /* @__PURE__ */ i(
1728
+ Y,
1703
1729
  {
1704
1730
  icon: "close",
1705
1731
  variant: "text",
1706
- onClick: xe,
1732
+ onClick: Ne,
1707
1733
  "data-shortcut": "Escape"
1708
1734
  }
1709
1735
  )
1710
1736
  ] })
1711
1737
  ] }),
1712
- Oe && /* @__PURE__ */ i(
1713
- zn,
1738
+ je && /* @__PURE__ */ i(
1739
+ qs,
1714
1740
  {
1715
- latestVersion: Oe,
1716
- resolveVersionJump: L
1741
+ latestVersion: je,
1742
+ resolveVersionJump: M
1717
1743
  }
1718
1744
  ),
1719
1745
  /* @__PURE__ */ i(
1720
- Hn,
1746
+ zs,
1721
1747
  {
1722
- entityType: S,
1723
- entitySubTypes: ve,
1724
- entities: l,
1748
+ entityType: D,
1749
+ entitySubTypes: G,
1750
+ entities: _,
1725
1751
  users: r,
1726
1752
  disabledAssignees: c,
1727
1753
  disabledStatuses: a,
1728
- tagsOptions: s,
1729
- isFetching: C,
1730
- isCompact: R,
1731
- currentTab: $,
1732
- onTabChange: U,
1733
- projectInfo: de,
1754
+ tagsOptions: n,
1755
+ isFetching: Q,
1756
+ isCompact: $,
1757
+ currentTab: L,
1758
+ onTabChange: F,
1759
+ projectInfo: ie,
1734
1760
  onOpenViewer: (v) => d?.(v),
1735
1761
  onEntityFocus: u,
1736
- thumbnailInputRef: Ve,
1737
- versionsInputRef: Ue
1762
+ thumbnailInputRef: $e,
1763
+ versionsInputRef: Le
1738
1764
  }
1739
1765
  ),
1740
- /* @__PURE__ */ k(Ye, { projectName: G, children: [
1741
- ce && !z && /* @__PURE__ */ i(
1742
- at,
1766
+ /* @__PURE__ */ k(et, { projectName: l, children: [
1767
+ de && !ke && /* @__PURE__ */ i(
1768
+ it,
1743
1769
  {
1744
- entityType: S,
1745
- entities: l,
1770
+ entityType: D,
1771
+ entities: _,
1746
1772
  activeUsers: m || [],
1747
- projectInfo: Ae,
1748
- projectName: G,
1749
- disabled: !$e(),
1773
+ projectInfo: S,
1774
+ projectName: l,
1775
+ disabled: !Ue(),
1750
1776
  scope: x,
1751
- statuses: Fe,
1777
+ statuses: fe,
1752
1778
  readOnly: !1,
1753
1779
  entityListId: w,
1754
- annotations: A,
1780
+ annotations: j,
1755
1781
  removeAnnotation: E,
1756
1782
  exportAnnotationComposite: y,
1757
1783
  isSlideOut: g
1758
1784
  }
1759
1785
  ),
1760
- $ === "subtasks" && S === "task" && _?.id && K && /* @__PURE__ */ i(
1761
- fs,
1786
+ L === "subtasks" && D === "task" && I?.id && oe && /* @__PURE__ */ i(
1787
+ kn,
1762
1788
  {
1763
- projectName: G,
1764
- taskId: _.id,
1765
- taskName: _.name,
1766
- folderId: _.folder?.id,
1767
- subtasks: _.task?.subtasks || [],
1768
- SubtasksManager: K,
1769
- useNavigate: le,
1770
- onNotFound: () => U("feed")
1789
+ projectName: l,
1790
+ taskId: I.id,
1791
+ taskName: I.name,
1792
+ folderId: I.folder?.id,
1793
+ subtasks: I.task?.subtasks || [],
1794
+ SubtasksManager: oe,
1795
+ useNavigate: pe,
1796
+ onNotFound: () => F("feed")
1771
1797
  }
1772
1798
  ),
1773
- $ === "files" && /* @__PURE__ */ i(
1774
- Wn,
1799
+ L === "files" && /* @__PURE__ */ i(
1800
+ Qs,
1775
1801
  {
1776
- entities: l,
1802
+ entities: _,
1777
1803
  scope: x,
1778
- isLoadingVersion: C
1804
+ isLoadingVersion: Q
1779
1805
  }
1780
1806
  ),
1781
- $ === "details" && /* @__PURE__ */ i(
1782
- ss,
1807
+ L === "details" && /* @__PURE__ */ i(
1808
+ rn,
1783
1809
  {
1784
- entityType: S,
1785
- entities: l,
1810
+ entityType: D,
1811
+ entities: _,
1786
1812
  activeUsers: m || [],
1787
- projectInfo: Ae,
1788
- projectName: G,
1789
- disabled: !$e(),
1813
+ projectInfo: S,
1814
+ projectName: l,
1815
+ disabled: !Ue(),
1790
1816
  scope: x,
1791
- statuses: Fe,
1817
+ statuses: fe,
1792
1818
  readOnly: !1,
1793
- annotations: A,
1819
+ annotations: j,
1794
1820
  removeAnnotation: E,
1795
1821
  exportAnnotationComposite: y,
1796
1822
  children: /* @__PURE__ */ i(
1797
- Qt,
1823
+ Kt,
1798
1824
  {
1799
- entities: l,
1800
- isLoading: C
1825
+ entities: _,
1826
+ isLoading: Q
1801
1827
  }
1802
1828
  )
1803
1829
  }
@@ -1806,14 +1832,14 @@ const An = T(ze)`
1806
1832
  ] })
1807
1833
  }
1808
1834
  );
1809
- }, ys = ({
1835
+ }, Sn = ({
1810
1836
  isOpen: e,
1811
- entityType: n,
1837
+ entityType: s,
1812
1838
  ...t
1813
1839
  }) => {
1814
- const { entities: o } = q();
1815
- return !e && !o || !n && !o ? null : /* @__PURE__ */ i(vs, { ...t, entityType: n || o?.entityType });
1816
- }, ks = Tt`
1840
+ const { entities: o } = K();
1841
+ return !e && !o || !s && !o ? null : /* @__PURE__ */ i(xn, { ...t, entityType: s || o?.entityType });
1842
+ }, Cn = Et`
1817
1843
  from {
1818
1844
  translate: 0 0;
1819
1845
  }
@@ -1821,7 +1847,7 @@ to {
1821
1847
  translate: calc(-100% - 8px) 0;
1822
1848
 
1823
1849
  }
1824
- `, ws = T.div`
1850
+ `, Tn = T.div`
1825
1851
  position: absolute;
1826
1852
  left: 0;
1827
1853
  top: 0;
@@ -1830,14 +1856,14 @@ to {
1830
1856
  width: 100%;
1831
1857
  max-width: 533px;
1832
1858
 
1833
- animation: ${ks} 0.2s ease forwards;
1834
- `, ka = ({ projectsInfo: e, scope: n }) => {
1835
- const { slideOut: t, onOpenViewer: o } = q(), { entityType: s, entityId: a, projectName: r } = t || {}, c = !!s && !!a && !!r, { data: m } = qe({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: p = [] } = f, { closeSlideOut: g } = q(), b = () => g(), x = (R) => o?.(R);
1836
- return c ? /* @__PURE__ */ i(ws, { children: /* @__PURE__ */ i(
1837
- ys,
1859
+ animation: ${Cn} 0.2s ease forwards;
1860
+ `, Ca = ({ projectsInfo: e, scope: s }) => {
1861
+ const { slideOut: t, onOpenViewer: o } = K(), { entityType: n, entityId: a, projectName: r } = t || {}, c = !!n && !!a && !!r, { data: m } = Je({ projectName: r }, { skip: !r }), f = e[r || ""] || {}, { tags: p = [] } = f, { closeSlideOut: g } = K(), b = () => g(), x = ($) => o?.($);
1862
+ return c ? /* @__PURE__ */ i(Tn, { children: /* @__PURE__ */ i(
1863
+ Sn,
1838
1864
  {
1839
1865
  isOpen: !0,
1840
- entityType: s,
1866
+ entityType: n,
1841
1867
  entitySubTypes: [],
1842
1868
  entities: [{ id: a, projectName: r }],
1843
1869
  projectsInfo: { [r]: f },
@@ -1846,26 +1872,26 @@ to {
1846
1872
  projectUsers: m,
1847
1873
  activeProjectUsers: m,
1848
1874
  isSlideOut: !0,
1849
- scope: n,
1875
+ scope: s,
1850
1876
  onClose: b,
1851
1877
  onOpenViewer: x
1852
1878
  }
1853
1879
  ) }) : null;
1854
1880
  };
1855
- T(Pn)`
1881
+ T(Os)`
1856
1882
  .p-dialog-header-icons {
1857
1883
  display: none;
1858
1884
  }
1859
1885
  .p-dialog-content {
1860
1886
  }
1861
1887
  `;
1862
- const xs = T.div`
1888
+ const Nn = T.div`
1863
1889
  display: flex;
1864
1890
  flex-direction: column;
1865
1891
  margin: -8px;
1866
1892
  width: calc(100% + 16px);
1867
1893
  height: calc(100% + 16px);
1868
- `, Ss = T.header`
1894
+ `, En = T.header`
1869
1895
  display: flex;
1870
1896
  align-items: flex-start;
1871
1897
  gap: var(--base-gap-large);
@@ -1877,7 +1903,7 @@ const xs = T.div`
1877
1903
  display: none;
1878
1904
  }
1879
1905
  }
1880
- `, Cs = T.div`
1906
+ `, Dn = T.div`
1881
1907
  display: flex;
1882
1908
  flex-direction: column;
1883
1909
  height: 100%;
@@ -1914,12 +1940,12 @@ const xs = T.div`
1914
1940
  align-items: center;
1915
1941
  gap: var(--base-gap-medium);
1916
1942
  }
1917
- `, Ts = T.div`
1943
+ `, In = T.div`
1918
1944
  display: flex;
1919
1945
  justify-content: space-between;
1920
1946
  padding: 8px;
1921
1947
  padding-top: 0;
1922
- `, Ns = T.div`
1948
+ `, Pn = T.div`
1923
1949
  border-top: solid 1px var(--md-sys-color-outline-variant);
1924
1950
  height: 100%;
1925
1951
  overflow: hidden;
@@ -1938,7 +1964,7 @@ const xs = T.div`
1938
1964
  display: none;
1939
1965
  }
1940
1966
  }
1941
- `, Es = T.div`
1967
+ `, Fn = T.div`
1942
1968
  display: flex;
1943
1969
  align-items: center;
1944
1970
  gap: var(--base-gap-small);
@@ -1949,84 +1975,84 @@ const xs = T.div`
1949
1975
  .icon {
1950
1976
  font-variation-settings: 'FILL' 1;
1951
1977
  }
1952
- `, wa = () => {
1953
- const { pip: e } = q(), n = e?.entityType, t = e?.entities || [], o = e?.scope || "", s = t.length > 0 && !!n, a = t.map((y) => y.projectName), { data: r = [] } = At({ projects: a }, { skip: !s }), { data: c = {}, isFetching: m } = Ot(
1978
+ `, Ta = () => {
1979
+ const { pip: e } = K(), s = e?.entityType, t = e?.entities || [], o = e?.scope || "", n = t.length > 0 && !!s, a = t.map((y) => y.projectName), { data: r = [] } = jt({ projects: a }, { skip: !n }), { data: c = {}, isFetching: m } = Rt(
1954
1980
  {
1955
1981
  projects: a
1956
1982
  },
1957
- { skip: !s }
1958
- ), f = D(
1959
- () => st(c, a),
1983
+ { skip: !n }
1984
+ ), f = C(
1985
+ () => ot(c, a),
1960
1986
  [c, a]
1961
- ), { data: p = [], isFetching: g } = Ke(
1987
+ ), { data: p = [], isFetching: g } = Xe(
1962
1988
  // @ts-expect-error
1963
- { entityType: n, entities: t },
1989
+ { entityType: s, entities: t },
1964
1990
  {
1965
- skip: !s || m
1991
+ skip: !n || m
1966
1992
  }
1967
- ), b = D(
1968
- () => ot(c, a),
1993
+ ), b = C(
1994
+ () => rt(c, a),
1969
1995
  [c, a]
1970
- ), x = D(
1996
+ ), x = C(
1971
1997
  () => ({
1972
1998
  task: b.taskTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
1973
1999
  folder: b.folderTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {}),
1974
2000
  product: b.productTypes.filter((y) => !!y.icon).reduce((y, w) => ({ ...y, [w.name]: w.icon }), {})
1975
2001
  }),
1976
2002
  [b]
1977
- ), R = D(
1978
- () => n ? et(p, n, x) : [],
1979
- [p, n]
1980
- ), j = D(() => r.filter((y) => p.some((w) => w?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), P = p[0];
1981
- if (!p.length || !P) return null;
2003
+ ), $ = C(
2004
+ () => s ? st(p, s, x) : [],
2005
+ [p, s]
2006
+ ), U = C(() => r.filter((y) => p.some((w) => w?.task?.assignees?.includes(y.name))).map((y) => ({ ...y, avatarUrl: `/api/users/${y.name}/avatar` })), [r, t]), A = p[0];
2007
+ if (!p.length || !A) return null;
1982
2008
  if (g) return /* @__PURE__ */ i("div", { children: "Loading..." });
1983
- const d = P?.projectName, N = p.some((y) => y?.status !== P?.status) ? {
2009
+ const d = A?.projectName, N = p.some((y) => y?.status !== A?.status) ? {
1984
2010
  icon: "question_mark",
1985
2011
  color: "var(--md-sys-color-surface-container-highest)",
1986
2012
  name: "Mixed statuses"
1987
- } : f.find((y) => y.name === P?.status) || {
2013
+ } : f.find((y) => y.name === A?.status) || {
1988
2014
  icon: "",
1989
2015
  color: "",
1990
2016
  name: "None"
1991
2017
  };
1992
- if (!n) return null;
1993
- const { title: A, subTitle: E } = nt(p, n);
1994
- return /* @__PURE__ */ i(ln, { children: /* @__PURE__ */ i(Ye, { projectName: d, children: /* @__PURE__ */ k(xs, { children: [
1995
- /* @__PURE__ */ k(Ss, { children: [
1996
- /* @__PURE__ */ i(Je, { thumbnails: R }),
1997
- /* @__PURE__ */ k(Cs, { children: [
1998
- /* @__PURE__ */ i("h2", { children: A }),
2018
+ if (!s) return null;
2019
+ const { title: j, subTitle: E } = at(p, s);
2020
+ return /* @__PURE__ */ i(cs, { children: /* @__PURE__ */ i(et, { projectName: d, children: /* @__PURE__ */ k(Nn, { children: [
2021
+ /* @__PURE__ */ k(En, { children: [
2022
+ /* @__PURE__ */ i(Ye, { thumbnails: $ }),
2023
+ /* @__PURE__ */ k(Dn, { children: [
2024
+ /* @__PURE__ */ i("h2", { children: j }),
1999
2025
  /* @__PURE__ */ k("div", { className: "sub-title", children: [
2000
2026
  /* @__PURE__ */ k("span", { children: [
2001
- Xe(n),
2027
+ Ze(s),
2002
2028
  " - "
2003
2029
  ] }),
2004
2030
  /* @__PURE__ */ i("h3", { children: E })
2005
2031
  ] })
2006
2032
  ] })
2007
2033
  ] }),
2008
- /* @__PURE__ */ k(Ts, { children: [
2034
+ /* @__PURE__ */ k(In, { children: [
2009
2035
  /* @__PURE__ */ k(
2010
- Es,
2036
+ Fn,
2011
2037
  {
2012
2038
  style: {
2013
2039
  backgroundColor: N?.color,
2014
- color: Ee(N?.color)
2040
+ color: Fe(N?.color)
2015
2041
  },
2016
2042
  children: [
2017
- /* @__PURE__ */ i(fe, { icon: N.icon || "question_mark", style: { color: "inherit" } }),
2043
+ /* @__PURE__ */ i(we, { icon: N.icon || "question_mark", style: { color: "inherit" } }),
2018
2044
  /* @__PURE__ */ i("span", { className: "label", children: N?.name })
2019
2045
  ]
2020
2046
  }
2021
2047
  ),
2022
- /* @__PURE__ */ i(xt, { users: j, style: { pointerEvents: "none" } })
2048
+ /* @__PURE__ */ i(Ct, { users: U, style: { pointerEvents: "none" } })
2023
2049
  ] }),
2024
- /* @__PURE__ */ i(Ns, { children: /* @__PURE__ */ i(
2025
- at,
2050
+ /* @__PURE__ */ i(Pn, { children: /* @__PURE__ */ i(
2051
+ it,
2026
2052
  {
2027
- entityType: n,
2053
+ entityType: s,
2028
2054
  entities: p,
2029
- thumbnailHash: P?.thumbnailHash,
2055
+ thumbnailHash: A?.thumbnailHash,
2030
2056
  activeUsers: [],
2031
2057
  projectInfo: c[d],
2032
2058
  projectName: d,
@@ -2039,23 +2065,23 @@ const xs = T.div`
2039
2065
  ] }) }) });
2040
2066
  };
2041
2067
  export {
2042
- Wt as AssigneeSelect,
2043
- Ca as CloseButton,
2044
- Lt as Content,
2045
- Ta as ContentRow,
2046
- ys as DetailsPanel,
2047
- wa as DetailsPanelFloating,
2048
- ka as DetailsPanelSlideOut,
2049
- Na as Footer,
2068
+ Gt as AssigneeSelect,
2069
+ Da as CloseButton,
2070
+ Mt as Content,
2071
+ Ia as ContentRow,
2072
+ Sn as DetailsPanel,
2073
+ Ta as DetailsPanelFloating,
2074
+ Ca as DetailsPanelSlideOut,
2075
+ Pa as Footer,
2050
2076
  Ut as Grid,
2051
- $t as Header,
2052
- Vt as HeaderContainer,
2053
- Ea as LabelWrapper,
2054
- zt as PriorityEnumDropdown,
2055
- Ht as ReadOnlyTags,
2056
- Bt as StatusSelect,
2057
- Mt as TagsSelect,
2058
- Da as ThumbnailWrapper,
2059
- _t as Title,
2060
- bs as entitiesWithoutFeed
2077
+ _t as Header,
2078
+ Lt as HeaderContainer,
2079
+ Fa as LabelWrapper,
2080
+ Qt as PriorityEnumDropdown,
2081
+ Wt as ReadOnlyTags,
2082
+ zt as StatusSelect,
2083
+ Bt as TagsSelect,
2084
+ Aa as ThumbnailWrapper,
2085
+ Ht as Title,
2086
+ wn as entitiesWithoutFeed
2061
2087
  };