@burdenoff/microfe-files 2026.518.2 → 2026.519.2

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