@ynput/ayon-frontend-shared 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +17 -14
  46. package/dist/types/ContextMenu.d.ts +17 -14
  47. package/dist/types/DetailsPanel.d.ts +17 -14
  48. package/dist/types/EntityPickerDialog.d.ts +17 -14
  49. package/dist/types/Feed.d.ts +17 -14
  50. package/dist/types/ListTable.d.ts +17 -14
  51. package/dist/types/NewEntity.d.ts +17 -14
  52. package/dist/types/ProjectTreeTable.d.ts +749 -15
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +17 -14
  55. package/dist/types/SimpleTable.d.ts +31 -14
  56. package/dist/types/Slicer.d.ts +18 -14
  57. package/dist/types/Views.d.ts +17 -14
  58. package/dist/types/api.d.ts +17 -14
  59. package/dist/types/components.d.ts +822 -25
  60. package/dist/types/context.d.ts +53 -15
  61. package/dist/types/hooks.d.ts +17 -14
  62. package/dist/types/index.d.ts +17 -14
  63. package/dist/types/util.d.ts +21 -14
  64. package/dist/util.es.js +152 -144
  65. package/package.json +16 -9
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
@@ -1,45 +1,47 @@
1
- import { C as $e, S as ze, A as ke, a as Ke, T as je, D as Xe, b as Je, c as Qe, d as Oe, e as Se, f as qe, g as Ze, h as et, M as tt, F as at, i as st, j as ot, k as nt, l as rt } from "./chunks/ReviewablesSelector.es.js";
2
- import { m as cs, n as ds, o as ps, p as fs, q as ms, r as hs, s as gs, E as bs, t as ws, u as ys, v as vs, w as Es, x as Cs, G as ks, y as Os, L as Ss, P as Ts, z as Ds, R as Vs, B as Rs, H as Is, I as As, J as xs, K as _s, N as Fs, O as Ps, Q as Ns, U as Ms, V as Ls, W as Bs, X as Us, Y as Gs, Z as Ws } from "./chunks/ReviewablesSelector.es.js";
3
- import { jsxs as H, jsx as C } from "react/jsx-runtime";
4
- import { useState as F, useRef as oe, useCallback as ee, useEffect as z, useMemo as me, useContext as lt } from "react";
5
- import { matchSorter as Te } from "match-sorter";
6
- import { InputText as it, Icon as ie, Section as ut, SEARCH_FILTER_ID as ct } from "@ynput/ayon-react-components";
7
- import ce from "clsx";
8
- import { B as Ys, a as $s, S as zs } from "./chunks/SimpleForm.es.js";
9
- import { d as dt, P as pt } from "./chunks/MetaWidget.es.js";
10
- import { A as js, j as Xs, D as Js, E as Qs, k as qs, L as Zs, l as eo, m as to, n as ao, o as so } from "./chunks/MetaWidget.es.js";
11
- import { createPortal as ft } from "react-dom";
12
- import { format as le, parseISO as Ne, isValid as Me } from "date-fns";
13
- import { B as De, e as Le, g as we, h as ye } from "./chunks/PlayableIcon.es.js";
14
- import { $ as no, j as ro, k as lo, l as io, m as uo, n as co, o as po, q as fo, A as mo, C as ho, a as go, r as bo, D as wo, s as yo, t as vo, F as Eo, I as Co, u as ko, v as Oo, w as So, x as To, y as Do, M as Vo, z as Ro, E as Io, N as Ao, U as xo, Y as _o, G as Fo, H as Po, J as No, K as Mo, d as Lo, f as Bo, L as Uo, O as Go, P as Wo, Q as Ho, R as Yo, S as $o, T as zo, V as Ko, W as jo, X as Xo, p as Jo, Z as Qo } from "./chunks/PlayableIcon.es.js";
15
- import { d as Be, x as mt, a as ht, e as gt } from "./chunks/TableExportContextInstance.es.js";
16
- import { f as Zo, D as en, R as tn } from "./chunks/TableExportContextInstance.es.js";
17
- import { p as bt, a as Ve } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
- import { D as sn, b as on, c as nn, d as rn, e as ln, s as un } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
19
- import { D as dn } from "./chunks/DetailsDialog.es.js";
20
- import { q as wt, r as yt, n as vt } from "./chunks/Watchers.es.js";
21
- import { s as fn, t as mn, v as hn, R as gn, c as bn, b as wn, w as yn, x as vn, W as En, u as Cn } from "./chunks/Watchers.es.js";
22
- import { E as On, P as Sn } from "./chunks/EmptyPlaceholder.es.js";
23
- import { E as Dn, a as Vn } from "./chunks/EmptyPlaceholderFlex.styled.es.js";
24
- import { I as In } from "./chunks/InfoMessage.es.js";
25
- import { J as xn } from "./chunks/JsonViewer.es.js";
26
- import { E as Fn, a as Pn, R as Nn, g as Mn } from "./chunks/EntityPath.es.js";
27
- import { E as Bn, a as Un } from "./chunks/EntityTooltip.es.js";
28
- import { bB as Re, bA as Et, bD as Ct } from "./chunks/searchTerms.es.js";
29
- import { bP as kt, bU as Ot, cB as St, aO as Tt, aT as Dt, bK as Vt, br as Rt, du as It, ce as At, bS as xt } from "./chunks/getUris.es.js";
1
+ import { C as rt, S as lt, A as Ce, a as it, T as ct, D as ut, b as dt, c as pt, d as Oe, e as Te, f as ft, g as mt, h as ht, M as gt, F as bt, i as wt, j as yt, k as vt, l as Et, m as St, B as kt, L as Ct, n as Ot, o as Tt, p as It, q as Dt, r as Pt } from "./chunks/ReviewablesSelector.es.js";
2
+ import { s as uo, t as po, u as fo, v as mo, w as ho, x as go, y as bo, E as wo, z as yo, G as vo, H as Eo, I as So, J as ko, K as Co, N as Oo, O as To, P as Io, Q as Do, R as Po, U as Vo, V as Ao, W as Ro, X as xo, Y as Fo, Z as _o, _ as Lo, $ as Mo, a0 as No, a1 as Bo, a2 as Uo, a3 as $o, a4 as Go, a5 as zo } from "./chunks/ReviewablesSelector.es.js";
3
+ import { jsxs as B, jsx as b, Fragment as ce } from "react/jsx-runtime";
4
+ import { useState as F, useRef as re, useCallback as q, useEffect as G, useMemo as Y, createElement as Vt, useContext as At } from "react";
5
+ import { matchSorter as Ie } from "match-sorter";
6
+ import { InputText as $e, Icon as de, Panel as De, InputPassword as Rt, Button as Pe, Section as xt, SEARCH_FILTER_ID as Ft } from "@ynput/ayon-react-components";
7
+ import fe from "clsx";
8
+ import { B as Wo, a as Yo, S as jo } from "./chunks/SimpleForm.es.js";
9
+ import { e as Ge, P as _t } from "./chunks/MetaWidget.es.js";
10
+ import { A as qo, k as Qo, l as Xo, m as Jo, n as Zo, L as en, o as tn, q as sn, r as an, s as on } from "./chunks/MetaWidget.es.js";
11
+ import { createPortal as Lt } from "react-dom";
12
+ import { format as ue, parseISO as ze, isValid as He } from "date-fns";
13
+ import { B as Ve, e as We, g as ye, h as ve } from "./chunks/PlayableIcon.es.js";
14
+ import { $ as rn, j as ln, k as cn, l as un, m as dn, n as pn, o as fn, q as mn, A as hn, C as gn, a as bn, r as wn, D as yn, s as vn, t as En, F as Sn, I as kn, u as Cn, v as On, w as Tn, x as In, y as Dn, M as Pn, z as Vn, E as An, N as Rn, U as xn, Y as Fn, G as _n, H as Ln, J as Mn, K as Nn, d as Bn, f as Un, L as $n, O as Gn, P as zn, Q as Hn, R as Wn, S as Yn, T as jn, V as Kn, W as qn, X as Qn, p as Xn, Z as Jn } from "./chunks/PlayableIcon.es.js";
15
+ import { d as Ye, x as je, b as Mt, e as Ke, y as Nt, u as Bt } from "./chunks/TableExportContextInstance.es.js";
16
+ import { f as er, D as tr, H as sr } from "./chunks/TableExportContextInstance.es.js";
17
+ import { p as Ut, d as Ae } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
+ import { e as or, D as nr, b as rr, a as lr, c as ir, s as cr } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
19
+ import { D as dr } from "./chunks/DetailsDialog.es.js";
20
+ import { q as $t, r as Gt, b as zt } from "./chunks/Watchers.es.js";
21
+ import { s as fr, t as mr, v as hr, R as gr, h as br, g as wr, w as yr, x as vr, W as Er, i as Sr } from "./chunks/Watchers.es.js";
22
+ import { E as Cr, P as Or } from "./chunks/EmptyPlaceholder.es.js";
23
+ import { E as Ir, a as Dr } from "./chunks/EmptyPlaceholderFlex.styled.es.js";
24
+ import { I as Vr } from "./chunks/InfoMessage.es.js";
25
+ import { J as Rr } from "./chunks/JsonViewer.es.js";
26
+ import { E as Fr, a as _r, R as Lr, g as Mr } from "./chunks/EntityPath.es.js";
27
+ import { a as Br, E as Ur } from "./chunks/EntityTooltip.es.js";
28
+ import { a as Re, bB as xe, bA as Ht, bD as Wt } from "./chunks/searchTerms.es.js";
29
+ import { bP as Yt, bU as jt, cB as Kt, aO as qt, aT as Qt, bK as Xt, br as Jt, du as Zt, co as es, ca as ts, ce as ss, bS as as } from "./chunks/getUris.es.js";
30
30
  export * from "primereact/confirmdialog";
31
31
  import "@module-federation/enhanced/runtime";
32
- import { toast as he } from "react-toastify";
33
- import { isEmpty as _t, upperFirst as de } from "lodash";
32
+ import { reportContributionError as qe, loadPiece as os } from "@ynput/ayon-addon/host";
33
+ import { toast as Q } from "react-toastify";
34
+ import { isEmpty as ns, upperFirst as me } from "lodash";
34
35
  import "uuid";
35
- import { a as Ft } from "./chunks/afterStartup.es.js";
36
+ import { a as rs } from "./chunks/afterStartup.es.js";
37
+ import Fe from "axios";
36
38
  import "semver";
37
39
  import "./chunks/ContextMenuContextInstance.es.js";
38
- import "react-redux";
39
- import { useSearchParams as Pt, useLocation as Nt, useNavigate as Mt, useParams as Lt } from "react-router-dom";
40
- import { F as Bt } from "./chunks/ColumnDropIndicator.styled.es.js";
41
- import { C as Hn, S as Yn, b as $n, u as zn } from "./chunks/ColumnDropIndicator.styled.es.js";
42
- import { F as jn } from "./chunks/FilterErrorActions.es.js";
40
+ import { useDispatch as ls } from "react-redux";
41
+ import { useSearchParams as is, useLocation as cs, useNavigate as Qe, useParams as us } from "react-router-dom";
42
+ import { F as ds } from "./chunks/ColumnDropIndicator.styled.es.js";
43
+ import { C as zr, S as Hr, b as Wr, u as Yr } from "./chunks/ColumnDropIndicator.styled.es.js";
44
+ import { F as Kr } from "./chunks/FilterErrorActions.es.js";
43
45
  import "lexical";
44
46
  import "@lexical/markdown";
45
47
  import "@lexical/code";
@@ -49,344 +51,352 @@ import "@lexical/selection";
49
51
  import "@lexical/utils";
50
52
  import "@lexical/react/LexicalBlockWithAlignableContents";
51
53
  import "@lexical/react/LexicalDecoratorBlockNode";
