@ynput/ayon-frontend-shared 0.4.7 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/DetailsPanel.es.js +684 -649
  2. package/dist/Feed.es.js +22 -22
  3. package/dist/ListTable.es.js +78 -67
  4. package/dist/ProjectTreeTable.es.js +2185 -2132
  5. package/dist/Slicer.es.js +152 -120
  6. package/dist/Views.es.js +1 -1
  7. package/dist/api.es.js +332 -329
  8. package/dist/chunks/Actions.es.js +7 -7
  9. package/dist/chunks/ColumnDropIndicator.es.js +127 -241
  10. package/dist/chunks/DeleteEntitiesContext.es.js +109 -109
  11. package/dist/chunks/DetailsDialog.es.js +3 -3
  12. package/dist/chunks/DetailsPanelContext.es.js +155 -0
  13. package/dist/chunks/EntityPath.es.js +40 -40
  14. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  15. package/dist/chunks/EntityTooltip.es.js +3 -3
  16. package/dist/chunks/EntityUpdatesContext.es.js +1 -1
  17. package/dist/chunks/Feed.es.js +2208 -2611
  18. package/dist/chunks/FilterErrorActions.es.js +5 -5
  19. package/dist/chunks/GlobalContext.es.js +21 -21
  20. package/dist/chunks/InfoMessage.es.js +146 -0
  21. package/dist/chunks/Menu.es.js +6 -6
  22. package/dist/chunks/MenuContext.es.js +51 -240
  23. package/dist/chunks/MenuItem.es.js +1 -1
  24. package/dist/chunks/MetaWidget.es.js +3211 -3761
  25. package/dist/chunks/NewEntityContext.es.js +539 -544
  26. package/dist/chunks/PlayableIcon.es.js +4261 -1163
  27. package/dist/chunks/ProjectContext.es.js +2 -2
  28. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  29. package/dist/chunks/RepresentationsList.es.js +3 -3
  30. package/dist/chunks/ReviewablesSelector.es.js +396 -384
  31. package/dist/chunks/SimpleForm.es.js +9 -9
  32. package/dist/chunks/SimpleTable.es.js +286 -283
  33. package/dist/chunks/Slicer.es.js +1129 -689
  34. package/dist/chunks/TableSettingsFallback.es.js +6 -6
  35. package/dist/chunks/ThumbnailSimple.es.js +410 -61
  36. package/dist/chunks/VersionUploadContext.es.js +30 -30
  37. package/dist/chunks/ViewsContext.es.js +97 -97
  38. package/dist/chunks/Watchers.es.js +628 -598
  39. package/dist/chunks/entityDefinitions.es.js +276 -134
  40. package/dist/chunks/expandRelativeDates.es.js +27 -0
  41. package/dist/chunks/getBundleMode.es.js +16 -61
  42. package/dist/chunks/getUris.es.js +329 -322
  43. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  44. package/dist/chunks/searchTerms.es.js +186 -173
  45. package/dist/chunks/uriUtils.es.js +48 -0
  46. package/dist/chunks/useAttributeEnums.es.js +69 -61
  47. package/dist/chunks/useColumnDragRestriction.es.js +37 -27
  48. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  49. package/dist/chunks/useLocalStorage.es.js +8 -8
  50. package/dist/chunks/useSessionStorage.es.js +61 -0
  51. package/dist/chunks/viewUpdateHelper.es.js +8 -8
  52. package/dist/components.es.js +199 -194
  53. package/dist/context.es.js +60 -58
  54. package/dist/hooks.es.js +108 -101
  55. package/dist/index.es.js +20 -14
  56. package/dist/types/Actions.d.ts +16 -16
  57. package/dist/types/ContextMenu.d.ts +16 -16
  58. package/dist/types/DetailsPanel.d.ts +22 -16
  59. package/dist/types/EntityPickerDialog.d.ts +16 -16
  60. package/dist/types/Feed.d.ts +16 -16
  61. package/dist/types/ListTable.d.ts +16 -16
  62. package/dist/types/NewEntity.d.ts +16 -16
  63. package/dist/types/ProjectTreeTable.d.ts +48 -22
  64. package/dist/types/RepresentationsList.d.ts +19 -16
  65. package/dist/types/SimpleTable.d.ts +17 -16
  66. package/dist/types/Slicer.d.ts +119 -34
  67. package/dist/types/Views.d.ts +17 -17
  68. package/dist/types/api.d.ts +404 -95
  69. package/dist/types/components.d.ts +86 -25
  70. package/dist/types/context.d.ts +60 -17
  71. package/dist/types/hooks.d.ts +16 -16
  72. package/dist/types/index.d.ts +16 -16
  73. package/dist/types/util.d.ts +16 -16
  74. package/dist/util.es.js +108 -97
  75. package/package.json +26 -13
  76. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  77. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -2,26 +2,26 @@ import { jsx as o, jsxs as e, Fragment as n } from "react/jsx-runtime";
