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