@burdenoff/microfe-files 2026.624.2 → 2026.625.1

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