@burdenoff/microfe-files 2026.1014.12 → 2026.1016.1

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