@burdenoff/microfe-files 2026.1111.1 → 2026.1111.3

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