2
2
  import { R as c, P as l } from "./ReviewablesSelector.es.js";
3
3
  import "react";
4
4
  import "@ynput/ayon-react-components";
5
- import { u as m } from "./useLocalStorage.es.js";
5
+ import { a as m } from "./useLocalStorage.es.js";
6
6
  const P = ({
7
7
  requiredVersion: r,
8
8
  feature: t,
9
- button: i,
10
- children: a
9
+ button: a,
10
+ children: i
11
11
  }) => {
12
12
  const { setPowerpackDialog: s } = m();
13
13
  return r ? /* @__PURE__ */ o(c, { requiredVersion: r }) : /* @__PURE__ */ e(n, { children: [
14
- !!i && /* @__PURE__ */ o(
14
+ !!a && /* @__PURE__ */ o(
15
15
  l,
16
16
  {
17
17
  style: { width: "100%" },
18
18
  icon: "add",
19
19
  variant: "filled",
20
- ...i,
20
+ ...a,
21
21
  feature: t
22
22
  }
23
23
  ),
24
- /* @__PURE__ */ o("div", { onClick: () => s(t), children: a })
24
+ /* @__PURE__ */ o("div", { onClick: () => s(t), children: i })
25
25
  ] });
26
26
  };
27
27
  export {
@@ -1,63 +1,407 @@
1
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { Dialog as S, FormRow as m, InputDate as u, SaveButton as k, Icon as j } from "@ynput/ayon-react-components";
3
- import d from "styled-components";
4
- import { format as p, parse as h } from "date-fns";
5
- import "lodash";
1
+ import { jsx as s, jsxs as g } from "react/jsx-runtime";
2
+ import { createPortal as te } from "react-dom";
3
+ import { useMemo as b, createContext as ie, useState as _, useContext as ne, useEffect as oe } from "react";
4
+ import { aQ as D } from "./searchTerms.es.js";
5
+ import { bf as ae, C as se, bi as re, aE as ce, dd as le, aR as de, aL as ue, a_ as me, K as pe, bA as ye, bh as fe, bs as ge } from "./getUris.es.js";
6
6
  import "primereact/confirmdialog";
7
+ import { union as ve, isEqual as he } from "lodash";
8
+ import { e as xe } from "./expandRelativeDates.es.js";
9
+ import { u as be } from "./DetailsPanelContext.es.js";
10
+ import { U as we } from "./PlayableIcon.es.js";
11
+ import y, { keyframes as Te } from "styled-components";
12
+ import { Icon as P, Dialog as ke, FormRow as I, InputDate as j, SaveButton as Me } from "@ynput/ayon-react-components";
13
+ import { a as _e } from "./EntityTooltip.es.js";
14
+ import { format as L, parse as R } from "date-fns";
7
15
  import "react-toastify";
8
16
  import "uuid";
9
- import { g as E } from "./getThumbnailUrl.es.js";
10
- import "./searchTerms.es.js";
11
- const B = d.div`
17
+ import { g as Ne } from "./getThumbnailUrl.es.js";
18
+ const Ae = ({
19
+ entities: e,
20
+ filter: t,
21
+ backendFilter: i,
22
+ activityTypes: n,
23
+ projectName: r,
24
+ entityType: c
25
+ }) => {
26
+ const o = b(
27
+ () => e.map((p) => ({ id: p.id, projectName: p.projectName, entityType: c })),
28
+ [e]
29
+ ).map((p) => p.id), a = !e.length || !t || !n || !r, f = {
30
+ entityIds: o,
31
+ projectName: r,
32
+ referenceTypes: ["origin", "mention", "relation"],
33
+ activityTypes: n,
34
+ activityFilter: i,
35
+ filter: t
36
+ };
37
+ let {
38
+ data: u,
39
+ isLoading: l,
40
+ isFetchingNextPage: h,
41
+ currentData: v,
42
+ fetchNextPage: w,
43
+ hasNextPage: x
44
+ } = ae(f, { skip: a });
45
+ const T = b(() => u?.pages ? u.pages.flatMap((p) => p.activities || []) : [], [u?.pages]), k = b(() => v?.pages ? v.pages.flatMap((p) => p.activities || []) : [], [v?.pages]), N = async () => {
46
+ if (!x) {
47
+ console.log("No more activities to load");
48
+ return;
49
+ }
50
+ return console.log("loading next page..."), await w();
51
+ }, A = b(() => {
52
+ if (!l) return !1;
53
+ const p = ve(
54
+ k?.flatMap((M) => M.entityId ? M.entityId : [])
55
+ );
56
+ return !he(p, o);
57
+ }, [k, o, l]);
58
+ return a && (l = !0), {
59
+ activitiesData: T,
60
+ isLoadingActivities: l,
61
+ isLoadingNew: A,
62
+ isLoadingNextPage: h,
63
+ hasNextPage: x,
64
+ loadNextPage: N
65
+ };
66
+ }, Ee = new Set(Object.keys(se).filter((e) => e !== "activity")), Ce = {
67
+ has_attachments: "activity_data.files",
68
+ // not `entity_type`: on inbox rows that column is always 'user'
69
+ origin_type: "activity_data.origin.type"
70
+ }, Fe = (e) => !!e && "key" in e, Ie = (e) => {
71
+ const t = Ce[e.key] ?? e.key;
72
+ if (e.key === "has_attachments")
73
+ return e.value ? { key: t, operator: "ne", value: [] } : null;
74
+ if (e.key === "in_review_session")
75
+ return e.value ? { key: "activity_data.entityList", operator: "notnull" } : null;
76
+ if (e.key === "category") {
77
+ const i = Array.isArray(e.value) ? e.value : [], n = i.includes("__none__"), r = i.filter((o) => o !== "__none__"), c = {
78
+ operator: "or",
79
+ conditions: [
80
+ { key: "activity_data.category", operator: "isnull" },
81
+ { key: "activity_data.category", operator: "eq", value: "" }
82
+ ]
83
+ }, d = {
84
+ key: "activity_data.category",
85
+ operator: "in",
86
+ value: r
87
+ };
88
+ return n && r.length ? { operator: "or", conditions: [c, d] } : n ? c : r.length ? d : null;
89
+ }
90
+ return e.key === "body" && e.operator === "like" && typeof e.value == "string" ? { ...e, key: t, value: `%${e.value}%` } : e.key === "author" ? {
91
+ operator: "or",
92
+ conditions: [
93
+ { ...e, key: "activity_data.author" },
94
+ { ...e, key: "activity_data.assignee" }
95
+ ]
96
+ } : { ...e, key: t };
97
+ }, z = (e) => {
98
+ if (Fe(e))
99
+ return Ee.has(e.key) ? null : Ie(e);
100
+ const t = (e.conditions || []).map((i) => z(i)).filter((i) => i !== null);
101
+ return t.length === 0 ? null : { operator: e.operator || "and", conditions: t };
102
+ }, je = (e) => {
103
+ if (!e || !e.conditions?.length) return null;
104
+ const t = xe(e), i = z(t);
105
+ return i || null;
106
+ }, Le = (e) => {
107
+ const t = je(e);
108
+ if (t)
109
+ return JSON.stringify(t);
110
+ }, pt = "__new__", U = ie(void 0), yt = ({ children: e, ...t }) => {
111
+ const { isGuest: i } = be(), { data: n = [] } = re({ projects: [t.projectName] }), { data: r = [] } = D.useGetTeamsQuery(
112
+ { projectName: t.projectName, showMembers: !0 },
113
+ { skip: !t.projectName }
114
+ ), c = b(
115
+ () => r.filter((m) => m.members?.some((ee) => ee.name === t.userName)).map((m) => m.name),
116
+ [r, t.userName]
117
+ ), [d, o] = _({
118
+ operator: "and",
119
+ conditions: []
120
+ }), [a, f] = _(""), u = t.feedFilter ?? d, l = t.setFeedFilter ?? o, [h, v] = _(null), [w, x] = _(null), [T, { isLoading: k }] = ce(), [N, { isLoading: A }] = le(), [p, { isLoading: M }] = de(), G = k || A || M, B = async (m) => await T(m).unwrap(), O = async (m) => await N(m).unwrap(), K = async (m) => await p(m).unwrap(), [q] = ue(), [Y] = me(), W = async (m) => await q(m).unwrap(), H = async (m) => await Y(m).unwrap(), C = pe(u), F = b(() => Le(u), [u]), J = Ae({
121
+ entities: t.entities,
122
+ filter: u,
123
+ backendFilter: F,
124
+ activityTypes: C,
125
+ projectName: t.projectName,
126
+ entityType: t.entityType
127
+ }), { data: V = {} } = ye(
128
+ {
129
+ suggestRequest: {
130
+ entityType: t.entityType,
131
+ entityId: t.entities[0]?.id
132
+ },
133
+ projectName: t.projectName
134
+ },
135
+ { skip: !h }
136
+ ), { data: X = [] } = fe({
137
+ projectName: t.projectName
138
+ }), { data: Z } = ge(
139
+ {
140
+ projectName: t.projectName,
141
+ entityIds: t.entities.map((m) => m.id)
142
+ },
143
+ { skip: !t.projectName || !t.entities.length }
144
+ );
145
+ return /* @__PURE__ */ s(
146
+ U.Provider,
147
+ {
148
+ value: {
149
+ ...t,
150
+ ...J,
151
+ mentionSuggestionsData: V,
152
+ categories: X,
153
+ checklistCount: Z,
154
+ users: n,
155
+ isUpdatingActivity: G,
156
+ userTeamNames: c,
157
+ refTooltip: w,
158
+ activityTypes: C,
159
+ feedFilter: u,
160
+ setFeedFilter: l,
161
+ backendFilter: F,
162
+ searchText: a,
163
+ setSearchText: f,
164
+ isGuest: i,
165
+ editingId: h,
166
+ setEditingId: v,
167
+ setRefTooltip: x,
168
+ // Query functions
169
+ createEntityActivity: B,
170
+ updateActivity: O,
171
+ deleteActivity: K,
172
+ createReaction: W,
173
+ deleteReaction: H
174
+ },
175
+ children: e
176
+ }
177
+ );
178
+ }, E = () => {
179
+ const e = ne(U);
180
+ if (!e)
181
+ throw new Error("useFeedContext must be used within a FeedProvider");
182
+ return e;
183
+ }, Re = () => {
184
+ const { refTooltip: e, setRefTooltip: t } = E();
185
+ return [e, (n) => {
186
+ n && n.id !== e?.id && t(n), n || t(null);
187
+ }];
188
+ }, Se = y.span`
189
+ display: flex;
190
+ align-items: center;
191
+ gap: var(--base-gap-large);
192
+
193
+ .thumbnail {
194
+ width: ${({ $size: e }) => e}px;
195
+ height: ${({ $size: e }) => e}px;
196
+
197
+ .icon {
198
+ font-size: ${({ $size: e }) => Math.round(e * 0.58)}px;
199
+ }
200
+ }
201
+
202
+ span {
203
+ white-space: nowrap;
204
+ }
205
+ `, De = y.span`
206
+ display: flex;
207
+ flex-direction: column;
208
+
209
+ .label {
210
+ color: var(--md-sys-color-outline);
211
+ font-size: 0.85em;
212
+ }
213
+ `, $ = ({ name: e, fullName: t, showSubtitle: i, size: n = 24 }) => /* @__PURE__ */ g(Se, { $size: n, children: [
214
+ /* @__PURE__ */ s(we, { name: e, size: n }),
215
+ i ? /* @__PURE__ */ g(De, { children: [
216
+ /* @__PURE__ */ s("span", { children: t || e }),
217
+ t && /* @__PURE__ */ s("span", { className: "label", children: e })
218
+ ] }) : /* @__PURE__ */ s("span", { children: t || e })
219
+ ] }), Pe = Te`
220
+ from {
221
+ opacity: 0.4;
222
+ scale: 0.9;
223
+ }
224
+ to {
225
+ opacity: 1;
226
+ scale: 1;
227
+ }
228
+ `, Q = y.span`
229
+ display: flex;
230
+ padding: 8px;
231
+ gap: var(--base-gap-large);
232
+ z-index: 100;
233
+ align-items: center;
234
+
235
+ background-color: var(--md-sys-color-surface-container-high);
236
+ border-radius: var(--border-radius-m);
237
+
238
+ position: fixed;
239
+ transform: translate(-50%, calc(-100% - 4px));
240
+ box-shadow: 0 0px 4px rgba(0, 0, 0, 0.2);
241
+ z-index: 9999;
242
+
243
+ .thumbnail {
244
+ width: 40px;
245
+ height: 40px;
246
+
247
+ .icon {
248
+ font-size: 24px;
249
+ }
250
+ }
251
+
252
+ animation: ${Pe} 50ms ease-out;
253
+ transform-origin: left bottom;
254
+ `, ze = ({ name: e, label: t, pos: i }) => /* @__PURE__ */ s(Q, { style: { ...i }, children: /* @__PURE__ */ s($, { name: e || "", fullName: t, showSubtitle: !0, size: 32 }) }), Ue = y(Q)`
255
+ flex-direction: column;
256
+ align-items: flex-start;
257
+ gap: 8px;
258
+ min-width: 180px;
259
+ `, $e = y.span`
260
+ display: flex;
261
+ align-items: center;
262
+ gap: var(--base-gap-large);
263
+
264
+ .icon {
265
+ font-size: 20px;
266
+ }
267
+ `, Qe = y.span`
268
+ display: flex;
269
+ flex-direction: column;
270
+
271
+ span {
272
+ white-space: nowrap;
273
+ }
274
+
275
+ .label {
276
+ color: var(--md-sys-color-outline);
277
+ font-size: 0.85em;
278
+ }
279
+ `, Ge = y.ul`
280
+ list-style: none;
281
+ margin: 0;
282
+ padding: 0;
283
+ display: flex;
284
+ flex-direction: column;
285
+ gap: 4px;
286
+ width: 100%;
287
+ `, Be = y.li`
288
+ display: flex;
289
+ align-items: center;
290
+ `, Oe = y.span`
291
+ color: var(--md-sys-color-outline);
292
+ font-size: 0.85em;
293
+ padding-left: 32px;
294
+ `, S = 5, Ke = ({ name: e, pos: t }) => {
295
+ const { projectName: i, users: n } = E(), { data: r = [] } = D.useGetTeamsQuery(
296
+ { projectName: i, showMembers: !0 },
297
+ { skip: !i || !e }
298
+ ), c = r.find((l) => l.name === e), d = c?.members ?? [], o = c?.memberCount ?? 0, a = d.slice(0, S), f = Math.max(0, o - S), u = new Map(n.map((l) => [l.name, l.attrib?.fullName || void 0]));
299
+ return /* @__PURE__ */ g(Ue, { style: { ...t }, children: [
300
+ /* @__PURE__ */ g($e, { children: [
301
+ /* @__PURE__ */ s(P, { icon: "group" }),
302
+ /* @__PURE__ */ g(Qe, { children: [
303
+ /* @__PURE__ */ s("span", { children: e }),
304
+ c && /* @__PURE__ */ g("span", { className: "label", children: [
305
+ o,
306
+ " ",
307
+ o === 1 ? "member" : "members"
308
+ ] })
309
+ ] })
310
+ ] }),
311
+ a.length > 0 && /* @__PURE__ */ g(Ge, { children: [
312
+ a.map((l) => /* @__PURE__ */ s(Be, { children: /* @__PURE__ */ s(
313
+ $,
314
+ {
315
+ name: l.name,
316
+ fullName: u.get(l.name),
317
+ size: 20
318
+ }
319
+ ) }, l.name)),
320
+ f > 0 && /* @__PURE__ */ g(Oe, { children: [
321
+ "+",
322
+ f,
323
+ " more"
324
+ ] })
325
+ ] })
326
+ ] });
327
+ }, qe = ({ type: e, id: t, pos: i }) => {
328
+ const { projectInfo: n, projectName: r } = E();
329
+ return /* @__PURE__ */ s(
330
+ _e,
331
+ {
332
+ entityType: e,
333
+ entityId: t,
334
+ projectName: r,
335
+ projectInfo: n,
336
+ pos: i
337
+ }
338
+ );
339
+ }, ft = () => {
340
+ const [e, t] = Re(), { type: i, label: n, name: r, pos: c, id: d } = e || {}, o = document.querySelector(".feed ul");
341
+ return oe(() => {
342
+ if (d) {
343
+ const a = (f) => {
344
+ const u = f.target, l = CSS.escape(`ref-${d.replaceAll(".", "-")}`), h = u?.closest(`#${l}`), v = u?.closest("[data-mention-value], .reference");
345
+ !h && !v && (t(null), document.removeEventListener("mouseover", a), o && o.removeEventListener("scroll", a));
346
+ };
347
+ return document.addEventListener("mouseover", a), o && o.addEventListener("scroll", a), () => {
348
+ document.removeEventListener("mouseover", a), o && o.removeEventListener("scroll", a);
349
+ };
350
+ }
351
+ }, [d, t, o]), d ? te(
352
+ i === "user" && c ? /* @__PURE__ */ s(ze, { name: r, label: n, pos: c }) : i === "team" && c ? /* @__PURE__ */ s(Ke, { name: r, pos: c }) : /* @__PURE__ */ s(qe, { type: i, label: n, name: r, pos: c, id: d }),
353
+ document.body
354
+ ) : null;
355
+ }, Ye = y.div`
12
356
  display: flex;
13
357
  flex-direction: column;
14
358
  gap: 12px;
15
- `, G = ({
16
- isOpen: l,
359
+ `, gt = ({
360
+ isOpen: e,
17
361
  header: t,
18
- startDate: o,
19
- endDate: e,
362
+ startDate: i,
363
+ endDate: n,
20
364
  onStartDateChange: r,
21
- onEndDateChange: s,
22
- onApply: c,
23
- onClose: a
24
- }) => /* @__PURE__ */ n(
25
- S,
365
+ onEndDateChange: c,
366
+ onApply: d,
367
+ onClose: o
368
+ }) => /* @__PURE__ */ s(
369
+ ke,
26
370
  {
27
- isOpen: l,
28
- onClose: a,
371
+ isOpen: e,
372
+ onClose: o,
29
373
  header: t,
30
374
  size: "sm",
31
375
  hideCancelButton: !0,
32
- footer: /* @__PURE__ */ n(
33
- k,
376
+ footer: /* @__PURE__ */ s(
377
+ Me,
34
378
  {
35
379
  label: "Confirm",
36
380
  icon: "check",
37
- onClick: c,
38
- active: !!o && !!e && e >= o
381
+ onClick: d,
382
+ active: !!i && !!n && n >= i
39
383
  }
40
384
  ),
41
- children: /* @__PURE__ */ y(B, { children: [
42
- /* @__PURE__ */ n(m, { label: "Start date", children: /* @__PURE__ */ n(
43
- u,
385
+ children: /* @__PURE__ */ g(Ye, { children: [
386
+ /* @__PURE__ */ s(I, { label: "Start date", children: /* @__PURE__ */ s(
387
+ j,
44
388
  {
45
- selected: o ? h(o, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
46
- onChange: (i) => r(i ? p(i, "yyyy-MM-dd") : ""),
389
+ selected: i ? R(i, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
390
+ onChange: (a) => r(a ? L(a, "yyyy-MM-dd") : ""),
47
391
  autoFocus: !0
48
392
  }
49
393
  ) }),
50
- /* @__PURE__ */ n(m, { label: "End date", children: /* @__PURE__ */ n(
51
- u,
394
+ /* @__PURE__ */ s(I, { label: "End date", children: /* @__PURE__ */ s(
395
+ j,
52
396
  {
53
- selected: e ? h(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
54
- onChange: (i) => s(i ? p(i, "yyyy-MM-dd") : ""),
55
- openToDate: o ? new Date(o) : void 0
397
+ selected: n ? R(n, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
398
+ onChange: (a) => c(a ? L(a, "yyyy-MM-dd") : ""),
399
+ openToDate: i ? new Date(i) : void 0
56
400
  }
57
401
  ) })
58
402
  ] })
59
403
  }
60
- ), z = d.div`
404
+ ), We = y.div`
61
405
  position: relative;
62
406
  width: 100%;
63
407
  max-width: 500px;
@@ -79,7 +423,7 @@ const B = d.div`
79
423
  background-color: hsl(220 20% 8%);
80
424
  color: var(--md-sys-color-outline);
81
425
  }
