efficient-shell 11.11.0 → 12.0.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 +10 -12
- package/dist/{Browser-NRGJ53ST.js → Browser-CXZAXF55.js} +17 -17
- package/dist/Calculator-TKQRQGTI.js +29 -0
- package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-WFC3TAL4.js} +9 -9
- package/dist/Files-QM5PW6BX.js +88 -0
- package/dist/{Notepad-2XW63REV.js → Notepad-B7CKQ54M.js} +9 -9
- package/dist/PdfViewer-3UEC5TNN.js +1 -0
- package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-JMJORKWZ.js} +68 -68
- package/dist/{Preview-K7KDM4XK.js → Preview-OELV5X55.js} +30 -30
- package/dist/Sidebar-SZ5OGL6C.js +44 -0
- package/dist/{Stock-IHAG62QV.js → Stock-R3436P6X.js} +3 -3
- package/dist/{Weather-EQDFEBIH.js → Weather-6N3ZPO2Q.js} +20 -20
- package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-BJKYHGLS.js} +6 -6
- package/dist/ai/index.js +91 -91
- package/dist/apps/index.d.ts +26 -25
- 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/ChartTooltip.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-7V32O5NF.js → chunk-2UO47XB4.js} +14 -30
- package/dist/{chunk-X2DUOIJP.js → chunk-33F35NNM.js} +1 -1
- package/dist/{chunk-FUHURDBL.js → chunk-34AHFST2.js} +1 -1
- package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
- package/dist/{chunk-JG26ICX6.js → chunk-3LGPZAVU.js} +2 -2
- package/dist/{chunk-3JCOD5L2.js → chunk-3YQICVUP.js} +2 -2
- package/dist/{chunk-5B4GRLAA.js → chunk-46EBZ7YI.js} +1 -1
- package/dist/{chunk-AHITTM6W.js → chunk-46VLN6KC.js} +1 -1
- package/dist/{chunk-E3EHHR73.js → chunk-4ALGGYHV.js} +9 -9
- package/dist/{chunk-QOJ2UNS5.js → chunk-4DDL6NXB.js} +1 -1
- package/dist/{chunk-62BDGAML.js → chunk-4K7BA3PD.js} +6 -6
- package/dist/chunk-4LNO444F.js +11 -0
- package/dist/{chunk-225LCPO7.js → chunk-4MERJIJJ.js} +1 -1
- package/dist/chunk-56YJIKVI.js +11 -0
- package/dist/{chunk-VEGZVUHE.js → chunk-5EWKVVUD.js} +1 -1
- package/dist/chunk-5PDHKH2A.js +3 -0
- package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
- package/dist/{chunk-6DQANKTL.js → chunk-62RAGXWK.js} +9 -9
- package/dist/{chunk-NMQGAP3H.js → chunk-63ZLF7LS.js} +1 -1
- package/dist/chunk-6E47JSLM.js +22 -0
- package/dist/{chunk-3PZI2C4R.js → chunk-6HO7244M.js} +1 -1
- package/dist/{chunk-3ZRYKZGI.js → chunk-6KGIHI6X.js} +10 -10
- package/dist/{chunk-OLJUPBY4.js → chunk-6MWLOLLP.js} +1 -1
- package/dist/{chunk-K6D7OSKZ.js → chunk-7P2WKDGB.js} +14 -14
- package/dist/{chunk-ESWR7YNY.js → chunk-A34PD3XT.js} +16 -16
- package/dist/{chunk-KVVZLEUG.js → chunk-A3AKJDLI.js} +1 -1
- package/dist/chunk-AEMAGYIZ.js +8 -0
- package/dist/{chunk-CLAKVFOB.js → chunk-AICGATHE.js} +48 -48
- package/dist/{chunk-57WQVUBX.js → chunk-AIJ6OR6X.js} +2 -2
- package/dist/{chunk-WOOKUEED.js → chunk-AQ3LCE2U.js} +1 -1
- package/dist/chunk-ATURDO2C.js +14 -0
- package/dist/chunk-B7WTHCTF.js +4 -0
- package/dist/{chunk-HRG4FYVU.js → chunk-BUHTLO2K.js} +1 -1
- package/dist/{chunk-CSLMWGFS.js → chunk-BYLGKRIT.js} +1 -1
- package/dist/{chunk-V64CJHMY.js → chunk-C4T4APD6.js} +22 -22
- package/dist/{chunk-TA4JGC5C.js → chunk-CCA4LQNB.js} +1 -1
- package/dist/{chunk-Y4RHGLXB.js → chunk-CFJL6MML.js} +1 -1
- package/dist/{chunk-KKJ55GUZ.js → chunk-CJ4U4C4A.js} +5 -5
- package/dist/{chunk-TZXAW32T.js → chunk-CRILBBSU.js} +1 -1
- package/dist/{chunk-D4RVWSUT.js → chunk-CRO56LVN.js} +1 -1
- package/dist/{chunk-DHMOJX2Z.js → chunk-D7DRZKUI.js} +1 -1
- package/dist/{chunk-SGBR443F.js → chunk-DD2ZGHCG.js} +6 -6
- package/dist/{chunk-42TLGG33.js → chunk-DSKROZST.js} +1 -1
- package/dist/{chunk-CDQUOCXO.js → chunk-DV4B26FJ.js} +1 -1
- package/dist/{chunk-VPEH3THH.js → chunk-DW5Y57I2.js} +3 -3
- package/dist/{chunk-CAIKDX2M.js → chunk-DWYCSJ6O.js} +2 -2
- package/dist/{chunk-UWJNQH2X.js → chunk-E47TNYYE.js} +1 -1
- package/dist/{chunk-IIKPM3F4.js → chunk-ED5D2O6E.js} +1 -1
- package/dist/{chunk-LXOX5FGH.js → chunk-EFBWQWUS.js} +2 -2
- package/dist/chunk-EJBR5Y4X.js +9 -0
- package/dist/{chunk-AQGIK2CV.js → chunk-EM6VZSNJ.js} +1 -1
- package/dist/{chunk-7R23EKON.js → chunk-EO3IKZCP.js} +1 -1
- package/dist/chunk-EOVXFXVV.js +2 -0
- package/dist/chunk-EZBE3H2W.js +9 -0
- package/dist/{chunk-PMKBWDXO.js → chunk-FGWHTNC3.js} +1 -1
- package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/{chunk-PZHO4FEN.js → chunk-GCRPI3AL.js} +1 -1
- package/dist/{chunk-6LK2BBCC.js → chunk-GEQC4ABV.js} +6 -6
- package/dist/{chunk-T74FGTLW.js → chunk-GHMDLZH4.js} +7 -7
- package/dist/chunk-GWDTGCQB.js +9 -0
- package/dist/{chunk-6LITLCVV.js → chunk-H34KI3HV.js} +9 -9
- package/dist/{chunk-LXQHTY3A.js → chunk-H3IGNWT7.js} +3 -3
- package/dist/{chunk-VZ52KKNA.js → chunk-HCKCQIWA.js} +6 -6
- package/dist/{chunk-R72ZKZDP.js → chunk-HK4QAI2A.js} +2 -2
- package/dist/{chunk-QEDVXD3L.js → chunk-HKPVHSZ3.js} +1 -1
- package/dist/{chunk-LGTYPLJM.js → chunk-HNUKXGYP.js} +3 -3
- package/dist/{chunk-B2AYI45X.js → chunk-HTB5AEZU.js} +6 -6
- package/dist/chunk-IJXMWWTM.js +9 -0
- package/dist/{chunk-AWQ5SOC5.js → chunk-IK37Q6LY.js} +1 -1
- package/dist/{chunk-EV7VAXMO.js → chunk-IS7C6OWZ.js} +9 -9
- package/dist/{chunk-YQLKZ5UQ.js → chunk-JAQO3TNE.js} +1 -1
- package/dist/chunk-JINTE3G4.js +1 -0
- package/dist/{chunk-SKRFI6WB.js → chunk-JQHL4B4C.js} +12 -12
- package/dist/{chunk-KZEIQO3V.js → chunk-JSUL7UON.js} +3 -3
- package/dist/{chunk-ZOQVYSTB.js → chunk-K46DLEIX.js} +22 -22
- package/dist/{chunk-Q7DVGUML.js → chunk-KABXUBIH.js} +1 -1
- package/dist/{chunk-CT7AU2TA.js → chunk-KRH7UAD2.js} +1 -1
- package/dist/{chunk-PDFV3YQB.js → chunk-KSHNA6W2.js} +1 -1
- package/dist/{chunk-7IVTGOGM.js → chunk-L6OPXIZN.js} +1 -1
- package/dist/{chunk-ZKBGUDNB.js → chunk-LBGRLG3Y.js} +1 -1
- package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
- package/dist/{chunk-PL4HKGYP.js → chunk-LISPTWW3.js} +1 -1
- package/dist/{chunk-HJBR73GS.js → chunk-LJN77RG6.js} +1 -1
- package/dist/chunk-LPJGF6LK.js +27 -0
- package/dist/{chunk-SWJXWDKX.js → chunk-LXHTCLNX.js} +1 -1
- package/dist/chunk-MBY5JIGB.js +1 -0
- package/dist/{chunk-RNBC6V2D.js → chunk-MOBJVNLF.js} +11 -11
- package/dist/{chunk-R6TDZ7T5.js → chunk-MQXZZBR6.js} +1 -1
- package/dist/{chunk-YUAF3FDE.js → chunk-MSAQGUGU.js} +4 -4
- package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-F636NDAU.js → chunk-N7GFQZ2J.js} +8 -8
- package/dist/chunk-N7LDQZTL.js +8 -0
- package/dist/chunk-NDP2I5HK.js +8 -0
- package/dist/{chunk-VVDK7XPH.js → chunk-NIBYHQLT.js} +1 -1
- package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
- package/dist/{chunk-KYHDDVTR.js → chunk-NK5RRBXY.js} +6 -6
- package/dist/{chunk-WEEQDPU3.js → chunk-NPTHHWXZ.js} +5 -5
- package/dist/chunk-NZISMTQE.js +7 -0
- package/dist/{chunk-K6LW2QLI.js → chunk-O53EQODF.js} +1 -1
- package/dist/{chunk-32EKHIAZ.js → chunk-OAZX7ZGB.js} +12 -12
- package/dist/{chunk-IEOCUEJK.js → chunk-OMCM3SIE.js} +7 -7
- package/dist/chunk-OMUC6TZT.js +6 -0
- package/dist/{chunk-PETBAYS5.js → chunk-OXVRXWJL.js} +12 -12
- package/dist/{chunk-ATKFIHDP.js → chunk-P75R4EYJ.js} +4 -4
- package/dist/{chunk-I5XNADZ3.js → chunk-PB6XGDLJ.js} +8 -8
- package/dist/{chunk-HDABS36W.js → chunk-PLDMQNKD.js} +7 -7
- package/dist/{chunk-M57KX3OM.js → chunk-QMTYILTT.js} +1 -1
- package/dist/{chunk-5KKJAYKT.js → chunk-QTNMALBN.js} +1 -1
- package/dist/{chunk-7HLBVMMQ.js → chunk-RBINX62X.js} +1 -1
- package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-SAASFWKB.js → chunk-RDYFZHT3.js} +1 -1
- package/dist/{chunk-JRCFOZEU.js → chunk-RLTTAH46.js} +4 -4
- package/dist/{chunk-UTITWGVW.js → chunk-RPFONHXQ.js} +1 -1
- package/dist/{chunk-2XORVHF2.js → chunk-RSPCCVN4.js} +1 -1
- package/dist/{chunk-UVMM7AYO.js → chunk-S262RGL6.js} +1 -1
- package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/{chunk-C3UY34DC.js → chunk-SCPPW3ZC.js} +4 -4
- package/dist/{chunk-PMA6DZ4Q.js → chunk-SOWRW647.js} +6 -6
- package/dist/chunk-SZC35EYE.js +28 -0
- package/dist/{chunk-6CK44QWU.js → chunk-T4WDJ7IB.js} +29 -29
- package/dist/{chunk-ZOQXFS3R.js → chunk-T6BGS26U.js} +1 -1
- package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-O6VIHWYU.js → chunk-TF6DYDNQ.js} +1 -1
- package/dist/{chunk-JJZAYAVL.js → chunk-THSKCKAQ.js} +1 -1
- package/dist/chunk-TLE6VHMJ.js +8 -0
- package/dist/{chunk-PDXOGPWH.js → chunk-TOSUM2OI.js} +1 -1
- package/dist/{chunk-SEP35R2E.js → chunk-TVRKONNH.js} +1 -1
- package/dist/{chunk-3OHADZYV.js → chunk-U24GFE5L.js} +1 -1
- package/dist/{chunk-QAIMZN7M.js → chunk-UDVUVFRS.js} +10 -10
- package/dist/{chunk-PVOTOUJG.js → chunk-UIOKWFT4.js} +1 -1
- package/dist/chunk-UMFEOZ75.js +4 -0
- package/dist/{chunk-IUMFOSFJ.js → chunk-UNJWYV6V.js} +3 -3
- package/dist/chunk-UYNFTF6L.js +2 -0
- package/dist/{chunk-IGQZANYE.js → chunk-VI4NLOVJ.js} +11 -11
- package/dist/{chunk-VU5P4ZM5.js → chunk-VNAOZVSM.js} +13 -13
- package/dist/{chunk-OXCFRH33.js → chunk-VOXX4LNC.js} +1 -1
- package/dist/{chunk-63545Z3N.js → chunk-VPGQMNW3.js} +1 -1
- package/dist/{chunk-GRC46C4V.js → chunk-W4UYDSTI.js} +7 -7
- package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/{chunk-ALJS3SYS.js → chunk-WPCNJ4UL.js} +1 -1
- package/dist/chunk-WRJP33DN.js +6 -0
- package/dist/{chunk-NTUZT37J.js → chunk-WRRMZAKK.js} +4 -4
- package/dist/chunk-WVIUU4BZ.js +13 -0
- package/dist/{chunk-RMSF4UCJ.js → chunk-X3NYVMXJ.js} +1 -1
- package/dist/chunk-XNFZLSWW.js +7 -0
- package/dist/{chunk-FFNPAJLS.js → chunk-XZ2WQNOX.js} +9 -9
- package/dist/chunk-XZU24YKP.js +13 -0
- package/dist/chunk-Y3SVPBUT.js +7 -0
- package/dist/{chunk-YOXR3VKO.js → chunk-YAZENY3X.js} +1 -1
- package/dist/{chunk-FRH2AHPI.js → chunk-YESTUDOK.js} +1 -1
- package/dist/{chunk-A4YTWDKD.js → chunk-YIV7CFBG.js} +2 -2
- package/dist/{chunk-3X2W7R5B.js → chunk-YJOJ5MUZ.js} +11 -11
- package/dist/chunk-YN5K72D6.js +5 -0
- package/dist/chunk-YQEGMCSX.js +9 -0
- package/dist/{chunk-CG5X5ZLV.js → chunk-YXOFUY4J.js} +1 -1
- package/dist/{chunk-6C6M3QXL.js → chunk-ZHFKBWBU.js} +1 -1
- package/dist/chunk-ZITMPMUT.js +2 -0
- package/dist/{chunk-B2SLXCMY.js → chunk-ZKYBLZPT.js} +8 -8
- package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/{chunk-IUG4Z2ND.js → chunk-ZU3BD75E.js} +1 -1
- package/dist/{chunk-PVVHWLNX.js → chunk-ZU432XW4.js} +1 -1
- package/dist/{chunk-5UCRYSQJ.js → chunk-ZYDRBF3H.js} +5 -5
- package/dist/{chunk-2ZAFRGRF.js → chunk-ZYJAZ5HH.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.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/SplitButton.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/icons/index.js +1 -1
- package/dist/index.js +666 -666
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- 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/ContextMenu.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/DropdownMenu.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/PopupMenu.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/StatusBadge.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +0 -265
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/shell.css +1 -12
- 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 +3 -8
- package/dist/Calculator-YZEGVEQ7.js +0 -29
- package/dist/Documents-FIGKS36O.js +0 -84
- package/dist/Files-FPNJ46XY.js +0 -88
- package/dist/PdfViewer-M4RTCNNE.js +0 -1
- package/dist/Sidebar-QP5Y7RBV.js +0 -44
- package/dist/Spreadsheet-RQE4OCEK.js +0 -75
- package/dist/chunk-2E3K4FSQ.js +0 -13
- package/dist/chunk-2EPAXWZZ.js +0 -14
- package/dist/chunk-2HAJ33HM.js +0 -9
- package/dist/chunk-2NRNKF46.js +0 -9
- package/dist/chunk-2XOH3NJZ.js +0 -27
- package/dist/chunk-3VR5BOD4.js +0 -8
- package/dist/chunk-5YP7MFPK.js +0 -1
- package/dist/chunk-6FIYG7IH.js +0 -28
- package/dist/chunk-6R32KKIS.js +0 -22
- package/dist/chunk-7DI3VQCF.js +0 -2
- package/dist/chunk-B2MD232O.js +0 -6
- package/dist/chunk-BDUXF7BT.js +0 -4
- package/dist/chunk-EC22ACQZ.js +0 -11
- package/dist/chunk-FJBJUFD7.js +0 -4
- package/dist/chunk-GO6HU2O3.js +0 -7
- package/dist/chunk-H56TNUV4.js +0 -1
- package/dist/chunk-KU4IWX6F.js +0 -2
- package/dist/chunk-MQ445O4X.js +0 -6
- package/dist/chunk-MQE2FBJU.js +0 -7
- package/dist/chunk-NMTS2L2B.js +0 -8
- package/dist/chunk-ODQYWMDF.js +0 -3
- package/dist/chunk-OPZXVXX5.js +0 -7
- package/dist/chunk-OZM6DE7A.js +0 -8
- package/dist/chunk-R7KRBKFH.js +0 -5
- package/dist/chunk-RQBQETXQ.js +0 -11
- package/dist/chunk-S43DAIIB.js +0 -9
- package/dist/chunk-SCZUDGRZ.js +0 -2
- package/dist/chunk-SUYQ7QYB.js +0 -13
- package/dist/chunk-TXKTITMF.js +0 -8
- package/dist/chunk-UG42KUCT.js +0 -9
- package/dist/chunk-VEZHFONL.js +0 -9
- package/dist/chunk-VTVSMRFX.js +0 -1
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-
|
|
1
|
+
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{ROW_HEIGHTS as c}from"./chunk-AW7TOB6N.js";import{reportBoundaryError as u}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as d}from"./chunk-JDCM2VHG.js";import{Result as h}from"./chunk-FGWHTNC3.js";import{CMD_Z as m,CMD_SHIFT_Z as p}from"./chunk-ZDMZM7HD.js";import{CopyButton as f}from"./chunk-6MWLOLLP.js";import{confirm as w}from"./chunk-LPJGF6LK.js";import{ItemCount as y}from"./chunk-TOSUM2OI.js";import{isInOverlayOver as g}from"./chunk-3DVNXNTF.js";import{dialogA11y as b}from"./chunk-VWGWZY7A.js";import{ColoredBadge as v}from"./chunk-KRH7UAD2.js";import{LoadingSpinner as x}from"./chunk-6HO7244M.js";import{useShellAuth as k}from"./chunk-2QY5BJLA.js";import{useIsMobile as E,useIsPhone as C}from"./chunk-UGTRSRIW.js";import{useShellPrefs as M}from"./chunk-KC3EX26K.js";import{activationOrder as N,activeListeners as S,ModalActionsContext as L,subscribeActive as T,getActiveModalId as z,KEY_ACTIVATED_SELECTOR as A}from"./chunk-F3ZOO23R.js";import{StatusBadge as D}from"./chunk-FZM3ZPW3.js";import{focusableIn as P}from"./chunk-CDAJKLGL.js";import{PopupMenu as I,PopupMenuItem as W,PopupMenuDivider as K,PopupMenuLabel as R}from"./chunk-6KGIHI6X.js";import{Button_default as O}from"./chunk-EOVXFXVV.js";import{Icon as $}from"./chunk-2UO47XB4.js";import{LoadingSpinner as j}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as F}from"./chunk-62LW225J.js";import{shellHttp as q,isShellHttpConfigured as B}from"./chunk-STKJA4PV.js";import{runEscapeInterceptors as H}from"./chunk-TWVUQUUD.js";import{useShellStrings as U}from"./chunk-MBY5JIGB.js";import{createContext as X,useContext as Y,Component as V,useLayoutEffect as G,useRef as J,useEffect as _,useState as Z,useSyncExternalStore as Q,useCallback as ee,isValidElement as te,Fragment as ne,Children as re,cloneElement as oe,useMemo as ie,useId as ae,useReducer as se,Suspense as le}from"react";import{jsxs as ce,jsx as ue,Fragment as de}from"react/jsx-runtime";import{createPortal as he}from"react-dom";import{useLocation as me}from"react-router-dom";import{useQueryClient as pe,useQuery as fe}from"@tanstack/react-query";function we(e){return"component"in e}function ye(e){return"endpoint"in e}var ge={};function be(e){ge=e}var ve=new Proxy({},{get:(e,t)=>ge[t],has:(e,t)=>t in ge,ownKeys:()=>Object.keys(ge),getOwnPropertyDescriptor(e,t){if(t in ge)return{configurable:!0,enumerable:!0,value:ge[t]}}});function xe(){return B()}var ke=q,Ee=X(null);function Ce(){return Y(Ee)?.pageSearch??""}var Me=null,Ne=/* @__PURE__ */new Set;function Se(e){Me!==e&&(Me=e,Ne.forEach(e=>e()))}function Le(){return Me}function Te(e){return Ne.add(e),()=>{Ne.delete(e)}}var ze=null;function Ae(e){ze=e}function De({error:e,onReload:t}){const n=d(e);/* @__PURE__ */
|
|
2
2
|
return ce("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
3
|
/* @__PURE__ */ue($,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
4
|
/* @__PURE__ */ce("div",{className:"min-w-0",children:[
|
|
5
5
|
/* @__PURE__ */ue("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
6
|
/* @__PURE__ */ue("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
|
|
7
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var Pe=class extends V{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=
|
|
7
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var Pe=class extends V{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),u(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */ue(De,{error:e,onReload:this.reset}):this.props.children}},Ie=X(null),We="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ke({className:e="",auto:t=!1}){const n=Y(Ie),r=U().undo,o=n?.claimOwnMount;if(G(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:u}=n;/* @__PURE__ */
|
|
8
8
|
return ce("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:
|
|
10
|
-
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:
|
|
11
|
-
return ue(j,{label:e.loading,padding:"",className:He})}function
|
|
9
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",m):r.nothingToUndo,className:We,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */ue("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:We,children:r.redo})]})}var Re=/* @__PURE__ */new Set([408,429]);function Oe(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function $e(e){const t=Oe(e);return null!=t&&(t>=400&&t<500&&!Re.has(t))}function je(e,t){return!$e(t)&&e<3}function Fe(e){if("page"!==e.type)return!0;const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return!0;const n=t;return!n.widget&&!n.utility}function qe(e){const t=e.route?ve[e.route]:void 0;if(!t||!we(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Be=(e,t)=>!!t&&"page"===e.type&&e.route===t;var He="flex-1 min-h-0";function Ue(){const e=U().record;/* @__PURE__ */
|
|
11
|
+
return ue(j,{label:e.loading,padding:"",className:He})}function Xe(e){return e??void 0}function Ye({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=U().record;if(t||e&&n)/* @__PURE__ */return ue(Ue,{});if(r){const e=Oe(r);if(401===e)/* @__PURE__ */
|
|
12
12
|
return ue(h,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:He});if(403===e)/* @__PURE__ */
|
|
13
13
|
return ue(h,{status:"403",className:He});if(404===e||410===e)/* @__PURE__ */
|
|
14
14
|
return ue(h,{status:"404",title:i.notFound,className:He});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
15
|
return ue(h,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:He})}/* @__PURE__ */
|
|
16
|
-
return ue(h,{status:"404",title:i.notFound,className:He})}function Ve({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ue(de,{children:t(e)}):/* @__PURE__ */ue(
|
|
17
|
-
return ue(
|
|
18
|
-
return ue("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ke.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:s?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(s?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var at=/* @__PURE__ */new Set,st=()=>"hidden";function lt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ve[e.entityType];if(!o||!ye(o))return null;const i=o,[a,s]=Z(!1),{dirty:c,registerDirty:u}=tt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=
|
|
16
|
+
return ue(h,{status:"404",title:i.notFound,className:He})}function Ve({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */ue(de,{children:t(e)}):/* @__PURE__ */ue(Ye,{...n})}var Ge=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function Je(e){return"string"==typeof e&&(e.startsWith("new-")||Ge.test(e))}function _e(e){if(Je(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Ze=X({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Qe=X(null);function et(e){const t=Y(Qe),n=J(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),G(()=>{if(t)return t(n.current,e)},[t,e]),_(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function tt(){const e=J(/* @__PURE__ */new Map),[t,n]=Z(!1);return{dirty:t,registerDirty:ee((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function nt(){return Y(Ze)}function rt(e){if("page"!==e.type&&_e(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function ot({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=tt(),i=ve[e.route];if(!i||!we(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
|
+
return ue(Yr,{open:!0,onClose:t,icon:l[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */ue(Qe.Provider,{value:o,children:/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */ue(x,{})}),children:/* @__PURE__ */ue(s,{})})})})}function it({entityType:e,entityId:t,label:n}){const r=U(),o=pe(),{data:i}=fe({queryKey:["my-profile-sidebar"],enabled:xe(),queryFn:()=>ke.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
|
|
18
|
+
return ue("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];ke.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:s?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(s?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var at=/* @__PURE__ */new Set,st=()=>"hidden";function lt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=ve[e.entityType];if(!o||!ye(o))return null;const i=o,[a,s]=Z(!1),{dirty:c,registerDirty:u}=tt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=Je(e.entityId),p=!i.selfFetching&&!h&&!m&&xe(),f=fe({queryKey:[d,e.entityId],queryFn:()=>{return ke.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Xe(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!$e(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:je}),w=f.data,y=f.refetch;_(()=>{var t;if(p)return t=t=>{t!==e.id||at.has(t)||y({cancelRefetch:!1})},Qn.add(t),()=>{Qn.delete(t)}},[y,e.id,p]);const g=ee(()=>{a&&!c?s(!1):t()},[a,c,t]),b=(i.useEdit??st)(w??null),v=!i.useEdit||m||h?void 0:{state:b,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},k=i.selfFetching?e.label:w?i.title(w,a,s):e.label,E=i.icon,C=E?l[E]:null,M=k,N=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(x,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,s)}):null!=w?/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(Yr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ue(Ue,{})}),children:i.render(w,t,e.entityId,a,s)}):/* @__PURE__ */ue(Yr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */ue(Ye,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */ue(Yr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:C,title:M,footer:N,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:v,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */ue(Qe.Provider,{value:u,children:/* @__PURE__ */ue(le,{fallback:/* @__PURE__ */ue(Ue,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */ue(Ve,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function ct(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function ut(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function dt(e){const t=ct(e),n=t??ut(e);if(!n)return;if(t&&!dr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&er(o)}function ht(){const e=z();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var mt=/* @__PURE__ */new Map;function pt(){const e=ht();if(e)return mt.get(e)}function ft(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var wt="rosh-peek-style",yt=F.peek,gt=F.taskbarPreview;function bt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(wt))return;const e=document.createElement("style");e.id=wt,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${yt}!important}html.rosh-reduce-transparency body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.92}@media (prefers-reduced-motion:reduce){body.rosh-peeking [data-modal-panel]{transition:none}}`,document.head.appendChild(e)}(),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")),e&&e.setAttribute("data-peek-focus",""),document.body.classList.toggle("rosh-peeking",!!e))}function vt(){"undefined"!=typeof document&&(document.body.classList.remove("rosh-peeking"),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")))}function xt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=U(),l=J(null),[c,u]=Z({w:n,h:Math.round(.75*r)}),[d,h]=Z(!1);return G(()=>{const o=l.current;if(!o)return;const i=ct(e)??ft(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=Math.min(n/a.width,r/a.height),c=Math.max(80,Math.round(a.width*s)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),h(!0);const m=i.cloneNode(!0);return m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px",m.style.transform=`scale(${s})`,m.style.transformOrigin="top left",m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */ce("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
19
19
|
/* @__PURE__ */ue("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */ce("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
20
|
/* @__PURE__ */ue($,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
-
/* @__PURE__ */ue("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ue("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */ue("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function kt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=U(),s=e.length>1,l=
|
|
21
|
+
/* @__PURE__ */ue("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */ue("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */ue("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function kt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=U(),s=e.length>1,l=J(null),[c,u]=Z({left:-9999,top:-9999,ready:!1}),[d,h]=Z(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");G(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),_(()=>vt,[]);const m="top"===d,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return he(
|
|
22
22
|
/* @__PURE__ */ue("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:gt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{vt(),i()},children:e.map(e=>{const t=ct(e.id)??ft(e.label),o=t?function(e){if(dr(e))return null;const t=e.getBoundingClientRect(),n=ir(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
23
23
|
return ce("div",{className:"group flex flex-col items-center",onMouseEnter:()=>bt(t),children:[!m&&/* @__PURE__ */ue("span",{className:p,children:e.label}),
|
|
24
24
|
/* @__PURE__ */ue(xt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */ue("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */ce("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
|
|
25
|
-
/* @__PURE__ */ue($,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Et(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function Ct({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=U(),[a,s]=Z(null);
|
|
25
|
+
/* @__PURE__ */ue($,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Et(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function Ct({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=U(),[a,s]=Z(null);_(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const c=Q(T,z),[,u]=Z(0);_(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=Z(0);_(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=ft(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=Z(null),[f,w]=Z(null),[g,b]=Z(null),v=J(null),x=()=>{v.current&&(clearTimeout(v.current),v.current=null),v.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!ve[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],C=/* @__PURE__ */new Map;for(const e of k){const t=e.route?ve[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=C.get(r);if(void 0!==o)E[o].items.push(e);else{C.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return he(
|
|
26
26
|
/* @__PURE__ */ce(de,{children:[E.map(e=>{const n=e.route?l[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(c){const t=document.querySelector(`[data-modal-id="${c}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=ct(e.id)??ft(e.label);return!!t&&!dr(t)});/* @__PURE__ */
|
|
27
27
|
return ce("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(g||(v.current&&(clearTimeout(v.current),v.current=null),v.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),v.current&&(clearTimeout(v.current),v.current=null),p(null),w(null),s?b({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&te(n)?oe(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */ue($,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
28
|
/* @__PURE__ */ue("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */ue("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */ue(y,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */ue("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */ue($,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
29
|
/* @__PURE__ */ue("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ce("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
30
30
|
/* @__PURE__ */ue($,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),g&&/* @__PURE__ */ce(I,{portal:!0,minWidth:200,style:Et(g.x,g.y),onClose:()=>b(null),children:[
|
|
31
31
|
/* @__PURE__ */ue(R,{children:g.label}),
|
|
32
|
-
/* @__PURE__ */ce(
|
|
32
|
+
/* @__PURE__ */ce(W,{onClick:()=>{b(null),g.items.forEach(e=>function(e){const t=On.get(e);t&&tr(t)}(e.id))},children:[
|
|
33
33
|
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
-
/* @__PURE__ */ce(
|
|
34
|
+
/* @__PURE__ */ce(W,{onClick:()=>{b(null),g.items.forEach(e=>o(e.id))},children:[
|
|
35
35
|
/* @__PURE__ */ue("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */ue("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
36
|
-
/* @__PURE__ */ue(
|
|
37
|
-
/* @__PURE__ */ce(
|
|
38
|
-
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */ue(kt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:x})]}),a)}var Mt=["/login","/forgot-password","/reset-password","/force-change-password"];function Nt({children:e,windowAccentForRoute:t}){const n=me(),r=Mt.some(e=>n.pathname.startsWith(e)),[o,i]=Z([]),a=
|
|
36
|
+
/* @__PURE__ */ue(K,{}),
|
|
37
|
+
/* @__PURE__ */ce(W,{danger:!0,onClick:()=>{b(null),g.items.forEach(e=>t(e.id))},children:[
|
|
38
|
+
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */ue(kt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:x})]}),a)}var Mt=["/login","/forgot-password","/reset-password","/force-change-password"];function Nt({children:e,windowAccentForRoute:t}){const n=me(),r=Mt.some(e=>n.pathname.startsWith(e)),[o,i]=Z([]),a=J(o);G(()=>{a.current=o},[o]);const s=Q(Te,Le,Le),l=J(/* @__PURE__ */new Map),c=e=>{const t=Fe(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};_(()=>{mt.clear();for(const e of o)e.route&&mt.set(e.id,e.route)},[o]);const u=ee(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ee(e=>{var t;ct(e)||ut(e)?(t=e,window.dispatchEvent(new CustomEvent(Mr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Pn;t&&at.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(In.get(i)??-1)>a)||er(o),t&&at.delete(e)},50)},m=(e,t,n)=>{const r=ze;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Fe(t))return e.length;if(t.shellOwned&&Be(t,n.home))return 0;const r=Be(t,n.home)?void 0:qe(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Fe(e)&&!Be(e,n.home)&&qe(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Be(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Be(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Fe(e[t])&&!Be(e[t],n.home)?qe(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:Le(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=ee(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),f=ee((e,t,n,r,o,a={})=>{if(!ve[e]||!ye(ve[e]))return;const s=`${e}:${t}`,l=ht();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Xe(n),openedFrom:l},!!a.append))})},[]),w=ee((e,t={})=>{if(!ve[e]||!we(ve[e]))return;const n=ve[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Bn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const p=ht();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:p,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ee(()=>{},[]),g=ee(()=>{},[]),b=d,v=d;/* @__PURE__ */
|
|
39
39
|
return ce(Ze.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:b,minimize:y,items:[],openItems:o,restore:g,remove:v,restoreIfMinimized:()=>!1},children:[e,
|
|
40
40
|
/* @__PURE__ */ue(Ct,{openWindows:o,onRemove:d,onSplitView:Ur,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&er(e)}})},onActivateById:dt}),
|
|
41
|
-
/* @__PURE__ */ue(
|
|
41
|
+
/* @__PURE__ */ue(Xr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
42
|
/* @__PURE__ */
|
|
43
|
-
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(
|
|
44
|
-
return ue(tn.Provider,{value:e,children:t})}var rn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),on='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function an(e){return sn(e).replace(/\s+/g," ").trim()}function sn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(sn).join("");if(te(e)){const t=e,n="string"==typeof t.type?t.type:"";return rn.has(n)?"":` ${sn(t.props?.children)} `}return""}function ln(e){const t=
|
|
45
|
-
return ue("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var
|
|
43
|
+
return ue(Ee.Provider,{value:c(e),children:/* @__PURE__ */ue(Pe,{fallback:(t,n)=>/* @__PURE__ */ue(Yr,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */ue(De,{error:t,onReload:n})}),children:/* @__PURE__ */ue(nn,{spec:rt(e),children:/* @__PURE__ */ue(eo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */ue(ot,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */ue(lt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var St=400;function Lt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=J(null),s=J(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=J(!1),c=J(void 0),u=J(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},St)};_(()=>{n&&!r&&h()},[n,r]),_(()=>{d&&n&&!r&&h()},[d]),_(()=>()=>clearTimeout(c.current),[]),_(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?P(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),G(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Tt=null,zt=/* @__PURE__ */new Set;function At(){return Tt}function Dt(e){if(Tt!==e){Tt=e;for(const e of zt)e()}}function Pt(e){return zt.add(e),()=>{zt.delete(e)}}var It=!1,Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Kt=()=>{};function Rt(e){It=e,Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Ot(e,t){It&&("submenu"===e?Wt.submenus++:Wt.menus++,Wt.menuKey=t)}function $t(e){if(!It)return Kt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!It)return;const r=performance.now()-t;"move"===e?Wt.moveMs+=r:Wt.resizeMs+=r}}function jt(){const e=Wt;return Wt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Ft=/* @__PURE__ */new Set([D,v]),qt=e=>Ft.has(e)||"function"==typeof e&&"badge"===e.titleRole,Bt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),Ht=/* @__PURE__ */new Set(["svg"]);function Ut(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Xt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Xt(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>Xt(e,t,n));if(!te(e))return;const r=e;if(r.type===f)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===ne)return void re.toArray(r.props.children).forEach(e=>Xt(e,t,n));if("string"==typeof r.type){if(Ht.has(r.type))return;if(!Bt.has(r.type))return n.push(" "),re.toArray(r.props.children).forEach(e=>Xt(e,t,n)),void n.push(" ")}const o=oe(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(qt(r.type)?t.badges:t.actions).push(o)}var Yt=/* @__PURE__ */new Map,Vt=/* @__PURE__ */new Set,Gt=0;function Jt(){Gt++,Vt.forEach(e=>e())}function _t(e){return Yt.get(e)}function Zt(e){return Vt.add(e),()=>{Vt.delete(e)}}function Qt(){return Gt}var en=X(""),tn=X(null);function nn({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
+
return ue(tn.Provider,{value:e,children:t})}var rn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),on='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function an(e){return sn(e).replace(/\s+/g," ").trim()}function sn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(sn).join("");if(te(e)){const t=e,n="string"==typeof t.type?t.type:"";return rn.has(n)?"":` ${sn(t.props?.children)} `}return""}function ln(e){const t=Y(en);_(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var cn={};function un(e,t,n){const r=Y(en);_(()=>{if(!r)return;cn[r]||(cn[r]=[]);const o={label:e,icon:n,onClick:t};return cn[r].push(o),()=>{cn[r]=(cn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function dn({title:e}){const t=J(null);return _(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */ue("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function hn(e){}function mn(){return Y(en)}function pn({children:e,position:t="right",quiet:n=!1}){const r=Y(L),[o,i]=Z(null);return _(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?he(e,o):null}function fn({onClick:e,children:t,className:n}){const r=Y(L);/* @__PURE__ */
|
|
45
|
+
return ue("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var wn="erp_window_positions",yn={};try{const e=localStorage.getItem(wn);e&&(yn=JSON.parse(e))}catch{}var gn=null;function bn(){gn&&clearTimeout(gn),gn=setTimeout(()=>{try{localStorage.setItem(wn,JSON.stringify(yn))}catch{}},500)}var vn="erp_activation_order",xn=[];try{const e=localStorage.getItem(vn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(xn=t)}catch{}var kn=null;function En(){kn&&clearTimeout(kn),kn=setTimeout(()=>{try{localStorage.setItem(vn,JSON.stringify(xn))}catch{}},500)}function Cn(e,t){yn[e]||(yn[e]=t,bn())}function Mn(e){return yn[e]?{...yn[e]}:null}function Nn(e,t){yn[e]=t,bn()}function Sn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(yn))n(yn[e],r,o)&&(delete yn[e],i=!0);i&&bn()}var Ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Tn=4e3,zn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},An={small:.8,medium:1,large:1.25,maximized:1.25},Dn=/* @__PURE__ */new Set,Pn=0,In=/* @__PURE__ */new Map;var Wn=0;function Kn(){return Wn}function Rn(){Wn++,S.forEach(e=>e())}var On=/* @__PURE__ */new Map,$n=/* @__PURE__ */new Map,jn=/* @__PURE__ */new Map;function Fn(){for(let e=N.length-1;e>=0;e--){const t=jn.get(N[e]);if(t?.tab)return t.owner}return null}function qn(){return Q(T,Fn,()=>null)}var Bn=/* @__PURE__ */new Set;var Hn=null;function Un(e){Hn=null,er(e)}function Xn(e){Hn=e;const t=On.get(e);t&&Un(t)}var Yn=/* @__PURE__ */new Map;function Vn(e){return Yn.get(e)?.holdsChanges()??!1}function Gn(e){const t=Yn.get(e);return t?t.ask():Promise.resolve(!0)}function Jn(e){Hn===e&&(Hn=null)}function _n(e,t,n){if(n&&jn.set(e,n),t)if(On.set(t,e),$n.set(e,t),Bn.delete(t)){N.unshift(e);const n=xn.indexOf(t);-1!==n&&xn.splice(n,1),xn.unshift(t),En()}else!function(e,t){const n=xn.indexOf(t);if(-1===n)return void N.push(e);let r=N.length;for(let e=0;e<N.length;e++){const t=$n.get(N[e]);if(t&&xn.indexOf(t)>n){r=e;break}}N.splice(r,0,e)}(e,t),-1===xn.indexOf(t)&&(xn.push(t),En());else N.push(e);Rn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Hn===t&&Un(e)}function Zn(e){return e?jn.get(e)?.owner??$n.get(e)??null:null}var Qn=/* @__PURE__ */new Set;function er(e){const t=Zn(z()),n=N.indexOf(e);-1!==n&&N.splice(n,1),N.push(e);const r=jn.get(e);if(r?.root)for(const[e,t]of jn){if(t.root||t.owner!==r.owner||Dn.has(e))continue;const n=N.indexOf(e);-1!==n&&N.splice(n,1),N.push(e)}Dn.delete(e);const o=$n.get(e);if(o){const e=xn.indexOf(o);-1!==e&&xn.splice(e,1),xn.push(o),En(),Hn&&Hn!==o&&(Hn=null)}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=Zn(z());i&&i!==t&&Qn.forEach(e=>e(i))}function tr(e){const t=N.indexOf(e);-1!==t&&N.splice(t,1),Dn.add(e),In.set(e,++Pn);const n=$n.get(e);if(n){const e=xn.indexOf(n);-1!==e&&(xn.splice(e,1),En())}Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var nr=/* @__PURE__ */new Set;var rr=8,or=32;function ir(){return e()}var ar=c.windowBar,sr=80,lr=384,cr=400;function ur(e,t=ir()){const n=Math.min(Math.max(e.x,t.x+sr-e.w),t.x+t.w-sr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-ar);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function dr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=ir();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function hr(e){const t=ir(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var mr=null;function pr(e){const t=(mr||((mr=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${F.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(mr)),mr);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function fr(){mr&&(mr.style.opacity="0",mr.style.display="none")}var wr=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],yr=350,gr=200;function br({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=Z(!1),s=J(void 0),l=J(void 0);_(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),yr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),gr)};/* @__PURE__ */
|
|
46
46
|
return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
47
|
-
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ue("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(vr))return;const e=document.createElement("style");e.id=vr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=$t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=N.indexOf(e);if(-1===t)return-1;const n=F.window+t*F.windowStep,r=jn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of jn){if(!t.root||t.owner!==r.owner)continue;const n=N.indexOf(e);-1!==n&&(o=Math.max(o,F.window+n*F.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=N.length-1;e>=0;e--)nr.has(N[e])||N.splice(e,1);xn=xn.filter(e=>{const t=On.get(e);return null!=t&&nr.has(t)}),En(),Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){Q(T,
|
|
48
|
-
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:F.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Xr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:R,allowPinOnTop:j,initialPosition:q,widget:B,compact:Y,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=_(null),Te=_(0);G(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);G(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,Ke]=Z(c),Re=U(),Oe=Re.window;G(()=>{Ke(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),je=ae(),[Fe,qe]=Z(!1),Be=_(!1),[He,Ue]=Z(!1),[Ye,Xe]=Z(null),Ve=X(tn),Je=X(Ee),{prefs:_e,save:Ge}=M(),Ze=!!_e.window_accent_stripe,Qe=_e.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];Ge({favorite_documents:e})},[Ve,tt,Qe,Ge]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=_(!1),ct=_(null);J(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=_(!1),dt=_(null),ht=_(null),mt=_(null),[pt,ft]=Z(!1),wt=_(null),yt=_(null),gt=_(null),[bt,vt]=Z(!1);J(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=y&&!1!==y]);const xt=!!R&&!B&&!Y&&!V&&(R.editing||"hidden"!==R.state),kt=!!(y||S||D)||pt||xt,Et=X(Ie),Ct=""!==X(en),Mt=_(null);Mt.current=Je?{owner:Je.key,tab:Je.tab,root:!Ct}:null;const Nt=fe||(Je&&!Ct?Je.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!Y&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Xe(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:zt}),Kt=40,{minimize:Wt,items:Rt,restoreIfMinimized:Ot,openWindows:$t}=nt(),jt=_(`modal-${Math.random().toString(36).slice(2,8)}`).current;G(()=>{if(B)return nr.add(jt),()=>{nr.delete(jt)}},[B,jt]),G(()=>{const e=e=>{const t=e.detail;t?.id===jt&&Ke(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ft,qt]=Z(F.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(jt),Ht=_(R);Ht.current=R;const Yt=!!R&&!R.editing&&"enabled"===R.state;G(()=>{if(!t||!Bt||!Yt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Yt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(jt);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Jt=Q(Tr,zr),Gt=Q(Wr,Rr),Zt=Q(Fr,qr),Qt=!j&&!B,nn=Jt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===jt,[un,dn]=Z(!1),hn=un&&Qt&&Gt===jt?"picked":null,mn=_(nn);G(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===jt&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,jt]),G(()=>{nn||sn(!1)},[nn]),G(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),G(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=_(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(N.length-1),u=Math.max(Kt,(i-l)/2),d=(o-a)/2,m=t.h-Kt-l-u;return"top-right"===q?{x:t.x+t.w-a-Kt,y:t.y+Kt,w:a,h:l}:"top-left"===q?{x:t.x+Kt,y:t.y+Kt,w:a,h:l}:{x:t.x+Math.max(Kt,(o-a)/2+Kt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=_(!1);t||(gn.current=!1);const vn=fe||d||null;G(()=>{if(!t)return;Gn(jt,vn,Mt.current??void 0),fe||er(jt),pn.current=!1,qt(Cr(jt));const e=()=>{qt(Cr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(jt),Wn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Yn(!1)},i=e=>{const t=e.detail;r(t)&&(er(jt),Xe({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(jt);const t=Vn.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ct.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}En(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=N.indexOf(e);-1!==t&&(N.splice(t,1),Rn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(jt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,jt,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=_(be),Sn=_(null);G(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const Pn=be&&!!Je?.tab&&!Ct&&!B&&!xe,Kn=Pn,Wn=_(Kn);Wn.current=Kn;const Fn=qn(),Bn=be&&!!Je?.tab&&!B&&!xe&&!Jt&&Fn!==Je.key,Hn=!!B&&be&&!Jt&&null!==Fn,[Un,Yn]=Z(()=>vn&&yn[vn]||k?Kn:Kn||xn),Vn=_(kn);Vn.current=kn;const Jn=_(Un);J(()=>{Jn.current=Un},[Un]),J(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),J(()=>{if(!re||!Cn||B||!t)return;const e=wt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const _n=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!_n);J(()=>{if(Zn||!t)return;if(!_n||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Kt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,_n,Un]);const ar=_(null),sr=!(!Je?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Jn.current}),void(Jn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Jn.current=!0,Yn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Jn.current=!1,Yn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},G(()=>{Kn&&(Jn.current=!0,Yn(!0),En(fn()))},[Kn,fn]),G(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Jn.current=!1,Yn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),G(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),G(()=>{if(!t)return;const e=()=>{Jn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Un,fn]),G(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!_n),!Wn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},..._n?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Yn(k.maximized))}},[t]),G(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const dr="auto"===m?Fe:!0===m,mr=Je&&!Ct?Je.key:null,wr=ie(()=>Ut(De),[De]),yr=_({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar});J(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar}});const gr=_(null);gr.current||(gr.current={open:(e,t)=>Xe({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),G(()=>{if(t&&mr)return()=>{return e=mr,void(Xt.delete(e)&&_t());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await w({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=_(()=>!1);J(()=>{Pr.current=vr}),J(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Xn.set(fe,e),()=>{Xn.get(fe)===e&&Xn.delete(fe)}},[t,fe,Dr]),J(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Kr=_(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Xe(null),er(jt),Wn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Kr.current){const t=Kr.current;Kr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Yn(!1),En(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Vn.current={...Vn.current,x:s,y:u},!B){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Vn.current});if(Vn.current=e,!B&&h){Kr.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),jr=ee((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Yn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(jt),"Enter"===e.key)return void(Un?(Yn(!1),En(wn())):(Yn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Kr.current||(Kr.current={...Vn.current})};if(r<0)return e(),Yn(!0),void En(fn());if(r>0){if(Un)return Yn(!1),void En(wn());if(Kr.current){const e=ur(Kr.current);return Kr.current=null,Vn.current=e,void En(e)}return void tr(jt)}e(),Yn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Vn.current=i,En(i)},[jt,Un,wn,fn]),Hr=ee(e=>{Kr.current||(Kr.current={...Vn.current}),Yn(!1);const t=hr(e);Vn.current=t,En(t),er(jt)},[jt]),Ur=Kn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Br},Yr=()=>{Yn(!0),En(fn())},Xr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);G(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===jt&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Xr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xr,jt,B]),G(()=>{if(!t)return;const e=e=>{N[N.length-1]===jt&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),G(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===jt){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,jt,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Jr]=Z(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),_r=Pn&&!Je?.home&&wr.actions.length>0;G(()=>{t&&mr&&function(e,t){const n=Xt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Xt.set(e,t),_t())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:_r&&Jr?Jr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,_r,Jr]);const Gr=ee(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(G(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==jt)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():Gr("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():Gr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,Gr,jt]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(jt):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:F.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(un&&Qt){const e="picked"===hn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:F.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Je?.home:!xe)?je:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
49
|
-
/* @__PURE__ */ce("div",{ref:ct,"data-modal-panel":!0,"data-modal-id":jt,"data-window-key":fe||void 0,...j?{"data-utility":""}:{},...He?{"data-pinned-top":""}:{},...B?{"data-widget":""}:{},...
|
|
50
|
-
/* @__PURE__ */ue("h2",{id:je,"data-window-title":!0,className:"sr-only",children:wr.text||$e}),
|
|
51
|
-
/* @__PURE__ */ue(de,{children:wr.actions}),
|
|
52
|
-
/* @__PURE__ */ce("div",
|
|
47
|
+
/* @__PURE__ */ue("button",{onClick:t,onFocus:c,onBlur:u,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */ue("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(l.current),onMouseLeave:u,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:wr.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */ue("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(l.current),onBlur:u,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */ue("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var vr="rosh-gesture-style";var xr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},kr=4;function Er(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(vr))return;const e=document.createElement("style");e.id=vr,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=$t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Cr(e){const t=N.indexOf(e);if(-1===t)return-1;const n=F.window+t*F.windowStep,r=jn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of jn){if(!t.root||t.owner!==r.owner)continue;const n=N.indexOf(e);-1!==n&&(o=Math.max(o,F.window+n*F.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=N.length-1;e>=0;e--)nr.has(N[e])||N.splice(e,1);xn=xn.filter(e=>{const t=On.get(e);return null!=t&&nr.has(t)}),En(),Rn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Mr="modal-close-request";function Nr(e){Q(T,Kn);const t=Y(L);if(N.length<=1)return!0;if(e){const t=On.get(e);if(null!=t)return z()===t}return t?.active??null!=z()}var Sr=!1,Lr=/* @__PURE__ */new Set;function Tr(e){return Lr.add(e),()=>Lr.delete(e)}function zr(){return Sr}function Ar(e){Sr!==e&&(Sr=e,Lr.forEach(e=>e()))}function Dr(){Ar(!Sr)}function Pr(){Ar(!1)}var Ir=null,Wr=/* @__PURE__ */new Set;function Kr(e){return Wr.add(e),()=>Wr.delete(e)}function Rr(){return Ir}function Or(e){Ir!==e&&(Ir=e,Wr.forEach(e=>e()))}var $r=null,jr=/* @__PURE__ */new Set;function Fr(e){return jr.add(e),()=>jr.delete(e)}function qr(){return $r}function Br(e){$r!==e&&($r=e,jr.forEach(e=>e()))}function Hr(){if(!$r)return void Ar(!1);Or($r),Br(null),Ar(!1)}function Ur(){Ar(!Sr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Xr(){const e=Q(Tr,zr),[t,n]=Z(e),[r,o]=Z(e);return _(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?he(
|
|
48
|
+
/* @__PURE__ */ue("div",{onMouseDown:e=>{e.stopPropagation(),Ar(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:F.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Yr({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:y,bodyScroll:v,onMinimize:x,initialBox:k,actions:S,actionsLeft:D,editing:P=!1,edit:R,allowPinOnTop:j,initialPosition:q,widget:B,compact:X,appStyle:V,flushBody:ne,autoHeight:re,autoMinHeight:se,autoWidth:le,widgetMenu:me,dimensions:pe,windowKey:fe,openedFromKey:we,accentRgb:ye,children:ge}){const[be,ve]=Z(()=>r()),xe=E()&&!be,ke=C()&&!!B,[Ce,Me]=Z(0),[Ne,Se]=Z(!1),Le=J(null),Te=J(0);_(()=>{Te.current=Ce},[Ce]);const ze=ee(e=>{xe&&(Le.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Se(!0),Dt(we??null))},[xe,we]),Ae=Q(Pt,At);_(()=>{if(!Ne)return;const e=e=>{if(!Le.current)return;const t=e.clientX-Le.current.startX;if(Math.abs(e.clientY-Le.current.startY)>Math.abs(t)+12)return Le.current=null,Se(!1),Me(0),void Dt(null);Me(Math.max(0,t))},t=()=>{if(!Le.current)return;const e=.3*window.innerWidth,t=Te.current>e;Le.current=null,Se(!1),t?(Me(window.innerWidth),setTimeout(()=>{l(),Me(0),Dt(null)},180)):(Me(0),Dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Ne]);const[De,We]=Z(c),Re=U(),Oe=Re.window;_(()=>{We(c)},[c]);const $e=ie(()=>an(De).trim()||void 0,[De]),je=ae(),[Fe,qe]=Z(!1),Be=J(!1),[He,Ue]=Z(!1),[Xe,Ye]=Z(null),Ve=Y(tn),Ge=Y(Ee),{prefs:Je,save:_e}=M(),Ze=!!Je.window_accent_stripe,Qe=Je.favorite_documents||[],tt=!!Ve&&Qe.some(e=>e.entityType===Ve.entityType&&e.entityId===Ve.entityId),rt=ee(()=>{if(!Ve)return;const e=tt?Qe.filter(e=>!(e.entityType===Ve.entityType&&e.entityId===Ve.entityId)):[...Qe,{entityType:Ve.entityType,entityId:Ve.entityId,label:Ve.label}];_e({favorite_documents:e})},[Ve,tt,Qe,_e]),[ot,it]=Z(null),[at,st]=Z("top-right"===q?"right":"left"),lt=J(!1),ct=J(null);G(()=>{const e=ct.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const ut=J(!1),dt=J(null),ht=J(null),mt=J(null),[pt,ft]=Z(!1),wt=J(null),yt=J(null),gt=J(null),[bt,vt]=Z(!1);G(()=>{const e=yt.current,t=gt.current;if(!e||!t)return;const n=()=>vt(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=y&&!1!==y]);const xt=!!R&&!B&&!X&&!V&&(R.editing||"hidden"!==R.state),kt=!!(y||S||D)||pt||xt,Et=Y(Ie),Ct=""!==Y(en),Mt=J(null);Mt.current=Ge?{owner:Ge.key,tab:Ge.tab,root:!Ct}:null;const Nt=fe||(Ge&&!Ct?Ge.key:null),St=!!Et&&!Ct&&Et.enabled&&Et.hasState&&(P||Et.declaredEditable)&&!Et.handMounted&&kt&&!B&&!X&&!V&&!xe,Tt=/* @__PURE__ */ue($,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),zt=u&&te(u)?oe(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??Tt,It=()=>/* @__PURE__ */ue("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ye(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:zt}),Wt=40,{minimize:Kt,items:Rt,restoreIfMinimized:Ot,openWindows:$t}=nt(),jt=J(`modal-${Math.random().toString(36).slice(2,8)}`).current;_(()=>{if(B)return nr.add(jt),()=>{nr.delete(jt)}},[B,jt]),_(()=>{const e=e=>{const t=e.detail;t?.id===jt&&We(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[jt]);const[Ft,qt]=Z(F.window),Bt=function(e){const t=Q(T,z);return N.length<=1||t===e}(jt),Ht=J(R);Ht.current=R;const Xt=!!R&&!R.editing&&"enabled"===R.state;_(()=>{if(!t||!Bt||!Xt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,ct.current)||(e.preventDefault(),e.stopPropagation(),Ht.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Bt,Xt]);const Vt=function(e){return Q(T,()=>Dn.has(e))}(jt);Lt({panelRef:ct,bodyRef:dt,open:t,widget:!!B,active:Bt,minimized:Vt});const Gt=Q(Tr,zr),_t=Q(Kr,Rr),Zt=Q(Fr,qr),Qt=!j&&!B,nn=Gt&&Qt,[rn,sn]=Z(!1),ln=nn&&Zt===jt,[un,dn]=Z(!1),hn=un&&Qt&&_t===jt?"picked":null,mn=J(nn);_(()=>{if(mn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Ir===jt&&Or(null)},700);return mn.current=nn,()=>clearTimeout(e)}mn.current=nn},[nn,jt]),_(()=>{nn||sn(!1)},[nn]),_(()=>{const e=ht.current,t=mt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>ft(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),_(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ct.current){const t=ct.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=ht.current,n=mt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=J(!1),fn=ee(e,[]),wn=ee(()=>{const t=e(),n=pe?pe[0]:Ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=An[zn()],l=pe?Math.min(pe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(N.length-1),u=Math.max(Wt,(i-l)/2),d=(o-a)/2,m=t.h-Wt-l-u;return"top-right"===q?{x:t.x+t.w-a-Wt,y:t.y+Wt,w:a,h:l}:"top-left"===q?{x:t.x+Wt,y:t.y+Wt,w:a,h:l}:{x:t.x+Math.max(Wt,(o-a)/2+Wt)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),gn=J(!1);t||(gn.current=!1);const vn=fe||d||null;_(()=>{if(!t)return;_n(jt,vn,Mt.current??void 0),fe||er(jt),pn.current=!1,qt(Cr(jt));const e=()=>{qt(Cr(jt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===fe;if(!e.label)return!1;const t=ct.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(er(jt),Kn.current)return;const t=ir(),n=Math.min(Vn.current.w,t.w-40),o=Math.min(Vn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;En({x:i,y:a,w:n,h:o}),Xn(!1)},i=e=>{const t=e.detail;r(t)&&(er(jt),Ye({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==fe)return;er(jt);const t=Vn.current,n=function(e,t=ir()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ct.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}En(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=N.indexOf(e);-1!==t&&(N.splice(t,1),Rn()),Dn.delete(e),In.delete(e),jn.delete(e);const n=$n.get(e);n&&($n.delete(e),On.delete(n))}(jt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,jt,vn,fn]);const xn=!B&&"maximized"===zn(),[kn,En]=Z(()=>{if(vn&&yn[vn]){const e={...yn[vn]};return pe&&(e.w=pe[0],re||(e.h=pe[1])),ur(e)}return k?{x:k.x,y:k.y,w:k.w,h:k.h}:xn?fn():wn()}),[Cn,Mn]=Z(()=>!re),Nn=J(be),Sn=J(null);_(()=>{const e=()=>{const e=r();e!==Nn.current&&Sn.current?.(e),Nn.current=e,ve(e),qt(Cr(jt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[jt]);const Pn=be&&!!Ge?.tab&&!Ct&&!B&&!xe,Wn=Pn,Kn=J(Wn);Kn.current=Wn;const Fn=qn(),Bn=be&&!!Ge?.tab&&!B&&!xe&&!Gt&&Fn!==Ge.key,Hn=!!B&&be&&!Gt&&null!==Fn,[Un,Xn]=Z(()=>vn&&yn[vn]||k?Wn:Wn||xn),Vn=J(kn);Vn.current=kn;const Gn=J(Un);G(()=>{Gn.current=Un},[Un]),G(()=>{if(Cn||Pn)return;const e=ct.current,t=dt.current;if(!e||!t)return;const n=se??(B?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Vn.current.y)-24),g=w?Math.min(Vn.current.h,y):Math.min(Math.max(n,u+p),y),b=Math.abs(g-o)>1;b&&(o=g,En(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(b||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Mn(!0)},160)))},l=new ResizeObserver(s);s(),wt.current&&l.observe(wt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Cn,B,se,kt,Pn]),G(()=>{if(!re||!Cn||B||!t)return;const e=wt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Un)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=se??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Vn.current.y)-24);En(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[re,Cn,B,t,Un,se]);const Jn=!1!==le&&!B&&!V&&!xe,[Zn,Qn]=Z(()=>!Jn);G(()=>{if(Zn||!t)return;if(!Jn||Un)return void Qn(!0);const n=ct.current,r=dt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Vn.current.w,c=0;const u=()=>Qn(!0),d=()=>{c=0;const t=Vn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const b=a(t,s(t.w,w,g),d,Wt);b!==t&&(l=b.w,En(b))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Tn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Zn,t,Jn,Un]);const ar=J(null),sr=!(!Ge?.tab||Ct||B||xe);Sn.current=t=>{if(!sr)return;if(t)return ar.current||(ar.current={box:{...Vn.current},maximized:Gn.current}),void(Gn.current=!0);const r=ar.current;ar.current=null;const o=e();if(r?.maximized)return Gn.current=!0,Xn(!0),void En(o);const i=r?.box??(vn?yn[vn]:void 0);if(Gn.current=!1,Xn(!1),i&&!n(i,o,!1)){const e={...i};pe&&(e.w=pe[0],re||(e.h=pe[1])),En(ur(e))}else En(wn())},_(()=>{Wn&&(Gn.current=!0,Xn(!0),En(fn()))},[Wn,fn]),_(()=>{if(B)return;const e=()=>{const e=vn?yn[vn]:void 0;if(Gn.current=!1,Xn(!1),e){const t={...e};pe&&(t.w=pe[0],re||(t.h=pe[1])),En(ur(t))}else En(wn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,wn,vn]),_(()=>{t&&vn&&!Pn&&(yn[vn]=kn,bn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[kn,t,vn,Pn]),_(()=>{if(!t)return;const e=()=>{Gn.current?En(fn()):document.body.classList.contains("rosh-gesturing")||En(ur)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Un&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Un,fn]),_(()=>{if(t&&(qe(!1),Be.current=!1,lt.current=!1,Qn(!Jn),!Kn.current)){if(vn&&yn[vn]){const e=yn[vn];return void En(t=>ur({...e,...re?{h:t.h}:{},...Jn?{x:t.x,w:t.w}:{}}))}k&&(En({x:k.x,y:k.y,w:k.w,h:k.h}),Xn(k.maximized))}},[t]),_(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{ct.current?.contains(t.target)&&!Be.current&&(Be.current=!0,e=setTimeout(()=>qe(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const dr="auto"===m?Fe:!0===m,mr=Ge&&!Ct?Ge.key:null,wr=ie(()=>Ut(De),[De]),yr=J({shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar});G(()=>{yr.current={shortcutSpec:Ve,isOnDesktop:tt,toggleDesktopShortcut:rt,taskbarStrings:Re.taskbar}});const gr=J(null);gr.current||(gr.current={open:(e,t)=>Ye({x:e,y:t}),items:()=>{const e=yr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of cn[jt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),_(()=>{if(t&&mr)return()=>{return e=mr,void(Yt.delete(e)&&Jt());var e}},[t,mr]),et(!(fe||!t)&&dr);const vr=ee(()=>dr||"auto"===m&&Be.current,[dr,m]),Nr=ee(async e=>{if(lt.current)return!1;if(!vr())return!0;lt.current=!0;const t=$e,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await w({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return lt.current=!1,r},[vr,$e]),Sr=ee(()=>lt.current?Promise.resolve():vr()?Nr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[vr,Nr,l]),Lr=ee(async()=>{await Nr("discard")&&(Be.current=!1,qe(!1),Ht.current?.onDiscard())},[Nr]),Dr=ee(async()=>{const e=await Nr("switch");return e&&(Be.current=!1,qe(!1)),e},[Nr]),Pr=J(()=>!1);G(()=>{Pr.current=vr}),G(()=>{if(!t||!fe)return;const e={holdsChanges:()=>Pr.current(),ask:Dr};return Yn.set(fe,e),()=>{Yn.get(fe)===e&&Yn.delete(fe)}},[t,fe,Dr]),G(()=>{if(!t||!Nt)return;const e=e=>{e.detail?.windowKey===Nt&&Sr()};return window.addEventListener(Mr,e),()=>window.removeEventListener(Mr,e)},[t,Nt,Sr]);const Wr=J(null),$r=ee(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ye(null),er(jt),Kn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ct.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Wr.current){const t=Wr.current;Wr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:Vn.current.x,c=s?s.top:Vn.current.y,u=s?s.height:Vn.current.h,d=s?s.width:Vn.current.w;Xn(!1),En(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<kr&&Math.abs(e.clientY-i)<kr)return;r=Er(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),Vn.current={...Vn.current,x:s,y:u},!B){const t=function(e,t){const n=ir(),r=e<=n.x+rr,o=e>=n.x+n.w-rr,i=t<=n.y+rr,a=t>=n.y+n.h-rr,s=e<=n.x+or,l=e>=n.x+n.w-or,c=t<=n.y+or,u=t>=n.y+n.h-or;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?pr(hr(t)):fr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),fr();const e=ur({...Vn.current});if(Vn.current=e,!B&&h){Wr.current={x:l,y:c,w:d,h:u};const e=hr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void En(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;st(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),En(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),jr=ee((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ct.current,l=s?.getBoundingClientRect(),c=l?l.left:Vn.current.x,u=l?l.top:Vn.current.y,d=l?l.width:Vn.current.w,h=l?l.height:Vn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Xn(!1),En({x:c,y:u,w:d,h:h}),Vn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const b=()=>{if(y=0,!g)return;const e=g;g=null,Vn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},v=e=>{if(!o){if(Math.abs(e.clientX-i)<kr&&Math.abs(e.clientY-a)<kr)return;o=Er(n,r,xr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(lr,d+e)),w&&(i=Math.max(cr,h+t)),m){const t=Math.max(lr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(cr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(b))},x=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),b(),o?.(),En({...Vn.current})};window.addEventListener("pointermove",v),window.addEventListener("pointerup",x)},[]),Br=ee(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),er(jt),"Enter"===e.key)return void(Un?(Xn(!1),En(wn())):(Xn(!0),En(fn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Wr.current||(Wr.current={...Vn.current})};if(r<0)return e(),Xn(!0),void En(fn());if(r>0){if(Un)return Xn(!1),void En(wn());if(Wr.current){const e=ur(Wr.current);return Wr.current=null,Vn.current=e,void En(e)}return void tr(jt)}e(),Xn(!1);const t=hr(n<0?"left":"right");return Vn.current=t,void En(t)}if(Un)return;const o=Vn.current,i=e.shiftKey?{...o,w:Math.max(lr,o.w+24*n),h:Math.max(cr,o.h+24*r)}:ur({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Vn.current=i,En(i)},[jt,Un,wn,fn]),Hr=ee(e=>{Wr.current||(Wr.current={...Vn.current}),Xn(!1);const t=hr(e);Vn.current=t,En(t),er(jt)},[jt]),Ur=Wn||nn?{}:{tabIndex:0,role:"group","aria-label":$e?`${$e} — ${Oe.windowSuffix}`:Oe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Br},Xr=()=>{Xn(!0),En(fn())},Yr=ee(()=>{const e=ct.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(on);t&&!t.disabled&&t.click()}},[]);_(()=>{if(!t)return;if(B)return;const e=e=>{if(N[N.length-1]===jt&&!g(e.target,ct.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Yr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ct.current?.contains(t)))return;if(t.closest(A))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yr,jt,B]),_(()=>{if(!t)return;const e=e=>{N[N.length-1]===jt&&(g(e.target,ct.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:jt}})),Be.current=!1,qe(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:jt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),_(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&N[N.length-1]===jt){if(H(e))return e.preventDefault(),void e.stopPropagation();if(Pn&&!P)return;e.preventDefault(),e.stopPropagation(),Sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Sr,jt,B,Pn,P]);const Vr=t&&(void 0!==p||void 0!==f),[Gr]=Z(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),Jr=Pn&&!Ge?.home&&wr.actions.length>0;_(()=>{t&&mr&&function(e,t){const n=Yt.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(Yt.set(e,t),Jt())}(mr,{title:wr.text||$e,dirty:dr,copy:wr.copy,actions:Jr&&Gr?Gr:void 0,menu:gr.current??void 0})},[t,mr,$e,dr,wr.text,wr.copy,Jr,Gr]);const _r=ee(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(_(()=>{if(!t)return;const e=e=>{if(N[N.length-1]!==jt)return;if(g(e.target,ct.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Vr&&(e.preventDefault(),p?p():_r("bottom")),"k"===e.key&&Vr&&(e.preventDefault(),f?f():_r("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Vr,_r,jt]),!t||gn.current)return null;const Zr=nn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=ir(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(jt):null,Qr=nn&&Zr?Math.min(Zr.w/kn.w,Zr.h/kn.h):1,eo=(()=>{if(nn&&Zr){const e=Qr,t=kn.w*e,n=kn.h*e,r=Zr.x+(Zr.w-t)/2-kn.x,o=Zr.y+(Zr.h-n)/2-kn.y,i=rn||ln;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:F.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(un&&Qt){const e="picked"===hn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:F.expose+30}:{}}}return null})(),to=b({modal:!1,titleId:!B&&(Pn?!Ge?.home:!xe)?je:void 0,label:wr.text||$e}),no=/* @__PURE__ */ce("div",{children:[
|
|
49
|
+
/* @__PURE__ */ce("div",{ref:ct,"data-modal-panel":!0,"data-modal-id":jt,"data-window-key":fe||void 0,...j?{"data-utility":""}:{},...He?{"data-pinned-top":""}:{},...B?{"data-widget":""}:{},...Ge?{"data-window-owner":Ge.key}:{},...Ge&&!Ct?{"data-window-root":""}:{},...Pn?{"data-window-tab":""}:{},...to,className:Pn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(B?Bt?"shadow-xl":"shadow-lg":"border "+(Bt?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(ut.current=!1,nn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Or(jt),Ar(!1),void er(jt)}if(!Bt&&!B&&!He&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ct.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ut.current=!0,Ye(null),er(jt),window.addEventListener("mouseup",()=>{setTimeout(()=>{ut.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ut.current&&(ut.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(nn)return;Ye(null);e.target.closest("[data-modal-panel]")===ct.current&&(e.target.closest("button, input, a, select, textarea")||er(jt))},style:xe?{zIndex:Ft+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Ce}px)`,transition:Ne?"none":"transform 180ms ease-out",...B?{display:"none"}:{},...Ft<0?{display:"none"}:{},...Bt||He||Ae&&fe===Ae?{}:{display:"none"}}:{zIndex:He?F.pinnedWindow:Ft+1,width:kn.w,height:kn.h,top:kn.y,...B&&"right"===at?{right:window.innerWidth-kn.x-kn.w}:{left:kn.x},...Ft<0&&!He?{display:"none"}:{},...ke?{display:"none"}:{},...Bn||Hn?{visibility:"hidden",pointerEvents:"none"}:{},...eo??{}},children:[xe&&!B&&/* @__PURE__ */ue("div",{onPointerDown:ze,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),B?null:Pn?Ge?.home?null:/* @__PURE__ */ce(de,{children:[
|
|
50
|
+
/* @__PURE__ */ue("h2",{id:je,"data-window-title":!0,className:"sr-only",children:wr.text||$e}),Jr&&Gr&&he(
|
|
51
|
+
/* @__PURE__ */ue(de,{children:wr.actions}),Gr),wr.badges.length>0&&/* @__PURE__ */ue("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:wr.badges})]}):xe?null:
|
|
52
|
+
/* @__PURE__ */ce("div",X?{onPointerDown:$r,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
53
53
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
54
54
|
/* @__PURE__ */ue("span",{id:je,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[j&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3 w-3",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
55
55
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:V?{onPointerDown:$r,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-compact-bar) px-3 border-b border-line shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
56
56
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
57
57
|
/* @__PURE__ */ue("span",{id:je,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[j&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3 w-3",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
58
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!
|
|
58
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!Wn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Xn(!1),En(wn())):Xr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Oe}),
|
|
59
59
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:$r,"data-window-chrome":"",...Ur,className:"flex items-center justify-between h-(--row-height-window-bar) px-3 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Bt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Bt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
60
60
|
/* @__PURE__ */ce("div",{"data-window-title":!0,title:$e,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Bt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&It(),
|
|
61
61
|
/* @__PURE__ */ue("span",{id:je,className:"truncate",children:nn?an(De):De})]}),!nn&&/* @__PURE__ */ce("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[j&&/* @__PURE__ */ue("button",{onClick:()=>Ue(e=>!e),title:He?Oe.unpin:Oe.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(He?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:He?"currentColor":"none",strokeWidth:1.5})}),
|
|
62
|
-
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!
|
|
62
|
+
/* @__PURE__ */ue("button",{onClick:()=>tr(jt),title:Oe.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!Wn&&/* @__PURE__ */ue(br,{maximized:Un,onToggleMax:()=>{Un?(Xn(!1),En(wn())):Xr()},onSnap:Hr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Oe}),
|
|
63
63
|
/* @__PURE__ */ue("button",{type:"button",onClick:Sr,"aria-label":Oe.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */ue($,{name:"close",className:"h-5 w-5"})})]})]}),ye&&Ze&&!B&&!xe&&/* @__PURE__ */ue("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Bt?.9:.55})`}}),
|
|
64
|
-
/* @__PURE__ */ue(en.Provider,{value:jt,children:/* @__PURE__ */ue(L.Provider,{value:{rightRef:ht,leftRef:mt,notify:()=>ft(!0),active:Bt,isDirty:dr,footerOpen:kt&&!B&&!
|
|
65
|
-
/* @__PURE__ */ue(
|
|
66
|
-
/* @__PURE__ */ue(
|
|
67
|
-
/* @__PURE__ */ue(
|
|
68
|
-
/* @__PURE__ */ce(
|
|
64
|
+
/* @__PURE__ */ue(en.Provider,{value:jt,children:/* @__PURE__ */ue(L.Provider,{value:{rightRef:ht,leftRef:mt,notify:()=>ft(!0),active:Bt,isDirty:dr,footerOpen:kt&&!B&&!X&&!V&&!xe},children:/* @__PURE__ */ue("div",{ref:dt,...B?{onPointerDown:$r,onContextMenu:e=>{e.preventDefault(),it({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${B?"p-0 cursor-move":V||ne?"p-0":X?"p-2":"p-4"} ${B||Pn?"":"backdrop-blur-sm"} ${!1===v||V||ne?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${B?"rounded-2xl select-none":""}`,style:{...B?{touchAction:"none"}:{},backgroundColor:B?"transparent":Pn?"rgb(var(--window-content-rgb))":Bt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */ue(Pe,{children:ge})})})}),B&&ot&&/* @__PURE__ */ce(I,{minWidth:160,style:{left:ot.x,top:ot.y},onClose:()=>it(null),children:[
|
|
65
|
+
/* @__PURE__ */ue(W,{onClick:()=>{it(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:jt}))},children:"Settings"}),
|
|
66
|
+
/* @__PURE__ */ue(K,{}),me&&/* @__PURE__ */ce(de,{children:[me,
|
|
67
|
+
/* @__PURE__ */ue(K,{})]}),
|
|
68
|
+
/* @__PURE__ */ce(W,{onClick:()=>{it(null),Ue(e=>!e)},children:[
|
|
69
69
|
/* @__PURE__ */ue("span",{className:"flex-1",children:"Always on Top"}),He&&/* @__PURE__ */ue($,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
70
|
-
/* @__PURE__ */ue(
|
|
71
|
-
/* @__PURE__ */ue(
|
|
72
|
-
/* @__PURE__ */ce("div",{onPointerDown:$r,ref:wt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Pn?"":" cursor-move"}${Bt&&!Pn?" backdrop-blur-sm":""}${B||
|
|
73
|
-
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(
|
|
70
|
+
/* @__PURE__ */ue(K,{}),
|
|
71
|
+
/* @__PURE__ */ue(W,{onClick:()=>{it(null),Sr()},children:"Close"})]}),
|
|
72
|
+
/* @__PURE__ */ce("div",{onPointerDown:$r,ref:wt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${Pn?"":" cursor-move"}${Bt&&!Pn?" backdrop-blur-sm":""}${B||X||V||xe||!kt?" hidden":""}`,style:{touchAction:"none",backgroundColor:Pn?"rgb(var(--window-footer-rgb))":Bt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
73
|
+
/* @__PURE__ */ce("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[St&&/* @__PURE__ */ue(Ke,{auto:!0}),D,
|
|
74
74
|
/* @__PURE__ */ue("div",{ref:mt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=y&&!1!==y&&
|
|
75
75
|
/* @__PURE__ */ue("div",{ref:yt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */ue("div",{ref:gt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(bt?" invisible":""),children:y})})]}),
|
|
76
76
|
/* @__PURE__ */ce("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[xt&&R&&(R.editing?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Lr()},children:Oe.discard}):"object"==typeof R.state?/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:R.state.disabledReason,children:Oe.edit}):/* @__PURE__ */ue(O,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>R.onEdit(),children:Oe.edit})),
|
|
77
|
-
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!
|
|
77
|
+
/* @__PURE__ */ue("div",{ref:ht,"data-modal-actions":!0,className:"flex items-center gap-2"}),S]})]}),!B&&!xe&&!nn&&Bt&&!Wn&&/* @__PURE__ */ce(de,{children:[
|
|
78
78
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
79
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
80
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
@@ -82,18 +82,18 @@ return ce("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u
|
|
|
82
82
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
83
83
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
84
|
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
|
-
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */ue("div",{className:"absolute inset-0",style:{zIndex:F.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>sn(!0),onMouseLeave:()=>sn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),er(jt),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */ue("button",{type:"button","data-expose-close":!0,"aria-label":Re.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Qr})`,transformOrigin:"top right",zIndex:F.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Sr()},children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&Zr&&/* @__PURE__ */ue("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Zr.x,top:Zr.y+Zr.h+4,width:Zr.w,zIndex:F.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:an(De)})]}),ro=
|
|
86
|
-
/* @__PURE__ */ce(
|
|
87
|
-
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!
|
|
88
|
-
/* @__PURE__ */ue($,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Oe.windowed]}:{onClick:()=>{
|
|
89
|
-
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),j&&!Pn&&/* @__PURE__ */ce(
|
|
90
|
-
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(
|
|
91
|
-
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?Re.taskbar.removeFromDesktop:Re.taskbar.addToDesktop]}),(cn[jt]||[]).length>0&&/* @__PURE__ */ue(de,{children:(cn[jt]||[]).map((e,t)=>/* @__PURE__ */ce(
|
|
92
|
-
/* @__PURE__ */ue(
|
|
93
|
-
/* @__PURE__ */ce(
|
|
85
|
+
/* @__PURE__ */ue("div",{onPointerDown:e=>jr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */ue("div",{className:"absolute inset-0",style:{zIndex:F.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>sn(!0),onMouseLeave:()=>sn(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),er(jt),Ar(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:rn&&/* @__PURE__ */ue("button",{type:"button","data-expose-close":!0,"aria-label":Re.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Qr})`,transformOrigin:"top right",zIndex:F.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Sr()},children:/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&Zr&&/* @__PURE__ */ue("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Zr.x,top:Zr.y+Zr.h+4,width:Zr.w,zIndex:F.expose+(rn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:an(De)})]}),ro=Xe&&/* @__PURE__ */ce(I,{style:{left:Xe.x,top:Xe.y},onClose:()=>Ye(null),minWidth:160,children:[!B&&!X&&!Pn&&/* @__PURE__ */ce(de,{children:[
|
|
86
|
+
/* @__PURE__ */ce(W,{onClick:()=>{tr(jt),Ye(null)},children:[
|
|
87
|
+
/* @__PURE__ */ue($,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!Wn&&/* @__PURE__ */ce(W,Un?{onClick:()=>{Xn(!1),En(wn()),Ye(null)},children:[
|
|
88
|
+
/* @__PURE__ */ue($,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Oe.windowed]}:{onClick:()=>{Xr(),Ye(null)},children:[
|
|
89
|
+
/* @__PURE__ */ue($,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),j&&!Pn&&/* @__PURE__ */ce(W,{onClick:()=>{Ue(e=>!e),Ye(null)},children:[
|
|
90
|
+
/* @__PURE__ */ue($,{name:"bookmark-square",className:"h-4 w-4 "+(He?"text-blue-600":""),fill:He?"currentColor":"none",strokeWidth:1.5}),He?Oe.unpin:Oe.pinOnTop]}),Ve&&/* @__PURE__ */ce(W,{onClick:()=>{Ye(null),rt()},children:[
|
|
91
|
+
/* @__PURE__ */ue($,{name:"star",className:"h-4 w-4",fill:tt?"currentColor":"none",strokeWidth:1.5}),tt?Re.taskbar.removeFromDesktop:Re.taskbar.addToDesktop]}),(cn[jt]||[]).length>0&&/* @__PURE__ */ue(de,{children:(cn[jt]||[]).map((e,t)=>/* @__PURE__ */ce(W,{onClick:()=>{Ye(null),e.onClick()},children:[e.icon,e.label]},t))}),!(Pn&&Ge?.home)&&/* @__PURE__ */ce(de,{children:[
|
|
92
|
+
/* @__PURE__ */ue(K,{}),
|
|
93
|
+
/* @__PURE__ */ce(W,{danger:!0,onClick:()=>{Ye(null),Sr()},children:[
|
|
94
94
|
/* @__PURE__ */ue($,{name:"close",className:"h-4 w-4"}),Oe.close]})]})]}),oo=!!fe&&$t.some(e=>e.id===fe),io=!Vt||oo||B?null:/* @__PURE__ */ce("div",{"data-modal-restore-tab":!0,"data-modal-id":jt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
95
95
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(jt),title:Oe.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:$e||Oe.windowSuffix}),
|
|
96
96
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>er(jt),title:Oe.restore,"aria-label":Oe.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
97
97
|
/* @__PURE__ */ue("button",{type:"button",onClick:()=>{Sr()},title:Oe.close,"aria-label":Oe.close,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return he(
|
|
98
|
-
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,
|
|
99
|
-
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(
|
|
98
|
+
/* @__PURE__ */ce(tn.Provider,{value:null,children:[no,ro,io]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Sr&&"Escape"===e.key&&(Br(null),Ar(!1))});var Vr=100,Gr={past:[],future:[]};function Jr(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Vr?r.slice(r.length-Vr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Gr}}var _r=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Zr=500,Qr=250;function eo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=se(Jr,Gr),a=J(/* @__PURE__ */new Map),[s,l]=Z(0),c=s>0,[u,d]=Z(0),[h,m]=Z(0),p=h>0,{hasAnyPerm:f}=k(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=J(null),g=J(!1),b=ee(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),v=ee((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ee(e=>{a.current.delete(e)&&l(e=>e-1)},[]),E=ee(e=>{d(t=>t+(e?1:-1))},[]),C=ee(e=>{m(t=>t+(e?1:-1))},[]),[M,N]=Z(0),S=M>0,T=ee(e=>{N(t=>t+(e?1:-1))},[]),z=Y(Ie),A=z?.claimReadOnly;_(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=z?.claimOwnMount;_(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const P=J({last:0,count:0,tripped:!1}),I=J(!1),W=ee((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(I.current=!0));if(!w||y.current)return;const r=P.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Qr&&(r.count=0),r.last=o,++r.count>Zr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Zr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,b]),K=ee(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),R=ee(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};K(e.values),i({type:"undo",redoStep:t})},[o.past,b,K]),O=ee(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};K(e.values),i({type:"redo",undoStep:t})},[o.future,b,K]),[$,j]=Z(0),F=J(0),q=J(0),B=J(!1),H=ee(()=>{g.current=!0,I.current=!1,y.current=null,F.current+=1,q.current=F.current,j(F.current)},[]),U=J(void 0),X=ee(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(B.current=!0),U.current=e),H()},[H]);_(()=>{g.current&&$===q.current&&(g.current=!1,y.current=null,(I.current||B.current)&&i({type:"clear"}),I.current=!1,B.current=!1)},[$]);const V=ee(()=>{B.current=!0,i({type:"clear"}),H()},[H]),G=w&&o.past.length>0,Q=w&&o.future.length>0,te=Nr(r),ne=J({undo:R,redo:O,canUndo:G,canRedo:Q});ne.current={undo:R,redo:O,canUndo:G,canRedo:Q},_(()=>{if(!te||!w)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&_r.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ne.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[te,w]);const re=ie(()=>({register:v,unregister:x,record:W,undo:R,redo:O,clear:V,baseline:X,canUndo:G,canRedo:Q,enabled:w,hasState:c,handMounted:S,claimOwnMount:T,claimReadOnly:E,declaredEditable:p,claimEditable:C,undoLabel:G?o.past[o.past.length-1].label:null,redoLabel:Q?o.future[0].label:null}),[v,x,W,R,O,V,X,G,Q,w,c,S,T,E,p,C,o.past,o.future]),oe=""!==mn(),ae=Y(L)?.footerOpen??!1,le=oe&&w&&c&&!S&&ae;/* @__PURE__ */
|
|
99
|
+
return ce(Ie.Provider,{value:re,children:[le&&/* @__PURE__ */ue(pn,{position:"left",quiet:!0,children:/* @__PURE__ */ue(Ke,{auto:!0})}),e]})}function to(){const e=Y(Ie),t=ee(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function no(e){const t=Y(Ie),n=t?.claimReadOnly,r=t?.claimEditable;_(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ro(e,t,n){const r=Y(Ie),o=ae(),i=J(e),a=J(t);a.current=t,_(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=J(r);c.current=r;const u=J({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},_(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function oo(e,t){const[n,r]=Z(e);return ro(n,e=>r(()=>e),t),[n,r]}export{fn as CancelButton,it as DocFavStar,Ye as EntityWindowFallback,Ue as EntityWindowLoading,Ve as EntityWindowState,on as MODAL_SUBMIT_SELECTOR,Yr as Modal,pn as ModalActions,Ke as UndoControls,eo as UndoProvider,ve as WINDOW_REGISTRY,De as WindowCrashedFallback,Pe as WindowErrorBoundary,Nt as WindowManagerProvider,dn as WindowTitle,dt as activateWindowById,$t as beginWindowGesture,Jn as cancelWindowFront,ke as client_default,Hr as commitExposeHighlight,Gn as confirmWindowDiscard,jt as drainPerfEvents,Pr as exitExposeMode,Sn as forgetMaximizedWindowBoxes,pt as getActiveWindowRoute,qr as getExposeHighlight,Qt as getWindowChromeVersion,Mn as getWindowPosition,Je as isDraftEntityId,_e as isDraftEntityWindow,ye as isEntityEntry,we as isPageEntry,xe as isShellApiClientConfigured,Fe as isTabWindow,Ot as markMenuOpen,_t as readWindowChrome,Xn as requestWindowFront,Br as setExposeHighlight,Rt as setPerfCollecting,Se as setShellHomeRoute,Ae as setShellTabStrip,be as setShellWindowRegistry,Cn as setWindowDefaultPosition,Nn as setWindowPosition,Ut as splitTitle,Fr as subscribeExposeHighlight,Zt as subscribeWindowChrome,qe as tabGroupOf,Dr as toggleExposeMode,qn as useCurrentTabKey,mn as useEnclosingModalId,Nr as useIsActiveWindow,Ce as usePageSearch,to as useUndo,no as useUndoCanEdit,ro as useUndoable,oo as useUndoableState,ln as useWidgetSettings,et as useWindowDirty,nt as useWindowManager,un as useWindowMenuItem,hn as useWindowTitle,Vn as windowHoldsChanges};
|