synapse-react-client 4.0.10 → 4.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/SWC.index.js +1 -1
  2. package/dist/assets/icons/CloudWarning.d.ts +5 -0
  3. package/dist/assets/icons/CloudWarning.d.ts.map +1 -0
  4. package/dist/assets/icons/CloudWarning.js +47 -0
  5. package/dist/assets/icons/CloudWarning.js.map +1 -0
  6. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.d.ts.map +1 -1
  7. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js +143 -140
  8. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  9. package/dist/components/DataGrid/columns/AutocompleteColumn.d.ts.map +1 -1
  10. package/dist/components/DataGrid/columns/AutocompleteColumn.js +66 -55
  11. package/dist/components/DataGrid/columns/AutocompleteColumn.js.map +1 -1
  12. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.d.ts.map +1 -1
  13. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.js +1 -1
  14. package/dist/components/DataGrid/columns/AutocompleteMultipleEnumColumn.js.map +1 -1
  15. package/dist/components/DataGrid/utils/applyModelChange.d.ts +1 -1
  16. package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
  17. package/dist/components/DataGrid/utils/applyModelChange.js +27 -24
  18. package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
  19. package/dist/components/DataGrid/utils/columnFactory.d.ts +8 -0
  20. package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
  21. package/dist/components/DataGrid/utils/columnFactory.js +47 -44
  22. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  23. package/dist/components/DataGrid/utils/getEmptyValue.d.ts +2 -0
  24. package/dist/components/DataGrid/utils/getEmptyValue.d.ts.map +1 -0
  25. package/dist/components/DataGrid/utils/getEmptyValue.js +8 -0
  26. package/dist/components/DataGrid/utils/getEmptyValue.js.map +1 -0
  27. package/dist/components/DataGrid/utils/modelColsToGrid.d.ts.map +1 -1
  28. package/dist/components/DataGrid/utils/modelColsToGrid.js +2 -1
  29. package/dist/components/DataGrid/utils/modelColsToGrid.js.map +1 -1
  30. package/dist/components/DataGrid/utils/schemaAwarePasteValue.d.ts +32 -0
  31. package/dist/components/DataGrid/utils/schemaAwarePasteValue.d.ts.map +1 -0
  32. package/dist/components/DataGrid/utils/schemaAwarePasteValue.js +22 -0
  33. package/dist/components/DataGrid/utils/schemaAwarePasteValue.js.map +1 -0
  34. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.css +1 -0
  35. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.d.ts.map +1 -1
  36. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js +199 -132
  37. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.js.map +1 -1
  38. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js +22 -0
  39. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.js.map +1 -0
  40. package/dist/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.module.scss +170 -0
  41. package/dist/components/EntityDownloadButton/EntityDownloadButton.d.ts.map +1 -1
  42. package/dist/components/EntityDownloadButton/EntityDownloadButton.js +1 -0
  43. package/dist/components/EntityDownloadButton/EntityDownloadButton.js.map +1 -1
  44. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.d.ts.map +1 -1
  45. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js +15 -14
  46. package/dist/components/EntityViewScopeEditor/EntityViewMaskEditor.js.map +1 -1
  47. package/dist/components/Forum/DiscussionReply.d.ts +1 -0
  48. package/dist/components/Forum/DiscussionReply.d.ts.map +1 -1
  49. package/dist/components/Forum/DiscussionReply.js +19 -19
  50. package/dist/components/Forum/DiscussionReply.js.map +1 -1
  51. package/dist/components/Forum/DiscussionThread.d.ts +1 -0
  52. package/dist/components/Forum/DiscussionThread.d.ts.map +1 -1
  53. package/dist/components/Forum/DiscussionThread.js +73 -72
  54. package/dist/components/Forum/DiscussionThread.js.map +1 -1
  55. package/dist/components/GenericCard/BioregistryRules.d.ts.map +1 -1
  56. package/dist/components/GenericCard/BioregistryRules.js +7 -3
  57. package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
  58. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  59. package/dist/components/IconSvg/IconSvg.js +2 -1
  60. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  61. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.d.ts.map +1 -1
  62. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js +157 -148
  63. package/dist/components/dataaccess/SubmissionPage/SubmissionPage.js.map +1 -1
  64. package/dist/components/doi/CreateOrUpdateDoiModal.d.ts.map +1 -1
  65. package/dist/components/doi/CreateOrUpdateDoiModal.js +20 -19
  66. package/dist/components/doi/CreateOrUpdateDoiModal.js.map +1 -1
  67. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.d.ts.map +1 -1
  68. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js +1 -1
  69. package/dist/features/entity/metadata-task/components/MetadataTasksTableAssigneeCell.js.map +1 -1
  70. package/dist/synapse-queries/KeyFactory.d.ts +1 -0
  71. package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
  72. package/dist/synapse-queries/KeyFactory.js +3 -0
  73. package/dist/synapse-queries/KeyFactory.js.map +1 -1
  74. package/dist/synapse-queries/forum/useThread.d.ts +1 -0
  75. package/dist/synapse-queries/forum/useThread.d.ts.map +1 -1
  76. package/dist/synapse-queries/forum/useThread.js +19 -12
  77. package/dist/synapse-queries/forum/useThread.js.map +1 -1
  78. package/dist/tsconfig.build.tsbuildinfo +1 -1
  79. package/dist/utils/APIConstants.d.ts +1 -0
  80. package/dist/utils/APIConstants.d.ts.map +1 -1
  81. package/dist/utils/APIConstants.js +2 -2
  82. package/dist/utils/APIConstants.js.map +1 -1
  83. package/dist/utils/AppUtils/session/ApplicationSessionManager.d.ts.map +1 -1
  84. package/dist/utils/AppUtils/session/ApplicationSessionManager.js +7 -4
  85. package/dist/utils/AppUtils/session/ApplicationSessionManager.js.map +1 -1
  86. package/dist/utils/functions/EntityTypeUtils.d.ts.map +1 -1
  87. package/dist/utils/functions/EntityTypeUtils.js +15 -4
  88. package/dist/utils/functions/EntityTypeUtils.js.map +1 -1
  89. package/package.json +4 -4
