efficient-shell 12.30.0 → 12.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/README.md +43 -1
  2. package/dist/{Browser-FQHXHI3R.js → Browser-36SDGA64.js} +17 -17
  3. package/dist/Calculator-GDHNFSB6.js +29 -0
  4. package/dist/{CurrencyConverter-EHIQIFJK.js → CurrencyConverter-PXCCCUS2.js} +6 -6
  5. package/dist/{Files-LTUUGPAM.js → Files-NVUIAUO5.js} +141 -141
  6. package/dist/{Notepad-JPAXNEFR.js → Notepad-QA2CD6GC.js} +9 -9
  7. package/dist/PdfViewer-627HEAIL.js +1 -0
  8. package/dist/{PomodoroTimer-IVDZBBUN.js → PomodoroTimer-HD2ZNOUV.js} +69 -69
  9. package/dist/{Preview-KRK4XT2B.js → Preview-FW2KT6FQ.js} +27 -27
  10. package/dist/Sidebar-QNJNEBT2.js +44 -0
  11. package/dist/{Stock-OBS2LPX4.js → Stock-EDZSOJAQ.js} +7 -7
  12. package/dist/{Weather-I4TJBIEN.js → Weather-OTVZZEE7.js} +17 -17
  13. package/dist/{WorldClock-YU2ZPVSA.js → WorldClock-PDKFE5S7.js} +4 -4
  14. package/dist/ai/index.js +88 -88
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChartBrush.js +1 -1
  24. package/dist/charts/ChartFrame.js +1 -1
  25. package/dist/charts/ChartSkeleton.js +1 -1
  26. package/dist/charts/ChordChart.js +1 -1
  27. package/dist/charts/ColumnChart.js +1 -1
  28. package/dist/charts/FunnelChart.js +1 -1
  29. package/dist/charts/HeatmapChart.js +1 -1
  30. package/dist/charts/HistogramChart.js +1 -1
  31. package/dist/charts/Meter.js +1 -1
  32. package/dist/charts/PieChart.js +1 -1
  33. package/dist/charts/RadarChart.js +1 -1
  34. package/dist/charts/RadialBarChart.js +1 -1
  35. package/dist/charts/RangeChart.js +1 -1
  36. package/dist/charts/RankedBars.js +1 -1
  37. package/dist/charts/SankeyChart.js +1 -1
  38. package/dist/charts/ScatterChart.js +1 -1
  39. package/dist/charts/SpecChart.js +1 -1
  40. package/dist/charts/StatTile.js +1 -1
  41. package/dist/charts/SunburstChart.js +1 -1
  42. package/dist/charts/TimeSeriesChart.js +1 -1
  43. package/dist/charts/TreemapChart.js +1 -1
  44. package/dist/charts/WaterfallChart.js +1 -1
  45. package/dist/{chunk-LQD54ZL5.js → chunk-246K337V.js} +1 -1
  46. package/dist/{chunk-CIOPLPZW.js → chunk-25M4CAB3.js} +1 -1
  47. package/dist/{chunk-JA5WM66L.js → chunk-26Y66IXU.js} +2 -2
  48. package/dist/chunk-2PNG5UR6.js +22 -0
  49. package/dist/chunk-3ECUHYHI.js +28 -0
  50. package/dist/{chunk-77BK2IAJ.js → chunk-3MAGUYG2.js} +1 -1
  51. package/dist/{chunk-6EXWWPAW.js → chunk-3TR6C5V4.js} +1 -1
  52. package/dist/{chunk-YNE5YC6E.js → chunk-3UMS74TZ.js} +1 -1
  53. package/dist/{chunk-XXRUDMD5.js → chunk-4U2OUX65.js} +5 -5
  54. package/dist/{chunk-FYGPJPU7.js → chunk-4XN6ACGV.js} +1 -1
  55. package/dist/{chunk-3R2TMLKH.js → chunk-555KW6TM.js} +5 -5
  56. package/dist/{chunk-5ZS3VOJH.js → chunk-5OJFYNEZ.js} +1 -1
  57. package/dist/{chunk-V64XY7L4.js → chunk-5R3NDBCD.js} +7 -7
  58. package/dist/{chunk-XK3VYRLR.js → chunk-5XHJ3H6Y.js} +4 -4
  59. package/dist/{chunk-LBLWN3SH.js → chunk-5XOF3O4B.js} +1 -1
  60. package/dist/{chunk-NJ6WZHXC.js → chunk-6AAGZ34A.js} +10 -10
  61. package/dist/{chunk-3ZC53F4T.js → chunk-6MA7VXZR.js} +3 -3
  62. package/dist/{chunk-KHFPF534.js → chunk-6ZTVZIPI.js} +6 -6
  63. package/dist/chunk-7CHEHWGL.js +9 -0
  64. package/dist/{chunk-AIGLJYQ5.js → chunk-7IRO4JAA.js} +1 -1
  65. package/dist/{chunk-N2BWOHNM.js → chunk-7JR2O3IX.js} +5 -5
  66. package/dist/{chunk-I6V4DMNR.js → chunk-A6YUCAGF.js} +1 -1
  67. package/dist/{chunk-NSNM4QIV.js → chunk-A7JAHN75.js} +5 -5
  68. package/dist/chunk-ADNUV6OV.js +8 -0
  69. package/dist/chunk-AFLG5E4O.js +7 -0
  70. package/dist/{chunk-KNNFNOX7.js → chunk-AFVI75RH.js} +7 -7
  71. package/dist/{chunk-KKYNDLOC.js → chunk-AGNHOSES.js} +6 -6
  72. package/dist/{chunk-RMUOUMV2.js → chunk-AJ2EEWZT.js} +2 -2
  73. package/dist/chunk-AWY2ZOXT.js +14 -0
  74. package/dist/{chunk-WM37FXRK.js → chunk-B7UT3W4C.js} +1 -1
  75. package/dist/{chunk-HJECGV6W.js → chunk-BEN2LJWQ.js} +1 -1
  76. package/dist/{chunk-U45APXV3.js → chunk-BIBQAEHV.js} +1 -1
  77. package/dist/{chunk-Y6H5C6A4.js → chunk-BLC6HAU3.js} +1 -1
  78. package/dist/{chunk-X5RFTIHV.js → chunk-BXPEEPYH.js} +1 -1
  79. package/dist/{chunk-JOANOIVK.js → chunk-CAIUI3DC.js} +1 -1
  80. package/dist/{chunk-5O5QMMMG.js → chunk-CHRK5R3Y.js} +8 -8
  81. package/dist/{chunk-B27XRZ47.js → chunk-COF2CF5R.js} +1 -1
  82. package/dist/{chunk-42GNFUAP.js → chunk-CYTK7DCA.js} +11 -11
  83. package/dist/{chunk-DOKA65JI.js → chunk-DGFC5BX4.js} +1 -1
  84. package/dist/{chunk-IQTURGC4.js → chunk-DHLXSL3Y.js} +1 -1
  85. package/dist/{chunk-4WW3SNL6.js → chunk-DRIO2Y4R.js} +4 -4
  86. package/dist/{chunk-IBPULOGJ.js → chunk-DWGMTMDU.js} +2 -2
  87. package/dist/{chunk-E7RMS776.js → chunk-E6GGE7E5.js} +14 -14
  88. package/dist/{chunk-FM34DWV7.js → chunk-FE6J5S5X.js} +5 -5
  89. package/dist/chunk-FKJPBQ6I.js +7 -0
  90. package/dist/{chunk-MYJ3HQYG.js → chunk-FXS2P23Q.js} +10 -10
  91. package/dist/chunk-G3NE4SGZ.js +11 -0
  92. package/dist/chunk-GX4CDXPK.js +9 -0
  93. package/dist/chunk-H74VN7OI.js +2 -0
  94. package/dist/chunk-H7WMOY62.js +1 -0
  95. package/dist/{chunk-HU24RSAE.js → chunk-HGGDOMBV.js} +1 -1
  96. package/dist/{chunk-CBBU74QT.js → chunk-HWV6UDFC.js} +1 -1
  97. package/dist/{chunk-OMSIXLK4.js → chunk-IBLRSK7V.js} +1 -1
  98. package/dist/{chunk-2N6WWL7Y.js → chunk-IE5XWHDU.js} +1 -1
  99. package/dist/chunk-IESNUXYH.js +1 -0
  100. package/dist/chunk-IYM5N7FH.js +4 -0
  101. package/dist/{chunk-IOIY54KO.js → chunk-J44SUUOG.js} +1 -1
  102. package/dist/{chunk-4SEPQN2N.js → chunk-JI55MXP4.js} +8 -8
  103. package/dist/{chunk-PAVOVX3D.js → chunk-JIBU7YY4.js} +2 -2
  104. package/dist/{chunk-WCJR2GNH.js → chunk-JLQ7N54N.js} +17 -17
  105. package/dist/chunk-JROPOGQP.js +2 -0
  106. package/dist/{chunk-GBPGZFBS.js → chunk-JTJDXCJU.js} +4 -4
  107. package/dist/{chunk-CVEVPB3O.js → chunk-JYVHFRKK.js} +5 -5
  108. package/dist/{chunk-MFZ4YMXE.js → chunk-JZ4V3RHK.js} +6 -6
  109. package/dist/{chunk-QF4FYOVE.js → chunk-K4BM6PPZ.js} +1 -1
  110. package/dist/{chunk-GN3AHAVY.js → chunk-K4RY57UX.js} +1 -1
  111. package/dist/{chunk-XMAOLCQV.js → chunk-K73KBA5C.js} +4 -4
  112. package/dist/{chunk-VREZFFRE.js → chunk-KDG7NWYX.js} +1 -1
  113. package/dist/{chunk-5X3Z45SL.js → chunk-KFNQVNND.js} +1 -1
  114. package/dist/{chunk-JTRQ7HAS.js → chunk-KTKFCR6T.js} +1 -1
  115. package/dist/chunk-L6XEON5Q.js +1 -0
  116. package/dist/{chunk-3N4XJS43.js → chunk-LNXYVWEF.js} +1 -1
  117. package/dist/chunk-LOJAJARD.js +8 -0
  118. package/dist/{chunk-GL4NELAT.js → chunk-LOMNX5VH.js} +1 -1
  119. package/dist/{chunk-ILSE5F5F.js → chunk-LQC5U5YT.js} +3 -3
  120. package/dist/chunk-LUAA4LKY.js +19 -0
  121. package/dist/{chunk-MRVW6F5E.js → chunk-M2TQQKJO.js} +1 -1
  122. package/dist/chunk-M3D5FW5R.js +6 -0
  123. package/dist/{chunk-NLQLVXMJ.js → chunk-M3FBPZ4G.js} +1 -1
  124. package/dist/{chunk-3B3QIHF7.js → chunk-MMSQZKJY.js} +5 -5
  125. package/dist/{chunk-X27K2NCU.js → chunk-NDGPJKE3.js} +5 -5
  126. package/dist/chunk-NMWV6BOL.js +8 -0
  127. package/dist/{chunk-36MM4YRK.js → chunk-NQ43KRRX.js} +7 -7
  128. package/dist/{chunk-FIXZT5TZ.js → chunk-NQA267J3.js} +7 -7
  129. package/dist/{chunk-VEF3STCH.js → chunk-NZ74N2IQ.js} +1 -1
  130. package/dist/{chunk-YGKQMENL.js → chunk-OA55OBDP.js} +1 -1
  131. package/dist/{chunk-2DCATU5B.js → chunk-OL2XKAX2.js} +1 -1
  132. package/dist/chunk-OQGCQQ7H.js +6 -0
  133. package/dist/{chunk-4FUQK2LK.js → chunk-OU3J5TOO.js} +1 -1
  134. package/dist/{chunk-MHVWUYEN.js → chunk-OWFJRER6.js} +1 -1
  135. package/dist/{chunk-M2GF44WC.js → chunk-PK5KDLIG.js} +12 -12
  136. package/dist/chunk-PPVZMIBL.js +4 -0
  137. package/dist/{chunk-5XYRFK7D.js → chunk-PR5CON2G.js} +1 -1
  138. package/dist/chunk-PTEKHRNX.js +26 -0
  139. package/dist/{chunk-UOHHIEH4.js → chunk-PUXSFLWR.js} +1 -1
  140. package/dist/{chunk-MVBDE4AX.js → chunk-Q2LKH6RN.js} +1 -1
  141. package/dist/{chunk-SAAXAAAH.js → chunk-Q2T5DRIK.js} +1 -1
  142. package/dist/{chunk-U22563X2.js → chunk-QB4LAGMN.js} +1 -1
  143. package/dist/{chunk-HE2I6KWY.js → chunk-QBQMMOP6.js} +2 -2
  144. package/dist/{chunk-PBZ3UQMS.js → chunk-QJ6HVBAA.js} +4 -4
  145. package/dist/{chunk-23CZSU3H.js → chunk-QPSKEDR7.js} +1 -1
  146. package/dist/{chunk-3HLV6BEC.js → chunk-QTWHMCCX.js} +10 -10
  147. package/dist/{chunk-Q4BJW37U.js → chunk-QUN3RSMN.js} +1 -1
  148. package/dist/{chunk-RPXRMTOU.js → chunk-QXLYU5FR.js} +1 -1
  149. package/dist/{chunk-37EYKPR6.js → chunk-QXTCEUFC.js} +1 -1
  150. package/dist/{chunk-HC3BZPWX.js → chunk-QYKWVZ3R.js} +1 -1
  151. package/dist/{chunk-6UB6YY3H.js → chunk-R3W6LZBG.js} +1 -1
  152. package/dist/{chunk-GANZLRMW.js → chunk-R3ZEDJDZ.js} +8 -8
  153. package/dist/chunk-RIULA2CH.js +15 -0
  154. package/dist/{chunk-ANGNTN36.js → chunk-RLFZRIO4.js} +1 -1
  155. package/dist/{chunk-TIYRBJSB.js → chunk-RPSNYIDY.js} +4 -4
  156. package/dist/{chunk-QT34GMZR.js → chunk-RSRTE7RG.js} +1 -1
  157. package/dist/{chunk-5RLJAXDR.js → chunk-S54Z2JAZ.js} +5 -5
  158. package/dist/{chunk-UQNKFMJR.js → chunk-T5UMQZ5X.js} +12 -12
  159. package/dist/{chunk-ZSVBEJ4G.js → chunk-TBXFRW3E.js} +1 -1
  160. package/dist/{chunk-KPPKPGQI.js → chunk-UJ23EKXU.js} +1 -1
  161. package/dist/{chunk-FSORYU5C.js → chunk-V2OE6OTK.js} +8 -8
  162. package/dist/{chunk-BEB3AGSY.js → chunk-V7BHDLP2.js} +1 -1
  163. package/dist/{chunk-DHRCI7KE.js → chunk-VERSP62V.js} +1 -1
  164. package/dist/{chunk-O3SCB4QZ.js → chunk-VI54L75G.js} +8 -8
  165. package/dist/{chunk-HOXXEF52.js → chunk-VTDW5GLS.js} +1 -1
  166. package/dist/chunk-VVI4Y6XA.js +23 -0
  167. package/dist/{chunk-AYCWVVJ3.js → chunk-VW3ZUWW2.js} +56 -56
  168. package/dist/{chunk-P4NWDRHS.js → chunk-WJTZE3PL.js} +11 -11
  169. package/dist/chunk-WW5AXVBX.js +2 -0
  170. package/dist/{chunk-2IEKMFVL.js → chunk-X4IFSC57.js} +1 -1
  171. package/dist/{chunk-UEADX2GV.js → chunk-X6AMAYXV.js} +2 -2
  172. package/dist/{chunk-JGZEZHMP.js → chunk-XBC7CBVJ.js} +1 -1
  173. package/dist/chunk-XFC7AWPW.js +11 -0
  174. package/dist/{chunk-TJ5ZX5HP.js → chunk-XKBCF6SK.js} +7 -7
  175. package/dist/chunk-XOQH6VSU.js +14 -0
  176. package/dist/chunk-XOXTMWV3.js +6 -0
  177. package/dist/{chunk-6EETON2U.js → chunk-XR7SPONC.js} +1 -1
  178. package/dist/{chunk-QV5A7NFQ.js → chunk-Y7XX6Z3M.js} +8 -8
  179. package/dist/chunk-YELYAGCX.js +13 -0
  180. package/dist/{chunk-QHWD3G7T.js → chunk-YG6ONZIB.js} +2 -2
  181. package/dist/{chunk-K6LO6QI5.js → chunk-ZFQI3EVU.js} +6 -6
  182. package/dist/chunk-ZGY2OK7Q.js +13 -0
  183. package/dist/{chunk-64ZDYUE7.js → chunk-ZHVWK5NL.js} +17 -17
  184. package/dist/{chunk-HRNT4UDG.js → chunk-ZP3UAWJL.js} +13 -13
  185. package/dist/data/DataTable.js +1 -1
  186. package/dist/data/EntityList.js +1 -1
  187. package/dist/data/Gantt.d.ts +107 -0
  188. package/dist/data/Gantt.js +2 -0
  189. package/dist/data/Kanban.js +1 -1
  190. package/dist/data/ListFooter.js +1 -1
  191. package/dist/data/ListLoadError.js +1 -1
  192. package/dist/data/Pagination.js +1 -1
  193. package/dist/data/ResizableTable.js +1 -1
  194. package/dist/file-intake/index.js +1 -1
  195. package/dist/forms/BorderInput.js +1 -1
  196. package/dist/forms/BrandAssetEditor.js +1 -1
  197. package/dist/forms/Calendar.js +1 -1
  198. package/dist/forms/ColorPicker.js +1 -1
  199. package/dist/forms/ComposerAttachments.js +1 -1
  200. package/dist/forms/CornersInput.js +1 -1
  201. package/dist/forms/DatePicker.js +1 -1
  202. package/dist/forms/DateRangePicker.js +1 -1
  203. package/dist/forms/DateTimePicker.js +1 -1
  204. package/dist/forms/DisplayChips.js +1 -1
  205. package/dist/forms/FilePicker.js +1 -1
  206. package/dist/forms/FormErrorSummary.js +1 -1
  207. package/dist/forms/IconPicker.js +1 -1
  208. package/dist/forms/ImageFocusPoint.js +1 -1
  209. package/dist/forms/InputNumber.js +1 -1
  210. package/dist/forms/LinkPicker.js +1 -1
  211. package/dist/forms/MediaLibrary.js +1 -1
  212. package/dist/forms/MediaUploadField.js +1 -1
  213. package/dist/forms/MediaUploadGrid.js +1 -1
  214. package/dist/forms/MediaUsedInList.js +1 -1
  215. package/dist/forms/NumericKeypad.js +1 -1
  216. package/dist/forms/PictureTiles.d.ts +14 -2
  217. package/dist/forms/PictureTiles.js +1 -1
  218. package/dist/forms/PositionInput.js +1 -1
  219. package/dist/forms/Select.js +1 -1
  220. package/dist/forms/SidesInput.js +1 -1
  221. package/dist/forms/Slider.js +1 -1
  222. package/dist/forms/Snippet.js +1 -1
  223. package/dist/forms/TagInput.js +1 -1
  224. package/dist/forms/TextToolbar.js +1 -1
  225. package/dist/forms/TimePicker.js +1 -1
  226. package/dist/forms/WidthsBar.js +1 -1
  227. package/dist/forms/mediaLibraryMenu.js +1 -1
  228. package/dist/forms/mediaMoveItems.js +1 -1
  229. package/dist/forms/textAlign.js +1 -1
  230. package/dist/forms/useFileIntake.js +1 -1
  231. package/dist/hooks/useTheme.d.ts +1 -1
  232. package/dist/icons/efficient-glyphs.js +1 -1
  233. package/dist/icons/efficient-looks.js +1 -1
  234. package/dist/icons/efficient.js +1 -1
  235. package/dist/icons/looks/map.js +1 -1
  236. package/dist/icons/payment.js +1 -1
  237. package/dist/icons/sets.js +1 -1
  238. package/dist/index.d.ts +5 -4
  239. package/dist/index.js +665 -665
  240. package/dist/locales/zh-Hans.js +1 -1
  241. package/dist/map/index.js +2 -2
  242. package/dist/model-viewer/index.js +3 -3
  243. package/dist/page-tabs/index.js +5 -5
  244. package/dist/pdf/index.js +1 -1
  245. package/dist/shell/Accordion.js +1 -1
  246. package/dist/shell/AppUpdateBanner.js +1 -1
  247. package/dist/shell/Avatar.js +1 -1
  248. package/dist/shell/Banner.js +1 -1
  249. package/dist/shell/Breadcrumbs.js +1 -1
  250. package/dist/shell/BudgetBar.js +1 -1
  251. package/dist/shell/Card.js +1 -1
  252. package/dist/shell/ColoredBadge.js +1 -1
  253. package/dist/shell/ConfirmDialog.js +1 -1
  254. package/dist/shell/ContainerFillChart.js +1 -1
  255. package/dist/shell/CountBadge.js +1 -1
  256. package/dist/shell/Dialog.js +1 -1
  257. package/dist/shell/Drawer.js +1 -1
  258. package/dist/shell/EditableGrid.js +1 -1
  259. package/dist/shell/EmptyState.js +1 -1
  260. package/dist/shell/GlobalSearch.js +1 -1
  261. package/dist/shell/HelpCenter.js +1 -1
  262. package/dist/shell/IconRail.js +1 -1
  263. package/dist/shell/ImageLightbox.js +1 -1
  264. package/dist/shell/ItemCount.js +1 -1
  265. package/dist/shell/LanguageSelect.js +1 -1
  266. package/dist/shell/Markdown.js +1 -1
  267. package/dist/shell/MetricBar.js +1 -1
  268. package/dist/shell/MetricBarLegend.js +1 -1
  269. package/dist/shell/MilestoneTimeline.js +1 -1
  270. package/dist/shell/PageHeader.js +1 -1
  271. package/dist/shell/ProductionTimeline.js +1 -1
  272. package/dist/shell/ResizeHandle.js +1 -1
  273. package/dist/shell/Result.js +1 -1
  274. package/dist/shell/SearchableSelect.js +1 -1
  275. package/dist/shell/SettingReset.js +1 -1
  276. package/dist/shell/SettingRow.js +1 -1
  277. package/dist/shell/SidebarLayout.js +1 -1
  278. package/dist/shell/SidebarNav.js +1 -1
  279. package/dist/shell/SortableList.js +1 -1
  280. package/dist/shell/Statistic.js +1 -1
  281. package/dist/shell/TimeAgo.js +1 -1
  282. package/dist/shell/TimelineTrack.js +1 -1
  283. package/dist/shell/TransferProgress.js +1 -1
  284. package/dist/shell/Tree.js +1 -1
  285. package/dist/shell/discardGuard.js +1 -1
  286. package/dist/shell/language.js +1 -1
  287. package/dist/shell/strings.d.ts +22 -0
  288. package/dist/shell/strings.js +1 -1
  289. package/dist/shell/toast.js +1 -1
  290. package/dist/telemetry/index.js +1 -1
  291. package/dist/templates/AuthScreen.js +1 -1
  292. package/dist/templates/ChatTemplate.js +1 -1
  293. package/dist/templates/CheckoutTemplate.js +1 -1
  294. package/dist/templates/DashboardTemplate.js +1 -1
  295. package/dist/templates/DataTablePage.js +1 -1
  296. package/dist/templates/EmailTemplate.js +1 -1
  297. package/dist/templates/ErrorBoundary.d.ts +1 -1
  298. package/dist/templates/ErrorBoundary.js +1 -1
  299. package/dist/templates/ErrorPage.js +1 -1
  300. package/dist/templates/FormLayoutPage.js +1 -1
  301. package/dist/templates/GalleryTemplate.js +1 -1
  302. package/dist/ui/index.d.ts +2 -1
  303. package/dist/ui/index.js +1 -1
  304. package/dist/ui.css +35 -0
  305. package/dist/version.js +1 -1
  306. package/package.json +1 -1
  307. package/dist/Calculator-XCRU5K4O.js +0 -29
  308. package/dist/PdfViewer-J55QKFNS.js +0 -1
  309. package/dist/Sidebar-FCXIPW5K.js +0 -44
  310. package/dist/chunk-4MCI7UHQ.js +0 -7
  311. package/dist/chunk-4YCWO2GZ.js +0 -14
  312. package/dist/chunk-67JLD6AU.js +0 -6
  313. package/dist/chunk-7DTWIWFO.js +0 -6
  314. package/dist/chunk-7IGWU6DK.js +0 -8
  315. package/dist/chunk-AJVL6LXI.js +0 -22
  316. package/dist/chunk-CHV7U5UV.js +0 -9
  317. package/dist/chunk-CXXMSYA6.js +0 -1
  318. package/dist/chunk-EWSOX4WP.js +0 -28
  319. package/dist/chunk-FEWWCWKV.js +0 -11
  320. package/dist/chunk-FPYOZOUY.js +0 -13
  321. package/dist/chunk-GCTJIZTJ.js +0 -2
  322. package/dist/chunk-GKX3C3JE.js +0 -13
  323. package/dist/chunk-HCDG7EUR.js +0 -1
  324. package/dist/chunk-KLG6RYYC.js +0 -6
  325. package/dist/chunk-KPFP2I2S.js +0 -8
  326. package/dist/chunk-LHATGPIE.js +0 -19
  327. package/dist/chunk-MKPZIEQP.js +0 -23
  328. package/dist/chunk-MUSNAMWH.js +0 -1
  329. package/dist/chunk-PRWA4AAC.js +0 -11
  330. package/dist/chunk-QB7TIWHT.js +0 -9
  331. package/dist/chunk-RJG67VRP.js +0 -15
  332. package/dist/chunk-RVD6HJUJ.js +0 -4
  333. package/dist/chunk-TN3W72FC.js +0 -8
  334. package/dist/chunk-UK2D2CSB.js +0 -14
  335. package/dist/chunk-VLI2ED22.js +0 -7
  336. package/dist/chunk-VY5NO4TS.js +0 -2
  337. package/dist/chunk-XJTZU7UH.js +0 -4
  338. package/dist/chunk-YS3CF7GL.js +0 -2
  339. /package/dist/{chunk-GMHMWDXU.js → chunk-KH3253OM.js} +0 -0
