@ynput/ayon-frontend-shared 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,381 +1,390 @@
1
- import { C as Pe, S as Ne, A as ue, a as Ie, T as Le, D as Me, b as Fe, c as Be, d as ce, e as de, f as Ue, g as We, h as Ge, M as He, F as Ye, i as $e, j as je, k as Ke, l as Xe } from "./chunks/ReviewablesSelector.es.js";
2
- import { m as ka, n as Pa, o as Na, p as Ia, q as La, r as Ma, s as Fa, t as Ba, E as Ua, u as Wa, v as Ga, w as Ha, x as Ya, y as $a, G as ja, z as Ka, L as Xa, P as za, B as Ja, R as qa, H as Qa, I as Za, J as es, K as ts, N as as, O as ss, Q as os, U as rs, V as ns, W as ls, X as is, Y as us, Z as cs } from "./chunks/ReviewablesSelector.es.js";
3
- import { jsxs as M, jsx as g } from "react/jsx-runtime";
4
- import { useState as H, useRef as ee, useCallback as Oe, useEffect as se, useMemo as pe, useContext as ze } from "react";
5
- import { matchSorter as fe } from "match-sorter";
6
- import { InputText as Je, Icon as z, Section as qe, SEARCH_FILTER_ID as Qe } from "@ynput/ayon-react-components";
7
- import te from "clsx";
8
- import { B as ps, a as fs, S as hs } from "./chunks/SimpleForm.es.js";
9
- import { P as Ze } from "./chunks/MetaWidget.es.js";
10
- import { C as gs, D as bs, E as Es, L as ys, c as ws, d as vs } from "./chunks/MetaWidget.es.js";
11
- import { createPortal as et } from "react-dom";
12
- import { format as X, parseISO as Se, isValid as De } from "date-fns";
13
- import { B as he, b as Re, c as ne, g as le } from "./chunks/PlayableIcon.es.js";
14
- import { C as Os, a as Ss, e as Ds, D as Rs, N as Ts, U as Vs, h as As, i as _s, d as xs, f as ks, j as Ps } from "./chunks/PlayableIcon.es.js";
15
- import { n as Is, o as Ls, p as Ms, q as Fs, R as Bs, r as Us, s as Ws, t as Gs, v as Hs } from "./chunks/DeleteEntitiesContext.es.js";
16
- import { D as $s } from "./chunks/DetailsDialog.es.js";
17
- import { q as tt, r as at, b as st } from "./chunks/Watchers.es.js";
18
- import { s as Ks, t as Xs, v as zs, R as Js, h as qs, g as Qs, w as Zs, x as eo, W as to, i as ao } from "./chunks/Watchers.es.js";
19
- import { E as oo, P as ro } from "./chunks/EmptyPlaceholder.es.js";
20
- import { E as lo, b as io, c as uo, d as co, a as po, M as fo, e as ho } from "./chunks/Menu.es.js";
21
- import { I as go } from "./chunks/InfoMessage.es.js";
22
- import { J as Eo } from "./chunks/JsonViewer.es.js";
23
- import { E as wo, a as vo, R as Co, g as Oo } from "./chunks/EntityPath.es.js";
24
- import { E as Do, a as Ro } from "./chunks/EntityTooltip.es.js";
25
- import { F as Vo, a as Ao, u as _o, b as xo } from "./chunks/FilterErrorActions.es.js";
26
- import { C as Po, a as No, S as Io } from "./chunks/ColumnDropIndicator.es.js";
27
- import { bg as me, bo as ot, bq as rt } from "./chunks/searchTerms.es.js";
28
- import { bm as nt, dj as lt, c6 as it, bN as ut } from "./chunks/getUris.es.js";
1
+ import { C as Ye, S as $e, A as Se, a as je, T as Ke, D as Xe, b as Je, c as Qe, d as ke, e as Oe, f as qe, g as Ze, h as et, M as tt, F as st, i as at, j as ot, k as nt, l as rt } from "./chunks/ReviewablesSelector.es.js";
2
+ import { m as ia, n as ca, o as ua, p as da, q as pa, r as fa, s as ma, E as ha, t as ga, u as ba, v as wa, w as ya, x as va, G as Ea, y as Ca, L as Sa, P as ka, z as Oa, R as Da, B as Va, H as Ta, I as Ra, J as Ia, K as Fa, N as Aa, O as Pa, Q as _a, U as xa, V as Na, W as La, X as Ma, Y as Ba } from "./chunks/ReviewablesSelector.es.js";
3
+ import { jsxs as z, jsx as C } from "react/jsx-runtime";
4
+ import { useState as _, useRef as oe, useCallback as ee, useEffect as Y, useMemo as me, useContext as lt } from "react";
5
+ import { matchSorter as De } from "match-sorter";
6
+ import { InputText as it, Icon as le, Section as ct, SEARCH_FILTER_ID as ut } from "@ynput/ayon-react-components";
7
+ import ue from "clsx";
8
+ import { B as Wa, a as Ha, S as za } from "./chunks/SimpleForm.es.js";
9
+ import { d as dt, P as pt } from "./chunks/MetaWidget.es.js";
10
+ import { i as Ya, D as $a, E as ja, L as Ka, j as Xa, k as Ja } from "./chunks/MetaWidget.es.js";
11
+ import { createPortal as ft } from "react-dom";
12
+ import { format as re, parseISO as Ne, isValid as Le } from "date-fns";
13
+ import { B as Ve, b as Me, c as we, g as ye } from "./chunks/PlayableIcon.es.js";
14
+ import { C as qa, a as Za, e as eo, D as to, N as so, U as ao, h as oo, i as no, d as ro, f as lo, j as io } from "./chunks/PlayableIcon.es.js";
15
+ import { d as Be, x as mt, a as ht, e as gt } from "./chunks/DeleteEntitiesContextInstance.es.js";
16
+ import { f as uo, D as po, R as fo } from "./chunks/DeleteEntitiesContextInstance.es.js";
17
+ import { p as bt, a as Te } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
18
+ import { D as ho, b as go, c as bo, d as wo, e as yo, s as vo } from "./chunks/DeleteEntitiesConfirmDialog.es.js";
19
+ import { D as Co } from "./chunks/DetailsDialog.es.js";
20
+ import { q as wt, r as yt, b as vt } from "./chunks/Watchers.es.js";
21
+ import { s as ko, t as Oo, v as Do, R as Vo, h as To, g as Ro, w as Io, x as Fo, W as Ao, i as Po } from "./chunks/Watchers.es.js";
22
+ import { E as xo, P as No } from "./chunks/EmptyPlaceholder.es.js";
23
+ import { E as Mo, b as Bo, c as Uo, d as Wo, a as Ho, M as zo, e as Go } from "./chunks/Menu.es.js";
24
+ import { I as $o } from "./chunks/InfoMessage.es.js";
25
+ import { J as Ko } from "./chunks/JsonViewer.es.js";
26
+ import { E as Jo, a as Qo, R as qo, g as Zo } from "./chunks/EntityPath.es.js";
27
+ import { E as tn, a as sn } from "./chunks/EntityTooltip.es.js";
28
+ import { bj as Re, bp as Et, br as Ct } from "./chunks/searchTerms.es.js";
29
+ import { bK as St, bP as kt, ct as Ot, aJ as Dt, aO as Vt, bF as Tt, bm as Rt, dj as It, c6 as Ft, bN as At } from "./chunks/getUris.es.js";
29
30
  export * from "primereact/confirmdialog";
30
- import { toast as Te } from "react-toastify";
31
- import { a as ct } from "./chunks/ProjectContext.es.js";
31
+ import "@module-federation/enhanced/runtime";
32
+ import { isEmpty as Pt, upperFirst as de } from "lodash";
33
+ import { toast as he } from "react-toastify";
34
+ import "uuid";
35
+ import "semver";
36
+ import "./chunks/ContextMenuContextInstance.es.js";
37
+ import "react-redux";
38
+ import { F as _t } from "./chunks/ColumnDropIndicator.styled.es.js";
39
+ import { C as nn, S as rn, b as ln, u as cn } from "./chunks/ColumnDropIndicator.styled.es.js";
40
+ import { F as dn } from "./chunks/FilterErrorActions.es.js";
32
41
  import "lexical";
33
42
  import "@lexical/markdown";
34
43
  import "@lexical/react/LexicalBlockWithAlignableContents";
35
44
  import "@lexical/react/LexicalDecoratorBlockNode";
36
- import { isEmpty as dt, upperFirst as ae } from "lodash";
37
- import "uuid";
38
45
  import "@lexical/code";
39
46
  import "@lexical/list";
40
47
  import "@lexical/rich-text";
41
48
  import "@lexical/selection";
42
49
  import "@lexical/utils";
