efficient-shell 11.12.0 → 12.1.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 +52 -11
- package/dist/{Browser-LPGSKKLU.js → Browser-U3SO6PSV.js} +14 -14
- package/dist/Calculator-6XGTP5OQ.js +29 -0
- package/dist/{CurrencyConverter-N2HQT7IR.js → CurrencyConverter-XNWE5MQW.js} +7 -7
- package/dist/Files-S4AFZX4N.js +121 -0
- package/dist/{Notepad-JCWNOQET.js → Notepad-YYNH67EN.js} +9 -9
- package/dist/PdfViewer-ZI3QOG4G.js +1 -0
- package/dist/{PomodoroTimer-356JUEM3.js → PomodoroTimer-SBV43YX6.js} +63 -63
- package/dist/{Preview-X7XNDI6X.js → Preview-KV3L22LT.js} +20 -20
- package/dist/Sidebar-XVVZJ7PR.js +44 -0
- package/dist/{Stock-2XOOZNRR.js → Stock-GODZPUR3.js} +3 -3
- package/dist/{Weather-ZDU2722T.js → Weather-2IIV4CFT.js} +19 -19
- package/dist/{WorldClock-PQGERFCH.js → WorldClock-JW4MLMCB.js} +7 -7
- package/dist/ai/index.js +30 -30
- package/dist/apps/index.d.ts +133 -27
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-SSM6P43S.js → chunk-27XV4TAU.js} +5 -5
- package/dist/{chunk-HJM4LSMM.js → chunk-2DOMIOYR.js} +1 -1
- package/dist/{chunk-YQLKZ5UQ.js → chunk-2OMM2AG3.js} +1 -1
- package/dist/chunk-2T7MZ77B.js +3 -0
- package/dist/{chunk-UEWB6IOD.js → chunk-2XQOK3CT.js} +2 -2
- package/dist/{chunk-7A2Y3W55.js → chunk-2YBJQUYQ.js} +1 -1
- package/dist/{chunk-UTITWGVW.js → chunk-32WEY6O5.js} +1 -1
- package/dist/{chunk-RMSF4UCJ.js → chunk-3CMCGOOV.js} +4 -4
- package/dist/{chunk-KYHDDVTR.js → chunk-3WFJ4PYV.js} +4 -4
- package/dist/chunk-43MCNASD.js +1 -0
- package/dist/{chunk-D4RVWSUT.js → chunk-4H5NTMOF.js} +1 -1
- package/dist/{chunk-L2IPWMLI.js → chunk-4KJ7MLWO.js} +6 -6
- package/dist/chunk-4RTDZSGH.js +27 -0
- package/dist/{chunk-HDABS36W.js → chunk-4UGFNTZ3.js} +12 -12
- package/dist/{chunk-VZ52KKNA.js → chunk-53EW4M5S.js} +5 -5
- package/dist/{chunk-GS74BABV.js → chunk-56ESGDIC.js} +1 -1
- package/dist/{chunk-PETBAYS5.js → chunk-5F6KJAF3.js} +14 -14
- package/dist/{chunk-AQ7CNPEE.js → chunk-5N6AC3LN.js} +11 -11
- package/dist/{chunk-PDFV3YQB.js → chunk-5NDONLH5.js} +3 -3
- package/dist/{chunk-LJJ7FDAQ.js → chunk-5THF6BJS.js} +5 -5
- package/dist/{chunk-6S6FJJKP.js → chunk-5V6SA77P.js} +6 -6
- package/dist/{chunk-5IESW4PM.js → chunk-63QLZYMN.js} +3 -3
- package/dist/{chunk-DMBA6KYQ.js → chunk-6XC3XX7F.js} +6 -6
- package/dist/{chunk-LWFH5QTJ.js → chunk-7EK7JNR4.js} +1 -1
- package/dist/{chunk-NPT6EXHK.js → chunk-7F4U43YN.js} +4 -4
- package/dist/{chunk-225LCPO7.js → chunk-7FBAZLBX.js} +1 -1
- package/dist/{chunk-NTUZT37J.js → chunk-7H7U3HC6.js} +4 -4
- package/dist/{chunk-ZKBGUDNB.js → chunk-7KIDOIPY.js} +1 -1
- package/dist/{chunk-R6TDZ7T5.js → chunk-7ZYEDXZX.js} +1 -1
- package/dist/{chunk-MD6EPKOR.js → chunk-A2ZEGD2S.js} +10 -10
- package/dist/{chunk-LLSLY6BT.js → chunk-ACNDPAAT.js} +1 -1
- package/dist/{chunk-XOH6QERF.js → chunk-AJ5NU7UH.js} +9 -9
- package/dist/{chunk-L74WV4RJ.js → chunk-AJO55X66.js} +6 -6
- package/dist/{chunk-ZMC25LRC.js → chunk-ANSQT5ZS.js} +1 -1
- package/dist/{chunk-HT7SOOMD.js → chunk-AQULCKKZ.js} +11 -11
- package/dist/{chunk-LP45EML2.js → chunk-B5OYS65L.js} +1 -1
- package/dist/chunk-BD4OHYQB.js +13 -0
- package/dist/{chunk-4TB4CSLB.js → chunk-BFA5U5JF.js} +11 -11
- package/dist/{chunk-Y4RHGLXB.js → chunk-BFO72WQB.js} +1 -1
- package/dist/{chunk-HOEEFFE3.js → chunk-BPECY7I7.js} +9 -9
- package/dist/{chunk-IFWXC323.js → chunk-BXZNMSTZ.js} +1 -1
- package/dist/{chunk-6ETRVCMH.js → chunk-BXZSLRNO.js} +10 -10
- package/dist/{chunk-YOXR3VKO.js → chunk-C4XV42QP.js} +1 -1
- package/dist/chunk-CC42UKIT.js +1 -0
- package/dist/{chunk-GRC46C4V.js → chunk-CD7P34VC.js} +7 -7
- package/dist/{chunk-4EVYK6DR.js → chunk-CENTHUBD.js} +7 -7
- package/dist/{chunk-TTQJQKCE.js → chunk-CF4YOJUQ.js} +10 -10
- package/dist/{chunk-O6VIHWYU.js → chunk-CNVYM3HP.js} +1 -1
- package/dist/{chunk-IJ6HZXZY.js → chunk-COMV3Z2U.js} +1 -1
- package/dist/chunk-CQCMJHDM.js +9 -0
- package/dist/{chunk-FD6XZRWA.js → chunk-CRB5GM4W.js} +1 -1
- package/dist/{chunk-JJLAI6GL.js → chunk-CRU2BNEM.js} +7 -7
- package/dist/{chunk-4APQHXLI.js → chunk-CTW2OKYS.js} +2 -2
- package/dist/chunk-CWTY4GTU.js +5 -0
- package/dist/{chunk-FEUTN4GK.js → chunk-DKUF7BD5.js} +1 -1
- package/dist/{chunk-HGMQOHMK.js → chunk-DSHEOC2O.js} +1 -1
- package/dist/{chunk-LXBBJNBQ.js → chunk-DU5IBIZQ.js} +1 -1
- package/dist/{chunk-5KKJAYKT.js → chunk-DZBGJ6X4.js} +1 -1
- package/dist/{chunk-FRH2AHPI.js → chunk-E227NVFX.js} +1 -1
- package/dist/{chunk-RBAC26J7.js → chunk-EEVKJJ5S.js} +4 -4
- package/dist/{chunk-WEEQDPU3.js → chunk-EOGXCGQF.js} +6 -6
- package/dist/{chunk-P75N466Z.js → chunk-ESDWHHQY.js} +2 -2
- package/dist/{chunk-AO7XAAGG.js → chunk-FAIHSCOG.js} +1 -1
- package/dist/chunk-FEJFGFPF.js +8 -0
- package/dist/{chunk-ZA2RBNRA.js → chunk-FLYOI6EW.js} +1 -1
- package/dist/{chunk-WOOKUEED.js → chunk-FOTDGSY5.js} +1 -1
- package/dist/{chunk-UBQUXUD2.js → chunk-FUUJJ7OH.js} +5 -5
- package/dist/chunk-FWUXYNWF.js +13 -0
- package/dist/{chunk-2ZAFRGRF.js → chunk-G2X5YYIQ.js} +2 -2
- package/dist/{chunk-KU4IWX6F.js → chunk-GEZ45J4Z.js} +2 -2
- package/dist/{chunk-HJBR73GS.js → chunk-GFBQ53WN.js} +1 -1
- package/dist/chunk-GGSPY3Q4.js +23 -0
- package/dist/chunk-GIUX7WUS.js +7 -0
- package/dist/{chunk-PVVHWLNX.js → chunk-GJ23UZDQ.js} +1 -1
- package/dist/{chunk-BPJ3CQH7.js → chunk-GJJKWGBX.js} +11 -11
- package/dist/chunk-GMLGR4R6.js +8 -0
- package/dist/{chunk-IKKR2TYY.js → chunk-GRB4LKZC.js} +5 -5
- package/dist/{chunk-K3IUUZO5.js → chunk-GZJ5F7SB.js} +8 -8
- package/dist/{chunk-WZJPASST.js → chunk-HB2XXIQG.js} +5 -5
- package/dist/chunk-HGZZXA2N.js +9 -0
- package/dist/{chunk-Q7UTGO73.js → chunk-HICNRXYB.js} +10 -10
- package/dist/{chunk-PTVTNCD6.js → chunk-HNQKXOFU.js} +4 -4
- package/dist/{chunk-OCWWEHNR.js → chunk-HS4EWT6L.js} +2 -2
- package/dist/{chunk-2NRNKF46.js → chunk-HTDZ3XAJ.js} +7 -7
- package/dist/chunk-HY3JYAUH.js +19 -0
- package/dist/{chunk-UVMM7AYO.js → chunk-I3QFYBOP.js} +1 -1
- package/dist/{chunk-GJFTO7D4.js → chunk-I7H3OIYX.js} +1 -1
- package/dist/{chunk-7FCIFHO7.js → chunk-IRZ6XM5A.js} +1 -1
- package/dist/{chunk-PL4HKGYP.js → chunk-IYPRFUTT.js} +1 -1
- package/dist/{chunk-TZXAW32T.js → chunk-J5ISQYVM.js} +1 -1
- package/dist/{chunk-DXKXETTT.js → chunk-JCTOQOVO.js} +1 -1
- package/dist/{chunk-IIKPM3F4.js → chunk-JCUG572K.js} +1 -1
- package/dist/{chunk-CXZ7PHHF.js → chunk-KHVECW4M.js} +6 -6
- package/dist/{chunk-CR3YDABU.js → chunk-L75RBQFH.js} +1 -1
- package/dist/{chunk-6CK44QWU.js → chunk-LJJSFJA2.js} +26 -26
- package/dist/{chunk-34AHNPW7.js → chunk-LLBH6PHE.js} +1 -1
- package/dist/{chunk-PMKBWDXO.js → chunk-LOEOCZCN.js} +1 -1
- package/dist/{chunk-VVDK7XPH.js → chunk-LTESFDTF.js} +1 -1
- package/dist/{chunk-6WPKLF6G.js → chunk-LUSIZ2BK.js} +15 -15
- package/dist/{chunk-JGWUSJDD.js → chunk-M7DFM2N7.js} +60 -60
- package/dist/{chunk-7V32O5NF.js → chunk-MRFNJZRR.js} +16 -31
- package/dist/{chunk-FFNPAJLS.js → chunk-NC36LJCA.js} +9 -9
- package/dist/{chunk-N75MPMLD.js → chunk-NHBDLW52.js} +1 -1
- package/dist/{chunk-SEP35R2E.js → chunk-NHWDB7R6.js} +1 -1
- package/dist/{chunk-NMQGAP3H.js → chunk-NJTFI7AA.js} +1 -1
- package/dist/chunk-NPQBJJLP.js +9 -0
- package/dist/{chunk-UHGAT5MH.js → chunk-NZYI4XV5.js} +2 -2
- package/dist/{chunk-SKRFI6WB.js → chunk-ONYPN3JY.js} +11 -11
- package/dist/{chunk-F33L4J3P.js → chunk-ORLQUGIN.js} +6 -6
- package/dist/{chunk-JJZAYAVL.js → chunk-PH3P54QQ.js} +1 -1
- package/dist/chunk-PKNHSZWK.js +8 -0
- package/dist/{chunk-IUG4Z2ND.js → chunk-PXIP246B.js} +1 -1
- package/dist/{chunk-GJVGGYQ2.js → chunk-QBD7V4TK.js} +1 -1
- package/dist/{chunk-OMROEVOP.js → chunk-QN56R4V4.js} +1 -1
- package/dist/{chunk-6UJYRGWY.js → chunk-QTMRW6DK.js} +1 -1
- package/dist/{chunk-LXQHTY3A.js → chunk-R3JKZXII.js} +5 -5
- package/dist/{chunk-6C6M3QXL.js → chunk-R3K3LVVS.js} +1 -1
- package/dist/{chunk-AWQ5SOC5.js → chunk-RIXX6NRV.js} +1 -1
- package/dist/{chunk-CAIKDX2M.js → chunk-RM74EAMV.js} +2 -2
- package/dist/{chunk-3N2MNOV5.js → chunk-RXHTIJ64.js} +1 -1
- package/dist/chunk-S3C3XJG7.js +1 -0
- package/dist/{chunk-OLJUPBY4.js → chunk-SCCAMJB4.js} +1 -1
- package/dist/{chunk-3PZI2C4R.js → chunk-SCGBCBXP.js} +1 -1
- package/dist/chunk-SX5CSXZO.js +8 -0
- package/dist/chunk-TBBG2AWY.js +9 -0
- package/dist/{chunk-KVVZLEUG.js → chunk-TRWHVG3A.js} +1 -1
- package/dist/{chunk-VIDT4JLR.js → chunk-TTSZSLQL.js} +1 -1
- package/dist/{chunk-SAASFWKB.js → chunk-UDJLRTQB.js} +1 -1
- package/dist/{chunk-G3FHFWC2.js → chunk-UDL2A2GT.js} +3 -3
- package/dist/chunk-UE54EN4C.js +2 -0
- package/dist/{chunk-VU5P4ZM5.js → chunk-VFBBGLRA.js} +12 -12
- package/dist/{chunk-ZHS2VQU7.js → chunk-VGWYAYHB.js} +3 -3
- package/dist/chunk-VPYD7UJM.js +22 -0
- package/dist/{chunk-UCAMOW53.js → chunk-VQPZDZ3R.js} +4 -4
- package/dist/{chunk-2XORVHF2.js → chunk-VW7W6LCV.js} +1 -1
- package/dist/{chunk-FUHURDBL.js → chunk-VZLYB5LX.js} +1 -1
- package/dist/{chunk-BOJEZKYS.js → chunk-WD3I7AEZ.js} +11 -11
- package/dist/{chunk-JRCFOZEU.js → chunk-WMLBMR4E.js} +3 -3
- package/dist/{chunk-UOGF37Z4.js → chunk-XARBHOEZ.js} +1 -1
- package/dist/{chunk-ELIWGIR7.js → chunk-XBDHRMQI.js} +9 -9
- package/dist/{chunk-RXVFAFEB.js → chunk-XQUXL75F.js} +1 -1
- package/dist/{chunk-5UCRYSQJ.js → chunk-XZH5PEML.js} +5 -5
- package/dist/{chunk-T74FGTLW.js → chunk-Y46WPTKY.js} +6 -6
- package/dist/chunk-YAD7TML2.js +28 -0
- package/dist/{chunk-M4AOQYSP.js → chunk-YKHAI5IZ.js} +1 -1
- package/dist/{chunk-D5MN3LXC.js → chunk-YRZP7JN4.js} +17 -17
- package/dist/{chunk-EQ72AP5E.js → chunk-Z43XVU2P.js} +1 -1
- package/dist/{chunk-4JJ5WT4D.js → chunk-ZACNIKIQ.js} +1 -1
- package/dist/{chunk-VEATEVMV.js → chunk-ZG3RF2VE.js} +1 -1
- package/dist/{chunk-JFCCI5L2.js → chunk-ZUBTNUVE.js} +1 -1
- package/dist/{chunk-I5GDAQYL.js → chunk-ZYFBV4C7.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/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/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +666 -666
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +0 -265
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/shell.css +1 -12
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -8
- package/dist/Calculator-XUV5JV3O.js +0 -29
- package/dist/Documents-IRPS3N5T.js +0 -84
- package/dist/Files-VN2IOPHX.js +0 -88
- package/dist/PdfViewer-M4RTCNNE.js +0 -1
- package/dist/Sidebar-OZMJNAXN.js +0 -44
- package/dist/Spreadsheet-YQOVGIU7.js +0 -75
- package/dist/chunk-2E3K4FSQ.js +0 -13
- package/dist/chunk-2XOH3NJZ.js +0 -27
- package/dist/chunk-5W3U3EVG.js +0 -7
- package/dist/chunk-5YP7MFPK.js +0 -1
- package/dist/chunk-64KZ74CS.js +0 -8
- package/dist/chunk-7TVGP2SX.js +0 -8
- package/dist/chunk-AD27M3ZH.js +0 -9
- package/dist/chunk-B2AYI45X.js +0 -9
- package/dist/chunk-CGA6RTVI.js +0 -9
- package/dist/chunk-CR42APAY.js +0 -8
- package/dist/chunk-DHMOJX2Z.js +0 -1
- package/dist/chunk-EBGOENC3.js +0 -3
- package/dist/chunk-ES2LUEPN.js +0 -22
- package/dist/chunk-FZWSP7KJ.js +0 -28
- package/dist/chunk-KV4QPU6U.js +0 -23
- package/dist/chunk-MFP5KOQW.js +0 -9
- package/dist/chunk-QDL2FNP7.js +0 -8
- package/dist/chunk-R7KRBKFH.js +0 -5
- package/dist/chunk-SI33IE7G.js +0 -2
- package/dist/chunk-SPMD7UZO.js +0 -19
- package/dist/chunk-UZTKBA7Z.js +0 -13
- package/dist/chunk-VTVSMRFX.js +0 -1
- package/dist/chunk-YXSGMPNW.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-
|
|
2
|
-
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,
|
|
3
|
-
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${
|
|
1
|
+
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-43MCNASD.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
|
|
2
|
+
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,A=s(),B=w??j.noData,C=null!=p&&Number.isFinite(p)?p:null,D=Number.isFinite(f)&&f>0?f:null;null==D&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const F=e(v,"MetricBar"),S=null!=C?F??t(l(C,g,b)):null,E=n(g),G=n(b),L=null!=C&&null!=D?x(C/D*100):0,P=null!=C?(y??(a=>100===D?u(a,1,A):m(a,A)))(C):"—",R=null!=C&&null!=D&&(null!=E||null!=G),z="md"===k||"lg"===k,H=z?"h-2":"h-1.5",O=null!=C&&null!=D,Q=/* @__PURE__ */c("div",{...O?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(D,Math.max(0,C)),"aria-valuetext":P}:{"aria-hidden":!0},className:O&&S?`relative mt-2 ${H} rounded-full bg-gray-200`:`relative mt-2 ${H} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[O&&
|
|
3
|
+
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${S?S.fill:"bg-gray-400"}`,style:{width:`${L}%`}}),R&&null!=D&&null!=E&&/* @__PURE__ */o(d,{at:x(E/D*100),title:j.warningAt(E),className:i.warning}),R&&null!=D&&null!=G&&/* @__PURE__ */o(d,{at:x(G/D*100),title:j.criticalAt(G),className:i.critical})]}),T=S?S.ink:null!=C?"text-gray-900":"text-gray-400";if(z){const a="lg"===k;/* @__PURE__ */
|
|
4
4
|
return c("div",{className:M,children:[null!=h&&/* @__PURE__ */o("div",{className:(a?"text-xs":"text-3xs")+" font-medium uppercase tracking-wide text-gray-500",children:h}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
6
|
-
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${
|
|
7
|
-
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=
|
|
6
|
+
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${T}`,children:P}),
|
|
7
|
+
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=C?N:B})]}),Q]})}/* @__PURE__ */
|
|
8
8
|
return c("div",{className:M,children:[
|
|
9
9
|
/* @__PURE__ */c("div",{className:"flex items-baseline gap-2",children:[null!=h&&/* @__PURE__ */o("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:h}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${
|
|
11
|
-
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=
|
|
10
|
+
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${T}`,children:P}),
|
|
11
|
+
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=C?N:B})]}),Q]})}export{h as MetricBar};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{SearchableSelect as e}from"./chunk-
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-BD4OHYQB.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-HY3JYAUH.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-56ESGDIC.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{Icon as o}from"./chunk-MRFNJZRR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-43MCNASD.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:A}=t,E=void 0!==t.onApply,$=u().link,D=y.isSafe??k,Y=d(),z=c(null),T=c(null),[H,R]=p({url:n}),U=E?H.url:n,[B,K]=p(!1),[M,Q]=p(null),[S,V]=p(null),[P,W]=p(!1),X=c(null),Z=c(()=>{});Z.current=E?t.onCancel:()=>{},m(()=>{if(E)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>z.current)},[E]),m(()=>{if(!E)return;const e=T.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const J=o??[{value:b,label:$.address,target:{type:"text"}}],L=M&&M.against===U?M.kind:y.kindOf(U),q=J.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),G=q.find(e=>"text"===e.target.type),I=q.find(e=>e.value===L)??G??q[0];if(!I)return null;const _="text"!==I.target.type,ee=_?y.targetOf(U):U,ae=h(I.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===I.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(U):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=S&&S.against===U?S.text:U,se=_?U:j?j(oe.trim()).trim():oe.trim(),ue=E&&j?se:oe,de=!_&&""!==ue.trim()&&!D(ue),ce=de&&(!E||B);_&&P&&W(!1);const pe=(e,a)=>{E?R({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{Q(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{K(!1);const a=e.trim();a?D(e)?(V({text:e,against:a}),me(a)):V({text:e,against:U}):(V({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===T.current||X.current?.contains(a)))return;if(W(!1),E||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!E||!se)return;if(!_&&de)return void K(!0);const e=_&&H.url===se?H.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
2
|
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
-
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===
|
|
4
|
-
return f("div",{ref:
|
|
5
|
-
return v("div",{ref:
|
|
6
|
-
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children
|
|
3
|
+
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===I.target.type)ke=/* @__PURE__ */f(r,{ref:T,id:`${Y}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${Y}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>W(!0),onBlur:ge,onKeyDown:j&&!E?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===I.target.type?I.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):I.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:I.target.placeholder},...be(e,ee)];ke=xe(I.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,I.value,q.map(e=>({value:e.value,label:e.label})),e=>{V(null),K(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void Q({kind:e,against:U});const l=h(a.target)[0];Q({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,A&&P&&!C&&"text"===I.target.type&&/* @__PURE__ */f("div",{ref:X,onBlur:ge,children:A({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${Y}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),I.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:I.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!E)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:z,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${Y}-address`,className:a({inline:!0}),children:$.title}),ye,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
|
|
7
7
|
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
-
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>
|
|
9
|
-
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
10
|
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
11
|
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
12
|
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-WGLHB6WE.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-
|
|
2
|
-
return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[
|
|
1
|
+
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-WGLHB6WE.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-43MCNASD.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
|
|
2
|
+
return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[S,$]=l({}),N=o(null),[z,A]=l({}),O=o(null),[T,K]=l(null),[R,P]=l(null),[F,H]=l(null),[I,j]=l(null),[W,X]=l(null),Y=o(null);n(()=>{const e=Y.current;if(!e||e.row!==W?.row||e.col!==W?.col)return;Y.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[W]);const[q,B]=l(null),[G,_]=l(null);c(()=>{D?.(q&&G?{anchor:q,end:G}:null)},[q,G,D]);const J=o(!1),[U,V]=l(null),Q=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:G};const ee=q&&G&&(q.row!==G.row||q.col!==G.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}J.current=!0,e.shiftKey&&q||B({row:t,col:n}),_({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{J.current&&_({row:e,col:t})},[]);c(()=>{const e=()=>{J.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!G)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,G.row),r=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,G,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),_({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&G){const t=Math.min(q.row,G.row),n=Math.max(q.row,G.row),r=Math.min(q.col,G.col),o=Math.max(q.col,G.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),X(null),B({row:o,col:l}),_({row:o,col:l}))}},[e,te,te.length,ne,q,G,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>S[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!N.current)return;const t=e.clientX-N.current.startX,n=Math.max(40,N.current.startW+t);$(e=>({...e,[N.current.col]:n}))},n=()=>{if(N.current&&p){const t=e.map((e,t)=>({...e,width:S[t]??e.width}));t[N.current.col]={...t[N.current.col],width:S[N.current.col]??e[N.current.col].width},p(t)}N.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,S,p]);const pe=e=>z[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);A(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if($(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:S[n]??e.width}));p(n)}},[te,e,S,p]),ye=a(e=>{A(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),_({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!Q.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);V({row:r,col:o})},t=()=>{Q.current&&U&&ve(U),Q.current=!1,V(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[U,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),Q.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,Se=Le?Math.max(0,Math.floor(De/28)-20):0,$e=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ne=s(()=>te.slice(Se,$e),[te,Se,$e]),ze=28*Se,Ae=28*(te.length-$e),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
|
|
3
3
|
return u("div",{ref:Me,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:v,height:v},onScroll:e=>ke(e.target.scrollTop),children:[
|
|
4
4
|
/* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+fe(e.indexOf(n)),0)},children:[
|
|
5
5
|
/* @__PURE__ */u("colgroup",{children:[
|
|
6
6
|
/* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:fe(t)}},e.key))]}),
|
|
7
7
|
/* @__PURE__ */h("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */u("tr",{children:[
|
|
8
|
-
/* @__PURE__ */h("th",{className:`${t} ${
|
|
9
|
-
return u("th",{className:`${t} ${
|
|
10
|
-
/* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),
|
|
11
|
-
/* @__PURE__ */u("tbody",{children:[
|
|
8
|
+
/* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),_({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&G&&Math.min(q.col,G.col)<=r&&r<=Math.max(q.col,G.col)&&0===Math.min(q.row,G.row)&&Math.max(q.row,G.row)===te.length-1;/* @__PURE__ */
|
|
9
|
+
return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),j(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void j(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}H(null),j(null)})(r),onDragEnd:()=>{H(null),j(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),_({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
|
|
10
|
+
/* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),N.current={col:t,startX:e.clientX,startW:fe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]},n.key)})]})}),
|
|
11
|
+
/* @__PURE__ */u("tbody",{children:[ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}}),Ne.map((t,n)=>{const r=Se+n,o=q&&G&&Math.min(q.row,G.row)<=r&&r<=Math.max(q.row,G.row)&&0===Math.min(q.col,G.col)&&Math.max(q.col,G.col)===e.length-1;/* @__PURE__ */
|
|
12
12
|
return u("tr",{style:{height:pe(r)},children:[
|
|
13
|
-
/* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${
|
|
14
|
-
/* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),
|
|
15
|
-
return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||
|
|
16
|
-
/* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||
|
|
13
|
+
/* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>K(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===T||T===e)return K(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(T,1);t.splice(e,0,n),f(t),K(null),P(null)})(r),onDragEnd:()=>{K(null),P(null)},onClick:t=>{t.shiftKey&&q||B({row:r,col:0}),_({row:r,col:e.length-1})},onContextMenu:e=>me(e,r),children:[r+1,
|
|
14
|
+
/* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&G&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,G,r,n),l=W?.row===r&&W?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&G?Math.max(q.row,G.row):-1,i=q&&G?Math.max(q.col,G.col):-1,d=q&&G&&r===s&&n===i,w=Q.current&&U&&q&&G&&(()=>{const e=Math.min(q.row,G.row),t=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col);let c=e,a=t,s=o,i=l;return U.row>t?a=U.row:U.row<e&&(c=U.row),U.col>l?i=U.col:U.col<o&&(s=U.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
|
|
15
|
+
return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||X({row:r,col:n})},children:[
|
|
16
|
+
/* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||X({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),J.current||(B({row:r,col:n}),_({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),X(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),Y.current={row:r,col:n},void X({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ae>0&&/* @__PURE__ */h("tr",{style:{height:Ae}})]})]}),se&&i(
|
|
17
17
|
/* @__PURE__ */u(d,{children:[
|
|
18
18
|
/* @__PURE__ */h("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ie(null)}),
|
|
19
19
|
/* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:se.x,top:se.y},children:se.items.map((e,t)=>/* @__PURE__ */h("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{g as EditableGrid,w as withSpareRow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-43MCNASD.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:i}),
|
|
4
4
|
/* @__PURE__ */r("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:d.title}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-YXSGMPNW.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],N=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,W=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Y=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Q(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Y.exec(n.trim()),i=e&&Q(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,N,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,N,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,N,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(W,"[url]").replace(V,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
1
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-S3C3XJG7.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(X,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(X,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-53EW4M5S.js";import{Segmented as a}from"./chunk-S4FPYCUU.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-QBD7V4TK.js";import{TransferProgress as u}from"./chunk-HNQKXOFU.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-7KIDOIPY.js";import{Icon as p}from"./chunk-MRFNJZRR.js";import{useShellStrings as b}from"./chunk-43MCNASD.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:F,label:U,hint:C,error:O,required:P,className:$,accept:z="image/*",maxSizeBytes:K,fit:S="cover",height:B=112,placeholder:D,cta:H,acceptHint:I,showFilename:q=!0,allowReplace:M=!0,allowRemove:W=!0,replaceLabel:Y,removeLabel:A,busy:Q=!1,busyLabel:V,choosingLabel:_,pickFailedLabel:E,progress:J,disabled:T=!1,kind:X,onKindChange:Z,focus:G,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,oe=X??(/video/.test(z)&&!/image/.test(z)?"video":"image"),re="string"==typeof A&&A?A:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=Q||ne,me=ne&&!Q?_??ie.choosing:V??ie.uploading,he=O??(se?E??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=T||ue,ke=!!w&&(t(w,z)||w===ve),Ne=D??o(z,ie),je=Y??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{R?pe(e):F?F(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:z,maxSizeBytes:K,acceptHint:I,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Fe=w?r(w):"",Ue=!ke&&!!ee,Ce=T||!M&&!W?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[M&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
|
|
2
|
+
/* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),W&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ue?void 0:{height:B},children:[Ue?
|
|
4
|
+
/* @__PURE__ */N(e,{value:G??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Fe||void 0,className:"h-full w-full",style:{objectFit:S}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Fe,className:"h-full w-full",style:{objectFit:S,objectPosition:G||void 0}}),q&&w&&/* @__PURE__ */N(n,{children:Fe}),Ce,ue&&/* @__PURE__ */N(l,{label:me,progress:J,rounded:"rounded-md"})]}),Pe=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":P||void 0,"aria-describedby":he?`${be}-error`:C?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:B},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:J}):/* @__PURE__ */k(j,{children:[
|
|
5
|
+
/* @__PURE__ */N("span",{className:"text-ink-faintest",children:/* @__PURE__ */N(s,{})}),
|
|
6
|
+
/* @__PURE__ */N("span",{className:"px-3 text-xs text-ink-faint",children:Ne}),
|
|
7
|
+
/* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),I&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:I})]})});/* @__PURE__ */
|
|
8
|
+
return k(i,{label:U,htmlFor:be,hint:C,error:he,required:P,className:$,children:[Z&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(a,{value:oe,onChange:e=>Z(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Oe:Pe,!R&&/* @__PURE__ */N("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */N(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-M7DFM2N7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-XQUXL75F.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-MRFNJZRR.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),L=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),R=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),_=n(()=>L.map(e=>({...e,docs:e.docs.filter(R)})).filter(e=>e.docs.length>0),[L,M]),A=n(()=>_.flatMap(e=>e.docs),[_]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,Y=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
|
|
2
2
|
return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===
|
|
9
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=Y(e.key);/* @__PURE__ */
|
|
10
10
|
return i("div",{className:"py-0.5",children:[
|
|
11
11
|
/* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!Y(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */o(d,{open:t}),
|
|
13
|
-
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=
|
|
13
|
+
/* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|
|
15
15
|
/* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
16
|
-
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:
|
|
16
|
+
/* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
|
|
17
17
|
/* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
18
18
|
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
19
|
-
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:
|
|
20
|
-
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[
|
|
21
|
-
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(
|
|
19
|
+
/* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
|
|
20
|
+
/* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
|
|
21
|
+
/* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-
|
|
2
|
-
return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[
|
|
1
|
+
import{IconPicker as e}from"./chunk-VGWYAYHB.js";import{ColorPicker as t}from"./chunk-AQULCKKZ.js";import{InputNumber_default as r}from"./chunk-ZYFBV4C7.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as l}from"./chunk-MRFNJZRR.js";import{jsxs as a,Fragment as i,jsx as s}from"react/jsx-runtime";var n=["top","right","bottom","left"];function d(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function m(e,t){const r=e??{},o=d(t),l=n.some(e=>"number"==typeof r[e]),a=n.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:l?0:o[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(l,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(l,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(l,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(l,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(l,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(l,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(l,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(l,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:l,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:g=!0,min:y=0,max:N=20,step:v=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const r={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(r[e]=d.width);r[e]=t,delete r.width,m(r)},C=(e,t,o,l,a,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(r,{value:l,onChange:i,min:y,max:N,step:v,precision:0,steppers:"compact",readOnly:x,placeholder:a,prefix:o,suffix:b.unit,"aria-label":t})}),S=n.map(j),O="number"==typeof d.width?d.width:S.every(e=>null!==e&&e===S[0])?S[0]:null,R=null===O&&S.some(e=>null!==e),Y=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",Z=e=>j(e)??("number"==typeof d.width?d.width:null),A=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[C("left",b.sides.left,h.left,Z("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,Z("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,Z("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,Z("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,O,R?"–":Y,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,g&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{label:b.style,value:A,disabled:x,onChange:e=>{x||m({...d,style:e})},options:o.map(e=>({value:e,label:b.styles[e],icon:p[e]}))})}),
|
|
3
3
|
/* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{u as BorderInput,d as borderSides,m as borderStartEach};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-C4XV42QP.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as s}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-MRFNJZRR.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-43MCNASD.js";import{useRef as f,useId as h,useState as x,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var N={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function j({open:j,onClose:w,title:C,description:D,role:W="dialog",children:J,footer:L,blocking:T=!1,size:V="md",aside:A=!1,dirty:F=!1,initialFocus:P,"aria-label":Q,"aria-labelledby":R,"aria-describedby":S,className:U=""}){const X=f(null),$=h(),z=h(),G=!T,I=h(),M=p().dialog,Z=e(m()),[B,H]=x(null),K=l({open:j,dirty:F,onClose:w,title:C,layer:B}),Y=f(null),q=r(j&&null!==Z,Y),E=i(q,X);if(o(j),n(X,j&&null!==Z,P),s(j),v(()=>{if(j)return u(()=>(T||K(),!0),()=>X.current)},[j,T,K]),!j||!Z)return null;/* @__PURE__ */
|
|
2
|
+
return y(g,{children:[/* @__PURE__ */k("span",{ref:Y,hidden:!0,"data-popup-anchor":""}),b(
|
|
3
|
+
/* @__PURE__ */k(t,{value:B,children:/* @__PURE__ */y("div",{ref:H,className:"fixed inset-0"+(A?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":A?"":void 0,children:[
|
|
4
|
+
/* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */k("div",{className:q?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:T?void 0:e=>{e.target===e.currentTarget&&K()},children:/* @__PURE__ */y("div",{ref:X,"data-popup-panel":"",style:q?{left:E?.left??0,top:E?.top??0,visibility:E?void 0:"hidden"}:void 0,...a({role:W,modal:!0,titleId:C?I:void 0,labelledBy:R,label:Q}),"aria-describedby":S??(D?z:J?$:void 0),className:`${q?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${N[V]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${U}`.trim(),children:[C&&/* @__PURE__ */k("h2",{id:I,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:C}),D&&/* @__PURE__ */k("p",{id:z,className:((C?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:D}),J&&/* @__PURE__ */k("div",{id:$,className:"mt-2 text-sm text-gray-600",children:J}),L&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:L}),G&&/* @__PURE__ */k("button",{type:"button",onClick:K,"aria-label":M.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),Z)]})}export{j as Dialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-EOGXCGQF.js";import{Textarea_default as a}from"./chunk-PB7G6CJ7.js";import{Radio_default as l}from"./chunk-NI5FXWK5.js";import{Select_default as r}from"./chunk-HY3JYAUH.js";import{FormField as n}from"./chunk-6KBDNYRW.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Input_default as c}from"./chunk-56ESGDIC.js";import{Button_default as o}from"./chunk-EOVXFXVV.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
3
3
|
/* @__PURE__ */d("div",{children:[
|
|
4
4
|
/* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-ZYFBV4C7.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as r}from"./chunk-MRFNJZRR.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";var d="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */t(r,{name:"padding-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"padding-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"padding-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"padding-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"padding-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"padding-left-right","aria-hidden":"true",className:d})},crop:{top:/* @__PURE__ */t(r,{name:"crop-top","aria-hidden":"true",className:d}),right:/* @__PURE__ */t(r,{name:"crop-right","aria-hidden":"true",className:d}),bottom:/* @__PURE__ */t(r,{name:"crop-bottom","aria-hidden":"true",className:d}),left:/* @__PURE__ */t(r,{name:"crop-left","aria-hidden":"true",className:d}),vertical:/* @__PURE__ */t(r,{name:"crop-y","aria-hidden":"true",className:d}),horizontal:/* @__PURE__ */t(r,{name:"crop-left-right","aria-hidden":"true",className:d})}},l=/* @__PURE__ */t(r,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var m=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function c(e,a){const r=r=>m(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function h({label:a,value:r,onChange:i,each:d,placeholder:l,words:c,min:h=0,max:p=200,step:u=4,readOnly:g,glyphs:f="padding"}){const N=s[f],b=(a,n,o)=>{const d=function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(r,a),s=a.map(e=>m(r,l,e)),f="mixed"!==d&&s.every(e=>e===s[0])?s[0]:"–";/* @__PURE__ */
|
|
2
2
|
return t("div",{"data-side":a.join("-"),className:"min-w-0",children:/* @__PURE__ */t(e,{value:"mixed"===d?null:d,onChange:e=>((e,a)=>{const t={...r};for(const r of e)t[r]=a;i(t)})(a,e),min:h,max:p,step:u,snap:!0,precision:0,steppers:"compact",readOnly:g,placeholder:f,prefix:o,suffix:c.unit,"aria-label":n})})};/* @__PURE__ */
|
|
3
3
|
return t("div",{role:"group","aria-label":a,"data-sides":d?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */n(o,d?{children:[b(["left"],c.sides.left,N.left),b(["top"],c.sides.top,N.top),b(["right"],c.sides.right,N.right),b(["bottom"],c.sides.bottom,N.bottom)]}:{children:[b(["left","right"],c.horizontal,N.horizontal),b(["top","bottom"],c.vertical,N.vertical)]})})}function p({each:e,onChange:r,label:n,disabled:o}){/* @__PURE__ */
|
|
4
4
|
return t(i,{content:n,children:/* @__PURE__ */t(a,{size:"md","aria-label":n,"aria-pressed":e,disabled:o,onClick:()=>r(!e),children:l})})}export{p as SidesEachToggle,h as SidesInput,c as sidesStartEach};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Banner as e}from"./chunk-
|
|
1
|
+
import{Banner as e}from"./chunk-JCUG572K.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
|
|
2
2
|
return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
|
|
4
4
|
/* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-43MCNASD.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
|
|
2
2
|
return i("div",{className:n,children:/* @__PURE__ */s("svg",{width:"100%",height:o,viewBox:`0 0 ${a} ${o}`,role:"img","aria-label":p,"aria-busy":"true",children:[
|
|
3
3
|
/* @__PURE__ */i("defs",{children:/* @__PURE__ */s("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
4
4
|
/* @__PURE__ */i("stop",{offset:"0%",stopColor:r.surface,stopOpacity:"0"}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-GEYM4WN3.js";import{formatDateTime as o}from"./chunk-Y3JW2GW5.js";import{useShellLocale as c}from"./chunk-
|
|
1
|
+
import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-GEYM4WN3.js";import{formatDateTime as o}from"./chunk-Y3JW2GW5.js";import{useShellLocale as c}from"./chunk-43MCNASD.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
|
|
2
2
|
return i("time",{dateTime:u,title:o(u,{locale:s??a}),className:l,children:t(p,{precise:n,locale:s??a})})}export{m as TimeAgo};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return t("div",{id:
|
|
3
|
-
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:
|
|
4
|
-
/* @__PURE__ */s("div",{ref:
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-ZYFBV4C7.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{Icon as a}from"./chunk-MRFNJZRR.js";import{Tooltip as i}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{useState as l,useRef as o}from"react";import{jsxs as t,jsx as s}from"react/jsx-runtime";var d={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function u({label:u,value:m,corners:f,onChange:p,radius:h=null,onRadiusChange:v,radiusLabel:b,radiusMin:k=0,radiusMax:g,radiusStep:x=1,radiusPlaceholder:w,disabled:y=!1,disabledReason:N,id:A,className:R=""}){const j=n(),C=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(f),[M,K]=l(0),L=o(null);/* @__PURE__ */
|
|
2
|
+
return t("div",{id:A,role:"group","aria-label":u,className:`flex min-w-0 flex-wrap items-center gap-2 ${R}`.trim(),children:[v&&
|
|
3
|
+
/* @__PURE__ */s("div",{className:"w-30 shrink-0",children:/* @__PURE__ */s(e,{value:h,onChange:v,min:k,max:g,step:x,precision:0,placeholder:w,prefix:/* @__PURE__ */s("span",{"data-radius-mark":"","aria-hidden":"true",children:j.corners.radiusMark}),suffix:j.corners.unit,steppers:"compact",disabled:y,"aria-label":b??j.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */s("div",{ref:L,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(L.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:C.map((e,n)=>{const l=m.includes(e.value),o=y||!0===e.disabled,t=o&&(!0===e.disabled&&e.title||(y?N:void 0))||void 0,c=/* @__PURE__ */s(r,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":o||void 0,disabledReason:t,"data-corner":e.value,size:"sm",tabIndex:n===M?0:-1,onFocus:()=>K(n),onClick:()=>{o||p(l?m.filter(r=>r!==e.value):[...m,e.value])},children:/* @__PURE__ */s(a,{name:"corner",strokeWidth:2,className:["h-4 w-4",d[e.value]??""].filter(Boolean).join(" ")})},e.value);return t?c:/* @__PURE__ */s(i,{content:e.title??e.label,children:c},e.value)})})]})}export{u as CornersInput};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
2
|
-
return t(C,{className:M,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...
|
|
3
|
-
/* @__PURE__ */t("div",{className:`${
|
|
4
|
-
/* @__PURE__ */a("p",{id:v,className:
|
|
5
|
-
/* @__PURE__ */t("div",{className:`${
|
|
6
|
-
/* @__PURE__ */a(j,{id:N,className:
|
|
1
|
+
import{useShellLocale as e}from"./chunk-43MCNASD.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,A=w||k,C=A?"section":"div",M=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),B=n.toArray(e).length>0,D=B?"border-b border-line-subtle ":"",H="current"===f,L=H?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",O=H?"rounded-t-(--radius-card) bg-accent-tint ":"",Q=`${D}${O}${y.edge} ${L}`;/* @__PURE__ */
|
|
2
|
+
return t(C,{className:M,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...H?{"aria-current":!0}:{},children:[$?
|
|
3
|
+
/* @__PURE__ */t("div",{className:`${D}${O}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${L}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:L,children:r}):/* @__PURE__ */a("div",{className:L,children:r}),
|
|
4
|
+
/* @__PURE__ */a("p",{id:v,className:H?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
|
|
5
|
+
/* @__PURE__ */t("div",{className:`${Q} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
|
|
6
|
+
/* @__PURE__ */a(j,{id:N,className:Q,children:r}):/* @__PURE__ */a("div",{className:Q,children:r})),B&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
|
|
7
7
|
return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
|
|
8
8
|
/* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
|
|
9
9
|
/* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-
|
|
2
|
-
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-SX5CSXZO.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-43MCNASD.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),A=Math.max(...v),L=.08*(A-j)||1;/* @__PURE__ */
|
|
2
|
+
return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-L,max:A+L,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
|
|
3
3
|
return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:u?.45:1,children:[
|
|
5
5
|
/* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-CNVYM3HP.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|