@ynput/ayon-frontend-shared 0.7.6 → 0.8.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 (70) hide show
  1. package/dist/DetailsPanel.es.js +361 -355
  2. package/dist/Feed.es.js +1 -1
  3. package/dist/ListTable.es.js +18 -18
  4. package/dist/NewEntity.es.js +30 -30
  5. package/dist/ProjectTreeTable.es.js +984 -974
  6. package/dist/ProjectsTable.es.js +3 -3
  7. package/dist/Slicer.es.js +53 -50
  8. package/dist/Views.es.js +150 -151
  9. package/dist/api.es.js +166 -165
  10. package/dist/chunks/Actions.es.js +9 -10
  11. package/dist/chunks/ColumnDropIndicator.es.js +2 -2
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +3 -4
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
  14. package/dist/chunks/DetailsDialog.es.js +3 -3
  15. package/dist/chunks/EmptyPlaceholder.es.js +7 -7
  16. package/dist/chunks/EntityPath.es.js +38 -39
  17. package/dist/chunks/EntityPickerDialog.es.js +65 -66
  18. package/dist/chunks/EntityTooltip.es.js +18 -19
  19. package/dist/chunks/Feed.es.js +1381 -1355
  20. package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
  21. package/dist/chunks/FilterErrorActions.es.js +2 -3
  22. package/dist/chunks/GroupSettingsFallback.es.js +2 -2
  23. package/dist/chunks/Menu.es.js +52 -53
  24. package/dist/chunks/MetaWidget.es.js +1948 -1875
  25. package/dist/chunks/ProjectFoldersContext.es.js +40 -40
  26. package/dist/chunks/RepresentationsList.es.js +1 -1
  27. package/dist/chunks/ReviewablesSelector.es.js +759 -742
  28. package/dist/chunks/SimpleTable.es.js +2 -1
  29. package/dist/chunks/Slicer.es.js +49 -50
  30. package/dist/chunks/TableExportContextInstance.es.js +600 -402
  31. package/dist/chunks/TableSettingsFallback.es.js +3 -4
  32. package/dist/chunks/ThumbnailSimple.es.js +114 -99
  33. package/dist/chunks/VideoPlayer.es.js +8 -9
  34. package/dist/chunks/Watchers.es.js +928 -871
  35. package/dist/chunks/expandRelativeDates.es.js +1 -1
  36. package/dist/chunks/getThumbnailUrl.es.js +33 -21
  37. package/dist/chunks/getUris.es.js +1580 -1610
  38. package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
  39. package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
  40. package/dist/chunks/searchTerms.es.js +773 -696
  41. package/dist/chunks/useAttributeEnums.es.js +22 -22
  42. package/dist/chunks/useDateRangeFilter.es.js +1 -1
  43. package/dist/chunks/useHierarchySelection.es.js +3 -4
  44. package/dist/chunks/useLoadModule.es.js +3 -4
  45. package/dist/components.es.js +475 -467
  46. package/dist/context.es.js +615 -540
  47. package/dist/hooks.es.js +193 -171
  48. package/dist/index.es.js +2 -2
  49. package/dist/types/Actions.d.ts +10 -8
  50. package/dist/types/DetailsPanel.d.ts +54 -76
  51. package/dist/types/EntityPickerDialog.d.ts +12 -6
  52. package/dist/types/Feed.d.ts +24 -24
  53. package/dist/types/ListTable.d.ts +33 -27
  54. package/dist/types/NewEntity.d.ts +26 -39
  55. package/dist/types/ProjectTreeTable.d.ts +199 -195
  56. package/dist/types/ProjectsTable.d.ts +6 -6
  57. package/dist/types/RepresentationsList.d.ts +4 -0
  58. package/dist/types/Slicer.d.ts +63 -246
  59. package/dist/types/Views.d.ts +71 -298
  60. package/dist/types/api.d.ts +3164 -2363
  61. package/dist/types/components.d.ts +327 -474
  62. package/dist/types/context.d.ts +285 -572
  63. package/dist/types/hooks.d.ts +76 -47
  64. package/dist/types/index.d.ts +6 -0
  65. package/dist/types/util.d.ts +141 -120
  66. package/dist/util.es.js +71 -68
  67. package/package.json +6 -6
  68. package/dist/chunks/EntityUpdatesContext.es.js +0 -61
  69. package/dist/chunks/PlayableIcon.es.js +0 -5020
  70. package/dist/chunks/viewUpdateHelper.es.js +0 -153
@@ -1,55 +1,54 @@
1
- import { jsx as l, jsxs as k, Fragment as Ce } from "react/jsx-runtime";
2
- import en, { useMemo as S, useState as L, useEffect as G, lazy as vo, Suspense as bo, useCallback as qe, useRef as ge, forwardRef as ft, useId as wo, Fragment as xo } from "react";
3
- import { v4 as wn } from "uuid";
4
- import ee, { clsx as xn } from "clsx";
5
- import kn from "react-markdown";
6
- import An from "remark-emoji";
7
- import Fn from "remark-gfm";
8
- import ko from "remark-directive";
9
- import Ao from "remark-directive-rehype";
10
- import { toast as Fe } from "react-toastify";
11
- import { $createListItemNode as Fo, $createListNode as Co } from "@lexical/list";
12
- import { $getRoot as To } from "lexical";
13
- import { Button as ct, Dialog as Do, getFileSizeString as No, Icon as se, theme as Cn, getTextColor as _t, Dropdown as So, SaveButton as Io, UserImage as Tn, SEARCH_FILTER_ID as Dn, buildFilterId as tn, getFilterFromId as Eo, SearchFilter as Mo } from "@ynput/ayon-react-components";
14
- import { _ as Po, a1 as Nn, a2 as _o, H as Ro, a3 as Lo, a4 as nn, a5 as $o, a6 as Oo, a7 as Vo, y as jo, a8 as Uo, a9 as zo, aa as Bo, ab as Go, ac as Ho, ad as qo, ae as Wo, af as Qo, ag as Yo, ah as Jo, ai as Ko, O as Rt, W as Sn, T as Xo, aj as Zo, ak as ea, al as ta, am as na, an as oa, ao as aa, ap as ra, aq as on, ar as ia, b as sa, c as ca, i as la, as as da, S as ua, e as ma, L as pa } from "./PlayableIcon.es.js";
1
+ import { jsx as c, jsxs as x, Fragment as Te } from "react/jsx-runtime";
2
+ import nn, { useMemo as I, useState as L, useEffect as W, lazy as xo, Suspense as ko, useCallback as Je, useRef as pe, forwardRef as ft, useId as Ao, Fragment as Fo } from "react";
3
+ import { v4 as xn } from "uuid";
4
+ import ne, { clsx as kn } from "clsx";
5
+ import An from "react-markdown";
6
+ import Fn from "remark-emoji";
7
+ import Cn from "remark-gfm";
8
+ import Co from "remark-directive";
9
+ import To from "remark-directive-rehype";
10
+ import { toast as Ce } from "react-toastify";
11
+ import { $createListItemNode as Do, $createListNode as No } from "@lexical/list";
12
+ import { $getRoot as Io } from "lexical";
13
+ import { Button as st, Dialog as So, getFileSizeString as Eo, Icon as se, theme as Tn, getTextColor as Lt, Dropdown as Mo, SaveButton as Po, UserImage as Dn, SEARCH_FILTER_ID as Nn, buildFilterId as on, getFilterFromId as _o, SearchFilter as Ro } from "@ynput/ayon-react-components";
14
+ import { a8 as Lo, aa as In, ab as $o, P as Oo, ac as Vo, ad as an, ae as jo, af as Uo, ag as zo, J as Bo, ah as Go, ai as Ho, aj as qo, ak as Wo, al as Qo, am as Yo, an as Jo, ao as Ko, ap as Xo, aq as Zo, ar as ea, V as $t, a3 as Sn, a0 as ta, as as na, at as oa, au as aa, av as ra, aw as ia, ax as sa, ay as ca, az as rn, aA as la, b as da, c as ua, i as ma, aB as pa, _ as ga, e as ha, T as fa, S as ya, U as va } from "./FilmstripEntityCard.es.js";
15
15
  import "@lexical/code";
16
16
  import "@lexical/rich-text";
17
17
  import "@lexical/selection";
18
18
  import "@lexical/utils";
19
19
  import "@lexical/react/LexicalBlockWithAlignableContents";
20
20
  import "@lexical/react/LexicalDecoratorBlockNode";
21
- import F, { css as Lt } from "styled-components";
22
- import { C as ga } from "./CodeEditor.es.js";
23
- import { E as St } from "./EmptyPlaceholder.es.js";
21
+ import F, { css as Ot } from "styled-components";
22
+ import { C as ba } from "./CodeEditor.es.js";
23
+ import { E as It } from "./EmptyPlaceholder.es.js";
24
24
  import "./EmptyPlaceholderFlex.styled.es.js";
25
- import { a_ as ha, bt as an } from "./searchTerms.es.js";
26
- import { bk as fa, bn as ya, aJ as va, dn as ba, aW as wa, aQ as xa, b3 as ka, Q as Aa, bF as Fa, bm as Ca, bx as Ta, br as Da, bl as Na, cE as Sa, c1 as Ia } from "./getUris.es.js";
25
+ import { a_ as wa, bs as sn } from "./searchTerms.es.js";
26
+ import { bl as xa, bo as ka, aJ as Aa, dp as Fa, aW as Ca, aQ as Ta, b3 as Da, Q as Na, bG as Ia, bn as Sa, by as Ea, bs as Ma, bm as Pa, cF as _a, c2 as Ra } from "./getUris.es.js";
27
27
  import "primereact/confirmdialog";
28
- import { union as Ea, isEqual as Ma } from "lodash";
29
- import { b as Pa, F as _a, u as $e, a as In, T as Ra, C as La } from "./ThumbnailSimple.es.js";
28
+ import { union as La, isEqual as $a } from "lodash";
29
+ import { b as Oa, F as Va, u as $e, a as En, T as ja, C as Ua } from "./ThumbnailSimple.es.js";
30
30
  import "@module-federation/enhanced/runtime";
31
31
  import "@ynput/ayon-addon/host";
32
- import { x as ze, y as $a, a4 as yt, u as Oa } from "./TableExportContextInstance.es.js";
33
- import $t from "axios";
32
+ import Vt from "axios";
33
+ import { m as Be, q as za, a2 as yt, u as Ba } from "./TableExportContextInstance.es.js";
34
34
  import "semver";
35
35
  import "./ContextMenuContextInstance.es.js";
36
36
  import "react-dom";
37
- import "react-redux";
38
37
  import "react-router-dom";
39
- import { p as be } from "./parseFilename.es.js";
40
- import { b as rn } from "./colorUtils.es.js";
38
+ import { p as ve } from "./parseFilename.es.js";
39
+ import { b as cn } from "./colorUtils.es.js";
41
40
  import "./EntityTooltip.es.js";
42
- import { isValid as lt, isToday as Va, isSameYear as ja, isSameDay as Ua, isSameWeek as za, isSameMinute as Ba, format as sn, formatISO as Ga, differenceInMinutes as Ha, differenceInSeconds as qa, compareAsc as Wa } from "date-fns";
41
+ import { isValid as Ke, isToday as Ga, isSameYear as Ha, isSameDay as qa, isSameWeek as Wa, isSameMinute as Qa, format as St, formatISO as Ya, differenceInMinutes as Ja, differenceInSeconds as Ka, compareAsc as Xa } from "date-fns";
43
42
  import "@ynput/ayon-addon";
44
- import { a as Qa, M as Ya } from "./Menu.es.js";
45
- import { InView as Ja } from "react-intersection-observer";
46
- import { t as Ka, c as Xa } from "./queryFilterToClientFilter.es.js";
47
- import { r as Za, a as er, m as tr, u as nr } from "./useDateRangeFilter.es.js";
43
+ import { a as Za, M as er } from "./Menu.es.js";
44
+ import { InView as tr } from "react-intersection-observer";
45
+ import { t as nr, c as or } from "./queryFilterToClientFilter.es.js";
46
+ import { r as ar, a as rr, m as ir, u as sr } from "./useDateRangeFilter.es.js";
48
47
  import "match-sorter";
