efficient-shell 12.30.0 → 12.32.0
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.
- package/README.md +43 -1
- package/dist/{Browser-FQHXHI3R.js → Browser-36SDGA64.js} +17 -17
- package/dist/Calculator-GDHNFSB6.js +29 -0
- package/dist/{CurrencyConverter-EHIQIFJK.js → CurrencyConverter-PXCCCUS2.js} +6 -6
- package/dist/{Files-LTUUGPAM.js → Files-NVUIAUO5.js} +141 -141
- package/dist/{Notepad-JPAXNEFR.js → Notepad-QA2CD6GC.js} +9 -9
- package/dist/PdfViewer-627HEAIL.js +1 -0
- package/dist/{PomodoroTimer-IVDZBBUN.js → PomodoroTimer-HD2ZNOUV.js} +69 -69
- package/dist/{Preview-KRK4XT2B.js → Preview-FW2KT6FQ.js} +27 -27
- package/dist/Sidebar-QNJNEBT2.js +44 -0
- package/dist/{Stock-OBS2LPX4.js → Stock-EDZSOJAQ.js} +7 -7
- package/dist/{Weather-I4TJBIEN.js → Weather-OTVZZEE7.js} +17 -17
- package/dist/{WorldClock-YU2ZPVSA.js → WorldClock-PDKFE5S7.js} +4 -4
- package/dist/ai/index.js +88 -88
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-LQD54ZL5.js → chunk-246K337V.js} +1 -1
- package/dist/{chunk-CIOPLPZW.js → chunk-25M4CAB3.js} +1 -1
- package/dist/{chunk-JA5WM66L.js → chunk-26Y66IXU.js} +2 -2
- package/dist/chunk-2PNG5UR6.js +22 -0
- package/dist/chunk-3ECUHYHI.js +28 -0
- package/dist/{chunk-77BK2IAJ.js → chunk-3MAGUYG2.js} +1 -1
- package/dist/{chunk-6EXWWPAW.js → chunk-3TR6C5V4.js} +1 -1
- package/dist/{chunk-YNE5YC6E.js → chunk-3UMS74TZ.js} +1 -1
- package/dist/{chunk-XXRUDMD5.js → chunk-4U2OUX65.js} +5 -5
- package/dist/{chunk-FYGPJPU7.js → chunk-4XN6ACGV.js} +1 -1
- package/dist/{chunk-3R2TMLKH.js → chunk-555KW6TM.js} +5 -5
- package/dist/{chunk-5ZS3VOJH.js → chunk-5OJFYNEZ.js} +1 -1
- package/dist/{chunk-V64XY7L4.js → chunk-5R3NDBCD.js} +7 -7
- package/dist/{chunk-XK3VYRLR.js → chunk-5XHJ3H6Y.js} +4 -4
- package/dist/{chunk-LBLWN3SH.js → chunk-5XOF3O4B.js} +1 -1
- package/dist/{chunk-NJ6WZHXC.js → chunk-6AAGZ34A.js} +10 -10
- package/dist/{chunk-3ZC53F4T.js → chunk-6MA7VXZR.js} +3 -3
- package/dist/{chunk-KHFPF534.js → chunk-6ZTVZIPI.js} +6 -6
- package/dist/chunk-7CHEHWGL.js +9 -0
- package/dist/{chunk-AIGLJYQ5.js → chunk-7IRO4JAA.js} +1 -1
- package/dist/{chunk-N2BWOHNM.js → chunk-7JR2O3IX.js} +5 -5
- package/dist/{chunk-I6V4DMNR.js → chunk-A6YUCAGF.js} +1 -1
- package/dist/{chunk-NSNM4QIV.js → chunk-A7JAHN75.js} +5 -5
- package/dist/chunk-ADNUV6OV.js +8 -0
- package/dist/chunk-AFLG5E4O.js +7 -0
- package/dist/{chunk-KNNFNOX7.js → chunk-AFVI75RH.js} +7 -7
- package/dist/{chunk-KKYNDLOC.js → chunk-AGNHOSES.js} +6 -6
- package/dist/{chunk-RMUOUMV2.js → chunk-AJ2EEWZT.js} +2 -2
- package/dist/chunk-AWY2ZOXT.js +14 -0
- package/dist/{chunk-WM37FXRK.js → chunk-B7UT3W4C.js} +1 -1
- package/dist/{chunk-HJECGV6W.js → chunk-BEN2LJWQ.js} +1 -1
- package/dist/{chunk-U45APXV3.js → chunk-BIBQAEHV.js} +1 -1
- package/dist/{chunk-Y6H5C6A4.js → chunk-BLC6HAU3.js} +1 -1
- package/dist/{chunk-X5RFTIHV.js → chunk-BXPEEPYH.js} +1 -1
- package/dist/{chunk-JOANOIVK.js → chunk-CAIUI3DC.js} +1 -1
- package/dist/{chunk-5O5QMMMG.js → chunk-CHRK5R3Y.js} +8 -8
- package/dist/{chunk-B27XRZ47.js → chunk-COF2CF5R.js} +1 -1
- package/dist/{chunk-42GNFUAP.js → chunk-CYTK7DCA.js} +11 -11
- package/dist/{chunk-DOKA65JI.js → chunk-DGFC5BX4.js} +1 -1
- package/dist/{chunk-IQTURGC4.js → chunk-DHLXSL3Y.js} +1 -1
- package/dist/{chunk-4WW3SNL6.js → chunk-DRIO2Y4R.js} +4 -4
- package/dist/{chunk-IBPULOGJ.js → chunk-DWGMTMDU.js} +2 -2
- package/dist/{chunk-E7RMS776.js → chunk-E6GGE7E5.js} +14 -14
- package/dist/{chunk-FM34DWV7.js → chunk-FE6J5S5X.js} +5 -5
- package/dist/chunk-FKJPBQ6I.js +7 -0
- package/dist/{chunk-MYJ3HQYG.js → chunk-FXS2P23Q.js} +10 -10
- package/dist/chunk-G3NE4SGZ.js +11 -0
- package/dist/chunk-GX4CDXPK.js +9 -0
- package/dist/chunk-H74VN7OI.js +2 -0
- package/dist/chunk-H7WMOY62.js +1 -0
- package/dist/{chunk-HU24RSAE.js → chunk-HGGDOMBV.js} +1 -1
- package/dist/{chunk-CBBU74QT.js → chunk-HWV6UDFC.js} +1 -1
- package/dist/{chunk-OMSIXLK4.js → chunk-IBLRSK7V.js} +1 -1
- package/dist/{chunk-2N6WWL7Y.js → chunk-IE5XWHDU.js} +1 -1
- package/dist/chunk-IESNUXYH.js +1 -0
- package/dist/chunk-IYM5N7FH.js +4 -0
- package/dist/{chunk-IOIY54KO.js → chunk-J44SUUOG.js} +1 -1
- package/dist/{chunk-4SEPQN2N.js → chunk-JI55MXP4.js} +8 -8
- package/dist/{chunk-PAVOVX3D.js → chunk-JIBU7YY4.js} +2 -2
- package/dist/{chunk-WCJR2GNH.js → chunk-JLQ7N54N.js} +17 -17
- package/dist/chunk-JROPOGQP.js +2 -0
- package/dist/{chunk-GBPGZFBS.js → chunk-JTJDXCJU.js} +4 -4
- package/dist/{chunk-CVEVPB3O.js → chunk-JYVHFRKK.js} +5 -5
- package/dist/{chunk-MFZ4YMXE.js → chunk-JZ4V3RHK.js} +6 -6
- package/dist/{chunk-QF4FYOVE.js → chunk-K4BM6PPZ.js} +1 -1
- package/dist/{chunk-GN3AHAVY.js → chunk-K4RY57UX.js} +1 -1
- package/dist/{chunk-XMAOLCQV.js → chunk-K73KBA5C.js} +4 -4
- package/dist/{chunk-VREZFFRE.js → chunk-KDG7NWYX.js} +1 -1
- package/dist/{chunk-5X3Z45SL.js → chunk-KFNQVNND.js} +1 -1
- package/dist/{chunk-JTRQ7HAS.js → chunk-KTKFCR6T.js} +1 -1
- package/dist/chunk-L6XEON5Q.js +1 -0
- package/dist/{chunk-3N4XJS43.js → chunk-LNXYVWEF.js} +1 -1
- package/dist/chunk-LOJAJARD.js +8 -0
- package/dist/{chunk-GL4NELAT.js → chunk-LOMNX5VH.js} +1 -1
- package/dist/{chunk-ILSE5F5F.js → chunk-LQC5U5YT.js} +3 -3
- package/dist/chunk-LUAA4LKY.js +19 -0
- package/dist/{chunk-MRVW6F5E.js → chunk-M2TQQKJO.js} +1 -1
- package/dist/chunk-M3D5FW5R.js +6 -0
- package/dist/{chunk-NLQLVXMJ.js → chunk-M3FBPZ4G.js} +1 -1
- package/dist/{chunk-3B3QIHF7.js → chunk-MMSQZKJY.js} +5 -5
- package/dist/{chunk-X27K2NCU.js → chunk-NDGPJKE3.js} +5 -5
- package/dist/chunk-NMWV6BOL.js +8 -0
- package/dist/{chunk-36MM4YRK.js → chunk-NQ43KRRX.js} +7 -7
- package/dist/{chunk-FIXZT5TZ.js → chunk-NQA267J3.js} +7 -7
- package/dist/{chunk-VEF3STCH.js → chunk-NZ74N2IQ.js} +1 -1
- package/dist/{chunk-YGKQMENL.js → chunk-OA55OBDP.js} +1 -1
- package/dist/{chunk-2DCATU5B.js → chunk-OL2XKAX2.js} +1 -1
- package/dist/chunk-OQGCQQ7H.js +6 -0
- package/dist/{chunk-4FUQK2LK.js → chunk-OU3J5TOO.js} +1 -1
- package/dist/{chunk-MHVWUYEN.js → chunk-OWFJRER6.js} +1 -1
- package/dist/{chunk-M2GF44WC.js → chunk-PK5KDLIG.js} +12 -12
- package/dist/chunk-PPVZMIBL.js +4 -0
- package/dist/{chunk-5XYRFK7D.js → chunk-PR5CON2G.js} +1 -1
- package/dist/chunk-PTEKHRNX.js +26 -0
- package/dist/{chunk-UOHHIEH4.js → chunk-PUXSFLWR.js} +1 -1
- package/dist/{chunk-MVBDE4AX.js → chunk-Q2LKH6RN.js} +1 -1
- package/dist/{chunk-SAAXAAAH.js → chunk-Q2T5DRIK.js} +1 -1
- package/dist/{chunk-U22563X2.js → chunk-QB4LAGMN.js} +1 -1
- package/dist/{chunk-HE2I6KWY.js → chunk-QBQMMOP6.js} +2 -2
- package/dist/{chunk-PBZ3UQMS.js → chunk-QJ6HVBAA.js} +4 -4
- package/dist/{chunk-23CZSU3H.js → chunk-QPSKEDR7.js} +1 -1
- package/dist/{chunk-3HLV6BEC.js → chunk-QTWHMCCX.js} +10 -10
- package/dist/{chunk-Q4BJW37U.js → chunk-QUN3RSMN.js} +1 -1
- package/dist/{chunk-RPXRMTOU.js → chunk-QXLYU5FR.js} +1 -1
- package/dist/{chunk-37EYKPR6.js → chunk-QXTCEUFC.js} +1 -1
- package/dist/{chunk-HC3BZPWX.js → chunk-QYKWVZ3R.js} +1 -1
- package/dist/{chunk-6UB6YY3H.js → chunk-R3W6LZBG.js} +1 -1
- package/dist/{chunk-GANZLRMW.js → chunk-R3ZEDJDZ.js} +8 -8
- package/dist/chunk-RIULA2CH.js +15 -0
- package/dist/{chunk-ANGNTN36.js → chunk-RLFZRIO4.js} +1 -1
- package/dist/{chunk-TIYRBJSB.js → chunk-RPSNYIDY.js} +4 -4
- package/dist/{chunk-QT34GMZR.js → chunk-RSRTE7RG.js} +1 -1
- package/dist/{chunk-5RLJAXDR.js → chunk-S54Z2JAZ.js} +5 -5
- package/dist/{chunk-UQNKFMJR.js → chunk-T5UMQZ5X.js} +12 -12
- package/dist/{chunk-ZSVBEJ4G.js → chunk-TBXFRW3E.js} +1 -1
- package/dist/{chunk-KPPKPGQI.js → chunk-UJ23EKXU.js} +1 -1
- package/dist/{chunk-FSORYU5C.js → chunk-V2OE6OTK.js} +8 -8
- package/dist/{chunk-BEB3AGSY.js → chunk-V7BHDLP2.js} +1 -1
- package/dist/{chunk-DHRCI7KE.js → chunk-VERSP62V.js} +1 -1
- package/dist/{chunk-O3SCB4QZ.js → chunk-VI54L75G.js} +8 -8
- package/dist/{chunk-HOXXEF52.js → chunk-VTDW5GLS.js} +1 -1
- package/dist/chunk-VVI4Y6XA.js +23 -0
- package/dist/{chunk-AYCWVVJ3.js → chunk-VW3ZUWW2.js} +56 -56
- package/dist/{chunk-P4NWDRHS.js → chunk-WJTZE3PL.js} +11 -11
- package/dist/chunk-WW5AXVBX.js +2 -0
- package/dist/{chunk-2IEKMFVL.js → chunk-X4IFSC57.js} +1 -1
- package/dist/{chunk-UEADX2GV.js → chunk-X6AMAYXV.js} +2 -2
- package/dist/{chunk-JGZEZHMP.js → chunk-XBC7CBVJ.js} +1 -1
- package/dist/chunk-XFC7AWPW.js +11 -0
- package/dist/{chunk-TJ5ZX5HP.js → chunk-XKBCF6SK.js} +7 -7
- package/dist/chunk-XOQH6VSU.js +14 -0
- package/dist/chunk-XOXTMWV3.js +6 -0
- package/dist/{chunk-6EETON2U.js → chunk-XR7SPONC.js} +1 -1
- package/dist/{chunk-QV5A7NFQ.js → chunk-Y7XX6Z3M.js} +8 -8
- package/dist/chunk-YELYAGCX.js +13 -0
- package/dist/{chunk-QHWD3G7T.js → chunk-YG6ONZIB.js} +2 -2
- package/dist/{chunk-K6LO6QI5.js → chunk-ZFQI3EVU.js} +6 -6
- package/dist/chunk-ZGY2OK7Q.js +13 -0
- package/dist/{chunk-64ZDYUE7.js → chunk-ZHVWK5NL.js} +17 -17
- package/dist/{chunk-HRNT4UDG.js → chunk-ZP3UAWJL.js} +13 -13
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.d.ts +107 -0
- package/dist/data/Gantt.js +2 -0
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.d.ts +14 -2
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +665 -665
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +2 -2
- package/dist/model-viewer/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +22 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +35 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-XCRU5K4O.js +0 -29
- package/dist/PdfViewer-J55QKFNS.js +0 -1
- package/dist/Sidebar-FCXIPW5K.js +0 -44
- package/dist/chunk-4MCI7UHQ.js +0 -7
- package/dist/chunk-4YCWO2GZ.js +0 -14
- package/dist/chunk-67JLD6AU.js +0 -6
- package/dist/chunk-7DTWIWFO.js +0 -6
- package/dist/chunk-7IGWU6DK.js +0 -8
- package/dist/chunk-AJVL6LXI.js +0 -22
- package/dist/chunk-CHV7U5UV.js +0 -9
- package/dist/chunk-CXXMSYA6.js +0 -1
- package/dist/chunk-EWSOX4WP.js +0 -28
- package/dist/chunk-FEWWCWKV.js +0 -11
- package/dist/chunk-FPYOZOUY.js +0 -13
- package/dist/chunk-GCTJIZTJ.js +0 -2
- package/dist/chunk-GKX3C3JE.js +0 -13
- package/dist/chunk-HCDG7EUR.js +0 -1
- package/dist/chunk-KLG6RYYC.js +0 -6
- package/dist/chunk-KPFP2I2S.js +0 -8
- package/dist/chunk-LHATGPIE.js +0 -19
- package/dist/chunk-MKPZIEQP.js +0 -23
- package/dist/chunk-MUSNAMWH.js +0 -1
- package/dist/chunk-PRWA4AAC.js +0 -11
- package/dist/chunk-QB7TIWHT.js +0 -9
- package/dist/chunk-RJG67VRP.js +0 -15
- package/dist/chunk-RVD6HJUJ.js +0 -4
- package/dist/chunk-TN3W72FC.js +0 -8
- package/dist/chunk-UK2D2CSB.js +0 -14
- package/dist/chunk-VLI2ED22.js +0 -7
- package/dist/chunk-VY5NO4TS.js +0 -2
- package/dist/chunk-XJTZU7UH.js +0 -4
- package/dist/chunk-YS3CF7GL.js +0 -2
- /package/dist/{chunk-GMHMWDXU.js → chunk-KH3253OM.js} +0 -0
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
import{openPreviewFile as e}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
return
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
return
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
return H(z,{name:n,tone:a,look:"folder"===e.kind?"solid":void 0,className:`${t} shrink-0`})}function De({entry:e,read:t}){const[n,a]=U(null),r="image"===_(e)&&e.size<=5242880;return V(()=>{if(!r||!t||"function"!=typeof URL.createObjectURL)return;let n=!0,i=null;return t(e.id).then(e=>{n&&(i=URL.createObjectURL(e),a(i))}).catch(()=>{}),()=>{n=!1,i&&URL.revokeObjectURL(i)}},[e.id,e.modifiedAt,r,t]),n?/* @__PURE__ */H("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */H(je,{entry:e,className:"h-10 w-10"})}function Me(){const n=w(),r=n.title??"Files",F=null!==m(),Z=!F&&!!n.shares&&!!n.sharedWithMe,[_,me]=U(null),[Me,$e]=U(null),[Te,Le]=U([]),[Ae,Pe]=U(()=>/* @__PURE__ */new Set),Ee=G(null),[Fe,Re]=U(!0),[We,ze]=U(!1),[Oe,Ke]=U(null),[Ie,Ue]=U(!1),[Ge,Ve]=U(null),[Ye,Je]=U(null),[Xe,Be]=U(null),[He,Qe]=U(be),[Ze,qe]=U(!1),[_e,et]=U(""),[tt,nt]=U(""),[at,rt]=U({}),[it,st]=U({key:"name",dir:"asc"}),[lt,ot]=U(()=>{const e=y();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"}),ct=G("files"),dt=G(lt);dt.current=lt,V(()=>{v()},[]);const[mt,ht]=U([]),ut=e=>{Qe(e);try{localStorage.setItem(ge,e)}catch{}},ft=Y(e=>{ot(e),rt({}),st("recent"===e?{key:"modified",dir:"desc"}:{key:"name",dir:"asc"}),"search"!==e&&(et(""),nt(""))},[]);V(()=>{const e=()=>{v(),ft("trash")},t=e=>{v();const t=e.detail?.folderId;t&&ft({desktopFolderId:t})};return window.addEventListener(b,e),window.addEventListener(x,t),()=>{window.removeEventListener(b,e),window.removeEventListener(x,t)}},[ft]);const pt=J(N,C,C),gt="object"==typeof lt?lt.desktopFolderId:null,kt=gt?pt?.folders.find(e=>e.id===gt)??null:null,wt=gt&&pt?.itemsByFolder[gt]||[];V(()=>{gt&&pt&&!pt.folders.some(e=>e.id===gt)&&ft("files")},[gt,pt,ft]);const yt=G(0),vt=G(null),bt=G(null),{openPage:xt,openEntity:Nt}=L(),Ct=i(),St=i(),jt=i(),Dt=J(h,u,u);V(()=>f(),[]),V(()=>{!Dt||"trash"!==lt&&"object"!=typeof lt||ft("files")},[Dt,lt,ft]);const Mt=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>xt(e)}):"page"===t.entityType?xt(t.entityId):Nt(t.entityType,t.entityId,null,t.label)},$t=Y(async()=>{if(!F)try{Ke(await n.quota())}catch{}},[n,F]),Tt=Y(async(e,t)=>{Re(!0);try{await e(),ze(!1)}catch(e){e instanceof TypeError?ze(!0):I.error(Ce(e,t))}finally{Re(!1)}},[]),Lt=Y(async e=>{if(F)return $e(xe(e)),ze(!1),void Re(!1);await Tt(async()=>{$e(await n.list(e))},"Failed to list"),$t()},[n,$t,F,Tt]),At=Y(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=F?xe(_):await n.list(_).catch(()=>null);return Le((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void Re(!1)}const a={recent:()=>n.recent?.()??Promise.resolve([]),starred:()=>n.starred?.()??Promise.resolve([]),shared:()=>n.sharedWithMe?.()??Promise.resolve([]),search:()=>n.search?.(t)??Promise.resolve([])}[e];await Tt(async()=>{Le(await a())},"Failed to list files")},[n,F,_,Tt]),Pt=Y(async()=>{if(F)return ht([]),void Re(!1);await Tt(async()=>{ht(await n.trash())},"Failed to list trash"),$t()},[n,$t,F,Tt]),Et=()=>{"files"===lt?Lt(_):pe(lt)?At(lt,tt):"trash"===lt&&Pt()};V(()=>{Pe(/* @__PURE__ */new Set),Ee.current=null,Et()},[_,lt,tt]),V(()=>{const e=_e.trim();if(!e)return;const t=setTimeout(()=>{e===tt&&"search"===dt.current||("search"!==dt.current&&(ct.current=dt.current),ot("search"),rt({}),nt(e))},300);return()=>clearTimeout(t)},[_e]);const Ft=()=>{et(""),"search"===dt.current&&ft(ct.current)},Rt=e=>{ft("files"),me(e)},Wt=async(e,t)=>{try{await e()}catch(e){I.error(Ce(e,t))}Et()},zt=e=>Wt(async()=>{await n.restore(e.id),I.success(`Restored "${e.name}"`)},"Restore failed"),Ot=async e=>{await P({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Wt(()=>n.purge(e.id),"Delete failed")},Kt=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){I.error(Ce(e,"Download failed"))}},It="files"===lt?Me?.folder??null:null,Ut=It?.role??"owner",Gt="owner"!==Ut,Vt="files"===lt?_:null,Yt=!F&&("files"!==lt||"viewer"!==Ut),Jt=!F&&"files"===lt&&"viewer"!==Ut,Xt=async(e,{withFolders:t=!1}={})=>{let a=0;for(const r of Array.from(e)){const e=r.webkitRelativePath??"",i=t?e.split("/").slice(0,-1).join("/"):"";try{await n.upload(Vt,r,i?{folderPath:i}:void 0),a++}catch(e){e instanceof $?I.error(Ne(r.name,e)):I.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&I.success(`Uploaded ${a} files`),"files"===lt?Lt(_):Rt(null)},Bt=async e=>{const t=ne(e),a=await E({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?I.error("Names cannot contain slashes"):Wt(()=>n.rename(e.id,function(e,t){const n=e.officeKind?T[e.officeKind]:"";return n&&!t.toLowerCase().endsWith(n)?t+n:t}(e,a)),"Rename failed"))},Ht=async e=>{if(0===e.length)return;const t=1===e.length?e[0]:null,a=e.some(e=>"owner"!==(e.role??"owner")),r=t?(t.owner??Me?.folder.owner)?.name??"its owner":"their owners";await P({title:t?`Move ${t.kind} to trash`:`Move ${e.length} items to trash`,message:(t?`"${ne(t)}"${"folder"===t.kind?" and everything inside":""}`:`${e.length} items`)+" will move to "+(a?`${r}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Move to trash",variant:"danger"})&&(await Wt(async()=>{for(const t of e)await n.remove(t.id)},"Delete failed"),I.success(t?`"${ne(t)}" moved to trash`:`${e.length} items moved to trash`))},Qt=(e,t)=>Wt(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Zt=async(e,t)=>{Be(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Wt(async()=>{for(const e of a)await n.move(e.id,t)},"Move failed"),I.success(1===a.length?`Moved "${ne(a[0])}"`:`Moved ${a.length} items`))},qt=()=>{yt.current=0,Ue(!1),Ve(null)};V(()=>{const e=()=>qt();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]);const _t="files"===lt?Me?.entries??[]:pe(lt)?Te:[],en=X(()=>le(de(_t,at),it),[_t,at,it]),tn=X(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Ae].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?Ut:"owner"),sn=e=>!F&&"viewer"!==rn(e),ln=e=>Z&&"owner"===rn(e),on=e=>!!n.move&&sn(e),cn=(e,t)=>{if(Dt){const t=tn.get(e);if(t&&"file"===t.kind&&!mn(t))return;return void Pe(/* @__PURE__ */new Set([e]))}if(t.shiftKey&&Ee.current){const t=en.map(e=>e.id),n=t.indexOf(Ee.current),a=t.indexOf(e);if(n>=0&&a>=0)return void Pe(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Ee.current=e,t.metaKey||t.ctrlKey?Pe(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):Pe(/* @__PURE__ */new Set([e]))},dn=()=>{Pe(/* @__PURE__ */new Set),Ee.current=null},mn=e=>!!Dt&&"file"===e.kind&&g(Dt.request,e.name),hn=e=>Dt&&"file"===e.kind&&!mn(e)?"text-ink-faintest":"",un=e=>{if(!Dt||!mn(e))return;const t="files"===lt?Me?.folder:null,n=t?["owner"===t.role?"My files":"Shared with me",...t.path.filter(e=>null!==e.id).map(e=>e.name)].join(" › "):"shared"===lt?"Shared with me":"My files";p(Dt.id,{entry:e,folderId:"files"===lt?_:null,location:n})},fn=Dt&&an&&mn(an)?an:null,pn=t=>{"folder"===t.kind?Rt(t.id):Dt?un(t):(async t=>{if(F)return;if(n.open?.(t))return;const a=ke[q(t.name)];a?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:a,load:()=>n.read(t.id),onStaged:e=>xt(e)}):Kt(t)})(t)},gn=e=>{if(0===e.length)return[];const t=1===e.length?e[0]:null;if(Dt)return t&&("folder"===t.kind||mn(t))?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const a=t&&"file"===t.kind&&n.openLabel?.(t)||"Open",r=e.every(e=>"file"===e.kind),i=e.every(sn);if(F)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const s=e.some(e=>!e.starred);return Se([...t?[{key:"open",label:a,icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Kt)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */H(z,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Bt(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */H(z,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Wt(async()=>{for(const t of e)await n.copy(t.id);I.success(1===e.length?`Copied "${ne(e[0])}"`:`Copied ${e.length} files`)},"Copy failed"))(e)}]:[],{type:"divider",key:"d2"},...t&&ln(t)?[{key:"share",label:"Share",icon:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Je(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */H(z,{name:"forward",className:"h-4 w-4"}),onSelect:()=>Be(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */H(z,{name:"star",className:"h-4 w-4"}),onSelect:()=>Qt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */H(z,{name:"info",className:"h-4 w-4"}),onSelect:()=>{Pe(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Ht(e)}]:[]])},kn=(e,t)=>{const n=Ae.has(t.id)?nn:[t];Ct.open(e,n)&&!Ae.has(t.id)&&(Pe(/* @__PURE__ */new Set([t.id])),Ee.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Ae.has(e.id)?nn:[e];t.dataTransfer.setData(ye,JSON.stringify(n.map(e=>e.id))),t.dataTransfer.effectAllowed="move"}}:{},yn=e=>"folder"===e.kind&&sn(e)&&n.move?{onDragOver:t=>{t.dataTransfer.types.includes(ye)&&(t.preventDefault(),t.stopPropagation(),Ge!==e.id&&Ve(e.id))},onDragLeave:()=>{Ge===e.id&&Ve(null)},onDrop:t=>{if(!t.dataTransfer.types.includes(ye))return;t.preventDefault(),t.stopPropagation(),Ve(null);const n=JSON.parse(t.dataTransfer.getData(ye)||"[]").map(e=>tn.get(e)).filter(t=>!!t&&t.id!==e.id);Zt(n,e.id)}}:{};if(We)/* @__PURE__ */
|
|
36
|
-
return
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
return
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
return
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
return
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
return
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
1
|
+
import{openPreviewFile as e}from"./chunk-RLFZRIO4.js";import{SidebarLayout as t}from"./chunk-AGNHOSES.js";import"./chunk-QWK6DRSN.js";import"./chunk-X6AMAYXV.js";import{SearchableSelect as n}from"./chunk-YELYAGCX.js";import{Breadcrumbs as a}from"./chunk-LOMNX5VH.js";import{Select_default as r}from"./chunk-LUAA4LKY.js";import"./chunk-EO5RLFRX.js";import"./chunk-K5YT5PMJ.js";import"./chunk-2NMW66P5.js";import{useContextMenu as i,ContextMenu as s}from"./chunk-QMBMK6PP.js";import{Input_default as l}from"./chunk-PT4GMPUB.js";import{DropdownMenu as o}from"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import{IconButton_default as c}from"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{formatBytes as d}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as m,subscribeFilesChoice as h,getFilesChoice as u,holdFilesChoice as f,answerFilesChoice as p,choiceTakes as g}from"./chunk-4EFIUJ7X.js";import{AboutApp as k}from"./chunk-JIBU7YY4.js";import{getFilesStore as w,peekFilesViewRequest as y,consumeFilesViewRequest as v,FILES_SHOW_TRASH_EVENT as b,FILES_OPEN_DESKTOP_FOLDER_EVENT as x,subscribeDesktopFolders as N,getDesktopFoldersSnapshot as C,hasHostFilesStore as S,FolderGlyph as j,DesktopItemMiniIcon as D,desktopItemTypeLabel as M,FilesQuotaError as $,FILES_OFFICE_EXTENSIONS as L}from"./chunk-WBAWJIVM.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as T,WindowTitle as A}from"./chunk-VW3ZUWW2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-OL2XKAX2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-IBLRSK7V.js";import{confirm as R,prompt as F}from"./chunk-ZHVWK5NL.js";import{Dialog as E}from"./chunk-PPVZMIBL.js";import"./chunk-EIFNESXS.js";import{ItemCount as P}from"./chunk-QUN3RSMN.js";import"./chunk-RIG5FEVS.js";import"./chunk-25M4CAB3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-Q2T5DRIK.js";import"./chunk-UJ23EKXU.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-H7WMOY62.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as W}from"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as O}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as z}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as K}from"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as I}from"./chunk-KFNQVNND.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-L6XEON5Q.js";import"./chunk-C3QOHMR6.js";import{useState as U,useRef as Y,useEffect as V,useCallback as G,useSyncExternalStore as J,useMemo as B}from"react";import{jsxs as X,jsx as Q,Fragment as Z}from"react/jsx-runtime";var H={doc:"document",docx:"document",odt:"document",rtf:"document",txt:"document",md:"document",xls:"spreadsheet",xlsx:"spreadsheet",ods:"spreadsheet",csv:"spreadsheet",sheet:"spreadsheet",ppt:"slides",pptx:"slides",odp:"slides",key:"slides",slides:"slides",pdf:"pdf",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",heic:"image",tif:"image",tiff:"image",mp4:"video",mov:"video",webm:"video",avi:"video",mkv:"video",mp3:"audio",wav:"audio",m4a:"audio",ogg:"audio",flac:"audio",zip:"archive",rar:"archive","7z":"archive",gz:"archive",tar:"archive",dxf:"drawing",dwg:"drawing",stp:"drawing",step:"drawing",stl:"drawing",obj:"drawing",iges:"drawing",igs:"drawing","3mf":"drawing",glb:"drawing",gltf:"drawing"};function q(e){const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toLowerCase():""}function _(e){if("folder"===e.kind)return"folder";if("document"===e.officeKind)return"document";if("spreadsheet"===e.officeKind)return"spreadsheet";if("deck"===e.officeKind)return"slides";const t=e.contentType??"";return"application/pdf"===t?"pdf":t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":H[q(e.name)]??"other"}var ee={folder:"Folder",document:"Document",spreadsheet:"Spreadsheet",slides:"Slides",pdf:"PDF",image:"Image",video:"Video",audio:"Audio",archive:"Archive",drawing:"Drawing",other:"File"},te={folder:{name:"folder",tone:"muted"},document:{name:"document",tone:"accent"},spreadsheet:{name:"table",tone:"success"},slides:{name:"presentation-chart-bar",tone:"warning"},pdf:{name:"document",tone:"danger"},image:{name:"image",tone:"muted"},video:{name:"play",tone:"muted"},audio:{name:"speaker-wave",tone:"muted"},archive:{name:"archive-box",tone:"muted"},drawing:{name:"cube-transparent",tone:"muted"},other:{name:"page",tone:"muted"}};function ne(e){const t=e.officeKind?L[e.officeKind]:"";return t&&e.name.toLowerCase().endsWith(t)&&e.name.length>t.length?e.name.slice(0,-t.length):e.name}function ae(e){return"folder"===e.kind||e.officeKind&&e.size<=2?"—":d(e.size)}function re(e,t=/* @__PURE__ */new Date){if(!e)return"—";const n=new Date(e);return isNaN(n.getTime())?"—":n.toDateString()===t.toDateString()?n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):n.getFullYear()===t.getFullYear()?n.toLocaleDateString(void 0,{day:"numeric",month:"short"}):n.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function ie(e){return"owner"===(e.role??"owner")?"me":e.owner?.name??"—"}var se=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function le(e,t){const n="asc"===t.dir?1:-1;return[...e].sort((e,a)=>e.kind!==a.kind?"folder"===e.kind?-1:1:n*((e,n)=>{switch(t.key){case"owner":return se.compare(ie(e),ie(n));case"size":return e.size-n.size;case"modified":return(Date.parse(e.modifiedAt)||0)-(Date.parse(n.modifiedAt)||0);default:return se.compare(ne(e),ne(n))}})(e,a)||se.compare(e.name,a.name))}var oe=["folder","document","spreadsheet","slides","pdf","image","video"],ce={today:"Today",week:"Last 7 days",month:"Last 30 days",year:"This year"};function de(e,t,n=/* @__PURE__ */new Date){const a=t.modified?function(e,t){const n=new Date(t);return n.setHours(0,0,0,0),"week"===e&&n.setDate(n.getDate()-6),"month"===e&&n.setDate(n.getDate()-29),"year"===e&&n.setMonth(0,1),n.getTime()}(t.modified,n):null;return e.filter(e=>{if(t.type&&_(e)!==t.type)return!1;if(t.person){const n="owner"===(e.role??"owner");if("me"===t.person?!n:n||e.owner?.id!==t.person)return!1}return null===a||(Date.parse(e.modifiedAt)||0)>=a})}var me=[{value:"viewer",label:"Viewer"},{value:"editor",label:"Editor"}];function he({store:e,entry:t,onClose:a,onChanged:i}){const[s,l]=U(null),[o,d]=U(""),[m,h]=U([]),[u,f]=U(!1),[p,g]=U(""),[k,w]=U("viewer"),[y,v]=U(!1),b=Y(/* @__PURE__ */new Map),x=t?.id??null;if(V(()=>{if(l(null),g(""),d(""),!x||!e.shares)return;let t=!0;return e.shares(x).then(e=>{t&&l(e)}).catch(e=>{t&&(I.error(e.message),l([]))}),()=>{t=!1}},[x,e]),V(()=>{if(!e.searchPeople||!x)return;let t=!0;f(!0);const n=setTimeout(()=>{e.searchPeople(o).then(e=>{if(t){for(const t of e)b.current.set(t.id,t);h(e)}}).catch(()=>{t&&h([])}).finally(()=>{t&&f(!1)})},250);return()=>{t=!1,clearTimeout(n)}},[o,x,e]),!t)return null;const N=new Set((s??[]).map(e=>e.person.id)),C=m.filter(e=>!N.has(e.id)).map(e=>({value:e.id,label:e.name})),S=async n=>{v(!0);try{await n(),l(await e.shares(t.id)),i()}catch(e){I.error(e.message)}finally{v(!1)}};/* @__PURE__ */
|
|
2
|
+
return X(E,{open:!0,onClose:a,size:"md",title:`Share “${t.name}”`,description:"folder"===t.kind?"Everything inside this folder is shared too. Editors’ uploads count toward your quota.":"Viewers can open and download it. Editors can also replace, rename and delete it.",footer:/* @__PURE__ */Q(W,{variant:"secondary",onClick:a,children:"Done"}),children:[
|
|
3
|
+
/* @__PURE__ */X("div",{className:"flex items-center gap-2",children:[
|
|
4
|
+
/* @__PURE__ */Q("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */Q(n,{value:p,onChange:g,onSearchChange:d,loading:u&&0===m.length,options:C,placeholder:"Search colleagues by name","aria-label":"Colleague to share with"})}),
|
|
5
|
+
/* @__PURE__ */Q("div",{className:"w-28 shrink-0",children:/* @__PURE__ */Q(r,{value:k,onChange:e=>w(e),options:me,"aria-label":"Access"})}),
|
|
6
|
+
/* @__PURE__ */Q(W,{variant:"primary",onClick:()=>{if(!p||!e.share)return;const n=b.current.get(p);S(async()=>{await e.share(t.id,p,k),g(""),d(""),n&&I.success(`Shared with ${n.name}`)})},disabled:!p||y,children:"Add"})]}),
|
|
7
|
+
/* @__PURE__ */Q("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */Q(z,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */X("ul",{className:"divide-y divide-line-subtle text-sm",children:[
|
|
8
|
+
/* @__PURE__ */X("li",{className:"flex items-center gap-2 h-10",children:[
|
|
9
|
+
/* @__PURE__ */Q("span",{className:"flex-1 truncate",children:"You"}),
|
|
10
|
+
/* @__PURE__ */Q("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */X("li",{className:"flex items-center gap-2 h-10",children:[
|
|
11
|
+
/* @__PURE__ */Q("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
|
|
12
|
+
/* @__PURE__ */Q("div",{className:"w-28 shrink-0",children:/* @__PURE__ */Q(r,{value:n.role,onChange:a=>S(()=>e.share(t.id,n.person.id,a)),options:me,"aria-label":`Access for ${n.person.name}`,disabled:y})}),
|
|
13
|
+
/* @__PURE__ */Q(c,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:y,onClick:()=>S(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4",strokeWidth:1.8})})]},n.person.id))]})]})}function ue({store:e,items:t,from:n,onClose:a,onMove:r}){const[i,s]=U(n??null),[l,o]=U(null),[d,m]=U(!1);V(()=>{t&&s(n??null)},[t,n]),V(()=>{if(!t)return;let n=!0;return m(!0),e.list(i).then(e=>{n&&o(e)}).catch(()=>{n&&o(null)}).finally(()=>{n&&m(!1)}),()=>{n=!1}},[e,i,t]);const h=new Set((t??[]).map(e=>e.id)),u=(l?.entries??[]).filter(e=>"folder"===e.kind&&!h.has(e.id)),f=(l?.folder.path??[]).filter(e=>null!==e.id),p=f.length>1?f[f.length-2].id:null,g=l?.folder,k="viewer"!==(g?.role??"owner"),w=void 0!==n&&i===n,y=t?.length??0,v=1===y?`"${t[0].name}"`:`${y} items`;/* @__PURE__ */
|
|
14
|
+
return X(E,{open:!!t,onClose:a,title:`Move ${v}`,size:"sm",footer:/* @__PURE__ */X(Z,{children:[
|
|
15
|
+
/* @__PURE__ */Q(W,{variant:"secondary",onClick:a,children:"Cancel"}),
|
|
16
|
+
/* @__PURE__ */Q(W,{variant:"primary",onClick:()=>r(i),disabled:d||!k||w,children:"Move here"})]}),children:[
|
|
17
|
+
/* @__PURE__ */X("div",{className:"flex items-center gap-1 mb-2 min-h-8",children:[null!==i&&/* @__PURE__ */Q(c,{"aria-label":"Back",size:"sm",onClick:()=>s(p),children:/* @__PURE__ */Q(O,{name:"arrow-left",className:"h-4 w-4"})}),
|
|
18
|
+
/* @__PURE__ */Q("span",{className:"text-sm font-medium text-ink-strong truncate",children:null===i?"My files":g?.name??""})]}),
|
|
19
|
+
/* @__PURE__ */Q("div",{className:"border border-line rounded-(--radius-control) h-64 overflow-auto",children:d?/* @__PURE__ */Q(z,{size:"sm",padding:"p-6",label:"Loading"}):0===u.length?/* @__PURE__ */Q("div",{className:"p-6 text-center text-sm text-ink-faintest",children:"No folders here."}):/* @__PURE__ */Q("ul",{children:u.map(e=>/* @__PURE__ */Q("li",{children:/* @__PURE__ */X("button",{type:"button",onClick:()=>s(e.id),className:"flex w-full items-center gap-2 px-3 h-9 text-left text-sm hover:bg-row-hover",children:[
|
|
20
|
+
/* @__PURE__ */Q(O,{name:"folder",look:"solid",tone:"muted",className:"h-4 w-4 shrink-0"}),
|
|
21
|
+
/* @__PURE__ */Q("span",{className:"truncate flex-1",children:e.name}),
|
|
22
|
+
/* @__PURE__ */Q(O,{name:"chevron-right",tone:"muted",className:"h-4 w-4 shrink-0"})]})},e.id))})}),!k&&/* @__PURE__ */Q("p",{className:"mt-2 text-xs text-ink-faint",children:"You can view this folder but not move things into it."})]})}function fe({store:e,entry:t,selectedCount:n,onClose:a}){const[r,i]=U(null),[s,l]=U(null);V(()=>{if(i(null),l(null),!t)return;let n=!0;return e.info?.(t.id).then(e=>{n&&i(e)}).catch(()=>{}),e.shares?.(t.id).then(e=>{n&&l(e)}).catch(()=>{}),()=>{n=!1}},[e,t]);const o=t?_(t):null,d=o?te[o]:null,m=r?.path.slice(0,-1).map(e=>e.name||"My files").join(" / "),h=(e,t)=>t?/* @__PURE__ */X("div",{className:"py-2",children:[
|
|
23
|
+
/* @__PURE__ */Q("dt",{className:"text-2xs text-ink-faint",children:e}),
|
|
24
|
+
/* @__PURE__ */Q("dd",{className:"text-sm text-ink break-words",children:t})]}):null;/* @__PURE__ */
|
|
25
|
+
return X("aside",{className:"w-72 shrink-0 border-l border-line flex flex-col min-h-0 bg-surface","aria-label":"Details",children:[
|
|
26
|
+
/* @__PURE__ */X("div",{className:"flex items-center gap-2 px-3 h-12 shrink-0",children:[d&&/* @__PURE__ */Q(O,{name:d.name,tone:d.tone,className:"h-5 w-5 shrink-0"}),
|
|
27
|
+
/* @__PURE__ */Q("span",{className:"flex-1 truncate text-sm font-medium text-ink-strong",children:t?ne(t):n>1?`${n} items selected`:"Details"}),
|
|
28
|
+
/* @__PURE__ */Q(c,{"aria-label":"Close details",size:"sm",onClick:a,children:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4"})})]}),
|
|
29
|
+
/* @__PURE__ */Q("div",{className:"flex-1 overflow-auto px-4 pb-4",children:t?/* @__PURE__ */X(Z,{children:[
|
|
30
|
+
/* @__PURE__ */Q("div",{className:"h-32 rounded-(--radius-control) bg-surface-sunken flex items-center justify-center mb-3",children:d&&/* @__PURE__ */Q(O,{name:d.name,tone:d.tone,className:"h-12 w-12"})}),s&&/* @__PURE__ */X("div",{className:"mb-3",children:[
|
|
31
|
+
/* @__PURE__ */Q("div",{className:"text-xs font-medium text-ink-strong mb-1",children:"Who has access"}),0===s.length?/* @__PURE__ */X("p",{className:"text-sm text-ink-faint",children:["Only ","owner"!==t.role&&t.role?t.owner?.name??"its owner":"you"]}):/* @__PURE__ */Q("ul",{className:"text-sm text-ink",children:s.map(e=>/* @__PURE__ */X("li",{className:"flex justify-between py-0.5",children:[
|
|
32
|
+
/* @__PURE__ */Q("span",{className:"truncate",children:e.person.name}),
|
|
33
|
+
/* @__PURE__ */Q("span",{className:"text-ink-faint text-xs",children:"editor"===e.role?"Editor":"Viewer"})]},e.person.id))})]}),
|
|
34
|
+
/* @__PURE__ */X("dl",{className:"border-t border-line pt-2",children:[h("Type",o?ee[o]:null),"file"===t.kind&&h("Size",ae(t)),h("Location",m),h("Owner","me"===ie(t)?"me":ie(t)),h("Modified",t.modifiedAt?`${re(t.modifiedAt)}${t.modifiedBy?` by ${t.modifiedBy.name}`:""}`:null),h("Created",r?.createdAt?re(r.createdAt):null)]})]}):/* @__PURE__ */Q("p",{className:"pt-6 text-center text-sm text-ink-faintest",children:n>1?"Select one item to see its details.":"Select a file or folder to see its details."})})]})}var pe=e=>"recent"===e||"starred"===e||"shared"===e||"search"===e,ge="files.layout",ke={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"},we=[{kind:"document",label:"Document"},{kind:"spreadsheet",label:"Spreadsheet"},{kind:"deck",label:"Slides"}],ye="application/x-efficient-files";function ve(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function be(){try{return"grid"===localStorage.getItem(ge)?"grid":"list"}catch{return"list"}}function xe(e){const t=e??"/",n=t.split("/").filter(Boolean);let a=m()??[];for(const e of n){const t=a.find(t=>"folder"===t.kind&&t.name===e);a=t?.children??[]}return{folder:{id:e,name:n[n.length-1]??"",role:"owner",path:[{id:null,name:""},...n.map((e,t)=>({id:"/"+n.slice(0,t+1).join("/"),name:e}))]},entries:a.map(e=>({id:("/"===t?"":t)+"/"+e.name,name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}}function Ne(e,t){return`Not enough space for “${e}” (${d(t.attempted)}). You've used ${d(t.used)} of ${d(t.limit)}. Empty Trash or ask an administrator for more space.`}var Ce=(e,t)=>e instanceof Error&&e.message||t;function Se(e){const t=[];for(const n of e)("divider"!==n.type||0!==t.length&&"divider"!==t[t.length-1].type)&&t.push(n);for(;t.length&&"divider"===t[t.length-1].type;)t.pop();return t}function je({entry:e,className:t="h-5 w-5"}){const{name:n,tone:a}=te[_(e)];/* @__PURE__ */
|
|
35
|
+
return Q(O,{name:n,tone:a,look:"folder"===e.kind?"solid":void 0,className:`${t} shrink-0`})}function De({entry:e,read:t}){const[n,a]=U(null),r="image"===_(e)&&e.size<=5242880;return V(()=>{if(!r||!t||"function"!=typeof URL.createObjectURL)return;let n=!0,i=null;return t(e.id).then(e=>{n&&(i=URL.createObjectURL(e),a(i))}).catch(()=>{}),()=>{n=!1,i&&URL.revokeObjectURL(i)}},[e.id,e.modifiedAt,r,t]),n?/* @__PURE__ */Q("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */Q(je,{entry:e,className:"h-10 w-10"})}function Me(){const n=w(),r=n.title??"Files",E=null!==m(),H=!E&&!!n.shares&&!!n.sharedWithMe,[_,me]=U(null),[Me,$e]=U(null),[Le,Te]=U([]),[Ae,Re]=U(()=>/* @__PURE__ */new Set),Fe=Y(null),[Ee,Pe]=U(!0),[We,Oe]=U(!1),[ze,Ke]=U(null),[Ie,Ue]=U(!1),[Ye,Ve]=U(null),[Ge,Je]=U(null),[Be,Xe]=U(null),[Qe,Ze]=U(be),[He,qe]=U(!1),[_e,et]=U(""),[tt,nt]=U(""),[at,rt]=U({}),[it,st]=U({key:"name",dir:"asc"}),[lt,ot]=U(()=>{const e=y();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"}),ct=Y("files"),dt=Y(lt);dt.current=lt,V(()=>{v()},[]);const[mt,ht]=U([]),ut=e=>{Ze(e);try{localStorage.setItem(ge,e)}catch{}},ft=G(e=>{ot(e),rt({}),st("recent"===e?{key:"modified",dir:"desc"}:{key:"name",dir:"asc"}),"search"!==e&&(et(""),nt(""))},[]);V(()=>{const e=()=>{v(),ft("trash")},t=e=>{v();const t=e.detail?.folderId;t&&ft({desktopFolderId:t})};return window.addEventListener(b,e),window.addEventListener(x,t),()=>{window.removeEventListener(b,e),window.removeEventListener(x,t)}},[ft]);const pt=J(N,C,C),gt="object"==typeof lt?lt.desktopFolderId:null,kt=gt?pt?.folders.find(e=>e.id===gt)??null:null,wt=gt&&pt?.itemsByFolder[gt]||[];V(()=>{gt&&pt&&!pt.folders.some(e=>e.id===gt)&&ft("files")},[gt,pt,ft]);const yt=Y(0),vt=Y(null),bt=Y(null),{openPage:xt,openEntity:Nt}=T(),Ct=i(),St=i(),jt=i(),Dt=J(h,u,u);V(()=>f(),[]),V(()=>{!Dt||"trash"!==lt&&"object"!=typeof lt||ft("files")},[Dt,lt,ft]);const Mt=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>xt(e)}):"page"===t.entityType?xt(t.entityId):Nt(t.entityType,t.entityId,null,t.label)},$t=G(async()=>{if(!E)try{Ke(await n.quota())}catch{}},[n,E]),Lt=G(async(e,t)=>{Pe(!0);try{await e(),Oe(!1)}catch(e){e instanceof TypeError?Oe(!0):I.error(Ce(e,t))}finally{Pe(!1)}},[]),Tt=G(async e=>{if(E)return $e(xe(e)),Oe(!1),void Pe(!1);await Lt(async()=>{$e(await n.list(e))},"Failed to list"),$t()},[n,$t,E,Lt]),At=G(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=E?xe(_):await n.list(_).catch(()=>null);return Te((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void Pe(!1)}const a={recent:()=>n.recent?.()??Promise.resolve([]),starred:()=>n.starred?.()??Promise.resolve([]),shared:()=>n.sharedWithMe?.()??Promise.resolve([]),search:()=>n.search?.(t)??Promise.resolve([])}[e];await Lt(async()=>{Te(await a())},"Failed to list files")},[n,E,_,Lt]),Rt=G(async()=>{if(E)return ht([]),void Pe(!1);await Lt(async()=>{ht(await n.trash())},"Failed to list trash"),$t()},[n,$t,E,Lt]),Ft=()=>{"files"===lt?Tt(_):pe(lt)?At(lt,tt):"trash"===lt&&Rt()};V(()=>{Re(/* @__PURE__ */new Set),Fe.current=null,Ft()},[_,lt,tt]),V(()=>{const e=_e.trim();if(!e)return;const t=setTimeout(()=>{e===tt&&"search"===dt.current||("search"!==dt.current&&(ct.current=dt.current),ot("search"),rt({}),nt(e))},300);return()=>clearTimeout(t)},[_e]);const Et=()=>{et(""),"search"===dt.current&&ft(ct.current)},Pt=e=>{ft("files"),me(e)},Wt=async(e,t)=>{try{await e()}catch(e){I.error(Ce(e,t))}Ft()},Ot=e=>Wt(async()=>{await n.restore(e.id),I.success(`Restored "${e.name}"`)},"Restore failed"),zt=async e=>{await R({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Wt(()=>n.purge(e.id),"Delete failed")},Kt=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){I.error(Ce(e,"Download failed"))}},It="files"===lt?Me?.folder??null:null,Ut=It?.role??"owner",Yt="owner"!==Ut,Vt="files"===lt?_:null,Gt=!E&&("files"!==lt||"viewer"!==Ut),Jt=!E&&"files"===lt&&"viewer"!==Ut,Bt=async(e,{withFolders:t=!1}={})=>{let a=0;for(const r of Array.from(e)){const e=r.webkitRelativePath??"",i=t?e.split("/").slice(0,-1).join("/"):"";try{await n.upload(Vt,r,i?{folderPath:i}:void 0),a++}catch(e){e instanceof $?I.error(Ne(r.name,e)):I.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&I.success(`Uploaded ${a} files`),"files"===lt?Tt(_):Pt(null)},Xt=async e=>{const t=ne(e),a=await F({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?I.error("Names cannot contain slashes"):Wt(()=>n.rename(e.id,function(e,t){const n=e.officeKind?L[e.officeKind]:"";return n&&!t.toLowerCase().endsWith(n)?t+n:t}(e,a)),"Rename failed"))},Qt=async e=>{if(0===e.length)return;const t=1===e.length?e[0]:null,a=e.some(e=>"owner"!==(e.role??"owner")),r=t?(t.owner??Me?.folder.owner)?.name??"its owner":"their owners";await R({title:t?`Move ${t.kind} to trash`:`Move ${e.length} items to trash`,message:(t?`"${ne(t)}"${"folder"===t.kind?" and everything inside":""}`:`${e.length} items`)+" will move to "+(a?`${r}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Move to trash",variant:"danger"})&&(await Wt(async()=>{for(const t of e)await n.remove(t.id)},"Delete failed"),I.success(t?`"${ne(t)}" moved to trash`:`${e.length} items moved to trash`))},Zt=(e,t)=>Wt(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Ht=async(e,t)=>{Xe(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Wt(async()=>{for(const e of a)await n.move(e.id,t)},"Move failed"),I.success(1===a.length?`Moved "${ne(a[0])}"`:`Moved ${a.length} items`))},qt=()=>{yt.current=0,Ue(!1),Ve(null)};V(()=>{const e=()=>qt();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]);const _t="files"===lt?Me?.entries??[]:pe(lt)?Le:[],en=B(()=>le(de(_t,at),it),[_t,at,it]),tn=B(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Ae].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?Ut:"owner"),sn=e=>!E&&"viewer"!==rn(e),ln=e=>H&&"owner"===rn(e),on=e=>!!n.move&&sn(e),cn=(e,t)=>{if(Dt){const t=tn.get(e);if(t&&"file"===t.kind&&!mn(t))return;return void Re(/* @__PURE__ */new Set([e]))}if(t.shiftKey&&Fe.current){const t=en.map(e=>e.id),n=t.indexOf(Fe.current),a=t.indexOf(e);if(n>=0&&a>=0)return void Re(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Fe.current=e,t.metaKey||t.ctrlKey?Re(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):Re(/* @__PURE__ */new Set([e]))},dn=()=>{Re(/* @__PURE__ */new Set),Fe.current=null},mn=e=>!!Dt&&"file"===e.kind&&g(Dt.request,e.name),hn=e=>Dt&&"file"===e.kind&&!mn(e)?"text-ink-faintest":"",un=e=>{if(!Dt||!mn(e))return;const t="files"===lt?Me?.folder:null,n=t?["owner"===t.role?"My files":"Shared with me",...t.path.filter(e=>null!==e.id).map(e=>e.name)].join(" › "):"shared"===lt?"Shared with me":"My files";p(Dt.id,{entry:e,folderId:"files"===lt?_:null,location:n})},fn=Dt&&an&&mn(an)?an:null,pn=t=>{"folder"===t.kind?Pt(t.id):Dt?un(t):(async t=>{if(E)return;if(n.open?.(t))return;const a=ke[q(t.name)];a?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:a,load:()=>n.read(t.id),onStaged:e=>xt(e)}):Kt(t)})(t)},gn=e=>{if(0===e.length)return[];const t=1===e.length?e[0]:null;if(Dt)return t&&("folder"===t.kind||mn(t))?[{key:"open",label:"Open",icon:/* @__PURE__ */Q(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const a=t&&"file"===t.kind&&n.openLabel?.(t)||"Open",r=e.every(e=>"file"===e.kind),i=e.every(sn);if(E)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */Q(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const s=e.some(e=>!e.starred);return Se([...t?[{key:"open",label:a,icon:/* @__PURE__ */Q(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */Q(O,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Kt)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */Q(O,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Xt(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */Q(O,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Wt(async()=>{for(const t of e)await n.copy(t.id);I.success(1===e.length?`Copied "${ne(e[0])}"`:`Copied ${e.length} files`)},"Copy failed"))(e)}]:[],{type:"divider",key:"d2"},...t&&ln(t)?[{key:"share",label:"Share",icon:/* @__PURE__ */Q(O,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Je(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */Q(O,{name:"forward",className:"h-4 w-4"}),onSelect:()=>Xe(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */Q(O,{name:"star",className:"h-4 w-4"}),onSelect:()=>Zt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */Q(O,{name:"info",className:"h-4 w-4"}),onSelect:()=>{Re(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */Q(O,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Qt(e)}]:[]])},kn=(e,t)=>{const n=Ae.has(t.id)?nn:[t];Ct.open(e,n)&&!Ae.has(t.id)&&(Re(/* @__PURE__ */new Set([t.id])),Fe.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Ae.has(e.id)?nn:[e];t.dataTransfer.setData(ye,JSON.stringify(n.map(e=>e.id))),t.dataTransfer.effectAllowed="move"}}:{},yn=e=>"folder"===e.kind&&sn(e)&&n.move?{onDragOver:t=>{t.dataTransfer.types.includes(ye)&&(t.preventDefault(),t.stopPropagation(),Ye!==e.id&&Ve(e.id))},onDragLeave:()=>{Ye===e.id&&Ve(null)},onDrop:t=>{if(!t.dataTransfer.types.includes(ye))return;t.preventDefault(),t.stopPropagation(),Ve(null);const n=JSON.parse(t.dataTransfer.getData(ye)||"[]").map(e=>tn.get(e)).filter(t=>!!t&&t.id!==e.id);Ht(n,e.id)}}:{};if(We)/* @__PURE__ */
|
|
36
|
+
return X("div",{className:"flex flex-col h-full bg-surface",children:[
|
|
37
|
+
/* @__PURE__ */Q(A,{title:`${r} - offline`}),
|
|
38
|
+
/* @__PURE__ */Q("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */X("div",{className:"max-w-md",children:[
|
|
39
|
+
/* @__PURE__ */Q(O,{name:"close-circle",tone:"muted",className:"h-12 w-12 mx-auto mb-3",strokeWidth:1.4}),S()?/* @__PURE__ */X(Z,{children:[
|
|
40
|
+
/* @__PURE__ */Q("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
|
|
41
|
+
/* @__PURE__ */Q("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */X(Z,{children:[
|
|
42
|
+
/* @__PURE__ */Q("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
|
|
43
|
+
/* @__PURE__ */X("p",{className:"text-sm text-ink-faint mb-3",children:["No response from the file server. Make sure the server is running — see ",
|
|
44
|
+
/* @__PURE__ */Q("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
|
|
45
|
+
/* @__PURE__ */Q(W,{variant:"primary",onClick:Ft,children:"Retry"})]})})]});const vn=ze&&ze.limit>0?Math.min(100,Math.round(ze.used/ze.limit*100)):0,bn=vn>90?"bg-danger":vn>75?"bg-warning":"bg-accent-fill",xn=[Yt?{label:"Shared with me",onClick:()=>ft("shared")}:{label:"My files",onClick:()=>Pt(null)},...(It?.path??[]).filter(e=>null!==e.id).map(e=>({label:e.name,onClick:()=>Pt(e.id)}))],Nn="recent"===lt?"Recent":"starred"===lt?"Starred":"shared"===lt?"Shared with me":"search"===lt?`Results for “${tt}”`:"trash"===lt?"Trash":kt?kt.name:null,Cn=Dt?`${r} - Choosing`:Nn?`${r} - ${"search"===lt?"Search":Nn}`:It&&null!==It.id?`${r} - ${It.name}`:r,Sn=e=>"flex w-full items-center gap-3 rounded-full px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-accent-tint font-medium text-accent-text":"text-ink hover:bg-row-hover"),jn=Se([{key:"folder",label:"New folder",icon:/* @__PURE__ */Q(O,{name:"folder-plus",className:"h-4 w-4"}),onSelect:async()=>{const e=await F({title:"New folder",placeholder:"Folder name",defaultValue:"Untitled folder",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?I.error("Folder names cannot contain slashes"):(await Wt(()=>n.createFolder(Vt,e),"Create folder failed"),"files"!==lt&&Pt(null)))}},{type:"divider",key:"d1"},{key:"upload",label:"File upload",icon:/* @__PURE__ */Q(O,{name:"upload",className:"h-4 w-4"}),onSelect:()=>vt.current?.click()},...n.folderUpload?[{key:"upload-folder",label:"Folder upload",icon:/* @__PURE__ */Q(O,{name:"cloud-arrow-up",className:"h-4 w-4"}),onSelect:()=>bt.current?.click()}]:[],{type:"divider",key:"d2"},...n.createOfficeFile?we.filter(e=>!n.officeKinds||n.officeKinds.includes(e.kind)).map(e=>{const t=te["deck"===e.kind?"slides":e.kind];return{key:e.kind,label:e.label,icon:/* @__PURE__ */Q(O,{name:t.name,tone:t.tone,className:"h-4 w-4"}),onSelect:()=>{Promise.resolve(n.createOfficeFile(e.kind,Vt)).catch(e=>I.error(Ce(e,"Could not create it")))}}}):[]]),Dn=/* @__PURE__ */X("div",{className:"flex h-full flex-col",children:[
|
|
46
|
+
/* @__PURE__ */Q("div",{className:"p-3 pb-2",children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */X(Z,{children:[
|
|
47
|
+
/* @__PURE__ */Q(O,{name:"add",className:"h-5 w-5"}),
|
|
48
|
+
/* @__PURE__ */Q("span",{children:"New"})]}),items:jn,align:"start","aria-label":"New",disabled:!Gt,triggerClassName:"inline-flex items-center gap-2 h-11 pl-4 pr-5 rounded-2xl bg-surface-raised border border-line shadow-sm text-sm font-medium text-ink-strong hover:bg-row-hover disabled:opacity-50 rosh-focus-ring focus-visible:ring-2"})}),
|
|
49
|
+
/* @__PURE__ */X("nav",{className:"px-2 flex-1 overflow-auto","aria-label":"Locations",children:[
|
|
50
|
+
/* @__PURE__ */X("button",{onClick:()=>Pt(null),className:Sn("files"===lt&&!Yt),children:[
|
|
51
|
+
/* @__PURE__ */Q(O,{name:"home",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"My files"]}),n.recent&&!E&&/* @__PURE__ */X("button",{onClick:()=>ft("recent"),className:Sn("recent"===lt),children:[
|
|
52
|
+
/* @__PURE__ */Q(O,{name:"clock",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Recent"]}),n.starred&&!E&&/* @__PURE__ */X("button",{onClick:()=>ft("starred"),className:Sn("starred"===lt),children:[
|
|
53
|
+
/* @__PURE__ */Q(O,{name:"star",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Starred"]}),H&&/* @__PURE__ */X("button",{onClick:()=>ft("shared"),className:Sn("shared"===lt||"files"===lt&&Yt),children:[
|
|
54
|
+
/* @__PURE__ */Q(O,{name:"team",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Shared with me"]}),!E&&/* @__PURE__ */X("button",{onClick:()=>ft("trash"),className:Sn("trash"===lt),children:[
|
|
55
|
+
/* @__PURE__ */Q(O,{name:"trash",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Trash"]}),pt&&pt.folders.length>0&&/* @__PURE__ */X(Z,{children:[
|
|
56
|
+
/* @__PURE__ */Q("div",{className:"px-3 pt-4 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),pt.folders.map(e=>/* @__PURE__ */X("button",{onClick:()=>ft({desktopFolderId:e.id}),className:Sn(gt===e.id),children:[
|
|
57
|
+
/* @__PURE__ */Q(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
58
|
+
/* @__PURE__ */Q("span",{className:"truncate",children:e.name}),
|
|
59
|
+
/* @__PURE__ */Q(P,{count:e.itemCount,active:gt===e.id,className:"ml-auto"})]},e.id))]})]}),ze&&/* @__PURE__ */X("div",{className:"px-5 py-3 shrink-0",title:`${d(ze.used)} of ${d(ze.limit)} used`,children:[
|
|
60
|
+
/* @__PURE__ */Q("div",{className:"h-1 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */Q("div",{className:`h-full ${bn} transition-all`,style:{width:`${vn}%`}})}),
|
|
61
|
+
/* @__PURE__ */X("div",{className:"mt-2 text-2xs text-ink-faint tabular-nums",children:[d(ze.used)," of ",d(ze.limit)," used"]})]})]}),Mn=(e,t)=>/* @__PURE__ */X("span",{className:"inline-flex items-center gap-1",children:[e,
|
|
62
|
+
/* @__PURE__ */Q(O,{name:"chevron-down",className:"h-3.5 w-3.5"}),t?"":null]}),$n=e=>"inline-flex items-center h-7 px-3 rounded-(--radius-control) border text-xs whitespace-nowrap rosh-focus-ring focus-visible:ring-2 "+(e?"border-accent-border bg-accent-tint text-accent-text":"border-line-strong text-ink-muted hover:bg-row-hover"),Ln=pe(lt)||"files"===lt,Tn=function(e){const t=/* @__PURE__ */new Map;for(const n of e)"owner"!==(n.role??"owner")&&n.owner&&t.set(n.owner.id,n.owner.name);return[...t].map(([e,t])=>({id:e,name:t})).sort((e,t)=>se.compare(e.name,t.name))}(_t),An=Ln&&_t.length>0?/* @__PURE__ */X("div",{className:"flex items-center gap-2 shrink-0",children:[
|
|
63
|
+
/* @__PURE__ */Q(o,{trigger:Mn(at.type?ee[at.type]:"Type",!!at.type),"aria-label":"Type",triggerClassName:$n(!!at.type),items:[...oe.map(e=>({type:"radio",key:e,label:ee[e],checked:at.type===e,onSelect:()=>rt(t=>({...t,type:t.type===e?null:e}))})),...at.type?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,type:null}))}]:[]]}),H&&/* @__PURE__ */Q(o,{trigger:Mn(at.person?"me"===at.person?"Owned by me":Tn.find(e=>e.id===at.person)?.name??"People":"People",!!at.person),"aria-label":"People",triggerClassName:$n(!!at.person),items:[{type:"radio",key:"me",label:"Owned by me",checked:"me"===at.person,onSelect:()=>rt(e=>({...e,person:"me"===e.person?null:"me"}))},...Tn.map(e=>({type:"radio",key:e.id,label:e.name,checked:at.person===e.id,onSelect:()=>rt(t=>({...t,person:t.person===e.id?null:e.id}))})),...at.person?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,person:null}))}]:[]]}),
|
|
64
|
+
/* @__PURE__ */Q(o,{trigger:Mn(at.modified?ce[at.modified]:"Modified",!!at.modified),"aria-label":"Modified",triggerClassName:$n(!!at.modified),items:[...Object.keys(ce).map(e=>({type:"radio",key:e,label:ce[e],checked:at.modified===e,onSelect:()=>rt(t=>({...t,modified:t.modified===e?null:e}))})),...at.modified?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,modified:null}))}]:[]]})]}):null,Rn=Ln&&nn.length>0&&!Dt?/* @__PURE__ */X("div",{className:"flex items-center gap-0.5 h-10 px-2 rounded-full bg-surface-sunken",role:"toolbar","aria-label":"Selection",children:[
|
|
65
|
+
/* @__PURE__ */Q(c,{"aria-label":"Clear selection",size:"sm",onClick:dn,children:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4"})}),
|
|
66
|
+
/* @__PURE__ */X("span",{className:"text-sm text-ink mr-2 whitespace-nowrap",children:[nn.length," selected"]}),an&&ln(an)&&/* @__PURE__ */Q(c,{"aria-label":"Share",size:"sm",onClick:()=>Je(an),children:/* @__PURE__ */Q(O,{name:"add-person",className:"h-4 w-4"})}),!E&&nn.every(e=>"file"===e.kind)&&/* @__PURE__ */Q(c,{"aria-label":"Download",size:"sm",onClick:()=>nn.forEach(Kt),children:/* @__PURE__ */Q(O,{name:"download",className:"h-4 w-4"})}),nn.every(on)&&/* @__PURE__ */Q(c,{"aria-label":"Move",size:"sm",onClick:()=>Xe(nn),children:/* @__PURE__ */Q(O,{name:"forward",className:"h-4 w-4"})}),!E&&nn.every(sn)&&/* @__PURE__ */Q(c,{"aria-label":"Move to trash",size:"sm",onClick:()=>Qt(nn),children:/* @__PURE__ */Q(O,{name:"trash",className:"h-4 w-4"})}),
|
|
67
|
+
/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(nn)})]}):null,Fn=/* @__PURE__ */Q("div",{className:"flex items-center gap-2 px-4 pb-2 min-h-12 shrink-0",children:Rn??/* @__PURE__ */X(Z,{children:[
|
|
68
|
+
/* @__PURE__ */X("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:["files"===lt?/* @__PURE__ */Q("div",{className:"min-w-0 text-base [&_*]:text-base",children:/* @__PURE__ */Q(a,{items:xn,maxItems:5})}):"trash"===lt?/* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong",children:"Trash"}):"object"==typeof lt?/* @__PURE__ */X(Z,{children:[
|
|
69
|
+
/* @__PURE__ */Q(j,{className:"h-4 w-4 text-amber-500 shrink-0"}),
|
|
70
|
+
/* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong truncate",children:kt?.name??"Desktop folder"}),
|
|
71
|
+
/* @__PURE__ */Q("span",{className:"text-2xs text-ink-faintest whitespace-nowrap",children:"Desktop shortcuts"})]}):/* @__PURE__ */Q("span",{className:"text-base font-medium text-ink-strong truncate",children:Nn}),"files"===lt&&Yt&&"viewer"===Ut&&/* @__PURE__ */X("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs text-ink-faint whitespace-nowrap",children:[
|
|
72
|
+
/* @__PURE__ */Q(O,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),"files"===lt&&Yt&&It?.owner&&/* @__PURE__ */X("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",It.owner.name]})]}),An,"trash"===lt&&/* @__PURE__ */Q(W,{variant:"secondary-danger",size:"sm",onClick:async()=>{if(0===mt.length)return;await R({title:"Empty trash",message:`${mt.length} item${1===mt.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"})&&Wt(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===mt.length,children:"Empty trash"})]})}),En=(e,t)=>Dt?null:/* @__PURE__ */X("div",{className:"flex items-center justify-end "+(t?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:[ln(e)&&/* @__PURE__ */Q(c,{"aria-label":"Share",size:"sm",onClick:t=>{t.stopPropagation(),Je(e)},children:/* @__PURE__ */Q(O,{name:"add-person",className:"h-4 w-4"})}),!E&&"file"===e.kind&&/* @__PURE__ */Q(c,{"aria-label":"Download",size:"sm",onClick:t=>{t.stopPropagation(),Kt(e)},children:/* @__PURE__ */Q(O,{name:"download",className:"h-4 w-4"})}),n.setStarred&&!E&&/* @__PURE__ */Q(c,{"aria-label":e.starred?"Remove from starred":"Add to starred","aria-pressed":!!e.starred,size:"sm",onClick:t=>{t.stopPropagation(),Zt([e],!e.starred)},children:/* @__PURE__ */Q(O,{name:"star",look:e.starred?"solid":void 0,tone:e.starred?"warning":void 0,className:"h-4 w-4"})}),
|
|
73
|
+
/* @__PURE__ */Q("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(Ae.has(e.id)&&nn.length>1?nn:[e])})})]}),Pn=e=>/* @__PURE__ */X("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
74
|
+
/* @__PURE__ */Q(je,{entry:e}),
|
|
75
|
+
/* @__PURE__ */Q("span",{className:"truncate",title:e.name,children:ne(e)}),!!e.shareCount&&/* @__PURE__ */Q("span",{className:"shrink-0",role:"img","aria-label":"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),title:"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),children:/* @__PURE__ */Q(O,{name:"team",tone:"muted",className:"h-3.5 w-3.5"})}),e.starred&&/* @__PURE__ */Q("span",{className:"shrink-0",role:"img","aria-label":"Starred",title:"Starred",children:/* @__PURE__ */Q(O,{name:"star",look:"solid",tone:"warning",className:"h-3.5 w-3.5"})})]}),Wn=(e,t,n)=>{const a=it.key===e;/* @__PURE__ */
|
|
76
|
+
return Q("th",{className:`${K} font-medium px-3 h-9 ${n}`,"aria-sort":a?"asc"===it.dir?"ascending":"descending":void 0,children:/* @__PURE__ */X("button",{type:"button",className:"inline-flex items-center gap-1 rounded hover:text-ink "+(a?"text-ink":""),onClick:()=>st(t=>({key:e,dir:t.key===e&&"asc"===t.dir?"desc":"asc"})),children:[t,a&&("asc"===it.dir?/* @__PURE__ */Q(O,{name:"arrow-up",className:"h-3 w-3"}):/* @__PURE__ */Q(O,{name:"arrow-down",className:"h-3 w-3"}))]})})},On="recent"===lt?"Files you and your colleagues change show here.":"starred"===lt?"Star the files and folders you want to find quickly.":"shared"===lt?"Nothing has been shared with you yet. Files and folders colleagues share with you show here.":"search"===lt?`Nothing matches “${tt}”.`:null,zn=0===en.length?Ee?/* @__PURE__ */Q(z,{size:"sm",padding:"p-6",label:"Loading"}):/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:_t.length>0?"Nothing matches these filters.":On??/* @__PURE__ */X(Z,{children:["This folder is empty.",Jt&&/* @__PURE__ */X(Z,{children:[" Drop files here or choose ",
|
|
77
|
+
/* @__PURE__ */Q("span",{className:"font-medium",children:"New"}),"."]})]})}):"grid"===Qe?/* @__PURE__ */Q("div",{className:"px-4 pb-4",children:["folder","file"].map(e=>{const t=en.filter(t=>t.kind===e);return 0===t.length?null:/* @__PURE__ */X("section",{className:"mb-4",children:[
|
|
78
|
+
/* @__PURE__ */Q("h3",{className:"text-xs font-medium text-ink-faint mb-2",children:"folder"===e?"Folders":"Files"}),
|
|
79
|
+
/* @__PURE__ */Q("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.map(t=>{const a=Ae.has(t.id);/* @__PURE__ */
|
|
80
|
+
return X("div",{role:"button",tabIndex:0,"aria-pressed":a,"aria-label":ne(t),onClick:e=>cn(t.id,e),onDoubleClick:()=>pn(t),onContextMenu:e=>kn(e,t),...wn(t),...yn(t),className:"group rounded-xl border cursor-default select-none outline-none focus-visible:ring-2 focus-visible:ring-accent-border "+(a||Ye===t.id?"border-accent-border bg-accent-tint":"border-line bg-surface-sunken hover:bg-row-hover"),children:[
|
|
81
|
+
/* @__PURE__ */X("div",{className:"flex items-center gap-2 pl-3 pr-1 h-11",children:[
|
|
82
|
+
/* @__PURE__ */Q(je,{entry:t,className:"h-4 w-4"}),
|
|
83
|
+
/* @__PURE__ */Q("span",{className:"flex-1 truncate text-sm",title:t.name,children:ne(t)}),
|
|
84
|
+
/* @__PURE__ */Q("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */Q(o,{trigger:/* @__PURE__ */Q(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(a&&nn.length>1?nn:[t])})})]}),"file"===e&&/* @__PURE__ */X(Z,{children:[
|
|
85
|
+
/* @__PURE__ */Q("div",{className:"mx-2 h-28 rounded-lg bg-surface flex items-center justify-center overflow-hidden",children:/* @__PURE__ */Q(De,{entry:t,read:E?void 0:n.read})}),
|
|
86
|
+
/* @__PURE__ */X("div",{className:"px-3 py-2 text-2xs text-ink-faint truncate",children:["me"===ie(t)?"You":ie(t)," · ",re(t.modifiedAt)]})]})]},t.id)})})]},e)})}):/* @__PURE__ */X("table",{className:"w-full text-sm table-fixed",children:[
|
|
87
|
+
/* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */X("tr",{children:[Wn("name","Name","text-left"),H&&Wn("owner","Owner","text-left w-32"),Wn("modified","Modified","text-left w-28"),Wn("size","Size","text-right w-20"),
|
|
88
|
+
/* @__PURE__ */Q("th",{className:`${K} w-32`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
89
|
+
/* @__PURE__ */Q("tbody",{children:en.map(e=>{const t=Ae.has(e.id);/* @__PURE__ */
|
|
90
|
+
return X("tr",{"aria-selected":t,onClick:t=>cn(e.id,t),onDoubleClick:()=>pn(e),onContextMenu:t=>kn(t,e),...wn(e),...yn(e),className:`group cursor-default select-none border-b border-line-subtle ${hn(e)} ${t||Ye===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
|
|
91
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11",children:Pn(e)}),H&&/* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint truncate",children:ie(e)}),
|
|
92
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:ve(e.modifiedAt),children:re(e.modifiedAt)}),
|
|
93
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint whitespace-nowrap",children:Dt&&"file"===e.kind&&!mn(e)&&Dt.request.otherLabel?Dt.request.otherLabel:ae(e)}),
|
|
94
|
+
/* @__PURE__ */Q("td",{className:"px-2 h-11",children:En(e,t)})]},e.id)})})]}),Kn=Ee&&0===mt.length?/* @__PURE__ */Q(z,{size:"sm",padding:"p-6",label:"Loading"}):0===mt.length?/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty. What you delete stays here for 30 days."}):/* @__PURE__ */X("table",{className:"w-full text-sm table-fixed",children:[
|
|
95
|
+
/* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */X("tr",{children:[
|
|
96
|
+
/* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
97
|
+
/* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-48`,children:"Original location"}),
|
|
98
|
+
/* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Deleted"}),
|
|
99
|
+
/* @__PURE__ */Q("th",{className:`${K} text-right font-medium px-3 h-9 w-24`,children:"Size"}),
|
|
100
|
+
/* @__PURE__ */Q("th",{className:`${K} w-28`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
101
|
+
/* @__PURE__ */Q("tbody",{children:mt.map(e=>/* @__PURE__ */X("tr",{className:"group border-b border-line-subtle hover:bg-row-hover",onContextMenu:t=>St.open(t,e),children:[
|
|
102
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11",children:/* @__PURE__ */X("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
103
|
+
/* @__PURE__ */Q(je,{entry:e}),
|
|
104
|
+
/* @__PURE__ */Q("span",{className:"truncate",title:e.name,children:e.name})]})}),
|
|
105
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint text-xs truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
106
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:e.deletedAt?ve(e.deletedAt):void 0,children:e.deletedAt?re(e.deletedAt):"—"}),
|
|
107
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":d(e.size)}),
|
|
108
|
+
/* @__PURE__ */Q("td",{className:"px-2 h-11",children:/* @__PURE__ */X("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
109
|
+
/* @__PURE__ */Q(c,{"aria-label":"Restore",size:"sm",onClick:()=>Ot(e),children:/* @__PURE__ */Q(O,{name:"revert",className:"h-4 w-4"})}),
|
|
110
|
+
/* @__PURE__ */Q(c,{"aria-label":"Delete forever",size:"sm",variant:"ghost-danger",onClick:()=>zt(e),children:/* @__PURE__ */Q(O,{name:"trash",className:"h-4 w-4"})})]})})]},e.id))})]}),In=0===wt.length?/* @__PURE__ */Q("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */X("table",{className:"w-full text-sm table-fixed",children:[
|
|
111
|
+
/* @__PURE__ */Q("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */X("tr",{children:[
|
|
112
|
+
/* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
113
|
+
/* @__PURE__ */Q("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Type"}),
|
|
114
|
+
/* @__PURE__ */Q("th",{className:`${K} w-32`,children:/* @__PURE__ */Q("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
115
|
+
/* @__PURE__ */Q("tbody",{children:wt.map(e=>/* @__PURE__ */X("tr",{onDoubleClick:()=>Mt(e),onContextMenu:t=>jt.open(t,e),className:"group cursor-default border-b border-line-subtle hover:bg-row-hover",children:[
|
|
116
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11",children:/* @__PURE__ */X("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
117
|
+
/* @__PURE__ */Q(D,{item:e}),
|
|
118
|
+
/* @__PURE__ */Q("span",{className:"truncate",title:e.label,children:e.label})]})}),
|
|
119
|
+
/* @__PURE__ */Q("td",{className:"px-3 h-11 text-xs text-ink-faint",children:M(e)}),
|
|
120
|
+
/* @__PURE__ */Q("td",{className:"px-2 h-11",children:/* @__PURE__ */X("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
121
|
+
/* @__PURE__ */Q(c,{"aria-label":"Open",size:"sm",onClick:()=>Mt(e),children:/* @__PURE__ */Q(O,{name:"external",className:"h-4 w-4"})}),
|
|
122
|
+
/* @__PURE__ */Q(c,{"aria-label":"Move to desktop",size:"sm",onClick:()=>pt?.moveToDesktop([e]),children:/* @__PURE__ */Q(O,{name:"desktop",className:"h-4 w-4"})}),
|
|
123
|
+
/* @__PURE__ */Q(c,{"aria-label":"Remove",size:"sm",variant:"ghost-danger",onClick:()=>pt?.removeShortcuts([e]),children:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4"})})]})})]},`${e.entityType}|${e.entityId}`))})]});/* @__PURE__ */
|
|
124
|
+
return X("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Jt&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),yt.current++,Ie||Ue(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{yt.current>0&&yt.current--,0===yt.current&&Ue(!1)},onDrop:e=>{e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),qt(),Jt&&e.dataTransfer.files?.length&&Bt(e.dataTransfer.files))},children:[
|
|
125
|
+
/* @__PURE__ */Q(A,{title:Cn}),
|
|
126
|
+
/* @__PURE__ */Q(k,{app:"files"}),
|
|
127
|
+
/* @__PURE__ */Q("input",{ref:vt,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Bt(e.target.files),vt.current&&(vt.current.value="")}}),
|
|
128
|
+
/* @__PURE__ */Q("input",{ref:e=>{bt.current=e,e?.setAttribute("webkitdirectory","")},type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Bt(e.target.files,{withFolders:!0}),bt.current&&(bt.current.value="")}}),
|
|
129
|
+
/* @__PURE__ */Q("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */Q(t,{sidebar:Dn,storageKey:"files.sidebarWidth",defaultWidth:220,minWidth:170,maxWidth:320,children:/* @__PURE__ */X("div",{className:"flex h-full min-w-0",children:[
|
|
130
|
+
/* @__PURE__ */X("div",{className:"flex flex-1 min-w-0 flex-col",children:[Dt&&/* @__PURE__ */X("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-line bg-accent-tint text-accent-text text-sm shrink-0",role:"status",children:[
|
|
131
|
+
/* @__PURE__ */Q(O,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
|
|
132
|
+
/* @__PURE__ */Q("span",{className:"flex-1 min-w-0 truncate",children:Dt.request.title}),
|
|
133
|
+
/* @__PURE__ */Q(W,{variant:"secondary",size:"sm",onClick:()=>p(Dt.id,null),children:"Cancel"}),
|
|
134
|
+
/* @__PURE__ */Q(W,{variant:"primary",size:"sm",disabled:!fn,onClick:()=>{fn&&un(fn)},children:"Open"})]}),
|
|
135
|
+
/* @__PURE__ */X("div",{className:"flex items-center gap-1 px-4 py-2 shrink-0",children:[
|
|
136
|
+
/* @__PURE__ */Q("div",{className:"flex-1 min-w-48 max-w-2xl",role:"search",children:/* @__PURE__ */Q(l,{type:"text",enterKeyHint:"search",value:_e,onChange:e=>{et(e.target.value),e.target.value.trim()||Et()},onKeyDown:e=>{"Escape"===e.key&&_e&&(e.stopPropagation(),Et())},placeholder:`Search in ${r}`,"aria-label":`Search in ${r}`,leftIcon:/* @__PURE__ */Q(O,{name:"search",className:"h-4 w-4"}),endAction:_e?{label:"Clear search",icon:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4"}),onClick:Et}:void 0})}),
|
|
137
|
+
/* @__PURE__ */Q("div",{className:"flex-1"}),"object"!=typeof lt&&"trash"!==lt&&/* @__PURE__ */X(Z,{children:[
|
|
138
|
+
/* @__PURE__ */Q(c,{"aria-label":"List view","aria-pressed":"list"===Qe,onClick:()=>ut("list"),children:/* @__PURE__ */Q(O,{name:"list",className:"h-4 w-4"})}),
|
|
139
|
+
/* @__PURE__ */Q(c,{"aria-label":"Grid view","aria-pressed":"grid"===Qe,onClick:()=>ut("grid"),children:/* @__PURE__ */Q(O,{name:"grid",className:"h-4 w-4"})})]}),
|
|
140
|
+
/* @__PURE__ */Q(c,{"aria-label":"Details","aria-pressed":He,onClick:()=>qe(e=>!e),children:/* @__PURE__ */Q(O,{name:"info",className:"h-4 w-4"})})]}),Fn,
|
|
141
|
+
/* @__PURE__ */Q("div",{className:"flex-1 overflow-auto outline-none",tabIndex:-1,onKeyDown:e=>{e.target instanceof HTMLInputElement||(Dt?"Enter"===e.key&&fn&&(e.preventDefault(),un(fn)):("Delete"===e.key||"Backspace"===e.key)&&nn.length&&nn.every(sn)?(e.preventDefault(),Qt(nn)):"Enter"===e.key&&an?(e.preventDefault(),pn(an)):(e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&en.length&&(e.preventDefault(),Re(new Set(en.map(e=>e.id)))))},onClick:e=>{e.target===e.currentTarget&&dn()},children:"object"==typeof lt?In:"trash"===lt?Kn:zn})]}),He&&Ln&&/* @__PURE__ */Q(fe,{store:n,entry:an,selectedCount:nn.length,onClose:()=>qe(!1)})]})})}),Ct.state&&/* @__PURE__ */Q(s,{...Ct.props,items:gn(Ct.state.data),"aria-label":"File actions"}),St.state&&/* @__PURE__ */Q(s,{...St.props,"aria-label":"Trash actions",items:[{key:"restore",label:"Restore",icon:/* @__PURE__ */Q(O,{name:"revert",className:"h-4 w-4"}),onSelect:()=>Ot(St.state.data)},{type:"divider",key:"d"},{key:"purge",label:"Delete forever",danger:!0,icon:/* @__PURE__ */Q(O,{name:"trash",className:"h-4 w-4"}),onSelect:()=>zt(St.state.data)}]}),jt.state&&/* @__PURE__ */Q(s,{...jt.props,"aria-label":"Shortcut actions",items:[{key:"open",label:"Open",icon:/* @__PURE__ */Q(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>Mt(jt.state.data)},{key:"desktop",label:"Move to desktop",icon:/* @__PURE__ */Q(O,{name:"desktop",className:"h-4 w-4"}),onSelect:()=>pt?.moveToDesktop([jt.state.data])},{type:"divider",key:"d"},{key:"remove",label:"Remove",danger:!0,icon:/* @__PURE__ */Q(O,{name:"close",className:"h-4 w-4"}),onSelect:()=>pt?.removeShortcuts([jt.state.data])}]}),H&&/* @__PURE__ */Q(he,{store:n,entry:Ge,onClose:()=>Je(null),onChanged:Ft}),n.move&&/* @__PURE__ */Q(ue,{store:n,items:Be,from:"files"===lt?_:void 0,onClose:()=>Xe(null),onMove:e=>Be&&Ht(Be,e)}),Ie&&/* @__PURE__ */Q("div",{className:"absolute inset-0 bg-accent-tint border-4 border-dashed border-accent-border pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */Q("div",{className:"px-4 py-2 rounded-md bg-accent-fill text-on-accent text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{Me as default,Ne as quotaExceededMessage};
|