efficient-shell 13.15.0 → 13.17.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 +20 -1
- package/dist/Browser-547OGMQH.js +44 -0
- package/dist/Calculator-4UBMDAJO.js +29 -0
- package/dist/CurrencyConverter-H3HHXXKT.js +21 -0
- package/dist/{Files-EN4DDZYV.js → Files-GPPTZPDS.js} +80 -80
- package/dist/Notepad-GAZ7CZQB.js +24 -0
- package/dist/PdfViewer-EELX35ZI.js +1 -0
- package/dist/PomodoroTimer-JVCYYGRD.js +91 -0
- package/dist/{Preview-OSQHIS3Z.js → Preview-GSD54EUE.js} +33 -33
- package/dist/Sidebar-UCCVJFSY.js +44 -0
- package/dist/{Stock-2P4NWUNB.js → Stock-S266KGAF.js} +4 -4
- package/dist/{Weather-7LIQ4POB.js → Weather-TE4TTTQA.js} +22 -22
- package/dist/{WorldClock-KHBYIJQZ.js → WorldClock-5TPBHBYA.js} +7 -7
- package/dist/ai/index.js +118 -118
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FlowChart.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/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/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.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-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
- package/dist/{chunk-D3T3JCUC.js → chunk-34HRPEQD.js} +1 -1
- package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
- package/dist/{chunk-OWAYSIQH.js → chunk-42DF7CDB.js} +5 -5
- package/dist/{chunk-4OBSVO6U.js → chunk-4G7PJ325.js} +1 -1
- package/dist/{chunk-3OUG6QAD.js → chunk-5EHIWKUZ.js} +1 -1
- package/dist/chunk-5URXJCNC.js +2 -0
- package/dist/{chunk-OEPQIIYL.js → chunk-63E4ZZYI.js} +1 -1
- package/dist/{chunk-CKTFXTJL.js → chunk-6OCA7RKQ.js} +1 -1
- package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
- package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
- package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
- package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
- package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
- package/dist/{chunk-VYHVIKP6.js → chunk-7SVSHJOO.js} +10 -10
- package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
- package/dist/{chunk-I6JTDAOB.js → chunk-BNPWUCZX.js} +1 -1
- package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
- package/dist/{chunk-WJ7U6TGK.js → chunk-BVX7LUAW.js} +4 -4
- package/dist/chunk-BWQHABH7.js +4 -0
- package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
- package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
- package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
- package/dist/{chunk-IJNQ2BUY.js → chunk-CILE3ZCC.js} +2 -2
- package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
- package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
- package/dist/{chunk-XHD6Q6JV.js → chunk-EFO72DEI.js} +1 -1
- package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
- package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
- package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
- package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
- package/dist/chunk-EX3DARI3.js +7 -0
- package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
- package/dist/chunk-F2RAIGCG.js +6 -0
- package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
- package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
- package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
- package/dist/chunk-FMLUQCFB.js +2 -0
- package/dist/chunk-FRTDUHQF.js +1 -0
- package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
- package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
- package/dist/chunk-G2JPTPRS.js +13 -0
- package/dist/{chunk-YDFDTRZF.js → chunk-G7SILKUY.js} +5 -5
- package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
- package/dist/{chunk-GSLZ46DJ.js → chunk-GMLOMLCS.js} +13 -13
- package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
- package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
- package/dist/{chunk-J6QC45OS.js → chunk-HC5KQZFG.js} +5 -5
- package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
- package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
- package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
- package/dist/{chunk-UGEX7SVM.js → chunk-IUQJGFEO.js} +8 -8
- package/dist/{chunk-5HBAJ2UA.js → chunk-J4CVYOY3.js} +13 -13
- package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
- package/dist/chunk-JPE4TYRQ.js +14 -0
- package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
- package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
- package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
- package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
- package/dist/{chunk-OLSA36VX.js → chunk-KSK4VZIM.js} +6 -6
- package/dist/{chunk-ZNKZ6J65.js → chunk-L4ZQY4ZG.js} +3 -3
- package/dist/chunk-LADP6AJY.js +9 -0
- package/dist/{chunk-W6NGPSMM.js → chunk-LGGATDPH.js} +17 -17
- package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
- package/dist/chunk-LNCAIY64.js +15 -0
- package/dist/chunk-LQCNIQ3I.js +8 -0
- package/dist/{chunk-QQK7HKNK.js → chunk-LUCO5PS6.js} +1 -1
- package/dist/chunk-M6UKCZHT.js +2 -0
- package/dist/{chunk-QVQO3EFL.js → chunk-MHQW6NAE.js} +11 -11
- package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
- package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
- package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
- package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
- package/dist/{chunk-JFRBUVHX.js → chunk-OIEFMLYI.js} +3 -3
- package/dist/{chunk-A4WNUFLT.js → chunk-OOGUQEPT.js} +1 -1
- package/dist/chunk-OUYGLDQN.js +24 -0
- package/dist/chunk-OXWBSZL2.js +23 -0
- package/dist/{chunk-NISLELJF.js → chunk-P4J26R5P.js} +1 -1
- package/dist/{chunk-TTLVTJR6.js → chunk-POQUUMRS.js} +2 -2
- package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
- package/dist/chunk-PTYB2GGI.js +1 -0
- package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
- package/dist/{chunk-7TJZ5AJE.js → chunk-QNXTVDIC.js} +6 -6
- package/dist/{chunk-7JG64RQW.js → chunk-QSJMLHBD.js} +1 -1
- package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
- package/dist/{chunk-NYKOATR5.js → chunk-RDETBXMP.js} +1 -1
- package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
- package/dist/chunk-RJVIKGHJ.js +4 -0
- package/dist/{chunk-ZOCE74ED.js → chunk-SF4IIV5Z.js} +2 -2
- package/dist/{chunk-RZ3OQFOD.js → chunk-SHHRC5XK.js} +8 -8
- package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
- package/dist/chunk-SM3N5UJ2.js +69 -0
- package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
- package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
- package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
- package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
- package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
- package/dist/chunk-THAPVKEJ.js +15 -0
- package/dist/{chunk-GKNF53YM.js → chunk-TKCCJRPE.js} +1 -1
- package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
- package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
- package/dist/{chunk-42RCQEEJ.js → chunk-U5RG34NE.js} +11 -11
- package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
- package/dist/{chunk-23LK4PLJ.js → chunk-UGEA3C5C.js} +5 -5
- package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
- package/dist/chunk-UTQN5AIO.js +6 -0
- package/dist/chunk-UVHXVSB2.js +1 -0
- package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
- package/dist/chunk-VLX7L2AM.js +1 -0
- package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
- package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
- package/dist/chunk-WCCS4VFE.js +1 -0
- package/dist/{chunk-P5C7DI5A.js → chunk-WPGSU4QG.js} +5 -5
- package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
- package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
- package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
- package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
- package/dist/chunk-XD3M5ZXM.js +7 -0
- package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
- package/dist/{chunk-CGKY4ZRA.js → chunk-XU4I2DMR.js} +2 -2
- package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
- package/dist/chunk-XXTAMF3O.js +28 -0
- package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
- package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
- package/dist/{chunk-LLYMOV4S.js → chunk-YQ5JHHLE.js} +1 -1
- package/dist/{chunk-BWLC56GZ.js → chunk-YT5HMLC7.js} +1 -1
- package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
- package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
- package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
- package/dist/chunk-ZDXRSY2Y.js +1 -0
- package/dist/chunk-ZI2FDUYJ.js +99 -0
- package/dist/chunk-ZISKHQZY.js +3 -0
- package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
- package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/data/useColumnConfig.js +1 -1
- package/dist/data/useSort.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/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.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/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/dropdownPosition.js +1 -1
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useTheme.js +1 -1
- package/dist/icons/brands.node.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -40
- package/dist/index.js +335 -335
- package/dist/map/index.js +7 -7
- 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/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.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/FitFrame.d.ts +46 -0
- package/dist/shell/FitFrame.js +2 -0
- package/dist/shell/FloatingBar.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/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.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/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/ShellPrefs.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/StatusBadge.js +1 -1
- package/dist/shell/Tabs.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/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/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Browser-KHMTFVKZ.js +0 -44
- package/dist/Calculator-OKVS4UOJ.js +0 -29
- package/dist/CurrencyConverter-ZA2NGJWI.js +0 -21
- package/dist/Notepad-PHQNEUKW.js +0 -24
- package/dist/PdfViewer-PFQGQRQX.js +0 -1
- package/dist/PomodoroTimer-PW7BRZUJ.js +0 -91
- package/dist/Sidebar-GYGYAXS2.js +0 -44
- package/dist/chunk-3DSGJIC7.js +0 -7
- package/dist/chunk-3J4SFHC7.js +0 -15
- package/dist/chunk-3QNZ7YGZ.js +0 -99
- package/dist/chunk-47UTEV3P.js +0 -23
- package/dist/chunk-6QKTQOEV.js +0 -69
- package/dist/chunk-7KWYVQMX.js +0 -2
- package/dist/chunk-7QSDPSXP.js +0 -1
- package/dist/chunk-AOLJKOO6.js +0 -28
- package/dist/chunk-ASDYAASN.js +0 -3
- package/dist/chunk-CBUBDXJ2.js +0 -1
- package/dist/chunk-D65T4H6J.js +0 -1
- package/dist/chunk-DQTYV6AC.js +0 -9
- package/dist/chunk-EV5BEEVO.js +0 -1
- package/dist/chunk-FHNQC2MA.js +0 -1
- package/dist/chunk-GOAFMGUI.js +0 -15
- package/dist/chunk-HNPJ3V3I.js +0 -6
- package/dist/chunk-KXPXLUNM.js +0 -4
- package/dist/chunk-MHCNQKEK.js +0 -4
- package/dist/chunk-O2PVZC5D.js +0 -8
- package/dist/chunk-QTVE3OSD.js +0 -7
- package/dist/chunk-RDGXSAOD.js +0 -2
- package/dist/chunk-SOZCWT6I.js +0 -6
- package/dist/chunk-WWCAVO3R.js +0 -14
- package/dist/chunk-XMFJDT6Y.js +0 -13
- package/dist/chunk-YGKLZBWC.js +0 -24
- /package/dist/{chunk-HOHHRNCB.js → chunk-FRCTA5FS.js} +0 -0
- /package/dist/{chunk-VG6BT2UG.js → chunk-YRQ5WGOM.js} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-6OGX7V7L.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{ImageLightbox as a}from"./chunk-FXSGIT53.js";import{DescriptionList as i}from"./chunk-SACUSHVN.js";import{Drawer as t}from"./chunk-LQCNIQ3I.js";import{EmptyState as o}from"./chunk-VXSYHTBP.js";import{Breadcrumbs as d}from"./chunk-OZ4R6U2M.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-L2WBCXG7.js";import{useMediaMoveItems as p}from"./chunk-ZCGT5YNR.js";import{MediaUsedInList as h}from"./chunk-FFRJ6QZK.js";import{RenameField as f}from"./chunk-Q4MOT7TY.js";import{NativeSelect as g}from"./chunk-GEITUFYK.js";import{MediaUploadGrid as v}from"./chunk-TPKNHQIE.js";import{Segmented as k}from"./chunk-TNALBYLY.js";import{copyToClipboard as y}from"./chunk-UFX7F3KG.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as N}from"./chunk-VKZC3NPM.js";import{Banner as x}from"./chunk-XWJT6TFU.js";import{Input_default as C}from"./chunk-3SIRRK3F.js";import{DropdownMenu as I}from"./chunk-EX3DARI3.js";import{IconButton_default as D}from"./chunk-NWS5G7FE.js";import{useFileIntake as S,FileIntakeAlert as T}from"./chunk-VFSAJMNX.js";import{setModalDragAside as F,modalIdHolding as j}from"./chunk-EIFNESXS.js";import{ColoredBadge as z}from"./chunk-WRV6QKJN.js";import{Button_default as L}from"./chunk-UTISUEO4.js";import{Icon as O}from"./chunk-ISVODSRP.js";import{Tooltip as E}from"./chunk-F2RAIGCG.js";import{buttonClasses as P}from"./chunk-UQYNPYF4.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as R}from"./chunk-IUVGHHR3.js";import{useRef as M,useMemo as U,useCallback as K,useState as G,useEffect as V}from"react";import{jsxs as B,Fragment as X,jsx as Y}from"react/jsx-runtime";var H="application/x-efficient-media-files",J="application/x-efficient-media-folder",Q="application/x-efficient-media-file";function W(e){if(!e||!Array.from(e.types).includes(Q))return null;try{const n=JSON.parse(e.getData(Q));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var $={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */Y(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */Y(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */Y(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */Y(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */Y(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */Y(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */Y(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */Y(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */Y(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */Y(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */Y(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */Y(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */Y(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */Y(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */Y(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */Y(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */Y(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */Y(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */Y(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */Y(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(O){const{mode:W="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:Ne,onNewFolder:xe,onRename:Ce,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:Te,onDeleteForever:Fe,onEmptyTrash:je,onReplace:ze,onCropEdit:Le,onOpenInDesign:Oe,onChoose:Ee,onCancel:Pe,pickNote:Ae,onDragOut:Re,className:Me=""}=O,Ue=R().mediaLibrary,Ke=R().media,Ge="pick"===W,Ve=!Ge,Be=M(null),Xe=A(Be,"phone"===_?343:1200),Ye="phone"===_||"auto"===_&&Xe<640,He=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),Je=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Qe=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Je.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Je]),We=K(e=>{const n=[];for(let l=e?Je.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Je.get(l.parentId):void 0);return n},[Je,le.length]),$e=K((e,n)=>We(e).some(e=>e.id===n),[We]),[Ze,qe]=G(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=K(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;V(()=>{if("files"===ee.place)en(["@files",...We(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?He.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?He.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=s(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=M(!0);V(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");V(()=>{he&&mn.setSelection(he)},[gn]);const vn=M(gn??""),kn=pn.join("\0");V(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Ge?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=G(null),Nn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Je.get(n.id)?.name:un.get(n.id)?.name)&&Ce?.(n,e)},xn=async e=>{if(!xe)return;const n=await xe(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Cn=K(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=Je.get(e.id);return n===e.id||n&&$e(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:u,label:Ue.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of Qe.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[Qe,Je,tn,$e,on,Ue]),In=K(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=G(null),Tn={words:Ue,media:Ke,denied:ve,moveTargets:Cn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:xe&&Ve?e=>{xn(e)}:void 0,rename:Ce&&Ve?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&Ve?Ie:void 0,trash:De&&Ve?De:void 0,deleteFolder:Se&&Ve?Se:void 0,folderNotEmpty:e=>!!Je.get(e)?.notEmpty,replace:ze&&Ve?ze:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Ue.urlLabel,n)},openInDesign:Oe,restore:Te,deleteForever:Fe},Fn=e=>m(e,Tn),jn=w(),zn=(e,n)=>{Ge||(mn.isSelected(e)||mn.select(e),jn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Ln,On]=G(null),[En,Pn]=G(null),[An,Rn]=G(null);V(()=>{if(!En&&!Ln)return;const e=()=>{Pn(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[En,Ln]);const Mn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Ge)&&(!!Mn(e,H)||!(!Mn(e,J)||!An)&&(n!==An&&!(n&&$e(n,An)))),Kn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Ln!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),On(null),Mn(e,H)){let l;try{l=JSON.parse(e.dataTransfer.getData(H))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else An&&(Ie({kind:"folder",id:An},n),Rn(null))}}),Gn=e=>{const n=e=>Mn(e,H)||Mn(e,J)||Mn(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&En!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Vn=(e,n,l)=>/* @__PURE__ */Y(E,{side:"right",content:En===e?Ue.noDropProducts:sn(l),open:En===e||!En&&void 0,children:/* @__PURE__ */Y("span",{children:n})}),Bn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Xn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return B("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */Y(n,{label:Vn(i,e.name,t),level:r,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Gn(i),...Ve?Bn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */Y(l,{children:Xn(d,r+1,t)})]},e.id)}),Yn=(e,r)=>(Qe.get(e)??[]).map(e=>{const a=Qe.get(e.id),i=Ze.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=Fn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return B("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */Y(n,{label:e.name,level:r,icon:a&&i?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:Ln===e.id?"into":void 0,dragging:An===e.id,draggable:Ve&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */Y(f,{value:e.name,label:Ue.folderName,onDone:Nn}):void 0,actions:Ve&&o.length?/* @__PURE__ */Y(I,{align:"end","aria-label":Ue.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Kn(e.id,e.id),...Ve?Bn({kind:"folder",id:e.id}):{},...Ve&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(J,e.id),Rn(e.id)},onDragEnd:()=>{Rn(null),On(null)}}:{}}}),a&&i&&/* @__PURE__ */Y(l,{children:Yn(e.id,r+1)})]},e.id)}),Hn=Ze.has("@files"),Jn=Ze.has("@products"),Qn=/* @__PURE__ */B(e,{"aria-label":Ue.folders,children:[re&&/* @__PURE__ */B(X,{children:[
|
|
6
|
+
/* @__PURE__ */Y(n,{label:Vn("@products",Ue.products),level:1,icon:Z.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:re.length?Jn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Gn("@products")}}),Jn&&re.length>0&&/* @__PURE__ */Y(l,{children:Xn(re,2)})]}),
|
|
7
|
+
/* @__PURE__ */Y(n,{label:Ue.allFiles,level:1,icon:Hn?Z.folderOpen:Z.folder,count:ae,countLabel:null!=ae?Ue.fileCount(ae):void 0,expanded:Qe.get(null)?.length?Hn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===Ln?"into":void 0,rowProps:{"data-media-row":"@files",...Kn("@files",null)}}),Hn&&(Qe.get(null)?.length??0)>0&&/* @__PURE__ */Y(l,{children:Yn(null,2)}),Ve&&/* @__PURE__ */Y(n,{label:Ue.trash,level:1,icon:Z.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Wn=(()=>{if(an)return[{label:Ue.trash}];if(rn){const e=ee.nodeId?He.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=We(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=rn?Ue.readOnly:ve.upload,Zn=!!Ne&&!an&&!$n,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Zn,onAccept:e=>Ne?.(e,on)}),_n=rn?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[Ve&&xe&&!an&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{xn(on)},...el(_n),children:Ue.newFolder}),Ne&&!an&&/* @__PURE__ */Y(L,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>qn.open(),...el($n),children:Ue.upload}),Ve&&an&&je&&te.length>0&&/* @__PURE__ */Y(L,{variant:"danger",size:"sm",onClick:je,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */Y("div",{style:{width:Ye?void 0:a,flex:Ye?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */Y(g,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */Y("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */Y(C,{size:"sm",type:"search",leftIcon:Z.search,placeholder:rn?Ue.searchProducts:Ue.search,"aria-label":rn?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],rl("use"),130),ce&&Ve&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */Y(k,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:Z.grid},{value:"list",label:Ue.list,icon:Z.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */Y(z,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=Ve&&tn&&!!Ie&&!ve.move,dl=!!Re&&!an,sl=M(""),cl=M(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=M(Re);ml.current=Re;const pl=K(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),F(sl.current,!1),e&&ml.current?.(e))},[]),hl=K(e=>{pl(ul());const n=Be.current?.ownerDocument;if(!n)return;sl.current=j(Be.current);const l=Be.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&F(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,F(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);V(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Re(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[Q]:gl(e)}}:{}})),kl=Ye?Math.max(72,Math.floor((Xe-24-16-1)/3)):112,yl=M(null),bl=c({containerRef:yl,enabled:Ve&&!Ye&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Ge){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Ee?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},Nl=te.length?null:oe?/* @__PURE__ */Y(o,{variant:"dashed",title:Ue.noMatches}):rn?/* @__PURE__ */Y(o,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */Y(o,{variant:"dashed",title:Ue.trashEmpty}):!Zn||Ge?/* @__PURE__ */Y(o,{variant:"dashed",title:Ue.emptyFolder}):null,xl="list"===me&&te.length>0,Cl=Nl??(xl?/* @__PURE__ */Y("ul",{role:"listbox","aria-multiselectable":Ve||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */B("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Q,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */Y("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */Y("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */Y("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */Y("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */Y(v,{items:vl,readOnly:!Zn||Ge,onFiles:Zn&&!Ge?e=>Ne(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?H:dl?Q:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:Ve?zn:void 0,menuOnMedia:Ve})),Il=p({count:pn.length,kind:In(pn),targets:Cn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===u?null:e.key)}),Dl=P({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */Y(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */B(X,{children:[Z.folder,Ue.moveTo]}),items:Il,disabled:!!ve.move}),Tl=Ve&&pn.length>1&&!rn?/* @__PURE__ */B("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */Y(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */B(X,an?{children:[Te&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>Te(pn),...el(ve.restore),children:Ue.restore}),Fe&&/* @__PURE__ */Y(L,{variant:"secondary-danger",size:"sm",onClick:()=>Fe(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Sl,Ce&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
|
|
12
|
+
/* @__PURE__ */Y(L,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,Fl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,r?/* @__PURE__ */Y(f,{value:e.name,label:Ue.fileName,onDone:Nn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),rn?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const a=m({kind:"files",ids:[e.id]},Tn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return B("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */Y("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */Y(x,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
|
|
15
|
+
/* @__PURE__ */Y(i,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */B("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */Y("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */Y(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>Tn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&Ve&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>ze(e.id),...el(ve.replace),children:Ue.replace}),Le&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Le(e.id),children:Ue.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */Y(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */B(X,{children:[Z.folder,Ue.moveTo]}),items:a.items,disabled:!!ve.move}),Ce&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */Y(D,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:Z.trash})]}),an&&Ve&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[Te&&/* @__PURE__ */Y(L,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>Te([e.id]),...el(ve.restore),children:Ue.restore}),Fe&&/* @__PURE__ */Y(L,{variant:"danger",size:"sm",onClick:()=>Fe([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),rn&&Oe&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */Y(h,{items:ge})]})},jl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,zl=Ge?/* @__PURE__ */B("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
18
|
+
/* @__PURE__ */Y("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
|
|
19
|
+
/* @__PURE__ */B("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */Y(L,{variant:"secondary",size:"sm",onClick:Pe,children:Ue.cancel}),
|
|
20
|
+
/* @__PURE__ */Y(L,{variant:"primary",size:"sm",disabled:!hn,...el(jl),onClick:()=>{hn&&!jl&&Ee?.(hn)},children:Ue.chooseImage})]})]}):null,Ll=Ve&&!!hn,Ol=/* @__PURE__ */B("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */Y(x,{tone:"neutral",children:Ae}),
|
|
21
|
+
/* @__PURE__ */B("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */Y(d,{items:Wn}),nl]}),al,Tl,
|
|
23
|
+
/* @__PURE__ */B("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{Ve&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Cl,
|
|
24
|
+
/* @__PURE__ */Y(r,{rect:bl.rect})]}),Zn&&/* @__PURE__ */Y("input",{...qn.inputProps}),
|
|
25
|
+
/* @__PURE__ */Y(T,{rejections:qn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return B("div",{ref:Be,"data-media-library":"","data-layout":Ye?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Me}`.trim(),children:[/* @__PURE__ */B("div",Ye?{className:"flex flex-col gap-3 p-3",children:[Qn,Ol]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */Y("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Qn}),
|
|
28
|
+
/* @__PURE__ */Y("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Ol}),Ll&&/* @__PURE__ */Y("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:Fl(hn)})]}),zl,Ye&&/* @__PURE__ */Y(t,{open:Ll,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&Fl(hn)}),jn.state&&/* @__PURE__ */Y(N,{...jn.props,items:Fn(jn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */Y(a,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{H as MEDIA_FILES_DRAG_TYPE,Q as MEDIA_FILE_DRAG_TYPE,J as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,W as readMediaFileDrag};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-
|
|
2
|
-
return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(
|
|
1
|
+
import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-IUVGHHR3.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const I=t().kanban,j=r(),H=N??I.loading,M=C??I.dropHere,R=E??I.addItem,[T,A]=o(null),[O,S]=o(null),$=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),q=()=>{A(null),S(null)},z=i(null),F=i(/* @__PURE__ */new Map);n(()=>{if(null!==T)return;const e=z.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=F.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),F.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[$,T]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:H}):0!==m.length||w?/* @__PURE__ */d("div",{ref:z,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=$[e.value]??[],t=null!==O&&O.col===e.value,r=null!==T?n.findIndex(e=>g(e)===T):-1,o=t&&(-1===r||O.index!==r&&O.index!==r+1)?O.index:-1;/* @__PURE__ */
|
|
2
|
+
return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(T&&O&&O.col===e){const n=($[e]??[]).findIndex(e=>g(e)===T),t=-1!==n;if(!t||O.index!==n&&O.index!==n+1){const r=t&&O.index>n?O.index-1:O.index;h(T,e,r)}}q()})(e.value)},children:[
|
|
3
3
|
/* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
|
|
4
4
|
/* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
|
|
5
5
|
/* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
6
6
|
/* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,j)})]}),
|
|
7
|
-
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()
|
|
7
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>S(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===T;/* @__PURE__ */
|
|
8
8
|
return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
9
|
-
/* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{
|
|
10
|
-
/* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),
|
|
9
|
+
/* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{A(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==T?n.findIndex(e=>g(e)===T):-1,o=-1!==a&&a<r?r+1:r;S(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:q,onClick:b?()=>b(t):void 0,style:null===T?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
|
|
10
|
+
/* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),R]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:I.empty})})}export{m as Kanban};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{OneLineLabel as t}from"./chunk-
|
|
1
|
+
import{OneLineLabel as t}from"./chunk-TD3ZQD5R.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
|
|
2
2
|
return o(l.Provider,{value:t,children:/* @__PURE__ */o(c.Provider,{value:s,children:a})})}function f(){const t=a(c);return r(s=>t?.(s)??d(s),[t])}function g({status:s,label:r,emphasis:n="subtle"}){const u=i(a(l)[s]??"neutral",n),v=a(c),f=r??v?.(s)??d(s);/* @__PURE__ */
|
|
3
3
|
return o("span",{className:`${e} px-3 py-0.5 text-xs font-medium ${u}`,children:/* @__PURE__ */o(t,{children:f})})}export{e as BADGE_PILL,n as GROUP_COLORS,u as GROUP_COLORS_SOLID,g as StatusBadge,v as StatusBadgeProvider,i as groupColors,d as statusLabel,f as useStatusLabel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-S25KELFW.js";import{Select_default as a}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-S25KELFW.js";import{Select_default as a}from"./chunk-GEITUFYK.js";import{Pagination as r}from"./chunk-223XYIIH.js";import{Input_default as t}from"./chunk-3SIRRK3F.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-YDJ5IZOU.js";import{Button_default as l}from"./chunk-UTISUEO4.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-TD3ZQD5R.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
|
|
2
2
|
return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
3
3
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-S25KELFW.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-S25KELFW.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-3SIRRK3F.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TransferProgress as e}from"./chunk-
|
|
1
|
+
import{TransferProgress as e}from"./chunk-GUSENWAH.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-IUVGHHR3.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
|
|
2
2
|
return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
|
|
3
3
|
return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
4
4
|
return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as r}from"./chunk-
|
|
1
|
+
import{Tooltip as r}from"./chunk-F2RAIGCG.js";import{useShellStrings as e}from"./chunk-IUVGHHR3.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
2
2
|
/* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
3
3
|
/* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
4
4
|
/* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TH_ONE_LINE as r}from"./chunk-
|
|
1
|
+
import{TH_ONE_LINE as r}from"./chunk-TD3ZQD5R.js";import{jsxs as e,jsx as c}from"react/jsx-runtime";function n({caption:n,head:t,rows:i}){/* @__PURE__ */
|
|
2
2
|
return e("table",{className:"sr-only",children:[
|
|
3
3
|
/* @__PURE__ */c("caption",{children:n}),
|
|
4
4
|
/* @__PURE__ */c("thead",{children:/* @__PURE__ */c("tr",{children:t.map(e=>/* @__PURE__ */c("th",{className:r,scope:"col",children:e},e))})}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useLayoutEffect as e,useEffect as o}from"react";var d="undefined"!=typeof window&&"undefined"!=typeof document,n=d?e:o;export{d as IN_BROWSER,n as useBrowserLayoutEffect};
|
|
@@ -0,0 +1,99 @@
|
|
|
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{reportBoundaryError as c}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as u}from"./chunk-JDCM2VHG.js";import{Result as d}from"./chunk-M2TQOJ3G.js";import{CMD_Z as h,CMD_SHIFT_Z as m}from"./chunk-FBZUEZK7.js";import{CopyButton as p}from"./chunk-BG3C4ALM.js";import{confirm as f}from"./chunk-GMLOMLCS.js";import{useModalDragAside as w}from"./chunk-EIFNESXS.js";import{ItemCount as y}from"./chunk-SXHV5OLA.js";import{isInOverlayOver as g}from"./chunk-SF4IIV5Z.js";import{dialogA11y as v}from"./chunk-VWGWZY7A.js";import{ColoredBadge as b}from"./chunk-WRV6QKJN.js";import{ROW_HEIGHTS as x}from"./chunk-AW7TOB6N.js";import{LoadingSpinner as k}from"./chunk-4U5M37SF.js";import{activationOrder as E,activeListeners as C,ModalActionsContext as M,subscribeActive as N,getActiveModalId as S,KEY_ACTIVATED_SELECTOR as L}from"./chunk-F3ZOO23R.js";import{useShellAuth as T}from"./chunk-2QY5BJLA.js";import{useIsMobile as z,useIsPhone as A}from"./chunk-UGTRSRIW.js";import{useShellPrefs as D}from"./chunk-DPFEQQQU.js";import{focusableIn as I}from"./chunk-DWGYC7OD.js";import{StatusBadge as P}from"./chunk-YDJ5IZOU.js";import{PopupMenu as R,PopupMenuItem as O,PopupMenuDivider as W,PopupMenuLabel as K}from"./chunk-THAPVKEJ.js";import{Button_default as $}from"./chunk-UTISUEO4.js";import{Icon as j}from"./chunk-ISVODSRP.js";import{LoadingSpinner as F}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as q}from"./chunk-62LW225J.js";import{shellHttp as H,isShellHttpConfigured as B}from"./chunk-STKJA4PV.js";import{fitBoxScale as U,fitFrameStyle as Y}from"./chunk-M6UKCZHT.js";import{runEscapeInterceptors as X}from"./chunk-TWVUQUUD.js";import{useShellStrings as V}from"./chunk-IUVGHHR3.js";import{createContext as G,createElement as J,useContext as _,Component as Z,useLayoutEffect as Q,useRef as ee,useEffect as te,useState as ne,useSyncExternalStore as re,useCallback as oe,isValidElement as ie,Fragment as ae,Children as se,cloneElement as le,useMemo as ce,useId as ue,useReducer as de,Suspense as he}from"react";import{jsxs as me,jsx as pe,Fragment as fe}from"react/jsx-runtime";import{createPortal as we}from"react-dom";import{useLocation as ye}from"react-router-dom";import{useQueryClient as ge,useQuery as ve}from"@tanstack/react-query";function be(e){return"component"in e}function xe(e){return"endpoint"in e}var ke={};function Ee(e){ke=e}var Ce=new Proxy({},{get:(e,t)=>ke[t],has:(e,t)=>t in ke,ownKeys:()=>Object.keys(ke),getOwnPropertyDescriptor(e,t){if(t in ke)return{configurable:!0,enumerable:!0,value:ke[t]}}});function Me(){return B()}var Ne=H,Se=G({});function Le({value:e,children:t}){return J(Se.Provider,{value:e},t)}function Te(){return _(Se)}var ze=G(null);function Ae(){return _(ze)?.pageSearch??""}var De=null,Ie=/* @__PURE__ */new Set;function Pe(e){De!==e&&(De=e,Ie.forEach(e=>e()))}function Re(){return De}function Oe(e){return Ie.add(e),()=>{Ie.delete(e)}}var We=null;function Ke(e){We=e}function $e({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
|
|
2
|
+
return me("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
+
/* @__PURE__ */pe(j,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
+
/* @__PURE__ */me("div",{className:"min-w-0",children:[
|
|
5
|
+
/* @__PURE__ */pe("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
|
+
/* @__PURE__ */pe("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__ */pe("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 je=class extends Z{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),c(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */pe($e,{error:e,onReload:this.reset}):this.props.children}},Fe=G(null),qe="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function He({className:e="",auto:t=!1}){const n=_(Fe),r=V().undo,o=n?.claimOwnMount;if(Q(()=>{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
|
+
return me("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",h):r.nothingToUndo,className:qe,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",m):r.nothingToRedo,className:qe,children:r.redo})]})}var Be=/* @__PURE__ */new Set([408,429]);function Ue(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ye(e){const t=Ue(e);return null!=t&&(t>=400&&t<500&&!Be.has(t))}function Xe(e,t){return!Ye(t)&&e<3}function Ve(e){if("page"!==e.type)return!0;const t=e.route?Ce[e.route]:void 0;if(!t||!be(t))return!0;const n=t;return!n.widget&&!n.utility}function Ge(e){const t=e.route?Ce[e.route]:void 0;if(!t||!be(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var Je=(e,t)=>!!t&&"page"===e.type&&e.route===t;var _e="flex-1 min-h-0";function Ze(){const e=V().record;/* @__PURE__ */
|
|
11
|
+
return pe(F,{label:e.loading,padding:"",className:_e})}function Qe(e){return e??void 0}function et({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=V().record;if(t||e&&n)/* @__PURE__ */return pe(Ze,{});if(r){const e=Ue(r);if(401===e)/* @__PURE__ */
|
|
12
|
+
return pe(d,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:_e});if(403===e)/* @__PURE__ */
|
|
13
|
+
return pe(d,{status:"403",className:_e});if(404===e||410===e)/* @__PURE__ */
|
|
14
|
+
return pe(d,{status:"404",title:i.notFound,className:_e});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
|
+
return pe(d,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */pe($,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:_e})}/* @__PURE__ */
|
|
16
|
+
return pe(d,{status:"404",title:i.notFound,className:_e})}function tt({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */pe(fe,{children:t(e)}):/* @__PURE__ */pe(et,{...n})}var nt=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function rt(e){return"string"==typeof e&&(e.startsWith("new-")||nt.test(e))}function ot(e){if(rt(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var it=G({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),at=G(null);function st(e){const t=_(at),n=ee(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),Q(()=>{if(t)return t(n.current,e)},[t,e]),te(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function lt(){const e=ee(/* @__PURE__ */new Map),[t,n]=ne(!1);return{dirty:t,registerDirty:oe((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 ct(){return _(it)}function ut(e){if("page"!==e.type&&ot(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 dt({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=lt(),i=Ce[e.route];if(!i||!be(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
|
+
return pe(eo,{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__ */pe(at.Provider,{value:o,children:/* @__PURE__ */pe(he,{fallback:/* @__PURE__ */pe("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */pe(k,{})}),children:/* @__PURE__ */pe(s,{})})})})}function ht({entityType:e,entityId:t,label:n}){const r=V(),o=ge(),{data:i}=ve({queryKey:["my-profile-sidebar"],enabled:Me(),queryFn:()=>Ne.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 pe("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];Ne.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__ */pe(j,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var mt=/* @__PURE__ */new Set,pt=()=>"hidden";function ft({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=Ce[e.entityType];if(!o||!xe(o))return null;const i=o,[a,s]=ne(!1),{dirty:c,registerDirty:u}=lt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=rt(e.entityId),p=Te(),f=(w=e.id,re(N,()=>{const e=Un.get(w);return null!=e&&$n.has(e)}));var w;const y=!i.selfFetching&&!h&&!m&&Me(),g=ve({queryKey:[d,e.entityId],queryFn:()=>{return Ne.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Qe(e.entitySnapshot),initialDataUpdatedAt:0,enabled:y,staleTime:0,refetchOnWindowFocus:()=>{return void 0===(e=p.entityRefetchOnWindowFocus)||("function"==typeof e?e():e);var e},refetchOnMount:"always",refetchInterval:e=>function(e,t={}){if(Ye(e))return!1;if(t.minimized)return!1;const n=t.hostInterval;if(void 0===n)return 6e4;const r="function"==typeof n?n():n;return"number"==typeof r&&r>0&&r}(e.state.error,{minimized:f,hostInterval:p.entityRefetchInterval}),refetchIntervalInBackground:!1,retry:Xe}),v=g.data,b=g.refetch;te(()=>{var t;if(y)return t=t=>{t!==e.id||mt.has(t)||b({cancelRefetch:!1})},ar.add(t),()=>{ar.delete(t)}},[b,e.id,y]);const x=oe(()=>{a&&!c?s(!1):t()},[a,c,t]),E=(i.useEdit??pt)(v??null),C=!i.useEdit||m||h?void 0:{state:E,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},M=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,L=S?l[S]:null,T=M,z=!i.selfFetching&&v&&i.footer&&!h?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */pe(he,{fallback:/* @__PURE__ */pe(k,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */pe(he,{fallback:/* @__PURE__ */pe(eo,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */pe(Ze,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */pe(eo,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */pe(et,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */pe(eo,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:L,title:T,footer:z,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:C,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */pe(at.Provider,{value:u,children:/* @__PURE__ */pe(he,{fallback:/* @__PURE__ */pe(Ze,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */pe(tt,{entity:v,isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function wt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function yt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function gt(e){const t=wt(e),n=t??yt(e);if(!n)return;if(t&&!gr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&sr(o)}function vt(){const e=S();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var bt=/* @__PURE__ */new Map;function xt(){const e=vt();if(e)return bt.get(e)}function kt(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 Et="rosh-peek-style",Ct=q.peek,Mt=q.taskbarPreview;function Nt(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Et))return;const e=document.createElement("style");e.id=Et,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:${Ct}!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 St(){"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 Lt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=V(),l=ee(null),[c,u]=ne({w:n,h:Math.round(.75*r)}),[d,h]=ne(!1);return Q(()=>{const o=l.current;if(!o)return;const i=wt(e)??kt(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=U({width:n,height:r},a),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);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";const p=Y(a.width,s);return Object.assign(m.style,{transform:p.transform??"",transformOrigin:p.transformOrigin}),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__ */me("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
|
+
/* @__PURE__ */pe("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */me("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
|
+
/* @__PURE__ */pe(j,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
+
/* @__PURE__ */pe("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */pe("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__ */pe("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__ */pe(j,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function Tt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=V(),s=e.length>1,l=ee(null),[c,u]=ne({left:-9999,top:-9999,ready:!1}),[d,h]=ne(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");Q(()=>{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]),te(()=>St,[]);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 we(
|
|
22
|
+
/* @__PURE__ */pe("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:Mt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{St(),i()},children:e.map(e=>{const t=wt(e.id)??kt(e.label),o=t?function(e){if(gr(e))return null;const t=e.getBoundingClientRect(),n=hr(),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
|
+
return me("div",{className:"group flex flex-col items-center",onMouseEnter:()=>Nt(t),children:[!m&&/* @__PURE__ */pe("span",{className:p,children:e.label}),
|
|
24
|
+
/* @__PURE__ */pe(Lt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */pe("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */me("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__ */pe(j,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function zt(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 At({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=V(),[a,s]=ne(null);te(()=>{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=re(N,S),[,u]=ne(0);te(()=>{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]=ne(0);te(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=kt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=ne(null),[f,w]=ne(null),[g,v]=ne(null),b=ee(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{p(null),w(null)},150)},k=e.filter(e=>!e.route||!Ce[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?Ce[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 we(
|
|
26
|
+
/* @__PURE__ */me(fe,{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=wt(e.id)??kt(e.label);return!!t&&!gr(t)});/* @__PURE__ */
|
|
27
|
+
return me("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(g||(b.current&&(clearTimeout(b.current),b.current=null),b.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(),b.current&&(clearTimeout(b.current),b.current=null),p(null),w(null),s?v({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&&ie(n)?le(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */pe(j,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
|
+
/* @__PURE__ */pe("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */pe("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */pe(y,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */pe("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__ */pe(j,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
|
+
/* @__PURE__ */pe("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */me("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
|
+
/* @__PURE__ */pe(j,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),g&&/* @__PURE__ */me(R,{portal:!0,minWidth:200,style:zt(g.x,g.y),onClose:()=>v(null),children:[
|
|
31
|
+
/* @__PURE__ */pe(K,{children:g.label}),
|
|
32
|
+
/* @__PURE__ */me(O,{onClick:()=>{v(null),g.items.forEach(e=>function(e){const t=Un.get(e);t&&lr(t)}(e.id))},children:[
|
|
33
|
+
/* @__PURE__ */pe(j,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
+
/* @__PURE__ */me(O,{onClick:()=>{v(null),g.items.forEach(e=>o(e.id))},children:[
|
|
35
|
+
/* @__PURE__ */pe("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */pe("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__ */pe(W,{}),
|
|
37
|
+
/* @__PURE__ */me(O,{danger:!0,onClick:()=>{v(null),g.items.forEach(e=>t(e.id))},children:[
|
|
38
|
+
/* @__PURE__ */pe(j,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${g.items.length})`]})]}),m&&f&&/* @__PURE__ */pe(Tt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var Dt=["/login","/forgot-password","/reset-password","/force-change-password"];function It({children:e,windowAccentForRoute:t}){const n=ye(),r=Dt.some(e=>n.pathname.startsWith(e)),[o,i]=ne([]),a=ee(o);Q(()=>{a.current=o},[o]);const s=re(Oe,Re,Re),l=ee(/* @__PURE__ */new Map),c=e=>{const t=Ve(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};te(()=>{bt.clear();for(const e of o)e.route&&bt.set(e.id,e.route)},[o]);const u=oe(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=oe(e=>{var t;wt(e)||yt(e)?(t=e,window.dispatchEvent(new CustomEvent(Dr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=jn;t&&mt.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,(Fn.get(i)??-1)>a)||sr(o),t&&mt.delete(e)},50)},m=(e,t,n)=>{const r=We;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Ve(t))return e.length;if(t.shellOwned&&Je(t,n.home))return 0;const r=Je(t,n.home)?void 0:Ge(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Ve(e)&&!Je(e,n.home)&&Ge(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!Je(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&Je(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=>Ve(e[t])&&!Je(e[t],n.home)?Ge(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:Re(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},p=oe(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=oe((e,t,n,r,o,a={})=>{if(!Ce[e]||!xe(Ce[e]))return;const s=`${e}:${t}`,l=vt();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:Qe(n),openedFrom:l},!!a.append))})},[]),w=oe((e,t={})=>{if(!Ce[e]||!be(Ce[e]))return;const n=Ce[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,Jn.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=vt();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(s&&i.length>0)return t;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=oe(()=>{},[]),g=oe(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
39
|
+
return me(it.Provider,{value:{openWindows:o,openEntity:f,openPage:w,reorderWindows:p,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
|
|
40
|
+
/* @__PURE__ */pe(At,{openWindows:o,onRemove:d,onSplitView:Zr,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&&sr(e)}})},onActivateById:gt}),
|
|
41
|
+
/* @__PURE__ */pe(Qr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
|
+
/* @__PURE__ */
|
|
43
|
+
return pe(ze.Provider,{value:c(e),children:/* @__PURE__ */pe(je,{fallback:(t,n)=>/* @__PURE__ */pe(eo,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */pe($e,{error:t,onReload:n})}),children:/* @__PURE__ */pe(un,{spec:ut(e),children:/* @__PURE__ */pe(so,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */pe(dt,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */pe(ft,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Pt=400;function Rt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=ee(null),s=ee(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=ee(!1),c=ee(void 0),u=ee(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Pt)};te(()=>{n&&!r&&h()},[n,r]),te(()=>{d&&n&&!r&&h()},[d]),te(()=>()=>clearTimeout(c.current),[]),te(()=>{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?I(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),Q(()=>{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 Ot=null,Wt=/* @__PURE__ */new Set;function Kt(){return Ot}function $t(e){if(Ot!==e){Ot=e;for(const e of Wt)e()}}function jt(e){return Wt.add(e),()=>{Wt.delete(e)}}var Ft=!1,qt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Ht=()=>{};function Bt(e){Ft=e,qt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Ut(e,t){Ft&&("submenu"===e?qt.submenus++:qt.menus++,qt.menuKey=t)}function Yt(e){if(!Ft)return Ht;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Ft)return;const r=performance.now()-t;"move"===e?qt.moveMs+=r:qt.resizeMs+=r}}function Xt(){const e=qt;return qt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Vt=/* @__PURE__ */new Set([P,b]),Gt=e=>Vt.has(e)||"function"==typeof e&&"badge"===e.titleRole,Jt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),_t=/* @__PURE__ */new Set(["svg"]);function Zt(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return Qt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function Qt(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=>Qt(e,t,n));if(!ie(e))return;const r=e;if(r.type===p)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===ae)return void se.toArray(r.props.children).forEach(e=>Qt(e,t,n));if("string"==typeof r.type){if(_t.has(r.type))return;if(!Jt.has(r.type))return n.push(" "),se.toArray(r.props.children).forEach(e=>Qt(e,t,n)),void n.push(" ")}const o=le(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(Gt(r.type)?t.badges:t.actions).push(o)}var en=/* @__PURE__ */new Map,tn=/* @__PURE__ */new Set,nn=0;function rn(){nn++,tn.forEach(e=>e())}function on(e){return en.get(e)}function an(e){return tn.add(e),()=>{tn.delete(e)}}function sn(){return nn}var ln=G(""),cn=G(null);function un({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
+
return pe(cn.Provider,{value:e,children:t})}var dn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),hn='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function mn(e){return pn(e).replace(/\s+/g," ").trim()}function pn(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(pn).join("");if(ie(e)){const t=e,n="string"==typeof t.type?t.type:"";return dn.has(n)?"":` ${pn(t.props?.children)} `}return""}function fn(e){const t=_(ln);te(()=>{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 wn={};function yn(e,t,n){const r=_(ln);te(()=>{if(!r)return;wn[r]||(wn[r]=[]);const o={label:e,icon:n,onClick:t};return wn[r].push(o),()=>{wn[r]=(wn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function gn({title:e}){const t=ee(null);return te(()=>{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__ */pe("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function vn(e){}function bn(){return _(ln)}function xn({children:e,position:t="right",quiet:n=!1}){const r=_(M),[o,i]=ne(null);return te(()=>{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?we(e,o):null}function kn({onClick:e,children:t,className:n}){const r=_(M);/* @__PURE__ */
|
|
45
|
+
return pe("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 En="erp_window_positions",Cn={};try{const e=localStorage.getItem(En);e&&(Cn=JSON.parse(e))}catch{}var Mn=null;function Nn(){Mn&&clearTimeout(Mn),Mn=setTimeout(()=>{try{localStorage.setItem(En,JSON.stringify(Cn))}catch{}},500)}var Sn="erp_activation_order",Ln=[];try{const e=localStorage.getItem(Sn),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Ln=t)}catch{}var Tn=null;function zn(){Tn&&clearTimeout(Tn),Tn=setTimeout(()=>{try{localStorage.setItem(Sn,JSON.stringify(Ln))}catch{}},500)}function An(e,t){Cn[e]||(Cn[e]=t,Nn())}function Dn(e){return Cn[e]?{...Cn[e]}:null}function In(e,t){Cn[e]=t,Nn()}function Pn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(Cn))n(Cn[e],r,o)&&(delete Cn[e],i=!0);i&&Nn()}var Rn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},On=4e3,Wn=()=>{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"},Kn={small:.8,medium:1,large:1.25,maximized:1.25},$n=/* @__PURE__ */new Set,jn=0,Fn=/* @__PURE__ */new Map;var qn=0;function Hn(){return qn}function Bn(){qn++,C.forEach(e=>e())}var Un=/* @__PURE__ */new Map,Yn=/* @__PURE__ */new Map,Xn=/* @__PURE__ */new Map;function Vn(){for(let e=E.length-1;e>=0;e--){const t=Xn.get(E[e]);if(t?.tab)return t.owner}return null}function Gn(){return re(N,Vn,()=>null)}var Jn=/* @__PURE__ */new Set;var _n=null;function Zn(e){_n=null,sr(e)}function Qn(e){_n=e;const t=Un.get(e);t&&Zn(t)}var er=/* @__PURE__ */new Map;function tr(e){return er.get(e)?.holdsChanges()??!1}function nr(e){const t=er.get(e);return t?t.ask():Promise.resolve(!0)}function rr(e){_n===e&&(_n=null)}function or(e,t,n){if(n&&Xn.set(e,n),t)if(Un.set(t,e),Yn.set(e,t),Jn.delete(t)){E.unshift(e);const n=Ln.indexOf(t);-1!==n&&Ln.splice(n,1),Ln.unshift(t),zn()}else!function(e,t){const n=Ln.indexOf(t);if(-1===n)return void E.push(e);let r=E.length;for(let e=0;e<E.length;e++){const t=Yn.get(E[e]);if(t&&Ln.indexOf(t)>n){r=e;break}}E.splice(r,0,e)}(e,t),-1===Ln.indexOf(t)&&(Ln.push(t),zn());else E.push(e);Bn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&_n===t&&Zn(e)}function ir(e){return e?Xn.get(e)?.owner??Yn.get(e)??null:null}var ar=/* @__PURE__ */new Set;function sr(e){const t=ir(S()),n=E.indexOf(e);-1!==n&&E.splice(n,1),E.push(e);const r=Xn.get(e);if(r?.root)for(const[e,t]of Xn){if(t.root||t.owner!==r.owner||$n.has(e))continue;const n=E.indexOf(e);-1!==n&&E.splice(n,1),E.push(e)}$n.delete(e);const o=Yn.get(e);if(o){const e=Ln.indexOf(o);-1!==e&&Ln.splice(e,1),Ln.push(o),zn(),_n&&_n!==o&&(_n=null)}Bn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=ir(S());i&&i!==t&&ar.forEach(e=>e(i))}function lr(e){const t=E.indexOf(e);-1!==t&&E.splice(t,1),$n.add(e),Fn.set(e,++jn);const n=Yn.get(e);if(n){const e=Ln.indexOf(n);-1!==e&&(Ln.splice(e,1),zn())}Bn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var cr=/* @__PURE__ */new Set;var ur=8,dr=32;function hr(){return e()}var mr=x.windowBar,pr=80,fr=384,wr=400;function yr(e,t=hr()){const n=Math.min(Math.max(e.x,t.x+pr-e.w),t.x+t.w-pr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-mr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function gr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=hr();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 vr(e){const t=hr(),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 br=null;function xr(e){const t=(br||((br=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${q.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(br)),br);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 kr(){br&&(br.style.opacity="0",br.style.display="none")}var Er=[{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"}],Cr=350,Mr=200;function Nr({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=ne(!1),s=ee(void 0),l=ee(void 0);te(()=>()=>{clearTimeout(s.current),clearTimeout(l.current)},[]);const c=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!0),Cr)},u=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!1),Mr)};/* @__PURE__ */
|
|
46
|
+
return me("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:u,children:[
|
|
47
|
+
/* @__PURE__ */pe("button",{onClick:t,onFocus:c,onBlur:u,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */pe("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:Er.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */pe("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__ */pe("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Sr="rosh-gesture-style";var Lr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},Tr=4;function zr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Sr))return;const e=document.createElement("style");e.id=Sr,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=Yt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Ar(e){const t=E.indexOf(e);if(-1===t)return-1;const n=q.window+t*q.windowStep,r=Xn.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of Xn){if(!t.root||t.owner!==r.owner)continue;const n=E.indexOf(e);-1!==n&&(o=Math.max(o,q.window+n*q.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=E.length-1;e>=0;e--)cr.has(E[e])||E.splice(e,1);Ln=Ln.filter(e=>{const t=Un.get(e);return null!=t&&cr.has(t)}),zn(),Bn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Dr="modal-close-request";function Ir(e){re(N,Hn);const t=_(M);if(E.length<=1)return!0;if(e){const t=Un.get(e);if(null!=t)return S()===t}return t?.active??null!=S()}var Pr=!1,Rr=/* @__PURE__ */new Set;function Or(e){return Rr.add(e),()=>Rr.delete(e)}function Wr(){return Pr}function Kr(e){Pr!==e&&(Pr=e,Rr.forEach(e=>e()))}function $r(){Kr(!Pr)}function jr(){Kr(!1)}var Fr=null,qr=/* @__PURE__ */new Set;function Hr(e){return qr.add(e),()=>qr.delete(e)}function Br(){return Fr}function Ur(e){Fr!==e&&(Fr=e,qr.forEach(e=>e()))}var Yr=null,Xr=/* @__PURE__ */new Set;function Vr(e){return Xr.add(e),()=>Xr.delete(e)}function Gr(){return Yr}function Jr(e){Yr!==e&&(Yr=e,Xr.forEach(e=>e()))}function _r(){if(!Yr)return void Kr(!1);Ur(Yr),Jr(null),Kr(!1)}function Zr(){Kr(!Pr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Qr(){const e=re(Or,Wr),[t,n]=ne(e),[r,o]=ne(e);return te(()=>{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?we(
|
|
48
|
+
/* @__PURE__ */pe("div",{onMouseDown:e=>{e.stopPropagation(),Kr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:q.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 eo({open:t,onClose:l,title:c,icon:u,copyText:d,size:h="lg",dirty:m=!1,onNext:p,onPrev:y,footer:b,bodyScroll:x,onMinimize:k,initialBox:C,actions:T,actionsLeft:I,editing:P=!1,edit:K,allowPinOnTop:F,initialPosition:H,widget:B,compact:Y,appStyle:G,flushBody:J,autoHeight:Z,autoMinHeight:ae,autoWidth:se,widgetMenu:de,dimensions:he,windowKey:ye,openedFromKey:ge,accentRgb:ve,children:be}){const[xe,ke]=ne(()=>r()),Ee=z()&&!xe,Ce=A()&&!!B,[Me,Ne]=ne(0),[Se,Le]=ne(!1),Te=ee(null),Ae=ee(0);te(()=>{Ae.current=Me},[Me]);const De=oe(e=>{Ee&&(Te.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Le(!0),$t(ge??null))},[Ee,ge]),Ie=re(jt,Kt);te(()=>{if(!Se)return;const e=e=>{if(!Te.current)return;const t=e.clientX-Te.current.startX;if(Math.abs(e.clientY-Te.current.startY)>Math.abs(t)+12)return Te.current=null,Le(!1),Ne(0),void $t(null);Ne(Math.max(0,t))},t=()=>{if(!Te.current)return;const e=.3*window.innerWidth,t=Ae.current>e;Te.current=null,Le(!1),t?(Ne(window.innerWidth),setTimeout(()=>{l(),Ne(0),$t(null)},180)):(Ne(0),$t(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)}},[Se]);const[Pe,Re]=ne(c),Oe=V(),We=Oe.window;te(()=>{Re(c)},[c]);const Ke=ce(()=>mn(Pe).trim()||void 0,[Pe]),$e=ue(),[qe,Be]=ne(!1),Ue=ee(!1),[Ye,Xe]=ne(!1),[Ve,Ge]=ne(null),Je=_(cn),_e=_(ze),{prefs:Ze,save:Qe}=D(),et=!!Ze.window_accent_stripe,tt=Ze.favorite_documents||[],nt=!!Je&&tt.some(e=>e.entityType===Je.entityType&&e.entityId===Je.entityId),rt=oe(()=>{if(!Je)return;const e=nt?tt.filter(e=>!(e.entityType===Je.entityType&&e.entityId===Je.entityId)):[...tt,{entityType:Je.entityType,entityId:Je.entityId,label:Je.label}];Qe({favorite_documents:e})},[Je,nt,tt,Qe]),[ot,it]=ne(null),[at,lt]=ne("top-right"===H?"right":"left"),ut=ee(!1),dt=ee(null);Q(()=>{const e=dt.current;e&&(ve?e.style.setProperty("--window-accent-rgb",ve):e.style.removeProperty("--window-accent-rgb"))},[ve]);const ht=ee(!1),mt=ee(null),pt=ee(null),ft=ee(null),[wt,yt]=ne(!1),gt=ee(null),vt=ee(null),bt=ee(null),[xt,kt]=ne(!1);Q(()=>{const e=vt.current,t=bt.current;if(!e||!t)return;const n=()=>kt(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!=b&&!1!==b]);const Et=!!K&&!B&&!Y&&!G&&(K.editing||"hidden"!==K.state),Ct=!!(b||T||I)||wt||Et,Mt=_(Fe),Nt=""!==_(ln),St=ee(null);St.current=_e?{owner:_e.key,tab:_e.tab,root:!Nt}:null;const Lt=ye||(_e&&!Nt?_e.key:null),Tt=!!Mt&&!Nt&&Mt.enabled&&Mt.hasState&&(P||Mt.declaredEditable)&&!Mt.handMounted&&Ct&&!B&&!Y&&!G&&!Ee,zt=/* @__PURE__ */pe(j,{name:"window",className:"h-4 w-4",strokeWidth:1.5}),At=u&&ie(u)?le(u,{className:`h-4 w-4 ${u.props?.className??""}`.trim()}):u??zt,Dt=()=>/* @__PURE__ */pe("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ge(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:At}),It=40,{minimize:Pt,items:Ot,restoreIfMinimized:Wt,openWindows:Ft}=ct(),qt=ee(`modal-${Math.random().toString(36).slice(2,8)}`).current,Ht=w(qt);te(()=>{if(B)return cr.add(qt),()=>{cr.delete(qt)}},[B,qt]),te(()=>{const e=e=>{const t=e.detail;t?.id===qt&&Re(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[qt]);const[Bt,Ut]=ne(q.window),Yt=function(e){const t=re(N,S);return E.length<=1||t===e}(qt),Xt=ee(K);Xt.current=K;const Vt=!!K&&!K.editing&&"enabled"===K.state;te(()=>{if(!t||!Yt||!Vt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(g(e.target,dt.current)||(e.preventDefault(),e.stopPropagation(),Xt.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Yt,Vt]);const Gt=function(e){return re(N,()=>$n.has(e))}(qt);Rt({panelRef:dt,bodyRef:mt,open:t,widget:!!B,active:Yt,minimized:Gt});const Jt=re(Or,Wr),_t=re(Hr,Br),Qt=re(Vr,Gr),tn=!F&&!B,nn=Jt&&tn,[on,an]=ne(!1),sn=nn&&Qt===qt,[un,dn]=ne(!1),pn=un&&tn&&_t===qt?"picked":null,fn=ee(nn);te(()=>{if(fn.current&&!nn){dn(!0);const e=setTimeout(()=>{dn(!1),Fr===qt&&Ur(null)},700);return fn.current=nn,()=>clearTimeout(e)}fn.current=nn},[nn,qt]),te(()=>{nn||an(!1)},[nn]),te(()=>{const e=pt.current,t=ft.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>yt(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]),te(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&dt.current){const t=dt.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=pt.current,n=ft.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const yn=ee(!1),gn=oe(e,[]),vn=oe(()=>{const t=e(),n=he?he[0]:Rn[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Kn[Wn()],l=he?Math.min(he[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*(E.length-1),u=Math.max(It,(i-l)/2),d=(o-a)/2,m=t.h-It-l-u;return"top-right"===H?{x:t.x+t.w-a-It,y:t.y+It,w:a,h:l}:"top-left"===H?{x:t.x+It,y:t.y+It,w:a,h:l}:{x:t.x+Math.max(It,(o-a)/2+It)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,m)),w:a,h:l}},[h]),bn=ee(!1);t||(bn.current=!1);const xn=ye||d||null;te(()=>{if(!t)return;or(qt,xn,St.current??void 0),ye||sr(qt),yn.current=!1,Ut(Ar(qt));const e=()=>{Ut(Ar(qt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ye;if(!e.label)return!1;const t=dt.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(sr(qt),In.current)return;const t=hr(),n=Math.min(Jn.current.w,t.w-40),o=Math.min(Jn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;Mn({x:i,y:a,w:n,h:o}),Vn(!1)},i=e=>{const t=e.detail;r(t)&&(sr(qt),Ge({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ye)return;sr(qt);const t=Jn.current,n=function(e,t=hr()){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=dt.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)}Mn(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=E.indexOf(e);-1!==t&&(E.splice(t,1),Bn()),$n.delete(e),Fn.delete(e),Xn.delete(e);const n=Yn.get(e);n&&(Yn.delete(e),Un.delete(n))}(qt),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,qt,xn,gn]);const kn=!B&&"maximized"===Wn(),[En,Mn]=ne(()=>{if(xn&&Cn[xn]){const e={...Cn[xn]};return he&&(e.w=he[0],Z||(e.h=he[1])),yr(e)}return C?{x:C.x,y:C.y,w:C.w,h:C.h}:kn?gn():vn()}),[Sn,Ln]=ne(()=>!Z),Tn=ee(xe),zn=ee(null);te(()=>{const e=()=>{const e=r();e!==Tn.current&&zn.current?.(e),Tn.current=e,ke(e),Ut(Ar(qt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[qt]);const An=xe&&!!_e?.tab&&!Nt&&!B&&!Ee,Dn=An,In=ee(Dn);In.current=Dn;const Pn=Gn(),jn=xe&&!!_e?.tab&&!B&&!Ee&&!Jt&&Pn!==_e.key,qn=!!B&&xe&&!Jt&&null!==Pn,[Hn,Vn]=ne(()=>xn&&Cn[xn]||C?Dn:Dn||kn),Jn=ee(En);Jn.current=En;const _n=ee(Hn);Q(()=>{_n.current=Hn},[Hn]),Q(()=>{if(Sn||An)return;const e=dt.current,t=mt.current;if(!e||!t)return;const n=ae??(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,Jn.current.y)-24),g=w?Math.min(Jn.current.h,y):Math.min(Math.max(n,u+p),y),v=Math.abs(g-o)>1;v&&(o=g,Mn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),B||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Ln(!0)},160)))},l=new ResizeObserver(s);s(),gt.current&&l.observe(gt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Sn,B,ae,Ct,An]),Q(()=>{if(!Z||!Sn||B||!t)return;const e=gt.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||Hn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ae??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,Jn.current.y)-24);Mn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[Z,Sn,B,t,Hn,ae]);const Zn=!1!==se&&!B&&!G&&!Ee,[Qn,tr]=ne(()=>!Zn);Q(()=>{if(Qn||!t)return;if(!Zn||Hn)return void tr(!0);const n=dt.current,r=mt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=Jn.current.w,c=0;const u=()=>tr(!0),d=()=>{c=0;const t=Jn.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 v=a(t,s(t.w,w,g),d,It);v!==t&&(l=v.w,Mn(v))};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,On);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Qn,t,Zn,Hn]);const nr=ee(null),rr=!(!_e?.tab||Nt||B||Ee);zn.current=t=>{if(!rr)return;if(t)return nr.current||(nr.current={box:{...Jn.current},maximized:_n.current}),void(_n.current=!0);const r=nr.current;nr.current=null;const o=e();if(r?.maximized)return _n.current=!0,Vn(!0),void Mn(o);const i=r?.box??(xn?Cn[xn]:void 0);if(_n.current=!1,Vn(!1),i&&!n(i,o,!1)){const e={...i};he&&(e.w=he[0],Z||(e.h=he[1])),Mn(yr(e))}else Mn(vn())},te(()=>{Dn&&(_n.current=!0,Vn(!0),Mn(gn()))},[Dn,gn]),te(()=>{if(B)return;const e=()=>{const e=xn?Cn[xn]:void 0;if(_n.current=!1,Vn(!1),e){const t={...e};he&&(t.w=he[0],Z||(t.h=he[1])),Mn(yr(t))}else Mn(vn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[B,vn,xn]),te(()=>{t&&xn&&!An&&(Cn[xn]=En,Nn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[En,t,xn,An]),te(()=>{if(!t)return;const e=()=>{_n.current?Mn(gn()):document.body.classList.contains("rosh-gesturing")||Mn(yr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Hn&&(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,Hn,gn]),te(()=>{if(t&&(Be(!1),Ue.current=!1,ut.current=!1,tr(!Zn),!In.current)){if(xn&&Cn[xn]){const e=Cn[xn];return void Mn(t=>yr({...e,...Z?{h:t.h}:{},...Zn?{x:t.x,w:t.w}:{}}))}C&&(Mn({x:C.x,y:C.y,w:C.w,h:C.h}),Vn(C.maximized))}},[t]),te(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{dt.current?.contains(t.target)&&!Ue.current&&(Ue.current=!0,e=setTimeout(()=>Be(!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 ir="auto"===m?qe:!0===m,ar=_e&&!Nt?_e.key:null,mr=ce(()=>Zt(Pe),[Pe]),pr=ee({shortcutSpec:Je,isOnDesktop:nt,toggleDesktopShortcut:rt,taskbarStrings:Oe.taskbar});Q(()=>{pr.current={shortcutSpec:Je,isOnDesktop:nt,toggleDesktopShortcut:rt,taskbarStrings:Oe.taskbar}});const gr=ee(null);gr.current||(gr.current={open:(e,t)=>Ge({x:e,y:t}),items:()=>{const e=pr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of wn[qt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),te(()=>{if(t&&ar)return()=>{return e=ar,void(en.delete(e)&&rn());var e}},[t,ar]),st(!(ye||!t)&&ir);const br=oe(()=>ir||"auto"===m&&Ue.current,[ir,m]),Er=oe(async e=>{if(ut.current)return!1;if(!br())return!0;ut.current=!0;const t=Ke,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 f({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 ut.current=!1,r},[br,Ke]),Cr=oe(()=>ut.current?Promise.resolve():br()?Er("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[br,Er,l]),Mr=oe(async()=>{await Er("discard")&&(Ue.current=!1,Be(!1),Xt.current?.onDiscard())},[Er]),Sr=oe(async()=>{const e=await Er("switch");return e&&(Ue.current=!1,Be(!1)),e},[Er]),Ir=ee(()=>!1);Q(()=>{Ir.current=br}),Q(()=>{if(!t||!ye)return;const e={holdsChanges:()=>Ir.current(),ask:Sr};return er.set(ye,e),()=>{er.get(ye)===e&&er.delete(ye)}},[t,ye,Sr]),Q(()=>{if(!t||!Lt)return;const e=e=>{e.detail?.windowKey===Lt&&Cr()};return window.addEventListener(Dr,e),()=>window.removeEventListener(Dr,e)},[t,Lt,Cr]);const Pr=ee(null),Rr=oe(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ge(null),sr(qt),In.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=dt.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Pr.current){const t=Pr.current;Pr.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:Jn.current.x,c=s?s.top:Jn.current.y,u=s?s.height:Jn.current.h,d=s?s.width:Jn.current.w;Vn(!1),Mn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<Tr&&Math.abs(e.clientY-i)<Tr)return;r=zr(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)`),Jn.current={...Jn.current,x:s,y:u},!B){const t=function(e,t){const n=hr(),r=e<=n.x+ur,o=e>=n.x+n.w-ur,i=t<=n.y+ur,a=t>=n.y+n.h-ur,s=e<=n.x+dr,l=e>=n.x+n.w-dr,c=t<=n.y+dr,u=t>=n.y+n.h-dr;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?xr(vr(t)):kr())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),kr();const e=yr({...Jn.current});if(Jn.current=e,!B&&h){Pr.current={x:l,y:c,w:d,h:u};const e=vr(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 Mn(e)}if(B){const t=e.x+e.w/2,n=window.innerWidth/2;lt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),Mn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),$r=oe((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=dt.current,l=s?.getBoundingClientRect(),c=l?l.left:Jn.current.x,u=l?l.top:Jn.current.y,d=l?l.width:Jn.current.w,h=l?l.height:Jn.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;Vn(!1),Mn({x:c,y:u,w:d,h:h}),Jn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Jn.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`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<Tr&&Math.abs(e.clientY-a)<Tr)return;o=zr(n,r,Lr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(f&&(o=Math.max(fr,d+e)),w&&(i=Math.max(wr,h+t)),m){const t=Math.max(fr,d-e);n=c+d-t,o=t}if(p){const e=Math.max(wr,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(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),Mn({...Jn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),jr=oe(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(),sr(qt),"Enter"===e.key)return void(Hn?(Vn(!1),Mn(vn())):(Vn(!0),Mn(gn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Pr.current||(Pr.current={...Jn.current})};if(r<0)return e(),Vn(!0),void Mn(gn());if(r>0){if(Hn)return Vn(!1),void Mn(vn());if(Pr.current){const e=yr(Pr.current);return Pr.current=null,Jn.current=e,void Mn(e)}return void lr(qt)}e(),Vn(!1);const t=vr(n<0?"left":"right");return Jn.current=t,void Mn(t)}if(Hn)return;const o=Jn.current,i=e.shiftKey?{...o,w:Math.max(fr,o.w+24*n),h:Math.max(wr,o.h+24*r)}:yr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Jn.current=i,Mn(i)},[qt,Hn,vn,gn]),qr=oe(e=>{Pr.current||(Pr.current={...Jn.current}),Vn(!1);const t=vr(e);Jn.current=t,Mn(t),sr(qt)},[qt]),Yr=Dn||nn?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${We.windowSuffix}`:We.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:jr},Xr=()=>{Vn(!0),Mn(gn())},Jr=oe(()=>{const e=dt.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(hn);t&&!t.disabled&&t.click()}},[]);te(()=>{if(!t)return;if(B)return;const e=e=>{if(E[E.length-1]===qt&&!g(e.target,dt.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Jr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&dt.current?.contains(t)))return;if(t.closest(L))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Jr,qt,B]),te(()=>{if(!t)return;const e=e=>{E[E.length-1]===qt&&(g(e.target,dt.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:qt}})),Ue.current=!1,Be(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:qt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),te(()=>{if(!t)return;if(B)return;const e=e=>{if("Escape"===e.key&&E[E.length-1]===qt){if(X(e))return e.preventDefault(),void e.stopPropagation();if(An&&!P)return;e.preventDefault(),e.stopPropagation(),Cr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Cr,qt,B,An,P]);const _r=t&&(void 0!==p||void 0!==y),[Zr]=ne(()=>{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}),Qr=An&&!_e?.home&&mr.actions.length>0;te(()=>{t&&ar&&function(e,t){const n=en.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(en.set(e,t),rn())}(ar,{title:mr.text||Ke,dirty:ir,copy:mr.copy,actions:Qr&&Zr?Zr:void 0,menu:gr.current??void 0})},[t,ar,Ke,ir,mr.text,mr.copy,Qr,Zr]);const eo=oe(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(te(()=>{if(!t)return;const e=e=>{if(E[E.length-1]!==qt)return;if(g(e.target,dt.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&_r&&(e.preventDefault(),p?p():eo("bottom")),"k"===e.key&&_r&&(e.preventDefault(),y?y():eo("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,y,_r,eo,qt]),!t||bn.current)return null;const to=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=hr(),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}}(qt):null,no=nn&&to?U({width:to.w,height:to.h},{width:En.w,height:En.h}):1,ro=(()=>{if(nn&&to){const e=no,t=En.w*e,n=En.h*e,r=to.x+(to.w-t)/2-En.x,o=to.y+(to.h-n)/2-En.y,i=on||sn;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:q.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&&tn){const e="picked"===pn;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:q.expose+30}:{}}}return null})(),oo=v({modal:!1,titleId:!B&&(An?!_e?.home:!Ee)?$e:void 0,label:mr.text||Ke}),io=/* @__PURE__ */me("div",{children:[
|
|
49
|
+
/* @__PURE__ */me("div",{ref:dt,"data-modal-panel":!0,"data-modal-id":qt,"data-window-key":ye||void 0,...F?{"data-utility":""}:{},...Ye?{"data-pinned-top":""}:{},...B?{"data-widget":""}:{},..._e?{"data-window-owner":_e.key}:{},..._e&&!Nt?{"data-window-root":""}:{},...An?{"data-window-tab":""}:{},...oo,className:An?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(B?Yt?"shadow-xl":"shadow-lg":"border "+(Yt?"shadow-xl border-line":"shadow-lg border-line-strong")),onMouseDownCapture:e=>{if(ht.current=!1,nn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),Ur(qt),Kr(!1),void sr(qt)}if(!Yt&&!B&&!Ye&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===dt.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),ht.current=!0,Ge(null),sr(qt),window.addEventListener("mouseup",()=>{setTimeout(()=>{ht.current=!1},0)},{once:!0}))}},onClickCapture:e=>{ht.current&&(ht.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(nn)return;Ge(null);e.target.closest("[data-modal-panel]")===dt.current&&(e.target.closest("button, input, a, select, textarea")||sr(qt))},style:Ee?{zIndex:Bt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Me}px)`,transition:Se?"none":"transform 180ms ease-out",...B?{display:"none"}:{},...Bt<0?{display:"none"}:{},...Yt||Ye||Ie&&ye===Ie?{}:{display:"none"},...Ht?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Ye?q.pinnedWindow:Bt+1,width:En.w,height:En.h,top:En.y,...B&&"right"===at?{right:window.innerWidth-En.x-En.w}:{left:En.x},...Bt<0&&!Ye?{display:"none"}:{},...Ce?{display:"none"}:{},...jn||qn||Ht?{visibility:"hidden",pointerEvents:"none"}:{},...ro??{}},children:[Ee&&!B&&/* @__PURE__ */pe("div",{onPointerDown:De,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),B?null:An?_e?.home?null:/* @__PURE__ */me(fe,{children:[
|
|
50
|
+
/* @__PURE__ */pe("h2",{id:$e,"data-window-title":!0,className:"sr-only",children:mr.text||Ke}),Qr&&Zr&&we(
|
|
51
|
+
/* @__PURE__ */pe(fe,{children:mr.actions}),Zr),mr.badges.length>0&&/* @__PURE__ */pe("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:mr.badges})]}):Ee?null:
|
|
52
|
+
/* @__PURE__ */me("div",Y?{onPointerDown:Rr,"data-window-chrome":"",...Yr,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 "+(Yt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Yt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
53
|
+
/* @__PURE__ */me("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Yt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&Dt(),
|
|
54
|
+
/* @__PURE__ */pe("span",{id:$e,className:"truncate",children:nn?mn(Pe):Pe})]}),!nn&&/* @__PURE__ */me("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */pe("button",{onClick:()=>Xe(e=>!e),title:Ye?We.unpin:We.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ye?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */pe(j,{name:"bookmark-square",className:"h-3 w-3",fill:Ye?"currentColor":"none",strokeWidth:1.5})}),
|
|
55
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:Cr,"aria-label":We.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */pe(j,{name:"close",className:"h-4 w-4"})})]})]}:G?{onPointerDown:Rr,"data-window-chrome":"",...Yr,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 "+(Yt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Yt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
56
|
+
/* @__PURE__ */me("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Yt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&Dt(),
|
|
57
|
+
/* @__PURE__ */pe("span",{id:$e,className:"truncate",children:nn?mn(Pe):Pe})]}),!nn&&/* @__PURE__ */me("div",{className:"flex items-center gap-2 shrink-0 ml-2",children:[F&&/* @__PURE__ */pe("button",{onClick:()=>Xe(e=>!e),title:Ye?We.unpin:We.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Ye?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */pe(j,{name:"bookmark-square",className:"h-3 w-3",fill:Ye?"currentColor":"none",strokeWidth:1.5})}),
|
|
58
|
+
/* @__PURE__ */pe("button",{onClick:()=>lr(qt),"aria-label":We.minimize,title:We.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!Dn&&/* @__PURE__ */pe(Nr,{maximized:Hn,onToggleMax:()=>{Hn?(Vn(!1),Mn(vn())):Xr()},onSnap:qr,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:We}),
|
|
59
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:Cr,"aria-label":We.close,className:"rounded p-0.5 text-ink-faintest hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */pe(j,{name:"close",className:"h-4 w-4"})})]})]}:{onPointerDown:Rr,"data-window-chrome":"",...Yr,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 "+(Yt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Yt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
60
|
+
/* @__PURE__ */me("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Yt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!nn&&Dt(),
|
|
61
|
+
/* @__PURE__ */pe("span",{id:$e,className:"truncate",children:nn?mn(Pe):Pe})]}),!nn&&/* @__PURE__ */me("div",{className:"flex items-center gap-3 shrink-0 ml-4",children:[F&&/* @__PURE__ */pe("button",{onClick:()=>Xe(e=>!e),title:Ye?We.unpin:We.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Ye?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */pe(j,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Ye?"currentColor":"none",strokeWidth:1.5})}),
|
|
62
|
+
/* @__PURE__ */pe("button",{onClick:()=>lr(qt),"aria-label":We.minimize,title:We.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!Dn&&/* @__PURE__ */pe(Nr,{maximized:Hn,onToggleMax:()=>{Hn?(Vn(!1),Mn(vn())):Xr()},onSnap:qr,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:We}),
|
|
63
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:Cr,"aria-label":We.close,className:"rounded-(--radius-control) text-ink-faintest hover:text-gray-600",children:/* @__PURE__ */pe(j,{name:"close",className:"h-5 w-5"})})]})]}),ve&&et&&!B&&!Ee&&/* @__PURE__ */pe("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Yt?.9:.55})`}}),
|
|
64
|
+
/* @__PURE__ */pe(ln.Provider,{value:qt,children:/* @__PURE__ */pe(M.Provider,{value:{rightRef:pt,leftRef:ft,notify:()=>yt(!0),active:Yt,isDirty:ir,footerOpen:Ct&&!B&&!Y&&!G&&!Ee},children:/* @__PURE__ */pe("div",{ref:mt,...B?{onPointerDown:Rr,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":G||J?"p-0":Y?"p-2":"p-4"} ${B||An?"":"backdrop-blur-sm"} ${!1===x||G||J?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${B?"rounded-2xl select-none":""}`,style:{...B?{touchAction:"none"}:{},backgroundColor:B?"transparent":An?"rgb(var(--window-content-rgb))":Yt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */pe(je,{children:be})})})}),B&&ot&&/* @__PURE__ */me(R,{minWidth:160,style:{left:ot.x,top:ot.y},onClose:()=>it(null),children:[
|
|
65
|
+
/* @__PURE__ */pe(O,{onClick:()=>{it(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:qt}))},children:"Settings"}),
|
|
66
|
+
/* @__PURE__ */pe(W,{}),de&&/* @__PURE__ */me(fe,{children:[de,
|
|
67
|
+
/* @__PURE__ */pe(W,{})]}),
|
|
68
|
+
/* @__PURE__ */me(O,{onClick:()=>{it(null),Xe(e=>!e)},children:[
|
|
69
|
+
/* @__PURE__ */pe("span",{className:"flex-1",children:"Always on Top"}),Ye&&/* @__PURE__ */pe(j,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
70
|
+
/* @__PURE__ */pe(W,{}),
|
|
71
|
+
/* @__PURE__ */pe(O,{onClick:()=>{it(null),Cr()},children:"Close"})]}),
|
|
72
|
+
/* @__PURE__ */me("div",{onPointerDown:Rr,ref:gt,"data-modal-footer":"",className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${An?"":" cursor-move"}${Yt&&!An?" backdrop-blur-sm":""}${B||Y||G||Ee||!Ct?" hidden":""}`,style:{touchAction:"none",backgroundColor:An?"rgb(var(--window-footer-rgb))":Yt?"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__ */me("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[Tt&&/* @__PURE__ */pe(He,{auto:!0}),I,
|
|
74
|
+
/* @__PURE__ */pe("div",{ref:ft,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=b&&!1!==b&&
|
|
75
|
+
/* @__PURE__ */pe("div",{ref:vt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */pe("div",{ref:bt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(xt?" invisible":""),children:b})})]}),
|
|
76
|
+
/* @__PURE__ */me("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[Et&&K&&(K.editing?/* @__PURE__ */pe($,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{Mr()},children:We.discard}):"object"==typeof K.state?/* @__PURE__ */pe($,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:K.state.disabledReason,children:We.edit}):/* @__PURE__ */pe($,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>K.onEdit(),children:We.edit})),
|
|
77
|
+
/* @__PURE__ */pe("div",{ref:pt,"data-modal-actions":!0,className:"flex items-center gap-2"}),T]})]}),!B&&!Ee&&!nn&&Yt&&!Dn&&/* @__PURE__ */me(fe,{children:[
|
|
78
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
79
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
80
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
81
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
82
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
83
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
84
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
85
|
+
/* @__PURE__ */pe("div",{onPointerDown:e=>$r(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),nn&&/* @__PURE__ */pe("div",{className:"absolute inset-0",style:{zIndex:q.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>an(!0),onMouseLeave:()=>an(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),sr(qt),Kr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:on&&/* @__PURE__ */pe("button",{type:"button","data-expose-close":!0,"aria-label":Oe.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/no})`,transformOrigin:"top right",zIndex:q.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),Cr()},children:/* @__PURE__ */pe(j,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),nn&&to&&/* @__PURE__ */pe("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:to.x,top:to.y+to.h+4,width:to.w,zIndex:q.expose+(on?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:mn(Pe)})]}),ao=Ve&&/* @__PURE__ */me(R,{style:{left:Ve.x,top:Ve.y},onClose:()=>Ge(null),minWidth:160,children:[!B&&!Y&&!An&&/* @__PURE__ */me(fe,{children:[
|
|
86
|
+
/* @__PURE__ */me(O,{onClick:()=>{lr(qt),Ge(null)},children:[
|
|
87
|
+
/* @__PURE__ */pe(j,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),We.minimize]}),!Dn&&/* @__PURE__ */me(O,Hn?{onClick:()=>{Vn(!1),Mn(vn()),Ge(null)},children:[
|
|
88
|
+
/* @__PURE__ */pe(j,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),We.windowed]}:{onClick:()=>{Xr(),Ge(null)},children:[
|
|
89
|
+
/* @__PURE__ */pe(j,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),We.maximize]})]}),F&&!An&&/* @__PURE__ */me(O,{onClick:()=>{Xe(e=>!e),Ge(null)},children:[
|
|
90
|
+
/* @__PURE__ */pe(j,{name:"bookmark-square",className:"h-4 w-4 "+(Ye?"text-blue-600":""),fill:Ye?"currentColor":"none",strokeWidth:1.5}),Ye?We.unpin:We.pinOnTop]}),Je&&/* @__PURE__ */me(O,{onClick:()=>{Ge(null),rt()},children:[
|
|
91
|
+
/* @__PURE__ */pe(j,{name:"star",className:"h-4 w-4",fill:nt?"currentColor":"none",strokeWidth:1.5}),nt?Oe.taskbar.removeFromDesktop:Oe.taskbar.addToDesktop]}),(wn[qt]||[]).length>0&&/* @__PURE__ */pe(fe,{children:(wn[qt]||[]).map((e,t)=>/* @__PURE__ */me(O,{onClick:()=>{Ge(null),e.onClick()},children:[e.icon,e.label]},t))}),!(An&&_e?.home)&&/* @__PURE__ */me(fe,{children:[
|
|
92
|
+
/* @__PURE__ */pe(W,{}),
|
|
93
|
+
/* @__PURE__ */me(O,{danger:!0,onClick:()=>{Ge(null),Cr()},children:[
|
|
94
|
+
/* @__PURE__ */pe(j,{name:"close",className:"h-4 w-4"}),We.close]})]})]}),so=!!ye&&Ft.some(e=>e.id===ye),lo=!Gt||so||B?null:/* @__PURE__ */me("div",{"data-modal-restore-tab":!0,"data-modal-id":qt,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
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:()=>sr(qt),title:We.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:Ke||We.windowSuffix}),
|
|
96
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:()=>sr(qt),title:We.restore,"aria-label":We.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
|
+
/* @__PURE__ */pe("button",{type:"button",onClick:()=>{Cr()},title:We.close,"aria-label":We.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 we(
|
|
98
|
+
/* @__PURE__ */me(cn.Provider,{value:null,children:[io,ao,lo]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{Pr&&"Escape"===e.key&&(Jr(null),Kr(!1))});var to=100,no={past:[],future:[]};function ro(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>to?r.slice(r.length-to):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:no}}var oo=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var io=500,ao=250;function so({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=de(ro,no),a=ee(/* @__PURE__ */new Map),[s,l]=ne(0),c=s>0,[u,d]=ne(0),[h,m]=ne(0),p=h>0,{hasAnyPerm:f}=T(),w=t&&0===u&&(!(n&&n.length>0)||f(n)),y=ee(null),g=ee(!1),v=oe(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=oe((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=oe(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=oe(e=>{d(t=>t+(e?1:-1))},[]),E=oe(e=>{m(t=>t+(e?1:-1))},[]),[C,N]=ne(0),S=C>0,L=oe(e=>{N(t=>t+(e?1:-1))},[]),z=_(Fe),A=z?.claimReadOnly;te(()=>{if(A&&!w)return A(!0),()=>A(!1)},[A,w]);const D=z?.claimOwnMount;te(()=>{if(D&&S)return D(!0),()=>D(!1)},[D,S]);const I=ee({last:0,count:0,tripped:!1}),P=ee(!1),R=oe((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)||(P.current=!0));if(!w||y.current)return;const r=I.current;if(r.tripped)return;const o=Date.now();if(o-r.last>ao&&(r.count=0),r.last=o,++r.count>io)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${io} 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:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,v]),O=oe(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),W=oe(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"undo",redoStep:t})},[o.past,v,O]),K=oe(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};O(e.values),i({type:"redo",undoStep:t})},[o.future,v,O]),[$,j]=ne(0),F=ee(0),q=ee(0),H=ee(!1),B=oe(()=>{g.current=!0,P.current=!1,y.current=null,F.current+=1,q.current=F.current,j(F.current)},[]),U=ee(void 0),Y=oe(e=>{void 0!==e&&(void 0!==U.current&&e!==U.current&&(H.current=!0),U.current=e),B()},[B]);te(()=>{g.current&&$===q.current&&(g.current=!1,y.current=null,(P.current||H.current)&&i({type:"clear"}),P.current=!1,H.current=!1)},[$]);const X=oe(()=>{H.current=!0,i({type:"clear"}),B()},[B]),V=w&&o.past.length>0,G=w&&o.future.length>0,J=Ir(r),Z=ee({undo:W,redo:K,canUndo:V,canRedo:G});Z.current={undo:W,redo:K,canUndo:V,canRedo:G},te(()=>{if(!J||!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&&oo.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=Z.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[J,w]);const Q=ce(()=>({register:b,unregister:x,record:R,undo:W,redo:K,clear:X,baseline:Y,canUndo:V,canRedo:G,enabled:w,hasState:c,handMounted:S,claimOwnMount:L,claimReadOnly:k,declaredEditable:p,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:G?o.future[0].label:null}),[b,x,R,W,K,X,Y,V,G,w,c,S,L,k,p,E,o.past,o.future]),re=""!==bn(),ie=_(M)?.footerOpen??!1,ae=re&&w&&c&&!S&&ie;/* @__PURE__ */
|
|
99
|
+
return me(Fe.Provider,{value:Q,children:[ae&&/* @__PURE__ */pe(xn,{position:"left",quiet:!0,children:/* @__PURE__ */pe(He,{auto:!0})}),e]})}function lo(){const e=_(Fe),t=oe(()=>{},[]);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 co(e){const t=_(Fe),n=t?.claimReadOnly,r=t?.claimEditable;te(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function uo(e,t,n){const r=_(Fe),o=ue(),i=ee(e),a=ee(t);a.current=t,te(()=>{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=ee(r);c.current=r;const u=ee({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},te(()=>{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 ho(e,t){const[n,r]=ne(e);return uo(n,e=>r(()=>e),t),[n,r]}export{kn as CancelButton,Le as DesktopHostProvider,ht as DocFavStar,et as EntityWindowFallback,Ze as EntityWindowLoading,tt as EntityWindowState,hn as MODAL_SUBMIT_SELECTOR,eo as Modal,xn as ModalActions,He as UndoControls,so as UndoProvider,Ce as WINDOW_REGISTRY,$e as WindowCrashedFallback,je as WindowErrorBoundary,It as WindowManagerProvider,gn as WindowTitle,gt as activateWindowById,Yt as beginWindowGesture,rr as cancelWindowFront,Ne as client_default,_r as commitExposeHighlight,nr as confirmWindowDiscard,Xt as drainPerfEvents,jr as exitExposeMode,Pn as forgetMaximizedWindowBoxes,xt as getActiveWindowRoute,Gr as getExposeHighlight,sn as getWindowChromeVersion,Dn as getWindowPosition,rt as isDraftEntityId,ot as isDraftEntityWindow,xe as isEntityEntry,be as isPageEntry,Me as isShellApiClientConfigured,Ve as isTabWindow,Ut as markMenuOpen,on as readWindowChrome,Qn as requestWindowFront,Jr as setExposeHighlight,Bt as setPerfCollecting,Pe as setShellHomeRoute,Ke as setShellTabStrip,Ee as setShellWindowRegistry,An as setWindowDefaultPosition,In as setWindowPosition,Zt as splitTitle,Vr as subscribeExposeHighlight,an as subscribeWindowChrome,Ge as tabGroupOf,$r as toggleExposeMode,Gn as useCurrentTabKey,Te as useDesktopHost,bn as useEnclosingModalId,Ir as useIsActiveWindow,Ae as usePageSearch,lo as useUndo,co as useUndoCanEdit,uo as useUndoable,ho as useUndoableState,fn as useWidgetSettings,st as useWindowDirty,ct as useWindowManager,yn as useWindowMenuItem,vn as useWindowTitle,tr as windowHoldsChanges};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-EX3DARI3.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:I,align:R="end",side:z="bottom",menuMinWidth:A,linkAs:D,block:F=!1,className:O=""},W){const L=g&&(null!=N&&""!==N&&!1!==N)&&!v,S=x&&null!=j&&""!==j&&!1!==j,U=o(),$=/* @__PURE__ */t(i,{ref:W,type:b,variant:f,size:p,loading:v,leftIcon:k,block:F,disabled:g&&!L,"aria-disabled":!!L||void 0,disabledReason:L?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),E=F?"relative flex min-w-0 flex-1":"relative inline-flex",G=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
|
|
2
|
+
return s("div",{className:[F?"flex w-full":"inline-flex","items-stretch",O].filter(Boolean).join(" "),children:[null==w||""===w||L?$:/* @__PURE__ */t(r,{content:w,className:E,children:$}),
|
|
3
|
+
/* @__PURE__ */t(r,{content:S?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":S?U:void 0,items:h,align:R,side:z,minWidth:A,linkAs:D,disabled:x&&!S,"aria-disabled":S,onOpenChange:y,footer:C,footerLabel:I,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:G,strokeWidth:2,"aria-hidden":"true"})})}),S&&/* @__PURE__ */t("span",{id:U,className:"sr-only",children:j})]})});export{c as SplitButton_default};
|