efficient-shell 13.21.0 → 13.22.1
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 +13 -0
- package/dist/{Browser-AE7OYSTS.js → Browser-ZNJ3OZSE.js} +13 -13
- package/dist/Calculator-BPQPQUZN.js +29 -0
- package/dist/CurrencyConverter-M4UJI6VQ.js +21 -0
- package/dist/{Files-Y5UGT3RX.js → Files-4HACSJ7C.js} +77 -77
- package/dist/Notepad-SK2E5VOK.js +24 -0
- package/dist/{PdfViewer-EELX35ZI.js → PdfViewer-FWGHFO4N.js} +1 -1
- package/dist/{PomodoroTimer-6XHLOAJD.js → PomodoroTimer-BR5NOA24.js} +48 -48
- package/dist/{Preview-XQXSRAGY.js → Preview-CLV2ZAU5.js} +26 -26
- package/dist/Sidebar-MY66ILZY.js +44 -0
- package/dist/{Stock-36O4LW46.js → Stock-LZ2QHPU4.js} +3 -3
- package/dist/{Weather-BN6AJJ4S.js → Weather-Q22ZW7ZQ.js} +20 -20
- package/dist/{WorldClock-TUVIRPTM.js → WorldClock-4MSSRLC7.js} +6 -6
- package/dist/ai/index.js +118 -118
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/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-23YQNCZ4.js +23 -0
- package/dist/chunk-2AEYVQ2R.js +2 -0
- package/dist/{chunk-MVOYVN3S.js → chunk-2YHS5E27.js} +1 -1
- package/dist/{chunk-X4E4RPFE.js → chunk-2YUAR2EH.js} +5 -5
- package/dist/{chunk-MUNP5Z24.js → chunk-3AMCLA5Q.js} +1 -1
- package/dist/{chunk-PPLPDP6D.js → chunk-3AUN7JSM.js} +1 -1
- package/dist/{chunk-FDDM7VMQ.js → chunk-3BQMICGG.js} +1 -1
- package/dist/{chunk-NILGK2KJ.js → chunk-3EYJ4G7L.js} +1 -1
- package/dist/{chunk-FXSGIT53.js → chunk-3GJVTK4H.js} +8 -8
- package/dist/chunk-3SIHJWR2.js +28 -0
- package/dist/chunk-3SKXWFGG.js +15 -0
- package/dist/{chunk-XD3M5ZXM.js → chunk-3TD3GH53.js} +6 -6
- package/dist/{chunk-4U5M37SF.js → chunk-4PJFL26P.js} +1 -1
- package/dist/{chunk-NA4XPE7S.js → chunk-53HHYEN4.js} +3 -3
- package/dist/{chunk-OF5X4HKC.js → chunk-5JUXMNUC.js} +1 -1
- package/dist/{chunk-TB2ARUE2.js → chunk-5OHFBS2B.js} +1 -1
- package/dist/chunk-5ZOYYL46.js +4 -0
- package/dist/{chunk-TPKNHQIE.js → chunk-66NJCU4W.js} +8 -8
- package/dist/{chunk-BCQSNK2Z.js → chunk-6CFI4YGI.js} +4 -4
- package/dist/{chunk-LKAGXURQ.js → chunk-6MFKKTCE.js} +17 -17
- package/dist/{chunk-QNWC3RWK.js → chunk-6NXPOZ6X.js} +1 -1
- package/dist/{chunk-F4VILY3O.js → chunk-72UHB4JU.js} +1 -1
- package/dist/{chunk-7I5RJPY7.js → chunk-7AVPMO4F.js} +1 -1
- package/dist/{chunk-KYQKMBSY.js → chunk-7B6JPNOD.js} +5 -5
- package/dist/{chunk-JB4WXBJB.js → chunk-7G5HKAGV.js} +5 -5
- package/dist/{chunk-SUSJFGXN.js → chunk-7N42VDGT.js} +9 -9
- package/dist/{chunk-J4CVYOY3.js → chunk-7N6CVTWO.js} +10 -10
- package/dist/{chunk-YCXQDUTW.js → chunk-7PAZO65L.js} +6 -6
- package/dist/{chunk-4G7PJ325.js → chunk-A5FC4LR7.js} +1 -1
- package/dist/{chunk-G5UGCAWN.js → chunk-A6TOHNJY.js} +1 -1
- package/dist/{chunk-HPZLV3KD.js → chunk-AFYLMXOJ.js} +5 -5
- package/dist/{chunk-XAT2MKNU.js → chunk-AH2NEKEN.js} +4 -4
- package/dist/{chunk-G7SILKUY.js → chunk-AQVPWUJ3.js} +5 -5
- package/dist/{chunk-63E4ZZYI.js → chunk-BEXFMSNK.js} +2 -2
- package/dist/{chunk-HOROMBJB.js → chunk-BL347U3N.js} +6 -6
- package/dist/{chunk-SOXZRLSD.js → chunk-BUMY4LIP.js} +3 -3
- package/dist/{chunk-OUYGLDQN.js → chunk-BUUAALHH.js} +7 -7
- package/dist/{chunk-7CBWSLCW.js → chunk-C7Z3ZMJH.js} +12 -12
- package/dist/{chunk-SF4IIV5Z.js → chunk-CJQPC2P3.js} +2 -2
- package/dist/{chunk-5POQCJL6.js → chunk-CUJ537IY.js} +4 -4
- package/dist/{chunk-E7BQZL7X.js → chunk-D4432YRW.js} +1 -1
- package/dist/{chunk-RDVC32EV.js → chunk-D5HFWOW7.js} +16 -16
- package/dist/{chunk-GEITUFYK.js → chunk-D5PXRJHA.js} +19 -19
- package/dist/{chunk-VRJKV44O.js → chunk-DAUE6ULT.js} +1 -1
- package/dist/chunk-DEE6FKE7.js +92 -0
- package/dist/{chunk-YWMCW5BN.js → chunk-DTRJLQWO.js} +1 -1
- package/dist/{chunk-WJMPTW3G.js → chunk-DV6TUXCZ.js} +1 -1
- package/dist/{chunk-23LK4PLJ.js → chunk-E4GF7M4S.js} +8 -8
- package/dist/chunk-EJJTDUN3.js +22 -0
- package/dist/{chunk-RA2UNNJC.js → chunk-F3EBYHIE.js} +10 -10
- package/dist/chunk-FBI3XJWH.js +11 -0
- package/dist/{chunk-WJTNQ7YD.js → chunk-FE7H6RXE.js} +2 -2
- package/dist/{chunk-YQ5JHHLE.js → chunk-FMBUR4EU.js} +1 -1
- package/dist/{chunk-IOLUF3UL.js → chunk-GKYGPCGL.js} +1 -1
- package/dist/{chunk-Q4MOT7TY.js → chunk-GPU7LLTJ.js} +1 -1
- package/dist/{chunk-ZCGT5YNR.js → chunk-GRAFJD3L.js} +1 -1
- package/dist/{chunk-L4ZQY4ZG.js → chunk-GZRNOIEE.js} +3 -3
- package/dist/{chunk-VQ35LXDC.js → chunk-I2NVBDKH.js} +1 -1
- package/dist/{chunk-EZYXY67W.js → chunk-IJG4UEKF.js} +8 -8
- package/dist/{chunk-3SIRRK3F.js → chunk-J5OAQAAD.js} +4 -4
- package/dist/{chunk-SZFULV7I.js → chunk-J5W63XNR.js} +6 -6
- package/dist/{chunk-GNRH43N3.js → chunk-JJYTN72U.js} +2 -2
- package/dist/{chunk-HMOKKMIV.js → chunk-JLSXDYS4.js} +2 -2
- package/dist/{chunk-EFVQQF6F.js → chunk-JXJNQHPY.js} +19 -19
- package/dist/{chunk-HPHDLN6E.js → chunk-JYR4V4AG.js} +2 -2
- package/dist/{chunk-EG5MU7XL.js → chunk-JZ43635V.js} +1 -1
- package/dist/{chunk-KQCJWK55.js → chunk-KC2EQCBE.js} +6 -6
- package/dist/chunk-KUPN5WRE.js +1 -0
- package/dist/{chunk-P52LXNUU.js → chunk-L744YF4X.js} +1 -1
- package/dist/{chunk-SXHV5OLA.js → chunk-LC2UF3AA.js} +1 -1
- package/dist/{chunk-GUSENWAH.js → chunk-LLDGRPLF.js} +1 -1
- package/dist/{chunk-KNZ7YTFH.js → chunk-LLSGIMLG.js} +1 -1
- package/dist/{chunk-JPSWWIBW.js → chunk-LQIHBIXG.js} +6 -6
- package/dist/{chunk-UC5IC3AM.js → chunk-LRMDLZMM.js} +9 -9
- package/dist/{chunk-SHHRC5XK.js → chunk-LUARJHUK.js} +9 -9
- package/dist/chunk-M36B3M2H.js +8 -0
- package/dist/{chunk-2J3C2RR4.js → chunk-M3HTP2N6.js} +6 -6
- package/dist/{chunk-BZRFD4DK.js → chunk-M4REKOGO.js} +1 -1
- package/dist/{chunk-ZNV75GAG.js → chunk-MEFB2KGF.js} +1 -1
- package/dist/{chunk-U2ZTHOQL.js → chunk-MMA3WTF2.js} +4 -4
- package/dist/chunk-MRZLFZNJ.js +6 -0
- package/dist/chunk-N64YAF5N.js +2 -0
- package/dist/chunk-N6PMH6DU.js +6 -0
- package/dist/chunk-NRHG4R2Q.js +1 -0
- package/dist/{chunk-G2JPTPRS.js → chunk-OFMZ6JM6.js} +13 -13
- package/dist/chunk-ONWFKCMB.js +14 -0
- package/dist/{chunk-XWJT6TFU.js → chunk-OSMRYND3.js} +1 -1
- package/dist/{chunk-6OCA7RKQ.js → chunk-P234FPKJ.js} +1 -1
- package/dist/{chunk-IUQJGFEO.js → chunk-P3JPSO3E.js} +8 -8
- package/dist/{chunk-ZVDYRXNP.js → chunk-P4VOUPRF.js} +6 -6
- package/dist/{chunk-ENDYHUUR.js → chunk-P73ZJ6QR.js} +1 -1
- package/dist/{chunk-5HFKVEWW.js → chunk-PFOTEDSQ.js} +1 -1
- package/dist/{chunk-H75CQD46.js → chunk-PHYHKDSW.js} +1 -1
- package/dist/{chunk-FBS55WOX.js → chunk-PLESHI3E.js} +7 -7
- package/dist/{chunk-42DF7CDB.js → chunk-PPI4WJ3V.js} +7 -7
- package/dist/{chunk-M2TQOJ3G.js → chunk-PSVGB7KT.js} +1 -1
- package/dist/{chunk-223XYIIH.js → chunk-Q2RNFBYS.js} +1 -1
- package/dist/{chunk-6OGX7V7L.js → chunk-Q36KB5RQ.js} +7 -7
- package/dist/{chunk-WPGSU4QG.js → chunk-Q7CM4UDG.js} +2 -2
- package/dist/{chunk-BVX7LUAW.js → chunk-QJUMBOL2.js} +6 -6
- package/dist/{chunk-25T4YQO7.js → chunk-QPVYBN4J.js} +2 -2
- package/dist/{chunk-FUPU7Z2G.js → chunk-QRPPWLKU.js} +7 -7
- package/dist/{chunk-7SVSHJOO.js → chunk-QZ2XRFDP.js} +6 -6
- package/dist/{chunk-IE6TRMIW.js → chunk-R3BSWWGB.js} +1 -1
- package/dist/{chunk-CCLK2RPQ.js → chunk-R7CYBBJY.js} +13 -13
- package/dist/{chunk-FFRJ6QZK.js → chunk-RB3BMRNA.js} +1 -1
- package/dist/{chunk-FZYUTZEV.js → chunk-RFWBNKKB.js} +10 -10
- package/dist/{chunk-S25KELFW.js → chunk-RKSCB5BJ.js} +5 -5
- package/dist/{chunk-F3E3CEZM.js → chunk-RM2I6DIF.js} +1 -1
- package/dist/{chunk-QBMMORYP.js → chunk-ROYHU3E5.js} +1 -1
- package/dist/chunk-S4RD6UJU.js +8 -0
- package/dist/{chunk-RDETBXMP.js → chunk-SAHRIE35.js} +1 -1
- package/dist/{chunk-MOKABQCY.js → chunk-SAMPXZF3.js} +3 -3
- package/dist/{chunk-W2TPXKCV.js → chunk-SCNQK5NF.js} +1 -1
- package/dist/{chunk-ABTVRB23.js → chunk-SKVLTYGN.js} +1 -1
- package/dist/{chunk-SM3N5UJ2.js → chunk-TDUOBP55.js} +9 -9
- package/dist/{chunk-BG3C4ALM.js → chunk-TJ5YMXVB.js} +1 -1
- package/dist/{chunk-VFSAJMNX.js → chunk-TNGIXSTM.js} +1 -1
- package/dist/{chunk-BNPWUCZX.js → chunk-TSCJG6UM.js} +1 -1
- package/dist/{chunk-ETQ45TBW.js → chunk-TTYTOLVV.js} +1 -1
- package/dist/{chunk-DO3DSSAW.js → chunk-U73K3ICC.js} +1 -1
- package/dist/{chunk-FRCTA5FS.js → chunk-UAXL44HH.js} +1 -1
- package/dist/{chunk-CWVQH2SP.js → chunk-UDJPSHVI.js} +1 -1
- package/dist/{chunk-L2WBCXG7.js → chunk-UFJR63AO.js} +1 -1
- package/dist/{chunk-YT5HMLC7.js → chunk-UJY5RUZ5.js} +1 -1
- package/dist/{chunk-R6GXVLY7.js → chunk-UMIRPFQJ.js} +1 -1
- package/dist/{chunk-WRV6QKJN.js → chunk-UVPDEGIA.js} +1 -1
- package/dist/{chunk-KEVJBI5Q.js → chunk-VTCMO3K7.js} +1 -1
- package/dist/{chunk-2TXQCA4C.js → chunk-W24THMLI.js} +8 -8
- package/dist/{chunk-VXSYHTBP.js → chunk-W3454ZES.js} +1 -1
- package/dist/{chunk-EFO72DEI.js → chunk-WCAABJEV.js} +1 -1
- package/dist/{chunk-OZ4R6U2M.js → chunk-WREUA43Q.js} +1 -1
- package/dist/{chunk-ELPW25CA.js → chunk-XX34ZFYB.js} +4 -4
- package/dist/chunk-XYQFTFI7.js +24 -0
- package/dist/{chunk-UFX7F3KG.js → chunk-XYVFJLAU.js} +1 -1
- package/dist/{chunk-A7VNKVZO.js → chunk-XYXCZIJY.js} +4 -4
- package/dist/{chunk-ZCN5BU4U.js → chunk-YBE66FBR.js} +1 -1
- package/dist/{chunk-6QH7I2V5.js → chunk-Z6J4KXY3.js} +2 -2
- package/dist/{chunk-NY6MLFBX.js → chunk-ZBGPAUOH.js} +5 -5
- package/dist/{chunk-LADP6AJY.js → chunk-ZFWCTHR4.js} +7 -7
- package/dist/{chunk-ORV2AVIJ.js → chunk-ZRWZHWKI.js} +2 -2
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/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/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.d.ts +24 -2
- package/dist/index.js +506 -506
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/model-viewer/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +3 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-QEQU3W2L.js +0 -29
- package/dist/CurrencyConverter-L22FF4ST.js +0 -21
- package/dist/Notepad-YZOEXYE3.js +0 -24
- package/dist/Sidebar-UCCVJFSY.js +0 -44
- package/dist/chunk-ABPVCVCT.js +0 -22
- package/dist/chunk-BWQHABH7.js +0 -4
- package/dist/chunk-CILE3ZCC.js +0 -2
- package/dist/chunk-D4WO73XD.js +0 -91
- package/dist/chunk-FMLUQCFB.js +0 -2
- package/dist/chunk-GMLOMLCS.js +0 -24
- package/dist/chunk-HC5KQZFG.js +0 -8
- package/dist/chunk-IUVGHHR3.js +0 -1
- package/dist/chunk-JPE4TYRQ.js +0 -14
- package/dist/chunk-KGAYYSFE.js +0 -6
- package/dist/chunk-LQCNIQ3I.js +0 -8
- package/dist/chunk-LZOKBMAF.js +0 -1
- package/dist/chunk-OXWBSZL2.js +0 -23
- package/dist/chunk-PBSCF2ML.js +0 -15
- package/dist/chunk-QNXTVDIC.js +0 -11
- package/dist/chunk-UTQN5AIO.js +0 -6
- package/dist/chunk-XXTAMF3O.js +0 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{fitBoxScale as e}from"./chunk-M6UKCZHT.js";import{toast_default as t}from"./chunk-
|
|
1
|
+
import{fitBoxScale as e}from"./chunk-M6UKCZHT.js";import{toast_default as t}from"./chunk-I2NVBDKH.js";import{useShellStrings as r}from"./chunk-NRHG4R2Q.js";import{forwardRef as n,useRef as o,useState as i,useMemo as a,useEffect as l,useImperativeHandle as s}from"react";import{jsx as c,jsxs as d,Fragment as h}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],p=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],y=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:g,onCancel:w},C){const z=o(null),D=o(null),P=o(null),$=o(null),E=r().annotator,I=o(E);I.current=E;const[S,W]=i("select"),[B,R]=i(u[0]),[j,H]=i(4),[T,F]=i(24),[U,A]=i(p[0].id),[K,O]=i(!0),[V,Z]=i(!1),[G,X]=i(!1),[q,Y]=i(null),[_,Q]=i(null),[J,ee]=i(6),[te,re]=i(12),[ne,oe]=i([]),[ie,ae]=i(null),[le,se]=i(null),[ce,de]=i(null),[he,ue]=i(1),[pe,ye]=i(null),[xe,me]=i(null),[ge,we]=i(null),fe=o(null),[ve,be]=i(!1),ke=a(()=>ce?{w:ce.w*he,h:ce.h*he}:null,[ce,he]),Me=ke&&le?ke.w/le.w:1,Ne=a(()=>ne.find(e=>e.id===ie)??null,[ne,ie]);l(()=>{"select"===S&&Ne&&("color"in Ne&&R(Ne.color),"stroke"in Ne&&H(Ne.stroke),"rect"===Ne.type&&re(Ne.radius),"text"===Ne.type&&(F(Ne.size),A(Ne.font),O(Ne.bold),Z(Ne.italic),X(Ne.underline),Y(Ne.borderColor),Q(Ne.background),ee(Ne.padding)))},[ie]),l(()=>{const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{$.current=e,se({w:e.naturalWidth,h:e.naturalHeight}),oe([]),ae(null)},e.onerror=()=>t.error(I.current.loadFailed),e.src=n},[n]),l(()=>{if(!le)return;const t=()=>{const t=z.current;if(!t)return;const r=t.getBoundingClientRect(),n=Math.max(0,r.width-32),o=Math.max(0,r.height-32);if(0===n||0===o)return;const i=e({width:n,height:o},{width:le.w,height:le.h},1);de({w:le.w*i,h:le.h*i})};t();const r=new ResizeObserver(t);return z.current&&r.observe(z.current),()=>r.disconnect()},[le]);const Ce=a(()=>ne.filter(e=>"mosaic"===e.type),[ne]);l(()=>{const e=$.current,t=D.current;if(!e||!t||!le)return;t.width=le.w,t.height=le.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of Ce)L(r,e)},[le,Ce,ce]);const Le=e=>{const t=P.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},ze=e=>{fe.current=e,be(!0)};l(()=>{if(!ve)return;const e=e=>{const t=fe.current;if(!t)return;const r=Le(e);if("draw"===t.kind)ye(b(S,t.start,r,B,j,te));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),ye({id:"",type:"draw",points:t.points.slice(),color:B,stroke:j}))}else if("crop"===t.kind)we(N(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;oe(r=>r.map(r=>r.id===t.id?k(t.original,e,n):r))}else"resize"===t.kind&&oe(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=N({x:l,y:s},{x:c,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)ye(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const r={...e,id:y()};return oe(e=>[...e,r]),ae(r.id),W("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void ye(null);const t={id:y(),type:"draw",points:e.points,color:B,stroke:j};oe(e=>[...e,t]),ae(t.id),W("select"),ye(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[ve,S,B,j,te]);l(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(ie&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),oe(e=>e.filter(e=>e.id!==ie)),ae(null)):"Escape"===e.key&&ae(null))):(e.preventDefault(),oe(e=>e.slice(0,-1)),void ae(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ie]);const De=e=>{const t=!{bold:K,italic:V,underline:G}[e];"bold"===e&&O(t),"italic"===e&&Z(t),"underline"===e&&X(t),ie&&oe(r=>r.map(r=>r.id===ie&&"text"===r.type?{...r,[e]:t}:r))},Pe=e=>{Y(e),ie&&oe(t=>t.map(t=>t.id===ie&&"text"===t.type?{...t,borderColor:e}:t))},$e=e=>{Q(e),ie&&oe(t=>t.map(t=>t.id===ie&&"text"===t.type?{...t,background:e}:t))},Ee=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&oe(e=>e.filter(e=>e.id!==xe.editingId)),void me(null);if(xe.editingId)oe(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:y(),type:"text",x:xe.x,y:xe.y,text:t,color:B,size:T,font:U,bold:K,italic:V,underline:G,borderColor:q,background:_,padding:J};oe(t=>[...t,e]),ae(e.id),W("select")}me(null)},Ie=async()=>{const e=D.current,t=P.current;if(!e||!t||!le)return null;const r=document.createElement("canvas");r.width=le.w,r.height=le.h;const n=r.getContext("2d");n.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,0,0,le.w,le.h),URL.revokeObjectURL(l),r};s(C,()=>({save:async()=>{const e=await Ie();e&&e.toBlob(e=>{if(!e)return void t.error(I.current.exportFailed);const r=URL.createObjectURL(e),n=document.createElement("a");n.href=r;const o=x.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void t.error(I.current.clipboardUnsupported);const e=await Ie();e&&e.toBlob(async e=>{if(e)try{await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),t.success(I.current.copied)}catch{t.error(I.current.copyRefused)}else t.error(I.current.copyFailed)},"image/png")}}),[le,x]);const Se=a(()=>[{id:"select",label:E.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:E.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:E.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:E.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:E.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:E.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:E.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:E.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[E]),We=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),Be=Ne?.type??("select"===S?null:S),Re="rect"===Be||"circle"===Be||"arrow"===Be||"draw"===Be,je="rect"===Be,He="text"===Be;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
3
|
/* @__PURE__ */d("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Se.map(e=>/* @__PURE__ */c("button",{onClick:()=>{W(e.id),ae(null)},title:e.label,className:We(S===e.id),children:e.icon},e.id)),
|
|
4
4
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
@@ -14,13 +14,13 @@ return d("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
|
14
14
|
/* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:te,onChange:e=>{return t=Number(e.target.value),re(t),void(ie&&oe(e=>e.map(e=>e.id===ie&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
15
15
|
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:te})]})]}),He&&/* @__PURE__ */d(h,{children:[
|
|
16
16
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
17
|
-
/* @__PURE__ */c("select",{value:
|
|
18
|
-
/* @__PURE__ */c("button",{onClick:()=>De("bold"),className:We(
|
|
17
|
+
/* @__PURE__ */c("select",{value:U,onChange:e=>{return t=e.target.value,A(t),void(ie&&oe(e=>e.map(e=>e.id===ie&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:p.map(e=>/* @__PURE__ */c("option",{value:e.id,children:E[e.name]},e.id))}),
|
|
18
|
+
/* @__PURE__ */c("button",{onClick:()=>De("bold"),className:We(K),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
|
|
19
19
|
/* @__PURE__ */c("button",{onClick:()=>De("italic"),className:We(V),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
|
|
20
|
-
/* @__PURE__ */c("button",{onClick:()=>De("underline"),className:We(
|
|
20
|
+
/* @__PURE__ */c("button",{onClick:()=>De("underline"),className:We(G),title:E.underline,children:/* @__PURE__ */c("span",{className:"underline",children:E.underlineLetter})}),
|
|
21
21
|
/* @__PURE__ */d("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
22
22
|
/* @__PURE__ */c("span",{children:E.size}),
|
|
23
|
-
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:T,onChange:e=>{return t=Number(e.target.value),
|
|
23
|
+
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:T,onChange:e=>{return t=Number(e.target.value),F(t),void(ie&&oe(e=>e.map(e=>e.id===ie&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
24
24
|
/* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:T})]}),
|
|
25
25
|
/* @__PURE__ */d("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
26
|
/* @__PURE__ */c("span",{children:E.border}),q?/* @__PURE__ */d(h,{children:[
|
|
@@ -42,13 +42,13 @@ return d("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
|
42
42
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
43
43
|
/* @__PURE__ */c("button",{onClick:()=>{oe(e=>e.slice(0,-1)),ae(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:E.undo}),
|
|
44
44
|
/* @__PURE__ */d("div",{className:"ml-auto flex items-center gap-2",children:[ge&&/* @__PURE__ */d(h,{children:[
|
|
45
|
-
/* @__PURE__ */c("button",{onClick:()=>{if(!ge||!$.current||!le)return;const e=ge,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=le.w,n.height=le.h;const o=n.getContext("2d");o.drawImage($.current,0,0);for(const e of
|
|
45
|
+
/* @__PURE__ */c("button",{onClick:()=>{if(!ge||!$.current||!le)return;const e=ge,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=le.w,n.height=le.h;const o=n.getContext("2d");o.drawImage($.current,0,0);for(const e of Ce)L(o,e);r.drawImage(n,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{$.current=i,se({w:i.naturalWidth,h:i.naturalHeight}),oe(t=>t.filter(e=>"mosaic"!==e.type).map(t=>k(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=M(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(e,i.naturalWidth,i.naturalHeight))),we(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:E.applyCrop}),
|
|
46
46
|
/* @__PURE__ */c("button",{onClick:()=>we(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:E.cancel})]}),g&&!ge&&/* @__PURE__ */d(h,{children:[w&&/* @__PURE__ */c("button",{onClick:w,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:E.cancel}),
|
|
47
47
|
/* @__PURE__ */c("button",{onClick:async()=>{const e=await Ie();e?e.toBlob(e=>{e?g(e):t.error(I.current.exportFailed)},"image/png"):t.error(I.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:E.apply})]})]})]}),
|
|
48
48
|
/* @__PURE__ */c("div",{ref:z,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ke&&le&&/* @__PURE__ */d("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ke.w,height:ke.h},children:[
|
|
49
49
|
/* @__PURE__ */c("canvas",{ref:D,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
|
|
50
|
-
/* @__PURE__ */d("svg",{ref:P,viewBox:`0 0 ${le.w} ${le.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===S?"default":"text"===S?"text":"crosshair"},onPointerDown:e=>{if("select"===S)return void ae(null);if("text"===S){if(xe)return void Ee();const t=Le(e);return void me({x:t.x,y:t.y,value:""})}const t=Le(e);if("crop"!==S){if("draw"===S)return ze({kind:"pen",points:[t]}),void ye({id:"",type:"draw",points:[t],color:B,stroke:j});ye(b(S,t,t,B,j,te)),ze({kind:"draw",start:t})}else ze({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(m,{anno:e,selected:ie===e.id,zoom:he,onPointerDown:t=>((e,t)=>{"select"===S&&(e.stopPropagation(),ae(t.id),ze({kind:"move",id:t.id,start:Le(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&me({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),ze({kind:"resize",id:t.id,corner:r,start:Le(e),original:t})})(t,e,r)},e.id)),pe&&/* @__PURE__ */c(m,{anno:{...pe,id:"__preview"},preview:!0}),ge&&/* @__PURE__ */c(f,{rect:ge,imageSize:le})]}),xe&&/* @__PURE__ */c(v,{pendingText:xe,color:B,size:T,font:p.find(e=>e.id===
|
|
51
|
-
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===S?ie?E.hintSelected:E.hintSelect:"text"===S?E.hintText:"crop"===S?E.hintCrop:"draw"===S?E.hintDraw:E.hintShape})]})});function m({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=M(e),s=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},u=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...s});else if("circle"===e.type)y=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...s});else if("arrow"===e.type)y=/* @__PURE__ */c(w,{anno:e,interactive:s});else if("draw"===e.type)y=/* @__PURE__ */c("path",{d:
|
|
50
|
+
/* @__PURE__ */d("svg",{ref:P,viewBox:`0 0 ${le.w} ${le.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===S?"default":"text"===S?"text":"crosshair"},onPointerDown:e=>{if("select"===S)return void ae(null);if("text"===S){if(xe)return void Ee();const t=Le(e);return void me({x:t.x,y:t.y,value:""})}const t=Le(e);if("crop"!==S){if("draw"===S)return ze({kind:"pen",points:[t]}),void ye({id:"",type:"draw",points:[t],color:B,stroke:j});ye(b(S,t,t,B,j,te)),ze({kind:"draw",start:t})}else ze({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(m,{anno:e,selected:ie===e.id,zoom:he,onPointerDown:t=>((e,t)=>{"select"===S&&(e.stopPropagation(),ae(t.id),ze({kind:"move",id:t.id,start:Le(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&me({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),ze({kind:"resize",id:t.id,corner:r,start:Le(e),original:t})})(t,e,r)},e.id)),pe&&/* @__PURE__ */c(m,{anno:{...pe,id:"__preview"},preview:!0}),ge&&/* @__PURE__ */c(f,{rect:ge,imageSize:le})]}),xe&&/* @__PURE__ */c(v,{pendingText:xe,color:B,size:T,font:p.find(e=>e.id===U)?.css??p[0].css,bold:K,italic:V,underline:G,borderColor:q,background:_,padding:J,scale:Me,onChange:e=>me({...xe,value:e}),onCommit:Ee,onCancel:()=>me(null)})]})}),
|
|
51
|
+
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===S?ie?E.hintSelected:E.hintSelect:"text"===S?E.hintText:"crop"===S?E.hintCrop:"draw"===S?E.hintDraw:E.hintShape})]})});function m({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=M(e),s=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},u=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...s});else if("circle"===e.type)y=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...s});else if("arrow"===e.type)y=/* @__PURE__ */c(w,{anno:e,interactive:s});else if("draw"===e.type)y=/* @__PURE__ */c("path",{d:C(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...s});else if("mosaic"===e.type)y=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...s,style:t?{...s.style,stroke:"var(--rosh-annotator-selection)"}:s.style});else{const t=p.find(t=>t.id===e.font)?.css??p[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=M(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */d("g",{...s,...u,children:[n&&/* @__PURE__ */c("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
52
52
|
/* @__PURE__ */c("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,r)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
|
|
53
53
|
return d("g",{children:[y,t&&!r&&/* @__PURE__ */d(h,{children:[
|
|
54
54
|
/* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",strokeWidth:2/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none",style:{stroke:"var(--rosh-annotator-selection)"}}),a&&/* @__PURE__ */c(g,{anno:e,zoom:n,onHandlePointerDown:a})]})]})}function g({anno:e,zoom:t,onHandlePointerDown:r}){const n=6/t,o=1.5/t,i=e=>({fill:"white",strokeWidth:o,pointerEvents:"all",style:{cursor:e,stroke:"var(--rosh-annotator-selection)"},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
|
|
@@ -66,4 +66,4 @@ return d("g",{...t,children:[
|
|
|
66
66
|
return d("g",{pointerEvents:"none",children:[
|
|
67
67
|
/* @__PURE__ */c("path",{d:`M0,0 H${t.w} V${t.h} H0 Z M${e.x},${e.y} V${e.y+e.h} H${e.x+e.w} V${e.y} Z`,fillRule:"evenodd",style:{fill:"var(--rosh-annotator-crop-scrim)"}}),
|
|
68
68
|
/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:"white",strokeWidth:2,strokeDasharray:"8,6"})]})}function v({pendingText:e,color:t,size:n,font:i,bold:a,italic:s,underline:d,borderColor:h,background:u,padding:p,scale:y,onChange:x,onCommit:m,onCancel:g}){const w=o(null),f=r().annotator;l(()=>{const e=requestAnimationFrame(()=>{w.current?.focus(),w.current?.select?.()});return()=>cancelAnimationFrame(e)},[]);const v=()=>m(w.current?.value),b=h?Math.max(1,Math.round(n/12)):0;/* @__PURE__ */
|
|
69
|
-
return c("div",{style:{position:"absolute",left:e.x*y+"px",top:e.y*y+"px",transform:"translateY(-2px)",zIndex:5},onPointerDown:e=>e.stopPropagation(),children:/* @__PURE__ */c("textarea",{ref:w,value:e.value,onChange:e=>x(e.target.value),onBlur:v,onKeyDown:e=>{"Escape"===e.key?(e.preventDefault(),g()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v())},placeholder:f.textPlaceholder,rows:1,className:"rosh-focus-ring resize-none shadow-(--elevation-panel)",style:{color:t,fontSize:n*y+"px",fontFamily:i,fontWeight:a?700:400,fontStyle:s?"italic":"normal",textDecoration:d?"underline":void 0,minWidth:80,padding:p*y+"px",borderRadius:Math.min(8,p)*y+"px",border:h?`${b*y}px solid ${h}`:"1px dashed var(--rosh-annotator-edit-hint)",background:u??"var(--rosh-annotator-edit-surface)"}})})}function b(e,t,r,n,o,i){if("rect"===e){const e=
|
|
69
|
+
return c("div",{style:{position:"absolute",left:e.x*y+"px",top:e.y*y+"px",transform:"translateY(-2px)",zIndex:5},onPointerDown:e=>e.stopPropagation(),children:/* @__PURE__ */c("textarea",{ref:w,value:e.value,onChange:e=>x(e.target.value),onBlur:v,onKeyDown:e=>{"Escape"===e.key?(e.preventDefault(),g()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v())},placeholder:f.textPlaceholder,rows:1,className:"rosh-focus-ring resize-none shadow-(--elevation-panel)",style:{color:t,fontSize:n*y+"px",fontFamily:i,fontWeight:a?700:400,fontStyle:s?"italic":"normal",textDecoration:d?"underline":void 0,minWidth:80,padding:p*y+"px",borderRadius:Math.min(8,p)*y+"px",border:h?`${b*y}px solid ${h}`:"1px dashed var(--rosh-annotator-edit-hint)",background:u??"var(--rosh-annotator-edit-surface)"}})})}function b(e,t,r,n,o,i){if("rect"===e){const e=N(t,r);return{id:"",type:"rect",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o,radius:i}}if("circle"===e){const e=N(t,r);return{id:"",type:"circle",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o}}if("arrow"===e)return{id:"",type:"arrow",x1:t.x,y1:t.y,x2:r.x,y2:r.y,color:n,stroke:o};if("mosaic"===e){const e=N(t,r);return{id:"",type:"mosaic",x:e.x,y:e.y,w:e.w,h:e.h}}return null}function k(e,t,r){return"arrow"===e.type?{...e,x1:e.x1+t,y1:e.y1+r,x2:e.x2+t,y2:e.y2+r}:"draw"===e.type?{...e,points:e.points.map(e=>({x:e.x+t,y:e.y+r}))}:(e.type,{...e,x:e.x+t,y:e.y+r})}function M(e){if("arrow"===e.type){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}if("draw"===e.type){if(0===e.points.length)return{x:0,y:0,w:0,h:0};let t=e.points[0].x,r=e.points[0].x,n=e.points[0].y,o=e.points[0].y;for(const i of e.points)i.x<t&&(t=i.x),i.x>r&&(r=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y);return{x:t,y:n,w:r-t,h:o-n}}if("text"===e.type){const t=e.text.split("\n"),r=t.reduce((e,t)=>Math.max(e,t.length),0);return{x:e.x,y:e.y,w:r*e.size*.55,h:t.length*e.size*1.2}}return{x:e.x,y:e.y,w:e.w,h:e.h}}function N(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function C(e){if(0===e.length)return"";let t=`M ${e[0].x} ${e[0].y}`;for(let r=1;r<e.length;r++)t+=` L ${e[r].x} ${e[r].y}`;return t}function L(e,t){const r=Math.round(Math.max(0,t.x)),n=Math.round(Math.max(0,t.y)),o=Math.round(Math.min(e.canvas.width-r,t.w)),i=Math.round(Math.min(e.canvas.height-n,t.h));if(o<2||i<2)return;const a=e.getImageData(r,n,o,i);for(let e=0;e<i;e+=12)for(let t=0;t<o;t+=12){let r=0,n=0,l=0,s=0,c=0;const d=Math.min(12,o-t),h=Math.min(12,i-e);for(let i=0;i<h;i++)for(let h=0;h<d;h++){const d=4*((e+i)*o+(t+h));r+=a.data[d],n+=a.data[d+1],l+=a.data[d+2],s+=a.data[d+3],c++}r=Math.round(r/c),n=Math.round(n/c),l=Math.round(l/c),s=Math.round(s/c);for(let i=0;i<h;i++)for(let c=0;c<d;c++){const d=4*((e+i)*o+(t+c));a.data[d]=r,a.data[d+1]=n,a.data[d+2]=l,a.data[d+3]=s}}e.putImageData(a,r,n)}export{x as ImageAnnotator_default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-
|
|
1
|
+
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,L]=n([]),b=r(0),A="string"==typeof d?d:"",j=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,A)});L(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,A,u,f,m,e,g]),k=s(()=>{h||y.current?.click()},[h]),z=s(()=>L([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>j(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),b.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(b.current=Math.max(0,b.current-1),0===b.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),b.current=0,v(!1),j(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),j(t))}},open:k,take:j,dragOver:x,rejections:D,clearRejections:z}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.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-D5PXRJHA.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-J5OAQAAD.js";import{Button_default as o}from"./chunk-UTISUEO4.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{useShellLanguage as e}from"./chunk-
|
|
1
|
+
import{useShellLanguage as e}from"./chunk-GKYGPCGL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-D5PXRJHA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
3
3
|
/* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */s("div",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SpinnerRing as e}from"./chunk-R2VKEMZH.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{SpinnerRing as e}from"./chunk-R2VKEMZH.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as n,Fragment as l,jsx as o}from"react/jsx-runtime";function r({selectedCount:r,hiddenSelectedCount:c=0,loadedCount:d,totalCount:i,label:a,isFetchingMore:s,extra:u,extraAfter:h}){const m=t().list,f=i??d,p=d>=f,x=c>0?m.selectedNotShown(r,c):r>0?m.selected(r):"";/* @__PURE__ */
|
|
2
2
|
return n(l,{children:[u,x?`${x} — `:"",p?null!=i?m.allLoaded(f,a):m.count(f,a):m.loadedOf(d,f,a),(C=h,null!=C&&!1!==C&&!0!==C&&""!==C?/* @__PURE__ */n(l,{children:[" · ",h]}):""),s?/* @__PURE__ */n(l,{children:[" · ",
|
|
3
3
|
/* @__PURE__ */n("span",{className:"inline-flex items-center gap-1",role:"status",children:[
|
|
4
4
|
/* @__PURE__ */o(e,{}),m.loadingMore]})]}):""]});var C}export{r as ListFooter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as e,useEffect as r,useCallback as n}from"react";function i({open:i,dirty:o,onClose:c,title:s,layer:u}){const a=t().dialog,d=e(!1),l=e(!1),m=e({dirty:o,onClose:c,title:s,strings:a});return r(()=>{m.current={dirty:o,onClose:c,title:s,strings:a}}),r(()=>{i||(d.current=!1)},[i]),r(()=>{if(!i||"auto"!==o||!u)return;const t=t=>{u.contains(t.target)&&(d.current=!0)};return document.addEventListener("input",t,!0),document.addEventListener("change",t,!0),()=>{document.removeEventListener("input",t,!0),document.removeEventListener("change",t,!0)}},[i,o,u]),n(()=>{const{dirty:t,onClose:e,title:r,strings:n}=m.current;if(l.current)return;("auto"===t?d.current:t)?(l.current=!0,import("./shell/ConfirmDialog.js").then(({confirm:t})=>t({title:n.discardTitle,message:n.discardMessage("string"==typeof r?r:void 0),confirmLabel:n.discardConfirm,cancelLabel:n.keepEditing,variant:"warning"})).then(t=>{l.current=!1,t&&(d.current=!1,m.current.onClose())})):e()},[])}export{i as useDiscardGuard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{useShellStrings as e}from"./chunk-NRHG4R2Q.js";import{useRef as r,useEffect as t}from"react";import{jsxs as n,jsx as l}from"react/jsx-runtime";function o({errors:o,title:s,autoFocus:c=!0,className:i=""}){const d=e(),m=r(null),a=r(!1);if(t(()=>{const e=o.length>0;e&&!a.current&&c&&m.current?.focus(),a.current=e},[o.length>0,c]),0===o.length)return null;/* @__PURE__ */
|
|
2
2
|
return n("div",{ref:m,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${i}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */l("h2",{className:"text-sm font-semibold text-red-800",children:s??d.form.errorSummaryTitle}),
|
|
4
4
|
/* @__PURE__ */l("ul",{className:"mt-2 space-y-1",children:o.map(({fieldId:e,message:r},t)=>/* @__PURE__ */l("li",{children:e?/* @__PURE__ */l("a",{href:`#${e}`,onClick:r=>{r.preventDefault(),(e=>{const r=document.getElementById(e);r&&(r.scrollIntoView({block:"center"}),r.focus())})(e)},className:"text-sm text-red-700 underline hover:text-red-900",children:r}):
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{mediaMoveSubmenu as e}from"./chunk-
|
|
1
|
+
import{mediaMoveSubmenu as e}from"./chunk-GRAFJD3L.js";import{optionNoteClass as n}from"./chunk-URHGHXDN.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
|
|
2
2
|
/* @__PURE__ */l("span",{children:e}),
|
|
3
3
|
/* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-J5OAQAAD.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-KGRJSTPM.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-
|
|
1
|
+
import{getFilesStore as e,setSpreadsheetPreview as t}from"./chunk-KGRJSTPM.js";import{setPdfPreview as n}from"./chunk-I4RJAMLJ.js";import{toast_default as i}from"./chunk-I2NVBDKH.js";var o="react-os-shell:preview-opened";async function a(a){const{filePath:r,filename:l,kind:c,onStaged:s,load:d}=a;try{const a=d?d():e().readShortcut?.(r)??null;let f;if(a)f=await a;else{const e=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(r)}`,{credentials:"include"});if(!e.ok)return i.error(`Download failed (${e.status})`),!1;f=await e.blob()}if("csv"===c){const e=await f.text();t({csv:e,filename:l}),s?.("/spreadsheet")}else{const e=URL.createObjectURL(f);n({url:e,filename:l,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(o,{detail:{filePath:r,filename:l,kind:c}})),!0}catch(e){return i.error(e?.message||"Open failed"),!1}}export{o as PREVIEW_OPENED_EVENT,a as openPreviewFile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-YDJ5IZOU.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as r}from"./chunk-TD3ZQD5R.js";import{useShellStrings as s}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-YDJ5IZOU.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{OneLineLabel as r}from"./chunk-TD3ZQD5R.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
|
|
2
2
|
return i("span",{"aria-hidden":"true",className:`h-3 w-0.5 shrink-0 rounded-[1px] ${e}`})}function t({link:t,className:l=""}){const c=n().meter;/* @__PURE__ */
|
|
3
3
|
return r("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500 ${l}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{SidebarBarContext as e,SidebarSheetContext as r}from"./chunk-QWK6DRSN.js";import{readStoredWidth as l,ResizeHandle as t}from"./chunk-
|
|
2
|
-
/* @__PURE__ */g("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */v(t,{side:b,width:
|
|
4
|
-
/* @__PURE__ */v("div",{className:`flex min-w-0 flex-1 flex-col ${
|
|
5
|
-
return g("div",
|
|
6
|
-
/* @__PURE__ */v(k,{phone:
|
|
7
|
-
/* @__PURE__ */v(y,{phone:
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as r}from"./chunk-QWK6DRSN.js";import{readStoredWidth as l,ResizeHandle as t}from"./chunk-JLSXDYS4.js";import{WindowInsetContext as a}from"./chunk-YI4T5I5D.js";import{useIsPhone as n}from"./chunk-UGTRSRIW.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{PANEL_SURFACE as i}from"./chunk-BWJZTHZ6.js";import{useBrowserState as s}from"./chunk-WCCS4VFE.js";import{useBrowserLayoutEffect as c}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useContext as h,useRef as u,useState as m,useReducer as p,useMemo as f,Fragment as b,useEffect as x}from"react";import{jsxs as g,jsx as v}from"react/jsx-runtime";var N=(e,r,l)=>Math.min(Math.max(e,r),l);function w({sidebar:e,sidebarTop:r,sidebarBottom:o,children:i,side:b="left",storageKey:x,defaultWidth:w=256,minWidth:j=180,maxWidth:S=480,className:C="",sidebarClassName:D=("right"===b?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:R="bg-white"}){const W="right"===b,$=d().sidebar,I=n(),z=function(){const[e,r]=m(!1),l=u(null),t=u(/* @__PURE__ */new Map),[,a]=p(e=>e+1,0),n=f(()=>({report(e,r,l){const n={label:r,el:l};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:r,current:()=>[...t.current.values()].sort((e,r)=>e.el&&r.el&&e.el.compareDocumentPosition(r.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:l}}(),[O,P]=s(()=>(x?l(x,j,S):null)??N(w,j,S),N(w,j,S)),E=null!=r||null!=o,T=h(a),K=u(null),[M,Y]=m(!1),G=T?.claim;c(()=>{if(!G||W||I||!K.current)return;const e=G(K.current);return e?(Y(!0),()=>{Y(!1),e()}):void 0},[G,W,I]);const L=M&&!!T?.over,Z=E||L,B=/* @__PURE__ */g("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:O},children:[
|
|
2
|
+
/* @__PURE__ */g("div",{className:`flex h-full flex-col ${Z?"overflow-hidden":"overflow-y-auto"} ${D}`,children:[L&&/* @__PURE__ */v("div",{"data-window-strip":"","aria-hidden":"true",className:"shrink-0 "+(T?.compact?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)")}),null!=r&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 px-2 pb-2 "+(L?"pt-1":"pt-3"),children:r}),Z?/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=o&&/* @__PURE__ */v("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:o})]}),
|
|
3
|
+
/* @__PURE__ */v(t,{side:b,width:O,onResize:P,min:j,max:S,defaultWidth:N(w,j,S),storageKey:x,hint:$.resize})]}),H=
|
|
4
|
+
/* @__PURE__ */v("div",{className:`flex min-w-0 flex-1 flex-col ${R}${M?" pb-2 pr-1":""}${L?" pt-2":""}`,children:i});/* @__PURE__ */
|
|
5
|
+
return g("div",I?{className:`relative flex h-full w-full flex-col overflow-hidden ${C}`,children:[
|
|
6
|
+
/* @__PURE__ */v(k,{phone:z,top:r,fallback:$.sections}),H,
|
|
7
|
+
/* @__PURE__ */v(y,{phone:z,bottom:o,label:$.sections,closeLabel:$.closeSections,children:e})]}:{ref:K,className:`flex h-full w-full overflow-hidden ${C}`,children:[W?null:B,H,W?B:null]})}function k({phone:r,top:l,fallback:t}){const a=r.current();/* @__PURE__ */
|
|
8
8
|
return g("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
9
9
|
/* @__PURE__ */g("button",{ref:r.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":r.open,onClick:()=>r.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
10
10
|
/* @__PURE__ */v("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,r)=>/* @__PURE__ */g(b,{children:[r>0&&" · ",e]},r))}),
|
|
@@ -12,4 +12,4 @@ return g("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 item
|
|
|
12
12
|
/* @__PURE__ */g(r.Provider,{value:e.api,children:[s&&/* @__PURE__ */v("button",{type:"button","aria-label":a,onClick:h,className:"absolute inset-0 z-(--z-in-box) cursor-default bg-gray-900/40"}),
|
|
13
13
|
/* @__PURE__ */g("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,"data-sidebar-section-sheet":!0,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())},onClick:e=>{const r=e.target.closest("button, a");!r||r.hasAttribute("aria-expanded")||r.closest("[data-sheet-keep-open]")||h()},className:`${s?"flex":"hidden"} absolute inset-x-0 bottom-0 z-(--z-in-box) max-h-[75%] flex-col rounded-t-2xl pt-2 ${i}`,children:[
|
|
14
14
|
/* @__PURE__ */v("div",{className:"mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-gray-300","aria-hidden":"true"}),
|
|
15
|
-
/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:n}),null!=l&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]})]})}export{
|
|
15
|
+
/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:n}),null!=l&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]})]})}export{w as SidebarLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{jsxs as r,jsx as a}from"react/jsx-runtime";function n({title:n,message:s,description:d,hint:i,variant:m,frameless:c,icon:o,children:l}){const h=c?"none":m??"dashed",x="boolean"!=typeof o&&null!=o?o:null,p=!x&&(o??"card"!==h),u=t().emptyState,y=s??(n?void 0:u.message),f=d??i;/* @__PURE__ */
|
|
2
2
|
return r("div",{className:`flex flex-col items-center justify-center text-center ${"card"===h?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===h?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[x&&/* @__PURE__ */a("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:x}),p&&/* @__PURE__ */a(e,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),n&&/* @__PURE__ */a("h3",{className:"text-sm font-medium text-gray-900",children:n}),y&&/* @__PURE__ */a("p",{className:"text-sm text-gray-500 "+(n?"mt-2":""),children:y}),f&&/* @__PURE__ */a("p",{className:"text-xs text-gray-400 mt-1",children:f}),l&&/* @__PURE__ */a("div",{className:"mt-4",children:l})]})}export{n as EmptyState};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CartesianPlot as t}from"./chunk-
|
|
1
|
+
import{CartesianPlot as t}from"./chunk-S4RD6UJU.js";import{ChartTooltip as a}from"./chunk-WDQI3FV6.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-NRHG4R2Q.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
|
|
2
2
|
return i(t,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:t=>{const e=M[t],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
|
|
3
3
|
return i(a,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
|
|
4
4
|
/* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as i}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
|
|
2
2
|
return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
|
|
3
3
|
/* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
|
|
4
4
|
/* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-
|
|
1
|
+
import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-NRHG4R2Q.js";import{formatPlain as l}from"./chunk-C3QOHMR6.js";import{jsxs as s,jsx as o}from"react/jsx-runtime";var d={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function i({label:i,value:m,unit:c,delta:h,deltaTone:p,trend:u,trendTone:g,footnote:x,className:f}){const y=r().charts,N=n(),w=null==h?null:h>0?"up":h<0?"down":"flat",b=p?t[p]:void 0,k=g?t[g]:a(0);/* @__PURE__ */
|
|
2
2
|
return s("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${f??""}`,children:[
|
|
3
3
|
/* @__PURE__ */o("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i}),
|
|
4
4
|
/* @__PURE__ */s("span",{className:"flex items-baseline gap-2",children:[
|
|
5
|
-
/* @__PURE__ */o("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:m}),c&&/* @__PURE__ */o("span",{className:"text-sm font-medium text-gray-500",children:c})]}),
|
|
6
|
-
/* @__PURE__ */o("span",{"aria-hidden":"true",children:d[
|
|
7
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:[" ",y[d[
|
|
5
|
+
/* @__PURE__ */o("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:m}),c&&/* @__PURE__ */o("span",{className:"text-sm font-medium text-gray-500",children:c})]}),w&&/* @__PURE__ */s("span",{className:"text-xs font-medium",style:b?{color:b}:void 0,children:[
|
|
6
|
+
/* @__PURE__ */o("span",{"aria-hidden":"true",children:d[w].glyph})," ",l(Math.abs(h),N),
|
|
7
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:[" ",y[d[w].word]]})]}),u&&u.length>1&&/* @__PURE__ */o(e,{data:u,height:26,stroke:k,strokeWidth:2,className:"mt-2 w-full"}),x&&/* @__PURE__ */o("span",{className:"mt-1 text-xs text-gray-500",children:x})]})}export{i as StatTile};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{Dialog as e}from"./chunk-MRZLFZNJ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-NRHG4R2Q.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),L=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),F=a(null),E=a(0),T=a([]),$=a(null),R=a(null),Z=u(e=>{F.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),D=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++E.current,options:r,resolve:e};null===F.current?Z(n):T.current.push(n)})},[Z]),[W,H]=c(!1),[J,K]=c({message:""}),[Q,S]=c(""),V=a(),Y=u(e=>(K(e),S(""),H(!0),new Promise(e=>{V.current=e})),[]),[B,G]=c(!1),[I,M]=c({}),[O,U]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return M(r),U(r.defaultValue??""),G(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=D,y=Y,N=z},[D,Y,z]);const A=(e,r)=>{if(F.current!==e)return;const n=k.current,t=T.current.shift();t?Z(t):(F.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{H(!1),S(""),V.current?.(e)},_=e=>{if(e){const e=O.trim();if(!e&&!I.allowEmpty)return G(!1),void q.current?.(null);G(!1),q.current?.(e)}else G(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===J.variant?"warning":"danger"],te=J.confirmWord,oe=null==te||Q===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:D,children:[r,
|
|
4
|
+
/* @__PURE__ */h(e,{open:t,onClose:()=>A(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
|
+
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>A(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>A(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
7
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
|
+
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
+
/* @__PURE__ */h(e,{open:W,onClose:()=>X(!1),initialFocus:null!=te?void 0:R,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:R,type:"button",onClick:()=>X(!1),className:C,children:J.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??J.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:J.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:J.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
|
+
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
|
+
/* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:Q,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q===te&&X(!0)},placeholder:te,className:`mt-2 ${P} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:B,onClose:()=>_(!1),title:I.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:I.cancelLabel||le.cancel}),
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!I.allowEmpty&&!O.trim(),className:L,children:I.confirmLabel||le.ok})]}),children:[I.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:I.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:O,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:I.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toast_default as t}from"./chunk-
|
|
1
|
+
import{toast_default as t}from"./chunk-I2NVBDKH.js";import{currentShellStrings as e}from"./chunk-NRHG4R2Q.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-F2RAIGCG.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-F2RAIGCG.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,R=p??(x?j.resetName(o):j.inheritName(o)),S=b?j.backTo(b):x?j.backToDefault:j.backToAuto,g=m??(b?j.tip(R,S):R);
|
|
2
2
|
/* @__PURE__ */
|
|
3
|
-
return r(t,{content:
|
|
4
|
-
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":
|
|
5
|
-
/* @__PURE__ */a("span",{id:y,hidden:!0,children:
|
|
3
|
+
return r(t,{content:g,describe:!1,children:[
|
|
4
|
+
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":R,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
|
|
5
|
+
/* @__PURE__ */a("span",{id:y,hidden:!0,children:S})]})}export{o as SettingReset};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as r}from"./chunk-F2RAIGCG.js";import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{Tooltip as r}from"./chunk-F2RAIGCG.js";import{useShellStrings as e}from"./chunk-NRHG4R2Q.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
2
2
|
/* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
3
3
|
/* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
4
4
|
/* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{IconButton_default as e}from"./chunk-NWS5G7FE.js";import{CloseGlyph as t}from"./chunk-
|
|
1
|
+
import{IconButton_default as e}from"./chunk-NWS5G7FE.js";import{CloseGlyph as t}from"./chunk-DTRJLQWO.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-TNGIXSTM.js";import{Button_default as s}from"./chunk-UTISUEO4.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
2
2
|
return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
3
3
|
return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
|
|
4
4
|
return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
|
|
@@ -6,7 +6,7 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
|
|
|
6
6
|
return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
|
|
7
7
|
/* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
8
8
|
/* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function b({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
|
|
9
|
-
/* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:N,className:j="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),
|
|
9
|
+
/* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:N,className:j="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{N&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,N(L.rejections))},[L.rejections,N]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:j,children:[v,
|
|
10
10
|
/* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
|
|
11
11
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return f(F.Provider,{value:i,children:e})}function
|
|
3
|
-
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:
|
|
4
|
-
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-QPVYBN4J.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{createContext as o,useState as l,useMemo as a,useId as u,useRef as s,useEffect as c,useContext as d}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";var p=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e){const t=String(e),n=/e-(\d+)$/.exec(t);return n?Number(n[1]):t.split(".")[1]?.length??0}var x={sm:{left:10,plain:8,unit:40,text:"text-xs"},md:{left:14,plain:12,unit:40,text:"text-sm"}},v={"--rosh-slider-gap":"var(--space-12)","--rosh-slider-floor":"4rem"},b={position:"absolute",left:0,top:0,width:"max-content",height:0,overflow:"hidden",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre"},g={display:"block",width:"max-content"},y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function w(e){return Math.max(1,...e.map(e=>[...e??""].reduce((e,t)=>e+(y.test(t)?2:1),0)))}function S(e,t,n,r){return Number(p(e,t,n).toFixed(r))}var F=o(null);function z({children:e}){const[t,n]=l({}),r=a(()=>(e,t)=>n(n=>{if(null===t){if(!(e in n))return n;const t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}}),[]),i=a(()=>{const e=Object.values(t);return{set:r,width:e.length?`max(${e.join(", ")})`:null}},[t,r]);/* @__PURE__ */
|
|
2
|
+
return f(F.Provider,{value:i,children:e})}function N({value:o,onChange:a,min:y,max:z,step:N=1,shiftStep:k,precision:R,inputMin:L,inputMax:j,suffix:C,units:E,onCommit:$,showInput:B=!0,emptyLabel:K,placeholderValue:M,stepFrom:A,label:W,"aria-labelledby":D,valueText:O,id:P,disabled:V,size:q="md",boxSize:H="sm",className:G="",auto:I}){const U=i(),Y=u(),Q=s(o);r(()=>{Q.current=o},[o]);const T=s(o),J=e=>{Q.current=e,a(e)},X=()=>{T.current=Q.current},Z=()=>{$&&Q.current!==T.current&&(T.current=Q.current,$(Q.current))},_=s(null),ee=s(Z);ee.current=Z;const te=Boolean($);c(()=>{const e=_.current;if(!te||!e)return;const t=()=>ee.current();return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[te]);const ne=t(),re=I??ne,ie=u(),oe=P??Y,le=R??h(N),ae=L??y,ue=j??z,se=void 0!==K||void 0!==M,ce=A??M,de=p(o??M??y,y,z),fe=[y.toFixed(le),z.toFixed(le),o?.toFixed(le),K,M?.toFixed(le)],me=null!=o?o.toFixed(le):K||(null!=M?M.toFixed(le):void 0),pe=s(null),he=s(null),[xe,ve]=l(null),be=s(null),ge=Boolean(C);r(()=>{if(!B)return;const e=()=>{const e=pe.current?.querySelector("input"),t=he.current;if(!e||!t)return;const n=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,t)=>e+(parseFloat(n[t])||0),0);if(r<=0)return;Object.assign(t.style,{fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,fontVariantNumeric:n.fontVariantNumeric,letterSpacing:n.letterSpacing});const i=Math.ceil(t.getBoundingClientRect().width);if(i<=0)return;const o=t.querySelector("[data-shown]"),l=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),a=!!o&&o.getBoundingClientRect().width>l+.5,u=be.current;if(be.current={box:u?.box??{frame:r,fontSize:n.fontSize,text:i,cut:a},room:l},u&&u.box.frame===r&&u.box.fontSize===n.fontSize&&u.box.text===i&&u.box.cut===a)return;const s={frame:r,fontSize:n.fontSize,text:i,cut:a};be.current={box:s,room:l},ve(s)};e(),window.addEventListener("resize",e);const t="undefined"!=typeof document?document.fonts:void 0;t?.addEventListener?.("loadingdone",e);let n=null;if("undefined"!=typeof ResizeObserver){n=new ResizeObserver(()=>e());const t=pe.current?.querySelector("input");t&&n.observe(t),he.current&&n.observe(he.current)}return()=>{window.removeEventListener("resize",e),t?.removeEventListener?.("loadingdone",e),n?.disconnect()}},[ge,B,H]),r(()=>{const e=be.current;if(!e)return;const t=e.box.text<=e.room+.5?null:he.current?.querySelector("[data-shown]"),n=!!t&&t.getBoundingClientRect().width>e.room+.5;if(n===e.box.cut)return;const r={...e.box,cut:n};be.current={box:r,room:e.room},ve(r)},[me]);const ye=e=>O?O(e):"string"==typeof C?`${e.toFixed(le)} ${C}`:void 0,we=null==o?K??(null!=M?ye(M)??String(M):void 0):ye(o),Se=x[H],Fe=fe.filter(e=>Boolean(e)),ze=void 0===me?-1:Fe.indexOf(me),Ne=xe?`${xe.text+xe.frame+2}px`:`calc(${w(fe)}ch + ${Se.left+(ge?Se.unit:Se.plain)+2}px)`,ke=d(F),Re=u(),Le=ke?.set;return r(()=>{Le&&Le(Re,B?Ne:null)},[Le,Re,Ne,B]),c(()=>()=>Le?.(Re,null),[Le,Re]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-(--rosh-slider-gap) ${G}`.trim(),style:v,children:[
|
|
3
|
+
/* @__PURE__ */f("input",{id:oe,type:"range",min:y,max:z,step:N,value:de,disabled:V,"aria-label":D?void 0:W,"aria-labelledby":D,"aria-valuetext":we,"aria-describedby":re?ie:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const n=e.shiftKey&&null!=k;if(!n&&!(null==o&&null!=ce))return;e.preventDefault();J(S((o??ce??de)+t*(n?k??N:N),y,z,le)),Z()},ref:_,onFocus:$&&X,onPointerDown:$&&X,onChange:e=>J(S(Number(e.target.value),y,z,le)),className:"min-w-(--rosh-slider-floor) flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===q?"h-1":"h-1.5")}),B&&
|
|
4
|
+
/* @__PURE__ */f(n,{content:xe?.cut?me:null,className:"relative flex min-w-0 max-w-[calc(100%-var(--rosh-slider-floor)-var(--rosh-slider-gap))] shrink-0",describe:!1,children:/* @__PURE__ */m("div",{ref:pe,"data-slider-box":"",onKeyUp:$&&(e=>{const t=e.target;"Enter"===e.key&&"INPUT"===t.tagName&&"range"!==t.getAttribute("type")&&Z()}),onFocus:$&&X,className:`relative min-w-0 max-w-full shrink-0 ${Se.text}`,style:{position:"relative",width:ke?.width??Ne,...xe?{fontSize:xe.fontSize}:{}},children:[
|
|
5
5
|
/* @__PURE__ */f("span",{ref:he,"data-slider-sizer":"","aria-hidden":"true",style:b,children:Fe.map((e,t)=>/* @__PURE__ */f("span",{"data-shown":t===ze?"":void 0,style:g,children:e},t))}),
|
|
6
|
-
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||
|
|
6
|
+
/* @__PURE__ */f(e,{value:o,onChange:e=>{null!=e?e<ae||e>ue||J(e):se&&J(null)},min:ae,max:ue,step:N,shiftStep:k,stepFrom:ce,precision:le,snap:!0,allowEmpty:se,suffix:C,units:E,onBlur:$&&Z,disabled:V,placeholder:K??(null!=M?M.toFixed(le):void 0),size:H,auto:re,"aria-label":W?U.slider.value(W):void 0,"aria-labelledby":W?void 0:D})]})}),re&&/* @__PURE__ */f("span",{id:ie,hidden:!0,children:U.settingView.auto})]})}export{N as Slider,z as SliderGroup,S as settleSliderValue,w as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-
|
|
2
|
-
return d("div",{className:M,ref:F,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),N=v??(e=>h(e,j)),$=w??b.noFlows,F=c(null),A=a(F),C=x??A,[E,Q]=m(null),{highlighted:R}=n();if(0===f.length||0===k.length)/* @__PURE__ */
|
|
2
|
+
return d("div",{className:M,ref:F,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const z=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),H=e=>z.length<=1?0:z.indexOf(e)/(z.length-1)*(C-g-140)+70,O=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),U=/* @__PURE__ */new Map;for(const e of f)U.set(e.depth,[...U.get(e.depth)??[],e]);const V=Math.max(...[...U.values()].map(e=>e.reduce((e,t)=>e+(O.get(t.key)??0),0))),W=p-20,Y=V>0?(W-y*(Math.max(...[...U.values()].map(e=>e.length))-1))/V:0,Z=/* @__PURE__ */new Map;for(const[e,t]of U){const n=t.map(e=>Math.max(2,(O.get(e.key)??0)*Y)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>W&&l>0?Math.max(0,1-(o-W)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;Z.set(t.key,{x:H(e),y:a,h:l,index:o}),a+=l+y})}const B=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,L=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,S="link"===E?.kind?k[E.index]:void 0,T="node"===E?.kind?f.find(e=>e.key===E.key):void 0;/* @__PURE__ */
|
|
3
3
|
return u("div",{className:`relative ${M??""}`,ref:F,children:[
|
|
4
|
-
/* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${C} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>
|
|
5
|
-
return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>
|
|
6
|
-
return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${C} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>Q(null),children:[k.map((e,n)=>{const o=Z.get(e.from),r=Z.get(e.to);if(!o||!r)return null;const a=Math.max(1,e.value*Y),i=o.y+(B.get(e.from)??0)+a/2,s=r.y+(D.get(e.to)??0)+a/2;B.set(e.from,(B.get(e.from)??0)+a),D.set(e.to,(D.get(e.to)??0)+a);const h=o.x+g,c=r.x,m=l(o.index,e.color),u=`${e.from}→${e.to}`,f=L.get(u)??0;L.set(u,f+1);const k=((e,t)=>E?"link"===E.kind?E.index===t:P(e,E.key):null!==R?P(e,R):null)(e,n);/* @__PURE__ */
|
|
5
|
+
return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>Q({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=Z.get(e.key);if(!t)return null;const n=t.x>C/2,o=(a=e.key,E?"node"===E.kind?E.key===a:P(k[E.index],a):null!==R?R===a:null);var a;/* @__PURE__ */
|
|
6
|
+
return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>Q({kind:"node",key:e.key}),children:[
|
|
7
7
|
/* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:l(t.index,e.color,e.tone)}),
|
|
8
|
-
/* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:r.label,children:e.label})]},e.key)})]}),
|
|
9
|
-
/* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to
|
|
8
|
+
/* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:r.label,children:e.label})]},e.key)})]}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:`${S.from} → ${S.to}`,rows:[{key:"value",label:b.flow,color:l(Z.get(S.from)?.index??0,S.color),value:N(S.value)}]})}),T&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:T.label,rows:[{key:"value",label:b.throughput,color:l(Z.get(T.key)?.index??0,T.color,T.tone),value:N(O.get(T.key)??0)}]})}),
|
|
9
|
+
/* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,N(e.value)])})]})}export{f as SankeyChart};
|