49
- import { c as or } from "./confirmDelete.es.js";
50
- import { c as En } from "./copyToClipboard.es.js";
51
- import { g as cn } from "./realtimeUpdatesUtils.es.js";
52
- const ar = ({
48
+ import { c as cr } from "./confirmDelete.es.js";
49
+ import { c as Mn } from "./copyToClipboard.es.js";
50
+ import { g as ln } from "./realtimeUpdatesUtils.es.js";
51
+ const lr = ({
53
52
  entities: e,
54
53
  filter: t,
55
54
  backendFilter: o,
@@ -57,10 +56,10 @@ const ar = ({
57
56
  projectName: a,
58
57
  entityType: r
59
58
  }) => {
60
- const i = S(
61
- () => e.map((b) => ({ id: b.id, projectName: b.projectName, entityType: r })),
59
+ const i = I(
60
+ () => e.map((w) => ({ id: w.id, projectName: w.projectName, entityType: r })),
62
61
  [e]
63
- ).map((b) => b.id), c = !e.length || !t || !n || !a, m = {
62
+ ).map((w) => w.id), l = !e.length || !t || !n || !a, m = {
64
63
  entityIds: i,
65
64
  projectName: a,
66
65
  referenceTypes: ["origin", "mention", "relation"],
@@ -73,23 +72,23 @@ const ar = ({
73
72
  isLoading: g,
74
73
  isFetchingNextPage: u,
75
74
  currentData: h,
76
- fetchNextPage: v,
75
+ fetchNextPage: b,
77
76
  hasNextPage: y
78
- } = fa(m, { skip: c });
79
- const D = S(() => p?.pages ? p.pages.flatMap((b) => b.activities || []) : [], [p?.pages]), P = S(() => h?.pages ? h.pages.flatMap((b) => b.activities || []) : [], [h?.pages]), C = async () => {
77
+ } = xa(m, { skip: l });
78
+ const D = I(() => p?.pages ? p.pages.flatMap((w) => w.activities || []) : [], [p?.pages]), M = I(() => h?.pages ? h.pages.flatMap((w) => w.activities || []) : [], [h?.pages]), C = async () => {
80
79
  if (!y) {
81
80
  console.log("No more activities to load");
82
81
  return;
83
82
  }
84
- return console.log("loading next page..."), await v();
85
- }, f = S(() => {
83
+ return console.log("loading next page..."), await b();
84
+ }, f = I(() => {
86
85
  if (!g) return !1;
87
- const b = Ea(
88
- P?.flatMap((T) => T.entityId ? T.entityId : [])
86
+ const w = La(
87
+ M?.flatMap((A) => A.entityId ? A.entityId : [])
89
88
  );
90
- return !Ma(b, i);
91
- }, [P, i, g]);
92
- return c && (g = !0), {
89
+ return !$a(w, i);
90
+ }, [M, i, g]);
91
+ return l && (g = !0), {
93
92
  activitiesData: D,
94
93
  isLoadingActivities: g,
95
94
  isLoadingNew: f,
@@ -97,24 +96,24 @@ const ar = ({
97
96
  hasNextPage: y,
98
97
  loadNextPage: C
99
98
  };
100
- }, it = "__new__", Ec = ({ children: e, ...t }) => {
101
- const { isGuest: o } = ze(), { data: n = [] } = ya({ projects: [t.projectName] }), { data: a = [] } = ha.useGetTeamsQuery(
99
+ }, rt = "__new__", Mc = ({ children: e, ...t }) => {
100
+ const { isGuest: o } = Be(), { data: n = [] } = ka({ projects: [t.projectName] }), { data: a = [] } = wa.useGetTeamsQuery(
102
101
  { projectName: t.projectName, showMembers: !0 },
103
102
  { skip: !t.projectName }
104
- ), r = S(
105
- () => a.filter((U) => U.members?.some((de) => de.name === t.userName)).map((U) => U.name),
103
+ ), r = I(
104
+ () => a.filter((j) => j.members?.some((de) => de.name === t.userName)).map((j) => j.name),
106
105
  [a, t.userName]
107
106
  ), [s, i] = L({
108
107
  operator: "and",
109
108
  conditions: []
110
- }), [c, m] = L(""), p = t.feedFilter ?? s, g = t.setFeedFilter ?? i, [u, h] = L(null), [v, y] = L(null), [D, { isLoading: P }] = va(), [C, { isLoading: f }] = ba(), [b, { isLoading: T }] = wa(), I = P || f || T, _ = async (U) => await D(U).unwrap(), R = async (U) => await C(U).unwrap(), E = async (U) => await b(U).unwrap(), [N] = xa(), [Q] = ka(), Y = async (U) => await N(U).unwrap(), H = async (U) => await Q(U).unwrap(), J = Aa(p), q = S(() => Pa(p), [p]), $ = ar({
109
+ }), [l, m] = L(""), p = t.feedFilter ?? s, g = t.setFeedFilter ?? i, [u, h] = L(null), [b, y] = L(null), [D, { isLoading: M }] = Aa(), [C, { isLoading: f }] = Fa(), [w, { isLoading: A }] = Ca(), S = M || f || A, P = async (j) => await D(j).unwrap(), _ = async (j) => await C(j).unwrap(), E = async (j) => await w(j).unwrap(), [N] = Ta(), [G] = Da(), X = async (j) => await N(j).unwrap(), Q = async (j) => await G(j).unwrap(), Z = Na(p), Y = I(() => Oa(p), [p]), $ = lr({
111
110
  entities: t.entities,
112
111
  filter: p,
113
- backendFilter: q,
114
- activityTypes: J,
112
+ backendFilter: Y,
113
+ activityTypes: Z,
115
114
  projectName: t.projectName,
116
115
  entityType: t.entityType
117
- }), { data: te = {} } = Fa(
116
+ }), { data: oe = {} } = Ia(
118
117
  {
119
118
  suggestRequest: {
120
119
  entityType: t.entityType,
@@ -123,49 +122,49 @@ const ar = ({
123
122
  projectName: t.projectName
124
123
  },
125
124
  { skip: !u }
126
- ), { data: oe = [] } = Ca({
125
+ ), { data: ae = [] } = Sa({
127
126
  projectName: t.projectName
128
- }), { data: W } = Ta(
127
+ }), { data: J } = Ea(
129
128
  {
130
129
  projectName: t.projectName,
131
- entityIds: t.entities.map((U) => U.id)
130
+ entityIds: t.entities.map((j) => j.id)
132
131
  },
133
132
  { skip: !t.projectName || !t.entities.length }
134
133
  );
135
- return /* @__PURE__ */ l(
136
- _a.Provider,
134
+ return /* @__PURE__ */ c(
135
+ Va.Provider,
137
136
  {
138
137
  value: {
139
138
  ...t,
140
139
  ...$,
141
- mentionSuggestionsData: te,
142
- categories: oe,
143
- checklistCount: W,
140
+ mentionSuggestionsData: oe,
141
+ categories: ae,
142
+ checklistCount: J,
144
143
  users: n,
145
- isUpdatingActivity: I,
144
+ isUpdatingActivity: S,
146
145
  userTeamNames: r,
147
- refTooltip: v,
148
- activityTypes: J,
146
+ refTooltip: b,
147
+ activityTypes: Z,
149
148
  feedFilter: p,
150
149
  setFeedFilter: g,
151
- backendFilter: q,
152
- searchText: c,
150
+ backendFilter: Y,
151
+ searchText: l,
153
152
  setSearchText: m,
154
153
  isGuest: o,
155
154
  editingId: u,
156
155
  setEditingId: h,
157
156
  setRefTooltip: y,
158
157
  // Query functions
159
- createEntityActivity: _,
160
- updateActivity: R,
158
+ createEntityActivity: P,
159
+ updateActivity: _,
161
160
  deleteActivity: E,
162
- createReaction: Y,
163
- deleteReaction: H
161
+ createReaction: X,
162
+ deleteReaction: Q
164
163
  },
165
164
  children: e
166
165
  }
167
166
  );
168
- }, rr = F.div`
167
+ }, dr = F.div`
169
168
  display: grid;
170
169
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
171
170
  gap: var(--base-gap-large);
@@ -181,7 +180,7 @@ const ar = ({
181
180
  301px + var(--padding-s) + var(--padding-s) + var(--base-gap-large)+ var(--base-gap-large)
182
181
  );
183
182
  overflow: auto;
184
- `, ir = F.div`
183
+ `, ur = F.div`
185
184
  position: relative;
186
185
  display: flex;
187
186
  flex-direction: column;
@@ -227,7 +226,7 @@ const ar = ({
227
226
  .download-icon {
228
227
  color: var(--md-sys-color-outline);
229
228
  }
230
- `, sr = F.footer`
229
+ `, mr = F.footer`
231
230
  background-color: var(--md-sys-color-surface-container-low);
232
231
  display: flex;
233
232
  align-items: center;
@@ -327,7 +326,7 @@ const ar = ({
327
326
  }
328
327
  }
329
328
  }
330
- `, cr = F.div`
329
+ `, pr = F.div`
331
330
  position: relative;
332
331
  display: flex;
333
332
  justify-content: center;
@@ -364,7 +363,7 @@ const ar = ({
364
363
  &:hover .image-wrapper::after {
365
364
  opacity: 0.8;
366
365
  }
367
- `, ln = F.div`
366
+ `, dn = F.div`
368
367
  position: absolute;
369
368
  inset: 0;
370
369
  display: flex;
@@ -403,7 +402,7 @@ const ar = ({
403
402
  &.posterError {
404
403
  background-color: transparent;
405
404
  }
406
- `, lr = F.div`
405
+ `, gr = F.div`
407
406
  display: none;
408
407
  position: absolute;
409
408
  left: 0;
@@ -412,7 +411,7 @@ const ar = ({
412
411
  height: calc(100% - 20px);
413
412
  width: 100%;
414
413
  gap: 0;
415
- `, dn = F(ct)`
414
+ `, un = F(st)`
416
415
  height: 100%;
417
416
  width: 100%;
418
417
  border: none;
@@ -423,7 +422,7 @@ const ar = ({
423
422
  background: none;
424
423
  opacity: 1;
425
424
  }
426
- `, dr = F(Po)`
425
+ `, hr = F(Lo)`
427
426
  --icon-size: 32px;
428
427
  top: calc(50% - 10px);
429
428
  left: 50%;
@@ -435,7 +434,7 @@ const ar = ({
435
434
  .icon {
436
435
  font-size: var(--icon-size);
437
436
  }
438
- `, Mc = F(Do)`
437
+ `, Pc = F(So)`
439
438
  min-height: 90vh;
440
439
  max-height: 90vh;
441
440
  min-width: min(90vw, 100%);
@@ -520,7 +519,7 @@ const ar = ({
520
519
  &:focus-visible {
521
520
  outline: none;
522
521
  }
523
- `, ur = F.img`
522
+ `, fr = F.img`
524
523
  height: 100%;
525
524
  width: 100%;
526
525
 
@@ -530,7 +529,7 @@ const ar = ({
530
529
  max-width: 90vw;
531
530
  min-width: 300px;
532
531
  background-color: var(--md-sys-color-surface-container-lowest);
533
- `, Pc = F.div`
532
+ `, _c = F.div`
534
533
  &.scrollable {
535
534
  position: absolute;
536
535
  inset: 56px;
@@ -542,7 +541,7 @@ const ar = ({
542
541
  inset: 56px 0 0 0;
543
542
  display: flex;
544
543
  }
545
- `, un = F.div`
544
+ `, mn = F.div`
546
545
  position: relative;
547
546
  display: flex;
548
547
  flex: 1;
@@ -559,45 +558,45 @@ const ar = ({
559
558
  flex: 1;
560
559
  min-width: 0;
561
560
  }
562
- `, dt = (e, t) => `/api/projects/${t}/files/${e}`, mr = ({
561
+ `, ct = (e, t) => `/api/projects/${t}/files/${e}`, yr = ({
563
562
  file: e,
564
563
  fullPreviews: t = ["png", "jpg", "jpeg", "gif", "svg", "webp"]
565
564
  }) => {
566
565
  const { id: o, projectName: n, mime: a } = e;
567
- let r = dt(o, n);
568
- return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */ l(ur, { src: r, autoFocus: !0 });
569
- }, pr = F(ga)`
566
+ let r = ct(o, n);
567
+ return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */ c(fr, { src: r, autoFocus: !0 });
568
+ }, vr = F(ba)`
570
569
  border-radius: var(--border-radius-m);
571
570
  height: 100%;
572
571
  overflow: auto !important;
573
- `, gr = ({ file: e }) => {
574
- let t = dt(e.id, e.projectName);
572
+ `, br = ({ file: e }) => {
573
+ let t = ct(e.id, e.projectName);
575
574
  const [o, n] = L(""), [a, r] = L(null);
576
- return G(() => {
575
+ return W(() => {
577
576
  (async () => {
578
577
  try {
579
578
  const i = await fetch(t);
580
579
  if (!i.ok)
581
580
  throw new Error(`HTTP error! status: ${i.status}`);
582
- const c = await i.text();
583
- n(c);
581
+ const l = await i.text();
582
+ n(l);
584
583
  } catch (i) {
585
584
  r(i.message);
586
585
  }
587
586
  })();
588
- }, [e.projectName, e.id, t]), a ? /* @__PURE__ */ k("div", { children: [
587
+ }, [e.projectName, e.id, t]), a ? /* @__PURE__ */ x("div", { children: [
589
588
  "Error: ",
590
589
  a
591
- ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ l(kn, { remarkPlugins: [Fn, An], children: o }) : /* @__PURE__ */ l(pr, { value: o, language: e.extension, readOnly: !0 });
592
- }, Mn = () => import("./VideoPlayer.es.js"), hr = vo(Mn), fr = ({ duration: e, width: t, height: o }) => Number.isFinite(e) && e > 0 && t > 0 && o > 0, yr = 1e4, vr = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", br = (e, t) => {
590
+ ] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ c(An, { remarkPlugins: [Cn, Fn], children: o }) : /* @__PURE__ */ c(vr, { value: o, language: e.extension, readOnly: !0 });
591
+ }, Pn = () => import("./VideoPlayer.es.js"), wr = xo(Pn), xr = ({ duration: e, width: t, height: o }) => Number.isFinite(e) && e > 0 && t > 0 && o > 0, kr = 1e4, Ar = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", Fr = (e, t) => {
593
592
  const [o, n] = L({ status: "loading" });
594
- return G(() => {
593
+ return W(() => {
595
594
  n({ status: "loading" });
596
595
  let a = !1, r = null, s;
597
596
  const i = () => {
598
- r && (r.removeEventListener("loadedmetadata", c), r.removeEventListener("error", m), r.removeAttribute("src"), r.load(), r = null);
597
+ r && (r.removeEventListener("loadedmetadata", l), r.removeEventListener("error", m), r.removeAttribute("src"), r.load(), r = null);
599
598
  };
600
- function c() {
599
+ function l() {
601
600
  if (a || !r) return;
602
601
  clearTimeout(s);
603
602
  const u = {
@@ -605,14 +604,14 @@ const ar = ({
605
604
  width: r.videoWidth,
606
605
  height: r.videoHeight
607
606
  };
608
- if (fr(u)) {
607
+ if (xr(u)) {
609
608
  i(), n({ status: "ready", metadata: u });
610
609
  return;
611
610
  }
612
611
  p(`unusable metadata ${JSON.stringify(u)}`);
613
612
  }
614
613
  function m() {
615
- a || (clearTimeout(s), p(vr(r?.error ?? null)));
614
+ a || (clearTimeout(s), p(Ar(r?.error ?? null)));
616
615
  }
617
616
  const p = (u) => {
618
617
  const h = r?.preload === "metadata";
@@ -623,7 +622,7 @@ const ar = ({
623
622
  console.warn(`[VideoMime] video cannot be played: ${u}`, e), n({ status: "error" });
624
623
  };
625
624
  function g(u) {
626
- r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"), yr), r.addEventListener("loadedmetadata", c), r.addEventListener("error", m), r.src = e;
625
+ r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"), kr), r.addEventListener("loadedmetadata", l), r.addEventListener("error", m), r.src = e;
627
626
  }
628
627
  return g("metadata"), () => {
629
628
  a = !0, clearTimeout(s), i();
@@ -639,18 +638,18 @@ const ar = ({
639
638
  codec: t?.codec
640
639
  }
641
640
  };
642
- }, wr = ({ file: e }) => {
643
- const { id: t, projectName: o, name: n, mediaInfo: a } = e, r = dt(t, o), s = br(r, a);
644
- if (G(() => {
645
- Mn();
641
+ }, Cr = ({ file: e }) => {
642
+ const { id: t, projectName: o, name: n, mediaInfo: a } = e, r = ct(t, o), s = Fr(r, a);
643
+ if (W(() => {
644
+ Pn();
646
645
  }, []), s.status === "error")
647
- return /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(St, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ k("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
646
+ return /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ x("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
648
647
  "Download ",
649
648
  n
650
649
  ] }) }) });
651
- const i = /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(St, { icon: "hourglass_empty", message: "Loading video..." }) });
652
- return s.status === "loading" ? i : /* @__PURE__ */ l(bo, { fallback: i, children: /* @__PURE__ */ l(
653
- hr,
650
+ const i = /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "hourglass_empty", message: "Loading video..." }) });
651
+ return s.status === "loading" ? i : /* @__PURE__ */ c(ko, { fallback: i, children: /* @__PURE__ */ c(
652
+ wr,
654
653
  {
655
654
  id: t,
656
655
  name: n,
@@ -663,20 +662,20 @@ const ar = ({
663
662
  codec: s.metadata.codec
664
663
  }
665
664
  ) });
666
- }, xr = {
665
+ }, Tr = {
667
666
  image: {
668
- component: mr,
667
+ component: yr,
669
668
  mimeTypes: ["image/"],
670
669
  fullPreviews: ["png", "jpg", "jpeg", "gif", "svg", "webp"],
671
670
  id: "image"
672
671
  },
673
672
  video: {
674
- component: wr,
673
+ component: Cr,
675
674
  mimeTypes: ["video/"],
676
675
  id: "video"
677
676
  },
678
677
  text: {
679
- component: gr,
678
+ component: br,
680
679
  mimeTypes: ["text/", "application/json", "scss", "jsx"],
681
680
  id: "text"
682
681
  },
@@ -684,11 +683,11 @@ const ar = ({
684
683
  component: null,
685
684
  mimeTypes: ["pdf"],
686
685
  id: "pdf",
687
- callback: (e) => window.open(dt(e.id, e.projectName), "_blank")
686
+ callback: (e) => window.open(ct(e.id, e.projectName), "_blank")
688
687
  }
689
- }, vt = (e = "", t = "") => Object.values(xr).some(
688
+ }, vt = (e = "", t = "") => Object.values(Tr).some(
690
689
  ({ mimeTypes: o = [] }) => o.some((n) => (e || t)?.includes(n))
691
- ), kr = {
690
+ ), Dr = {
692
691
  // special cases
693
692
  description: ["doc"],
694
693
  folder_zip: ["zip"],
@@ -730,12 +729,12 @@ const ar = ({
730
729
  filter_none: ["sequence"],
731
730
  font_download: ["font"],
732
731
  deployed_code: ["model", ".obj", ".abc", ".stl", ".fbx", ".gltf", ".glb", ".usd"]
733
- }, Ar = (e) => {
734
- for (const [t, o] of Object.entries(kr))
732
+ }, Nr = (e) => {
733
+ for (const [t, o] of Object.entries(Dr))
735
734
  if (o.some((n) => e.includes(n)))
736
735
  return t;
737
736
  return "draft";
738
- }, Fr = ({
737
+ }, Ir = ({
739
738
  name: e,
740
739
  mime: t,
741
740
  src: o,
@@ -744,31 +743,31 @@ const ar = ({
744
743
  annotationFrameStart: r,
745
744
  size: s,
746
745
  progress: i,
747
- onRemove: c,
746
+ onRemove: l,
748
747
  isCompact: m,
749
748
  isDownloadable: p = !1,
750
749
  onExpand: g,
751
750
  disableExpand: u,
752
751
  onJumpTo: h,
753
- className: v,
752
+ className: b,
754
753
  ...y
755
754
  }) => {
756
- const D = i && i < 100, [P, C] = L(!1), [f, b] = L(!1), { feedAnnotationsEnabled: T } = ze(), { entities: I } = $e(), _ = e.split("."), R = _.pop() || "", E = _.join("."), N = vt(t || "." + R), Q = t?.includes("image/") || !!n, H = !!t?.includes("video/") && !n && o ? `${o}/thumbnail` : void 0, J = /* @__PURE__ */ k(Ce, { children: [
757
- /* @__PURE__ */ l("span", { className: "size", children: No(s) }),
758
- /* @__PURE__ */ l(se, { icon: "download", className: "download-icon" })
759
- ] }), q = S(
755
+ const D = i && i < 100, [M, C] = L(!1), [f, w] = L(!1), { feedAnnotationsEnabled: A } = Be(), { entities: S } = $e(), P = e.split("."), _ = P.pop() || "", E = P.join("."), N = vt(t || "." + _), G = t?.includes("image/") || !!n, Q = !!t?.includes("video/") && !n && o ? `${o}/thumbnail` : void 0, Z = /* @__PURE__ */ x(Te, { children: [
756
+ /* @__PURE__ */ c("span", { className: "size", children: Eo(s) }),
757
+ /* @__PURE__ */ c(se, { icon: "download", className: "download-icon" })
758
+ ] }), Y = I(
760
759
  () => n ?? a,
761
760
  [n, a]
762
- ), $ = S(() => I.at(0), [I]), te = S(() => {
763
- if (!q?.range)
761
+ ), $ = I(() => S.at(0), [S]), oe = I(() => {
762
+ if (!Y?.range)
764
763
  return [1, 1];
765
- const oe = r === void 0 ? $?.attrib?.frameStart : r;
766
- return Number.isFinite(oe) ? [oe - 1 + q.range[0], oe - 1 + q.range[1]] : q.range;
767
- }, [q, r, $]);
768
- return /* @__PURE__ */ k(
769
- ir,
764
+ const ae = r === void 0 ? $?.attrib?.frameStart : r;
765
+ return Number.isFinite(ae) ? [ae - 1 + Y.range[0], ae - 1 + Y.range[1]] : Y.range;
766
+ }, [Y, r, $]);
767
+ return /* @__PURE__ */ x(
768
+ ur,
770
769
  {
771
- className: ee(v, {
770
+ className: ne(b, {
772
771
  compact: m,
773
772
  isDownloadable: p,
774
773
  isPreviewable: N,
@@ -776,51 +775,51 @@ const ar = ({
776
775
  }),
777
776
  ...y,
778
777
  children: [
779
- /* @__PURE__ */ k(
780
- cr,
778
+ /* @__PURE__ */ x(
779
+ pr,
781
780
  {
782
- className: ee("content-wrapper", {
781
+ className: ne("content-wrapper", {
783
782
  isPreviewable: N,
784
783
  isUnsavedAnnotation: !!n
785
784
  }),
786
785
  children: [
787
- /* @__PURE__ */ l(se, { icon: Ar(t || "." + R), className: "type-icon" }),
788
- Q && o && /* @__PURE__ */ l(
789
- ln,
786
+ /* @__PURE__ */ c(se, { icon: Nr(t || "." + _), className: "type-icon" }),
787
+ G && o && /* @__PURE__ */ c(
788
+ dn,
790
789
  {
791
- className: ee({
790
+ className: ne({
792
791
  "image-wrapper": !0,
793
792
  isDownloadable: p || N || n
794
793
  }),
795
- children: /* @__PURE__ */ l(
794
+ children: /* @__PURE__ */ c(
796
795
  "img",
797
796
  {
798
797
  src: o,
799
798
  onError: () => C(!0),
800
799
  style: {
801
- display: P ? "none" : "block"
800
+ display: M ? "none" : "block"
802
801
  }
803
802
  }
804
803
  )
805
804
  }
806
805
  ),
807
- H && /* @__PURE__ */ k(
808
- ln,
806
+ Q && /* @__PURE__ */ x(
807
+ dn,
809
808
  {
810
- className: ee({
809
+ className: ne({
811
810
  "image-wrapper": !0,
812
811
  isDownloadable: p || N,
813
812
  posterError: f
814
813
  }),
815
814
  children: [
816
- !f && /* @__PURE__ */ l("img", { src: H, onError: () => b(!0) }),
817
- /* @__PURE__ */ l(dr, {})
815
+ !f && /* @__PURE__ */ c("img", { src: Q, onError: () => w(!0) }),
816
+ /* @__PURE__ */ c(hr, {})
818
817
  ]
819
818
  }
820
819
  ),
821
- /* @__PURE__ */ k(lr, { className: "expand-buttons", children: [
822
- N && !u && /* @__PURE__ */ l(
823
- dn,
820
+ /* @__PURE__ */ x(gr, { className: "expand-buttons", children: [
821
+ N && !u && /* @__PURE__ */ c(
822
+ un,
824
823
  {
825
824
  "data-tooltip": "Open preview",
826
825
  icon: "open_in_full",
@@ -828,8 +827,8 @@ const ar = ({
828
827
  onClick: g
829
828
  }
830
829
  ),
831
- (n || T && a) && /* @__PURE__ */ l(
832
- dn,
830
+ (n || A && a) && /* @__PURE__ */ c(
831
+ un,
833
832
  {
834
833
  "data-tooltip": "Jump to annotation",
835
834
  icon: "play_circle",
@@ -841,36 +840,36 @@ const ar = ({
841
840
  ]
842
841
  }
843
842
  ),
844
- /* @__PURE__ */ k(
845
- sr,
843
+ /* @__PURE__ */ x(
844
+ mr,
846
845
  {
847
- className: ee({
846
+ className: ne({
848
847
  inProgress: D,
849
848
  isPreviewable: N && !u,
850
849
  isDownloadable: p
851
850
  }),
852
851
  children: [
853
- /* @__PURE__ */ l("span", { className: "progress", style: { right: `${100 - i}%` } }),
854
- /* @__PURE__ */ l("div", { className: "name-wrapper", children: q ? /* @__PURE__ */ k("span", { className: "name", children: [
855
- /* @__PURE__ */ l(se, { icon: "draw" }),
856
- te[0],
857
- te[1] !== te[0] && ` - ${te[1]}`
858
- ] }) : /* @__PURE__ */ k("span", { className: "name", children: [
852
+ /* @__PURE__ */ c("span", { className: "progress", style: { right: `${100 - i}%` } }),
853
+ /* @__PURE__ */ c("div", { className: "name-wrapper", children: Y ? /* @__PURE__ */ x("span", { className: "name", children: [
854
+ /* @__PURE__ */ c(se, { icon: "draw" }),
855
+ oe[0],
856
+ oe[1] !== oe[0] && ` - ${oe[1]}`
857
+ ] }) : /* @__PURE__ */ x("span", { className: "name", children: [
859
858
  E,
860
- /* @__PURE__ */ k("span", { className: "extension", children: [
859
+ /* @__PURE__ */ x("span", { className: "extension", children: [
861
860
  ".",
862
- R
861
+ _
863
862
  ] })
864
863
  ] }) }),
865
- p && (c ? /* @__PURE__ */ l("div", { className: "download", children: J }) : /* @__PURE__ */ l("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: J }))
864
+ p && (l ? /* @__PURE__ */ c("div", { className: "download", children: Z }) : /* @__PURE__ */ c("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: Z }))
866
865
  ]
867
866
  }
868
867
  ),
869
- c && /* @__PURE__ */ l(ct, { className: "remove", onClick: c, icon: "close" })
868
+ l && /* @__PURE__ */ c(st, { className: "remove", onClick: l, icon: "close" })
870
869
  ]
871
870
  }
872
871
  );
873
- }, Pn = ({
872
+ }, _n = ({
874
873
  files: e = [],
875
874
  activityId: t,
876
875
  isCompact: o,
@@ -879,26 +878,26 @@ const ar = ({
879
878
  projectName: r,
880
879
  isDownloadable: s,
881
880
  onExpand: i,
882
- onAnnotationClick: c,
881
+ onAnnotationClick: l,
883
882
  pt: m,
884
883
  ...p
885
884
  }) => {
886
885
  if (!e.length) return null;
887
- const g = qe(
886
+ const g = Je(
888
887
  (u) => {
889
- const h = e.filter((y) => vt(y.mime, y.ext)), v = h.findIndex((y) => y.id === e[u].id);
890
- i?.({ files: h, index: v, activityId: t || "" });
888
+ const h = e.filter((y) => vt(y.mime, y.ext)), b = h.findIndex((y) => y.id === e[u].id);
889
+ i?.({ files: h, index: b, activityId: t || "" });
891
890
  },
892
891
  [i]
893
892
  );
894
- return /* @__PURE__ */ l(rr, { className: ee({ compact: o }), ...p, children: e.map((u, h) => /* @__PURE__ */ l(
895
- Fr,
893
+ return /* @__PURE__ */ c(dr, { className: ne({ compact: o }), ...p, children: e.map((u, h) => /* @__PURE__ */ c(
894
+ Ir,
896
895
  {
897
896
  id: u.id || u.name,
898
897
  name: u.name,
899
898
  mime: u.mime || u.type,
900
899
  size: u.size,
901
- src: u.unsavedAnnotation ? u.thumbnail : u.id ? dt(u.id, r) : void 0,
900
+ src: u.unsavedAnnotation ? u.thumbnail : u.id ? ct(u.id, r) : void 0,
902
901
  unsavedAnnotation: u.unsavedAnnotation,
903
902
  savedAnnotation: u.annotation,
904
903
  progress: u.progress,
@@ -906,13 +905,13 @@ const ar = ({
906
905
  isCompact: o,
907
906
  isDownloadable: s,
908
907
  onExpand: () => g(h),
909
- onJumpTo: () => c?.(u),
908
+ onJumpTo: () => l?.(u),
910
909
  disableExpand: n,
911
910
  ...m?.file
912
911
  },
913
912
  u.id || u.name
914
913
  )) });
915
- }, Cr = (e) => {
914
+ }, Sr = (e) => {
916
915
  const t = /!\[.*?\]\((.*?)\)/g, o = e.match(t);
917
916
  let n = e;
918
917
  return o && o.forEach((a) => {
@@ -920,46 +919,46 @@ const ar = ({
920
919
  const r = a.match(/\(([^)]+)\)/)[1], s = r.split("?")[0];
921
920
  n = e.replace(r, s);
922
921
  }), n;
923
- }, Tr = new AbortController(), Dr = $t.CancelToken, Nr = Dr.source(), We = (e, t, o) => new Promise((n, a) => {
922
+ }, Er = new AbortController(), Mr = Vt.CancelToken, Pr = Mr.source(), Xe = (e, t, o) => new Promise((n, a) => {
924
923
  new FormData().append("image", e);
925
924
  const s = {
926
- signal: Tr.signal,
927
- cancelToken: Nr.token,
925
+ signal: Er.signal,
926
+ cancelToken: Pr.token,
928
927
  onUploadProgress: (i) => o && o(i, e),
929
928
  headers: {
930
929
  "Content-Type": e.type,
931
- "x-file-name": be(e.name)
930
+ "x-file-name": ve(e.name)
932
931
  }
933
932
  };
934
- $t.post(`/api/projects/${t}/files`, e, s).then((i) => {
933
+ Vt.post(`/api/projects/${t}/files`, e, s).then((i) => {
935
934
  n({ file: e, data: i.data });
936
935
  }).catch((i) => {
937
936
  console.error(i), a({ message: "Upload failed: " + i.response.data.detail });
938
937
  });
939
- }), Sr = (e, t, o, n, a) => {
938
+ }), _r = (e, t, o, n, a) => {
940
939
  e.preventDefault(), e.stopPropagation();
941
940
  let r = e.dataTransfer.files;
942
941
  if (r?.length) {
943
942
  if (r.length === 0) return;
944
943
  for (const s of r)
945
- We(s, t, o).then(
944
+ Xe(s, t, o).then(
946
945
  (i) => n(i),
947
946
  (i) => {
948
- a && a(s), Fe.error(i.message), console.warn(i);
947
+ a && a(s), Ce.error(i.message), console.warn(i);
949
948
  }
950
949
  );
951
950
  }
952
- }, Ir = (e, t, o) => (t || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((n) => {
951
+ }, Rr = (e, t, o) => (t || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((n) => {
953
952
  n.versionId || console.warn("filterEntityAnnotations: annotation.versionId is empty", n);
954
953
  }), Object.values(e).filter(
955
- (n) => n.versionId === t && !o.some((a) => a.name === be(n.name))
954
+ (n) => n.versionId === t && !o.some((a) => a.name === ve(n.name))
956
955
  ).map((n) => ({
957
956
  ...n,
958
957
  unsavedAnnotation: n
959
- }))), Er = ({ entityId: e, filesUploading: t }) => {
960
- const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } = ze(), i = Ir(a || [], e, t);
961
- return G(() => {
962
- i.length > 0 && !o && n(it);
958
+ }))), Lr = ({ entityId: e, filesUploading: t }) => {
959
+ const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } = Be(), i = Rr(a || [], e, t);
960
+ return W(() => {
961
+ i.length > 0 && !o && n(rt);
963
962
  }, [i]), {
964
963
  annotations: i,
965
964
  goToAnnotation: (m) => {
@@ -968,101 +967,101 @@ const ar = ({
968
967
  },
969
968
  removeAnnotation: r
970
969
  };
971
- }, _n = (e) => S(() => {
970
+ }, Rn = (e) => I(() => {
972
971
  if (!e)
973
972
  return { primary: void 0, secondary: void 0 };
974
- const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s = rn(e, a, 0.1) || e, i = rn(e, r, 0.2) || e;
973
+ const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s = cn(e, a, 0.1) || e, i = cn(e, r, 0.2) || e;
975
974
  return {
976
975
  primary: s,
977
976
  secondary: i
978
977
  };
979
- }, [e]), Mr = ({ projectName: e, onSuccess: t, onProgress: o, onStart: n, onError: a }) => {
980
- const { exportAnnotationComposite: r } = $e(), s = async (c) => {
981
- const m = await r?.(c.id);
978
+ }, [e]), $r = ({ projectName: e, onSuccess: t, onProgress: o, onStart: n, onError: a }) => {
979
+ const { exportAnnotationComposite: r } = $e(), s = async (l) => {
980
+ const m = await r?.(l.id);
982
981
  if (!m)
983
- throw new Error(`Exporting composite image for annotation ${c.id} failed`);
984
- const p = new File([m], c.name, {
982
+ throw new Error(`Exporting composite image for annotation ${l.id} failed`);
983
+ const p = new File([m], l.name, {
985
984
  type: "image/png"
986
- }), g = await fetch(c.annotationData).then((P) => P.blob()), u = new File([g], `annotation-${c.name}`, {
985
+ }), g = await fetch(l.annotationData).then((M) => M.blob()), u = new File([g], `annotation-${l.name}`, {
987
986
  type: "image/png"
988
987
  }), h = await Promise.all([
989
- We(p, e, o),
990
- We(u, e, () => {
988
+ Xe(p, e, o),
989
+ Xe(u, e, () => {
991
990
  })
992
- ]), [v, y] = h, D = [t(v), t(y, !0)];
993
- return { annotation: c, uploads: h, files: D };
991
+ ]), [b, y] = h, D = [t(b), t(y, !0)];
992
+ return { annotation: l, uploads: h, files: D };
994
993
  };
995
- return async (c) => {
994
+ return async (l) => {
996
995
  try {
997
- const m = c.map(async (h) => {
996
+ const m = l.map(async (h) => {
998
997
  n?.(h);
999
998
  try {
1000
999
  return await s(h);
1001
- } catch (v) {
1002
- throw a?.(h), v;
1000
+ } catch (b) {
1001
+ throw a?.(h), b;
1003
1002
  }
1004
1003
  }), p = await Promise.allSettled(m), g = [], u = [];
1005
1004
  return p.forEach((h) => {
1006
1005
  if (h.status === "fulfilled") {
1007
- const { uploads: v, annotation: y, files: D } = h.value;
1006
+ const { uploads: b, annotation: y, files: D } = h.value;
1008
1007
  g.push(...D), u.push({
1009
1008
  range: y.range,
1010
1009
  id: y.id,
1011
- composite: v[0].data.id,
1012
- transparent: v[1].data.id
1010
+ composite: b[0].data.id,
1011
+ transparent: b[1].data.id
1013
1012
  });
1014
1013
  } else
1015
- Fe.error("Upload failed: " + h.reason.message);
1014
+ Ce.error("Upload failed: " + h.reason.message);
1016
1015
  }), { files: g, metadata: u };
1017
1016
  } catch (m) {
1018
- return Fe.error("Upload failed: " + m.message), { files: [], metadata: [] };
1017
+ return Ce.error("Upload failed: " + m.message), { files: [], metadata: [] };
1019
1018
  }
1020
1019
  };
1021
- }, Rn = "ayon-comment-draft/", Ln = 720 * 60 * 60 * 1e3, Pr = (e) => !e.text.trim() && !e.files.length && !e.uploadedAnnotations.length, $n = (e) => {
1020
+ }, Ln = "ayon-comment-draft/", $n = 720 * 60 * 60 * 1e3, Or = (e) => !e.text.trim() && !e.files.length && !e.uploadedAnnotations.length, On = (e) => {
1022
1021
  try {
1023
1022
  const t = localStorage.getItem(e);
1024
1023
  return t ? JSON.parse(t) : null;
1025
1024
  } catch {
1026
1025
  return null;
1027
1026
  }
1028
- }, _r = (e, t) => {
1027
+ }, Vr = (e, t) => {
1029
1028
  try {
1030
- Pr(t) ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ ...t, savedAt: Date.now() }));
1029
+ Or(t) ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ ...t, savedAt: Date.now() }));
1031
1030
  } catch (o) {
1032
1031
  console.warn("Could not save comment draft", o);
1033
1032
  }
1034
- }, Rr = () => {
1033
+ }, jr = () => {
1035
1034
  try {
1036
1035
  const e = Date.now();
1037
1036
  for (const t of Object.keys(localStorage)) {
1038
- if (!t.startsWith(Rn)) continue;
1039
- const o = $n(t);
1040
- (!o || e - o.savedAt > Ln) && localStorage.removeItem(t);
1037
+ if (!t.startsWith(Ln)) continue;
1038
+ const o = On(t);
1039
+ (!o || e - o.savedAt > $n) && localStorage.removeItem(t);
1041
1040
  }
1042
1041
  } catch {
1043
1042
  }
1044
- }, Lr = (e, t, o) => e && t && o.length ? `${Rn}${e}/${t}/${[...o].sort().join(",")}` : null, $r = ({ draftKey: e, draft: t, paused: o, restore: n }) => {
1045
- const a = ge(null), r = ge(!1);
1046
- G(() => {
1043
+ }, Ur = (e, t, o) => e && t && o.length ? `${Ln}${e}/${t}/${[...o].sort().join(",")}` : null, zr = ({ draftKey: e, draft: t, paused: o, restore: n }) => {
1044
+ const a = pe(null), r = pe(!1);
1045
+ W(() => {
1047
1046
  if (!e || o) return;
1048
1047
  const s = a.current;
1049
1048
  if (a.current = e, s === e) return;
1050
- s || Rr();
1051
- const i = $n(e);
1052
- i && Date.now() - i.savedAt <= Ln ? (r.current = !0, n({
1049
+ s || jr();
1050
+ const i = On(e);
1051
+ i && Date.now() - i.savedAt <= $n ? (r.current = !0, n({
1053
1052
  text: i.text ?? "",
1054
1053
  files: i.files ?? [],
1055
1054
  uploadedAnnotations: i.uploadedAnnotations ?? [],
1056
1055
  category: i.category ?? null
1057
1056
  })) : s && (r.current = !0, n({ text: "", files: [], uploadedAnnotations: [], category: t.category }));
1058
- }, [e, o]), G(() => {
1057
+ }, [e, o]), W(() => {
1059
1058
  if (r.current) {
1060
1059
  r.current = !1;
1061
1060
  return;
1062
1061
  }
1063
- !e || o || _r(e, t);
1062
+ !e || o || Vr(e, t);
1064
1063
  }, [e, o, t.text, t.files, t.uploadedAnnotations, t.category]);
1065
- }, Or = "Category", Vr = F.div`
1064
+ }, Br = "Category", Gr = F.div`
1066
1065
  display: flex;
1067
1066
  padding: 2px 4px;
1068
1067
  justify-content: center;
@@ -1088,7 +1087,7 @@ const ar = ({
1088
1087
 
1089
1088
  &.compact {
1090
1089
  padding: 1px 2px;
1091
- ${Cn.labelMedium}
1090
+ ${Tn.labelMedium}
1092
1091
  }
1093
1092
 
1094
1093
  &.editing {
@@ -1111,13 +1110,13 @@ const ar = ({
1111
1110
  color: var(--md-sys-color-tertiary);
1112
1111
  }
1113
1112
  }
1114
- `, st = ft(
1115
- ({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...c }, m) => /* @__PURE__ */ l(
1116
- Vr,
1113
+ `, it = ft(
1114
+ ({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...l }, m) => /* @__PURE__ */ c(
1115
+ Gr,
1117
1116
  {
1118
- ...c,
1117
+ ...l,
1119
1118
  ref: m,
1120
- className: ee(i, {
1119
+ className: ne(i, {
1121
1120
  none: !e,
1122
1121
  compact: o,
1123
1122
  editing: n,
@@ -1129,13 +1128,13 @@ const ar = ({
1129
1128
  ...t && {
1130
1129
  backgroundColor: t,
1131
1130
  borderColor: t,
1132
- color: _t(t)
1131
+ color: Lt(t)
1133
1132
  }
1134
1133
  },
1135
- children: e || Or
1134
+ children: e || Br
1136
1135
  }
1137
1136
  )
1138
- ), jr = F.span`
1137
+ ), Hr = F.span`
1139
1138
  display: flex;
1140
1139
  justify-content: flex-start;
1141
1140
  align-items: center;
@@ -1154,7 +1153,7 @@ const ar = ({
1154
1153
  color: var(--md-sys-color-on-surface) !important;
1155
1154
  }
1156
1155
  }
1157
- `, Ur = ft(
1156
+ `, qr = ft(
1158
1157
  ({
1159
1158
  label: e,
1160
1159
  color: t,
@@ -1164,18 +1163,18 @@ const ar = ({
1164
1163
  endContent: r,
1165
1164
  isClear: s,
1166
1165
  style: i,
1167
- className: c,
1166
+ className: l,
1168
1167
  ...m
1169
- }, p) => /* @__PURE__ */ k(
1170
- jr,
1168
+ }, p) => /* @__PURE__ */ x(
1169
+ Hr,
1171
1170
  {
1172
1171
  ...m,
1173
- className: ee(c, { selected: n }),
1174
- style: { backgroundColor: n && t ? t : "", color: _t(n && t ? t : ""), ...i },
1172
+ className: ne(l, { selected: n }),
1173
+ style: { backgroundColor: n && t ? t : "", color: Lt(n && t ? t : ""), ...i },
1175
1174
  ref: p,
1176
1175
  children: [
1177
1176
  a,
1178
- /* @__PURE__ */ l(
1177
+ /* @__PURE__ */ c(
1179
1178
  se,
1180
1179
  {
1181
1180
  icon: o || (s ? "clear" : "crop_square"),
@@ -1187,7 +1186,7 @@ const ar = ({
1187
1186
  ]
1188
1187
  }
1189
1188
  )
1190
- ), zr = "1.3.0", Br = F(So)`
1189
+ ), Wr = "1.3.0", Qr = F(Mo)`
1191
1190
  button {
1192
1191
  /* remove all styles and just use a wrapper */
1193
1192
  background-color: unset !important;
@@ -1198,7 +1197,7 @@ const ar = ({
1198
1197
  width: unset !important;
1199
1198
  color: var(--md-sys-color-on-surface) !important;
1200
1199
  }
1201
- `, Gr = ({
1200
+ `, Yr = ({
1202
1201
  value: e,
1203
1202
  categories: t,
1204
1203
  readonly: o,
@@ -1207,34 +1206,34 @@ const ar = ({
1207
1206
  hasPowerpack: r,
1208
1207
  onPowerFeature: s,
1209
1208
  onChange: i,
1210
- ...c
1209
+ ...l
1211
1210
  }) => {
1212
1211
  if (n) return null;
1213
1212
  const m = t.find((u) => u.name === e), { color: p } = m || {};
1214
1213
  if (!r)
1215
- return /* @__PURE__ */ l(
1216
- st,
1214
+ return /* @__PURE__ */ c(
1215
+ it,
1217
1216
  {
1218
1217
  value: null,
1219
1218
  isPower: !0,
1220
1219
  isDisabled: !0,
1221
- style: c.style,
1220
+ style: l.style,
1222
1221
  onClick: () => s?.("commentCategories"),
1223
1222
  "data-tooltip": "Comment categories is a Powerpack feature"
1224
1223
  }
1225
1224
  );
1226
1225
  if (o)
1227
- return /* @__PURE__ */ l(st, { value: e, color: p, isCompact: a, style: c.style });
1226
+ return /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, style: l.style });
1228
1227
  if (!t.length)
1229
- return /* @__PURE__ */ l(
1230
- st,
1228
+ return /* @__PURE__ */ c(
1229
+ it,
1231
1230
  {
1232
1231
  value: e,
1233
1232
  color: p,
1234
1233
  isCompact: a,
1235
- style: c.style,
1236
- onClick: () => Fe.warning(
1237
- `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${zr}.`
1234
+ style: l.style,
1235
+ onClick: () => Ce.warning(
1236
+ `No categories found. Ensure they are set in the Powerpack settings and the version is at least ${Wr}.`
1238
1237
  )
1239
1238
  }
1240
1239
  );
@@ -1247,48 +1246,48 @@ const ar = ({
1247
1246
  icon: null
1248
1247
  }))
1249
1248
  ];
1250
- return /* @__PURE__ */ l(
1251
- Br,
1249
+ return /* @__PURE__ */ c(
1250
+ Qr,
1252
1251
  {
1253
1252
  options: g,
1254
1253
  value: e ? [e] : [],
1255
1254
  onChange: (u) => i(u[0]),
1256
- valueTemplate: () => /* @__PURE__ */ l(st, { value: e, color: p, isCompact: a, isEditing: !0 }),
1257
- itemTemplate: (u, h, v, y) => /* @__PURE__ */ l(
1258
- Ur,
1255
+ valueTemplate: () => /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, isEditing: !0 }),
1256
+ itemTemplate: (u, h, b, y) => /* @__PURE__ */ c(
1257
+ qr,
1259
1258
  {
1260
1259
  label: u.label,
1261
1260
  color: u.color,
1262
- isSelected: v,
1261
+ isSelected: b,
1263
1262
  isClear: u.value === null
1264
1263
  },
1265
1264
  y
1266
1265
  ),
1267
- ...c
1266
+ ...l
1268
1267
  }
1269
1268
  );
1270
- }, Hr = (e, { isGuest: t, isAdmin: o }) => !!(t || !e.length && !o), qr = ["tip", "status"], Wr = ["textDirective", "leafDirective", "containerDirective"], On = (e) => ({ type: "text", value: e }), Ft = (e) => ({ type: "paragraph", children: [On(e)] }), Qr = (e, t) => {
1269
+ }, Jr = (e, { isGuest: t, isAdmin: o }) => !!(t || !e.length && !o), Kr = ["tip", "status"], Xr = ["textDirective", "leafDirective", "containerDirective"], Vn = (e) => ({ type: "text", value: e }), Ft = (e) => ({ type: "paragraph", children: [Vn(e)] }), Zr = (e, t) => {
1271
1270
  const o = e.position?.start.offset, n = e.position?.end.offset;
1272
1271
  return o === void 0 || n === void 0 ? null : t.slice(o, n);
1273
- }, Yr = (e, t) => {
1274
- const o = Qr(e, t);
1272
+ }, ei = (e, t) => {
1273
+ const o = Zr(e, t);
1275
1274
  if (o === null) return null;
1276
- if (e.type === "textDirective") return [On(o)];
1275
+ if (e.type === "textDirective") return [Vn(o)];
1277
1276
  if (e.type === "leafDirective") return [Ft(o)];
1278
1277
  const [n, ...a] = o.split(`
1279
1278
  `), r = a.length ? a[a.length - 1].match(/:{3,}\s*$/) : null;
1280
1279
  return [Ft(n), ...e.children || [], ...r ? [Ft(r[0])] : []];
1281
- }, Vn = (e, t, o) => {
1280
+ }, jn = (e, t, o) => {
1282
1281
  if (!e.children) return;
1283
1282
  const n = [];
1284
1283
  for (const a of e.children) {
1285
- const s = Wr.includes(a.type) && !o.includes(a.name || "") ? Yr(a, t) : null;
1284
+ const s = Xr.includes(a.type) && !o.includes(a.name || "") ? ei(a, t) : null;
1286
1285
  n.push(...s || [a]);
1287
1286
  }
1288
- e.children = n, n.forEach((a) => Vn(a, t, o));
1289
- }, Jr = (e = qr) => (t, o) => {
1290
- Vn(t, String(o.value ?? ""), e);
1291
- }, jn = 1e4, Kr = F.span`
1287
+ e.children = n, n.forEach((a) => jn(a, t, o));
1288
+ }, ti = (e = Kr) => (t, o) => {
1289
+ jn(t, String(o.value ?? ""), e);
1290
+ }, Un = 1e4, ni = F.span`
1292
1291
  margin-left: auto;
1293
1292
  color: var(--md-sys-color-outline);
1294
1293
  user-select: none;
@@ -1301,99 +1300,99 @@ const ar = ({
1301
1300
  min-width: 0;
1302
1301
  max-width: fit-content;
1303
1302
 
1304
- ${Cn.bodySmall}
1305
- `, ut = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
1303
+ ${Tn.bodySmall}
1304
+ `, lt = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
1306
1305
  const [a, r] = L(!0), [s, i] = L(/* @__PURE__ */ new Date());
1307
1306
  if (!e) return null;
1308
- const c = new Date(e);
1309
- if (!lt(c)) return null;
1310
- G(() => {
1311
- const b = setInterval(
1307
+ const l = new Date(e);
1308
+ if (!Ke(l)) return null;
1309
+ W(() => {
1310
+ const w = setInterval(
1312
1311
  () => i(/* @__PURE__ */ new Date()),
1313
- jn
1312
+ Un
1314
1313
  );
1315
- return () => clearInterval(b);
1314
+ return () => clearInterval(w);
1316
1315
  }, []);
1317
- const m = Va(c), p = ja(c, s), g = Ua(c, new Date(s.setDate(s.getDate() - 1))), u = za(c, s), h = Ba(c, s), v = g ? "" : p ? u ? "E" : "MMM d" : "MMM d yyyy", y = "h:mm a", D = S(() => Nn(c), [c]), P = S(() => m ? sn(c, `${v}, ${y}`) : sn(c, `EEEE, dd MMM yyyy ${y}`), [c, m]);
1318
- let C = a && !t ? D : P;
1316
+ const m = Ga(l), p = Ha(l, s), g = qa(l, new Date(s.setDate(s.getDate() - 1))), u = Wa(l, s), h = Qa(l, s), b = g ? "" : p ? u ? "E" : "MMM d" : "MMM d yyyy", y = "h:mm a", D = I(() => In(l), [l]), M = I(() => m ? St(l, `${b}, ${y}`) : St(l, `EEEE, dd MMM yyyy ${y}`), [l, m]);
1317
+ let C = a && !t ? D : M;
1319
1318
  g && a && !t && (C = `Yesterday${C}`), h && (C = "Just now");
1320
1319
  const f = () => {
1321
1320
  r(!a);
1322
1321
  };
1323
- return /* @__PURE__ */ l(
1324
- Kr,
1322
+ return /* @__PURE__ */ c(
1323
+ ni,
1325
1324
  {
1326
- className: ee("date"),
1325
+ className: ne("date"),
1327
1326
  ...n,
1328
1327
  onClick: f,
1329
1328
  onMouseOver: () => !o && r(!1),
1330
1329
  onMouseOut: () => !o && r(!0),
1331
- "data-tooltip": o ? P : null,
1330
+ "data-tooltip": o ? M : null,
1332
1331
  "data-tooltip-delay": 0,
1333
1332
  children: C
1334
1333
  }
1335
1334
  );
1336
1335
  };
1337
- var Ne = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Ne || {});
1338
- const Un = (e) => {
1336
+ var Se = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Se || {});
1337
+ const zn = (e) => {
1339
1338
  switch (e) {
1340
- case Ne.REQUEST_CHANGES:
1339
+ case Se.REQUEST_CHANGES:
1341
1340
  return "requested changes";
1342
- case Ne.APPROVE:
1341
+ case Se.APPROVE:
1343
1342
  default:
1344
1343
  return "approved this";
1345
1344
  }
1346
- }, Xr = (e, t) => {
1345
+ }, oi = (e, t) => {
1347
1346
  switch (e) {
1348
- case Ne.REQUEST_CHANGES:
1347
+ case Se.REQUEST_CHANGES:
1349
1348
  return "Requested changes on " + t;
1350
- case Ne.APPROVE:
1349
+ case Se.APPROVE:
1351
1350
  default:
1352
1351
  return "Approved " + t;
1353
1352
  }
1354
- }, zn = (e) => {
1353
+ }, Bn = (e) => {
1355
1354
  switch (e) {
1356
- case Ne.REQUEST_CHANGES:
1355
+ case Se.REQUEST_CHANGES:
1357
1356
  return "refresh";
1358
- case Ne.APPROVE:
1357
+ case Se.APPROVE:
1359
1358
  default:
1360
1359
  return "task_alt";
1361
1360
  }
1362
- }, Zr = ({ lastOwnVersionReview: e }) => {
1361
+ }, ai = ({ lastOwnVersionReview: e }) => {
1363
1362
  const [t, o] = L(/* @__PURE__ */ new Date());
1364
- G(() => {
1365
- const r = setInterval(() => o(/* @__PURE__ */ new Date()), jn);
1363
+ W(() => {
1364
+ const r = setInterval(() => o(/* @__PURE__ */ new Date()), Un);
1366
1365
  return () => clearInterval(r);
1367
1366
  }, []);
1368
- const n = S(() => e?.activityData?.feedback, [e]), a = S(() => e?.createdAt ? Nn(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, t]);
1369
- return /* @__PURE__ */ k(_o, { className: xn(n), children: [
1370
- /* @__PURE__ */ l(se, { icon: zn(n) }),
1367
+ const n = I(() => e?.activityData?.feedback, [e]), a = I(() => e?.createdAt ? In(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, t]);
1368
+ return /* @__PURE__ */ x($o, { className: kn(n), children: [
1369
+ /* @__PURE__ */ c(se, { icon: Bn(n) }),
1371
1370
  "You last ",
1372
- Un(n),
1371
+ zn(n),
1373
1372
  " ",
1374
1373
  a,
1375
1374
  " ",
1376
1375
  a === "just now" ? "" : "ago"
1377
1376
  ] });
1378
- }, mn = (e) => {
1377
+ }, pn = (e) => {
1379
1378
  const t = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(e.trim());
1380
1379
  if (!t) return null;
1381
1380
  const o = Number(t[1]), n = t[2] ? Number(t[2]) : o;
1382
1381
  return Number.isSafeInteger(o) && o > 0 && Number.isSafeInteger(n) && n >= o ? { startFrame: o, endFrame: n } : null;
1383
- }, It = (e) => typeof e == "number" && Number.isFinite(e) ? e - 1 : 0, Bn = (e, t) => String(e + It(t)), ei = (e, t) => {
1382
+ }, Et = (e) => typeof e == "number" && Number.isFinite(e) ? e - 1 : 0, Gn = (e, t) => String(e + Et(t)), ri = (e, t) => {
1384
1383
  if (!e) return null;
1385
- const o = e.startFrame - It(t), n = e.endFrame - It(t);
1384
+ const o = e.startFrame - Et(t), n = e.endFrame - Et(t);
1386
1385
  return o > 0 ? { startFrame: o, endFrame: n } : null;
1387
- }, pn = async (e, t, o, n, a) => {
1388
- const { data: r } = await $t.get(`/api/projects/${e}/files/${t}`, {
1386
+ }, gn = async (e, t, o, n, a) => {
1387
+ const { data: r } = await Vt.get(`/api/projects/${e}/files/${t}`, {
1389
1388
  responseType: "blob"
1390
1389
  }), s = new File([r], o, { type: n || r.type });
1391
- return We(s, e, a);
1392
- }, gn = (e, t) => `/api/projects/${e}/files/${t}`, hn = (e, t) => !!e && Rt(t).has(e), ti = [
1390
+ return Xe(s, e, a);
1391
+ }, hn = (e, t) => `/api/projects/${e}/files/${t}`, fn = (e, t) => !!e && $t(t).has(e), ii = [
1393
1392
  { trigger: "@", icon: "person", tooltip: "Mention user" },
1394
1393
  { trigger: "@@", icon: "layers", tooltip: "Mention version" },
1395
1394
  { trigger: "@@@", icon: "check_circle", tooltip: "Mention task" }
1396
- ], Gn = ({
1395
+ ], Hn = ({
1397
1396
  initValue: e,
1398
1397
  initFiles: t = [],
1399
1398
  annotationFrameStart: o,
@@ -1402,440 +1401,440 @@ const Un = (e) => {
1402
1401
  activityId: r,
1403
1402
  versionReview: s,
1404
1403
  lastOwnVersionReview: i,
1405
- onSubmit: c,
1404
+ onSubmit: l,
1406
1405
  onReview: m,
1407
1406
  duplicate: p,
1408
1407
  onDuplicateHandled: g,
1409
1408
  isEditing: u,
1410
1409
  disabled: h,
1411
- isLoading: v,
1410
+ isLoading: b,
1412
1411
  isOpen: y,
1413
1412
  onOpen: D,
1414
- onClose: P,
1413
+ onClose: M,
1415
1414
  saveDraft: C = !0
1416
1415
  }) => {
1417
1416
  const {
1418
1417
  projectName: f,
1419
- entities: b,
1420
- projectInfo: T,
1421
- feedFilter: I,
1422
- mentionSuggestionsData: _,
1423
- categories: R,
1418
+ entities: w,
1419
+ projectInfo: A,
1420
+ feedFilter: S,
1421
+ mentionSuggestionsData: P,
1422
+ categories: _,
1424
1423
  isGuest: E,
1425
1424
  userName: N,
1426
- editingId: Q
1427
- } = $e(), { hasLicense: Y, onPowerFeature: H, user: J, openSlideOut: q, commentFrameLink: $ } = ze(), te = J?.data?.isAdmin, oe = $a(), [, W] = In(), [U, de] = L(e || ""), [ae, ne] = L(
1425
+ editingId: G
1426
+ } = $e(), { hasLicense: X, onPowerFeature: Q, user: Z, openSlideOut: Y, commentFrameLink: $ } = Be(), oe = Z?.data?.isAdmin, ae = za(), [, J] = En(), [j, de] = L(e || ""), [H, ee] = L(
1428
1427
  () => t.map(
1429
- (d) => hn(d.id, e || "") ? { ...d, isInline: !0 } : d
1428
+ (d) => fn(d.id, e || "") ? { ...d, isInline: !0 } : d
1430
1429
  )
1431
- ), [Qe, we] = L(0), xe = ge(/* @__PURE__ */ new Map()), [ke, he] = L([]), [Me, K] = L(!1), [Te, Oe] = L(!1), [Se, De] = L([]), [Ye, Ve] = L([]), { annotations: fe, removeAnnotation: Be, goToAnnotation: Ge } = Er({
1432
- entityId: b[0]?.id,
1433
- filesUploading: ke
1434
- }), re = b.length === 1 && b[0].entityType === "version" ? b[0] : void 0, Je = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [Pe, He] = L(
1430
+ ), [Oe, De] = L(0), Ve = pe(/* @__PURE__ */ new Map()), [be, ge] = L([]), [Ge, ue] = L(!1), [xe, he] = L(!1), [Ne, Ie] = L([]), [Ze, Re] = L([]), { annotations: fe, removeAnnotation: He, goToAnnotation: qe } = Lr({
1431
+ entityId: w[0]?.id,
1432
+ filesUploading: be
1433
+ }), re = w.length === 1 && w[0].entityType === "version" ? w[0] : void 0, et = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [je, We] = L(
1435
1434
  () => u && Number.isSafeInteger(a?.startFrame) && a.startFrame > 0 ? {
1436
1435
  startFrame: a.startFrame,
1437
1436
  endFrame: Number.isSafeInteger(a.endFrame) && a.endFrame >= a.startFrame ? a.endFrame : a.startFrame
1438
1437
  } : null
1439
- ), _e = (d) => He(d && { ...d, entityId: re?.id }), je = u || Pe?.entityId === re?.id ? Pe : null, [Ae, Re] = L(!1), w = u ? je : je ?? Je, M = u ? !!re || !!je : !!$ && !!re, O = $?.formatFrame, X = O ?? ((d) => Bn(d, o)), ue = (d) => O ? mn(d) : ei(mn(d), o), A = w ? w.endFrame > w.startFrame ? `${X(w.startFrame)}-${X(w.endFrame)}` : X(w.startFrame) : void 0, [me, ye] = L(A ?? ""), Ie = ge(!1), Ee = ge(null), Le = (d) => {
1438
+ ), Ee = (d) => We(d && { ...d, entityId: re?.id }), Ue = u || je?.entityId === re?.id ? je : null, [ke, Me] = L(!1), q = u ? Ue : Ue ?? et, Pe = u ? !!re || !!Ue : !!$ && !!re, T = $?.formatFrame, R = T ?? ((d) => Gn(d, o)), U = (d) => T ? pn(d) : ri(pn(d), o), v = q ? q.endFrame > q.startFrame ? `${R(q.startFrame)}-${R(q.endFrame)}` : R(q.startFrame) : void 0, [K, we] = L(v ?? ""), Ae = pe(!1), Fe = pe(null), Le = (d) => {
1440
1439
  if (!re) return;
1441
- const x = d ? { ...d, entityId: re.id } : null;
1440
+ const k = d ? { ...d, entityId: re.id } : null;
1442
1441
  if (!u) {
1443
- $?.setDraft(x);
1442
+ $?.setDraft(k);
1444
1443
  return;
1445
1444
  }
1446
1445
  r && $?.setEditPreview({
1447
1446
  activityId: r,
1448
- link: x
1447
+ link: k
1449
1448
  });
1450
- }, Ke = (d) => {
1451
- ye(d);
1452
- const x = ue(d);
1453
- x && Le(x);
1449
+ }, jt = (d) => {
1450
+ we(d);
1451
+ const k = U(d);
1452
+ k && Le(k);
1454
1453
  };
1455
- G(() => {
1456
- Ae || ye(A ?? "");
1457
- }, [A, Ae]), G(
1454
+ W(() => {
1455
+ ke || we(v ?? "");
1456
+ }, [v, ke]), W(
1458
1457
  () => () => {
1459
1458
  u && $?.setEditPreview(null);
1460
1459
  },
1461
1460
  [u, $?.setEditPreview]
1462
1461
  );
1463
- const Xe = () => {
1464
- if (Ie.current) {
1465
- Ie.current = !1, ye(A ?? ""), Le(Ee.current), Re(!1);
1462
+ const dt = () => {
1463
+ if (Ae.current) {
1464
+ Ae.current = !1, we(v ?? ""), Le(Fe.current), Me(!1);
1466
1465
  return;
1467
1466
  }
1468
- const d = ue(me);
1469
- d ? (_e(d), Le(d)) : (ye(A ?? ""), Le(Ee.current)), Re(!1);
1470
- }, mt = () => {
1471
- _e(null), u ? Le(null) : $?.unlink();
1472
- }, Ze = () => {
1473
- !u && $ && re ? $.link(re.id) : (ye(""), Re(!0));
1474
- }, et = () => w ? mt() : Ze(), bt = S(() => {
1475
- if (!M || !u && !$ || !re) return;
1467
+ const d = U(K);
1468
+ d ? (Ee(d), Le(d)) : (we(v ?? ""), Le(Fe.current)), Me(!1);
1469
+ }, Qe = () => {
1470
+ Ee(null), u ? Le(null) : $?.unlink();
1471
+ }, Ye = () => {
1472
+ !u && $ && re ? $.link(re.id) : (we(""), Me(!0));
1473
+ }, bt = () => q ? Qe() : Ye(), ut = I(() => {
1474
+ if (!Pe || !u && !$ || !re) return;
1476
1475
  const d = ["frame", "time", "timecode", "link", "range"];
1477
1476
  return [
1478
- w ? {
1477
+ q ? {
1479
1478
  id: "frame-link",
1480
1479
  label: "Remove frame link",
1481
1480
  icon: "timer_off",
1482
1481
  keywords: [...d, "unlink", "remove"],
1483
- hint: A,
1484
- run: mt
1482
+ hint: v,
1483
+ run: Qe
1485
1484
  } : {
1486
1485
  id: "frame-link",
1487
1486
  label: u ? "Add frame link" : "Link to current frame",
1488
1487
  icon: "timer",
1489
1488
  keywords: d,
1490
- run: Ze
1489
+ run: Ye
1491
1490
  }
1492
1491
  ];
1493
- }, [M, u, $, re?.id, !!w, A]), [tt, Ot] = L(n);
1494
- $r({
1495
- draftKey: C && !u ? Lr(
1492
+ }, [Pe, u, $, re?.id, !!q, v]), [_e, mt] = L(n);
1493
+ zr({
1494
+ draftKey: C && !u ? Ur(
1496
1495
  f,
1497
1496
  N,
1498
- b.map((d) => d.id)
1497
+ w.map((d) => d.id)
1499
1498
  ) : null,
1500
- draft: { text: U, files: ae, uploadedAnnotations: Se, category: tt },
1501
- paused: Te,
1499
+ draft: { text: j, files: H, uploadedAnnotations: Ne, category: _e },
1500
+ paused: xe,
1502
1501
  restore: (d) => {
1503
- de(d.text), ne(d.files), De(d.uploadedAnnotations), Ot(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !Q && D?.();
1502
+ de(d.text), ee(d.files), Ie(d.uploadedAnnotations), mt(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !G && D?.();
1504
1503
  }
1505
1504
  });
1506
- const Vt = R.filter((d) => d.accessLevel >= 20), jt = R.find((d) => d.name === tt), Ut = _n(jt?.color), nt = ge(null), zt = ge(null), Bt = ge(null), pt = !!U.trim(), Zn = !pt && !ae.length && !ke.length && !Qe && !Se.length && !fe.length && !Te, Gt = !!I?.conditions?.some(
1505
+ const Ut = _.filter((d) => d.accessLevel >= 20), zt = _.find((d) => d.name === _e), Bt = Rn(zt?.color), tt = pe(null), Gt = pe(null), Ht = pe(null), pt = !!j.trim(), no = !pt && !H.length && !be.length && !Oe && !Ne.length && !fe.length && !xe, qt = !!S?.conditions?.some(
1507
1506
  (d) => "key" in d && d.key === "checklists" && d.value === !0
1508
1507
  );
1509
- G(() => {
1510
- if (!y || u || !Gt) return;
1511
- const d = nt.current;
1508
+ W(() => {
1509
+ if (!y || u || !qt) return;
1510
+ const d = tt.current;
1512
1511
  !d || !d.isEmpty() || d.getEditor().update(() => {
1513
- const x = Fo(!1);
1514
- To().clear().append(Co("check").append(x)), x.select();
1512
+ const k = Do(!1);
1513
+ Io().clear().append(No("check").append(k)), k.select();
1515
1514
  });
1516
- }, [y, u, Gt]);
1517
- const Ht = b[0]?.entityType, qt = oe?.productTypes, eo = S(
1515
+ }, [y, u, qt]);
1516
+ const Wt = w[0]?.entityType, Qt = ae?.productTypes, oo = I(
1518
1517
  () => E ? void 0 : {
1519
- ...Ro({
1520
- suggestions: _,
1521
- project: { productTypes: qt },
1522
- taskTypes: T?.taskTypes,
1523
- entityType: Ht
1518
+ ...Oo({
1519
+ suggestions: P,
1520
+ project: { productTypes: Qt },
1521
+ taskTypes: A?.taskTypes,
1522
+ entityType: Wt
1524
1523
  }),
1525
1524
  // keep the picker short
1526
1525
  limit: 5
1527
1526
  },
1528
- [E, _, qt, T?.taskTypes, Ht]
1529
- ), to = ({ type: d, id: x }) => {
1530
- d === "user" || d === "team" || q({ entityId: x, entityType: d, projectName: f });
1531
- }, no = ({ type: d, id: x, label: V }, j) => {
1532
- const { x: z, y: ce, width: le } = j.getBoundingClientRect();
1533
- W({ id: x, name: x, type: d, label: V, pos: { left: z + le / 2, top: ce } });
1534
- }, [oo, wt] = L(!1);
1535
- G(() => {
1527
+ [E, P, Qt, A?.taskTypes, Wt]
1528
+ ), ao = ({ type: d, id: k }) => {
1529
+ d === "user" || d === "team" || Y({ entityId: k, entityType: d, projectName: f });
1530
+ }, ro = ({ type: d, id: k, label: O }, V) => {
1531
+ const { x: z, y: ce, width: le } = V.getBoundingClientRect();
1532
+ J({ id: k, name: k, type: d, label: O, pos: { left: z + le / 2, top: ce } });
1533
+ }, [io, wt] = L(!1);
1534
+ W(() => {
1536
1535
  y || wt(!1);
1537
1536
  }, [y]);
1538
- const ao = () => {
1537
+ const so = () => {
1539
1538
  y || h || (wt(!0), D && D());
1540
- }, Wt = () => {
1541
- u && $?.setEditPreview(null), (!pt || u) && de(""), P && P(), Bt.current?.closest("#viewer-dialog")?.focus();
1542
- }, ot = ({ file: d, data: x }, V = !1) => {
1543
- const j = be(d.name), z = {
1544
- id: x.id,
1545
- name: j,
1539
+ }, Yt = () => {
1540
+ u && $?.setEditPreview(null), (!pt || u) && de(""), M && M(), Ht.current?.closest("#viewer-dialog")?.focus();
1541
+ }, nt = ({ file: d, data: k }, O = !1) => {
1542
+ const V = ve(d.name), z = {
1543
+ id: k.id,
1544
+ name: V,
1546
1545
  mime: d.type,
1547
1546
  size: d.size,
1548
- order: ae.length,
1549
- isAnnotationLayer: V
1547
+ order: H.length,
1548
+ isAnnotationLayer: O
1550
1549
  };
1551
- return ne((ce) => [...ce, z]), he(
1552
- (ce) => ce.filter((le) => be(le.name) !== j)
1550
+ return ee((ce) => [...ce, z]), ge(
1551
+ (ce) => ce.filter((le) => ve(le.name) !== V)
1553
1552
  ), z;
1554
- }, ro = (d, x, V) => {
1555
- V ? Be?.(d) : (ne((j) => j.filter((z) => z.id !== d)), he((j) => j.filter((z) => be(z.name) !== be(x))));
1556
- }, at = (d, x) => {
1557
- const V = Math.round(d.loaded * 100 / d.total);
1558
- if (V !== 100) {
1559
- const j = be(x.name);
1560
- he((z) => {
1561
- const ce = z.find((B) => be(B.name) === j), le = z.filter((B) => be(B.name) !== j), Ue = {
1562
- name: j,
1563
- progress: V,
1564
- type: x.type,
1565
- order: ce?.order ?? ae.length + z.length
1553
+ }, co = (d, k, O) => {
1554
+ O ? He?.(d) : (ee((V) => V.filter((z) => z.id !== d)), ge((V) => V.filter((z) => ve(z.name) !== ve(k))));
1555
+ }, ot = (d, k) => {
1556
+ const O = Math.round(d.loaded * 100 / d.total);
1557
+ if (O !== 100) {
1558
+ const V = ve(k.name);
1559
+ ge((z) => {
1560
+ const ce = z.find((B) => ve(B.name) === V), le = z.filter((B) => ve(B.name) !== V), ze = {
1561
+ name: V,
1562
+ progress: O,
1563
+ type: k.type,
1564
+ order: ce?.order ?? H.length + z.length
1566
1565
  };
1567
- return [...le, Ue];
1566
+ return [...le, ze];
1568
1567
  });
1569
1568
  }
1570
1569
  }, gt = (d) => {
1571
- he((x) => x.filter((V) => V.name !== be(d)));
1572
- }, Qt = (d) => {
1573
- for (const x of d) {
1574
- const V = We(x, f, at);
1575
- xe.current.set(x, V), V.then(
1576
- (j) => ot(j),
1577
- (j) => {
1578
- gt(x.name), Fe.error(j.message), console.warn(j);
1570
+ ge((k) => k.filter((O) => O.name !== ve(d)));
1571
+ }, Jt = (d) => {
1572
+ for (const k of d) {
1573
+ const O = Xe(k, f, ot);
1574
+ Ve.current.set(k, O), O.then(
1575
+ (V) => nt(V),
1576
+ (V) => {
1577
+ gt(k.name), Ce.error(V.message), console.warn(V);
1579
1578
  }
1580
1579
  );
1581
1580
  }
1582
- }, io = async (d) => {
1583
- we((x) => x + 1);
1581
+ }, lo = async (d) => {
1582
+ De((k) => k + 1);
1584
1583
  try {
1585
- const x = xe.current.get(d);
1586
- if (x) {
1587
- const { data: z } = await x;
1588
- return ne((ce) => ce.map((le) => le.id === z.id ? { ...le, isInline: !0 } : le)), {
1589
- src: gn(f, z.id),
1590
- name: be(d.name),
1584
+ const k = Ve.current.get(d);
1585
+ if (k) {
1586
+ const { data: z } = await k;
1587
+ return ee((ce) => ce.map((le) => le.id === z.id ? { ...le, isInline: !0 } : le)), {
1588
+ src: hn(f, z.id),
1589
+ name: ve(d.name),
1591
1590
  mime: d.type
1592
1591
  };
1593
1592
  }
1594
- const { data: V } = await We(d, f, void 0), j = be(d.name);
1595
- return ne((z) => [
1593
+ const { data: O } = await Xe(d, f, void 0), V = ve(d.name);
1594
+ return ee((z) => [
1596
1595
  ...z,
1597
- { id: V.id, name: j, mime: d.type, size: d.size, order: z.length, isInline: !0 }
1598
- ]), { src: gn(f, V.id), name: j, mime: d.type };
1599
- } catch (x) {
1600
- throw xe.current.has(d) || Fe.error(x?.message || "Upload failed"), x;
1596
+ { id: O.id, name: V, mime: d.type, size: d.size, order: z.length, isInline: !0 }
1597
+ ]), { src: hn(f, O.id), name: V, mime: d.type };
1598
+ } catch (k) {
1599
+ throw Ve.current.has(d) || Ce.error(k?.message || "Upload failed"), k;
1601
1600
  } finally {
1602
- we((x) => x - 1);
1601
+ De((k) => k - 1);
1603
1602
  }
1604
- }, so = (d) => {
1605
- K(!1), !d.defaultPrevented && Sr(
1603
+ }, uo = (d) => {
1604
+ ue(!1), !d.defaultPrevented && _r(
1606
1605
  d,
1607
1606
  f,
1608
- at,
1609
1607
  ot,
1610
- (x) => gt(x.name)
1608
+ nt,
1609
+ (k) => gt(k.name)
1611
1610
  );
1612
- }, co = (d) => {
1613
- d.preventDefault(), d.stopPropagation(), K(!0);
1614
- }, Yt = ge(null), lo = async ({ activity: d }) => {
1615
- const x = yt(d);
1616
- x && x.entityId === re?.id && (_e({ startFrame: x.startFrame, endFrame: x.endFrame }), $?.setDraft(x));
1617
- const V = Sn(d.body || ""), j = d.files || [], z = Rt(V), ce = b.length === 1 && b[0].id === (d.origin?.id ?? d.entityId), le = (B) => {
1618
- const pe = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), ie = `[Source](${Xo(d.activityId, pe)})`, Z = [B.trim(), ie].filter(Boolean).join(`
1611
+ }, mo = (d) => {
1612
+ d.preventDefault(), d.stopPropagation(), ue(!0);
1613
+ }, Kt = pe(null), po = async ({ activity: d }) => {
1614
+ const k = yt(d);
1615
+ k && k.entityId === re?.id && (Ee({ startFrame: k.startFrame, endFrame: k.endFrame }), $?.setDraft(k));
1616
+ const O = Sn(d.body || ""), V = d.files || [], z = $t(O), ce = w.length === 1 && w[0].id === (d.origin?.id ?? d.entityId), le = (B) => {
1617
+ const me = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), ie = `[Source](${ta(d.activityId, me)})`, te = [B.trim(), ie].filter(Boolean).join(`
1619
1618
 
1620
1619
  `);
1621
- de((ve) => ve.trim() ? `${ve.trim()}
1620
+ de((ye) => ye.trim() ? `${ye.trim()}
1622
1621
 
1623
- ${Z}` : Z), nt.current?.focus();
1624
- }, Ue = async (B) => {
1625
- const pe = z.has(B.id);
1622
+ ${te}` : te), tt.current?.focus();
1623
+ }, ze = async (B) => {
1624
+ const me = z.has(B.id);
1626
1625
  try {
1627
- const ie = await pn(
1626
+ const ie = await gn(
1628
1627
  f,
1629
1628
  B.id,
1630
1629
  B.name,
1631
1630
  B.mime,
1632
- pe ? void 0 : at
1631
+ me ? void 0 : ot
1633
1632
  );
1634
- if (pe) {
1635
- const { file: ve, data: rt } = ie, ht = be(ve.name);
1636
- ne((Zt) => [
1637
- ...Zt,
1638
- { id: rt.id, name: ht, mime: ve.type, size: ve.size, order: Zt.length, isInline: pe }
1633
+ if (me) {
1634
+ const { file: ye, data: at } = ie, ht = ve(ye.name);
1635
+ ee((tn) => [
1636
+ ...tn,
1637
+ { id: at.id, name: ht, mime: ye.type, size: ye.size, order: tn.length, isInline: me }
1639
1638
  ]);
1640
- } else ot(ie);
1641
- const Z = B.annotation;
1642
- if (Z && ce) {
1643
- const ve = await pn(
1639
+ } else nt(ie);
1640
+ const te = B.annotation;
1641
+ if (te && ce) {
1642
+ const ye = await gn(
1644
1643
  f,
1645
- Z.transparent,
1644
+ te.transparent,
1646
1645
  `annotation-${B.name}`,
1647
1646
  "image/png"
1648
1647
  );
1649
- ot(ve, !0), De((rt) => [
1650
- ...rt,
1648
+ nt(ye, !0), Ie((at) => [
1649
+ ...at,
1651
1650
  {
1652
- ...Z,
1653
- id: `${Z.id}-${wn()}`,
1651
+ ...te,
1652
+ id: `${te.id}-${xn()}`,
1654
1653
  composite: ie.data.id,
1655
- transparent: ve.data.id
1654
+ transparent: ye.data.id
1656
1655
  }
1657
1656
  ]);
1658
1657
  }
1659
1658
  return [B.id, ie.data.id];
1660
1659
  } catch (ie) {
1661
- return gt(B.name), Fe.error(`Could not copy ${B.name}`), console.warn(ie), null;
1660
+ return gt(B.name), Ce.error(`Could not copy ${B.name}`), console.warn(ie), null;
1662
1661
  }
1663
1662
  };
1664
- we((B) => B + 1);
1663
+ De((B) => B + 1);
1665
1664
  try {
1666
- const B = j.filter((Z) => z.has(Z.id)), pe = j.filter((Z) => !z.has(Z.id)), ie = Promise.all(pe.map(Ue));
1665
+ const B = V.filter((te) => z.has(te.id)), me = V.filter((te) => !z.has(te.id)), ie = Promise.all(me.map(ze));
1667
1666
  if (B.length) {
1668
- const Z = new Map(
1669
- (await Promise.all(B.map(Ue))).filter(
1670
- (ve) => !!ve
1667
+ const te = new Map(
1668
+ (await Promise.all(B.map(ze))).filter(
1669
+ (ye) => !!ye
1671
1670
  )
1672
1671
  );
1673
1672
  le(
1674
- V.replace(
1673
+ O.replace(
1675
1674
  /(\/api\/projects\/[^/]+\/files\/)([\w-]+)/g,
1676
- (ve, rt, ht) => Z.has(ht) ? rt + Z.get(ht) : ve
1675
+ (ye, at, ht) => te.has(ht) ? at + te.get(ht) : ye
1677
1676
  )
1678
1677
  );
1679
- } else le(V);
1678
+ } else le(O);
1680
1679
  await ie;
1681
1680
  } finally {
1682
- we((B) => B - 1);
1681
+ De((B) => B - 1);
1683
1682
  }
1684
1683
  };
1685
- G(() => {
1686
- !p || Yt.current === p.key || (Yt.current = p.key, wt(!0), g?.(), lo(p));
1684
+ W(() => {
1685
+ !p || Kt.current === p.key || (Kt.current = p.key, wt(!0), g?.(), po(p));
1687
1686
  }, [p?.key]);
1688
- const uo = Mr({
1687
+ const go = $r({
1689
1688
  projectName: f,
1690
- onSuccess: ot,
1691
- onProgress: at,
1689
+ onSuccess: nt,
1690
+ onProgress: ot,
1692
1691
  // seed progress so the card switches to uploading before the export finishes
1693
- onStart: (d) => at({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
1692
+ onStart: (d) => ot({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
1694
1693
  onError: (d) => gt(d.name)
1695
- }), mo = ke.length > 0 || Qe > 0, xt = Te || mo, kt = async () => {
1694
+ }), ho = be.length > 0 || Oe > 0, xt = xe || ho, kt = async () => {
1696
1695
  if (!xt)
1697
1696
  try {
1698
- Oe(!0);
1699
- let d = [], x = Se, V = [];
1697
+ he(!0);
1698
+ let d = [], k = Ne, O = [];
1700
1699
  if (fe.length) {
1701
- Ve(fe.map((Z) => Z.id));
1702
- const { files: pe, metadata: ie } = await uo(fe);
1703
- d = pe, x = [...x, ...ie], V = ie.map((Z) => Z.id), Ve(V);
1700
+ Re(fe.map((te) => te.id));
1701
+ const { files: me, metadata: ie } = await go(fe);
1702
+ d = me, k = [...k, ...ie], O = ie.map((te) => te.id), Re(O);
1704
1703
  }
1705
- const { annotations: j = [] } = a || {}, z = x.length ? [...j, ...x] : void 0, ce = Cr(nt.current?.getMarkdown() ?? U), le = ae.filter((pe) => !pe.isInline || hn(pe.id, ce)), Ue = [...le, ...d], B = {
1704
+ const { annotations: V = [] } = a || {}, z = k.length ? [...V, ...k] : void 0, ce = Sr(tt.current?.getMarkdown() ?? j), le = H.filter((me) => !me.isInline || fn(me.id, ce)), ze = [...le, ...d], B = {
1706
1705
  ...a,
1707
1706
  annotations: z,
1708
1707
  // could be undefined
1709
- category: E ? null : tt,
1708
+ category: E ? null : _e,
1710
1709
  // guests cannot set category (it is done by default on backend)
1711
1710
  // one frame link per comment, stored as metadata rather than in the text
1712
- startFrame: w?.startFrame ?? void 0,
1713
- endFrame: w?.endFrame ?? void 0
1711
+ startFrame: q?.startFrame ?? void 0,
1712
+ endFrame: q?.endFrame ?? void 0
1714
1713
  };
1715
- if ((ce || Ue.length) && c) {
1716
- const pe = U;
1717
- de(""), ne([]);
1714
+ if ((ce || ze.length) && l) {
1715
+ const me = j;
1716
+ de(""), ee([]);
1718
1717
  try {
1719
- await c(ce, Ue, B), V.forEach((ie) => Be?.(ie)), u && $?.setEditPreview(null), De([]), !u && w && $?.unlink(), u || _e(null);
1718
+ await l(ce, ze, B), O.forEach((ie) => He?.(ie)), u && $?.setEditPreview(null), Ie([]), !u && q && $?.unlink(), u || Ee(null);
1720
1719
  } catch {
1721
- de(pe), ne(le), De(Se);
1720
+ de(me), ee(le), Ie(Ne);
1722
1721
  return;
1723
1722
  }
1724
1723
  }
1725
1724
  } catch (d) {
1726
- console.error(d), Fe.error("Something went wrong");
1725
+ console.error(d), Ce.error("Something went wrong");
1727
1726
  } finally {
1728
- Ve([]), Oe(!1);
1727
+ Re([]), he(!1);
1729
1728
  }
1730
- }, Jt = [
1731
- ...fe.filter((d) => !Ye.includes(d.id)),
1732
- ...(ae || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1733
- ...ke
1734
- ].sort((d, x) => d.order - x.order), po = Jt.length > 3, Kt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", Xt = async (d) => {
1729
+ }, Xt = [
1730
+ ...fe.filter((d) => !Ze.includes(d.id)),
1731
+ ...(H || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1732
+ ...be
1733
+ ].sort((d, k) => d.order - k.order), fo = Xt.length > 3, Zt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", en = async (d) => {
1735
1734
  if (m)
1736
1735
  try {
1737
- (pt || ae.length > 0 || fe.length > 0) && await kt(), m(d);
1738
- } catch (x) {
1739
- console.error(x), Fe.error("Something went wrong while submitting the review");
1736
+ (pt || H.length > 0 || fe.length > 0) && await kt(), m(d);
1737
+ } catch (k) {
1738
+ console.error(k), Ce.error("Something went wrong while submitting the review");
1740
1739
  }
1741
- }, go = s && m && !h && /* @__PURE__ */ k(Lo, { className: ee("version-review-buttons", { guest: E }), children: [
1742
- /* @__PURE__ */ l(
1743
- nn,
1740
+ }, yo = s && m && !h && /* @__PURE__ */ x(Vo, { className: ne("version-review-buttons", { guest: E }), children: [
1741
+ /* @__PURE__ */ c(
1742
+ an,
1744
1743
  {
1745
1744
  icon: "check",
1746
1745
  variant: "tertiary",
1747
1746
  "data-tooltip": "Approve",
1748
- onClick: () => Xt(Ne.APPROVE),
1749
- children: /* @__PURE__ */ l("span", { className: "label", children: "Approve" })
1747
+ onClick: () => en(Se.APPROVE),
1748
+ children: /* @__PURE__ */ c("span", { className: "label", children: "Approve" })
1750
1749
  }
1751
1750
  ),
1752
- /* @__PURE__ */ l(
1753
- nn,
1751
+ /* @__PURE__ */ c(
1752
+ an,
1754
1753
  {
1755
1754
  icon: "refresh",
1756
1755
  variant: "danger",
1757
1756
  "data-tooltip": "Request changes",
1758
- onClick: () => Xt(Ne.REQUEST_CHANGES),
1759
- children: /* @__PURE__ */ l("span", { className: "label", children: "Request changes" })
1757
+ onClick: () => en(Se.REQUEST_CHANGES),
1758
+ children: /* @__PURE__ */ c("span", { className: "label", children: "Request changes" })
1760
1759
  }
1761
1760
  )
1762
- ] }), At = !E && /* @__PURE__ */ l(
1763
- Gr,
1761
+ ] }), At = !E && /* @__PURE__ */ c(
1762
+ Yr,
1764
1763
  {
1765
- value: tt,
1766
- categories: Vt,
1767
- onChange: (d) => Ot(d),
1764
+ value: _e,
1765
+ categories: Ut,
1766
+ onChange: (d) => mt(d),
1768
1767
  isCompact: u,
1769
- hasPowerpack: Y,
1770
- onPowerFeature: H,
1771
- isHidden: Hr(Vt, { isGuest: E, isAdmin: te })
1768
+ hasPowerpack: X,
1769
+ onPowerFeature: Q,
1770
+ isHidden: Jr(Ut, { isGuest: E, isAdmin: oe })
1772
1771
  }
1773
- ), ho = /* @__PURE__ */ k(Ce, { children: [
1774
- /* @__PURE__ */ l(
1775
- ct,
1772
+ ), vo = /* @__PURE__ */ x(Te, { children: [
1773
+ /* @__PURE__ */ c(
1774
+ st,
1776
1775
  {
1777
1776
  icon: "attach_file",
1778
1777
  variant: "text",
1779
1778
  className: "md-toolbar-button",
1780
1779
  "data-tooltip": "Attach files",
1781
1780
  onMouseDown: (d) => d.preventDefault(),
1782
- onClick: () => zt.current?.click()
1781
+ onClick: () => Gt.current?.click()
1783
1782
  }
1784
1783
  ),
1785
- /* @__PURE__ */ l(
1784
+ /* @__PURE__ */ c(
1786
1785
  "input",
1787
1786
  {
1788
- ref: zt,
1787
+ ref: Gt,
1789
1788
  type: "file",
1790
1789
  multiple: !0,
1791
1790
  hidden: !0,
1792
1791
  onChange: (d) => {
1793
- Qt(Array.from(d.target.files || [])), d.target.value = "";
1792
+ Jt(Array.from(d.target.files || [])), d.target.value = "";
1794
1793
  }
1795
1794
  }
1796
1795
  )
1797
- ] }), fo = u || oo, yo = `calc(${Math.max((Ae ? me || "Frame or range" : A || "").length, 1) + 2}ch + 16px)`;
1798
- return /* @__PURE__ */ l(Ce, { children: /* @__PURE__ */ k(
1799
- $o,
1796
+ ] }), bo = u || io, wo = `calc(${Math.max((ke ? K || "Frame or range" : v || "").length, 1) + 2}ch + 16px)`;
1797
+ return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(
1798
+ jo,
1800
1799
  {
1801
- ref: Bt,
1802
- className: ee("comment-container", "md-mention-anchor", { isOpen: y, isEditing: u }),
1803
- onDragOver: co,
1804
- onDragLeave: () => K(!1),
1805
- onDrop: so,
1806
- onClick: () => K(!1),
1800
+ ref: Ht,
1801
+ className: ne("comment-container", "md-mention-anchor", { isOpen: y, isEditing: u }),
1802
+ onDragOver: mo,
1803
+ onDragLeave: () => ue(!1),
1804
+ onDrop: uo,
1805
+ onClick: () => ue(!1),
1807
1806
  onKeyDown: (d) => {
1808
- const x = d.key === "ArrowUp" || d.key === "ArrowDown", V = d.target.isContentEditable;
1809
- x && V && Zn && !u || d.stopPropagation();
1807
+ const k = d.key === "ArrowUp" || d.key === "ArrowDown", O = d.target.isContentEditable;
1808
+ k && O && no && !u || d.stopPropagation();
1810
1809
  },
1811
1810
  children: [
1812
- s && i && /* @__PURE__ */ l(Zr, { lastOwnVersionReview: i }),
1813
- /* @__PURE__ */ k(
1814
- Oo,
1811
+ s && i && /* @__PURE__ */ c(ai, { lastOwnVersionReview: i }),
1812
+ /* @__PURE__ */ x(
1813
+ Uo,
1815
1814
  {
1816
- className: ee("block-shortcuts", {
1815
+ className: ne("block-shortcuts", {
1817
1816
  isOpen: y,
1818
1817
  isClosed: !y || h,
1819
1818
  isEditing: u,
1820
- isDropping: Me,
1819
+ isDropping: Ge,
1821
1820
  disabled: h,
1822
- isLoading: v,
1823
- isSubmitting: Te,
1824
- category: !!tt && !E
1821
+ isLoading: b,
1822
+ isSubmitting: xe,
1823
+ category: !!_e && !E
1825
1824
  }),
1826
- onClick: ao,
1827
- $categoryPrimary: jt?.color,
1828
- $categoryTertiary: Ut.primary,
1829
- $categorySecondary: Ut.secondary,
1825
+ onClick: so,
1826
+ $categoryPrimary: zt?.color,
1827
+ $categoryTertiary: Bt.primary,
1828
+ $categorySecondary: Bt.secondary,
1830
1829
  children: [
1831
- y && /* @__PURE__ */ l(
1832
- Pn,
1830
+ y && /* @__PURE__ */ c(
1831
+ _n,
1833
1832
  {
1834
- files: Jt,
1835
- isCompact: po || u,
1836
- onRemove: ro,
1833
+ files: Xt,
1834
+ isCompact: fo || u,
1835
+ onRemove: co,
1837
1836
  projectName: f,
1838
- onAnnotationClick: Ge,
1837
+ onAnnotationClick: qe,
1839
1838
  style: {
1840
1839
  borderBottom: "1px solid var(--md-sys-color-outline-variant)",
1841
1840
  height: "100%"
@@ -1851,131 +1850,131 @@ ${Z}` : Z), nt.current?.focus();
1851
1850
  }
1852
1851
  }
1853
1852
  ),
1854
- y && !h ? /* @__PURE__ */ k(Ce, { children: [
1855
- u && At && /* @__PURE__ */ l(Vo, { children: At }),
1856
- /* @__PURE__ */ l(
1857
- jo,
1853
+ y && !h ? /* @__PURE__ */ x(Te, { children: [
1854
+ u && At && /* @__PURE__ */ c(zo, { children: At }),
1855
+ /* @__PURE__ */ c(
1856
+ Bo,
1858
1857
  {
1859
- ref: nt,
1858
+ ref: tt,
1860
1859
  className: "comment-editor",
1861
- value: U,
1860
+ value: j,
1862
1861
  onChange: de,
1863
- placeholder: Kt(!0),
1864
- mentions: eo,
1862
+ placeholder: Zt(!0),
1863
+ mentions: oo,
1865
1864
  mentionPlacement: u ? "inline" : "top",
1866
- onMentionClick: to,
1867
- onMentionHover: no,
1865
+ onMentionClick: ao,
1866
+ onMentionHover: ro,
1868
1867
  onSubmit: kt,
1869
- onEscape: Wt,
1870
- onFiles: Qt,
1871
- onUploadMedia: io,
1872
- commands: bt,
1868
+ onEscape: Yt,
1869
+ onFiles: Jt,
1870
+ onUploadMedia: lo,
1871
+ commands: ut,
1873
1872
  toolbar: !u,
1874
1873
  floatingToolbar: u,
1875
1874
  toolbarStart: At,
1876
- toolbarEnd: /* @__PURE__ */ k(Ce, { children: [
1877
- /* @__PURE__ */ l(Uo, {}),
1878
- ho
1875
+ toolbarEnd: /* @__PURE__ */ x(Te, { children: [
1876
+ /* @__PURE__ */ c(Go, {}),
1877
+ vo
1879
1878
  ] }),
1880
1879
  bordered: !1,
1881
- autoFocus: fo,
1880
+ autoFocus: bo,
1882
1881
  minHeight: u ? 40 : 88,
1883
1882
  maxHeight: 259
1884
1883
  }
1885
1884
  )
1886
- ] }) : /* @__PURE__ */ l(zo, { children: Kt() }),
1887
- /* @__PURE__ */ k(Bo, { children: [
1888
- (!E || M) && /* @__PURE__ */ k(Go, { children: [
1889
- !E && ti.map(({ trigger: d, icon: x, tooltip: V }) => /* @__PURE__ */ l(
1890
- ct,
1885
+ ] }) : /* @__PURE__ */ c(Ho, { children: Zt() }),
1886
+ /* @__PURE__ */ x(qo, { children: [
1887
+ (!E || Pe) && /* @__PURE__ */ x(Wo, { children: [
1888
+ !E && ii.map(({ trigger: d, icon: k, tooltip: O }) => /* @__PURE__ */ c(
1889
+ st,
1891
1890
  {
1892
- icon: x,
1891
+ icon: k,
1893
1892
  variant: "text",
1894
- onMouseDown: (j) => j.preventDefault(),
1895
- onClick: () => nt.current?.insertMentionTrigger(d),
1896
- "data-tooltip": V,
1893
+ onMouseDown: (V) => V.preventDefault(),
1894
+ onClick: () => tt.current?.insertMentionTrigger(d),
1895
+ "data-tooltip": O,
1897
1896
  "data-shortcut": d
1898
1897
  },
1899
1898
  d
1900
1899
  )),
1901
- M && /* @__PURE__ */ k(
1902
- Ho,
1900
+ Pe && /* @__PURE__ */ x(
1901
+ Qo,
1903
1902
  {
1904
- className: ee("frame-link", { selected: !!w || Ae }),
1903
+ className: ne("frame-link", { selected: !!q || ke }),
1905
1904
  children: [
1906
- /* @__PURE__ */ l(
1907
- qo,
1905
+ /* @__PURE__ */ c(
1906
+ Yo,
1908
1907
  {
1909
1908
  icon: "timer",
1910
1909
  variant: "text",
1911
- onClick: et,
1912
- "aria-label": w ? "Remove frame link" : "Add frame link",
1913
- "data-tooltip": w ? "Remove frame link" : u ? "Add frame link" : "Link to current frame",
1910
+ onClick: bt,
1911
+ "aria-label": q ? "Remove frame link" : "Add frame link",
1912
+ "data-tooltip": q ? "Remove frame link" : u ? "Add frame link" : "Link to current frame",
1914
1913
  "data-testid": "comment-frame-link"
1915
1914
  }
1916
1915
  ),
1917
- (w || Ae) && (Ae ? /* @__PURE__ */ l(
1918
- Wo,
1916
+ (q || ke) && (ke ? /* @__PURE__ */ c(
1917
+ Jo,
1919
1918
  {
1920
1919
  autoFocus: !0,
1921
1920
  "aria-label": "Linked frame or range",
1922
- value: me,
1921
+ value: K,
1923
1922
  placeholder: "Frame",
1924
1923
  onFocus: (d) => {
1925
- Ee.current = w, d.currentTarget.select();
1924
+ Fe.current = q, d.currentTarget.select();
1926
1925
  },
1927
- onChange: (d) => Ke(d.target.value),
1928
- onBlur: Xe,
1929
- style: { width: yo },
1926
+ onChange: (d) => jt(d.target.value),
1927
+ onBlur: dt,
1928
+ style: { width: wo },
1930
1929
  onKeyDown: (d) => {
1931
- d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (Ie.current = !0, d.currentTarget.blur());
1930
+ d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (Ae.current = !0, d.currentTarget.blur());
1932
1931
  },
1933
1932
  "data-testid": "comment-frame-link-input"
1934
1933
  }
1935
- ) : /* @__PURE__ */ l(
1936
- Qo,
1934
+ ) : /* @__PURE__ */ c(
1935
+ Ko,
1937
1936
  {
1938
1937
  variant: "text",
1939
- "aria-label": `Edit linked frame ${A ?? ""}`,
1940
- onClick: () => Re(!0),
1938
+ "aria-label": `Edit linked frame ${v ?? ""}`,
1939
+ onClick: () => Me(!0),
1941
1940
  "data-tooltip": "Edit linked frame or range",
1942
- children: A || "Frame or range"
1941
+ children: v || "Frame or range"
1943
1942
  }
1944
1943
  ))
1945
1944
  ]
1946
1945
  }
1947
1946
  )
1948
1947
  ] }),
1949
- /* @__PURE__ */ k(Yo, { children: [
1950
- u && /* @__PURE__ */ l(ct, { variant: "text", onClick: Wt, children: "Cancel" }),
1951
- /* @__PURE__ */ l(
1952
- Io,
1948
+ /* @__PURE__ */ x(Xo, { children: [
1949
+ u && /* @__PURE__ */ c(st, { variant: "text", onClick: Yt, children: "Cancel" }),
1950
+ /* @__PURE__ */ c(
1951
+ Po,
1953
1952
  {
1954
1953
  label: u ? "Save" : "Comment",
1955
1954
  className: "comment",
1956
- active: pt || !!ae.length,
1955
+ active: pt || !!H.length,
1957
1956
  onClick: kt,
1958
- disabled: v || xt,
1957
+ disabled: b || xt,
1959
1958
  saving: xt
1960
1959
  }
1961
1960
  )
1962
1961
  ] })
1963
1962
  ] }),
1964
- /* @__PURE__ */ l(Jo, { className: ee({ show: Me && y }), children: /* @__PURE__ */ l(se, { icon: "cloud_upload" }) })
1963
+ /* @__PURE__ */ c(Zo, { className: ne({ show: Ge && y }), children: /* @__PURE__ */ c(se, { icon: "cloud_upload" }) })
1965
1964
  ]
1966
1965
  }
1967
1966
  ),
1968
- /* @__PURE__ */ l(Ko, {}),
1969
- go
1967
+ /* @__PURE__ */ c(ea, {}),
1968
+ yo
1970
1969
  ]
1971
1970
  }
1972
1971
  ) });
1973
- }, ni = (e, t, o) => e && Lt`
1972
+ }, si = (e, t, o) => e && Ot`
1974
1973
  --reaction-border-color: ${e};
1975
1974
  --reaction-active-bg: ${t};
1976
1975
  --reaction-hover-bg: ${t};
1977
1976
  --reaction-active-border: ${e};
1978
- `, oi = F.div`
1977
+ `, ci = F.div`
1979
1978
  /* VARS */
1980
1979
  --reaction-border-color: var(--md-sys-color-outline-variant);
1981
1980
  --reaction-hover-bg: var(--md-sys-color-surface-container-high-hover);
@@ -1988,7 +1987,7 @@ ${Z}` : Z), nt.current?.focus();
1988
1987
  --reaction-compact-active-hover-bg: var(--md-sys-color-primary-container-hover);
1989
1988
 
1990
1989
  /* CATEGORY */
1991
- ${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) => ni(e, t)}
1990
+ ${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) => si(e, t)}
1992
1991
 
1993
1992
  display: flex;
1994
1993
  justify-content: center;
@@ -2039,23 +2038,23 @@ ${Z}` : Z), nt.current?.focus();
2039
2038
  position: relative;
2040
2039
  height: 19px;
2041
2040
  }
2042
- `, ai = F.div`
2041
+ `, li = F.div`
2043
2042
  outline: 'solid 1px red';
2044
2043
  display: flex;
2045
2044
  gap: 8px;
2046
- `, ri = F.div`
2045
+ `, di = F.div`
2047
2046
  position: fixed;
2048
2047
  top: 0;
2049
2048
  bottom: 0;
2050
2049
  left: 0;
2051
2050
  right: 0;
2052
2051
  z-index: 55;
2053
- `, ii = F.div`
2052
+ `, ui = F.div`
2054
2053
  /* VARS */
2055
2054
  --panel-bg: var(--md-sys-color-surface-container-high);
2056
2055
 
2057
2056
  /* CATEGORY */
2058
- ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Lt`
2057
+ ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
2059
2058
  --panel-bg: ${t};
2060
2059
  `}
2061
2060
 
@@ -2071,14 +2070,14 @@ ${Z}` : Z), nt.current?.focus();
2071
2070
  padding: 4px;
2072
2071
  border-radius: 4px;
2073
2072
  box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.15);
2074
- `, si = F.div`
2073
+ `, mi = F.div`
2075
2074
  /* VARS */
2076
2075
  --opener-bg: var(--md-sys-color-surface-container-high);
2077
2076
  --opener-hover-bg: var(--md-sys-color-surface-container-high-hover);
2078
2077
  --opener-color: var(--md-sys-color-outline);
2079
2078
 
2080
2079
  /* CATEGORY */
2081
- ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Lt`
2080
+ ${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
2082
2081
  --opener-bg: ${t};
2083
2082
  --opener-hover-bg: ${t};
2084
2083
  --opener-color: ${e};
@@ -2101,31 +2100,31 @@ ${Z}` : Z), nt.current?.focus();
2101
2100
  filter: ${({ $categoryPrimary: e }) => e ? "brightness(1.2)" : "none"};
2102
2101
  }
2103
2102
  }
2104
- `, ci = F.div`
2103
+ `, pi = F.div`
2105
2104
  display: flex;
2106
2105
  gap: 8px;
2107
2106
  position: relative;
2108
- `, li = [
2107
+ `, gi = [
2109
2108
  { key: "thumb_up", value: "👍" },
2110
2109
  { key: "thumb_down", value: "👎" },
2111
2110
  { key: "heart_plus", value: "❤" },
2112
2111
  { key: "celebration", value: "🎉" },
2113
2112
  { key: "notes", value: "📝" }
2114
- ], di = {
2113
+ ], hi = {
2115
2114
  thumb_up: "👍",
2116
2115
  thumb_down: "👎",
2117
2116
  heart_plus: "❤️",
2118
2117
  celebration: "🎉",
2119
2118
  notes: "📝"
2120
- }, Et = [
2119
+ }, Mt = [
2121
2120
  "thumb_up",
2122
2121
  "thumb_down",
2123
2122
  "heart_plus",
2124
2123
  "celebration",
2125
2124
  "notes"
2126
- ], ui = (e) => [...e].sort(
2127
- (o, n) => Et.indexOf(o.type) - Et.indexOf(n.type)
2128
- ), Hn = ({
2125
+ ], fi = (e) => [...e].sort(
2126
+ (o, n) => Mt.indexOf(o.type) - Mt.indexOf(n.type)
2127
+ ), qn = ({
2129
2128
  reaction: e,
2130
2129
  variant: t = "standard",
2131
2130
  onClick: o,
@@ -2134,29 +2133,29 @@ ${Z}` : Z), nt.current?.focus();
2134
2133
  categoryTertiary: r
2135
2134
  }) => {
2136
2135
  const s = e.users?.join(", ") || void 0;
2137
- return /* @__PURE__ */ k(
2138
- oi,
2136
+ return /* @__PURE__ */ x(
2137
+ ci,
2139
2138
  {
2140
- className: ee(t, { active: e.isActive }),
2139
+ className: ne(t, { active: e.isActive }),
2141
2140
  onClick: o,
2142
2141
  "data-tooltip": s,
2143
2142
  $categoryPrimary: n,
2144
2143
  $categorySecondary: a,
2145
2144
  $categoryTertiary: r,
2146
2145
  children: [
2147
- /* @__PURE__ */ l("span", { className: "emoji", children: di[e.type] }),
2148
- e.users && /* @__PURE__ */ l("span", { children: e.users.length })
2146
+ /* @__PURE__ */ c("span", { className: "emoji", children: hi[e.type] }),
2147
+ e.users && /* @__PURE__ */ c("span", { children: e.users.length })
2149
2148
  ]
2150
2149
  }
2151
2150
  );
2152
- }, mi = ({
2151
+ }, yi = ({
2153
2152
  reactions: e,
2154
2153
  changeHandler: t,
2155
2154
  categoryPrimary: o,
2156
2155
  categorySecondary: n,
2157
2156
  categoryTertiary: a
2158
- }) => /* @__PURE__ */ l(ai, { children: e.map((r) => /* @__PURE__ */ l(
2159
- Hn,
2157
+ }) => /* @__PURE__ */ c(li, { children: e.map((r) => /* @__PURE__ */ c(
2158
+ qn,
2160
2159
  {
2161
2160
  reaction: r,
2162
2161
  isActive: r.isActive,
@@ -2168,22 +2167,22 @@ ${Z}` : Z), nt.current?.focus();
2168
2167
  categoryTertiary: a
2169
2168
  },
2170
2169
  r.type
2171
- )) }), pi = ({
2170
+ )) }), vi = ({
2172
2171
  reactions: e,
2173
2172
  changeHandler: t,
2174
2173
  categoryPrimary: o,
2175
2174
  categorySecondary: n,
2176
2175
  categoryTertiary: a
2177
2176
  }) => {
2178
- const [r, s] = L(!1), i = e.filter((c) => c.isActive).map((c) => c.type);
2179
- return /* @__PURE__ */ k(
2180
- si,
2177
+ const [r, s] = L(!1), i = e.filter((l) => l.isActive).map((l) => l.type);
2178
+ return /* @__PURE__ */ x(
2179
+ mi,
2181
2180
  {
2182
2181
  $categoryPrimary: o,
2183
2182
  $categorySecondary: n,
2184
2183
  $categoryTertiary: a,
2185
2184
  children: [
2186
- /* @__PURE__ */ l(
2185
+ /* @__PURE__ */ c(
2187
2186
  se,
2188
2187
  {
2189
2188
  icon: "add_reaction",
@@ -2191,21 +2190,21 @@ ${Z}` : Z), nt.current?.focus();
2191
2190
  onClick: () => s(!r)
2192
2191
  }
2193
2192
  ),
2194
- r && /* @__PURE__ */ k(Ce, { children: [
2195
- /* @__PURE__ */ l(ri, { onClick: () => s(!1) }),
2196
- /* @__PURE__ */ l(
2197
- ii,
2193
+ r && /* @__PURE__ */ x(Te, { children: [
2194
+ /* @__PURE__ */ c(di, { onClick: () => s(!1) }),
2195
+ /* @__PURE__ */ c(
2196
+ ui,
2198
2197
  {
2199
2198
  $categoryPrimary: o,
2200
2199
  $categorySecondary: n,
2201
2200
  $categoryTertiary: a,
2202
- children: li.map((c) => {
2201
+ children: gi.map((l) => {
2203
2202
  const m = {
2204
- type: c.key,
2205
- isActive: i.includes(c.key)
2203
+ type: l.key,
2204
+ isActive: i.includes(l.key)
2206
2205
  };
2207
- return /* @__PURE__ */ l(
2208
- Hn,
2206
+ return /* @__PURE__ */ c(
2207
+ qn,
2209
2208
  {
2210
2209
  reaction: m,
2211
2210
  variant: "compact",
@@ -2225,7 +2224,7 @@ ${Z}` : Z), nt.current?.focus();
2225
2224
  ]
2226
2225
  }
2227
2226
  );
2228
- }, gi = ({
2227
+ }, bi = ({
2229
2228
  reactions: e,
2230
2229
  changeHandler: t,
2231
2230
  readOnly: o,
@@ -2235,27 +2234,27 @@ ${Z}` : Z), nt.current?.focus();
2235
2234
  categoryTertiary: s
2236
2235
  }) => {
2237
2236
  const i = n ? { categoryPrimary: a, categorySecondary: r, categoryTertiary: s } : {};
2238
- return /* @__PURE__ */ k(ci, { children: [
2239
- !o && /* @__PURE__ */ l(
2240
- pi,
2237
+ return /* @__PURE__ */ x(pi, { children: [
2238
+ !o && /* @__PURE__ */ c(
2239
+ vi,
2241
2240
  {
2242
2241
  reactions: e,
2243
2242
  changeHandler: t,
2244
2243
  ...i
2245
2244
  }
2246
2245
  ),
2247
- /* @__PURE__ */ l(mi, { reactions: e, changeHandler: t, ...i })
2246
+ /* @__PURE__ */ c(yi, { reactions: e, changeHandler: t, ...i })
2248
2247
  ] });
2249
- }, hi = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2248
+ }, wi = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
2250
2249
  if (o.includes("http")) return [];
2251
2250
  const n = o.match(/\(([^)]+)\)/), a = n ? n[1].split(":") : [];
2252
2251
  return { type: a[0], id: a[1] };
2253
- }), fi = (e) => e.replace(/@(?=@|\[)/g, ""), yi = {
2252
+ }), xi = (e) => e.replace(/@(?=@|\[)/g, ""), ki = {
2254
2253
  "&": "&amp;",
2255
2254
  "<": "&lt;",
2256
2255
  ">": "&gt;",
2257
2256
  '"': "&quot;"
2258
- }, Ct = (e) => e.replace(/[&<>"]/g, (t) => yi[t]), vi = (e) => e.replaceAll(" ", "%20"), bi = (e, t) => {
2257
+ }, Ct = (e) => e.replace(/[&<>"]/g, (t) => ki[t]), Ai = (e) => e.replaceAll(" ", "%20"), Fi = (e, t) => {
2259
2258
  const o = t.cloneContents();
2260
2259
  if (!o.querySelector("[data-mention-value]")) return null;
2261
2260
  let n = "", a = "";
@@ -2270,11 +2269,11 @@ ${Z}` : Z), nt.current?.focus();
2270
2269
  return;
2271
2270
  }
2272
2271
  if (s.nodeType !== Node.ELEMENT_NODE) return;
2273
- const i = s, c = i.getAttribute("data-mention-value");
2274
- if (c) {
2272
+ const i = s, l = i.getAttribute("data-mention-value");
2273
+ if (l) {
2275
2274
  const m = i.getAttribute("data-mention-label") || (i.textContent || "").trim();
2276
2275
  if (m) {
2277
- const p = vi(c);
2276
+ const p = Ai(l);
2278
2277
  n += `[${m}](${p})`, a += `<a href="@${Ct(p)}">@${Ct(m)}</a>`;
2279
2278
  }
2280
2279
  return;
@@ -2293,37 +2292,37 @@ ${Z}` : Z), nt.current?.focus();
2293
2292
  s.childNodes.forEach(r);
2294
2293
  };
2295
2294
  return r(o), n ? { text: n, html: a } : null;
2296
- }, wi = ({ children: e }) => {
2297
- const t = en.Children.map(e, (n) => {
2298
- if (!en.isValidElement(n)) return n;
2295
+ }, Ci = ({ children: e }) => {
2296
+ const t = nn.Children.map(e, (n) => {
2297
+ if (!nn.isValidElement(n)) return n;
2299
2298
  const a = n.props.children;
2300
2299
  return typeof a != "string" ? n : {
2301
2300
  ...n,
2302
2301
  props: {
2303
2302
  ...n.props,
2304
- children: fi(a)
2303
+ children: xi(a)
2305
2304
  }
2306
2305
  };
2307
- }), o = qe((n) => {
2306
+ }), o = Je((n) => {
2308
2307
  const a = window.getSelection();
2309
2308
  if (!a || a.rangeCount === 0 || a.isCollapsed) return;
2310
2309
  const r = a.getRangeAt(0), s = n.currentTarget;
2311
2310
  if (!s.contains(r.startContainer) || !s.contains(r.endContainer)) return;
2312
- const i = bi(s, r);
2311
+ const i = Fi(s, r);
2313
2312
  i && (n.preventDefault(), n.clipboardData.setData("text/plain", i.text), n.clipboardData.setData("text/html", i.html));
2314
2313
  }, []);
2315
- return /* @__PURE__ */ l("div", { className: "comment-text", onCopy: o, children: t });
2316
- }, xi = (e = [], t) => {
2314
+ return /* @__PURE__ */ c("div", { className: "comment-text", onCopy: o, children: t });
2315
+ }, Ti = (e = [], t) => {
2317
2316
  let o = {};
2318
2317
  return e.forEach((n) => {
2319
2318
  const a = n.reaction;
2320
- Et.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), t == n.userName && (o[a].isActive = !0), o[a].users?.push(n.fullName || n.userName));
2321
- }), ui(Object.values(o));
2322
- }, ki = F.div`
2319
+ Mt.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), t == n.userName && (o[a].isActive = !0), o[a].users?.push(n.fullName || n.userName));
2320
+ }), fi(Object.values(o));
2321
+ }, Di = F.div`
2323
2322
  display: flex;
2324
2323
  align-items: center;
2325
2324
  gap: var(--base-gap-small);
2326
- `, Ai = F.span`
2325
+ `, Ni = F.span`
2327
2326
  border-radius: var(--border-radius-m);
2328
2327
  padding: 2px 6px;
2329
2328
  margin: 0 2px;
@@ -2340,19 +2339,19 @@ ${Z}` : Z), nt.current?.focus();
2340
2339
  font-size: 16px;
2341
2340
  font-variation-settings: 'FILL' 1;
2342
2341
  }
2343
- `, Fi = ({ name: e, statuses: t, children: o }) => {
2344
- const n = Ci(e, t);
2345
- return /* @__PURE__ */ k(ki, { children: [
2342
+ `, Ii = ({ name: e, statuses: t, children: o }) => {
2343
+ const n = Si(e, t);
2344
+ return /* @__PURE__ */ x(Di, { children: [
2346
2345
  o,
2347
- /* @__PURE__ */ k(Ai, { $color: _t(n.color), style: { backgroundColor: n.color }, children: [
2348
- n.icon && /* @__PURE__ */ l(se, { icon: n.icon }),
2346
+ /* @__PURE__ */ x(Ni, { $color: Lt(n.color), style: { backgroundColor: n.color }, children: [
2347
+ n.icon && /* @__PURE__ */ c(se, { icon: n.icon }),
2349
2348
  e
2350
2349
  ] })
2351
2350
  ] });
2352
- }, Ci = (e, t) => {
2351
+ }, Si = (e, t) => {
2353
2352
  const o = { name: e, color: "var(--md-sys-color-primary)", icon: void 0 };
2354
2353
  return t.find((n) => n.name === e) || o;
2355
- }, Ti = F.header`
2354
+ }, Ei = F.header`
2356
2355
  display: flex;
2357
2356
  align-items: flex-end;
2358
2357
  gap: var(--base-gap-small);
@@ -2364,7 +2363,7 @@ ${Z}` : Z), nt.current?.focus();
2364
2363
  margin-left: 4px;
2365
2364
  font-weight: 800;
2366
2365
  }
2367
- `, Di = F.div`
2366
+ `, Mi = F.div`
2368
2367
  display: flex;
2369
2368
  gap: var(--base-gap-small);
2370
2369
  align-items: center;
@@ -2393,7 +2392,7 @@ const Tt = F.span`
2393
2392
  strong {
2394
2393
  font-weight: 800;
2395
2394
  }
2396
- `, Ni = F.li`
2395
+ `, Pi = F.li`
2397
2396
  list-style: none;
2398
2397
  margin: var(--padding-s) var(--padding-m);
2399
2398
  padding: var(--padding-s) var(--padding-m) var(--padding-s) 0;
@@ -2420,7 +2419,7 @@ const Tt = F.span`
2420
2419
  &.request_changes .date, {
2421
2420
  color: var(--md-sys-color-error);
2422
2421
  }
2423
- `, Si = F.div`
2422
+ `, _i = F.div`
2424
2423
  display: flex;
2425
2424
  flex-wrap: nowrap;
2426
2425
  align-items: center;
@@ -2439,7 +2438,7 @@ const Tt = F.span`
2439
2438
  color: var(--md-sys-color-outline);
2440
2439
  opacity: 0.5;
2441
2440
  }
2442
- `, Ii = F.span`
2441
+ `, Ri = F.span`
2443
2442
  white-space: nowrap;
2444
2443
  font-size: 12px;
2445
2444
  text-overflow: ellipsis;
@@ -2450,16 +2449,16 @@ const Tt = F.span`
2450
2449
  font-size: 12px;
2451
2450
  font-weight: 800;
2452
2451
  }
2453
- `, Ei = "#c5c5c5";
2454
- function qn(e) {
2455
- const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } = S(() => {
2452
+ `, Li = "#c5c5c5";
2453
+ function Wn(e) {
2454
+ const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } = I(() => {
2456
2455
  let a = !1;
2457
2456
  if (e) {
2458
2457
  const r = t.find((s) => s.name === e);
2459
2458
  return r || (a = !0), {
2460
2459
  categoryData: r || {
2461
2460
  name: e,
2462
- color: Ei
2461
+ color: Li
2463
2462
  },
2464
2463
  categoryNotFound: a
2465
2464
  };
@@ -2471,21 +2470,21 @@ function qn(e) {
2471
2470
  }, [e, t]);
2472
2471
  return { categoryData: o, categoryNotFound: n };
2473
2472
  }
2474
- const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (e) => !e || !e.name ? _i : e.name === Mi && !e.label ? Pi : e.label ? e.label : e.name, Mt = "anonymous.guest", Ri = ({ isGuest: e, activity: t }) => {
2475
- const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s = S(
2473
+ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (e) => !e || !e.name ? Vi : e.name === $i && !e.label ? Oi : e.label ? e.label : e.name, Pt = "anonymous.guest", ji = ({ isGuest: e, activity: t }) => {
2474
+ const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s = I(
2476
2475
  () => [
2477
- Wn({ name: o, label: n }),
2478
- Un(r?.feedback ?? Ne.APPROVE)
2476
+ Qn({ name: o, label: n }),
2477
+ zn(r?.feedback ?? Se.APPROVE)
2479
2478
  ].join(" "),
2480
2479
  [n, o, r?.feedback, a]
2481
- ), { categoryData: i, categoryNotFound: c } = qn(r?.category), m = S(() => {
2482
- if (!o?.startsWith(Mt))
2480
+ ), { categoryData: i, categoryNotFound: l } = Wn(r?.category), m = I(() => {
2481
+ if (!o?.startsWith(Pt))
2483
2482
  return `/api/users/${o}/avatar`;
2484
2483
  }, [o]);
2485
2484
  if (r?.feedback)
2486
- return /* @__PURE__ */ l(Ni, { className: xn(r.feedback), children: /* @__PURE__ */ k(Si, { children: [
2487
- o && /* @__PURE__ */ l(
2488
- Tn,
2485
+ return /* @__PURE__ */ c(Pi, { className: kn(r.feedback), children: /* @__PURE__ */ x(_i, { children: [
2486
+ o && /* @__PURE__ */ c(
2487
+ Dn,
2489
2488
  {
2490
2489
  name: o,
2491
2490
  fullName: n,
@@ -2493,21 +2492,21 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2493
2492
  size: 22
2494
2493
  }
2495
2494
  ),
2496
- /* @__PURE__ */ l(se, { icon: zn(r.feedback) }),
2497
- i && !e && /* @__PURE__ */ l(
2498
- st,
2495
+ /* @__PURE__ */ c(se, { icon: Bn(r.feedback) }),
2496
+ i && !e && /* @__PURE__ */ c(
2497
+ it,
2499
2498
  {
2500
2499
  value: i.name,
2501
2500
  color: i.color,
2502
2501
  isCompact: !0,
2503
- "data-tooltip": c ? "Category not found. It may have been deleted." : void 0,
2502
+ "data-tooltip": l ? "Category not found. It may have been deleted." : void 0,
2504
2503
  "data-tooltip-delay": 0
2505
2504
  }
2506
2505
  ),
2507
- /* @__PURE__ */ l(Ii, { children: s }),
2508
- /* @__PURE__ */ l(ut, { date: a, exactTooltip: !0 })
2506
+ /* @__PURE__ */ c(Ri, { children: s }),
2507
+ /* @__PURE__ */ c(lt, { date: a, exactTooltip: !0 })
2509
2508
  ] }) });
2510
- }, Qn = ({
2509
+ }, Yn = ({
2511
2510
  name: e,
2512
2511
  fullName: t,
2513
2512
  date: o,
@@ -2516,34 +2515,34 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2516
2515
  children: r,
2517
2516
  projectName: s,
2518
2517
  entityType: i,
2519
- onReferenceClick: c,
2518
+ onReferenceClick: l,
2520
2519
  onReferenceTooltip: m
2521
2520
  }) => {
2522
- const { referenceType: p, origin: g, activityType: u, versions: h, activityId: v } = a, y = p === "mention", D = u === "version.publish", C = h && h?.length > 1 ? "published versions" : "published a version", f = y ? "mentioned" : "commented", b = y ? ` ${i} on` : "on", T = e?.startsWith("guest.") || e?.startsWith(Mt), I = (a.author?.deleted || !a.author?.active) && !T, _ = S(() => {
2523
- if (!e?.startsWith(Mt))
2521
+ const { referenceType: p, origin: g, activityType: u, versions: h, activityId: b } = a, y = p === "mention", D = u === "version.publish", C = h && h?.length > 1 ? "published versions" : "published a version", f = y ? "mentioned" : "commented", w = y ? ` ${i} on` : "on", A = e?.startsWith("guest.") || e?.startsWith(Pt), S = (a.author?.deleted || !a.author?.active) && !A, P = I(() => {
2522
+ if (!e?.startsWith(Pt))
2524
2523
  return `/api/users/${e}/avatar`;
2525
2524
  }, [e]);
2526
- return /* @__PURE__ */ k(Ti, { children: [
2527
- /* @__PURE__ */ k(Di, { children: [
2528
- e && !I && /* @__PURE__ */ l(Tn, { name: e, fullName: t, src: _, size: 22 }),
2529
- I && /* @__PURE__ */ l(se, { icon: "account_circle" }),
2530
- /* @__PURE__ */ l("h5", { children: t || a.activityData?.author || "Unknown" }),
2531
- n && /* @__PURE__ */ k(Ce, { children: [
2532
- /* @__PURE__ */ l(Tt, { children: /* @__PURE__ */ l("strong", { children: f }) }),
2533
- /* @__PURE__ */ l(Tt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: b }),
2534
- g && /* @__PURE__ */ l(
2535
- Zo,
2525
+ return /* @__PURE__ */ x(Ei, { children: [
2526
+ /* @__PURE__ */ x(Mi, { children: [
2527
+ e && !S && /* @__PURE__ */ c(Dn, { name: e, fullName: t, src: P, size: 22 }),
2528
+ S && /* @__PURE__ */ c(se, { icon: "account_circle" }),
2529
+ /* @__PURE__ */ c("h5", { children: t || a.activityData?.author || "Unknown" }),
2530
+ n && /* @__PURE__ */ x(Te, { children: [
2531
+ /* @__PURE__ */ c(Tt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
2532
+ /* @__PURE__ */ c(Tt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: w }),
2533
+ g && /* @__PURE__ */ c(
2534
+ na,
2536
2535
  {
2537
2536
  id: g.id,
2538
2537
  type: g.type,
2539
2538
  variant: "text",
2540
- onClick: () => c?.({
2539
+ onClick: () => l?.({
2541
2540
  entityId: g.id,
2542
2541
  entityType: g.type,
2543
2542
  projectName: s,
2544
- activityId: v
2543
+ activityId: b
2545
2544
  }),
2546
- onMouseEnter: (R, E) => m?.({
2545
+ onMouseEnter: (_, E) => m?.({
2547
2546
  type: g.type,
2548
2547
  id: g.id,
2549
2548
  label: g.label,
@@ -2554,13 +2553,13 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2554
2553
  }
2555
2554
  )
2556
2555
  ] }),
2557
- D && /* @__PURE__ */ l(Tt, { children: C }),
2556
+ D && /* @__PURE__ */ c(Tt, { children: C }),
2558
2557
  r
2559
2558
  ] }),
2560
- /* @__PURE__ */ l(ut, { date: o })
2559
+ /* @__PURE__ */ c(lt, { date: o })
2561
2560
  ] });
2562
- }, Li = ({ flags: e }) => e.length ? /* @__PURE__ */ l(ea, { children: e.map(({ id: t, label: o, icon: n, tooltip: a, onClick: r, disabled: s, testId: i }) => /* @__PURE__ */ k(
2563
- ta,
2561
+ }, Ui = ({ flags: e }) => e.length ? /* @__PURE__ */ c(oa, { children: e.map(({ id: t, label: o, icon: n, tooltip: a, onClick: r, disabled: s, testId: i }) => /* @__PURE__ */ x(
2562
+ aa,
2564
2563
  {
2565
2564
  as: r ? "button" : "span",
2566
2565
  type: r ? "button" : void 0,
@@ -2570,12 +2569,12 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2570
2569
  "data-tooltip-delay": 0,
2571
2570
  "data-testid": i,
2572
2571
  children: [
2573
- n && /* @__PURE__ */ l(se, { icon: n }),
2572
+ n && /* @__PURE__ */ c(se, { icon: n }),
2574
2573
  o
2575
2574
  ]
2576
2575
  },
2577
2576
  t
2578
- )) }) : null, $i = ({
2577
+ )) }) : null, zi = ({
2579
2578
  category: e,
2580
2579
  categoryNotFound: t,
2581
2580
  frameLink: o,
@@ -2602,7 +2601,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2602
2601
  testId: "comment-frame-link-chip"
2603
2602
  }
2604
2603
  ] : []
2605
- ], Oi = ({
2604
+ ], Bi = ({
2606
2605
  onDelete: e,
2607
2606
  onEdit: t,
2608
2607
  onCopyText: o,
@@ -2612,37 +2611,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2612
2611
  projectName: s,
2613
2612
  entity: i
2614
2613
  }) => {
2615
- const c = [], m = (p) => () => {
2614
+ const l = [], m = (p) => () => {
2616
2615
  a?.(), p();
2617
2616
  };
2618
- return t && c.push({
2617
+ return t && l.push({
2619
2618
  id: "edit",
2620
2619
  label: "Edit",
2621
2620
  icon: "edit_square",
2622
2621
  onClick: m(t)
2623
- }), o && c.push({
2622
+ }), o && l.push({
2624
2623
  id: "copy-text",
2625
2624
  label: "Copy text",
2626
2625
  icon: "content_copy",
2627
2626
  onClick: m(o)
2628
- }), n && c.push({
2627
+ }), n && l.push({
2629
2628
  id: "duplicate",
2630
2629
  label: "Duplicate",
2631
2630
  icon: "library_add",
2632
2631
  onClick: m(n)
2633
- }), c.push({
2632
+ }), l.push({
2634
2633
  id: "copy-link",
2635
2634
  label: "Copy link",
2636
2635
  icon: "link",
2637
- onClick: m(() => En(na(s, r, i)))
2638
- }), e && c.push({
2636
+ onClick: m(() => Mn(ra(s, r, i)))
2637
+ }), e && l.push({
2639
2638
  id: "delete",
2640
2639
  label: "Delete",
2641
2640
  icon: "delete",
2642
2641
  onClick: m(e),
2643
2642
  danger: !0
2644
- }), /* @__PURE__ */ l(Qa, { menu: c });
2645
- }, Vi = ({
2643
+ }), /* @__PURE__ */ c(Za, { menu: l });
2644
+ }, Gi = ({
2646
2645
  activity: e = {},
2647
2646
  annotationFrameStart: t,
2648
2647
  onCheckChange: o,
@@ -2651,277 +2650,277 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2651
2650
  onDuplicate: r,
2652
2651
  projectInfo: s,
2653
2652
  editProps: i,
2654
- projectName: c,
2653
+ projectName: l,
2655
2654
  entityType: m,
2656
2655
  onReferenceClick: p,
2657
2656
  onFileExpand: g,
2658
2657
  showOrigin: u,
2659
2658
  isHighlighted: h,
2660
- readOnly: v,
2659
+ readOnly: b,
2661
2660
  statuses: y = []
2662
2661
  }) => {
2663
2662
  const {
2664
2663
  userName: D,
2665
- createReaction: P,
2664
+ createReaction: M,
2666
2665
  deleteReaction: C,
2667
2666
  editingId: f,
2668
- setEditingId: b,
2669
- isGuest: T,
2670
- userTeamNames: I
2671
- } = $e(), _ = ge(null), { toggleMenuOpen: R, menuOpen: E } = Oa(), { categoryData: N, categoryNotFound: Q } = qn(e?.activityData?.category), Y = _n(N?.color);
2667
+ setEditingId: w,
2668
+ isGuest: A,
2669
+ userTeamNames: S
2670
+ } = $e(), P = pe(null), { toggleMenuOpen: _, menuOpen: E } = Ba(), { categoryData: N, categoryNotFound: G } = Wn(e?.activityData?.category), X = Rn(N?.color);
2672
2671
  let {
2673
- body: H,
2674
- authorName: J,
2675
- authorFullName: q,
2672
+ body: Q,
2673
+ authorName: Z,
2674
+ authorFullName: Y,
2676
2675
  createdAt: $,
2677
- referenceType: te,
2678
- entityId: oe,
2679
- activityId: W,
2680
- author: U,
2676
+ referenceType: oe,
2677
+ entityId: ae,
2678
+ activityId: J,
2679
+ author: j,
2681
2680
  isOwner: de,
2682
- files: ae = [],
2683
- origin: ne
2681
+ files: H = [],
2682
+ origin: ee
2684
2683
  } = e;
2685
- J || (J = U?.name || ""), q = Wn({ name: J, label: q });
2686
- const Qe = wo(), we = `activity-comment-menu-${W}-${Qe}`, xe = E === we, { onGoToFrame: ke, setHighlightedActivities: he, user: Me, commentFrameLink: K } = ze(), Te = !!Me?.data?.isAdmin, Oe = de || Te, Se = de || Te, De = () => {
2687
- b(W);
2688
- }, Ye = () => {
2689
- b(null);
2690
- }, Ve = async (A, me, ye) => {
2691
- await a?.(A, me, void 0, ye), b(null);
2692
- }, fe = f === W, Be = ({ activityId: A, url: me }) => {
2693
- document.getElementById(A) ? he([A]) : window.open(me, "_blank", "noreferrer");
2694
- }, Ge = te !== "origin" || u, re = async () => {
2695
- const A = hi(H);
2696
- Ge && ne && A.push({ id: ne.id, type: ne.type }), n && await n(W, oe, A);
2697
- }, Je = () => {
2698
- or({
2684
+ Z || (Z = j?.name || ""), Y = Qn({ name: Z, label: Y });
2685
+ const Oe = Ao(), De = `activity-comment-menu-${J}-${Oe}`, Ve = E === De, { onGoToFrame: be, setHighlightedActivities: ge, user: Ge, commentFrameLink: ue } = Be(), xe = !!Ge?.data?.isAdmin, he = de || xe, Ne = de || xe, Ie = () => {
2686
+ w(J);
2687
+ }, Ze = () => {
2688
+ w(null);
2689
+ }, Re = async (v, K, we) => {
2690
+ await a?.(v, K, void 0, we), w(null);
2691
+ }, fe = f === J, He = ({ activityId: v, url: K }) => {
2692
+ document.getElementById(v) ? ge([v]) : window.open(K, "_blank", "noreferrer");
2693
+ }, qe = oe !== "origin" || u, re = async () => {
2694
+ const v = wi(Q);
2695
+ qe && ee && v.push({ id: ee.id, type: ee.type }), n && await n(J, ae, v);
2696
+ }, et = () => {
2697
+ cr({
2699
2698
  title: "Delete comment",
2700
2699
  message: "Are you sure you want to delete this comment?",
2701
2700
  accept: async () => {
2702
2701
  await re();
2703
2702
  }
2704
2703
  });
2705
- }, [, Pe] = In(), He = S(
2706
- () => xi(e.reactions, D),
2704
+ }, [, je] = En(), We = I(
2705
+ () => Ti(e.reactions, D),
2707
2706
  [[...e.reactions || []]]
2708
- ), _e = (A) => {
2709
- A.isActive ? P({
2710
- projectName: c,
2707
+ ), Ee = (v) => {
2708
+ v.isActive ? M({
2709
+ projectName: l,
2711
2710
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2712
2711
  userName: D,
2713
- activityId: W,
2712
+ activityId: J,
2714
2713
  createReactionModel: {
2715
- reaction: A.type
2714
+ reaction: v.type
2716
2715
  }
2717
2716
  }) : C({
2718
- projectName: c,
2717
+ projectName: l,
2719
2718
  // @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
2720
2719
  userName: D,
2721
- activityId: W,
2722
- reaction: A.type
2720
+ activityId: J,
2721
+ reaction: v.type
2723
2722
  });
2724
- }, je = qe(
2725
- (A) => {
2726
- A.annotation && (ke?.(A.annotation.range[0]), he([W]));
2723
+ }, Ue = Je(
2724
+ (v) => {
2725
+ v.annotation && (be?.(v.annotation.range[0]), ge([J]));
2727
2726
  },
2728
- [ke]
2729
- ), Ae = S(() => Rt(H), [H]), Re = S(
2730
- () => (ae || []).filter((A) => !Ae.has(A.id)),
2731
- [ae, Ae]
2732
- ), w = (A) => {
2733
- const me = ua(A), ye = (ae || []).filter((Ee) => vt(Ee.mime, Ee.ext)), Ie = ye.findIndex((Ee) => Ee.id === me);
2734
- Ie !== -1 && g?.({ files: ye, index: Ie, activityId: W });
2735
- }, M = S(() => Sn(H || ""), [H]), O = S(() => yt(e), [e]), X = K?.formatFrame ?? ((A) => Bn(A, t)), ue = () => {
2736
- O && (K ? K.goTo(O) : ke?.(O.startFrame), he([W]));
2727
+ [be]
2728
+ ), ke = I(() => $t(Q), [Q]), Me = I(
2729
+ () => (H || []).filter((v) => !ke.has(v.id)),
2730
+ [H, ke]
2731
+ ), q = (v) => {
2732
+ const K = ga(v), we = (H || []).filter((Fe) => vt(Fe.mime, Fe.ext)), Ae = we.findIndex((Fe) => Fe.id === K);
2733
+ Ae !== -1 && g?.({ files: we, index: Ae, activityId: J });
2734
+ }, Pe = I(() => Sn(Q || ""), [Q]), T = I(() => yt(e), [e]), R = ue?.formatFrame ?? ((v) => Gn(v, t)), U = () => {
2735
+ T && (ue ? ue.goTo(T) : be?.(T.startFrame), ge([J]));
2737
2736
  };
2738
- return /* @__PURE__ */ k(Ce, { children: [
2739
- /* @__PURE__ */ k(
2740
- oa,
2737
+ return /* @__PURE__ */ x(Te, { children: [
2738
+ /* @__PURE__ */ x(
2739
+ ia,
2741
2740
  {
2742
- className: ee("comment", {
2741
+ className: ne("comment", {
2743
2742
  isOwner: de,
2744
2743
  isEditing: fe,
2745
2744
  isHighlighted: h,
2746
- category: !!N && !T,
2747
- menuOpen: xe
2745
+ category: !!N && !A,
2746
+ menuOpen: Ve
2748
2747
  }),
2749
- id: W,
2748
+ id: J,
2750
2749
  $categoryPrimary: N?.color,
2751
- $categoryTertiary: Y.primary,
2752
- $categorySecondary: Y.secondary,
2750
+ $categoryTertiary: X.primary,
2751
+ $categorySecondary: X.secondary,
2753
2752
  children: [
2754
- /* @__PURE__ */ l(
2755
- Qn,
2753
+ /* @__PURE__ */ c(
2754
+ Yn,
2756
2755
  {
2757
- name: J,
2758
- fullName: q,
2756
+ name: Z,
2757
+ fullName: Y,
2759
2758
  date: $,
2760
- isRef: Ge,
2759
+ isRef: qe,
2761
2760
  activity: e,
2762
- projectName: c,
2761
+ projectName: l,
2763
2762
  entityType: m,
2764
2763
  onReferenceClick: p,
2765
- onReferenceTooltip: Pe,
2764
+ onReferenceTooltip: je,
2766
2765
  children: void 0
2767
2766
  }
2768
2767
  ),
2769
- /* @__PURE__ */ k(aa, { className: ee("comment-body", { isEditing: fe }), children: [
2770
- !v && /* @__PURE__ */ k(ra, { className: "tools", children: [
2771
- Se && /* @__PURE__ */ l(on, { icon: "edit_square", onClick: De, variant: "text" }),
2772
- /* @__PURE__ */ l(
2773
- on,
2768
+ /* @__PURE__ */ x(sa, { className: ne("comment-body", { isEditing: fe }), children: [
2769
+ !b && /* @__PURE__ */ x(ca, { className: "tools", children: [
2770
+ Ne && /* @__PURE__ */ c(rn, { icon: "edit_square", onClick: Ie, variant: "text" }),
2771
+ /* @__PURE__ */ c(
2772
+ rn,
2774
2773
  {
2775
2774
  icon: "more_horiz",
2776
- ref: _,
2777
- onClick: (A) => {
2778
- A.stopPropagation(), R(we);
2775
+ ref: P,
2776
+ onClick: (v) => {
2777
+ v.stopPropagation(), _(De);
2779
2778
  },
2780
- className: xe ? "active" : ""
2779
+ className: Ve ? "active" : ""
2781
2780
  }
2782
2781
  )
2783
2782
  ] }),
2784
- fe ? /* @__PURE__ */ l(
2785
- Gn,
2783
+ fe ? /* @__PURE__ */ c(
2784
+ Hn,
2786
2785
  {
2787
- initValue: H,
2788
- initFiles: ae,
2786
+ initValue: Q,
2787
+ initFiles: H,
2789
2788
  annotationFrameStart: t,
2790
2789
  initCategory: N?.name,
2791
2790
  data: e.activityData,
2792
- activityId: W,
2791
+ activityId: J,
2793
2792
  versionReview: !1,
2794
2793
  isEditing: !0,
2795
- onClose: Ye,
2796
- onSubmit: Ve,
2794
+ onClose: Ze,
2795
+ onSubmit: Re,
2797
2796
  isOpen: !0,
2798
2797
  ...i
2799
2798
  }
2800
- ) : /* @__PURE__ */ k(Ce, { children: [
2801
- /* @__PURE__ */ l(
2802
- Li,
2799
+ ) : /* @__PURE__ */ x(Te, { children: [
2800
+ /* @__PURE__ */ c(
2801
+ Ui,
2803
2802
  {
2804
- flags: $i({
2803
+ flags: zi({
2805
2804
  category: N,
2806
- categoryNotFound: Q,
2807
- frameLink: O,
2808
- formatFrame: X,
2809
- onFrameLinkClick: ue,
2810
- canNavigateToFrame: !!K || !!ke,
2811
- isGuest: T
2805
+ categoryNotFound: G,
2806
+ frameLink: T,
2807
+ formatFrame: R,
2808
+ onFrameLinkClick: U,
2809
+ canNavigateToFrame: !!ue || !!be,
2810
+ isGuest: A
2812
2811
  })
2813
2812
  }
2814
2813
  ),
2815
- /* @__PURE__ */ l(wi, { children: /* @__PURE__ */ l(
2816
- kn,
2814
+ /* @__PURE__ */ c(Ci, { children: /* @__PURE__ */ c(
2815
+ An,
2817
2816
  {
2818
2817
  remarkPlugins: [
2818
+ Cn,
2819
2819
  Fn,
2820
- An,
2821
- ko,
2822
- Jr,
2823
- Ao
2820
+ Co,
2821
+ ti,
2822
+ To
2824
2823
  ],
2825
- urlTransform: (A) => A,
2824
+ urlTransform: (v) => v,
2826
2825
  components: {
2827
2826
  // a links
2828
2827
  // @ts-ignore
2829
- a: (A) => (
2828
+ a: (v) => (
2830
2829
  // @ts-ignore
2831
- da(A, {
2832
- entityId: ne?.id ?? oe,
2833
- entityType: ne?.type ?? m,
2830
+ pa(v, {
2831
+ entityId: ee?.id ?? ae,
2832
+ entityType: ee?.type ?? m,
2834
2833
  userName: D,
2835
- userTeamNames: I,
2836
- projectName: c,
2834
+ userTeamNames: S,
2835
+ projectName: l,
2837
2836
  onReferenceClick: p,
2838
- onReferenceTooltip: Pe,
2839
- activityId: W,
2837
+ onReferenceTooltip: je,
2838
+ activityId: J,
2840
2839
  categoryPrimary: N?.color,
2841
- categorySecondary: Y.secondary,
2842
- onActivityLinkClick: Be
2840
+ categorySecondary: X.secondary,
2841
+ onActivityLinkClick: He
2843
2842
  })
2844
2843
  ),
2845
2844
  // checkbox inputs
2846
2845
  // @ts-ignore
2847
- input: (A) => la(A, { activity: e, onCheckChange: o }),
2846
+ input: (v) => ma(v, { activity: e, onCheckChange: o }),
2848
2847
  // code syntax highlighting
2849
2848
  // eslint-disable-next-line
2850
2849
  // @ts-ignore
2851
- code: (A) => ca(A),
2850
+ code: (v) => ua(v),
2852
2851
  // @ts-ignore
2853
- blockquote: (A) => sa(A),
2852
+ blockquote: (v) => da(v),
2854
2853
  // @ts-ignore
2855
- tip: (A) => /* @__PURE__ */ k(ia, { children: [
2856
- /* @__PURE__ */ l(se, { icon: "info" }),
2857
- A.children
2854
+ tip: (v) => /* @__PURE__ */ x(la, { children: [
2855
+ /* @__PURE__ */ c(se, { icon: "info" }),
2856
+ v.children
2858
2857
  ] }),
2859
2858
  // a video url on its own line is an embedded video
2860
2859
  // @ts-ignore
2861
- p: (A) => Za(A, { onOpen: w }) ?? er(A) ?? /* @__PURE__ */ l("p", { children: A.children }),
2860
+ p: (v) => ar(v, { onOpen: q }) ?? rr(v) ?? /* @__PURE__ */ c("p", { children: v.children }),
2862
2861
  // @ts-ignore
2863
- status: (A) => /* @__PURE__ */ l(Fi, { name: A.id, statuses: y, children: A.children })
2862
+ status: (v) => /* @__PURE__ */ c(Ii, { name: v.id, statuses: y, children: v.children })
2864
2863
  },
2865
- children: M
2864
+ children: Pe
2866
2865
  }
2867
2866
  ) }),
2868
- /* @__PURE__ */ l(
2869
- Pn,
2867
+ /* @__PURE__ */ c(
2868
+ _n,
2870
2869
  {
2871
- files: Re,
2872
- isCompact: Re.length > 6,
2873
- activityId: W,
2874
- projectName: c,
2870
+ files: Me,
2871
+ isCompact: Me.length > 6,
2872
+ activityId: J,
2873
+ projectName: l,
2875
2874
  isDownloadable: !0,
2876
2875
  onExpand: g,
2877
- onAnnotationClick: je,
2876
+ onAnnotationClick: Ue,
2878
2877
  pt: { file: { annotationFrameStart: t } },
2879
2878
  onRemove: void 0
2880
2879
  }
2881
2880
  )
2882
2881
  ] }),
2883
- !fe && /* @__PURE__ */ l("div", { style: { marginTop: "16px" }, children: He && /* @__PURE__ */ l(
2884
- gi,
2882
+ !fe && /* @__PURE__ */ c("div", { style: { marginTop: "16px" }, children: We && /* @__PURE__ */ c(
2883
+ bi,
2885
2884
  {
2886
- reactions: He,
2887
- changeHandler: _e,
2888
- readOnly: v,
2889
- category: N && !T ? N.name : void 0,
2885
+ reactions: We,
2886
+ changeHandler: Ee,
2887
+ readOnly: b,
2888
+ category: N && !A ? N.name : void 0,
2890
2889
  categoryPrimary: N?.color,
2891
- categorySecondary: Y.secondary,
2892
- categoryTertiary: Y.primary
2890
+ categorySecondary: X.secondary,
2891
+ categoryTertiary: X.primary
2893
2892
  }
2894
2893
  ) })
2895
2894
  ] })
2896
2895
  ]
2897
2896
  }
2898
2897
  ),
2899
- /* @__PURE__ */ l(
2900
- Ya,
2898
+ /* @__PURE__ */ c(
2899
+ er,
2901
2900
  {
2902
- target: _.current,
2903
- id: we,
2901
+ target: P.current,
2902
+ id: De,
2904
2903
  align: "right",
2905
- onClose: (A) => {
2906
- A?.stopPropagation(), R(!1);
2904
+ onClose: (v) => {
2905
+ v?.stopPropagation(), _(!1);
2907
2906
  },
2908
- children: /* @__PURE__ */ l(
2909
- Oi,
2907
+ children: /* @__PURE__ */ c(
2908
+ Bi,
2910
2909
  {
2911
- onDelete: Oe && n ? Je : void 0,
2912
- onEdit: Se ? De : void 0,
2913
- onCopyText: M ? () => En(M) : void 0,
2910
+ onDelete: he && n ? et : void 0,
2911
+ onEdit: Ne ? Ie : void 0,
2912
+ onCopyText: Pe ? () => Mn(Pe) : void 0,
2914
2913
  onDuplicate: r ? () => r(e) : void 0,
2915
- activityId: W,
2916
- onSelect: () => R(!1),
2917
- projectName: c,
2918
- entity: ne ?? (oe ? { id: oe, type: m } : void 0)
2914
+ activityId: J,
2915
+ onSelect: () => _(!1),
2916
+ projectName: l,
2917
+ entity: ee ?? (ae ? { id: ae, type: m } : void 0)
2919
2918
  }
2920
2919
  )
2921
2920
  }
2922
2921
  )
2923
2922
  ] });
2924
- }, ji = F.li`
2923
+ }, Hi = F.li`
2925
2924
  list-style: none;
2926
2925
  margin: 0;
2927
2926
  padding: 0;
@@ -2931,7 +2930,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2931
2930
  padding: 4px 8px;
2932
2931
  border-radius: var(--border-radius-m);
2933
2932
  user-select: none;
2934
- `, Ui = F.div`
2933
+ `, qi = F.div`
2935
2934
  display: flex;
2936
2935
  flex-wrap: wrap;
2937
2936
  align-items: center;
@@ -2954,10 +2953,10 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2954
2953
  font-size: 12px;
2955
2954
  font-weight: 800;
2956
2955
  }
2957
- `, zi = (e, t) => {
2956
+ `, Wi = (e, t) => {
2958
2957
  let o = [], n = {};
2959
2958
  return e.activityData.origin.type == "folder" && !n.folder && (n.folder = !0, o.push(e.activityData.origin.name)), e.activityData.origin.type == "task" && !n.task && (n.task = !0, o.push(e.activityData.origin.name)), (t == "version" || e.activityData.origin.type == "version") && (n.product || (n.product = !0, o.push(e.activityData.parents?.find((a) => a.type == "product")?.name)), n.version || (n.version = !0, o.push(e.activityData.origin.name))), o;
2960
- }, Bi = F.div`
2959
+ }, Qi = F.div`
2961
2960
  display: inline-flex;
2962
2961
  align-items: center;
2963
2962
  gap: var(--base-gap-small);
@@ -2966,7 +2965,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2966
2965
  font-variation-settings: 'FILL' 1;
2967
2966
  font-size: 16px;
2968
2967
  }
2969
- `, Gi = F.span`
2968
+ `, Yi = F.span`
2970
2969
  color: var(--md-sys-color-outline);
2971
2970
  font-size: 12px;
2972
2971
  max-width: 300px;
@@ -2976,37 +2975,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
2976
2975
  span {
2977
2976
  font-size: inherit;
2978
2977
  }
2979
- `, Pt = ft(
2980
- ({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */ k(Bi, { ...a, ref: r, children: [
2981
- e && /* @__PURE__ */ l(se, { icon: e, style: { color: t } }),
2982
- /* @__PURE__ */ l(Gi, { title: o, children: n ? n.map((s, i) => /* @__PURE__ */ k(xo, { children: [
2983
- /* @__PURE__ */ l("span", { style: { color: s.color }, children: s.label }),
2978
+ `, _t = ft(
2979
+ ({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */ x(Qi, { ...a, ref: r, children: [
2980
+ e && /* @__PURE__ */ c(se, { icon: e, style: { color: t } }),
2981
+ /* @__PURE__ */ c(Yi, { title: o, children: n ? n.map((s, i) => /* @__PURE__ */ x(Fo, { children: [
2982
+ /* @__PURE__ */ c("span", { style: { color: s.color }, children: s.label }),
2984
2983
  i < n.length - 1 && ", "
2985
2984
  ] }, i)) : o })
2986
2985
  ] })
2987
- ), Hi = (e) => {
2986
+ ), Ji = (e) => {
2988
2987
  const t = typeof e.icon == "string" ? e.icon : e.icon?.name, o = e.color ?? (typeof e.icon == "object" ? e.icon?.color : void 0);
2989
2988
  return { name: e.label, icon: t, color: o };
2990
- }, qi = (e, t) => {
2989
+ }, Ki = (e, t) => {
2991
2990
  const o = t?.data.enum?.find((n) => n.value === e)?.label;
2992
2991
  if (o) return o;
2993
2992
  if (t?.data.type === "datetime") {
2994
2993
  const n = new Date(String(e));
2995
- if (!isNaN(n.getTime())) return ma(n, "dd-MM-yyyy");
2994
+ if (!isNaN(n.getTime())) return ha(n, "dd-MM-yyyy");
2996
2995
  }
2997
2996
  return String(e);
2998
- }, Wi = (e, t) => e === "description" || t?.data.widget === "markdown", Qi = (e, t, o) => {
2997
+ }, Xi = (e, t) => e === "description" || t?.data.widget === "markdown", Zi = (e, t, o) => {
2999
2998
  if (e == null || e === "" || Array.isArray(e) && !e.length) return { name: "none" };
3000
- if (typeof e == "string" && Wi(o, t))
3001
- return { name: tr(e) || "none" };
2999
+ if (typeof e == "string" && Xi(o, t))
3000
+ return { name: ir(e) || "none" };
3002
3001
  if (t?.data.type === "boolean") return { name: e ? "Checked" : "Unchecked" };
3003
3002
  const a = Array.isArray(e) ? e : [e];
3004
3003
  if (a.length === 1) {
3005
3004
  const r = t?.data.enum?.find((s) => s.value === a[0]);
3006
- if (r) return Hi(r);
3005
+ if (r) return Ji(r);
3007
3006
  }
3008
- return { name: a.map((r) => qi(r, t)).join(", ") };
3009
- }, Yi = ({
3007
+ return { name: a.map((r) => Ki(r, t)).join(", ") };
3008
+ }, es = ({
3010
3009
  entityType: e,
3011
3010
  projectInfo: t,
3012
3011
  activity: o = {}
@@ -3017,37 +3016,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3017
3016
  authorFullName: r,
3018
3017
  createdAt: s,
3019
3018
  oldStatus: i,
3020
- newStatus: c,
3019
+ newStatus: l,
3021
3020
  activityData: m = {}
3022
- } = o, { key: p, oldValue: g, newValue: u } = m, h = zi(o, e), v = n === "attrib.change", y = n === "tags.change", D = n === "subtype.change", { data: P = [] } = Da(void 0, { skip: !v }), C = S(() => P.find((N) => N.name === p), [P, p]), f = v ? C?.data.title || p : y ? "Tags" : D ? "Type" : void 0, b = (N) => ({
3021
+ } = o, { key: p, oldValue: g, newValue: u } = m, h = Wi(o, e), b = n === "attrib.change", y = n === "tags.change", D = n === "subtype.change", { data: M = [] } = Ma(void 0, { skip: !b }), C = I(() => M.find((N) => N.name === p), [M, p]), f = b ? C?.data.title || p : y ? "Tags" : D ? "Type" : void 0, w = (N) => ({
3023
3022
  name: N?.name || "",
3024
3023
  icon: N?.icon,
3025
3024
  color: N?.color
3026
- }), T = (N) => {
3027
- const Q = Array.isArray(N) ? N.map(String) : [];
3028
- if (!Q.length) return { name: "none" };
3029
- const Y = Q.map((H) => ({
3030
- label: H,
3031
- color: t?.tags?.find((J) => J.name === H)?.color
3025
+ }), A = (N) => {
3026
+ const G = Array.isArray(N) ? N.map(String) : [];
3027
+ if (!G.length) return { name: "none" };
3028
+ const X = G.map((Q) => ({
3029
+ label: Q,
3030
+ color: t?.tags?.find((Z) => Z.name === Q)?.color
3032
3031
  }));
3033
- return { name: Q.join(", "), items: Y };
3034
- }, I = n === "status.change", _ = (N, Q) => I ? b(Q) : y ? T(N) : Qi(N, C, p), R = _(g, i), E = _(u, c);
3035
- return /* @__PURE__ */ k(ji, { children: [
3036
- /* @__PURE__ */ k(Ui, { children: [
3037
- /* @__PURE__ */ l(Dt, { children: r || a }),
3038
- /* @__PURE__ */ k(Dt, { children: [
3032
+ return { name: G.join(", "), items: X };
3033
+ }, S = n === "status.change", P = (N, G) => S ? w(G) : y ? A(N) : Zi(N, C, p), _ = P(g, i), E = P(u, l);
3034
+ return /* @__PURE__ */ x(Hi, { children: [
3035
+ /* @__PURE__ */ x(qi, { children: [
3036
+ /* @__PURE__ */ c(Dt, { children: r || a }),
3037
+ /* @__PURE__ */ x(Dt, { children: [
3039
3038
  "- ",
3040
3039
  h.join(" / "),
3041
3040
  " -"
3042
3041
  ] }),
3043
- f && /* @__PURE__ */ l(Dt, { children: /* @__PURE__ */ l("strong", { children: f }) }),
3044
- /* @__PURE__ */ l(Pt, { ...R }),
3045
- /* @__PURE__ */ l(se, { icon: "trending_flat" }),
3046
- /* @__PURE__ */ l(Pt, { ...E })
3042
+ f && /* @__PURE__ */ c(Dt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
3043
+ /* @__PURE__ */ c(_t, { ..._ }),
3044
+ /* @__PURE__ */ c(se, { icon: "trending_flat" }),
3045
+ /* @__PURE__ */ c(_t, { ...E })
3047
3046
  ] }),
3048
- /* @__PURE__ */ l(ut, { date: s })
3047
+ /* @__PURE__ */ c(lt, { date: s })
3049
3048
  ] });
3050
- }, Ji = F.li`
3049
+ }, Jn = F.li`
3051
3050
  /* reset default */
3052
3051
  list-style: none;
3053
3052
  margin: 0;
@@ -3060,7 +3059,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3060
3059
  padding: 4px 8px;
3061
3060
  border-radius: var(--border-radius-m);
3062
3061
  user-select: none;
3063
- `, Ki = F.div`
3062
+ `, Kn = F.div`
3064
3063
  display: flex;
3065
3064
  flex-wrap: nowrap;
3066
3065
  align-items: start;
@@ -3068,18 +3067,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3068
3067
  gap: var(--base-gap-small);
3069
3068
  padding: 0px 4px;
3070
3069
  overflow: hidden;
3071
- `, Xi = F.span`
3070
+ `, Rt = F.span`
3072
3071
  color: var(--md-sys-color-outline);
3073
3072
  white-space: wrap;
3074
3073
  font-size: 12px;
3075
- `, fn = ({ activity: e, isAdding: t }) => {
3074
+ `, yn = ({ activity: e, isAdding: t }) => {
3076
3075
  const { authorFullName: o, createdAt: n, activityData: a, authorName: r } = e || {}, { assignee: s } = a || {};
3077
3076
  let i = o || r;
3078
- return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */ l(Ji, { children: /* @__PURE__ */ k(Ki, { children: [
3079
- /* @__PURE__ */ l(Xi, { children: i }),
3080
- /* @__PURE__ */ l(ut, { date: n })
3077
+ return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { children: [
3078
+ /* @__PURE__ */ c(Rt, { children: i }),
3079
+ /* @__PURE__ */ c(lt, { date: n })
3081
3080
  ] }) });
3082
- }, Zi = F.li`
3081
+ }, ts = F.li`
3083
3082
  /* reset default */
3084
3083
  list-style: none;
3085
3084
  margin: 0;
@@ -3091,7 +3090,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3091
3090
 
3092
3091
  width: 100%;
3093
3092
  padding: 8px;
3094
- `, es = F.div`
3093
+ `, ns = F.div`
3095
3094
  border-radius: var(--border-radius-m);
3096
3095
  padding: var(--padding-m);
3097
3096
 
@@ -3107,7 +3106,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3107
3106
  display: inline;
3108
3107
  }
3109
3108
  }
3110
- `, ts = F.div`
3109
+ `, os = F.div`
3111
3110
  display: flex;
3112
3111
  flex-direction: row;
3113
3112
  justify-content: space-between;
@@ -3121,7 +3120,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3121
3120
  min-width: 0;
3122
3121
  overflow: hidden;
3123
3122
  }
3124
- `, yn = F.div`
3123
+ `, vn = F.div`
3125
3124
  display: flex;
3126
3125
  align-items: center;
3127
3126
  justify-content: space-between;
@@ -3145,7 +3144,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3145
3144
  display: none;
3146
3145
  flex: 1;
3147
3146
  }
3148
- `, ns = F(Ra)`
3147
+ `, as = F(ja)`
3149
3148
  width: 74px;
3150
3149
  min-width: 74px;
3151
3150
  height: unset;
@@ -3159,23 +3158,23 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3159
3158
  img {
3160
3159
  object-fit: cover;
3161
3160
  }
3162
- `, os = F.span`
3161
+ `, rs = F.span`
3163
3162
  overflow: hidden;
3164
3163
  text-overflow: ellipsis;
3165
3164
  white-space: nowrap;
3166
3165
  display: block;
3167
3166
  min-width: 0;
3168
- `, as = F.div`
3167
+ `, is = F.div`
3169
3168
  margin-top: var(--base-gap-small);
3170
3169
  color: var(--md-sys-color-outline);
3171
3170
  word-break: break-word;
3172
- `, rs = F.li`
3171
+ `, ss = F.li`
3173
3172
  /* reset default */
3174
3173
  list-style: none;
3175
3174
  margin: 0;
3176
3175
  padding: 0;
3177
3176
  padding: 0px 8px;
3178
- `, Yn = F.div`
3177
+ `, Xn = F.div`
3179
3178
  width: 100%;
3180
3179
  display: flex;
3181
3180
  align-items: center;
@@ -3198,7 +3197,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3198
3197
  &:hover {
3199
3198
  background-color: var(--md-sys-color-surface-container-hover);
3200
3199
  }
3201
- `, is = ({
3200
+ `, cs = ({
3202
3201
  activity: e,
3203
3202
  projectName: t,
3204
3203
  entityType: o,
@@ -3206,15 +3205,24 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3206
3205
  filter: a,
3207
3206
  statuses: r = []
3208
3207
  }) => {
3209
- const { onOpenViewer: s } = ze();
3210
- let { authorName: i, authorFullName: c, createdAt: m, versions: p = [] } = e;
3211
- const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g), v = 2, [y, D] = L(!1), P = (C, f) => s?.({ versionIds: [C], productId: f, projectName: t });
3212
- return /* @__PURE__ */ k(Zi, { children: [
3213
- /* @__PURE__ */ l(
3214
- Qn,
3208
+ const { onOpenViewer: s } = Be();
3209
+ let { authorName: i, authorFullName: l, createdAt: m, versions: p = [] } = e;
3210
+ const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g), b = 2, [y, D] = L(!1), M = (C, f, w) => {
3211
+ const A = fa(C);
3212
+ s?.({
3213
+ versionIds: [f],
3214
+ productId: w,
3215
+ projectName: t,
3216
+ reviewableIds: A && [A.fileId],
3217
+ goToPosition: A?.position
3218
+ });
3219
+ };
3220
+ return /* @__PURE__ */ x(ts, { children: [
3221
+ /* @__PURE__ */ c(
3222
+ Yn,
3215
3223
  {
3216
3224
  name: i,
3217
- fullName: c || i,
3225
+ fullName: l || i,
3218
3226
  date: m,
3219
3227
  activity: e,
3220
3228
  projectName: t,
@@ -3223,19 +3231,19 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3223
3231
  }
3224
3232
  ),
3225
3233
  p.flatMap((C, f) => {
3226
- const { name: b, id: T, productId: I, productName: _, thumbnailHash: R, comment: E } = C, N = r.find((Q) => Q.name === C.status);
3227
- return (f < v || u) && /* @__PURE__ */ k(es, { onClick: () => P(T, I), children: [
3228
- /* @__PURE__ */ k(ts, { children: [
3229
- /* @__PURE__ */ k("div", { children: [
3230
- /* @__PURE__ */ k(yn, { children: [
3231
- /* @__PURE__ */ l("span", { children: _ }),
3232
- /* @__PURE__ */ l(ut, { date: m, isExact: !0 })
3234
+ const { name: w, id: A, productId: S, productName: P, thumbnailHash: _, comment: E } = C, N = r.find((G) => G.name === C.status);
3235
+ return (f < b || u) && /* @__PURE__ */ x(ns, { onClick: (G) => M(G, A, S), children: [
3236
+ /* @__PURE__ */ x(os, { children: [
3237
+ /* @__PURE__ */ x("div", { children: [
3238
+ /* @__PURE__ */ x(vn, { children: [
3239
+ /* @__PURE__ */ c("span", { children: P }),
3240
+ /* @__PURE__ */ c(lt, { date: m, isExact: !0 })
3233
3241
  ] }),
3234
- /* @__PURE__ */ k(yn, { children: [
3235
- /* @__PURE__ */ l(os, { className: "version", children: b }),
3242
+ /* @__PURE__ */ x(vn, { children: [
3243
+ /* @__PURE__ */ c(rs, { className: "version", children: w }),
3236
3244
  " -",
3237
- /* @__PURE__ */ l(
3238
- Pt,
3245
+ /* @__PURE__ */ c(
3246
+ _t,
3239
3247
  {
3240
3248
  icon: N?.icon,
3241
3249
  color: N?.color,
@@ -3244,38 +3252,40 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3244
3252
  )
3245
3253
  ] })
3246
3254
  ] }),
3247
- /* @__PURE__ */ l(
3248
- ns,
3255
+ /* @__PURE__ */ c(
3256
+ as,
3249
3257
  {
3250
3258
  projectName: t,
3251
- entityId: T,
3259
+ entityId: A,
3252
3260
  entityType: "version",
3253
3261
  onError: () => D(!0),
3254
3262
  iconOnly: y,
3255
- thumbnailHash: R,
3256
- icon: "play_circle"
3263
+ thumbnailHash: _,
3264
+ icon: "play_circle",
3265
+ filmstrip: !0,
3266
+ filmstripFit: "cover"
3257
3267
  }
3258
3268
  )
3259
3269
  ] }),
3260
- E && /* @__PURE__ */ l(as, { children: E })
3261
- ] }, T);
3270
+ E && /* @__PURE__ */ c(is, { children: E })
3271
+ ] }, A);
3262
3272
  }),
3263
- !g && p.length > v && /* @__PURE__ */ k(Yn, { onClick: () => h(!u), children: [
3264
- /* @__PURE__ */ l(se, { icon: "more" }),
3265
- /* @__PURE__ */ l("span", { children: u ? "Show less" : `Show ${p.length - v} more versions` })
3273
+ !g && p.length > b && /* @__PURE__ */ x(Xn, { onClick: () => h(!u), children: [
3274
+ /* @__PURE__ */ c(se, { icon: "more" }),
3275
+ /* @__PURE__ */ c("span", { children: u ? "Show less" : `Show ${p.length - b} more versions` })
3266
3276
  ] })
3267
3277
  ] });
3268
- }, ss = ({ activities: e, editProps: t, ...o }) => {
3278
+ }, ls = ({ activities: e, editProps: t, ...o }) => {
3269
3279
  const [n, a] = L(!1);
3270
- return /* @__PURE__ */ k(Ce, { children: [
3271
- /* @__PURE__ */ l(rs, { children: /* @__PURE__ */ k(Yn, { onClick: () => a(!n), children: [
3272
- /* @__PURE__ */ l(se, { icon: n ? "expand_less" : "chevron_right" }),
3280
+ return /* @__PURE__ */ x(Te, { children: [
3281
+ /* @__PURE__ */ c(ss, { children: /* @__PURE__ */ x(Xn, { onClick: () => a(!n), children: [
3282
+ /* @__PURE__ */ c(se, { icon: n ? "expand_less" : "chevron_right" }),
3273
3283
  n ? "Show less" : "Show more"
3274
3284
  ] }) }),
3275
3285
  n && e.map((r) => (
3276
3286
  // @ts-expect-error
3277
- /* @__PURE__ */ l(
3278
- Jn,
3287
+ /* @__PURE__ */ c(
3288
+ Zn,
3279
3289
  {
3280
3290
  editProps: t,
3281
3291
  activity: r,
@@ -3286,7 +3296,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3286
3296
  )
3287
3297
  ))
3288
3298
  ] });
3289
- }, Jn = ({
3299
+ }, Zn = ({
3290
3300
  activity: e,
3291
3301
  fromGroup: t,
3292
3302
  annotationFrameStart: o,
@@ -3295,7 +3305,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3295
3305
  editProps: r,
3296
3306
  filter: s,
3297
3307
  readOnly: i,
3298
- statuses: c,
3308
+ statuses: l,
3299
3309
  isSlideOut: m,
3300
3310
  isGuest: p,
3301
3311
  ...g
@@ -3304,15 +3314,15 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3304
3314
  case "comment":
3305
3315
  return (
3306
3316
  // @ts-expect-error
3307
- /* @__PURE__ */ l(
3308
- Vi,
3317
+ /* @__PURE__ */ c(
3318
+ Gi,
3309
3319
  {
3310
3320
  activity: e,
3311
3321
  annotationFrameStart: o,
3312
3322
  projectInfo: n,
3313
3323
  editProps: r,
3314
3324
  readOnly: i,
3315
- statuses: c,
3325
+ statuses: l,
3316
3326
  isSlideOut: m,
3317
3327
  ...g
3318
3328
  }
@@ -3322,18 +3332,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3322
3332
  case "attrib.change":
3323
3333
  case "tags.change":
3324
3334
  case "subtype.change":
3325
- return /* @__PURE__ */ l(Yi, { activity: e, projectInfo: n, ...g });
3335
+ return /* @__PURE__ */ c(es, { activity: e, projectInfo: n, ...g });
3326
3336
  case "assignee.add":
3327
- return /* @__PURE__ */ l(fn, { activity: e, ...g, isAdding: !0 });
3337
+ return /* @__PURE__ */ c(yn, { activity: e, ...g, isAdding: !0 });
3328
3338
  case "assignee.remove":
3329
- return /* @__PURE__ */ l(fn, { activity: e, ...g });
3339
+ return /* @__PURE__ */ c(yn, { activity: e, ...g });
3330
3340
  case "version.publish":
3331
- return /* @__PURE__ */ l(is, { activity: e, projectInfo: n, filter: s, statuses: c, ...g });
3341
+ return /* @__PURE__ */ c(cs, { activity: e, projectInfo: n, filter: s, statuses: l, ...g });
3332
3342
  case "version.review":
3333
- return /* @__PURE__ */ l(Ri, { activity: e, isGuest: p, ...g });
3343
+ return /* @__PURE__ */ c(ji, { activity: e, isGuest: p, ...g });
3334
3344
  case "group":
3335
- return !t && /* @__PURE__ */ l(
3336
- ss,
3345
+ return !t && /* @__PURE__ */ c(
3346
+ ls,
3337
3347
  {
3338
3348
  editProps: r,
3339
3349
  activities: e.items || [],
@@ -3344,7 +3354,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
3344
3354
  default:
3345
3355
  return null;
3346
3356
  }
3347
- }, cs = F.section`
3357
+ }, ds = F.section`
3348
3358
  padding-bottom: 4px;
3349
3359
  overflow: hidden;
3350
3360
  position: relative;
@@ -3392,7 +3402,7 @@ F.div`
3392
3402
  color: inherit;
3393
3403
  }
3394
3404
  `;
3395
- const ls = F.ul`
3405
+ const us = F.ul`
3396
3406
  gap: var(--base-gap-large);
3397
3407
  overflow-y: auto;
3398
3408
  padding: 24px 0;
@@ -3413,11 +3423,11 @@ const ls = F.ul`
3413
3423
  & > *:last-child {
3414
3424
  margin-top: 32px;
3415
3425
  }
3416
- `, ds = F.span`
3426
+ `, ms = F.span`
3417
3427
  padding: 16px 8px;
3418
3428
  color: var(--md-sys-color-outline);
3419
3429
  font-size: 11px;
3420
- `, us = F.div`
3430
+ `, ps = F.div`
3421
3431
  height: 50px;
3422
3432
  border-radius: 8px;
3423
3433
  overflow: hidden;
@@ -3425,7 +3435,7 @@ const ls = F.ul`
3425
3435
  opacity: 0.5;
3426
3436
 
3427
3437
  position: relative;
3428
- `, ms = ({
3438
+ `, gs = ({
3429
3439
  projectName: e,
3430
3440
  entityType: t,
3431
3441
  entities: o = [],
@@ -3436,33 +3446,33 @@ const ls = F.ul`
3436
3446
  createEntityActivity: r,
3437
3447
  updateActivity: s,
3438
3448
  deleteActivity: i,
3439
- isUpdatingActivity: c,
3449
+ isUpdatingActivity: l,
3440
3450
  userName: m,
3441
3451
  userFullName: p,
3442
3452
  activityTypes: g
3443
3453
  } = $e(), u = o.map((C) => C.id), h = ({
3444
3454
  entityId: C,
3445
3455
  newId: f,
3446
- subTitle: b,
3447
- value: T,
3448
- files: I = [],
3449
- data: _ = {}
3456
+ subTitle: w,
3457
+ value: A,
3458
+ files: S = [],
3459
+ data: P = {}
3450
3460
  }) => ({
3451
- body: T,
3461
+ body: A,
3452
3462
  activityType: "comment",
3453
3463
  activityId: f,
3454
3464
  entityId: C,
3455
3465
  referenceType: "origin",
3456
3466
  authorName: m,
3457
3467
  authorFullName: p,
3458
- createdAt: Ga(/* @__PURE__ */ new Date()),
3459
- files: I,
3468
+ createdAt: Ya(/* @__PURE__ */ new Date()),
3469
+ files: S,
3460
3470
  reactions: [],
3461
- activityData: _,
3471
+ activityData: P,
3462
3472
  origin: {
3463
3473
  id: "8090c2dafcc811eeaf820242c0a80002",
3464
3474
  type: t,
3465
- name: b
3475
+ name: w
3466
3476
  },
3467
3477
  author: {
3468
3478
  active: !0,
@@ -3470,61 +3480,61 @@ const ls = F.ul`
3470
3480
  }
3471
3481
  });
3472
3482
  return {
3473
- submitComment: async (C, f = [], b = {}) => {
3474
- const T = o.map(({ id: R, subTitle: E }) => {
3475
- const N = cn(), Q = f.map((te) => te.id), Y = a ? { ...b, entityList: a } : b, H = {
3483
+ submitComment: async (C, f = [], w = {}) => {
3484
+ const A = o.map(({ id: _, subTitle: E }) => {
3485
+ const N = ln(), G = f.map((oe) => oe.id), X = a ? { ...w, entityList: a } : w, Q = {
3476
3486
  body: C,
3477
3487
  activityType: "comment",
3478
3488
  id: N,
3479
- files: Q,
3480
- data: Y
3481
- }, J = f.filter(
3482
- ({ id: te }) => !b.annotations?.some(
3483
- (oe) => oe.transparent === te
3489
+ files: G,
3490
+ data: X
3491
+ }, Z = f.filter(
3492
+ ({ id: oe }) => !w.annotations?.some(
3493
+ (ae) => ae.transparent === oe
3484
3494
  )
3485
- ), q = h({ entityId: R, newId: N, subTitle: E, value: C, files: J, data: b });
3495
+ ), Y = h({ entityId: _, newId: N, subTitle: E, value: C, files: Z, data: w });
3486
3496
  return r({
3487
3497
  projectName: e,
3488
3498
  entityType: t,
3489
- entityId: R,
3490
- data: H,
3491
- patch: q,
3499
+ entityId: _,
3500
+ data: Q,
3501
+ patch: Y,
3492
3502
  filter: n,
3493
3503
  ...{ entityIds: u, activityTypes: g }
3494
3504
  });
3495
- }), _ = (await Promise.all(T)).filter((R) => R.error);
3496
- if (_.length > 0) {
3497
- const R = an(_[0].error) || "Failed to create comment";
3498
- throw Fe.error(R), new Error(R);
3505
+ }), P = (await Promise.all(A)).filter((_) => _.error);
3506
+ if (P.length > 0) {
3507
+ const _ = sn(P[0].error) || "Failed to create comment";
3508
+ throw Ce.error(_), new Error(_);
3499
3509
  }
3500
3510
  },
3501
- updateComment: async (C, f, b = [], T = {}) => {
3502
- const I = b.map((N) => N.id), _ = {
3511
+ updateComment: async (C, f, w = [], A = {}) => {
3512
+ const S = w.map((N) => N.id), P = {
3503
3513
  body: f,
3504
- files: I,
3505
- data: T
3506
- }, R = {
3514
+ files: S,
3515
+ data: A
3516
+ }, _ = {
3507
3517
  ...C,
3508
- ..._,
3509
- files: b,
3510
- activityData: T
3518
+ ...P,
3519
+ files: w,
3520
+ activityData: A
3511
3521
  }, E = { entityType: t, entityIds: u, activityTypes: g };
3512
3522
  try {
3513
3523
  await s({
3514
3524
  projectName: e,
3515
- data: _,
3525
+ data: P,
3516
3526
  activityId: C.activityId,
3517
3527
  entityId: C.entityId,
3518
- patch: R,
3528
+ patch: _,
3519
3529
  filter: n,
3520
3530
  ...E
3521
3531
  });
3522
3532
  } catch (N) {
3523
- throw Fe.error(an(N)), N;
3533
+ throw Ce.error(sn(N)), N;
3524
3534
  }
3525
3535
  },
3526
- deleteComment: async (C, f, b = []) => {
3527
- const T = { entityType: t, entityIds: u, activityTypes: g };
3536
+ deleteComment: async (C, f, w = []) => {
3537
+ const A = { entityType: t, entityIds: u, activityTypes: g };
3528
3538
  if (C)
3529
3539
  try {
3530
3540
  await i({
@@ -3533,32 +3543,32 @@ const ls = F.ul`
3533
3543
  entityId: f,
3534
3544
  filter: n,
3535
3545
  patch: { activityId: C },
3536
- refs: b,
3537
- ...T
3546
+ refs: w,
3547
+ ...A
3538
3548
  });
3539
3549
  } catch {
3540
3550
  }
3541
3551
  },
3542
3552
  submitReview: async (C) => {
3543
- const f = o.map(({ id: b, subTitle: T }) => {
3544
- const I = cn(), _ = { feedback: C, entityList: a }, R = {
3545
- body: Xr(C, t),
3553
+ const f = o.map(({ id: w, subTitle: A }) => {
3554
+ const S = ln(), P = { feedback: C, entityList: a }, _ = {
3555
+ body: oi(C, t),
3546
3556
  activityType: "version.review",
3547
- id: I,
3548
- data: _
3549
- }, E = h({ entityId: b, newId: I, subTitle: T, value: "", data: _ });
3557
+ id: S,
3558
+ data: P
3559
+ }, E = h({ entityId: w, newId: S, subTitle: A, value: "", data: P });
3550
3560
  return r({
3551
3561
  projectName: e,
3552
3562
  entityType: t,
3553
- entityId: b,
3554
- data: R,
3563
+ entityId: w,
3564
+ data: _,
3555
3565
  patch: E,
3556
3566
  filter: n
3557
3567
  });
3558
3568
  });
3559
3569
  await Promise.all(f);
3560
3570
  },
3561
- isSaving: c
3571
+ isSaving: l
3562
3572
  };
3563
3573
  }, Nt = (e = {}) => {
3564
3574
  const {
@@ -3567,9 +3577,9 @@ const ls = F.ul`
3567
3577
  origin: n = {},
3568
3578
  activityData: { context: { productName: a, productType: r, productId: s } = {} } = {},
3569
3579
  version: i
3570
- } = e, { name: c, id: m } = n;
3580
+ } = e, { name: l, id: m } = n;
3571
3581
  return {
3572
- name: c,
3582
+ name: l,
3573
3583
  id: m,
3574
3584
  productId: s,
3575
3585
  productName: a,
@@ -3580,7 +3590,7 @@ const ls = F.ul`
3580
3590
  status: i?.status,
3581
3591
  thumbnailHash: i?.thumbnailHash
3582
3592
  };
3583
- }, ps = 5, gs = (e = []) => {
3593
+ }, hs = 5, fs = (e = []) => {
3584
3594
  const t = [];
3585
3595
  let o = null;
3586
3596
  for (const n of e) {
@@ -3592,10 +3602,10 @@ const ls = F.ul`
3592
3602
  o = { ...n }, o.versions = [Nt(n)];
3593
3603
  continue;
3594
3604
  }
3595
- const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i = Ha(
3605
+ const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i = Ja(
3596
3606
  new Date(o.createdAt),
3597
3607
  new Date(n.createdAt)
3598
- ) <= ps;
3608
+ ) <= hs;
3599
3609
  if (a && i && r) {
3600
3610
  o.versions.push(Nt(n));
3601
3611
  continue;
@@ -3605,34 +3615,34 @@ const ls = F.ul`
3605
3615
  }
3606
3616
  }
3607
3617
  return o && t.push(o), t;
3608
- }, hs = (e, t) => {
3618
+ }, ys = (e, t) => {
3609
3619
  let o = {};
3610
- t.reduce((i, c) => (i[c.name] = c, i), o);
3620
+ t.reduce((i, l) => (i[l.name] = l, i), o);
3611
3621
  const n = [];
3612
3622
  let a = [];
3613
3623
  const r = (i) => {
3614
- const c = (h) => ["assignee.add", "assignee.remove"].includes(h[0].activityType) ? [
3624
+ const l = (h) => ["assignee.add", "assignee.remove"].includes(h[0].activityType) ? [
3615
3625
  {
3616
3626
  ...h[0],
3617
3627
  activityType: h[0].activityType,
3618
3628
  assignee: [
3619
3629
  ...h.map(
3620
- (v) => o[v.activityData.assignee]?.attrib?.fullName || v.activityData.assignee
3630
+ (b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
3621
3631
  )
3622
3632
  ].join(", "),
3623
3633
  activityData: {
3624
3634
  ...h[0].activityData,
3625
3635
  assignee: h.map(
3626
- (v) => o[v.activityData.assignee]?.attrib?.fullName || v.activityData.assignee
3636
+ (b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
3627
3637
  ).join(", ")
3628
3638
  }
3629
3639
  }
3630
3640
  ] : h;
3631
3641
  let m = [], p = [], g = null, u = null;
3632
3642
  return i.forEach((h) => {
3633
- g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...c(p)), p = [h]), g = h.activityType, u = h.authorName;
3634
- }), p.length != 0 && m.push(...c(p)), m;
3635
- }, s = (i, c) => {
3643
+ g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...l(p)), p = [h]), g = h.activityType, u = h.authorName;
3644
+ }), p.length != 0 && m.push(...l(p)), m;
3645
+ }, s = (i, l) => {
3636
3646
  if (a.length > 2) {
3637
3647
  if (i) {
3638
3648
  const m = a[0].activityData.assignee;
@@ -3647,20 +3657,20 @@ const ls = F.ul`
3647
3657
  n.push({
3648
3658
  activityType: "group",
3649
3659
  items: r(i ? a.slice(1) : a),
3650
- activityId: "group-" + c
3660
+ activityId: "group-" + l
3651
3661
  });
3652
3662
  } else a.length > 0 && a.forEach((m) => n.push(m));
3653
3663
  a = [];
3654
3664
  };
3655
3665
  for (const i of e)
3656
- if (fs.includes(i.activityType))
3666
+ if (vs.includes(i.activityType))
3657
3667
  a.push(i);
3658
3668
  else {
3659
- const c = n.length === 0;
3660
- s(c, n.length), n.push(i);
3669
+ const l = n.length === 0;
3670
+ s(l, n.length), n.push(i);
3661
3671
  }
3662
3672
  return a.length > 0 && s(!1, n.length), n;
3663
- }, vn = (e, t, o = "oldValue") => {
3673
+ }, bn = (e, t, o = "oldValue") => {
3664
3674
  const n = [];
3665
3675
  let a = null, r = null;
3666
3676
  for (const s of e)
@@ -3669,104 +3679,104 @@ const ls = F.ul`
3669
3679
  a = { ...s }, r = new Date(s.createdAt);
3670
3680
  continue;
3671
3681
  }
3672
- const i = a.authorName === s.authorName, c = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && lt(r) && lt(p) && Math.abs(qa(r, p)) <= 20;
3673
- i && u && c && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
3682
+ const i = a.authorName === s.authorName, l = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && Ke(r) && Ke(p) && Math.abs(Ka(r, p)) <= 20;
3683
+ i && u && l && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
3674
3684
  ...a.activityData,
3675
3685
  oldValue: s.activityData.oldValue
3676
3686
  }, a.hasPreviousPage = s.hasPreviousPage, a.cursor = s.cursor, r = p) : (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = { ...s }, r = p);
3677
3687
  } else
3678
3688
  a && (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = null, r = null), n.push(s);
3679
3689
  return a && a.activityData.oldValue !== a.activityData.newValue && !n.some((s) => s.activityId === a.activityId) && n.push(a), n;
3680
- }, fs = [
3690
+ }, vs = [
3681
3691
  "status.change",
3682
3692
  "assignee.add",
3683
3693
  "assignee.remove",
3684
3694
  "attrib.change",
3685
3695
  "tags.change",
3686
3696
  "subtype.change"
3687
- ], ys = (e = [], t = {}) => e.map((o) => {
3697
+ ], bs = (e = [], t = {}) => e.map((o) => {
3688
3698
  const n = { ...o, origin: { ...o.origin } };
3689
3699
  if (n.activityType === "status.change") {
3690
3700
  if (!t) return n;
3691
- const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((c) => c.name === a), i = t.statuses?.find((c) => c.name === r);
3701
+ const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((l) => l.name === a), i = t.statuses?.find((l) => l.name === r);
3692
3702
  n.oldStatus = { ...s, name: a }, n.newStatus = { ...i, name: r };
3693
3703
  }
3694
3704
  return n;
3695
- }), vs = (e = [], t = [], o) => t.includes(o) ? e.filter((n) => n.referenceType !== "relation") : e, bs = (e = [], t = [], o = {}, n, a, r) => {
3696
- const s = S(
3697
- () => ys(e, o),
3705
+ }), ws = (e = [], t = [], o) => t.includes(o) ? e.filter((n) => n.referenceType !== "relation") : e, xs = (e = [], t = [], o = {}, n, a, r) => {
3706
+ const s = I(
3707
+ () => bs(e, o),
3698
3708
  [e, o]
3699
- ), i = S(() => s.map((y) => ({ ...y, isOwner: a === y.authorName })), [s, a]), c = S(
3700
- () => vs(i, ["version"], n),
3709
+ ), i = I(() => s.map((y) => ({ ...y, isOwner: a === y.authorName })), [s, a]), l = I(
3710
+ () => ws(i, ["version"], n),
3701
3711
  [i, n]
3702
- ), m = S(() => [...c].sort((D, P) => {
3703
- const C = new Date(D.createdAt), f = new Date(P.createdAt), b = lt(C), T = lt(f);
3704
- if (!b && !T)
3712
+ ), m = I(() => [...l].sort((D, M) => {
3713
+ const C = new Date(D.createdAt), f = new Date(M.createdAt), w = Ke(C), A = Ke(f);
3714
+ if (!w && !A)
3705
3715
  return 0;
3706
- if (b) {
3707
- if (!T)
3716
+ if (w) {
3717
+ if (!A)
3708
3718
  return -1;
3709
3719
  } else return 1;
3710
- return Wa(f, C);
3711
- }), [c]), p = S(
3712
- () => vn(m, "status.change", "oldStatus"),
3720
+ return Xa(f, C);
3721
+ }), [l]), p = I(
3722
+ () => bn(m, "status.change", "oldStatus"),
3713
3723
  [m]
3714
- ), g = S(
3715
- () => vn(p, "attrib.change"),
3724
+ ), g = I(
3725
+ () => bn(p, "attrib.change"),
3716
3726
  [p]
3717
- ), u = S(() => r?.conditions?.some(
3727
+ ), u = I(() => r?.conditions?.some(
3718
3728
  (D) => "key" in D && D.key === "updates" && D.value === !0
3719
- ) ? g : hs(g, t), [g, t, r]), h = S(
3720
- () => gs(u),
3729
+ ) ? g : ys(g, t), [g, t, r]), h = I(
3730
+ () => fs(u),
3721
3731
  [u]
3722
3732
  );
3723
- return S(() => [...new Map(
3733
+ return I(() => [...new Map(
3724
3734
  h.filter((D) => D && D.activityId).map((D) => [D.activityId, D])
3725
3735
  ).values()], [h]);
3726
- }, bn = (e, t) => JSON.stringify({ entities: e.map((o) => o.id), filter: t }), ws = ({
3736
+ }, wn = (e, t) => JSON.stringify({ entities: e.map((o) => o.id), filter: t }), ks = ({
3727
3737
  entities: e = [],
3728
3738
  feedRef: t,
3729
3739
  filter: o,
3730
3740
  disabled: n,
3731
3741
  isLoading: a
3732
3742
  }) => {
3733
- const r = ge({}), s = (i) => {
3734
- const c = i.current.querySelectorAll(".scroll-to"), m = Array.from(c).map((g) => g.closest("li.comment"));
3743
+ const r = pe({}), s = (i) => {
3744
+ const l = i.current.querySelectorAll(".scroll-to"), m = Array.from(l).map((g) => g.closest("li.comment"));
3735
3745
  return (m[m.length - 1]?.offsetTop || 0) - 8 || 0;
3736
3746
  };
3737
- G(() => {
3738
- const i = bn(e, o);
3747
+ W(() => {
3748
+ const i = wn(e, o);
3739
3749
  !t.current || n || a || (t.current.scrollTop = r.current[i] || s(t));
3740
- }, [e, o, t.current, a]), G(() => {
3750
+ }, [e, o, t.current, a]), W(() => {
3741
3751
  let i = null;
3742
3752
  if (!t.current || n) return;
3743
- const c = (m) => {
3753
+ const l = (m) => {
3744
3754
  if (i)
3745
3755
  return;
3746
3756
  i = setTimeout(() => {
3747
3757
  i = null;
3748
3758
  }, 300);
3749
- const { scrollTop: p } = m.target, g = bn(e, o);
3759
+ const { scrollTop: p } = m.target, g = wn(e, o);
3750
3760
  r.current[g] = p;
3751
3761
  };
3752
- return t.current?.addEventListener("scroll", c), () => {
3753
- t.current?.removeEventListener("scroll", c);
3762
+ return t.current?.addEventListener("scroll", l), () => {
3763
+ t.current?.removeEventListener("scroll", l);
3754
3764
  };
3755
3765
  }, [t.current, o, e, n]);
3756
- }, xs = ({ feedRef: e, isInputOpen: t, height: o }) => {
3757
- G(() => {
3766
+ }, As = ({ feedRef: e, isInputOpen: t, height: o }) => {
3767
+ W(() => {
3758
3768
  if (!e.current) return;
3759
3769
  const n = o;
3760
3770
  e.current.scrollTop === 0 || (t ? e.current.scrollBy(0, n) : e.current.scrollBy(0, -n));
3761
3771
  }, [t, e, o]);
3762
- }, ks = (e = 50, t = 200) => Math.floor(Math.random() * (t - e + 1) + e), As = (e) => new Array(e).fill(0).map((t, o) => /* @__PURE__ */ l(
3763
- us,
3772
+ }, Fs = (e = 50, t = 200) => Math.floor(Math.random() * (t - e + 1) + e), Cs = (e) => new Array(e).fill(0).map((t, o) => /* @__PURE__ */ c(
3773
+ ps,
3764
3774
  {
3765
3775
  className: "loading",
3766
- style: { minHeight: ks(50, 150) }
3776
+ style: { minHeight: Fs(50, 150) }
3767
3777
  },
3768
3778
  o
3769
- )), Fs = ({
3779
+ )), Ts = ({
3770
3780
  feedRef: e,
3771
3781
  highlighted: t = [],
3772
3782
  isLoading: o,
@@ -3774,26 +3784,26 @@ const ls = F.ul`
3774
3784
  hasNextPage: a,
3775
3785
  activities: r
3776
3786
  }) => {
3777
- const s = ge([]), i = async (m, p = 0) => {
3787
+ const s = pe([]), i = async (m, p = 0) => {
3778
3788
  if (!n) return null;
3779
3789
  const g = m.querySelector("li.isHighlighted");
3780
3790
  if (g) return g;
3781
3791
  if (p++, p > 10) return null;
3782
3792
  const u = await n();
3783
- return !u || !u.hasNextPage ? null : (await new Promise((v) => requestAnimationFrame(() => v())), i(m, p));
3784
- }, c = async (m) => {
3793
+ return !u || !u.hasNextPage ? null : (await new Promise((b) => requestAnimationFrame(() => b())), i(m, p));
3794
+ }, l = async (m) => {
3785
3795
  const p = await i(m);
3786
3796
  if (!p) {
3787
3797
  console.error("No highlighted element found");
3788
3798
  return;
3789
3799
  }
3790
- const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0, v = 64, D = u + v > h ? g - 16 : g + u - h + v;
3800
+ const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0, b = 64, D = u + b > h ? g - 16 : g + u - h + b;
3791
3801
  console.log("FOUND: scrolling to highlighted..."), m.scrollTo({ top: D }), s.current = t;
3792
3802
  };
3793
- G(() => {
3794
- !t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."), c(e.current));
3803
+ W(() => {
3804
+ !t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."), l(e.current));
3795
3805
  }, [e, t, r, o, n, s, a]);
3796
- }, Cs = (e) => e.map((t) => {
3806
+ }, Ds = (e) => e.map((t) => {
3797
3807
  if (t.activityType !== "comment" || !t.activityData?.annotations) return t;
3798
3808
  const o = t.files.map((a) => {
3799
3809
  const r = t.activityData.annotations.find(
@@ -3802,79 +3812,79 @@ const ls = F.ul`
3802
3812
  return r ? r.transparent === a.id ? null : { ...a, annotation: r } : a;
3803
3813
  }).filter(Boolean);
3804
3814
  return { ...t, files: o };
3805
- }), Kn = [
3815
+ }), eo = [
3806
3816
  "comments",
3807
3817
  "versions",
3808
3818
  "updates",
3809
3819
  "checklists",
3810
3820
  "has_attachments",
3811
3821
  "in_review_session"
3812
- ], Ts = (e) => !!e && "key" in e, Ds = (e, t) => {
3822
+ ], Ns = (e) => !!e && "key" in e, Is = (e, t) => {
3813
3823
  const o = [], n = [], a = (r) => {
3814
3824
  if (!r) return;
3815
- if (Ts(r)) {
3825
+ if (Ns(r)) {
3816
3826
  const i = r.key;
3817
3827
  if (i === "body") {
3818
3828
  const p = String(r.value ?? "");
3819
3829
  p && n.push({ id: p, label: p });
3820
3830
  return;
3821
3831
  }
3822
- const c = t.find((p) => p.id === i);
3823
- if (!c) return;
3824
- if (Kn.includes(i)) {
3832
+ const l = t.find((p) => p.id === i);
3833
+ if (!l) return;
3834
+ if (eo.includes(i)) {
3825
3835
  r.value === !0 && o.push({
3826
- id: tn(i),
3827
- label: c.label,
3828
- icon: c.icon,
3836
+ id: on(i),
3837
+ label: l.label,
3838
+ icon: l.icon,
3829
3839
  type: "boolean",
3830
3840
  singleSelect: !0,
3831
3841
  // value label = filter name so the compact chip (label hidden) reads
3832
3842
  // e.g. "Checklists" instead of "Yes"
3833
- values: [{ id: "true", label: c.label }]
3843
+ values: [{ id: "true", label: l.label }]
3834
3844
  });
3835
3845
  return;
3836
3846
  }
3837
3847
  const m = Array.isArray(r.value) ? r.value : [r.value];
3838
3848
  o.push({
3839
- id: tn(i),
3840
- label: c.label,
3841
- type: c.type,
3842
- icon: c.icon,
3843
- singleSelect: c.singleSelect,
3849
+ id: on(i),
3850
+ label: l.label,
3851
+ type: l.type,
3852
+ icon: l.icon,
3853
+ singleSelect: l.singleSelect,
3844
3854
  operator: "OR",
3845
3855
  values: m.map((p) => {
3846
- const g = c.values?.find((u) => u.id === String(p));
3856
+ const g = l.values?.find((u) => u.id === String(p));
3847
3857
  return g ? { ...g } : { id: String(p), label: String(p) };
3848
3858
  })
3849
3859
  });
3850
3860
  return;
3851
3861
  }
3852
- const s = Ka(r, t);
3862
+ const s = nr(r, t);
3853
3863
  if (s) {
3854
3864
  o.push(s);
3855
3865
  return;
3856
3866
  }
3857
3867
  r.conditions?.forEach(a);
3858
3868
  };
3859
- return e?.conditions?.forEach(a), n.length && o.push({ id: Dn, label: "", values: n }), o;
3860
- }, Ns = (e) => {
3869
+ return e?.conditions?.forEach(a), n.length && o.push({ id: Nn, label: "", values: n }), o;
3870
+ }, Ss = (e) => {
3861
3871
  const t = [], o = [];
3862
3872
  return e.forEach((n) => {
3863
- const a = Eo(n.id), r = (n.values || []).map((s) => s.id);
3873
+ const a = _o(n.id), r = (n.values || []).map((s) => s.id);
3864
3874
  if (r.length)
3865
- if (a === Dn)
3875
+ if (a === Nn)
3866
3876
  r.forEach(
3867
3877
  (s) => o.push({ key: "body", operator: "like", value: String(s) })
3868
3878
  );
3869
- else if (Kn.includes(a))
3879
+ else if (eo.includes(a))
3870
3880
  r.includes("true") && t.push({ key: a, operator: "eq", value: !0 });
3871
3881
  else if (n.type === "datetime") {
3872
- const s = Xa(a, n);
3882
+ const s = or(a, n);
3873
3883
  s && t.push(s);
3874
3884
  } else
3875
3885
  t.push({ key: a, operator: "in", value: r.map(String) });
3876
3886
  }), o.length === 1 ? t.push(o[0]) : o.length > 1 && t.push({ operator: "or", conditions: o }), { operator: "and", conditions: t };
3877
- }, Ss = F.div`
3887
+ }, Es = F.div`
3878
3888
  padding: 4px 8px;
3879
3889
  padding-bottom: 0;
3880
3890
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.25));
@@ -3889,7 +3899,7 @@ const ls = F.ul`
3889
3899
  opacity: 0.5;
3890
3900
  pointer-events: none;
3891
3901
  }
3892
- `, Xn = ft(
3902
+ `, to = ft(
3893
3903
  ({
3894
3904
  feedFilter: e,
3895
3905
  setFeedFilter: t,
@@ -3900,11 +3910,11 @@ const ls = F.ul`
3900
3910
  checklistCount: s,
3901
3911
  onSearchTextChange: i
3902
3912
  }) => {
3903
- const c = S(() => {
3904
- const f = (T, I, _) => ({
3905
- id: T,
3906
- label: I,
3907
- icon: _,
3913
+ const l = I(() => {
3914
+ const f = (A, S, P) => ({
3915
+ id: A,
3916
+ label: S,
3917
+ icon: P,
3908
3918
  type: "boolean",
3909
3919
  singleSelect: !0,
3910
3920
  values: []
@@ -3925,11 +3935,11 @@ const ls = F.ul`
3925
3935
  operator: "OR",
3926
3936
  values: [
3927
3937
  { id: "__none__", label: "No category", icon: "crop_square" },
3928
- ...n.map((T) => ({
3929
- id: T.name,
3930
- label: T.name,
3938
+ ...n.map((A) => ({
3939
+ id: A.name,
3940
+ label: A.name,
3931
3941
  icon: "crop_square",
3932
- color: T.color
3942
+ color: A.color
3933
3943
  }))
3934
3944
  ]
3935
3945
  }
@@ -3940,10 +3950,10 @@ const ls = F.ul`
3940
3950
  icon: "person",
3941
3951
  type: "list_of_strings",
3942
3952
  operator: "OR",
3943
- values: o.map((T) => ({
3944
- id: T.name,
3945
- label: T.attrib?.fullName || T.name,
3946
- img: `/api/users/${T.name}/avatar`
3953
+ values: o.map((A) => ({
3954
+ id: A.name,
3955
+ label: A.attrib?.fullName || A.name,
3956
+ img: `/api/users/${A.name}/avatar`
3947
3957
  }))
3948
3958
  },
3949
3959
  {
@@ -3951,85 +3961,85 @@ const ls = F.ul`
3951
3961
  label: "Posted date",
3952
3962
  icon: "calendar_today",
3953
3963
  type: "datetime",
3954
- values: pa()
3964
+ values: ya()
3955
3965
  }
3956
3966
  ];
3957
3967
  }, [o, n, a]);
3958
3968
  let m = "";
3959
3969
  s?.total && s.total > 0 && (m = `${s.checked}/${s.total}`);
3960
- const p = S(
3970
+ const p = I(
3961
3971
  () => ["comments", { id: "checklists", label: m, tooltip: "Checklists" }],
3962
3972
  [m]
3963
- ), g = S(
3964
- () => Ds(e, c),
3965
- [e, c]
3966
- ), [u, h] = L(g), v = nr(), y = ge(null);
3967
- G(() => {
3973
+ ), g = I(
3974
+ () => Is(e, l),
3975
+ [e, l]
3976
+ ), [u, h] = L(g), b = sr(), y = pe(null);
3977
+ W(() => {
3968
3978
  h(g);
3969
- }, [JSON.stringify(g)]), G(() => {
3970
- const f = (b) => {
3971
- const T = y.current?.getContainerElement();
3972
- T && !T.contains(b.target) && y.current?.close();
3979
+ }, [JSON.stringify(g)]), W(() => {
3980
+ const f = (w) => {
3981
+ const A = y.current?.getContainerElement();
3982
+ A && !A.contains(w.target) && y.current?.close();
3973
3983
  };
3974
3984
  return document.addEventListener("mousedown", f), () => {
3975
3985
  document.removeEventListener("mousedown", f);
3976
3986
  };
3977
3987
  }, [y]);
3978
3988
  const D = (f) => {
3979
- t(Ns(f)), i?.("");
3989
+ t(Ss(f)), i?.("");
3980
3990
  };
3981
- return /* @__PURE__ */ k(Ss, { className: r ? "loading" : void 0, children: [
3982
- /* @__PURE__ */ l(
3983
- Mo,
3991
+ return /* @__PURE__ */ x(Es, { className: r ? "loading" : void 0, children: [
3992
+ /* @__PURE__ */ c(
3993
+ Ro,
3984
3994
  {
3985
3995
  ref: y,
3986
3996
  compact: !0,
3987
- options: c,
3997
+ options: l,
3988
3998
  filters: u,
3989
3999
  onChange: (f) => {
3990
- v.wrapFilterChange(f, u, h);
4000
+ b.wrapFilterChange(f, u, h);
3991
4001
  },
3992
4002
  onFinish: D,
3993
4003
  enableGlobalSearch: !0,
3994
4004
  enableMultipleSameFilters: !1,
3995
4005
  enableAutosuggestion: !1,
3996
- onSearchChange: (f, b) => {
3997
- b || i?.(f);
4006
+ onSearchChange: (f, w) => {
4007
+ w || i?.(f);
3998
4008
  },
3999
4009
  quickActions: p,
4000
4010
  placeholder: "Search and filter feed...",
4001
4011
  pt: {
4002
4012
  searchBar: {
4003
- onClickCapture: (f) => v.handleSearchBarClickCapture(f, u)
4013
+ onClickCapture: (f) => b.handleSearchBarClickCapture(f, u)
4004
4014
  },
4005
4015
  dropdown: {
4006
4016
  pt: {
4007
4017
  item: {
4008
- onClick: (f) => v.handleDropdownItemClick(f, u, c)
4018
+ onClick: (f) => b.handleDropdownItemClick(f, u, l)
4009
4019
  }
4010
4020
  }
4011
4021
  }
4012
4022
  }
4013
4023
  }
4014
4024
  ),
4015
- /* @__PURE__ */ l(
4016
- La,
4025
+ /* @__PURE__ */ c(
4026
+ Ua,
4017
4027
  {
4018
- isOpen: !!v.customRangeFilterId,
4019
- header: c.find((f) => f.id === v.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
4020
- startDate: v.customStartDate,
4021
- endDate: v.customEndDate,
4022
- onStartDateChange: v.setCustomStartDate,
4023
- onEndDateChange: v.setCustomEndDate,
4024
- onApply: () => v.handleCustomRangeApply(u, c, D, y),
4025
- onClose: v.handleCustomRangeClose
4028
+ isOpen: !!b.customRangeFilterId,
4029
+ header: l.find((f) => f.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
4030
+ startDate: b.customStartDate,
4031
+ endDate: b.customEndDate,
4032
+ onStartDateChange: b.setCustomStartDate,
4033
+ onEndDateChange: b.setCustomEndDate,
4034
+ onApply: () => b.handleCustomRangeApply(u, l, D, y),
4035
+ onClose: b.handleCustomRangeClose
4026
4036
  }
4027
4037
  )
4028
4038
  ] });
4029
4039
  }
4030
4040
  );
4031
- Xn.displayName = "FeedSearchFilter";
4032
- function Is({
4041
+ to.displayName = "FeedSearchFilter";
4042
+ function Ms({
4033
4043
  projectName: e,
4034
4044
  enabled: t,
4035
4045
  entityIds: o,
@@ -4037,10 +4047,10 @@ function Is({
4037
4047
  loadingActivities: a,
4038
4048
  userName: r
4039
4049
  }) {
4040
- const s = S(
4050
+ const s = I(
4041
4051
  () => n.find((p) => p.activityType === "version.review" && p.authorName === r),
4042
4052
  [n, r]
4043
- ), i = !!(o.length === 0 || !t || a || s), { data: c } = Na(
4053
+ ), i = !!(o.length === 0 || !t || a || s), { data: l } = Pa(
4044
4054
  {
4045
4055
  projectName: e,
4046
4056
  entityIds: o,
@@ -4050,27 +4060,27 @@ function Is({
4050
4060
  },
4051
4061
  { skip: i }
4052
4062
  );
4053
- return S(() => s ?? c?.activities.at(-1), [s, c]);
4063
+ return I(() => s ?? l?.activities.at(-1), [s, l]);
4054
4064
  }
4055
- const Es = (e) => !!e.activityData?.annotations?.length || !!yt(e), Ms = ({ projectName: e, entityType: t, entities: o, activities: n }) => {
4056
- const a = S(
4065
+ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ projectName: e, entityType: t, entities: o, activities: n }) => {
4066
+ const a = I(
4057
4067
  () => t === "version" ? Object.fromEntries(
4058
4068
  o.filter((i) => i.attrib).map((i) => [i.id, i.attrib?.frameStart ?? null])
4059
4069
  ) : {},
4060
4070
  [t, o]
4061
- ), r = S(() => {
4071
+ ), r = I(() => {
4062
4072
  const i = /* @__PURE__ */ new Set();
4063
- for (const c of n) {
4064
- const m = c.origin;
4065
- c.activityType !== "comment" || m?.type !== "version" || m.id in a || !Es(c) || i.add(m.id);
4073
+ for (const l of n) {
4074
+ const m = l.origin;
4075
+ l.activityType !== "comment" || m?.type !== "version" || m.id in a || !Ps(l) || i.add(m.id);
4066
4076
  }
4067
4077
  return [...i].sort();
4068
- }, [n, a]), { data: s } = Sa(
4078
+ }, [n, a]), { data: s } = _a(
4069
4079
  { projectName: e, versionIds: r },
4070
4080
  { skip: !e || !r.length }
4071
4081
  );
4072
- return S(() => ({ ...s, ...a }), [s, a]);
4073
- }, _c = 30, Rc = ({
4082
+ return I(() => ({ ...s, ...a }), [s, a]);
4083
+ }, Rc = 30, Lc = ({
4074
4084
  disabled: e,
4075
4085
  readOnly: t,
4076
4086
  statuses: o = [],
@@ -4081,249 +4091,265 @@ const Es = (e) => !!e.activityData?.annotations?.length || !!yt(e), Ms = ({ proj
4081
4091
  }) => {
4082
4092
  const {
4083
4093
  projectName: i,
4084
- entities: c,
4094
+ entities: l,
4085
4095
  entityType: m,
4086
4096
  editingId: p,
4087
4097
  projectInfo: g,
4088
4098
  setEditingId: u,
4089
4099
  userName: h,
4090
- activitiesData: v,
4100
+ activitiesData: b,
4091
4101
  isLoadingNew: y,
4092
4102
  isLoadingNextPage: D,
4093
- loadNextPage: P,
4103
+ loadNextPage: M,
4094
4104
  hasNextPage: C,
4095
4105
  users: f,
4096
- categories: b,
4097
- checklistCount: T,
4098
- feedFilter: I,
4099
- setFeedFilter: _,
4100
- isGuest: R,
4106
+ categories: w,
4107
+ checklistCount: A,
4108
+ feedFilter: S,
4109
+ setFeedFilter: P,
4110
+ isGuest: _,
4101
4111
  searchText: E,
4102
4112
  setSearchText: N
4103
4113
  } = $e(), {
4104
- openSlideOut: Q,
4105
- highlightedActivities: Y,
4106
- setHighlightedActivities: H,
4107
- onOpenImage: J,
4108
- setFeedAnnotations: q,
4114
+ openSlideOut: G,
4115
+ highlightedActivities: X,
4116
+ setHighlightedActivities: Q,
4117
+ onOpenImage: Z,
4118
+ setFeedAnnotations: Y,
4109
4119
  setFeedFrameLinks: $,
4110
- user: te
4111
- } = ze(), oe = I.conditions?.some(
4112
- (w) => "key" in w && w.key === "versions" && w.value === !0
4113
- ), W = I.conditions?.some(
4114
- (w) => "key" in w && ["comments", "checklists", "versions", "updates"].includes(w.key) && w.value === !0
4115
- ), U = I.conditions?.some(
4116
- (w) => "key" in w && (w.key === "comments" || w.key === "checklists") && w.value === !0
4117
- ), de = m === "version" || m === "folder", { data: ae, isLoading: ne } = Ia({ projectName: i }, { skip: !i }), we = !te.data?.isManager && !te.data?.isAdmin && !ne && ae?.activities?.enabled && !ae?.activities?.activities?.includes("comment") || W && !U, xe = S(
4118
- () => Cs(v),
4119
- [v]
4120
+ user: oe
4121
+ } = Be(), ae = S.conditions?.some(
4122
+ (T) => "key" in T && T.key === "versions" && T.value === !0
4123
+ ), J = S.conditions?.some(
4124
+ (T) => "key" in T && ["comments", "checklists", "versions", "updates"].includes(T.key) && T.value === !0
4125
+ ), j = S.conditions?.some(
4126
+ (T) => "key" in T && (T.key === "comments" || T.key === "checklists") && T.value === !0
4127
+ ), de = m === "version" || m === "folder", H = m === "folder" && l.length === 1 ? l[0] : null, ee = f.find((T) => T.name === H?.createdBy), { data: Oe, isLoading: De } = Ra({ projectName: i }, { skip: !i }), be = !oe.data?.isManager && !oe.data?.isAdmin && !De && Oe?.activities?.enabled && !Oe?.activities?.activities?.includes("comment") || J && !j, ge = I(
4128
+ () => Ds(b),
4129
+ [b]
4120
4130
  );
4121
- G(() => {
4122
- xe.length || q([]);
4123
- const w = xe.map(
4124
- (M) => M.activityData?.annotations?.map((O) => ({
4125
- ...O,
4126
- activityId: M.activityId
4131
+ W(() => {
4132
+ ge.length || Y([]);
4133
+ const T = ge.map(
4134
+ (R) => R.activityData?.annotations?.map((U) => ({
4135
+ ...U,
4136
+ activityId: R.activityId
4127
4137
  }))
4128
4138
  ).filter(Boolean).flat();
4129
- q(w);
4130
- }, [xe]), G(() => {
4131
- const w = v.map((M) => {
4132
- const O = yt(M);
4133
- return O && { ...O, activityId: M.activityId };
4134
- }).filter((M) => !!M);
4135
- $(w);
4136
- }, [v]);
4137
- const ke = Ms({
4139
+ Y(T);
4140
+ }, [ge]), W(() => {
4141
+ const T = b.map((R) => {
4142
+ const U = yt(R);
4143
+ return U && { ...U, activityId: R.activityId };
4144
+ }).filter((R) => !!R);
4145
+ $(T);
4146
+ }, [b]);
4147
+ const Ge = _s({
4138
4148
  projectName: i,
4139
4149
  entityType: m,
4140
- entities: c,
4141
- activities: v
4142
- }), he = bs(
4150
+ entities: l,
4151
+ activities: b
4152
+ }), ue = xs(
4143
4153
  // @ts-ignore
4144
- xe,
4154
+ ge,
4145
4155
  f,
4146
4156
  g,
4147
4157
  m,
4148
4158
  h,
4149
- I
4150
- ), Me = S(() => {
4151
- if (!E) return he;
4152
- const w = E.toLowerCase();
4153
- return he.filter(
4154
- (M) => M.body?.toLowerCase().includes(w)
4159
+ S
4160
+ ), xe = I(() => {
4161
+ if (!E) return ue;
4162
+ const T = E.toLowerCase();
4163
+ return ue.filter(
4164
+ (R) => R.body?.toLowerCase().includes(T)
4155
4165
  );
4156
- }, [he, E]), K = ge(null);
4157
- xs({ feedRef: K, isInputOpen: p === it, height: 93 }), ws({
4158
- entities: c,
4159
- feedRef: K,
4160
- filter: I,
4161
- disabled: !!Y.length,
4166
+ }, [ue, E]), he = pe(null);
4167
+ As({ feedRef: he, isInputOpen: p === rt, height: 93 }), ks({
4168
+ entities: l,
4169
+ feedRef: he,
4170
+ filter: S,
4171
+ disabled: !!X.length,
4162
4172
  isLoading: y
4163
- }), Fs({
4164
- feedRef: K,
4165
- highlighted: Y,
4173
+ }), Ts({
4174
+ feedRef: he,
4175
+ highlighted: X,
4166
4176
  isLoading: y || D,
4167
- loadNextPage: P,
4168
- hasNextPage: !!P,
4169
- activities: v
4177
+ loadNextPage: M,
4178
+ hasNextPage: !!M,
4179
+ activities: b
4170
4180
  });
4171
4181
  const {
4172
- submitComment: Te,
4173
- updateComment: Oe,
4174
- deleteComment: Se,
4175
- submitReview: De,
4176
- isSaving: Ye
4177
- } = ms({
4182
+ submitComment: Ne,
4183
+ updateComment: Ie,
4184
+ deleteComment: Ze,
4185
+ submitReview: Re,
4186
+ isSaving: fe
4187
+ } = gs({
4178
4188
  projectName: i,
4179
4189
  entityType: m,
4180
- entities: c,
4181
- filter: I,
4190
+ entities: l,
4191
+ filter: S,
4182
4192
  entityListId: n
4183
- }), Ve = qe(
4184
- async (w, M = [], O = {}) => {
4185
- await Te(w, M, O), K.current && K.current.scrollTo({ top: 0 });
4193
+ }), He = Je(
4194
+ async (T, R = [], U = {}) => {
4195
+ await Ne(T, R, U), he.current && he.current.scrollTo({ top: 0 });
4186
4196
  },
4187
- [Te, K]
4188
- ), fe = qe(
4189
- async (w) => {
4190
- await De(w);
4197
+ [Ne, he]
4198
+ ), qe = Je(
4199
+ async (T) => {
4200
+ await Re(T);
4191
4201
  },
4192
- [De]
4193
- ), Be = (w, M) => {
4194
- const O = w?.target;
4195
- if (!O || !M) return console.log("no target or activity");
4196
- const X = O.checked, ue = X ? "[ ]" : "[x]", A = X ? "[x]" : "[ ]", { body: me } = M, ye = Array.from(
4197
- O.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
4198
- ).findIndex((et) => et === O.closest("li"));
4199
- let Ie = ye;
4200
- (me.match(/\[.\]/g) || []).forEach((et, bt) => {
4201
- et !== ue && bt < ye && Ie--;
4202
+ [Re]
4203
+ ), re = (T, R) => {
4204
+ const U = T?.target;
4205
+ if (!U || !R) return console.log("no target or activity");
4206
+ const v = U.checked, K = v ? "[ ]" : "[x]", we = v ? "[x]" : "[ ]", { body: Ae } = R, Fe = Array.from(
4207
+ U.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
4208
+ ).findIndex((_e) => _e === U.closest("li"));
4209
+ let Le = Fe;
4210
+ (Ae.match(/\[.\]/g) || []).forEach((_e, mt) => {
4211
+ _e !== K && mt < Fe && Le--;
4202
4212
  });
4203
- const Le = [];
4204
- let Ke = -1;
4205
- for (; (Ke = me.indexOf(ue, Ke + 1)) > -1; )
4206
- Le.push(Ke);
4207
- const Xe = Le[Ie];
4208
- if (Xe === void 0) return;
4209
- const mt = Xe + ue.length, Ze = me.slice(0, Xe) + A + me.slice(mt);
4210
- Ze && Oe(M, Ze, M.files);
4211
- }, Ge = (w) => {
4212
- const { entityId: M, entityType: O, activityId: X } = w;
4213
- if (!O || !["version", "task", "folder"].includes(O))
4213
+ const dt = [];
4214
+ let Qe = -1;
4215
+ for (; (Qe = Ae.indexOf(K, Qe + 1)) > -1; )
4216
+ dt.push(Qe);
4217
+ const Ye = dt[Le];
4218
+ if (Ye === void 0) return;
4219
+ const bt = Ye + K.length, ut = Ae.slice(0, Ye) + we + Ae.slice(bt);
4220
+ ut && Ie(R, ut, R.files);
4221
+ }, et = (T) => {
4222
+ const { entityId: R, entityType: U, activityId: v } = T;
4223
+ if (!U || !["version", "task", "folder"].includes(U))
4214
4224
  return console.log("Entity type not supported yet");
4215
- if (!M || !O || !i) return console.log("No entity id or type found");
4216
- Q({ entityId: M, entityType: O, projectName: i }), H([X]);
4217
- }, re = ({ index: w, activityId: M }) => {
4218
- const O = Object.values(Me).reverse().filter((X) => X.activityType == "comment").map((X) => ({
4219
- id: X.activityId,
4220
- files: X.files.filter((ue) => vt(ue.mime, ue.ext))
4221
- })).filter((X) => X.files.length > 0);
4222
- J?.({ files: O, activityId: M, index: w, projectName: i });
4223
- }, [Je, Pe] = L(null), He = !we && !t && !e, _e = qe(
4224
- (w) => {
4225
- Pe({ key: wn(), activity: w }), u(it);
4225
+ if (!R || !U || !i) return console.log("No entity id or type found");
4226
+ G({ entityId: R, entityType: U, projectName: i }), Q([v]);
4227
+ }, je = ({ index: T, activityId: R }) => {
4228
+ const U = Object.values(xe).reverse().filter((v) => v.activityType == "comment").map((v) => ({
4229
+ id: v.activityId,
4230
+ files: v.files.filter((K) => vt(K.mime, K.ext))
4231
+ })).filter((v) => v.files.length > 0);
4232
+ Z?.({ files: U, activityId: R, index: T, projectName: i });
4233
+ }, [We, Ee] = L(null), Ue = !be && !t && !e, ke = Je(
4234
+ (T) => {
4235
+ Ee({ key: xn(), activity: T }), u(rt);
4226
4236
  },
4227
4237
  [u]
4228
- ), je = S(() => As(10), []), Ae = Is({
4238
+ ), Me = I(() => Cs(10), []), q = Ms({
4229
4239
  projectName: i,
4230
4240
  enabled: r,
4231
- entityIds: c.map((w) => w.id),
4232
- activities: he,
4241
+ entityIds: l.map((T) => T.id),
4242
+ activities: ue,
4233
4243
  loadingActivities: y,
4234
4244
  userName: h
4235
4245
  });
4236
- return /* @__PURE__ */ l(Ce, { children: /* @__PURE__ */ k(cs, { className: "feed", children: [
4246
+ return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(ds, { className: "feed", children: [
4237
4247
  void 0,
4238
- /* @__PURE__ */ l(
4239
- Xn,
4248
+ /* @__PURE__ */ c(
4249
+ to,
4240
4250
  {
4241
- feedFilter: I,
4242
- setFeedFilter: _,
4251
+ feedFilter: S,
4252
+ setFeedFilter: P,
4243
4253
  users: f,
4244
- categories: b,
4254
+ categories: w,
4245
4255
  supportsReviewSession: de,
4246
4256
  isLoading: y,
4247
4257
  onSearchTextChange: N,
4248
- checklistCount: T
4258
+ checklistCount: A
4249
4259
  }
4250
4260
  ),
4251
- /* @__PURE__ */ k(ls, { ref: K, className: ee({ loading: y }, "no-shimmer"), children: [
4252
- y ? je : Me.map((w) => /* @__PURE__ */ l(
4253
- Jn,
4261
+ /* @__PURE__ */ x(us, { ref: he, className: ne({ loading: y }, "no-shimmer"), children: [
4262
+ y ? Me : xe.map((T) => /* @__PURE__ */ c(
4263
+ Zn,
4254
4264
  {
4255
- activity: w,
4256
- annotationFrameStart: ke[w.origin?.id],
4257
- onCheckChange: Be,
4258
- onDelete: Se,
4259
- onUpdate: async (M, O, X, ue) => await Oe(w, M, O, ue),
4260
- onDuplicate: He ? _e : void 0,
4265
+ activity: T,
4266
+ annotationFrameStart: Ge[T.origin?.id],
4267
+ onCheckChange: re,
4268
+ onDelete: Ze,
4269
+ onUpdate: async (R, U, v, K) => await Ie(T, R, U, K),
4270
+ onDuplicate: Ue ? ke : void 0,
4261
4271
  projectInfo: g,
4262
4272
  projectName: i,
4263
4273
  entityType: m,
4264
- onReferenceClick: Ge,
4265
- createdAts: c.map((M) => M.createdAt),
4266
- onFileExpand: re,
4267
- showOrigin: c.length > 1,
4268
- filter: I,
4274
+ onReferenceClick: et,
4275
+ createdAts: l.map((R) => R.createdAt),
4276
+ onFileExpand: je,
4277
+ showOrigin: l.length > 1,
4278
+ filter: S,
4269
4279
  editProps: {
4270
4280
  projectName: i,
4271
- entities: c,
4281
+ entities: l,
4272
4282
  entityType: m
4273
4283
  },
4274
- isHighlighted: Y.includes(w.activityId),
4284
+ isHighlighted: X.includes(T.activityId),
4275
4285
  readOnly: t,
4276
4286
  statuses: o,
4277
4287
  isSlideOut: a,
4278
- isGuest: R
4288
+ isGuest: _
4279
4289
  },
4280
- w.activityId
4290
+ T.activityId
4281
4291
  )),
4282
- Me.length === 0 && oe && !U && !y && /* @__PURE__ */ l(St, { message: "No versions published yet", icon: "layers" }),
4283
- C && P && /* @__PURE__ */ l(
4284
- Ja,
4292
+ xe.length === 0 && ae && !j && !y && /* @__PURE__ */ c(It, { message: "No versions published yet", icon: "layers" }),
4293
+ C && M && /* @__PURE__ */ c(
4294
+ tr,
4285
4295
  {
4286
- root: K.current,
4287
- onChange: (w) => w && P(),
4296
+ root: he.current,
4297
+ onChange: (T) => T && M(),
4288
4298
  rootMargin: "400px 0px 0px 0px",
4289
- children: /* @__PURE__ */ l(ds, { style: { height: 0 }, onClick: () => P(), children: D ? "Loading more..." : "Click to load more" })
4299
+ children: /* @__PURE__ */ c(ms, { style: { height: 0 }, onClick: () => M(), children: D ? "Loading more..." : "Click to load more" })
4290
4300
  }
4291
- )
4301
+ ),
4302
+ !y && !S.conditions?.length && !E && H?.createdAt && Ke(new Date(H.createdAt)) && /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { style: { alignItems: "center" }, children: [
4303
+ /* @__PURE__ */ x(Rt, { children: [
4304
+ "Folder created at ",
4305
+ St(new Date(H.createdAt), "PPpp"),
4306
+ " by"
4307
+ ] }),
4308
+ H.createdBy && /* @__PURE__ */ c(
4309
+ va,
4310
+ {
4311
+ name: H.createdBy,
4312
+ fullName: ee?.attrib?.fullName || void 0,
4313
+ size: 20
4314
+ }
4315
+ ),
4316
+ /* @__PURE__ */ c(Rt, { children: ee?.attrib?.fullName || H.createdBy || "Unknown" })
4317
+ ] }) })
4292
4318
  ] }),
4293
- !we && /* @__PURE__ */ l(
4294
- Gn,
4319
+ !be && /* @__PURE__ */ c(
4320
+ Hn,
4295
4321
  {
4296
4322
  initValue: null,
4297
- onSubmit: Ve,
4298
- isOpen: p === it,
4323
+ onSubmit: He,
4324
+ isOpen: p === rt,
4299
4325
  onClose: () => u(null),
4300
- onOpen: () => u(it),
4326
+ onOpen: () => u(rt),
4301
4327
  disabled: e,
4302
- isLoading: y || !c.length || Ye,
4328
+ isLoading: y || !l.length || fe,
4303
4329
  versionReview: r,
4304
- lastOwnVersionReview: Ae,
4305
- onReview: fe,
4306
- duplicate: Je,
4307
- onDuplicateHandled: () => Pe(null),
4330
+ lastOwnVersionReview: q,
4331
+ onReview: qe,
4332
+ duplicate: We,
4333
+ onDuplicateHandled: () => Ee(null),
4308
4334
  saveDraft: s
4309
4335
  }
4310
4336
  )
4311
4337
  ] }) });
4312
4338
  };
4313
4339
  export {
4314
- Gr as A,
4315
- qr as C,
4316
- Mc as D,
4317
- it as F,
4318
- un as P,
4319
- Pc as S,
4320
- Ur as a,
4321
- st as b,
4322
- Rc as c,
4323
- Ec as d,
4324
- xr as e,
4325
- _c as f,
4340
+ Yr as A,
4341
+ Kr as C,
4342
+ Pc as D,
4343
+ rt as F,
4344
+ mn as P,
4345
+ _c as S,
4346
+ qr as a,
4347
+ it as b,
4348
+ Lc as c,
4349
+ Mc as d,
4350
+ Tr as e,
4351
+ Rc as f,
4326
4352
  vt as g,
4327
- Hr as i,
4328
- Jr as r
4353
+ Jr as i,
4354
+ ti as r
4329
4355
  };