52
- import { m as Jn, r as Qn, a as qn, u as Zn } from "./chunks/useDateRangeFilter.es.js";
53
- import { T as tr } from "./chunks/TableSettingsFallback.es.js";
54
- import { a as Ut, b as Gt } from "./chunks/viewUpdateHelper.es.js";
55
- import { h as Wt, c as Ht, b as Yt, e as $t } from "./chunks/Slicer.es.js";
56
- import { p as sr, q as or } from "./chunks/Slicer.es.js";
57
- import { Splitter as zt, SplitterPanel as Ie } from "primereact/splitter";
58
- import { g as se } from "./chunks/getEntityTypeIcon.es.js";
59
- import { g as $ } from "./chunks/iconUtils.es.js";
60
- import { C as rr, T as lr } from "./chunks/ThumbnailSimple.es.js";
61
- import { S as ur } from "./chunks/SimpleFormDialog.es.js";
62
- import { T as dr } from "./chunks/EntityPickerDialog.es.js";
63
- import { e as Kt } from "./chunks/extractVersionFromFilename.es.js";
64
- import { b as jt, c as Xt, v as Jt } from "./chunks/versionUploadHelpers.es.js";
65
- import { p as Qt } from "./chunks/parseFilename.es.js";
66
- import { V as qt } from "./chunks/VersionUploadContextInstance.es.js";
67
- import { u as fr, a as mr } from "./chunks/VersionUploadContextInstance.es.js";
68
- import { b as gr, c as br, a as wr, M as yr, d as vr } from "./chunks/Menu.es.js";
69
- import { C as Cr } from "./chunks/ColumnHeaderMenuUI.es.js";
70
- const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
54
+ import { m as Qr, r as Xr, a as Jr, u as Zr } from "./chunks/useDateRangeFilter.es.js";
55
+ import { T as tl } from "./chunks/TableSettingsFallback.es.js";
56
+ import { useContributions as ps, ContributionView as Xe, ProjectPageLayout as fs, Slicer as ms, prefetchPiece as hs, runContribution as gs } from "@ynput/ayon-addon";
57
+ import { a as Je, b as bs } from "./chunks/viewUpdateHelper.es.js";
58
+ import ws from "remark-gfm";
59
+ import ys from "react-markdown";
60
+ import { Splitter as vs, SplitterPanel as _e } from "primereact/splitter";
61
+ import { o as Es, h as Ss, e as ks } from "./chunks/Slicer.es.js";
62
+ import { p as al, q as ol } from "./chunks/Slicer.es.js";
63
+ import "./chunks/NewEntityContextInstance.es.js";
64
+ import { V as Cs } from "./chunks/VersionUploadContextInstance.es.js";
65
+ import { u as rl, a as ll } from "./chunks/VersionUploadContextInstance.es.js";
66
+ import "@tanstack/react-table";
67
+ import { M as Os, a as Ts } from "./chunks/Menu.es.js";
68
+ import { b as cl, c as ul, d as dl } from "./chunks/Menu.es.js";
69
+ import { A as Is } from "./chunks/SimpleTable.es.js";
70
+ import { f as fl } from "./chunks/SimpleTable.es.js";
71
+ import { g as ne } from "./chunks/getEntityTypeIcon.es.js";
72
+ import { g as K } from "./chunks/iconUtils.es.js";
73
+ import { C as hl, T as gl } from "./chunks/ThumbnailSimple.es.js";
74
+ import { S as wl } from "./chunks/SimpleFormDialog.es.js";
75
+ import { T as vl } from "./chunks/EntityPickerDialog.es.js";
76
+ import { e as Ds } from "./chunks/extractVersionFromFilename.es.js";
77
+ import { b as Ps, c as Vs, v as As } from "./chunks/versionUploadHelpers.es.js";
78
+ import { p as Rs } from "./chunks/parseFilename.es.js";
79
+ import { C as Sl } from "./chunks/ColumnHeaderMenuUI.es.js";
80
+ const Le = 500, xs = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ga = ({
71
81
  shareOptions: t,
72
82
  existingAccess: e,
73
- owner: i,
74
- placeholder: u = "Add people or access groups",
83
+ owner: n,
84
+ placeholder: i = "Add people or access groups",
75
85
  disabled: o = !1,
76
- mode: a = "internal",
77
- onSelectOption: s,
78
- pt: h,
86
+ mode: s = "internal",
87
+ onSelectOption: a,
88
+ pt: g,
79
89
  ...l
80
90
  }) => {
81
- const [m, n] = F(""), [E, v] = F(!1), [T, f] = F(-1), A = oe(null), R = t.filter((D) => !e.includes(D.value)).toSorted((D, b) => {
82
- const w = (p) => p.value === "__everyone__" ? 0 : p.value.startsWith("__") ? 1 : p.value.startsWith("team:") ? 2 : p.value.startsWith("group:") ? 3 : p.value.startsWith("user:") ? 4 : 5, S = w(D), r = w(b);
83
- return S !== r ? S - r : D.label.localeCompare(b.label);
84
- }), g = (m ? Te(R, m, {
91
+ const [d, r] = F(""), [k, v] = F(!1), [O, m] = F(-1), R = re(null), T = t.filter((C) => !e.includes(C.value)).toSorted((C, h) => {
92
+ const y = (f) => f.value === "__everyone__" ? 0 : f.value.startsWith("__") ? 1 : f.value.startsWith("team:") ? 2 : f.value.startsWith("group:") ? 3 : f.value.startsWith("user:") ? 4 : 5, S = y(C), c = y(h);
93
+ return S !== c ? S - c : C.label.localeCompare(h.label);
94
+ }), w = (d ? Ie(T, d, {
85
95
  keys: ["name", "label", "value"],
86
- threshold: Te.rankings.CONTAINS
87
- }) : R).slice(0, Ae), V = Zt.test(m) && !t.some((D) => D.name === m) && a === "external", I = () => {
88
- v(!0), f(-1);
96
+ threshold: Ie.rankings.CONTAINS
97
+ }) : T).slice(0, Le), V = xs.test(d) && !t.some((C) => C.name === d) && s === "external", A = () => {
98
+ v(!0), m(-1);
89
99
  }, M = () => {
90
100
  setTimeout(() => {
91
- v(!1), f(-1);
101
+ v(!1), m(-1);
92
102
  }, 200);
93
- }, N = (D) => {
94
- n(D.target.value), f(-1), v(!0);
95
- }, L = (D) => {
96
- if (!E || g.length === 0) {
97
- D.key === "Enter" && g.length > 0 && (D.preventDefault(), Y(g[0]));
103
+ }, N = (C) => {
104
+ r(C.target.value), m(-1), v(!0);
105
+ }, x = (C) => {
106
+ if (!k || w.length === 0) {
107
+ C.key === "Enter" && w.length > 0 && (C.preventDefault(), z(w[0]));
98
108
  return;
99
109
  }
100
- switch (D.key) {
110
+ switch (C.key) {
101
111
  case "ArrowDown":
102
- D.preventDefault(), f((b) => b < g.length - 1 ? b + 1 : b);
112
+ C.preventDefault(), m((h) => h < w.length - 1 ? h + 1 : h);
103
113
  break;
104
114
  case "ArrowUp":
105
- D.preventDefault(), f((b) => b > 0 ? b - 1 : -1);
115
+ C.preventDefault(), m((h) => h > 0 ? h - 1 : -1);
106
116
  break;
107
117
  case "Enter":
108
- D.preventDefault(), T >= 0 && T < g.length ? Y(g[T]) : g.length > 0 && Y(g[0]);
118
+ C.preventDefault(), O >= 0 && O < w.length ? z(w[O]) : w.length > 0 && z(w[0]);
109
119
  break;
110
120
  case "Escape":
111
- v(!1), f(-1), A.current?.blur(), D.stopPropagation();
121
+ v(!1), m(-1), R.current?.blur(), C.stopPropagation();
112
122
  break;
113
123
  }
114
- }, Y = (D) => {
115
- s(D, 10), n(""), v(!1), f(-1), A.current?.focus();
116
- }, K = () => {
117
- s(
124
+ }, z = (C) => {
125
+ a(C, 10), r(""), v(!1), m(-1), R.current?.focus();
126
+ }, j = () => {
127
+ a(
118
128
  {
119
- name: m,
120
- label: m,
121
- value: m,
129
+ name: d,
130
+ label: d,
131
+ value: d,
122
132
  shareType: "guest"
123
133
  },
124
134
  10
125
- ), n(""), v(!1), f(-1), A.current?.focus();
135
+ ), r(""), v(!1), m(-1), R.current?.focus();
126
136
  };
127
- return /* @__PURE__ */ H($e, { ...l, children: [
128
- /* @__PURE__ */ C(
129
- it,
137
+ return /* @__PURE__ */ B(rt, { ...l, children: [
138
+ /* @__PURE__ */ b(
139
+ $e,
130
140
  {
131
- ref: A,
132
- value: m,
133
- placeholder: u,
141
+ ref: R,
142
+ value: d,
143
+ placeholder: i,
134
144
  disabled: o,
135
- onFocus: I,
136
- onClick: I,
145
+ onFocus: A,
146
+ onClick: A,
137
147
  onBlur: M,
138
148
  onChange: N,
139
- onKeyDown: L,
149
+ onKeyDown: x,
140
150
  style: { width: "100%" }
141
151
  }
142
152
  ),
143
- E && (g.length > 0 || V) && /* @__PURE__ */ H(
144
- ze,
153
+ k && (w.length > 0 || V) && /* @__PURE__ */ B(
154
+ lt,
145
155
  {
146
- ...h?.list,
147
- className: ce(h?.list?.className, { "no-owner": !i }),
156
+ ...g?.list,
157
+ className: fe(g?.list?.className, { "no-owner": !n }),
148
158
  children: [
149
- g.map((D, b) => /* @__PURE__ */ C(
150
- ke,
159
+ w.map((C, h) => /* @__PURE__ */ b(
160
+ Ce,
151
161
  {
152
- name: D.name,
153
- label: D.label,
154
- shareType: D.shareType,
162
+ name: C.name,
163
+ label: C.label,
164
+ shareType: C.shareType,
155
165
  isOwner: !1,
156
166
  isMe: !1,
157
- "data-index": b,
158
- className: b === T ? "highlighted" : "",
167
+ "data-index": h,
168
+ className: h === O ? "highlighted" : "",
159
169
  style: { cursor: "pointer" },
160
- onClick: () => Y(D),
161
- onMouseEnter: () => f(b),
170
+ onClick: () => z(C),
171
+ onMouseEnter: () => m(h),
162
172
  isCompact: !0,
163
173
  isSearchResult: !0
164
174
  },
165
- D.value
175
+ C.value
166
176
  )),
167
- V && /* @__PURE__ */ C(
168
- ke,
177
+ V && /* @__PURE__ */ b(
178
+ Ce,
169
179
  {
170
- name: m,
171
- label: m,
180
+ name: d,
181
+ label: d,
172
182
  shareType: "guest",
173
183
  isOwner: !1,
174
184
  isMe: !1,
175
- "data-index": g.length,
176
- className: g.length === T ? "highlighted" : "",
185
+ "data-index": w.length,
186
+ className: w.length === O ? "highlighted" : "",
177
187
  style: { cursor: "pointer" },
178
- onClick: K,
179
- onMouseEnter: () => f(g.length),
188
+ onClick: j,
189
+ onMouseEnter: () => m(w.length),
180
190
  isCompact: !0,
181
191
  isSearchResult: !0
182
192
  }
183
193
  ),
184
- g.length === Ae && /* @__PURE__ */ C("li", { className: "tip", children: "More than 500 results, please refine your search..." })
194
+ w.length === Le && /* @__PURE__ */ b("li", { className: "tip", children: "More than 500 results, please refine your search..." })
185
195
  ]
186
196
  }
187
197
  )
188
198
  ] });
189
- }, Ja = {
199
+ }, za = {
190
200
  0: "No access",
191
201
  10: "Viewer",
192
202
  20: "Editor",
193
203
  30: "Admin"
194
- }, xe = (t) => {
204
+ }, Me = (t) => {
195
205
  if (!t) return "";
196
206
  try {
197
- const e = Ne(t);
198
- if (Me(e))
199
- return Le(e, "yyyy-MM-dd");
207
+ const e = ze(t);
208
+ if (He(e))
209
+ return We(e, "yyyy-MM-dd");
200
210
  } catch {
201
211
  return "";
202
212
  }
203
213
  return "";
204
- }, _e = (t, e) => {
214
+ }, Ne = (t, e) => {
205
215
  if (!t) return null;
206
216
  try {
207
- const i = Ne(t);
208
- if (Me(i))
209
- return Le(i, e);
217
+ const n = ze(t);
218
+ if (He(n))
219
+ return We(n, e);
210
220
  } catch {
211
221
  return null;
212
222
  }
213
223
  return null;
214
- }, ae = (t) => {
224
+ }, oe = (t) => {
215
225
  if (!t) return null;
216
226
  try {
217
- const [e, i, u] = t.split("-").map(Number);
218
- if (e && i && u)
219
- return new Date(Date.UTC(e, i - 1, u)).toISOString();
227
+ const [e, n, i] = t.split("-").map(Number);
228
+ if (e && n && i)
229
+ return new Date(Date.UTC(e, n - 1, i)).toISOString();
220
230
  } catch {
221
231
  return null;
222
232
  }
223
233
  return null;
224
- }, Qa = ({
234
+ }, Ha = ({
225
235
  value: t,
226
236
  onChange: e,
227
- emptyTrigger: i,
228
- valueTrigger: u,
237
+ emptyTrigger: n,
238
+ valueTrigger: i,
229
239
  align: o = "left",
230
- disabled: a = !1,
231
- className: s,
232
- displayFormat: h = "MMM d",
240
+ disabled: s = !1,
241
+ className: a,
242
+ displayFormat: g = "MMM d",
233
243
  minDate: l,
234
- maxDate: m,
235
- pt: n
244
+ maxDate: d,
245
+ pt: r
236
246
  }) => {
237
- const [E, v] = F(!1), [T, f] = F(""), [A, R] = F(""), g = oe(null), V = oe(null), I = oe(null), M = oe(null), N = t.startDate || t.endDate, L = ee(() => {
238
- const y = ae(T), P = ae(A);
239
- (y !== t.startDate || P !== t.endDate) && e({ startDate: y, endDate: P }), v(!1);
240
- }, [T, A, t.startDate, t.endDate, e]);
241
- z(() => {
242
- E && (f(xe(t.startDate)), R(xe(t.endDate)), !t.startDate && !t.endDate && setTimeout(() => {
247
+ const [k, v] = F(!1), [O, m] = F(""), [R, T] = F(""), w = re(null), V = re(null), A = re(null), M = re(null), N = t.startDate || t.endDate, x = q(() => {
248
+ const E = oe(O), _ = oe(R);
249
+ (E !== t.startDate || _ !== t.endDate) && e({ startDate: E, endDate: _ }), v(!1);
250
+ }, [O, R, t.startDate, t.endDate, e]);
251
+ G(() => {
252
+ k && (m(Me(t.startDate)), T(Me(t.endDate)), !t.startDate && !t.endDate && setTimeout(() => {
243
253
  try {
244
- I.current?.showPicker();
254
+ A.current?.showPicker();
245
255
  } catch {
246
256
  }
247
257
  }, 100));
248
- }, [E, t.startDate, t.endDate]), z(() => {
249
- if (!E) return;
250
- const y = (P) => {
251
- const B = P.target;
252
- g.current && !g.current.contains(B) && V.current && !V.current.contains(B) && L();
258
+ }, [k, t.startDate, t.endDate]), G(() => {
259
+ if (!k) return;
260
+ const E = (_) => {
261
+ const U = _.target;
262
+ w.current && !w.current.contains(U) && V.current && !V.current.contains(U) && x();
253
263
  };
254
- return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
255
- }, [E, L]), z(() => {
256
- if (!E) return;
257
- const y = (P) => {
258
- P.key === "Escape" && (P.stopPropagation(), L());
264
+ return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
265
+ }, [k, x]), G(() => {
266
+ if (!k) return;
267
+ const E = (_) => {
268
+ _.key === "Escape" && (_.stopPropagation(), x());
259
269
  };
260
- return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
261
- }, [E, L]);
262
- const Y = (y) => {
263
- const P = y.target.value;
264
- f(P);
265
- const B = ae(P), W = ae(A);
266
- if (B && W) {
267
- const j = new Date(B), te = new Date(W);
268
- j > te && R(P);
270
+ return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
271
+ }, [k, x]);
272
+ const z = (E) => {
273
+ const _ = E.target.value;
274
+ m(_);
275
+ const U = oe(_), W = oe(R);
276
+ if (U && W) {
277
+ const X = new Date(U), ae = new Date(W);
278
+ X > ae && T(_);
269
279
  }
270
- B && setTimeout(() => {
280
+ U && setTimeout(() => {
271
281
  try {
272
282
  M.current?.showPicker();
273
283
  } catch {
274
284
  }
275
285
  }, 100);
276
- }, K = (y) => {
277
- const P = y.target.value;
278
- R(P);
279
- const B = ae(P), W = ae(T);
280
- let j = W, te = B;
281
- if (B && W) {
282
- const q = new Date(W);
283
- new Date(B) < q && (f(P), j = B);
286
+ }, j = (E) => {
287
+ const _ = E.target.value;
288
+ T(_);
289
+ const U = oe(_), W = oe(O);
290
+ let X = W, ae = U;
291
+ if (U && W) {
292
+ const te = new Date(W);
293
+ new Date(U) < te && (m(_), X = U);
284
294
  }
285
- e({ startDate: j, endDate: te });
286
- }, D = () => {
287
- f(""), R(""), e({ startDate: null, endDate: null }), v(!1);
288
- }, b = (y) => {
289
- y.stopPropagation(), a || (E ? L() : v(!0));
290
- }, w = E ? ae(T) : t.startDate, S = E ? ae(A) : t.endDate, r = _e(w, h), p = _e(S, h), c = r && p ? `${r} - ${p}` : r || p || "", d = () => {
291
- if (!g.current) return { top: 0, left: 0 };
292
- const y = g.current.getBoundingClientRect();
295
+ e({ startDate: X, endDate: ae });
296
+ }, C = () => {
297
+ m(""), T(""), e({ startDate: null, endDate: null }), v(!1);
298
+ }, h = (E) => {
299
+ E.stopPropagation(), s || (k ? x() : v(!0));
300
+ }, y = k ? oe(O) : t.startDate, S = k ? oe(R) : t.endDate, c = Ne(y, g), f = Ne(S, g), u = c && f ? `${c} - ${f}` : c || f || "", p = () => {
301
+ if (!w.current) return { top: 0, left: 0 };
302
+ const E = w.current.getBoundingClientRect();
293
303
  return {
294
- top: y.bottom + 4,
295
- left: o === "left" ? y.left : y.right
304
+ top: E.bottom + 4,
305
+ left: o === "left" ? E.left : E.right
296
306
  };
297
- }, k = () => N ? u ? u(t, c) : /* @__PURE__ */ C("span", { className: ce("date-value", n?.valueDisplay?.className), ...n?.valueDisplay, children: c }) : i || /* @__PURE__ */ C(Ze, { icon: "calendar_add_on" }), x = d();
298
- return /* @__PURE__ */ H(
299
- Ke,
307
+ }, I = () => N ? i ? i(t, u) : /* @__PURE__ */ b("span", { className: fe("date-value", r?.valueDisplay?.className), ...r?.valueDisplay, children: u }) : n || /* @__PURE__ */ b(mt, { icon: "calendar_add_on" }), D = p();
308
+ return /* @__PURE__ */ B(
309
+ it,
300
310
  {
301
- ...n?.root,
302
- className: ce(De, s, n?.root?.className),
311
+ ...r?.root,
312
+ className: fe(Ve, a, r?.root?.className),
303
313
  children: [
304
- /* @__PURE__ */ C(
305
- je,
314
+ /* @__PURE__ */ b(
315
+ ct,
306
316
  {
307
- ref: g,
308
- onClick: b,
309
- disabled: a,
317
+ ref: w,
318
+ onClick: h,
319
+ disabled: s,
310
320
  type: "button",
311
- ...n?.trigger,
312
- className: ce(N ? "has-value" : "empty", n?.trigger?.className),
313
- children: k()
321
+ ...r?.trigger,
322
+ className: fe(N ? "has-value" : "empty", r?.trigger?.className),
323
+ children: I()
314
324
  }
315
325
  ),
316
- E && ft(
317
- /* @__PURE__ */ C(
318
- Xe,
326
+ k && Lt(
327
+ /* @__PURE__ */ b(
328
+ ut,
319
329
  {
320
330
  ref: V,
321
331
  style: {
322
- top: x.top,
323
- left: o === "left" ? x.left : "auto",
324
- right: o === "right" ? window.innerWidth - x.left : "auto",
325
- ...n?.dropdown?.style
332
+ top: D.top,
333
+ left: o === "left" ? D.left : "auto",
334
+ right: o === "right" ? window.innerWidth - D.left : "auto",
335
+ ...r?.dropdown?.style
326
336
  },
327
- onMouseDown: (y) => y.stopPropagation(),
328
- ...n?.dropdown,
329
- className: ce(De, o, n?.dropdown?.className),
330
- children: /* @__PURE__ */ H(Je, { className: n?.content?.className, ...n?.content, children: [
331
- /* @__PURE__ */ C(
332
- Qe,
337
+ onMouseDown: (E) => E.stopPropagation(),
338
+ ...r?.dropdown,
339
+ className: fe(Ve, o, r?.dropdown?.className),
340
+ children: /* @__PURE__ */ B(dt, { className: r?.content?.className, ...r?.content, children: [
341
+ /* @__PURE__ */ b(
342
+ pt,
333
343
  {
334
344
  icon: "close",
335
345
  variant: "text",
336
- onClick: L,
337
- ...n?.closeButton
346
+ onClick: x,
347
+ ...r?.closeButton
338
348
  }
339
349
  ),
340
- /* @__PURE__ */ H(
350
+ /* @__PURE__ */ B(
341
351
  Oe,
342
352
  {
343
- className: n?.startDate?.field?.className,
344
- ...n?.startDate?.field,
353
+ className: r?.startDate?.field?.className,
354
+ ...r?.startDate?.field,
345
355
  children: [
346
- /* @__PURE__ */ C("label", { ...n?.startDate?.label, children: "Start date" }),
347
- /* @__PURE__ */ C(
348
- Se,
356
+ /* @__PURE__ */ b("label", { ...r?.startDate?.label, children: "Start date" }),
357
+ /* @__PURE__ */ b(
358
+ Te,
349
359
  {
350
- ref: I,
360
+ ref: A,
351
361
  type: "date",
352
- value: T,
353
- onChange: Y,
354
- max: m ? le(m, "yyyy-MM-dd") : void 0,
355
- min: l ? le(l, "yyyy-MM-dd") : void 0,
356
- onClick: (y) => {
362
+ value: O,
363
+ onChange: z,
364
+ max: d ? ue(d, "yyyy-MM-dd") : void 0,
365
+ min: l ? ue(l, "yyyy-MM-dd") : void 0,
366
+ onClick: (E) => {
357
367
  try {
358
- y.currentTarget.showPicker();
368
+ E.currentTarget.showPicker();
359
369
  } catch {
360
370
  }
361
371
  },
362
- ...n?.startDate?.input
372
+ ...r?.startDate?.input
363
373
  }
364
374
  )
365
375
  ]
366
376
  }
367
377
  ),
368
- /* @__PURE__ */ H(Oe, { className: n?.endDate?.field?.className, ...n?.endDate?.field, children: [
369
- /* @__PURE__ */ C("label", { ...n?.endDate?.label, children: "End date" }),
370
- /* @__PURE__ */ C(
371
- Se,
378
+ /* @__PURE__ */ B(Oe, { className: r?.endDate?.field?.className, ...r?.endDate?.field, children: [
379
+ /* @__PURE__ */ b("label", { ...r?.endDate?.label, children: "End date" }),
380
+ /* @__PURE__ */ b(
381
+ Te,
372
382
  {
373
383
  ref: M,
374
384
  type: "date",
375
- value: A,
376
- onChange: K,
377
- max: m ? le(m, "yyyy-MM-dd") : void 0,
378
- min: T || (l ? le(l, "yyyy-MM-dd") : void 0),
379
- onClick: (y) => {
385
+ value: R,
386
+ onChange: j,
387
+ max: d ? ue(d, "yyyy-MM-dd") : void 0,
388
+ min: O || (l ? ue(l, "yyyy-MM-dd") : void 0),
389
+ onClick: (E) => {
380
390
  try {
381
- y.currentTarget.showPicker();
391
+ E.currentTarget.showPicker();
382
392
  } catch {
383
393
  }
384
394
  },
385
- ...n?.endDate?.input
395
+ ...r?.endDate?.input
386
396
  }
387
397
  )
388
398
  ] }),
389
- N && /* @__PURE__ */ C(qe, { onClick: D, variant: "text", ...n?.clearButton, children: "Clear dates" })
399
+ N && /* @__PURE__ */ b(ft, { onClick: C, variant: "text", ...r?.clearButton, children: "Clear dates" })
390
400
  ] })
391
401
  }
392
402
  ),
@@ -395,274 +405,274 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
395
405
  ]
396
406
  }
397
407
  );
398
- }, ne = {
408
+ }, le = {
399
409
  version: 1,
400
410
  name: "review",
401
411
  productType: "review"
402
- }, qa = ({
412
+ }, Wa = ({
403
413
  children: t,
404
414
  projectName: e,
405
- onVersionCreated: i,
406
- dispatch: u
415
+ onVersionCreated: n,
416
+ dispatch: i
407
417
  }) => {
408
- const [o, a] = F(""), [s, h] = F(""), [l, m] = F(null), [n, E] = F(null), [v, T] = F(!1), [f, A] = F([]), [R, g] = F(ne), [V, I] = F(!1), [M, N] = F(""), [L, Y] = F(null), [K, D] = F(null), [b, w] = F(void 0), [S, r] = F(void 0), p = oe(!1), c = oe(null), { data: d = [], isLoading: k } = kt(
418
+ const [o, s] = F(""), [a, g] = F(""), [l, d] = F(null), [r, k] = F(null), [v, O] = F(!1), [m, R] = F([]), [T, w] = F(le), [V, A] = F(!1), [M, N] = F(""), [x, z] = F(null), [j, C] = F(null), [h, y] = F(void 0), [S, c] = F(void 0), f = re(!1), u = re(null), { data: p = [], isLoading: I } = Yt(
409
419
  { projectName: e, folderId: o },
410
- { skip: !o || !v || !!s }
411
- ), x = me(() => {
412
- if (!(s || !R.name || d.length === 0))
413
- return d.find((O) => O.name === R.name);
414
- }, [s, R.name, d]), y = s || x?.id || "", { currentData: P } = Ot(
420
+ { skip: !o || !v || !!a }
421
+ ), D = Y(() => {
422
+ if (!(a || !T.name || p.length === 0))
423
+ return p.find((P) => P.name === T.name);
424
+ }, [a, T.name, p]), E = a || D?.id || "", { currentData: _ } = jt(
415
425
  {
416
426
  projectName: e,
417
- productId: s
427
+ productId: a
418
428
  },
419
- { skip: !s || !v || b != null }
420
- ), { data: B } = St(
429
+ { skip: !a || !v || h != null }
430
+ ), { data: U } = Kt(
421
431
  { projectName: e, versionId: S },
422
432
  { skip: !S || !v || l !== null }
423
- ), W = l ?? B?.taskId ?? "", j = !!(S && l === null && !B), te = ee(
424
- ({ productId: O, folderId: _, taskId: U, linkedTask: Z, latestVersionNumber: ue, latestVersionId: He }) => {
425
- h(O || ""), a(_ || ""), m(U || null), E(Z || null), w(ue), r(He), g((Ye) => ({
426
- ...Ye,
427
- ...ue != null ? { version: ue + 1 } : {}
428
- })), T(!0);
433
+ ), W = l ?? U?.taskId ?? "", X = !!(S && l === null && !U), ae = q(
434
+ ({ productId: P, folderId: L, taskId: $, linkedTask: se, latestVersionNumber: pe, latestVersionId: ot }) => {
435
+ g(P || ""), s(L || ""), d($ || null), k(se || null), y(pe), c(ot), w((nt) => ({
436
+ ...nt,
437
+ ...pe != null ? { version: pe + 1 } : {}
438
+ })), O(!0);
429
439
  },
430
440
  []
431
- ), q = ee(() => {
432
- f.forEach((O) => {
433
- O.preview && URL.revokeObjectURL(O.preview);
434
- }), A([]), g(ne), Y(null), D(null), N(""), I(!1), T(!1), h(""), a(""), m(null), E(null), p.current = !1, w(void 0), r(void 0);
435
- }, [f]), [be] = Tt(), [pe] = Dt(), X = ee(
436
- async (O) => {
441
+ ), te = q(() => {
442
+ m.forEach((P) => {
443
+ P.preview && URL.revokeObjectURL(P.preview);
444
+ }), R([]), w(le), z(null), C(null), N(""), A(!1), O(!1), g(""), s(""), d(null), k(null), f.current = !1, y(void 0), c(void 0);
445
+ }, [m]), [we] = qt(), [he] = Qt(), J = q(
446
+ async (P) => {
437
447
  try {
438
- if (y) {
439
- const _ = await jt(pe, e, {
440
- productId: y,
441
- version: O.version,
448
+ if (E) {
449
+ const L = await Ps(he, e, {
450
+ productId: E,
451
+ version: P.version,
442
452
  taskId: W || void 0
443
453
  });
444
- return i(y, _.id), he.success("Created new version"), {
445
- productId: y,
446
- versionId: _.id
454
+ return n(E, L.id), Q.success("Created new version"), {
455
+ productId: E,
456
+ versionId: L.id
447
457
  };
448
458
  } else {
449
- const { product: _, version: U } = await Xt(
450
- be,
451
- pe,
459
+ const { product: L, version: $ } = await Vs(
460
+ we,
461
+ he,
452
462
  e,
453
463
  {
454
464
  folderId: o,
455
- name: O.name,
456
- productType: O.productType || "review",
457
- productBaseType: O.productType || "review"
465
+ name: P.name,
466
+ productType: P.productType || "review",
467
+ productBaseType: P.productType || "review"
458
468
  },
459
469
  {
460
- version: O.version,
470
+ version: P.version,
461
471
  taskId: W || void 0
462
472
  }
463
473
  );
464
- return i(_.id, U.id), he.success("Created new version"), {
465
- productId: _.id,
466
- versionId: U.id
474
+ return n(L.id, $.id), Q.success("Created new version"), {
475
+ productId: L.id,
476
+ versionId: $.id
467
477
  };
468
478
  }
469
- } catch (_) {
470
- throw console.error("Error uploading version:", _), _.message || _;
479
+ } catch (L) {
480
+ throw console.error("Error uploading version:", L), L.message || L;
471
481
  }
472
482
  },
473
- [q, y, o, W, e]
474
- ), fe = ee(
475
- (O) => {
476
- if (y) return;
477
- const _ = O[0];
478
- if (_) {
479
- const U = Qt(_.name), Z = Kt(U);
480
- Z && Z !== R.version && g((ue) => ({
481
- ...ue,
482
- version: Z
483
+ [te, E, o, W, e]
484
+ ), ge = q(
485
+ (P) => {
486
+ if (E) return;
487
+ const L = P[0];
488
+ if (L) {
489
+ const $ = Rs(L.name), se = Ds($);
490
+ se && se !== T.version && w((pe) => ({
491
+ ...pe,
492
+ version: se
483
493
  }));
484
494
  }
485
495
  },
486
- [y, R.version]
487
- ), J = P?.version ?? b ?? x?.latestVersion?.version, Q = ee((O, _) => {
488
- g((U) => ({
489
- ...U,
490
- [O]: _
496
+ [E, T.version]
497
+ ), Z = _?.version ?? h ?? D?.latestVersion?.version, ee = q((P, L) => {
498
+ w(($) => ({
499
+ ...$,
500
+ [P]: L
491
501
  })), N("");
492
- }, []), Ee = ee(
493
- async (O) => {
502
+ }, []), Se = q(
503
+ async (P) => {
494
504
  try {
495
- I(!0), N("");
496
- const _ = Jt(O, J, !y);
497
- if (!_.isValid)
498
- throw _.error;
499
- const U = await X(O);
500
- o && (c.current = { folderId: o, productName: O.name }), U?.productId && Y(U.productId), U?.versionId && D(U.versionId), f.length < 1 && (I(!1), q());
501
- } catch (_) {
502
- N(_), I(!1);
505
+ A(!0), N("");
506
+ const L = As(P, Z, !E);
507
+ if (!L.isValid)
508
+ throw L.error;
509
+ const $ = await J(P);
510
+ o && (u.current = { folderId: o, productName: P.name }), $?.productId && z($.productId), $?.versionId && C($.versionId), m.length < 1 && (A(!1), te());
511
+ } catch (L) {
512
+ N(L), A(!1);
503
513
  }
504
514
  },
505
- [X, f.length, q, J, y]
515
+ [J, m.length, te, Z, E]
506
516
  );
507
- z(() => {
508
- if (!(!v || b != null))
509
- return g(P ? (O) => ({ ...O, version: P.version + 1 }) : ne), () => {
510
- g(ne);
517
+ G(() => {
518
+ if (!(!v || h != null))
519
+ return w(_ ? (P) => ({ ...P, version: _.version + 1 }) : le), () => {
520
+ w(le);
511
521
  };
512
- }, [v, P, b]), z(() => {
513
- if (!v || s || d.length === 0 || R.name !== ne.name) return;
514
- const O = c.current;
515
- if (O && O.folderId === o && d.some((Z) => Z.name === O.productName)) {
516
- g((Z) => ({ ...Z, name: O.productName }));
522
+ }, [v, _, h]), G(() => {
523
+ if (!v || a || p.length === 0 || T.name !== le.name) return;
524
+ const P = u.current;
525
+ if (P && P.folderId === o && p.some((se) => se.name === P.productName)) {
526
+ w((se) => ({ ...se, name: P.productName }));
517
527
  return;
518
528
  }
519
- const _ = d[d.length - 1];
520
- _ && g((U) => ({ ...U, name: _.name }));
521
- }, [v, s, d]), z(() => {
522
- if (!(!v || s))
523
- if (x) {
524
- g((_) => ({
525
- ..._,
526
- productType: x.productType,
527
- ...x.latestVersion && {
528
- version: x.latestVersion.version + 1
529
+ const L = p[p.length - 1];
530
+ L && w(($) => ({ ...$, name: L.name }));
531
+ }, [v, a, p]), G(() => {
532
+ if (!(!v || a))
533
+ if (D) {
534
+ w((L) => ({
535
+ ...L,
536
+ productType: D.productType,
537
+ ...D.latestVersion && {
538
+ version: D.latestVersion.version + 1
529
539
  }
530
540
  }));
531
- const O = x.latestVersion?.task;
532
- O && (l === null || p.current) ? (m(O.id), E({
533
- id: O.id,
534
- name: O.name,
535
- label: O.label,
536
- taskType: O.taskType
537
- }), p.current = !0) : !O && p.current && (m(null), E(null), p.current = !1);
541
+ const P = D.latestVersion?.task;
542
+ P && (l === null || f.current) ? (d(P.id), k({
543
+ id: P.id,
544
+ name: P.name,
545
+ label: P.label,
546
+ taskType: P.taskType
547
+ }), f.current = !0) : !P && f.current && (d(null), k(null), f.current = !1);
538
548
  } else
539
- g((O) => ({ ...O, version: ne.version })), (l === null || p.current) && (m(null), E(null), p.current = !1);
540
- }, [v, s, x]);
541
- const Ce = ee((O) => {
542
- m(O), p.current = !1;
543
- }, []), We = me(
549
+ w((P) => ({ ...P, version: le.version })), (l === null || f.current) && (d(null), k(null), f.current = !1);
550
+ }, [v, a, D]);
551
+ const ke = q((P) => {
552
+ d(P), f.current = !1;
553
+ }, []), at = Y(
544
554
  () => ({
545
- productId: s,
546
- setProductId: h,
555
+ productId: a,
556
+ setProductId: g,
547
557
  folderId: o,
548
558
  taskId: W,
549
- linkedTask: n,
550
- isLoadingTask: j,
551
- setTaskId: Ce,
552
- setLinkedTask: E,
553
- setFolderId: a,
559
+ linkedTask: r,
560
+ isLoadingTask: X,
561
+ setTaskId: ke,
562
+ setLinkedTask: k,
563
+ setFolderId: s,
554
564
  isOpen: v,
555
565
  projectName: e,
556
- latestVersion: J,
557
- pendingFiles: f,
558
- setPendingFiles: A,
559
- onOpenVersionUpload: te,
560
- onCloseVersionUpload: q,
561
- onUploadVersion: X,
562
- extractAndSetVersionFromFiles: fe,
563
- form: R,
564
- setForm: g,
566
+ latestVersion: Z,
567
+ pendingFiles: m,
568
+ setPendingFiles: R,
569
+ onOpenVersionUpload: ae,
570
+ onCloseVersionUpload: te,
571
+ onUploadVersion: J,
572
+ extractAndSetVersionFromFiles: ge,
573
+ form: T,
574
+ setForm: w,
565
575
  isSubmitting: V,
566
576
  error: M,
567
- createdProductId: L,
568
- createdVersionId: K,
569
- handleFormChange: Q,
570
- handleFormSubmit: Ee,
571
- folderProducts: d,
572
- isFolderProductsLoading: k,
573
- matchedProduct: x,
574
- dispatch: u
577
+ createdProductId: x,
578
+ createdVersionId: j,
579
+ handleFormChange: ee,
580
+ handleFormSubmit: Se,
581
+ folderProducts: p,
582
+ isFolderProductsLoading: I,
583
+ matchedProduct: D,
584
+ dispatch: i
575
585
  }),
576
586
  [
577
587
  o,
578
- a,
579
588
  s,
589
+ a,
580
590
  W,
581
- n,
582
- j,
583
- Ce,
584
- E,
585
- h,
591
+ r,
592
+ X,
593
+ ke,
594
+ k,
595
+ g,
586
596
  v,
587
597
  e,
588
- J,
589
- f,
590
- A,
591
- te,
592
- q,
593
- X,
594
- fe,
598
+ Z,
599
+ m,
595
600
  R,
601
+ ae,
602
+ te,
603
+ J,
604
+ ge,
605
+ T,
596
606
  V,
597
607
  M,
598
- L,
599
- K,
600
- Q,
601
- Ee,
602
- d,
603
- k,
604
608
  x,
605
- u
609
+ j,
610
+ ee,
611
+ Se,
612
+ p,
613
+ I,
614
+ D,
615
+ i
606
616
  ]
607
617
  );
608
- return /* @__PURE__ */ C(qt.Provider, { value: We, children: t });
609
- }, Za = ({ children: t }) => {
610
- const [e, i] = F(!1), { siteInfo: u, user: o, cloudInfo: a } = Be(), { data: s, isLoading: h } = Vt(
618
+ return /* @__PURE__ */ b(Cs.Provider, { value: at, children: t });
619
+ }, Ya = ({ children: t }) => {
620
+ const [e, n] = F(!1), { siteInfo: i, user: o, cloudInfo: s } = Ye(), { data: a, isLoading: g } = Xt(
611
621
  {},
612
622
  {
613
- skip: !o?.name || !a?.connected
623
+ skip: !o?.name || !s?.connected
614
624
  }
615
625
  ), l = () => {
616
- e || (Ft(() => {
626
+ e || (rs(() => {
617
627
  if (document.getElementById("featurebase-sdk")) return;
618
- const c = document.createElement("script");
619
- c.src = "https://do.featurebase.app/js/sdk.js", c.id = "featurebase-sdk", c.async = !0, document.body.appendChild(c);
620
- }), i(!0));
621
- }, m = () => {
622
- const c = window;
623
- typeof c.Featurebase != "function" && (c.Featurebase = function() {
624
- (c.Featurebase.q = c.Featurebase.q || []).push(arguments);
628
+ const u = document.createElement("script");
629
+ u.src = "https://do.featurebase.app/js/sdk.js", u.id = "featurebase-sdk", u.async = !0, document.body.appendChild(u);
630
+ }), n(!0));
631
+ }, d = () => {
632
+ const u = window;
633
+ typeof u.Featurebase != "function" && (u.Featurebase = function() {
634
+ (u.Featurebase.q = u.Featurebase.q || []).push(arguments);
625
635
  });
626
- }, n = u?.version?.split("+")[0] || "unknown", E = u?.version?.split("+")[1] || "unknown", v = () => {
627
- if (!o?.name || !s?.available) return;
628
- const c = {
629
- ...s.data,
636
+ }, r = i?.version?.split("+")[0] || "unknown", k = i?.version?.split("+")[1] || "unknown", v = () => {
637
+ if (!o?.name || !a?.available) return;
638
+ const u = {
639
+ ...a.data,
630
640
  customFields: {
631
641
  origin: window.location.origin,
632
- serverVersion: n,
633
- frontendVersion: E,
634
- instanceId: a?.instanceId
642
+ serverVersion: r,
643
+ frontendVersion: k,
644
+ instanceId: s?.instanceId
635
645
  }
636
646
  };
637
- console.log(c), window.Featurebase("identify", c, (k) => {
638
- k ? console.error(k) : console.log("Featurebase identify completed");
647
+ console.log(u), window.Featurebase("identify", u, (I) => {
648
+ I ? console.error(I) : console.log("Featurebase identify completed");
639
649
  });
640
- }, [T, f] = F(!1), [A, R] = F(0), g = () => {
641
- const c = window;
642
- if (typeof c.Featurebase == "function") {
643
- if (console.log("Initializing Featurebase messenger widget"), !s?.available)
650
+ }, [O, m] = F(!1), [R, T] = F(0), w = () => {
651
+ const u = window;
652
+ if (typeof u.Featurebase == "function") {
653
+ if (console.log("Initializing Featurebase messenger widget"), !a?.available)
644
654
  return console.warn("messenger verification not available, skipping messenger init");
645
- c.Featurebase(
655
+ u.Featurebase(
646
656
  "boot",
647
657
  {
648
658
  theme: "dark",
649
- ...s?.data
659
+ ...a?.data
650
660
  },
651
- (d) => {
652
- d ? console.error(d) : (console.log("Featurebase messenger completed"), f(!0), c.Featurebase("onUnreadCountChange", function(k) {
653
- R(k);
661
+ (p) => {
662
+ p ? console.error(p) : (console.log("Featurebase messenger completed"), m(!0), u.Featurebase("onUnreadCountChange", function(I) {
663
+ T(I);
654
664
  }));
655
665
  }
656
666
  );
657
667
  }
658
668
  }, V = () => {
659
- const c = [];
669
+ const u = [];
660
670
  if (o?.data?.isAdmin) {
661
- const k = ["Server", "Addon", "Pipeline"];
662
- c.push(...k);
663
- } else u?.disableChangelog || c.push("Highlights");
664
- const d = window;
665
- return typeof d.Featurebase == "function" && d.Featurebase("init_changelog_widget", {
671
+ const I = ["Server", "Addon", "Pipeline"];
672
+ u.push(...I);
673
+ } else i?.disableChangelog || u.push("Highlights");
674
+ const p = window;
675
+ return typeof p.Featurebase == "function" && p.Featurebase("init_changelog_widget", {
666
676
  organization: "ayon",
667
677
  dropdown: {
668
678
  enabled: !0
@@ -672,160 +682,160 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
672
682
  usersName: o?.attrib?.fullName,
673
683
  autoOpenForNewUpdates: !0
674
684
  },
675
- category: c,
685
+ category: u,
676
686
  theme: "dark"
677
687
  }), !1;
678
- }, I = () => {
679
- const c = window;
680
- return typeof c.Featurebase == "function" && c.Featurebase(
688
+ }, A = () => {
689
+ const u = window;
690
+ return typeof u.Featurebase == "function" && u.Featurebase(
681
691
  "initialize_feedback_widget",
682
692
  {
683
693
  organization: "ayon",
684
694
  theme: "dark",
685
695
  metadata: {}
686
696
  },
687
- (d) => {
688
- d && console.error("Error initializing feedback widget:", d);
697
+ (p) => {
698
+ p && console.error("Error initializing feedback widget:", p);
689
699
  }
690
700
  ), !1;
691
701
  }, M = () => {
692
- const c = window;
693
- return typeof c.Featurebase == "function" && c.Featurebase(
702
+ const u = window;
703
+ return typeof u.Featurebase == "function" && u.Featurebase(
694
704
  "initialize_portal_widget",
695
705
  {
696
706
  organization: "ayon",
697
707
  fullScreen: !0,
698
708
  initialPage: "MainView"
699
709
  },
700
- (d) => d ? (console.error("Error initializing portal widget:", d), !1) : !0
710
+ (p) => p ? (console.error("Error initializing portal widget:", p), !1) : !0
701
711
  ), !1;
702
712
  }, N = () => {
703
- const c = window;
704
- return typeof c.Featurebase == "function" && c.Featurebase(
713
+ const u = window;
714
+ return typeof u.Featurebase == "function" && u.Featurebase(
705
715
  "initialize_survey_widget",
706
716
  {
707
717
  organization: "ayon",
708
718
  placement: "bottom-right",
709
719
  theme: "dark",
710
720
  email: o?.attrib?.email,
711
- featurebaseJwt: s?.data?.featurebaseJwt,
721
+ featurebaseJwt: a?.data?.featurebaseJwt,
712
722
  locale: "en"
713
723
  },
714
- (d) => {
715
- d ? console.error("Error initializing survey widget:", d) : console.log("Survey widget initialized successfully");
724
+ (p) => {
725
+ p ? console.error("Error initializing survey widget:", p) : console.log("Survey widget initialized successfully");
716
726
  }
717
727
  ), !1;
718
728
  };
719
- z(() => {
720
- o?.name && u && (u.disableFeedback || e || (l(), m(), V(), I(), M()));
721
- }, [o?.name, e, u]);
722
- const [L, Y] = F(!1);
723
- z(() => {
724
- !o?.name || !a || !s || !e || L || (v(), N(), Y(!0));
729
+ G(() => {
730
+ o?.name && i && (i.disableFeedback || e || (l(), d(), V(), A(), M()));
731
+ }, [o?.name, e, i]);
732
+ const [x, z] = F(!1);
733
+ G(() => {
734
+ !o?.name || !s || !a || !e || x || (v(), N(), z(!0));
725
735
  }, [
726
736
  o?.name,
727
- a?.instanceId,
728
- s?.available,
737
+ s?.instanceId,
738
+ a?.available,
729
739
  e,
730
740
  window.location.pathname,
731
- L
732
- ]), z(() => {
733
- h || !e || g();
734
- }, [s, h, e]);
735
- const K = () => {
741
+ x
742
+ ]), G(() => {
743
+ g || !e || w();
744
+ }, [a, g, e]);
745
+ const j = () => {
736
746
  window.postMessage({
737
747
  target: "FeaturebaseWidget",
738
748
  data: {
739
749
  action: "openFeedbackWidget"
740
750
  }
741
751
  });
742
- }, D = (c = "MainView", d) => {
752
+ }, C = (u = "MainView", p) => {
743
753
  window.postMessage({
744
754
  target: "FeaturebaseWidget",
745
755
  data: {
746
756
  action: "changePage",
747
- payload: c,
757
+ payload: u,
748
758
  openWidget: !0,
749
- ...d && { articleId: d }
759
+ ...p && { articleId: p }
750
760
  }
751
761
  });
752
- }, [b, w] = F(!1), S = document.getElementById("fb-messenger-root"), r = (c) => S instanceof HTMLElement && (S.style.display = c ? "block" : "none");
753
- z(() => {
754
- !e || !T || r(b);
755
- }, [e, T, b]), z(() => {
756
- if (!e || !T) return;
757
- const c = window;
758
- typeof c.Featurebase == "function" && c.Featurebase("onHide", function() {
759
- w(!1);
762
+ }, [h, y] = F(!1), S = document.getElementById("fb-messenger-root"), c = (u) => S instanceof HTMLElement && (S.style.display = u ? "block" : "none");
763
+ G(() => {
764
+ !e || !O || c(h);
765
+ }, [e, O, h]), G(() => {
766
+ if (!e || !O) return;
767
+ const u = window;
768
+ typeof u.Featurebase == "function" && u.Featurebase("onHide", function() {
769
+ y(!1);
760
770
  });
761
- }, [e, T]);
762
- const p = (c = "Home", d) => {
763
- const k = window;
764
- if (typeof k.Featurebase != "function") {
771
+ }, [e, O]);
772
+ const f = (u = "Home", p) => {
773
+ const I = window;
774
+ if (typeof I.Featurebase != "function") {
765
775
  window.alert("Featurebase SDK is not loaded yet. Please try again later."), console.warn("Featurebase SDK is not loaded yet.");
766
776
  return;
767
777
  }
768
- if (b) {
769
- k.Featurebase("hide"), w(!1);
778
+ if (h) {
779
+ I.Featurebase("hide"), y(!1);
770
780
  return;
771
781
  }
772
- switch (w(!0), c) {
782
+ switch (y(!0), u) {
773
783
  case "Home":
774
- k.Featurebase("show");
784
+ I.Featurebase("show");
775
785
  break;
776
786
  case "Messages":
777
- k.Featurebase("show", "messages");
787
+ I.Featurebase("show", "messages");
778
788
  break;
779
789
  case "Changelog":
780
- k.Featurebase("show", "changelog");
790
+ I.Featurebase("show", "changelog");
781
791
  break;
782
792
  case "Help":
783
- k.Featurebase("show", "help");
793
+ I.Featurebase("show", "help");
784
794
  break;
785
795
  case "ShowArticle":
786
- d ? k.Featurebase("showArticle", d) : k.Featurebase("show", "help");
796
+ p ? I.Featurebase("showArticle", p) : I.Featurebase("show", "help");
787
797
  break;
788
798
  case "NewMessage":
789
- k.Featurebase("showNewMessage", d);
799
+ I.Featurebase("showNewMessage", p);
790
800
  break;
791
801
  default:
792
- k.Featurebase("show");
802
+ I.Featurebase("show");
793
803
  break;
794
804
  }
795
805
  };
796
- return /* @__PURE__ */ C(
797
- Bt.Provider,
806
+ return /* @__PURE__ */ b(
807
+ ds.Provider,
798
808
  {
799
809
  value: {
800
- openSupport: p,
801
- openFeedback: K,
802
- openPortal: D,
803
- messengerLoaded: T,
804
- unreadCount: A,
805
- messengerVisibility: b,
806
- setMessengerVisibility: w,
810
+ openSupport: f,
811
+ openFeedback: j,
812
+ openPortal: C,
813
+ messengerLoaded: O,
814
+ unreadCount: R,
815
+ messengerVisibility: h,
816
+ setMessengerVisibility: y,
807
817
  loaded: e
808
818
  },
809
819
  children: t
810
820
  }
811
821
  );
812
- }, es = ({
822
+ }, ja = ({
813
823
  projectName: t,
814
824
  list: e,
815
- isLoading: i,
816
- attributes: u = []
825
+ isLoading: n,
826
+ attributes: i = []
817
827
  }) => {
818
- const [o, a] = F({
828
+ const [o, s] = F({
819
829
  label: "",
820
830
  tags: [],
821
831
  active: !1
822
- }), s = (e?.accessLevel || 0) >= 30, { tags: h } = mt(), { data: l = [] } = Rt(), m = me(
823
- () => l.filter((f) => f.scope?.includes("list")).map((f) => ({
824
- name: f.name,
825
- data: f.data
832
+ }), a = (e?.accessLevel || 0) >= 30, { tags: g } = je(), { data: l = [] } = Jt(), d = Y(
833
+ () => l.filter((m) => m.scope?.includes("list")).map((m) => ({
834
+ name: m.name,
835
+ data: m.data
826
836
  })),
827
837
  [l]
828
- ), n = me(
838
+ ), r = Y(
829
839
  () => [
830
840
  { name: "label", data: { type: "string", title: "Label" } },
831
841
  {
@@ -833,249 +843,530 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
833
843
  data: {
834
844
  type: "list_of_strings",
835
845
  title: "Tags",
836
- enum: h?.map((f) => ({ value: f.name, label: f.name, color: f.color })),
846
+ enum: g?.map((m) => ({ value: m.name, label: m.name, color: m.color })),
837
847
  enableCustomValues: !0,
838
848
  enableSearch: !0
839
849
  }
840
850
  },
841
- ...m,
851
+ ...d,
842
852
  { name: "active", data: { type: "boolean", title: "Active" } },
843
- ...u
853
+ ...i
844
854
  ],
845
- [h, m, u]
855
+ [g, d, i]
846
856
  );
847
- z(() => {
857
+ G(() => {
848
858
  if (e) {
849
- const f = e.attrib || {}, R = [...m, ...u].reduce((g, { name: V }) => {
850
- const I = f[V];
851
- return g[V] = I || "", g;
859
+ const m = e.attrib || {}, T = [...d, ...i].reduce((w, { name: V }) => {
860
+ const A = m[V];
861
+ return w[V] = A || "", w;
852
862
  }, {});
853
- a({
863
+ s({
854
864
  label: e?.label || "",
855
865
  tags: e?.tags || [],
856
866
  active: e?.active ?? !1,
857
- ...R
867
+ ...T
858
868
  });
859
869
  }
860
- }, [e, JSON.stringify(u), JSON.stringify(m)]);
861
- const [E] = It(), v = (f) => u.some((A) => A.name === f) || m.some((A) => A.name === f), T = ee(
862
- async (f, A) => {
870
+ }, [e, JSON.stringify(i), JSON.stringify(d)]);
871
+ const [k] = Zt(), v = (m) => i.some((R) => R.name === m) || d.some((R) => R.name === m), O = q(
872
+ async (m, R) => {
863
873
  if (!e?.id) return console.warn("No list ID provided");
864
- let R;
865
- if (v(f)) {
866
- const g = e.attrib || {};
867
- A === "" && f === "category" ? R = {
874
+ let T;
875
+ if (v(m)) {
876
+ const w = e.attrib || {};
877
+ R === "" && m === "category" ? T = {
868
878
  attrib: {
869
- ...g,
870
- [f]: null
879
+ ...w,
880
+ [m]: null
871
881
  }
872
- } : R = {
882
+ } : T = {
873
883
  attrib: {
874
- ...g,
875
- [f]: A
884
+ ...w,
885
+ [m]: R
876
886
  }
877
- }, a((V) => ({ ...V, [f]: A }));
887
+ }, s((V) => ({ ...V, [m]: R }));
878
888
  } else {
879
- const g = { [f]: A };
880
- R = g, a((V) => ({ ...V, ...g }));
889
+ const w = { [m]: R };
890
+ T = w, s((V) => ({ ...V, ...w }));
881
891
  }
882
892
  try {
883
- await E({
893
+ await k({
884
894
  listId: e.id,
885
895
  projectName: t,
886
- entityListPatchModel: R
896
+ entityListPatchModel: T
887
897
  });
888
- } catch (g) {
889
- console.error(g), he.error("Failed to update list attribute: ", g.attrib.detail);
898
+ } catch (w) {
899
+ console.error(w), Q.error("Failed to update list attribute: ", w.attrib.detail);
890
900
  }
891
901
  },
892
- [e?.id, e?.attrib, t, E, m, u]
902
+ [e?.id, e?.attrib, t, k, d, i]
893
903
  );
894
- return /* @__PURE__ */ C(
895
- wt,
904
+ return /* @__PURE__ */ b(
905
+ $t,
896
906
  {
897
- enableEditing: s,
907
+ enableEditing: a,
898
908
  projectName: t,
899
- fields: n,
909
+ fields: r,
900
910
  form: o,
901
- isLoading: i,
902
- onChange: T,
911
+ isLoading: n,
912
+ onChange: O,
903
913
  title: "Attributes"
904
914
  }
905
915
  );
906
- }, ts = ({ list: t, isLoading: e }) => {
907
- const i = Object.fromEntries(
916
+ }, Ka = ({ list: t, isLoading: e }) => {
917
+ const n = Object.fromEntries(
908
918
  Object.entries(t?.data || {}).filter(
909
- ([a, s]) => !["category", "count"].includes(a) && s !== null && typeof s != "object"
919
+ ([s, a]) => !["category", "count"].includes(s) && a !== null && typeof a != "object"
910
920
  )
911
- ), u = {
921
+ ), i = {
912
922
  Id: t?.id,
913
923
  "Entity type": t?.entityType,
914
924
  "List type": t?.entityListType,
915
925
  "Items count": t?.data?.count ?? t?.items?.length,
916
926
  Owner: t?.owner,
917
- "Created at": t?.createdAt && le(new Date(t?.createdAt), "PPpp"),
927
+ "Created at": t?.createdAt && ue(new Date(t?.createdAt), "PPpp"),
918
928
  "Created by": t?.createdBy,
919
- "Updated at": t?.updatedAt && le(new Date(t?.updatedAt), "PPpp"),
929
+ "Updated at": t?.updatedAt && ue(new Date(t?.updatedAt), "PPpp"),
920
930
  "Last updated by": t?.updatedBy,
921
- ...i
922
- }, o = Object.keys(u).map((a) => ({
923
- name: a,
931
+ ...n
932
+ }, o = Object.keys(i).map((s) => ({
933
+ name: s,
924
934
  data: { type: "string" },
925
935
  hidden: !1
926
936
  }));
927
- return /* @__PURE__ */ C(yt, { form: u, fields: o, isLoading: !!e });
928
- }, as = ({
937
+ return /* @__PURE__ */ b(Gt, { form: i, fields: o, isLoading: !!e });
938
+ }, qa = ({
929
939
  label: t,
930
940
  description: e,
931
- features: i,
932
- isCloseable: u = !0,
941
+ features: n,
942
+ isCloseable: i = !0,
933
943
  addon: o
934
944
  }) => {
935
- const [a, s] = F(!1), { setPowerpackDialog: h, selectedPowerPack: l, powerpackDialog: m, addonDialog: n } = ht(), E = !!o || !!n, v = t ?? m?.label ?? n?.label, T = e ?? m?.description ?? (n ? n.features[n.selectedFeature ?? ""]?.description ?? Object.values(n.features)[0]?.description : void 0), f = o?.icon ?? (n ? n.icon : "bolt");
936
- if (!m && !n && (!t || !e)) return null;
937
- const R = (() => {
938
- if (i)
939
- return Object.entries(i);
940
- if (n) {
941
- const V = n.featureOrder.filter((I) => I in n.features).map(
942
- (I) => [I, n.features[I]]
945
+ const [s, a] = F(!1), { setPowerpackDialog: g, selectedPowerPack: l, powerpackDialog: d, addonDialog: r } = Mt(), k = !!o || !!r, v = t ?? d?.label ?? r?.label, O = e ?? d?.description ?? (r ? r.features[r.selectedFeature ?? ""]?.description ?? Object.values(r.features)[0]?.description : void 0), m = o?.icon ?? (r ? r.icon : "bolt");
946
+ if (!d && !r && (!t || !e)) return null;
947
+ const T = (() => {
948
+ if (n)
949
+ return Object.entries(n);
950
+ if (r) {
951
+ const V = r.featureOrder.filter((A) => A in r.features).map(
952
+ (A) => [A, r.features[A]]
943
953
  );
944
- if (n.selectedFeature) {
945
- const I = V.findIndex(([M]) => M === n.selectedFeature);
946
- if (I > 0) {
947
- const [M] = V.splice(I, 1);
954
+ if (r.selectedFeature) {
955
+ const A = V.findIndex(([M]) => M === r.selectedFeature);
956
+ if (A > 0) {
957
+ const [M] = V.splice(A, 1);
948
958
  V.unshift(M);
949
959
  }
950
960
  }
951
961
  return V;
952
962
  }
953
- return Object.entries(bt).sort(([V], [I]) => {
963
+ return Object.entries(Ut).sort(([V], [A]) => {
954
964
  if (V === l) return -1;
955
- if (I === l) return 1;
956
- const M = Ve.indexOf(V), N = Ve.indexOf(I);
965
+ if (A === l) return 1;
966
+ const M = Ae.indexOf(V), N = Ae.indexOf(A);
957
967
  return M > -1 && N > -1 ? M - N : M > -1 ? -1 : N > -1 ? 1 : 0;
958
968
  });
959
969
  })();
960
- return /* @__PURE__ */ H(
961
- et,
970
+ return /* @__PURE__ */ B(
971
+ ht,
962
972
  {
963
973
  isOpen: !0,
964
974
  onClose: () => {
965
- u && (h(null), s(!1));
975
+ i && (g(null), a(!1));
966
976
  },
967
977
  size: "lg",
968
- hideCancelButton: !u,
969
- hideBackdrop: !u,
978
+ hideCancelButton: !i,
979
+ hideBackdrop: !i,
970
980
  children: [
971
- /* @__PURE__ */ H(tt, { children: [
972
- /* @__PURE__ */ H("h1", { children: [
973
- /* @__PURE__ */ C(ie, { icon: f }),
981
+ /* @__PURE__ */ B(gt, { children: [
982
+ /* @__PURE__ */ B("h1", { children: [
983
+ /* @__PURE__ */ b(de, { icon: m }),
974
984
  v
975
985
  ] }),
976
- /* @__PURE__ */ C("h2", { children: T })
986
+ /* @__PURE__ */ b("h2", { children: O })
977
987
  ] }),
978
- /* @__PURE__ */ H(at, { children: [
979
- E ? /* @__PURE__ */ H("h3", { children: [
988
+ /* @__PURE__ */ B(bt, { children: [
989
+ k ? /* @__PURE__ */ B("h3", { children: [
980
990
  "Unlock all ",
981
- /* @__PURE__ */ C("span", { className: "green", children: "Premium Addons" }),
991
+ /* @__PURE__ */ b("span", { className: "green", children: "Premium Addons" }),
982
992
  " with an AYON Studio subscription."
983
- ] }) : /* @__PURE__ */ H("h3", { children: [
993
+ ] }) : /* @__PURE__ */ B("h3", { children: [
984
994
  "Unlock all ",
985
- /* @__PURE__ */ C(ie, { icon: "bolt" }),
995
+ /* @__PURE__ */ b(de, { icon: "bolt" }),
986
996
  " ",
987
- /* @__PURE__ */ C("span", { className: "green", children: "Power Features" }),
997
+ /* @__PURE__ */ b("span", { className: "green", children: "Power Features" }),
988
998
  " with an AYON subscription."
989
999
  ] }),
990
- /* @__PURE__ */ C("ul", { children: R.slice(0, a ? void 0 : 5).map(([V, I]) => /* @__PURE__ */ H("li", { children: [
991
- /* @__PURE__ */ C(ie, { icon: I.icon ?? "check" }),
992
- /* @__PURE__ */ C("span", { children: I.bullet })
1000
+ /* @__PURE__ */ b("ul", { children: T.slice(0, s ? void 0 : 5).map(([V, A]) => /* @__PURE__ */ B("li", { children: [
1001
+ /* @__PURE__ */ b(de, { icon: A.icon ?? "check" }),
1002
+ /* @__PURE__ */ b("span", { children: A.bullet })
993
1003
  ] }, V)) }),
994
- !a && R.length > 5 && /* @__PURE__ */ C(st, { onClick: () => s(!0), children: "Show all" })
1004
+ !s && T.length > 5 && /* @__PURE__ */ b(wt, { onClick: () => a(!0), children: "Show all" })
995
1005
  ] }),
996
- /* @__PURE__ */ C(ot, { addon: o?.name, children: /* @__PURE__ */ C(nt, {}) })
1006
+ /* @__PURE__ */ b(yt, { addon: o?.name, children: /* @__PURE__ */ b(vt, {}) })
997
1007
  ]
998
1008
  }
999
1009
  );
1000
- }, Fe = ({
1010
+ }, Qa = (t) => {
1011
+ const { projectName: e } = je(), { contributions: n } = ps("projectTable.customizeSection");
1012
+ return Y(() => {
1013
+ const i = { projectName: e, page: t };
1014
+ return n.filter((o) => !o.pages?.length || o.pages.includes(t)).map((o) => ({
1015
+ // namespaced, so it can't replace a built-in section (settings are merged by id)
1016
+ id: `addon:${o.key}`,
1017
+ title: o.title,
1018
+ icon: o.icon,
1019
+ component: Vt(Xe, {
1020
+ contribution: o,
1021
+ context: i
1022
+ })
1023
+ }));
1024
+ }, [n, e, t]);
1025
+ }, Be = ({
1001
1026
  Component: t,
1002
1027
  projectName: e,
1003
- state: i,
1004
- dispatch: u,
1028
+ state: n,
1029
+ dispatch: i,
1005
1030
  useSelector: o,
1006
- onOpenImage: a,
1007
- onGoToFrame: s,
1008
- onOpenViewer: h,
1031
+ onOpenImage: s,
1032
+ onGoToFrame: a,
1033
+ onOpenViewer: g,
1009
1034
  onUpdateEntity: l,
1010
- ...m
1035
+ ...d
1011
1036
  }) => {
1012
- const n = gt(), { onCreateView: E, getLatestSettings: v, markCacheDirty: T } = Ut();
1013
- return /* @__PURE__ */ C(
1037
+ const r = Ke(), { onCreateView: k, getLatestSettings: v, markCacheDirty: O } = Je();
1038
+ return /* @__PURE__ */ b(
1014
1039
  t,
1015
1040
  {
1016
- router: { useParams: Lt, useNavigate: Mt, useLocation: Nt, useSearchParams: Pt },
1041
+ router: { useParams: us, useNavigate: Qe, useLocation: cs, useSearchParams: is },
1017
1042
  projectName: e,
1018
1043
  views: {
1019
- ...n,
1020
- settings: n.viewSettings,
1021
- updateViewSettings: (...f) => Gt(...f, n, E, v, T)
1044
+ ...r,
1045
+ settings: r.viewSettings,
1046
+ updateViewSettings: (...m) => bs(...m, r, k, v, O)
1022
1047
  },
1023
1048
  context: {},
1024
- state: i,
1025
- dispatch: u,
1049
+ state: n,
1050
+ dispatch: i,
1026
1051
  useSelector: o,
1027
- onOpenImage: a,
1028
- onGoToFrame: s,
1029
- onOpenViewer: h,
1052
+ onOpenImage: s,
1053
+ onGoToFrame: a,
1054
+ onOpenViewer: g,
1030
1055
  onUpdateEntity: l,
1031
- toast: he,
1032
- ...m
1056
+ toast: Q,
1057
+ ...d
1033
1058
  }
1034
1059
  );
1035
- }, ea = ({ children: t, fields: e }) => {
1036
- const i = Wt.filter((u) => e.includes(u.value));
1037
- return /* @__PURE__ */ C("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ H(
1038
- zt,
1039
- {
1040
- layout: "horizontal",
1041
- style: { width: "100%", height: "100%" },
1042
- stateKey: Ht,
1043
- stateStorage: "local",
1044
- children: [
1045
- /* @__PURE__ */ C(Ie, { ...Yt, children: /* @__PURE__ */ C(ut, { wrap: !0, children: /* @__PURE__ */ C($t, { sliceFields: i, pinnedSliceType: "hierarchy" }) }) }),
1046
- /* @__PURE__ */ C(Ie, { size: 80, children: t })
1047
- ]
1048
- }
1049
- ) });
1050
- }, ss = ({
1060
+ }, Fs = ({ children: t, fields: e }) => /* @__PURE__ */ b("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ b(fs, { sidebar: /* @__PURE__ */ b(ms, { fields: e }), children: t }) }), Xa = ({
1051
1061
  Component: t,
1052
1062
  projectName: e,
1053
- slicer: i,
1054
- state: u = {},
1063
+ slicer: n,
1064
+ state: i = {},
1055
1065
  addonProps: o,
1056
- ...a
1066
+ ...s
1057
1067
  }) => {
1058
- let s = /* @__PURE__ */ C(Fe, { Component: t, projectName: e, ...a });
1059
- if (i && e) {
1060
- let h = null;
1068
+ let a = /* @__PURE__ */ b(Be, { Component: t, projectName: e, ...s });
1069
+ if (n && e) {
1070
+ let g = null;
1061
1071
  try {
1062
- h = dt();
1072
+ g = Ge();
1063
1073
  } catch {
1064
1074
  console.log("Slicer context not available for this addon page");
1065
1075
  }
1066
- s = /* @__PURE__ */ C(ea, { fields: i.fields, children: /* @__PURE__ */ C(
1067
- Fe,
1076
+ a = /* @__PURE__ */ b(Fs, { fields: n.fields, children: /* @__PURE__ */ b(
1077
+ Be,
1068
1078
  {
1069
1079
  Component: t,
1070
1080
  projectName: e,
1071
- ...a,
1072
- state: { slicer: h, ...u },
1081
+ ...s,
1082
+ state: { slicer: g, ...i },
1073
1083
  ...o
1074
1084
  }
1075
1085
  ) });
1076
1086
  }
1077
- return s;
1078
- }, ta = /* @__PURE__ */ new Set([
1087
+ return a;
1088
+ }, _s = () => /* @__PURE__ */ B(Et, { children: [
1089
+ "By logging in you agree to our",
1090
+ " ",
1091
+ /* @__PURE__ */ b("a", { href: "https://ynput.io/terms/", target: "_blank", children: "Terms of Service" }),
1092
+ " ",
1093
+ "and",
1094
+ " ",
1095
+ /* @__PURE__ */ b("a", { href: "https://ynput.io/privacy-policy", target: "_blank", children: "Privacy Policy" })
1096
+ ] }), Ja = ({ onLogin: t, loading: e = null, isFirstTime: n = !1 }) => {
1097
+ const i = ls(), o = new URLSearchParams(window.location.search), [s, a] = F(""), [g, l] = F(""), d = o.getAll("provider"), [r, k] = F(!1), [v, O] = F(!1), { data: m, isLoading: R } = es({ full: !0 }), T = m || {}, { motd: w, loginPageBrand: V = "", loginPageBackground: A = "" } = T;
1098
+ G(() => {
1099
+ document.title = "Login • AYON";
1100
+ }, []), G(() => {
1101
+ window.location.pathname.startsWith("/login") || (console.debug("Storing preferred URL in local storage:", window.location.href), localStorage.setItem("auth-preferred-url", window.location.href));
1102
+ }, []);
1103
+ const M = async (C) => {
1104
+ if (C.preventDefault(), !(s && g)) {
1105
+ Q.error("Please enter username and password to login");
1106
+ return;
1107
+ }
1108
+ let h = null;
1109
+ try {
1110
+ h = await Fe.post("/api/auth/login", { name: s, password: g });
1111
+ } catch (y) {
1112
+ const S = y;
1113
+ console.error("Login error", S.response?.data || S), Q.error(S.response?.data?.detail || `Unable to login: Error ${S.response?.status}`);
1114
+ return;
1115
+ }
1116
+ if (!h || !h.data) {
1117
+ console.error("Login error", h), Q.error("Unable to login, check the console for details");
1118
+ return;
1119
+ }
1120
+ localStorage.removeItem("auth-preferred-url"), Q.info(h.data.detail), t({ user: h.data.user, accessToken: h.data.token }), i(Re.util.resetApiState());
1121
+ }, N = async (C) => {
1122
+ const h = window.location.pathname.split("/")[2];
1123
+ if (!h || (console.debug("handleSSOCallback", h), !C?.length && h !== "_token")) return;
1124
+ const y = new URLSearchParams(window.location.search);
1125
+ if (!y.toString()) return;
1126
+ window.history.replaceState({}, "", window.location.pathname);
1127
+ let S = (T?.ssoOptions || []).find((D) => D.name === h);
1128
+ if (h === "_token" && (S = {
1129
+ name: "secure token",
1130
+ callback: "/api/auth/tokenauth"
1131
+ }), !S) return;
1132
+ y.append("ayonProvider", h), O(!0);
1133
+ let c = !1, f = null, u = null;
1134
+ try {
1135
+ console.debug("SSO Callback", S.callback), f = await Fe.get(S.callback, { params: y }), c = !0;
1136
+ } catch (D) {
1137
+ const E = D;
1138
+ console.error("SSO Callback error", E.response?.data), Q.error(
1139
+ /* @__PURE__ */ B(ce, { children: [
1140
+ /* @__PURE__ */ B("p", { children: [
1141
+ "Unable to login using ",
1142
+ S.name,
1143
+ ":"
1144
+ ] }),
1145
+ /* @__PURE__ */ b("p", { children: E.response?.data?.detail || `Error ${E.response?.status}` })
1146
+ ] })
1147
+ );
1148
+ }
1149
+ let p = null, I = null;
1150
+ if (c && f?.data?.user) {
1151
+ console.debug("SSO Callback response", f.data);
1152
+ const D = f.data;
1153
+ Q.info(D.detail || `Logged in as ${D.user.name}`), p = D.user, I = D.token, D.redirectUrl && (u = D.redirectUrl);
1154
+ } else c && (Q.error("Unable to login using SSO"), c = !1);
1155
+ c ? (!u && localStorage.getItem("auth-preferred-url") && (u = localStorage.getItem("auth-preferred-url")), u || (u = window.location.origin), O(!1), localStorage.removeItem("auth-preferred-url"), t({ user: p, accessToken: I, redirectUrl: u }), i(Re.util.resetApiState())) : (console.log("SSO Callback failed, clearing auth state"), O(!1), localStorage.removeItem("auth-preferred-url"));
1156
+ };
1157
+ G(() => {
1158
+ N(T.ssoOptions);
1159
+ }, [T.ssoOptions]);
1160
+ const x = r || !T?.hidePasswordAuth || d?.length && d.includes("password") || null, z = !r && (d || !x), j = Y(() => T.ssoOptions?.length ? T.ssoOptions.filter(
1161
+ ({ name: C, hidden: h }) => !h && (!d?.length || d.includes(C) || r)
1162
+ ).map(({ name: C, title: h, url: y, args: S, redirectKey: c, icon: f, color: u, textColor: p }) => {
1163
+ const I = { ...S }, D = `${window.location.origin}/login/${C}`;
1164
+ I[c] = D;
1165
+ const E = new URLSearchParams(I), _ = `${y}?${E}`;
1166
+ return /* @__PURE__ */ b(
1167
+ St,
1168
+ {
1169
+ name: h || C,
1170
+ url: _,
1171
+ icon: f,
1172
+ color: u,
1173
+ textColor: p
1174
+ },
1175
+ C
1176
+ );
1177
+ }) : null, [T.ssoOptions, d, r]);
1178
+ return v || R ? n ? null : /* @__PURE__ */ b(ce, { children: e }) : /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ B("main", { className: "center", children: [
1179
+ A && /* @__PURE__ */ b(kt, { src: A }),
1180
+ /* @__PURE__ */ B(Ct, { children: [
1181
+ (w || V) && /* @__PURE__ */ B(De, { children: [
1182
+ V && /* @__PURE__ */ b(Ot, { src: V }),
1183
+ /* @__PURE__ */ b(Tt, { children: /* @__PURE__ */ b(ys, { remarkPlugins: [ws], children: w }) })
1184
+ ] }),
1185
+ /* @__PURE__ */ B(De, { children: [
1186
+ /* @__PURE__ */ b(It, { src: "/AYON.svg" }),
1187
+ /* @__PURE__ */ B(Dt, { children: [
1188
+ x ? /* @__PURE__ */ B("form", { onSubmit: M, children: [
1189
+ /* @__PURE__ */ b("label", { id: "username", children: "Username" }),
1190
+ /* @__PURE__ */ b(
1191
+ $e,
1192
+ {
1193
+ autoFocus: !0,
1194
+ placeholder: "Enter your username",
1195
+ name: "username",
1196
+ "aria-label": "Username",
1197
+ value: s,
1198
+ onChange: (C) => a(C.target.value)
1199
+ }
1200
+ ),
1201
+ /* @__PURE__ */ b("label", { id: "password", children: "Password" }),
1202
+ /* @__PURE__ */ b(
1203
+ Rt,
1204
+ {
1205
+ placeholder: "Enter password",
1206
+ name: "password",
1207
+ "aria-label": "Password",
1208
+ value: g,
1209
+ onChange: (C) => l(C.target.value)
1210
+ }
1211
+ ),
1212
+ /* @__PURE__ */ b(Pe, { type: "submit", children: /* @__PURE__ */ b("span", { className: "label", children: "Login with password" }) })
1213
+ ] }) : /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ b("div", { style: { marginBottom: "8px" } }) }),
1214
+ j
1215
+ ] }),
1216
+ T?.passwordRecoveryAvailable && x && /* @__PURE__ */ b("a", { href: "/passwordReset", style: { margin: "8px 0" }, children: "Reset password" }),
1217
+ z && /* @__PURE__ */ b(
1218
+ Pe,
1219
+ {
1220
+ style: { width: "100%" },
1221
+ variant: "text",
1222
+ onClick: () => k(!0),
1223
+ children: "Show all login options"
1224
+ }
1225
+ ),
1226
+ /* @__PURE__ */ b(_s, {})
1227
+ ] })
1228
+ ] })
1229
+ ] }) });
1230
+ }, Za = ({ sidebar: t, children: e }) => {
1231
+ const [n, i] = Es();
1232
+ return t ? /* @__PURE__ */ B(
1233
+ vs,
1234
+ {
1235
+ layout: "horizontal",
1236
+ style: { width: "100%", height: "100%" },
1237
+ onResizeEnd: i,
1238
+ children: [
1239
+ /* @__PURE__ */ b(_e, { size: n[0], style: { overflow: "hidden" }, children: t }),
1240
+ /* @__PURE__ */ b(_e, { size: n[1], style: { overflow: "hidden" }, children: e })
1241
+ ]
1242
+ }
1243
+ ) : /* @__PURE__ */ b(ce, { children: e });
1244
+ }, eo = ({ fields: t }) => {
1245
+ const e = t.join(","), n = Y(
1246
+ () => Ss.filter((i) => t.includes(i.value)),
1247
+ // fields is compared by content: addons pass a new array literal every render
1248
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1249
+ [e]
1250
+ );
1251
+ return /* @__PURE__ */ b(xt, { wrap: !0, style: { height: "100%" }, children: /* @__PURE__ */ b(ks, { sliceFields: n, pinnedSliceType: "hierarchy" }) });
1252
+ }, Ls = () => {
1253
+ }, Ze = () => {
1254
+ const t = Ke(), { updateViewSettings: e } = Je(), { viewType: n, viewSettings: i, isLoadingViews: o } = t, s = q(
1255
+ (a) => e(a, Ls, void 0, {}),
1256
+ [e]
1257
+ );
1258
+ return Y(
1259
+ () => n ? {
1260
+ viewType: n,
1261
+ settings: i,
1262
+ isLoading: o,
1263
+ updateSettings: s
1264
+ } : void 0,
1265
+ [n, i, o, s]
1266
+ );
1267
+ }, Ms = () => {
1268
+ const {
1269
+ folders: t,
1270
+ isLoading: e,
1271
+ getFolderById: n,
1272
+ getParentFolderIds: i,
1273
+ getChildFolderIds: o,
1274
+ getFolderIdsWithoutChildren: s
1275
+ } = Nt();
1276
+ return Y(
1277
+ () => ({
1278
+ // attrib is typed `object` in the api model
1279
+ folders: t,
1280
+ isLoading: e,
1281
+ getFolderById: n,
1282
+ getParentFolderIds: i,
1283
+ getChildFolderIds: o,
1284
+ getFolderIdsWithoutChildren: s
1285
+ }),
1286
+ [
1287
+ t,
1288
+ e,
1289
+ n,
1290
+ i,
1291
+ o,
1292
+ s
1293
+ ]
1294
+ );
1295
+ }, to = (t) => {
1296
+ const { data: e } = ts({ projectName: t }), { rowSelection: n, sliceType: i } = Ge(), o = Y(
1297
+ () => ({
1298
+ sliceType: i,
1299
+ selection: Object.keys(n).filter((g) => n[g])
1300
+ }),
1301
+ [i, n]
1302
+ ), s = Ms(), a = Ze();
1303
+ return Y(
1304
+ () => ({ projectName: t, project: e, slicer: o, projectFolders: s, views: a }),
1305
+ [t, e, o, s, a]
1306
+ );
1307
+ }, so = (t) => {
1308
+ const e = Ze();
1309
+ return Y(() => ({ selectedProjects: t, views: e }), [t, e]);
1310
+ }, Ns = (t) => ["to", "run", "dialog", "menu", "component"].find(
1311
+ (e) => t[e] !== void 0
1312
+ ), et = (t, e) => t.map((n, i) => {
1313
+ if ("divider" in n) return { id: "divider" };
1314
+ const { id: o, label: s, icon: a, to: g, href: l, onClick: d, items: r, disabled: k, selected: v, danger: O } = n;
1315
+ return {
1316
+ id: `${o}-${i}`,
1317
+ label: s,
1318
+ icon: a,
1319
+ disabled: k,
1320
+ selected: v,
1321
+ danger: O,
1322
+ ...g ? { link: g } : l ? { link: l, target: "_blank" } : {},
1323
+ ...d ? {
1324
+ onClick: () => {
1325
+ Promise.resolve().then(d).catch((m) => qe(e, m));
1326
+ }
1327
+ } : {},
1328
+ ...r?.length ? { items: et(r, e) } : {}
1329
+ };
1330
+ }), ao = ({
1331
+ contribution: t,
1332
+ context: e,
1333
+ renderButton: n,
1334
+ autoOpen: i,
1335
+ onContext: o
1336
+ }) => {
1337
+ const s = t, a = Ns(s), g = Qe(), l = Y(
1338
+ () => ({ ...e, navigate: (x) => g(x) }),
1339
+ [e, g]
1340
+ ), [d, r] = F(!!i && a === "dialog"), k = q(() => r(!1), []), v = Y(() => ({ ...l, close: k }), [l, k]), { menuOpen: O, setMenuOpen: m, toggleMenuOpen: R } = Bt(), T = `addon:${s.slot}:${s.key}`, [w, V] = F([]), [A, M] = F(null);
1341
+ return G(
1342
+ () => o?.(a === "dialog" ? v : l),
1343
+ [o, a, v, l]
1344
+ ), a === "component" ? /* @__PURE__ */ b(Xe, { contribution: t, context: l }) : /* @__PURE__ */ B(ce, { children: [
1345
+ n({
1346
+ ref: M,
1347
+ active: d || O === T,
1348
+ onClick: () => {
1349
+ if (a === "to") g(s.to);
1350
+ else if (a === "run") gs(t, l);
1351
+ else if (a === "dialog") r((x) => !x);
1352
+ else if (a === "menu") {
1353
+ if (O === T) return m(!1);
1354
+ os(s.menu).then((x) => {
1355
+ if (typeof x != "function") throw new Error('"menu" has no default export function');
1356
+ return x(
1357
+ { ...l, slot: s.slot }
1358
+ );
1359
+ }).then((x) => {
1360
+ V(et(x, s)), R(T);
1361
+ }).catch((x) => qe(s, x));
1362
+ }
1363
+ },
1364
+ onMouseEnter: () => a && a !== "to" && hs(s[a])
1365
+ }),
1366
+ a === "dialog" && d && /* @__PURE__ */ b(Is, { contribution: t, context: v }),
1367
+ a === "menu" && /* @__PURE__ */ b(Os, { id: T, target: A, children: /* @__PURE__ */ b(Ts, { menu: w }) })
1368
+ ] });
1369
+ }, Bs = /* @__PURE__ */ new Set([
1079
1370
  "name",
1080
1371
  "extension",
1081
1372
  "status",
@@ -1091,253 +1382,253 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1091
1382
  "hasReviewables",
1092
1383
  "createdAt",
1093
1384
  "updatedAt"
1094
- ]), os = ({
1385
+ ]), oo = ({
1095
1386
  filterTypes: t = [],
1096
1387
  projectNames: e,
1097
- scope: i,
1098
- scopes: u,
1388
+ scope: n,
1389
+ scopes: i,
1099
1390
  data: o,
1100
- config: a,
1101
- power: s
1391
+ config: s,
1392
+ power: a
1102
1393
  }) => {
1103
- const h = vt(), l = o.productTypes || [], m = o.productBaseTypes || [];
1104
- let n = [];
1105
- const E = /* @__PURE__ */ new Map(), v = u || (i ? Array.isArray(i) ? i : [i] : []).map((w) => ({
1106
- scope: w,
1394
+ const g = zt(), l = o.productTypes || [], d = o.productBaseTypes || [];
1395
+ let r = [];
1396
+ const k = /* @__PURE__ */ new Map(), v = i || (n ? Array.isArray(n) ? n : [n] : []).map((y) => ({
1397
+ scope: y,
1107
1398
  filterTypes: t
1108
- })), T = v.length > 1, f = new Set(
1109
- Array.from(new Set(v.flatMap(({ filterTypes: b }) => b))).filter(
1110
- (b) => v.filter(({ filterTypes: w }) => w.includes(b)).length > 1
1399
+ })), O = v.length > 1, m = new Set(
1400
+ Array.from(new Set(v.flatMap(({ filterTypes: h }) => h))).filter(
1401
+ (h) => v.filter(({ filterTypes: y }) => y.includes(h)).length > 1
1111
1402
  )
1112
- ), A = v.some(
1113
- (b) => ["entitySubType", "status"].some((w) => b.filterTypes.includes(w))
1114
1403
  ), R = v.some(
1115
- (b) => ["assignees", "users", "author"].some(
1116
- (w) => b.filterTypes.includes(w)
1404
+ (h) => ["entitySubType", "status"].some((y) => h.filterTypes.includes(y))
1405
+ ), T = v.some(
1406
+ (h) => ["assignees", "users", "author"].some(
1407
+ (y) => h.filterTypes.includes(y)
1117
1408
  )
1118
- ), { data: g = {} } = At(
1409
+ ), { data: w = {} } = ss(
1119
1410
  {
1120
1411
  projects: e
1121
1412
  },
1122
1413
  {
1123
- skip: !e?.length || !A
1414
+ skip: !e?.length || !R
1124
1415
  }
1125
- ), { data: V = [] } = xt(
1416
+ ), { data: V = [] } = as(
1126
1417
  { projects: e },
1127
1418
  {
1128
- skip: !e?.length || !R
1419
+ skip: !e?.length || !T
1129
1420
  }
1130
- ), { attributes: I } = Be(), M = lt(pt), N = M?.attribFields?.length ? M.attribFields : I, L = /* @__PURE__ */ new Map();
1131
- v.forEach(({ scope: b, filterTypes: w }) => {
1132
- w.includes("attributes") && N.filter((S) => S.scope?.includes(b)).forEach((S) => {
1133
- L.set(
1421
+ ), { attributes: A } = Ye(), M = At(_t), N = M?.attribFields?.length ? M.attribFields : A, x = /* @__PURE__ */ new Map();
1422
+ v.forEach(({ scope: h, filterTypes: y }) => {
1423
+ y.includes("attributes") && N.filter((S) => S.scope?.includes(h)).forEach((S) => {
1424
+ x.set(
1134
1425
  S.name,
1135
- (L.get(S.name) || 0) + 1
1426
+ (x.get(S.name) || 0) + 1
1136
1427
  );
1137
1428
  });
1138
- }), v.forEach(({ scope: b, filterTypes: w }) => {
1139
- const S = T ? b : void 0;
1140
- if (w.includes("taskType") && b !== "user") {
1141
- const r = G(
1429
+ }), v.forEach(({ scope: h, filterTypes: y }) => {
1430
+ const S = O ? h : void 0;
1431
+ if (y.includes("taskType") && h !== "user") {
1432
+ const c = H(
1142
1433
  "taskType",
1143
1434
  {
1144
- ...a,
1435
+ ...s,
1145
1436
  enableOperatorChange: !1
1146
1437
  },
1147
1438
  S,
1148
- f.has("taskType")
1439
+ m.has("taskType")
1149
1440
  );
1150
- if (r) {
1151
- let p = ve({ projectsInfo: g, productTypes: l }, "task");
1152
- r.values?.push(...p), n.push(r);
1441
+ if (c) {
1442
+ let f = Ee({ projectsInfo: w, productTypes: l }, "task");
1443
+ c.values?.push(...f), r.push(c);
1153
1444
  }
1154
1445
  }
1155
- if (w.includes("folderType") && b !== "user") {
1156
- const r = G(
1446
+ if (y.includes("folderType") && h !== "user") {
1447
+ const c = H(
1157
1448
  "folderType",
1158
1449
  {
1159
- ...a,
1450
+ ...s,
1160
1451
  enableOperatorChange: !1
1161
1452
  },
1162
1453
  S,
1163
- f.has("folderType")
1454
+ m.has("folderType")
1164
1455
  );
1165
- if (r) {
1166
- let p = ve({ projectsInfo: g, productTypes: l }, "folder");
1167
- r.values?.push(...p), n.push(r);
1456
+ if (c) {
1457
+ let f = Ee({ projectsInfo: w, productTypes: l }, "folder");
1458
+ c.values?.push(...f), r.push(c);
1168
1459
  }
1169
1460
  }
1170
- if (w.includes("productType") && b !== "user") {
1171
- const r = G(
1461
+ if (y.includes("productType") && h !== "user") {
1462
+ const c = H(
1172
1463
  "productType",
1173
1464
  {
1174
- ...a,
1465
+ ...s,
1175
1466
  enableOperatorChange: !1
1176
1467
  },
1177
1468
  S,
1178
- f.has("productType")
1469
+ m.has("productType")
1179
1470
  );
1180
- if (r) {
1181
- let p = ve({ projectsInfo: g, productTypes: l }, "product");
1182
- r.values?.push(...p), n.push(r);
1471
+ if (c) {
1472
+ let f = Ee({ projectsInfo: w, productTypes: l }, "product");
1473
+ c.values?.push(...f), r.push(c);
1183
1474
  }
1184
1475
  }
1185
- if (w.includes("productBaseType") && b !== "user") {
1186
- const r = G(
1476
+ if (y.includes("productBaseType") && h !== "user") {
1477
+ const c = H(
1187
1478
  "productBaseType",
1188
1479
  {
1189
- ...a,
1480
+ ...s,
1190
1481
  enableOperatorChange: !1
1191
1482
  },
1192
1483
  S,
1193
- f.has("productBaseType")
1484
+ m.has("productBaseType")
1194
1485
  );
1195
- r && (m.forEach(({ icon: p, name: c }) => {
1196
- r.values?.some((d) => d.id === c) || r.values?.push({
1197
- id: c,
1198
- label: c,
1199
- icon: p || se("product")
1486
+ c && (d.forEach(({ icon: f, name: u }) => {
1487
+ c.values?.some((p) => p.id === u) || c.values?.push({
1488
+ id: u,
1489
+ label: u,
1490
+ icon: f || ne("product")
1200
1491
  });
1201
- }), o.productBaseTypes?.forEach(({ icon: p, name: c }) => {
1202
- r.values?.some((d) => d.id === c) || r.values?.push({
1203
- id: c,
1204
- label: c,
1205
- icon: p || se("product")
1492
+ }), o.productBaseTypes?.forEach(({ icon: f, name: u }) => {
1493
+ c.values?.some((p) => p.id === u) || c.values?.push({
1494
+ id: u,
1495
+ label: u,
1496
+ icon: f || ne("product")
1206
1497
  });
1207
- }), n.push(r));
1498
+ }), r.push(c));
1208
1499
  }
1209
- if (w.includes("productName") && b === "product") {
1210
- const r = G(
1500
+ if (y.includes("productName") && h === "product") {
1501
+ const c = H(
1211
1502
  "productName",
1212
- a,
1503
+ s,
1213
1504
  S,
1214
- f.has("productName")
1505
+ m.has("productName")
1215
1506
  );
1216
- r && (o.productNames?.forEach((p) => {
1217
- r.values?.some((c) => c.id === p) || r.values?.push({
1218
- id: p,
1219
- label: p
1507
+ c && (o.productNames?.forEach((f) => {
1508
+ c.values?.some((u) => u.id === f) || c.values?.push({
1509
+ id: f,
1510
+ label: f
1220
1511
  });
1221
- }), n.push(r));
1512
+ }), r.push(c));
1222
1513
  }
1223
- if (w.includes("status")) {
1224
- const r = G(
1514
+ if (y.includes("status")) {
1515
+ const c = H(
1225
1516
  "status",
1226
- { ...a, enableOperatorChange: !1 },
1517
+ { ...s, enableOperatorChange: !1 },
1227
1518
  S,
1228
- f.has("status")
1519
+ m.has("status")
1229
1520
  );
1230
- r && (Object.values(g).forEach((p) => {
1231
- (p?.statuses || []).filter((d) => d.scope?.includes(b)).forEach((d) => {
1232
- r.values?.some((k) => k.id === d.name) || r.values?.push({
1233
- id: d.name,
1234
- label: d.name,
1235
- icon: d.icon,
1236
- color: d.color
1521
+ c && (Object.values(w).forEach((f) => {
1522
+ (f?.statuses || []).filter((p) => p.scope?.includes(h)).forEach((p) => {
1523
+ c.values?.some((I) => I.id === p.name) || c.values?.push({
1524
+ id: p.name,
1525
+ label: p.name,
1526
+ icon: p.icon,
1527
+ color: p.color
1237
1528
  });
1238
1529
  });
1239
- }), n.push(r));
1530
+ }), r.push(c));
1240
1531
  }
1241
- if (w.includes("assignees")) {
1242
- const r = G(
1532
+ if (y.includes("assignees")) {
1533
+ const c = H(
1243
1534
  "assignees",
1244
- a,
1535
+ s,
1245
1536
  S,
1246
- f.has("assignees")
1537
+ m.has("assignees")
1247
1538
  );
1248
- r && (V.forEach((p) => {
1249
- r.values?.some((c) => c.id === p.name) || r.values?.push({
1250
- id: p.name,
1251
- label: p.attrib.fullName || p.name,
1252
- img: `/api/users/${p.name}/avatar`,
1539
+ c && (V.forEach((f) => {
1540
+ c.values?.some((u) => u.id === f.name) || c.values?.push({
1541
+ id: f.name,
1542
+ label: f.attrib.fullName || f.name,
1543
+ img: `/api/users/${f.name}/avatar`,
1253
1544
  icon: null
1254
1545
  });
1255
- }), r.values?.sort((p, c) => {
1256
- const d = o.assignees?.filter((x) => x === p.id).length || 0;
1257
- return (o.assignees?.filter((x) => x === c.id).length || 0) - d;
1258
- }), n.push(r));
1546
+ }), c.values?.sort((f, u) => {
1547
+ const p = o.assignees?.filter((D) => D === f.id).length || 0;
1548
+ return (o.assignees?.filter((D) => D === u.id).length || 0) - p;
1549
+ }), r.push(c));
1259
1550
  }
1260
- if (w.includes("author")) {
1261
- const r = G(
1551
+ if (y.includes("author")) {
1552
+ const c = H(
1262
1553
  "author",
1263
- a,
1554
+ s,
1264
1555
  S,
1265
- f.has("author")
1556
+ m.has("author")
1266
1557
  );
1267
- r && (V.forEach((p) => {
1268
- r.values?.some((c) => c.id === p.name) || r.values?.push({
1269
- id: p.name,
1270
- label: p.attrib.fullName || p.name,
1271
- img: `/api/users/${p.name}/avatar`,
1558
+ c && (V.forEach((f) => {
1559
+ c.values?.some((u) => u.id === f.name) || c.values?.push({
1560
+ id: f.name,
1561
+ label: f.attrib.fullName || f.name,
1562
+ img: `/api/users/${f.name}/avatar`,
1272
1563
  icon: null
1273
1564
  });
1274
- }), n.push(r));
1565
+ }), r.push(c));
1275
1566
  }
1276
- if (w.includes("tags")) {
1277
- const r = G("tags", a, S, f.has("tags"));
1278
- if (r) {
1279
- const p = /* @__PURE__ */ new Map();
1280
- Object.values(g).forEach((k) => {
1281
- k?.tags && k.tags.forEach((x) => {
1282
- p.has(x.name) || p.set(x.name, x);
1567
+ if (y.includes("tags")) {
1568
+ const c = H("tags", s, S, m.has("tags"));
1569
+ if (c) {
1570
+ const f = /* @__PURE__ */ new Map();
1571
+ Object.values(w).forEach((I) => {
1572
+ I?.tags && I.tags.forEach((D) => {
1573
+ f.has(D.name) || f.set(D.name, D);
1283
1574
  });
1284
1575
  });
1285
- const c = /* @__PURE__ */ new Map();
1286
- o.tags?.forEach((k) => {
1287
- const x = c.get(k);
1288
- if (x) {
1289
- x.count++;
1576
+ const u = /* @__PURE__ */ new Map();
1577
+ o.tags?.forEach((I) => {
1578
+ const D = u.get(I);
1579
+ if (D) {
1580
+ D.count++;
1290
1581
  return;
1291
1582
  } else {
1292
- const y = p.get(k);
1293
- c.set(k, {
1294
- id: k,
1583
+ const E = f.get(I);
1584
+ u.set(I, {
1585
+ id: I,
1295
1586
  type: "string",
1296
- label: k,
1587
+ label: I,
1297
1588
  values: [],
1298
- color: y?.color || null,
1589
+ color: E?.color || null,
1299
1590
  count: 1
1300
1591
  });
1301
1592
  }
1302
1593
  });
1303
- const d = Array.from(c.values()).sort(
1304
- (k, x) => x.count - k.count
1594
+ const p = Array.from(u.values()).sort(
1595
+ (I, D) => D.count - I.count
1305
1596
  );
1306
- r.values?.push(...d), n.push(r);
1597
+ c.values?.push(...p), r.push(c);
1307
1598
  }
1308
1599
  }
1309
- if (w.includes("version")) {
1310
- const r = G("version", a, S);
1311
- r && (rt.forEach((c) => {
1312
- r.values?.push({
1313
- id: c.value,
1314
- label: c.label,
1315
- icon: c.icon
1600
+ if (y.includes("version")) {
1601
+ const c = H("version", s, S);
1602
+ c && (Pt.forEach((u) => {
1603
+ c.values?.push({
1604
+ id: u.value,
1605
+ label: u.label,
1606
+ icon: u.icon
1316
1607
  });
1317
- }), n.push(r));
1608
+ }), r.push(c));
1318
1609
  }
1319
- if (w.includes("name")) {
1320
- const r = G("name", a, S, f.has("name"));
1321
- r && n.push(r);
1610
+ if (y.includes("name")) {
1611
+ const c = H("name", s, S, m.has("name"));
1612
+ c && r.push(c);
1322
1613
  }
1323
- if (w.includes("extension") && b === "representation") {
1324
- const r = G(
1614
+ if (y.includes("extension") && h === "representation") {
1615
+ const c = H(
1325
1616
  "extension",
1326
- a,
1617
+ s,
1327
1618
  S,
1328
- f.has("extension")
1619
+ m.has("extension")
1329
1620
  );
1330
- r && n.push(r);
1621
+ c && r.push(c);
1331
1622
  }
1332
- if (w.includes("hasReviewables")) {
1333
- const r = G(
1623
+ if (y.includes("hasReviewables")) {
1624
+ const c = H(
1334
1625
  "hasReviewables",
1335
- a,
1626
+ s,
1336
1627
  S,
1337
- f.has("hasReviewables")
1628
+ m.has("hasReviewables")
1338
1629
  );
1339
- if (r) {
1340
- const p = [
1630
+ if (c) {
1631
+ const f = [
1341
1632
  {
1342
1633
  id: "true",
1343
1634
  label: "Yes",
@@ -1349,83 +1640,83 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1349
1640
  values: []
1350
1641
  }
1351
1642
  ];
1352
- r.values?.push(...p), n.push(r);
1643
+ c.values?.push(...f), r.push(c);
1353
1644
  }
1354
1645
  }
1355
- if (w.includes("createdAt")) {
1356
- const r = G(
1646
+ if (y.includes("createdAt")) {
1647
+ const c = H(
1357
1648
  "createdAt",
1358
- a,
1649
+ s,
1359
1650
  S,
1360
- f.has("createdAt")
1651
+ m.has("createdAt")
1361
1652
  );
1362
- r && (r.values?.push(we), r.values?.push(
1363
- ...ye().map((p) => ({
1364
- ...p,
1365
- contentAfter: s ? void 0 : /* @__PURE__ */ C(ie, { icon: "bolt" })
1653
+ c && (c.values?.push(ye), c.values?.push(
1654
+ ...ve().map((f) => ({
1655
+ ...f,
1656
+ contentAfter: a ? void 0 : /* @__PURE__ */ b(de, { icon: "bolt" })
1366
1657
  }))
1367
- ), n.push(r));
1658
+ ), r.push(c));
1368
1659
  }
1369
- if (w.includes("updatedAt")) {
1370
- const r = G(
1660
+ if (y.includes("updatedAt")) {
1661
+ const c = H(
1371
1662
  "updatedAt",
1372
- a,
1663
+ s,
1373
1664
  S,
1374
- f.has("updatedAt")
1665
+ m.has("updatedAt")
1375
1666
  );
1376
- r && (r.values?.push(we), r.values?.push(
1377
- ...ye().map((p) => ({
1378
- ...p,
1379
- contentAfter: s ? void 0 : /* @__PURE__ */ C(ie, { icon: "bolt" })
1667
+ c && (c.values?.push(ye), c.values?.push(
1668
+ ...ve().map((f) => ({
1669
+ ...f,
1670
+ contentAfter: a ? void 0 : /* @__PURE__ */ b(de, { icon: "bolt" })
1380
1671
  }))
1381
- ), n.push(r));
1672
+ ), r.push(c));
1382
1673
  }
1383
- if (w.includes("attributes")) {
1384
- const r = N.filter(
1385
- (d) => d.scope?.includes(b) && // replaced by the dedicated extension option: publishing never sets this
1674
+ if (y.includes("attributes")) {
1675
+ const c = N.filter(
1676
+ (p) => p.scope?.includes(h) && // replaced by the dedicated extension option: publishing never sets this
1386
1677
  // attribute on representations, so filtering on it matches nothing
1387
- !(w.includes("extension") && d.name === "extension")
1388
- ), p = _t(o.attributes) ? r : r.filter(
1389
- (d) => o.attributes && o.attributes[d.name]
1678
+ !(y.includes("extension") && p.name === "extension")
1679
+ ), f = ns(o.attributes) ? c : c.filter(
1680
+ (p) => o.attributes && o.attributes[p.name]
1390
1681
  );
1391
- (a?.enableRelativeValues ? p : p.filter((d) => d.data.type !== "datetime")).forEach((d) => {
1392
- const k = o.attributes && o.attributes[d.name], x = d.data.enum, y = d.data.type, P = [
1682
+ (s?.enableRelativeValues ? f : f.filter((p) => p.data.type !== "datetime")).forEach((p) => {
1683
+ const I = o.attributes && o.attributes[p.name], D = p.data.enum, E = p.data.type, _ = [
1393
1684
  "list_of_strings",
1394
1685
  "list_of_integers",
1395
1686
  "list_of_any",
1396
1687
  "list_of_submodels"
1397
- ].includes(y || ""), B = y === "datetime", W = y === "string", j = y === "integer" || y === "float", te = P ? a?.enableOperatorChange : !1, q = d.data.default !== void 0 && d.data.default !== null && d.data.inherit !== !1, pe = (P || B || W || j) && !q ? a?.enableRelativeValues : !1, X = aa(
1398
- d,
1688
+ ].includes(E || ""), U = E === "datetime", W = E === "string", X = E === "integer" || E === "float", ae = _ ? s?.enableOperatorChange : !1, te = p.data.default !== void 0 && p.data.default !== null && p.data.inherit !== !1, he = (_ || U || W || X) && !te ? s?.enableRelativeValues : !1, J = Us(
1689
+ p,
1399
1690
  {
1400
- ...a,
1691
+ ...s,
1401
1692
  allowsCustomValues: !0,
1402
- enableOperatorChange: te,
1403
- enableRelativeValues: pe
1693
+ enableOperatorChange: ae,
1694
+ enableRelativeValues: he
1404
1695
  },
1405
1696
  S,
1406
- (L.get(d.name) || 0) > 1
1697
+ (x.get(p.name) || 0) > 1
1407
1698
  );
1408
- if (d.data.enumResolver) {
1409
- const Q = d.data;
1410
- X.loadValuesKey = e?.[0], X.loadValues = async () => Pe(
1411
- k,
1412
- await h(Q, e?.[0]),
1413
- y
1699
+ if (p.data.enumResolver) {
1700
+ const ee = p.data;
1701
+ J.loadValuesKey = e?.[0], J.loadValues = async () => Ue(
1702
+ I,
1703
+ await g(ee, e?.[0]),
1704
+ E
1414
1705
  );
1415
1706
  }
1416
- const fe = [
1707
+ const ge = [
1417
1708
  "string",
1418
1709
  "integer",
1419
1710
  "float",
1420
1711
  "list_of_strings",
1421
1712
  "list_of_integers"
1422
- ], J = [];
1423
- if (fe.includes(y)) {
1424
- const Q = Pe(k, x, y);
1425
- J.push(...Q);
1713
+ ], Z = [];
1714
+ if (ge.includes(E)) {
1715
+ const ee = Ue(I, D, E);
1716
+ Z.push(...ee);
1426
1717
  }
1427
- if (y === "boolean") {
1428
- const Q = [
1718
+ if (E === "boolean") {
1719
+ const ee = [
1429
1720
  {
1430
1721
  id: "true",
1431
1722
  label: "Yes",
@@ -1437,56 +1728,56 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1437
1728
  values: []
1438
1729
  }
1439
1730
  ];
1440
- J.push(...Q);
1731
+ Z.push(...ee);
1441
1732
  }
1442
- B && (J.push(we), J.push(
1443
- ...ye().map((Q) => ({
1444
- ...Q,
1445
- contentAfter: s ? void 0 : /* @__PURE__ */ C(ie, { icon: "bolt" })
1733
+ U && (Z.push(ye), Z.push(
1734
+ ...ve().map((ee) => ({
1735
+ ...ee,
1736
+ contentAfter: a ? void 0 : /* @__PURE__ */ b(de, { icon: "bolt" })
1446
1737
  }))
1447
- )), X.values?.push(...J), E.set(X.id, d.name), n.push(X);
1738
+ )), J.values?.push(...Z), k.set(J.id, p.name), r.push(J);
1448
1739
  });
1449
1740
  }
1450
1741
  });
1451
- const Y = n.reduce((b, w) => {
1452
- if (!w.group) return b;
1453
- const S = typeof w.group == "string" ? void 0 : w.group, r = S?.name || w.group, p = v.some(({ scope: c }) => c === r);
1454
- return b.some((c) => c.name === r) || b.push({
1455
- name: r,
1456
- label: p ? de(r) : S?.label || w.label,
1457
- icon: p ? se(r) : S?.icon || w.icon,
1458
- color: S?.color || w.color
1459
- }), b;
1460
- }, []), K = sa(n, E, N), D = oa(
1461
- Y,
1462
- K,
1463
- E,
1742
+ const z = r.reduce((h, y) => {
1743
+ if (!y.group) return h;
1744
+ const S = typeof y.group == "string" ? void 0 : y.group, c = S?.name || y.group, f = v.some(({ scope: u }) => u === c);
1745
+ return h.some((u) => u.name === c) || h.push({
1746
+ name: c,
1747
+ label: f ? me(c) : S?.label || y.label,
1748
+ icon: f ? ne(c) : S?.icon || y.icon,
1749
+ color: S?.color || y.color
1750
+ }), h;
1751
+ }, []), j = $s(r, k, N), C = Gs(
1752
+ z,
1753
+ j,
1754
+ k,
1464
1755
  N
1465
1756
  );
1466
- return { options: K, groupOptions: D };
1467
- }, ve = ({
1757
+ return { options: j, groupOptions: C };
1758
+ }, Ee = ({
1468
1759
  projectsInfo: t,
1469
1760
  productTypes: e
1470
- }, i) => {
1471
- const u = [];
1472
- return i === "product" ? e.forEach(({ icon: o, name: a }) => {
1473
- u.push({
1474
- id: a,
1761
+ }, n) => {
1762
+ const i = [];
1763
+ return n === "product" ? e.forEach(({ icon: o, name: s }) => {
1764
+ i.push({
1765
+ id: s,
1475
1766
  type: "string",
1476
- label: a,
1477
- icon: o || se("product"),
1767
+ label: s,
1768
+ icon: o || ne("product"),
1478
1769
  inverted: !1,
1479
1770
  values: [],
1480
1771
  allowsCustomValues: !1
1481
1772
  });
1482
- }) : i === "task" ? Object.values(t).forEach((o) => {
1483
- (o?.taskTypes || []).forEach((s) => {
1484
- u.some((h) => h.id === s.name) || u.push({
1485
- id: s.name,
1773
+ }) : n === "task" ? Object.values(t).forEach((o) => {
1774
+ (o?.taskTypes || []).forEach((a) => {
1775
+ i.some((g) => g.id === a.name) || i.push({
1776
+ id: a.name,
1486
1777
  type: "string",
1487
- label: s.name,
1488
- icon: s.icon,
1489
- color: s.color,
1778
+ label: a.name,
1779
+ icon: a.icon,
1780
+ color: a.color,
1490
1781
  inverted: !1,
1491
1782
  values: [],
1492
1783
  allowsCustomValues: !1,
@@ -1497,14 +1788,14 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1497
1788
  }
1498
1789
  });
1499
1790
  });
1500
- }) : i === "folder" && Object.values(t).forEach((o) => {
1501
- (o?.folderTypes || []).forEach((s) => {
1502
- u.some((h) => h.id === s.name) || u.push({
1503
- id: s.name,
1791
+ }) : n === "folder" && Object.values(t).forEach((o) => {
1792
+ (o?.folderTypes || []).forEach((a) => {
1793
+ i.some((g) => g.id === a.name) || i.push({
1794
+ id: a.name,
1504
1795
  type: "string",
1505
- label: s.name,
1506
- icon: s.icon,
1507
- color: s.color,
1796
+ label: a.name,
1797
+ icon: a.icon,
1798
+ color: a.color,
1508
1799
  inverted: !1,
1509
1800
  values: [],
1510
1801
  allowsCustomValues: !1,
@@ -1515,21 +1806,21 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1515
1806
  }
1516
1807
  });
1517
1808
  });
1518
- }), u;
1519
- }, Ue = (t, e, i, u) => {
1520
- const { prefixes: o, keys: a } = i || {};
1521
- let s = t;
1522
- return a && e in a ? s = `${a[e]}` : o && e in o && (s = `${o[e]}${t}`), u && (s = `${u}_${s}`), s;
1523
- }, G = (t, e, i, u = !1) => {
1524
- const o = (l) => Ue(l, t, e, i);
1525
- let a = null;
1809
+ }), i;
1810
+ }, tt = (t, e, n, i) => {
1811
+ const { prefixes: o, keys: s } = n || {};
1812
+ let a = t;
1813
+ return s && e in s ? a = `${s[e]}` : o && e in o && (a = `${o[e]}${t}`), i && (a = `${i}_${a}`), a;
1814
+ }, H = (t, e, n, i = !1) => {
1815
+ const o = (l) => tt(l, t, e, n);
1816
+ let s = null;
1526
1817
  switch (t) {
1527
1818
  case "taskType":
1528
- a = {
1819
+ s = {
1529
1820
  id: o("taskType"),
1530
1821
  type: "string",
1531
1822
  label: "Task Type",
1532
- icon: $("task"),
1823
+ icon: K("task"),
1533
1824
  inverted: !1,
1534
1825
  operator: "OR",
1535
1826
  values: [],
@@ -1541,11 +1832,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1541
1832
  };
1542
1833
  break;
1543
1834
  case "folderType":
1544
- a = {
1835
+ s = {
1545
1836
  id: o("folderType"),
1546
1837
  type: "string",
1547
1838
  label: "Folder Type",
1548
- icon: $("folder"),
1839
+ icon: K("folder"),
1549
1840
  inverted: !1,
1550
1841
  operator: "OR",
1551
1842
  values: [],
@@ -1557,11 +1848,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1557
1848
  };
1558
1849
  break;
1559
1850
  case "productType":
1560
- a = {
1851
+ s = {
1561
1852
  id: o("productType"),
1562
1853
  type: "string",
1563
1854
  label: "Product Type",
1564
- icon: $("product"),
1855
+ icon: K("product"),
1565
1856
  inverted: !1,
1566
1857
  operator: "OR",
1567
1858
  values: [],
@@ -1573,11 +1864,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1573
1864
  };
1574
1865
  break;
1575
1866
  case "productBaseType":
1576
- a = {
1867
+ s = {
1577
1868
  id: o("productBaseType"),
1578
1869
  type: "string",
1579
1870
  label: "Product Base Type",
1580
- icon: $("product"),
1871
+ icon: K("product"),
1581
1872
  inverted: !1,
1582
1873
  operator: "OR",
1583
1874
  values: [],
@@ -1589,11 +1880,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1589
1880
  };
1590
1881
  break;
1591
1882
  case "productName":
1592
- a = {
1883
+ s = {
1593
1884
  id: o("productNames"),
1594
1885
  type: "string",
1595
1886
  label: "Product Name",
1596
- icon: $("productName", "string"),
1887
+ icon: K("productName", "string"),
1597
1888
  inverted: !1,
1598
1889
  operator: "OR",
1599
1890
  values: [],
@@ -1605,11 +1896,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1605
1896
  };
1606
1897
  break;
1607
1898
  case "status":
1608
- a = {
1899
+ s = {
1609
1900
  id: o("status"),
1610
1901
  type: "string",
1611
1902
  label: "Status",
1612
- icon: $("status"),
1903
+ icon: K("status"),
1613
1904
  inverted: !1,
1614
1905
  operator: "OR",
1615
1906
  values: [],
@@ -1621,11 +1912,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1621
1912
  };
1622
1913
  break;
1623
1914
  case "assignees":
1624
- a = {
1915
+ s = {
1625
1916
  id: o("assignees"),
1626
1917
  type: "list_of_strings",
1627
1918
  label: "Assignee",
1628
- icon: $("assignees"),
1919
+ icon: K("assignees"),
1629
1920
  inverted: !1,
1630
1921
  operator: "OR",
1631
1922
  values: [],
@@ -1637,11 +1928,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1637
1928
  };
1638
1929
  break;
1639
1930
  case "author":
1640
- a = {
1931
+ s = {
1641
1932
  id: o("author"),
1642
1933
  type: "string",
1643
1934
  label: "Author",
1644
- icon: $("author"),
1935
+ icon: K("author"),
1645
1936
  inverted: !1,
1646
1937
  operator: "OR",
1647
1938
  values: [],
@@ -1653,11 +1944,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1653
1944
  };
1654
1945
  break;
1655
1946
  case "tags":
1656
- a = {
1947
+ s = {
1657
1948
  id: o("tags"),
1658
1949
  type: "list_of_strings",
1659
1950
  label: "Tags",
1660
- icon: $("tags"),
1951
+ icon: K("tags"),
1661
1952
  inverted: !1,
1662
1953
  operator: "OR",
1663
1954
  values: [],
@@ -1669,11 +1960,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1669
1960
  };
1670
1961
  break;
1671
1962
  case "version":
1672
- a = {
1963
+ s = {
1673
1964
  id: o("version"),
1674
1965
  type: "string",
1675
1966
  label: "Version",
1676
- icon: se("version"),
1967
+ icon: ne("version"),
1677
1968
  inverted: !1,
1678
1969
  operator: "OR",
1679
1970
  values: [],
@@ -1686,7 +1977,7 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1686
1977
  };
1687
1978
  break;
1688
1979
  case "name":
1689
- a = {
1980
+ s = {
1690
1981
  id: o("name"),
1691
1982
  type: "string",
1692
1983
  label: "Name",
@@ -1702,11 +1993,11 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1702
1993
  };
1703
1994
  break;
1704
1995
  case "extension":
1705
- a = {
1996
+ s = {
1706
1997
  id: o("extension"),
1707
1998
  type: "string",
1708
1999
  label: "File Extension",
1709
- icon: $("extension", "string"),
2000
+ icon: K("extension", "string"),
1710
2001
  inverted: !1,
1711
2002
  operator: "OR",
1712
2003
  values: [],
@@ -1718,7 +2009,7 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1718
2009
  };
1719
2010
  break;
1720
2011
  case "hasReviewables":
1721
- a = {
2012
+ s = {
1722
2013
  id: o("hasReviewables"),
1723
2014
  type: "boolean",
1724
2015
  label: "Has Reviewables",
@@ -1735,7 +2026,7 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1735
2026
  };
1736
2027
  break;
1737
2028
  case "createdAt":
1738
- a = {
2029
+ s = {
1739
2030
  id: o("createdAt"),
1740
2031
  type: "datetime",
1741
2032
  label: "Created",
@@ -1752,7 +2043,7 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1752
2043
  };
1753
2044
  break;
1754
2045
  case "updatedAt":
1755
- a = {
2046
+ s = {
1756
2047
  id: o("updatedAt"),
1757
2048
  type: "datetime",
1758
2049
  label: "Updated",
@@ -1769,24 +2060,24 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1769
2060
  };
1770
2061
  break;
1771
2062
  }
1772
- const s = de(i || ""), h = (l) => i ? `${s} ${l}` : l;
1773
- if ((u || i) && a) {
1774
- const l = i || t;
1775
- a.group = {
2063
+ const a = me(n || ""), g = (l) => n ? `${a} ${l}` : l;
2064
+ if ((i || n) && s) {
2065
+ const l = n || t;
2066
+ s.group = {
1776
2067
  name: l,
1777
- label: i ? de(i) : a.label,
1778
- icon: i ? se(i) : a.icon
2068
+ label: n ? me(n) : s.label,
2069
+ icon: n ? ne(n) : s.icon
1779
2070
  };
1780
2071
  }
1781
- return a && i && (a.tooltip = h(a.label), a.value = { label: h(a.label) }), a && t === "version" && i === "version" && (a.value = { label: "Product Version" }, a.tooltip = "Product Version"), a;
1782
- }, aa = (t, e, i, u = !1) => {
1783
- const o = t.data.title || t.name, a = u || i ? {
1784
- name: i || t.name,
1785
- label: i ? de(i) : o,
1786
- icon: i ? se(i) : $(t.name, t.data.type, Re(t.data))
2072
+ return s && n && (s.tooltip = g(s.label), s.value = { label: g(s.label) }), s && t === "version" && n === "version" && (s.value = { label: "Product Version" }, s.tooltip = "Product Version"), s;
2073
+ }, Us = (t, e, n, i = !1) => {
2074
+ const o = t.data.title || t.name, s = i || n ? {
2075
+ name: n || t.name,
2076
+ label: n ? me(n) : o,
2077
+ icon: n ? ne(n) : K(t.name, t.data.type, xe(t.data))
1787
2078
  } : void 0;
1788
2079
  return {
1789
- id: Ue(t.name, "attributes", e, i),
2080
+ id: tt(t.name, "attributes", e, n),
1790
2081
  type: t.data.type,
1791
2082
  label: o,
1792
2083
  operator: "OR",
@@ -1797,27 +2088,27 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1797
2088
  allowNoValue: e.enableRelativeValues,
1798
2089
  allowExcludes: e?.enableExcludes,
1799
2090
  operatorChangeable: e?.enableOperatorChange,
1800
- icon: $(t.name, t.data.type, Re(t.data)),
1801
- group: a,
1802
- tooltip: i ? `${de(i)} ${o}` : void 0,
1803
- value: i ? { icon: se(i) } : void 0,
2091
+ icon: K(t.name, t.data.type, xe(t.data)),
2092
+ group: s,
2093
+ tooltip: n ? `${me(n)} ${o}` : void 0,
2094
+ value: n ? { icon: ne(n) } : void 0,
1804
2095
  singleSelect: ["boolean", "datetime"].includes(t.data.type || "")
1805
2096
  };
1806
- }, Pe = (t, e, i) => {
1807
- const u = [], o = [];
2097
+ }, Ue = (t, e, n) => {
2098
+ const i = [], o = [];
1808
2099
  if (e) {
1809
- const a = (t || []).flatMap((s) => Array.isArray(s) ? s : [s]);
1810
- Et(e, a).forEach(
1811
- (s) => {
1812
- const h = s.icon, l = Ct(h);
1813
- u.push({
1814
- id: s.value.toString(),
1815
- type: i,
1816
- label: s.label,
2100
+ const s = (t || []).flatMap((a) => Array.isArray(a) ? a : [a]);
2101
+ Ht(e, s).forEach(
2102
+ (a) => {
2103
+ const g = a.icon, l = Wt(g);
2104
+ i.push({
2105
+ id: a.value.toString(),
2106
+ type: n,
2107
+ label: a.label,
1817
2108
  values: [],
1818
- icon: l ? null : h,
1819
- img: l ? h : void 0,
1820
- color: s.color,
2109
+ icon: l ? null : g,
2110
+ img: l ? g : void 0,
2111
+ color: a.color,
1821
2112
  pt: {
1822
2113
  style: { color: "inherit" }
1823
2114
  }
@@ -1825,60 +2116,60 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1825
2116
  }
1826
2117
  );
1827
2118
  }
1828
- return t?.forEach((a) => {
1829
- if (!a) return;
1830
- let s = "";
1831
- switch (typeof a) {
2119
+ return t?.forEach((s) => {
2120
+ if (!s) return;
2121
+ let a = "";
2122
+ switch (typeof s) {
1832
2123
  case "string":
1833
2124
  case "number":
1834
2125
  case "boolean":
1835
- s = a.toString();
2126
+ a = s.toString();
1836
2127
  break;
1837
2128
  case "object":
1838
- Array.isArray(a) ? s = a.join(", ") : s = JSON.stringify(a);
2129
+ Array.isArray(s) ? a = s.join(", ") : a = JSON.stringify(s);
1839
2130
  break;
1840
2131
  }
1841
- const h = s.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
1842
- if (u?.find((n) => n.id === h)) return;
1843
- const m = o.find((n) => n.id === h);
1844
- if (m) {
1845
- m.count++;
2132
+ const g = a.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
2133
+ if (i?.find((r) => r.id === g)) return;
2134
+ const d = o.find((r) => r.id === g);
2135
+ if (d) {
2136
+ d.count++;
1846
2137
  return;
1847
2138
  } else
1848
2139
  o.push({
1849
- id: h,
1850
- type: i,
1851
- label: s,
2140
+ id: g,
2141
+ type: n,
2142
+ label: a,
1852
2143
  values: [],
1853
2144
  count: 1
1854
2145
  });
1855
- }), o.sort((a, s) => s.count - a.count), [...u, ...o];
1856
- }, sa = (t, e, i) => [...t].sort((u, o) => Ge(
1857
- ge(u),
1858
- e.get(u.id),
1859
- ge(o),
2146
+ }), o.sort((s, a) => a.count - s.count), [...i, ...o];
2147
+ }, $s = (t, e, n) => [...t].sort((i, o) => st(
2148
+ be(i),
2149
+ e.get(i.id),
2150
+ be(o),
1860
2151
  e.get(o.id),
1861
- i
1862
- )), ge = (t) => t.group ? typeof t.group == "string" ? t.group : t.group.name : t.id, oa = (t, e, i, u) => [...t].sort((o, a) => {
1863
- const s = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === o.name), h = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === a.name);
1864
- return Ge(
1865
- s ? ge(s) : o.name,
1866
- s ? i.get(s.id) : o.name,
1867
- h ? ge(h) : a.name,
1868
- h ? i.get(h.id) : a.name,
1869
- u
2152
+ n
2153
+ )), be = (t) => t.group ? typeof t.group == "string" ? t.group : t.group.name : t.id, Gs = (t, e, n, i) => [...t].sort((o, s) => {
2154
+ const a = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === o.name), g = e.find((l) => (typeof l.group == "string" ? l.group : l.group?.name) === s.name);
2155
+ return st(
2156
+ a ? be(a) : o.name,
2157
+ a ? n.get(a.id) : o.name,
2158
+ g ? be(g) : s.name,
2159
+ g ? n.get(g.id) : s.name,
2160
+ i
1870
2161
  );
1871
- }), Ge = (t, e, i, u, o) => {
1872
- const a = new Map(o.map((m, n) => [m.name, n])), s = (m) => {
1873
- let n = 0;
1874
- for (const E of ta) {
1875
- if (m === E || m.endsWith(`_${E}`)) return n;
1876
- n++;
2162
+ }), st = (t, e, n, i, o) => {
2163
+ const s = new Map(o.map((d, r) => [d.name, r])), a = (d) => {
2164
+ let r = 0;
2165
+ for (const k of Bs) {
2166
+ if (d === k || d.endsWith(`_${k}`)) return r;
2167
+ r++;
1877
2168
  }
1878
2169
  return Number.MAX_SAFE_INTEGER;
1879
- }, h = e ? [1, a.get(e) ?? Number.MAX_SAFE_INTEGER] : [0, s(t)], l = u ? [1, a.get(u) ?? Number.MAX_SAFE_INTEGER] : [0, s(i)];
1880
- return h[0] - l[0] || h[1] - l[1];
1881
- }, ns = (t, e, i, u) => {
2170
+ }, g = e ? [1, s.get(e) ?? Number.MAX_SAFE_INTEGER] : [0, a(t)], l = i ? [1, s.get(i) ?? Number.MAX_SAFE_INTEGER] : [0, a(n)];
2171
+ return g[0] - l[0] || g[1] - l[1];
2172
+ }, no = (t, e, n, i) => {
1882
2173
  const o = {
1883
2174
  folder: { conditions: [], operator: t?.operator || "and" },
1884
2175
  product: { conditions: [], operator: t?.operator || "and" },
@@ -1890,16 +2181,16 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1890
2181
  };
1891
2182
  if (!t?.conditions || t?.conditions.length === 0)
1892
2183
  return o;
1893
- const a = (l) => {
1894
- const m = e.find((n) => l.startsWith(`${n}_`));
1895
- if (m) {
1896
- const n = l.substring(`${m}_`.length);
1897
- return { scope: m, cleanId: n };
1898
- } else if (i?.fallbackScope)
1899
- return { scope: i.fallbackScope, cleanId: l };
2184
+ const s = (l) => {
2185
+ const d = e.find((r) => l.startsWith(`${r}_`));
2186
+ if (d) {
2187
+ const r = l.substring(`${d}_`.length);
2188
+ return { scope: d, cleanId: r };
2189
+ } else if (n?.fallbackScope)
2190
+ return { scope: n.fallbackScope, cleanId: l };
1900
2191
  return { scope: null, cleanId: l };
1901
- }, s = (l) => {
1902
- const m = {
2192
+ }, a = (l) => {
2193
+ const d = {
1903
2194
  folder: [],
1904
2195
  product: [],
1905
2196
  task: [],
@@ -1909,33 +2200,33 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1909
2200
  unscoped: []
1910
2201
  };
1911
2202
  if ("conditions" in l && !("key" in l)) {
1912
- const n = (l.conditions || []).map((E) => s(E));
1913
- Object.keys(m).forEach((E) => {
1914
- const v = E, T = n.flatMap((f) => f[v]);
1915
- T.length > 0 && (T.length === 1 && !l.operator ? m[v].push(T[0]) : m[v].push({
1916
- conditions: T,
2203
+ const r = (l.conditions || []).map((k) => a(k));
2204
+ Object.keys(d).forEach((k) => {
2205
+ const v = k, O = r.flatMap((m) => m[v]);
2206
+ O.length > 0 && (O.length === 1 && !l.operator ? d[v].push(O[0]) : d[v].push({
2207
+ conditions: O,
1917
2208
  operator: l.operator
1918
2209
  }));
1919
2210
  });
1920
2211
  } else if ("key" in l) {
1921
- const { scope: n, cleanId: E } = a(l.key);
1922
- if (n)
1923
- m[n].push({ ...l, key: E });
2212
+ const { scope: r, cleanId: k } = s(l.key);
2213
+ if (r)
2214
+ d[r].push({ ...l, key: k });
1924
2215
  else {
1925
- const v = u?.[l.key];
1926
- v ? m[v].push(l) : l.key === ct || l.key === "name" || l.key?.endsWith("_name") ? e.forEach((T) => {
1927
- m[T].push(l);
1928
- }) : m.unscoped.push(l);
2216
+ const v = i?.[l.key];
2217
+ v ? d[v].push(l) : l.key === Ft || l.key === "name" || l.key?.endsWith("_name") ? e.forEach((O) => {
2218
+ d[O].push(l);
2219
+ }) : d.unscoped.push(l);
1929
2220
  }
1930
2221
  }
1931
- return m;
1932
- }, h = (t.conditions || []).map((l) => s(l));
2222
+ return d;
2223
+ }, g = (t.conditions || []).map((l) => a(l));
1933
2224
  return Object.keys(o).forEach((l) => {
1934
- const m = l;
1935
- o[m].conditions = h.flatMap((n) => n[m]);
2225
+ const d = l;
2226
+ o[d].conditions = g.flatMap((r) => r[d]);
1936
2227
  }), o;
1937
- }, rs = (t, e, i) => {
1938
- const u = {
2228
+ }, ro = (t, e, n) => {
2229
+ const i = {
1939
2230
  folder: [],
1940
2231
  product: [],
1941
2232
  task: [],
@@ -1945,30 +2236,30 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1945
2236
  unscoped: []
1946
2237
  };
1947
2238
  if (!t || t.length === 0)
1948
- return u;
1949
- const o = (s) => e.find((l) => s.startsWith(`${l}_`)) || null, a = (s, h) => {
1950
- const l = `${h}_`;
1951
- return s.startsWith(l) ? s.substring(l.length) : s;
2239
+ return i;
2240
+ const o = (a) => e.find((l) => a.startsWith(`${l}_`)) || null, s = (a, g) => {
2241
+ const l = `${g}_`;
2242
+ return a.startsWith(l) ? a.substring(l.length) : a;
1952
2243
  };
1953
- return t.forEach((s) => {
1954
- if (!s.id) return;
1955
- const h = o(s.id);
1956
- if (h) {
2244
+ return t.forEach((a) => {
2245
+ if (!a.id) return;
2246
+ const g = o(a.id);
2247
+ if (g) {
1957
2248
  const l = {
1958
- ...s,
1959
- id: a(s.id, h)
2249
+ ...a,
2250
+ id: s(a.id, g)
1960
2251
  };
1961
- u[h].push(l);
2252
+ i[g].push(l);
1962
2253
  } else {
1963
- const l = i?.[s.id];
1964
- l ? u[l].push(s) : u.unscoped.push(s);
2254
+ const l = n?.[a.id];
2255
+ l ? i[l].push(a) : i.unscoped.push(a);
1965
2256
  }
1966
- }), u;
1967
- }, re = ["status", "tags", "attributes", "createdAt", "updatedAt"], na = {
1968
- folder: [...re, "name", "folderType"],
1969
- task: [...re, "name", "taskType", "folderType", "assignees"],
2257
+ }), i;
2258
+ }, ie = ["status", "tags", "attributes", "createdAt", "updatedAt"], zs = {
2259
+ folder: [...ie, "name", "folderType"],
2260
+ task: [...ie, "name", "taskType", "folderType", "assignees"],
1970
2261
  version: [
1971
- ...re,
2262
+ ...ie,
1972
2263
  "version",
1973
2264
  "productName",
1974
2265
  "productType",
@@ -1978,186 +2269,197 @@ const Ae = 500, Zt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xa = ({
1978
2269
  "taskType",
1979
2270
  "folderType"
1980
2271
  ],
1981
- product: [...re, "productName", "productBaseType"],
1982
- representation: [...re, "name", "extension"],
1983
- user: [...re]
1984
- }, ls = (t, e) => t.map((i) => ({
1985
- scope: i,
1986
- filterTypes: na[i].filter((u) => !e?.[i]?.includes(u))
2272
+ product: [...ie, "productName", "productBaseType"],
2273
+ representation: [...ie, "name", "extension"],
2274
+ user: [...ie]
2275
+ }, lo = (t, e) => t.map((n) => ({
2276
+ scope: n,
2277
+ filterTypes: zs[n].filter((i) => !e?.[n]?.includes(i))
1987
2278
  }));
1988
2279
  export {
1989
- no as $createMediaNode,
1990
- ro as $createMentionNode,
1991
- lo as $createYouTubeNode,
1992
- io as $getMarkdown,
1993
- uo as $isMediaNode,
1994
- co as $isMentionNode,
1995
- po as $isYouTubeNode,
1996
- fo as $setMarkdown,
1997
- Ja as ACCESS_LEVEL_LABELS,
1998
- mo as ACTIVITY_LINK_LABEL,
1999
- Xa as AccessSearchInput,
2000
- ke as AccessUser,
2001
- cs as AddColumnButton,
2002
- js as AddNewLinks,
2003
- ds as AddonLoadingScreen,
2004
- ps as AttributeEditor,
2005
- De as BLOCK_DIALOG_CLOSE_CLASS,
2006
- Ys as Badge,
2007
- $s as BadgeWrapper,
2008
- ho as CUSTOM_RANGE_ICON,
2009
- go as CUSTOM_RANGE_ID,
2010
- bo as CellEditingDialog,
2011
- Xs as Chips,
2012
- Cr as ColumnHeaderMenuUI,
2013
- Hn as ColumnMenuButton,
2014
- fs as ColumnsSettings,
2015
- ms as ColumnsSettingsWithContext,
2016
- rr as CustomDateRangeDialog,
2017
- hs as CustomizeButton,
2018
- gs as DEFAULT_FEATURED_ORDER,
2019
- wo as DEFAULT_TOOLBAR,
2020
- Zo as DELETE_CONFIRM_THRESHOLD,
2021
- sn as DELETE_TYPE_ORDER,
2022
- yo as DESCRIPTION_TOOLBAR,
2023
- Qa as DateRangePicker,
2024
- en as DeleteConfirmContent,
2025
- on as DeleteEntitiesConfirmDialog,
2026
- Js as DescriptionSection,
2027
- dn as DetailsDialog,
2028
- wt as DetailsPanelAttributesEditor,
2029
- fn as DetailsPanelDetails,
2030
- yt as DetailsSection,
2031
- vo as DoneCheckbox,
2032
- Bn as ENTITY_TOOLTIP_TYPES,
2033
- bs as EVERYONE_GROUP_KEY,
2034
- ws as EVERY_GUESTS_KEY,
2035
- ys as EarlyPreview,
2036
- On as EmptyPlaceholder,
2037
- Dn as EmptyPlaceholderFlex,
2038
- Vn as EmptyPlaceholderFlexWrapper,
2039
- Qs as EntityIcon,
2040
- Fn as EntityPanelUploader,
2041
- Pn as EntityPath,
2042
- Un as EntityTooltip,
2043
- vs as EnumEditor,
2044
- Es as EnumEditorItem,
2045
- qs as EnumItemDialog,
2046
- rt as FEATURED_VERSION_TYPES,
2047
- na as FILTER_TYPES_BY_SCOPE,
2048
- Eo as FLOATING_TOOLBAR,
2049
- Cs as FeaturedVersionOrder,
2050
- Bt as FeedbackContext,
2051
- Za as FeedbackProvider,
2052
- mn as FieldLabel,
2053
- hn as FileThumbnail,
2054
- jn as FilterErrorActions,
2055
- ot as FreeTrialLink,
2056
- ks as GROUP_KEY_PREFIX,
2057
- Os as GUEST_KEY_PREFIX,
2058
- Co as INSERT_MENTION_TRIGGER_COMMAND,
2059
- In as InfoMessage,
2060
- xn as JsonViewer,
2061
- Ss as LegacyBadge,
2062
- Zs as LinkManagerItem,
2063
- eo as LinksManager,
2064
- es as ListAttributeForm,
2065
- ts as ListMetaData,
2066
- ko as MARKDOWN_TRANSFORMERS,
2067
- Oo as MENTION,
2068
- So as MENTION_REF_TYPES,
2069
- To as MENTION_TRIGGER_BY_TYPE,
2070
- gr as MENU_PORTAL_CONTENT_ID,
2071
- br as MENU_PORTAL_DIALOG_ID,
2072
- Do as MarkdownEditor,
2073
- Vo as MediaBlock,
2074
- Ro as MediaNode,
2075
- Io as MentionNode,
2076
- wr as Menu,
2077
- yr as MenuContainer,
2078
- vr as MenuList,
2079
- Ao as NO_DATE,
2080
- Sn as Placeholder,
2081
- Ts as PowerpackButton,
2082
- as as PowerpackDialog,
2083
- ss as ProjectPageRemote,
2084
- Ds as ProjectTableSettings,
2085
- tn as RefreshToast,
2086
- Fe as RemotePageWrapper,
2087
- Vs as RequiredAddonVersion,
2088
- gn as ReviewableCard,
2089
- bn as ReviewableProgressCard,
2090
- wn as ReviewableUpload,
2091
- Nn as ReviewablesList,
2092
- Rs as ReviewablesSelector,
2093
- Is as SettingOption,
2094
- As as SettingSwitch,
2095
- xs as SettingsPanel,
2096
- _s as SettingsPanelItemTemplate,
2097
- Fs as ShareOptionIcon,
2098
- zs as SimpleForm,
2099
- ur as SimpleFormDialog,
2100
- Ps as SizeSlider,
2101
- Ns as SplitterStyles,
2102
- yn as StackedThumbnails,
2103
- Ms as StyledLink,
2104
- to as SubtasksManagerWrapper,
2105
- Yn as SupportBubble,
2106
- sr as SyncButton,
2107
- Ls as TEAM_KEY_PREFIX,
2108
- Bs as TableGridSwitch,
2109
- dr as TableSearch,
2110
- tr as TableSettingsFallback,
2111
- vn as Thumbnail,
2112
- lr as ThumbnailSimple,
2113
- Us as USER_KEY_PREFIX,
2114
- Gs as UploadVersionDialog,
2115
- xo as UserImage,
2116
- qt as VersionUploadContext,
2117
- qa as VersionUploadProvider,
2118
- En as Watchers,
2119
- _o as YouTubeEmbed,
2120
- Fo as YouTubeNode,
2121
- nn as buildChildrenDetails,
2122
- rn as buildEntityLabel,
2123
- ln as buildExpectedCounts,
2124
- ls as buildScopes,
2125
- or as buildSortMenuItem,
2126
- Po as createFeedMentionSource,
2127
- we as customRangeOption,
2128
- No as dateOptions,
2129
- Mo as datePresetOptions,
2130
- Lo as detectRelativeDatePattern,
2131
- Bo as filterDateFunctions,
2132
- Uo as generateDateOptions,
2133
- ye as generateDatePresetOptions,
2134
- Mn as getGroupedReviewables,
2135
- Go as getInlineMediaFileIds,
2136
- Wo as getLinkLabel,
2137
- Ho as getMediaKind,
2138
- Yo as getMentionTrigger,
2139
- $o as getProjectFileId,
2140
- zo as getSourceLink,
2141
- Ws as getUiTypeLabel,
2142
- ao as groupLinksByEntity,
2143
- Ko as isMediaFile,
2144
- Jn as markdownToPlainText,
2145
- jo as normalizeLegacyMarkdown,
2146
- Xo as parseActivityLink,
2147
- Qt as parseFilename,
2148
- Jo as parseYouTubeUrl,
2149
- Qn as renderMediaParagraph,
2150
- qn as renderYouTubeParagraph,
2151
- rs as splitClientFiltersByScope,
2152
- ns as splitFiltersByScope,
2153
- un as sumExpectedCounts,
2154
- Qo as toggleBlockFormat,
2155
- os as useBuildFilterOptions,
2156
- Zn as useDateRangeFilter,
2157
- $n as useFeedback,
2158
- zn as useFeedbackSafe,
2159
- fr as useOptionalVersionUploadContext,
2160
- Cn as useReviewablesUpload,
2161
- so as useUpdateLinks,
2162
- mr as useVersionUploadContext
2280
+ rn as $createMediaNode,
2281
+ ln as $createMentionNode,
2282
+ cn as $createYouTubeNode,
2283
+ un as $getMarkdown,
2284
+ dn as $isMediaNode,
2285
+ pn as $isMentionNode,
2286
+ fn as $isYouTubeNode,
2287
+ mn as $setMarkdown,
2288
+ za as ACCESS_LEVEL_LABELS,
2289
+ hn as ACTIVITY_LINK_LABEL,
2290
+ Ga as AccessSearchInput,
2291
+ Ce as AccessUser,
2292
+ uo as AddColumnButton,
2293
+ qo as AddNewLinks,
2294
+ ao as AddonButton,
2295
+ Is as AddonDialog,
2296
+ po as AddonLoadingScreen,
2297
+ fo as AttributeEditor,
2298
+ Ve as BLOCK_DIALOG_CLOSE_CLASS,
2299
+ Wo as Badge,
2300
+ Yo as BadgeWrapper,
2301
+ gn as CUSTOM_RANGE_ICON,
2302
+ bn as CUSTOM_RANGE_ID,
2303
+ wn as CellEditingDialog,
2304
+ Qo as Chips,
2305
+ Sl as ColumnHeaderMenuUI,
2306
+ zr as ColumnMenuButton,
2307
+ mo as ColumnsSettings,
2308
+ ho as ColumnsSettingsWithContext,
2309
+ hl as CustomDateRangeDialog,
2310
+ go as CustomizeButton,
2311
+ bo as DEFAULT_FEATURED_ORDER,
2312
+ yn as DEFAULT_TOOLBAR,
2313
+ er as DELETE_CONFIRM_THRESHOLD,
2314
+ or as DELETE_TYPE_ORDER,
2315
+ vn as DESCRIPTION_TOOLBAR,
2316
+ Ha as DateRangePicker,
2317
+ tr as DeleteConfirmContent,
2318
+ nr as DeleteEntitiesConfirmDialog,
2319
+ Xo as DescriptionSection,
2320
+ dr as DetailsDialog,
2321
+ $t as DetailsPanelAttributesEditor,
2322
+ fr as DetailsPanelDetails,
2323
+ Gt as DetailsSection,
2324
+ En as DoneCheckbox,
2325
+ Br as ENTITY_TOOLTIP_TYPES,
2326
+ wo as EVERYONE_GROUP_KEY,
2327
+ yo as EVERY_GUESTS_KEY,
2328
+ vo as EarlyPreview,
2329
+ Cr as EmptyPlaceholder,
2330
+ Ir as EmptyPlaceholderFlex,
2331
+ Dr as EmptyPlaceholderFlexWrapper,
2332
+ Jo as EntityIcon,
2333
+ Fr as EntityPanelUploader,
2334
+ _r as EntityPath,
2335
+ Ur as EntityTooltip,
2336
+ Eo as EnumEditor,
2337
+ So as EnumEditorItem,
2338
+ Zo as EnumItemDialog,
2339
+ Pt as FEATURED_VERSION_TYPES,
2340
+ zs as FILTER_TYPES_BY_SCOPE,
2341
+ Sn as FLOATING_TOOLBAR,
2342
+ ko as FeaturedVersionOrder,
2343
+ ds as FeedbackContext,
2344
+ Ya as FeedbackProvider,
2345
+ mr as FieldLabel,
2346
+ hr as FileThumbnail,
2347
+ Kr as FilterErrorActions,
2348
+ yt as FreeTrialLink,
2349
+ Co as GROUP_KEY_PREFIX,
2350
+ Oo as GUEST_KEY_PREFIX,
2351
+ kn as INSERT_MENTION_TRIGGER_COMMAND,
2352
+ Vr as InfoMessage,
2353
+ Rr as JsonViewer,
2354
+ To as LegacyBadge,
2355
+ en as LinkManagerItem,
2356
+ tn as LinksManager,
2357
+ ja as ListAttributeForm,
2358
+ Ka as ListMetaData,
2359
+ Ja as LoginPage,
2360
+ Cn as MARKDOWN_TRANSFORMERS,
2361
+ On as MENTION,
2362
+ Tn as MENTION_REF_TYPES,
2363
+ In as MENTION_TRIGGER_BY_TYPE,
2364
+ cl as MENU_PORTAL_CONTENT_ID,
2365
+ ul as MENU_PORTAL_DIALOG_ID,
2366
+ Dn as MarkdownEditor,
2367
+ Pn as MediaBlock,
2368
+ Vn as MediaNode,
2369
+ An as MentionNode,
2370
+ Ts as Menu,
2371
+ Os as MenuContainer,
2372
+ dl as MenuList,
2373
+ Rn as NO_DATE,
2374
+ Or as Placeholder,
2375
+ Io as PowerpackButton,
2376
+ qa as PowerpackDialog,
2377
+ Za as ProjectPageLayoutHost,
2378
+ Xa as ProjectPageRemote,
2379
+ Do as ProjectTableSettings,
2380
+ sr as RefreshToast,
2381
+ Be as RemotePageWrapper,
2382
+ Po as RequiredAddonVersion,
2383
+ gr as ReviewableCard,
2384
+ br as ReviewableProgressCard,
2385
+ wr as ReviewableUpload,
2386
+ Lr as ReviewablesList,
2387
+ Vo as ReviewablesSelector,
2388
+ Ao as SettingOption,
2389
+ Ro as SettingSwitch,
2390
+ xo as SettingsPanel,
2391
+ Fo as SettingsPanelItemTemplate,
2392
+ _o as ShareOptionIcon,
2393
+ jo as SimpleForm,
2394
+ wl as SimpleFormDialog,
2395
+ Lo as SizeSlider,
2396
+ eo as SlicerHost,
2397
+ Mo as SplitterStyles,
2398
+ yr as StackedThumbnails,
2399
+ No as StyledLink,
2400
+ sn as SubtasksManagerWrapper,
2401
+ Hr as SupportBubble,
2402
+ al as SyncButton,
2403
+ Bo as TEAM_KEY_PREFIX,
2404
+ Uo as TableGridSwitch,
2405
+ vl as TableSearch,
2406
+ tl as TableSettingsFallback,
2407
+ vr as Thumbnail,
2408
+ gl as ThumbnailSimple,
2409
+ $o as USER_KEY_PREFIX,
2410
+ Go as UploadVersionDialog,
2411
+ xn as UserImage,
2412
+ Cs as VersionUploadContext,
2413
+ Wa as VersionUploadProvider,
2414
+ Er as Watchers,
2415
+ Fn as YouTubeEmbed,
2416
+ _n as YouTubeNode,
2417
+ rr as buildChildrenDetails,
2418
+ lr as buildEntityLabel,
2419
+ ir as buildExpectedCounts,
2420
+ lo as buildScopes,
2421
+ ol as buildSortMenuItem,
2422
+ Ln as createFeedMentionSource,
2423
+ ye as customRangeOption,
2424
+ Mn as dateOptions,
2425
+ Nn as datePresetOptions,
2426
+ Bn as detectRelativeDatePattern,
2427
+ Un as filterDateFunctions,
2428
+ $n as generateDateOptions,
2429
+ ve as generateDatePresetOptions,
2430
+ Ns as getButtonAction,
2431
+ Mr as getGroupedReviewables,
2432
+ Gn as getInlineMediaFileIds,
2433
+ zn as getLinkLabel,
2434
+ Hn as getMediaKind,
2435
+ Wn as getMentionTrigger,
2436
+ Yn as getProjectFileId,
2437
+ jn as getSourceLink,
2438
+ zo as getUiTypeLabel,
2439
+ an as groupLinksByEntity,
2440
+ Kn as isMediaFile,
2441
+ Qr as markdownToPlainText,
2442
+ qn as normalizeLegacyMarkdown,
2443
+ Qn as parseActivityLink,
2444
+ Rs as parseFilename,
2445
+ Xn as parseYouTubeUrl,
2446
+ Xr as renderMediaParagraph,
2447
+ Jr as renderYouTubeParagraph,
2448
+ ro as splitClientFiltersByScope,
2449
+ no as splitFiltersByScope,
2450
+ cr as sumExpectedCounts,
2451
+ et as toMenuItems,
2452
+ Jn as toggleBlockFormat,
2453
+ Qa as useAddonCustomizeSections,
2454
+ fl as useAddonTableShortcuts,
2455
+ oo as useBuildFilterOptions,
2456
+ Zr as useDateRangeFilter,
2457
+ Wr as useFeedback,
2458
+ Yr as useFeedbackSafe,
2459
+ rl as useOptionalVersionUploadContext,
2460
+ to as useProjectPageSlotContext,
2461
+ Sr as useReviewablesUpload,
2462
+ so as useStudioPageSlotContext,
2463
+ on as useUpdateLinks,
2464
+ ll as useVersionUploadContext
2163
2465
  };