@@ -6,53 +6,75 @@ import { useSynapseContext as i } from "../../utils/context/SynapseContext.js";
6
6
  import "../../utils/index.js";
7
7
  import { useGetAvailableFilesToDownloadInfinite as a, useGetDownloadListStatistics as o, useRemoveFilesFromDownloadList as s } from "../../synapse-queries/download/useDownloadList.js";
8
8
  import { useGetEntityQueryOptions as c } from "../../synapse-queries/entity/useEntity.js";
9
- import { DialogBase as l } from "../DialogBase.js";
9
+ import l from "../../assets/icons/CloudWarning.js";
10
10
  import { deduplicateFileName as u, getFileName as d } from "./fileNameUtils.js";
11
- import { useCallback as f, useRef as p, useState as m } from "react";
12
- import { Button as h, LinearProgress as g, Typography as _ } from "@mui/material";
13
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
- import { FileHandleAssociateType as x } from "@sage-bionetworks/synapse-types";
15
- import { useQueryClient as S } from "@tanstack/react-query";
16
- import { Download as C } from "@mui/icons-material";
11
+ import f from "./DownloadIneligibleForPackagingFilesFromListButton.module.js";
12
+ import { useCallback as p, useEffect as m, useRef as h, useState as g } from "react";
13
+ import { Box as _, Button as v, IconButton as y, LinearProgress as ee, Paper as b, Typography as x } from "@mui/material";
14
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
15
+ import { FileHandleAssociateType as te } from "@sage-bionetworks/synapse-types";
16
+ import { useQueryClient as ne } from "@tanstack/react-query";
17
+ import { Close as re, Download as ie } from "@mui/icons-material";
18
+ import T from "dayjs";
19
+ import E from "dayjs/plugin/relativeTime";
20
+ import D from "dayjs/plugin/duration";
17
21
  //#region src/components/DownloadCart/DownloadIneligibleForPackagingFilesFromListButton.tsx
