@burdenoff/microfe-files 2026.527.1 → 2026.527.3

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 (49) hide show
  1. package/dist/files/components/ActionMenu.js +44 -40
  2. package/dist/files/components/ActionMenu.js.map +1 -1
  3. package/dist/files/components/ConfirmDialog.js +42 -40
  4. package/dist/files/components/ConfirmDialog.js.map +1 -1
  5. package/dist/files/components/CopyDialog.js +1 -0
  6. package/dist/files/components/CopyDialog.js.map +1 -1
  7. package/dist/files/components/FileBrowser.js +186 -170
  8. package/dist/files/components/FileBrowser.js.map +1 -1
  9. package/dist/files/components/FileCard.js.map +1 -1
  10. package/dist/files/components/FileInfoPanel.js +102 -102
  11. package/dist/files/components/FileInfoPanel.js.map +1 -1
  12. package/dist/files/components/FileListItem.js.map +1 -1
  13. package/dist/files/components/FolderCard.js +147 -161
  14. package/dist/files/components/FolderCard.js.map +1 -1
  15. package/dist/files/components/MoveDialog.js +9 -12
  16. package/dist/files/components/MoveDialog.js.map +1 -1
  17. package/dist/files/components/SearchBar.js +125 -117
  18. package/dist/files/components/SearchBar.js.map +1 -1
  19. package/dist/files/components/ShareDialog.js +5 -0
  20. package/dist/files/components/ShareDialog.js.map +1 -1
  21. package/dist/files/components/Toast.js +27 -24
  22. package/dist/files/components/Toast.js.map +1 -1
  23. package/dist/files/components/UploadQueue.js +1 -1
  24. package/dist/files/components/UploadQueue.js.map +1 -1
  25. package/dist/files/components/viewers/AudioPlayer.js +3 -0
  26. package/dist/files/components/viewers/AudioPlayer.js.map +1 -1
  27. package/dist/files/components/viewers/TextViewer.js +1 -0
  28. package/dist/files/components/viewers/TextViewer.js.map +1 -1
  29. package/dist/files/components/viewers/VideoPlayer.js +3 -0
  30. package/dist/files/components/viewers/VideoPlayer.js.map +1 -1
  31. package/dist/files/hooks/useCreateFolder.js +15 -7
  32. package/dist/files/hooks/useCreateFolder.js.map +1 -1
  33. package/dist/files/hooks/useKeyboardNavigation.js +51 -51
  34. package/dist/files/hooks/useKeyboardNavigation.js.map +1 -1
  35. package/dist/files/hooks/useMoveFile.js +1 -2
  36. package/dist/files/hooks/useMoveFile.js.map +1 -1
  37. package/dist/files/hooks/useMoveFolder.js +0 -2
  38. package/dist/files/hooks/useMoveFolder.js.map +1 -1
  39. package/dist/files/hooks/useStarredItems.js +4 -3
  40. package/dist/files/hooks/useStarredItems.js.map +1 -1
  41. package/dist/files/hooks/useToggleStar.js +10 -10
  42. package/dist/files/hooks/useToggleStar.js.map +1 -1
  43. package/dist/files/pages/BrowserPage.js +312 -302
  44. package/dist/files/pages/BrowserPage.js.map +1 -1
  45. package/dist/files/pages/ShareAccessPage.js +1 -0
  46. package/dist/files/pages/ShareAccessPage.js.map +1 -1
  47. package/dist/files/utils/quotaUtils.js +14 -0
  48. package/dist/files/utils/quotaUtils.js.map +1 -0
  49. package/package.json +2 -2
@@ -39,29 +39,30 @@ import { MoveDialog as Ae } from "../components/MoveDialog.js";
39
39
  import { CopyDialog as je } from "../components/CopyDialog.js";
40
40
  import { ConfirmDialog as Me } from "../components/ConfirmDialog.js";
41
41
  import { UploadQueue as Ne } from "../components/UploadQueue.js";