43
- import { a as pt, c as ft, p as ge } from "./chunks/useLocalStorage.es.js";
44
- import "@module-federation/enhanced/runtime";
45
- import "semver";
46
- import "./chunks/MenuContext.es.js";
47
- import { T as Fo } from "./chunks/TableSettingsFallback.es.js";
48
- import { u as ht } from "./chunks/ViewsContext.es.js";
49
- import { a as mt, b as gt } from "./chunks/viewUpdateHelper.es.js";
50
- import { useSearchParams as bt, useLocation as Et, useNavigate as yt, useParams as wt } from "react-router-dom";
51
- import { u as vt } from "./chunks/entityDefinitions.es.js";
52
- import { g as Ct, c as Ot, b as St, d as Dt } from "./chunks/Slicer.es.js";
53
- import { l as Uo } from "./chunks/Slicer.es.js";
54
- import { Splitter as Rt, SplitterPanel as be } from "primereact/splitter";
55
- import { g as Y } from "./chunks/getEntityTypeIcon.es.js";
56
- import { g as B } from "./chunks/parseHtmlToPlainTextWithLinks.es.js";
57
- import { u as Tt } from "./chunks/GlobalContext.es.js";
58
- import { u as Go } from "./chunks/useDateRangeFilter.es.js";
59
- import { C as Yo, T as $o } from "./chunks/ThumbnailSimple.es.js";
60
- import { S as Ko } from "./chunks/SimpleFormDialog.es.js";
61
- import { T as zo } from "./chunks/EntityPickerDialog.es.js";
62
- import { V as qo, u as Qo, a as Zo } from "./chunks/VersionUploadContext.es.js";
63
- import { p as tr } from "./chunks/parseFilename.es.js";
64
- const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
65
- shareOptions: e,
66
- existingAccess: t,
67
- owner: l,
68
- placeholder: u = "Add people or access groups",
69
- disabled: r = !1,
70
- mode: a = "internal",
71
- onSelectOption: o,
72
- pt: f,
73
- ...i
50
+ import { T as fn } from "./chunks/TableSettingsFallback.es.js";
51
+ import { a as xt, b as Nt } from "./chunks/viewUpdateHelper.es.js";
52
+ import { useSearchParams as Lt, useLocation as Mt, useNavigate as Bt, useParams as Ut } from "react-router-dom";
53
+ import { g as Wt, c as Ht, b as zt, d as Gt } from "./chunks/Slicer.es.js";
54
+ import { l as hn } from "./chunks/Slicer.es.js";
55
+ import { Splitter as Yt, SplitterPanel as Ie } from "primereact/splitter";
56
+ import { g as ae } from "./chunks/getEntityTypeIcon.es.js";
57
+ import { g as j } from "./chunks/parseHtmlToPlainTextWithLinks.es.js";
58
+ import { u as bn } from "./chunks/useDateRangeFilter.es.js";
59
+ import { C as yn, T as vn } from "./chunks/ThumbnailSimple.es.js";
60
+ import { S as Cn } from "./chunks/SimpleFormDialog.es.js";
61
+ import { T as kn } from "./chunks/EntityPickerDialog.es.js";
62
+ import { e as $t } from "./chunks/extractVersionFromFilename.es.js";
63
+ import { b as jt, c as Kt, v as Xt } from "./chunks/versionUploadHelpers.es.js";
64
+ import { p as Jt } from "./chunks/parseFilename.es.js";
65
+ import { V as Qt } from "./chunks/VersionUploadContextInstance.es.js";
66
+ import { u as Dn, a as Vn } from "./chunks/VersionUploadContextInstance.es.js";
67
+ import { C as Rn } from "./chunks/ColumnHeaderMenuUI.es.js";
68
+ const Fe = 500, qt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, js = ({
69
+ shareOptions: t,
70
+ existingAccess: e,
71
+ owner: i,
72
+ placeholder: c = "Add people or access groups",
73
+ disabled: o = !1,
74
+ mode: s = "internal",
75
+ onSelectOption: a,
76
+ pt: h,
77
+ ...l
74
78
  }) => {
75
- const [c, s] = H(""), [w, v] = H(!1), [D, d] = H(-1), T = ee(null), _ = e.filter((S) => !t.includes(S.value)).toSorted((S, h) => {
76
- const b = (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, O = b(S), n = b(h);
77
- return O !== n ? O - n : S.label.localeCompare(h.label);
78
- }), m = (c ? fe(_, c, {
79
+ const [f, n] = _(""), [E, y] = _(!1), [D, m] = _(-1), F = oe(null), R = t.filter((V) => !e.includes(V.value)).toSorted((V, b) => {
80
+ const v = (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, O = v(V), r = v(b);
81
+ return O !== r ? O - r : V.label.localeCompare(b.label);
82
+ }), g = (f ? De(R, f, {
79
83
  keys: ["name", "label", "value"],
80
- threshold: fe.rankings.CONTAINS
81
- }) : _).slice(0, Ee), R = Vt.test(c) && !e.some((S) => S.name === c) && a === "external", V = () => {
82
- v(!0), d(-1);
83
- }, P = () => {
84
+ threshold: De.rankings.CONTAINS
85
+ }) : R).slice(0, Fe), T = qt.test(f) && !t.some((V) => V.name === f) && s === "external", I = () => {
86
+ y(!0), m(-1);
87
+ }, L = () => {
84
88
  setTimeout(() => {
85
- v(!1), d(-1);
89
+ y(!1), m(-1);
86
90
  }, 200);
87
- }, N = (S) => {
88
- s(S.target.value), d(-1), v(!0);
89
- }, F = (S) => {
90
- if (!w || m.length === 0) {
91
- S.key === "Enter" && m.length > 0 && (S.preventDefault(), U(m[0]));
91
+ }, N = (V) => {
92
+ n(V.target.value), m(-1), y(!0);
93
+ }, M = (V) => {
94
+ if (!E || g.length === 0) {
95
+ V.key === "Enter" && g.length > 0 && (V.preventDefault(), G(g[0]));
92
96
  return;
93
97
  }
94
- switch (S.key) {
98
+ switch (V.key) {
95
99
  case "ArrowDown":
96
- S.preventDefault(), d((h) => h < m.length - 1 ? h + 1 : h);
100
+ V.preventDefault(), m((b) => b < g.length - 1 ? b + 1 : b);
97
101
  break;
98
102
  case "ArrowUp":
99
- S.preventDefault(), d((h) => h > 0 ? h - 1 : -1);
103
+ V.preventDefault(), m((b) => b > 0 ? b - 1 : -1);
100
104
  break;
101
105
  case "Enter":
102
- S.preventDefault(), D >= 0 && D < m.length ? U(m[D]) : m.length > 0 && U(m[0]);
106
+ V.preventDefault(), D >= 0 && D < g.length ? G(g[D]) : g.length > 0 && G(g[0]);
103
107
  break;
104
108
  case "Escape":
105
- v(!1), d(-1), T.current?.blur(), S.stopPropagation();
109
+ y(!1), m(-1), F.current?.blur(), V.stopPropagation();
106
110
  break;
107
111
  }
108
- }, U = (S) => {
109
- o(S, 10), s(""), v(!1), d(-1), T.current?.focus();
110
- }, K = () => {
111
- o(
112
+ }, G = (V) => {
113
+ a(V, 10), n(""), y(!1), m(-1), F.current?.focus();
114
+ }, $ = () => {
115
+ a(
112
116
  {
113
- name: c,
114
- label: c,
115
- value: c,
117
+ name: f,
118
+ label: f,
119
+ value: f,
116
120
  shareType: "guest"
117
121
  },
118
122
  10
119
- ), s(""), v(!1), d(-1), T.current?.focus();
123
+ ), n(""), y(!1), m(-1), F.current?.focus();
120
124
  };
121
- return /* @__PURE__ */ M(Pe, { ...i, children: [
122
- /* @__PURE__ */ g(
123
- Je,
125
+ return /* @__PURE__ */ z(Ye, { ...l, children: [
126
+ /* @__PURE__ */ C(
127
+ it,
124
128
  {
125
- ref: T,
126
- value: c,
127
- placeholder: u,
128
- disabled: r,
129
- onFocus: V,
130
- onClick: V,
131
- onBlur: P,
129
+ ref: F,
130
+ value: f,
131
+ placeholder: c,
132
+ disabled: o,
133
+ onFocus: I,
134
+ onClick: I,
135
+ onBlur: L,
132
136
  onChange: N,
133
- onKeyDown: F,
137
+ onKeyDown: M,
134
138
  style: { width: "100%" }
135
139
  }
136
140
  ),
137
- w && (m.length > 0 || R) && /* @__PURE__ */ M(
138
- Ne,
141
+ E && (g.length > 0 || T) && /* @__PURE__ */ z(
142
+ $e,
139
143
  {
140
- ...f?.list,
141
- className: te(f?.list?.className, { "no-owner": !l }),
144
+ ...h?.list,
145
+ className: ue(h?.list?.className, { "no-owner": !i }),
142
146
  children: [
143
- m.map((S, h) => /* @__PURE__ */ g(
144
- ue,
147
+ g.map((V, b) => /* @__PURE__ */ C(
148
+ Se,
145
149
  {
146
- name: S.name,
147
- label: S.label,
148
- shareType: S.shareType,
150
+ name: V.name,
151
+ label: V.label,
152
+ shareType: V.shareType,
149
153
  isOwner: !1,
150
154
  isMe: !1,
151
- "data-index": h,
152
- className: h === D ? "highlighted" : "",
155
+ "data-index": b,
156
+ className: b === D ? "highlighted" : "",
153
157
  style: { cursor: "pointer" },
154
- onClick: () => U(S),
155
- onMouseEnter: () => d(h),
158
+ onClick: () => G(V),
159
+ onMouseEnter: () => m(b),
156
160
  isCompact: !0,
157
161
  isSearchResult: !0
158
162
  },
159
- S.value
163
+ V.value
160
164
  )),
161
- R && /* @__PURE__ */ g(
162
- ue,
165
+ T && /* @__PURE__ */ C(
166
+ Se,
163
167
  {
164
- name: c,
165
- label: c,
168
+ name: f,
169
+ label: f,
166
170
  shareType: "guest",
167
171
  isOwner: !1,
168
172
  isMe: !1,
169
- "data-index": m.length,
170
- className: m.length === D ? "highlighted" : "",
173
+ "data-index": g.length,
174
+ className: g.length === D ? "highlighted" : "",
171
175
  style: { cursor: "pointer" },
172
- onClick: K,
173
- onMouseEnter: () => d(m.length),
176
+ onClick: $,
177
+ onMouseEnter: () => m(g.length),
174
178
  isCompact: !0,
175
179
  isSearchResult: !0
176
180
  }
177
181
  ),
178
- m.length === Ee && /* @__PURE__ */ g("li", { className: "tip", children: "More than 500 results, please refine your search..." })
182
+ g.length === Fe && /* @__PURE__ */ C("li", { className: "tip", children: "More than 500 results, please refine your search..." })
179
183
  ]
180
184
  }
181
185
  )
182
186
  ] });
183
- }, ye = (e) => {
184
- if (!e) return "";
187
+ }, Ks = {
188
+ 0: "No access",
189
+ 10: "Viewer",
190
+ 20: "Editor",
191
+ 30: "Admin"
192
+ }, Ae = (t) => {
193
+ if (!t) return "";
185
194
  try {
186
- const t = Se(e);
187
- if (De(t))
188
- return Re(t, "yyyy-MM-dd");
195
+ const e = Ne(t);
196
+ if (Le(e))
197
+ return Me(e, "yyyy-MM-dd");
189
198
  } catch {
190
199
  return "";
191
200
  }
192
201
  return "";
193
- }, we = (e, t) => {
194
- if (!e) return null;
202
+ }, Pe = (t, e) => {
203
+ if (!t) return null;
195
204
  try {
196
- const l = Se(e);
197
- if (De(l))
198
- return Re(l, t);
205
+ const i = Ne(t);
206
+ if (Le(i))
207
+ return Me(i, e);
199
208
  } catch {
200
209
  return null;
201
210
  }
202
211
  return null;
203
- }, G = (e) => {
204
- if (!e) return null;
212
+ }, se = (t) => {
213
+ if (!t) return null;
205
214
  try {
206
- const [t, l, u] = e.split("-").map(Number);
207
- if (t && l && u)
208
- return new Date(Date.UTC(t, l - 1, u)).toISOString();
215
+ const [e, i, c] = t.split("-").map(Number);
216
+ if (e && i && c)
217
+ return new Date(Date.UTC(e, i - 1, c)).toISOString();
209
218
  } catch {
210
219
  return null;
211
220
  }
212
221
  return null;
213
- }, va = ({
214
- value: e,
215
- onChange: t,
216
- emptyTrigger: l,
217
- valueTrigger: u,
218
- align: r = "left",
219
- disabled: a = !1,
220
- className: o,
221
- displayFormat: f = "MMM d",
222
- minDate: i,
223
- maxDate: c,
224
- pt: s
222
+ }, Xs = ({
223
+ value: t,
224
+ onChange: e,
225
+ emptyTrigger: i,
226
+ valueTrigger: c,
227
+ align: o = "left",
228
+ disabled: s = !1,
229
+ className: a,
230
+ displayFormat: h = "MMM d",
231
+ minDate: l,
232
+ maxDate: f,
233
+ pt: n
225
234
  }) => {
226
- const [w, v] = H(!1), [D, d] = H(""), [T, _] = H(""), m = ee(null), R = ee(null), V = ee(null), P = ee(null), N = e.startDate || e.endDate, F = Oe(() => {
227
- const E = G(D), A = G(T);
228
- (E !== e.startDate || A !== e.endDate) && t({ startDate: E, endDate: A }), v(!1);
229
- }, [D, T, e.startDate, e.endDate, t]);
230
- se(() => {
231
- w && (d(ye(e.startDate)), _(ye(e.endDate)), !e.startDate && !e.endDate && setTimeout(() => {
235
+ const [E, y] = _(!1), [D, m] = _(""), [F, R] = _(""), g = oe(null), T = oe(null), I = oe(null), L = oe(null), N = t.startDate || t.endDate, M = ee(() => {
236
+ const w = se(D), x = se(F);
237
+ (w !== t.startDate || x !== t.endDate) && e({ startDate: w, endDate: x }), y(!1);
238
+ }, [D, F, t.startDate, t.endDate, e]);
239
+ Y(() => {
240
+ E && (m(Ae(t.startDate)), R(Ae(t.endDate)), !t.startDate && !t.endDate && setTimeout(() => {
232
241
  try {
233
- V.current?.showPicker();
242
+ I.current?.showPicker();
234
243
  } catch {
235
244
  }
236
245
  }, 100));
237
- }, [w, e.startDate, e.endDate]), se(() => {
238
- if (!w) return;
239
- const E = (A) => {
240
- const I = A.target;
241
- m.current && !m.current.contains(I) && R.current && !R.current.contains(I) && F();
246
+ }, [E, t.startDate, t.endDate]), Y(() => {
247
+ if (!E) return;
248
+ const w = (x) => {
249
+ const B = x.target;
250
+ g.current && !g.current.contains(B) && T.current && !T.current.contains(B) && M();
242
251
  };
243
- return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
244
- }, [w, F]), se(() => {
245
- if (!w) return;
246
- const E = (A) => {
247
- A.key === "Escape" && (A.stopPropagation(), F());
252
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
253
+ }, [E, M]), Y(() => {
254
+ if (!E) return;
255
+ const w = (x) => {
256
+ x.key === "Escape" && (x.stopPropagation(), M());
248
257
  };
249
- return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
250
- }, [w, F]);
251
- const U = (E) => {
252
- const A = E.target.value;
253
- d(A);
254
- const I = G(A), W = G(T);
255
- if (I && W) {
256
- const $ = new Date(I), J = new Date(W);
257
- $ > J && _(A);
258
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
259
+ }, [E, M]);
260
+ const G = (w) => {
261
+ const x = w.target.value;
262
+ m(x);
263
+ const B = se(x), W = se(F);
264
+ if (B && W) {
265
+ const K = new Date(B), te = new Date(W);
266
+ K > te && R(x);
258
267
  }
259
- I && setTimeout(() => {
268
+ B && setTimeout(() => {
260
269
  try {
261
- P.current?.showPicker();
270
+ L.current?.showPicker();
262
271
  } catch {
263
272
  }
264
273
  }, 100);
265
- }, K = (E) => {
266
- const A = E.target.value;
267
- _(A);
268
- const I = G(A), W = G(D);
269
- let $ = W, J = I;
270
- if (I && W) {
271
- const re = new Date(W);
272
- new Date(I) < re && (d(A), $ = I);
274
+ }, $ = (w) => {
275
+ const x = w.target.value;
276
+ R(x);
277
+ const B = se(x), W = se(D);
278
+ let K = W, te = B;
279
+ if (B && W) {
280
+ const q = new Date(W);
281
+ new Date(B) < q && (m(x), K = B);
273
282
  }
274
- t({ startDate: $, endDate: J });
275
- }, S = () => {
276
- d(""), _(""), t({ startDate: null, endDate: null }), v(!1);
277
- }, h = (E) => {
278
- E.stopPropagation(), a || (w ? F() : v(!0));
279
- }, b = w ? G(D) : e.startDate, O = w ? G(T) : e.endDate, n = we(b, f), p = we(O, f), C = n && p ? `${n} - ${p}` : n || p || "", y = () => {
280
- if (!m.current) return { top: 0, left: 0 };
281
- const E = m.current.getBoundingClientRect();
283
+ e({ startDate: K, endDate: te });
284
+ }, V = () => {
285
+ m(""), R(""), e({ startDate: null, endDate: null }), y(!1);
286
+ }, b = (w) => {
287
+ w.stopPropagation(), s || (E ? M() : y(!0));
288
+ }, v = E ? se(D) : t.startDate, O = E ? se(F) : t.endDate, r = Pe(v, h), p = Pe(O, h), u = r && p ? `${r} - ${p}` : r || p || "", d = () => {
289
+ if (!g.current) return { top: 0, left: 0 };
290
+ const w = g.current.getBoundingClientRect();
282
291
  return {
283
- top: E.bottom + 4,
284
- left: r === "left" ? E.left : E.right
292
+ top: w.bottom + 4,
293
+ left: o === "left" ? w.left : w.right
285
294
  };
286
- }, x = () => N ? u ? u(e, C) : /* @__PURE__ */ g("span", { className: te("date-value", s?.valueDisplay?.className), ...s?.valueDisplay, children: C }) : l || /* @__PURE__ */ g(We, { icon: "calendar_add_on" }), k = y();
287
- return /* @__PURE__ */ M(
288
- Ie,
295
+ }, S = () => N ? c ? c(t, u) : /* @__PURE__ */ C("span", { className: ue("date-value", n?.valueDisplay?.className), ...n?.valueDisplay, children: u }) : i || /* @__PURE__ */ C(Ze, { icon: "calendar_add_on" }), A = d();
296
+ return /* @__PURE__ */ z(
297
+ je,
289
298
  {
290
- ...s?.root,
291
- className: te(he, o, s?.root?.className),
299
+ ...n?.root,
300
+ className: ue(Ve, a, n?.root?.className),
292
301
  children: [
293
- /* @__PURE__ */ g(
294
- Le,
302
+ /* @__PURE__ */ C(
303
+ Ke,
295
304
  {
296
- ref: m,
297
- onClick: h,
298
- disabled: a,
305
+ ref: g,
306
+ onClick: b,
307
+ disabled: s,
299
308
  type: "button",
300
- ...s?.trigger,
301
- className: te(N ? "has-value" : "empty", s?.trigger?.className),
302
- children: x()
309
+ ...n?.trigger,
310
+ className: ue(N ? "has-value" : "empty", n?.trigger?.className),
311
+ children: S()
303
312
  }
304
313
  ),
305
- w && et(
306
- /* @__PURE__ */ g(
307
- Me,
314
+ E && ft(
315
+ /* @__PURE__ */ C(
316
+ Xe,
308
317
  {
309
- ref: R,
318
+ ref: T,
310
319
  style: {
311
- top: k.top,
312
- left: r === "left" ? k.left : "auto",
313
- right: r === "right" ? window.innerWidth - k.left : "auto",
314
- ...s?.dropdown?.style
320
+ top: A.top,
321
+ left: o === "left" ? A.left : "auto",
322
+ right: o === "right" ? window.innerWidth - A.left : "auto",
323
+ ...n?.dropdown?.style
315
324
  },
316
- onMouseDown: (E) => E.stopPropagation(),
317
- ...s?.dropdown,
318
- className: te(he, r, s?.dropdown?.className),
319
- children: /* @__PURE__ */ M(Fe, { className: s?.content?.className, ...s?.content, children: [
320
- /* @__PURE__ */ g(
321
- Be,
325
+ onMouseDown: (w) => w.stopPropagation(),
326
+ ...n?.dropdown,
327
+ className: ue(Ve, o, n?.dropdown?.className),
328
+ children: /* @__PURE__ */ z(Je, { className: n?.content?.className, ...n?.content, children: [
329
+ /* @__PURE__ */ C(
330
+ Qe,
322
331
  {
323
332
  icon: "close",
324
333
  variant: "text",
325
- onClick: F,
326
- ...s?.closeButton
334
+ onClick: M,
335
+ ...n?.closeButton
327
336
  }
328
337
  ),
329
- /* @__PURE__ */ M(
330
- ce,
338
+ /* @__PURE__ */ z(
339
+ ke,
331
340
  {
332
- className: s?.startDate?.field?.className,
333
- ...s?.startDate?.field,
341
+ className: n?.startDate?.field?.className,
342
+ ...n?.startDate?.field,
334
343
  children: [
335
- /* @__PURE__ */ g("label", { ...s?.startDate?.label, children: "Start date" }),
336
- /* @__PURE__ */ g(
337
- de,
344
+ /* @__PURE__ */ C("label", { ...n?.startDate?.label, children: "Start date" }),
345
+ /* @__PURE__ */ C(
346
+ Oe,
338
347
  {
339
- ref: V,
348
+ ref: I,
340
349
  type: "date",
341
350
  value: D,
342
- onChange: U,
343
- max: c ? X(c, "yyyy-MM-dd") : void 0,
344
- min: i ? X(i, "yyyy-MM-dd") : void 0,
345
- onClick: (E) => {
351
+ onChange: G,
352
+ max: f ? re(f, "yyyy-MM-dd") : void 0,
353
+ min: l ? re(l, "yyyy-MM-dd") : void 0,
354
+ onClick: (w) => {
346
355
  try {
347
- E.currentTarget.showPicker();
356
+ w.currentTarget.showPicker();
348
357
  } catch {
349
358
  }
350
359
  },
351
- ...s?.startDate?.input
360
+ ...n?.startDate?.input
352
361
  }
353
362
  )
354
363
  ]
355
364
  }
356
365
  ),
357
- /* @__PURE__ */ M(ce, { className: s?.endDate?.field?.className, ...s?.endDate?.field, children: [
358
- /* @__PURE__ */ g("label", { ...s?.endDate?.label, children: "End date" }),
359
- /* @__PURE__ */ g(
360
- de,
366
+ /* @__PURE__ */ z(ke, { className: n?.endDate?.field?.className, ...n?.endDate?.field, children: [
367
+ /* @__PURE__ */ C("label", { ...n?.endDate?.label, children: "End date" }),
368
+ /* @__PURE__ */ C(
369
+ Oe,
361
370
  {
362
- ref: P,
371
+ ref: L,
363
372
  type: "date",
364
- value: T,
365
- onChange: K,
366
- max: c ? X(c, "yyyy-MM-dd") : void 0,
367
- min: D || (i ? X(i, "yyyy-MM-dd") : void 0),
368
- onClick: (E) => {
373
+ value: F,
374
+ onChange: $,
375
+ max: f ? re(f, "yyyy-MM-dd") : void 0,
376
+ min: D || (l ? re(l, "yyyy-MM-dd") : void 0),
377
+ onClick: (w) => {
369
378
  try {
370
- E.currentTarget.showPicker();
379
+ w.currentTarget.showPicker();
371
380
  } catch {
372
381
  }
373
382
  },
374
- ...s?.endDate?.input
383
+ ...n?.endDate?.input
375
384
  }
376
385
  )
377
386
  ] }),
378
- N && /* @__PURE__ */ g(Ue, { onClick: S, variant: "text", ...s?.clearButton, children: "Clear dates" })
387
+ N && /* @__PURE__ */ C(qe, { onClick: V, variant: "text", ...n?.clearButton, children: "Clear dates" })
379
388
  ] })
380
389
  }
381
390
  ),
@@ -384,23 +393,436 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
384
393
  ]
385
394
  }
386
395
  );
387
- }, Ca = ({
396
+ }, ne = {
397
+ version: 1,
398
+ name: "review",
399
+ productType: "review"
400
+ }, Js = ({
401
+ children: t,
388
402
  projectName: e,
389
- list: t,
390
- isLoading: l,
391
- attributes: u = []
403
+ onVersionCreated: i,
404
+ dispatch: c
405
+ }) => {
406
+ const [o, s] = _(""), [a, h] = _(""), [l, f] = _(null), [n, E] = _(null), [y, D] = _(!1), [m, F] = _([]), [R, g] = _(ne), [T, I] = _(!1), [L, N] = _(""), [M, G] = _(null), [$, V] = _(null), [b, v] = _(void 0), [O, r] = _(void 0), p = oe(!1), u = oe(null), { data: d = [], isLoading: S } = St(
407
+ { projectName: e, folderId: o },
408
+ { skip: !o || !y || !!a }
409
+ ), A = me(() => {
410
+ if (!(a || !R.name || d.length === 0))
411
+ return d.find((k) => k.name === R.name);
412
+ }, [a, R.name, d]), w = a || A?.id || "", { currentData: x } = kt(
413
+ {
414
+ projectName: e,
415
+ productId: a
416
+ },
417
+ { skip: !a || !y || b != null }
418
+ ), { data: B } = Ot(
419
+ { projectName: e, versionId: O },
420
+ { skip: !O || !y || l !== null }
421
+ ), W = l ?? B?.taskId ?? "", K = !!(O && l === null && !B), te = ee(
422
+ ({ productId: k, folderId: P, taskId: U, linkedTask: Z, latestVersionNumber: ie, latestVersionId: ze }) => {
423
+ h(k || ""), s(P || ""), f(U || null), E(Z || null), v(ie), r(ze), g((Ge) => ({
424
+ ...Ge,
425
+ ...ie != null ? { version: ie + 1 } : {}
426
+ })), D(!0);
427
+ },
428
+ []
429
+ ), q = ee(() => {
430
+ m.forEach((k) => {
431
+ k.preview && URL.revokeObjectURL(k.preview);
432
+ }), F([]), g(ne), G(null), V(null), N(""), I(!1), D(!1), h(""), s(""), f(null), E(null), p.current = !1, v(void 0), r(void 0);
433
+ }, [m]), [be] = Dt(), [pe] = Vt(), X = ee(
434
+ async (k) => {
435
+ try {
436
+ if (w) {
437
+ const P = await jt(pe, e, {
438
+ productId: w,
439
+ version: k.version,
440
+ taskId: W || void 0
441
+ });
442
+ return i(w, P.id), he.success("Created new version"), {
443
+ productId: w,
444
+ versionId: P.id
445
+ };
446
+ } else {
447
+ const { product: P, version: U } = await Kt(
448
+ be,
449
+ pe,
450
+ e,
451
+ {
452
+ folderId: o,
453
+ name: k.name,
454
+ productType: k.productType || "review",
455
+ productBaseType: k.productType || "review"
456
+ },
457
+ {
458
+ version: k.version,
459
+ taskId: W || void 0
460
+ }
461
+ );
462
+ return i(P.id, U.id), he.success("Created new version"), {
463
+ productId: P.id,
464
+ versionId: U.id
465
+ };
466
+ }
467
+ } catch (P) {
468
+ throw console.error("Error uploading version:", P), P.message || P;
469
+ }
470
+ },
471
+ [q, w, o, W, e]
472
+ ), fe = ee(
473
+ (k) => {
474
+ if (w) return;
475
+ const P = k[0];
476
+ if (P) {
477
+ const U = Jt(P.name), Z = $t(U);
478
+ Z && Z !== R.version && g((ie) => ({
479
+ ...ie,
480
+ version: Z
481
+ }));
482
+ }
483
+ },
484
+ [w, R.version]
485
+ ), J = x?.version ?? b ?? A?.latestVersion?.version, Q = ee((k, P) => {
486
+ g((U) => ({
487
+ ...U,
488
+ [k]: P
489
+ })), N("");
490
+ }, []), Ee = ee(
491
+ async (k) => {
492
+ try {
493
+ I(!0), N("");
494
+ const P = Xt(k, J, !w);
495
+ if (!P.isValid)
496
+ throw P.error;
497
+ const U = await X(k);
498
+ o && (u.current = { folderId: o, productName: k.name }), U?.productId && G(U.productId), U?.versionId && V(U.versionId), m.length < 1 && (I(!1), q());
499
+ } catch (P) {
500
+ N(P), I(!1);
501
+ }
502
+ },
503
+ [X, m.length, q, J, w]
504
+ );
505
+ Y(() => {
506
+ if (!(!y || b != null))
507
+ return g(x ? (k) => ({ ...k, version: x.version + 1 }) : ne), () => {
508
+ g(ne);
509
+ };
510
+ }, [y, x, b]), Y(() => {
511
+ if (!y || a || d.length === 0 || R.name !== ne.name) return;
512
+ const k = u.current;
513
+ if (k && k.folderId === o && d.some((Z) => Z.name === k.productName)) {
514
+ g((Z) => ({ ...Z, name: k.productName }));
515
+ return;
516
+ }
517
+ const P = d[d.length - 1];
518
+ P && g((U) => ({ ...U, name: P.name }));
519
+ }, [y, a, d]), Y(() => {
520
+ if (!(!y || a))
521
+ if (A) {
522
+ g((P) => ({
523
+ ...P,
524
+ productType: A.productType,
525
+ ...A.latestVersion && {
526
+ version: A.latestVersion.version + 1
527
+ }
528
+ }));
529
+ const k = A.latestVersion?.task;
530
+ k && (l === null || p.current) ? (f(k.id), E({
531
+ id: k.id,
532
+ name: k.name,
533
+ label: k.label,
534
+ taskType: k.taskType
535
+ }), p.current = !0) : !k && p.current && (f(null), E(null), p.current = !1);
536
+ } else
537
+ g((k) => ({ ...k, version: ne.version })), (l === null || p.current) && (f(null), E(null), p.current = !1);
538
+ }, [y, a, A]);
539
+ const Ce = ee((k) => {
540
+ f(k), p.current = !1;
541
+ }, []), He = me(
542
+ () => ({
543
+ productId: a,
544
+ setProductId: h,
545
+ folderId: o,
546
+ taskId: W,
547
+ linkedTask: n,
548
+ isLoadingTask: K,
549
+ setTaskId: Ce,
550
+ setLinkedTask: E,
551
+ setFolderId: s,
552
+ isOpen: y,
553
+ projectName: e,
554
+ latestVersion: J,
555
+ pendingFiles: m,
556
+ setPendingFiles: F,
557
+ onOpenVersionUpload: te,
558
+ onCloseVersionUpload: q,
559
+ onUploadVersion: X,
560
+ extractAndSetVersionFromFiles: fe,
561
+ form: R,
562
+ setForm: g,
563
+ isSubmitting: T,
564
+ error: L,
565
+ createdProductId: M,
566
+ createdVersionId: $,
567
+ handleFormChange: Q,
568
+ handleFormSubmit: Ee,
569
+ folderProducts: d,
570
+ isFolderProductsLoading: S,
571
+ matchedProduct: A,
572
+ dispatch: c
573
+ }),
574
+ [
575
+ o,
576
+ s,
577
+ a,
578
+ W,
579
+ n,
580
+ K,
581
+ Ce,
582
+ E,
583
+ h,
584
+ y,
585
+ e,
586
+ J,
587
+ m,
588
+ F,
589
+ te,
590
+ q,
591
+ X,
592
+ fe,
593
+ R,
594
+ T,
595
+ L,
596
+ M,
597
+ $,
598
+ Q,
599
+ Ee,
600
+ d,
601
+ S,
602
+ A,
603
+ c
604
+ ]
605
+ );
606
+ return /* @__PURE__ */ C(Qt.Provider, { value: He, children: t });
607
+ }, Qs = ({ children: t }) => {
608
+ const [e, i] = _(!1), { siteInfo: c, user: o, cloudInfo: s } = Be(), { data: a, isLoading: h } = Tt(
609
+ {},
610
+ {
611
+ skip: !o?.name || !s?.connected
612
+ }
613
+ ), l = () => {
614
+ if (!e) {
615
+ const u = document.createElement("script");
616
+ u.src = "https://do.featurebase.app/js/sdk.js", u.id = "featurebase-sdk", u.async = !0, document.body.appendChild(u), i(!0);
617
+ }
618
+ }, f = () => {
619
+ const u = window;
620
+ typeof u.Featurebase != "function" && (u.Featurebase = function() {
621
+ (u.Featurebase.q = u.Featurebase.q || []).push(arguments);
622
+ });
623
+ }, n = c?.version?.split("+")[0] || "unknown", E = c?.version?.split("+")[1] || "unknown", y = () => {
624
+ if (!o?.name || !a?.available) return;
625
+ const u = {
626
+ ...a.data,
627
+ customFields: {
628
+ origin: window.location.origin,
629
+ serverVersion: n,
630
+ frontendVersion: E,
631
+ instanceId: s?.instanceId
632
+ }
633
+ };
634
+ console.log(u), window.Featurebase("identify", u, (S) => {
635
+ S ? console.error(S) : console.log("Featurebase identify completed");
636
+ });
637
+ }, [D, m] = _(!1), [F, R] = _(0), g = () => {
638
+ const u = window;
639
+ if (typeof u.Featurebase == "function") {
640
+ if (console.log("Initializing Featurebase messenger widget"), !a?.available)
641
+ return console.warn("messenger verification not available, skipping messenger init");
642
+ u.Featurebase(
643
+ "boot",
644
+ {
645
+ theme: "dark",
646
+ ...a?.data
647
+ },
648
+ (d) => {
649
+ d ? console.error(d) : (console.log("Featurebase messenger completed"), m(!0), u.Featurebase("onUnreadCountChange", function(S) {
650
+ R(S);
651
+ }));
652
+ }
653
+ );
654
+ }
655
+ }, T = () => {
656
+ const u = [];
657
+ if (o?.data?.isAdmin) {
658
+ const S = ["Server", "Addon", "Pipeline"];
659
+ u.push(...S);
660
+ } else c?.disableChangelog || u.push("Highlights");
661
+ const d = window;
662
+ return typeof d.Featurebase == "function" && d.Featurebase("init_changelog_widget", {
663
+ organization: "ayon",
664
+ dropdown: {
665
+ enabled: !0
666
+ },
667
+ popup: {
668
+ enabled: !0,
669
+ usersName: o?.attrib?.fullName,
670
+ autoOpenForNewUpdates: !0
671
+ },
672
+ category: u,
673
+ theme: "dark"
674
+ }), !1;
675
+ }, I = () => {
676
+ const u = window;
677
+ return typeof u.Featurebase == "function" && u.Featurebase(
678
+ "initialize_feedback_widget",
679
+ {
680
+ organization: "ayon",
681
+ theme: "dark",
682
+ metadata: {}
683
+ },
684
+ (d) => {
685
+ d && console.error("Error initializing feedback widget:", d);
686
+ }
687
+ ), !1;
688
+ }, L = () => {
689
+ const u = window;
690
+ return typeof u.Featurebase == "function" && u.Featurebase(
691
+ "initialize_portal_widget",
692
+ {
693
+ organization: "ayon",
694
+ fullScreen: !0,
695
+ initialPage: "MainView"
696
+ },
697
+ (d) => d ? (console.error("Error initializing portal widget:", d), !1) : !0
698
+ ), !1;
699
+ }, N = () => {
700
+ const u = window;
701
+ return typeof u.Featurebase == "function" && u.Featurebase(
702
+ "initialize_survey_widget",
703
+ {
704
+ organization: "ayon",
705
+ placement: "bottom-right",
706
+ theme: "dark",
707
+ email: o?.attrib?.email,
708
+ featurebaseJwt: a?.data?.featurebaseJwt,
709
+ locale: "en"
710
+ },
711
+ (d) => {
712
+ d ? console.error("Error initializing survey widget:", d) : console.log("Survey widget initialized successfully");
713
+ }
714
+ ), !1;
715
+ };
716
+ Y(() => {
717
+ o?.name && c && (c.disableFeedback || e || (l(), f(), T(), I(), L()));
718
+ }, [o?.name, e, c]);
719
+ const [M, G] = _(!1);
720
+ Y(() => {
721
+ !o?.name || !s || !a || !e || M || (y(), N(), G(!0));
722
+ }, [
723
+ o?.name,
724
+ s?.instanceId,
725
+ a?.available,
726
+ e,
727
+ window.location.pathname,
728
+ M
729
+ ]), Y(() => {
730
+ h || !e || g();
731
+ }, [a, h, e]);
732
+ const $ = () => {
733
+ window.postMessage({
734
+ target: "FeaturebaseWidget",
735
+ data: {
736
+ action: "openFeedbackWidget"
737
+ }
738
+ });
739
+ }, V = (u = "MainView", d) => {
740
+ window.postMessage({
741
+ target: "FeaturebaseWidget",
742
+ data: {
743
+ action: "changePage",
744
+ payload: u,
745
+ openWidget: !0,
746
+ ...d && { articleId: d }
747
+ }
748
+ });
749
+ }, [b, v] = _(!1), O = document.getElementById("fb-messenger-root"), r = (u) => O instanceof HTMLElement && (O.style.display = u ? "block" : "none");
750
+ Y(() => {
751
+ !e || !D || r(b);
752
+ }, [e, D, b]), Y(() => {
753
+ if (!e || !D) return;
754
+ const u = window;
755
+ typeof u.Featurebase == "function" && u.Featurebase("onHide", function() {
756
+ v(!1);
757
+ });
758
+ }, [e, D]);
759
+ const p = (u = "Home", d) => {
760
+ const S = window;
761
+ if (typeof S.Featurebase != "function") {
762
+ window.alert("Featurebase SDK is not loaded yet. Please try again later."), console.warn("Featurebase SDK is not loaded yet.");
763
+ return;
764
+ }
765
+ if (b) {
766
+ S.Featurebase("hide"), v(!1);
767
+ return;
768
+ }
769
+ switch (v(!0), u) {
770
+ case "Home":
771
+ S.Featurebase("show");
772
+ break;
773
+ case "Messages":
774
+ S.Featurebase("show", "messages");
775
+ break;
776
+ case "Changelog":
777
+ S.Featurebase("show", "changelog");
778
+ break;
779
+ case "Help":
780
+ S.Featurebase("show", "help");
781
+ break;
782
+ case "ShowArticle":
783
+ d ? S.Featurebase("showArticle", d) : S.Featurebase("show", "help");
784
+ break;
785
+ case "NewMessage":
786
+ S.Featurebase("showNewMessage", d);
787
+ break;
788
+ default:
789
+ S.Featurebase("show");
790
+ break;
791
+ }
792
+ };
793
+ return /* @__PURE__ */ C(
794
+ _t.Provider,
795
+ {
796
+ value: {
797
+ openSupport: p,
798
+ openFeedback: $,
799
+ openPortal: V,
800
+ messengerLoaded: D,
801
+ unreadCount: F,
802
+ messengerVisibility: b,
803
+ setMessengerVisibility: v,
804
+ loaded: e
805
+ },
806
+ children: t
807
+ }
808
+ );
809
+ }, qs = ({
810
+ projectName: t,
811
+ list: e,
812
+ isLoading: i,
813
+ attributes: c = []
392
814
  }) => {
393
- const [r, a] = H({
815
+ const [o, s] = _({
394
816
  label: "",
395
817
  tags: [],
396
818
  active: !1
397
- }), o = (t?.accessLevel || 0) >= 30, { tags: f } = ct(), { data: i = [] } = nt(), c = pe(
398
- () => i.filter((d) => d.scope?.includes("list")).map((d) => ({
399
- name: d.name,
400
- data: d.data
819
+ }), a = (e?.accessLevel || 0) >= 30, { tags: h } = mt(), { data: l = [] } = Rt(), f = me(
820
+ () => l.filter((m) => m.scope?.includes("list")).map((m) => ({
821
+ name: m.name,
822
+ data: m.data
401
823
  })),
402
- [i]
403
- ), s = pe(
824
+ [l]
825
+ ), n = me(
404
826
  () => [
405
827
  { name: "label", data: { type: "string", title: "Label" } },
406
828
  {
@@ -408,249 +830,249 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
408
830
  data: {
409
831
  type: "list_of_strings",
410
832
  title: "Tags",
411
- enum: f?.map((d) => ({ value: d.name, label: d.name, color: d.color })),
833
+ enum: h?.map((m) => ({ value: m.name, label: m.name, color: m.color })),
412
834
  enableCustomValues: !0,
413
835
  enableSearch: !0
414
836
  }
415
837
  },
416
- ...c,
838
+ ...f,
417
839
  { name: "active", data: { type: "boolean", title: "Active" } },
418
- ...u
840
+ ...c
419
841
  ],
420
- [f, c, u]
842
+ [h, f, c]
421
843
  );
422
- se(() => {
423
- if (t) {
424
- const d = t.attrib || {}, _ = [...c, ...u].reduce((m, { name: R }) => {
425
- const V = d[R];
426
- return m[R] = V || "", m;
844
+ Y(() => {
845
+ if (e) {
846
+ const m = e.attrib || {}, R = [...f, ...c].reduce((g, { name: T }) => {
847
+ const I = m[T];
848
+ return g[T] = I || "", g;
427
849
  }, {});
428
- a({
429
- label: t?.label || "",
430
- tags: t?.tags || [],
431
- active: t?.active ?? !1,
432
- ..._
850
+ s({
851
+ label: e?.label || "",
852
+ tags: e?.tags || [],
853
+ active: e?.active ?? !1,
854
+ ...R
433
855
  });
434
856
  }
435
- }, [t, JSON.stringify(u), JSON.stringify(c)]);
436
- const [w] = lt(), v = (d) => u.some((T) => T.name === d) || c.some((T) => T.name === d), D = Oe(
437
- async (d, T) => {
438
- if (!t?.id) return console.warn("No list ID provided");
439
- let _;
440
- if (v(d)) {
441
- const m = t.attrib || {};
442
- T === "" && d === "category" ? _ = {
857
+ }, [e, JSON.stringify(c), JSON.stringify(f)]);
858
+ const [E] = It(), y = (m) => c.some((F) => F.name === m) || f.some((F) => F.name === m), D = ee(
859
+ async (m, F) => {
860
+ if (!e?.id) return console.warn("No list ID provided");
861
+ let R;
862
+ if (y(m)) {
863
+ const g = e.attrib || {};
864
+ F === "" && m === "category" ? R = {
443
865
  attrib: {
444
- ...m,
445
- [d]: null
866
+ ...g,
867
+ [m]: null
446
868
  }
447
- } : _ = {
869
+ } : R = {
448
870
  attrib: {
449
- ...m,
450
- [d]: T
871
+ ...g,
872
+ [m]: F
451
873
  }
452
- }, a((R) => ({ ...R, [d]: T }));
874
+ }, s((T) => ({ ...T, [m]: F }));
453
875
  } else {
454
- const m = { [d]: T };
455
- _ = m, a((R) => ({ ...R, ...m }));
876
+ const g = { [m]: F };
877
+ R = g, s((T) => ({ ...T, ...g }));
456
878
  }
457
879
  try {
458
- await w({
459
- listId: t.id,
460
- projectName: e,
461
- entityListPatchModel: _
880
+ await E({
881
+ listId: e.id,
882
+ projectName: t,
883
+ entityListPatchModel: R
462
884
  });
463
- } catch (m) {
464
- console.error(m), Te.error("Failed to update list attribute: ", m.attrib.detail);
885
+ } catch (g) {
886
+ console.error(g), he.error("Failed to update list attribute: ", g.attrib.detail);
465
887
  }
466
888
  },
467
- [t?.id, t?.attrib, e, w, c, u]
889
+ [e?.id, e?.attrib, t, E, f, c]
468
890
  );
469
- return /* @__PURE__ */ g(
470
- tt,
891
+ return /* @__PURE__ */ C(
892
+ wt,
471
893
  {
472
- enableEditing: o,
473
- projectName: e,
474
- fields: s,
475
- form: r,
476
- isLoading: l,
894
+ enableEditing: a,
895
+ projectName: t,
896
+ fields: n,
897
+ form: o,
898
+ isLoading: i,
477
899
  onChange: D,
478
900
  title: "Attributes"
479
901
  }
480
902
  );
481
- }, Oa = ({ list: e, isLoading: t }) => {
482
- const l = Object.fromEntries(
483
- Object.entries(e?.data || {}).filter(
484
- ([a, o]) => !["category", "count"].includes(a) && o !== null && typeof o != "object"
903
+ }, Zs = ({ list: t, isLoading: e }) => {
904
+ const i = Object.fromEntries(
905
+ Object.entries(t?.data || {}).filter(
906
+ ([s, a]) => !["category", "count"].includes(s) && a !== null && typeof a != "object"
485
907
  )
486
- ), u = {
487
- Id: e?.id,
488
- "Entity type": e?.entityType,
489
- "List type": e?.entityListType,
490
- "Items count": e?.items?.length,
491
- Owner: e?.owner,
492
- "Created at": e?.createdAt && X(new Date(e?.createdAt), "PPpp"),
493
- "Created by": e?.createdBy,
494
- "Updated at": e?.updatedAt && X(new Date(e?.updatedAt), "PPpp"),
495
- "Last updated by": e?.updatedBy,
496
- ...l
497
- }, r = Object.keys(u).map((a) => ({
498
- name: a,
908
+ ), c = {
909
+ Id: t?.id,
910
+ "Entity type": t?.entityType,
911
+ "List type": t?.entityListType,
912
+ "Items count": t?.items?.length,
913
+ Owner: t?.owner,
914
+ "Created at": t?.createdAt && re(new Date(t?.createdAt), "PPpp"),
915
+ "Created by": t?.createdBy,
916
+ "Updated at": t?.updatedAt && re(new Date(t?.updatedAt), "PPpp"),
917
+ "Last updated by": t?.updatedBy,
918
+ ...i
919
+ }, o = Object.keys(c).map((s) => ({
920
+ name: s,
499
921
  data: { type: "string" },
500
922
  hidden: !1
501
923
  }));
502
- return /* @__PURE__ */ g(at, { form: u, fields: r, isLoading: !!t });
503
- }, Sa = ({
504
- label: e,
505
- description: t,
506
- features: l,
507
- isCloseable: u = !0,
508
- addon: r
924
+ return /* @__PURE__ */ C(yt, { form: c, fields: o, isLoading: !!e });
925
+ }, ea = ({
926
+ label: t,
927
+ description: e,
928
+ features: i,
929
+ isCloseable: c = !0,
930
+ addon: o
509
931
  }) => {
510
- const [a, o] = H(!1), { setPowerpackDialog: f, selectedPowerPack: i, powerpackDialog: c, addonDialog: s } = pt(), w = !!r || !!s, v = e ?? c?.label ?? s?.label, D = t ?? c?.description ?? (s ? s.features[s.selectedFeature ?? ""]?.description ?? Object.values(s.features)[0]?.description : void 0), d = r?.icon ?? (s ? s.icon : "bolt");
511
- if (!c && !s && (!e || !t)) return null;
512
- const _ = (() => {
513
- if (l)
514
- return Object.entries(l);
515
- if (s) {
516
- const R = s.featureOrder.filter((V) => V in s.features).map(
517
- (V) => [V, s.features[V]]
932
+ const [s, a] = _(!1), { setPowerpackDialog: h, selectedPowerPack: l, powerpackDialog: f, addonDialog: n } = ht(), E = !!o || !!n, y = t ?? f?.label ?? n?.label, D = e ?? f?.description ?? (n ? n.features[n.selectedFeature ?? ""]?.description ?? Object.values(n.features)[0]?.description : void 0), m = o?.icon ?? (n ? n.icon : "bolt");
933
+ if (!f && !n && (!t || !e)) return null;
934
+ const R = (() => {
935
+ if (i)
936
+ return Object.entries(i);
937
+ if (n) {
938
+ const T = n.featureOrder.filter((I) => I in n.features).map(
939
+ (I) => [I, n.features[I]]
518
940
  );
519
- if (s.selectedFeature) {
520
- const V = R.findIndex(([P]) => P === s.selectedFeature);
521
- if (V > 0) {
522
- const [P] = R.splice(V, 1);
523
- R.unshift(P);
941
+ if (n.selectedFeature) {
942
+ const I = T.findIndex(([L]) => L === n.selectedFeature);
943
+ if (I > 0) {
944
+ const [L] = T.splice(I, 1);
945
+ T.unshift(L);
524
946
  }
525
947
  }
526
- return R;
948
+ return T;
527
949
  }
528
- return Object.entries(ft).sort(([R], [V]) => {
529
- if (R === i) return -1;
530
- if (V === i) return 1;
531
- const P = ge.indexOf(R), N = ge.indexOf(V);
532
- return P > -1 && N > -1 ? P - N : P > -1 ? -1 : N > -1 ? 1 : 0;
950
+ return Object.entries(bt).sort(([T], [I]) => {
951
+ if (T === l) return -1;
952
+ if (I === l) return 1;
953
+ const L = Te.indexOf(T), N = Te.indexOf(I);
954
+ return L > -1 && N > -1 ? L - N : L > -1 ? -1 : N > -1 ? 1 : 0;
533
955
  });
534
956
  })();
535
- return /* @__PURE__ */ M(
536
- Ge,
957
+ return /* @__PURE__ */ z(
958
+ et,
537
959
  {
538
960
  isOpen: !0,
539
961
  onClose: () => {
540
- u && (f(null), o(!1));
962
+ c && (h(null), a(!1));
541
963
  },
542
964
  size: "lg",
543
- hideCancelButton: !u,
544
- hideBackdrop: !u,
965
+ hideCancelButton: !c,
966
+ hideBackdrop: !c,
545
967
  children: [
546
- /* @__PURE__ */ M(He, { children: [
547
- /* @__PURE__ */ M("h1", { children: [
548
- /* @__PURE__ */ g(z, { icon: d }),
549
- v
968
+ /* @__PURE__ */ z(tt, { children: [
969
+ /* @__PURE__ */ z("h1", { children: [
970
+ /* @__PURE__ */ C(le, { icon: m }),
971
+ y
550
972
  ] }),
551
- /* @__PURE__ */ g("h2", { children: D })
973
+ /* @__PURE__ */ C("h2", { children: D })
552
974
  ] }),
553
- /* @__PURE__ */ M(Ye, { children: [
554
- w ? /* @__PURE__ */ M("h3", { children: [
975
+ /* @__PURE__ */ z(st, { children: [
976
+ E ? /* @__PURE__ */ z("h3", { children: [
555
977
  "Unlock all ",
556
- /* @__PURE__ */ g("span", { className: "green", children: "Premium Addons" }),
978
+ /* @__PURE__ */ C("span", { className: "green", children: "Premium Addons" }),
557
979
  " with an AYON Studio subscription."
558
- ] }) : /* @__PURE__ */ M("h3", { children: [
980
+ ] }) : /* @__PURE__ */ z("h3", { children: [
559
981
  "Unlock all ",
560
- /* @__PURE__ */ g(z, { icon: "bolt" }),
982
+ /* @__PURE__ */ C(le, { icon: "bolt" }),
561
983
  " ",
562
- /* @__PURE__ */ g("span", { className: "green", children: "Power Features" }),
984
+ /* @__PURE__ */ C("span", { className: "green", children: "Power Features" }),
563
985
  " with an AYON subscription."
564
986
  ] }),
565
- /* @__PURE__ */ g("ul", { children: _.slice(0, a ? void 0 : 5).map(([R, V]) => /* @__PURE__ */ M("li", { children: [
566
- /* @__PURE__ */ g(z, { icon: V.icon ?? "check" }),
567
- /* @__PURE__ */ g("span", { children: V.bullet })
568
- ] }, R)) }),
569
- !a && _.length > 5 && /* @__PURE__ */ g($e, { onClick: () => o(!0), children: "Show all" })
987
+ /* @__PURE__ */ C("ul", { children: R.slice(0, s ? void 0 : 5).map(([T, I]) => /* @__PURE__ */ z("li", { children: [
988
+ /* @__PURE__ */ C(le, { icon: I.icon ?? "check" }),
989
+ /* @__PURE__ */ C("span", { children: I.bullet })
990
+ ] }, T)) }),
991
+ !s && R.length > 5 && /* @__PURE__ */ C(at, { onClick: () => a(!0), children: "Show all" })
570
992
  ] }),
571
- /* @__PURE__ */ g(je, { addon: r?.name, children: /* @__PURE__ */ g(Ke, {}) })
993
+ /* @__PURE__ */ C(ot, { addon: o?.name, children: /* @__PURE__ */ C(nt, {}) })
572
994
  ]
573
995
  }
574
996
  );
575
- }, ve = ({
576
- Component: e,
577
- projectName: t,
578
- state: l,
579
- dispatch: u,
580
- useSelector: r,
581
- onOpenImage: a,
582
- onGoToFrame: o,
583
- onOpenViewer: f,
584
- onUpdateEntity: i,
585
- ...c
997
+ }, _e = ({
998
+ Component: t,
999
+ projectName: e,
1000
+ state: i,
1001
+ dispatch: c,
1002
+ useSelector: o,
1003
+ onOpenImage: s,
1004
+ onGoToFrame: a,
1005
+ onOpenViewer: h,
1006
+ onUpdateEntity: l,
1007
+ ...f
586
1008
  }) => {
587
- const s = ht(), { onCreateView: w, getLatestSettings: v, markCacheDirty: D } = mt();
588
- return /* @__PURE__ */ g(
589
- e,
1009
+ const n = gt(), { onCreateView: E, getLatestSettings: y, markCacheDirty: D } = xt();
1010
+ return /* @__PURE__ */ C(
1011
+ t,
590
1012
  {
591
- router: { useParams: wt, useNavigate: yt, useLocation: Et, useSearchParams: bt },
592
- projectName: t,
1013
+ router: { useParams: Ut, useNavigate: Bt, useLocation: Mt, useSearchParams: Lt },
1014
+ projectName: e,
593
1015
  views: {
594
- ...s,
595
- settings: s.viewSettings,
596
- updateViewSettings: (...d) => gt(...d, s, w, v, D)
1016
+ ...n,
1017
+ settings: n.viewSettings,
1018
+ updateViewSettings: (...m) => Nt(...m, n, E, y, D)
597
1019
  },
598
1020
  context: {},
599
- state: l,
600
- dispatch: u,
601
- useSelector: r,
602
- onOpenImage: a,
603
- onGoToFrame: o,
604
- onOpenViewer: f,
605
- onUpdateEntity: i,
606
- toast: Te,
607
- ...c
1021
+ state: i,
1022
+ dispatch: c,
1023
+ useSelector: o,
1024
+ onOpenImage: s,
1025
+ onGoToFrame: a,
1026
+ onOpenViewer: h,
1027
+ onUpdateEntity: l,
1028
+ toast: he,
1029
+ ...f
608
1030
  }
609
1031
  );
610
- }, At = ({ children: e, fields: t }) => {
611
- const l = Ct.filter((u) => t.includes(u.value));
612
- return /* @__PURE__ */ g("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ M(
613
- Rt,
1032
+ }, Zt = ({ children: t, fields: e }) => {
1033
+ const i = Wt.filter((c) => e.includes(c.value));
1034
+ return /* @__PURE__ */ C("main", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ z(
1035
+ Yt,
614
1036
  {
615
1037
  layout: "horizontal",
616
1038
  style: { width: "100%", height: "100%" },
617
- stateKey: Ot,
1039
+ stateKey: Ht,
618
1040
  stateStorage: "local",
619
1041
  children: [
620
- /* @__PURE__ */ g(be, { ...St, children: /* @__PURE__ */ g(qe, { wrap: !0, children: /* @__PURE__ */ g(Dt, { sliceFields: l, pinnedSliceType: "hierarchy" }) }) }),
621
- /* @__PURE__ */ g(be, { size: 80, children: e })
1042
+ /* @__PURE__ */ C(Ie, { ...zt, children: /* @__PURE__ */ C(ct, { wrap: !0, children: /* @__PURE__ */ C(Gt, { sliceFields: i, pinnedSliceType: "hierarchy" }) }) }),
1043
+ /* @__PURE__ */ C(Ie, { size: 80, children: t })
622
1044
  ]
623
1045
  }
624
1046
  ) });
625
- }, Da = ({
626
- Component: e,
627
- projectName: t,
628
- slicer: l,
629
- state: u = {},
630
- addonProps: r,
631
- ...a
1047
+ }, ta = ({
1048
+ Component: t,
1049
+ projectName: e,
1050
+ slicer: i,
1051
+ state: c = {},
1052
+ addonProps: o,
1053
+ ...s
632
1054
  }) => {
633
- let o = /* @__PURE__ */ g(ve, { Component: e, projectName: t, ...a });
634
- if (l && t) {
635
- let f = null;
1055
+ let a = /* @__PURE__ */ C(_e, { Component: t, projectName: e, ...s });
1056
+ if (i && e) {
1057
+ let h = null;
636
1058
  try {
637
- f = vt();
1059
+ h = dt();
638
1060
  } catch {
639
1061
  console.log("Slicer context not available for this addon page");
640
1062
  }
641
- o = /* @__PURE__ */ g(At, { fields: l.fields, children: /* @__PURE__ */ g(
642
- ve,
1063
+ a = /* @__PURE__ */ C(Zt, { fields: i.fields, children: /* @__PURE__ */ C(
1064
+ _e,
643
1065
  {
644
- Component: e,
645
- projectName: t,
646
- ...a,
647
- state: { slicer: f, ...u },
648
- ...r
1066
+ Component: t,
1067
+ projectName: e,
1068
+ ...s,
1069
+ state: { slicer: h, ...c },
1070
+ ...o
649
1071
  }
650
1072
  ) });
651
1073
  }
652
- return o;
653
- }, _t = /* @__PURE__ */ new Set([
1074
+ return a;
1075
+ }, es = /* @__PURE__ */ new Set([
654
1076
  "name",
655
1077
  "status",
656
1078
  "tags",
@@ -665,243 +1087,243 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
665
1087
  "hasReviewables",
666
1088
  "createdAt",
667
1089
  "updatedAt"
668
- ]), Ra = ({
669
- filterTypes: e = [],
670
- projectNames: t,
671
- scope: l,
672
- scopes: u,
673
- data: r,
674
- config: a,
675
- power: o
1090
+ ]), sa = ({
1091
+ filterTypes: t = [],
1092
+ projectNames: e,
1093
+ scope: i,
1094
+ scopes: c,
1095
+ data: o,
1096
+ config: s,
1097
+ power: a
676
1098
  }) => {
677
- const f = st(), i = r.productTypes || [], c = r.productBaseTypes || [];
678
- let s = [];
679
- const w = /* @__PURE__ */ new Map(), v = u || (l ? Array.isArray(l) ? l : [l] : []).map((b) => ({
680
- scope: b,
681
- filterTypes: e
682
- })), D = v.length > 1, d = new Set(
683
- Array.from(new Set(v.flatMap(({ filterTypes: h }) => h))).filter(
684
- (h) => v.filter(({ filterTypes: b }) => b.includes(h)).length > 1
1099
+ const h = vt(), l = o.productTypes || [], f = o.productBaseTypes || [];
1100
+ let n = [];
1101
+ const E = /* @__PURE__ */ new Map(), y = c || (i ? Array.isArray(i) ? i : [i] : []).map((v) => ({
1102
+ scope: v,
1103
+ filterTypes: t
1104
+ })), D = y.length > 1, m = new Set(
1105
+ Array.from(new Set(y.flatMap(({ filterTypes: b }) => b))).filter(
1106
+ (b) => y.filter(({ filterTypes: v }) => v.includes(b)).length > 1
685
1107
  )
686
- ), T = v.some(
687
- (h) => ["entitySubType", "status"].some((b) => h.filterTypes.includes(b))
688
- ), _ = v.some(
689
- (h) => ["assignees", "users", "author"].some(
690
- (b) => h.filterTypes.includes(b)
1108
+ ), F = y.some(
1109
+ (b) => ["entitySubType", "status"].some((v) => b.filterTypes.includes(v))
1110
+ ), R = y.some(
1111
+ (b) => ["assignees", "users", "author"].some(
1112
+ (v) => b.filterTypes.includes(v)
691
1113
  )
692
- ), { data: m = {} } = it(
1114
+ ), { data: g = {} } = Ft(
693
1115
  {
694
- projects: t
1116
+ projects: e
695
1117
  },
696
1118
  {
697
- skip: !t?.length || !T
1119
+ skip: !e?.length || !F
698
1120
  }
699
- ), { data: R = [] } = ut(
700
- { projects: t },
1121
+ ), { data: T = [] } = At(
1122
+ { projects: e },
701
1123
  {
702
- skip: !t?.length || !_
1124
+ skip: !e?.length || !R
703
1125
  }
704
- ), { attributes: V } = Tt(), P = ze(Ze), N = P?.attribFields?.length ? P.attribFields : V, F = /* @__PURE__ */ new Map();
705
- v.forEach(({ scope: h, filterTypes: b }) => {
706
- b.includes("attributes") && N.filter((O) => O.scope?.includes(h)).forEach((O) => {
707
- F.set(
1126
+ ), { attributes: I } = Be(), L = lt(pt), N = L?.attribFields?.length ? L.attribFields : I, M = /* @__PURE__ */ new Map();
1127
+ y.forEach(({ scope: b, filterTypes: v }) => {
1128
+ v.includes("attributes") && N.filter((O) => O.scope?.includes(b)).forEach((O) => {
1129
+ M.set(
708
1130
  O.name,
709
- (F.get(O.name) || 0) + 1
1131
+ (M.get(O.name) || 0) + 1
710
1132
  );
711
1133
  });
712
- }), v.forEach(({ scope: h, filterTypes: b }) => {
713
- const O = D ? h : void 0;
714
- if (b.includes("taskType") && h !== "user") {
715
- const n = L(
1134
+ }), y.forEach(({ scope: b, filterTypes: v }) => {
1135
+ const O = D ? b : void 0;
1136
+ if (v.includes("taskType") && b !== "user") {
1137
+ const r = H(
716
1138
  "taskType",
717
1139
  {
718
- ...a,
1140
+ ...s,
719
1141
  enableOperatorChange: !1
720
1142
  },
721
1143
  O,
722
- d.has("taskType")
1144
+ m.has("taskType")
723
1145
  );
724
- if (n) {
725
- let p = ie({ projectsInfo: m, productTypes: i }, "task");
726
- n.values?.push(...p), s.push(n);
1146
+ if (r) {
1147
+ let p = ve({ projectsInfo: g, productTypes: l }, "task");
1148
+ r.values?.push(...p), n.push(r);
727
1149
  }
728
1150
  }
729
- if (b.includes("folderType") && h !== "user") {
730
- const n = L(
1151
+ if (v.includes("folderType") && b !== "user") {
1152
+ const r = H(
731
1153
  "folderType",
732
1154
  {
733
- ...a,
1155
+ ...s,
734
1156
  enableOperatorChange: !1
735
1157
  },
736
1158
  O,
737
- d.has("folderType")
1159
+ m.has("folderType")
738
1160
  );
739
- if (n) {
740
- let p = ie({ projectsInfo: m, productTypes: i }, "folder");
741
- n.values?.push(...p), s.push(n);
1161
+ if (r) {
1162
+ let p = ve({ projectsInfo: g, productTypes: l }, "folder");
1163
+ r.values?.push(...p), n.push(r);
742
1164
  }
743
1165
  }
744
- if (b.includes("productType") && h !== "user") {
745
- const n = L(
1166
+ if (v.includes("productType") && b !== "user") {
1167
+ const r = H(
746
1168
  "productType",
747
1169
  {
748
- ...a,
1170
+ ...s,
749
1171
  enableOperatorChange: !1
750
1172
  },
751
1173
  O,
752
- d.has("productType")
1174
+ m.has("productType")
753
1175
  );
754
- if (n) {
755
- let p = ie({ projectsInfo: m, productTypes: i }, "product");
756
- n.values?.push(...p), s.push(n);
1176
+ if (r) {
1177
+ let p = ve({ projectsInfo: g, productTypes: l }, "product");
1178
+ r.values?.push(...p), n.push(r);
757
1179
  }
758
1180
  }
759
- if (b.includes("productBaseType") && h !== "user") {
760
- const n = L(
1181
+ if (v.includes("productBaseType") && b !== "user") {
1182
+ const r = H(
761
1183
  "productBaseType",
762
1184
  {
763
- ...a,
1185
+ ...s,
764
1186
  enableOperatorChange: !1
765
1187
  },
766
1188
  O,
767
- d.has("productBaseType")
1189
+ m.has("productBaseType")
768
1190
  );
769
- n && (c.forEach(({ icon: p, name: C }) => {
770
- n.values?.some((y) => y.id === C) || n.values?.push({
771
- id: C,
772
- label: C,
773
- icon: p || Y("product")
1191
+ r && (f.forEach(({ icon: p, name: u }) => {
1192
+ r.values?.some((d) => d.id === u) || r.values?.push({
1193
+ id: u,
1194
+ label: u,
1195
+ icon: p || ae("product")
774
1196
  });
775
- }), r.productBaseTypes?.forEach(({ icon: p, name: C }) => {
776
- n.values?.some((y) => y.id === C) || n.values?.push({
777
- id: C,
778
- label: C,
779
- icon: p || Y("product")
1197
+ }), o.productBaseTypes?.forEach(({ icon: p, name: u }) => {
1198
+ r.values?.some((d) => d.id === u) || r.values?.push({
1199
+ id: u,
1200
+ label: u,
1201
+ icon: p || ae("product")
780
1202
  });
781
- }), s.push(n));
1203
+ }), n.push(r));
782
1204
  }
783
- if (b.includes("productName") && h === "product") {
784
- const n = L(
1205
+ if (v.includes("productName") && b === "product") {
1206
+ const r = H(
785
1207
  "productName",
786
- a,
1208
+ s,
787
1209
  O,
788
- d.has("productName")
1210
+ m.has("productName")
789
1211
  );
790
- n && (r.productNames?.forEach((p) => {
791
- n.values?.some((C) => C.id === p) || n.values?.push({
1212
+ r && (o.productNames?.forEach((p) => {
1213
+ r.values?.some((u) => u.id === p) || r.values?.push({
792
1214
  id: p,
793
1215
  label: p
794
1216
  });
795
- }), s.push(n));
1217
+ }), n.push(r));
796
1218
  }
797
- if (b.includes("status")) {
798
- const n = L(
1219
+ if (v.includes("status")) {
1220
+ const r = H(
799
1221
  "status",
800
- { ...a, enableOperatorChange: !1 },
1222
+ { ...s, enableOperatorChange: !1 },
801
1223
  O,
802
- d.has("status")
1224
+ m.has("status")
803
1225
  );
804
- n && (Object.values(m).forEach((p) => {
805
- (p?.statuses || []).filter((y) => y.scope?.includes(h)).forEach((y) => {
806
- n.values?.some((x) => x.id === y.name) || n.values?.push({
807
- id: y.name,
808
- label: y.name,
809
- icon: y.icon,
810
- color: y.color
1226
+ r && (Object.values(g).forEach((p) => {
1227
+ (p?.statuses || []).filter((d) => d.scope?.includes(b)).forEach((d) => {
1228
+ r.values?.some((S) => S.id === d.name) || r.values?.push({
1229
+ id: d.name,
1230
+ label: d.name,
1231
+ icon: d.icon,
1232
+ color: d.color
811
1233
  });
812
1234
  });
813
- }), s.push(n));
1235
+ }), n.push(r));
814
1236
  }
815
- if (b.includes("assignees")) {
816
- const n = L(
1237
+ if (v.includes("assignees")) {
1238
+ const r = H(
817
1239
  "assignees",
818
- a,
1240
+ s,
819
1241
  O,
820
- d.has("assignees")
1242
+ m.has("assignees")
821
1243
  );
822
- n && (R.forEach((p) => {
823
- n.values?.some((C) => C.id === p.name) || n.values?.push({
1244
+ r && (T.forEach((p) => {
1245
+ r.values?.some((u) => u.id === p.name) || r.values?.push({
824
1246
  id: p.name,
825
1247
  label: p.attrib.fullName || p.name,
826
1248
  img: `/api/users/${p.name}/avatar`,
827
1249
  icon: null
828
1250
  });
829
- }), n.values?.sort((p, C) => {
830
- const y = r.assignees?.filter((k) => k === p.id).length || 0;
831
- return (r.assignees?.filter((k) => k === C.id).length || 0) - y;
832
- }), s.push(n));
1251
+ }), r.values?.sort((p, u) => {
1252
+ const d = o.assignees?.filter((A) => A === p.id).length || 0;
1253
+ return (o.assignees?.filter((A) => A === u.id).length || 0) - d;
1254
+ }), n.push(r));
833
1255
  }
834
- if (b.includes("author")) {
835
- const n = L(
1256
+ if (v.includes("author")) {
1257
+ const r = H(
836
1258
  "author",
837
- a,
1259
+ s,
838
1260
  O,
839
- d.has("author")
1261
+ m.has("author")
840
1262
  );
841
- n && (R.forEach((p) => {
842
- n.values?.some((C) => C.id === p.name) || n.values?.push({
1263
+ r && (T.forEach((p) => {
1264
+ r.values?.some((u) => u.id === p.name) || r.values?.push({
843
1265
  id: p.name,
844
1266
  label: p.attrib.fullName || p.name,
845
1267
  img: `/api/users/${p.name}/avatar`,
846
1268
  icon: null
847
1269
  });
848
- }), s.push(n));
1270
+ }), n.push(r));
849
1271
  }
850
- if (b.includes("tags")) {
851
- const n = L("tags", a, O, d.has("tags"));
852
- if (n) {
1272
+ if (v.includes("tags")) {
1273
+ const r = H("tags", s, O, m.has("tags"));
1274
+ if (r) {
853
1275
  const p = /* @__PURE__ */ new Map();
854
- Object.values(m).forEach((x) => {
855
- x?.tags && x.tags.forEach((k) => {
856
- p.has(k.name) || p.set(k.name, k);
1276
+ Object.values(g).forEach((S) => {
1277
+ S?.tags && S.tags.forEach((A) => {
1278
+ p.has(A.name) || p.set(A.name, A);
857
1279
  });
858
1280
  });
859
- const C = /* @__PURE__ */ new Map();
860
- r.tags?.forEach((x) => {
861
- const k = C.get(x);
862
- if (k) {
863
- k.count++;
1281
+ const u = /* @__PURE__ */ new Map();
1282
+ o.tags?.forEach((S) => {
1283
+ const A = u.get(S);
1284
+ if (A) {
1285
+ A.count++;
864
1286
  return;
865
1287
  } else {
866
- const E = p.get(x);
867
- C.set(x, {
868
- id: x,
1288
+ const w = p.get(S);
1289
+ u.set(S, {
1290
+ id: S,
869
1291
  type: "string",
870
- label: x,
1292
+ label: S,
871
1293
  values: [],
872
- color: E?.color || null,
1294
+ color: w?.color || null,
873
1295
  count: 1
874
1296
  });
875
1297
  }
876
1298
  });
877
- const y = Array.from(C.values()).sort(
878
- (x, k) => k.count - x.count
1299
+ const d = Array.from(u.values()).sort(
1300
+ (S, A) => A.count - S.count
879
1301
  );
880
- n.values?.push(...y), s.push(n);
1302
+ r.values?.push(...d), n.push(r);
881
1303
  }
882
1304
  }
883
- if (b.includes("version")) {
884
- const n = L("version", a, O);
885
- n && (Xe.forEach((C) => {
886
- n.values?.push({
887
- id: C.value,
888
- label: C.label,
889
- icon: C.icon
1305
+ if (v.includes("version")) {
1306
+ const r = H("version", s, O);
1307
+ r && (rt.forEach((u) => {
1308
+ r.values?.push({
1309
+ id: u.value,
1310
+ label: u.label,
1311
+ icon: u.icon
890
1312
  });
891
- }), s.push(n));
1313
+ }), n.push(r));
892
1314
  }
893
- if (b.includes("name")) {
894
- const n = L("name", a, O, d.has("name"));
895
- n && s.push(n);
1315
+ if (v.includes("name")) {
1316
+ const r = H("name", s, O, m.has("name"));
1317
+ r && n.push(r);
896
1318
  }
897
- if (b.includes("hasReviewables")) {
898
- const n = L(
1319
+ if (v.includes("hasReviewables")) {
1320
+ const r = H(
899
1321
  "hasReviewables",
900
- a,
1322
+ s,
901
1323
  O,
902
- d.has("hasReviewables")
1324
+ m.has("hasReviewables")
903
1325
  );
904
- if (n) {
1326
+ if (r) {
905
1327
  const p = [
906
1328
  {
907
1329
  id: "true",
@@ -914,81 +1336,81 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
914
1336
  values: []
915
1337
  }
916
1338
  ];
917
- n.values?.push(...p), s.push(n);
1339
+ r.values?.push(...p), n.push(r);
918
1340
  }
919
1341
  }
920
- if (b.includes("createdAt")) {
921
- const n = L(
1342
+ if (v.includes("createdAt")) {
1343
+ const r = H(
922
1344
  "createdAt",
923
- a,
1345
+ s,
924
1346
  O,
925
- d.has("createdAt")
1347
+ m.has("createdAt")
926
1348
  );
927
- n && (n.values?.push(ne), n.values?.push(
928
- ...le().map((p) => ({
1349
+ r && (r.values?.push(we), r.values?.push(
1350
+ ...ye().map((p) => ({
929
1351
  ...p,
930
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1352
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
931
1353
  }))
932
- ), s.push(n));
1354
+ ), n.push(r));
933
1355
  }
934
- if (b.includes("updatedAt")) {
935
- const n = L(
1356
+ if (v.includes("updatedAt")) {
1357
+ const r = H(
936
1358
  "updatedAt",
937
- a,
1359
+ s,
938
1360
  O,
939
- d.has("updatedAt")
1361
+ m.has("updatedAt")
940
1362
  );
941
- n && (n.values?.push(ne), n.values?.push(
942
- ...le().map((p) => ({
1363
+ r && (r.values?.push(we), r.values?.push(
1364
+ ...ye().map((p) => ({
943
1365
  ...p,
944
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1366
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
945
1367
  }))
946
- ), s.push(n));
1368
+ ), n.push(r));
947
1369
  }
948
- if (b.includes("attributes")) {
949
- const n = N.filter(
950
- (y) => y.scope?.includes(h)
951
- ), p = dt(r.attributes) ? n : n.filter(
952
- (y) => r.attributes && r.attributes[y.name]
1370
+ if (v.includes("attributes")) {
1371
+ const r = N.filter(
1372
+ (d) => d.scope?.includes(b)
1373
+ ), p = Pt(o.attributes) ? r : r.filter(
1374
+ (d) => o.attributes && o.attributes[d.name]
953
1375
  );
954
- (a?.enableRelativeValues ? p : p.filter((y) => y.data.type !== "datetime")).forEach((y) => {
955
- const x = r.attributes && r.attributes[y.name], k = y.data.enum, E = y.data.type, A = [
1376
+ (s?.enableRelativeValues ? p : p.filter((d) => d.data.type !== "datetime")).forEach((d) => {
1377
+ const S = o.attributes && o.attributes[d.name], A = d.data.enum, w = d.data.type, x = [
956
1378
  "list_of_strings",
957
1379
  "list_of_integers",
958
1380
  "list_of_any",
959
1381
  "list_of_submodels"
960
- ].includes(E || ""), I = E === "datetime", W = E === "string", $ = E === "integer" || E === "float", J = A ? a?.enableOperatorChange : !1, re = y.data.default !== void 0 && y.data.default !== null && y.data.inherit !== !1, xe = (A || I || W || $) && !re ? a?.enableRelativeValues : !1, q = xt(
961
- y,
1382
+ ].includes(w || ""), B = w === "datetime", W = w === "string", K = w === "integer" || w === "float", te = x ? s?.enableOperatorChange : !1, q = d.data.default !== void 0 && d.data.default !== null && d.data.inherit !== !1, pe = (x || B || W || K) && !q ? s?.enableRelativeValues : !1, X = ts(
1383
+ d,
962
1384
  {
963
- ...a,
1385
+ ...s,
964
1386
  allowsCustomValues: !0,
965
- enableOperatorChange: J,
966
- enableRelativeValues: xe
1387
+ enableOperatorChange: te,
1388
+ enableRelativeValues: pe
967
1389
  },
968
1390
  O,
969
- (F.get(y.name) || 0) > 1
1391
+ (M.get(d.name) || 0) > 1
970
1392
  );
971
- if (y.data.enumResolver) {
972
- const j = y.data;
973
- q.loadValuesKey = t?.[0], q.loadValues = async () => Ce(
974
- x,
975
- await f(j, t?.[0]),
976
- E
1393
+ if (d.data.enumResolver) {
1394
+ const Q = d.data;
1395
+ X.loadValuesKey = e?.[0], X.loadValues = async () => xe(
1396
+ S,
1397
+ await h(Q, e?.[0]),
1398
+ w
977
1399
  );
978
1400
  }
979
- const ke = [
1401
+ const fe = [
980
1402
  "string",
981
1403
  "integer",
982
1404
  "float",
983
1405
  "list_of_strings",
984
1406
  "list_of_integers"
985
- ], Q = [];
986
- if (ke.includes(E)) {
987
- const j = Ce(x, k, E);
988
- Q.push(...j);
1407
+ ], J = [];
1408
+ if (fe.includes(w)) {
1409
+ const Q = xe(S, A, w);
1410
+ J.push(...Q);
989
1411
  }
990
- if (E === "boolean") {
991
- const j = [
1412
+ if (w === "boolean") {
1413
+ const Q = [
992
1414
  {
993
1415
  id: "true",
994
1416
  label: "Yes",
@@ -1000,56 +1422,56 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1000
1422
  values: []
1001
1423
  }
1002
1424
  ];
1003
- Q.push(...j);
1425
+ J.push(...Q);
1004
1426
  }
1005
- I && (Q.push(ne), Q.push(
1006
- ...le().map((j) => ({
1007
- ...j,
1008
- contentAfter: o ? void 0 : /* @__PURE__ */ g(z, { icon: "bolt" })
1427
+ B && (J.push(we), J.push(
1428
+ ...ye().map((Q) => ({
1429
+ ...Q,
1430
+ contentAfter: a ? void 0 : /* @__PURE__ */ C(le, { icon: "bolt" })
1009
1431
  }))
1010
- )), q.values?.push(...Q), w.set(q.id, y.name), s.push(q);
1432
+ )), X.values?.push(...J), E.set(X.id, d.name), n.push(X);
1011
1433
  });
1012
1434
  }
1013
1435
  });
1014
- const U = s.reduce((h, b) => {
1015
- if (!b.group) return h;
1016
- const O = typeof b.group == "string" ? void 0 : b.group, n = O?.name || b.group, p = v.some(({ scope: C }) => C === n);
1017
- return h.some((C) => C.name === n) || h.push({
1018
- name: n,
1019
- label: p ? ae(n) : O?.label || b.label,
1020
- icon: p ? Y(n) : O?.icon || b.icon,
1021
- color: O?.color || b.color
1022
- }), h;
1023
- }, []), K = kt(s, w, N), S = Pt(
1024
- U,
1025
- K,
1026
- w,
1436
+ const G = n.reduce((b, v) => {
1437
+ if (!v.group) return b;
1438
+ const O = typeof v.group == "string" ? void 0 : v.group, r = O?.name || v.group, p = y.some(({ scope: u }) => u === r);
1439
+ return b.some((u) => u.name === r) || b.push({
1440
+ name: r,
1441
+ label: p ? de(r) : O?.label || v.label,
1442
+ icon: p ? ae(r) : O?.icon || v.icon,
1443
+ color: O?.color || v.color
1444
+ }), b;
1445
+ }, []), $ = ss(n, E, N), V = as(
1446
+ G,
1447
+ $,
1448
+ E,
1027
1449
  N
1028
1450
  );
1029
- return { options: K, groupOptions: S };
1030
- }, ie = ({
1031
- projectsInfo: e,
1032
- productTypes: t
1033
- }, l) => {
1034
- const u = [];
1035
- return l === "product" ? t.forEach(({ icon: r, name: a }) => {
1036
- u.push({
1037
- id: a,
1451
+ return { options: $, groupOptions: V };
1452
+ }, ve = ({
1453
+ projectsInfo: t,
1454
+ productTypes: e
1455
+ }, i) => {
1456
+ const c = [];
1457
+ return i === "product" ? e.forEach(({ icon: o, name: s }) => {
1458
+ c.push({
1459
+ id: s,
1038
1460
  type: "string",
1039
- label: a,
1040
- icon: r || Y("product"),
1461
+ label: s,
1462
+ icon: o || ae("product"),
1041
1463
  inverted: !1,
1042
1464
  values: [],
1043
1465
  allowsCustomValues: !1
1044
1466
  });
1045
- }) : l === "task" ? Object.values(e).forEach((r) => {
1046
- (r?.taskTypes || []).forEach((o) => {
1047
- u.some((f) => f.id === o.name) || u.push({
1048
- id: o.name,
1467
+ }) : i === "task" ? Object.values(t).forEach((o) => {
1468
+ (o?.taskTypes || []).forEach((a) => {
1469
+ c.some((h) => h.id === a.name) || c.push({
1470
+ id: a.name,
1049
1471
  type: "string",
1050
- label: o.name,
1051
- icon: o.icon,
1052
- color: o.color,
1472
+ label: a.name,
1473
+ icon: a.icon,
1474
+ color: a.color,
1053
1475
  inverted: !1,
1054
1476
  values: [],
1055
1477
  allowsCustomValues: !1,
@@ -1060,14 +1482,14 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1060
1482
  }
1061
1483
  });
1062
1484
  });
1063
- }) : l === "folder" && Object.values(e).forEach((r) => {
1064
- (r?.folderTypes || []).forEach((o) => {
1065
- u.some((f) => f.id === o.name) || u.push({
1066
- id: o.name,
1485
+ }) : i === "folder" && Object.values(t).forEach((o) => {
1486
+ (o?.folderTypes || []).forEach((a) => {
1487
+ c.some((h) => h.id === a.name) || c.push({
1488
+ id: a.name,
1067
1489
  type: "string",
1068
- label: o.name,
1069
- icon: o.icon,
1070
- color: o.color,
1490
+ label: a.name,
1491
+ icon: a.icon,
1492
+ color: a.color,
1071
1493
  inverted: !1,
1072
1494
  values: [],
1073
1495
  allowsCustomValues: !1,
@@ -1078,85 +1500,85 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1078
1500
  }
1079
1501
  });
1080
1502
  });
1081
- }), u;
1082
- }, Ve = (e, t, l, u) => {
1083
- const { prefixes: r, keys: a } = l || {};
1084
- let o = e;
1085
- return a && t in a ? o = `${a[t]}` : r && t in r && (o = `${r[t]}${e}`), u && (o = `${u}_${o}`), o;
1086
- }, L = (e, t, l, u = !1) => {
1087
- const r = (i) => Ve(i, e, t, l);
1088
- let a = null;
1089
- switch (e) {
1503
+ }), c;
1504
+ }, Ue = (t, e, i, c) => {
1505
+ const { prefixes: o, keys: s } = i || {};
1506
+ let a = t;
1507
+ return s && e in s ? a = `${s[e]}` : o && e in o && (a = `${o[e]}${t}`), c && (a = `${c}_${a}`), a;
1508
+ }, H = (t, e, i, c = !1) => {
1509
+ const o = (l) => Ue(l, t, e, i);
1510
+ let s = null;
1511
+ switch (t) {
1090
1512
  case "taskType":
1091
- a = {
1092
- id: r("taskType"),
1513
+ s = {
1514
+ id: o("taskType"),
1093
1515
  type: "string",
1094
1516
  label: "Task Type",
1095
- icon: B("task"),
1517
+ icon: j("task"),
1096
1518
  inverted: !1,
1097
1519
  operator: "OR",
1098
1520
  values: [],
1099
1521
  allowsCustomValues: !1,
1100
1522
  allowHasValue: !1,
1101
1523
  allowNoValue: !1,
1102
- allowExcludes: t?.enableExcludes,
1524
+ allowExcludes: e?.enableExcludes,
1103
1525
  operatorChangeable: !1
1104
1526
  };
1105
1527
  break;
1106
1528
  case "folderType":
1107
- a = {
1108
- id: r("folderType"),
1529
+ s = {
1530
+ id: o("folderType"),
1109
1531
  type: "string",
1110
1532
  label: "Folder Type",
1111
- icon: B("folder"),
1533
+ icon: j("folder"),
1112
1534
  inverted: !1,
1113
1535
  operator: "OR",
1114
1536
  values: [],
1115
1537
  allowsCustomValues: !1,
1116
1538
  allowHasValue: !1,
1117
1539
  allowNoValue: !1,
1118
- allowExcludes: t?.enableExcludes,
1540
+ allowExcludes: e?.enableExcludes,
1119
1541
  operatorChangeable: !1
1120
1542
  };
1121
1543
  break;
1122
1544
  case "productType":
1123
- a = {
1124
- id: r("productType"),
1545
+ s = {
1546
+ id: o("productType"),
1125
1547
  type: "string",
1126
1548
  label: "Product Type",
1127
- icon: B("product"),
1549
+ icon: j("product"),
1128
1550
  inverted: !1,
1129
1551
  operator: "OR",
1130
1552
  values: [],
1131
1553
  allowsCustomValues: !1,
1132
1554
  allowHasValue: !1,
1133
1555
  allowNoValue: !1,
1134
- allowExcludes: t?.enableExcludes,
1556
+ allowExcludes: e?.enableExcludes,
1135
1557
  operatorChangeable: !1
1136
1558
  };
1137
1559
  break;
1138
1560
  case "productBaseType":
1139
- a = {
1140
- id: r("productBaseType"),
1561
+ s = {
1562
+ id: o("productBaseType"),
1141
1563
  type: "string",
1142
1564
  label: "Product Base Type",
1143
- icon: B("product"),
1565
+ icon: j("product"),
1144
1566
  inverted: !1,
1145
1567
  operator: "OR",
1146
1568
  values: [],
1147
1569
  allowsCustomValues: !0,
1148
1570
  allowHasValue: !1,
1149
1571
  allowNoValue: !1,
1150
- allowExcludes: t?.enableExcludes,
1572
+ allowExcludes: e?.enableExcludes,
1151
1573
  operatorChangeable: !1
1152
1574
  };
1153
1575
  break;
1154
1576
  case "productName":
1155
- a = {
1156
- id: r("productNames"),
1577
+ s = {
1578
+ id: o("productNames"),
1157
1579
  type: "string",
1158
1580
  label: "Product Name",
1159
- icon: B("productName", "string"),
1581
+ icon: j("productName", "string"),
1160
1582
  inverted: !1,
1161
1583
  operator: "OR",
1162
1584
  values: [],
@@ -1168,75 +1590,75 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1168
1590
  };
1169
1591
  break;
1170
1592
  case "status":
1171
- a = {
1172
- id: r("status"),
1593
+ s = {
1594
+ id: o("status"),
1173
1595
  type: "string",
1174
1596
  label: "Status",
1175
- icon: B("status"),
1597
+ icon: j("status"),
1176
1598
  inverted: !1,
1177
1599
  operator: "OR",
1178
1600
  values: [],
1179
1601
  allowsCustomValues: !1,
1180
1602
  allowHasValue: !1,
1181
1603
  allowNoValue: !1,
1182
- allowExcludes: t?.enableExcludes,
1604
+ allowExcludes: e?.enableExcludes,
1183
1605
  operatorChangeable: !1
1184
1606
  };
1185
1607
  break;
1186
1608
  case "assignees":
1187
- a = {
1188
- id: r("assignees"),
1609
+ s = {
1610
+ id: o("assignees"),
1189
1611
  type: "list_of_strings",
1190
1612
  label: "Assignee",
1191
- icon: B("assignees"),
1613
+ icon: j("assignees"),
1192
1614
  inverted: !1,
1193
1615
  operator: "OR",
1194
1616
  values: [],
1195
1617
  allowsCustomValues: !1,
1196
- allowHasValue: t?.enableRelativeValues,
1197
- allowNoValue: t?.enableRelativeValues,
1198
- allowExcludes: t?.enableExcludes,
1199
- operatorChangeable: t?.enableOperatorChange
1618
+ allowHasValue: e?.enableRelativeValues,
1619
+ allowNoValue: e?.enableRelativeValues,
1620
+ allowExcludes: e?.enableExcludes,
1621
+ operatorChangeable: e?.enableOperatorChange
1200
1622
  };
1201
1623
  break;
1202
1624
  case "author":
1203
- a = {
1204
- id: r("author"),
1625
+ s = {
1626
+ id: o("author"),
1205
1627
  type: "string",
1206
1628
  label: "Author",
1207
- icon: B("author"),
1629
+ icon: j("author"),
1208
1630
  inverted: !1,
1209
1631
  operator: "OR",
1210
1632
  values: [],
1211
1633
  allowsCustomValues: !1,
1212
- allowHasValue: t?.enableRelativeValues,
1213
- allowNoValue: t?.enableRelativeValues,
1214
- allowExcludes: t?.enableExcludes,
1215
- operatorChangeable: t?.enableOperatorChange
1634
+ allowHasValue: e?.enableRelativeValues,
1635
+ allowNoValue: e?.enableRelativeValues,
1636
+ allowExcludes: e?.enableExcludes,
1637
+ operatorChangeable: e?.enableOperatorChange
1216
1638
  };
1217
1639
  break;
1218
1640
  case "tags":
1219
- a = {
1220
- id: r("tags"),
1641
+ s = {
1642
+ id: o("tags"),
1221
1643
  type: "list_of_strings",
1222
1644
  label: "Tags",
1223
- icon: B("tags"),
1645
+ icon: j("tags"),
1224
1646
  inverted: !1,
1225
1647
  operator: "OR",
1226
1648
  values: [],
1227
1649
  allowsCustomValues: !0,
1228
- allowHasValue: t?.enableRelativeValues,
1229
- allowNoValue: t?.enableRelativeValues,
1230
- allowExcludes: t?.enableExcludes,
1231
- operatorChangeable: t?.enableOperatorChange
1650
+ allowHasValue: e?.enableRelativeValues,
1651
+ allowNoValue: e?.enableRelativeValues,
1652
+ allowExcludes: e?.enableExcludes,
1653
+ operatorChangeable: e?.enableOperatorChange
1232
1654
  };
1233
1655
  break;
1234
1656
  case "version":
1235
- a = {
1236
- id: r("version"),
1657
+ s = {
1658
+ id: o("version"),
1237
1659
  type: "string",
1238
1660
  label: "Version",
1239
- icon: Y("version"),
1661
+ icon: ae("version"),
1240
1662
  inverted: !1,
1241
1663
  operator: "OR",
1242
1664
  values: [],
@@ -1249,8 +1671,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1249
1671
  };
1250
1672
  break;
1251
1673
  case "name":
1252
- a = {
1253
- id: r("name"),
1674
+ s = {
1675
+ id: o("name"),
1254
1676
  type: "string",
1255
1677
  label: "Name",
1256
1678
  icon: "text_fields",
@@ -1265,8 +1687,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1265
1687
  };
1266
1688
  break;
1267
1689
  case "hasReviewables":
1268
- a = {
1269
- id: r("hasReviewables"),
1690
+ s = {
1691
+ id: o("hasReviewables"),
1270
1692
  type: "boolean",
1271
1693
  label: "Has Reviewables",
1272
1694
  icon: "play_circle",
@@ -1276,14 +1698,14 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1276
1698
  allowsCustomValues: !1,
1277
1699
  allowHasValue: !1,
1278
1700
  allowNoValue: !1,
1279
- allowExcludes: t?.enableExcludes,
1701
+ allowExcludes: e?.enableExcludes,
1280
1702
  operatorChangeable: !1,
1281
1703
  singleSelect: !0
1282
1704
  };
1283
1705
  break;
1284
1706
  case "createdAt":
1285
- a = {
1286
- id: r("createdAt"),
1707
+ s = {
1708
+ id: o("createdAt"),
1287
1709
  type: "datetime",
1288
1710
  label: "Created",
1289
1711
  icon: "calendar_add_on",
@@ -1299,8 +1721,8 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1299
1721
  };
1300
1722
  break;
1301
1723
  case "updatedAt":
1302
- a = {
1303
- id: r("updatedAt"),
1724
+ s = {
1725
+ id: o("updatedAt"),
1304
1726
  type: "datetime",
1305
1727
  label: "Updated",
1306
1728
  icon: "edit_calendar",
@@ -1316,134 +1738,136 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1316
1738
  };
1317
1739
  break;
1318
1740
  }
1319
- const o = ae(l || ""), f = (i) => l ? `${o} ${i}` : i;
1320
- if ((u || l) && a) {
1321
- const i = l || e;
1322
- a.group = {
1323
- name: i,
1324
- label: l ? ae(l) : a.label,
1325
- icon: l ? Y(l) : a.icon
1741
+ const a = de(i || ""), h = (l) => i ? `${a} ${l}` : l;
1742
+ if ((c || i) && s) {
1743
+ const l = i || t;
1744
+ s.group = {
1745
+ name: l,
1746
+ label: i ? de(i) : s.label,
1747
+ icon: i ? ae(i) : s.icon
1326
1748
  };
1327
1749
  }
1328
- return a && l && (a.tooltip = f(a.label), a.value = { label: f(a.label) }), a && e === "version" && l === "version" && (a.value = { label: "Product Version" }, a.tooltip = "Product Version"), a;
1329
- }, xt = (e, t, l, u = !1) => {
1330
- const r = e.data.title || e.name, a = u || l ? {
1331
- name: l || e.name,
1332
- label: l ? ae(l) : r,
1333
- icon: l ? Y(l) : B(e.name, e.data.type, me(e.data))
1750
+ return s && i && (s.tooltip = h(s.label), s.value = { label: h(s.label) }), s && t === "version" && i === "version" && (s.value = { label: "Product Version" }, s.tooltip = "Product Version"), s;
1751
+ }, ts = (t, e, i, c = !1) => {
1752
+ const o = t.data.title || t.name, s = c || i ? {
1753
+ name: i || t.name,
1754
+ label: i ? de(i) : o,
1755
+ icon: i ? ae(i) : j(t.name, t.data.type, Re(t.data))
1334
1756
  } : void 0;
1335
1757
  return {
1336
- id: Ve(e.name, "attributes", t, l),
1337
- type: e.data.type,
1338
- label: r,
1758
+ id: Ue(t.name, "attributes", e, i),
1759
+ type: t.data.type,
1760
+ label: o,
1339
1761
  operator: "OR",
1340
1762
  inverted: !1,
1341
1763
  values: [],
1342
- allowsCustomValues: t?.allowsCustomValues,
1343
- allowHasValue: t.enableRelativeValues,
1344
- allowNoValue: t.enableRelativeValues,
1345
- allowExcludes: t?.enableExcludes,
1346
- operatorChangeable: t?.enableOperatorChange,
1347
- icon: B(e.name, e.data.type, me(e.data)),
1348
- group: a,
1349
- tooltip: l ? `${ae(l)} ${r}` : void 0,
1350
- value: l ? { icon: Y(l) } : void 0,
1351
- singleSelect: ["boolean", "datetime"].includes(e.data.type || "")
1764
+ allowsCustomValues: e?.allowsCustomValues,
1765
+ allowHasValue: e.enableRelativeValues,
1766
+ allowNoValue: e.enableRelativeValues,
1767
+ allowExcludes: e?.enableExcludes,
1768
+ operatorChangeable: e?.enableOperatorChange,
1769
+ icon: j(t.name, t.data.type, Re(t.data)),
1770
+ group: s,
1771
+ tooltip: i ? `${de(i)} ${o}` : void 0,
1772
+ value: i ? { icon: ae(i) } : void 0,
1773
+ singleSelect: ["boolean", "datetime"].includes(t.data.type || "")
1352
1774
  };
1353
- }, Ce = (e, t, l) => {
1354
- const u = [], r = [];
1355
- if (t) {
1356
- const a = (e || []).flatMap((o) => Array.isArray(o) ? o : [o]);
1357
- ot(t, a).forEach((o) => {
1358
- const f = o.icon, i = rt(f);
1359
- u.push({
1360
- id: o.value.toString(),
1361
- type: l,
1362
- label: o.label,
1363
- values: [],
1364
- icon: i ? null : f,
1365
- img: i ? f : void 0,
1366
- color: o.color,
1367
- pt: {
1368
- style: { color: "inherit" }
1369
- }
1370
- });
1371
- });
1775
+ }, xe = (t, e, i) => {
1776
+ const c = [], o = [];
1777
+ if (e) {
1778
+ const s = (t || []).flatMap((a) => Array.isArray(a) ? a : [a]);
1779
+ Et(e, s).forEach(
1780
+ (a) => {
1781
+ const h = a.icon, l = Ct(h);
1782
+ c.push({
1783
+ id: a.value.toString(),
1784
+ type: i,
1785
+ label: a.label,
1786
+ values: [],
1787
+ icon: l ? null : h,
1788
+ img: l ? h : void 0,
1789
+ color: a.color,
1790
+ pt: {
1791
+ style: { color: "inherit" }
1792
+ }
1793
+ });
1794
+ }
1795
+ );
1372
1796
  }
1373
- return e?.forEach((a) => {
1374
- if (!a) return;
1375
- let o = "";
1376
- switch (typeof a) {
1797
+ return t?.forEach((s) => {
1798
+ if (!s) return;
1799
+ let a = "";
1800
+ switch (typeof s) {
1377
1801
  case "string":
1378
1802
  case "number":
1379
1803
  case "boolean":
1380
- o = a.toString();
1804
+ a = s.toString();
1381
1805
  break;
1382
1806
  case "object":
1383
- Array.isArray(a) ? o = a.join(", ") : o = JSON.stringify(a);
1807
+ Array.isArray(s) ? a = s.join(", ") : a = JSON.stringify(s);
1384
1808
  break;
1385
1809
  }
1386
- const f = o.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
1387
- if (u?.find((s) => s.id === f)) return;
1388
- const c = r.find((s) => s.id === f);
1389
- if (c) {
1390
- c.count++;
1810
+ const h = a.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
1811
+ if (c?.find((n) => n.id === h)) return;
1812
+ const f = o.find((n) => n.id === h);
1813
+ if (f) {
1814
+ f.count++;
1391
1815
  return;
1392
1816
  } else
1393
- r.push({
1394
- id: f,
1395
- type: l,
1396
- label: o,
1817
+ o.push({
1818
+ id: h,
1819
+ type: i,
1820
+ label: a,
1397
1821
  values: [],
1398
1822
  count: 1
1399
1823
  });
1400
- }), r.sort((a, o) => o.count - a.count), [...u, ...r];
1401
- }, kt = (e, t, l) => [...e].sort((u, r) => Ae(
1402
- oe(u),
1403
- t.get(u.id),
1404
- oe(r),
1405
- t.get(r.id),
1406
- l
1407
- )), oe = (e) => e.group ? typeof e.group == "string" ? e.group : e.group.name : e.id, Pt = (e, t, l, u) => [...e].sort((r, a) => {
1408
- const o = t.find((i) => (typeof i.group == "string" ? i.group : i.group?.name) === r.name), f = t.find((i) => (typeof i.group == "string" ? i.group : i.group?.name) === a.name);
1409
- return Ae(
1410
- o ? oe(o) : r.name,
1411
- o ? l.get(o.id) : r.name,
1412
- f ? oe(f) : a.name,
1413
- f ? l.get(f.id) : a.name,
1414
- u
1824
+ }), o.sort((s, a) => a.count - s.count), [...c, ...o];
1825
+ }, ss = (t, e, i) => [...t].sort((c, o) => We(
1826
+ ge(c),
1827
+ e.get(c.id),
1828
+ ge(o),
1829
+ e.get(o.id),
1830
+ i
1831
+ )), ge = (t) => t.group ? typeof t.group == "string" ? t.group : t.group.name : t.id, as = (t, e, i, c) => [...t].sort((o, s) => {
1832
+ const a = 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) === s.name);
1833
+ return We(
1834
+ a ? ge(a) : o.name,
1835
+ a ? i.get(a.id) : o.name,
1836
+ h ? ge(h) : s.name,
1837
+ h ? i.get(h.id) : s.name,
1838
+ c
1415
1839
  );
1416
- }), Ae = (e, t, l, u, r) => {
1417
- const a = new Map(r.map((c, s) => [c.name, s])), o = (c) => {
1418
- let s = 0;
1419
- for (const w of _t) {
1420
- if (c === w || c.endsWith(`_${w}`)) return s;
1421
- s++;
1840
+ }), We = (t, e, i, c, o) => {
1841
+ const s = new Map(o.map((f, n) => [f.name, n])), a = (f) => {
1842
+ let n = 0;
1843
+ for (const E of es) {
1844
+ if (f === E || f.endsWith(`_${E}`)) return n;
1845
+ n++;
1422
1846
  }
1423
1847
  return Number.MAX_SAFE_INTEGER;
1424
- }, f = t ? [1, a.get(t) ?? Number.MAX_SAFE_INTEGER] : [0, o(e)], i = u ? [1, a.get(u) ?? Number.MAX_SAFE_INTEGER] : [0, o(l)];
1425
- return f[0] - i[0] || f[1] - i[1];
1426
- }, Ta = (e, t, l, u) => {
1427
- const r = {
1428
- folder: { conditions: [], operator: e?.operator || "and" },
1429
- product: { conditions: [], operator: e?.operator || "and" },
1430
- task: { conditions: [], operator: e?.operator || "and" },
1431
- user: { conditions: [], operator: e?.operator || "and" },
1432
- version: { conditions: [], operator: e?.operator || "and" },
1433
- unscoped: { conditions: [], operator: e?.operator || "and" }
1848
+ }, h = e ? [1, s.get(e) ?? Number.MAX_SAFE_INTEGER] : [0, a(t)], l = c ? [1, s.get(c) ?? Number.MAX_SAFE_INTEGER] : [0, a(i)];
1849
+ return h[0] - l[0] || h[1] - l[1];
1850
+ }, aa = (t, e, i, c) => {
1851
+ const o = {
1852
+ folder: { conditions: [], operator: t?.operator || "and" },
1853
+ product: { conditions: [], operator: t?.operator || "and" },
1854
+ task: { conditions: [], operator: t?.operator || "and" },
1855
+ user: { conditions: [], operator: t?.operator || "and" },
1856
+ version: { conditions: [], operator: t?.operator || "and" },
1857
+ unscoped: { conditions: [], operator: t?.operator || "and" }
1434
1858
  };
1435
- if (!e?.conditions || e?.conditions.length === 0)
1436
- return r;
1437
- const a = (i) => {
1438
- const c = t.find((s) => i.startsWith(`${s}_`));
1439
- if (c) {
1440
- const s = i.substring(`${c}_`.length);
1441
- return { scope: c, cleanId: s };
1442
- } else if (l?.fallbackScope)
1443
- return { scope: l.fallbackScope, cleanId: i };
1444
- return { scope: null, cleanId: i };
1445
- }, o = (i) => {
1446
- const c = {
1859
+ if (!t?.conditions || t?.conditions.length === 0)
1860
+ return o;
1861
+ const s = (l) => {
1862
+ const f = e.find((n) => l.startsWith(`${n}_`));
1863
+ if (f) {
1864
+ const n = l.substring(`${f}_`.length);
1865
+ return { scope: f, cleanId: n };
1866
+ } else if (i?.fallbackScope)
1867
+ return { scope: i.fallbackScope, cleanId: l };
1868
+ return { scope: null, cleanId: l };
1869
+ }, a = (l) => {
1870
+ const f = {
1447
1871
  folder: [],
1448
1872
  product: [],
1449
1873
  task: [],
@@ -1451,34 +1875,34 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1451
1875
  version: [],
1452
1876
  unscoped: []
1453
1877
  };
1454
- if ("conditions" in i && !("key" in i)) {
1455
- const s = (i.conditions || []).map((w) => o(w));
1456
- Object.keys(c).forEach((w) => {
1457
- const v = w, D = s.flatMap((d) => d[v]);
1458
- D.length > 0 && (D.length === 1 && !i.operator ? c[v].push(D[0]) : c[v].push({
1878
+ if ("conditions" in l && !("key" in l)) {
1879
+ const n = (l.conditions || []).map((E) => a(E));
1880
+ Object.keys(f).forEach((E) => {
1881
+ const y = E, D = n.flatMap((m) => m[y]);
1882
+ D.length > 0 && (D.length === 1 && !l.operator ? f[y].push(D[0]) : f[y].push({
1459
1883
  conditions: D,
1460
- operator: i.operator
1884
+ operator: l.operator
1461
1885
  }));
1462
1886
  });
1463
- } else if ("key" in i) {
1464
- const { scope: s, cleanId: w } = a(i.key);
1465
- if (s)
1466
- c[s].push({ ...i, key: w });
1887
+ } else if ("key" in l) {
1888
+ const { scope: n, cleanId: E } = s(l.key);
1889
+ if (n)
1890
+ f[n].push({ ...l, key: E });
1467
1891
  else {
1468
- const v = u?.[i.key];
1469
- v ? c[v].push(i) : i.key === Qe || i.key === "name" || i.key?.endsWith("_name") ? t.forEach((D) => {
1470
- c[D].push(i);
1471
- }) : c.unscoped.push(i);
1892
+ const y = c?.[l.key];
1893
+ y ? f[y].push(l) : l.key === ut || l.key === "name" || l.key?.endsWith("_name") ? e.forEach((D) => {
1894
+ f[D].push(l);
1895
+ }) : f.unscoped.push(l);
1472
1896
  }
1473
1897
  }
1474
- return c;
1475
- }, f = (e.conditions || []).map((i) => o(i));
1476
- return Object.keys(r).forEach((i) => {
1477
- const c = i;
1478
- r[c].conditions = f.flatMap((s) => s[c]);
1479
- }), r;
1480
- }, Va = (e, t, l) => {
1481
- const u = {
1898
+ return f;
1899
+ }, h = (t.conditions || []).map((l) => a(l));
1900
+ return Object.keys(o).forEach((l) => {
1901
+ const f = l;
1902
+ o[f].conditions = h.flatMap((n) => n[f]);
1903
+ }), o;
1904
+ }, oa = (t, e, i) => {
1905
+ const c = {
1482
1906
  folder: [],
1483
1907
  product: [],
1484
1908
  task: [],
@@ -1486,31 +1910,31 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1486
1910
  version: [],
1487
1911
  unscoped: []
1488
1912
  };
1489
- if (!e || e.length === 0)
1490
- return u;
1491
- const r = (o) => t.find((i) => o.startsWith(`${i}_`)) || null, a = (o, f) => {
1492
- const i = `${f}_`;
1493
- return o.startsWith(i) ? o.substring(i.length) : o;
1913
+ if (!t || t.length === 0)
1914
+ return c;
1915
+ const o = (a) => e.find((l) => a.startsWith(`${l}_`)) || null, s = (a, h) => {
1916
+ const l = `${h}_`;
1917
+ return a.startsWith(l) ? a.substring(l.length) : a;
1494
1918
  };
1495
- return e.forEach((o) => {
1496
- if (!o.id) return;
1497
- const f = r(o.id);
1498
- if (f) {
1499
- const i = {
1500
- ...o,
1501
- id: a(o.id, f)
1919
+ return t.forEach((a) => {
1920
+ if (!a.id) return;
1921
+ const h = o(a.id);
1922
+ if (h) {
1923
+ const l = {
1924
+ ...a,
1925
+ id: s(a.id, h)
1502
1926
  };
1503
- u[f].push(i);
1927
+ c[h].push(l);
1504
1928
  } else {
1505
- const i = l?.[o.id];
1506
- i ? u[i].push(o) : u.unscoped.push(o);
1929
+ const l = i?.[a.id];
1930
+ l ? c[l].push(a) : c.unscoped.push(a);
1507
1931
  }
1508
- }), u;
1509
- }, Z = ["status", "tags", "attributes", "createdAt", "updatedAt"], Nt = {
1510
- folder: [...Z, "name", "folderType"],
1511
- task: [...Z, "name", "taskType", "folderType", "assignees"],
1932
+ }), c;
1933
+ }, ce = ["status", "tags", "attributes", "createdAt", "updatedAt"], os = {
1934
+ folder: [...ce, "name", "folderType"],
1935
+ task: [...ce, "name", "taskType", "folderType", "assignees"],
1512
1936
  version: [
1513
- ...Z,
1937
+ ...ce,
1514
1938
  "version",
1515
1939
  "productName",
1516
1940
  "productType",
@@ -1520,139 +1944,141 @@ const Ee = 500, Vt = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, wa = ({
1520
1944
  "taskType",
1521
1945
  "folderType"
1522
1946
  ],
1523
- product: [...Z, "productName", "productBaseType"],
1524
- user: [...Z]
1525
- }, Aa = (e, t) => e.map((l) => ({
1526
- scope: l,
1527
- filterTypes: Nt[l].filter((u) => !t?.[l]?.includes(u))
1947
+ product: [...ce, "productName", "productBaseType"],
1948
+ user: [...ce]
1949
+ }, na = (t, e) => t.map((i) => ({
1950
+ scope: i,
1951
+ filterTypes: os[i].filter((c) => !e?.[i]?.includes(c))
1528
1952
  }));
1529
1953
  export {
1530
- ka as ACCESS_LEVEL_LABELS,
1531
- wa as AccessSearchInput,
1532
- ue as AccessUser,
1533
- Pa as AddColumnButton,
1534
- Na as AddonLoadingScreen,
1535
- Ia as AttributeEditor,
1536
- he as BLOCK_DIALOG_CLOSE_CLASS,
1537
- ps as Badge,
1538
- fs as BadgeWrapper,
1539
- Os as CUSTOM_RANGE_ICON,
1540
- Ss as CUSTOM_RANGE_ID,
1541
- Ds as CellEditingDialog,
1542
- gs as Chips,
1543
- Po as ColumnHeaderMenuUI,
1544
- No as ColumnMenuButton,
1545
- La as ColumnsSettings,
1546
- Ma as ColumnsSettingsWithContext,
1547
- Yo as CustomDateRangeDialog,
1548
- Fa as CustomizeButton,
1549
- Ba as DEFAULT_FEATURED_ORDER,
1550
- Is as DELETE_CONFIRM_THRESHOLD,
1551
- Ls as DELETE_TYPE_ORDER,
1552
- va as DateRangePicker,
1553
- Ms as DeleteConfirmContent,
1554
- Fs as DeleteEntitiesConfirmDialog,
1555
- bs as DescriptionSection,
1556
- $s as DetailsDialog,
1557
- tt as DetailsPanelAttributesEditor,
1558
- Ks as DetailsPanelDetails,
1559
- at as DetailsSection,
1560
- Rs as DoneCheckbox,
1561
- Do as ENTITY_TOOLTIP_TYPES,
1562
- Ua as EVERYONE_GROUP_KEY,
1563
- Wa as EVERY_GUESTS_KEY,
1564
- Ga as EarlyPreview,
1565
- oo as EmptyPlaceholder,
1566
- lo as EmptyPlaceholderFlex,
1567
- io as EmptyPlaceholderFlexWrapper,
1568
- Es as EntityIcon,
1569
- wo as EntityPanelUploader,
1570
- vo as EntityPath,
1571
- Ro as EntityTooltip,
1572
- Ha as EnumEditor,
1573
- Ya as EnumEditorItem,
1574
- Xe as FEATURED_VERSION_TYPES,
1575
- Nt as FILTER_TYPES_BY_SCOPE,
1576
- $a as FeaturedVersionOrder,
1577
- Vo as FeedbackProvider,
1578
- Xs as FieldLabel,
1579
- zs as FileThumbnail,
1580
- Ao as FilterErrorActions,
1581
- je as FreeTrialLink,
1582
- ja as GROUP_KEY_PREFIX,
1583
- Ka as GUEST_KEY_PREFIX,
1584
- go as InfoMessage,
1585
- Eo as JsonViewer,
1586
- Xa as LegacyBadge,
1587
- ys as LinkManagerItem,
1588
- ws as LinksManager,
1589
- Ca as ListAttributeForm,
1590
- Oa as ListMetaData,
1591
- uo as MENU_PORTAL_CONTENT_ID,
1592
- co as MENU_PORTAL_DIALOG_ID,
1593
- po as Menu,
1594
- fo as MenuContainer,
1595
- ho as MenuList,
1596
- Ts as NO_DATE,
1597
- ro as Placeholder,
1598
- za as PowerpackButton,
1599
- Sa as PowerpackDialog,
1600
- Da as ProjectPageRemote,
1601
- Ja as ProjectTableSettings,
1602
- Bs as RefreshToast,
1603
- ve as RemotePageWrapper,
1604
- qa as RequiredAddonVersion,
1605
- Js as ReviewableCard,
1606
- qs as ReviewableProgressCard,
1607
- Qs as ReviewableUpload,
1608
- Co as ReviewablesList,
1609
- Qa as ReviewablesSelector,
1610
- Za as SettingOption,
1611
- es as SettingSwitch,
1612
- ts as SettingsPanel,
1613
- as as SettingsPanelItemTemplate,
1614
- ss as ShareOptionIcon,
1615
- hs as SimpleForm,
1616
- Ko as SimpleFormDialog,
1617
- os as SizeSlider,
1618
- Zs as StackedThumbnails,
1619
- rs as StyledLink,
1620
- vs as SubtasksManagerWrapper,
1621
- Io as SupportBubble,
1622
- Uo as SyncButton,
1623
- ns as TEAM_KEY_PREFIX,
1624
- ls as TableGridSwitch,
1625
- zo as TableSearch,
1626
- Fo as TableSettingsFallback,
1627
- eo as Thumbnail,
1628
- $o as ThumbnailSimple,
1629
- is as USER_KEY_PREFIX,
1630
- us as UploadVersionDialog,
1631
- Vs as UserImage,
1632
- qo as VersionUploadProvider,
1633
- to as Watchers,
1634
- Us as buildChildrenDetails,
1635
- Ws as buildEntityLabel,
1636
- Gs as buildExpectedCounts,
1637
- Aa as buildScopes,
1638
- ne as customRangeOption,
1639
- As as dateOptions,
1640
- _s as datePresetOptions,
1641
- xs as detectRelativeDatePattern,
1642
- ks as filterDateFunctions,
1643
- Ps as generateDateOptions,
1644
- le as generateDatePresetOptions,
1645
- Oo as getGroupedReviewables,
1646
- cs as getUiTypeLabel,
1647
- tr as parseFilename,
1648
- Va as splitClientFiltersByScope,
1649
- Ta as splitFiltersByScope,
1650
- Hs as sumExpectedCounts,
1651
- Ra as useBuildFilterOptions,
1652
- Go as useDateRangeFilter,
1653
- _o as useFeedback,
1654
- xo as useFeedbackSafe,
1655
- Qo as useOptionalVersionUploadContext,
1656
- ao as useReviewablesUpload,
1657
- Zo as useVersionUploadContext
1954
+ Ks as ACCESS_LEVEL_LABELS,
1955
+ js as AccessSearchInput,
1956
+ Se as AccessUser,
1957
+ ia as AddColumnButton,
1958
+ ca as AddonLoadingScreen,
1959
+ ua as AttributeEditor,
1960
+ Ve as BLOCK_DIALOG_CLOSE_CLASS,
1961
+ Wa as Badge,
1962
+ Ha as BadgeWrapper,
1963
+ qa as CUSTOM_RANGE_ICON,
1964
+ Za as CUSTOM_RANGE_ID,
1965
+ eo as CellEditingDialog,
1966
+ Ya as Chips,
1967
+ Rn as ColumnHeaderMenuUI,
1968
+ nn as ColumnMenuButton,
1969
+ da as ColumnsSettings,
1970
+ pa as ColumnsSettingsWithContext,
1971
+ yn as CustomDateRangeDialog,
1972
+ fa as CustomizeButton,
1973
+ ma as DEFAULT_FEATURED_ORDER,
1974
+ uo as DELETE_CONFIRM_THRESHOLD,
1975
+ ho as DELETE_TYPE_ORDER,
1976
+ Xs as DateRangePicker,
1977
+ po as DeleteConfirmContent,
1978
+ go as DeleteEntitiesConfirmDialog,
1979
+ $a as DescriptionSection,
1980
+ Co as DetailsDialog,
1981
+ wt as DetailsPanelAttributesEditor,
1982
+ ko as DetailsPanelDetails,
1983
+ yt as DetailsSection,
1984
+ to as DoneCheckbox,
1985
+ tn as ENTITY_TOOLTIP_TYPES,
1986
+ ha as EVERYONE_GROUP_KEY,
1987
+ ga as EVERY_GUESTS_KEY,
1988
+ ba as EarlyPreview,
1989
+ xo as EmptyPlaceholder,
1990
+ Mo as EmptyPlaceholderFlex,
1991
+ Bo as EmptyPlaceholderFlexWrapper,
1992
+ ja as EntityIcon,
1993
+ Jo as EntityPanelUploader,
1994
+ Qo as EntityPath,
1995
+ sn as EntityTooltip,
1996
+ wa as EnumEditor,
1997
+ ya as EnumEditorItem,
1998
+ rt as FEATURED_VERSION_TYPES,
1999
+ os as FILTER_TYPES_BY_SCOPE,
2000
+ va as FeaturedVersionOrder,
2001
+ _t as FeedbackContext,
2002
+ Qs as FeedbackProvider,
2003
+ Oo as FieldLabel,
2004
+ Do as FileThumbnail,
2005
+ dn as FilterErrorActions,
2006
+ ot as FreeTrialLink,
2007
+ Ea as GROUP_KEY_PREFIX,
2008
+ Ca as GUEST_KEY_PREFIX,
2009
+ $o as InfoMessage,
2010
+ Ko as JsonViewer,
2011
+ Sa as LegacyBadge,
2012
+ Ka as LinkManagerItem,
2013
+ Xa as LinksManager,
2014
+ qs as ListAttributeForm,
2015
+ Zs as ListMetaData,
2016
+ Uo as MENU_PORTAL_CONTENT_ID,
2017
+ Wo as MENU_PORTAL_DIALOG_ID,
2018
+ Ho as Menu,
2019
+ zo as MenuContainer,
2020
+ Go as MenuList,
2021
+ so as NO_DATE,
2022
+ No as Placeholder,
2023
+ ka as PowerpackButton,
2024
+ ea as PowerpackDialog,
2025
+ ta as ProjectPageRemote,
2026
+ Oa as ProjectTableSettings,
2027
+ fo as RefreshToast,
2028
+ _e as RemotePageWrapper,
2029
+ Da as RequiredAddonVersion,
2030
+ Vo as ReviewableCard,
2031
+ To as ReviewableProgressCard,
2032
+ Ro as ReviewableUpload,
2033
+ qo as ReviewablesList,
2034
+ Va as ReviewablesSelector,
2035
+ Ta as SettingOption,
2036
+ Ra as SettingSwitch,
2037
+ Ia as SettingsPanel,
2038
+ Fa as SettingsPanelItemTemplate,
2039
+ Aa as ShareOptionIcon,
2040
+ za as SimpleForm,
2041
+ Cn as SimpleFormDialog,
2042
+ Pa as SizeSlider,
2043
+ Io as StackedThumbnails,
2044
+ _a as StyledLink,
2045
+ Ja as SubtasksManagerWrapper,
2046
+ rn as SupportBubble,
2047
+ hn as SyncButton,
2048
+ xa as TEAM_KEY_PREFIX,
2049
+ Na as TableGridSwitch,
2050
+ kn as TableSearch,
2051
+ fn as TableSettingsFallback,
2052
+ Fo as Thumbnail,
2053
+ vn as ThumbnailSimple,
2054
+ La as USER_KEY_PREFIX,
2055
+ Ma as UploadVersionDialog,
2056
+ ao as UserImage,
2057
+ Qt as VersionUploadContext,
2058
+ Js as VersionUploadProvider,
2059
+ Ao as Watchers,
2060
+ bo as buildChildrenDetails,
2061
+ wo as buildEntityLabel,
2062
+ yo as buildExpectedCounts,
2063
+ na as buildScopes,
2064
+ we as customRangeOption,
2065
+ oo as dateOptions,
2066
+ no as datePresetOptions,
2067
+ ro as detectRelativeDatePattern,
2068
+ lo as filterDateFunctions,
2069
+ io as generateDateOptions,
2070
+ ye as generateDatePresetOptions,
2071
+ Zo as getGroupedReviewables,
2072
+ Ba as getUiTypeLabel,
2073
+ Jt as parseFilename,
2074
+ oa as splitClientFiltersByScope,
2075
+ aa as splitFiltersByScope,
2076
+ vo as sumExpectedCounts,
2077
+ sa as useBuildFilterOptions,
2078
+ bn as useDateRangeFilter,
2079
+ ln as useFeedback,
2080
+ cn as useFeedbackSafe,
2081
+ Dn as useOptionalVersionUploadContext,
2082
+ Po as useReviewablesUpload,
2083
+ Vn as useVersionUploadContext
1658
2084
  };