efficient-shell 8.21.1 → 8.23.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 (320) hide show
  1. package/README.md +33 -2
  2. package/dist/{Browser-33BAOVZA.js → Browser-6DBCKZYW.js} +14 -14
  3. package/dist/Calculator-WZIBSVDK.js +29 -0
  4. package/dist/{CurrencyConverter-ONCRQNI4.js → CurrencyConverter-BX5HDEX6.js} +7 -7
  5. package/dist/{Documents-LE46Z6RO.js → Documents-YPOCP5OP.js} +23 -23
  6. package/dist/Files-33ONRECZ.js +87 -0
  7. package/dist/{Notepad-NYFR5HWW.js → Notepad-MOWWMSOT.js} +9 -9
  8. package/dist/{PdfViewer-ZFZ4PEAV.js → PdfViewer-67VBUIRD.js} +1 -1
  9. package/dist/{PomodoroTimer-JVQ5K7B4.js → PomodoroTimer-LBFYGZHA.js} +68 -68
  10. package/dist/{Preview-CPT6HLMR.js → Preview-OUCMOCOE.js} +27 -27
  11. package/dist/Sidebar-OIWVKYUU.js +43 -0
  12. package/dist/{Spreadsheet-BEIPEEOO.js → Spreadsheet-GC7GNZ7C.js} +11 -11
  13. package/dist/{Stock-TWJNCTNT.js → Stock-5TKATE4I.js} +3 -3
  14. package/dist/{Weather-RM7GPLAH.js → Weather-NQJCUUUN.js} +16 -16
  15. package/dist/{WorldClock-ITJ2MO75.js → WorldClock-QYZF2JCO.js} +4 -4
  16. package/dist/ai/index.js +13 -13
  17. package/dist/apps/index.d.ts +1 -1
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/media-host-check.js +1 -1
  20. package/dist/bin/ui-check.js +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.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-255BENW2.js +7 -0
  46. package/dist/chunk-3EKWDVBV.js +29 -0
  47. package/dist/{chunk-EXMFUK3A.js → chunk-3GHBY2FP.js} +8 -8
  48. package/dist/{chunk-LVSPLCGG.js → chunk-3PGK3VFS.js} +1 -1
  49. package/dist/{chunk-VOHZQVFK.js → chunk-3PNKI44X.js} +6 -6
  50. package/dist/{chunk-IPOSLLLU.js → chunk-3V5Z2BJY.js} +12 -12
  51. package/dist/chunk-3WC6ITJ3.js +11 -0
  52. package/dist/{chunk-NBVF2CXM.js → chunk-3XQGEILM.js} +1 -1
  53. package/dist/{chunk-EDQBTPDF.js → chunk-4CFOKYVR.js} +7 -7
  54. package/dist/{chunk-P7WUDHIP.js → chunk-4F3IKYUO.js} +6 -6
  55. package/dist/{chunk-OSVN2UF7.js → chunk-4NXMMWL6.js} +1 -1
  56. package/dist/{chunk-NDTMQRR2.js → chunk-4VLKDANH.js} +1 -1
  57. package/dist/{chunk-4CWKK5HV.js → chunk-4YUCXIRP.js} +4 -4
  58. package/dist/{chunk-B55IXYDR.js → chunk-53ROHXAV.js} +2 -2
  59. package/dist/{chunk-AXZEINMF.js → chunk-5FTHHLJH.js} +18 -18
  60. package/dist/{chunk-36MUTG34.js → chunk-5PY4H4ZJ.js} +1 -1
  61. package/dist/{chunk-DMLJOBQS.js → chunk-64FIE4SX.js} +8 -8
  62. package/dist/chunk-6NMDKOQA.js +7 -0
  63. package/dist/{chunk-73DAZUJP.js → chunk-6WSTN5A3.js} +9 -9
  64. package/dist/{chunk-MEOICYR5.js → chunk-72YFU346.js} +1 -1
  65. package/dist/{chunk-K4DZWCUP.js → chunk-77FLITYM.js} +6 -6
  66. package/dist/chunk-7CFH6Y4T.js +3 -0
  67. package/dist/{chunk-D5HHU5AO.js → chunk-BI6ZLD4X.js} +7 -7
  68. package/dist/chunk-BIYL7CEI.js +2 -0
  69. package/dist/{chunk-RCRI6QZV.js → chunk-BMZSMXE6.js} +1 -1
  70. package/dist/chunk-BOBUSE33.js +2 -0
  71. package/dist/{chunk-NNKMEF3D.js → chunk-BRHIRE4D.js} +4 -4
  72. package/dist/{chunk-IGCXJHAK.js → chunk-BSNWVZHW.js} +1 -1
  73. package/dist/{chunk-MFEJ6TYE.js → chunk-BY2OWWKC.js} +1 -1
  74. package/dist/chunk-CGUMJZUB.js +2 -0
  75. package/dist/chunk-CRLSG5AY.js +9 -0
  76. package/dist/{chunk-TT3S2XVQ.js → chunk-CZ25A5RS.js} +1 -1
  77. package/dist/{chunk-BXM72C73.js → chunk-D2AUUIKG.js} +1 -1
  78. package/dist/{chunk-YVBFFE4Z.js → chunk-D7FT2PXG.js} +5 -5
  79. package/dist/{chunk-RAQESAQZ.js → chunk-DFDDRKIJ.js} +1 -1
  80. package/dist/{chunk-MWAYM46R.js → chunk-DISSJYKV.js} +10 -10
  81. package/dist/chunk-DITCVBR7.js +15 -0
  82. package/dist/chunk-DODH46ZQ.js +8 -0
  83. package/dist/{chunk-6GVJ6IKD.js → chunk-DTSCO7VM.js} +1 -1
  84. package/dist/{chunk-OZPYTSPD.js → chunk-DZNG34DC.js} +8 -8
  85. package/dist/{chunk-3HNK7IRJ.js → chunk-E5ALJIXV.js} +4 -4
  86. package/dist/chunk-E6UCGCOC.js +1 -0
  87. package/dist/{chunk-AJD24TNB.js → chunk-ECWSWLQR.js} +1 -1
  88. package/dist/{chunk-MTSZ66O4.js → chunk-EJUR35JG.js} +1 -1
  89. package/dist/{chunk-OCCHDMEV.js → chunk-ERMZ75FO.js} +1 -1
  90. package/dist/{chunk-WRJDHFLD.js → chunk-EYKUKN32.js} +2 -2
  91. package/dist/{chunk-N65HZ3TK.js → chunk-EYX6KLCZ.js} +1 -1
  92. package/dist/{chunk-LDFRVV5R.js → chunk-EZ3BQ6PK.js} +6 -6
  93. package/dist/{chunk-NRDO5IHL.js → chunk-FL2PUQX7.js} +1 -1
  94. package/dist/{chunk-KZEQJVBO.js → chunk-FLQIF7HC.js} +3 -3
  95. package/dist/chunk-FRPNTDP4.js +8 -0
  96. package/dist/{chunk-PVSGQN5M.js → chunk-GATKJSGL.js} +6 -6
  97. package/dist/{chunk-4VK3GJZI.js → chunk-GIM2422N.js} +1 -1
  98. package/dist/{chunk-IY3CRZRH.js → chunk-GQACKEKW.js} +21 -21
  99. package/dist/{chunk-A4U4BTN3.js → chunk-GWIPZKZJ.js} +3 -3
  100. package/dist/{chunk-IKNNHEVY.js → chunk-H3BC4KDE.js} +1 -1
  101. package/dist/{chunk-55WFJELE.js → chunk-HVX37PKU.js} +1 -1
  102. package/dist/{chunk-CU2B7G5A.js → chunk-IHQX4GYD.js} +1 -1
  103. package/dist/{chunk-7S2I6ACG.js → chunk-IZCODCSC.js} +1 -1
  104. package/dist/{chunk-ECZT7SIE.js → chunk-JEXXJK7H.js} +1 -1
  105. package/dist/{chunk-OZF4QAJT.js → chunk-JNDBRSYZ.js} +3 -3
  106. package/dist/{chunk-L2YW3END.js → chunk-JPP7UWQA.js} +3 -3
  107. package/dist/{chunk-IURSUMDO.js → chunk-JWIKHVF4.js} +8 -8
  108. package/dist/{chunk-YSHS6QIY.js → chunk-K7KQDPLW.js} +5 -5
  109. package/dist/{chunk-AJ42UE53.js → chunk-KDZUWQEG.js} +1 -1
  110. package/dist/{chunk-OTU633XJ.js → chunk-KKSW5IZ7.js} +6 -6
  111. package/dist/{chunk-THDSOVEH.js → chunk-KZHPX4FM.js} +2 -2
  112. package/dist/{chunk-AVOVYKVL.js → chunk-LBLV64XG.js} +2 -2
  113. package/dist/{chunk-CFLVEKSH.js → chunk-LK2SICMI.js} +1 -1
  114. package/dist/{chunk-IJA5ZAGL.js → chunk-LLLAIPFX.js} +1 -1
  115. package/dist/{chunk-YTGWIMXB.js → chunk-M5P6A7KS.js} +1 -1
  116. package/dist/{chunk-YGEK2Z6P.js → chunk-MAOJENIB.js} +1 -1
  117. package/dist/{chunk-UFVQ7ZBP.js → chunk-MEYYQC43.js} +5 -5
  118. package/dist/{chunk-DO6XTJ77.js → chunk-MMFJBWJC.js} +1 -1
  119. package/dist/{chunk-VX4BNYH3.js → chunk-MTXTJLFK.js} +2 -2
  120. package/dist/{chunk-HVVPBAP5.js → chunk-MXHEREC6.js} +3 -3
  121. package/dist/chunk-N3GETPME.js +1 -0
  122. package/dist/{chunk-VY7EPQEG.js → chunk-NHCRQ7SW.js} +1 -1
  123. package/dist/{chunk-MKITHLDU.js → chunk-NID6MGGC.js} +7 -7
  124. package/dist/chunk-NMK4UQXZ.js +12 -0
  125. package/dist/chunk-NT26CWMZ.js +5 -0
  126. package/dist/{chunk-Y5ZWPU4L.js → chunk-NVE6L27I.js} +8 -8
  127. package/dist/{chunk-HJIBTA6V.js → chunk-NWP6IJYK.js} +9 -9
  128. package/dist/{chunk-PJCVNFWM.js → chunk-O6JX6RDX.js} +7 -7
  129. package/dist/{chunk-M5BFTFBK.js → chunk-OFOLUFNB.js} +14 -14
  130. package/dist/chunk-OSA24YH6.js +19 -0
  131. package/dist/{chunk-IMF537IJ.js → chunk-OVVXSAGE.js} +9 -9
  132. package/dist/{chunk-VHAM5TD2.js → chunk-PDXD6DT7.js} +1 -1
  133. package/dist/{chunk-UY47AKZU.js → chunk-PNGL4ZW2.js} +6 -6
  134. package/dist/{chunk-6V753BUI.js → chunk-PNQ4EYYM.js} +3 -3
  135. package/dist/{chunk-LMLM4KHQ.js → chunk-PPFMXLEX.js} +8 -8
  136. package/dist/{chunk-NKJDOQVW.js → chunk-Q3OCGLW7.js} +2 -2
  137. package/dist/{chunk-B4XPFCCQ.js → chunk-QFA5COE6.js} +2 -2
  138. package/dist/{chunk-NSCLFAKK.js → chunk-QQCHLRKG.js} +1 -1
  139. package/dist/{chunk-LQQMELJM.js → chunk-QQK3XS6H.js} +8 -8
  140. package/dist/{chunk-N7VNKAXZ.js → chunk-R6DGLGB3.js} +1 -1
  141. package/dist/chunk-RGBX3EVC.js +11 -0
  142. package/dist/{chunk-6WNQ5ENK.js → chunk-RSO67DWS.js} +7 -7
  143. package/dist/{chunk-XWH6KVVB.js → chunk-RUQEB2ZC.js} +3 -3
  144. package/dist/{chunk-JYOI66DT.js → chunk-RYBJ6MMM.js} +1 -1
  145. package/dist/{chunk-3Z7LIHMB.js → chunk-S7VSXUKS.js} +3 -3
  146. package/dist/{chunk-H7ZXUGXX.js → chunk-SB7OTZI4.js} +15 -15
  147. package/dist/{chunk-U5I7IF72.js → chunk-SBHFEWR6.js} +1 -1
  148. package/dist/chunk-SG2MTCA2.js +100 -0
  149. package/dist/chunk-SXORVKIZ.js +9 -0
  150. package/dist/{chunk-EL3O7ZFQ.js → chunk-TW7TA2AB.js} +1 -1
  151. package/dist/{chunk-DIKOEJ2Y.js → chunk-TXS6JKFV.js} +1 -1
  152. package/dist/{chunk-L6FLPBU2.js → chunk-UB4BTRSB.js} +1 -1
  153. package/dist/{chunk-AH2AUQYM.js → chunk-UKB2I3UK.js} +1 -1
  154. package/dist/{chunk-QJPLM2KQ.js → chunk-UQZWPA5M.js} +2 -2
  155. package/dist/{chunk-CMYLTCPA.js → chunk-UVUBZL7K.js} +1 -1
  156. package/dist/{chunk-EKWSGPJ4.js → chunk-UX6HNRFV.js} +7 -7
  157. package/dist/{chunk-4PZN25MV.js → chunk-VTVOQS5L.js} +15 -15
  158. package/dist/{chunk-PWOFYFMO.js → chunk-VU6VPKM3.js} +5 -5
  159. package/dist/chunk-W5M6P4DZ.js +8 -0
  160. package/dist/{chunk-ES3WKDZC.js → chunk-WGSK7HEY.js} +1 -1
  161. package/dist/{chunk-RZBHO74V.js → chunk-WJ3XSJ6B.js} +1 -1
  162. package/dist/{chunk-AX7KPMDV.js → chunk-WSODT2L5.js} +2 -2
  163. package/dist/{chunk-24L7NLA3.js → chunk-WTY3SXO7.js} +1 -1
  164. package/dist/{chunk-ZBLNVAZ4.js → chunk-WYN5KVU4.js} +3 -3
  165. package/dist/chunk-X6PPP6NX.js +14 -0
  166. package/dist/{chunk-CUT7PAXL.js → chunk-XFBXKKOB.js} +1 -1
  167. package/dist/{chunk-2BS74SYW.js → chunk-XHBQPVNG.js} +1 -1
  168. package/dist/{chunk-7M7ESM5V.js → chunk-Y2D2YMFY.js} +9 -9
  169. package/dist/{chunk-RDPUVCXR.js → chunk-Y4MI6NRI.js} +1 -1
  170. package/dist/{chunk-RAI3GTS6.js → chunk-Y5T257HX.js} +3 -3
  171. package/dist/{chunk-BIS5PHHV.js → chunk-YCQVEJOT.js} +2 -2
  172. package/dist/{chunk-PG6AVBSR.js → chunk-YDYDR72S.js} +1 -1
  173. package/dist/{chunk-OF6TUQAL.js → chunk-YSFLXPUS.js} +5 -5
  174. package/dist/{chunk-DLCIGDKC.js → chunk-YW2DH6YQ.js} +3 -3
  175. package/dist/{chunk-NL6VHSUN.js → chunk-Z2YGQBLZ.js} +1 -1
  176. package/dist/{chunk-QEVIQZIE.js → chunk-ZEKM6HAA.js} +2 -2
  177. package/dist/{chunk-5Z2WLSFM.js → chunk-ZN3O2KJ7.js} +15 -15
  178. package/dist/{chunk-GNXTOUPJ.js → chunk-ZOSIPTXM.js} +5 -5
  179. package/dist/{chunk-EAEUSMYL.js → chunk-ZSRRV44J.js} +1 -1
  180. package/dist/{chunk-MHYOQMBV.js → chunk-ZTB6EMC7.js} +1 -1
  181. package/dist/data/DataTable.js +1 -1
  182. package/dist/data/Kanban.js +1 -1
  183. package/dist/data/ListFooter.js +1 -1
  184. package/dist/data/ListLoadError.js +1 -1
  185. package/dist/data/Pagination.js +1 -1
  186. package/dist/file-intake/index.js +1 -1
  187. package/dist/format/index.js +1 -1
  188. package/dist/forms/BorderInput.js +1 -1
  189. package/dist/forms/BrandAssetEditor.js +1 -1
  190. package/dist/forms/Calendar.js +1 -1
  191. package/dist/forms/ColorPicker.js +1 -1
  192. package/dist/forms/ComposerAttachments.js +1 -1
  193. package/dist/forms/CornersInput.js +1 -1
  194. package/dist/forms/DatePicker.js +1 -1
  195. package/dist/forms/DateRangePicker.js +1 -1
  196. package/dist/forms/DateTimePicker.js +1 -1
  197. package/dist/forms/DisplayChips.js +1 -1
  198. package/dist/forms/FilePicker.js +1 -1
  199. package/dist/forms/FormErrorSummary.js +1 -1
  200. package/dist/forms/IconPicker.js +1 -1
  201. package/dist/forms/ImageFocusPoint.js +1 -1
  202. package/dist/forms/InputNumber.js +1 -1
  203. package/dist/forms/LinkPicker.js +1 -1
  204. package/dist/forms/MediaLibrary.d.ts +11 -0
  205. package/dist/forms/MediaLibrary.js +1 -1
  206. package/dist/forms/MediaUploadField.js +1 -1
  207. package/dist/forms/MediaUploadGrid.js +1 -1
  208. package/dist/forms/MediaUsedInList.js +1 -1
  209. package/dist/forms/NumericKeypad.js +1 -1
  210. package/dist/forms/PositionInput.js +1 -1
  211. package/dist/forms/Select.js +1 -1
  212. package/dist/forms/SidesInput.js +1 -1
  213. package/dist/forms/Slider.js +1 -1
  214. package/dist/forms/Snippet.js +1 -1
  215. package/dist/forms/SplitButton.js +1 -1
  216. package/dist/forms/TagInput.js +1 -1
  217. package/dist/forms/TextToolbar.js +1 -1
  218. package/dist/forms/TimePicker.js +1 -1
  219. package/dist/forms/WidthsBar.js +1 -1
  220. package/dist/forms/mediaLibraryMenu.d.ts +5 -1
  221. package/dist/forms/mediaLibraryMenu.js +1 -1
  222. package/dist/forms/mediaMoveItems.js +1 -1
  223. package/dist/forms/useFileIntake.js +1 -1
  224. package/dist/icons/index.js +1 -1
  225. package/dist/index.d.ts +19 -5
  226. package/dist/index.js +180 -180
  227. package/dist/locales/zh-Hans.js +1 -1
  228. package/dist/map/index.js +5 -5
  229. package/dist/page-tabs/index.js +5 -5
  230. package/dist/pdf/index.js +1 -1
  231. package/dist/shell/Accordion.js +1 -1
  232. package/dist/shell/AppUpdateBanner.js +1 -1
  233. package/dist/shell/Avatar.js +1 -1
  234. package/dist/shell/Banner.js +1 -1
  235. package/dist/shell/Breadcrumbs.js +1 -1
  236. package/dist/shell/BudgetBar.js +1 -1
  237. package/dist/shell/Card.js +1 -1
  238. package/dist/shell/ColoredBadge.js +1 -1
  239. package/dist/shell/ConfirmDialog.js +1 -1
  240. package/dist/shell/ContainerFillChart.js +1 -1
  241. package/dist/shell/ContextMenu.js +1 -1
  242. package/dist/shell/CountBadge.js +1 -1
  243. package/dist/shell/Dialog.js +1 -1
  244. package/dist/shell/Drawer.js +1 -1
  245. package/dist/shell/DropdownMenu.js +1 -1
  246. package/dist/shell/EditableGrid.js +1 -1
  247. package/dist/shell/EmptyState.js +1 -1
  248. package/dist/shell/GlobalSearch.js +1 -1
  249. package/dist/shell/HelpCenter.js +1 -1
  250. package/dist/shell/IconRail.js +1 -1
  251. package/dist/shell/ImageLightbox.js +1 -1
  252. package/dist/shell/LanguageSelect.js +1 -1
  253. package/dist/shell/Markdown.js +1 -1
  254. package/dist/shell/MetricBar.js +1 -1
  255. package/dist/shell/MetricBarLegend.js +1 -1
  256. package/dist/shell/MilestoneTimeline.js +1 -1
  257. package/dist/shell/PageHeader.js +1 -1
  258. package/dist/shell/PopupMenu.js +1 -1
  259. package/dist/shell/ProductionTimeline.js +1 -1
  260. package/dist/shell/ResizeHandle.js +1 -1
  261. package/dist/shell/Result.js +1 -1
  262. package/dist/shell/SearchableSelect.js +1 -1
  263. package/dist/shell/SettingReset.js +1 -1
  264. package/dist/shell/SettingRow.js +1 -1
  265. package/dist/shell/SidebarLayout.js +1 -1
  266. package/dist/shell/SidebarNav.js +1 -1
  267. package/dist/shell/SortableList.js +1 -1
  268. package/dist/shell/Statistic.js +1 -1
  269. package/dist/shell/TimeAgo.js +1 -1
  270. package/dist/shell/TimelineTrack.js +1 -1
  271. package/dist/shell/TopNav.js +1 -1
  272. package/dist/shell/TransferProgress.js +1 -1
  273. package/dist/shell/Tree.js +1 -1
  274. package/dist/shell/ZoomableImage.d.ts +9 -1
  275. package/dist/shell/ZoomableImage.js +1 -1
  276. package/dist/shell/language.js +1 -1
  277. package/dist/shell/strings.d.ts +9 -0
  278. package/dist/shell/strings.js +1 -1
  279. package/dist/shell/toast.js +1 -1
  280. package/dist/telemetry/index.js +1 -1
  281. package/dist/templates/AuthScreen.js +1 -1
  282. package/dist/templates/ChatTemplate.js +1 -1
  283. package/dist/templates/CheckoutTemplate.js +1 -1
  284. package/dist/templates/DashboardTemplate.js +1 -1
  285. package/dist/templates/DataTablePage.js +1 -1
  286. package/dist/templates/EmailTemplate.js +1 -1
  287. package/dist/templates/ErrorBoundary.js +1 -1
  288. package/dist/templates/ErrorPage.js +1 -1
  289. package/dist/templates/FormLayoutPage.js +1 -1
  290. package/dist/templates/GalleryTemplate.js +1 -1
  291. package/dist/{types-BOinJXUf.d.ts → types-ClT92-8Z.d.ts} +13 -1
  292. package/dist/ui/index.d.ts +1 -1
  293. package/dist/ui/index.js +1 -1
  294. package/dist/version.js +1 -1
  295. package/package.json +1 -1
  296. package/dist/Calculator-FHN36ZE3.js +0 -29
  297. package/dist/Files-PD7KZM2Y.js +0 -87
  298. package/dist/Sidebar-OFRMBB5V.js +0 -43
  299. package/dist/chunk-5U3WEVZL.js +0 -19
  300. package/dist/chunk-DLS2VCBK.js +0 -3
  301. package/dist/chunk-DNCII5C4.js +0 -8
  302. package/dist/chunk-DNKACLRF.js +0 -11
  303. package/dist/chunk-ERFM5U3M.js +0 -12
  304. package/dist/chunk-ETSKG62F.js +0 -1
  305. package/dist/chunk-F2Z6IXMM.js +0 -2
  306. package/dist/chunk-HYFHCPNJ.js +0 -15
  307. package/dist/chunk-JGE7S7RQ.js +0 -29
  308. package/dist/chunk-K7Y6VDCC.js +0 -11
  309. package/dist/chunk-KPFOXLN4.js +0 -5
  310. package/dist/chunk-L2HZ7YXS.js +0 -14
  311. package/dist/chunk-MOOBUMON.js +0 -9
  312. package/dist/chunk-TW6WEYGO.js +0 -8
  313. package/dist/chunk-U5KIRPLV.js +0 -2
  314. package/dist/chunk-UBVFIIXS.js +0 -8
  315. package/dist/chunk-WBEMN4JG.js +0 -9
  316. package/dist/chunk-WDXJWC3Y.js +0 -7
  317. package/dist/chunk-Y7V7CMKP.js +0 -2
  318. package/dist/chunk-YUIY7QOR.js +0 -1
  319. package/dist/chunk-ZDK2JYH5.js +0 -99
  320. package/dist/chunk-ZKOIGLRF.js +0 -7