42
- import { nativeImpact as Pe, nativeNotify as Fe, nativeOpenUrl as Ie } from "../../utils/nativeBridge.js";
43
- import { emitFilesEvent as Le } from "../utils/events.js";
44
- import { useEffect as Re, useMemo as ze, useState as o } from "react";
45
- import { FolderPlus as Be, FolderUp as Ve, FolderX as He, Grid3x3 as Ue, Home as We, List as Ge, Loader2 as s, Search as Ke, Trash2 as qe, Upload as Je, X as Ye } from "lucide-react";
46
- import { useFeatureFlagDetails as Xe } from "@burdenoff/fe-libs/shared/feature-flags";
42
+ import { isQuotaExhaustedError as Pe } from "../utils/quotaUtils.js";
43
+ import { nativeImpact as Fe, nativeNotify as Ie, nativeOpenUrl as Le } from "../../utils/nativeBridge.js";
44
+ import { emitFilesEvent as Re } from "../utils/events.js";
45
+ import { useEffect as ze, useMemo as Be, useState as o } from "react";
46
+ import { FolderPlus as Ve, FolderUp as He, FolderX as Ue, Grid3x3 as We, Home as Ge, List as Ke, Loader2 as s, Search as qe, Trash2 as Je, Upload as Ye, X as Xe } from "lucide-react";
47
+ import { useFeatureFlagDetails as Ze } from "@burdenoff/fe-libs/shared/feature-flags";
47
48
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
48
- import { useNavigate as Ze, useParams as Qe } from "react-router-dom";
49
- import { useI18n as $e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
49
+ import { useNavigate as Qe, useParams as $e } from "react-router-dom";
50
+ import { useI18n as et } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
50
51
  //#region src/files/pages/BrowserPage.tsx
51
52
  function d() {
52
- let { t: d } = $e(), { folderId: f } = Qe(), et = Ze(), tt = e(), { workspaceId: p } = tt, { viewMode: nt, setViewMode: rt, breadcrumbs: it, selectedFiles: m, selectedFolders: h, clearSelection: g } = t(), [_, at] = o("all"), ot = Xe("files.starred"), st = Xe("files.bin"), ct = ot ? !!ot.value : !1, lt = st ? !!st.value : !1, ut = ze(() => {
53
+ let { t: d } = et(), { folderId: f } = $e(), p = Qe(), tt = e(), { workspaceId: m } = tt, { viewMode: nt, setViewMode: rt, breadcrumbs: it, selectedFiles: h, selectedFolders: g, clearSelection: _ } = t(), [v, at] = o("all"), ot = Ze("files.starred"), st = Ze("files.bin"), ct = ot ? !!ot.value : !1, lt = st ? !!st.value : !1, ut = Be(() => {
53
54
  let e = ["all", "recent"];
54
55
  return ct && e.push("starred"), lt && e.push("bin"), e;
55
56
  }, [ct, lt]);
56
- Re(() => {
57
- ut.includes(_) || at("all");
58
- }, [ut, _]);
59
- let [v, dt] = o(""), [ft, pt] = o(), y = v.trim().length >= 2, [mt, ht] = o(null), [b, gt] = o(null), x = be(), S = r({
57
+ ze(() => {
58
+ ut.includes(v) || at("all");
59
+ }, [ut, v]);
60
+ let [dt, ft] = o(""), [pt, mt] = o(), y = dt.trim().length >= 2, [ht, gt] = o(null), [b, _t] = o(null), x = be(), S = r({
60
61
  folderId: f || void 0,
61
62
  pageSize: 100,
62
- skip: _ !== "all" || y
63
- }), C = i({ skip: _ !== "recent" || y }), w = ee({ skip: _ !== "starred" || y || !ct }), T = te({ skip: _ !== "bin" || y || !lt }), E = ye(v, y, ft);
64
- Re(() => {
63
+ skip: v !== "all" || y
64
+ }), C = i({ skip: v !== "recent" || y }), w = ee({ skip: v !== "starred" || y || !ct }), T = te({ skip: v !== "bin" || y || !lt }), E = ye(dt, y, pt);
65
+ ze(() => {
65
66
  if (f && S.data?.folderPath && S.data?.currentFolder) {
66
67
  let e = S.data.folderPath.folders || [], n = S.data.currentFolder, r = [...e.map((e) => ({
67
68
  id: e.id,
@@ -75,7 +76,7 @@ function d() {
75
76
  }, [f, S.data]);
76
77
  let D = [], O = [], k = !1, A = null, j = !1;
77
78
  if (y && E.data) D = E.data.files || [], O = E.data.folders || [], k = E.isLoading, A = E.error;
78
- else switch (_) {
79
+ else switch (v) {
79
80
  case "all":
80
81
  D = S.data?.filesList?.files || [], O = S.data?.foldersList?.folders || [], k = S.loading, A = S.error || null, j = !1;
81
82
  break;
@@ -89,27 +90,27 @@ function d() {
89
90
  D = T.files, O = T.folders, k = T.isLoading, A = T.error || null, j = !0;
90
91
  break;
91
92
  }
92
- let _t = _ === "all" ? (S.data?.filesList?.total ?? D.length) + (S.data?.foldersList?.total ?? O.length) : null, M = m.size + h.size, [vt, yt] = o(!1), [bt, N] = o(!1), [xt, P] = o(!1), [St, F] = o(!1), [Ct, wt] = o(!1), [Tt, I] = o(null), [L, R] = o(null), [z, Et] = o(null), [B, V] = o(null), [H, U] = o(""), [W, G] = o(""), [Dt, K] = o(!1), [Ot, q] = o([]), [kt, J] = o(!1), [Y, X] = o(null), Z = (e, t) => {
93
- Le(tt, e, t);
94
- }, At = async () => {
95
- if (!Y || Y.loading) return;
96
- let e = Y.onConfirm;
97
- X({
98
- ...Y,
93
+ let vt = v === "all" ? (S.data?.filesList?.total ?? D.length) + (S.data?.foldersList?.total ?? O.length) : null, M = h.size + g.size, [yt, N] = o(!1), [bt, xt] = o(!1), [St, P] = o(!1), [Ct, F] = o(!1), [wt, I] = o(!1), [Tt, Et] = o(!1), [Dt, L] = o(null), [R, z] = o(null), [B, Ot] = o(null), [V, H] = o(null), [U, W] = o(""), [G, K] = o(""), [kt, q] = o(!1), [At, J] = o([]), [jt, Y] = o(!1), [X, Z] = o(null), Q = (e, t) => {
94
+ Re(tt, e, t);
95
+ }, Mt = async () => {
96
+ if (!X || X.loading) return;
97
+ let e = X.onConfirm;
98
+ Z({
99
+ ...X,
99
100
  loading: !0
100
101
  });
101
102
  try {
102
- await e(), X(null);
103
+ await e(), Z(null);
103
104
  } catch (e) {
104
- Z("files.api.failed", {
105
+ Q("files.api.failed", {
105
106
  action: "confirmDialog",
106
107
  message: e instanceof Error ? e.message : "Confirmed action failed"
107
- }), X((e) => e && {
108
+ }), Z((e) => e && {
108
109
  ...e,
109
110
  loading: !1
110
111
  });
111
112
  }
112
- }, Q = ne(), jt = re(), Mt = ie(), Nt = ae(), Pt = oe(), Ft = se(), It = ce(), Lt = le(), Rt = ue(), zt = de(), Bt = fe(), Vt = pe(), Ht = me(), Ut = he(), Wt = ge(), Gt = _e(), Kt = ve(), qt = () => {
113
+ }, $ = ne(), Nt = re(), Pt = ie(), Ft = ae(), It = oe(), Lt = se(), Rt = ce(), zt = le(), Bt = ue(), Vt = de(), Ht = fe(), Ut = pe(), Wt = me(), Gt = he(), Kt = ge(), qt = _e(), Jt = ve(), Yt = () => {
113
114
  let e = document.createElement("input");
114
115
  e.type = "file", e.multiple = !0, e.onchange = async (e) => {
115
116
  let t = e.target.files;
@@ -125,21 +126,21 @@ function d() {
125
126
  thumbnailUrl: n ?? void 0
126
127
  };
127
128
  }));
128
- q((t) => [...t, ...e]), J(!0), K(!0);
129
- for (let t of e) await $(t);
130
- K(!1);
129
+ J((t) => [...t, ...e]), Y(!0), q(!0);
130
+ for (let t of e) await Xt(t);
131
+ q(!1);
131
132
  }
132
133
  }, e.click();
133
- }, $ = async (e) => {
134
+ }, Xt = async (e) => {
134
135
  let t = (t) => {
135
- q((n) => n.map((n) => n.id === e.id ? {
136
+ J((n) => n.map((n) => n.id === e.id ? {
136
137
  ...n,
137
138
  ...t
138
139
  } : n));
139
140
  };
140
141
  t({ status: "uploading" });
141
142
  try {
142
- let n = await jt.mutateAsync({
143
+ let n = await Nt.mutateAsync({
143
144
  file: e.file,
144
145
  folderId: e.folderId,
145
146
  onProgress: (e) => {
@@ -149,7 +150,7 @@ function d() {
149
150
  t({
150
151
  status: "completed",
151
152
  progress: 100
152
- }), Z("files.file.uploaded", {
153
+ }), Q("files.file.uploaded", {
153
154
  fileId: n.id,
154
155
  fileName: n.name,
155
156
  folderId: e.folderId
@@ -162,35 +163,35 @@ function d() {
162
163
  }), x.error(a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded. Please upgrade your plan or delete files."))) : (t({
163
164
  status: "failed",
164
165
  error: r
165
- }), Z("files.api.failed", {
166
+ }), Q("files.api.failed", {
166
167
  action: "uploadFile",
167
168
  fileName: e.file.name,
168
169
  message: r
169
170
  }));
170
171
  }
171
- }, Jt = (e) => {
172
- jt.pause(), q((t) => t.map((t) => t.id === e ? {
172
+ }, Zt = (e) => {
173
+ Nt.pause(), J((t) => t.map((t) => t.id === e ? {
173
174
  ...t,
174
175
  status: "paused"
175
176
  } : t));
176
- }, Yt = (e) => {
177
- let t = Ot.find((t) => t.id === e);
178
- t && $(t);
179
- }, Xt = (e) => {
180
- let t = Ot.find((t) => t.id === e);
181
- t && (q((t) => t.map((t) => t.id === e ? {
177
+ }, Qt = (e) => {
178
+ let t = At.find((t) => t.id === e);
179
+ t && Xt(t);
180
+ }, $t = (e) => {
181
+ let t = At.find((t) => t.id === e);
182
+ t && (J((t) => t.map((t) => t.id === e ? {
182
183
  ...t,
183
184
  status: "pending",
184
185
  progress: 0,
185
186
  error: void 0
186
- } : t)), $(t));
187
- }, Zt = (e) => {
188
- q((t) => {
187
+ } : t)), Xt(t));
188
+ }, en = (e) => {
189
+ J((t) => {
189
190
  let n = t.filter((t) => t.id !== e);
190
- return n.length === 0 && (J(!1), K(!1)), n;
191
+ return n.length === 0 && (Y(!1), q(!1)), n;
191
192
  });
192
- }, Qt = () => {
193
- if (!p) {
193
+ }, tn = () => {
194
+ if (!m) {
194
195
  x.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
195
196
  return;
196
197
  }
@@ -209,11 +210,11 @@ function d() {
209
210
  let t = e.split("/"), r = "", i = f || void 0;
210
211
  for (let e of t) if (r = r ? `${r}/${e}` : e, n.has(r)) i = n.get(r);
211
212
  else try {
212
- let t = await Q.mutateAsync({
213
+ let { data: t } = await $.mutateAsync({
213
214
  name: e,
214
215
  parentFolderId: i
215
216
  });
216
- n.set(r, t.id), i = t.id;
217
+ t?.id && (n.set(r, t.id), i = t.id);
217
218
  } catch {}
218
219
  }
219
220
  let i = [], ee = 0;
@@ -231,38 +232,41 @@ function d() {
231
232
  });
232
233
  }
233
234
  }
234
- q((e) => [...e, ...i]), J(!0), K(!0);
235
- for (let e of i) await $(e);
236
- K(!1), x.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
235
+ J((e) => [...e, ...i]), Y(!0), q(!0);
236
+ for (let e of i) await Xt(e);
237
+ q(!1), x.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
237
238
  count: i.length,
238
239
  plural: i.length > 1 ? "s" : ""
239
240
  }));
240
241
  }
241
242
  }, e.click();
242
- }, $t = () => {
243
- yt(!0);
244
- }, en = async () => {
245
- if (W.trim() && p) try {
246
- await Q.mutateAsync({
247
- name: W,
248
- parentFolderId: f
249
- }), G(""), yt(!1), Z("files.folder.created", {
250
- folderName: W,
243
+ }, nn = () => {
244
+ N(!0);
245
+ }, rn = async () => {
246
+ if (G.trim() && m) {
247
+ let { data: e, error: t } = await $.mutateAsync({
248
+ name: G,
251
249
  parentFolderId: f
252
250
  });
253
- } catch (e) {
254
- x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), Z("files.api.failed", {
255
- action: "createFolder",
256
- message: e instanceof Error ? e.message : "Folder creation failed"
257
- });
251
+ if (t) {
252
+ Pe(t) ? (N(!1), K(""), xt(!0)) : (x.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), Q("files.api.failed", {
253
+ action: "createFolder",
254
+ message: t instanceof Error ? t.message : "Folder creation failed"
255
+ }));
256
+ return;
257
+ }
258
+ e && (K(""), N(!1), Q("files.folder.created", {
259
+ folderName: G,
260
+ parentFolderId: f
261
+ }));
258
262
  }
259
- }, tn = (e) => {
260
- gt(e);
261
- }, nn = (e) => {
262
- I(e), P(!0);
263
- }, rn = (e) => {
264
- I(e), P(!0);
265
- }, an = async (e) => {
263
+ }, an = (e) => {
264
+ _t(e);
265
+ }, on = (e) => {
266
+ L(e), F(!0);
267
+ }, sn = (e) => {
268
+ L(e), F(!0);
269
+ }, cn = async (e) => {
266
270
  if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
267
271
  let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
268
272
  if (e.fileId) {
@@ -275,7 +279,7 @@ function d() {
275
279
  shareType: t,
276
280
  accessLevel: "DOWNLOAD"
277
281
  };
278
- n = (await Vt.mutateAsync(r))?.token ?? "", Z("files.share.created", {
282
+ n = (await Ut.mutateAsync(r))?.token ?? "", Q("files.share.created", {
279
283
  entityType: "file",
280
284
  fileId: e.fileId,
281
285
  shareType: t
@@ -290,7 +294,7 @@ function d() {
290
294
  shareType: t,
291
295
  accessLevel: "DOWNLOAD"
292
296
  };
293
- n = (await Ht.mutateAsync(r))?.createFolderShare?.token ?? "", Z("files.share.created", {
297
+ n = (await Wt.mutateAsync(r))?.createFolderShare?.token ?? "", Q("files.share.created", {
294
298
  entityType: "folder",
295
299
  folderId: e.folderId,
296
300
  shareType: t
@@ -300,21 +304,21 @@ function d() {
300
304
  publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
301
305
  token: n
302
306
  };
303
- }, on = async (e) => {
304
- Pe("medium"), X({
307
+ }, ln = async (e) => {
308
+ Fe("medium"), Z({
305
309
  title: a(d, "files.confirm.deleteFile.title", "Delete file"),
306
310
  description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
307
311
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
308
312
  variant: "danger",
309
313
  onConfirm: async () => {
310
314
  try {
311
- await Mt.mutateAsync({ id: e.id }), Fe("success"), x.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Z("files.file.deleted", {
315
+ await Pt.mutateAsync({ id: e.id }), Ie("success"), x.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.file.deleted", {
312
316
  fileId: e.id,
313
317
  fileName: e.name,
314
318
  permanent: !1
315
319
  });
316
320
  } catch (t) {
317
- x.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Fe("error"), Z("files.api.failed", {
321
+ x.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Ie("error"), Q("files.api.failed", {
318
322
  action: "deleteFile",
319
323
  fileId: e.id,
320
324
  message: t instanceof Error ? t.message : "Failed to delete file"
@@ -322,24 +326,24 @@ function d() {
322
326
  }
323
327
  }
324
328
  });
325
- }, sn = async (e) => {
329
+ }, un = async (e) => {
326
330
  try {
327
- await Pt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), Z("files.file.restored", {
331
+ await It.mutateAsync({ id: e.id }), x.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.file.restored", {
328
332
  fileId: e.id,
329
333
  fileName: e.name
330
334
  });
331
335
  } catch (e) {
332
336
  x.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
333
337
  }
334
- }, cn = async (e) => {
335
- Pe("heavy"), X({
338
+ }, dn = async (e) => {
339
+ Fe("heavy"), Z({
336
340
  title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
337
341
  description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
338
342
  confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
339
343
  variant: "danger",
340
344
  onConfirm: async () => {
341
345
  try {
342
- await It.mutateAsync({ id: e.id }), x.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Z("files.file.deleted", {
346
+ await Rt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.file.deleted", {
343
347
  fileId: e.id,
344
348
  fileName: e.name,
345
349
  permanent: !0
@@ -349,69 +353,69 @@ function d() {
349
353
  }
350
354
  }
351
355
  });
352
- }, ln = async (e) => {
356
+ }, fn = async (e) => {
353
357
  try {
354
- await Rt.mutateAsync({
358
+ await Bt.mutateAsync({
355
359
  id: e.id,
356
360
  type: "file"
357
- }), Z("files.file.starred", {
361
+ }), Q("files.file.starred", {
358
362
  fileId: e.id,
359
363
  fileName: e.name,
360
364
  starred: !e.starred
361
365
  });
362
366
  } catch {
363
- x.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), Z("files.api.failed", {
367
+ x.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
364
368
  action: "toggleFileStar",
365
369
  fileId: e.id
366
370
  });
367
371
  }
368
- }, un = (e) => {
369
- V({
372
+ }, pn = (e) => {
373
+ H({
370
374
  id: e.id,
371
375
  name: e.name,
372
376
  type: "file"
373
- }), U(e.name), N(!0);
374
- }, dn = async (e) => {
377
+ }), W(e.name), P(!0);
378
+ }, mn = async (e) => {
375
379
  try {
376
380
  let t = e.downloadUrl || e.url;
377
381
  if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
378
382
  let n = document.createElement("a");
379
- n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), x.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), Z("files.file.downloaded", {
383
+ n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), x.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), Q("files.file.downloaded", {
380
384
  fileId: e.id,
381
385
  fileName: e.name
382
386
  });
383
387
  } catch (e) {
384
388
  x.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
385
389
  }
386
- }, fn = (e) => {
387
- Et({
390
+ }, hn = (e) => {
391
+ Ot({
388
392
  item: e,
389
393
  type: "file"
390
- }), wt(!0);
391
- }, pn = (e) => {
392
- R({
394
+ }), Et(!0);
395
+ }, gn = (e) => {
396
+ z({
393
397
  item: e,
394
398
  type: "file"
395
- }), F(!0);
396
- }, mn = (e) => {
397
- ht({
399
+ }), I(!0);
400
+ }, _n = (e) => {
401
+ gt({
398
402
  item: e,
399
403
  type: "file"
400
404
  });
401
- }, hn = (e) => {
402
- et(`/files/browse/${e.id}`);
403
- }, gn = async (e) => {
404
- Pe("medium"), X({
405
+ }, vn = (e) => {
406
+ p(`/files/browse/${e.id}`);
407
+ }, yn = async (e) => {
408
+ Fe("medium"), Z({
405
409
  title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
406
410
  description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
407
411
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
408
412
  variant: "danger",
409
413
  onConfirm: async () => {
410
414
  try {
411
- await Nt.mutateAsync({
415
+ await Ft.mutateAsync({
412
416
  id: e.id,
413
417
  recursive: !0
414
- }), x.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Z("files.folder.deleted", {
418
+ }), x.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), Q("files.folder.deleted", {
415
419
  folderId: e.id,
416
420
  folderName: e.name,
417
421
  permanent: !1
@@ -421,24 +425,24 @@ function d() {
421
425
  }
422
426
  }
423
427
  });
424
- }, _n = async (e) => {
428
+ }, bn = async (e) => {
425
429
  try {
426
- await Ft.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), Z("files.folder.restored", {
430
+ await Lt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), Q("files.folder.restored", {
427
431
  folderId: e.id,
428
432
  folderName: e.name
429
433
  });
430
434
  } catch (e) {
431
435
  x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
432
436
  }
433
- }, vn = async (e) => {
434
- X({
437
+ }, xn = async (e) => {
438
+ Z({
435
439
  title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
436
440
  description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
437
441
  confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
438
442
  variant: "danger",
439
443
  onConfirm: async () => {
440
444
  try {
441
- await Lt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Z("files.folder.deleted", {
445
+ await zt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), Q("files.folder.deleted", {
442
446
  folderId: e.id,
443
447
  folderName: e.name,
444
448
  permanent: !0
@@ -448,105 +452,105 @@ function d() {
448
452
  }
449
453
  }
450
454
  });
451
- }, yn = (e) => {
452
- V({
455
+ }, Sn = (e) => {
456
+ H({
453
457
  id: e.id,
454
458
  name: e.name,
455
459
  type: "folder"
456
- }), U(e.name), N(!0);
457
- }, bn = (e) => {
458
- R({
460
+ }), W(e.name), P(!0);
461
+ }, Cn = (e) => {
462
+ z({
459
463
  item: e,
460
464
  type: "folder"
461
- }), F(!0);
462
- }, xn = async (e) => {
465
+ }), I(!0);
466
+ }, wn = async (e) => {
463
467
  try {
464
- await Rt.mutateAsync({
468
+ await Bt.mutateAsync({
465
469
  id: e.id,
466
470
  type: "folder"
467
- }), Z("files.folder.starred", {
471
+ }), Q("files.folder.starred", {
468
472
  folderId: e.id,
469
473
  folderName: e.name,
470
474
  starred: !e.starred
471
475
  });
472
476
  } catch {
473
- x.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), Z("files.api.failed", {
477
+ x.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), Q("files.api.failed", {
474
478
  action: "toggleFolderStar",
475
479
  folderId: e.id
476
480
  });
477
481
  }
478
- }, Sn = (e) => {
479
- ht({
482
+ }, Tn = (e) => {
483
+ gt({
480
484
  item: e,
481
485
  type: "folder"
482
486
  });
483
- }, Cn = async (e) => {
484
- if (L) try {
485
- L.type === "file" ? (await Wt.mutateAsync({
486
- fileId: L.item.id,
487
+ }, En = async (e) => {
488
+ if (R) try {
489
+ R.type === "file" ? (await Kt.mutateAsync({
490
+ fileId: R.item.id,
487
491
  targetFolderId: e || null
488
- }), x.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: L.item.name })), Z("files.file.moved", {
489
- fileId: L.item.id,
490
- fileName: L.item.name,
492
+ }), x.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.file.moved", {
493
+ fileId: R.item.id,
494
+ fileName: R.item.name,
491
495
  destinationFolderId: e
492
- })) : (await Gt.mutateAsync({
493
- folderId: L.item.id,
496
+ })) : (await qt.mutateAsync({
497
+ folderId: R.item.id,
494
498
  targetParentFolderId: e
495
- }), x.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: L.item.name })), Z("files.folder.moved", {
496
- folderId: L.item.id,
497
- folderName: L.item.name,
499
+ }), x.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: R.item.name })), Q("files.folder.moved", {
500
+ folderId: R.item.id,
501
+ folderName: R.item.name,
498
502
  destinationFolderId: e
499
- })), F(!1), R(null);
503
+ })), I(!1), z(null);
500
504
  } catch (e) {
501
- x.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: L.item.name })), Z("files.api.failed", {
502
- action: L.type === "file" ? "moveFile" : "moveFolder",
503
- itemId: L.item.id,
504
- itemType: L.type,
505
+ x.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: R.item.name })), Q("files.api.failed", {
506
+ action: R.type === "file" ? "moveFile" : "moveFolder",
507
+ itemId: R.item.id,
508
+ itemType: R.type,
505
509
  message: e instanceof Error ? e.message : void 0
506
510
  });
507
511
  }
508
- }, wn = async (e, t) => {
509
- if (z) try {
510
- if (z.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
511
- await Ut.mutateAsync({
512
- id: z.item.id,
513
- newName: t || `Copy of ${z.item.name}`,
512
+ }, Dn = async (e, t) => {
513
+ if (B) try {
514
+ if (B.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
515
+ await Gt.mutateAsync({
516
+ id: B.item.id,
517
+ newName: t || `Copy of ${B.item.name}`,
514
518
  targetFolderId: e || void 0
515
- }), x.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: z.item.name })), Z("files.file.copied", {
516
- fileId: z.item.id,
517
- fileName: z.item.name,
519
+ }), x.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: B.item.name })), Q("files.file.copied", {
520
+ fileId: B.item.id,
521
+ fileName: B.item.name,
518
522
  destinationFolderId: e
519
- }), wt(!1), Et(null);
523
+ }), Et(!1), Ot(null);
520
524
  } catch (e) {
521
- x.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: z.item.name })), Z("files.api.failed", {
525
+ x.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: B.item.name })), Q("files.api.failed", {
522
526
  action: "copyFile",
523
- fileId: z.item.id,
527
+ fileId: B.item.id,
524
528
  message: e instanceof Error ? e.message : void 0
525
529
  });
526
530
  }
527
- }, Tn = async () => {
528
- if (!(!B || !H.trim())) try {
529
- let e = B.name, t = H.trim();
530
- B.type === "file" ? (await zt.mutateAsync({
531
- fileId: B.id,
531
+ }, On = async () => {
532
+ if (!(!V || !U.trim())) try {
533
+ let e = V.name, t = U.trim();
534
+ V.type === "file" ? (await Vt.mutateAsync({
535
+ fileId: V.id,
532
536
  newName: t
533
- }), x.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), Z("files.file.renamed", {
534
- fileId: B.id,
537
+ }), x.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.file.renamed", {
538
+ fileId: V.id,
535
539
  previousName: e,
536
540
  name: t
537
- })) : (await Bt.mutateAsync({
538
- folderId: B.id,
541
+ })) : (await Ht.mutateAsync({
542
+ folderId: V.id,
539
543
  newName: t
540
- }), x.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), Z("files.folder.renamed", {
541
- folderId: B.id,
544
+ }), x.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), Q("files.folder.renamed", {
545
+ folderId: V.id,
542
546
  previousName: e,
543
547
  name: t
544
- })), N(!1), V(null), U("");
548
+ })), P(!1), H(null), W("");
545
549
  } catch (e) {
546
- x.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: B.type })), Z("files.api.failed", {
547
- action: B.type === "file" ? "renameFile" : "renameFolder",
548
- itemId: B.id,
549
- itemType: B.type,
550
+ x.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: V.type })), Q("files.api.failed", {
551
+ action: V.type === "file" ? "renameFile" : "renameFolder",
552
+ itemId: V.id,
553
+ itemType: V.type,
550
554
  message: e instanceof Error ? e.message : void 0
551
555
  });
552
556
  }
@@ -554,20 +558,20 @@ function d() {
554
558
  return n({
555
559
  files: D,
556
560
  folders: O,
557
- onFilePreview: tn,
558
- onFileDelete: on,
559
- onFolderOpen: hn,
560
- onFolderDelete: gn,
561
- activeTab: _
562
- }), p === void 0 ? /* @__PURE__ */ u("div", {
561
+ onFilePreview: an,
562
+ onFileDelete: ln,
563
+ onFolderOpen: vn,
564
+ onFolderDelete: yn,
565
+ activeTab: v
566
+ }), m === void 0 ? /* @__PURE__ */ u("div", {
563
567
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
564
- children: [/* @__PURE__ */ l(s, { className: "h-8 w-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ l("p", {
568
+ children: [/* @__PURE__ */ l(s, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ l("p", {
565
569
  className: "text-sm text-text-secondary max-w-md",
566
570
  children: a(d, "files.browser.workspace.waiting", "Waiting for workspace context. If this persists, the app shell may not have provided a workspaceId to the Files module. Try reloading the page or switching workspaces.")
567
571
  })]
568
- }) : p === "" ? /* @__PURE__ */ u("div", {
572
+ }) : m === "" ? /* @__PURE__ */ u("div", {
569
573
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
570
- children: [/* @__PURE__ */ l(He, { className: "h-8 w-8 text-text-tertiary" }), /* @__PURE__ */ l("p", {
574
+ children: [/* @__PURE__ */ l(Ue, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ l("p", {
571
575
  className: "text-sm text-text-secondary max-w-md",
572
576
  children: a(d, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
573
577
  })]
@@ -582,10 +586,10 @@ function d() {
582
586
  className: "flex items-center gap-1 sm:gap-2 text-sm overflow-x-auto",
583
587
  children: [/* @__PURE__ */ u("button", {
584
588
  type: "button",
585
- onClick: () => et("/files/browse"),
589
+ onClick: () => p("/files/browse"),
586
590
  className: "flex items-center gap-1 text-text-primary hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap",
587
591
  title: a(d, "files.browser.actions.goToRoot", "Go to root"),
588
- children: [/* @__PURE__ */ l(We, { className: "size-4" }), /* @__PURE__ */ l("span", {
592
+ children: [/* @__PURE__ */ l(Ge, { className: "size-4" }), /* @__PURE__ */ l("span", {
589
593
  className: "hidden sm:inline",
590
594
  children: a(d, "files.browser.rootLabel", "My Drive")
591
595
  })]
@@ -596,7 +600,7 @@ function d() {
596
600
  children: "/"
597
601
  }), /* @__PURE__ */ l("button", {
598
602
  type: "button",
599
- onClick: () => et(`/files/browse/${e.id}`),
603
+ onClick: () => p(`/files/browse/${e.id}`),
600
604
  className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === it.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
601
605
  title: `Go to ${e.name}`,
602
606
  children: e.name
@@ -606,7 +610,7 @@ function d() {
606
610
  })
607
611
  }),
608
612
  /* @__PURE__ */ l(Ce, {
609
- activeTab: _,
613
+ activeTab: v,
610
614
  onTabChange: at,
611
615
  tabs: ut
612
616
  }),
@@ -621,10 +625,10 @@ function d() {
621
625
  className: "relative w-full max-w-2xl",
622
626
  children: /* @__PURE__ */ l(ke, {
623
627
  onSearch: (e, t) => {
624
- dt(e), pt(t);
628
+ ft(e), mt(t);
625
629
  },
626
630
  placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
627
- initialQuery: v,
631
+ initialQuery: dt,
628
632
  showFilters: !0
629
633
  })
630
634
  })
@@ -643,33 +647,33 @@ function d() {
643
647
  !y && /* @__PURE__ */ u(c, { children: [
644
648
  /* @__PURE__ */ u("button", {
645
649
  type: "button",
646
- onClick: $t,
650
+ onClick: nn,
647
651
  className: "flex items-center gap-1 sm:gap-2 px-2 sm:px-4 py-2 text-xs sm:text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm",
648
- children: [/* @__PURE__ */ l(Be, { className: "size-4" }), /* @__PURE__ */ l("span", {
652
+ children: [/* @__PURE__ */ l(Ve, { className: "size-4" }), /* @__PURE__ */ l("span", {
649
653
  className: "hidden sm:inline",
650
654
  children: a(d, "files.browser.actions.newFolder", "New Folder")
651
655
  })]
652
656
  }),
653
657
  /* @__PURE__ */ l("button", {
654
658
  type: "button",
655
- onClick: qt,
656
- disabled: Dt,
659
+ onClick: Yt,
660
+ disabled: kt,
657
661
  className: "flex items-center gap-1 sm:gap-2 px-2 sm:px-4 py-2 text-xs sm:text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
658
- children: Dt ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ l("span", {
662
+ children: kt ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ l("span", {
659
663
  className: "hidden sm:inline",
660
664
  children: a(d, "files.browser.upload.uploading", "Uploading...")
661
- })] }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(Je, { className: "size-4" }), /* @__PURE__ */ l("span", {
665
+ })] }) : /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(Ye, { className: "size-4" }), /* @__PURE__ */ l("span", {
662
666
  className: "hidden sm:inline",
663
667
  children: a(d, "files.browser.actions.uploadFiles", "Upload Files")
664
668
  })] })
665
669
  }),
666
670
  /* @__PURE__ */ u("button", {
667
671
  type: "button",
668
- onClick: Qt,
669
- disabled: Dt,
672
+ onClick: tn,
673
+ disabled: kt,
670
674
  className: "hidden sm:flex items-center gap-2 px-4 py-2.5 text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover hover:border-border-default transition-all duration-200 shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
671
675
  title: a(d, "files.browser.actions.uploadFolderTitle", "Upload entire folder with structure"),
672
- children: [/* @__PURE__ */ l(Ve, { className: "size-4" }), a(d, "files.browser.actions.uploadFolder", "Upload Folder")]
676
+ children: [/* @__PURE__ */ l(He, { className: "size-4" }), a(d, "files.browser.actions.uploadFolder", "Upload Folder")]
673
677
  })
674
678
  ] }),
675
679
  /* @__PURE__ */ u("div", {
@@ -679,13 +683,13 @@ function d() {
679
683
  onClick: () => rt("grid"),
680
684
  className: `p-2 transition-colors duration-200 ${nt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
681
685
  "aria-label": a(d, "files.browser.view.grid", "Grid view"),
682
- children: /* @__PURE__ */ l(Ue, { className: "size-5" })
686
+ children: /* @__PURE__ */ l(We, { className: "size-5" })
683
687
  }), /* @__PURE__ */ l("button", {
684
688
  type: "button",
685
689
  onClick: () => rt("list"),
686
690
  className: `p-2 transition-colors duration-200 ${nt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
687
691
  "aria-label": a(d, "files.browser.view.list", "List view"),
688
- children: /* @__PURE__ */ l(Ge, { className: "size-5" })
692
+ children: /* @__PURE__ */ l(Ke, { className: "size-5" })
689
693
  })]
690
694
  })
691
695
  ]
@@ -695,12 +699,12 @@ function d() {
695
699
  className: "mt-3 flex items-center justify-between p-3 bg-status-success-bg-subtle rounded-lg border border-status-success-border transition-all duration-200",
696
700
  children: [/* @__PURE__ */ u("span", {
697
701
  className: "text-sm font-medium text-status-success-text",
698
- children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: v }), E.data && ` (${(E.data.files?.length || 0) + (E.data.folders?.length || 0)} items)`]
702
+ children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: dt }), E.data && ` (${(E.data.files?.length || 0) + (E.data.folders?.length || 0)} items)`]
699
703
  }), /* @__PURE__ */ u("button", {
700
704
  type: "button",
701
- onClick: () => dt(""),
705
+ onClick: () => ft(""),
702
706
  className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
703
- children: [/* @__PURE__ */ l(Ye, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
707
+ children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
704
708
  })]
705
709
  }),
706
710
  M > 0 && /* @__PURE__ */ u("div", {
@@ -715,13 +719,11 @@ function d() {
715
719
  })
716
720
  }), /* @__PURE__ */ l("div", {
717
721
  className: "flex items-center gap-2",
718
- children: _ === "bin" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
722
+ children: v === "bin" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
719
723
  type: "button",
720
724
  onClick: async () => {
721
725
  try {
722
- for (let e of Array.from(m)) await Pt.mutateAsync({ id: e });
723
- for (let e of Array.from(h)) await Ft.mutateAsync({ id: e });
724
- g(), x.success(`${M} item${M > 1 ? "s" : ""} restored`);
726
+ await Promise.all([...Array.from(h).map((e) => It.mutateAsync({ id: e })), ...Array.from(g).map((e) => Lt.mutateAsync({ id: e }))]), _(), x.success(`${M} item${M > 1 ? "s" : ""} restored`);
725
727
  } catch (e) {
726
728
  x.error(e instanceof Error ? e.message : "Failed to restore some items");
727
729
  }
@@ -731,7 +733,7 @@ function d() {
731
733
  }), /* @__PURE__ */ u("button", {
732
734
  type: "button",
733
735
  onClick: async () => {
734
- X({
736
+ Z({
735
737
  title: a(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
736
738
  description: a(d, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
737
739
  count: M,
@@ -741,9 +743,7 @@ function d() {
741
743
  variant: "danger",
742
744
  onConfirm: async () => {
743
745
  try {
744
- for (let e of Array.from(m)) await It.mutateAsync({ id: e });
745
- for (let e of Array.from(h)) await Lt.mutateAsync({ id: e });
746
- g(), x.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
746
+ await Promise.all([...Array.from(h).map((e) => Rt.mutateAsync({ id: e })), ...Array.from(g).map((e) => zt.mutateAsync({ id: e }))]), _(), x.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
747
747
  count: M,
748
748
  plural: M > 1 ? "s" : ""
749
749
  }));
@@ -754,11 +754,11 @@ function d() {
754
754
  });
755
755
  },
756
756
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
757
- children: [/* @__PURE__ */ l(qe, { className: "size-4" }), a(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
757
+ children: [/* @__PURE__ */ l(Je, { className: "size-4" }), a(d, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
758
758
  })] }) : /* @__PURE__ */ u("button", {
759
759
  type: "button",
760
760
  onClick: async () => {
761
- X({
761
+ Z({
762
762
  title: a(d, "files.confirm.bulkDelete.title", "Delete selected items"),
763
763
  description: a(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
764
764
  count: M,
@@ -768,13 +768,11 @@ function d() {
768
768
  variant: "danger",
769
769
  onConfirm: async () => {
770
770
  try {
771
- let e = Array.from(m), t = Array.from(h);
772
- e.length > 0 && await Kt.mutateAsync(e);
773
- for (let e of t) await Nt.mutateAsync({
771
+ let e = Array.from(h), t = Array.from(g);
772
+ e.length > 0 && await Jt.mutateAsync(e), await Promise.all(t.map((e) => Ft.mutateAsync({
774
773
  id: e,
775
774
  recursive: !0
776
- });
777
- g(), x.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
775
+ }))), _(), x.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
778
776
  count: M,
779
777
  plural: M > 1 ? "s" : ""
780
778
  }));
@@ -785,14 +783,14 @@ function d() {
785
783
  });
786
784
  },
787
785
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-status-error-text bg-bg-surface border border-status-error-border rounded-lg hover:bg-status-error-bg-subtle transition-colors duration-200",
788
- children: [/* @__PURE__ */ l(qe, { className: "size-4" }), a(d, "files.browser.selection.actions.delete", "Delete")]
786
+ children: [/* @__PURE__ */ l(Je, { className: "size-4" }), a(d, "files.browser.selection.actions.delete", "Delete")]
789
787
  })
790
788
  })]
791
789
  }), /* @__PURE__ */ u("button", {
792
790
  type: "button",
793
- onClick: g,
791
+ onClick: _,
794
792
  className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
795
- children: [/* @__PURE__ */ l(Ye, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
793
+ children: [/* @__PURE__ */ l(Xe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
796
794
  })]
797
795
  })
798
796
  ]
@@ -805,30 +803,30 @@ function d() {
805
803
  loading: k,
806
804
  error: A,
807
805
  preserveSortOrder: j,
808
- onFilePreview: tn,
809
- onFileShare: _ === "bin" ? void 0 : nn,
810
- onFileDelete: _ === "bin" ? cn : on,
811
- onFileRestore: _ === "bin" ? sn : void 0,
812
- onFileFavorite: _ === "bin" ? void 0 : ln,
813
- onFileRename: _ === "bin" ? void 0 : un,
814
- onFileDownload: dn,
815
- onFileCopy: _ === "bin" ? void 0 : fn,
816
- onFileMove: _ === "bin" ? void 0 : pn,
817
- onFileInfo: mn,
818
- onFolderOpen: hn,
819
- onFolderShare: _ === "bin" ? void 0 : rn,
820
- onFolderDelete: _ === "bin" ? vn : gn,
821
- onFolderRestore: _ === "bin" ? _n : void 0,
822
- onFolderRename: _ === "bin" ? void 0 : yn,
823
- onFolderFavorite: _ === "bin" ? void 0 : xn,
824
- onFolderMove: _ === "bin" ? void 0 : bn,
825
- onFolderInfo: Sn
806
+ onFilePreview: an,
807
+ onFileShare: v === "bin" ? void 0 : on,
808
+ onFileDelete: v === "bin" ? dn : ln,
809
+ onFileRestore: v === "bin" ? un : void 0,
810
+ onFileFavorite: v === "bin" ? void 0 : fn,
811
+ onFileRename: v === "bin" ? void 0 : pn,
812
+ onFileDownload: mn,
813
+ onFileCopy: v === "bin" ? void 0 : hn,
814
+ onFileMove: v === "bin" ? void 0 : gn,
815
+ onFileInfo: _n,
816
+ onFolderOpen: vn,
817
+ onFolderShare: v === "bin" ? void 0 : sn,
818
+ onFolderDelete: v === "bin" ? xn : yn,
819
+ onFolderRestore: v === "bin" ? bn : void 0,
820
+ onFolderRename: v === "bin" ? void 0 : Sn,
821
+ onFolderFavorite: v === "bin" ? void 0 : wn,
822
+ onFolderMove: v === "bin" ? void 0 : Cn,
823
+ onFolderInfo: Tn
826
824
  }), !k && (D.length > 0 || O.length > 0) && /* @__PURE__ */ u("div", {
827
825
  className: "mt-4 px-2 text-sm text-text-secondary",
828
- children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: D.length + O.length }), !y && _ === "all" && _t !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: _t })}`]
826
+ children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: D.length + O.length }), !y && v === "all" && vt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: vt })}`]
829
827
  })]
830
828
  }),
831
- vt && /* @__PURE__ */ l("div", {
829
+ yt && /* @__PURE__ */ l("div", {
832
830
  className: "fixed inset-0 backdrop-blur-sm flex items-center justify-center z-[100] animate-in fade-in duration-200",
833
831
  role: "dialog",
834
832
  "aria-modal": "true",
@@ -843,11 +841,12 @@ function d() {
843
841
  }),
844
842
  /* @__PURE__ */ l("input", {
845
843
  type: "text",
846
- value: W,
847
- onChange: (e) => G(e.target.value),
844
+ value: G,
845
+ onChange: (e) => K(e.target.value),
848
846
  onKeyDown: (e) => {
849
- e.key === "Enter" && en(), e.key === "Escape" && (yt(!1), G(""));
847
+ e.key === "Enter" && rn(), e.key === "Escape" && (N(!1), K(""));
850
848
  },
849
+ "aria-label": a(d, "files.browser.newFolderDialog.title", "New folder"),
851
850
  placeholder: a(d, "files.browser.newFolderDialog.placeholder", "Folder name"),
852
851
  className: "w-full px-4 py-3 border-2 border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
853
852
  }),
@@ -856,22 +855,22 @@ function d() {
856
855
  children: [/* @__PURE__ */ l("button", {
857
856
  type: "button",
858
857
  onClick: () => {
859
- yt(!1), G("");
858
+ N(!1), K("");
860
859
  },
861
860
  className: "px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200",
862
861
  children: a(d, "files.common.actions.cancel", "Cancel")
863
862
  }), /* @__PURE__ */ u("button", {
864
863
  type: "button",
865
- onClick: en,
866
- disabled: !W.trim() || Q.isPending,
864
+ onClick: rn,
865
+ disabled: !G.trim() || $.isPending,
867
866
  className: "px-6 py-2.5 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover disabled:bg-bg-muted disabled:text-text-tertiary disabled:cursor-not-allowed transition-colors duration-200 flex items-center gap-2",
868
- children: [Q.isPending && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), Q.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
867
+ children: [$.isPending && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), $.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
869
868
  })]
870
869
  })
871
870
  ]
872
871
  })
873
872
  }),
874
- bt && B && /* @__PURE__ */ l("div", {
873
+ St && V && /* @__PURE__ */ l("div", {
875
874
  className: "fixed inset-0 backdrop-blur-sm flex items-center justify-center z-[100] animate-in fade-in duration-200",
876
875
  role: "dialog",
877
876
  "aria-modal": "true",
@@ -882,15 +881,16 @@ function d() {
882
881
  /* @__PURE__ */ l("h2", {
883
882
  id: "files-rename-title",
884
883
  className: "text-base font-semibold text-text-primary mb-4",
885
- children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: B.type })
884
+ children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: V.type })
886
885
  }),
887
886
  /* @__PURE__ */ l("input", {
888
887
  type: "text",
889
- value: H,
890
- onChange: (e) => U(e.target.value),
888
+ value: U,
889
+ onChange: (e) => W(e.target.value),
891
890
  onKeyDown: (e) => {
892
- e.key === "Enter" && Tn(), e.key === "Escape" && (N(!1), V(null), U(""));
891
+ e.key === "Enter" && On(), e.key === "Escape" && (P(!1), H(null), W(""));
893
892
  },
893
+ "aria-label": a(d, "files.browser.renameDialog.title", "Rename"),
894
894
  placeholder: a(d, "files.browser.renameDialog.placeholder", "New name"),
895
895
  className: "w-full px-4 py-3 border-2 border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
896
896
  }),
@@ -899,85 +899,95 @@ function d() {
899
899
  children: [/* @__PURE__ */ l("button", {
900
900
  type: "button",
901
901
  onClick: () => {
902
- N(!1), V(null), U("");
902
+ P(!1), H(null), W("");
903
903
  },
904
904
  className: "px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-action-ghost-bg-hover rounded-lg transition-colors duration-200",
905
905
  children: a(d, "files.common.actions.cancel", "Cancel")
906
906
  }), /* @__PURE__ */ u("button", {
907
907
  type: "button",
908
- onClick: Tn,
909
- disabled: !H.trim() || H.trim() === B.name || zt.isPending || Bt.isPending,
908
+ onClick: On,
909
+ disabled: !U.trim() || U.trim() === V.name || Vt.isPending || Ht.isPending,
910
910
  className: "px-6 py-2.5 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover disabled:bg-bg-muted disabled:text-text-tertiary disabled:cursor-not-allowed transition-colors duration-200 flex items-center gap-2",
911
- children: [(zt.isPending || Bt.isPending) && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), zt.isPending || Bt.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
911
+ children: [(Vt.isPending || Ht.isPending) && /* @__PURE__ */ l(s, { className: "size-4 animate-spin" }), Vt.isPending || Ht.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
912
912
  })]
913
913
  })
914
914
  ]
915
915
  })
916
916
  }),
917
- xt && Tt && /* @__PURE__ */ l(we, {
918
- item: Tt,
919
- itemType: "mimeType" in Tt ? "file" : "folder",
917
+ Ct && Dt && /* @__PURE__ */ l(we, {
918
+ item: Dt,
919
+ itemType: "mimeType" in Dt ? "file" : "folder",
920
920
  onClose: () => {
921
- P(!1), I(null);
921
+ F(!1), L(null);
922
922
  },
923
- onCreateShare: an,
924
- isLoading: Vt.isPending
923
+ onCreateShare: cn,
924
+ isLoading: Ut.isPending
925
925
  }),
926
- Y && /* @__PURE__ */ l(Me, {
927
- title: Y.title,
928
- description: Y.description,
929
- confirmLabel: Y.confirmLabel,
926
+ X && /* @__PURE__ */ l(Me, {
927
+ title: X.title,
928
+ description: X.description,
929
+ confirmLabel: X.confirmLabel,
930
930
  cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
931
- variant: Y.variant,
932
- loading: Y.loading,
933
- onConfirm: At,
931
+ variant: X.variant,
932
+ loading: X.loading,
933
+ onConfirm: Mt,
934
934
  onCancel: () => {
935
- Y.loading || X(null);
935
+ X.loading || Z(null);
936
936
  }
937
937
  }),
938
- St && L && /* @__PURE__ */ l(Ae, {
939
- item: L.item,
940
- type: L.type,
938
+ bt && /* @__PURE__ */ l(Me, {
939
+ title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
940
+ description: a(d, "files.folder.quota.description", "You've reached the folder limit for your plan. Upgrade your plan or purchase an add-on to create more folders."),
941
+ confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
942
+ cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
943
+ onConfirm: () => {
944
+ xt(!1), p("/billing");
945
+ },
946
+ onCancel: () => xt(!1)
947
+ }),
948
+ wt && R && /* @__PURE__ */ l(Ae, {
949
+ item: R.item,
950
+ type: R.type,
941
951
  onClose: () => {
942
- F(!1), R(null);
952
+ I(!1), z(null);
943
953
  },
944
- onMove: Cn,
945
- isLoading: Wt.isPending || Gt.isPending
954
+ onMove: En,
955
+ isLoading: Kt.isPending || qt.isPending
946
956
  }),
947
- Ct && z && /* @__PURE__ */ l(je, {
948
- item: z.item,
949
- type: z.type,
957
+ Tt && B && /* @__PURE__ */ l(je, {
958
+ item: B.item,
959
+ type: B.type,
950
960
  onClose: () => {
951
- wt(!1), Et(null);
961
+ Et(!1), Ot(null);
952
962
  },
953
- onCopy: wn,
954
- isLoading: Ut.isPending
963
+ onCopy: Dn,
964
+ isLoading: Gt.isPending
955
965
  }),
956
966
  b && /* @__PURE__ */ l(Te, {
957
967
  file: b,
958
- onClose: () => gt(null),
968
+ onClose: () => _t(null),
959
969
  onDownload: () => {
960
- Ie(b.downloadUrl || b.url);
970
+ Le(b.downloadUrl || b.url);
961
971
  },
962
- onShare: _ === "bin" ? void 0 : () => {
963
- I(b), P(!0);
972
+ onShare: v === "bin" ? void 0 : () => {
973
+ L(b), F(!0);
964
974
  },
965
- onStar: _ === "bin" ? void 0 : () => ln(b),
966
- onDelete: () => _ === "bin" ? cn(b) : on(b)
975
+ onStar: v === "bin" ? void 0 : () => fn(b),
976
+ onDelete: () => v === "bin" ? dn(b) : ln(b)
967
977
  }),
968
- mt && /* @__PURE__ */ l(Ee, {
969
- item: mt.item,
970
- type: mt.type,
971
- onClose: () => ht(null)
978
+ ht && /* @__PURE__ */ l(Ee, {
979
+ item: ht.item,
980
+ type: ht.type,
981
+ onClose: () => gt(null)
972
982
  }),
973
983
  /* @__PURE__ */ l(Ne, {
974
- items: Ot,
975
- isOpen: kt,
976
- onClose: () => J(!1),
977
- onPause: Jt,
978
- onResume: Yt,
979
- onRetry: Xt,
980
- onCancel: Zt
984
+ items: At,
985
+ isOpen: jt,
986
+ onClose: () => Y(!1),
987
+ onPause: Zt,
988
+ onResume: Qt,
989
+ onRetry: $t,
990
+ onCancel: en
981
991
  }),
982
992
  /* @__PURE__ */ l(Oe, {
983
993
  toasts: x.toasts,
@@ -990,7 +1000,7 @@ function d() {
990
1000
  children: [
991
1001
  /* @__PURE__ */ l("div", {
992
1002
  className: "inline-flex items-center justify-center size-16 bg-bg-muted rounded-full mb-4",
993
- children: /* @__PURE__ */ l(Ke, { className: "size-8 text-text-tertiary" })
1003
+ children: /* @__PURE__ */ l(qe, { className: "size-8 text-text-tertiary" })
994
1004
  }),
995
1005
  /* @__PURE__ */ l("h3", {
996
1006
  className: "text-lg font-medium text-text-primary mb-2",
@@ -1003,16 +1013,16 @@ function d() {
1003
1013
  /* @__PURE__ */ l("button", {
1004
1014
  type: "button",
1005
1015
  onClick: () => {
1006
- dt(""), pt(void 0);
1016
+ ft(""), mt(void 0);
1007
1017
  },
1008
1018
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-text-inverse bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover transition-colors duration-200",
1009
1019
  children: a(d, "files.browser.search.clear", "Clear search")
1010
1020
  })
1011
1021
  ]
1012
1022
  }) : /* @__PURE__ */ l(De, {
1013
- type: _,
1014
- onUpload: _ === "all" ? qt : void 0,
1015
- onNewFolder: _ === "all" ? $t : void 0
1023
+ type: v,
1024
+ onUpload: v === "all" ? Yt : void 0,
1025
+ onNewFolder: v === "all" ? nn : void 0
1016
1026
  })
1017
1027
  })
1018
1028
  ]