18
- function w(e) {
22
+ function ae(e) {
19
23
  return "showDirectoryPicker" in e;
20
24
  }
21
- var T = 50;
22
- function E(E) {
23
- let { buttonText: D = "Start Multi-file Download", variant: O = "contained" } = E, { accessToken: k, isAuthenticated: A } = i(), j = S(), M = c(), [N, P] = m(!1), F = p(!1), I = p(!1), [L, R] = m(null), { data: z, status: B, hasNextPage: V, fetchNextPage: H, error: U } = a(), { mutateAsync: W } = s(), { refetch: G } = o(), K = f(async (t) => {
24
- if (!F.current) {
25
- if (!t || !A) {
26
- P(!1);
25
+ var O = 50, k = 3e3;
26
+ T.extend(D), T.extend(E);
27
+ function A(E) {
28
+ let { buttonText: D = "Start Multi-file Download", variant: A = "contained" } = E, { accessToken: j, isAuthenticated: M } = i(), N = ne(), P = c(), [F, I] = g(!1), L = h(!1), [oe, R] = g(!1), z = h(!1), B = h(null), [V, H] = g(null), U = h(null), [se, W] = g(""), G = h(-1), K = h(-1);
29
+ m(() => {
30
+ if (!V) {
31
+ G.current = -1, K.current = -1, W("");
32
+ return;
33
+ }
34
+ let { fileIndex: e, totalFiles: t, currentFile: n, bytesDownloaded: r, totalBytes: i } = V;
35
+ if (e !== G.current) {
36
+ G.current = e, K.current = -1, W(`Downloading file ${e} of ${t}: ${n}`);
37
+ return;
38
+ }
39
+ if (i > 0) {
40
+ let e = Math.floor(r / i * 100), t = Math.floor(e / 25) * 25;
41
+ t > 0 && t !== K.current && (K.current = t, W(`${t}% of ${n} downloaded`));
42
+ }
43
+ }, [V]);
44
+ let { data: q, status: J, hasNextPage: Y, fetchNextPage: X, error: ce } = a(), { mutateAsync: Z } = s(), { refetch: Q } = o(), $ = p(async (t) => {
45
+ if (!L.current) {
46
+ if (!t || !M) {
47
+ I(!1);
27
48
  return;
28
49
  }
29
50
  try {
30
- F.current = !0, I.current = !1;
51
+ L.current = !0, z.current = !1, R(!1);
31
52
  let i = t.pages.flatMap((e) => e.page).filter((e) => !e.isEligibleForPackaging);
32
53
  if (i.length === 0) {
33
- e("No non-packageable files available to download", "info"), P(!1), F.current = !1;
54
+ e("No non-packageable files available to download", "info"), I(!1), L.current = !1;
34
55
  return;
35
56
  }
36
- let a = w(window), o;
57
+ let a = ae(window), o;
37
58
  if (a) {
38
59
  let t = window;
39
60
  try {
40
61
  o = await t.showDirectoryPicker({ mode: "readwrite" });
41
62
  } catch (t) {
42
- console.error("Failed to select directory:", t), e("Directory selection is required to directly download files from the website.", "warning"), P(!1), F.current = !1;
63
+ console.error("Failed to select directory:", t), e("Directory selection is required to directly download files from the website.", "warning"), I(!1), L.current = !1;
43
64
  return;
44
65
  }
45
66
  } else e("Your browser will download files individually to your default downloads folder. Each file may trigger a separate download prompt.", "info");
46
- R({
67
+ U.current = null, H({
47
68
  currentFile: "",
48
69
  fileIndex: 0,
49
70
  totalFiles: i.length,
50
71
  bytesDownloaded: 0,
51
- totalBytes: 0
72
+ totalBytes: 0,
73
+ estimatedSecondsRemaining: null
52
74
  });
53
75
  let s = /* @__PURE__ */ new Map(), c = i.map(async (e) => {
54
- if (!I.current) try {
55
- let t = await j.ensureQueryData(M(e.fileEntityId, e.versionNumber?.toString())), n = `${t.id}-${e.versionNumber ?? "latest"}`;
76
+ if (!z.current) try {
77
+ let t = await N.ensureQueryData(P(e.fileEntityId, e.versionNumber?.toString())), n = `${t.id}-${e.versionNumber ?? "latest"}`;
56
78
  s.set(n, t.dataFileHandleId);
57
79
  } catch (t) {
58
80
  console.error(`Failed to fetch entity ${e.fileEntityId}:`, t);
@@ -67,15 +89,15 @@ function E(E) {
67
89
  return {
68
90
  fileHandleId: s.get(t),
69
91
  associateObjectId: e.fileEntityId,
70
- associateObjectType: x.FileEntity
92
+ associateObjectType: te.FileEntity
71
93
  };
72
94
  });
73
95
  if (l.length === 0) {
74
- e("Failed to fetch file information for download", "danger"), P(!1), F.current = !1;
96
+ e("Failed to fetch file information for download", "danger"), I(!1), L.current = !1;
75
97
  return;
76
98
  }
77
99
  let f = [];
78
- for (let e = 0; e < l.length; e += T) f.push(l.slice(e, e + T));
100
+ for (let e = 0; e < l.length; e += O) f.push(l.slice(e, e + O));
79
101
  let p = 0, m = 0, h = [], g = /* @__PURE__ */ new Map(), _ = async (e, t) => {
80
102
  try {
81
103
  let n = await fetch(e);
@@ -93,45 +115,59 @@ function E(E) {
93
115
  }, v = async (e, t) => {
94
116
  try {
95
117
  let n;
96
- if (e.fileHandle && r(e.fileHandle) ? n = e.fileHandle.externalURL : e.preSignedURL && (n = e.preSignedURL), !n) return !1;
118
+ if (e.fileHandle && r(e.fileHandle) ? (n = e.fileHandle.externalURL, R(!0)) : e.preSignedURL && (n = e.preSignedURL), !n) return !1;
97
119
  let i = u(d(e, t), g), s = p + 1;
98
- if (R((e) => e ? {
120
+ if (U.current = null, H((e) => e ? {
99
121
  ...e,
100
122
  currentFile: i,
101
123
  fileIndex: s,
102
124
  bytesDownloaded: 0,
103
- totalBytes: 0
125
+ totalBytes: 0,
126
+ estimatedSecondsRemaining: null
104
127
  } : null), !a) {
105
128
  let e = await _(n, i);
106
129
  return e && (p = s, t && h.push(t)), e;
107
130
  }
108
131
  if (!o) return !1;
109
132
  try {
110
- let e = await fetch(n);
133
+ B.current = new AbortController();
134
+ let e = await fetch(n, { signal: B.current.signal });
111
135
  if (!e.ok) throw Error(`HTTP error! status: ${e.status}`);
112
136
  let r = e.headers.get("content-length"), a = r ? parseInt(r, 10) : 0;
113
- R((e) => e ? {
137
+ H((e) => e ? {
114
138
  ...e,
115
139
  bytesDownloaded: 0,
116
140
  totalBytes: a
117
141
  } : null);
118
142
  let c = await (await o.getFileHandle(i, { create: !0 })).createWritable();
119
143
  if (e.body) {
120
- let t = e.body.getReader(), n = 0;
144
+ let t = e.body.getReader(), n = 0, r = !1;
121
145
  try {
122
146
  for (;;) {
123
- let { done: e, value: r } = await t.read();
147
+ let { done: e, value: i } = await t.read();
124
148
  if (e) break;
125
- n += r.length, await c.write(r), R((e) => e ? {
149
+ if (n += i.length, await c.write(i), z.current) {
150
+ r = !0, t.cancel(), await c.abort();
151
+ break;
152
+ }
153
+ U.current === null && (U.current = Date.now());
154
+ let o = Date.now() - U.current, s = null;
155
+ if (o > k && n > 0 && a > 0) {
156
+ let e = n / o;
157
+ s = Math.max(0, (a - n) / e / 1e3);
158
+ }
159
+ H((e) => e ? {
126
160
  ...e,
127
- bytesDownloaded: n
161
+ bytesDownloaded: n,
162
+ ...o > k && { estimatedSecondsRemaining: s }
128
163
  } : null);
129
164
  }
130
165
  } catch (e) {
131
- throw await c.abort(), e;
166
+ throw r ||= (await c.abort(), !0), e;
132
167
  } finally {
133
- await c.close();
168
+ r || await c.close();
134
169
  }
170
+ if (z.current) return !1;
135
171
  } else try {
136
172
  let t = await e.blob();
137
173
  await c.write(t);
@@ -140,6 +176,7 @@ function E(E) {
140
176
  }
141
177
  return p = s, t && h.push(t), !0;
142
178
  } catch (r) {
179
+ if (z.current || r instanceof DOMException && r.name === "AbortError") return !1;
143
180
  console.error(`Failed to fetch/write file ${e.fileHandleId}:`, r);
144
181
  try {
145
182
  return _(n, i), p = s, t && h.push(t), !0;
@@ -153,7 +190,7 @@ function E(E) {
153
190
  }, y = async (e) => {
154
191
  console.info(`Attempting to fetch ${e.length} files individually after batch failure`);
155
192
  for (let t of e) {
156
- if (I.current) {
193
+ if (z.current) {
157
194
  console.info("Individual file fetch cancelled by user");
158
195
  break;
159
196
  }
@@ -164,7 +201,7 @@ function E(E) {
164
201
  includeFileHandles: !0,
165
202
  includePreSignedURLs: !0,
166
203
  includePreviewPreSignedURLs: !1
167
- }, k);
204
+ }, j);
168
205
  if (r.requestedFiles.length > 0) {
169
206
  let e = r.requestedFiles[0];
170
207
  await v(e, i.find((e) => e.fileEntityId === t.associateObjectId)) || m++;
@@ -175,7 +212,7 @@ function E(E) {
175
212
  }
176
213
  };
177
214
  for (let e of f) {
178
- if (I.current) {
215
+ if (z.current) {
179
216
  console.info("Download cancelled by user");
180
217
  break;
181
218
  }
@@ -186,12 +223,12 @@ function E(E) {
186
223
  includeFileHandles: !0,
187
224
  includePreSignedURLs: !0,
188
225
  includePreviewPreSignedURLs: !1
189
- }, k);
226
+ }, j);
190
227
  } catch (e) {
191
228
  console.error("Failed to fetch batch:", e);
192
229
  }
193
230
  if (t) for (let n = 0; n < t.requestedFiles.length; n++) {
194
- if (I.current) {
231
+ if (z.current) {
195
232
  console.info("Download cancelled by user during batch processing");
196
233
  break;
197
234
  }
@@ -200,119 +237,149 @@ function E(E) {
200
237
  }
201
238
  else await y(e);
202
239
  }
203
- h.length > 0 && (await W({ batchToRemove: h.map((e) => ({
240
+ h.length > 0 && (await Z({ batchToRemove: h.map((e) => ({
204
241
  fileEntityId: e.fileEntityId,
205
242
  versionNumber: e.versionNumber
206
- })) }), await G(), window.scrollTo({
243
+ })) }), await Q(), window.scrollTo({
207
244
  top: 0,
208
245
  behavior: "smooth"
209
- })), I.current ? e(`Download cancelled. ${p} file${p === 1 ? " was" : "s were"} downloaded before cancellation.`, "info") : p > 0 ? e(`Download started for ${p} file${p === 1 ? "" : "s"}${m > 0 ? `. ${m} file${m === 1 ? "" : "s"} failed.` : "."}`, m > 0 ? "warning" : "success") : e("No files could be downloaded", "warning");
246
+ })), z.current ? e(`Download cancelled. ${p} file${p === 1 ? " was" : "s were"} downloaded before cancellation.`, "info") : p > 0 ? e(`Download started for ${p} file${p === 1 ? "" : "s"}${m > 0 ? `. ${m} file${m === 1 ? "" : "s"} failed.` : "."}`, m > 0 ? "warning" : "success") : e("No files could be downloaded", "warning");
210
247
  } catch (t) {
211
248
  console.error("Error downloading files:", t), e(t?.reason ?? (t instanceof Error ? t.message : void 0) ?? "An error occurred while downloading files", "danger");
212
249
  } finally {
213
- R(null), P(!1), F.current = !1;
250
+ H(null), I(!1), L.current = !1;
214
251
  }
215
252
  }
216
253
  }, [
217
- k,
218
- A,
219
254
  j,
220
255
  M,
221
- W,
222
- G
223
- ]), q = f(async () => {
224
- if (!N) {
225
- P(!0);
256
+ N,
257
+ P,
258
+ Z,
259
+ Q
260
+ ]), le = p(async () => {
261
+ if (!F) {
262
+ I(!0);
226
263
  try {
227
- let t = V, n = z;
228
- for (; t && H;) {
229
- let e = await H();
264
+ let t = Y, n = q;
265
+ for (; t && X;) {
266
+ let e = await X();
230
267
  t = e.hasNextPage, e.data && (n = e.data);
231
268
  }
232
- B === "success" && n ? K(n) : (P(!1), F.current = !1, e("Failed to load download list. Please try again.", "danger"));
269
+ J === "success" && n ? $(n) : (I(!1), L.current = !1, e("Failed to load download list. Please try again.", "danger"));
233
270
  } catch (t) {
234
- console.error("Error downloading files:", t), P(!1), F.current = !1, e(t?.reason ?? (t instanceof Error ? t.message : void 0) ?? "An error occurred while preparing files for download", "danger");
271
+ console.error("Error downloading files:", t), I(!1), L.current = !1, e(t?.reason ?? (t instanceof Error ? t.message : void 0) ?? "An error occurred while preparing files for download", "danger");
235
272
  }
236
273
  }
237
274
  }, [
238
- N,
239
- V,
240
- H,
241
- B,
242
- z,
243
- K
244
- ]), J = f(() => {
245
- I.current = !0, R(null), P(!1), F.current = !1;
275
+ F,
276
+ Y,
277
+ X,
278
+ J,
279
+ q,
280
+ $
281
+ ]), ue = p(() => {
282
+ z.current = !0, B.current?.abort(), H(null), I(!1), L.current = !1;
246
283
  }, []);
247
- return U ? null : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(l, {
248
- open: !!L,
249
- title: "Downloading Files",
250
- hasCloseButton: !1,
251
- onCancel: J,
252
- maxWidth: "sm",
253
- content: L ? /* @__PURE__ */ b(v, { children: [
254
- /* @__PURE__ */ b(_, {
255
- variant: "body2",
256
- color: "text.secondary",
257
- gutterBottom: !0,
258
- id: "download-progress-description",
259
- children: [
260
- "File ",
261
- L.fileIndex,
262
- " of",
263
- " ",
264
- L.totalFiles
265
- ]
266
- }),
267
- /* @__PURE__ */ y(_, {
268
- variant: "body2",
269
- noWrap: !0,
270
- gutterBottom: !0,
271
- children: L.currentFile
272
- }),
273
- L.totalBytes > 0 && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(g, {
274
- variant: "determinate",
275
- value: L.bytesDownloaded / L.totalBytes * 100,
276
- sx: { my: 2 },
277
- "aria-label": "Download progress"
278
- }), /* @__PURE__ */ b(_, {
279
- variant: "body2",
280
- color: "text.secondary",
281
- "aria-live": "polite",
282
- "aria-atomic": "true",
283
- children: [
284
- t(L.bytesDownloaded),
285
- " ",
286
- "of ",
287
- t(L.totalBytes)
288
- ]
289
- })] }),
290
- L.totalBytes === 0 && /* @__PURE__ */ y(g, {
291
- sx: { my: 2 },
292
- "aria-label": "Download progress"
293
- })
294
- ] }) : null,
295
- actions: /* @__PURE__ */ y(h, {
296
- variant: "outlined",
297
- color: "error",
298
- onClick: J,
299
- children: "Cancel"
284
+ return ce ? null : /* @__PURE__ */ w(S, { children: [
285
+ /* @__PURE__ */ C("span", {
286
+ role: "status",
287
+ "aria-live": "polite",
288
+ "aria-atomic": "true",
289
+ className: f.visuallyHidden,
290
+ children: se
300
291
  }),
301
- DialogProps: {
302
- "aria-describedby": "download-progress-description",
303
- disableEscapeKeyDown: !1
304
- }
305
- }), /* @__PURE__ */ y(h, {
306
- variant: O,
307
- onClick: () => {
308
- q();
309
- },
310
- loading: N,
311
- startIcon: /* @__PURE__ */ y(C, {}),
312
- children: D
313
- })] });
292
+ !!V && oe && /* @__PURE__ */ w(b, {
293
+ elevation: 8,
294
+ className: f.externalWarningPanel,
295
+ sx: { zIndex: (e) => e.zIndex.modal },
296
+ role: "region",
297
+ "aria-label": "External file warning",
298
+ children: [
299
+ /* @__PURE__ */ C(l, { className: f.warningIcon }),
300
+ /* @__PURE__ */ w(_, {
301
+ className: f.warningTextContainer,
302
+ children: [/* @__PURE__ */ C(x, {
303
+ className: f.warningTitleText,
304
+ children: "Some of your files are hosted externally."
305
+ }), /* @__PURE__ */ C(x, {
306
+ className: f.progressFileNameText,
307
+ children: "Downloads may be slower than expected"
308
+ })]
309
+ }),
310
+ /* @__PURE__ */ C(y, {
311
+ onClick: () => R(!1),
312
+ size: "small",
313
+ className: f.warningCloseButton,
314
+ "aria-label": "Dismiss external file warning",
315
+ children: /* @__PURE__ */ C(re, {})
316
+ })
317
+ ]
318
+ }),
319
+ !!V && /* @__PURE__ */ w(b, {
320
+ elevation: 8,
321
+ className: f.progressPanel,
322
+ sx: { zIndex: (e) => e.zIndex.modal },
323
+ role: "region",
324
+ "aria-label": "Download progress",
325
+ children: [
326
+ /* @__PURE__ */ w(x, {
327
+ className: f.progressTitleText,
328
+ children: [
329
+ "Downloading file ",
330
+ V.fileIndex,
331
+ " of",
332
+ " ",
333
+ V.totalFiles
334
+ ]
335
+ }),
336
+ /* @__PURE__ */ C(x, {
337
+ className: f.progressFileNameText,
338
+ children: V.currentFile
339
+ }),
340
+ /* @__PURE__ */ w(_, {
341
+ className: f.progressFooter,
342
+ children: [/* @__PURE__ */ w(_, {
343
+ className: f.progressBarContainer,
344
+ children: [/* @__PURE__ */ w(_, {
345
+ className: f.progressStats,
346
+ children: [/* @__PURE__ */ C(x, {
347
+ className: f.progressStatsText,
348
+ children: V.totalBytes > 0 ? `${Math.round(V.bytesDownloaded / V.totalBytes * 100)}% ( ${t(V.bytesDownloaded, 0)} / ${t(V.totalBytes)} )` : ""
349
+ }), /* @__PURE__ */ C(x, {
350
+ className: f.progressStatsText,
351
+ children: V.estimatedSecondsRemaining === null ? "" : `About ${T.duration({ seconds: V.estimatedSecondsRemaining }).humanize()} remaining`
352
+ })]
353
+ }), /* @__PURE__ */ C(ee, {
354
+ variant: V.totalBytes > 0 ? "determinate" : "indeterminate",
355
+ value: V.totalBytes > 0 ? V.bytesDownloaded / V.totalBytes * 100 : void 0,
356
+ "aria-label": "Download progress",
357
+ className: f.progressBar
358
+ })]
359
+ }), /* @__PURE__ */ C(_, {
360
+ className: f.cancelButtonContainer,
361
+ children: /* @__PURE__ */ C(v, {
362
+ variant: "outlined",
363
+ onClick: ue,
364
+ className: f.cancelButton,
365
+ children: "Cancel"
366
+ })
367
+ })]
368
+ })
369
+ ]
370
+ }),
371
+ /* @__PURE__ */ C(v, {
372
+ variant: A,
373
+ onClick: () => {
374
+ le();
375
+ },
376
+ loading: F,
377
+ startIcon: /* @__PURE__ */ C(ie, {}),
378
+ children: D
379
+ })
380
+ ] });
314
381
  }
315
382
  //#endregion
316
- export { E as DownloadIneligibleForPackagingFilesFromListButton, E as default };
383
+ export { A as DownloadIneligibleForPackagingFilesFromListButton, A as default };
317
384
 
318
385
  //# sourceMappingURL=DownloadIneligibleForPackagingFilesFromListButton.js.map