efficient-shell 11.11.0 → 12.0.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 (372) hide show
  1. package/README.md +10 -12
  2. package/dist/{Browser-NRGJ53ST.js → Browser-CXZAXF55.js} +17 -17
  3. package/dist/Calculator-TKQRQGTI.js +29 -0
  4. package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-WFC3TAL4.js} +9 -9
  5. package/dist/Files-QM5PW6BX.js +88 -0
  6. package/dist/{Notepad-2XW63REV.js → Notepad-B7CKQ54M.js} +9 -9
  7. package/dist/PdfViewer-3UEC5TNN.js +1 -0
  8. package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-JMJORKWZ.js} +68 -68
  9. package/dist/{Preview-K7KDM4XK.js → Preview-OELV5X55.js} +30 -30
  10. package/dist/Sidebar-SZ5OGL6C.js +44 -0
  11. package/dist/{Stock-IHAG62QV.js → Stock-R3436P6X.js} +3 -3
  12. package/dist/{Weather-EQDFEBIH.js → Weather-6N3ZPO2Q.js} +20 -20
  13. package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-BJKYHGLS.js} +6 -6
  14. package/dist/ai/index.js +91 -91
  15. package/dist/apps/index.d.ts +26 -25
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChartBrush.js +1 -1
  24. package/dist/charts/ChartFrame.js +1 -1
  25. package/dist/charts/ChartSkeleton.js +1 -1
  26. package/dist/charts/ChartTooltip.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/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/{chunk-7V32O5NF.js → chunk-2UO47XB4.js} +14 -30
  47. package/dist/{chunk-X2DUOIJP.js → chunk-33F35NNM.js} +1 -1
  48. package/dist/{chunk-FUHURDBL.js → chunk-34AHFST2.js} +1 -1
  49. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  50. package/dist/{chunk-JG26ICX6.js → chunk-3LGPZAVU.js} +2 -2
  51. package/dist/{chunk-3JCOD5L2.js → chunk-3YQICVUP.js} +2 -2
  52. package/dist/{chunk-5B4GRLAA.js → chunk-46EBZ7YI.js} +1 -1
  53. package/dist/{chunk-AHITTM6W.js → chunk-46VLN6KC.js} +1 -1
  54. package/dist/{chunk-E3EHHR73.js → chunk-4ALGGYHV.js} +9 -9
  55. package/dist/{chunk-QOJ2UNS5.js → chunk-4DDL6NXB.js} +1 -1
  56. package/dist/{chunk-62BDGAML.js → chunk-4K7BA3PD.js} +6 -6
  57. package/dist/chunk-4LNO444F.js +11 -0
  58. package/dist/{chunk-225LCPO7.js → chunk-4MERJIJJ.js} +1 -1
  59. package/dist/chunk-56YJIKVI.js +11 -0
  60. package/dist/{chunk-VEGZVUHE.js → chunk-5EWKVVUD.js} +1 -1
  61. package/dist/chunk-5PDHKH2A.js +3 -0
  62. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  63. package/dist/{chunk-6DQANKTL.js → chunk-62RAGXWK.js} +9 -9
  64. package/dist/{chunk-NMQGAP3H.js → chunk-63ZLF7LS.js} +1 -1
  65. package/dist/chunk-6E47JSLM.js +22 -0
  66. package/dist/{chunk-3PZI2C4R.js → chunk-6HO7244M.js} +1 -1
  67. package/dist/{chunk-3ZRYKZGI.js → chunk-6KGIHI6X.js} +10 -10
  68. package/dist/{chunk-OLJUPBY4.js → chunk-6MWLOLLP.js} +1 -1
  69. package/dist/{chunk-K6D7OSKZ.js → chunk-7P2WKDGB.js} +14 -14
  70. package/dist/{chunk-ESWR7YNY.js → chunk-A34PD3XT.js} +16 -16
  71. package/dist/{chunk-KVVZLEUG.js → chunk-A3AKJDLI.js} +1 -1
  72. package/dist/chunk-AEMAGYIZ.js +8 -0
  73. package/dist/{chunk-CLAKVFOB.js → chunk-AICGATHE.js} +48 -48
  74. package/dist/{chunk-57WQVUBX.js → chunk-AIJ6OR6X.js} +2 -2
  75. package/dist/{chunk-WOOKUEED.js → chunk-AQ3LCE2U.js} +1 -1
  76. package/dist/chunk-ATURDO2C.js +14 -0
  77. package/dist/chunk-B7WTHCTF.js +4 -0
  78. package/dist/{chunk-HRG4FYVU.js → chunk-BUHTLO2K.js} +1 -1
  79. package/dist/{chunk-CSLMWGFS.js → chunk-BYLGKRIT.js} +1 -1
  80. package/dist/{chunk-V64CJHMY.js → chunk-C4T4APD6.js} +22 -22
  81. package/dist/{chunk-TA4JGC5C.js → chunk-CCA4LQNB.js} +1 -1
  82. package/dist/{chunk-Y4RHGLXB.js → chunk-CFJL6MML.js} +1 -1
  83. package/dist/{chunk-KKJ55GUZ.js → chunk-CJ4U4C4A.js} +5 -5
  84. package/dist/{chunk-TZXAW32T.js → chunk-CRILBBSU.js} +1 -1
  85. package/dist/{chunk-D4RVWSUT.js → chunk-CRO56LVN.js} +1 -1
  86. package/dist/{chunk-DHMOJX2Z.js → chunk-D7DRZKUI.js} +1 -1
  87. package/dist/{chunk-SGBR443F.js → chunk-DD2ZGHCG.js} +6 -6
  88. package/dist/{chunk-42TLGG33.js → chunk-DSKROZST.js} +1 -1
  89. package/dist/{chunk-CDQUOCXO.js → chunk-DV4B26FJ.js} +1 -1
  90. package/dist/{chunk-VPEH3THH.js → chunk-DW5Y57I2.js} +3 -3
  91. package/dist/{chunk-CAIKDX2M.js → chunk-DWYCSJ6O.js} +2 -2
  92. package/dist/{chunk-UWJNQH2X.js → chunk-E47TNYYE.js} +1 -1
  93. package/dist/{chunk-IIKPM3F4.js → chunk-ED5D2O6E.js} +1 -1
  94. package/dist/{chunk-LXOX5FGH.js → chunk-EFBWQWUS.js} +2 -2
  95. package/dist/chunk-EJBR5Y4X.js +9 -0
  96. package/dist/{chunk-AQGIK2CV.js → chunk-EM6VZSNJ.js} +1 -1
  97. package/dist/{chunk-7R23EKON.js → chunk-EO3IKZCP.js} +1 -1
  98. package/dist/chunk-EOVXFXVV.js +2 -0
  99. package/dist/chunk-EZBE3H2W.js +9 -0
  100. package/dist/{chunk-PMKBWDXO.js → chunk-FGWHTNC3.js} +1 -1
  101. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  102. package/dist/{chunk-PZHO4FEN.js → chunk-GCRPI3AL.js} +1 -1
  103. package/dist/{chunk-6LK2BBCC.js → chunk-GEQC4ABV.js} +6 -6
  104. package/dist/{chunk-T74FGTLW.js → chunk-GHMDLZH4.js} +7 -7
  105. package/dist/chunk-GWDTGCQB.js +9 -0
  106. package/dist/{chunk-6LITLCVV.js → chunk-H34KI3HV.js} +9 -9
  107. package/dist/{chunk-LXQHTY3A.js → chunk-H3IGNWT7.js} +3 -3
  108. package/dist/{chunk-VZ52KKNA.js → chunk-HCKCQIWA.js} +6 -6
  109. package/dist/{chunk-R72ZKZDP.js → chunk-HK4QAI2A.js} +2 -2
  110. package/dist/{chunk-QEDVXD3L.js → chunk-HKPVHSZ3.js} +1 -1
  111. package/dist/{chunk-LGTYPLJM.js → chunk-HNUKXGYP.js} +3 -3
  112. package/dist/{chunk-B2AYI45X.js → chunk-HTB5AEZU.js} +6 -6
  113. package/dist/chunk-IJXMWWTM.js +9 -0
  114. package/dist/{chunk-AWQ5SOC5.js → chunk-IK37Q6LY.js} +1 -1
  115. package/dist/{chunk-EV7VAXMO.js → chunk-IS7C6OWZ.js} +9 -9
  116. package/dist/{chunk-YQLKZ5UQ.js → chunk-JAQO3TNE.js} +1 -1
  117. package/dist/chunk-JINTE3G4.js +1 -0
  118. package/dist/{chunk-SKRFI6WB.js → chunk-JQHL4B4C.js} +12 -12
  119. package/dist/{chunk-KZEIQO3V.js → chunk-JSUL7UON.js} +3 -3
  120. package/dist/{chunk-ZOQVYSTB.js → chunk-K46DLEIX.js} +22 -22
  121. package/dist/{chunk-Q7DVGUML.js → chunk-KABXUBIH.js} +1 -1
  122. package/dist/{chunk-CT7AU2TA.js → chunk-KRH7UAD2.js} +1 -1
  123. package/dist/{chunk-PDFV3YQB.js → chunk-KSHNA6W2.js} +1 -1
  124. package/dist/{chunk-7IVTGOGM.js → chunk-L6OPXIZN.js} +1 -1
  125. package/dist/{chunk-ZKBGUDNB.js → chunk-LBGRLG3Y.js} +1 -1
  126. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  127. package/dist/{chunk-PL4HKGYP.js → chunk-LISPTWW3.js} +1 -1
  128. package/dist/{chunk-HJBR73GS.js → chunk-LJN77RG6.js} +1 -1
  129. package/dist/chunk-LPJGF6LK.js +27 -0
  130. package/dist/{chunk-SWJXWDKX.js → chunk-LXHTCLNX.js} +1 -1
  131. package/dist/chunk-MBY5JIGB.js +1 -0
  132. package/dist/{chunk-RNBC6V2D.js → chunk-MOBJVNLF.js} +11 -11
  133. package/dist/{chunk-R6TDZ7T5.js → chunk-MQXZZBR6.js} +1 -1
  134. package/dist/{chunk-YUAF3FDE.js → chunk-MSAQGUGU.js} +4 -4
  135. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  136. package/dist/{chunk-F636NDAU.js → chunk-N7GFQZ2J.js} +8 -8
  137. package/dist/chunk-N7LDQZTL.js +8 -0
  138. package/dist/chunk-NDP2I5HK.js +8 -0
  139. package/dist/{chunk-VVDK7XPH.js → chunk-NIBYHQLT.js} +1 -1
  140. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  141. package/dist/{chunk-KYHDDVTR.js → chunk-NK5RRBXY.js} +6 -6
  142. package/dist/{chunk-WEEQDPU3.js → chunk-NPTHHWXZ.js} +5 -5
  143. package/dist/chunk-NZISMTQE.js +7 -0
  144. package/dist/{chunk-K6LW2QLI.js → chunk-O53EQODF.js} +1 -1
  145. package/dist/{chunk-32EKHIAZ.js → chunk-OAZX7ZGB.js} +12 -12
  146. package/dist/{chunk-IEOCUEJK.js → chunk-OMCM3SIE.js} +7 -7
  147. package/dist/chunk-OMUC6TZT.js +6 -0
  148. package/dist/{chunk-PETBAYS5.js → chunk-OXVRXWJL.js} +12 -12
  149. package/dist/{chunk-ATKFIHDP.js → chunk-P75R4EYJ.js} +4 -4
  150. package/dist/{chunk-I5XNADZ3.js → chunk-PB6XGDLJ.js} +8 -8
  151. package/dist/{chunk-HDABS36W.js → chunk-PLDMQNKD.js} +7 -7
  152. package/dist/{chunk-M57KX3OM.js → chunk-QMTYILTT.js} +1 -1
  153. package/dist/{chunk-5KKJAYKT.js → chunk-QTNMALBN.js} +1 -1
  154. package/dist/{chunk-7HLBVMMQ.js → chunk-RBINX62X.js} +1 -1
  155. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  156. package/dist/{chunk-SAASFWKB.js → chunk-RDYFZHT3.js} +1 -1
  157. package/dist/{chunk-JRCFOZEU.js → chunk-RLTTAH46.js} +4 -4
  158. package/dist/{chunk-UTITWGVW.js → chunk-RPFONHXQ.js} +1 -1
  159. package/dist/{chunk-2XORVHF2.js → chunk-RSPCCVN4.js} +1 -1
  160. package/dist/{chunk-UVMM7AYO.js → chunk-S262RGL6.js} +1 -1
  161. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  162. package/dist/{chunk-C3UY34DC.js → chunk-SCPPW3ZC.js} +4 -4
  163. package/dist/{chunk-PMA6DZ4Q.js → chunk-SOWRW647.js} +6 -6
  164. package/dist/chunk-SZC35EYE.js +28 -0
  165. package/dist/{chunk-6CK44QWU.js → chunk-T4WDJ7IB.js} +29 -29
  166. package/dist/{chunk-ZOQXFS3R.js → chunk-T6BGS26U.js} +1 -1
  167. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  168. package/dist/{chunk-O6VIHWYU.js → chunk-TF6DYDNQ.js} +1 -1
  169. package/dist/{chunk-JJZAYAVL.js → chunk-THSKCKAQ.js} +1 -1
  170. package/dist/chunk-TLE6VHMJ.js +8 -0
  171. package/dist/{chunk-PDXOGPWH.js → chunk-TOSUM2OI.js} +1 -1
  172. package/dist/{chunk-SEP35R2E.js → chunk-TVRKONNH.js} +1 -1
  173. package/dist/{chunk-3OHADZYV.js → chunk-U24GFE5L.js} +1 -1
  174. package/dist/{chunk-QAIMZN7M.js → chunk-UDVUVFRS.js} +10 -10
  175. package/dist/{chunk-PVOTOUJG.js → chunk-UIOKWFT4.js} +1 -1
  176. package/dist/chunk-UMFEOZ75.js +4 -0
  177. package/dist/{chunk-IUMFOSFJ.js → chunk-UNJWYV6V.js} +3 -3
  178. package/dist/chunk-UYNFTF6L.js +2 -0
  179. package/dist/{chunk-IGQZANYE.js → chunk-VI4NLOVJ.js} +11 -11
  180. package/dist/{chunk-VU5P4ZM5.js → chunk-VNAOZVSM.js} +13 -13
  181. package/dist/{chunk-OXCFRH33.js → chunk-VOXX4LNC.js} +1 -1
  182. package/dist/{chunk-63545Z3N.js → chunk-VPGQMNW3.js} +1 -1
  183. package/dist/{chunk-GRC46C4V.js → chunk-W4UYDSTI.js} +7 -7
  184. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  185. package/dist/{chunk-ALJS3SYS.js → chunk-WPCNJ4UL.js} +1 -1
  186. package/dist/chunk-WRJP33DN.js +6 -0
  187. package/dist/{chunk-NTUZT37J.js → chunk-WRRMZAKK.js} +4 -4
  188. package/dist/chunk-WVIUU4BZ.js +13 -0
  189. package/dist/{chunk-RMSF4UCJ.js → chunk-X3NYVMXJ.js} +1 -1
  190. package/dist/chunk-XNFZLSWW.js +7 -0
  191. package/dist/{chunk-FFNPAJLS.js → chunk-XZ2WQNOX.js} +9 -9
  192. package/dist/chunk-XZU24YKP.js +13 -0
  193. package/dist/chunk-Y3SVPBUT.js +7 -0
  194. package/dist/{chunk-YOXR3VKO.js → chunk-YAZENY3X.js} +1 -1
  195. package/dist/{chunk-FRH2AHPI.js → chunk-YESTUDOK.js} +1 -1
  196. package/dist/{chunk-A4YTWDKD.js → chunk-YIV7CFBG.js} +2 -2
  197. package/dist/{chunk-3X2W7R5B.js → chunk-YJOJ5MUZ.js} +11 -11
  198. package/dist/chunk-YN5K72D6.js +5 -0
  199. package/dist/chunk-YQEGMCSX.js +9 -0
  200. package/dist/{chunk-CG5X5ZLV.js → chunk-YXOFUY4J.js} +1 -1
  201. package/dist/{chunk-6C6M3QXL.js → chunk-ZHFKBWBU.js} +1 -1
  202. package/dist/chunk-ZITMPMUT.js +2 -0
  203. package/dist/{chunk-B2SLXCMY.js → chunk-ZKYBLZPT.js} +8 -8
  204. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  205. package/dist/{chunk-IUG4Z2ND.js → chunk-ZU3BD75E.js} +1 -1
  206. package/dist/{chunk-PVVHWLNX.js → chunk-ZU432XW4.js} +1 -1
  207. package/dist/{chunk-5UCRYSQJ.js → chunk-ZYDRBF3H.js} +5 -5
  208. package/dist/{chunk-2ZAFRGRF.js → chunk-ZYJAZ5HH.js} +1 -1
  209. package/dist/data/DataTable.js +1 -1
  210. package/dist/data/EntityList.js +1 -1
  211. package/dist/data/Kanban.js +1 -1
  212. package/dist/data/ListFooter.js +1 -1
  213. package/dist/data/ListLoadError.js +1 -1
  214. package/dist/data/Pagination.js +1 -1
  215. package/dist/data/ResizableTable.js +1 -1
  216. package/dist/file-intake/index.js +1 -1
  217. package/dist/forms/AlignmentGrid.js +1 -1
  218. package/dist/forms/BorderInput.js +1 -1
  219. package/dist/forms/BrandAssetEditor.js +1 -1
  220. package/dist/forms/Button.js +1 -1
  221. package/dist/forms/Calendar.js +1 -1
  222. package/dist/forms/ColorPicker.js +1 -1
  223. package/dist/forms/ComposerAttachments.js +1 -1
  224. package/dist/forms/CornersInput.js +1 -1
  225. package/dist/forms/DatePicker.js +1 -1
  226. package/dist/forms/DateRangePicker.js +1 -1
  227. package/dist/forms/DateTimePicker.js +1 -1
  228. package/dist/forms/DisplayChips.js +1 -1
  229. package/dist/forms/FilePicker.js +1 -1
  230. package/dist/forms/FormErrorSummary.js +1 -1
  231. package/dist/forms/IconButton.js +1 -1
  232. package/dist/forms/IconPicker.js +1 -1
  233. package/dist/forms/ImageFocusPoint.js +1 -1
  234. package/dist/forms/Input.js +1 -1
  235. package/dist/forms/InputNumber.js +1 -1
  236. package/dist/forms/LinkPicker.js +1 -1
  237. package/dist/forms/MediaLibrary.js +1 -1
  238. package/dist/forms/MediaUploadField.js +1 -1
  239. package/dist/forms/MediaUploadGrid.js +1 -1
  240. package/dist/forms/MediaUsedInList.js +1 -1
  241. package/dist/forms/NumericKeypad.js +1 -1
  242. package/dist/forms/PictureTiles.js +1 -1
  243. package/dist/forms/PositionInput.js +1 -1
  244. package/dist/forms/RenameField.js +1 -1
  245. package/dist/forms/Segmented.js +1 -1
  246. package/dist/forms/Select.js +1 -1
  247. package/dist/forms/SidesInput.js +1 -1
  248. package/dist/forms/Slider.js +1 -1
  249. package/dist/forms/Snippet.js +1 -1
  250. package/dist/forms/SplitButton.js +1 -1
  251. package/dist/forms/TagInput.js +1 -1
  252. package/dist/forms/TextToolbar.js +1 -1
  253. package/dist/forms/TimePicker.js +1 -1
  254. package/dist/forms/WidthsBar.js +1 -1
  255. package/dist/forms/mediaLibraryMenu.js +1 -1
  256. package/dist/forms/mediaMoveItems.js +1 -1
  257. package/dist/forms/textAlign.js +1 -1
  258. package/dist/forms/useFileIntake.js +1 -1
  259. package/dist/icons/index.js +1 -1
  260. package/dist/index.js +666 -666
  261. package/dist/locales/zh-Hans.js +1 -1
  262. package/dist/map/index.js +3 -3
  263. package/dist/markdown/index.js +1 -1
  264. package/dist/page-tabs/index.js +5 -5
  265. package/dist/pdf/index.js +1 -1
  266. package/dist/shell/Accordion.js +1 -1
  267. package/dist/shell/AppUpdateBanner.js +1 -1
  268. package/dist/shell/Avatar.js +1 -1
  269. package/dist/shell/Banner.js +1 -1
  270. package/dist/shell/Breadcrumbs.js +1 -1
  271. package/dist/shell/BudgetBar.js +1 -1
  272. package/dist/shell/Card.js +1 -1
  273. package/dist/shell/ColoredBadge.js +1 -1
  274. package/dist/shell/ConfirmDialog.js +1 -1
  275. package/dist/shell/ContainerFillChart.js +1 -1
  276. package/dist/shell/ContextMenu.js +1 -1
  277. package/dist/shell/CountBadge.js +1 -1
  278. package/dist/shell/Dialog.js +1 -1
  279. package/dist/shell/Drawer.js +1 -1
  280. package/dist/shell/DropdownMenu.js +1 -1
  281. package/dist/shell/EditableGrid.js +1 -1
  282. package/dist/shell/EmptyState.js +1 -1
  283. package/dist/shell/GlobalSearch.js +1 -1
  284. package/dist/shell/HelpCenter.js +1 -1
  285. package/dist/shell/IconRail.js +1 -1
  286. package/dist/shell/ImageLightbox.js +1 -1
  287. package/dist/shell/ItemCount.js +1 -1
  288. package/dist/shell/LanguageSelect.js +1 -1
  289. package/dist/shell/Markdown.js +1 -1
  290. package/dist/shell/MetricBar.js +1 -1
  291. package/dist/shell/MetricBarLegend.js +1 -1
  292. package/dist/shell/MilestoneTimeline.js +1 -1
  293. package/dist/shell/PageHeader.js +1 -1
  294. package/dist/shell/PopupMenu.js +1 -1
  295. package/dist/shell/ProductionTimeline.js +1 -1
  296. package/dist/shell/ResizeHandle.js +1 -1
  297. package/dist/shell/Result.js +1 -1
  298. package/dist/shell/SearchableSelect.js +1 -1
  299. package/dist/shell/SettingReset.js +1 -1
  300. package/dist/shell/SettingRow.js +1 -1
  301. package/dist/shell/SidebarLayout.js +1 -1
  302. package/dist/shell/SidebarNav.js +1 -1
  303. package/dist/shell/SortableList.js +1 -1
  304. package/dist/shell/Statistic.js +1 -1
  305. package/dist/shell/StatusBadge.js +1 -1
  306. package/dist/shell/StepChain.js +1 -1
  307. package/dist/shell/Stepper.js +1 -1
  308. package/dist/shell/Tabs.js +1 -1
  309. package/dist/shell/TimeAgo.js +1 -1
  310. package/dist/shell/TimelineTrack.js +1 -1
  311. package/dist/shell/Tooltip.js +1 -1
  312. package/dist/shell/TopNav.js +1 -1
  313. package/dist/shell/TransferProgress.js +1 -1
  314. package/dist/shell/Tree.js +1 -1
  315. package/dist/shell/discardGuard.js +1 -1
  316. package/dist/shell/language.js +1 -1
  317. package/dist/shell/strings.d.ts +0 -265
  318. package/dist/shell/strings.js +1 -1
  319. package/dist/shell/toast.js +1 -1
  320. package/dist/shell.css +1 -12
  321. package/dist/telemetry/index.js +1 -1
  322. package/dist/templates/AuthScreen.js +1 -1
  323. package/dist/templates/ChatTemplate.js +1 -1
  324. package/dist/templates/CheckoutTemplate.js +1 -1
  325. package/dist/templates/DashboardTemplate.js +1 -1
  326. package/dist/templates/DataTablePage.js +1 -1
  327. package/dist/templates/EmailTemplate.js +1 -1
  328. package/dist/templates/ErrorBoundary.js +1 -1
  329. package/dist/templates/ErrorPage.js +1 -1
  330. package/dist/templates/FormLayoutPage.js +1 -1
  331. package/dist/templates/GalleryTemplate.js +1 -1
  332. package/dist/ui/index.js +1 -1
  333. package/dist/version.js +1 -1
  334. package/package.json +3 -8
  335. package/dist/Calculator-YZEGVEQ7.js +0 -29
  336. package/dist/Documents-FIGKS36O.js +0 -84
  337. package/dist/Files-FPNJ46XY.js +0 -88
  338. package/dist/PdfViewer-M4RTCNNE.js +0 -1
  339. package/dist/Sidebar-QP5Y7RBV.js +0 -44
  340. package/dist/Spreadsheet-RQE4OCEK.js +0 -75
  341. package/dist/chunk-2E3K4FSQ.js +0 -13
  342. package/dist/chunk-2EPAXWZZ.js +0 -14
  343. package/dist/chunk-2HAJ33HM.js +0 -9
  344. package/dist/chunk-2NRNKF46.js +0 -9
  345. package/dist/chunk-2XOH3NJZ.js +0 -27
  346. package/dist/chunk-3VR5BOD4.js +0 -8
  347. package/dist/chunk-5YP7MFPK.js +0 -1
  348. package/dist/chunk-6FIYG7IH.js +0 -28
  349. package/dist/chunk-6R32KKIS.js +0 -22
  350. package/dist/chunk-7DI3VQCF.js +0 -2
  351. package/dist/chunk-B2MD232O.js +0 -6
  352. package/dist/chunk-BDUXF7BT.js +0 -4
  353. package/dist/chunk-EC22ACQZ.js +0 -11
  354. package/dist/chunk-FJBJUFD7.js +0 -4
  355. package/dist/chunk-GO6HU2O3.js +0 -7
  356. package/dist/chunk-H56TNUV4.js +0 -1
  357. package/dist/chunk-KU4IWX6F.js +0 -2
  358. package/dist/chunk-MQ445O4X.js +0 -6
  359. package/dist/chunk-MQE2FBJU.js +0 -7
  360. package/dist/chunk-NMTS2L2B.js +0 -8
  361. package/dist/chunk-ODQYWMDF.js +0 -3
  362. package/dist/chunk-OPZXVXX5.js +0 -7
  363. package/dist/chunk-OZM6DE7A.js +0 -8
  364. package/dist/chunk-R7KRBKFH.js +0 -5
  365. package/dist/chunk-RQBQETXQ.js +0 -11
  366. package/dist/chunk-S43DAIIB.js +0 -9
  367. package/dist/chunk-SCZUDGRZ.js +0 -2
  368. package/dist/chunk-SUYQ7QYB.js +0 -13
  369. package/dist/chunk-TXKTITMF.js +0 -8
  370. package/dist/chunk-UG42KUCT.js +0 -9
  371. package/dist/chunk-VEZHFONL.js +0 -9
  372. package/dist/chunk-VTVSMRFX.js +0 -1
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-KVVZLEUG.js";import{useShellStrings as t}from"./chunk-5YP7MFPK.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),P=r(null),E=t().annotator,$=r(E);$.current=E;const[I,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[F,H]=o(24),[T,U]=o(h[0].id),[A,K]=o(!0),[O,V]=o(!1),[Z,G]=o(!1),[X,Y]=o(null),[q,_]=o(null),[J,Q]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(H(Me.size),U(Me.font),K(Me.bold),V(Me.italic),G(Me.underline),Y(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(I,t.start,n,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};re(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:O,underline:Z}[e];"bold"===e&&K(t),"italic"===e&&V(t),"underline"===e&&G(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{_(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Ee=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:W,size:F,font:T,bold:A,italic:O,underline:Z,borderColor:X,background:q,padding:J};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error($.current.clipboardUnsupported);const t=await $e();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success($.current.copied)}catch{e.error($.current.copyRefused)}else e.error($.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:E.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:E.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:E.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:E.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:E.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:E.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:E.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:E.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[E]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-A3AKJDLI.js";import{useShellStrings as t}from"./chunk-MBY5JIGB.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),I=r(null),P=t().annotator,$=r(P);$.current=P;const[E,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[H,F]=o(24),[T,A]=o(h[0].id),[U,O]=o(!0),[K,V]=o(!1),[Z,G]=o(!1),[X,Y]=o(null),[q,J]=o(null),[_,Q]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===E&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(F(Me.size),A(Me.font),O(Me.bold),V(Me.italic),G(Me.underline),Y(Me.borderColor),J(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{I.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=I.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(E,t.start,n,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};re(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,E,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:U,italic:K,underline:Z}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&G(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ie=e=>{J(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Pe=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:W,size:H,font:T,bold:U,italic:K,underline:Z,borderColor:X,background:q,padding:_};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error($.current.clipboardUnsupported);const t=await $e();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success($.current.copied)}catch{e.error($.current.copyRefused)}else e.error($.current.copyFailed)},"image/png")}}),[ae,x]);const Ee=i(()=>[{id:"select",label:P.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:P.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:P.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:P.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:P.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:P.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:P.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:P.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[P]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===E?null:E),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
2
2
  return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
- /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===e.id),children:e.icon},e.id)),
3
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ee.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(E===e.id),children:e.icon},e.id)),
4
4
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(W===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
6
6
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
7
7
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
8
- /* @__PURE__ */c("span",{children:E.weight}),
8
+ /* @__PURE__ */c("span",{children:P.weight}),
9
9
  /* @__PURE__ */c("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&re(e=>e.map(e=>e.id!==oe?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
10
10
  /* @__PURE__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
11
11
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
12
12
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
13
- /* @__PURE__ */c("span",{children:E.radius}),
13
+ /* @__PURE__ */c("span",{children:P.radius}),
14
14
  /* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
15
15
  /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
16
16
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
- /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:E[e.name]},e.id))}),
18
- /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
19
- /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(O),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
20
- /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:E.underline,children:/* @__PURE__ */c("span",{className:"underline",children:E.underlineLetter})}),
17
+ /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,A(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:P[e.name]},e.id))}),
18
+ /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(U),title:P.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:P.boldLetter})}),
19
+ /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(K),title:P.italic,children:/* @__PURE__ */c("span",{className:"italic",children:P.italicLetter})}),
20
+ /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:P.underline,children:/* @__PURE__ */c("span",{className:"underline",children:P.underlineLetter})}),
21
21
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
- /* @__PURE__ */c("span",{children:E.size}),
23
- /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:F,onChange:e=>{return t=Number(e.target.value),H(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
- /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:F})]}),
22
+ /* @__PURE__ */c("span",{children:P.size}),
23
+ /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),F(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
+ /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
25
25
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
- /* @__PURE__ */c("span",{children:E.border}),X?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:E.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
- /* @__PURE__ */c("button",{onClick:()=>De(null),title:E.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:E.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
26
+ /* @__PURE__ */c("span",{children:P.border}),X?/* @__PURE__ */s(d,{children:[
27
+ /* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:P.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
+ /* @__PURE__ */c("button",{onClick:()=>De(null),title:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:P.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
29
29
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
- /* @__PURE__ */c("span",{children:E.fill}),q?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>Pe(e.target.value),title:E.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
- /* @__PURE__ */c("button",{onClick:()=>Pe(null),title:E.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:E.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
30
+ /* @__PURE__ */c("span",{children:P.fill}),q?/* @__PURE__ */s(d,{children:[
31
+ /* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>Ie(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
+ /* @__PURE__ */c("button",{onClick:()=>Ie(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Ie("#ffffff"),title:P.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
33
33
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
- /* @__PURE__ */c("span",{children:E.padding}),
35
- /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:J,onChange:e=>{return t=Number(e.target.value),Q(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
- /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:J})]})]}),
34
+ /* @__PURE__ */c("span",{children:P.padding}),
35
+ /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),Q(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
+ /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
37
37
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
38
- /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomOut,children:"−"}),
38
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomOut,children:"−"}),
39
39
  /* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
40
- /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomIn,children:"+"}),
41
- /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.fitHint,children:E.fit}),
40
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomIn,children:"+"}),
41
+ /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
42
42
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
- /* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:E.undo}),
43
+ /* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:P.undo}),
44
44
  /* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */s(d,{children:[
45
- /* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{P.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:E.applyCrop}),
46
- /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:E.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:E.cancel}),
47
- /* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:E.apply})]})]})]}),
45
+ /* @__PURE__ */c("button",{onClick:()=>{if(!me||!I.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(I.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{I.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:P.applyCrop}),
46
+ /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:P.cancel}),
47
+ /* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:P.apply})]})]})]}),
48
48
  /* @__PURE__ */c("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ve&&ae&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ve.w,height:ve.h},children:[
49
49
  /* @__PURE__ */c("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
50
- /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void Ee();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:W,size:F,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:O,underline:Z,borderColor:X,background:q,padding:J,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:Ee,onCancel:()=>ye(null)})]})}),
51
- /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?E.hintSelected:E.hintSelect:"text"===I?E.hintText:"crop"===I?E.hintCrop:"draw"===I?E.hintDraw:E.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
50
+ /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===E?"default":"text"===E?"text":"crosshair"},onPointerDown:e=>{if("select"===E)return void ie(null);if("text"===E){if(xe)return void Pe();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==E){if("draw"===E)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(E,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===E&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:W,size:H,font:h.find(e=>e.id===T)?.css??h[0].css,bold:U,italic:K,underline:Z,borderColor:X,background:q,padding:_,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:Pe,onCancel:()=>ye(null)})]})}),
51
+ /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===E?oe?P.hintSelected:P.hintSelect:"text"===E?P.hintText:"crop"===E?P.hintCrop:"draw"===E?P.hintDraw:P.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
52
52
  /* @__PURE__ */c("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,n)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===n?0:1.2*e.size,children:t},n))})]})}/* @__PURE__ */
53
53
  return s("g",{children:[x,t&&!n&&/* @__PURE__ */s(d,{children:[
54
54
  /* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/r,strokeDasharray:`${6/r},${4/r}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:r,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:n}){const r=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-GO6HU2O3.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-NZISMTQE.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
2
2
  return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
3
3
  return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
4
4
  /* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("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}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Tooltip as e}from"./chunk-QQ2LDC6C.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
1
+ import{Tooltip as e}from"./chunk-NJN5IKWO.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
2
2
  return r(n,{children:[
3
3
  /* @__PURE__ */i(e,{content:l,describe:!1,className:t?"relative flex w-full":"relative inline-flex",children:a}),
4
4
  /* @__PURE__ */i("span",{id:o,className:"sr-only",children:l})]})}export{a as OffWithReason,t as describedByWith,l as isAriaDisabled,o as swallowPress};
@@ -1,4 +1,4 @@
1
- import{useShellStrings as t}from"./chunk-5YP7MFPK.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
1
+ import{useShellStrings as t}from"./chunk-MBY5JIGB.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
2
2
  return e("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
3
3
  /* @__PURE__ */r("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:i}),
4
4
  /* @__PURE__ */r("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:d.title}),
@@ -1 +1 @@
1
- import{toast_default as t}from"./chunk-KVVZLEUG.js";import{currentShellStrings as e}from"./chunk-5YP7MFPK.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
1
+ import{toast_default as t}from"./chunk-A3AKJDLI.js";import{currentShellStrings as e}from"./chunk-MBY5JIGB.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
@@ -0,0 +1,8 @@
1
+ import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-MBY5JIGB.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:S=[4,22],className:U,emptyLabel:B}){const D=m().charts,L=h(),I=z??(e=>f(e,L)),P=$??(e=>f(e,L)),V=B??D.noObservations,W=u(null),C=n(W),E=v??C,J=p(),[O,F]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(F(null),!0))},[O]);const G=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),Q=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),T=j||w?Q.map(e=>({...e,points:e.points.filter(e=>G(e.x,j)&&G(e.y,w))})).filter(e=>e.points.length>0):Q,X=Q.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
2
+ return y("div",{className:U,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const Y=T.flatMap(e=>e.points),Z=Y.some(e=>null!=e.size),H=14,K=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Y.map(e=>e.y),w,R,{from:k-q,to:H}),ie=t(te.ticks(5).map(P),_),le=Math.max(ie+1,E-K),re=ee(Y.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Y.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=O?T[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
3
+ return g("div",{className:`relative ${U??""}`,ref:W,children:[
4
+ /* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":D.scatter(T.map(e=>e.label),A??D.yAxis,M??D.xAxis)+(X>0?`. ${D.outsideRange(X)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>F(null),onBlur:()=>F(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
5
+ /* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:J,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:H-S[1],width:le-ie+2*S[1],height:k-q-H+2*S[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
6
+ /* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
7
+ /* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:I(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
8
+ /* @__PURE__ */y("g",{clipPath:`url(#${J})`,children:T.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):S[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??D.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:I(ae.x)},{key:"y",label:A??D.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.y)},...null!=ae.size?[{key:"size",label:D.size,color:a.muted,value:f(ae.size,L)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
@@ -1,4 +1,4 @@
1
- import{Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-5YP7MFPK.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
1
+ import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
2
2
  return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
3
3
  /* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
4
4
  /* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
@@ -1,4 +1,4 @@
1
- import{useShellLocale as e}from"./chunk-5YP7MFPK.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
1
+ import{useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
2
2
  /* @__PURE__ */
3
3
  return l("span",{className:`relative inline-flex shrink-0 ${u}`.trim(),style:{width:h,height:h},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[y?/* @__PURE__ */a("img",{src:e,alt:"",onError:()=>g(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */a("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*h)},children:m(t)}),c&&/* @__PURE__ */a("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${o[c]}`,style:{width:f,height:f}})]})}function u({children:r,max:n,size:o="md",className:m=""}){const c=i.toArray(r),u=n?c.slice(0,n):c,h=n?c.length-u.length:0,f=s[o],d=Math.round(.3*f),g=e();/* @__PURE__ */
4
4
  return l("div",{className:`flex items-center ${m}`.trim(),children:[u.map((e,t)=>/* @__PURE__ */a("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-d},children:e},t)),h>0&&/* @__PURE__ */l("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:f,height:f,marginLeft:-d,fontSize:Math.round(.36*f)},children:["+",t(h,g)]})]})}export{c as Avatar,u as AvatarGroup};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-CLAKVFOB.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-AICGATHE.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,16 +1,16 @@
1
- import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as n}from"./chunk-CJH2BGXY.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{glassStyle as i}from"./chunk-5FYDNH4Y.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),C=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:S,allColumns:_,onResizeStart:z,onDragStart:P,onDragOver:$,onDrop:Y,onDragEnd:B,toggleColumn:F,resetColumns:I,draggedIdx:K,dropGap:L}=t(f,C),{hasAnyPerm:R}=r(),T=s().columns,[A,E]=c(!1),[G,J]=c(!1),[O,U]=c(!1),W=m(null),X=k.length>0&&R(k);e(W,h(()=>{A&&E(!1)},[A]));const H=S.reduce((e,t)=>e+t.width,0),M=S.map(e=>`${e.width}px`),Q={tableLayout:"fixed",width:H,minWidth:"100%"},V=m(null),Z=h(e=>{const t=V.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
1
+ import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{TH_ONE_LINE as n}from"./chunk-WGLHB6WE.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-MBY5JIGB.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:B,onDragOver:$,onDrop:I,onDragEnd:L,toggleColumn:W,resetColumns:E,draggedIdx:G,dropGap:P}=t(f,S),{hasAnyPerm:R}=r(),T=i().columns,[U,Y]=c(!1),[A,J]=c(!1),[K,O]=c(!1),X=m(null),F=k.length>0&&R(k);e(X,h(()=>{U&&Y(!1)},[U]));const H=C.reduce((e,t)=>e+t.width,0),M=C.map(e=>`${e.width}px`),Q={tableLayout:"fixed",width:H,minWidth:"100%"},V=m(null),Z=h(e=>{const t=V.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
2
2
  return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
3
3
  /* @__PURE__ */p("div",{ref:V,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:Q,children:[
4
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),
5
- /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:S.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
- return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${K===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>P(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>Y(t,e),onDragEnd:a?void 0:B,style:a?void 0:{cursor:"grab"},children:[
7
- /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),L===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===S.length-1&&L===S.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
4
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),
5
+ /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
+ return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${G===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>B(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>I(t,e),onDragEnd:a?void 0:L,style:a?void 0:{cursor:"grab"},children:[
7
+ /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),P===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&P===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
8
8
  /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
9
9
  /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:Q,children:[
10
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),N(S)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
10
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
11
11
  /* @__PURE__ */p("span",{children:b}),
12
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:W,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?T.hideSelection:T.showSelection,children:D?T.selectDone:T.select}),
13
- /* @__PURE__ */p("button",{onClick:I,className:"text-2xs text-ink-faintest hover:text-gray-600",children:T.reset}),
14
- /* @__PURE__ */p("button",{onClick:()=>E(!A),className:"text-gray-400 hover:text-gray-600",title:T.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),A&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:i(),children:[
12
+ /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:X,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?T.hideSelection:T.showSelection,children:D?T.selectDone:T.select}),
13
+ /* @__PURE__ */p("button",{onClick:E,className:"text-2xs text-ink-faintest hover:text-gray-600",children:T.reset}),
14
+ /* @__PURE__ */p("button",{onClick:()=>Y(!U),className:"text-gray-400 hover:text-gray-600",title:T.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),U&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
15
15
  /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:T.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
16
- /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>F(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),X&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{J(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),U(!0),setTimeout(()=>U(!1),2e3)}catch{}J(!1)},disabled:G,className:"text-2xs w-full text-center py-1 rounded "+(O?"text-green-600":"text-ink-faint hover:text-blue-600"),children:G?"...":O?T.savedDefault:T.saveDefault})})]})]})]})]})}export{f as ResizableTable};
16
+ /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>W(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),F&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{J(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),O(!0),setTimeout(()=>O(!1),2e3)}catch{}J(!1)},disabled:A,className:"text-2xs w-full text-center py-1 rounded "+(K?"text-green-600":"text-ink-faint hover:text-blue-600"),children:A?"...":K?T.savedDefault:T.saveDefault})})]})]})]})]})}export{f as ResizableTable};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-WEEQDPU3.js";import{Select_default as a}from"./chunk-ESWR7YNY.js";import{Pagination as r}from"./chunk-225LCPO7.js";import{Input_default as t}from"./chunk-LGTYPLJM.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-JPNAEN53.js";import{Button_default as l}from"./chunk-7DI3VQCF.js";import{Icon as c}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as m}from"./chunk-CJH2BGXY.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-NPTHHWXZ.js";import{Select_default as a}from"./chunk-A34PD3XT.js";import{Pagination as r}from"./chunk-4MERJIJJ.js";import{Input_default as t}from"./chunk-HNUKXGYP.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-FZM3ZPW3.js";import{Button_default as l}from"./chunk-EOVXFXVV.js";import{Icon as c}from"./chunk-2UO47XB4.js";import{TH_ONE_LINE as m}from"./chunk-WGLHB6WE.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
@@ -0,0 +1,4 @@
1
+ import{AccessibleTable as e}from"./chunk-5PP435FL.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-36VIGB6J.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-MBY5JIGB.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,B]=u(null),{highlighted:I}=r(),L=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",L),0===L.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const C=Math.max(...L.map(e=>e.depth))+1,E=f/2,F=f/2,P=(f/2-8-b)/C,z=L.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),A=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,G=e=>null!==w?e.id===w:null===I||e.branchKey===I,R=w?L.find(e=>e.id===w):void 0,V=e=>c(e.value/z*100,1,$);/* @__PURE__ */
2
+ return d("div",{className:`relative ${g??""}`,children:[
3
+ /* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(z),C),onMouseLeave:()=>B(null),children:[L.map(e=>/* @__PURE__ */s("path",{d:t(E,F,b+e.depth*P+v/2,b+(e.depth+1)*P-v/2,e.start,e.end),fill:A(e),fillOpacity:G(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>B(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:E,y:F+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),R&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:R.label,rows:[{key:"value",label:M.value,color:A(R),value:j(R.value)},{key:"share",label:M.share,color:a.muted,value:V(R)}]})}),
4
+ /* @__PURE__ */s(e,{caption:M.sunburst(j(z),C),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:L.map(e=>[e.depth+1,e.label,j(e.value),V(e)])})]})}export{f as SunburstChart};
@@ -1,5 +1,5 @@
1
- import{CartesianPlot as t}from"./chunk-3VR5BOD4.js";import{ChartTooltip as a}from"./chunk-WDQI3FV6.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-5YP7MFPK.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
- return i(t,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:t=>{const e=M[t],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
3
- return i(a,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
1
+ import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as a}from"./chunk-N7LDQZTL.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-MBY5JIGB.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}}),L=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
2
+ return i(a,{labels:c.map(t=>t.label),values:L,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
+ 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__ */
5
5
  return i("rect",{x:t(r),y:s,width:Math.max(1,t.bandwidth),height:c,rx:b,fill:n,fillOpacity:null===o||o===r?1:.45},r)})]})})}export{c as WaterfallChart};
@@ -0,0 +1,2 @@
1
+ import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-PLDMQNKD.js";import{toDayMs as i,fmtSliderDate as t,DAY_MS as a}from"./chunk-7TC3LJQM.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-MBY5JIGB.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:M}){const b=l(Date.now,null),j=[],C=[],x=o().timeline,D=r();for(const e of p){const n=i(e.date??null);null===n?C.push({key:e.key,label:e.label,kind:e.kind}):j.push({...e,ms:n})}j.sort((e,n)=>e.ms-n.ms);const L=i(g??null);let N,w,H=!0;0===j.length?(w=L??b??0,N=w-30*a,H=null!==L||null!==b):(N=j[0].ms,w=L??j[j.length-1].ms,w-N<a&&(w=N+a));const J=j.length>0?Math.max(0,Math.round((w-N)/a)):0,K=u??(J>0?x.duration(J):void 0),O=[j.length>0?x.started(t(j[0].ms,D)):void 0,K,C.length>0?x.reached(j.length,p.length):void 0],B=j.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),Q={};for(const e of j)e.phase&&(Q[e.phase]=Q[e.phase]||[]).push(e.ms);const T=Object.entries(Q).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),G="rail"===v,I=H&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:G?"spread":"compressed",labels:G?"none":"lanes",items:B,pending:C,phases:T,startMs:N,endMs:w,todayMs:b??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:M,ariaLabel:x.milestones(m)})});/* @__PURE__ */
2
+ return h("div",G?{className:"shrink-0","data-timeline-variant":"rail",children:I}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:O,children:I})})}export{m as MilestoneTimeline};
@@ -1,15 +1,15 @@
1
- import{AccessibleTable as e}from"./chunk-EYPKBJYG.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-5YP7MFPK.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:F}){const W=m().charts,C=c(),Y=N??(e=>h(e,C)),w=F??W.nothingToCompare,R=p(),[A,E]=u(null),{highlighted:L}=a(),P=x;if(k.length<3||0===P.length)/* @__PURE__ */
2
- return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const z=y/2,B=y/2,Q=y/2-46,T=o(k.length),U=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...P.map(e=>e.values[t]??0).filter(Number.isFinite))),V=(e,t)=>{const r=Math.max(0,Math.min(1,t/U[e])),l=T.center(e)-T.step/2;return[z+Q*r*Math.cos(l),B+Q*r*Math.sin(l)]},H=(e,t)=>null!==A?A!==e:null!==L&&L!==t,J=null!==A?P[A]:void 0;/* @__PURE__ */
1
+ import{AccessibleTable as e}from"./chunk-5PP435FL.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-MBY5JIGB.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const F=m().charts,W=c(),w=N??(e=>h(e,W)),B=C??F.nothingToCompare,L=p(),[R,A]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
2
+ return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:B});const E=y/2,J=y/2,P=y/2-46,T=n(k.length),U=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),V=(e,t)=>{const r=Math.max(0,Math.min(1,t/U[e])),l=T.center(e)-T.step/2;return[E+P*r*Math.cos(l),J+P*r*Math.sin(l)]},G=(e,t)=>null!==R?R!==e:null!==Y&&Y!==t,H=null!==R?z[R]:void 0;/* @__PURE__ */
3
3
  return f("div",{className:`relative ${$??""}`,children:[
4
- /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":R,onMouseLeave:()=>E(null),children:[
5
- /* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(P.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=Q*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:z,cy:B,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(z,B,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=V(t,U[t]);/* @__PURE__ */
4
+ /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":L,onMouseLeave:()=>A(null),children:[
5
+ /* @__PURE__ */d("title",{id:L,children:F.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=P*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:E,cy:J,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(E,J,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=V(t,U[t]);/* @__PURE__ */
6
6
  return f("g",{children:[
7
- /* @__PURE__ */d("line",{x1:z,y1:B,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
- /* @__PURE__ */d("text",{x:z+(Q+18)*Math.cos(T.center(t)-T.step/2),y:B+(Q+18)*Math.sin(T.center(t)-T.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
- /* @__PURE__ */d(r,{id:R,reveal:!!j&&"center-out"}),P.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>V(r,e.values[r]??0));/* @__PURE__ */
10
- return f("g",{opacity:H(t,e.key)?.3:1,onMouseEnter:()=>E(t),mask:j?`url(#${l(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
- /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),J&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:J.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(A,3,J.color,J.tone),value:Y(J.values[t]??0)}))})}),
12
- /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:P.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
7
+ /* @__PURE__ */d("line",{x1:E,y1:J,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
+ /* @__PURE__ */d("text",{x:E+(P+18)*Math.cos(T.center(t)-T.step/2),y:J+(P+18)*Math.sin(T.center(t)-T.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
+ /* @__PURE__ */d(r,{id:L,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>V(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:G(t,e.key)?.3:1,onMouseEnter:()=>A(t),mask:j?`url(#${l(L)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),H&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:H.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(R,3,H.color,H.tone),value:w(H.values[t]??0)}))})}),
12
+ /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
13
  /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
14
  /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
- /* @__PURE__ */d(e,{caption:W.acrossMeasures(P.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:P.map(e=>[e.label,...k.map((t,r)=>Y(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
15
+ /* @__PURE__ */d(e,{caption:F.acrossMeasures(z.map(e=>e.label),k.length),head:[F.tableSeries,...k.map(e=>e.label)],rows:z.map(e=>[e.label,...k.map((t,r)=>w(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -1,15 +1,15 @@
1
- import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-HDABS36W.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-7TC3LJQM.js";import{Icon as s}from"./chunk-7V32O5NF.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-5YP7MFPK.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),S=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),P=x.length?Math.min(...x):S,C=x.length?Math.max(...x):S,D=a(r??null)??P,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,C,q,D+i];return O||e.push(S),Math.max(...e)})(),A=Math.max(1,Math.round((T-D)/i)),L=a(p??null)??C??D,I=Math.min(Math.max(y??L,D),T),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=I})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>I){$=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(D).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),z=j??F,B=j?a(j.date):F?D:null,H=$?a($.date):null,J=!!(z&&$&&null!=B&&null!=H&&I>B&&I<H);let K,E;if(J&&null!=B&&null!=H){const e=(I-B)/Math.max(H-B,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of z?.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(z?.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):z?.est_completion_date||$?.est_completion_date||null,K={id:`interp-${I}`,progress_number:_.estimated,date:new Date(I).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},E=z}else if(K=z??t[t.length-1]??null,K){const e=t.findIndex(e=>e.id===K.id);E=e>=0&&e<t.length-1?t[e+1]:null}else E=null;const G={};for(const e of E?.items??[])G[e.part_number]=e;const Q=!(!d||K?.id===d),V=d?Math.min(a(p??null)??T,T):T,W=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:D,endMs:T,totalLeadDays:A,scrubMs:I,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:Q,beforeAnchor:z,nextAfter:$,displayed:K,prevReport:E,prevByPN:G,isInterpolated:J,playing:v,startPlay:()=>{if(v)return void N();if(V<=D)return void f(V);M(!0),f(D);let e=performance.now(),t=D;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:W,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})),S=new Map(N.map(({report:e,ms:t})=>[e.id,t])),P=N.map(({ms:e})=>e),C=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:C,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=S.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:x,variant:S="card",onPlayStart:P}){const{reports:C,markers:D,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:A,setScrubMs:L,displayed:I,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:z,estCompletionMs:B}=n,H=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)}}}(C.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),L,P),J=c().production,K=d(),E=_??J.heading,G=e=>o(e,K);if(0===C.length&&0===D.length)return null;const Q=D.filter(e=>"shipment"===e.kind),V=D.filter(e=>"inspection"===e.kind),W=D.filter(e=>"invoice"===e.kind),Y=(I?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=I?v(I):0,U=C.find(e=>e.id===F),X=U?N(U):z,ee=
3
- /* @__PURE__ */h("button",{type:"button",onClick:H.toggle,"aria-pressed":H.playing,title:H.playing?J.pause:J.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[H.playing?/* @__PURE__ */b(s,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */b(s,{name:"play","aria-hidden":"true"}),
4
- /* @__PURE__ */b("span",{children:H.playing?J.pause:J.play})]}),te=j&&(x??X)?/* @__PURE__ */b("button",{type:"button",onClick:()=>{H.stop(),$()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:x??J.backTo(String(X))}):null,[re,ne]=p(J.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:I?/* @__PURE__ */h(y,{children:[e&&re,
5
- /* @__PURE__ */b("b",{className:"font-medium",children:N(I)}),e&&ne,
6
- /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",G(new Date(I.date).getTime())," · ",J.overall(Math.round(Z))," · ",J.inStock(Y)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:J.noReport})});if("rail"===S){const e=null!=B&&B>=q&&q>O,t=e?{key:"__estimate__",label:J.estimatedCompletion,dateText:G(B)}:null;/* @__PURE__ */
1
+ import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineGlyph as t,TimelineProgressIcon as r,TimelineTrack as n}from"./chunk-PLDMQNKD.js";import{toDayMs as a,fmtSliderDate as o,DAY_MS as i}from"./chunk-7TC3LJQM.js";import{Icon as s}from"./chunk-2UO47XB4.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c,useShellLocale as d,splitAround as p}from"./chunk-MBY5JIGB.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),S=l(Date.now,null)??Math.max(0,...x,...b.map(e=>a(e.date)??0),a(r??null)??0,a(n??null)??0),D=x.length?Math.min(...x):S,P=x.length?Math.max(...x):S,C=a(r??null)??D,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,P,q,C+i];return O||e.push(S),Math.max(...e)})(),L=Math.max(1,Math.round((T-C)/i)),I=a(p??null)??P??C,A=Math.min(Math.max(y??I,C),T),j=t.find(e=>{const t=a(e.date);return null!=t&&t<=A})??null;let $=null;for(let e=t.length-1;e>=0;e--){const r=a(t[e].date);if(null!=r&&r>A){$=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:""}})(),B=j??F,J=j?a(j.date):F?C:null,z=$?a($.date):null,G=!!(B&&$&&null!=J&&null!=z&&A>J&&A<z);let K,Q;if(G&&null!=J&&null!=z){const e=(A-J)/Math.max(z-J,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of B?.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(B?.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):B?.est_completion_date||$?.est_completion_date||null,K={id:`interp-${A}`,progress_number:_.estimated,date:new Date(A).toISOString().slice(0,10),created_by_name:"",est_completion_date:l,items:o,notes:""},Q=B}else if(K=B??t[t.length-1]??null,K){const e=t.findIndex(e=>e.id===K.id);Q=e>=0&&e<t.length-1?t[e+1]:null}else Q=null;const E={};for(const e of Q?.items??[])E[e.part_number]=e;const H=!(!d||K?.id===d),U=d?Math.min(a(p??null)??T,T):T,X=d?t.find(e=>e.id===d)?.progress_number:void 0;return{startMs:C,endMs:T,totalLeadDays:L,scrubMs:A,setScrubMs:e=>{N(),f(e)},resetToCurrent:()=>{N(),p&&f(new Date(p).getTime())},scrubbedAway:H,beforeAnchor:B,nextAfter:$,displayed:K,prevReport:Q,prevByPN:E,isInterpolated:G,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: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})),S=new Map(N.map(({report:e,ms:t})=>[e.id,t])),D=N.map(({ms:e})=>e),P=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:P,startMs:e,endMs:t,activeKey:s,onActivate:e=>{const t=S.get(e);null!=t&&l(t),p(e)},playback:k,edgeCaptions:f,thumb:{valueMs:i,onChange:l,onDragStart:g,stops:D,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:S="card",onPlayStart:D}){const{reports:P,markers:C,poNumber:R,startMs:O,endMs:q,totalLeadDays:T,scrubMs:L,setScrubMs:I,displayed:A,scrubbedAway:j,resetToCurrent:$,currentReportId:F,currentReportProgressNumber:B,estCompletionMs:J}=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)}}}(P.map(e=>a(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),I,D),G=c().production,K=d(),Q=_??G.heading,E=e=>o(e,K);if(0===P.length&&0===C.length)return null;const H=C.filter(e=>"shipment"===e.kind),U=C.filter(e=>"inspection"===e.kind),X=C.filter(e=>"invoice"===e.kind),Y=(A?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),Z=A?v(A):0,V=P.find(e=>e.id===F),W=V?N(V):B,ee=
3
+ /* @__PURE__ */h("button",{type:"button",onClick:z.toggle,"aria-pressed":z.playing,title:z.playing?G.pause:G.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?G.pause:G.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??G.backTo(String(W))}):null,[re,ne]=p(G.showing),ae=e=>/* @__PURE__ */b("p",{className:"rosh-tl-status text-gray-800",children:A?/* @__PURE__ */h(y,{children:[e&&re,
5
+ /* @__PURE__ */b("b",{className:"font-medium",children:N(A)}),e&&ne,
6
+ /* @__PURE__ */h("span",{className:"text-gray-500",children:[" · ",E(new Date(A.date).getTime())," · ",G.overall(Math.round(Z))," · ",G.inStock(Y)]})]}):/* @__PURE__ */b("span",{className:"text-gray-500",children:G.noReport})});if("rail"===S){const e=null!=J&&J>=q&&q>O,t=e?{key:"__estimate__",label:G.estimatedCompletion,dateText:E(J)}: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:q,reports:C,markers:D,valueMs:A,activeId:I?.id??"",onChange:L,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??J.start,end:M?.end??(e?J.estDone:void 0)},onDragStart:H.stop,playback:{playing:H.playing,onArrive:(e,t)=>L(t),onProgress:f,onStop:H.stop}}),
8
+ /* @__PURE__ */b(w,{bare:!0,endMark:t,startMs:O,endMs:q,reports:P,markers:C,valueMs:L,activeId:A?.id??"",onChange:I,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:{start:M?.start??G.start,end:M?.end??(e?G.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:E,subject:R,meta:[`${G(O)} → ${G(q)}`,J.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
- /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[C.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
- /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),J.report]}),Q.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"})}),J.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"})}),J.inspection]}),W.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"})}),J.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:C,markers:D,valueMs:A,activeId:I?.id??"",onChange:L,onPickReport:i,onOpenReport:l,onOpenMarker:m,renderReportPreview:k,reportLabel:N,edgeCaptions:M,onDragStart:H.stop,playback:{playing:H.playing,onArrive:(e,t)=>L(t),onProgress:f,onStop:H.stop}})})})}export{k as POST_PRODUCTION_STATUSES,N as ProductionTimeline,f as STAGES,_ as calcOverall,v as calcReportOverall,M as useProductionTimeline};
10
+ return b("div",{className:"shrink-0",children:/* @__PURE__ */b(e,{icon:/* @__PURE__ */b(r,{}),heading:Q,subject:R,meta:[`${E(O)} → ${E(q)}`,G.leadTime(T)],actions:/* @__PURE__ */h(y,{children:[te,ee]}),footer:/* @__PURE__ */h(y,{children:[ae(!0),
11
+ /* @__PURE__ */h("div",{className:"rosh-tl-legend",children:[P.length>0&&/* @__PURE__ */h("span",{className:"border-gray-200 text-gray-500",children:[
12
+ /* @__PURE__ */b("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),G.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"})}),G.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"})}),G.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"})}),G.invoice]})]})]}),children:/* @__PURE__ */b(w,{startMs:O,endMs:q,reports:P,markers:C,valueMs:L,activeId:A?.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{useShellLanguage as e}from"./chunk-UVMM7AYO.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-ESWR7YNY.js";import{Icon as t}from"./chunk-7V32O5NF.js";import{useShellStrings as l}from"./chunk-5YP7MFPK.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
1
+ import{useShellLanguage as e}from"./chunk-S262RGL6.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-A34PD3XT.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{useShellStrings as l}from"./chunk-MBY5JIGB.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
2
2
  /* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
4
4
  /* @__PURE__ */s("div",{children:[
@@ -1,4 +1,4 @@
1
- import{isSafeLinkHref as e}from"./chunk-Q5Z3KHT2.js";import{Button_default as t}from"./chunk-7DI3VQCF.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{useShellStrings as r}from"./chunk-5YP7MFPK.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
1
+ import{isSafeLinkHref as e}from"./chunk-Q5Z3KHT2.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-MBY5JIGB.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
2
2
  return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
3
3
  /* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
4
4
  /* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
@@ -1,11 +1,11 @@
1
- import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-5YP7MFPK.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
2
- return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const j=r().meter,B=s(),F=w??j.noData,P=null!=p&&Number.isFinite(p)?p:null,A=Number.isFinite(f)&&f>0?f:null;null==A&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const C=e(v,"MetricBar"),D=null!=P?C??t(l(P,g,b)):null,E=n(g),G=n(b),L=null!=P&&null!=A?x(P/A*100):0,R=null!=P?(y??(a=>100===A?u(a,1,B):m(a,B)))(P):"—",S=null!=P&&null!=A&&(null!=E||null!=G),z="md"===k||"lg"===k,H=z?"h-2":"h-1.5",K=null!=P&&null!=A,O=/* @__PURE__ */c("div",{...K?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":Math.min(A,Math.max(0,P)),"aria-valuetext":R}:{"aria-hidden":!0},className:K&&D?`relative mt-2 ${H} rounded-full bg-gray-200`:`relative mt-2 ${H} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[K&&
3
- /* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${D?D.fill:"bg-gray-400"}`,style:{width:`${L}%`}}),S&&null!=A&&null!=E&&/* @__PURE__ */o(d,{at:x(E/A*100),title:j.warningAt(E),className:i.warning}),S&&null!=A&&null!=G&&/* @__PURE__ */o(d,{at:x(G/A*100),title:j.criticalAt(G),className:i.critical})]}),Q=D?D.ink:null!=P?"text-gray-900":"text-gray-400";if(z){const a="lg"===k;/* @__PURE__ */
1
+ import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-MBY5JIGB.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
2
+ return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const B=r().meter,j=s(),A=w??B.noData,F=null!=p&&Number.isFinite(p)?p:null,G=Number.isFinite(f)&&f>0?f:null;null==G&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const C=e(v,"MetricBar"),D=null!=F?C??t(l(F,g,b)):null,E=n(g),L=n(b),P=null!=F&&null!=G?x(F/G*100):0,R=null!=F?(y??(a=>100===G?u(a,1,j):m(a,j)))(F):"—",S=null!=F&&null!=G&&(null!=E||null!=L),z="md"===k||"lg"===k,H=z?"h-2":"h-1.5",I=null!=F&&null!=G,J=/* @__PURE__ */c("div",{...I?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":G,"aria-valuenow":Math.min(G,Math.max(0,F)),"aria-valuetext":R}:{"aria-hidden":!0},className:I&&D?`relative mt-2 ${H} rounded-full bg-gray-200`:`relative mt-2 ${H} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[I&&
3
+ /* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${D?D.fill:"bg-gray-400"}`,style:{width:`${P}%`}}),S&&null!=G&&null!=E&&/* @__PURE__ */o(d,{at:x(E/G*100),title:B.warningAt(E),className:i.warning}),S&&null!=G&&null!=L&&/* @__PURE__ */o(d,{at:x(L/G*100),title:B.criticalAt(L),className:i.critical})]}),O=D?D.ink:null!=F?"text-gray-900":"text-gray-400";if(z){const a="lg"===k;/* @__PURE__ */
4
4
  return c("div",{className:M,children:[null!=h&&/* @__PURE__ */o("div",{className:(a?"text-xs":"text-3xs")+" font-medium uppercase tracking-wide text-gray-500",children:h}),
5
5
  /* @__PURE__ */c("div",{className:"mt-1 flex items-baseline gap-2",children:[
6
- /* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${Q}`,children:R}),
7
- /* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=P?N:F})]}),O]})}/* @__PURE__ */
6
+ /* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${O}`,children:R}),
7
+ /* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=F?N:A})]}),J]})}/* @__PURE__ */
8
8
  return c("div",{className:M,children:[
9
9
  /* @__PURE__ */c("div",{className:"flex items-baseline gap-2",children:[null!=h&&/* @__PURE__ */o("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:h}),
10
- /* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${Q}`,children:R}),
11
- /* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=P?N:F})]}),O]})}export{h as MetricBar};
10
+ /* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${O}`,children:R}),
11
+ /* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=F?N:A})]}),J]})}export{h as MetricBar};
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-NJN5IKWO.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};