@@ -1,20 +1,20 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-UQBPKZUR.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-ETSKG62F.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as j,useEffect as T,useLayoutEffect as E}from"react";import{createPortal as I}from"react-dom";import{jsxs as S,jsx as O,Fragment as H}from"react/jsx-runtime";var C=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),j=f??D,T=k(),E=/* @__PURE__ */S("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?T:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
- /* @__PURE__ */O(R,{items:r})]});return j?/* @__PURE__ */S(H,{children:[E,
3
- /* @__PURE__ */O("span",{id:T,hidden:!0,children:$.settingView.auto})]}):E});function R({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return O(H,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var z=w(function({value:l,onChange:u,options:w,placeholder:C,invalid:z,className:B="",id:K,disabled:U,size:A,touchSize:F,title:P,multiple:V,renderOption:W,renderValue:L,valueText:M,readOnly:G=!1,footer:J,changed:Q=!1,auto:q,"aria-describedby":X,"aria-label":Y,"aria-labelledby":Z,..._},ee){const[te,re]=N(!1),[ne,ie]=N(-1),ae=$(null),le=$(null),oe=$(null),de=$(null),se=$([]),ce=()=>de.current??oe.current,ue=!!J?.length,pe="sm"===A,me=pe?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",ve=p(pe),[he,fe]=N(null),be=x(),ge=$(te);ge.current=te;const ye=$({buffer:"",timer:null}),xe=k(),we=`${xe}-listbox`,ke=K??`${xe}-trigger`,Ne=e=>`${xe}-opt-${e}`,$e=`${xe}-changed`,De=d(),je=q??De,Te=`${xe}-auto`,Ee=[X,Q?$e:void 0,je?Te:void 0].filter(Boolean).join(" ")||void 0,Ie=D(()=>i(w),[w]),Se=V?l:[],Oe=u,He=f(le,te,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Ce="undefined"==typeof window?T:E,Re=`${te}|${He?.top}|${He?.bottom}|${He?.maxHeight}|${w.length}`;Ce(()=>{fe(null)},[Re]),Ce(()=>{const e=oe.current;if(!te||!e||null!==he)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&fe(Math.floor(i))},[te,he,Re]);const ze=V?Ie.findIndex(e=>Se.includes(e.value)):Ie.findIndex(e=>e.value===l),Be=V?Ie.filter(e=>Se.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ie[ze].label:void 0,Ke=!V&&ze>=0?Ie[ze].lang:void 0,Ue=V?Ie.filter(e=>Se.includes(e.value)):ze>=0?[Ie[ze]]:[],Ae=L&&Ue.length?L(Ue):void 0,Fe=void 0!==Ae&&M?M(Ue):void 0,Pe=j((e=!0)=>{re(!1),ie(-1),e&&le.current?.focus()},[]),Ve=j(()=>{U||G||(ie(ze>=0?ze:e(Ie)),re(!0))},[U,G,Ie,ze]),We=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(V){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ie(e)}Oe(t.value),Pe()}},[Ie,V,l,Oe,Pe]);T(()=>{if(!te)return;return y(e=>!("Escape"!==e.key||!ge.current)&&(Pe(),!0),ce)},[te,Pe]),T(()=>{if(!te)return;const e=e=>{const t=e.target;ae.current?.contains(t)||ce()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[te,Pe]),T(()=>{!te||ne<0||oe.current?.querySelector(`#${CSS.escape(Ne(ne))}`)?.scrollIntoView({block:"nearest"})},[te,ne]);const Le=j(e=>{const r=ye.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=te?ne:ze,i=t(Ie,r.buffer,n);i<0||(te?ie(i):V?(ie(i),re(!0)):We(i))},[te,ne,ze,Ie,We,V]),Me=te?a(w,(e,t)=>{const r=(n=e.value,V?Se.includes(n):l===n);var n;const i=t===ne;/* @__PURE__ */
5
- return S("div",{id:Ne(t),role:"option",lang:e.description||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ie(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${me}${V?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[V&&/* @__PURE__ */O(o,{selected:r}),W?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:i})}):V?/* @__PURE__ */S("span",{className:"block min-w-0 flex-1",children:[
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-UQBPKZUR.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-E6UCGCOC.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as j,useEffect as E,useLayoutEffect as T}from"react";import{createPortal as C}from"react-dom";import{jsxs as I,jsx as O,Fragment as S}from"react/jsx-runtime";var H=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),j=f??D,E=k(),T=/* @__PURE__ */I("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?E:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
+ /* @__PURE__ */O(R,{items:r})]});return j?/* @__PURE__ */I(S,{children:[T,
3
+ /* @__PURE__ */O("span",{id:E,hidden:!0,children:$.settingView.auto})]}):T});function R({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
+ return O(S,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var z=w(function({value:l,onChange:u,options:w,placeholder:H,invalid:z,className:B="",id:U,disabled:K,size:A,touchSize:P,title:V,multiple:W,renderOption:F,renderValue:L,valueText:M,readOnly:G=!1,footer:J,changed:Q=!1,auto:q,"aria-describedby":X,"aria-label":Y,"aria-labelledby":Z,..._},ee){const[te,re]=N(!1),[ne,ie]=N(-1),ae=$(null),le=$(null),oe=$(null),de=$(null),se=$([]),ce=()=>de.current??oe.current,ue=!!J?.length,pe="sm"===A,me=pe?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",ve=p(pe),[he,fe]=N(null),be=x(),ge=$(te);ge.current=te;const ye=$({buffer:"",timer:null}),xe=k(),we=`${xe}-listbox`,ke=U??`${xe}-trigger`,Ne=e=>`${xe}-opt-${e}`,$e=`${xe}-changed`,De=d(),je=q??De,Ee=`${xe}-auto`,Te=[X,Q?$e:void 0,je?Ee:void 0].filter(Boolean).join(" ")||void 0,Ce=D(()=>i(w),[w]),Ie=W?l:[],Oe=u,Se=f(le,te,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),He="undefined"==typeof window?E:T,Re=`${te}|${Se?.top}|${Se?.bottom}|${Se?.maxHeight}|${w.length}`;He(()=>{fe(null)},[Re]),He(()=>{const e=oe.current;if(!te||!e||null!==he)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&fe(Math.floor(i))},[te,he,Re]);const ze=W?Ce.findIndex(e=>Ie.includes(e.value)):Ce.findIndex(e=>e.value===l),Be=W?Ce.filter(e=>Ie.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ce[ze].label:void 0,Ue=!W&&ze>=0?Ce[ze].lang:void 0,Ke=W?Ce.filter(e=>Ie.includes(e.value)):ze>=0?[Ce[ze]]:[],Ae=L&&Ke.length?L(Ke):void 0,Pe=void 0!==Ae&&M?M(Ke):void 0,Ve=j((e=!0)=>{re(!1),ie(-1),e&&le.current?.focus()},[]),We=j(()=>{K||G||(ie(ze>=0?ze:e(Ce)),re(!0))},[K,G,Ce,ze]),Fe=j(e=>{const t=Ce[e];if(t&&!t.disabled){if(W){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ie(e)}Oe(t.value),Ve()}},[Ce,W,l,Oe,Ve]);E(()=>{if(!te)return;return y(e=>!("Escape"!==e.key||!ge.current)&&(Ve(),!0),ce)},[te,Ve]),E(()=>{if(!te)return;const e=e=>{const t=e.target;ae.current?.contains(t)||ce()?.contains(t)||Ve(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[te,Ve]),E(()=>{!te||ne<0||oe.current?.querySelector(`#${CSS.escape(Ne(ne))}`)?.scrollIntoView({block:"nearest"})},[te,ne]);const Le=j(e=>{const r=ye.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=te?ne:ze,i=t(Ce,r.buffer,n);i<0||(te?ie(i):W?(ie(i),re(!0)):Fe(i))},[te,ne,ze,Ce,Fe,W]),Me=te?a(w,(e,t)=>{const r=(n=e.value,W?Ie.includes(n):l===n);var n;const i=t===ne;/* @__PURE__ */
5
+ return I("div",{id:Ne(t),role:"option",lang:e.description||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ie(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${me}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */O(o,{selected:r}),F?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
6
6
  /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",children:e.label}),e.description&&/* @__PURE__ */O("span",{className:ve,children:e.description})]}):e.description?
7
- /* @__PURE__ */S(H,{children:[
7
+ /* @__PURE__ */I(S,{children:[
8
8
  /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",children:e.label}),
9
9
  /* @__PURE__ */O("span",{className:ve,children:e.description})]}):e.label]},e.value)},xe,"mx-1"):null,Ge=void 0!==Ae?
10
- /* @__PURE__ */S("span",{className:"relative block min-w-0 truncate",children:[
10
+ /* @__PURE__ */I("span",{className:"relative block min-w-0 truncate",children:[
11
11
  /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ae}),
12
- /* @__PURE__ */O("span",{lang:void 0===Fe?Ke:void 0,className:"sr-only",children:Fe??Be})]}):/* @__PURE__ */O("span",{lang:Ke,className:"block truncate "+(void 0===Be?"text-gray-400":""),children:Be??C??" "}),Je={zIndex:h.popup,left:He?.left,top:He?.top,bottom:He?.bottom,width:He?.width,maxHeight:He?.maxHeight??b,visibility:He?void 0:"hidden",...g()},Qe=/* @__PURE__ */O("div",{ref:oe,id:we,role:"listbox","aria-labelledby":Z??(Y?void 0:ke),"aria-label":Z?void 0:Y,"aria-multiselectable":V||void 0,className:ue?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:ue?null!==he?{maxHeight:he}:void 0:null!==he?{...Je,maxHeight:he}:Je,children:Me}),qe=ue?/* @__PURE__ */S("div",{ref:de,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Je,children:[Qe,
13
- /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */S("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,n=t=>{e.preventDefault(),se.current[t]?.focus()},i=()=>{e.preventDefault(),le.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${me} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
12
+ /* @__PURE__ */O("span",{lang:void 0===Pe?Ue:void 0,className:"sr-only",children:Pe??Be})]}):/* @__PURE__ */O("span",{lang:Ue,className:"block truncate "+(void 0===Be?"text-gray-400":""),children:Be??H??" "}),Je={zIndex:h.popup,left:Se?.left,top:Se?.top,bottom:Se?.bottom,width:Se?.width,maxHeight:Se?.maxHeight??b,visibility:Se?void 0:"hidden",...g()},Qe=/* @__PURE__ */O("div",{ref:oe,id:we,role:"listbox","aria-labelledby":Z??(Y?void 0:ke),"aria-label":Z?void 0:Y,"aria-multiselectable":W||void 0,className:ue?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:ue?null!==he?{maxHeight:he}:void 0:null!==he?{...Je,maxHeight:he}:Je,children:Me}),qe=ue?/* @__PURE__ */I("div",{ref:de,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Je,children:[Qe,
13
+ /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ve(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,n=t=>{e.preventDefault(),se.current[t]?.focus()},i=()=>{e.preventDefault(),le.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Ve());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ve()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${me} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
14
14
  /* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
15
- return S("div",{ref:ae,className:"relative",children:[
16
- /* @__PURE__ */O("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":z||void 0,"aria-describedby":Ee,"aria-label":Y,"aria-labelledby":Z,title:P,disabled:U,"aria-readonly":G||void 0,onClick:()=>te?Pe():Ve(),onKeyDown:t=>{if(!U&&!G)switch(t.key){case"ArrowDown":return t.preventDefault(),void(te?ie(e=>n(Ie,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(te?ie(e=>n(Ie,e,-1)):Ve());case"Home":return void(te&&(t.preventDefault(),ie(e(Ie))));case"End":return void(te&&(t.preventDefault(),ie(r(Ie))));case"Enter":return void(te&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(te?We(ne):Ve());case"Escape":return void(te&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return te&&ue&&!t.shiftKey?(t.preventDefault(),void se.current[0]?.focus()):void(te&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:s({invalid:z,size:A,readOnly:G,auto:je,className:`${G?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
17
- /* @__PURE__ */S("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
18
- /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),Q&&/* @__PURE__ */O("span",{id:$e,hidden:!0,children:be.select.changed}),je&&/* @__PURE__ */O("span",{id:Te,hidden:!0,children:be.settingView.auto}),!G&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
19
- /* @__PURE__ */S("select",{ref:ee,value:l,multiple:V||void 0,onChange:e=>Oe(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:U,"aria-hidden":"true",tabIndex:-1,className:"sr-only",..._,children:[void 0!==C&&!V&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:C}),
20
- /* @__PURE__ */O(R,{items:w})]}),te&&I(qe,document.body)]})}),B=w(function({touchSize:e="touch",...t},r){const n=u();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(C,{ref:r,...t,size:e}):/* @__PURE__ */O(z,{ref:r,...t}):/* @__PURE__ */O(z,{ref:r,...t,size:e})});export{C as NativeSelect,B as Select_default};
15
+ return I("div",{ref:ae,className:"relative",children:[
16
+ /* @__PURE__ */O("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":z||void 0,"aria-describedby":Te,"aria-label":Y,"aria-labelledby":Z,title:V,disabled:K,"aria-readonly":G||void 0,onClick:()=>te?Ve():We(),onKeyDown:t=>{if(!K&&!G)switch(t.key){case"ArrowDown":return t.preventDefault(),void(te?ie(e=>n(Ce,e,1)):We());case"ArrowUp":return t.preventDefault(),void(te?ie(e=>n(Ce,e,-1)):We());case"Home":return void(te&&(t.preventDefault(),ie(e(Ce))));case"End":return void(te&&(t.preventDefault(),ie(r(Ce))));case"Enter":return void(te&&(t.preventDefault(),Fe(ne)));case" ":return t.preventDefault(),void(te?Fe(ne):We());case"Escape":return void(te&&(t.preventDefault(),t.stopPropagation(),Ve()));case"Tab":return te&&ue&&!t.shiftKey?(t.preventDefault(),void se.current[0]?.focus()):void(te&&Ve(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:s({invalid:z,size:A,readOnly:G,auto:je,className:`${G?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
17
+ /* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
18
+ /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),Q&&/* @__PURE__ */O("span",{id:$e,hidden:!0,children:be.select.changed}),je&&/* @__PURE__ */O("span",{id:Ee,hidden:!0,children:be.settingView.auto}),!G&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
19
+ /* @__PURE__ */I("select",{ref:ee,value:l,multiple:W||void 0,onChange:e=>Oe(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",..._,children:[void 0!==H&&!W&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:H}),
20
+ /* @__PURE__ */O(R,{items:w})]}),te&&C(qe,document.body)]})}),B=w(function({touchSize:e="touch",...t},r){const n=u();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(H,{ref:r,...t,size:e}):/* @__PURE__ */O(z,{ref:r,...t}):/* @__PURE__ */O(z,{ref:r,...t,size:e})});export{H as NativeSelect,B as Select_default};
@@ -1,9 +1,9 @@
1
- import{useShellLocale as e}from"./chunk-ETSKG62F.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as a,Children as d}from"react";import{jsxs as t,jsx as i}from"react/jsx-runtime";var n={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:g="",style:x,tone:y="neutral"}){const f=n[m??(o?"md":"none")],N=a(),v=a(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,A=w||k,C=A?"section":"div",B=`rounded-(--radius-card) border ${l[y]} bg-white shadow-sm ${h}`.trim(),E=d.toArray(e).length>0,F=E?"border-b border-gray-100 ":"",G="current"===y,H=G?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",K=G?"rounded-t-(--radius-card) bg-blue-50 ":"",L=`${F}${K}${f.edge} ${H}`;/* @__PURE__ */
2
- return t(C,{className:B,style:x,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...G?{"aria-current":!0}:{},children:[$?
3
- /* @__PURE__ */t("div",{className:`${F}${K}${f.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${H}`,children:[w?/* @__PURE__ */i(j,{id:N,children:r}):/* @__PURE__ */i("span",{children:r}),u]}):w?/* @__PURE__ */i(j,{id:N,className:H,children:r}):/* @__PURE__ */i("div",{className:H,children:r}),
1
+ import{useShellLocale as e}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as a,Children as d}from"react";import{jsxs as t,jsx as i}from"react/jsx-runtime";var n={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:g="",style:x,tone:y="neutral"}){const f=n[m??(o?"md":"none")],N=a(),v=a(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,C=null!=p&&""!==p,k=w||C,A=k?"section":"div",O=`rounded-(--radius-card) border ${l[y]} bg-white shadow-sm ${h}`.trim(),B=d.toArray(e).length>0,E=B?"border-b border-gray-100 ":"",G="current"===y,H=G?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=G?"rounded-t-(--radius-card) bg-blue-50 ":"",M=`${E}${L}${f.edge} ${H}`;/* @__PURE__ */
2
+ return t(A,{className:O,style:x,...C?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&k?{"aria-describedby":v}:{},...G?{"aria-current":!0}:{},children:[$?
3
+ /* @__PURE__ */t("div",{className:`${E}${L}${f.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${H}`,children:[w?/* @__PURE__ */i(j,{id:N,children:r}):/* @__PURE__ */i("span",{children:r}),u]}):w?/* @__PURE__ */i(j,{id:N,className:H,children:r}):/* @__PURE__ */i("div",{className:H,children:r}),
4
4
  /* @__PURE__ */i("p",{id:v,className:G?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-gray-500",children:s})]}):null!=r&&(null!=u?
5
- /* @__PURE__ */t("div",{className:`${L} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */i(j,{id:N,children:r}):/* @__PURE__ */i("span",{children:r}),u]}):w?
6
- /* @__PURE__ */i(j,{id:N,className:L,children:r}):/* @__PURE__ */i("div",{className:L,children:r})),E&&/* @__PURE__ */i("div",{className:[f.body,g].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */i("div",{className:`border-t border-gray-100 ${f.edge}`,children:c})]})}function c({label:a,value:d,icon:n,delta:l,className:s=""}){const c=e(),o="number"==typeof d&&c?r(d,c):d,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
5
+ /* @__PURE__ */t("div",{className:`${M} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */i(j,{id:N,children:r}):/* @__PURE__ */i("span",{children:r}),u]}):w?
6
+ /* @__PURE__ */i(j,{id:N,className:M,children:r}):/* @__PURE__ */i("div",{className:M,children:r})),B&&/* @__PURE__ */i("div",{className:[f.body,g].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */i("div",{className:`border-t border-gray-100 ${f.edge}`,children:c})]})}function c({label:a,value:d,icon:n,delta:l,className:s=""}){const c=e(),o="number"==typeof d&&c?r(d,c):d,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
7
7
  return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
8
8
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-gray-500",children:[
9
9
  /* @__PURE__ */i("span",{className:"text-xs font-medium uppercase tracking-wide",children:a}),n]}),
@@ -0,0 +1,8 @@
1
+ import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-Y4MI6NRI.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-P5BOTIJU.js";import{CartesianPlot as s}from"./chunk-RSO67DWS.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-E6UCGCOC.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:j,formatValue:C,yAxisLabel:F,className:L,emptyLabel:A,radius:S=3,loading:O=!1,animate:R=!0,glow:V=!1,emphasise:z=!1,activeKey:E,highlight:T="none",valueLabels:Y=!1,onSelect:B,min:I,formatTooltipValue:U,tooltipLabels:W,barGap:G=4,seriesLabels:H=!1}){const D=x(),{highlighted:J}=r(),K=d().charts,P=f(),Q=C??(t=>p(t,P)),Z=U??Q;if(O)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:L});const q=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},X=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>X.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>X.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>X.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:X.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,X.length),n=X.length>1?Math.min(G,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=H&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>X.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
2
+ return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
3
+ return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:j,min:nt?void 0:I,formatValue:nt?t=>b(Math.round(100*t),0,P):Q,yAxisLabel:F,className:L,emptyLabel:A,onSelect:B,ariaLabel:K.acrossCategories(X.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:W?.[t]??v[t],rows:X.map(e=>({key:e.key,label:e.label,color:q(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,P)} · ${Z(e.data[t])}`:Z(e.data[t]):void 0})),footnote:nt?K.inCategory(Z(tt[t])):void 0}),overlay:Y&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),Y&&!nt&&v.map((a,n)=>{if(k){if(!X.some(t=>Number.isFinite(t.data[n])))return null;const a=X.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
4
+ return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(a)},`v${n}`)}return X.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
5
+ return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=E?v.indexOf(E):-1,c=l(k?tt:X[0]?.data??[],T),d=s??(h>=0?h:c);/* @__PURE__ */
6
+ return M("g",{children:[
7
+ /* @__PURE__ */y(t,{id:D,glow:V}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return X.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=q(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),j=null===d||d===l,C=j?p:z?u.muted:p,F=o(t.key,J);/* @__PURE__ */
8
+ return y("rect",{x:M,y:v,width:g,height:w,rx:S,fill:C,fillOpacity:F??(j?1:z?.32:.45),filter:V&&d===l?`url(#${n(D)})`:void 0,className:"rosh-viz-mark"+(R?` ${e.rise}`:""),style:R?a(l*(k?1:X.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!z&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
@@ -1,4 +1,4 @@
1
- import{StatCard as e,Card as a}from"./chunk-PWOFYFMO.js";import{Avatar as t}from"./chunk-DO6XTJ77.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-MKITHLDU.js";import{ColumnChart as l}from"./chunk-UBVFIIXS.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-D323R2FT.js";import{TH_ONE_LINE as c}from"./chunk-6KO5VTL7.js";import{Button_default as n}from"./chunk-4IU5BSVE.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
1
+ import{StatCard as e,Card as a}from"./chunk-VU6VPKM3.js";import{Avatar as t}from"./chunk-MMFJBWJC.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-NID6MGGC.js";import{ColumnChart as l}from"./chunk-W5M6P4DZ.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-D323R2FT.js";import{TH_ONE_LINE as c}from"./chunk-6KO5VTL7.js";import{Button_default as n}from"./chunk-4IU5BSVE.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
2
2
  return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
3
3
  /* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */m("div",{children:[
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as i}from"./chunk-ETSKG62F.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as i}from"./chunk-E6UCGCOC.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
2
  return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
3
  /* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
4
  /* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-B55IXYDR.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-PJCVNFWM.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:D="",autoFocus:H=!0}){const L=s(null),j=a(),[A,S]=d(null),C=s(w);C.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),W=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!W.current&&H&&(W.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,H]),m(()=>{if(H)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[H]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>L.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const F=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),T=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:T,onClose:w,className:D,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:F,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-53ROHXAV.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-O6JX6RDX.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),A=a(),[j,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),T=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!T.current&&D&&(T.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),X=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:X,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as r}from"./chunk-ETSKG62F.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as r}from"./chunk-E6UCGCOC.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
2
2
  return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
3
3
  return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
4
4
  return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
@@ -1,6 +1,6 @@
1
- import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-ETSKG62F.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsx as o,jsxs as h}from"react/jsx-runtime";function c({rows:c,max:u,formatValue:d,emphasisKey:p,highlight:g="none",emphasisTone:x,barHeight:f=12,rowGap:y=30,animate:b=!0,labelFont:N="sans",className:k,emptyLabel:v}){const $=i().charts,j=r(),w=d??(e=>m(e,j)),F=v??$.nothingToRank;if(0===c.length)/* @__PURE__ */
2
- return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:F});const M=t(c.map(e=>e.value),g),R=p??(null===M?void 0:c[M]?.key),C=u??Math.max(...c.map(e=>e.value).filter(Number.isFinite),0),T=s(0);/* @__PURE__ */
3
- return o("ol",{className:`m-0 list-none p-0 ${k??""}`,style:{display:"grid",rowGap:`${Math.max(4,y-f)}px`},children:c.map((t,i)=>{const r=t.key===R,m=r?x?l[x]:s(1):R?n.muted:T,c=Number.isFinite(t.value)?t.value:null,u=null!==c&&C>0?Math.max(0,Math.min(1,c/C)):0;/* @__PURE__ */
1
+ import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-E6UCGCOC.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsx as o,jsxs as h}from"react/jsx-runtime";function c({rows:c,max:u,formatValue:d,emphasisKey:p,highlight:g="none",emphasisTone:x,barHeight:f=12,rowGap:y=30,animate:b=!0,labelFont:N="sans",className:k,emptyLabel:v}){const $=i().charts,j=r(),w=d??(e=>m(e,j)),C=v??$.nothingToRank;if(0===c.length)/* @__PURE__ */
2
+ return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:C});const M=t(c.map(e=>e.value),g),F=p??(null===M?void 0:c[M]?.key),R=u??Math.max(...c.map(e=>e.value).filter(Number.isFinite),0),G=s(0);/* @__PURE__ */
3
+ return o("ol",{className:`m-0 list-none p-0 ${k??""}`,style:{display:"grid",rowGap:`${Math.max(4,y-f)}px`},children:c.map((t,i)=>{const r=t.key===F,m=r?x?l[x]:s(1):F?n.muted:G,c=Number.isFinite(t.value)?t.value:null,u=null!==c&&R>0?Math.max(0,Math.min(1,c/R)):0;/* @__PURE__ */
4
4
  return h("li",{className:"grid gap-1",children:[
5
5
  /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-3",children:[
6
6
  /* @__PURE__ */h("span",{className:`truncate ${"mono"===N?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:t.label,children:[t.label,r&&/* @__PURE__ */o("span",{className:"sr-only",children:` ${$.emphasised}`})]}),
@@ -0,0 +1,14 @@
1
+ import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-E6UCGCOC.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const N=o().charts,L=i(),S=y??(e=>h(e,L)),j=A??N.noStages,z=c(),[C,V]=m(null),{highlighted:w}=e(),E=s(null),F=l(E,560),U=$??F;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const W=b??a(0),Z=p??54*x.length,B=Math.max(...x.map(e=>e.value),1),H="bars"===v,O=H?Math.round(Math.min(132,Math.max(80,.24*U))):Math.round(Math.min(168,Math.max(104,.38*U))),P=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},R=e=>{const t=P(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},T=H?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=R(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,Y=U-O-T,G=Math.max(H?2:0,Math.min(M,Y)),I=e=>Math.max(G,Y*Math.max(0,e/B)),J=e=>I(e)/2,Q=O+Y/2,X=e=>46+e/Math.max(1,x.length-1)*54,q=e=>`color-mix(in oklab, ${W} ${X(e).toFixed(0)}%, ${n.surface})`,D=e=>X(e)>=55?n.surface:n.label,K=(e,t)=>null!==C?C!==e:null!==w&&w!==t,_=null!==C?x[C]:void 0;/* @__PURE__ */
2
+ return f("div",{className:`relative ${k??""}`,ref:E,children:[
3
+ /* @__PURE__ */f("svg",{width:"100%",height:Z,viewBox:`0 0 ${U} ${Z}`,role:"img","aria-labelledby":z,onMouseLeave:()=>V(null),children:[
4
+ /* @__PURE__ */d("title",{id:z,children:N.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*Z/x.length+g/2,a=(t+1)*Z/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(H){const u=O,h=u+I(e.value),{count:c,drop:m}=R(t);/* @__PURE__ */
5
+ return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>V(t),children:[
6
+ /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:q(t)}),
7
+ /* @__PURE__ */d("text",{x:O-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:D(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
+ /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
+ /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=J(e.value),c="cone"===v?J(x[t+1]?.value??e.value):h,m=P(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
+ return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>V(t),children:[
11
+ /* @__PURE__ */d("path",{d:`M${Q-h},${l} L${Q+h},${l} L${Q+c},${a} L${Q-c},${a} Z`,fill:q(t)}),
12
+ /* @__PURE__ */d("text",{x:O-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
+ /* @__PURE__ */f("text",{x:O-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
+ /* @__PURE__ */d("text",{x:s?Q:Q+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?D(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==C&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:N.count,color:q(C),value:S(_.value)},{key:"share",label:N.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...C>0&&x[C-1].value>0?[{key:"drop",label:N.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[C-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-WDXJWC3Y.js";import{jsxs as t,jsx as a,Fragment as i}from"react/jsx-runtime";var r="relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",n="text-blue-600",s="text-gray-600 hover:text-gray-900";function l({item:e,active:r,caret:n}){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-255BENW2.js";import{jsxs as t,jsx as a,Fragment as i}from"react/jsx-runtime";var r="relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",n="text-blue-600",s="text-gray-600 hover:text-gray-900";function l({item:e,active:r,caret:n}){/* @__PURE__ */
2
2
  return t(i,{children:[e.icon&&/* @__PURE__ */a("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
3
3
  /* @__PURE__ */a("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */a("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */a("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),r&&/* @__PURE__ */a("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function c({items:i,activeKey:c,onSelect:m,brand:d,actions:o,linkAs:u,className:b}){/* @__PURE__ */
4
4
  return t("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${b??""}`,children:[d&&/* @__PURE__ */a("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:d}),
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-PWOFYFMO.js";import{Select_default as l}from"./chunk-4PZN25MV.js";import{Input_default as a}from"./chunk-UNEJ2ABD.js";import{FormField as r}from"./chunk-MVQBVPWP.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Banner as c}from"./chunk-24L7NLA3.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-VU6VPKM3.js";import{Select_default as l}from"./chunk-VTVOQS5L.js";import{Input_default as a}from"./chunk-UNEJ2ABD.js";import{FormField as r}from"./chunk-MVQBVPWP.js";import{Checkbox_default as i}from"./chunk-CGZBDI6C.js";import{Banner as c}from"./chunk-WTY3SXO7.js";import{Button_default as d}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=s(!0),[p,u]=s("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,15 +1,15 @@
1
- import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-OZPYTSPD.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-KIBL6M3T.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-ETSKG62F.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const S=t.map(e=>a(e.date)).filter(e=>null!=e),x=l(Date.now,null)??Math.max(0,...S,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),P=S.length?Math.min(...S):x,D=S.length?Math.max(...S):x,C=a(r??null)??P,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),T=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),q=(()=>{const e=[R,D,T,C+i];return O||e.push(x),Math.max(...e)})(),A=Math.max(1,Math.round((q-C)/i)),I=a(p??null)??D??C,L=Math.min(Math.max(y??I,C),q),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=L})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>L){$=t[e];break}}const F=(()=>{if(j||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(C).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=j??F,K=j?a(j.date):F?C:null,z=$?a($.date):null,B=!!(E&&$&&null!=K&&null!=z&&L>K&&L<z);let G,J;if(B&&null!=K&&null!=z){const e=(L-K)/Math.max(z-K,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,G={id:`interp-${L}`,progress_number:_.estimated,date:new Date(L).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},J=E}else if(G=E??t[t.length-1]??null,G){const e=t.findIndex(e=>e.id===G.id);J=e>=0&&e<t.length-1?t[e+1]:null}else J=null;const Y={};for(const e of J?.items??[])Y[e.part_number]=e;const H=!(!d||G?.id===d),U=d?Math.min(a(p??null)??q,q):q,V=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:C,endMs:q,totalLeadDays:A,scrubMs:L,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:E,nextAfter:$,displayed:G,prevReport:J,prevByPN:Y,isInterpolated:B,playing:v,startPlay:()=>{if(v)return void N();if(U<=C)return void f(U);M(!0),f(C);let e=performance.now(),t=C;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=U)return f(U),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:V,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),S=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),x=new Map(N.map(({report:e,ms:t})=>[e.id,t])),P=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
- return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:S,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=x.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:P,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:S,variant:x="card",onPlayStart:P}){const{reports:D,markers:C,poNumber:R,startMs:O,endMs:T,totalLeadDays:q,scrubMs:A,setScrubMs:I,displayed:L,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:K}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,P),B=c().production,G=d(),J=_??B.heading,Y=e=>o(e,G);if(0===D.length&&0===C.length)return null;const H=C.filter(e=>"shipment"===e.kind),U=C.filter(e=>"inspection"===e.kind),V=C.filter(e=>"invoice"===e.kind),X=(L?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=L?v(L):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
1
+ import{TimelineCard as e}from"./chunk-SURSVJA2.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-DZNG34DC.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-YDEIXM2A.js";import{Icon as s}from"./chunk-KIBL6M3T.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-E6UCGCOC.js";import{useState as u,useEffect as m,useRef as g}from"react";import{jsxs as h,jsx as b,Fragment as y}from"react/jsx-runtime";var k=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),f=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function _(e){if(e.order_qty<=0)return 0;let t=0;for(const r of f)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function v(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+_(t),0)/t.length}function M(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:o,poNumber:s="",currentReportId:d,currentReportDate:p,msPerDayOfPlayback:h=500,markers:b=[]}=e,[y,f]=u(null),_=c().production;m(()=>{p?f(new Date(p).getTime()):t.length>0&&f(new Date(t[0].date).getTime())},[d]);const[v,M]=u(!1),w=g(null),N=()=>{null!=w.current&&(cancelAnimationFrame(w.current),w.current=null),M(!1)};m(()=>()=>N(),[]),m(()=>{N()},[d]);const x=t.map(e=>a(e.date)).filter(e=>null!=e),C=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),S=x.length?Math.min(...x):C,D=x.length?Math.max(...x):C,P=a(r??null)??S,R=a(n??null)??0,O=k.has((o||"").toLowerCase()),q=b.reduce((e,t)=>{const r=a(t.date);return null!=r&&r>e?r:e},0),T=(()=>{const e=[R,D,q,P+i];return O||e.push(C),Math.max(...e)})(),A=Math.max(1,Math.round((T-P)/i)),I=a(p??null)??D??P,L=Math.min(Math.max(y??I,P),T),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=L})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>L){$=t[e];break}}const F=(()=>{if(j||!$||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${s}`,progress_number:_.start,date:r||new Date(P).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),E=j??F,G=j?a(j.date):F?P:null,z=$?a($.date):null,B=!!(E&&$&&null!=G&&null!=z&&L>G&&L<z);let J,K;if(B&&null!=G&&null!=z){const e=(L-G)/Math.max(z-G,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of E?.items??[])r[e.part_number]=e;const n={};for(const e of $?.items??[])n[e.part_number]=e;const o=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const o=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:o.description??i.description??"",order_qty:s(o.order_qty??i.order_qty??0),casting:t(s(o.casting),s(i.casting)),cnc:t(s(o.cnc),s(i.cnc)),painting:t(s(o.painting),s(i.painting)),packing:t(s(o.packing),s(i.packing)),finished_goods:t(s(o.finished_goods),s(i.finished_goods)),stock_qty:t(s(o.stock_qty),s(i.stock_qty))}}),i=a(E?.est_completion_date),s=a($?.est_completion_date);let l;l=null!=i&&null!=s?new Date(Math.round(i+(s-i)*e)).toISOString().slice(0,10):E?.est_completion_date||$?.est_completion_date||null,J={id:`interp-${L}`,progress_number:_.estimated,date:new Date(L).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},K=E}else if(J=E??t[t.length-1]??null,J){const e=t.findIndex(e=>e.id===J.id);K=e>=0&&e<t.length-1?t[e+1]:null}else K=null;const U={};for(const e of K?.items??[])U[e.part_number]=e;const H=!(!d||J?.id===d),V=d?Math.min(a(p??null)??T,T):T,X=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:P,endMs:T,totalLeadDays:A,scrubMs:L,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:E,nextAfter:$,displayed:J,prevReport:K,prevByPN:U,isInterpolated:B,playing:v,startPlay:()=>{if(v)return void N();if(V<=P)return void f(V);M(!0),f(P);let e=performance.now(),t=P;const r=n=>{const a=n-e;if(e=n,t+=a/h*i,t>=V)return f(V),w.current=null,void M(!1);f(t),w.current=requestAnimationFrame(r)};w.current=requestAnimationFrame(r)},stopPlay:N,reports:t,markers:b,poNumber:s,currentReportId:d,currentReportProgressNumber:X,estCompletionMs:a(n??null)}}function w({startMs:e,endMs:t,reports:r,markers:a,valueMs:i,activeId:s,onChange:l,onPickReport:p,onOpenReport:u,onOpenMarker:m,onDragStart:g,renderReportPreview:h,reportLabel:y,playback:k,edgeCaptions:f,bare:_=!1,endMark:v=null}){const M=c().production,w=d(),N=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),x=N.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:y(e),preview:e.preview??h?.(e),onOpen:u?()=>u(e.id):void 0})),C=new Map(N.map(({report:e,ms:t})=>[e.id,t])),S=N.map(({ms:e})=>e),D=m?a.map(e=>({...e,onOpen:m})):a;/* @__PURE__ */
2
+ return b("div",{className:"select-none",children:/* @__PURE__ */b(n,{axis:_?"spread":"linear",labels:_?"none":"active",endMark:_?v:null,items:x,markers:D,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=C.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:S,ariaLabel:M.scrub,valueText:e=>{const t=(e=>N.find(t=>t.ms===e)?.report)(e);return t?`${y(t)} · ${o(e,w)}`:o(e,w)}},ariaLabel:M.label(o(e,w),o(t,w))})})}function N({snapshot:n,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,onScrubProgress:f,heading:_,edgeCaptions:M,reportLabel:N=e=>e.progress_number,resetLabel:x,variant:C="card",onPlayStart:S}){const{reports:D,markers:P,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:A,setScrubMs:I,displayed:L,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:E,estCompletionMs:G}=n,z=function(e,t,r){const[n,a]=u(!1),o=g(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),o.current||(o.current=!0,t(e[0])),a(!0))},stop:()=>{o.current=!1,a(!1)}}}(D.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,S),B=c().production,J=d(),K=_??B.heading,U=e=>o(e,J);if(0===D.length&&0===P.length)return null;const H=P.filter(e=>"shipment"===e.kind),V=P.filter(e=>"inspection"===e.kind),X=P.filter(e=>"invoice"===e.kind),Y=(L?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=L?v(L):0,Q=D.find(e=>e.id===F),W=Q?N(Q):E,ee=
3
3
  /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?B.pause:B.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[z.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
- /* @__PURE__ */b("span",{children:z.playing?B.pause:B.play})]}),te=j&&(S??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:S??B.backTo(String(W))}):null,[re,ne]=p(B.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:L?/* @__PURE__ */h(y,{children:[e&&re,
4
+ /* @__PURE__ */b("span",{children:z.playing?B.pause:B.play})]}),te=j&&(x??W)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{z.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:x??B.backTo(String(W))}):null,[re,ne]=p(B.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:L?/* @__PURE__ */h(y,{children:[e&&re,
5
5
  /* @__PURE__ */b("b",{className:"font-medium",children:N(L)}),e&&ne,
6
- /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",Y(new Date(L.date).getTime())," · ",B.overall(Math.round(Z))," · ",B.inStock(X)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:B.noReport})});if("rail"===x){const e=null!=K&&K>=T&&T>O,t=e?{key:"__estimate__",label:B.estimatedCompletion,dateText:Y(K)}:null;/* @__PURE__ */
6
+ /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",U(new Date(L.date).getTime())," · ",B.overall(Math.round(Z))," · ",B.inStock(Y)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:B.noReport})});if("rail"===C){const e=null!=G&&G>=q&&q>O,t=e?{key:"__estimate__",label:B.estimatedCompletion,dateText:U(G)}:null;/* @__PURE__ */
7
7
  return h("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
8
- /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:T,reports:D,markers:C,valueMs:A,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??B.start,end:M?.end??(e?B.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
8
+ /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:D,markers:P,valueMs:A,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??B.start,end:M?.end??(e?B.estDone:void 0)},onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}}),
9
9
  /* @__PURE__ */h("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[ee,te,ae(!1)]})]})}/* @__PURE__ */
10
- return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:J,subject:R,meta:[`${Y(O)} → ${Y(T)}`,B.leadTime(q)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
10
+ return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:K,subject:R,meta:[`${U(O)} → ${U(q)}`,B.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
11
  /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[D.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
12
  /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),B.report]}),H.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
13
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),B.shipment]}),U.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),B.inspection]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),B.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:T,reports:D,markers:C,valueMs:A,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
13
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"truck"})}),B.shipment]}),V.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
14
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"flask"})}),B.inspection]}),X.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
15
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */b(t,{name:"receipt"})}),B.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:D,markers:P,valueMs:A,activeId:L?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:z.stop,playback:{playing:z.playing,onArrive:(e,t)=>I(t),onProgress:f,onStop:z.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
@@ -1,4 +1,4 @@
1
- import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-ETSKG62F.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
1
+ import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
2
2
  return i("div",{className:n,children:/* @__PURE__ */s("svg",{width:"100%",height:o,viewBox:`0 0 ${a} ${o}`,role:"img","aria-label":p,"aria-busy":"true",children:[
3
3
  /* @__PURE__ */i("defs",{children:/* @__PURE__ */s("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[
4
4
  /* @__PURE__ */i("stop",{offset:"0%",stopColor:r.surface,stopOpacity:"0"}),
@@ -1,7 +1,7 @@
1
- import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-ETSKG62F.js";import{formatPlain as l}from"./chunk-C3QOHMR6.js";import{jsxs as s,jsx as o}from"react/jsx-runtime";var d={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function i({label:i,value:m,unit:c,delta:h,deltaTone:p,trend:u,trendTone:g,footnote:x,className:f}){const y=r().charts,w=n(),N=null==h?null:h>0?"up":h<0?"down":"flat",b=p?t[p]:void 0,k=g?t[g]:a(0);/* @__PURE__ */
1
+ import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-E6UCGCOC.js";import{formatPlain as l}from"./chunk-C3QOHMR6.js";import{jsxs as s,jsx as o}from"react/jsx-runtime";var d={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function i({label:i,value:m,unit:c,delta:h,deltaTone:p,trend:u,trendTone:g,footnote:x,className:f}){const y=r().charts,w=n(),N=null==h?null:h>0?"up":h<0?"down":"flat",C=p?t[p]:void 0,b=g?t[g]:a(0);/* @__PURE__ */
2
2
  return s("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${f??""}`,children:[
3
3
  /* @__PURE__ */o("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i}),
4
4
  /* @__PURE__ */s("span",{className:"flex items-baseline gap-2",children:[
5
- /* @__PURE__ */o("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:m}),c&&/* @__PURE__ */o("span",{className:"text-sm font-medium text-gray-500",children:c})]}),N&&/* @__PURE__ */s("span",{className:"text-xs font-medium",style:b?{color:b}:void 0,children:[
5
+ /* @__PURE__ */o("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:m}),c&&/* @__PURE__ */o("span",{className:"text-sm font-medium text-gray-500",children:c})]}),N&&/* @__PURE__ */s("span",{className:"text-xs font-medium",style:C?{color:C}:void 0,children:[
6
6
  /* @__PURE__ */o("span",{"aria-hidden":"true",children:d[N].glyph})," ",l(Math.abs(h),w),
7
- /* @__PURE__ */s("span",{className:"sr-only",children:[" ",y[d[N].word]]})]}),u&&u.length>1&&/* @__PURE__ */o(e,{data:u,height:26,stroke:k,strokeWidth:2,className:"mt-2 w-full"}),x&&/* @__PURE__ */o("span",{className:"mt-1 text-xs text-gray-500",children:x})]})}export{i as StatTile};
7
+ /* @__PURE__ */s("span",{className:"sr-only",children:[" ",y[d[N].word]]})]}),u&&u.length>1&&/* @__PURE__ */o(e,{data:u,height:26,stroke:b,strokeWidth:2,className:"mt-2 w-full"}),x&&/* @__PURE__ */o("span",{className:"mt-1 text-xs text-gray-500",children:x})]})}export{i as StatTile};
@@ -1,3 +1,3 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as s}from"./chunk-ETSKG62F.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as u}from"react/jsx-runtime";var f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function h({open:h,onClose:x,title:p,description:b,role:g="dialog",children:v,footer:y,blocking:k=!1,size:N="md",initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const K=n(null),T=d(),D=d(),G=!k,I=d(),U=s().dialog;return r(h),i(K,h,j),t(h),c(()=>{if(h)return o(()=>(k||x(),!0),()=>K.current)},[h,k,x]),h?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
1
+ import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as u}from"react/jsx-runtime";var f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function h({open:h,onClose:x,title:p,description:b,role:g="dialog",children:v,footer:y,blocking:k=!1,size:N="md",initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const U=n(null),D=d(),G=d(),I=!k,K=d(),T=s().dialog;return r(h),i(U,h,j),t(h),c(()=>{if(h)return o(()=>(k||x(),!0),()=>U.current)},[h,k,x]),h?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
2
2
  /* @__PURE__ */u("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:k?void 0:e=>{e.target===e.currentTarget&&x()},children:/* @__PURE__ */m("div",{ref:K,...e({role:g,modal:!0,titleId:p?I:void 0,labelledBy:C,label:w}),"aria-describedby":L??(b?D:v?T:void 0),className:`relative max-h-full w-full ${f[N]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${W}`.trim(),children:[p&&/* @__PURE__ */u("h2",{id:I,className:(G?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:p}),b&&/* @__PURE__ */u("p",{id:D,className:((p?"mt-1":G?"pr-8":"")+" text-sm text-gray-500").trim(),children:b}),v&&/* @__PURE__ */u("div",{id:T,className:"mt-2 text-sm text-gray-600",children:v}),y&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:y}),G&&/* @__PURE__ */u("button",{type:"button",onClick:x,"aria-label":U.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */u(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}export{h as Dialog};
3
+ /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:k?void 0:e=>{e.target===e.currentTarget&&x()},children:/* @__PURE__ */m("div",{ref:U,...e({role:g,modal:!0,titleId:p?K:void 0,labelledBy:C,label:w}),"aria-describedby":L??(b?G:v?D:void 0),className:`relative max-h-full w-full ${f[N]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${W}`.trim(),children:[p&&/* @__PURE__ */u("h2",{id:K,className:(I?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:p}),b&&/* @__PURE__ */u("p",{id:G,className:((p?"mt-1":I?"pr-8":"")+" text-sm text-gray-500").trim(),children:b}),v&&/* @__PURE__ */u("div",{id:D,className:"mt-2 text-sm text-gray-600",children:v}),y&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:y}),I&&/* @__PURE__ */u("button",{type:"button",onClick:x,"aria-label":T.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */u(a,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}export{h as Dialog};
@@ -1 +1 @@
1
- import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-ETSKG62F.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,L]=n([]),b=r(0),A="string"==typeof d?d:"",j=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,A)});L(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,A,u,f,m,e,g]),k=s(()=>{h||y.current?.click()},[h]),z=s(()=>L([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>j(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),b.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(b.current=Math.max(0,b.current-1),0===b.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),b.current=0,v(!1),j(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),j(t))}},open:k,take:j,dragOver:x,rejections:D,clearRejections:z}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
1
+ import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-E6UCGCOC.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}function u({onAccept:e,accept:a,maxSizeBytes:u,maxFiles:f,multiple:p=!0,currentCount:m=0,acceptHint:d,disabled:h=!1}){const g=t().files,y=r(null),[x,v]=n(!1),[D,C]=n([]),L=r(0),b="string"==typeof d?d:"",A=s(t=>{if(h||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of p?r:r.slice(0,1))o(e,a)?null!=u&&e.size>u?s.push({file:e,reason:"size",message:g.tooLarge(e.name,l(e.size,g),l(u,g))}):p&&null!=f&&m+n.length>=f?s.push({file:e,reason:"count",message:g.tooMany(e.name,f)}):n.push(e):s.push({file:e,reason:"type",message:g.notAccepted(e.name,b)});C(s),n.length&&e(n),y.current&&(y.current.value="")},[h,p,a,b,u,f,m,e,g]),j=s(()=>{h||y.current?.click()},[h]),k=s(()=>C([]),[]);return{inputRef:y,inputProps:{ref:y,type:"file",accept:a||void 0,multiple:p,disabled:h,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:h?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,v(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),x||v(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&v(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,v(!1),A(e.dataTransfer.files))}},pasteProps:h?{}:{onPaste:e=>{const t=c(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:x,rejections:D,clearRejections:k}}function f({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{f as FileIntakeAlert,o as acceptsFile,l as humanSize,i as isFileDrag,c as pastedFiles,u as useFileIntake};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-36MUTG34.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-OSVN2UF7.js";import{Icon as n}from"./chunk-KIBL6M3T.js";import{useShellStrings as a}from"./chunk-ETSKG62F.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-KIBL6M3T.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":T,className:B=""}){const[C,F]=i(!1),G=o(null),K=a().copy;c(()=>()=>{G.current&&clearTimeout(G.current)},[]);const L=l(async()=>{await e(n)?(F(!0),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{F(!1),G.current=null},2e3),v?.(n)):t.error(K.failed)},[n,v,K]),{box:M,button:S}=p[g],U=!k;/* @__PURE__ */
4
- return m("div",{id:U?void 0:j,"aria-describedby":U?void 0:T,className:["inline-flex max-w-full items-center rounded-md",u[N],M,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[T,L]=i(!1),M=o(null),z=a().copy;c(()=>()=>{M.current&&clearTimeout(M.current)},[]);const A=l(async()=>{await e(n)?(L(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{L(!1),M.current=null},2e3),v?.(n)):t.error(z.failed)},[n,v,z]),{box:E,button:G}=p[g],H=!k;/* @__PURE__ */
4
+ return m("div",{id:H?void 0:j,"aria-describedby":H?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],E,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!k&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?K.copyLabel(x):K.copy,"aria-describedby":T,onClick:L,className:`${S} text-gray-400`,children:/* @__PURE__ */s(C?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:C?K.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?z.copyLabel(x):z.copy,"aria-describedby":C,onClick:A,className:`${G} text-gray-400`,children:/* @__PURE__ */s(T?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:T?z.copied:""})]})]})}export{y as Snippet};
@@ -1,8 +1,8 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-KIBL6M3T.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-ETSKG62F.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
2
- return h("button",{type:"button",onClick:e,"aria-label":r.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__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:w,"aria-label":j,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const K=n(null),z=d(),B=d(),D=d();if(r(o),i(K,o,w),t(o),c(()=>{if(o)return l(()=>(N||a(),!0),()=>K.current)},[o,N,a]),!o)return null;const G="bottom"===p,I=G?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
1
+ import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-KIBL6M3T.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
2
+ return h("button",{type:"button",onClick:e,"aria-label":r.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__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:w,"aria-label":j,"aria-labelledby":C,"aria-describedby":L,className:W=""}){const U=n(null),z=d(),B=d(),D=d();if(r(o),i(U,o,w),t(o),c(()=>{if(o)return l(()=>(N||a(),!0),()=>U.current)},[o,N,a]),!o)return null;const G="bottom"===p,I=G?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
3
3
  return m("div",{className:"fixed inset-0",style:{zIndex:s.overlay},role:"presentation",children:[
4
4
  /* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:N?void 0:a,"aria-hidden":"true"}),
5
- /* @__PURE__ */m("div",{ref:K,...e({modal:!0,titleId:g?D:void 0,labelledBy:C,label:j}),"aria-describedby":L??(y?B:k?z:void 0),"data-drawer-side":p,style:I,className:["fixed flex flex-col bg-white shadow-xl",G?"":`w-full max-w-full ${f[x]}`,u[p],G?"rounded-t-xl":"",W].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
5
+ /* @__PURE__ */m("div",{ref:U,...e({modal:!0,titleId:g?D:void 0,labelledBy:C,label:j}),"aria-describedby":L??(y?B:k?z:void 0),"data-drawer-side":p,style:I,className:["fixed flex flex-col bg-white shadow-xl",G?"":`w-full max-w-full ${f[x]}`,u[p],G?"rounded-t-xl":"",W].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
6
6
  /* @__PURE__ */m("div",{className:"min-w-0",children:[
7
7
  /* @__PURE__ */h("h2",{id:D,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:B,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!N&&/* @__PURE__ */h(b,{onClose:a})]}):!N&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
8
8
  /* @__PURE__ */m("div",{id:z,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:B,className:("mb-3 text-sm text-gray-500 "+(N?"":"pr-8")).trim(),children:y}),k]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
@@ -1,4 +1,4 @@
1
- import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as a}from"./chunk-6WNQ5ENK.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-ETSKG62F.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
1
+ import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{CartesianPlot as a}from"./chunk-RSO67DWS.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-E6UCGCOC.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
2
2
  return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
3
3
  return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
4
4
  /* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
@@ -1,2 +1,2 @@
1
- import{toast_default as t}from"./chunk-OSVN2UF7.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(R(),F()):"none"!==t&&0!==m||R()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&F())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),R())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);R(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function F(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function R(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function V(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,q=[],J=!1,L=null,U=/* @__PURE__ */new Set;function X(){for(const t of U)t()}function $(t){q=t,X()}function z(){const t=W;return t?L=t.list().then(e=>{W===t&&(q=e,J=!0,X())}).catch(()=>{W===t&&(J=!0,X())}).finally(()=>{L=null}):(q=[],J=!0,X(),Promise.resolve())}function H(t){W=t,q=[],J=!1,t?z():X()}function Q(t){return U.add(t),!W||J||L||z(),()=>{U.delete(t)}}function Y(){return q}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(Q,Y,Y),i=o(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+E(),a=K(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);$(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:K()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=W;if(!n)return t.removeTask(e);const o=q;$(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!W)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,V as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
1
+ import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-4NXMMWL6.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",W="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function E(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var K=null,L=[],X=!1,q=null,J=/* @__PURE__ */new Set;function $(){for(const t of J)t()}function z(t){L=t,$()}function H(){const t=K;return t?q=t.list().then(e=>{K===t&&(L=e,X=!0,$())}).catch(()=>{K===t&&(X=!0,$())}).finally(()=>{q=null}):(L=[],X=!0,$(),Promise.resolve())}function Q(t){K=t,L=[],X=!1,t?H():$()}function U(t){return J.add(t),!K||X||q||H(),()=>{J.delete(t)}}function Y(){return L}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=E(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:E()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(t=>{const n=K;if(!n)return e.addTask(t);const o="tmp-"+j(),a=E(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...L,r]),n.create({...t,name:t.name.trim()}).then(t=>z(L.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z(L.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=K;if(!o)return e.updateTask(t,n);z(L.map(e=>e.id===t?{...e,...n,id:t,updatedAt:E()}:e)),o.update(t,n).catch(()=>{H()})},[e]),l=o(t=>{const n=K;if(!n)return e.removeTask(t);const o=L;z(L.filter(e=>e.id!==t)),n.remove(t).catch(()=>z(o))},[e]),s=o(t=>{if(!K)return e.toggleDone(t);const n=L.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{K||e.setAllTasks(t)},[e]);return null===K?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(W))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(W,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(W,"1");const a=E(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(W,"1")}catch{try{localStorage.setItem(W,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,Q as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};