@@ -1,19 +1,19 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-G67CJAQ2.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-HCDG7EUR.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
- return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,$]=l(null);c(()=>{M?.(E)},[E,M]);const[L,S]=l({}),z=o(null),[A,N]=l({}),O=o(null),[T,K]=l(null),[R,P]=l(null),[F,H]=l(null),[I,j]=l(null),[X,Y]=l(null),W=o(null);n(()=>{const e=W.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;W.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[X]);const[q,B]=l(null),[G,J]=l(null);c(()=>{D?.(q&&G?{anchor:q,end:G}:null)},[q,G,D]);const U=o(!1),[_,Q]=l(null),V=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:G};const ee=q&&G&&(q.row!==G.row||q.col!==G.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}U.current=!0,e.shiftKey&&q||B({row:t,col:n}),J({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{U.current&&J({row:e,col:t})},[]);c(()=>{const e=()=>{U.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!G)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,G.row),r=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,G,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),J({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&G){const t=Math.min(q.row,G.row),n=Math.max(q.row,G.row),r=Math.min(q.col,G.col),o=Math.max(q.col,G.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),$({row:o,col:l}),Y(null),B({row:o,col:l}),J({row:o,col:l}))}},[e,te,te.length,ne,q,G,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>L[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!z.current)return;const t=e.clientX-z.current.startX,n=Math.max(40,z.current.startW+t);S(e=>({...e,[z.current.col]:n}))},n=()=>{if(z.current&&p){const t=e.map((e,t)=>({...e,width:L[t]??e.width}));t[z.current.col]={...t[z.current.col],width:L[z.current.col]??e[z.current.col].width},p(t)}z.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,L,p]);const pe=e=>A[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);N(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:L[n]??e.width}));p(n)}},[te,e,L,p]),ye=a(e=>{N(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),J({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);Q({row:r,col:o})},t=()=>{V.current&&_&&ve(_),V.current=!1,Q(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[_,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const $e=te.length>100,Le=$e?Math.max(0,Math.floor(De/28)-20):0,Se=$e?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,ze=s(()=>te.slice(Le,Se),[te,Le,Se]),Ae=28*Le,Ne=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
1
+ import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-G67CJAQ2.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-L6XEON5Q.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
+ return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[$,S]=l({}),N=o(null),[z,A]=l({}),O=o(null),[T,K]=l(null),[R,P]=l(null),[F,H]=l(null),[I,X]=l(null),[j,Y]=l(null),W=o(null);n(()=>{const e=W.current;if(!e||e.row!==j?.row||e.col!==j?.col)return;W.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[j]);const[q,B]=l(null),[G,J]=l(null);c(()=>{D?.(q&&G?{anchor:q,end:G}:null)},[q,G,D]);const Q=o(!1),[_,U]=l(null),V=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:G};const ee=q&&G&&(q.row!==G.row||q.col!==G.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}Q.current=!0,e.shiftKey&&q||B({row:t,col:n}),J({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{Q.current&&J({row:e,col:t})},[]);c(()=>{const e=()=>{Q.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!G)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,G.row),r=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,G,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),J({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&G){const t=Math.min(q.row,G.row),n=Math.max(q.row,G.row),r=Math.min(q.col,G.col),o=Math.max(q.col,G.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),Y(null),B({row:o,col:l}),J({row:o,col:l}))}},[e,te,te.length,ne,q,G,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>$[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!N.current)return;const t=e.clientX-N.current.startX,n=Math.max(40,N.current.startW+t);S(e=>({...e,[N.current.col]:n}))},n=()=>{if(N.current&&p){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[N.current.col]={...t[N.current.col],width:$[N.current.col]??e[N.current.col].width},p(t)}N.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,p]);const pe=e=>z[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);A(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:$[n]??e.width}));p(n)}},[te,e,$,p]),ye=a(e=>{A(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),J({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);U({row:r,col:o})},t=()=>{V.current&&_&&ve(_),V.current=!1,U(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[_,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,$e=Le?Math.max(0,Math.floor(De/28)-20):0,Se=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ne=s(()=>te.slice($e,Se),[te,$e,Se]),ze=28*$e,Ae=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
3
3
  return u("div",{ref:Me,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:v,height:v},onScroll:e=>ke(e.target.scrollTop),children:[
4
4
  /* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+fe(e.indexOf(n)),0)},children:[
5
5
  /* @__PURE__ */u("colgroup",{children:[
6
6
  /* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:fe(t)}},e.key))]}),
7
7
  /* @__PURE__ */h("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */u("tr",{children:[
8
8
  /* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),J({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&G&&Math.min(q.col,G.col)<=r&&r<=Math.max(q.col,G.col)&&0===Math.min(q.row,G.row)&&Math.max(q.row,G.row)===te.length-1;/* @__PURE__ */
9
- return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),j(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void j(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}H(null),j(null)})(r),onDragEnd:()=>{H(null),j(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),J({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
10
- /* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),z.current={col:t,startX:e.clientX,startW:fe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]},n.key)})]})}),
11
- /* @__PURE__ */u("tbody",{children:[Ae>0&&/* @__PURE__ */h("tr",{style:{height:Ae}}),ze.map((t,n)=>{const r=Le+n,o=q&&G&&Math.min(q.row,G.row)<=r&&r<=Math.max(q.row,G.row)&&0===Math.min(q.col,G.col)&&Math.max(q.col,G.col)===e.length-1;/* @__PURE__ */
9
+ return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),X(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void X(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}H(null),X(null)})(r),onDragEnd:()=>{H(null),X(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),J({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
10
+ /* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),N.current={col:t,startX:e.clientX,startW:fe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]},n.key)})]})}),
11
+ /* @__PURE__ */u("tbody",{children:[ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}}),Ne.map((t,n)=>{const r=$e+n,o=q&&G&&Math.min(q.row,G.row)<=r&&r<=Math.max(q.row,G.row)&&0===Math.min(q.col,G.col)&&Math.max(q.col,G.col)===e.length-1;/* @__PURE__ */
12
12
  return u("tr",{style:{height:pe(r)},children:[
13
13
  /* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>K(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===T||T===e)return K(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(T,1);t.splice(e,0,n),f(t),K(null),P(null)})(r),onDragEnd:()=>{K(null),P(null)},onClick:t=>{t.shiftKey&&q||B({row:r,col:0}),J({row:r,col:e.length-1})},onContextMenu:e=>me(e,r),children:[r+1,
14
- /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&G&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,G,r,n),l=X?.row===r&&X?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&G?Math.max(q.row,G.row):-1,i=q&&G?Math.max(q.col,G.col):-1,d=q&&G&&r===s&&n===i,w=V.current&&_&&q&&G&&(()=>{const e=Math.min(q.row,G.row),t=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col);let c=e,a=t,s=o,i=l;return _.row>t?a=_.row:_.row<e&&(c=_.row),_.col>l?i=_.col:_.col<o&&(s=_.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
14
+ /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&G&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,G,r,n),l=j?.row===r&&j?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&G?Math.max(q.row,G.row):-1,i=q&&G?Math.max(q.col,G.col):-1,d=q&&G&&r===s&&n===i,w=V.current&&_&&q&&G&&(()=>{const e=Math.min(q.row,G.row),t=Math.max(q.row,G.row),o=Math.min(q.col,G.col),l=Math.max(q.col,G.col);let c=e,a=t,s=o,i=l;return _.row>t?a=_.row:_.row<e&&(c=_.row),_.col>l?i=_.col:_.col<o&&(s=_.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
15
15
  return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||Y({row:r,col:n})},children:[
16
- /* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{$({row:r,col:n}),U.current||(B({row:r,col:n}),J({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),W.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ne>0&&/* @__PURE__ */h("tr",{style:{height:Ne}})]})]}),se&&i(
16
+ /* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),Q.current||(B({row:r,col:n}),J({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),W.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ae>0&&/* @__PURE__ */h("tr",{style:{height:Ae}})]})]}),se&&i(
17
17
  /* @__PURE__ */u(d,{children:[
18
18
  /* @__PURE__ */h("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ie(null)}),
19
19
  /* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:se.x,top:se.y},children:se.items.map((e,t)=>/* @__PURE__ */h("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{g as EditableGrid,w as withSpareRow};
@@ -1,4 +1,4 @@
1
- import{ChartSkeleton as e}from"./chunk-QT34GMZR.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-HCDG7EUR.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
1
+ import{ChartSkeleton as e}from"./chunk-RSRTE7RG.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-L6XEON5Q.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
2
2
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
3
3
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
4
4
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
@@ -8,10 +8,10 @@ return n("span",{className:`${a} h-3.5 w-1 rounded-full`,style:{backgroundColor:
8
8
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:r}})}}function d({entries:e,interactive:r,fallbackSwatch:t,onClick:l}){const{highlighted:d,setHighlighted:u}=a();/* @__PURE__ */
9
9
  return n("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,a)=>{const h=r&&null!==d&&d!==e.key,m=/* @__PURE__ */o(c,{children:[
10
10
  /* @__PURE__ */n(i,{shape:e.swatch??t,colour:s(a,e.color,e.tone)}),e.label]});/* @__PURE__ */
11
- return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:x,className:N}){const w=l().charts;/* @__PURE__ */
12
- return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${N??""}`,"aria-busy":h||m||void 0,children:[
11
+ return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:N,className:x}){const w=l().charts;/* @__PURE__ */
12
+ return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${x??""}`,"aria-busy":h||m||void 0,children:[
13
13
  /* @__PURE__ */o("header",{className:"flex items-start justify-between gap-4",children:[
14
14
  /* @__PURE__ */o("div",{className:"min-w-0",children:[
15
- /* @__PURE__ */n("h3",{className:"text-base font-semibold text-ink-strongest",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:x}),!m&&c&&c.length>1&&/* @__PURE__ */n(d,{entries:c,interactive:g,fallbackSwatch:y,onClick:f}),!m&&i&&/* @__PURE__ */o("details",{className:"border-t border-gray-100 pt-3",children:[
15
+ /* @__PURE__ */n("h3",{className:"text-base font-semibold text-ink-strongest",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:N}),!m&&c&&c.length>1&&/* @__PURE__ */n(d,{entries:c,interactive:g,fallbackSwatch:y,onClick:f}),!m&&i&&/* @__PURE__ */o("details",{className:"border-t border-gray-100 pt-3",children:[
16
16
  /* @__PURE__ */n("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:u??w.showTable}),
17
17
  /* @__PURE__ */n("div",{className:"mt-3 overflow-x-auto",style:{color:t.label},children:i})]})]})})}export{u as ChartFrame};
@@ -1,4 +1,4 @@
1
- import{SpinnerRing as e}from"./chunk-R2VKEMZH.js";import{useShellStrings as t}from"./chunk-HCDG7EUR.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__ */
1
+ import{SpinnerRing as e}from"./chunk-R2VKEMZH.js";import{useShellStrings as t}from"./chunk-L6XEON5Q.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,27 +1,27 @@
1
- import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-HGOWQO63.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-HCDG7EUR.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function C(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var L=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
1
+ import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-HGOWQO63.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-L6XEON5Q.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
2
2
  return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
3
3
  /* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
4
4
  /* @__PURE__ */w("span",{children:e.title}),
5
5
  /* @__PURE__ */w("span",{className:"font-medium normal-case tracking-normal",children:s(e.count,!!e.truncated)})]}),e.rows.map(e=>{const n=c++,s=n===t,l="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
6
- return v("div",{id:L(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
6
+ return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
7
7
  /* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
8
8
  /* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
9
- /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:R,favorites:M,hotkey:P=!0}={}){const H=m().search,$=E??H.placeholder,[S,B]=h(!1),[W,z]=h(""),[F,G]=h(0),O=f(null),{results:Q,truncatedTypes:U,loading:V,failure:Y,reset:q}=C(W,l,2);y(()=>{const e=e=>{P&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),B(e=>!e)),"Escape"===e.key&&S&&B(!1)},t=()=>B(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[S,P]),i(S);const[J,X]=h(!1);S!==J&&(X(S),S&&(z(""),G(0),q())),y(()=>{S?setTimeout(()=>O.current?.focus(),50):z("")},[S]),y(()=>{G(0)},[Q]);const Z=W.length>=2,_=g(()=>Z?e(Q,D,W,H.actions,{truncatedTypes:U,listRoutes:A,typeLabels:N,seeAllLabel:H.seeAll}):t({recent:K,favorites:M,actions:D,typeLabels:N},H),[Z,Q,U,A,N,D,W,K,M,H]),ee=g(()=>r(_),[_]),te=Math.min(F,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{S&&0!==ee.length&&document.getElementById(L(re,te))?.scrollIntoView?.({block:"nearest"})},[S,te,ee.length,re]);const ae=b(e=>{B(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||R?.(e.result),I?.(e.result)):e.action.onSelect()},[I,R]);return S?k(
9
+ /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:M,favorites:P,hotkey:R=!0}={}){const $=m().search,H=E??$.placeholder,[S,B]=h(!1),[W,z]=h(""),[F,O]=h(0),Q=f(null),{results:G,truncatedTypes:V,loading:X,failure:Y,reset:q}=L(W,l,2);y(()=>{const e=e=>{R&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),B(e=>!e)),"Escape"===e.key&&S&&B(!1)},t=()=>B(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[S,R]),i(S);const[J,U]=h(!1);S!==J&&(U(S),S&&(z(""),O(0),q())),y(()=>{S?setTimeout(()=>Q.current?.focus(),50):z("")},[S]),y(()=>{O(0)},[G]);const Z=W.length>=2,_=g(()=>Z?e(G,D,W,$.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:$.seeAll}):t({recent:K,favorites:P,actions:D,typeLabels:N},$),[Z,G,V,A,N,D,W,K,P,$]),ee=g(()=>r(_),[_]),te=Math.min(F,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{S&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[S,te,ee.length,re]);const ae=b(e=>{B(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||M?.(e.result),I?.(e.result)):e.action.onSelect()},[I,M]);return S?k(
10
10
  /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>B(!1),children:[
11
11
  /* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
12
  /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
13
13
  /* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
14
  /* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
15
- /* @__PURE__ */w("input",{ref:O,type:"text",value:W,onChange:e=>{z(e.target.value),G(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),G(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),G(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),G(s(_.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:$,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?L(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),V&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":H.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
16
- /* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:H.escBadge})]}),
17
- /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[V&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:H.searching}),!V&&"all"===Y&&Z&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:H.searchFailed}),!V&&Z&&0===ee.length&&"all"!==Y&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:H.noResults}),ne&&/* @__PURE__ */w(T,{sections:_,activeIdx:te,listId:re,label:H.listLabel,typeIcons:o,groupCount:H.groupCount,groupLabel:H.groupLabel,onHover:G,onPick:ae}),!V&&"some"===Y&&Z&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:H.partialFailure}),!V&&!Z&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:H.minChars(2)})]}),
15
+ /* @__PURE__ */w("input",{ref:Q,type:"text",value:W,onChange:e=>{z(e.target.value),O(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),O(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),O(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),O(s(_.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:H,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),X&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":$.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
16
+ /* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:$.escBadge})]}),
17
+ /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[X&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:$.searching}),!X&&"all"===Y&&Z&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:$.searchFailed}),!X&&Z&&0===ee.length&&"all"!==Y&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.noResults}),ne&&/* @__PURE__ */w(T,{sections:_,activeIdx:te,listId:re,label:$.listLabel,typeIcons:o,groupCount:$.groupCount,groupLabel:$.groupLabel,onHover:O,onPick:ae}),!X&&"some"===Y&&Z&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:$.partialFailure}),!X&&!Z&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:$.minChars(2)})]}),
18
18
  /* @__PURE__ */v("div",{className:"flex items-center justify-between px-4 py-2 border-t border-line-subtle bg-surface-sunken text-2xs text-ink-faintest",children:[
19
19
  /* @__PURE__ */v("div",{className:"flex items-center gap-3",children:[
20
20
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
21
21
  /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
22
- /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${H.navigate}`]}),
22
+ /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${$.navigate}`]}),
23
23
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
24
- /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:H.enterKey}),` ${H.open}`]}),_.length>1&&/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
25
- /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:H.tabKey}),` ${H.nextGroup}`]})]}),
24
+ /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.enterKey}),` ${$.open}`]}),_.length>1&&/* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
25
+ /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.tabKey}),` ${$.nextGroup}`]})]}),
26
26
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
27
- /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:H.escKey}),` ${H.close}`]})]})]})]}),document.body):null}export{I as GlobalSearch,D as openGlobalSearch};
27
+ /* @__PURE__ */w("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:$.escKey}),` ${$.close}`]})]})]})]}),document.body):null}export{I as GlobalSearch,D as openGlobalSearch};
@@ -1,3 +1,3 @@
1
- import{IconPicker as e}from"./chunk-3N4XJS43.js";import{ColorPicker as t}from"./chunk-UQNKFMJR.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-RMUOUMV2.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:S,units:j}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},C=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:S,placeholder:i,prefix:o,suffix:w.unit,units:j,"aria-label":t})}),M=d.map(k),J="number"==typeof m.width?m.width:M.every(e=>null!==e&&e===M[0])?M[0]:null,R=null===J&&M.some(e=>null!==e),U=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",I=e=>k(e)??("number"==typeof m.width?m.width:null),V=m.style??f.style;/* @__PURE__ */
2
- return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,I("left"),String(f.sides.left),e=>O("left",e)),C("top",w.sides.top,u.top,I("top"),String(f.sides.top),e=>O("top",e)),C("right",w.sides.right,u.right,I("right"),String(f.sides.right),e=>O("right",e)),C("bottom",w.sides.bottom,u.bottom,I("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):C("all",w.width,u.all,J,R?"–":U,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:V,disabled:S,onChange:e=>{S||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
- /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{S||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:S})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
1
+ import{IconPicker as e}from"./chunk-LNXYVWEF.js";import{ColorPicker as t}from"./chunk-T5UMQZ5X.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-AJ2EEWZT.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:S}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},C=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:S,"aria-label":t})}),E=d.map(k),T="number"==typeof m.width?m.width:E.every(e=>null!==e&&e===E[0])?E[0]:null,W=null===T&&E.some(e=>null!==e),I=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),M=m.style??f.style;/* @__PURE__ */
2
+ return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),C("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),C("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),C("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):C("all",w.width,u.all,T,W?"–":I,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:M,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
+ /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
@@ -1,8 +1,8 @@
1
- import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-HCDG7EUR.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:D,id:L,className:M="",tone:E,tooltip:W,split:Y}){const[G,$]=m(!1),[H,J]=m(""),S=d(),T=h(null),B=h(null),F=h(null),I=s(T,G),K=e=>k.find(t=>t.value===e)?.label??e,P=p(()=>{const t=new Set(o),n=[],r=H.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,H]),U=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},Z=e=>{e&&!o.includes(e)?(y([...o,e]),J("")):J("")},z=e=>y(o.filter(t=>t!==e)),A=()=>{const e=H.trim();if(Y&&e)return U(e.split(Y)),void J("");j&&e?Z(e):J("")},O=h(()=>{});O.current=()=>{A(),$(!1)},f(()=>{if(!G)return;const e=e=>{const t=e.target;T.current?.contains(t)||F.current?.contains(t)||(A(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>O.current());return()=>{document.removeEventListener("mousedown",e),t()}});const R=k.length>0;/* @__PURE__ */
2
- return g("div",{ref:T,className:"relative",children:[
3
- /* @__PURE__ */g("div",{onMouseDown:e=>{D||e.target.closest("button")||(e.preventDefault(),B.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${D?"bg-gray-50 cursor-not-allowed":""} ${M}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
- /* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!D&&/* @__PURE__ */x("button",{type:"button","aria-label":S.select.removeItem?.(K(e))??`${S.select.remove} ${K(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=W?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
5
- /* @__PURE__ */x("input",{id:L,ref:B,type:"text",autoComplete:"off",role:"combobox","aria-expanded":G&&R,"aria-invalid":C||void 0,disabled:D,value:H,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return U(t.slice(0,-1)),void J(t[t.length-1])}J(e)})(e.target.value),$(!0)},onFocus:()=>{!D&&R&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=H.trim(),o=n?P.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):A()}else"Backspace"===t.key&&""===H&&o.length>0?z(o[o.length-1]):"Escape"===t.key?($(!1),J(""),B.current?.blur()):"Tab"===t.key&&(A(),$(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),G&&R&&v(
6
- /* @__PURE__ */x("div",{ref:F,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,minWidth:I?.minWidth,maxWidth:I?.maxWidth??a,width:"max-content",visibility:I?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:I?.maxHeight??c},children:0===P.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?S.select.allSelected:S.select.noMatches}):P.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
1
+ import{optionMatches as e,OptionSublabel as t}from"./chunk-K5YT5PMJ.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-JMGDGNM7.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-5FYDNH4Y.js";import{useShellStrings as d}from"./chunk-L6XEON5Q.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:M="",tone:E,tooltip:W,split:Y}){const[$,G]=m(!1),[J,S]=m(""),T=d(),B=h(null),F=h(null),H=h(null),I=s(B,$),K=e=>k.find(t=>t.value===e)?.label??e,O=p(()=>{const t=new Set(o),n=[],r=J.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,J]),P=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},Z=e=>{e&&!o.includes(e)?(y([...o,e]),S("")):S("")},z=e=>y(o.filter(t=>t!==e)),A=()=>{const e=J.trim();if(Y&&e)return P(e.split(Y)),void S("");j&&e?Z(e):S("")},Q=h(()=>{});Q.current=()=>{A(),G(!1)},f(()=>{if(!$)return;const e=e=>{const t=e.target;B.current?.contains(t)||H.current?.contains(t)||(A(),G(!1))};document.addEventListener("mousedown",e);const t=l(()=>Q.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
+ return g("div",{ref:B,className:"relative",children:[
3
+ /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),F.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${M}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
+ /* @__PURE__ */x("span",{className:"truncate",children:K(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":T.select.removeItem?.(K(e))??`${T.select.remove} ${K(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=W?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
5
+ /* @__PURE__ */x("input",{id:D,ref:F,type:"text",autoComplete:"off",role:"combobox","aria-expanded":$&&U,"aria-invalid":C||void 0,disabled:L,value:J,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(Y){const t=e.split(Y);if(t.length>1)return P(t.slice(0,-1)),void S(t[t.length-1])}S(e)})(e.target.value),G(!0)},onFocus:()=>{!L&&U&&G(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=J.trim(),o=n?O.filter(t=>e(t,n.toLowerCase())):[];1===o.length?Z(o[0].value):A()}else"Backspace"===t.key&&""===J&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(G(!1),S(""),F.current?.blur()):"Tab"===t.key&&(A(),G(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),$&&U&&v(
6
+ /* @__PURE__ */x("div",{ref:H,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:I?.left,right:I?.right,top:I?.top,bottom:I?.bottom,minWidth:I?.minWidth,maxWidth:I?.maxWidth??a,width:"max-content",visibility:I?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:I?.maxHeight??c},children:0===O.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?T.select.allSelected:T.select.noMatches}):O.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
7
7
  /* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
8
8
  /* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
@@ -0,0 +1,9 @@
1
+ import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-25M4CAB3.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-L6XEON5Q.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},D={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function W(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function S({onClose:e}){const t=b().dialog;/* @__PURE__ */
2
+ return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function V({open:u,onClose:b,side:V="right",size:B="md",title:E,description:G,footer:H,children:I,blocking:O=!1,dirty:P=!1,initialFocus:Q,"aria-label":U,"aria-labelledby":z,"aria-describedby":A,className:F=""}){const L=g(null),R=x(),T=x(),X=x(),Y=e(p()),[J,M]=y(null),Z=a({open:u,dirty:P,onClose:b,title:E,layer:J}),$=g(null),q=t(u&&null!==Y,$),K=r(u&&null!==Y,$),_=i(K,J),ee=o(K),te=null!==K.host;if(c(u),m(L,u&&null!==Y,Q,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(O||Z(),!0),()=>L.current)},[u,O,Z,_]),!u||!Y)return null;const re="bottom"===V,ie={...re?{maxHeight:"85vh"}:{},...q?W(V,q):{}};/* @__PURE__ */
3
+ return k(N,{children:[/* @__PURE__ */j("span",{ref:$,hidden:!0,"data-popup-anchor":""}),w(
4
+ /* @__PURE__ */j(n,{value:J,children:/* @__PURE__ */k("div",{ref:M,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(K),role:"presentation","data-overlay-layer":"",children:[
5
+ /* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(K)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:O?void 0:Z,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
6
+ /* @__PURE__ */k("div",{ref:L,...d({modal:!0,titleId:E?X:void 0,labelledBy:z,label:U}),"aria-describedby":A??(G?T:I?R:void 0),"data-drawer-side":V,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[B]}`,q?"":D[V],re?"rounded-t-xl":"",F].filter(Boolean).join(" "),children:[E?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
7
+ /* @__PURE__ */k("div",{className:"min-w-0",children:[
8
+ /* @__PURE__ */j("h2",{id:X,className:"text-base font-semibold text-gray-900",children:E}),G&&/* @__PURE__ */j("p",{id:T,className:"mt-0.5 text-sm text-gray-500",children:G})]}),!O&&/* @__PURE__ */j(S,{onClose:Z})]}):!O&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(S,{onClose:Z})}),
9
+ /* @__PURE__ */k("div",{id:R,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[G&&!E&&/* @__PURE__ */j("p",{id:T,className:("mb-3 text-sm text-gray-500 "+(O?"":"pr-8")).trim(),children:G}),I]}),H&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:H})]})]})}),Y)]})}export{V as Drawer};
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-HCDG7EUR.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
1
+ import{Button_default as e}from"./chunk-EVYD6UFQ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-L6XEON5Q.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
2
2
  return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
3
3
  /* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
4
4
  /* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
@@ -1,10 +1,10 @@
1
- import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-HCDG7EUR.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),T=N??j.loading,H=C??j.dropHere,M=E??j.addItem,[A,O]=o(null),[R,$]=o(null),S=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),q=()=>{O(null),$(null)},z=i(null),F=i(/* @__PURE__ */new Map);n(()=>{if(null!==A)return;const e=z.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=F.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),F.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[S,A]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:T}):0!==m.length||w?/* @__PURE__ */d("div",{ref:z,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=S[e.value]??[],t=null!==R&&R.col===e.value,r=null!==A?n.findIndex(e=>g(e)===A):-1,o=t&&(-1===r||R.index!==r&&R.index!==r+1)?R.index:-1;/* @__PURE__ */
2
- return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(A&&R&&R.col===e){const n=(S[e]??[]).findIndex(e=>g(e)===A),t=-1!==n;if(!t||R.index!==n&&R.index!==n+1){const r=t&&R.index>n?R.index-1:R.index;h(A,e,r)}}q()})(e.value)},children:[
1
+ import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-L6XEON5Q.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:E,addItemText:D}){const j=t().kanban,I=r(),T=N??j.loading,M=C??j.dropHere,O=D??j.addItem,[A,H]=o(null),[$,L]=o(null),R=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),S=()=>{H(null),L(null)},q=i(null),z=i(/* @__PURE__ */new Map);n(()=>{if(null!==A)return;const e=q.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=z.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),z.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[R,A]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:T}):0!==m.length||w?/* @__PURE__ */d("div",{ref:q,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=R[e.value]??[],t=null!==$&&$.col===e.value,r=null!==A?n.findIndex(e=>g(e)===A):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
+ return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(A&&$&&$.col===e){const n=(R[e]??[]).findIndex(e=>g(e)===A),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(A,e,r)}}S()})(e.value)},children:[
3
3
  /* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
4
4
  /* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
5
5
  /* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
6
6
  /* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,I)})]}),
7
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>$(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===A;/* @__PURE__ */
7
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>L(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===A;/* @__PURE__ */
8
8
  return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
9
- /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==A?n.findIndex(e=>g(e)===A):-1,o=-1!==a&&a<r?r+1:r;$(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:q,onClick:b?()=>b(t):void 0,style:null===A?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:H})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
- /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),M]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
9
+ /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{H(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==A?n.findIndex(e=>g(e)===A):-1,o=-1!==a&&a<r?r+1:r;L(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:S,onClick:b?()=>b(t):void 0,style:null===A?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),E&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>E(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
+ /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),O]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-SOZCWT6I.js";import{useShellStrings as n}from"./chunk-HCDG7EUR.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 S="desktop"===u,x=p??(S?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):S?j.backToDefault:j.backToAuto,g=m??(b?j.tip(x,T):x);
1
+ import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-SOZCWT6I.js";import{useShellStrings as n}from"./chunk-L6XEON5Q.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 S="desktop"===u,x=p??(S?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):S?j.backToDefault:j.backToAuto,g=m??(b?j.tip(x,T):x);
2
2
  /* @__PURE__ */
3
3
  return r(t,{content:g,describe:!1,children:[
4
4
  /* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":x,"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"})}),
@@ -1,4 +1,4 @@
1
- import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-B27XRZ47.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-VREZFFRE.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-HCDG7EUR.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__ */
1
+ import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-COF2CF5R.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-KDG7NWYX.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-L6XEON5Q.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,8 +6,8 @@ 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:j,className:N="",children:v}){const R=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),L=l([]);return o(()=>{j&&R.rejections.length>0&&R.rejections!==L.current&&(L.current=R.rejections,j(R.rejections))},[R.rejections,j]),/* @__PURE__ */u(h,{intake:R,dropLabel:p,className:N,children:[v,
10
- /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{R.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
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:j,className:N="",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(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
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
- /* @__PURE__ */d(b,{onClick:R.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
- /* @__PURE__ */d(a,{rejections:R.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
12
+ /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
+ /* @__PURE__ */d(a,{rejections:L.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
@@ -0,0 +1,8 @@
1
+ import{DragBand as e,tooltipBesideBand as t}from"./chunk-QB4LAGMN.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{niceAxis as i,niceMax as n,linearScale as o,axisGutter as l,bandScale as a}from"./chunk-2JWPNR2U.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-L6XEON5Q.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:N=.24,min:w,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:E,xTickAnchor:P="center",children:L,overlay:R,tooltip:U,onSelect:z,zoom:D,ariaLabel:C,className:S,emptyLabel:F}){const I=c().charts,Q=m(),T=j??(e=>d(e,Q)),V=F??I.noData,W=u(null),B=r(W),O=M??B,[X,Z]=f(null),G=g();if(p(()=>{if(null!==X)return s(e=>"Escape"===e.key&&(Z(null),!0))},[X]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
2
+ return x("div",{className:S,ref:W,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const H=b.filter(Number.isFinite),J=H.every(Number.isInteger),K=void 0===w&&void 0===A?i(Math.min(0,...H),Math.max(0,...H),{intervals:$+1,integer:J}):null,q=void 0!==w&&void 0===A?i(w,Math.max(w,...H),{intervals:$+1,integer:J,zero:!1}):null,Y=K?K.lo:w??Math.min(0,...H),_=K?K.hi:q?q.hi:A??n(Math.max(...H,0)),ee=K?K.ticks:q?[Y,...q.ticks.filter(e=>e>Y)]:o([Y,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:l(ee.map(T),48)+(E?10:0)},re=te.left,ie=Math.max(re+1,O-te.right),ne=te.top,oe=k-te.bottom,le=o([Y,_],{from:oe,to:ne}),ae=a(v.length,{from:re,to:ie},N),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(O/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
3
+ return y("div",{className:`relative ${S??""}`,ref:W,children:[
4
+ /* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${O} ${k}`,role:"img","aria-label":C,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Z(null),onBlur:()=>Z(null),onKeyDown:e=>{if(z&&null!==X&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void z(X);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;Z(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:D?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
5
+ /* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:G,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
6
+ /* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:T(e)},`t${e}`)),E&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:E}),
7
+ /* @__PURE__ */x("g",{clipPath:`url(#${G})`,children:L({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:O,height:k,clipId:G,active:X})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:O,height:k,clipId:G,active:X}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===P?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),D?.drag&&/* @__PURE__ */x(e,{x0:ae.center(D.drag[0])-(ie-re)/v.length/2,x1:ae.center(D.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>Z(t),onPointerDown:D?()=>D.press(t):void 0,onPointerEnter:D?()=>D.over(t):void 0,onPointerUp:D?.release,onClick:z?()=>z(t):void 0,style:z?{cursor:"pointer"}:void 0},`h${t}`))]}),U&&null!==X&&
8
+ /* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(X),ae.bandwidth,O),children:U(X)})]})}export{v as CartesianPlot};
@@ -0,0 +1,7 @@
1
+ import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-HY6CBG4M.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as r}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-L6XEON5Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),$=j??M.nothingToBreakDown,C=c(null),B=a(C),F=v??B,[Y,z]=u(null),{highlighted:A}=l(),D=e(p,F,d);if(0===D.length)/* @__PURE__ */
2
+ return s("div",{className:b,ref:C,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const E=k??i(0),G=Math.max(...D.map(e=>e.value),1),H=e=>34+e/G*62,L=e=>`color-mix(in oklab, ${E} ${H(e).toFixed(0)}%, ${o.surface})`,O=e=>H(e)>=55?o.surface:o.label,Q=Y??A,V=Y?D.find(e=>e.key===Y):void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${b??""}`,ref:C,children:[
4
+ /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${F} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>z(null),children:D.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
+ return f("g",{opacity:Q&&Q!==e.key?.55:1,onMouseEnter:()=>z(e.key),children:[
6
+ /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:L(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:O(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:O(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),V&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(r,{title:V.label,rows:[{key:"value",label:M.value,color:L(V.value),value:N(V.value)}]})}),
7
+ /* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:D.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
@@ -1,11 +1,11 @@
1
- import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-HCDG7EUR.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
2
- return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,B=s(),A=w??j.noData,C=null!=p&&Number.isFinite(p)?p:null,D=Number.isFinite(f)&&f>0?f:null;null==D&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const E=e(v,"MetricBar"),F=null!=C?E??t(l(C,g,b)):null,G=n(g),R=n(b),H=null!=C&&null!=D?x(C/D*100):0,L=null!=C?(y??(a=>100===D?u(a,1,B):m(a,B)))(C):"—",P=null!=C&&null!=D&&(null!=G||null!=R),S="md"===k||"lg"===k,U=S?"h-2":"h-1.5",z=null!=C&&null!=D,O=/* @__PURE__ */c("div",{...z?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(D,Math.max(0,C)),"aria-valuetext":L}:{"aria-hidden":!0},className:z&&F?`relative mt-2 ${U} rounded-full bg-gray-200`:`relative mt-2 ${U} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[z&&
3
- /* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${F?F.fill:"bg-gray-400"}`,style:{width:`${H}%`}}),P&&null!=D&&null!=G&&/* @__PURE__ */o(d,{at:x(G/D*100),title:j.warningAt(G),className:i.warning}),P&&null!=D&&null!=R&&/* @__PURE__ */o(d,{at:x(R/D*100),title:j.criticalAt(R),className:i.critical})]}),Q=F?F.ink:null!=C?"text-gray-900":"text-gray-400";if(S){const a="lg"===k;/* @__PURE__ */
1
+ import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-L6XEON5Q.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
2
+ return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,B=s(),A=w??j.noData,E=null!=p&&Number.isFinite(p)?p:null,F=Number.isFinite(f)&&f>0?f:null;null==F&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const L=e(v,"MetricBar"),C=null!=E?L??t(l(E,g,b)):null,D=n(g),G=n(b),O=null!=E&&null!=F?x(E/F*100):0,P=null!=E?(y??(a=>100===F?u(a,1,B):m(a,B)))(E):"—",Q=null!=E&&null!=F&&(null!=D||null!=G),R="md"===k||"lg"===k,S=R?"h-2":"h-1.5",X=null!=E&&null!=F,z=/* @__PURE__ */c("div",{...X?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":F,"aria-valuenow":Math.min(F,Math.max(0,E)),"aria-valuetext":P}:{"aria-hidden":!0},className:X&&C?`relative mt-2 ${S} rounded-full bg-gray-200`:`relative mt-2 ${S} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[X&&
3
+ /* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${C?C.fill:"bg-gray-400"}`,style:{width:`${O}%`}}),Q&&null!=F&&null!=D&&/* @__PURE__ */o(d,{at:x(D/F*100),title:j.warningAt(D),className:i.warning}),Q&&null!=F&&null!=G&&/* @__PURE__ */o(d,{at:x(G/F*100),title:j.criticalAt(G),className:i.critical})]}),H=C?C.ink:null!=E?"text-gray-900":"text-gray-400";if(R){const a="lg"===k;/* @__PURE__ */
4
4
  return c("div",{className:M,children:[null!=h&&/* @__PURE__ */o("div",{className:(a?"text-xs":"text-3xs")+" font-medium uppercase tracking-wide text-gray-500",children:h}),
5
5
  /* @__PURE__ */c("div",{className:"mt-1 flex items-baseline gap-2",children:[
6
- /* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${Q}`,children:L}),
7
- /* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=C?N:A})]}),O]})}/* @__PURE__ */
6
+ /* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${H}`,children:P}),
7
+ /* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=E?N:A})]}),z]})}/* @__PURE__ */
8
8
  return c("div",{className:M,children:[
9
9
  /* @__PURE__ */c("div",{className:"flex items-baseline gap-2",children:[null!=h&&/* @__PURE__ */o("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:h}),
10
- /* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${Q}`,children:L}),
11
- /* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=C?N:A})]}),O]})}export{h as MetricBar};
10
+ /* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${H}`,children:P}),
11
+ /* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=E?N:A})]}),z]})}export{h as MetricBar};
@@ -1,9 +1,9 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-UEADX2GV.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-HCDG7EUR.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:D=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:C="bg-white"}){const j="right"===m,z=i().sidebar,E=a(),O=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[P,R]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),W=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:P},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${W?"overflow-hidden":"overflow-y-auto"} ${D}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),W?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
- /* @__PURE__ */p(t,{side:m,width:P,onResize:R,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),S=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${C}`,children:u});/* @__PURE__ */
4
- return f("div",E?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:O,top:l,fallback:z.sections}),S,
6
- /* @__PURE__ */p(v,{phone:O,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:I,S,j?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-X6AMAYXV.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-L6XEON5Q.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:j="bg-white"}){const z="right"===m,C=i().sidebar,D=a(),P=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[W,E]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),I=null!=l||null!=n,R=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:W},children:[
2
+ /* @__PURE__ */f("div",{className:`flex h-full flex-col ${I?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),I?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
+ /* @__PURE__ */p(t,{side:m,width:W,onResize:E,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:C.resize})]}),S=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
4
+ return f("div",D?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:P,top:l,fallback:C.sections}),S,
6
+ /* @__PURE__ */p(v,{phone:P,bottom:n,label:C.sections,closeLabel:C.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:R,S,z?R:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
7
7
  return f("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:[
8
8
  /* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.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:[
9
9
  /* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
@@ -1,3 +1,3 @@
1
- import{unitBox as e}from"./chunk-QOYKBINM.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-HCDG7EUR.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:n,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":n,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(t,{size:"sm",...v,children:u})}var j=c(function({value:t,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:D,disabled:E,readOnly:B,invalid:C,placeholder:S,size:O,prefix:$,suffix:M,suffixControl:R,units:F,id:K,name:P,className:U="",onBlur:T,onFocus:V,steppers:W,stepFrom:z,snap:I=!1,allowEmpty:L=!0,appearance:Y="box",display:A,reportWhileTyping:H=!0,onRevert:Q,"aria-label":G,"aria-labelledby":J,"aria-describedby":X,auto:Z,...q},_){const ee="bare"===Y,re=R??("string"==typeof M?e(M,F,E||B):void 0),te=r(),ne=Z??te,oe=s(),ie="string"==typeof M&&""!==M.trim()?M.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(M||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(t,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(t),he=d(t);he.current=t;const be=Boolean(E||B),ge=W??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==t&&de(x(t,g))},[t,g]);const De=e=>{if(be)return;let r=(ae(pe.current)??z??(S?ae(S):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Me()},Ee=d(De);Ee.current=De;const Be=d({unit:j??1,big:D??10*(j??1),locked:be});Be.current={unit:j??1,big:D??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),Ee.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Ce,Se]=u(!1),[Oe,$e]=u(0),Me=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Ce&&document.activeElement===fe.current&&fe.current?.select()},[ee,Ce,Oe]);const Re=d(!1);f(()=>{if(Ce&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(Q??o)(r),Me(),!0})},[Ce,be,g,o,Q]);const Fe=()=>{const e=ae(pe.current);if(null==e){if(!L){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(I?Math.max(b(j??1),b(i??0)):void 0);I&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Ke=/* @__PURE__ */m("input",{ref:me,id:K,"data-number-input":"",name:P,type:"text",inputMode:0===g?"numeric":"decimal",value:!Ce&&A?A(t):ue,disabled:E,readOnly:B,placeholder:S,step:j,role:"spinbutton","aria-valuenow":t??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==t?S||void 0:`${x(t,g)}${ee&&ie?ie:""}`,"aria-describedby":[X,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":C||void 0,"aria-label":G,"aria-labelledby":J,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!H)return;const t=ae(e);(null!==t||L)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Fe(),void Me();const r=j??1,t=D??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),De(n))},onFocus:()=>{ve.current=he.current,Se(!0),Re.current=!0,V?.()},onMouseUp:ee?e=>{Re.current&&(Re.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Se(!1),Re.current=!1,Fe(),T?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Ce?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",U].filter(Boolean).join(" "):n({invalid:C,size:O,readOnly:B,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Ce?"text-ellipsis":"",U].filter(Boolean).join(" ")})}),Pe=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Pe?/* @__PURE__ */v(h,{children:[Ke,Pe]}):Ke;const Ue=ae(ue);/* @__PURE__ */
2
- return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Ke,Pe,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):M&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:M}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ue&&Ue<=i,onStep:e=>Ee.current(-(e?D??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ue&&Ue>=c,onStep:e=>Ee.current(e?D??10*(j??1):j??1)});/* @__PURE__ */
1
+ import{unitBox as e}from"./chunk-QOYKBINM.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{IconButton_default as t}from"./chunk-SV5RRBVA.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-L6XEON5Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:n,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":n,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(t,{size:"sm",...v,children:u})}var j=c(function({value:t,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:E,disabled:B,readOnly:D,invalid:O,placeholder:S,size:C,prefix:$,suffix:M,suffixControl:F,units:K,id:P,name:R,className:L="",onBlur:T,onFocus:U,steppers:V,stepFrom:W,snap:z=!1,allowEmpty:I=!0,appearance:Y="box",display:A,reportWhileTyping:Q=!0,onRevert:X,"aria-label":H,"aria-labelledby":J,"aria-describedby":Z,auto:q,...G},_){const ee="bare"===Y,re=F??("string"==typeof M?e(M,K,B||D):void 0),te=r(),ne=q??te,oe=s(),ie="string"==typeof M&&""!==M.trim()?M.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(M||re),ce=Object.fromEntries(Object.entries(G).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(t,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(t),he=d(t);he.current=t;const be=Boolean(B||D),ge=V??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==t&&de(x(t,g))},[t,g]);const Ee=e=>{if(be)return;let r=(ae(pe.current)??W??(S?ae(S):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Me()},Be=d(Ee);Be.current=Ee;const De=d({unit:j??1,big:E??10*(j??1),locked:be});De.current={unit:j??1,big:E??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=De.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),Be.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Oe,Se]=u(!1),[Ce,$e]=u(0),Me=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Oe&&document.activeElement===fe.current&&fe.current?.select()},[ee,Oe,Ce]);const Fe=d(!1);f(()=>{if(Oe&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(X??o)(r),Me(),!0})},[Oe,be,g,o,X]);const Ke=()=>{const e=ae(pe.current);if(null==e){if(!I){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(z?Math.max(b(j??1),b(i??0)):void 0);z&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Pe=/* @__PURE__ */m("input",{ref:me,id:P,"data-number-input":"",name:R,type:"text",inputMode:0===g?"numeric":"decimal",value:!Oe&&A?A(t):ue,disabled:B,readOnly:D,placeholder:S,step:j,role:"spinbutton","aria-valuenow":t??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==t?S||void 0:`${x(t,g)}${ee&&ie?ie:""}`,"aria-describedby":[Z,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":O||void 0,"aria-label":H,"aria-labelledby":J,onChange:e=>(e=>{if(D)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!Q)return;const t=ae(e);(null!==t||I)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Ke(),void Me();const r=j??1,t=E??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Ee(n))},onFocus:()=>{ve.current=he.current,Se(!0),Fe.current=!0,U?.()},onMouseUp:ee?e=>{Fe.current&&(Fe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Se(!1),Fe.current=!1,Ke(),T?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Oe?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",L].filter(Boolean).join(" "):n({invalid:O,size:C,readOnly:D,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Oe?"text-ellipsis":"",L].filter(Boolean).join(" ")})}),Re=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Re?/* @__PURE__ */v(h,{children:[Pe,Re]}):Pe;const Le=ae(ue);/* @__PURE__ */
2
+ return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Pe,Re,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):M&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:M}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Le&&Le<=i,onStep:e=>Be.current(-(e?E??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Le&&Le>=c,onStep:e=>Be.current(e?E??10*(j??1):j??1)});/* @__PURE__ */
3
3
  return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};