@burdenoff/microfe-files 2026.624.2 → 2026.624.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 rt, Input as it, ResponsiveDialog as at, ResponsiveDialogContent as ot, ResponsiveDialogFooter as st, ResponsiveDialogHeader as ct, ResponsiveDialogTitle as lt } from "@burdenoff/fe-libs/ui";
52
53
  //#region src/files/pages/BrowserPage.tsx
53
- 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(() => [
54
+ function u() {
55
+ let { t: u } = nt(), { folderId: d } = tt(), f = et(), ut = e(), { workspaceId: p } = ut, dt = Fe(p ?? ""), { viewMode: ft, setViewMode: pt, breadcrumbs: mt, selectedFiles: m, selectedFolders: h, clearSelection: g } = t(), [_, ht] = o("all"), gt = 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({
64
- folderId: f || void 0,
62
+ gt.includes(_) || ht("all");
63
+ }, [gt, _]);
64
+ let [_t, vt] = o(""), [yt, bt] = o(), v = _t.trim().length >= 2, [xt, St] = o(null), [y, Ct] = o(null), b = be(), x = r({
65
+ folderId: d || 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: _ !== "all" || v
68
+ }), S = i({ skip: _ !== "recent" || v }), C = ee({ skip: _ !== "starred" || v }), w = te({ skip: _ !== "bin" || v }), T = ye(_t, v, 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 (d && x.data?.folderPath && x.data?.currentFolder) {
71
+ let e = x.data.folderPath.folders || [], n = x.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;
82
- else switch (v) {
80
+ }, [d, x.data]);
81
+ let E = [], D = [], O = !1, k = null, A = !1;
82
+ if (v && T.data) E = T.data.files || [], D = T.data.folders || [], O = T.isLoading, k = T.error;
83
+ else switch (_) {
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
+ E = x.data?.filesList?.files || [], D = x.data?.foldersList?.folders || [], O = x.loading, k = x.error || null, A = !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
+ E = S.files || [], D = S.folders || [], O = S.isLoading, k = S.error || null, A = !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
+ E = C.files, D = C.folders, O = C.isLoading, k = C.error || null, A = !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
+ E = w.files, D = w.folders, O = w.isLoading, k = w.error || null, A = !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 wt = _ === "all" ? (x.data?.filesList?.total ?? E.length) + (x.data?.foldersList?.total ?? D.length) : null, j = m.size + h.size, [Tt, M] = o(!1), [Et, Dt] = o(!1), [Ot, N] = o(!1), [kt, At] = o(!1), [jt, P] = o(!1), [Mt, Nt] = o(!1), [Pt, F] = o(null), [I, L] = o(null), [R, Ft] = o(null), [z, B] = o(null), [V, H] = o(""), [U, W] = o(""), [It, G] = o(!1), [Lt, K] = o([]), [Rt, q] = o(!1), [J, Y] = o(null), X = (e, t) => {
98
+ Be(ut, e, t);
99
+ }, zt = 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(), Bt = re(), Vt = ie(), Ht = ae(), Ut = oe(), Wt = se(), Gt = ce(), Kt = le(), qt = ue(), Q = de(), $ = fe(), Jt = pe(), Yt = me(), Xt = he(), Zt = ge(), Qt = _e(), $t = ve(), en = () => {
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;
@@ -125,25 +126,25 @@ function d() {
125
126
  file: e,
126
127
  status: "pending",
127
128
  progress: 0,
128
- folderId: f || void 0,
129
+ folderId: d || void 0,
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 tn(t);
135
+ G(!1);
135
136
  }
136
137
  }, e.click();
137
- }, Jt = async (e) => {
138
+ }, tn = 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 Bt.mutateAsync({
147
148
  file: e.file,
148
149
  folderId: e.folderId,
149
150
  onProgress: (e) => {
@@ -153,49 +154,49 @@ 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
160
161
  });
161
162
  } catch (n) {
162
- let r = n instanceof Error ? n.message : a(d, "files.upload.errors.failed", "Upload failed");
163
+ let r = n instanceof Error ? n.message : a(u, "files.upload.errors.failed", "Upload failed");
163
164
  r === "Upload paused" ? t({ status: "paused" }) : r === "QUOTA_EXHAUSTED" ? (t({
164
165
  status: "failed",
165
- 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({
166
+ error: a(u, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
167
+ }), b.error(a(u, "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
+ }, nn = (e) => {
177
+ Bt.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
+ }, rn = (e) => {
182
+ let t = Lt.find((t) => t.id === e);
183
+ t && tn(t);
184
+ }, an = (e) => {
185
+ let t = Lt.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)), tn(t));
192
+ }, on = (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
- if (!m) {
198
- x.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
197
+ }, sn = () => {
198
+ if (!p) {
199
+ b.error(a(u, "files.workspace.errors.notSelected", "Workspace not selected"));
199
200
  return;
200
201
  }
201
202
  let e = document.createElement("input");
@@ -210,10 +211,10 @@ function d() {
210
211
  let n = /* @__PURE__ */ new Map(), r = Array.from(e.keys()).sort();
211
212
  for (let e of r) {
212
213
  if (!e) continue;
213
- let t = e.split("/"), r = "", i = f || void 0;
214
+ let t = e.split("/"), r = "", i = d || 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
  });
@@ -222,7 +223,7 @@ function d() {
222
223
  }
223
224
  let i = [], ee = 0;
224
225
  for (let [t, r] of e) {
225
- let e = t ? n.get(t) : f || void 0;
226
+ let e = t ? n.get(t) : d || void 0;
226
227
  for (let t of r) {
227
228
  let n = await xe(t);
228
229
  i.push({
@@ -235,42 +236,42 @@ 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 tn(e);
241
+ G(!1), b.success(a(u, "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,
252
- parentFolderId: f
247
+ }, cn = () => {
248
+ M(!0);
249
+ }, ln = async () => {
250
+ if (U.trim() && p) {
251
+ let { data: e, error: t } = await Z.mutateAsync({
252
+ name: U,
253
+ parentFolderId: d
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) ? (M(!1), W(""), Dt(!0)) : (b.error(t instanceof Error ? t.message : a(u, "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,
263
- parentFolderId: f
262
+ e && (W(""), M(!1), X("files.folder.created", {
263
+ folderName: U,
264
+ parentFolderId: d
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) => {
273
- if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
267
+ }, un = (e) => {
268
+ Ct(e);
269
+ }, dn = (e) => {
270
+ F(e), At(!0);
271
+ }, fn = (e) => {
272
+ F(e), At(!0);
273
+ }, pn = async (e) => {
274
+ if (!e.fileId && !e.folderId) throw Error(a(u, "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) {
276
277
  let r = {
@@ -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 Jt.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 Yt.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({
312
- title: a(d, "files.confirm.deleteFile.title", "Delete file"),
313
- description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
314
- confirmLabel: a(d, "files.common.actions.delete", "Delete"),
311
+ }, mn = async (e) => {
312
+ Le("medium"), Y({
313
+ title: a(u, "files.confirm.deleteFile.title", "Delete file"),
314
+ description: a(u, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
315
+ confirmLabel: a(u, "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 Vt.mutateAsync({ id: e.id }), Re("success"), b.success(a(u, "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
+ b.error(t instanceof Error ? t.message : a(u, "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
+ }, hn = 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 Ut.mutateAsync({ id: e.id }), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.file.errors.restoreFailed", "Failed to restore file"));
340
341
  }
341
- }, ln = async (e) => {
342
- Le("heavy"), Z({
343
- title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
344
- description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
345
- confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
342
+ }, gn = async (e) => {
343
+ Le("heavy"), Y({
344
+ title: a(u, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
345
+ description: a(u, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
346
+ confirmLabel: a(u, "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 Gt.mutateAsync({ id: e.id }), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
356
357
  }
357
358
  }
358
359
  });
359
- }, un = async (e) => {
360
+ }, _n = async (e) => {
360
361
  try {
361
- await Rt.mutateAsync({
362
+ await qt.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
+ b.error(a(u, "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
+ }, vn = (e) => {
377
+ B({
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
+ }), H(e.name), N(!0);
382
+ }, yn = async (e) => {
382
383
  try {
383
384
  let t = e.downloadUrl || e.url;
384
- if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
385
+ if (!t) throw Error(a(u, "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), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.file.errors.downloadFailed", "Failed to download file"));
392
393
  }
393
- }, pn = (e) => {
394
- Et({
394
+ }, bn = (e) => {
395
+ Ft({
395
396
  item: e,
396
397
  type: "file"
397
- }), wt(!0);
398
- }, mn = (e) => {
399
- z({
398
+ }), Nt(!0);
399
+ }, xn = (e) => {
400
+ L({
400
401
  item: e,
401
402
  type: "file"
402
- }), I(!0);
403
- }, hn = (e) => {
404
- mt({
403
+ }), P(!0);
404
+ }, Sn = (e) => {
405
+ St({
405
406
  item: e,
406
407
  type: "file"
407
408
  });
408
- }, gn = (e) => {
409
- p(`/files/browse/${e.id}`);
410
- }, _n = async (e) => {
411
- Le("medium"), Z({
412
- title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
413
- description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
414
- confirmLabel: a(d, "files.common.actions.delete", "Delete"),
409
+ }, Cn = (e) => {
410
+ f(`/files/browse/${e.id}`);
411
+ }, wn = async (e) => {
412
+ Le("medium"), Y({
413
+ title: a(u, "files.confirm.deleteFolder.title", "Delete folder"),
414
+ description: a(u, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
415
+ confirmLabel: a(u, "files.common.actions.delete", "Delete"),
415
416
  variant: "danger",
416
417
  onConfirm: async () => {
417
418
  try {
418
- await Nt.mutateAsync({
419
+ await Ht.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
+ }), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.deleteFailed", "Failed to delete folder"));
428
429
  }
429
430
  }
430
431
  });
431
- }, vn = async (e) => {
432
+ }, Tn = 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 Wt.mutateAsync({ id: e.id }), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.restoreFailed", "Failed to restore folder"));
439
440
  }
440
- }, yn = async (e) => {
441
- Z({
442
- title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
443
- description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
444
- confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
441
+ }, En = async (e) => {
442
+ Y({
443
+ title: a(u, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
444
+ description: a(u, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
445
+ confirmLabel: a(u, "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 Kt.mutateAsync({ id: e.id }), b.success(a(u, "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
+ b.error(e instanceof Error ? e.message : a(u, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
455
456
  }
456
457
  }
457
458
  });
458
- }, bn = (e) => {
459
- H({
459
+ }, Dn = (e) => {
460
+ B({
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
+ }), H(e.name), N(!0);
465
+ }, On = (e) => {
466
+ L({
466
467
  item: e,
467
468
  type: "folder"
468
- }), I(!0);
469
- }, Sn = async (e) => {
469
+ }), P(!0);
470
+ }, kn = async (e) => {
470
471
  try {
471
- await Rt.mutateAsync({
472
+ await qt.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
+ b.error(a(u, "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
+ }, An = (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
+ }, jn = async (e) => {
492
+ if (I) try {
493
+ I.type === "file" ? (await Zt.mutateAsync({
494
+ fileId: I.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
+ }), b.success(a(u, "files.file.move.success", "\"{{name}}\" moved", { name: I.item.name })), X("files.file.moved", {
497
+ fileId: I.item.id,
498
+ fileName: I.item.name,
498
499
  destinationFolderId: e
499
- })) : (await Gt.mutateAsync({
500
- folderId: R.item.id,
500
+ })) : (await Qt.mutateAsync({
501
+ folderId: I.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
+ }), b.success(a(u, "files.folder.move.success", "\"{{name}}\" moved", { name: I.item.name })), X("files.folder.moved", {
504
+ folderId: I.item.id,
505
+ folderName: I.item.name,
505
506
  destinationFolderId: e
506
- })), I(!1), z(null);
507
+ })), P(!1), L(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
+ b.error(e instanceof Error ? e.message : a(u, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: I.item.name })), X("files.api.failed", {
510
+ action: I.type === "file" ? "moveFile" : "moveFolder",
511
+ itemId: I.item.id,
512
+ itemType: I.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
+ }, Mn = async (e, t) => {
517
+ if (R) try {
518
+ if (R.type !== "file") throw Error(a(u, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
519
+ await Xt.mutateAsync({
520
+ id: R.item.id,
521
+ newName: t || `Copy of ${R.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
+ }), b.success(a(u, "files.file.copy.success", "\"{{name}}\" copied", { name: R.item.name })), X("files.file.copied", {
524
+ fileId: R.item.id,
525
+ fileName: R.item.name,
525
526
  destinationFolderId: e
526
- }), wt(!1), Et(null);
527
+ }), Nt(!1), Ft(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
+ b.error(e instanceof Error ? e.message : a(u, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: R.item.name })), X("files.api.failed", {
529
530
  action: "copyFile",
530
- fileId: B.item.id,
531
+ fileId: R.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
+ }, Nn = async () => {
536
+ if (!(!z || !V.trim())) try {
537
+ let e = z.name, t = V.trim();
538
+ z.type === "file" ? (await Q.mutateAsync({
539
+ fileId: z.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
+ }), b.success(a(u, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
542
+ fileId: z.id,
542
543
  previousName: e,
543
544
  name: t
544
- })) : (await Bt.mutateAsync({
545
- folderId: V.id,
545
+ })) : (await $.mutateAsync({
546
+ folderId: z.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
+ }), b.success(a(u, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
549
+ folderId: z.id,
549
550
  previousName: e,
550
551
  name: t
551
- })), P(!1), H(null), W("");
552
+ })), N(!1), B(null), H("");
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
+ b.error(e instanceof Error ? e.message : a(u, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: z.type })), X("files.api.failed", {
555
+ action: z.type === "file" ? "renameFile" : "renameFolder",
556
+ itemId: z.id,
557
+ itemType: z.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,
568
- activeTab: v
569
- }), m === void 0 ? /* @__PURE__ */ u("div", {
563
+ files: E,
564
+ folders: D,
565
+ onFilePreview: un,
566
+ onFileDelete: mn,
567
+ onFolderOpen: Cn,
568
+ onFolderDelete: wn,
569
+ activeTab: _
570
+ }), p === 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
- 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
+ children: a(u, "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
+ }) : p === "" ? /* @__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
- children: a(d, "files.browser.workspace.notSelected", "No workspace selected. Please select a workspace to view files.")
580
+ children: a(u, "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
+ /* @__PURE__ */ c("div", {
585
586
  className: "bg-bg-surface border-b border-border-default 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
- onClick: () => p("/files/browse"),
594
+ onClick: () => f("/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
- title: a(d, "files.browser.actions.goToRoot", "Go to root"),
596
- children: [/* @__PURE__ */ l(qe, { className: "size-4" }), /* @__PURE__ */ l("span", {
596
+ title: a(u, "files.browser.actions.goToRoot", "Go to root"),
597
+ children: [/* @__PURE__ */ c(qe, { className: "size-4" }), /* @__PURE__ */ c("span", {
597
598
  className: "hidden sm:inline",
598
- children: a(d, "files.browser.rootLabel", "My Drive")
599
+ children: a(u, "files.browser.rootLabel", "My Drive")
599
600
  })]
600
- }), ot.map((e, t) => /* @__PURE__ */ u("div", {
601
+ }), mt.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
- 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"}`,
608
+ onClick: () => f(`/files/browse/${e.id}`),
609
+ className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === mt.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,438 +614,434 @@ 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
- activeTab: v,
620
- onTabChange: st,
621
- tabs: ct
619
+ children: /* @__PURE__ */ c(Ce, {
620
+ activeTab: _,
621
+ onTabChange: ht,
622
+ tabs: gt
622
623
  })
623
624
  }),
624
- /* @__PURE__ */ u("div", {
625
+ /* @__PURE__ */ l("div", {
625
626
  className: "bg-bg-surface border-b border-border-default 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
- placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
639
- initialQuery: lt,
639
+ placeholder: a(u, "files.search.input.placeholder", "Search files and folders..."),
640
+ initialQuery: _t,
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
646
  children: [
646
- !y && (D.length > 0 || O.length > 0) && /* @__PURE__ */ l("button", {
647
+ !v && (E.length > 0 || D.length > 0) && /* @__PURE__ */ c("button", {
647
648
  type: "button",
648
649
  onClick: () => {
649
- let e = D.map((e) => e.id), n = O.map((e) => e.id);
650
+ let e = E.map((e) => e.id), n = D.map((e) => e.id);
650
651
  t.getState().selectAllFiles(e), n.forEach((e) => t.getState().selectFolder(e));
651
652
  },
652
653
  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
+ children: a(u, "files.browser.actions.selectAll", "Select All")
654
655
  }),
655
- !y && /* @__PURE__ */ u(c, { children: [
656
- /* @__PURE__ */ u("button", {
656
+ !v && /* @__PURE__ */ l($e, { children: [
657
+ /* @__PURE__ */ l("button", {
657
658
  type: "button",
658
- onClick: en,
659
+ onClick: cn,
659
660
  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
661
  "data-tour": "files-new-folder-button",
661
- children: [/* @__PURE__ */ l(Ue, { className: "size-4" }), /* @__PURE__ */ l("span", {
662
+ children: [/* @__PURE__ */ c(Ue, { className: "size-4" }), /* @__PURE__ */ c("span", {
662
663
  className: "hidden sm:inline",
663
- children: a(d, "files.browser.actions.newFolder", "New Folder")
664
+ children: a(u, "files.browser.actions.newFolder", "New Folder")
664
665
  })]
665
666
  }),
666
- /* @__PURE__ */ l("button", {
667
+ /* @__PURE__ */ c("button", {
667
668
  type: "button",
668
- onClick: qt,
669
- disabled: Dt,
669
+ onClick: en,
670
+ disabled: It,
670
671
  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
672
  "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
+ children: It ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), /* @__PURE__ */ c("span", {
673
674
  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", {
675
+ children: a(u, "files.browser.upload.uploading", "Uploading...")
676
+ })] }) : /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c(Ze, { className: "size-4" }), /* @__PURE__ */ c("span", {
676
677
  className: "hidden sm:inline",
677
- children: a(d, "files.browser.actions.uploadFiles", "Upload Files")
678
+ children: a(u, "files.browser.actions.uploadFiles", "Upload Files")
678
679
  })] })
679
680
  }),
680
- /* @__PURE__ */ u("button", {
681
+ /* @__PURE__ */ l("button", {
681
682
  type: "button",
682
- onClick: $t,
683
- disabled: Dt,
683
+ onClick: sn,
684
+ disabled: It,
684
685
  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")]
686
+ title: a(u, "files.browser.actions.uploadFolderTitle", "Upload entire folder with structure"),
687
+ children: [/* @__PURE__ */ c(We, { className: "size-4" }), a(u, "files.browser.actions.uploadFolder", "Upload Folder")]
687
688
  })
688
689
  ] }),
689
- /* @__PURE__ */ u("div", {
690
+ /* @__PURE__ */ l("div", {
690
691
  className: "flex items-center border border-border-default rounded-lg overflow-hidden",
691
692
  "data-tour": "files-view-mode-toggle",
692
- children: [/* @__PURE__ */ l("button", {
693
+ children: [/* @__PURE__ */ c("button", {
693
694
  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", {
695
+ onClick: () => pt("grid"),
696
+ className: `p-2 transition-colors duration-200 ${ft === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
697
+ "aria-label": a(u, "files.browser.view.grid", "Grid view"),
698
+ children: /* @__PURE__ */ c(Ke, { className: "size-5" })
699
+ }), /* @__PURE__ */ c("button", {
699
700
  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" })
701
+ onClick: () => pt("list"),
702
+ className: `p-2 transition-colors duration-200 ${ft === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
703
+ "aria-label": a(u, "files.browser.view.list", "List view"),
704
+ children: /* @__PURE__ */ c(Je, { className: "size-5" })
704
705
  })]
705
706
  })
706
707
  ]
707
708
  })]
708
709
  }),
709
- y && /* @__PURE__ */ u("div", {
710
+ v && /* @__PURE__ */ l("div", {
710
711
  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", {
712
+ children: [/* @__PURE__ */ l("span", {
712
713
  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", {
714
+ children: [a(u, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: _t }), T.data && ` (${(T.data.files?.length || 0) + (T.data.folders?.length || 0)} items)`]
715
+ }), /* @__PURE__ */ l("button", {
715
716
  type: "button",
716
- onClick: () => ut(""),
717
+ onClick: () => vt(""),
717
718
  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")]
719
+ children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(u, "files.browser.search.clear", "Clear search")]
719
720
  })]
720
721
  }),
721
- M > 0 && /* @__PURE__ */ u("div", {
722
+ j > 0 && /* @__PURE__ */ l("div", {
722
723
  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", {
724
+ children: [/* @__PURE__ */ l("div", {
724
725
  className: "flex items-center gap-4",
725
- children: [/* @__PURE__ */ l("span", {
726
+ children: [/* @__PURE__ */ c("span", {
726
727
  className: "text-sm font-medium text-text-primary",
727
- children: a(d, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
728
- count: M,
729
- suffix: M > 1 ? "s" : ""
728
+ children: a(u, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
729
+ count: j,
730
+ suffix: j > 1 ? "s" : ""
730
731
  })
731
- }), /* @__PURE__ */ l("div", {
732
+ }), /* @__PURE__ */ c("div", {
732
733
  className: "flex items-center gap-2",
733
- children: v === "bin" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
734
+ children: _ === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
734
735
  type: "button",
735
736
  onClick: async () => {
736
737
  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`);
738
+ await Promise.all([...Array.from(m).map((e) => Ut.mutateAsync({ id: e })), ...Array.from(h).map((e) => Wt.mutateAsync({ id: e }))]), g(), b.success(`${j} item${j > 1 ? "s" : ""} restored`);
738
739
  } catch (e) {
739
- x.error(e instanceof Error ? e.message : "Failed to restore some items");
740
+ b.error(e instanceof Error ? e.message : "Failed to restore some items");
740
741
  }
741
742
  },
742
743
  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
- children: a(d, "files.browser.selection.actions.restore", "Restore")
744
- }), /* @__PURE__ */ u("button", {
744
+ children: a(u, "files.browser.selection.actions.restore", "Restore")
745
+ }), /* @__PURE__ */ l("button", {
745
746
  type: "button",
746
747
  onClick: async () => {
747
- Z({
748
- title: a(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
749
- 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" : ""
748
+ Y({
749
+ title: a(u, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
750
+ description: a(u, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
751
+ count: j,
752
+ plural: j > 1 ? "s" : ""
752
753
  }),
753
- confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
754
+ confirmLabel: a(u, "files.common.actions.deletePermanently", "Delete permanently"),
754
755
  variant: "danger",
755
756
  onConfirm: async () => {
756
757
  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" : ""
758
+ await Promise.all([...Array.from(m).map((e) => Gt.mutateAsync({ id: e })), ...Array.from(h).map((e) => Kt.mutateAsync({ id: e }))]), g(), b.success(a(u, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
759
+ count: j,
760
+ plural: j > 1 ? "s" : ""
760
761
  }));
761
762
  } catch (e) {
762
- x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
763
+ b.error(e instanceof Error ? e.message : a(u, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
763
764
  }
764
765
  }
765
766
  });
766
767
  },
767
768
  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", {
769
+ children: [/* @__PURE__ */ c(Xe, { className: "size-4" }), a(u, "files.browser.selection.actions.deletePermanently", "Delete permanently")]
770
+ })] }) : /* @__PURE__ */ l("button", {
770
771
  type: "button",
771
772
  onClick: async () => {
772
- Z({
773
- title: a(d, "files.confirm.bulkDelete.title", "Delete selected items"),
774
- description: a(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
775
- count: M,
776
- plural: M > 1 ? "s" : ""
773
+ Y({
774
+ title: a(u, "files.confirm.bulkDelete.title", "Delete selected items"),
775
+ description: a(u, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
776
+ count: j,
777
+ plural: j > 1 ? "s" : ""
777
778
  }),
778
- confirmLabel: a(d, "files.common.actions.delete", "Delete"),
779
+ confirmLabel: a(u, "files.common.actions.delete", "Delete"),
779
780
  variant: "danger",
780
781
  onConfirm: async () => {
781
782
  try {
782
- 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({
783
+ let e = Array.from(m), t = Array.from(h);
784
+ e.length > 0 && await $t.mutateAsync(e), await Promise.all(t.map((e) => Ht.mutateAsync({
784
785
  id: e,
785
786
  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" : ""
787
+ }))), g(), b.success(a(u, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
788
+ count: j,
789
+ plural: j > 1 ? "s" : ""
789
790
  }));
790
791
  } catch (e) {
791
- x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
792
+ b.error(e instanceof Error ? e.message : a(u, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
792
793
  }
793
794
  }
794
795
  });
795
796
  },
796
797
  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")]
798
+ children: [/* @__PURE__ */ c(Xe, { className: "size-4" }), a(u, "files.browser.selection.actions.delete", "Delete")]
798
799
  })
799
800
  })]
800
- }), /* @__PURE__ */ u("button", {
801
+ }), /* @__PURE__ */ l("button", {
801
802
  type: "button",
802
- onClick: _,
803
+ onClick: g,
803
804
  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")]
805
+ children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(u, "files.common.actions.clear", "Clear")]
805
806
  })]
806
807
  })
807
808
  ]
808
809
  }),
809
- (rt.isExhausted || rt.isNearLimit) && /* @__PURE__ */ l("div", {
810
+ (dt.isExhausted || dt.isNearLimit) && /* @__PURE__ */ c("div", {
810
811
  className: "px-4 sm:px-6 pt-3",
811
- children: /* @__PURE__ */ l(Pe, { quota: rt })
812
+ children: /* @__PURE__ */ c(Pe, { quota: dt })
812
813
  }),
813
- /* @__PURE__ */ u("div", {
814
+ /* @__PURE__ */ l("div", {
814
815
  className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
815
816
  "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", {
817
+ children: [/* @__PURE__ */ c(Se, {
818
+ files: E,
819
+ folders: D,
820
+ loading: O,
821
+ error: k,
822
+ preserveSortOrder: A,
823
+ onFilePreview: un,
824
+ onFileShare: _ === "bin" ? void 0 : dn,
825
+ onFileDelete: _ === "bin" ? gn : mn,
826
+ onFileRestore: _ === "bin" ? hn : void 0,
827
+ onFileFavorite: _ === "bin" ? void 0 : _n,
828
+ onFileRename: _ === "bin" ? void 0 : vn,
829
+ onFileDownload: yn,
830
+ onFileCopy: _ === "bin" ? void 0 : bn,
831
+ onFileMove: _ === "bin" ? void 0 : xn,
832
+ onFileInfo: Sn,
833
+ onFolderOpen: Cn,
834
+ onFolderShare: _ === "bin" ? void 0 : fn,
835
+ onFolderDelete: _ === "bin" ? En : wn,
836
+ onFolderRestore: _ === "bin" ? Tn : void 0,
837
+ onFolderRename: _ === "bin" ? void 0 : Dn,
838
+ onFolderFavorite: _ === "bin" ? void 0 : kn,
839
+ onFolderMove: _ === "bin" ? void 0 : On,
840
+ onFolderInfo: An
841
+ }), !O && (E.length > 0 || D.length > 0) && /* @__PURE__ */ l("div", {
841
842
  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 })}`]
843
+ children: [a(u, "files.browser.results.showingItems", "Showing {{count}} items", { count: E.length + D.length }), !v && _ === "all" && wt !== null && ` ${a(u, "files.browser.results.ofItems", "of {{count}} items", { count: wt })}`]
843
844
  })]
844
845
  }),
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",
846
+ Tt && /* @__PURE__ */ c(at, {
847
+ open: !0,
848
+ onOpenChange: (e) => {
849
+ !e && !Z.isPending && (M(!1), W(""));
850
+ },
851
+ children: /* @__PURE__ */ l(ot, {
852
+ className: "w-full max-w-xs",
852
853
  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")
854
+ /* @__PURE__ */ c(ct, {
855
+ className: "text-left",
856
+ children: /* @__PURE__ */ c(lt, {
857
+ id: "files-new-folder-title",
858
+ className: "text-base font-semibold text-text-primary",
859
+ children: a(u, "files.browser.newFolderDialog.title", "New folder")
860
+ })
857
861
  }),
858
- /* @__PURE__ */ l("input", {
862
+ /* @__PURE__ */ c(it, {
859
863
  type: "text",
860
- value: G,
861
- onChange: (e) => K(e.target.value),
864
+ value: U,
865
+ onChange: (e) => W(e.target.value),
862
866
  onKeyDown: (e) => {
863
- e.key === "Enter" && tn(), e.key === "Escape" && (N(!1), K(""));
867
+ e.key === "Enter" && ln();
864
868
  },
865
- "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"
869
+ "aria-label": a(u, "files.browser.newFolderDialog.title", "New folder"),
870
+ placeholder: a(u, "files.browser.newFolderDialog.placeholder", "Folder name")
868
871
  }),
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
- })
872
+ /* @__PURE__ */ l(st, { children: [/* @__PURE__ */ c(rt, {
873
+ type: "button",
874
+ variant: "outline",
875
+ onClick: () => {
876
+ M(!1), W("");
877
+ },
878
+ children: a(u, "files.common.actions.cancel", "Cancel")
879
+ }), /* @__PURE__ */ l(rt, {
880
+ type: "button",
881
+ onClick: ln,
882
+ disabled: !U.trim() || Z.isPending,
883
+ children: [Z.isPending && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Z.isPending ? a(u, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(u, "files.common.actions.create", "Create")]
884
+ })] })
886
885
  ]
887
886
  })
888
887
  }),
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",
888
+ Ot && z && /* @__PURE__ */ c(at, {
889
+ open: !0,
890
+ onOpenChange: (e) => {
891
+ !e && !Q.isPending && !$.isPending && (N(!1), B(null), H(""));
892
+ },
893
+ children: /* @__PURE__ */ l(ot, {
894
+ className: "w-full max-w-xs",
896
895
  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 })
896
+ /* @__PURE__ */ c(ct, {
897
+ className: "text-left",
898
+ children: /* @__PURE__ */ c(lt, {
899
+ id: "files-rename-title",
900
+ className: "text-base font-semibold text-text-primary",
901
+ children: a(u, "files.browser.renameDialog.title", "Rename {{type}}", { type: z.type })
902
+ })
901
903
  }),
902
- /* @__PURE__ */ l("input", {
904
+ /* @__PURE__ */ c(it, {
903
905
  type: "text",
904
- value: U,
905
- onChange: (e) => W(e.target.value),
906
+ value: V,
907
+ onChange: (e) => H(e.target.value),
906
908
  onKeyDown: (e) => {
907
- e.key === "Enter" && En(), e.key === "Escape" && (P(!1), H(null), W(""));
909
+ e.key === "Enter" && Nn();
908
910
  },
909
- "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"
911
+ "aria-label": a(u, "files.browser.renameDialog.title", "Rename"),
912
+ placeholder: a(u, "files.browser.renameDialog.placeholder", "New name")
912
913
  }),
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
- })
914
+ /* @__PURE__ */ l(st, { children: [/* @__PURE__ */ c(rt, {
915
+ type: "button",
916
+ variant: "outline",
917
+ onClick: () => {
918
+ N(!1), B(null), H("");
919
+ },
920
+ children: a(u, "files.common.actions.cancel", "Cancel")
921
+ }), /* @__PURE__ */ l(rt, {
922
+ type: "button",
923
+ onClick: Nn,
924
+ disabled: !V.trim() || V.trim() === z.name || Q.isPending || $.isPending,
925
+ children: [(Q.isPending || $.isPending) && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Q.isPending || $.isPending ? a(u, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(u, "files.common.actions.rename", "Rename")]
926
+ })] })
930
927
  ]
931
928
  })
932
929
  }),
933
- xt && Tt && /* @__PURE__ */ l(we, {
934
- item: Tt,
935
- itemType: "mimeType" in Tt ? "file" : "folder",
930
+ kt && Pt && /* @__PURE__ */ c(we, {
931
+ item: Pt,
932
+ itemType: "mimeType" in Pt ? "file" : "folder",
936
933
  onClose: () => {
937
- F(!1), L(null);
934
+ At(!1), F(null);
938
935
  },
939
- onCreateShare: on,
940
- isLoading: Vt.isPending
936
+ onCreateShare: pn,
937
+ isLoading: Jt.isPending
941
938
  }),
942
- X && /* @__PURE__ */ l(Me, {
943
- title: X.title,
944
- description: X.description,
945
- confirmLabel: X.confirmLabel,
946
- cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
947
- variant: X.variant,
948
- loading: X.loading,
949
- onConfirm: At,
939
+ J && /* @__PURE__ */ c(Me, {
940
+ title: J.title,
941
+ description: J.description,
942
+ confirmLabel: J.confirmLabel,
943
+ cancelLabel: a(u, "files.common.actions.cancel", "Cancel"),
944
+ variant: J.variant,
945
+ loading: J.loading,
946
+ onConfirm: zt,
950
947
  onCancel: () => {
951
- X.loading || Z(null);
948
+ J.loading || Y(null);
952
949
  }
953
950
  }),
954
- vt && /* @__PURE__ */ l(Me, {
955
- title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
956
- 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
- confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
958
- cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
951
+ Et && /* @__PURE__ */ c(Me, {
952
+ title: a(u, "files.folder.quota.title", "Folder Limit Reached"),
953
+ description: a(u, "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."),
954
+ confirmLabel: a(u, "files.folder.quota.upgrade", "View Billing"),
955
+ cancelLabel: a(u, "files.common.actions.dismiss", "Dismiss"),
959
956
  onConfirm: () => {
960
- yt(!1), p("/billing");
957
+ Dt(!1), f("/billing");
961
958
  },
962
- onCancel: () => yt(!1)
959
+ onCancel: () => Dt(!1)
963
960
  }),
964
- St && R && /* @__PURE__ */ l(Ae, {
965
- item: R.item,
966
- type: R.type,
961
+ jt && I && /* @__PURE__ */ c(Ae, {
962
+ item: I.item,
963
+ type: I.type,
967
964
  onClose: () => {
968
- I(!1), z(null);
965
+ P(!1), L(null);
969
966
  },
970
- onMove: wn,
971
- isLoading: Wt.isPending || Gt.isPending
967
+ onMove: jn,
968
+ isLoading: Zt.isPending || Qt.isPending
972
969
  }),
973
- Ct && B && /* @__PURE__ */ l(je, {
974
- item: B.item,
975
- type: B.type,
970
+ Mt && R && /* @__PURE__ */ c(je, {
971
+ item: R.item,
972
+ type: R.type,
976
973
  onClose: () => {
977
- wt(!1), Et(null);
974
+ Nt(!1), Ft(null);
978
975
  },
979
- onCopy: Tn,
980
- isLoading: Ut.isPending
976
+ onCopy: Mn,
977
+ isLoading: Xt.isPending
981
978
  }),
982
- b && /* @__PURE__ */ l(Te, {
983
- file: b,
984
- onClose: () => ht(null),
979
+ y && /* @__PURE__ */ c(Te, {
980
+ file: y,
981
+ onClose: () => Ct(null),
985
982
  onDownload: () => {
986
- ze(b.downloadUrl || b.url);
983
+ ze(y.downloadUrl || y.url);
987
984
  },
988
- onShare: v === "bin" ? void 0 : () => {
989
- L(b), F(!0);
985
+ onShare: _ === "bin" ? void 0 : () => {
986
+ F(y), At(!0);
990
987
  },
991
- onStar: v === "bin" ? void 0 : () => un(b),
992
- onDelete: () => v === "bin" ? ln(b) : sn(b)
988
+ onStar: _ === "bin" ? void 0 : () => _n(y),
989
+ onDelete: () => _ === "bin" ? gn(y) : mn(y)
993
990
  }),
994
- pt && /* @__PURE__ */ l(Ee, {
995
- item: pt.item,
996
- type: pt.type,
997
- onClose: () => mt(null)
991
+ xt && /* @__PURE__ */ c(Ee, {
992
+ item: xt.item,
993
+ type: xt.type,
994
+ onClose: () => St(null)
998
995
  }),
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
996
+ /* @__PURE__ */ c(Ne, {
997
+ items: Lt,
998
+ isOpen: Rt,
999
+ onClose: () => q(!1),
1000
+ onPause: nn,
1001
+ onResume: rn,
1002
+ onRetry: an,
1003
+ onCancel: on
1007
1004
  }),
1008
- /* @__PURE__ */ l(Oe, {
1009
- toasts: x.toasts,
1010
- onClose: x.removeToast
1005
+ /* @__PURE__ */ c(Oe, {
1006
+ toasts: b.toasts,
1007
+ onClose: b.removeToast
1011
1008
  }),
1012
- !k && D.length === 0 && O.length === 0 && /* @__PURE__ */ l("div", {
1009
+ !O && E.length === 0 && D.length === 0 && /* @__PURE__ */ c("div", {
1013
1010
  className: "px-6 py-12",
1014
- children: y ? /* @__PURE__ */ u("div", {
1011
+ children: v ? /* @__PURE__ */ l("div", {
1015
1012
  className: "text-center animate-in fade-in duration-200",
1016
1013
  children: [
1017
- /* @__PURE__ */ l("div", {
1014
+ /* @__PURE__ */ c("div", {
1018
1015
  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" })
1016
+ children: /* @__PURE__ */ c(Ye, { className: "size-8 text-text-tertiary" })
1020
1017
  }),
1021
- /* @__PURE__ */ l("h3", {
1018
+ /* @__PURE__ */ c("h3", {
1022
1019
  className: "text-lg font-medium text-text-primary mb-2",
1023
- children: a(d, "files.browser.empty.search.title", "No results found")
1020
+ children: a(u, "files.browser.empty.search.title", "No results found")
1024
1021
  }),
1025
- /* @__PURE__ */ l("p", {
1022
+ /* @__PURE__ */ c("p", {
1026
1023
  className: "text-sm text-text-secondary mb-4",
1027
- children: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters")
1024
+ children: a(u, "files.browser.empty.search.description", "Try adjusting your search query or filters")
1028
1025
  }),
1029
- /* @__PURE__ */ l("button", {
1026
+ /* @__PURE__ */ c("button", {
1030
1027
  type: "button",
1031
1028
  onClick: () => {
1032
- ut(""), ft(void 0);
1029
+ vt(""), bt(void 0);
1033
1030
  },
1034
1031
  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
- children: a(d, "files.browser.search.clear", "Clear search")
1032
+ children: a(u, "files.browser.search.clear", "Clear search")
1036
1033
  })
1037
1034
  ]
1038
- }) : /* @__PURE__ */ l(De, {
1039
- type: v,
1040
- onUpload: v === "all" ? qt : void 0,
1041
- onNewFolder: v === "all" ? en : void 0
1035
+ }) : /* @__PURE__ */ c(De, {
1036
+ type: _,
1037
+ onUpload: _ === "all" ? en : void 0,
1038
+ onNewFolder: _ === "all" ? cn : void 0
1042
1039
  })
1043
1040
  })
1044
1041
  ]
1045
1042
  });
1046
1043
  }
1047
1044
  //#endregion
1048
- export { d as BrowserPage };
1045
+ export { u as BrowserPage };
1049
1046
 
1050
1047
  //# sourceMappingURL=BrowserPage.js.map