82
- `, F = d.img`
426
+ `, He = y.img`
83
427
  width: 100%;
84
428
  height: 100%;
85
429
  object-fit: contain;
@@ -88,41 +432,46 @@ const B = d.div`
88
432
  display: block;
89
433
  position: absolute;
90
434
  inset: 0;
91
- `, H = ({
92
- projectName: l,
435
+ `, vt = ({
436
+ projectName: e,
93
437
  entityType: t,
94
- entityId: o,
95
- icon: e,
438
+ entityId: i,
439
+ icon: n,
96
440
  thumbnailHash: r,
97
- isLoading: s,
98
- className: c,
99
- disabled: a,
100
- src: i,
101
- onLoad: g,
102
- onError: f,
103
- iconOnly: b,
104
- ...v
441
+ isLoading: c,
442
+ className: d,
443
+ disabled: o,
444
+ src: a,
445
+ onLoad: f,
446
+ onError: u,
447
+ iconOnly: l,
448
+ ...h
105
449
  }) => {
106
- const w = E({
107
- projectName: l,
450
+ const v = Ne({
451
+ projectName: e,
108
452
  entityType: t,
109
- entityId: o,
453
+ entityId: i,
110
454
  thumbnailHash: r ? String(r) : void 0
111
- }), x = t === "project", M = ["product"].includes(t), C = x ? !!l : !!o;
112
- return /* @__PURE__ */ y(z, { className: c + " thumbnail", ...v, children: [
113
- !s && !a && /* @__PURE__ */ n(j, { icon: e || "image" }),
114
- (t && !M && C || i) && !b && /* @__PURE__ */ n(
115
- F,
455
+ }), w = t === "project", x = ["product"].includes(t), T = w ? !!e : !!i;
456
+ return /* @__PURE__ */ g(We, { className: d + " thumbnail", ...h, children: [
457
+ !c && !o && /* @__PURE__ */ s(P, { icon: n || "image" }),
458
+ (t && !x && T || a) && !l && /* @__PURE__ */ s(
459
+ He,
116
460
  {
117
- alt: `Entity thumbnail ${o || l}`,
118
- src: i || w || void 0,
119
- onLoad: g,
120
- onError: f
461
+ alt: `Entity thumbnail ${i || e}`,
462
+ src: a || v || void 0,
463
+ onLoad: f,
464
+ onError: u
121
465
  }
122
466
  )
123
467
  ] });
124
468
  };
125
469
  export {
126
- G as C,
127
- H as T
470
+ ft as A,
471
+ gt as C,
472
+ pt as F,
473
+ vt as T,
474
+ yt as a,
475
+ Re as b,
476
+ E as u
128
477
  };