efficient-shell 12.28.0 → 12.30.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 +38 -0
- package/dist/{Browser-PC45PVTN.js → Browser-FQHXHI3R.js} +16 -16
- package/dist/Calculator-XCRU5K4O.js +29 -0
- package/dist/{CurrencyConverter-BB4QWNER.js → CurrencyConverter-EHIQIFJK.js} +9 -9
- package/dist/Files-LTUUGPAM.js +141 -0
- package/dist/{Notepad-BLUA2254.js → Notepad-JPAXNEFR.js} +9 -9
- package/dist/PdfViewer-J55QKFNS.js +1 -0
- package/dist/{PomodoroTimer-KIJKDHVO.js → PomodoroTimer-IVDZBBUN.js} +8 -8
- package/dist/{Preview-JVL2N5GN.js → Preview-KRK4XT2B.js} +31 -31
- package/dist/Sidebar-FCXIPW5K.js +44 -0
- package/dist/{Stock-JQEJMIMG.js → Stock-OBS2LPX4.js} +7 -7
- package/dist/{Weather-FAQX55XL.js → Weather-I4TJBIEN.js} +18 -18
- package/dist/{WorldClock-YSZNGEL2.js → WorldClock-YU2ZPVSA.js} +6 -6
- package/dist/ai/index.js +134 -134
- 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/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-W2663E4S.js → chunk-23CZSU3H.js} +3 -3
- package/dist/{chunk-47UH3D4B.js → chunk-2DCATU5B.js} +1 -1
- package/dist/{chunk-RF3ZFTAU.js → chunk-2IEKMFVL.js} +1 -1
- package/dist/{chunk-TDXRG43I.js → chunk-2N6WWL7Y.js} +1 -1
- package/dist/{chunk-O4YKOS74.js → chunk-36MM4YRK.js} +9 -9
- package/dist/{chunk-HLE4LTRU.js → chunk-37EYKPR6.js} +1 -1
- package/dist/{chunk-RVVQDBV7.js → chunk-3B3QIHF7.js} +5 -5
- package/dist/{chunk-BKYRHQK2.js → chunk-3HLV6BEC.js} +12 -12
- package/dist/{chunk-BT2YPDQL.js → chunk-3N4XJS43.js} +3 -3
- package/dist/{chunk-232YPI2L.js → chunk-3R2TMLKH.js} +5 -5
- package/dist/{chunk-CON5NRCO.js → chunk-3ZC53F4T.js} +3 -3
- package/dist/{chunk-ZGCCV4WE.js → chunk-42GNFUAP.js} +10 -10
- package/dist/{chunk-OMFYTCBI.js → chunk-4FUQK2LK.js} +1 -1
- package/dist/{chunk-WKYNPGFB.js → chunk-4MCI7UHQ.js} +5 -5
- package/dist/chunk-4SEPQN2N.js +12 -0
- package/dist/{chunk-GEVNBBM7.js → chunk-4WW3SNL6.js} +1 -1
- package/dist/chunk-4YCWO2GZ.js +14 -0
- package/dist/{chunk-XSVQ5V7L.js → chunk-5O5QMMMG.js} +9 -9
- package/dist/{chunk-EATV7FMU.js → chunk-5RLJAXDR.js} +8 -8
- package/dist/{chunk-3YBXA72C.js → chunk-5X3Z45SL.js} +1 -1
- package/dist/{chunk-UEFIUTOU.js → chunk-5XYRFK7D.js} +1 -1
- package/dist/{chunk-6KOMF6WL.js → chunk-5ZS3VOJH.js} +1 -1
- package/dist/{chunk-YWNHK6Z5.js → chunk-64ZDYUE7.js} +15 -15
- package/dist/{chunk-WX2Q76WC.js → chunk-67JLD6AU.js} +6 -6
- package/dist/{chunk-OM6VWUAZ.js → chunk-6EETON2U.js} +1 -1
- package/dist/{chunk-4PIQG2ZK.js → chunk-6EXWWPAW.js} +1 -1
- package/dist/{chunk-ATZ262BR.js → chunk-6UB6YY3H.js} +1 -1
- package/dist/{chunk-ZGWXSHVM.js → chunk-77BK2IAJ.js} +1 -1
- package/dist/{chunk-Y4FWTYZS.js → chunk-7DTWIWFO.js} +6 -6
- package/dist/chunk-7IGWU6DK.js +8 -0
- package/dist/{chunk-XAEI36TW.js → chunk-AIGLJYQ5.js} +1 -1
- package/dist/chunk-AJVL6LXI.js +22 -0
- package/dist/{chunk-2OUAPOLK.js → chunk-ANGNTN36.js} +1 -1
- package/dist/{chunk-BC4FE77W.js → chunk-AYCWVVJ3.js} +50 -50
- package/dist/{chunk-7GJIIBJD.js → chunk-B27XRZ47.js} +1 -1
- package/dist/{chunk-EWVE5XG6.js → chunk-BEB3AGSY.js} +1 -1
- package/dist/{chunk-DIHHV6T6.js → chunk-CBBU74QT.js} +1 -1
- package/dist/chunk-CHV7U5UV.js +9 -0
- package/dist/{chunk-TGLUENXE.js → chunk-CIOPLPZW.js} +1 -1
- package/dist/{chunk-SS3CROPR.js → chunk-CVEVPB3O.js} +3 -3
- package/dist/chunk-CXXMSYA6.js +1 -0
- package/dist/{chunk-6Q7L32LL.js → chunk-DHRCI7KE.js} +1 -1
- package/dist/{chunk-HNEI2RKX.js → chunk-DOKA65JI.js} +1 -1
- package/dist/{chunk-XKNKRKHH.js → chunk-E7RMS776.js} +14 -14
- package/dist/chunk-EWSOX4WP.js +28 -0
- package/dist/{chunk-K5PDLRYH.js → chunk-FEWWCWKV.js} +9 -9
- package/dist/{chunk-SR4W2SYQ.js → chunk-FIXZT5TZ.js} +7 -7
- package/dist/{chunk-LAO6GLBY.js → chunk-FM34DWV7.js} +6 -6
- package/dist/{chunk-VP2GI3UP.js → chunk-FPYOZOUY.js} +8 -8
- package/dist/{chunk-VLKJN6HX.js → chunk-FSORYU5C.js} +12 -12
- package/dist/{chunk-MKNDDB6U.js → chunk-FYGPJPU7.js} +1 -1
- package/dist/{chunk-AFWLCXQD.js → chunk-GANZLRMW.js} +8 -8
- package/dist/{chunk-N5RV73CI.js → chunk-GBPGZFBS.js} +4 -4
- package/dist/chunk-GKX3C3JE.js +13 -0
- package/dist/{chunk-JLRF6FN7.js → chunk-GL4NELAT.js} +1 -1
- package/dist/{chunk-DGHSCKOE.js → chunk-GN3AHAVY.js} +4 -4
- package/dist/{chunk-7ZJRBFHA.js → chunk-HC3BZPWX.js} +1 -1
- package/dist/{chunk-JSHMIMAJ.js → chunk-HCDG7EUR.js} +1 -1
- package/dist/{chunk-GUHCKMC7.js → chunk-HE2I6KWY.js} +2 -2
- package/dist/chunk-HJECGV6W.js +5 -0
- package/dist/{chunk-TYQ2JL4J.js → chunk-HOXXEF52.js} +1 -1
- package/dist/{chunk-34L5SRM7.js → chunk-HRNT4UDG.js} +18 -18
- package/dist/{chunk-WPG3ZHYT.js → chunk-HU24RSAE.js} +1 -1
- package/dist/{chunk-7TNZ3DTT.js → chunk-I6V4DMNR.js} +2 -2
- package/dist/{chunk-EEB5XPWP.js → chunk-IBPULOGJ.js} +2 -2
- package/dist/{chunk-RZ2DWX4N.js → chunk-ILSE5F5F.js} +5 -5
- package/dist/{chunk-KAKJ7ENS.js → chunk-IOIY54KO.js} +2 -2
- package/dist/{chunk-NUPK6CUV.js → chunk-IQTURGC4.js} +1 -1
- package/dist/{chunk-VBLCYL4L.js → chunk-JA5WM66L.js} +1 -1
- package/dist/{chunk-XAF5ZI7H.js → chunk-JGZEZHMP.js} +1 -1
- package/dist/{chunk-CBVKGAZH.js → chunk-JOANOIVK.js} +1 -1
- package/dist/{chunk-24Y5JHIR.js → chunk-JTRQ7HAS.js} +1 -1
- package/dist/{chunk-CEIIQRK5.js → chunk-K6LO6QI5.js} +6 -6
- package/dist/{chunk-VLBIM33E.js → chunk-KHFPF534.js} +6 -6
- package/dist/{chunk-WN3JHPJI.js → chunk-KKYNDLOC.js} +6 -6
- package/dist/{chunk-4IHYWLWE.js → chunk-KLG6RYYC.js} +5 -5
- package/dist/{chunk-7K3FYCRZ.js → chunk-KNNFNOX7.js} +9 -9
- package/dist/chunk-KPFP2I2S.js +8 -0
- package/dist/{chunk-JZBLOIL7.js → chunk-KPPKPGQI.js} +1 -1
- package/dist/{chunk-XHSMDUEW.js → chunk-LBLWN3SH.js} +3 -3
- package/dist/chunk-LHATGPIE.js +19 -0
- package/dist/{chunk-TKIYZE7V.js → chunk-LQD54ZL5.js} +1 -1
- package/dist/{chunk-MTYEY7HT.js → chunk-M2GF44WC.js} +12 -12
- package/dist/{chunk-56XCGOX5.js → chunk-MFZ4YMXE.js} +6 -6
- package/dist/{chunk-VFHKD7TQ.js → chunk-MHVWUYEN.js} +1 -1
- package/dist/{chunk-BFRGDRFK.js → chunk-MKPZIEQP.js} +22 -22
- package/dist/{chunk-LL4KF43W.js → chunk-MRVW6F5E.js} +1 -1
- package/dist/chunk-MUSNAMWH.js +1 -0
- package/dist/{chunk-VEQ45GAH.js → chunk-MVBDE4AX.js} +1 -1
- package/dist/{chunk-V3XS6BTJ.js → chunk-MYJ3HQYG.js} +12 -12
- package/dist/{chunk-JFGJJNT2.js → chunk-N2BWOHNM.js} +6 -6
- package/dist/{chunk-N2445WHJ.js → chunk-NJ6WZHXC.js} +5 -5
- package/dist/{chunk-OXRQIWRT.js → chunk-NLQLVXMJ.js} +1 -1
- package/dist/{chunk-HSUTZCRT.js → chunk-NSNM4QIV.js} +5 -5
- package/dist/{chunk-QB2GJNGB.js → chunk-O3SCB4QZ.js} +8 -8
- package/dist/{chunk-HVYXJLAV.js → chunk-OMSIXLK4.js} +1 -1
- package/dist/{chunk-74JMBOQH.js → chunk-P4NWDRHS.js} +26 -26
- package/dist/{chunk-X5MUSNKH.js → chunk-PAVOVX3D.js} +1 -1
- package/dist/{chunk-LIWBCIRZ.js → chunk-PBZ3UQMS.js} +4 -4
- package/dist/chunk-PRWA4AAC.js +11 -0
- package/dist/{chunk-MWTCGJAI.js → chunk-Q4BJW37U.js} +1 -1
- package/dist/{chunk-WNOXHJVT.js → chunk-QB7TIWHT.js} +5 -5
- package/dist/{chunk-YO26RV3H.js → chunk-QF4FYOVE.js} +1 -1
- package/dist/{chunk-DJXXY23A.js → chunk-QHWD3G7T.js} +2 -2
- package/dist/{chunk-WXZZGHET.js → chunk-QT34GMZR.js} +1 -1
- package/dist/{chunk-UH5ZGWSA.js → chunk-QV5A7NFQ.js} +8 -8
- package/dist/chunk-RJG67VRP.js +15 -0
- package/dist/{chunk-63IGYBCQ.js → chunk-RMUOUMV2.js} +2 -2
- package/dist/{chunk-3FBXJO77.js → chunk-RPXRMTOU.js} +1 -1
- package/dist/chunk-RVD6HJUJ.js +4 -0
- package/dist/{chunk-NN32QUCE.js → chunk-SAAXAAAH.js} +1 -1
- package/dist/chunk-TIYRBJSB.js +7 -0
- package/dist/{chunk-4BKJ6A5H.js → chunk-TJ5ZX5HP.js} +10 -10
- package/dist/chunk-TN3W72FC.js +8 -0
- package/dist/{chunk-2DYVVHZA.js → chunk-U22563X2.js} +1 -1
- package/dist/{chunk-QADNVFV5.js → chunk-U45APXV3.js} +1 -1
- package/dist/{chunk-OOWPLQD5.js → chunk-UEADX2GV.js} +2 -2
- package/dist/chunk-UK2D2CSB.js +14 -0
- package/dist/{chunk-Z66QBDNU.js → chunk-UOHHIEH4.js} +1 -1
- package/dist/{chunk-H2CPT6K3.js → chunk-UQNKFMJR.js} +12 -12
- package/dist/{chunk-SE6IQZYW.js → chunk-V64XY7L4.js} +9 -9
- package/dist/{chunk-75H4BWNC.js → chunk-VEF3STCH.js} +1 -1
- package/dist/chunk-VLI2ED22.js +7 -0
- package/dist/{chunk-V4XR4MOS.js → chunk-VREZFFRE.js} +1 -1
- package/dist/chunk-VY5NO4TS.js +2 -0
- package/dist/{chunk-CMJD5URC.js → chunk-WCJR2GNH.js} +18 -18
- package/dist/{chunk-Y7KDCC6E.js → chunk-WM37FXRK.js} +1 -1
- package/dist/{chunk-4LOHQ4QB.js → chunk-X27K2NCU.js} +5 -5
- package/dist/{chunk-ZBJ7FTA5.js → chunk-X5RFTIHV.js} +1 -1
- package/dist/chunk-XJTZU7UH.js +4 -0
- package/dist/{chunk-RBS3AWE7.js → chunk-XK3VYRLR.js} +1 -1
- package/dist/{chunk-FJVZ2W55.js → chunk-XMAOLCQV.js} +1 -1
- package/dist/{chunk-GC4N4UQM.js → chunk-XXRUDMD5.js} +5 -5
- package/dist/{chunk-AMIMNRYU.js → chunk-Y6H5C6A4.js} +1 -1
- package/dist/{chunk-YYGJJ6EI.js → chunk-YGKQMENL.js} +1 -1
- package/dist/{chunk-NOGSS432.js → chunk-YNE5YC6E.js} +1 -1
- package/dist/chunk-YS3CF7GL.js +2 -0
- package/dist/{chunk-IB3LLQZC.js → chunk-ZSVBEJ4G.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- 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/PositionInput.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.d.ts +13 -2
- 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 +4 -4
- package/dist/index.js +132 -132
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +4 -4
- package/dist/model-viewer/index.d.ts +123 -0
- package/dist/model-viewer/index.js +7 -0
- 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 +10 -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 +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -1
- package/dist/Calculator-5TRNFPY4.js +0 -29
- package/dist/Files-BKEREVQK.js +0 -141
- package/dist/PdfViewer-4YLDY4JY.js +0 -1
- package/dist/Sidebar-SAGLPIOC.js +0 -44
- package/dist/chunk-2SGOKMUU.js +0 -13
- package/dist/chunk-4Y33Y4OX.js +0 -8
- package/dist/chunk-574SLTKO.js +0 -8
- package/dist/chunk-64J7TYJ3.js +0 -4
- package/dist/chunk-A4PFVMQ2.js +0 -7
- package/dist/chunk-BHHFVIAD.js +0 -2
- package/dist/chunk-DG2TGWXI.js +0 -15
- package/dist/chunk-DRMIQ3YE.js +0 -1
- package/dist/chunk-ENFXDIIZ.js +0 -8
- package/dist/chunk-FFUTSMF5.js +0 -28
- package/dist/chunk-FI6IJTAJ.js +0 -14
- package/dist/chunk-FVKXDF2Q.js +0 -12
- package/dist/chunk-IATKDC52.js +0 -9
- package/dist/chunk-JJ2OXUK7.js +0 -14
- package/dist/chunk-S6AN76R3.js +0 -4
- package/dist/chunk-T7D73HT7.js +0 -11
- package/dist/chunk-TU2L7NW3.js +0 -7
- package/dist/chunk-UFM4YBZ7.js +0 -1
- package/dist/chunk-VDYF3WPJ.js +0 -2
- package/dist/chunk-XMY2HKVD.js +0 -19
- package/dist/chunk-XQWHKXLS.js +0 -22
- package/dist/chunk-YX2OOGV7.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-shell",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.30.0",
|
|
4
4
|
"description": "Desktop-style React UI shell — windows, taskbar, start menu, sticky notes, frosted glass theming, and bundled apps.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
"import": "./dist/map/index.js",
|
|
60
60
|
"default": "./dist/map/index.js"
|
|
61
61
|
},
|
|
62
|
+
"./model-viewer": {
|
|
63
|
+
"types": "./dist/model-viewer/index.d.ts",
|
|
64
|
+
"import": "./dist/model-viewer/index.js",
|
|
65
|
+
"default": "./dist/model-viewer/index.js"
|
|
66
|
+
},
|
|
62
67
|
"./map/worker-route": {
|
|
63
68
|
"types": "./dist/map-worker-route.d.ts",
|
|
64
69
|
"import": "./dist/map-worker-route.js",
|
|
@@ -176,6 +181,7 @@
|
|
|
176
181
|
],
|
|
177
182
|
"peerDependencies": {
|
|
178
183
|
"@ai-sdk/react": ">=4",
|
|
184
|
+
"@google/model-viewer": "^4.4.0",
|
|
179
185
|
"@headlessui/react": ">=2",
|
|
180
186
|
"@tanstack/react-query": ">=5",
|
|
181
187
|
"ai": ">=7",
|
|
@@ -198,6 +204,7 @@
|
|
|
198
204
|
},
|
|
199
205
|
"devDependencies": {
|
|
200
206
|
"@ai-sdk/react": "^4.0.143",
|
|
207
|
+
"@google/model-viewer": "4.4.0",
|
|
201
208
|
"@headlessui/react": "^2.2.10",
|
|
202
209
|
"@phosphor-icons/core": "2.1.1",
|
|
203
210
|
"@tabler/icons": "3.48.0",
|
|
@@ -231,6 +238,7 @@
|
|
|
231
238
|
"remark-gfm": "^4.0.1",
|
|
232
239
|
"tailwindcss": "^4.2.4",
|
|
233
240
|
"terser": "^5.51.2",
|
|
241
|
+
"three": "0.183.2",
|
|
234
242
|
"tsup": "^8.0.0",
|
|
235
243
|
"typescript": "^5.3.0",
|
|
236
244
|
"web-vitals": "6.2.3"
|
|
@@ -265,6 +273,9 @@
|
|
|
265
273
|
"@ai-sdk/react": {
|
|
266
274
|
"optional": true
|
|
267
275
|
},
|
|
276
|
+
"@google/model-viewer": {
|
|
277
|
+
"optional": true
|
|
278
|
+
},
|
|
268
279
|
"@headlessui/react": {
|
|
269
280
|
"optional": true
|
|
270
281
|
},
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-XAF5ZI7H.js";import{useWidgetSettings as n}from"./chunk-BC4FE77W.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-47UH3D4B.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-HVYXJLAV.js";import"./chunk-YWNHK6Z5.js";import"./chunk-64J7TYJ3.js";import"./chunk-EIFNESXS.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-TGLUENXE.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-NN32QUCE.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./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"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[E,S]=c(()=>e(h)),[J,T]=c(!1),[W,D]=c(E),M=i(null);n(o(()=>{D({...E}),T(!0)},[E]));const A=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),F=o(()=>{k("0"),d(null),g(null),N(!1)},[]),G=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),U=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=G(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,G]),w=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=G(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,G]),H=o(()=>{k(e=>String(parseFloat(e)/100))},[]),X=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?A(e.key):"."===e.key?A("."):"+"===e.key?U("+"):"-"===e.key?U("-"):"*"===e.key?U("×"):"/"===e.key?(e.preventDefault(),U("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&M.current?.contains(e.target)&&e.preventDefault(),w()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&H())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A,U,w,F,H]);const I="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",L=`${I} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,Q=`${I} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Z=`${I} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,B=`${I} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
-
return l(a,{children:[
|
|
3
|
-
/* @__PURE__ */l("div",{ref:M,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
|
|
4
|
-
/* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
-
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:C.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
|
|
6
|
-
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
-
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
|
|
9
|
-
/* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
-
/* @__PURE__ */u("button",{onClick:F,className:Z,children:"AC"}),
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:X,className:Z,children:"+/−"}),
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:H,className:Z,children:"%"}),
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>U("÷"),className:`${Q} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>A("7"),className:L,children:"7"}),
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>A("8"),className:L,children:"8"}),
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>A("9"),className:L,children:"9"}),
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>U("×"),className:`${Q} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>A("4"),className:L,children:"4"}),
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>A("5"),className:L,children:"5"}),
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>A("6"),className:L,children:"6"}),
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>U("-"),className:`${Q} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>A("1"),className:L,children:"1"}),
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>A("2"),className:L,children:"2"}),
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>A("3"),className:L,children:"3"}),
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>U("+"),className:`${Q} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>A("0"),className:`${L} col-span-2`,children:"0"}),
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>A("."),className:L,children:"."}),
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:w,className:B,children:"="})]})]}),
|
|
29
|
-
/* @__PURE__ */u(t,{open:J,onClose:()=>T(!1),title:"Calculator Settings",appearance:W,onAppearanceChange:D,onSave:()=>{S(W),localStorage.setItem(h,JSON.stringify(W)),T(!1)}})]})}export{m as default};
|
package/dist/Files-BKEREVQK.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import{openPreviewFile as e}from"./chunk-2OUAPOLK.js";import{SidebarLayout as t}from"./chunk-WN3JHPJI.js";import"./chunk-QWK6DRSN.js";import"./chunk-OOWPLQD5.js";import{SearchableSelect as n}from"./chunk-2SGOKMUU.js";import{Breadcrumbs as a}from"./chunk-JLRF6FN7.js";import{Select_default as r}from"./chunk-XMY2HKVD.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-X5MUSNKH.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 T}from"./chunk-WBAWJIVM.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as L,WindowTitle as F}from"./chunk-BC4FE77W.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-47UH3D4B.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-HVYXJLAV.js";import{confirm as A,prompt as E}from"./chunk-YWNHK6Z5.js";import{Dialog as P}from"./chunk-64J7TYJ3.js";import"./chunk-EIFNESXS.js";import{ItemCount as W}from"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-TGLUENXE.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-NN32QUCE.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-UFM4YBZ7.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 R}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 U}from"./chunk-3YBXA72C.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as I,useRef as J,useEffect as Y,useCallback as G,useSyncExternalStore as V,useMemo as B}from"react";import{jsxs as H,jsx as X,Fragment as Q}from"react/jsx-runtime";var Z={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":Z[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?T[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]=I(null),[o,d]=I(""),[m,h]=I([]),[u,f]=I(!1),[p,g]=I(""),[k,w]=I("viewer"),[y,v]=I(!1),b=J(/* @__PURE__ */new Map),x=t?.id??null;if(Y(()=>{if(l(null),g(""),d(""),!x||!e.shares)return;let t=!0;return e.shares(x).then(e=>{t&&l(e)}).catch(e=>{t&&(U.error(e.message),l([]))}),()=>{t=!1}},[x,e]),Y(()=>{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){U.error(e.message)}finally{v(!1)}};/* @__PURE__ */
|
|
2
|
-
return H(P,{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__ */X(R,{variant:"secondary",onClick:a,children:"Done"}),children:[
|
|
3
|
-
/* @__PURE__ */H("div",{className:"flex items-center gap-2",children:[
|
|
4
|
-
/* @__PURE__ */X("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */X(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__ */X("div",{className:"w-28 shrink-0",children:/* @__PURE__ */X(r,{value:k,onChange:e=>w(e),options:me,"aria-label":"Access"})}),
|
|
6
|
-
/* @__PURE__ */X(R,{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&&U.success(`Shared with ${n.name}`)})},disabled:!p||y,children:"Add"})]}),
|
|
7
|
-
/* @__PURE__ */X("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */X(z,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */H("ul",{className:"divide-y divide-line-subtle text-sm",children:[
|
|
8
|
-
/* @__PURE__ */H("li",{className:"flex items-center gap-2 h-10",children:[
|
|
9
|
-
/* @__PURE__ */X("span",{className:"flex-1 truncate",children:"You"}),
|
|
10
|
-
/* @__PURE__ */X("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */H("li",{className:"flex items-center gap-2 h-10",children:[
|
|
11
|
-
/* @__PURE__ */X("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
|
|
12
|
-
/* @__PURE__ */X("div",{className:"w-28 shrink-0",children:/* @__PURE__ */X(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__ */X(c,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:y,onClick:()=>S(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */X(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]=I(n??null),[l,o]=I(null),[d,m]=I(!1);Y(()=>{t&&s(n??null)},[t,n]),Y(()=>{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 H(P,{open:!!t,onClose:a,title:`Move ${v}`,size:"sm",footer:/* @__PURE__ */H(Q,{children:[
|
|
15
|
-
/* @__PURE__ */X(R,{variant:"secondary",onClick:a,children:"Cancel"}),
|
|
16
|
-
/* @__PURE__ */X(R,{variant:"primary",onClick:()=>r(i),disabled:d||!k||w,children:"Move here"})]}),children:[
|
|
17
|
-
/* @__PURE__ */H("div",{className:"flex items-center gap-1 mb-2 min-h-8",children:[null!==i&&/* @__PURE__ */X(c,{"aria-label":"Back",size:"sm",onClick:()=>s(p),children:/* @__PURE__ */X(O,{name:"arrow-left",className:"h-4 w-4"})}),
|
|
18
|
-
/* @__PURE__ */X("span",{className:"text-sm font-medium text-ink-strong truncate",children:null===i?"My files":g?.name??""})]}),
|
|
19
|
-
/* @__PURE__ */X("div",{className:"border border-line rounded-(--radius-control) h-64 overflow-auto",children:d?/* @__PURE__ */X(z,{size:"sm",padding:"p-6",label:"Loading"}):0===u.length?/* @__PURE__ */X("div",{className:"p-6 text-center text-sm text-ink-faintest",children:"No folders here."}):/* @__PURE__ */X("ul",{children:u.map(e=>/* @__PURE__ */X("li",{children:/* @__PURE__ */H("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__ */X(O,{name:"folder",look:"solid",tone:"muted",className:"h-4 w-4 shrink-0"}),
|
|
21
|
-
/* @__PURE__ */X("span",{className:"truncate flex-1",children:e.name}),
|
|
22
|
-
/* @__PURE__ */X(O,{name:"chevron-right",tone:"muted",className:"h-4 w-4 shrink-0"})]})},e.id))})}),!k&&/* @__PURE__ */X("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]=I(null),[s,l]=I(null);Y(()=>{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__ */H("div",{className:"py-2",children:[
|
|
23
|
-
/* @__PURE__ */X("dt",{className:"text-2xs text-ink-faint",children:e}),
|
|
24
|
-
/* @__PURE__ */X("dd",{className:"text-sm text-ink break-words",children:t})]}):null;/* @__PURE__ */
|
|
25
|
-
return H("aside",{className:"w-72 shrink-0 border-l border-line flex flex-col min-h-0 bg-surface","aria-label":"Details",children:[
|
|
26
|
-
/* @__PURE__ */H("div",{className:"flex items-center gap-2 px-3 h-12 shrink-0",children:[d&&/* @__PURE__ */X(O,{name:d.name,tone:d.tone,className:"h-5 w-5 shrink-0"}),
|
|
27
|
-
/* @__PURE__ */X("span",{className:"flex-1 truncate text-sm font-medium text-ink-strong",children:t?ne(t):n>1?`${n} items selected`:"Details"}),
|
|
28
|
-
/* @__PURE__ */X(c,{"aria-label":"Close details",size:"sm",onClick:a,children:/* @__PURE__ */X(O,{name:"close",className:"h-4 w-4"})})]}),
|
|
29
|
-
/* @__PURE__ */X("div",{className:"flex-1 overflow-auto px-4 pb-4",children:t?/* @__PURE__ */H(Q,{children:[
|
|
30
|
-
/* @__PURE__ */X("div",{className:"h-32 rounded-(--radius-control) bg-surface-sunken flex items-center justify-center mb-3",children:d&&/* @__PURE__ */X(O,{name:d.name,tone:d.tone,className:"h-12 w-12"})}),s&&/* @__PURE__ */H("div",{className:"mb-3",children:[
|
|
31
|
-
/* @__PURE__ */X("div",{className:"text-xs font-medium text-ink-strong mb-1",children:"Who has access"}),0===s.length?/* @__PURE__ */H("p",{className:"text-sm text-ink-faint",children:["Only ","owner"!==t.role&&t.role?t.owner?.name??"its owner":"you"]}):/* @__PURE__ */X("ul",{className:"text-sm text-ink",children:s.map(e=>/* @__PURE__ */H("li",{className:"flex justify-between py-0.5",children:[
|
|
32
|
-
/* @__PURE__ */X("span",{className:"truncate",children:e.person.name}),
|
|
33
|
-
/* @__PURE__ */X("span",{className:"text-ink-faint text-xs",children:"editor"===e.role?"Editor":"Viewer"})]},e.person.id))})]}),
|
|
34
|
-
/* @__PURE__ */H("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__ */X("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 X(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]=I(null),r="image"===_(e)&&e.size<=5242880;return Y(()=>{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__ */X("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */X(je,{entry:e,className:"h-10 w-10"})}function Me(){const n=w(),r=n.title??"Files",P=null!==m(),Z=!P&&!!n.shares&&!!n.sharedWithMe,[_,me]=I(null),[Me,$e]=I(null),[Te,Le]=I([]),[Fe,Ae]=I(()=>/* @__PURE__ */new Set),Ee=J(null),[Pe,We]=I(!0),[Re,Oe]=I(!1),[ze,Ke]=I(null),[Ue,Ie]=I(!1),[Je,Ye]=I(null),[Ge,Ve]=I(null),[Be,He]=I(null),[Xe,Qe]=I(be),[Ze,qe]=I(!1),[_e,et]=I(""),[tt,nt]=I(""),[at,rt]=I({}),[it,st]=I({key:"name",dir:"asc"}),[lt,ot]=I(()=>{const e=y();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"}),ct=J("files"),dt=J(lt);dt.current=lt,Y(()=>{v()},[]);const[mt,ht]=I([]),ut=e=>{Qe(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(""))},[]);Y(()=>{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=V(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]||[];Y(()=>{gt&&pt&&!pt.folders.some(e=>e.id===gt)&&ft("files")},[gt,pt,ft]);const yt=J(0),vt=J(null),bt=J(null),{openPage:xt,openEntity:Nt}=L(),Ct=i(),St=i(),jt=i(),Dt=V(h,u,u);Y(()=>f(),[]),Y(()=>{!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(!P)try{Ke(await n.quota())}catch{}},[n,P]),Tt=G(async(e,t)=>{We(!0);try{await e(),Oe(!1)}catch(e){e instanceof TypeError?Oe(!0):U.error(Ce(e,t))}finally{We(!1)}},[]),Lt=G(async e=>{if(P)return $e(xe(e)),Oe(!1),void We(!1);await Tt(async()=>{$e(await n.list(e))},"Failed to list"),$t()},[n,$t,P,Tt]),Ft=G(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=P?xe(_):await n.list(_).catch(()=>null);return Le((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void We(!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,P,_,Tt]),At=G(async()=>{if(P)return ht([]),void We(!1);await Tt(async()=>{ht(await n.trash())},"Failed to list trash"),$t()},[n,$t,P,Tt]),Et=()=>{"files"===lt?Lt(_):pe(lt)?Ft(lt,tt):"trash"===lt&&At()};Y(()=>{Ae(/* @__PURE__ */new Set),Ee.current=null,Et()},[_,lt,tt]),Y(()=>{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 Pt=()=>{et(""),"search"===dt.current&&ft(ct.current)},Wt=e=>{ft("files"),me(e)},Rt=async(e,t)=>{try{await e()}catch(e){U.error(Ce(e,t))}Et()},Ot=e=>Rt(async()=>{await n.restore(e.id),U.success(`Restored "${e.name}"`)},"Restore failed"),zt=async e=>{await A({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Rt(()=>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){U.error(Ce(e,"Download failed"))}},Ut="files"===lt?Me?.folder??null:null,It=Ut?.role??"owner",Jt="owner"!==It,Yt="files"===lt?_:null,Gt=!P&&("files"!==lt||"viewer"!==It),Vt=!P&&"files"===lt&&"viewer"!==It,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(Yt,r,i?{folderPath:i}:void 0),a++}catch(e){e instanceof $?U.error(Ne(r.name,e)):U.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&U.success(`Uploaded ${a} files`),"files"===lt?Lt(_):Wt(null)},Ht=async e=>{const t=ne(e),a=await E({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?U.error("Names cannot contain slashes"):Rt(()=>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"))},Xt=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 A({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 Rt(async()=>{for(const t of e)await n.remove(t.id)},"Delete failed"),U.success(t?`"${ne(t)}" moved to trash`:`${e.length} items moved to trash`))},Qt=(e,t)=>Rt(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Zt=async(e,t)=>{He(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Rt(async()=>{for(const e of a)await n.move(e.id,t)},"Move failed"),U.success(1===a.length?`Moved "${ne(a[0])}"`:`Moved ${a.length} items`))},qt=()=>{yt.current=0,Ie(!1),Ye(null)};Y(()=>{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=B(()=>le(de(_t,at),it),[_t,at,it]),tn=B(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Fe].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?It:"owner"),sn=e=>!P&&"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 Ae(/* @__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 Ae(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Ee.current=e,t.metaKey||t.ctrlKey?Ae(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):Ae(/* @__PURE__ */new Set([e]))},dn=()=>{Ae(/* @__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?Wt(t.id):Dt?un(t):(async t=>{if(P)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__ */X(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(P)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */X(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__ */X(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */X(O,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Kt)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */X(O,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Ht(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */X(O,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Rt(async()=>{for(const t of e)await n.copy(t.id);U.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__ */X(O,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Ve(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */X(O,{name:"forward",className:"h-4 w-4"}),onSelect:()=>He(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */X(O,{name:"star",className:"h-4 w-4"}),onSelect:()=>Qt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */X(O,{name:"info",className:"h-4 w-4"}),onSelect:()=>{Ae(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */X(O,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Xt(e)}]:[]])},kn=(e,t)=>{const n=Fe.has(t.id)?nn:[t];Ct.open(e,n)&&!Fe.has(t.id)&&(Ae(/* @__PURE__ */new Set([t.id])),Ee.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Fe.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(),Je!==e.id&&Ye(e.id))},onDragLeave:()=>{Je===e.id&&Ye(null)},onDrop:t=>{if(!t.dataTransfer.types.includes(ye))return;t.preventDefault(),t.stopPropagation(),Ye(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(Re)/* @__PURE__ */
|
|
36
|
-
return H("div",{className:"flex flex-col h-full bg-surface",children:[
|
|
37
|
-
/* @__PURE__ */X(F,{title:`${r} - offline`}),
|
|
38
|
-
/* @__PURE__ */X("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */H("div",{className:"max-w-md",children:[
|
|
39
|
-
/* @__PURE__ */X(O,{name:"close-circle",tone:"muted",className:"h-12 w-12 mx-auto mb-3",strokeWidth:1.4}),S()?/* @__PURE__ */H(Q,{children:[
|
|
40
|
-
/* @__PURE__ */X("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
|
|
41
|
-
/* @__PURE__ */X("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */H(Q,{children:[
|
|
42
|
-
/* @__PURE__ */X("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
|
|
43
|
-
/* @__PURE__ */H("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__ */X("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
|
|
45
|
-
/* @__PURE__ */X(R,{variant:"primary",onClick:Et,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=[Jt?{label:"Shared with me",onClick:()=>ft("shared")}:{label:"My files",onClick:()=>Wt(null)},...(Ut?.path??[]).filter(e=>null!==e.id).map(e=>({label:e.name,onClick:()=>Wt(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}`:Ut&&null!==Ut.id?`${r} - ${Ut.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__ */X(O,{name:"folder-plus",className:"h-4 w-4"}),onSelect:async()=>{const e=await E({title:"New folder",placeholder:"Folder name",defaultValue:"Untitled folder",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?U.error("Folder names cannot contain slashes"):(await Rt(()=>n.createFolder(Yt,e),"Create folder failed"),"files"!==lt&&Wt(null)))}},{type:"divider",key:"d1"},{key:"upload",label:"File upload",icon:/* @__PURE__ */X(O,{name:"upload",className:"h-4 w-4"}),onSelect:()=>vt.current?.click()},...n.folderUpload?[{key:"upload-folder",label:"Folder upload",icon:/* @__PURE__ */X(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__ */X(O,{name:t.name,tone:t.tone,className:"h-4 w-4"}),onSelect:()=>{Promise.resolve(n.createOfficeFile(e.kind,Yt)).catch(e=>U.error(Ce(e,"Could not create it")))}}}):[]]),Dn=/* @__PURE__ */H("div",{className:"flex h-full flex-col",children:[
|
|
46
|
-
/* @__PURE__ */X("div",{className:"p-3 pb-2",children:/* @__PURE__ */X(o,{trigger:/* @__PURE__ */H(Q,{children:[
|
|
47
|
-
/* @__PURE__ */X(O,{name:"add",className:"h-5 w-5"}),
|
|
48
|
-
/* @__PURE__ */X("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__ */H("nav",{className:"px-2 flex-1 overflow-auto","aria-label":"Locations",children:[
|
|
50
|
-
/* @__PURE__ */H("button",{onClick:()=>Wt(null),className:Sn("files"===lt&&!Jt),children:[
|
|
51
|
-
/* @__PURE__ */X(O,{name:"home",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"My files"]}),n.recent&&!P&&/* @__PURE__ */H("button",{onClick:()=>ft("recent"),className:Sn("recent"===lt),children:[
|
|
52
|
-
/* @__PURE__ */X(O,{name:"clock",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Recent"]}),n.starred&&!P&&/* @__PURE__ */H("button",{onClick:()=>ft("starred"),className:Sn("starred"===lt),children:[
|
|
53
|
-
/* @__PURE__ */X(O,{name:"star",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Starred"]}),Z&&/* @__PURE__ */H("button",{onClick:()=>ft("shared"),className:Sn("shared"===lt||"files"===lt&&Jt),children:[
|
|
54
|
-
/* @__PURE__ */X(O,{name:"team",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Shared with me"]}),!P&&/* @__PURE__ */H("button",{onClick:()=>ft("trash"),className:Sn("trash"===lt),children:[
|
|
55
|
-
/* @__PURE__ */X(O,{name:"trash",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Trash"]}),pt&&pt.folders.length>0&&/* @__PURE__ */H(Q,{children:[
|
|
56
|
-
/* @__PURE__ */X("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__ */H("button",{onClick:()=>ft({desktopFolderId:e.id}),className:Sn(gt===e.id),children:[
|
|
57
|
-
/* @__PURE__ */X(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
58
|
-
/* @__PURE__ */X("span",{className:"truncate",children:e.name}),
|
|
59
|
-
/* @__PURE__ */X(W,{count:e.itemCount,active:gt===e.id,className:"ml-auto"})]},e.id))]})]}),ze&&/* @__PURE__ */H("div",{className:"px-5 py-3 shrink-0",title:`${d(ze.used)} of ${d(ze.limit)} used`,children:[
|
|
60
|
-
/* @__PURE__ */X("div",{className:"h-1 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */X("div",{className:`h-full ${bn} transition-all`,style:{width:`${vn}%`}})}),
|
|
61
|
-
/* @__PURE__ */H("div",{className:"mt-2 text-2xs text-ink-faint tabular-nums",children:[d(ze.used)," of ",d(ze.limit)," used"]})]})]}),Mn=(e,t)=>/* @__PURE__ */H("span",{className:"inline-flex items-center gap-1",children:[e,
|
|
62
|
-
/* @__PURE__ */X(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"),Tn=pe(lt)||"files"===lt,Ln=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),Fn=Tn&&_t.length>0?/* @__PURE__ */H("div",{className:"flex items-center gap-2 shrink-0",children:[
|
|
63
|
-
/* @__PURE__ */X(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}))}]:[]]}),Z&&/* @__PURE__ */X(o,{trigger:Mn(at.person?"me"===at.person?"Owned by me":Ln.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"}))},...Ln.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__ */X(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,An=Tn&&nn.length>0&&!Dt?/* @__PURE__ */H("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__ */X(c,{"aria-label":"Clear selection",size:"sm",onClick:dn,children:/* @__PURE__ */X(O,{name:"close",className:"h-4 w-4"})}),
|
|
66
|
-
/* @__PURE__ */H("span",{className:"text-sm text-ink mr-2 whitespace-nowrap",children:[nn.length," selected"]}),an&&ln(an)&&/* @__PURE__ */X(c,{"aria-label":"Share",size:"sm",onClick:()=>Ve(an),children:/* @__PURE__ */X(O,{name:"add-person",className:"h-4 w-4"})}),!P&&nn.every(e=>"file"===e.kind)&&/* @__PURE__ */X(c,{"aria-label":"Download",size:"sm",onClick:()=>nn.forEach(Kt),children:/* @__PURE__ */X(O,{name:"download",className:"h-4 w-4"})}),nn.every(on)&&/* @__PURE__ */X(c,{"aria-label":"Move",size:"sm",onClick:()=>He(nn),children:/* @__PURE__ */X(O,{name:"forward",className:"h-4 w-4"})}),!P&&nn.every(sn)&&/* @__PURE__ */X(c,{"aria-label":"Move to trash",size:"sm",onClick:()=>Xt(nn),children:/* @__PURE__ */X(O,{name:"trash",className:"h-4 w-4"})}),
|
|
67
|
-
/* @__PURE__ */X(o,{trigger:/* @__PURE__ */X(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(nn)})]}):null,En=/* @__PURE__ */X("div",{className:"flex items-center gap-2 px-4 pb-2 min-h-12 shrink-0",children:An??/* @__PURE__ */H(Q,{children:[
|
|
68
|
-
/* @__PURE__ */H("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:["files"===lt?/* @__PURE__ */X("div",{className:"min-w-0 text-base [&_*]:text-base",children:/* @__PURE__ */X(a,{items:xn,maxItems:5})}):"trash"===lt?/* @__PURE__ */X("span",{className:"text-base font-medium text-ink-strong",children:"Trash"}):"object"==typeof lt?/* @__PURE__ */H(Q,{children:[
|
|
69
|
-
/* @__PURE__ */X(j,{className:"h-4 w-4 text-amber-500 shrink-0"}),
|
|
70
|
-
/* @__PURE__ */X("span",{className:"text-base font-medium text-ink-strong truncate",children:kt?.name??"Desktop folder"}),
|
|
71
|
-
/* @__PURE__ */X("span",{className:"text-2xs text-ink-faintest whitespace-nowrap",children:"Desktop shortcuts"})]}):/* @__PURE__ */X("span",{className:"text-base font-medium text-ink-strong truncate",children:Nn}),"files"===lt&&Jt&&"viewer"===It&&/* @__PURE__ */H("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__ */X(O,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),"files"===lt&&Jt&&Ut?.owner&&/* @__PURE__ */H("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",Ut.owner.name]})]}),Fn,"trash"===lt&&/* @__PURE__ */X(R,{variant:"secondary-danger",size:"sm",onClick:async()=>{if(0===mt.length)return;await A({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"})&&Rt(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===mt.length,children:"Empty trash"})]})}),Pn=(e,t)=>Dt?null:/* @__PURE__ */H("div",{className:"flex items-center justify-end "+(t?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:[ln(e)&&/* @__PURE__ */X(c,{"aria-label":"Share",size:"sm",onClick:t=>{t.stopPropagation(),Ve(e)},children:/* @__PURE__ */X(O,{name:"add-person",className:"h-4 w-4"})}),!P&&"file"===e.kind&&/* @__PURE__ */X(c,{"aria-label":"Download",size:"sm",onClick:t=>{t.stopPropagation(),Kt(e)},children:/* @__PURE__ */X(O,{name:"download",className:"h-4 w-4"})}),n.setStarred&&!P&&/* @__PURE__ */X(c,{"aria-label":e.starred?"Remove from starred":"Add to starred","aria-pressed":!!e.starred,size:"sm",onClick:t=>{t.stopPropagation(),Qt([e],!e.starred)},children:/* @__PURE__ */X(O,{name:"star",look:e.starred?"solid":void 0,tone:e.starred?"warning":void 0,className:"h-4 w-4"})}),
|
|
73
|
-
/* @__PURE__ */X("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */X(o,{trigger:/* @__PURE__ */X(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(Fe.has(e.id)&&nn.length>1?nn:[e])})})]}),Wn=e=>/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
74
|
-
/* @__PURE__ */X(je,{entry:e}),
|
|
75
|
-
/* @__PURE__ */X("span",{className:"truncate",title:e.name,children:ne(e)}),!!e.shareCount&&/* @__PURE__ */X("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__ */X(O,{name:"team",tone:"muted",className:"h-3.5 w-3.5"})}),e.starred&&/* @__PURE__ */X("span",{className:"shrink-0",role:"img","aria-label":"Starred",title:"Starred",children:/* @__PURE__ */X(O,{name:"star",look:"solid",tone:"warning",className:"h-3.5 w-3.5"})})]}),Rn=(e,t,n)=>{const a=it.key===e;/* @__PURE__ */
|
|
76
|
-
return X("th",{className:`${K} font-medium px-3 h-9 ${n}`,"aria-sort":a?"asc"===it.dir?"ascending":"descending":void 0,children:/* @__PURE__ */H("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__ */X(O,{name:"arrow-up",className:"h-3 w-3"}):/* @__PURE__ */X(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?Pe?/* @__PURE__ */X(z,{size:"sm",padding:"p-6",label:"Loading"}):/* @__PURE__ */X("div",{className:"p-10 text-center text-sm text-ink-faintest",children:_t.length>0?"Nothing matches these filters.":On??/* @__PURE__ */H(Q,{children:["This folder is empty.",Vt&&/* @__PURE__ */H(Q,{children:[" Drop files here or choose ",
|
|
77
|
-
/* @__PURE__ */X("span",{className:"font-medium",children:"New"}),"."]})]})}):"grid"===Xe?/* @__PURE__ */X("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__ */H("section",{className:"mb-4",children:[
|
|
78
|
-
/* @__PURE__ */X("h3",{className:"text-xs font-medium text-ink-faint mb-2",children:"folder"===e?"Folders":"Files"}),
|
|
79
|
-
/* @__PURE__ */X("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.map(t=>{const a=Fe.has(t.id);/* @__PURE__ */
|
|
80
|
-
return H("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||Je===t.id?"border-accent-border bg-accent-tint":"border-line bg-surface-sunken hover:bg-row-hover"),children:[
|
|
81
|
-
/* @__PURE__ */H("div",{className:"flex items-center gap-2 pl-3 pr-1 h-11",children:[
|
|
82
|
-
/* @__PURE__ */X(je,{entry:t,className:"h-4 w-4"}),
|
|
83
|
-
/* @__PURE__ */X("span",{className:"flex-1 truncate text-sm",title:t.name,children:ne(t)}),
|
|
84
|
-
/* @__PURE__ */X("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */X(o,{trigger:/* @__PURE__ */X(O,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(a&&nn.length>1?nn:[t])})})]}),"file"===e&&/* @__PURE__ */H(Q,{children:[
|
|
85
|
-
/* @__PURE__ */X("div",{className:"mx-2 h-28 rounded-lg bg-surface flex items-center justify-center overflow-hidden",children:/* @__PURE__ */X(De,{entry:t,read:P?void 0:n.read})}),
|
|
86
|
-
/* @__PURE__ */H("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__ */H("table",{className:"w-full text-sm table-fixed",children:[
|
|
87
|
-
/* @__PURE__ */X("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[Rn("name","Name","text-left"),Z&&Rn("owner","Owner","text-left w-32"),Rn("modified","Modified","text-left w-28"),Rn("size","Size","text-right w-20"),
|
|
88
|
-
/* @__PURE__ */X("th",{className:`${K} w-32`,children:/* @__PURE__ */X("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
89
|
-
/* @__PURE__ */X("tbody",{children:en.map(e=>{const t=Fe.has(e.id);/* @__PURE__ */
|
|
90
|
-
return H("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||Je===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
|
|
91
|
-
/* @__PURE__ */X("td",{className:"px-3 h-11",children:Wn(e)}),Z&&/* @__PURE__ */X("td",{className:"px-3 h-11 text-ink-faint truncate",children:ie(e)}),
|
|
92
|
-
/* @__PURE__ */X("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:ve(e.modifiedAt),children:re(e.modifiedAt)}),
|
|
93
|
-
/* @__PURE__ */X("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__ */X("td",{className:"px-2 h-11",children:Pn(e,t)})]},e.id)})})]}),Kn=Pe&&0===mt.length?/* @__PURE__ */X(z,{size:"sm",padding:"p-6",label:"Loading"}):0===mt.length?/* @__PURE__ */X("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty. What you delete stays here for 30 days."}):/* @__PURE__ */H("table",{className:"w-full text-sm table-fixed",children:[
|
|
95
|
-
/* @__PURE__ */X("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[
|
|
96
|
-
/* @__PURE__ */X("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
97
|
-
/* @__PURE__ */X("th",{className:`${K} text-left font-medium px-3 h-9 w-48`,children:"Original location"}),
|
|
98
|
-
/* @__PURE__ */X("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Deleted"}),
|
|
99
|
-
/* @__PURE__ */X("th",{className:`${K} text-right font-medium px-3 h-9 w-24`,children:"Size"}),
|
|
100
|
-
/* @__PURE__ */X("th",{className:`${K} w-28`,children:/* @__PURE__ */X("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
101
|
-
/* @__PURE__ */X("tbody",{children:mt.map(e=>/* @__PURE__ */H("tr",{className:"group border-b border-line-subtle hover:bg-row-hover",onContextMenu:t=>St.open(t,e),children:[
|
|
102
|
-
/* @__PURE__ */X("td",{className:"px-3 h-11",children:/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
103
|
-
/* @__PURE__ */X(je,{entry:e}),
|
|
104
|
-
/* @__PURE__ */X("span",{className:"truncate",title:e.name,children:e.name})]})}),
|
|
105
|
-
/* @__PURE__ */X("td",{className:"px-3 h-11 text-ink-faint text-xs truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
106
|
-
/* @__PURE__ */X("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__ */X("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":d(e.size)}),
|
|
108
|
-
/* @__PURE__ */X("td",{className:"px-2 h-11",children:/* @__PURE__ */H("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
109
|
-
/* @__PURE__ */X(c,{"aria-label":"Restore",size:"sm",onClick:()=>Ot(e),children:/* @__PURE__ */X(O,{name:"revert",className:"h-4 w-4"})}),
|
|
110
|
-
/* @__PURE__ */X(c,{"aria-label":"Delete forever",size:"sm",variant:"ghost-danger",onClick:()=>zt(e),children:/* @__PURE__ */X(O,{name:"trash",className:"h-4 w-4"})})]})})]},e.id))})]}),Un=0===wt.length?/* @__PURE__ */X("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__ */H("table",{className:"w-full text-sm table-fixed",children:[
|
|
111
|
-
/* @__PURE__ */X("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */H("tr",{children:[
|
|
112
|
-
/* @__PURE__ */X("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
113
|
-
/* @__PURE__ */X("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Type"}),
|
|
114
|
-
/* @__PURE__ */X("th",{className:`${K} w-32`,children:/* @__PURE__ */X("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
115
|
-
/* @__PURE__ */X("tbody",{children:wt.map(e=>/* @__PURE__ */H("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__ */X("td",{className:"px-3 h-11",children:/* @__PURE__ */H("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
117
|
-
/* @__PURE__ */X(D,{item:e}),
|
|
118
|
-
/* @__PURE__ */X("span",{className:"truncate",title:e.label,children:e.label})]})}),
|
|
119
|
-
/* @__PURE__ */X("td",{className:"px-3 h-11 text-xs text-ink-faint",children:M(e)}),
|
|
120
|
-
/* @__PURE__ */X("td",{className:"px-2 h-11",children:/* @__PURE__ */H("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
121
|
-
/* @__PURE__ */X(c,{"aria-label":"Open",size:"sm",onClick:()=>Mt(e),children:/* @__PURE__ */X(O,{name:"external",className:"h-4 w-4"})}),
|
|
122
|
-
/* @__PURE__ */X(c,{"aria-label":"Move to desktop",size:"sm",onClick:()=>pt?.moveToDesktop([e]),children:/* @__PURE__ */X(O,{name:"desktop",className:"h-4 w-4"})}),
|
|
123
|
-
/* @__PURE__ */X(c,{"aria-label":"Remove",size:"sm",variant:"ghost-danger",onClick:()=>pt?.removeShortcuts([e]),children:/* @__PURE__ */X(O,{name:"close",className:"h-4 w-4"})})]})})]},`${e.entityType}|${e.entityId}`))})]});/* @__PURE__ */
|
|
124
|
-
return H("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Vt&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),yt.current++,Ue||Ie(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{yt.current>0&&yt.current--,0===yt.current&&Ie(!1)},onDrop:e=>{e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),qt(),Vt&&e.dataTransfer.files?.length&&Bt(e.dataTransfer.files))},children:[
|
|
125
|
-
/* @__PURE__ */X(F,{title:Cn}),
|
|
126
|
-
/* @__PURE__ */X(k,{app:"files"}),
|
|
127
|
-
/* @__PURE__ */X("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__ */X("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__ */X("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */X(t,{sidebar:Dn,storageKey:"files.sidebarWidth",defaultWidth:220,minWidth:170,maxWidth:320,children:/* @__PURE__ */H("div",{className:"flex h-full min-w-0",children:[
|
|
130
|
-
/* @__PURE__ */H("div",{className:"flex flex-1 min-w-0 flex-col",children:[Dt&&/* @__PURE__ */H("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__ */X(O,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
|
|
132
|
-
/* @__PURE__ */X("span",{className:"flex-1 min-w-0 truncate",children:Dt.request.title}),
|
|
133
|
-
/* @__PURE__ */X(R,{variant:"secondary",size:"sm",onClick:()=>p(Dt.id,null),children:"Cancel"}),
|
|
134
|
-
/* @__PURE__ */X(R,{variant:"primary",size:"sm",disabled:!fn,onClick:()=>{fn&&un(fn)},children:"Open"})]}),
|
|
135
|
-
/* @__PURE__ */H("div",{className:"flex items-center gap-1 px-4 py-2 shrink-0",children:[
|
|
136
|
-
/* @__PURE__ */X("div",{className:"flex-1 min-w-48 max-w-2xl",role:"search",children:/* @__PURE__ */X(l,{type:"text",enterKeyHint:"search",value:_e,onChange:e=>{et(e.target.value),e.target.value.trim()||Pt()},onKeyDown:e=>{"Escape"===e.key&&_e&&(e.stopPropagation(),Pt())},placeholder:`Search in ${r}`,"aria-label":`Search in ${r}`,leftIcon:/* @__PURE__ */X(O,{name:"search",className:"h-4 w-4"}),endAction:_e?{label:"Clear search",icon:/* @__PURE__ */X(O,{name:"close",className:"h-4 w-4"}),onClick:Pt}:void 0})}),
|
|
137
|
-
/* @__PURE__ */X("div",{className:"flex-1"}),"object"!=typeof lt&&"trash"!==lt&&/* @__PURE__ */H(Q,{children:[
|
|
138
|
-
/* @__PURE__ */X(c,{"aria-label":"List view","aria-pressed":"list"===Xe,onClick:()=>ut("list"),children:/* @__PURE__ */X(O,{name:"list",className:"h-4 w-4"})}),
|
|
139
|
-
/* @__PURE__ */X(c,{"aria-label":"Grid view","aria-pressed":"grid"===Xe,onClick:()=>ut("grid"),children:/* @__PURE__ */X(O,{name:"grid",className:"h-4 w-4"})})]}),
|
|
140
|
-
/* @__PURE__ */X(c,{"aria-label":"Details","aria-pressed":Ze,onClick:()=>qe(e=>!e),children:/* @__PURE__ */X(O,{name:"info",className:"h-4 w-4"})})]}),En,
|
|
141
|
-
/* @__PURE__ */X("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(),Xt(nn)):"Enter"===e.key&&an?(e.preventDefault(),pn(an)):(e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&en.length&&(e.preventDefault(),Ae(new Set(en.map(e=>e.id)))))},onClick:e=>{e.target===e.currentTarget&&dn()},children:"object"==typeof lt?Un:"trash"===lt?Kn:zn})]}),Ze&&Tn&&/* @__PURE__ */X(fe,{store:n,entry:an,selectedCount:nn.length,onClose:()=>qe(!1)})]})})}),Ct.state&&/* @__PURE__ */X(s,{...Ct.props,items:gn(Ct.state.data),"aria-label":"File actions"}),St.state&&/* @__PURE__ */X(s,{...St.props,"aria-label":"Trash actions",items:[{key:"restore",label:"Restore",icon:/* @__PURE__ */X(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__ */X(O,{name:"trash",className:"h-4 w-4"}),onSelect:()=>zt(St.state.data)}]}),jt.state&&/* @__PURE__ */X(s,{...jt.props,"aria-label":"Shortcut actions",items:[{key:"open",label:"Open",icon:/* @__PURE__ */X(O,{name:"external",className:"h-4 w-4"}),onSelect:()=>Mt(jt.state.data)},{key:"desktop",label:"Move to desktop",icon:/* @__PURE__ */X(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__ */X(O,{name:"close",className:"h-4 w-4"}),onSelect:()=>pt?.removeShortcuts([jt.state.data])}]}),Z&&/* @__PURE__ */X(he,{store:n,entry:Ge,onClose:()=>Ve(null),onChanged:Et}),n.move&&/* @__PURE__ */X(ue,{store:n,items:Be,from:"files"===lt?_:void 0,onClose:()=>He(null),onMove:e=>Be&&Zt(Be,e)}),Ue&&/* @__PURE__ */X("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__ */X("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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-VLKJN6HX.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-3YBXA72C.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";
|
package/dist/Sidebar-SAGLPIOC.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-U6LKNGC6.js";import{ResizeHandle as l}from"./chunk-OOWPLQD5.js";import{openGlobalSearch as s}from"./chunk-N2445WHJ.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as S,PopupMenuItem as C,PopupMenuDivider as L}from"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as $}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as W}from"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as A,useRef as I,useEffect as T,isValidElement as H,cloneElement as M}from"react";import{jsx as D,jsxs as K,Fragment as O}from"react/jsx-runtime";var R="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),P=150,J=250;function Q(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var U=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),B="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",E="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function G({open:e,children:t}){const r=I(null);return T(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */D("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */D("div",{className:"min-h-0 overflow-hidden",children:t})})}function X({open:e}){/* @__PURE__ */
|
|
2
|
-
return D($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function F({dir:e}){/* @__PURE__ */
|
|
3
|
-
return D($,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function V({className:e}){/* @__PURE__ */
|
|
4
|
-
return D($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var Y=e=>.75+1.75*e+"rem";function _({width:b,openWidth:P=x,collapsed:J,onToggleCollapsed:_,onResize:Z,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=W().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=A(()=>t(r(n))),we=z(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Se,Ce]=A(!1),Le=I(null),$e=J&&!le,[We,ze]=A(!1),Ae=I("pointer"),Ie=I(void 0),Te=I(!1),He=I(null),Me=()=>{clearTimeout(Ie.current),Ie.current=void 0},De=e=>{Me(),Ae.current=e,ze(!0)},Ke=()=>{Me(),ze(!1)};T(()=>{Me(),ze(!1)},[J]),T(()=>()=>Me(),[]),T(()=>{if(!We)return;const e=e=>{const t=e.target;t&&(He.current?.contains(t)||t.closest?.('[role="menu"]'))||(Me(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[We]);const Oe=J&&!We,Re=J&&We?P:b,Pe=(e,t)=>{Ke(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Je=(e,t)=>{const r=t[e];/* @__PURE__ */
|
|
5
|
-
return D("span",{className:E,"aria-hidden":"true",children:r&&H(r)?M(r,{className:"size-[18px]"}):r})},Qe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Ue=(e,t,r=we)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
|
|
6
|
-
return K("div",{children:[
|
|
7
|
-
/* @__PURE__ */K("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:U(l,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Je(e.to,ce),
|
|
8
|
-
/* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
|
|
9
|
-
/* @__PURE__ */D(X,{open:o})]}),
|
|
10
|
-
/* @__PURE__ */D(G,{open:o,children:/* @__PURE__ */D("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Ue(e,t+1,Qe(n)))})}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
|
|
11
|
-
return K("div",{children:[
|
|
12
|
-
/* @__PURE__ */K("button",{type:"button",onClick:t=>Pe(e,t),onAuxClick:t=>{1===t.button&&Pe(e,t)},"aria-current":a?"page":void 0,className:U(a,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Je(e.to,ce),
|
|
13
|
-
/* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)},Be=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */D("span",{className:E,"aria-hidden":"true",children:e.icon}):Je(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Oe)/* @__PURE__ */
|
|
14
|
-
return K("div",{children:[
|
|
15
|
-
/* @__PURE__ */D("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),De("tap")},className:U(a,!0),children:n}),o&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
|
|
16
|
-
return K("div",{children:[
|
|
17
|
-
/* @__PURE__ */K("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:U(!l&&a,!1),children:[n,
|
|
18
|
-
/* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
|
|
19
|
-
/* @__PURE__ */D(X,{open:l})]}),
|
|
20
|
-
/* @__PURE__ */D(G,{open:l,children:/* @__PURE__ */D("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Ue(e,1,Qe(r)))})}),o&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ee=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Ge=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Xe=re?.avatar_url?/* @__PURE__ */D("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */D("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ge}),Fe=Se?Le.current?.getBoundingClientRect():void 0,Ve=Oe?"":"px-3",Ye=Oe?{paddingInline:y}:void 0,_e=`${J?xe.expandSidebar:xe.collapseSidebar} (${R?"⌘":"Ctrl"} .)`,Ze=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:_,label:J?xe.expandSidebar:xe.collapseSidebar,title:_e},qe=/* @__PURE__ */K(O,{children:[he&&/* @__PURE__ */D(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Oe&&/* @__PURE__ */K("span",{className:"min-w-0 text-left leading-tight",children:[
|
|
21
|
-
/* @__PURE__ */D("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */D("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
|
|
22
|
-
return K("aside",{ref:He,"aria-label":xe.navLabel,"data-rail-peek":We?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${J?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${We?"rounded-r-(--radius-panel)":""}`,style:{width:Re,boxShadow:We?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Te.current=!0,$e&&(We?Me():(Me(),Ie.current=setTimeout(()=>De("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Te.current=!1,$e&&(Me(),We&&!Se&&"pointer"===Ae.current&&(Ie.current=setTimeout(Ke,250))))},onFocus:e=>{$e&&!We&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&De("focus")},onBlur:e=>{if(!We||"focus"!==Ae.current)return;const t=e.relatedTarget;t&&He.current?.contains(t)||Se||Te.current||Ke()},onKeyDown:e=>{"Escape"===e.key&&We&&Ke()},children:[
|
|
23
|
-
/* @__PURE__ */K("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Oe?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ze?/* @__PURE__ */D("button",{type:"button",onClick:Ze.run,"aria-label":Ze.label,title:Ze.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Oe?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */D("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */D(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */D($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):J?We&&
|
|
24
|
-
/* @__PURE__ */D("button",{type:"button",onClick:()=>{Ke(),_()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${R?"⌘":"Ctrl"} .)`,className:B,children:/* @__PURE__ */D(F,{dir:"right"})}):/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${R?"⌘":"Ctrl"} .)`,className:B,children:/* @__PURE__ */D(F,{dir:"left"})})]}),
|
|
25
|
-
/* @__PURE__ */D("div",{className:`shrink-0 pt-3 ${Ve}`,style:Ye,children:Oe?/* @__PURE__ */D("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${R?"⌘K":"Ctrl K"})`,className:U(!1,!0),children:/* @__PURE__ */D(V,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */K("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
|
|
26
|
-
/* @__PURE__ */D(V,{className:"size-3.5 text-gray-500"}),
|
|
27
|
-
/* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
|
|
28
|
-
/* @__PURE__ */D("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:R?"⌘K":"Ctrl K"})]})}),
|
|
29
|
-
/* @__PURE__ */K("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ve} ${Oe?"space-y-1":"space-y-0.5"}`,style:Ye,children:[Oe&&/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${R?"⌘":"Ctrl"} .)`,className:`${U(!1,!0)} mb-3`,children:/* @__PURE__ */D(F,{dir:"right"})}),ye.topItems.map(e=>{if(!Oe)return Ue(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
|
|
30
|
-
return K("div",{children:[
|
|
31
|
-
/* @__PURE__ */D("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Pe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),De("tap")},className:U(r,!0),children:Je(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Be(e,!1)),ye.systemSections.map(e=>Be(e,!1)),ye.virtualSections.map(e=>Be(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Be(e,!1))]}),
|
|
32
|
-
/* @__PURE__ */D("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ve}`,style:Ye,children:/* @__PURE__ */K("button",{ref:Le,type:"button",onClick:()=>Ce(e=>!e),"aria-haspopup":"menu","aria-expanded":Se,"aria-label":Oe?xe.accountMenu(Ee):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Oe?"justify-center py-2":"px-2 py-2"),children:[Xe,!Oe&&/* @__PURE__ */K("span",{className:"min-w-0 flex-1 text-left",children:[
|
|
33
|
-
/* @__PURE__ */D("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ee}),ne?.email&&Ee!==ne.email&&/* @__PURE__ */D("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),Z&&!J&&!le&&/* @__PURE__ */D(l,{side:"left",width:b,onResize:Z,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Se&&Fe&&/* @__PURE__ */K(S,{portal:!0,minWidth:224,onClose:()=>{Ce(!1),We&&"pointer"===Ae.current&&!Te.current&&Ke()},style:Q(Re,Fe,window.innerHeight),children:[Oe&&/* @__PURE__ */K("div",{className:"border-b border-line px-3 py-3",children:[
|
|
34
|
-
/* @__PURE__ */D("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ee}),ne?.email&&/* @__PURE__ */D("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
|
|
35
|
-
/* @__PURE__ */K(C,{onClick:()=>{Ce(!1),Ke(),ee("/profile",!1)},children:[
|
|
36
|
-
/* @__PURE__ */D($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */K(C,{onClick:()=>{Ce(!1),Pe(e)},children:[
|
|
37
|
-
/* @__PURE__ */D("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */K(C,{onClick:()=>{Ce(!1),Ke(),oe()},children:[
|
|
38
|
-
/* @__PURE__ */D($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
|
|
39
|
-
/* @__PURE__ */D(L,{}),ae&&/* @__PURE__ */K(O,{children:[
|
|
40
|
-
/* @__PURE__ */K(C,{onClick:()=>{Ce(!1),Ke(),ae()},children:[
|
|
41
|
-
/* @__PURE__ */D($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
|
|
42
|
-
/* @__PURE__ */D(L,{})]}),
|
|
43
|
-
/* @__PURE__ */K(C,{danger:!0,onClick:()=>{Ce(!1),Ke(),ie()},children:[
|
|
44
|
-
/* @__PURE__ */D($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{J as RAIL_PEEK_CLOSE_MS,P as RAIL_PEEK_OPEN_MS,Q as accountMenuPosition,_ as default};
|
package/dist/chunk-2SGOKMUU.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-PT4GMPUB.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-EVYD6UFQ.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as y}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as k,glassStyle as j}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-JSHMIMAJ.js";import{useState as D,useId as N,useRef as S,useMemo as C,useEffect as M}from"react";import{createPortal as W}from"react-dom";import{jsxs as R,jsx as T}from"react/jsx-runtime";function E(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var F=["right-2","right-8","right-16"],z=[8,32,64];function A(A){const{options:L,placeholder:O,emptyOptionLabel:I,className:U="",disabled:Y,id:H,filter:J=!1,allowFreeText:B=!1,freeTextOption:P,onSearchChange:V,loading:G=!1,error:K,onRetry:Z,rightAdornment:Q,endAction:X,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=A,re=!0===A.multiple,le=A.multiple?A.value:A.value?[A.value]:[],oe=A.multiple?"":A.value,ie=e=>{A.multiple?A.onChange(e):A.onChange(e[0]??"")},ae=le.length>0,se=J&&ae&&!Y,ce=re||J,ue=null!=P,de=B||ue,[he,pe]=D(!1),[me,fe]=D(-1),be=N(),ge=H??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=D(""),ke=$(),je=I??ke.select.none,$e=e=>{xe(e),fe(-1),V?.(e)},De=S(null),Ne=S(null),Se=S(null),Ce=S(null),Me=S(he);Me.current=he;const We=S(!1),Re=e=>{Me.current&&(Me.current=!1,e&&B&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Te=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),Re(!1)}},[Ee,Fe]=D(null);y(()=>{if(!Q||he)return void Fe(null);const e=Ce.current?.offsetWidth??0;Fe(e?e+z[Ye]+6:null)});const ze=v(Ne,he,ce?{popupRef:Se}:{matchTriggerWidth:!0}),Ae=C(()=>t(L),[L]),Le=le.join("\0"),Oe=C(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Ae)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Ae,Le,de]),Ie=Oe.join(", "),Ue=_&&ae&&!Y,Ye=(Ue?1:0)+(X?1:0),[He,Je]=D(null),Be=S(null),Pe=S(""),Ve=S(()=>{});Ve.current=()=>{const e=Ne.current,t=Be.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Oe.join("\0")}`;if(o===Pe.current)return;Pe.current=o;let i=null;r>0&&Oe.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=E(Oe,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Je(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Ve.current()}),M(()=>{const e=Ne.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ve.current());return t.observe(e),()=>t.disconnect()},[re]);const Ge=Oe.length,Ke=!re||!He||He.shown>=Ge?Ie:0===He.shown?ke.select.selectedCount(Ge):`${Oe.slice(0,He.shown).join(", ")} +${Ge-He.shown}`,Ze=re&&null!==He&&(He.shown<Ge||He.cut),Qe=he&&ae&&ce;M(()=>{if(!he)return;const e=e=>{const t=e.target;De.current?.contains(t)||Se.current?.contains(t)||Re(!0)};document.addEventListener("mousedown",e);const t=b(()=>Re(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,B,ye,Le,A.onChange]),M(()=>{if(he)return x(e=>!("Escape"!==e.key||!Me.current)&&(Re(!1),Ne.current?.blur(),!0),()=>Se.current)},[he]);const Xe=C(()=>{const e=/* @__PURE__ */new Set;return n(L,t=>!e.has(t.value)&&(e.add(t.value),!0))},[L]),qe=C(()=>{if(V)return Xe;const e=ye.trim().toLowerCase();return e?n(Xe,t=>r(t,e)):Xe},[Xe,ye,V]),_e=C(()=>t(qe),[qe]),et=ye.trim(),tt=C(()=>ue&&et?Ae.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Ae,Le]),nt=C(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
-
return R("div",{ref:De,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(De.current?.contains(t)||Se.current?.contains(t))||We.current||document.activeElement!==Ne.current&&Re(!0)},children:[(rt=/* @__PURE__ */T("input",{id:ge,ref:Ne,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ke,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{Y||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(Y)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Te(nt[me],me):1!==_e.length||_e[0].disabled?B&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),Re(!1),Ne.current?.blur())):Te(_e[0],0)):"Escape"===t.key?(Re(!1),Ne.current?.blur()):"Tab"===t.key&&Re(!0)},placeholder:Qe?Ke:O||je,className:`${se?u:d} ${U} ${a[Ye]}${Y?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Qe?" rosh-field-shows-choice":""}`,style:Ee?{paddingRight:Ee}:void 0,disabled:Y}),re?/* @__PURE__ */T(f,{content:!he&&Ze?Ie:null,className:"block",children:rt}):rt),re&&
|
|
3
|
-
/* @__PURE__ */T("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */T("span",{ref:Be,className:"whitespace-pre"})}),Ye>0&&
|
|
4
|
-
/* @__PURE__ */R(s,{children:[Ue&&
|
|
5
|
-
/* @__PURE__ */T("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */T(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */T(p,{name:"close"}),onClick:()=>{ie([]),Re(!1)}}})}),X&&/* @__PURE__ */T("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */T(c,{action:X})})]}),Q&&!he&&/* @__PURE__ */T("div",{ref:Ce,className:`absolute top-1/2 -translate-y-1/2 ${F[Ye]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:Q}),he&&W(
|
|
6
|
-
/* @__PURE__ */R("div",{ref:Se,onMouseDownCapture:()=>{We.current=!0,setTimeout(()=>{We.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:ze?.left,right:ze?.right,top:ze?.top,bottom:ze?.bottom,minWidth:ze?.minWidth,width:ze?.width,...ce&&{maxWidth:ze?.maxWidth},visibility:ze?void 0:"hidden",...j()},children:[re&&ae&&_&&!Y&&
|
|
7
|
-
/* @__PURE__ */T("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${k}`,children:ke.select.clearAll}),G?
|
|
8
|
-
/* @__PURE__ */T(m,{size:"sm",padding:"py-2",label:ke.search.searching}):K?/* @__PURE__ */R("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
-
/* @__PURE__ */T("span",{className:"min-w-0 flex-1",children:K}),Z&&/* @__PURE__ */T(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:Z,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
-
/* @__PURE__ */R("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:ze?.maxHeight??w},children:[0===nt.length?G||K?null:/* @__PURE__ */T("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
-
return R("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Te(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */T(o,{selected:n}),
|
|
12
|
-
/* @__PURE__ */T("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */T(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&P&&
|
|
13
|
-
/* @__PURE__ */T("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Te(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */T("span",{className:"min-w-0 flex-1 truncate",children:P(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{A as SearchableSelect,E as fitChoice};
|
package/dist/chunk-4Y33Y4OX.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{usePlotWidth as e}from"./chunk-MAFUXCPZ.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-JSHMIMAJ.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:S=[4,22],className:D,emptyLabel:U}){const L=m().charts,W=h(),I=z??(e=>f(e,W)),P=$??(e=>f(e,W)),V=U??L.noObservations,C=u(null),E=e(C),F=v??E,J=p(),[O,Q]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(Q(null),!0))},[O]);const B=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),H=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),T=j||w?H.map(e=>({...e,points:e.points.filter(e=>B(e.x,j)&&B(e.y,w))})).filter(e=>e.points.length>0):H,X=H.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
|
|
2
|
-
return y("div",{className:D,ref:C,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const Z=T.flatMap(e=>e.points),K=Z.some(e=>null!=e.size),Y=14,q=20,G=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Z.map(e=>e.y),w,R,{from:k-G,to:Y}),ie=t(te.ticks(5).map(P),_),le=Math.max(ie+1,F-q),re=ee(Z.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Z.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=O?T[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
-
return g("div",{className:`relative ${D??""}`,ref:C,children:[
|
|
4
|
-
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${F} ${k}`,role:"img","aria-label":L.scatter(T.map(e=>e.label),A??L.yAxis,M??L.xAxis)+(X>0?`. ${L.outsideRange(X)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Q(null),onBlur:()=>Q(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;Q(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
-
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:J,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:Y-S[1],width:le-ie+2*S[1],height:k-G-Y+2*S[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
|
-
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
-
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:I(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${J})`,children:T.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:K?oe(l.size??0):S[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>Q({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(n,{title:ae.label??ne.label,rows:[{key:"x",label:M??L.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:I(ae.x)},{key:"y",label:A??L.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.y)},...null!=ae.size?[{key:"size",label:L.size,color:a.muted,value:f(ae.size,W)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
package/dist/chunk-574SLTKO.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as t}from"./chunk-HY6CBG4M.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-JSHMIMAJ.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:M,className:k,emptyLabel:v}){const $=l().charts,w=i(),N=M??(t=>s(t,w)),j=v??$.noFlows,[y,F]=c(null),{highlighted:C}=o(),E=h(u,f,x,$.other),{labels:I,matrix:A,otherIndex:z,foldedCount:H}=E,Q=(t,e)=>A[t]?.[e]??0,L=t=>t===z?r.muted:a(t),O=E.totals,V=I.map((t,e)=>e).sort((t,e)=>O[e]-O[t]),W=V.reduce((t,e)=>t+O[e],0);if(W<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Y=p/2,B=p/2,J=p/2-44,P=J-b,R=g*V.length,S=/* @__PURE__ */new Map;let T=-Math.PI/2;V.forEach((t,e)=>{const o=O[t]/W*(2*Math.PI-R);S.set(t,{start:T,end:T+o,slot:e}),T+=o+g});const U=/* @__PURE__ */new Map,D=[];for(const t of V)for(const e of V){const o=Q(t,e);if(o<=0)continue;const n=S.get(t),r=o/Math.max(1,O[t])*(n.end-n.start),a=U.get(t)??0;U.set(t,a+r),D.push({from:t,to:e,value:o,a:n.start+a+r/2,b:S.get(e).start+(S.get(e).end-S.get(e).start)/2})}const G=(t,e)=>[Y+e*Math.cos(t),B+e*Math.sin(t)],Z="arc"===y?.kind?y.index:void 0,q="ribbon"===y?.kind?D[y.index]:void 0;/* @__PURE__ */
|
|
2
|
-
return m("div",{className:`relative ${k??""}`,children:[
|
|
3
|
-
/* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(V.length),onMouseLeave:()=>F(null),children:[D.map((t,e)=>{const[o,n]=G(t.a,P),[r,a]=G(t.b,P),l=L(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==C?I[t.from]===C||I[t.to]===C:null)(t,e);/* @__PURE__ */
|
|
4
|
-
return d("path",{d:`M${o},${n} Q${Y},${B} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/W*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>F({kind:"ribbon",index:e})},`${I[t.from]}→${I[t.to]}`)}),V.map(t=>{const o=S.get(t),n=(o.start+o.end)/2,[a,l]=G(n,J+16),i=(t=>y?"arc"===y.kind?y.index===t:D[y.index].from===t||D[y.index].to===t:null!==C?I[t]===C:null)(t);/* @__PURE__ */
|
|
5
|
-
return m("g",{onMouseEnter:()=>F({kind:"arc",index:t}),children:[
|
|
6
|
-
/* @__PURE__ */d("path",{d:e(Y,B,P,J,o.start,o.end),fill:L(t),fillOpacity:null===i||i?1:.45}),
|
|
7
|
-
/* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:I[t]})]},t)})]}),H>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(H)}),void 0!==Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:I[Z],rows:[{key:"total",label:$.totalFlow,color:L(Z),value:N(O[Z])}]})}),q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${I[q.from]} → ${I[q.to]}`,rows:[{key:"value",label:$.flow,color:L(q.from),value:N(q.value)}]})}),
|
|
8
|
-
/* @__PURE__ */d(t,{caption:$.chord(V.length),head:[$.tableFrom,$.tableTo,$.value],rows:D.map(t=>[I[t.from],I[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
|
package/dist/chunk-64J7TYJ3.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,usePopupLevel as t,usePopupLevelBindings as a,windowScrimStyle as o,OverlayLayerProvider as l,scrimHasCorners as n,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as d}from"./chunk-TGLUENXE.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-7QSDPSXP.js";import{useFocusTrap as u,useScrollLock as p}from"./chunk-DWGYC7OD.js";import{Icon as f}from"./chunk-ISVODSRP.js";import{useHydrated as h}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as v}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-JSHMIMAJ.js";import{useRef as b,useId as y,useState as g,useEffect as k}from"react";import{createPortal as w}from"react-dom";import{jsxs as N,Fragment as j,jsx as $}from"react/jsx-runtime";var C="bg-black/30 backdrop-blur-sm",D={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function S({open:S,onClose:W,title:E,description:G,role:I="dialog",children:T,footer:U,blocking:V=!1,size:J="md",aside:P=!1,dirty:A=!1,initialFocus:F,"aria-label":H,"aria-labelledby":L,"aria-describedby":M,className:O=""}){const Q=b(null),R=y(),X=y(),Y=!V,z=y(),B=x().dialog,Z=e(h()),[q,K]=g(null),_=d({open:S,dirty:A,onClose:W,title:E,layer:q}),ee=b(null),re=r(S&&null!==Z,ee),ie=i(re,Q),te=t(S&&null!==Z,ee),ae=a(te,q),oe=o(te),le=null!==te.host;if(m(S),u(Q,S&&null!==Z,F,ae),p(S),k(()=>{if(S)return v(()=>!ae.current?.(document.activeElement)&&(V||_(),!0),()=>Q.current)},[S,V,_,ae]),!S||!Z)return null;/* @__PURE__ */
|
|
2
|
-
return N(j,{children:[/* @__PURE__ */$("span",{ref:ee,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
-
/* @__PURE__ */$(l,{value:q,children:/* @__PURE__ */N("div",{ref:K,className:"fixed inset-0"+(P?" pointer-events-none opacity-0":le?" pointer-events-none":""),style:s(te),role:"presentation","data-overlay-layer":"","data-aside":P?"":void 0,children:[!le&&/* @__PURE__ */$("div",{className:`fixed inset-0 ${C}`,"aria-hidden":"true","data-popup-scrim":"system"}),oe&&/* @__PURE__ */$("div",{className:`fixed ${C}${P?"":" pointer-events-auto"}${n(te)?" rounded-(--radius-window)":""}`,style:oe,onClick:V?void 0:_,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
-
/* @__PURE__ */$("div",{className:re?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:V||le?void 0:e=>{e.target===e.currentTarget&&_()},children:/* @__PURE__ */N("div",{ref:Q,"data-popup-panel":"",style:re?{left:ie?.left??0,top:ie?.top??0,visibility:ie?void 0:"hidden"}:void 0,...c({role:I,modal:!0,titleId:E?z:void 0,labelledBy:L,label:H}),"aria-describedby":M??(G?X:T?R:void 0),className:`${re?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${D[J]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl${le&&!P?" pointer-events-auto":""} ${O}`.trim(),children:[E&&/* @__PURE__ */$("h2",{id:z,className:(Y?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:E}),G&&/* @__PURE__ */$("p",{id:X,className:((E?"mt-1":Y?"pr-8":"")+" text-sm text-gray-500").trim(),children:G}),T&&/* @__PURE__ */$("div",{id:R,className:"mt-2 text-sm text-gray-600",children:T}),U&&/* @__PURE__ */$("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:U}),Y&&/* @__PURE__ */$("button",{type:"button",onClick:_,"aria-label":B.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */$(f,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),Z)]})}export{S as Dialog};
|
package/dist/chunk-A4PFVMQ2.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-HY6CBG4M.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as r}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:M}){const j=n().charts,w=m(),N=y??(e=>h(e,w)),$=M??j.nothingToBreakDown,C=c(null),A=a(C),B=v??A,[F,H]=u(null),{highlighted:Y}=l(),z=e(p,B,d);if(0===z.length)/* @__PURE__ */
|
|
2
|
-
return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const D=k??i(0),G=Math.max(...z.map(e=>e.value),1),I=e=>34+e/G*62,S=e=>`color-mix(in oklab, ${D} ${I(e).toFixed(0)}%, ${o.surface})`,V=e=>I(e)>=55?o.surface:o.label,E=F??Y,J=F?z.find(e=>e.key===F):void 0;/* @__PURE__ */
|
|
3
|
-
return f("div",{className:`relative ${b??""}`,ref:C,children:[
|
|
4
|
-
/* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${B} ${d}`,role:"img","aria-label":j.treemap(p.length),onMouseLeave:()=>H(null),children:z.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
|
|
5
|
-
return f("g",{opacity:E&&E!==e.key?.55:1,onMouseEnter:()=>H(e.key),children:[
|
|
6
|
-
/* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:S(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:V(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:V(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),J&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(r,{title:J.label,rows:[{key:"value",label:j.value,color:S(J.value),value:N(J.value)}]})}),
|
|
7
|
-
/* @__PURE__ */s(t,{caption:j.treemap(p.length),head:[j.tableItem,j.value],rows:z.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
|
package/dist/chunk-BHHFVIAD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-CMJD5URC.js";import{toDayMs as i,fmtSliderDate as t,DAY_MS as a}from"./chunk-7TC3LJQM.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-JSHMIMAJ.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:M=null,onHoverChange:y}){const b=l(Date.now,null),j=[],C=[],x=o().timeline,J=r();for(const e of p){const n=i(e.date??null);null===n?C.push({key:e.key,label:e.label,kind:e.kind}):j.push({...e,ms:n})}j.sort((e,n)=>e.ms-n.ms);const D=i(g??null);let H,L,w=!0;0===j.length?(L=D??b??0,H=L-30*a,w=null!==D||null!==b):(H=j[0].ms,L=D??j[j.length-1].ms,L-H<a&&(L=H+a));const N=j.length>0?Math.max(0,Math.round((L-H)/a)):0,O=u??(N>0?x.duration(N):void 0),K=[j.length>0?x.started(t(j[0].ms,J)):void 0,O,C.length>0?x.reached(j.length,p.length):void 0],S=j.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),T={};for(const e of j)e.phase&&(T[e.phase]=T[e.phase]||[]).push(e.ms);const A=Object.entries(T).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),I="rail"===v,Q=w&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:I?"spread":"compressed",labels:I?"none":"lanes",items:S,pending:C,phases:A,startMs:H,endMs:L,todayMs:b??void 0,edgeCaptions:f,highlightKeys:M,onHoverChange:y,ariaLabel:x.milestones(m)})});/* @__PURE__ */
|
|
2
|
-
return h("div",I?{className:"shrink-0","data-timeline-variant":"rail",children:Q}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:K,children:Q})})}export{m as MilestoneTimeline};
|
package/dist/chunk-DG2TGWXI.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:M="polygon",rings:v=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),A=C??W.nothingToCompare,R=p(),[H,L]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
|
|
2
|
-
return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:A});const B=y/2,E=y/2,J=y/2-46,Q=o(k.length),S=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/S[e])),l=Q.center(e)-Q.step/2;return[B+J*r*Math.cos(l),E+J*r*Math.sin(l)]},U=(e,t)=>null!==H?H!==e:null!==Y&&Y!==t,V=null!==H?z[H]:void 0;/* @__PURE__ */
|
|
3
|
-
return f("div",{className:`relative ${$??""}`,children:[
|
|
4
|
-
/* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":R,onMouseLeave:()=>L(null),children:[
|
|
5
|
-
/* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:v},(e,r)=>{const l=J*(r+1)/v;return"circle"===M?/* @__PURE__ */d("circle",{cx:B,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(B,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,S[t]);/* @__PURE__ */
|
|
6
|
-
return f("g",{children:[
|
|
7
|
-
/* @__PURE__ */d("line",{x1:B,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
|
|
8
|
-
/* @__PURE__ */d("text",{x:B+(J+18)*Math.cos(Q.center(t)-Q.step/2),y:E+(J+18)*Math.sin(Q.center(t)-Q.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
|
|
9
|
-
/* @__PURE__ */d(r,{id:R,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
|
|
10
|
-
return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
|
|
11
|
-
/* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:V.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(H,3,V.color,V.tone),value:w(V.values[t]??0)}))})}),
|
|
12
|
-
/* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
|
|
14
|
-
/* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
15
|
-
/* @__PURE__ */d(e,{caption:W.acrossMeasures(z.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:z.map(e=>[e.label,...k.map((t,r)=>w(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
|