efficient-shell 12.13.0 → 12.14.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 +5 -1
- package/dist/{Browser-OFC3QRX3.js → Browser-V35ERC75.js} +14 -14
- package/dist/{Calculator-RP4UPGG7.js → Calculator-FY7CWH3U.js} +22 -22
- package/dist/{CurrencyConverter-HZWRB62S.js → CurrencyConverter-X2ZMKSB6.js} +9 -9
- package/dist/Files-5QCSSGZO.js +141 -0
- package/dist/{Notepad-77VJ4DK4.js → Notepad-2AXGNMRM.js} +10 -10
- package/dist/PdfViewer-F2TCC5UD.js +1 -0
- package/dist/PomodoroTimer-LQM4OSNO.js +91 -0
- package/dist/{Preview-DXEYBUYC.js → Preview-NI7HTAAW.js} +36 -36
- package/dist/Sidebar-ADAIERCI.js +44 -0
- package/dist/{Stock-WK45DFIC.js → Stock-ENUIGK4M.js} +3 -3
- package/dist/{Weather-BVKZQI4R.js → Weather-QRQVA3LE.js} +21 -21
- package/dist/{WorldClock-L3BQXXQX.js → WorldClock-QJOV3TND.js} +6 -6
- package/dist/ai/index.js +79 -79
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-YX4MRM7A.js → chunk-232YPI2L.js} +6 -6
- package/dist/{chunk-W4NVTD5Q.js → chunk-24JKQX2N.js} +4 -4
- package/dist/{chunk-5EKNXSQG.js → chunk-24LO6OH4.js} +1 -1
- package/dist/{chunk-EDANELWX.js → chunk-2DYVVHZA.js} +1 -1
- package/dist/{chunk-RKYWKMUK.js → chunk-2NZ7CVMW.js} +1 -1
- package/dist/{chunk-GCVIUXKL.js → chunk-2ZPNA7L7.js} +1 -1
- package/dist/{chunk-45HQXTA6.js → chunk-3A6FYWFQ.js} +1 -1
- package/dist/{chunk-ITGFHWYG.js → chunk-3HZS3BAZ.js} +12 -12
- package/dist/{chunk-27ZJQUDS.js → chunk-3N5OI6VM.js} +1 -1
- package/dist/{chunk-JTZVUO3I.js → chunk-3YBXA72C.js} +1 -1
- package/dist/{chunk-4XS4DO4T.js → chunk-42XSMAIK.js} +1 -1
- package/dist/{chunk-2GS2VOQT.js → chunk-4BKJ6A5H.js} +9 -9
- package/dist/{chunk-Y23BITKG.js → chunk-4I4WZHMV.js} +1 -1
- package/dist/{chunk-JGJWPONL.js → chunk-4IHYWLWE.js} +5 -5
- package/dist/{chunk-KIRLSUQT.js → chunk-4LOHQ4QB.js} +5 -5
- package/dist/{chunk-YVAJ42M2.js → chunk-4Y33Y4OX.js} +6 -6
- package/dist/{chunk-654DGV5Q.js → chunk-56XKHWNL.js} +1 -1
- package/dist/chunk-574SLTKO.js +8 -0
- package/dist/{chunk-MFZPTS7W.js → chunk-5MH5N76F.js} +4 -4
- package/dist/{chunk-UYTFNR4W.js → chunk-5VGIIMON.js} +1 -1
- package/dist/{chunk-5ZQY42QX.js → chunk-5WZ53AS5.js} +1 -1
- package/dist/{chunk-YFDS6KF3.js → chunk-6A26HUVK.js} +1 -1
- package/dist/{chunk-LRKFMR4K.js → chunk-6KITIRNZ.js} +2 -2
- package/dist/{chunk-GB2XLSR5.js → chunk-74JMBOQH.js} +10 -10
- package/dist/{chunk-6YIVKPWQ.js → chunk-75H4BWNC.js} +1 -1
- package/dist/{chunk-AUCNJFTP.js → chunk-7K3FYCRZ.js} +9 -9
- package/dist/{chunk-4NLCXHWN.js → chunk-7X2P6IH3.js} +4 -4
- package/dist/{chunk-SEHKTBVM.js → chunk-7ZJRBFHA.js} +1 -1
- package/dist/chunk-A4PFVMQ2.js +7 -0
- package/dist/{chunk-BFCIOWYI.js → chunk-AELSVMXH.js} +1 -1
- package/dist/{chunk-JZKACEXW.js → chunk-AQZUTW7N.js} +8 -8
- package/dist/{chunk-ZV6WLVD3.js → chunk-B2KQ3T7Q.js} +6 -6
- package/dist/chunk-BHHFVIAD.js +2 -0
- package/dist/{chunk-EQ2KTDOU.js → chunk-BWYOTLJL.js} +3 -3
- package/dist/{chunk-GMJ5WOB2.js → chunk-CBVKGAZH.js} +1 -1
- package/dist/{chunk-BYDSBDVS.js → chunk-CEIIQRK5.js} +6 -6
- package/dist/{chunk-GMLDGXNQ.js → chunk-CJ3MI2NH.js} +1 -1
- package/dist/{chunk-FZWAOYAM.js → chunk-CMJD5URC.js} +9 -9
- package/dist/{chunk-EO6MOQOZ.js → chunk-DCNSQGHJ.js} +12 -12
- package/dist/chunk-DG2TGWXI.js +15 -0
- package/dist/{chunk-D4K72BHN.js → chunk-DGHSCKOE.js} +4 -4
- package/dist/{chunk-GBEDLYND.js → chunk-DJXXY23A.js} +2 -2
- package/dist/{chunk-EKDXJQIP.js → chunk-DJYZ2EF4.js} +10 -10
- package/dist/{chunk-Q64F2EXW.js → chunk-EDX55XGV.js} +6 -6
- package/dist/{chunk-QULE4LAC.js → chunk-EEAY7FJW.js} +17 -17
- package/dist/{chunk-WMIU2VR5.js → chunk-EEB5XPWP.js} +2 -2
- package/dist/{chunk-ZLFZJX6M.js → chunk-EGCHJHRR.js} +8 -8
- package/dist/chunk-ENFXDIIZ.js +8 -0
- package/dist/{chunk-U35TIWEP.js → chunk-EZ6O5TQ3.js} +16 -16
- package/dist/{chunk-CB5FQMFB.js → chunk-FI6IJTAJ.js} +12 -12
- package/dist/{chunk-JVNJCRHM.js → chunk-FJVZ2W55.js} +1 -1
- package/dist/{chunk-EAXPSAHZ.js → chunk-FQHPGREQ.js} +9 -9
- package/dist/{chunk-NBUL37WB.js → chunk-FUTLZ6BC.js} +1 -1
- package/dist/chunk-FVKXDF2Q.js +12 -0
- package/dist/{chunk-QGFAQVUO.js → chunk-G3E4CD77.js} +6 -6
- package/dist/{chunk-AG6Y62TP.js → chunk-G6LSBF3P.js} +69 -69
- package/dist/{chunk-SFFELHLP.js → chunk-GC4N4UQM.js} +5 -5
- package/dist/{chunk-4UQNNA4K.js → chunk-GEVNBBM7.js} +1 -1
- package/dist/{chunk-M2VCZAMQ.js → chunk-GOEHP2XM.js} +3 -3
- package/dist/{chunk-G3VRO4CK.js → chunk-GUHCKMC7.js} +2 -2
- package/dist/{chunk-B7HTKDT3.js → chunk-H32UNWVU.js} +5 -5
- package/dist/chunk-HGOWQO63.js +1 -0
- package/dist/{chunk-NHIP2S4E.js → chunk-HJF4UZOA.js} +13 -13
- package/dist/{chunk-5T4WTFBC.js → chunk-I3TVRNUT.js} +1 -1
- package/dist/{chunk-5NCR64CE.js → chunk-IIC76MWQ.js} +1 -1
- package/dist/{chunk-6BNLDGST.js → chunk-ILIPEY3D.js} +1 -1
- package/dist/{chunk-FSZ3TNAR.js → chunk-JAVTQART.js} +1 -1
- package/dist/{chunk-HEX3EP5F.js → chunk-JFGJJNT2.js} +4 -4
- package/dist/chunk-JSHMIMAJ.js +1 -0
- package/dist/{chunk-SWB32OKH.js → chunk-JTGRLXZN.js} +1 -1
- package/dist/{chunk-NV7QRWQJ.js → chunk-JZBLOIL7.js} +1 -1
- package/dist/{chunk-O3YCIWHF.js → chunk-KAKJ7ENS.js} +2 -2
- package/dist/{chunk-YPZXE67U.js → chunk-KSMEWOCE.js} +1 -1
- package/dist/{chunk-LTN4AQYG.js → chunk-KX53AB74.js} +1 -1
- package/dist/chunk-L7MWAC2P.js +6 -0
- package/dist/{chunk-WJBP5SND.js → chunk-LIWBCIRZ.js} +4 -4
- package/dist/{chunk-NORR52Z3.js → chunk-LIX6KTZJ.js} +1 -1
- package/dist/{chunk-P3GBQBDC.js → chunk-LQVQX5B2.js} +1 -1
- package/dist/{chunk-WQV7VQ5Z.js → chunk-MRLXGLNZ.js} +1 -1
- package/dist/{chunk-KWTK6TGH.js → chunk-MWTCGJAI.js} +1 -1
- package/dist/{chunk-6JLXXX4H.js → chunk-N2445WHJ.js} +12 -12
- package/dist/{chunk-5POLDDQW.js → chunk-NBNYKV3D.js} +7 -7
- package/dist/{chunk-I5UM6UZF.js → chunk-NKP5WCEA.js} +6 -6
- package/dist/{chunk-MEAJGM6F.js → chunk-NOGSS432.js} +1 -1
- package/dist/{chunk-V6FHZGCL.js → chunk-OM6VWUAZ.js} +1 -1
- package/dist/{chunk-EIXMUGVZ.js → chunk-OOWPLQD5.js} +2 -2
- package/dist/{chunk-NOEAEXIZ.js → chunk-OVD3ECM7.js} +1 -1
- package/dist/chunk-PCZSE6CC.js +5 -0
- package/dist/{chunk-UG5GKEU5.js → chunk-QADNVFV5.js} +1 -1
- package/dist/{chunk-BET6KEY2.js → chunk-QPYVCG74.js} +12 -12
- package/dist/chunk-QU23OGAX.js +27 -0
- package/dist/{chunk-VCNTSE3H.js → chunk-R7QEGRKE.js} +1 -1
- package/dist/{chunk-ZR2UWJIR.js → chunk-RBS3AWE7.js} +1 -1
- package/dist/{chunk-WM2BBRT6.js → chunk-RF3ZFTAU.js} +1 -1
- package/dist/{chunk-HYQBYMJX.js → chunk-RMDVKQJE.js} +2 -2
- package/dist/{chunk-42BVXJZN.js → chunk-RZ2DWX4N.js} +5 -5
- package/dist/{chunk-PDCCNHTP.js → chunk-SDL4VWFU.js} +1 -1
- package/dist/{chunk-VPZOSVDF.js → chunk-SE6IQZYW.js} +9 -9
- package/dist/chunk-SNLGA2PZ.js +1 -0
- package/dist/{chunk-ISU4FCEX.js → chunk-SR4W2SYQ.js} +4 -4
- package/dist/{chunk-TJCJLKJB.js → chunk-T3JSUBIF.js} +1 -1
- package/dist/{chunk-SY65V6K7.js → chunk-T7D73HT7.js} +9 -9
- package/dist/chunk-TU2L7NW3.js +7 -0
- package/dist/{chunk-VLCHHTX6.js → chunk-TYQ2JL4J.js} +1 -1
- package/dist/{chunk-QQ5XCRZM.js → chunk-UEEELXEN.js} +8 -8
- package/dist/{chunk-LMUB2EAD.js → chunk-UULBPDAH.js} +8 -8
- package/dist/chunk-UWLGKMH5.js +9 -0
- package/dist/{chunk-Z7RXWXR5.js → chunk-V4XR4MOS.js} +1 -1
- package/dist/{chunk-4MUE4CYB.js → chunk-VBLCYL4L.js} +1 -1
- package/dist/chunk-VDYF3WPJ.js +2 -0
- package/dist/{chunk-MAI2DN7N.js → chunk-VEQ45GAH.js} +1 -1
- package/dist/{chunk-HE24VQMU.js → chunk-VFHKD7TQ.js} +1 -1
- package/dist/{chunk-TCMAWDBL.js → chunk-VJXPT53M.js} +18 -18
- package/dist/{chunk-P44RCA6Z.js → chunk-VP2GI3UP.js} +8 -8
- package/dist/{chunk-44VAZ2EL.js → chunk-VYRVSTI6.js} +9 -9
- package/dist/{chunk-QQM36CYU.js → chunk-W2663E4S.js} +3 -3
- package/dist/{chunk-QMNDKNK2.js → chunk-WESNFWM4.js} +1 -1
- package/dist/{chunk-NGQZI7HP.js → chunk-WLUJQLXG.js} +1 -1
- package/dist/chunk-WNOXHJVT.js +9 -0
- package/dist/{chunk-EVEGK57J.js → chunk-WPG3ZHYT.js} +1 -1
- package/dist/{chunk-QCOXJXGZ.js → chunk-WQ4YKWN2.js} +1 -1
- package/dist/{chunk-YVIV7SKG.js → chunk-WXZZGHET.js} +1 -1
- package/dist/{chunk-BGBSEPPH.js → chunk-WYGUHCJ2.js} +8 -8
- package/dist/{chunk-BM5QI2L6.js → chunk-XG5ER6GJ.js} +6 -6
- package/dist/{chunk-ASOVTAIT.js → chunk-XHSMDUEW.js} +3 -3
- package/dist/{chunk-YMJOFWW6.js → chunk-XKJGJNY2.js} +3 -3
- package/dist/{chunk-6P7SIIG4.js → chunk-XKNKRKHH.js} +14 -14
- package/dist/chunk-XQWHKXLS.js +22 -0
- package/dist/{chunk-GOKJZKLV.js → chunk-XU3YOWEG.js} +1 -1
- package/dist/{chunk-SXHNZFUY.js → chunk-Y6E7IRK2.js} +1 -1
- package/dist/{chunk-5HOXR3L4.js → chunk-Y7KDCC6E.js} +1 -1
- package/dist/chunk-YHB6MJYD.js +28 -0
- package/dist/{chunk-AKTEMZOT.js → chunk-YO26RV3H.js} +1 -1
- package/dist/{chunk-SEMV4NCH.js → chunk-YU52WMSH.js} +1 -1
- package/dist/chunk-YX2OOGV7.js +4 -0
- package/dist/{chunk-RQKD5AAL.js → chunk-Z66QBDNU.js} +1 -1
- package/dist/{chunk-IARCNQD3.js → chunk-ZGWXSHVM.js} +1 -1
- package/dist/{chunk-AXFNOY2L.js → chunk-ZTRKM3B5.js} +7 -7
- 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.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/index.js +665 -665
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +2 -2
- 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/globalSearchModel.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +2 -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.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.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Files-HBJGKKO2.js +0 -141
- package/dist/PdfViewer-BFP2WCMQ.js +0 -1
- package/dist/PomodoroTimer-ME3BMHKR.js +0 -91
- package/dist/Sidebar-FU7TD5FQ.js +0 -44
- package/dist/chunk-4WWK6FHD.js +0 -1
- package/dist/chunk-675RYIWR.js +0 -7
- package/dist/chunk-6VB4TBU6.js +0 -9
- package/dist/chunk-7ADTFFEM.js +0 -5
- package/dist/chunk-CA3OC4YY.js +0 -9
- package/dist/chunk-EAIHBASJ.js +0 -28
- package/dist/chunk-FQHY6DTF.js +0 -4
- package/dist/chunk-GFOJM52T.js +0 -15
- package/dist/chunk-HL3V67JZ.js +0 -2
- package/dist/chunk-HLZJLFVR.js +0 -12
- package/dist/chunk-HULQSIX5.js +0 -8
- package/dist/chunk-ISZOD5S6.js +0 -2
- package/dist/chunk-J7CHHY7O.js +0 -6
- package/dist/chunk-JB3JD2XK.js +0 -22
- package/dist/chunk-KOPTKTHN.js +0 -7
- package/dist/chunk-MXITMJCT.js +0 -27
- package/dist/chunk-TJSJVC6P.js +0 -1
- package/dist/chunk-WGRS6QBT.js +0 -1
- package/dist/chunk-YRG6XJ6M.js +0 -8
package/dist/Files-HBJGKKO2.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import{openPreviewFile as e}from"./chunk-TJCJLKJB.js";import{SidebarLayout as t}from"./chunk-BM5QI2L6.js";import"./chunk-QWK6DRSN.js";import"./chunk-EIXMUGVZ.js";import{SearchableSelect as n}from"./chunk-ITGFHWYG.js";import{Breadcrumbs as a}from"./chunk-SWB32OKH.js";import{Select_default as r}from"./chunk-TCMAWDBL.js";import"./chunk-EO5RLFRX.js";import"./chunk-RAOM3WIQ.js";import"./chunk-2NMW66P5.js";import{useContextMenu as i,ContextMenu as s}from"./chunk-7ARBBWPQ.js";import{Input_default as l}from"./chunk-CU3ZE25J.js";import{DropdownMenu as o}from"./chunk-KCAUYEYR.js";import"./chunk-W7DYKTHE.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-XJW65EIG.js";import{AboutApp as k}from"./chunk-UYTFNR4W.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 T,FilesQuotaError as M,FILES_OFFICE_EXTENSIONS as $}from"./chunk-J2YURAQY.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as L,WindowTitle as A}from"./chunk-AG6Y62TP.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SXHNZFUY.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NGQZI7HP.js";import{confirm as W,prompt as R}from"./chunk-MXITMJCT.js";import{Dialog as F}from"./chunk-7ADTFFEM.js";import{ItemCount as E}from"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-27ZJQUDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-QCOXJXGZ.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-4WWK6FHD.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as P}from"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as z}from"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as K}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as O}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-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useState as I,useRef as J,useEffect as Y,useCallback as G,useSyncExternalStore as Q,useMemo as V}from"react";import{jsxs as B,jsx as H,Fragment as X}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?$[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 B(F,{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__ */H(P,{variant:"secondary",onClick:a,children:"Done"}),children:[
|
|
3
|
-
/* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
|
|
4
|
-
/* @__PURE__ */H("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */H(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__ */H("div",{className:"w-28 shrink-0",children:/* @__PURE__ */H(r,{value:k,onChange:e=>w(e),options:me,"aria-label":"Access"})}),
|
|
6
|
-
/* @__PURE__ */H(P,{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__ */H("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */H(K,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */B("ul",{className:"divide-y divide-line-subtle text-sm",children:[
|
|
8
|
-
/* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
|
|
9
|
-
/* @__PURE__ */H("span",{className:"flex-1 truncate",children:"You"}),
|
|
10
|
-
/* @__PURE__ */H("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
|
|
11
|
-
/* @__PURE__ */H("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
|
|
12
|
-
/* @__PURE__ */H("div",{className:"w-28 shrink-0",children:/* @__PURE__ */H(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__ */H(c,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:y,onClick:()=>S(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */H(z,{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 B(F,{open:!!t,onClose:a,title:`Move ${v}`,size:"sm",footer:/* @__PURE__ */B(X,{children:[
|
|
15
|
-
/* @__PURE__ */H(P,{variant:"secondary",onClick:a,children:"Cancel"}),
|
|
16
|
-
/* @__PURE__ */H(P,{variant:"primary",onClick:()=>r(i),disabled:d||!k||w,children:"Move here"})]}),children:[
|
|
17
|
-
/* @__PURE__ */B("div",{className:"flex items-center gap-1 mb-2 min-h-8",children:[null!==i&&/* @__PURE__ */H(c,{"aria-label":"Back",size:"sm",onClick:()=>s(p),children:/* @__PURE__ */H(z,{name:"arrow-left",className:"h-4 w-4"})}),
|
|
18
|
-
/* @__PURE__ */H("span",{className:"text-sm font-medium text-ink-strong truncate",children:null===i?"My files":g?.name??""})]}),
|
|
19
|
-
/* @__PURE__ */H("div",{className:"border border-line rounded-(--radius-control) h-64 overflow-auto",children:d?/* @__PURE__ */H(K,{size:"sm",padding:"p-6",label:"Loading"}):0===u.length?/* @__PURE__ */H("div",{className:"p-6 text-center text-sm text-ink-faintest",children:"No folders here."}):/* @__PURE__ */H("ul",{children:u.map(e=>/* @__PURE__ */H("li",{children:/* @__PURE__ */B("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__ */H(z,{name:"folder",look:"solid",tone:"muted",className:"h-4 w-4 shrink-0"}),
|
|
21
|
-
/* @__PURE__ */H("span",{className:"truncate flex-1",children:e.name}),
|
|
22
|
-
/* @__PURE__ */H(z,{name:"chevron-right",tone:"muted",className:"h-4 w-4 shrink-0"})]})},e.id))})}),!k&&/* @__PURE__ */H("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__ */B("div",{className:"py-2",children:[
|
|
23
|
-
/* @__PURE__ */H("dt",{className:"text-2xs text-ink-faint",children:e}),
|
|
24
|
-
/* @__PURE__ */H("dd",{className:"text-sm text-ink break-words",children:t})]}):null;/* @__PURE__ */
|
|
25
|
-
return B("aside",{className:"w-72 shrink-0 border-l border-line flex flex-col min-h-0 bg-surface","aria-label":"Details",children:[
|
|
26
|
-
/* @__PURE__ */B("div",{className:"flex items-center gap-2 px-3 h-12 shrink-0",children:[d&&/* @__PURE__ */H(z,{name:d.name,tone:d.tone,className:"h-5 w-5 shrink-0"}),
|
|
27
|
-
/* @__PURE__ */H("span",{className:"flex-1 truncate text-sm font-medium text-ink-strong",children:t?ne(t):n>1?`${n} items selected`:"Details"}),
|
|
28
|
-
/* @__PURE__ */H(c,{"aria-label":"Close details",size:"sm",onClick:a,children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})})]}),
|
|
29
|
-
/* @__PURE__ */H("div",{className:"flex-1 overflow-auto px-4 pb-4",children:t?/* @__PURE__ */B(X,{children:[
|
|
30
|
-
/* @__PURE__ */H("div",{className:"h-32 rounded-(--radius-control) bg-surface-sunken flex items-center justify-center mb-3",children:d&&/* @__PURE__ */H(z,{name:d.name,tone:d.tone,className:"h-12 w-12"})}),s&&/* @__PURE__ */B("div",{className:"mb-3",children:[
|
|
31
|
-
/* @__PURE__ */H("div",{className:"text-xs font-medium text-ink-strong mb-1",children:"Who has access"}),0===s.length?/* @__PURE__ */B("p",{className:"text-sm text-ink-faint",children:["Only ","owner"!==t.role&&t.role?t.owner?.name??"its owner":"you"]}):/* @__PURE__ */H("ul",{className:"text-sm text-ink",children:s.map(e=>/* @__PURE__ */B("li",{className:"flex justify-between py-0.5",children:[
|
|
32
|
-
/* @__PURE__ */H("span",{className:"truncate",children:e.person.name}),
|
|
33
|
-
/* @__PURE__ */H("span",{className:"text-ink-faint text-xs",children:"editor"===e.role?"Editor":"Viewer"})]},e.person.id))})]}),
|
|
34
|
-
/* @__PURE__ */B("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__ */H("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 H(z,{name:n,tone:a,look:"folder"===e.kind?"solid":void 0,className:`${t} shrink-0`})}function De({entry:e,read:t}){const[n,a]=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__ */H("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */H(je,{entry:e,className:"h-10 w-10"})}function Te(){const n=w(),r=n.title??"Files",F=null!==m(),Z=!F&&!!n.shares&&!!n.sharedWithMe,[_,me]=I(null),[Te,Me]=I(null),[$e,Le]=I([]),[Ae,We]=I(()=>/* @__PURE__ */new Set),Re=J(null),[Fe,Ee]=I(!0),[Pe,ze]=I(!1),[Ke,Oe]=I(null),[Ue,Ie]=I(!1),[Je,Ye]=I(null),[Ge,Qe]=I(null),[Ve,Be]=I(null),[He,Xe]=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=>{Xe(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=Q(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=Q(h,u,u);Y(()=>f(),[]),Y(()=>{!Dt||"trash"!==lt&&"object"!=typeof lt||ft("files")},[Dt,lt,ft]);const Tt=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)},Mt=G(async()=>{if(!F)try{Oe(await n.quota())}catch{}},[n,F]),$t=G(async(e,t)=>{Ee(!0);try{await e(),ze(!1)}catch(e){e instanceof TypeError?ze(!0):U.error(Ce(e,t))}finally{Ee(!1)}},[]),Lt=G(async e=>{if(F)return Me(xe(e)),ze(!1),void Ee(!1);await $t(async()=>{Me(await n.list(e))},"Failed to list"),Mt()},[n,Mt,F,$t]),At=G(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=F?xe(_):await n.list(_).catch(()=>null);return Le((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void Ee(!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 $t(async()=>{Le(await a())},"Failed to list files")},[n,F,_,$t]),Wt=G(async()=>{if(F)return ht([]),void Ee(!1);await $t(async()=>{ht(await n.trash())},"Failed to list trash"),Mt()},[n,Mt,F,$t]),Rt=()=>{"files"===lt?Lt(_):pe(lt)?At(lt,tt):"trash"===lt&&Wt()};Y(()=>{We(/* @__PURE__ */new Set),Re.current=null,Rt()},[_,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 Ft=()=>{et(""),"search"===dt.current&&ft(ct.current)},Et=e=>{ft("files"),me(e)},Pt=async(e,t)=>{try{await e()}catch(e){U.error(Ce(e,t))}Rt()},zt=e=>Pt(async()=>{await n.restore(e.id),U.success(`Restored "${e.name}"`)},"Restore failed"),Kt=async e=>{await W({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Pt(()=>n.purge(e.id),"Delete failed")},Ot=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?Te?.folder??null:null,It=Ut?.role??"owner",Jt="owner"!==It,Yt="files"===lt?_:null,Gt=!F&&("files"!==lt||"viewer"!==It),Qt=!F&&"files"===lt&&"viewer"!==It,Vt=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 M?U.error(Ne(r.name,e)):U.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&U.success(`Uploaded ${a} files`),"files"===lt?Lt(_):Et(null)},Bt=async e=>{const t=ne(e),a=await R({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?U.error("Names cannot contain slashes"):Pt(()=>n.rename(e.id,function(e,t){const n=e.officeKind?$[e.officeKind]:"";return n&&!t.toLowerCase().endsWith(n)?t+n:t}(e,a)),"Rename failed"))},Ht=async e=>{if(0===e.length)return;const t=1===e.length?e[0]:null,a=e.some(e=>"owner"!==(e.role??"owner")),r=t?(t.owner??Te?.folder.owner)?.name??"its owner":"their owners";await W({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 Pt(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`))},Xt=(e,t)=>Pt(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Zt=async(e,t)=>{Be(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Pt(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?Te?.entries??[]:pe(lt)?$e:[],en=V(()=>le(de(_t,at),it),[_t,at,it]),tn=V(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Ae].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?It:"owner"),sn=e=>!F&&"viewer"!==rn(e),ln=e=>Z&&"owner"===rn(e),on=e=>!!n.move&&sn(e),cn=(e,t)=>{if(Dt){const t=tn.get(e);if(t&&"file"===t.kind&&!mn(t))return;return void We(/* @__PURE__ */new Set([e]))}if(t.shiftKey&&Re.current){const t=en.map(e=>e.id),n=t.indexOf(Re.current),a=t.indexOf(e);if(n>=0&&a>=0)return void We(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Re.current=e,t.metaKey||t.ctrlKey?We(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):We(/* @__PURE__ */new Set([e]))},dn=()=>{We(/* @__PURE__ */new Set),Re.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?Te?.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?Et(t.id):Dt?un(t):(async t=>{if(F)return;if(n.open?.(t))return;const a=ke[q(t.name)];a?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:a,load:()=>n.read(t.id),onStaged:e=>xt(e)}):Ot(t)})(t)},gn=e=>{if(0===e.length)return[];const t=1===e.length?e[0]:null;if(Dt)return t&&("folder"===t.kind||mn(t))?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const a=t&&"file"===t.kind&&n.openLabel?.(t)||"Open",r=e.every(e=>"file"===e.kind),i=e.every(sn);if(F)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const s=e.some(e=>!e.starred);return Se([...t?[{key:"open",label:a,icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Ot)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */H(z,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Bt(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */H(z,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Pt(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__ */H(z,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Qe(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */H(z,{name:"forward",className:"h-4 w-4"}),onSelect:()=>Be(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */H(z,{name:"star",className:"h-4 w-4"}),onSelect:()=>Xt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */H(z,{name:"info",className:"h-4 w-4"}),onSelect:()=>{We(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Ht(e)}]:[]])},kn=(e,t)=>{const n=Ae.has(t.id)?nn:[t];Ct.open(e,n)&&!Ae.has(t.id)&&(We(/* @__PURE__ */new Set([t.id])),Re.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Ae.has(e.id)?nn:[e];t.dataTransfer.setData(ye,JSON.stringify(n.map(e=>e.id))),t.dataTransfer.effectAllowed="move"}}:{},yn=e=>"folder"===e.kind&&sn(e)&&n.move?{onDragOver:t=>{t.dataTransfer.types.includes(ye)&&(t.preventDefault(),t.stopPropagation(),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(Pe)/* @__PURE__ */
|
|
36
|
-
return B("div",{className:"flex flex-col h-full bg-surface",children:[
|
|
37
|
-
/* @__PURE__ */H(A,{title:`${r} - offline`}),
|
|
38
|
-
/* @__PURE__ */H("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */B("div",{className:"max-w-md",children:[
|
|
39
|
-
/* @__PURE__ */H(z,{name:"close-circle",tone:"muted",className:"h-12 w-12 mx-auto mb-3",strokeWidth:1.4}),S()?/* @__PURE__ */B(X,{children:[
|
|
40
|
-
/* @__PURE__ */H("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
|
|
41
|
-
/* @__PURE__ */H("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */B(X,{children:[
|
|
42
|
-
/* @__PURE__ */H("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
|
|
43
|
-
/* @__PURE__ */B("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__ */H("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
|
|
45
|
-
/* @__PURE__ */H(P,{variant:"primary",onClick:Rt,children:"Retry"})]})})]});const vn=Ke&&Ke.limit>0?Math.min(100,Math.round(Ke.used/Ke.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:()=>Et(null)},...(Ut?.path??[]).filter(e=>null!==e.id).map(e=>({label:e.name,onClick:()=>Et(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__ */H(z,{name:"folder-plus",className:"h-4 w-4"}),onSelect:async()=>{const e=await R({title:"New folder",placeholder:"Folder name",defaultValue:"Untitled folder",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?U.error("Folder names cannot contain slashes"):(await Pt(()=>n.createFolder(Yt,e),"Create folder failed"),"files"!==lt&&Et(null)))}},{type:"divider",key:"d1"},{key:"upload",label:"File upload",icon:/* @__PURE__ */H(z,{name:"upload",className:"h-4 w-4"}),onSelect:()=>vt.current?.click()},...n.folderUpload?[{key:"upload-folder",label:"Folder upload",icon:/* @__PURE__ */H(z,{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__ */H(z,{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__ */B("div",{className:"flex h-full flex-col",children:[
|
|
46
|
-
/* @__PURE__ */H("div",{className:"p-3 pb-2",children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */B(X,{children:[
|
|
47
|
-
/* @__PURE__ */H(z,{name:"add",className:"h-5 w-5"}),
|
|
48
|
-
/* @__PURE__ */H("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__ */B("nav",{className:"px-2 flex-1 overflow-auto","aria-label":"Locations",children:[
|
|
50
|
-
/* @__PURE__ */B("button",{onClick:()=>Et(null),className:Sn("files"===lt&&!Jt),children:[
|
|
51
|
-
/* @__PURE__ */H(z,{name:"home",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"My files"]}),n.recent&&!F&&/* @__PURE__ */B("button",{onClick:()=>ft("recent"),className:Sn("recent"===lt),children:[
|
|
52
|
-
/* @__PURE__ */H(z,{name:"clock",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Recent"]}),n.starred&&!F&&/* @__PURE__ */B("button",{onClick:()=>ft("starred"),className:Sn("starred"===lt),children:[
|
|
53
|
-
/* @__PURE__ */H(z,{name:"star",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Starred"]}),Z&&/* @__PURE__ */B("button",{onClick:()=>ft("shared"),className:Sn("shared"===lt||"files"===lt&&Jt),children:[
|
|
54
|
-
/* @__PURE__ */H(z,{name:"team",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Shared with me"]}),!F&&/* @__PURE__ */B("button",{onClick:()=>ft("trash"),className:Sn("trash"===lt),children:[
|
|
55
|
-
/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Trash"]}),pt&&pt.folders.length>0&&/* @__PURE__ */B(X,{children:[
|
|
56
|
-
/* @__PURE__ */H("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__ */B("button",{onClick:()=>ft({desktopFolderId:e.id}),className:Sn(gt===e.id),children:[
|
|
57
|
-
/* @__PURE__ */H(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
58
|
-
/* @__PURE__ */H("span",{className:"truncate",children:e.name}),
|
|
59
|
-
/* @__PURE__ */H(E,{count:e.itemCount,active:gt===e.id,className:"ml-auto"})]},e.id))]})]}),Ke&&/* @__PURE__ */B("div",{className:"px-5 py-3 shrink-0",title:`${d(Ke.used)} of ${d(Ke.limit)} used`,children:[
|
|
60
|
-
/* @__PURE__ */H("div",{className:"h-1 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */H("div",{className:`h-full ${bn} transition-all`,style:{width:`${vn}%`}})}),
|
|
61
|
-
/* @__PURE__ */B("div",{className:"mt-2 text-2xs text-ink-faint tabular-nums",children:[d(Ke.used)," of ",d(Ke.limit)," used"]})]})]}),Tn=(e,t)=>/* @__PURE__ */B("span",{className:"inline-flex items-center gap-1",children:[e,
|
|
62
|
-
/* @__PURE__ */H(z,{name:"chevron-down",className:"h-3.5 w-3.5"}),t?"":null]}),Mn=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"),$n=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),An=$n&&_t.length>0?/* @__PURE__ */B("div",{className:"flex items-center gap-2 shrink-0",children:[
|
|
63
|
-
/* @__PURE__ */H(o,{trigger:Tn(at.type?ee[at.type]:"Type",!!at.type),"aria-label":"Type",triggerClassName:Mn(!!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__ */H(o,{trigger:Tn(at.person?"me"===at.person?"Owned by me":Ln.find(e=>e.id===at.person)?.name??"People":"People",!!at.person),"aria-label":"People",triggerClassName:Mn(!!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__ */H(o,{trigger:Tn(at.modified?ce[at.modified]:"Modified",!!at.modified),"aria-label":"Modified",triggerClassName:Mn(!!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,Wn=$n&&nn.length>0&&!Dt?/* @__PURE__ */B("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__ */H(c,{"aria-label":"Clear selection",size:"sm",onClick:dn,children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})}),
|
|
66
|
-
/* @__PURE__ */B("span",{className:"text-sm text-ink mr-2 whitespace-nowrap",children:[nn.length," selected"]}),an&&ln(an)&&/* @__PURE__ */H(c,{"aria-label":"Share",size:"sm",onClick:()=>Qe(an),children:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"})}),!F&&nn.every(e=>"file"===e.kind)&&/* @__PURE__ */H(c,{"aria-label":"Download",size:"sm",onClick:()=>nn.forEach(Ot),children:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"})}),nn.every(on)&&/* @__PURE__ */H(c,{"aria-label":"Move",size:"sm",onClick:()=>Be(nn),children:/* @__PURE__ */H(z,{name:"forward",className:"h-4 w-4"})}),!F&&nn.every(sn)&&/* @__PURE__ */H(c,{"aria-label":"Move to trash",size:"sm",onClick:()=>Ht(nn),children:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"})}),
|
|
67
|
-
/* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(nn)})]}):null,Rn=/* @__PURE__ */H("div",{className:"flex items-center gap-2 px-4 pb-2 min-h-12 shrink-0",children:Wn??/* @__PURE__ */B(X,{children:[
|
|
68
|
-
/* @__PURE__ */B("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:["files"===lt?/* @__PURE__ */H("div",{className:"min-w-0 text-base [&_*]:text-base",children:/* @__PURE__ */H(a,{items:xn,maxItems:5})}):"trash"===lt?/* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong",children:"Trash"}):"object"==typeof lt?/* @__PURE__ */B(X,{children:[
|
|
69
|
-
/* @__PURE__ */H(j,{className:"h-4 w-4 text-amber-500 shrink-0"}),
|
|
70
|
-
/* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong truncate",children:kt?.name??"Desktop folder"}),
|
|
71
|
-
/* @__PURE__ */H("span",{className:"text-2xs text-ink-faintest whitespace-nowrap",children:"Desktop shortcuts"})]}):/* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong truncate",children:Nn}),"files"===lt&&Jt&&"viewer"===It&&/* @__PURE__ */B("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__ */H(z,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),"files"===lt&&Jt&&Ut?.owner&&/* @__PURE__ */B("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",Ut.owner.name]})]}),An,"trash"===lt&&/* @__PURE__ */H(P,{variant:"secondary-danger",size:"sm",onClick:async()=>{if(0===mt.length)return;await W({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"})&&Pt(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===mt.length,children:"Empty trash"})]})}),Fn=(e,t)=>Dt?null:/* @__PURE__ */B("div",{className:"flex items-center justify-end "+(t?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:[ln(e)&&/* @__PURE__ */H(c,{"aria-label":"Share",size:"sm",onClick:t=>{t.stopPropagation(),Qe(e)},children:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"})}),!F&&"file"===e.kind&&/* @__PURE__ */H(c,{"aria-label":"Download",size:"sm",onClick:t=>{t.stopPropagation(),Ot(e)},children:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"})}),n.setStarred&&!F&&/* @__PURE__ */H(c,{"aria-label":e.starred?"Remove from starred":"Add to starred","aria-pressed":!!e.starred,size:"sm",onClick:t=>{t.stopPropagation(),Xt([e],!e.starred)},children:/* @__PURE__ */H(z,{name:"star",look:e.starred?"solid":void 0,tone:e.starred?"warning":void 0,className:"h-4 w-4"})}),
|
|
73
|
-
/* @__PURE__ */H("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(Ae.has(e.id)&&nn.length>1?nn:[e])})})]}),En=e=>/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
74
|
-
/* @__PURE__ */H(je,{entry:e}),
|
|
75
|
-
/* @__PURE__ */H("span",{className:"truncate",title:e.name,children:ne(e)}),!!e.shareCount&&/* @__PURE__ */H("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__ */H(z,{name:"team",tone:"muted",className:"h-3.5 w-3.5"})}),e.starred&&/* @__PURE__ */H("span",{className:"shrink-0",role:"img","aria-label":"Starred",title:"Starred",children:/* @__PURE__ */H(z,{name:"star",look:"solid",tone:"warning",className:"h-3.5 w-3.5"})})]}),Pn=(e,t,n)=>{const a=it.key===e;/* @__PURE__ */
|
|
76
|
-
return H("th",{className:`${O} font-medium px-3 h-9 ${n}`,"aria-sort":a?"asc"===it.dir?"ascending":"descending":void 0,children:/* @__PURE__ */B("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__ */H(z,{name:"arrow-up",className:"h-3 w-3"}):/* @__PURE__ */H(z,{name:"arrow-down",className:"h-3 w-3"}))]})})},zn="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,Kn=0===en.length?Fe?/* @__PURE__ */H(K,{size:"sm",padding:"p-6",label:"Loading"}):/* @__PURE__ */H("div",{className:"p-10 text-center text-sm text-ink-faintest",children:_t.length>0?"Nothing matches these filters.":zn??/* @__PURE__ */B(X,{children:["This folder is empty.",Qt&&/* @__PURE__ */B(X,{children:[" Drop files here or choose ",
|
|
77
|
-
/* @__PURE__ */H("span",{className:"font-medium",children:"New"}),"."]})]})}):"grid"===He?/* @__PURE__ */H("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__ */B("section",{className:"mb-4",children:[
|
|
78
|
-
/* @__PURE__ */H("h3",{className:"text-xs font-medium text-ink-faint mb-2",children:"folder"===e?"Folders":"Files"}),
|
|
79
|
-
/* @__PURE__ */H("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.map(t=>{const a=Ae.has(t.id);/* @__PURE__ */
|
|
80
|
-
return B("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__ */B("div",{className:"flex items-center gap-2 pl-3 pr-1 h-11",children:[
|
|
82
|
-
/* @__PURE__ */H(je,{entry:t,className:"h-4 w-4"}),
|
|
83
|
-
/* @__PURE__ */H("span",{className:"flex-1 truncate text-sm",title:t.name,children:ne(t)}),
|
|
84
|
-
/* @__PURE__ */H("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(a&&nn.length>1?nn:[t])})})]}),"file"===e&&/* @__PURE__ */B(X,{children:[
|
|
85
|
-
/* @__PURE__ */H("div",{className:"mx-2 h-28 rounded-lg bg-surface flex items-center justify-center overflow-hidden",children:/* @__PURE__ */H(De,{entry:t,read:F?void 0:n.read})}),
|
|
86
|
-
/* @__PURE__ */B("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__ */B("table",{className:"w-full text-sm table-fixed",children:[
|
|
87
|
-
/* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[Pn("name","Name","text-left"),Z&&Pn("owner","Owner","text-left w-32"),Pn("modified","Modified","text-left w-28"),Pn("size","Size","text-right w-20"),
|
|
88
|
-
/* @__PURE__ */H("th",{className:`${O} w-32`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
89
|
-
/* @__PURE__ */H("tbody",{children:en.map(e=>{const t=Ae.has(e.id);/* @__PURE__ */
|
|
90
|
-
return B("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__ */H("td",{className:"px-3 h-11",children:En(e)}),Z&&/* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint truncate",children:ie(e)}),
|
|
92
|
-
/* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:ve(e.modifiedAt),children:re(e.modifiedAt)}),
|
|
93
|
-
/* @__PURE__ */H("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__ */H("td",{className:"px-2 h-11",children:Fn(e,t)})]},e.id)})})]}),On=Fe&&0===mt.length?/* @__PURE__ */H(K,{size:"sm",padding:"p-6",label:"Loading"}):0===mt.length?/* @__PURE__ */H("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty. What you delete stays here for 30 days."}):/* @__PURE__ */B("table",{className:"w-full text-sm table-fixed",children:[
|
|
95
|
-
/* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[
|
|
96
|
-
/* @__PURE__ */H("th",{className:`${O} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
97
|
-
/* @__PURE__ */H("th",{className:`${O} text-left font-medium px-3 h-9 w-48`,children:"Original location"}),
|
|
98
|
-
/* @__PURE__ */H("th",{className:`${O} text-left font-medium px-3 h-9 w-32`,children:"Deleted"}),
|
|
99
|
-
/* @__PURE__ */H("th",{className:`${O} text-right font-medium px-3 h-9 w-24`,children:"Size"}),
|
|
100
|
-
/* @__PURE__ */H("th",{className:`${O} w-28`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
101
|
-
/* @__PURE__ */H("tbody",{children:mt.map(e=>/* @__PURE__ */B("tr",{className:"group border-b border-line-subtle hover:bg-row-hover",onContextMenu:t=>St.open(t,e),children:[
|
|
102
|
-
/* @__PURE__ */H("td",{className:"px-3 h-11",children:/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
103
|
-
/* @__PURE__ */H(je,{entry:e}),
|
|
104
|
-
/* @__PURE__ */H("span",{className:"truncate",title:e.name,children:e.name})]})}),
|
|
105
|
-
/* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint text-xs truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
106
|
-
/* @__PURE__ */H("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__ */H("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":d(e.size)}),
|
|
108
|
-
/* @__PURE__ */H("td",{className:"px-2 h-11",children:/* @__PURE__ */B("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
109
|
-
/* @__PURE__ */H(c,{"aria-label":"Restore",size:"sm",onClick:()=>zt(e),children:/* @__PURE__ */H(z,{name:"revert",className:"h-4 w-4"})}),
|
|
110
|
-
/* @__PURE__ */H(c,{"aria-label":"Delete forever",size:"sm",variant:"ghost-danger",onClick:()=>Kt(e),children:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"})})]})})]},e.id))})]}),Un=0===wt.length?/* @__PURE__ */H("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__ */B("table",{className:"w-full text-sm table-fixed",children:[
|
|
111
|
-
/* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[
|
|
112
|
-
/* @__PURE__ */H("th",{className:`${O} text-left font-medium px-3 h-9`,children:"Name"}),
|
|
113
|
-
/* @__PURE__ */H("th",{className:`${O} text-left font-medium px-3 h-9 w-32`,children:"Type"}),
|
|
114
|
-
/* @__PURE__ */H("th",{className:`${O} w-32`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
|
|
115
|
-
/* @__PURE__ */H("tbody",{children:wt.map(e=>/* @__PURE__ */B("tr",{onDoubleClick:()=>Tt(e),onContextMenu:t=>jt.open(t,e),className:"group cursor-default border-b border-line-subtle hover:bg-row-hover",children:[
|
|
116
|
-
/* @__PURE__ */H("td",{className:"px-3 h-11",children:/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
|
|
117
|
-
/* @__PURE__ */H(D,{item:e}),
|
|
118
|
-
/* @__PURE__ */H("span",{className:"truncate",title:e.label,children:e.label})]})}),
|
|
119
|
-
/* @__PURE__ */H("td",{className:"px-3 h-11 text-xs text-ink-faint",children:T(e)}),
|
|
120
|
-
/* @__PURE__ */H("td",{className:"px-2 h-11",children:/* @__PURE__ */B("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
|
|
121
|
-
/* @__PURE__ */H(c,{"aria-label":"Open",size:"sm",onClick:()=>Tt(e),children:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"})}),
|
|
122
|
-
/* @__PURE__ */H(c,{"aria-label":"Move to desktop",size:"sm",onClick:()=>pt?.moveToDesktop([e]),children:/* @__PURE__ */H(z,{name:"desktop",className:"h-4 w-4"})}),
|
|
123
|
-
/* @__PURE__ */H(c,{"aria-label":"Remove",size:"sm",variant:"ghost-danger",onClick:()=>pt?.removeShortcuts([e]),children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})})]})})]},`${e.entityType}|${e.entityId}`))})]});/* @__PURE__ */
|
|
124
|
-
return B("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Qt&&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(),Qt&&e.dataTransfer.files?.length&&Vt(e.dataTransfer.files))},children:[
|
|
125
|
-
/* @__PURE__ */H(A,{title:Cn}),
|
|
126
|
-
/* @__PURE__ */H(k,{app:"files"}),
|
|
127
|
-
/* @__PURE__ */H("input",{ref:vt,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Vt(e.target.files),vt.current&&(vt.current.value="")}}),
|
|
128
|
-
/* @__PURE__ */H("input",{ref:e=>{bt.current=e,e?.setAttribute("webkitdirectory","")},type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Vt(e.target.files,{withFolders:!0}),bt.current&&(bt.current.value="")}}),
|
|
129
|
-
/* @__PURE__ */H("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */H(t,{sidebar:Dn,storageKey:"files.sidebarWidth",defaultWidth:220,minWidth:170,maxWidth:320,children:/* @__PURE__ */B("div",{className:"flex h-full min-w-0",children:[
|
|
130
|
-
/* @__PURE__ */B("div",{className:"flex flex-1 min-w-0 flex-col",children:[Dt&&/* @__PURE__ */B("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__ */H(z,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
|
|
132
|
-
/* @__PURE__ */H("span",{className:"flex-1 min-w-0 truncate",children:Dt.request.title}),
|
|
133
|
-
/* @__PURE__ */H(P,{variant:"secondary",size:"sm",onClick:()=>p(Dt.id,null),children:"Cancel"}),
|
|
134
|
-
/* @__PURE__ */H(P,{variant:"primary",size:"sm",disabled:!fn,onClick:()=>{fn&&un(fn)},children:"Open"})]}),
|
|
135
|
-
/* @__PURE__ */B("div",{className:"flex items-center gap-1 px-4 py-2 shrink-0",children:[
|
|
136
|
-
/* @__PURE__ */H("div",{className:"flex-1 min-w-48 max-w-2xl",role:"search",children:/* @__PURE__ */H(l,{type:"text",enterKeyHint:"search",value:_e,onChange:e=>{et(e.target.value),e.target.value.trim()||Ft()},onKeyDown:e=>{"Escape"===e.key&&_e&&(e.stopPropagation(),Ft())},placeholder:`Search in ${r}`,"aria-label":`Search in ${r}`,leftIcon:/* @__PURE__ */H(z,{name:"search",className:"h-4 w-4"}),endAction:_e?{label:"Clear search",icon:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"}),onClick:Ft}:void 0})}),
|
|
137
|
-
/* @__PURE__ */H("div",{className:"flex-1"}),"object"!=typeof lt&&"trash"!==lt&&/* @__PURE__ */B(X,{children:[
|
|
138
|
-
/* @__PURE__ */H(c,{"aria-label":"List view","aria-pressed":"list"===He,onClick:()=>ut("list"),children:/* @__PURE__ */H(z,{name:"list",className:"h-4 w-4"})}),
|
|
139
|
-
/* @__PURE__ */H(c,{"aria-label":"Grid view","aria-pressed":"grid"===He,onClick:()=>ut("grid"),children:/* @__PURE__ */H(z,{name:"grid",className:"h-4 w-4"})})]}),
|
|
140
|
-
/* @__PURE__ */H(c,{"aria-label":"Details","aria-pressed":Ze,onClick:()=>qe(e=>!e),children:/* @__PURE__ */H(z,{name:"info",className:"h-4 w-4"})})]}),Rn,
|
|
141
|
-
/* @__PURE__ */H("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(),Ht(nn)):"Enter"===e.key&&an?(e.preventDefault(),pn(an)):(e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&en.length&&(e.preventDefault(),We(new Set(en.map(e=>e.id)))))},onClick:e=>{e.target===e.currentTarget&&dn()},children:"object"==typeof lt?Un:"trash"===lt?On:Kn})]}),Ze&&$n&&/* @__PURE__ */H(fe,{store:n,entry:an,selectedCount:nn.length,onClose:()=>qe(!1)})]})})}),Ct.state&&/* @__PURE__ */H(s,{...Ct.props,items:gn(Ct.state.data),"aria-label":"File actions"}),St.state&&/* @__PURE__ */H(s,{...St.props,"aria-label":"Trash actions",items:[{key:"restore",label:"Restore",icon:/* @__PURE__ */H(z,{name:"revert",className:"h-4 w-4"}),onSelect:()=>zt(St.state.data)},{type:"divider",key:"d"},{key:"purge",label:"Delete forever",danger:!0,icon:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Kt(St.state.data)}]}),jt.state&&/* @__PURE__ */H(s,{...jt.props,"aria-label":"Shortcut actions",items:[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>Tt(jt.state.data)},{key:"desktop",label:"Move to desktop",icon:/* @__PURE__ */H(z,{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__ */H(z,{name:"close",className:"h-4 w-4"}),onSelect:()=>pt?.removeShortcuts([jt.state.data])}]}),Z&&/* @__PURE__ */H(he,{store:n,entry:Ge,onClose:()=>Qe(null),onChanged:Rt}),n.move&&/* @__PURE__ */H(ue,{store:n,items:Ve,from:"files"===lt?_:void 0,onClose:()=>Be(null),onMove:e=>Ve&&Zt(Ve,e)}),Ue&&/* @__PURE__ */H("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__ */H("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{Te as default,Ne as quotaExceededMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-NHIP2S4E.js";import"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-BFCIOWYI.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,migratePomodoroTasksOnce as u,pomoSwitchMode as d,pomoPause as m,pomoStart as h,ALARM_OPTIONS as p,playAlarm as g,FOCUS_SOUND_OPTIONS as k,previewFocusSound as f}from"./chunk-GBEDLYND.js";import{PLACEHOLDER_INK as b}from"./chunk-AYZY3YNC.js";import{pad2 as x}from"./chunk-LF27WIN2.js";import{useWidgetSettings as v}from"./chunk-AG6Y62TP.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SXHNZFUY.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-NGQZI7HP.js";import"./chunk-MXITMJCT.js";import"./chunk-7ADTFFEM.js";import"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-27ZJQUDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-QCOXJXGZ.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as y}from"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as N}from"./chunk-JOAKKXTL.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-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as C,useEffect as w,useMemo as S,useState as j,useRef as B,useCallback as T}from"react";import{jsxs as M,Fragment as P,jsx as I}from"react/jsx-runtime";var D="pomodoro_appearance",A="pomodoro_active_task_id",V={focus:"Pomodoro",short:"Short Break",long:"Long Break"},L={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var J=25,W=5,$=15,F=!1,G=!1,R=4,Q=!0,U=!0,Z="bell",E=100,K=1,X="none",O=50,Y=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function H(){const t=C(o,a,a),{prefs:g,save:f}=y(),b=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:Y(t.focusMinutes,1,120,J),shortBreakMinutes:Y(t.shortBreakMinutes,1,120,W),longBreakMinutes:Y(t.longBreakMinutes,1,120,$),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:F,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:G,longBreakInterval:Y(t.longBreakInterval,1,20,R),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:Q,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:U,alarmSound:p.some(e=>e.id===t.alarmSound)?t.alarmSound:Z,alarmVolume:Y(t.alarmVolume,0,100,E),alarmRepeat:Y(t.alarmRepeat,1,5,K),focusSound:k.some(e=>e.id===t.focusSound)?t.focusSound:X,focusVolume:Y(t.focusVolume,0,100,O)}}(g.pomodoro_settings);w(()=>{n({focus:60*b.focusMinutes,short:60*b.shortBreakMinutes,long:60*b.longBreakMinutes})},[b.focusMinutes,b.shortBreakMinutes,b.longBreakMinutes]),w(()=>{r(b.alarmSound),s(b.alarmVolume,b.alarmRepeat)},[b.alarmSound,b.alarmVolume,b.alarmRepeat]),w(()=>{i({autoStartBreaks:b.autoStartBreaks,autoStartPomodoros:b.autoStartPomodoros,longBreakInterval:b.longBreakInterval})},[b.autoStartBreaks,b.autoStartPomodoros,b.longBreakInterval]),w(()=>{l(b.focusSound,b.focusVolume)},[b.focusSound,b.focusVolume]),w(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const H=c(),z=H.tasks,q=S(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),ee=function(e,t){return S(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(S(()=>z.filter(e=>!!e.dueDate&&(e.dueDate===q||e.dueDate<q&&!e.done)),[z,q]),b.checkToBottom),[te,oe]=j(()=>localStorage.getItem(A)),[ae,ne]=j(!1),[re,se]=j(null),ie=B(!1);w(()=>{ie.current||(ie.current=!0,u(z,H.setAllTasks))},[]),w(()=>{try{te?localStorage.setItem(A,te):localStorage.removeItem(A)}catch{}},[te]),w(()=>{if(!re)return;const e=()=>se(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[re]);const le=B(t.streak);w(()=>{if(t.streak>le.current&&te){const e=z.find(e=>e.id===te);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=b.autoCheckTasks&&o>0&&t>=o;H.updateTask(te,{completed:t,done:e.done||a})}}le.current=t.streak},[t.streak,te,b.autoCheckTasks,z,H]);const ue=ee.reduce((e,t)=>e+(t.completed??0),0),de=ee.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),me=ee.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),he=t.running&&"focus"===t.mode?t.remaining:0,pe=me*b.focusMinutes*60+he,ge=new Date(Date.now()+1e3*pe).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ke=(pe/3600).toFixed(1),fe=te?z.find(e=>e.id===te)??null:null,be=x(Math.floor(t.remaining/60)),xe=x(t.remaining%60),[ve,ye]=j(()=>e(D)),[Ne,Ce]=j(!1),[we,Se]=j(ve),[je,Be]=j(b);v(T(()=>{Se({...ve}),Be({...b}),Ce(!0)},[ve,b]));const Te="focus"!==t.mode,Me=L[t.mode],Pe=Te?(Ie=Me,De=ve.activeOpacity/100,`rgba(${parseInt(Ie.slice(1,3),16)}, ${parseInt(Ie.slice(3,5),16)}, ${parseInt(Ie.slice(5,7),16)}, ${De})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${ve.activeOpacity/100})`;var Ie,De;const Ae={primary:Te?"text-white":"text-gray-900",secondary:Te?"text-white/85":"text-gray-700",muted:Te?"text-white/65":"text-gray-500",tabActive:Te?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Te?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Te?"border-white/30":"border-gray-200",softDivider:Te?"border-white/20":"border-gray-200",iconBtn:Te?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Te?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Ve=Te?Me:"#0f172a";/* @__PURE__ */
|
|
2
|
-
return M(P,{children:[
|
|
3
|
-
/* @__PURE__ */M("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Ae.primary}`,style:{backgroundColor:Pe,backdropFilter:ve.activeBlur>0?`blur(${ve.activeBlur}px)`:void 0},children:[
|
|
4
|
-
/* @__PURE__ */I("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */I("button",{onClick:()=>d(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Ae.tabActive:Ae.tabInactive}`,children:V[e]},e))}),
|
|
5
|
-
/* @__PURE__ */M("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[be,":",xe]}),
|
|
6
|
-
/* @__PURE__ */I("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */I("button",{onClick:()=>t.running?m():h(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:Ve,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
|
|
7
|
-
/* @__PURE__ */I("div",{className:"px-3 py-3 text-center",children:fe?/* @__PURE__ */M(P,{children:[
|
|
8
|
-
/* @__PURE__ */M("div",{className:`text-xs leading-tight ${Ae.muted}`,children:["#",(fe.completed??0)+1]}),
|
|
9
|
-
/* @__PURE__ */I("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Ae.primary}`,children:fe.name})]}):/* @__PURE__ */I("div",{className:`text-xs italic ${Ae.muted}`,children:"No task selected"})}),
|
|
10
|
-
/* @__PURE__ */M("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
|
|
11
|
-
/* @__PURE__ */I("h3",{className:`text-base font-bold tracking-tight ${Ae.primary}`,children:"Tasks"}),
|
|
12
|
-
/* @__PURE__ */I("button",{className:`rounded p-1 transition-colors ${Ae.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
|
|
13
|
-
/* @__PURE__ */I("div",{className:`border-t mx-3 mt-2 ${Ae.divider}`}),
|
|
14
|
-
/* @__PURE__ */M("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[ee.map(e=>{const t=e.id===te;/* @__PURE__ */
|
|
15
|
-
return M("div",{onClick:()=>oe(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
|
|
16
|
-
/* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,H.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */I("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Ve},children:/* @__PURE__ */I("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */I("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"10"})})}),
|
|
17
|
-
/* @__PURE__ */I("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
|
|
18
|
-
/* @__PURE__ */M("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
|
|
19
|
-
/* @__PURE__ */I("span",{className:"font-bold text-gray-500",children:e.completed??0}),
|
|
20
|
-
/* @__PURE__ */I("span",{className:"text-gray-400",children:" / "}),
|
|
21
|
-
/* @__PURE__ */I("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
|
|
22
|
-
/* @__PURE__ */M("div",{className:"relative",children:[
|
|
23
|
-
/* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),se(re===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),re===e.id&&/* @__PURE__ */I("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,H.removeTask(o),te===o&&oe(null),se(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ae?/* @__PURE__ */I(ce,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=H.addTask({name:o,estimated:t,completed:0,dueDate:q});te||oe(a),ne(!1)},onCancel:()=>ne(!1),accentColor:Ve}):/* @__PURE__ */M("button",{onClick:()=>ne(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Ae.addTaskBtn}`,children:[
|
|
24
|
-
/* @__PURE__ */I(N,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
|
|
25
|
-
/* @__PURE__ */M("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Ae.softDivider}`,children:[
|
|
26
|
-
/* @__PURE__ */M("span",{className:Ae.secondary,children:["Pomos: ",
|
|
27
|
-
/* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:ue}),
|
|
28
|
-
/* @__PURE__ */I("span",{className:Ae.muted,children:" / "}),
|
|
29
|
-
/* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:de})]}),pe>0&&/* @__PURE__ */M("span",{className:Ae.secondary,children:["Finish At: ",
|
|
30
|
-
/* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:ge}),
|
|
31
|
-
/* @__PURE__ */M("span",{className:Ae.muted,children:[" (",ke,"h)"]})]})]})]}),
|
|
32
|
-
/* @__PURE__ */I(_,{open:Ne,onClose:()=>Ce(!1),onSave:()=>{ye(we),localStorage.setItem(D,JSON.stringify(we)),f({pomodoro_settings:je}),Ce(!1)},configAppearance:we,setConfigAppearance:Se,configPrefs:je,setConfigPrefs:Be})]})}function _({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
|
|
33
|
-
return M(t,{open:e,onClose:o,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:a,children:[
|
|
34
|
-
/* @__PURE__ */M(z,{icon:/* @__PURE__ */I(se,{}),label:"TIMER",children:[
|
|
35
|
-
/* @__PURE__ */M("div",{children:[
|
|
36
|
-
/* @__PURE__ */I("p",{className:"text-sm font-bold text-gray-800 mb-2",children:"Time (minutes)"}),
|
|
37
|
-
/* @__PURE__ */M("div",{className:"grid grid-cols-3 gap-3",children:[
|
|
38
|
-
/* @__PURE__ */I(te,{label:"Pomodoro",value:s.focusMinutes,onChange:e=>l("focusMinutes",e),max:120}),
|
|
39
|
-
/* @__PURE__ */I(te,{label:"Short Break",value:s.shortBreakMinutes,onChange:e=>l("shortBreakMinutes",e),max:120}),
|
|
40
|
-
/* @__PURE__ */I(te,{label:"Long Break",value:s.longBreakMinutes,onChange:e=>l("longBreakMinutes",e),max:120})]})]}),
|
|
41
|
-
/* @__PURE__ */I(q,{label:"Auto Start Breaks",children:/* @__PURE__ */I(ne,{checked:s.autoStartBreaks,onChange:e=>l("autoStartBreaks",e)})}),
|
|
42
|
-
/* @__PURE__ */I(q,{label:"Auto Start Pomodoros",children:/* @__PURE__ */I(ne,{checked:s.autoStartPomodoros,onChange:e=>l("autoStartPomodoros",e)})}),
|
|
43
|
-
/* @__PURE__ */I(q,{label:"Long Break interval",children:/* @__PURE__ */I(oe,{value:s.longBreakInterval,onChange:e=>l("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
|
|
44
|
-
/* @__PURE__ */M(z,{icon:/* @__PURE__ */I(ie,{}),label:"TASK",children:[
|
|
45
|
-
/* @__PURE__ */I(q,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */I(ne,{checked:s.autoCheckTasks,onChange:e=>l("autoCheckTasks",e)})}),
|
|
46
|
-
/* @__PURE__ */I(q,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */I(ne,{checked:s.checkToBottom,onChange:e=>l("checkToBottom",e)})})]}),
|
|
47
|
-
/* @__PURE__ */M(z,{icon:/* @__PURE__ */I(le,{}),label:"SOUND",children:[
|
|
48
|
-
/* @__PURE__ */I(q,{label:"Alarm Sound",children:/* @__PURE__ */M("div",{className:"flex items-center gap-2",children:[
|
|
49
|
-
/* @__PURE__ */I(ae,{value:s.alarmSound,onChange:e=>l("alarmSound",e),options:p.map(e=>({id:e.id,label:e.label}))}),"off"!==s.alarmSound&&/* @__PURE__ */I("button",{type:"button",onClick:()=>g(s.alarmSound,{volume:s.alarmVolume,repeat:1}),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
|
|
50
|
-
/* @__PURE__ */I(ee,{value:s.alarmVolume,onChange:e=>l("alarmVolume",e)}),
|
|
51
|
-
/* @__PURE__ */I(q,{label:"repeat",children:/* @__PURE__ */I(oe,{value:s.alarmRepeat,onChange:e=>l("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
|
|
52
|
-
/* @__PURE__ */I(q,{label:"Focus Sound",children:/* @__PURE__ */M("div",{className:"flex items-center gap-2",children:[
|
|
53
|
-
/* @__PURE__ */I(ae,{value:s.focusSound,onChange:e=>l("focusSound",e),options:k}),"none"!==s.focusSound&&/* @__PURE__ */I("button",{type:"button",onClick:()=>f(s.focusSound,s.focusVolume),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
|
|
54
|
-
/* @__PURE__ */I(ee,{value:s.focusVolume,onChange:e=>l("focusVolume",e)})]})]})}function z({icon:e,label:t,children:o}){/* @__PURE__ */
|
|
55
|
-
return M("div",{className:"border-t border-gray-200 pt-3 first:border-0 first:pt-0",children:[
|
|
56
|
-
/* @__PURE__ */M("div",{className:"flex items-center gap-2 mb-3 text-ink-faintest",children:[e,
|
|
57
|
-
/* @__PURE__ */I("span",{className:"text-xs font-bold tracking-[0.15em]",children:t})]}),
|
|
58
|
-
/* @__PURE__ */I("div",{className:"space-y-3",children:o})]})}function q({label:e,info:t,children:o}){/* @__PURE__ */
|
|
59
|
-
return M("div",{className:"flex items-center justify-between gap-3",children:[
|
|
60
|
-
/* @__PURE__ */M("div",{className:"flex items-center gap-2 min-w-0",children:[
|
|
61
|
-
/* @__PURE__ */I("span",{className:"text-sm font-semibold text-gray-800",children:e}),t&&/* @__PURE__ */I(re,{title:t})]}),
|
|
62
|
-
/* @__PURE__ */I("div",{className:"shrink-0",children:o})]})}function ee({value:e,onChange:t}){/* @__PURE__ */
|
|
63
|
-
return M("div",{className:"flex items-center justify-end gap-3",children:[
|
|
64
|
-
/* @__PURE__ */I("span",{className:"text-xs text-gray-400 w-7 text-right tabular-nums",children:e}),
|
|
65
|
-
/* @__PURE__ */I("input",{type:"range",min:0,max:100,value:e,onChange:e=>t(parseInt(e.target.value,10)),className:"w-40 accent-blue-500"})]})}function te({label:e,value:t,onChange:o,min:a=1,max:n=99}){/* @__PURE__ */
|
|
66
|
-
return M("label",{className:"flex flex-col",children:[
|
|
67
|
-
/* @__PURE__ */I("span",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),
|
|
68
|
-
/* @__PURE__ */I(oe,{value:t,onChange:o,min:a,max:n})]})}function oe({value:e,onChange:t,min:o=1,max:a=99,className:n=""}){/* @__PURE__ */
|
|
69
|
-
return I("input",{type:"number",min:o,max:a,value:e,onChange:e=>t(Math.max(o,Math.min(a,parseInt(e.target.value,10)||o))),className:`bg-gray-100 border-0 rounded-md px-2 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 w-full ${n}`})}function ae({value:e,onChange:t,options:o}){/* @__PURE__ */
|
|
70
|
-
return M("div",{className:"relative",children:[
|
|
71
|
-
/* @__PURE__ */I("select",{value:e,onChange:e=>t(e.target.value),className:"appearance-none bg-gray-100 border-0 rounded-md pl-3 pr-8 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer",children:o.map(e=>/* @__PURE__ */I("option",{value:e.id,children:e.label},e.id))}),
|
|
72
|
-
/* @__PURE__ */I(N,{name:"chevron-down",className:`absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 pointer-events-none ${b}`,strokeWidth:2.5})]})}function ne({checked:e,onChange:t}){/* @__PURE__ */
|
|
73
|
-
return I("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e?"bg-emerald-500":"bg-gray-300"),children:/* @__PURE__ */I("span",{className:"absolute h-5 w-5 rounded-full bg-white shadow transition-transform "+(e?"translate-x-[22px]":"translate-x-0.5")})})}function re({title:e}){/* @__PURE__ */
|
|
74
|
-
return I("span",{title:e,className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-gray-300 text-on-accent text-3xs font-bold cursor-help",children:"i"})}function se(){/* @__PURE__ */
|
|
75
|
-
return M("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
|
|
76
|
-
/* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"9"}),
|
|
77
|
-
/* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7v5l3 2"})]})}function ie(){/* @__PURE__ */
|
|
78
|
-
return M("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
|
|
79
|
-
/* @__PURE__ */I("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),
|
|
80
|
-
/* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})}function le(){/* @__PURE__ */
|
|
81
|
-
return M("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
|
|
82
|
-
/* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5L6 9H2v6h4l5 4V5z"}),
|
|
83
|
-
/* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function ce({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=j(""),[r,s]=j(1),i=()=>e(a,r);/* @__PURE__ */
|
|
84
|
-
return M("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--elevation-panel)",children:[
|
|
85
|
-
/* @__PURE__ */I("input",{autoFocus:!0,value:a,onChange:e=>n(e.target.value),placeholder:"What are you working on?",onKeyDown:e=>{"Enter"===e.key&&i(),"Escape"===e.key&&t()},className:"w-full text-base font-medium bg-transparent border-0 outline-none placeholder-gray-400"}),
|
|
86
|
-
/* @__PURE__ */M("div",{className:"flex items-center justify-between mt-2",children:[
|
|
87
|
-
/* @__PURE__ */I("span",{className:"text-xs font-semibold text-gray-500",children:"Est Pomodoros"}),
|
|
88
|
-
/* @__PURE__ */I("input",{type:"number",min:1,max:20,value:r,onChange:e=>s(Math.max(1,Math.min(20,parseInt(e.target.value,10)||1))),className:"w-16 bg-gray-100 rounded px-2 py-1 text-sm text-right border-0 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),
|
|
89
|
-
/* @__PURE__ */M("div",{className:"flex gap-2 mt-3 justify-end",children:[
|
|
90
|
-
/* @__PURE__ */I("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
91
|
-
/* @__PURE__ */I("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{H as default};
|
package/dist/Sidebar-FU7TD5FQ.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 a,toggleOpenSection as i,writeStored as l}from"./chunk-U6LKNGC6.js";import{ResizeHandle as o}from"./chunk-EIXMUGVZ.js";import{openGlobalSearch as s}from"./chunk-6JLXXX4H.js";import{partitionNav as c,visibleNavChildren as d,flyoutGroups as m,visibleSectionItems as h,rowsContainRoute as u}from"./chunk-WGRS6QBT.js";import{BrandMark as p}from"./chunk-MI67DI3H.js";import{IconButton_default as b}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as f,navSections as g,startMenuCategories as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_W as v,RAIL_MAX_W as N,RAIL_MIN_W as j,navIcons as C,sectionIcons as w}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as S,PopupMenuItem as L,PopupMenuDivider as z,PopupMenuLabel as $}from"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as A}from"./chunk-JOAKKXTL.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-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useMemo as I,useState as T,useRef as H,useEffect as M,isValidElement as R,cloneElement as K}from"react";import{jsx as J,jsxs as X,Fragment as B}from"react/jsx-runtime";var D="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform);function Q(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+f,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(" "),P="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function G({open:e,children:t}){const r=H(null);return M(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */J("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__ */J("div",{className:"min-h-0 overflow-hidden",children:t})})}function V({open:e}){/* @__PURE__ */
|
|
2
|
-
return J(A,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function Z({dir:e}){/* @__PURE__ */
|
|
3
|
-
return J(A,"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 O({className:e}){/* @__PURE__ */
|
|
4
|
-
return J(A,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var Y=e=>.75+1.75*e+"rem";function _({width:_,collapsed:E,onToggleCollapsed:F,onResize:q,onHome:ee,onOpen:te,activeRoute:re,profile:ne,user:ae,onLogout:ie,onSwitchToDesktop:le,onReportBug:oe,onClose:se,navSections:ce=g,navIcons:de=C,sectionIcons:me=w,categories:he=x,productName:ue,productIcon:pe,tagline:be,adaptiveLogo:fe=!1,logoHasAlpha:ge=null,logoIsLight:xe=null}){const ke=W().layout,{hasAnyPerm:ye}=e(),ve=I(()=>c(ce,he,ye),[ce,he,ye]),[Ne,je]=T(()=>t(r(n))),Ce=I(()=>[...ve.topItems.filter(e=>d(e,ye).length>0).map(e=>`child:${e.to}`),...[...ve.erpSections,...ve.systemSections,...ve.virtualSections,...ve.footerSections].map(e=>e.label)],[ve,ye]),we=(e,t=Ce)=>je(r=>{const a=i(r,e,t);return l(n,JSON.stringify([...a])),a}),[Se,Le]=T(null),[ze,$e]=T(!1),Ae=H(null);M(()=>{E||Le(null)},[E]);const We=(e,t)=>{Le(null),e.onSelect?e.onSelect():te(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Ie=(e,t)=>{const r=t[e];/* @__PURE__ */
|
|
5
|
-
return J("span",{className:P,"aria-hidden":"true",children:r&&R(r)?K(r,{className:"size-[18px]"}):r})},Te=e=>e.filter(e=>d(e,ye).length>0).map(e=>`child:${e.to}`),He=(e,t,r=Ce)=>{const n=d(e,ye),a=e.menuLabel??e.label;if(n.length>0){const i=`child:${e.to}`,l=Ne.has(i),o=!l&&u(n,re,ye);/* @__PURE__ */
|
|
6
|
-
return X("div",{children:[
|
|
7
|
-
/* @__PURE__ */X("button",{type:"button",onClick:()=>we(i,r),"aria-expanded":l,className:U(o,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ie(e.to,de),
|
|
8
|
-
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:a}),
|
|
9
|
-
/* @__PURE__ */J(V,{open:l})]}),
|
|
10
|
-
/* @__PURE__ */J(G,{open:l,children:/* @__PURE__ */J("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>He(e,t+1,Te(n)))})}),e.dividerAfter&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)}const i=e.to===re;/* @__PURE__ */
|
|
11
|
-
return X("div",{children:[
|
|
12
|
-
/* @__PURE__ */X("button",{type:"button",onClick:t=>We(e,t),onAuxClick:t=>{1===t.button&&We(e,t)},"aria-current":i?"page":void 0,className:U(i,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ie(e.to,de),
|
|
13
|
-
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:a})]}),e.dividerAfter&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)},Me=(e,t)=>{const r=t?e.items:h(e,ye);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */J("span",{className:P,"aria-hidden":"true",children:e.icon}):Ie(e.label,me),a=e.menuLabel??e.label,i=u(r,re,ye),l="dividerAfter"in e&&e.dividerAfter;if(E)/* @__PURE__ */
|
|
14
|
-
return X("div",{children:[
|
|
15
|
-
/* @__PURE__ */J("button",{type:"button",title:a,"aria-label":a,"aria-haspopup":"menu","aria-expanded":Se?.label===e.label,onClick:t=>{const n=t.currentTarget.getBoundingClientRect();Le(t=>t?.label===e.label?null:{label:e.label,items:r,top:n.top})},className:U(i||Se?.label===e.label,!0),children:n}),l&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const o=Ne.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
|
|
16
|
-
return X("div",{children:[
|
|
17
|
-
/* @__PURE__ */X("button",{type:"button",onClick:()=>we(e.label),"aria-expanded":o,"aria-controls":s,className:U(!o&&i,!1),children:[n,
|
|
18
|
-
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:a}),
|
|
19
|
-
/* @__PURE__ */J(V,{open:o})]}),
|
|
20
|
-
/* @__PURE__ */J(G,{open:o,children:/* @__PURE__ */J("div",{id:s,role:"group","aria-label":a,className:"space-y-0.5 pt-0.5",children:r.map(e=>He(e,1,Te(r)))})}),l&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Re=ne?.first_name?`${ne.first_name} ${ne.last_name||""}`.trim():ae?.email||"",Ke=(ne?.first_name?.charAt(0)||ae?.email?.charAt(0)||"?").toUpperCase(),Je=ne?.avatar_url?/* @__PURE__ */J("img",{src:ne.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */J("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ke}),Xe=ze?Ae.current?.getBoundingClientRect():void 0,Be=E?"":"px-3",De=E?{paddingInline:y}:void 0,Qe=`${E?ke.expandSidebar:ke.collapseSidebar} (${D?"⌘":"Ctrl"} .)`,Ue=ee?{run:ee,label:ke.goHome,title:ke.goHome}:se?null:{run:F,label:E?ke.expandSidebar:ke.collapseSidebar,title:Qe},Pe=/* @__PURE__ */X(B,{children:[pe&&/* @__PURE__ */J(p,{src:pe,alt:"",slot:"compact",surface:"light",adaptive:fe,hasAlpha:ge,isLight:xe,size:28,decorative:!0}),!E&&/* @__PURE__ */X("span",{className:"min-w-0 text-left leading-tight",children:[
|
|
21
|
-
/* @__PURE__ */J("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),be&&/* @__PURE__ */J("span",{className:"block truncate text-2xs font-medium text-gray-500",children:be})]})]}),Ge=ve.erpSections.length>0||ve.systemSections.length>0||ve.virtualSections.length>0;/* @__PURE__ */
|
|
22
|
-
return X("aside",{"aria-label":ke.navLabel,className:"fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong",style:{width:_},children:[
|
|
23
|
-
/* @__PURE__ */X("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(E?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ue?/* @__PURE__ */J("button",{type:"button",onClick:Ue.run,"aria-label":Ue.label,title:Ue.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(E?"justify-center p-0.5":"-ml-1 p-1"),children:Pe}):/* @__PURE__ */J("span",{className:"flex min-w-0 items-center gap-2",children:Pe}),se?/* @__PURE__ */J(b,{onClick:se,"aria-label":ke.closeMenu,children:/* @__PURE__ */J(A,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):!E&&/* @__PURE__ */J("button",{type:"button",onClick:F,"aria-label":ke.collapseSidebar,title:`${ke.collapseSidebar} (${D?"⌘":"Ctrl"} .)`,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:/* @__PURE__ */J(Z,{dir:"left"})})]}),
|
|
24
|
-
/* @__PURE__ */J("div",{className:`shrink-0 pt-3 ${Be}`,style:De,children:E?/* @__PURE__ */J("button",{type:"button",onClick:s,"aria-label":ke.search,title:`${ke.search} (${D?"⌘K":"Ctrl K"})`,className:U(!1,!0),children:/* @__PURE__ */J(O,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */X("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:[
|
|
25
|
-
/* @__PURE__ */J(O,{className:"size-3.5 text-gray-500"}),
|
|
26
|
-
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:ke.search}),
|
|
27
|
-
/* @__PURE__ */J("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:D?"⌘K":"Ctrl K"})]})}),
|
|
28
|
-
/* @__PURE__ */X("nav",{"aria-label":ke.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Be} ${E?"space-y-1":"space-y-0.5"}`,style:De,children:[E&&/* @__PURE__ */J("button",{type:"button",onClick:F,"aria-label":ke.expandSidebar,title:`${ke.expandSidebar} (${D?"⌘":"Ctrl"} .)`,className:`${U(!1,!0)} mb-3`,children:/* @__PURE__ */J(Z,{dir:"right"})}),ve.topItems.map(e=>{if(!E)return He(e,0);const t=d(e,ye),r=e.to===re||u(t,re,ye),n=e.menuLabel??e.label;/* @__PURE__ */
|
|
29
|
-
return X("div",{children:[
|
|
30
|
-
/* @__PURE__ */J("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void We(e,r);const n=r.currentTarget.getBoundingClientRect();Le(r=>r?.label===e.to?null:{label:e.to,items:t,top:n.top})},className:U(r,!0),children:Ie(e.to,de)}),e.dividerAfter&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ve.topItems.length>0&&Ge&&!ve.topItems[ve.topItems.length-1].dividerAfter&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ve.erpSections.map(e=>Me(e,!1)),ve.systemSections.map(e=>Me(e,!1)),ve.virtualSections.map(e=>Me(e,!0)),ve.footerSections.length>0&&/* @__PURE__ */J("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ve.footerSections.map(e=>Me(e,!1))]}),
|
|
31
|
-
/* @__PURE__ */J("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Be}`,style:De,children:/* @__PURE__ */X("button",{ref:Ae,type:"button",onClick:()=>$e(e=>!e),"aria-haspopup":"menu","aria-expanded":ze,"aria-label":E?ke.accountMenu(Re):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(E?"justify-center py-2":"px-2 py-2"),children:[Je,!E&&/* @__PURE__ */X("span",{className:"min-w-0 flex-1 text-left",children:[
|
|
32
|
-
/* @__PURE__ */J("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Re}),ae?.email&&Re!==ae.email&&/* @__PURE__ */J("span",{className:"block truncate text-2xs text-ink-faint",children:ae.email})]})]})}),q&&!E&&!se&&/* @__PURE__ */J(o,{side:"left",width:_,onResize:q,min:j,max:N,defaultWidth:v,storageKey:a,label:ke.resizeSidebar}),ze&&Xe&&/* @__PURE__ */X(S,{portal:!0,minWidth:224,onClose:()=>$e(!1),style:Q(_,Xe,window.innerHeight),children:[E&&/* @__PURE__ */X("div",{className:"border-b border-line px-3 py-3",children:[
|
|
33
|
-
/* @__PURE__ */J("p",{className:"truncate text-sm font-semibold text-gray-800",children:Re}),ae?.email&&/* @__PURE__ */J("p",{className:"truncate text-xs text-gray-500",children:ae.email})]}),
|
|
34
|
-
/* @__PURE__ */X(L,{onClick:()=>{$e(!1),te("/profile",!1)},children:[
|
|
35
|
-
/* @__PURE__ */J(A,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ke.profile]}),ve.footerItems.map(e=>/* @__PURE__ */X(L,{onClick:()=>{$e(!1),We(e)},children:[
|
|
36
|
-
/* @__PURE__ */J("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:de[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */X(L,{onClick:()=>{$e(!1),oe()},children:[
|
|
37
|
-
/* @__PURE__ */J(A,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ke.reportIssue]}),
|
|
38
|
-
/* @__PURE__ */J(z,{}),le&&/* @__PURE__ */X(B,{children:[
|
|
39
|
-
/* @__PURE__ */X(L,{onClick:()=>{$e(!1),le()},children:[
|
|
40
|
-
/* @__PURE__ */J(A,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ke.switchToDesktop]}),
|
|
41
|
-
/* @__PURE__ */J(z,{})]}),
|
|
42
|
-
/* @__PURE__ */X(L,{danger:!0,onClick:()=>{$e(!1),ie()},children:[
|
|
43
|
-
/* @__PURE__ */J(A,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ke.signOut]})]}),Se&&E&&/* @__PURE__ */J(S,{portal:!0,minWidth:220,onClose:()=>Le(null),style:{left:_+f,top:Math.min(Se.top,window.innerHeight-48*Math.min(Se.items.length,10)-16)},children:m(Se.items,ye).map((e,t)=>/* @__PURE__ */X("div",{role:e.heading?"group":void 0,"aria-label":e.heading?e.heading.menuLabel??e.heading.label:void 0,children:[t>0&&/* @__PURE__ */J(z,{}),e.heading&&/* @__PURE__ */J($,{children:e.heading.menuLabel??e.heading.label}),e.items.map(e=>/* @__PURE__ */X(L,{onClick:()=>We(e),children:[Ie(e.to,de),
|
|
44
|
-
/* @__PURE__ */J("span",{className:e.to===re?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))]},e.heading?.to??`run-${t}`))})]})}export{Q as accountMenuPosition,_ as default};
|
package/dist/chunk-4WWK6FHD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="12.13.0",a=r;export{a as APP_VERSION,r as VERSION};
|
package/dist/chunk-675RYIWR.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-TJSJVC6P.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:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),C=j??M.nothingToBreakDown,$=c(null),B=a($),F=v??B,[V,Y]=u(null),{highlighted:z}=l(),A=e(p,F,d);if(0===A.length)/* @__PURE__ */
|
|
2
|
-
return s("div",{className:b,ref:$,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:C})});const D=k??i(0),G=Math.max(...A.map(e=>e.value),1),H=e=>34+e/G*62,P=e=>`color-mix(in oklab, ${D} ${H(e).toFixed(0)}%, ${o.surface})`,S=e=>H(e)>=55?o.surface:o.label,T=V??z,E=V?A.find(e=>e.key===V):void 0;/* @__PURE__ */
|
|
3
|
-
return f("div",{className:`relative ${b??""}`,ref:$,children:[
|
|
4
|
-
/* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${F} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>Y(null),children:A.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:T&&T!==e.key?.55:1,onMouseEnter:()=>Y(e.key),children:[
|
|
6
|
-
/* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:P(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:S(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:S(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),E&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(r,{title:E.label,rows:[{key:"value",label:M.value,color:P(E.value),value:N(E.value)}]})}),
|
|
7
|
-
/* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:A.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
|
package/dist/chunk-6VB4TBU6.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-QAS22BIS.js";import{ImageFocusPoint as a}from"./chunk-YX4MRM7A.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-NOEAEXIZ.js";import{TransferProgress as u}from"./chunk-JVNJCRHM.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-Z7RXWXR5.js";import{Icon as p}from"./chunk-JOAKKXTL.js";import{useShellStrings as b}from"./chunk-TJSJVC6P.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:F,hint:U,error:O,required:P,className:$,accept:z="image/*",maxSizeBytes:A,fit:J="cover",height:S=112,placeholder:X,cta:B,acceptHint:H,showFilename:I=!0,allowReplace:K=!0,allowRemove:q=!0,replaceLabel:M,removeLabel:V,busy:W=!1,busyLabel:E,choosingLabel:T,pickFailedLabel:Y,progress:Z,disabled:_=!1,kind:D,onKindChange:Q,focus:G,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=B??ie.cta,oe=D??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof V&&V?V:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=W||ne,me=ne&&!W?T??ie.choosing:E??ie.uploading,he=O??(se?Y??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=_||ue,ke=!!w&&(t(w,z)||w===ve),Ne=X??o(z,ie),je=M??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:A,acceptHint:H,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?r(w):"",Fe=!ke&&!!ee,Ue=_||!K&&!q?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[K&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
|
|
2
|
-
/* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),q&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Fe?void 0:{height:S},children:[Fe?
|
|
4
|
-
/* @__PURE__ */N(a,{value:G??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:J}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:J,objectPosition:G||void 0}}),I&&w&&/* @__PURE__ */N(n,{children:Ce}),Ue,ue&&/* @__PURE__ */N(l,{label:me,progress:Z,rounded:"rounded-md"})]}),Pe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":P||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:S},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:Z}):/* @__PURE__ */k(j,{children:[
|
|
5
|
-
/* @__PURE__ */N("span",{className:"text-ink-faintest",children:/* @__PURE__ */N(s,{})}),
|
|
6
|
-
/* @__PURE__ */N("span",{className:"px-3 text-xs text-ink-faint",children:Ne}),
|
|
7
|
-
/* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),H&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:H})]})});/* @__PURE__ */
|
|
8
|
-
return k(i,{label:F,htmlFor:be,hint:U,error:he,required:P,className:$,children:[Q&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(e,{value:oe,onChange:e=>Q(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),w?Oe:Pe,!R&&/* @__PURE__ */N("input",{...we.inputProps}),
|
|
9
|
-
/* @__PURE__ */N(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
package/dist/chunk-7ADTFFEM.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-27ZJQUDS.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as s,useScrollLock as n}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-JOAKKXTL.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-TJSJVC6P.js";import{useRef as f,useId as h,useState as x,useEffect as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function N({open:N,onClose:w,title:J,description:C,role:D="dialog",children:T,footer:L,blocking:W=!1,size:S="md",aside:U=!1,dirty:V=!1,initialFocus:A,"aria-label":K,"aria-labelledby":P,"aria-describedby":Q,className:X=""}){const $=f(null),z=h(),F=h(),G=!W,I=h(),Z=p().dialog,B=e(m()),[H,O]=x(null),Y=l({open:N,dirty:V,onClose:w,title:J,layer:H}),q=f(null),E=r(N&&null!==B,q),M=i(E,$);if(o(N),s($,N&&null!==B,A),n(N),b(()=>{if(N)return u(()=>(W||Y(),!0),()=>$.current)},[N,W,Y]),!N||!B)return null;/* @__PURE__ */
|
|
2
|
-
return y(g,{children:[/* @__PURE__ */k("span",{ref:q,hidden:!0,"data-popup-anchor":""}),v(
|
|
3
|
-
/* @__PURE__ */k(t,{value:H,children:/* @__PURE__ */y("div",{ref:O,className:"fixed inset-0"+(U?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":U?"":void 0,children:[
|
|
4
|
-
/* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30 backdrop-blur-sm","aria-hidden":"true"}),
|
|
5
|
-
/* @__PURE__ */k("div",{className:E?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:W?void 0:e=>{e.target===e.currentTarget&&Y()},children:/* @__PURE__ */y("div",{ref:$,"data-popup-panel":"",style:E?{left:M?.left??0,top:M?.top??0,visibility:M?void 0:"hidden"}:void 0,...a({role:D,modal:!0,titleId:J?I:void 0,labelledBy:P,label:K}),"aria-describedby":Q??(C?F:T?z:void 0),className:`${E?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${j[S]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${X}`.trim(),children:[J&&/* @__PURE__ */k("h2",{id:I,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:J}),C&&/* @__PURE__ */k("p",{id:F,className:((J?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:C}),T&&/* @__PURE__ */k("div",{id:z,className:"mt-2 text-sm text-gray-600",children:T}),L&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:L}),G&&/* @__PURE__ */k("button",{type:"button",onClick:Y,"aria-label":Z.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__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),B)]})}export{N as Dialog};
|
package/dist/chunk-CA3OC4YY.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-TJSJVC6P.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,C=c(null),F=o(C),E=x??F,[A,V]=m(null),{highlighted:z}=n();if(0===f.length||0===k.length)/* @__PURE__ */
|
|
2
|
-
return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const H=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),O=e=>H.length<=1?0:H.indexOf(e)/(H.length-1)*(E-g-140)+70,P=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),Q=/* @__PURE__ */new Map;for(const e of f)Q.set(e.depth,[...Q.get(e.depth)??[],e]);const S=Math.max(...[...Q.values()].map(e=>e.reduce((e,t)=>e+(P.get(t.key)??0),0))),T=p-20,U=S>0?(T-y*(Math.max(...[...Q.values()].map(e=>e.length))-1))/S:0,W=/* @__PURE__ */new Map;for(const[e,t]of Q){const n=t.map(e=>Math.max(2,(P.get(e.key)??0)*U)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>T&&l>0?Math.max(0,1-(o-T)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;W.set(t.key,{x:O(e),y:a,h:l,index:o}),a+=l+y})}const Y=/* @__PURE__ */new Map,B=/* @__PURE__ */new Map,J=/* @__PURE__ */new Map,L=(e,t)=>e.from===t||e.to===t,R="link"===A?.kind?k[A.index]:void 0,Z="node"===A?.kind?f.find(e=>e.key===A.key):void 0;/* @__PURE__ */
|
|
3
|
-
return u("div",{className:`relative ${M??""}`,ref:C,children:[
|
|
4
|
-
/* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${E} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>V(null),children:[k.map((e,n)=>{const o=W.get(e.from),l=W.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*U),i=o.y+(Y.get(e.from)??0)+a/2,s=l.y+(B.get(e.to)??0)+a/2;Y.set(e.from,(Y.get(e.from)??0)+a),B.set(e.to,(B.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=J.get(u)??0;J.set(u,f+1);const k=((e,t)=>A?"link"===A.kind?A.index===t:L(e,A.key):null!==z?L(e,z):null)(e,n);/* @__PURE__ */
|
|
5
|
-
return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>V({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=W.get(e.key);if(!t)return null;const n=t.x>E/2,o=(l=e.key,A?"node"===A.kind?A.key===l:L(k[A.index],l):null!==z?z===l:null);var l;/* @__PURE__ */
|
|
6
|
-
return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>V({kind:"node",key:e.key}),children:[
|
|
7
|
-
/* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:r(t.index,e.color,e.tone)}),
|
|
8
|
-
/* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),R&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:`${R.from} → ${R.to}`,rows:[{key:"value",label:b.flow,color:r(W.get(R.from)?.index??0,R.color),value:$(R.value)}]})}),Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:Z.label,rows:[{key:"value",label:b.throughput,color:r(W.get(Z.key)?.index??0,Z.color,Z.tone),value:$(P.get(Z.key)??0)}]})}),
|
|
9
|
-
/* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,$(e.value)])})]})}export{f as SankeyChart};
|