efficient-shell 10.16.0 → 10.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/dist/{Browser-RI5X7GMK.js → Browser-4B76MFTG.js} +13 -13
  2. package/dist/Calculator-AXFKAC7G.js +29 -0
  3. package/dist/{CurrencyConverter-2GUEE7ZR.js → CurrencyConverter-36BFSFRS.js} +8 -8
  4. package/dist/{Documents-GI346UL5.js → Documents-VKAMBKSP.js} +15 -15
  5. package/dist/Files-NRYZG4KY.js +88 -0
  6. package/dist/{Notepad-HRZKLHO3.js → Notepad-AQXGH6VP.js} +10 -10
  7. package/dist/{PdfViewer-LU5JKHSG.js → PdfViewer-Y3SAVADX.js} +1 -1
  8. package/dist/{PomodoroTimer-QYCTTTPZ.js → PomodoroTimer-RHDLKJBY.js} +63 -63
  9. package/dist/{Preview-LSGN5GN7.js → Preview-DEBTZQP5.js} +47 -47
  10. package/dist/Sidebar-CB6KRPW2.js +44 -0
  11. package/dist/{Spreadsheet-7JBZY6KJ.js → Spreadsheet-FSHLWXYP.js} +13 -13
  12. package/dist/{Stock-ZVQT25IE.js → Stock-CV53A432.js} +3 -3
  13. package/dist/{Weather-RAUDLLVU.js → Weather-R4MCLH7F.js} +19 -19
  14. package/dist/{WorldClock-2XBWZ6SZ.js → WorldClock-CSFPCZHU.js} +6 -6
  15. package/dist/ai/index.d.ts +1 -1
  16. package/dist/ai/index.js +81 -80
  17. package/dist/ai.css +1 -1
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/media-host-check.js +1 -1
  20. package/dist/bin/ui-check.js +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChartTooltip.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -1
  29. package/dist/charts/ColumnChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/SpecChart.js +1 -1
  42. package/dist/charts/StatTile.js +1 -1
  43. package/dist/charts/SunburstChart.js +1 -1
  44. package/dist/charts/TimeSeriesChart.js +1 -1
  45. package/dist/charts/TreemapChart.js +1 -1
  46. package/dist/charts/WaterfallChart.js +1 -1
  47. package/dist/chunk-26RTJKHD.js +2 -0
  48. package/dist/{chunk-F2R3UFNQ.js → chunk-2E2SUEEE.js} +1 -1
  49. package/dist/chunk-2EVTN26H.js +2 -0
  50. package/dist/{chunk-M22B3Y5Y.js → chunk-3IUPYCW3.js} +1 -1
  51. package/dist/{chunk-N3TOHWFF.js → chunk-3J2PO3KW.js} +1 -1
  52. package/dist/{chunk-X6BFVDB4.js → chunk-3PR7FLTZ.js} +2 -2
  53. package/dist/{chunk-PCFBDXLN.js → chunk-3TKMH5VR.js} +1 -1
  54. package/dist/{chunk-4WEFGKJL.js → chunk-3VLG6LR3.js} +4 -4
  55. package/dist/{chunk-CBEKJTXU.js → chunk-4D66DUU5.js} +5 -5
  56. package/dist/{chunk-XDBG4HPV.js → chunk-4EZIWLJJ.js} +1 -1
  57. package/dist/{chunk-FWVC4A2O.js → chunk-4MJA2SPJ.js} +13 -13
  58. package/dist/chunk-4Q25UHWB.js +22 -0
  59. package/dist/{chunk-EZEYKCI6.js → chunk-4ULRP4Y4.js} +1 -1
  60. package/dist/chunk-4V73LGZG.js +11 -0
  61. package/dist/{chunk-S6FBMSFU.js → chunk-5IPFQV34.js} +2 -2
  62. package/dist/{chunk-3ELLBQPS.js → chunk-5LCDCO46.js} +1 -1
  63. package/dist/{chunk-GISDIVFK.js → chunk-5N5AAYQV.js} +1 -1
  64. package/dist/{chunk-7HTRLRVO.js → chunk-5VAIVRK6.js} +62 -62
  65. package/dist/{chunk-RLJHRDDW.js → chunk-5W2OEDUD.js} +8 -8
  66. package/dist/chunk-6ACS4S4P.js +15 -0
  67. package/dist/{chunk-ULXCDM7Y.js → chunk-6V4INP7J.js} +10 -10
  68. package/dist/{chunk-LCJRTJXT.js → chunk-7AZAMDGG.js} +9 -9
  69. package/dist/{chunk-AKM6JBMD.js → chunk-7ELJQL7J.js} +1 -1
  70. package/dist/chunk-7RPYVQEV.js +2 -0
  71. package/dist/{chunk-UPQW4GCT.js → chunk-7TZV6G2F.js} +1 -1
  72. package/dist/{chunk-VTFZ6W2D.js → chunk-7X4QNWA7.js} +2 -2
  73. package/dist/{chunk-D7F442OZ.js → chunk-AEJYSUVQ.js} +1 -1
  74. package/dist/{chunk-QYSEYYV7.js → chunk-AFINCNY3.js} +1 -1
  75. package/dist/{chunk-DKGZPVLL.js → chunk-AFYLVV74.js} +1 -1
  76. package/dist/{chunk-H4HB5OET.js → chunk-AWKJZSTO.js} +1 -1
  77. package/dist/chunk-B3CN55UI.js +2 -0
  78. package/dist/{chunk-CQV3VSI2.js → chunk-B4HSNEBK.js} +1 -1
  79. package/dist/{chunk-57HN6MPC.js → chunk-BE777IO7.js} +2 -2
  80. package/dist/{chunk-K4ANB6AF.js → chunk-BVIOCAEU.js} +1 -1
  81. package/dist/{chunk-4UKGVLFP.js → chunk-BZUA5F33.js} +1 -1
  82. package/dist/{chunk-QP4UPCXQ.js → chunk-C764JODK.js} +1 -1
  83. package/dist/chunk-CCIGAU5Y.js +6 -0
  84. package/dist/{chunk-CKKUFDZ3.js → chunk-CF7BMDU3.js} +18 -18
  85. package/dist/{chunk-LEDUD23S.js → chunk-CLTRQ7AQ.js} +1 -1
  86. package/dist/{chunk-7TNAOZZ2.js → chunk-CNUHLJYD.js} +1 -1
  87. package/dist/chunk-CUKDQPEN.js +19 -0
  88. package/dist/{chunk-ISJPW2FZ.js → chunk-D6OYQM4V.js} +11 -11
  89. package/dist/{chunk-W6URVLQF.js → chunk-DOC52JBV.js} +17 -17
  90. package/dist/{chunk-IOJNSX4N.js → chunk-DQQKG46I.js} +7 -7
  91. package/dist/{chunk-INNIWRVU.js → chunk-E6GDAV5R.js} +2 -2
  92. package/dist/{chunk-TM33D3CE.js → chunk-EC527NE3.js} +1 -1
  93. package/dist/{chunk-RCPFUDPS.js → chunk-EDMDKQNO.js} +3 -3
  94. package/dist/{chunk-3EJ64VKE.js → chunk-EN5NXWT6.js} +1 -1
  95. package/dist/{chunk-MTEFYFUO.js → chunk-ENDCV7B3.js} +9 -9
  96. package/dist/{chunk-MCDM2G4W.js → chunk-EOWUUOVE.js} +1 -1
  97. package/dist/{chunk-4G2C6J4I.js → chunk-EQCFPRKJ.js} +1 -1
  98. package/dist/{chunk-TXDA7TTP.js → chunk-EQZZ4V5X.js} +1 -1
  99. package/dist/{chunk-WINNA7LS.js → chunk-EZUQ5NXE.js} +1 -1
  100. package/dist/chunk-F7Z47OIF.js +12 -0
  101. package/dist/{chunk-2SY76NFO.js → chunk-FEATDGFD.js} +4 -4
  102. package/dist/chunk-FX6DBXXD.js +1 -0
  103. package/dist/{chunk-7JGR7WPD.js → chunk-G4JTO5PB.js} +1 -1
  104. package/dist/{chunk-SG4LO2AN.js → chunk-G4PGEQOX.js} +10 -10
  105. package/dist/{chunk-W3OWPBQL.js → chunk-GD7ILVPF.js} +2 -2
  106. package/dist/chunk-GDQJBQ5B.js +1 -0
  107. package/dist/chunk-GLBLKHYA.js +5 -0
  108. package/dist/{chunk-WB4P4QE2.js → chunk-H7BKSATJ.js} +1 -1
  109. package/dist/{chunk-L4IW77TD.js → chunk-HJ2BDUO6.js} +4 -4
  110. package/dist/chunk-HJCUDXLV.js +1 -0
  111. package/dist/{chunk-SDQIXE5M.js → chunk-HLQVB7FG.js} +8 -8
  112. package/dist/chunk-HLVOHOBC.js +6 -0
  113. package/dist/{chunk-QHOBK35Y.js → chunk-HS2E7DVI.js} +1 -1
  114. package/dist/chunk-HXNMRJQ4.js +2 -0
  115. package/dist/chunk-HXZ5XPBS.js +3 -0
  116. package/dist/{chunk-3LDXURVU.js → chunk-HYDVHGVT.js} +2 -2
  117. package/dist/chunk-IDV32UV7.js +29 -0
  118. package/dist/chunk-IHFZ7OXO.js +14 -0
  119. package/dist/{chunk-MNSKGMVZ.js → chunk-ILP7QVW5.js} +8 -8
  120. package/dist/{chunk-KJ4CBZEQ.js → chunk-IMDGMUE3.js} +1 -1
  121. package/dist/{chunk-JGTGQGHY.js → chunk-IX7QXMNJ.js} +1 -1
  122. package/dist/chunk-JFH5HW2G.js +12 -0
  123. package/dist/{chunk-HNBGLF4B.js → chunk-JFV5CQN4.js} +1 -1
  124. package/dist/{chunk-7MSC3Z5H.js → chunk-JH4ZCPHW.js} +8 -8
  125. package/dist/{chunk-OOLPDASG.js → chunk-JSG2AKCG.js} +1 -1
  126. package/dist/{chunk-6RX4PVBU.js → chunk-JTMEFXRL.js} +1 -1
  127. package/dist/{chunk-YOSUCCHG.js → chunk-K7L3ZCPB.js} +3 -3
  128. package/dist/chunk-KLBJ646Z.js +8 -0
  129. package/dist/{chunk-7NBSBGLX.js → chunk-L2RS2UQM.js} +8 -8
  130. package/dist/{chunk-PYAJCN2Q.js → chunk-LAMRQE2P.js} +1 -1
  131. package/dist/{chunk-ULAGXDOL.js → chunk-LXL2UCUR.js} +1 -1
  132. package/dist/{chunk-O6JJIR4H.js → chunk-M5LR7ZZX.js} +1 -1
  133. package/dist/{chunk-UWIZX3RK.js → chunk-MAFSELZK.js} +1 -1
  134. package/dist/{chunk-N67QX3WW.js → chunk-MMQ6ETRD.js} +2 -2
  135. package/dist/{chunk-XTCXX5LJ.js → chunk-MS5APD3V.js} +1 -1
  136. package/dist/chunk-MUXGWDEH.js +2 -0
  137. package/dist/{chunk-GPJO34QP.js → chunk-N4ZEB4UD.js} +9 -9
  138. package/dist/{chunk-E3753CWP.js → chunk-NRI26RYC.js} +2 -2
  139. package/dist/{chunk-7HLC352T.js → chunk-NVFYLTJ6.js} +17 -17
  140. package/dist/chunk-NXVFY22L.js +9 -0
  141. package/dist/{chunk-QDQ347RL.js → chunk-NYEMGKAE.js} +1 -1
  142. package/dist/{chunk-5UYZ75F3.js → chunk-NZGNOMWX.js} +12 -12
  143. package/dist/{chunk-3NW5LD7D.js → chunk-NZQCDFDG.js} +3 -3
  144. package/dist/{chunk-BJXDOM2N.js → chunk-OBJGUJIE.js} +1 -1
  145. package/dist/{chunk-AUWTGM65.js → chunk-OH5L6HYW.js} +3 -3
  146. package/dist/{chunk-ZURB2DCM.js → chunk-OPN4I565.js} +1 -1
  147. package/dist/{chunk-7SMV6G4Z.js → chunk-ORIXCEKO.js} +1 -1
  148. package/dist/{chunk-FEQDZTZ7.js → chunk-OUIE2N2Z.js} +6 -6
  149. package/dist/{chunk-TOVKWNI2.js → chunk-P3RXXWXN.js} +6 -6
  150. package/dist/{chunk-ON67HF5K.js → chunk-PCTOL2FX.js} +8 -8
  151. package/dist/{chunk-6XBWM453.js → chunk-Q3IR5SKD.js} +1 -1
  152. package/dist/{chunk-7ZP64SC7.js → chunk-Q5QS5MFX.js} +1 -1
  153. package/dist/{chunk-4QJOEHM6.js → chunk-QEB2UTHO.js} +7 -7
  154. package/dist/{chunk-I2XGPTCN.js → chunk-QJLBBDX2.js} +1 -1
  155. package/dist/{chunk-AJO72CPB.js → chunk-QLVJ5W4G.js} +2 -2
  156. package/dist/chunk-QO5E33DH.js +8 -0
  157. package/dist/{chunk-LPXMHYTM.js → chunk-QVZKRROQ.js} +1 -1
  158. package/dist/{chunk-EXJXOKUU.js → chunk-QYL26AB4.js} +1 -1
  159. package/dist/chunk-RAAH4TQU.js +1 -0
  160. package/dist/{chunk-JJW43QPS.js → chunk-RBEI4CKX.js} +5 -5
  161. package/dist/{chunk-TVH7IZQ4.js → chunk-REWKL7MX.js} +2 -2
  162. package/dist/{chunk-MVZRZTQP.js → chunk-S5SRXI4V.js} +1 -1
  163. package/dist/{chunk-QYRMFGES.js → chunk-SAP4YI2Y.js} +1 -1
  164. package/dist/{chunk-KTA77U3P.js → chunk-SDATPJM2.js} +4 -4
  165. package/dist/{chunk-KEPJWZJZ.js → chunk-SL77N7VT.js} +3 -3
  166. package/dist/{chunk-UDRMZ22J.js → chunk-SOBGCIPF.js} +1 -1
  167. package/dist/{chunk-H32EQG5Z.js → chunk-SOJEQHZ2.js} +9 -9
  168. package/dist/{chunk-34URULVW.js → chunk-SQCUN2DX.js} +1 -1
  169. package/dist/chunk-SRWZE3WA.js +6 -0
  170. package/dist/{chunk-5RE6R3XC.js → chunk-SXNQHIBY.js} +1 -1
  171. package/dist/{chunk-GGK27H67.js → chunk-TGGUYAWA.js} +1 -1
  172. package/dist/chunk-TGXO3CDO.js +2 -0
  173. package/dist/{chunk-74OUAR6L.js → chunk-TIGTIT3L.js} +6 -6
  174. package/dist/{chunk-UYRITNQW.js → chunk-TLWGOQI3.js} +3 -3
  175. package/dist/{chunk-MQU3PZUS.js → chunk-TMMNCXQT.js} +1 -1
  176. package/dist/chunk-TNDRHHKN.js +14 -0
  177. package/dist/{chunk-SHKBDFSE.js → chunk-TXDBOSSB.js} +1 -1
  178. package/dist/{chunk-DRDYZ633.js → chunk-U32J7D4Q.js} +2 -2
  179. package/dist/{chunk-LDE5IV2M.js → chunk-UABVKJK7.js} +4 -4
  180. package/dist/{chunk-UTWJKSET.js → chunk-UEISJFZH.js} +5 -5
  181. package/dist/{chunk-B7UCXROE.js → chunk-UG6RI525.js} +1 -1
  182. package/dist/chunk-UXPBVRSE.js +7 -0
  183. package/dist/{chunk-W5CJD54C.js → chunk-VAK5FQXH.js} +1 -1
  184. package/dist/{chunk-O7DW2BKY.js → chunk-VHF3CJVO.js} +28 -28
  185. package/dist/{chunk-7X5FABQS.js → chunk-VHPT7ZS5.js} +5 -5
  186. package/dist/{chunk-MHB52H2Y.js → chunk-WON5GBJY.js} +12 -12
  187. package/dist/{chunk-D4I3U7UE.js → chunk-WS7XIJS6.js} +1 -1
  188. package/dist/{chunk-AOK3BHRT.js → chunk-WWLKVGV7.js} +4 -4
  189. package/dist/{chunk-G4GVLK44.js → chunk-WZ5QSSUM.js} +6 -6
  190. package/dist/{chunk-LO5T2K4B.js → chunk-X2KMUHBB.js} +3 -3
  191. package/dist/{chunk-CPZ42W2B.js → chunk-XCAO2F3H.js} +1 -1
  192. package/dist/chunk-XGJQVIEG.js +2 -0
  193. package/dist/{chunk-PVZGSCCB.js → chunk-XKJ7GEVA.js} +5 -5
  194. package/dist/chunk-XPTOKPUM.js +11 -0
  195. package/dist/{chunk-XZGGJHJC.js → chunk-XQMPLXGG.js} +15 -15
  196. package/dist/{chunk-VKKK4WLS.js → chunk-XQZL6JDD.js} +6 -6
  197. package/dist/{chunk-JEH5EVIG.js → chunk-XSJHN2GD.js} +1 -1
  198. package/dist/{chunk-2VGQS6CW.js → chunk-XTV3CAV7.js} +1 -1
  199. package/dist/{chunk-3AH524CN.js → chunk-XYECIBVX.js} +1 -1
  200. package/dist/{chunk-6C6TRDNI.js → chunk-YG2TWBDH.js} +1 -1
  201. package/dist/chunk-YG6Y5X7S.js +7 -0
  202. package/dist/chunk-YJ5IHIAI.js +2 -0
  203. package/dist/{chunk-NBVHJZVS.js → chunk-YQFGRYEF.js} +12 -12
  204. package/dist/chunk-YUECA3XB.js +8 -0
  205. package/dist/chunk-YYZ73H64.js +7 -0
  206. package/dist/{chunk-7UTPXU6K.js → chunk-ZF2MNQXY.js} +1 -1
  207. package/dist/{chunk-ZW3IDCP2.js → chunk-ZGOHRLXG.js} +1 -1
  208. package/dist/{chunk-6AS5PHHK.js → chunk-ZI3DGOW6.js} +17 -17
  209. package/dist/{chunk-TKJBZIHT.js → chunk-ZMRGHVKS.js} +1 -1
  210. package/dist/data/DataTable.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/file-intake/index.js +1 -1
  216. package/dist/forms/AlignmentGrid.js +1 -1
  217. package/dist/forms/BorderInput.js +1 -1
  218. package/dist/forms/BrandAssetEditor.js +1 -1
  219. package/dist/forms/Button.js +1 -1
  220. package/dist/forms/Calendar.js +1 -1
  221. package/dist/forms/ColorPicker.js +1 -1
  222. package/dist/forms/ComposerAttachments.js +1 -1
  223. package/dist/forms/CornersInput.js +1 -1
  224. package/dist/forms/DatePicker.js +1 -1
  225. package/dist/forms/DateRangePicker.js +1 -1
  226. package/dist/forms/DateTimePicker.js +1 -1
  227. package/dist/forms/DisplayChips.js +1 -1
  228. package/dist/forms/FilePicker.js +1 -1
  229. package/dist/forms/FormErrorSummary.js +1 -1
  230. package/dist/forms/IconButton.js +1 -1
  231. package/dist/forms/IconPicker.js +1 -1
  232. package/dist/forms/ImageFocusPoint.js +1 -1
  233. package/dist/forms/InputNumber.js +1 -1
  234. package/dist/forms/LinkPicker.js +1 -1
  235. package/dist/forms/MediaLibrary.js +1 -1
  236. package/dist/forms/MediaUploadField.js +1 -1
  237. package/dist/forms/MediaUploadGrid.js +1 -1
  238. package/dist/forms/MediaUsedInList.js +1 -1
  239. package/dist/forms/NumericKeypad.js +1 -1
  240. package/dist/forms/PictureTiles.js +1 -1
  241. package/dist/forms/PositionInput.js +1 -1
  242. package/dist/forms/Segmented.js +1 -1
  243. package/dist/forms/Select.d.ts +1 -1
  244. package/dist/forms/Select.js +1 -1
  245. package/dist/forms/SidesInput.js +1 -1
  246. package/dist/forms/Slider.js +1 -1
  247. package/dist/forms/Snippet.js +1 -1
  248. package/dist/forms/SplitButton.js +1 -1
  249. package/dist/forms/TagInput.js +1 -1
  250. package/dist/forms/TextToolbar.d.ts +1 -1
  251. package/dist/forms/TextToolbar.js +1 -1
  252. package/dist/forms/TimePicker.js +1 -1
  253. package/dist/forms/WidthsBar.js +1 -1
  254. package/dist/forms/mediaLibraryMenu.js +1 -1
  255. package/dist/forms/mediaMoveItems.js +1 -1
  256. package/dist/forms/textAlign.d.ts +1 -1
  257. package/dist/forms/textAlign.js +1 -1
  258. package/dist/forms/useFileIntake.js +1 -1
  259. package/dist/hooks/useTheme.d.ts +1 -1
  260. package/dist/icons/efficient-glyphs.d.ts +2 -0
  261. package/dist/icons/efficient-glyphs.js +1 -1
  262. package/dist/icons/efficient-looks.d.ts +4 -0
  263. package/dist/icons/efficient-looks.js +1 -1
  264. package/dist/icons/efficient-meanings.d.ts +2 -0
  265. package/dist/icons/efficient-meanings.js +1 -1
  266. package/dist/icons/efficient.d.ts +2 -0
  267. package/dist/icons/efficient.js +1 -1
  268. package/dist/icons/glyphs/SeparatorSlashIcon.d.ts +8 -0
  269. package/dist/icons/glyphs/SeparatorSlashIcon.js +1 -0
  270. package/dist/icons/glyphs/SeparatorTriangleIcon.d.ts +8 -0
  271. package/dist/icons/glyphs/SeparatorTriangleIcon.js +1 -0
  272. package/dist/icons/index.d.ts +2 -2
  273. package/dist/icons/index.js +1 -1
  274. package/dist/icons/looks/SeparatorSlashMiniIcon.d.ts +8 -0
  275. package/dist/icons/looks/SeparatorSlashMiniIcon.js +1 -0
  276. package/dist/icons/looks/SeparatorSlashSolidIcon.d.ts +8 -0
  277. package/dist/icons/looks/SeparatorSlashSolidIcon.js +1 -0
  278. package/dist/icons/looks/SeparatorTriangleMiniIcon.d.ts +8 -0
  279. package/dist/icons/looks/SeparatorTriangleMiniIcon.js +1 -0
  280. package/dist/icons/looks/SeparatorTriangleSolidIcon.d.ts +8 -0
  281. package/dist/icons/looks/SeparatorTriangleSolidIcon.js +1 -0
  282. package/dist/icons/looks/map.js +1 -1
  283. package/dist/icons/sets.js +1 -1
  284. package/dist/index.d.ts +4 -4
  285. package/dist/index.js +256 -256
  286. package/dist/locales/zh-Hans.js +1 -1
  287. package/dist/map/index.js +8 -8
  288. package/dist/{names-Bmx_9y41.d.ts → names-CkQuQ47O.d.ts} +1 -1
  289. package/dist/page-tabs/index.js +5 -5
  290. package/dist/pdf/index.js +1 -1
  291. package/dist/shell/Accordion.js +1 -1
  292. package/dist/shell/AppUpdateBanner.js +1 -1
  293. package/dist/shell/Avatar.js +1 -1
  294. package/dist/shell/Banner.js +1 -1
  295. package/dist/shell/Breadcrumbs.js +1 -1
  296. package/dist/shell/BudgetBar.js +1 -1
  297. package/dist/shell/Card.js +1 -1
  298. package/dist/shell/ColoredBadge.js +1 -1
  299. package/dist/shell/ConfirmDialog.js +1 -1
  300. package/dist/shell/ContainerFillChart.js +1 -1
  301. package/dist/shell/ContextMenu.js +1 -1
  302. package/dist/shell/CountBadge.js +1 -1
  303. package/dist/shell/Dialog.js +1 -1
  304. package/dist/shell/Drawer.js +1 -1
  305. package/dist/shell/DropdownMenu.js +1 -1
  306. package/dist/shell/EditableGrid.js +1 -1
  307. package/dist/shell/EmptyState.js +1 -1
  308. package/dist/shell/FloatingBar.js +1 -1
  309. package/dist/shell/GlobalSearch.js +1 -1
  310. package/dist/shell/HelpCenter.js +1 -1
  311. package/dist/shell/IconRail.js +1 -1
  312. package/dist/shell/ImageLightbox.js +1 -1
  313. package/dist/shell/ItemCount.js +1 -1
  314. package/dist/shell/LanguageSelect.js +1 -1
  315. package/dist/shell/Markdown.d.ts +1 -1
  316. package/dist/shell/Markdown.js +1 -1
  317. package/dist/shell/MetricBar.js +1 -1
  318. package/dist/shell/MetricBarLegend.js +1 -1
  319. package/dist/shell/MilestoneTimeline.js +1 -1
  320. package/dist/shell/PageHeader.js +1 -1
  321. package/dist/shell/Popover.js +1 -1
  322. package/dist/shell/PopupMenu.js +1 -1
  323. package/dist/shell/ProductionTimeline.js +1 -1
  324. package/dist/shell/ResizeHandle.js +1 -1
  325. package/dist/shell/Result.js +1 -1
  326. package/dist/shell/SearchableSelect.js +1 -1
  327. package/dist/shell/SettingReset.js +1 -1
  328. package/dist/shell/SettingRow.js +1 -1
  329. package/dist/shell/SidebarLayout.js +1 -1
  330. package/dist/shell/SidebarNav.js +1 -1
  331. package/dist/shell/SortableList.js +1 -1
  332. package/dist/shell/Statistic.js +1 -1
  333. package/dist/shell/StatusBadge.js +1 -1
  334. package/dist/shell/Tabs.js +1 -1
  335. package/dist/shell/TimeAgo.js +1 -1
  336. package/dist/shell/TimelineTrack.js +1 -1
  337. package/dist/shell/Tooltip.js +1 -1
  338. package/dist/shell/TopNav.js +1 -1
  339. package/dist/shell/TransferProgress.js +1 -1
  340. package/dist/shell/Tree.js +1 -1
  341. package/dist/shell/discardGuard.js +1 -1
  342. package/dist/shell/language.js +1 -1
  343. package/dist/shell/strings.d.ts +6 -0
  344. package/dist/shell/strings.js +1 -1
  345. package/dist/shell/toast.js +1 -1
  346. package/dist/telemetry/index.js +1 -1
  347. package/dist/templates/AuthScreen.js +1 -1
  348. package/dist/templates/ChatTemplate.js +1 -1
  349. package/dist/templates/CheckoutTemplate.js +1 -1
  350. package/dist/templates/DashboardTemplate.js +1 -1
  351. package/dist/templates/DataTablePage.js +1 -1
  352. package/dist/templates/EmailTemplate.js +1 -1
  353. package/dist/templates/ErrorBoundary.d.ts +1 -1
  354. package/dist/templates/ErrorBoundary.js +1 -1
  355. package/dist/templates/ErrorPage.js +1 -1
  356. package/dist/templates/FormLayoutPage.js +1 -1
  357. package/dist/templates/GalleryTemplate.js +1 -1
  358. package/dist/ui/index.d.ts +1 -1
  359. package/dist/ui/index.js +1 -1
  360. package/dist/version.js +1 -1
  361. package/package.json +1 -1
  362. package/dist/Calculator-Y566OMJZ.js +0 -29
  363. package/dist/Files-UA23KXN7.js +0 -88
  364. package/dist/Sidebar-2P26444H.js +0 -44
  365. package/dist/chunk-2JG5JU4M.js +0 -8
  366. package/dist/chunk-4PAWQEXM.js +0 -1
  367. package/dist/chunk-7XYTJPWW.js +0 -29
  368. package/dist/chunk-BNJWZAQE.js +0 -12
  369. package/dist/chunk-COJYPNKF.js +0 -2
  370. package/dist/chunk-DESWIPOZ.js +0 -3
  371. package/dist/chunk-DWR7MYQU.js +0 -7
  372. package/dist/chunk-EU3JZGV2.js +0 -14
  373. package/dist/chunk-I4VIEGCX.js +0 -2
  374. package/dist/chunk-IKNG7EFQ.js +0 -12
  375. package/dist/chunk-JSGQWVYH.js +0 -7
  376. package/dist/chunk-KTVXPGGB.js +0 -11
  377. package/dist/chunk-LU6NA4RU.js +0 -5
  378. package/dist/chunk-M4K6FLIY.js +0 -1
  379. package/dist/chunk-PJQGYKN6.js +0 -11
  380. package/dist/chunk-PN5FQVMB.js +0 -7
  381. package/dist/chunk-PN65IIYN.js +0 -8
  382. package/dist/chunk-PUF75SMJ.js +0 -1
  383. package/dist/chunk-Q6YNMNUH.js +0 -6
  384. package/dist/chunk-RPYFOQM2.js +0 -6
  385. package/dist/chunk-RRUHQLUY.js +0 -14
  386. package/dist/chunk-TMNAHOJ7.js +0 -9
  387. package/dist/chunk-UBMY23AG.js +0 -6
  388. package/dist/chunk-VNACNNCJ.js +0 -19
  389. package/dist/chunk-W35N7SL3.js +0 -8
  390. package/dist/chunk-W4OBVKN4.js +0 -1
  391. package/dist/chunk-WMEYNKXZ.js +0 -22
  392. package/dist/chunk-Y3R267FV.js +0 -15
  393. package/dist/chunk-ZZVE64OI.js +0 -2
  394. /package/dist/{chunk-6V6ANLHW.js → chunk-Y2AGVGOP.js} +0 -0
@@ -1,6 +1,6 @@
1
- import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-4PAWQEXM.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsx as o,jsxs as h}from"react/jsx-runtime";function c({rows:c,max:u,formatValue:d,emphasisKey:p,highlight:g="none",emphasisTone:x,barHeight:f=12,rowGap:y=30,animate:b=!0,labelFont:N="sans",className:k,emptyLabel:v}){const $=i().charts,j=r(),w=d??(e=>m(e,j)),M=v??$.nothingToRank;if(0===c.length)/* @__PURE__ */
2
- return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:M});const F=t(c.map(e=>e.value),g),R=p??(null===F?void 0:c[F]?.key),C=u??Math.max(...c.map(e=>e.value).filter(Number.isFinite),0),A=s(0);/* @__PURE__ */
3
- return o("ol",{className:`m-0 list-none p-0 ${k??""}`,style:{display:"grid",rowGap:`${Math.max(4,y-f)}px`},children:c.map((t,i)=>{const r=t.key===R,m=r?x?l[x]:s(1):R?n.muted:A,c=Number.isFinite(t.value)?t.value:null,u=null!==c&&C>0?Math.max(0,Math.min(1,c/C)):0;/* @__PURE__ */
1
+ import{MOTION as e,stagger as a}from"./chunk-465RRWBY.js";import{autoHighlightIndex as t}from"./chunk-CNYAHYE6.js";import{seriesColor as s,STATUS_VARS as l,CHART_INK as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as r}from"./chunk-GDQJBQ5B.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsx as o,jsxs as h}from"react/jsx-runtime";function c({rows:c,max:u,formatValue:d,emphasisKey:p,highlight:g="none",emphasisTone:x,barHeight:f=12,rowGap:y=30,animate:b=!0,labelFont:N="sans",className:k,emptyLabel:v}){const $=i().charts,j=r(),w=d??(e=>m(e,j)),M=v??$.nothingToRank;if(0===c.length)/* @__PURE__ */
2
+ return o("p",{className:`text-sm text-gray-500 ${k??""}`,children:M});const F=t(c.map(e=>e.value),g),R=p??(null===F?void 0:c[F]?.key),C=u??Math.max(...c.map(e=>e.value).filter(Number.isFinite),0),B=s(0);/* @__PURE__ */
3
+ return o("ol",{className:`m-0 list-none p-0 ${k??""}`,style:{display:"grid",rowGap:`${Math.max(4,y-f)}px`},children:c.map((t,i)=>{const r=t.key===R,m=r?x?l[x]:s(1):R?n.muted:B,c=Number.isFinite(t.value)?t.value:null,u=null!==c&&C>0?Math.max(0,Math.min(1,c/C)):0;/* @__PURE__ */
4
4
  return h("li",{className:"grid gap-1",children:[
5
5
  /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-3",children:[
6
6
  /* @__PURE__ */h("span",{className:`truncate ${"mono"===N?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:t.label,children:[t.label,r&&/* @__PURE__ */o("span",{className:"sr-only",children:` ${$.emphasised}`})]}),
@@ -1,4 +1,4 @@
1
- import{Avatar as e}from"./chunk-DKGZPVLL.js";import{StatCard as a,Card as t}from"./chunk-TOVKWNI2.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-LCJRTJXT.js";import{ColumnChart as l}from"./chunk-CBEKJTXU.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-TXDA7TTP.js";import{Button_default as c}from"./chunk-I4VIEGCX.js";import{TH_ONE_LINE as n}from"./chunk-MVZRZTQP.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
1
+ import{Avatar as e}from"./chunk-AFYLVV74.js";import{StatCard as a,Card as t}from"./chunk-P3RXXWXN.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-7AZAMDGG.js";import{ColumnChart as l}from"./chunk-4D66DUU5.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-EQZZ4V5X.js";import{Button_default as c}from"./chunk-HXNMRJQ4.js";import{TH_ONE_LINE as n}from"./chunk-S5SRXI4V.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
2
2
  return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
3
3
  /* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */m("div",{children:[
@@ -1,11 +1,11 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-B7UCXROE.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-6RX4PVBU.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const C=m(),$=l().files,z=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),O=j?`${C}-error`:N?`${C}-hint`:void 0;/* @__PURE__ */
2
- return o(e,{label:g,htmlFor:C,hint:N,error:j,required:k,className:v,children:[
3
- /* @__PURE__ */o("button",{ref:B,type:"button",id:C,disabled:y,onClick:z.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":O,...z.zoneProps,className:t(z.dragOver,y,a(y),"px-4 py-6"),children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-UG6RI525.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-JTMEFXRL.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const $=m(),z=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
2
+ return o(e,{label:g,htmlFor:$,hint:N,error:j,required:k,className:v,children:[
3
+ /* @__PURE__ */o("button",{ref:B,type:"button",id:$,disabled:y,onClick:C.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":F,...C.zoneProps,className:t(C.dragOver,y,a(y),"px-4 py-6"),children:[
4
4
  /* @__PURE__ */o("span",{children:[
5
- /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?$.chooseMany:$.chooseOne}),
6
- /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?$.dragMany:$.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
- /* @__PURE__ */d("input",{...z.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
5
+ /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?z.chooseMany:z.chooseOne}),
6
+ /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?z.dragMany:z.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
+ /* @__PURE__ */d("input",{...C.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
8
8
  /* @__PURE__ */d("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:e.name,children:e.name}),
9
- /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,$)}),
10
- /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{z.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":$.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
- /* @__PURE__ */d(s,{rejections:z.rejections})]})});export{p as FilePicker_default};
9
+ /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,z)}),
10
+ /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{C.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":z.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
+ /* @__PURE__ */d(s,{rejections:C.rejections})]})});export{p as FilePicker_default};
@@ -1,4 +1,4 @@
1
- import{Tooltip as e}from"./chunk-6XBWM453.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-Q3IR5SKD.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};
@@ -0,0 +1,6 @@
1
+ import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-4EZIWLJJ.js";import{IconButton_default as a}from"./chunk-FX6DBXXD.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{Tooltip as n}from"./chunk-Q3IR5SKD.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
2
+ return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":B,windows:j,className:I="",layout:q="grid"}){const A=s().textToolbar,L=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!L.words&&!L.paragraph)return null;const R=m(n,k,x,L.cells.paragraph),S=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,$=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:S(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:S(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,K=l(A),U=e.map(e=>[e,K[e],r(e)]),X=C?e.filter(e=>C.allow.includes(e)):[],J=C&&X.includes(C.value)?C.value:X[0],Q=[["none",A.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",A.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",A.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],T=x&&R?g(A.clear,/* @__PURE__ */i(a,{className:S(!1),"aria-label":A.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,E=/* @__PURE__ */t(d,{children:[$("bold",A.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),$("italic",A.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),$("underline",A.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),$("strike",A.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(A.color,/* @__PURE__ */i(a,{pressed:k.open,className:S(k.open,"rosh-tb-color"),"aria-label":A.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,$("link",A.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),$("sup",A.sup,/* @__PURE__ */i(o,{name:"superscript"})),$("sub",A.sub,/* @__PURE__ */i(o,{name:"subscript"})),$("code",A.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===R?T:null]}),O=/* @__PURE__ */t(d,{children:[C&&X.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.alignment,onKeyDown:e=>p(e,X,e=>C.onChange(e)),children:U.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:S(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===J?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(A.bullet,/* @__PURE__ */i(a,{className:S("bullet"===D.pressed),"aria-label":A.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(A.number,/* @__PURE__ */i(a,{className:S("number"===D.pressed),"aria-label":A.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,$("quote",A.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.letterCase,onKeyDown:e=>p(e,Q.map(([e])=>e),e=>M.onChange(e)),children:Q.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:S(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===R?T:null]}),F="row"===q,G=F?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===N&&"words"!==R?" is-eight":"",H=b(n,Boolean(k)),W={"--rosh-tb-color-col":String(H.color),"--rosh-tb-link-col":String(H.link),...F?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Z;return Z=F?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:O}):null]}):L.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[E,
3
+ /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),O]}):L.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
+ /* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}),
5
+ /* @__PURE__ */i("div",{className:"rosh-tb-para",children:O})]}):/* @__PURE__ */t(d,{children:[L.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==R?" is-eight":""),children:E}):null,L.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:O}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${G} ${I}`.trim(),style:W,children:[
6
+ /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":B??A.formatting,children:Z}),j]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
@@ -1,2 +1,2 @@
1
- import{fromDateKey as t,toDateKey as e}from"./chunk-2HMNOLKX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{pad2 as r}from"./chunk-LF27WIN2.js";import{useShellLocale as i}from"./chunk-4PAWQEXM.js";import{forwardRef as a}from"react";import{jsx as o}from"react/jsx-runtime";var m=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/;function s(t){return null==t||""===t?"":t instanceof Date?Number.isNaN(t.getTime())?"":`${e(n=t)}T${r(n.getHours())}:${r(n.getMinutes())}`:m.test(t)?t:"";var n}var u=a(function({value:e,onChange:r,min:a,max:u,invalid:l,size:c,className:d="",...f},p){const v=i();/* @__PURE__ */
1
+ import{fromDateKey as t,toDateKey as e}from"./chunk-2HMNOLKX.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{pad2 as r}from"./chunk-LF27WIN2.js";import{useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{forwardRef as a}from"react";import{jsx as o}from"react/jsx-runtime";var m=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/;function s(t){return null==t||""===t?"":t instanceof Date?Number.isNaN(t.getTime())?"":`${e(n=t)}T${r(n.getHours())}:${r(n.getMinutes())}`:m.test(t)?t:"";var n}var u=a(function({value:e,onChange:r,min:a,max:u,invalid:l,size:c,className:d="",...f},p){const v=i();/* @__PURE__ */
2
2
  return o("input",{ref:p,type:"datetime-local",lang:v,"aria-invalid":l||void 0,value:s(e),min:s(a)||void 0,max:s(u)||void 0,onChange:e=>r?.(function(e){if(!m.test(e))return null;const[n,r]=e.split("T"),i=t(n),[a,o,s=0]=r.split(":").map(Number);return!i||a>23||o>59||s>59?null:(i.setHours(a,o,s),i)}(e.target.value)),className:n({invalid:l,size:c,className:d}),...f})});export{u as DateTimePicker_default};
@@ -1,4 +1,4 @@
1
- import{useShellLocale as e}from"./chunk-4PAWQEXM.js";import{formatFixed as t,formatPlain as s}from"./chunk-C3QOHMR6.js";import{jsxs as a,jsx as r}from"react/jsx-runtime";var l={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},m={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function n({title:n,value:i,precision:c,prefix:d,suffix:x,tone:u="default",size:o="md",className:f=""}){const p=e(),g="number"!=typeof i?i:null!=c?t(i,c,p):p?s(i,p):i;/* @__PURE__ */
1
+ import{useShellLocale as e}from"./chunk-GDQJBQ5B.js";import{formatFixed as t,formatPlain as s}from"./chunk-C3QOHMR6.js";import{jsxs as a,jsx as r}from"react/jsx-runtime";var l={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},m={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function n({title:n,value:i,precision:c,prefix:d,suffix:x,tone:u="default",size:o="md",className:f=""}){const p=e(),g="number"!=typeof i?i:null!=c?t(i,c,p):p?s(i,p):i;/* @__PURE__ */
2
2
  return a("div",{className:f,children:[n&&/* @__PURE__ */r("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:n}),
3
3
  /* @__PURE__ */a("div",{className:`mt-1 flex items-baseline gap-1 ${m[u]}`,children:[d&&/* @__PURE__ */r("span",{className:"text-sm",children:d}),
4
4
  /* @__PURE__ */r("span",{className:`font-semibold tabular-nums ${l[o]}`,children:g}),x&&/* @__PURE__ */r("span",{className:"text-sm",children:x})]})]})}export{n as Statistic};
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";function r({size:r=18,...i}){/* @__PURE__ */
2
+ return e("svg",{width:r,height:r,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...i,children:/* @__PURE__ */e("path",{fillRule:"evenodd",d:"M12.77854,3.05364c0.38459,0.15384 0.57165,0.59031 0.41781,0.9749l-5,12.5c-0.15384,0.38459 -0.59031,0.57165 -0.9749,0.41781c-0.38459,-0.15384 -0.57165,-0.59031 -0.41781,-0.9749l5,-12.5c0.15384,-0.38459 0.59031,-0.57165 0.9749,-0.41781z"})})}export{r as SeparatorSlashMiniIcon};
@@ -1,8 +1,8 @@
1
- import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-TXDA7TTP.js";import{Tooltip as r}from"./chunk-6XBWM453.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-F27JJHNJ.js";import{useShellStrings as d}from"./chunk-4PAWQEXM.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:W="",tone:E,tooltip:J,split:M}){const[T,$]=m(!1),[B,A]=m(""),F=d(),G=h(null),H=h(null),P=h(null),S=s(G,T),X=e=>k.find(t=>t.value===e)?.label??e,Y=p(()=>{const t=new Set(o),n=[],r=B.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,B]),I=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},z=e=>{e&&!o.includes(e)?(y([...o,e]),A("")):A("")},K=e=>y(o.filter(t=>t!==e)),Q=()=>{const e=B.trim();if(M&&e)return I(e.split(M)),void A("");j&&e?z(e):A("")},R=h(()=>{});R.current=()=>{Q(),$(!1)},f(()=>{if(!T)return;const e=e=>{const t=e.target;G.current?.contains(t)||P.current?.contains(t)||(Q(),$(!1))};document.addEventListener("mousedown",e);const t=l(()=>R.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
- return g("div",{ref:G,className:"relative",children:[
3
- /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),H.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${W}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
- /* @__PURE__ */x("span",{className:"truncate",children:X(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":F.select.removeItem?.(X(e))??`${F.select.remove} ${X(e)}`,onClick:()=>K(e),className:n.remove,children:"×"})]},e),l=J?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
5
- /* @__PURE__ */x("input",{id:D,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":T&&U,"aria-invalid":C||void 0,disabled:L,value:B,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(M){const t=e.split(M);if(t.length>1)return I(t.slice(0,-1)),void A(t[t.length-1])}A(e)})(e.target.value),$(!0)},onFocus:()=>{!L&&U&&$(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=B.trim(),o=n?Y.filter(t=>e(t,n.toLowerCase())):[];1===o.length?z(o[0].value):Q()}else"Backspace"===t.key&&""===B&&o.length>0?K(o[o.length-1]):"Escape"===t.key?($(!1),A(""),H.current?.blur()):"Tab"===t.key&&(Q(),$(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),T&&U&&v(
6
- /* @__PURE__ */x("div",{ref:P,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:S?.left,right:S?.right,top:S?.top,bottom:S?.bottom,minWidth:S?.minWidth,maxWidth:S?.maxWidth??a,width:"max-content",visibility:S?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:S?.maxHeight??c},children:0===Y.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?F.select.allSelected:F.select.noMatches}):Y.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),z(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
1
+ import{optionMatches as e,OptionSublabel as t}from"./chunk-LJN77RG6.js";import{inputClasses as n}from"./chunk-AYZY3YNC.js";import{GROUP_COLORS as o}from"./chunk-EQZZ4V5X.js";import{Tooltip as r}from"./chunk-Q3IR5SKD.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as s,POPUP_MAX_WIDTH as a,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-F27JJHNJ.js";import{useShellStrings as d}from"./chunk-GDQJBQ5B.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as v}from"react-dom";import{jsxs as g,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-accent-tint px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${o.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:o,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:C,disabled:L,id:D,className:J="",tone:E,tooltip:B,split:W}){const[$,G]=m(!1),[M,Q]=m(""),S=d(),F=h(null),H=h(null),I=h(null),Y=s(F,$),Z=e=>k.find(t=>t.value===e)?.label??e,K=p(()=>{const t=new Set(o),n=[],r=M.trim().toLowerCase();for(const o of k)t.has(o.value)||(t.add(o.value),r&&!e(o,r)||n.push(o));return n},[k,o,M]),R=e=>{const t=[...o];for(const n of e){const e=n.trim();if(!e)continue;const o=e.toLowerCase(),r=k.find(t=>t.value===e||t.label.toLowerCase()===o)?.value,l=r??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==o.length&&y(t)},T=e=>{e&&!o.includes(e)?(y([...o,e]),Q("")):Q("")},z=e=>y(o.filter(t=>t!==e)),A=()=>{const e=M.trim();if(W&&e)return R(e.split(W)),void Q("");j&&e?T(e):Q("")},P=h(()=>{});P.current=()=>{A(),G(!1)},f(()=>{if(!$)return;const e=e=>{const t=e.target;F.current?.contains(t)||I.current?.contains(t)||(A(),G(!1))};document.addEventListener("mousedown",e);const t=l(()=>P.current());return()=>{document.removeEventListener("mousedown",e),t()}});const U=k.length>0;/* @__PURE__ */
2
+ return g("div",{ref:F,className:"relative",children:[
3
+ /* @__PURE__ */g("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),H.current?.focus())},className:n({invalid:C,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${J}`}),children:[o.map(e=>{const t=E?.(e),n=w[t??"accent"],o=/* @__PURE__ */g("span",{"data-tone":t,className:n.chip,children:[
4
+ /* @__PURE__ */x("span",{className:"truncate",children:Z(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":S.select.removeItem?.(Z(e))??`${S.select.remove} ${Z(e)}`,onClick:()=>z(e),className:n.remove,children:"×"})]},e),l=B?.(e);return null==l?o:/* @__PURE__ */x(r,{content:l,className:"relative inline-flex max-w-full",children:o},e)}),
5
+ /* @__PURE__ */x("input",{id:D,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":$&&U,"aria-invalid":C||void 0,disabled:L,value:M,placeholder:0===o.length?N:void 0,onChange:e=>{(e=>{if(W){const t=e.split(W);if(t.length>1)return R(t.slice(0,-1)),void Q(t[t.length-1])}Q(e)})(e.target.value),G(!0)},onFocus:()=>{!L&&U&&G(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=M.trim(),o=n?K.filter(t=>e(t,n.toLowerCase())):[];1===o.length?T(o[0].value):A()}else"Backspace"===t.key&&""===M&&o.length>0?z(o[o.length-1]):"Escape"===t.key?(G(!1),Q(""),H.current?.blur()):"Tab"===t.key&&(A(),G(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-ink-strong placeholder:text-[color:var(--ink-placeholder)] rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),$&&U&&v(
6
+ /* @__PURE__ */x("div",{ref:I,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:Y?.left,right:Y?.right,top:Y?.top,bottom:Y?.bottom,minWidth:Y?.minWidth,maxWidth:Y?.maxWidth??a,width:"max-content",visibility:Y?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:Y?.maxHeight??c},children:0===K.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&o.length>=k.length?S.select.allSelected:S.select.noMatches}):K.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),T(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-row-hover text-ink whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-row-hover text-ink whitespace-nowrap",children:e.sublabel?/* @__PURE__ */g(b,{children:[
7
7
  /* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
8
8
  /* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
@@ -1,6 +1,6 @@
1
- import{GROUP_COLORS as e}from"./chunk-TXDA7TTP.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
2
- return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
1
+ import{GROUP_COLORS as e}from"./chunk-EQZZ4V5X.js";import{Tooltip as r}from"./chunk-Q3IR5SKD.js";import{SpinnerRing as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:n,onClick:l}){/* @__PURE__ */
2
+ return t(r,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:n})})})}function c({state:r,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===r)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===r)/* @__PURE__ */
3
3
  return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
4
4
  /* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
5
- return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==$&&/* @__PURE__ */t(r,{ink:""}),
5
+ return i("span",{role:"status","aria-live":"polite",className:`${s} ${e.info} ${b}`.trim(),children:[null==$&&/* @__PURE__ */t(n,{ink:""}),
6
6
  /* @__PURE__ */t("span",{className:"tabular-nums",children:"string"==typeof y?N(y):/* @__PURE__ */i(a,{children:[y,N("")&&` ${N("")}`]})}),d&&/* @__PURE__ */t(o,{label:k,glyph:"×",onClick:d})]})}export{c as TransferProgress};
@@ -1 +1 @@
1
- import{toast_default as t}from"./chunk-AKM6JBMD.js";import{currentShellStrings as e}from"./chunk-4PAWQEXM.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-7ELJQL7J.js";import{currentShellStrings as e}from"./chunk-GDQJBQ5B.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,14 @@
1
+ import{SearchableSelect as e}from"./chunk-F7Z47OIF.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-CUKDQPEN.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Input_default as n}from"./chunk-MAMWQCJ6.js";import{INPUT_SIZES as r}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-HXNMRJQ4.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-GDQJBQ5B.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:r,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O=""}=t,j=void 0!==t.onApply,$=u().link,Q=y.isSafe??k,z=d(),A=c(null),D=c(null),[E,P]=p({url:r}),U=j?E.url:r,[M,J]=p(!1),[K,W]=p(null),[X,Y]=p(null),B=c(()=>{});B.current=j?t.onCancel:()=>{},m(()=>{if(j)return s(e=>{const a=A.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(B.current(),!0)},()=>A.current)},[j]),m(()=>{if(!j)return;const e=D.current;e?(e.focus(),e.select()):A.current?.querySelector("button, input")?.focus()},[]);const R=o??[{value:b,label:$.address,target:{type:"text"}}],T=K&&K.against===U?K.kind:y.kindOf(U),H=R.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===T),L=H.find(e=>"text"===e.target.type),S=H.find(e=>e.value===T)??L??H[0];if(!S)return null;const Z="text"!==S.target.type,q=Z?y.targetOf(U):U,G=h(S.target),I=G.find(e=>e.value===q),V=e=>({value:e,label:$.unavailable(e)}),_="select"===S.target.type&&q&&w?w(q):null,ee=_?y.readFilter(U):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=X&&X.against===U?X.text:U,te=!Z&&""!==le.trim()&&!Q(le),ne=te&&(!j||M),re=(e,a)=>{j?P({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},ie=(e,a)=>{W(a=>a?{...a,against:e}:a),re(e,a)},oe=e=>{if(!e)return ie("");const a=G.find(a=>a.value===e);ie(e,a?.label)},se=Z?U:le.trim(),ue=()=>{if(!j||!se)return;if(!Z&&te)return void J(!0);const e=Z&&E.url===se?E.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[V(a),...e]:[...e],ce=(a,t,n,r,i)=>{const o=[];for(const e of n){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=n.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:n.find(e=>""===e.value)?.label,onChange:r})}/* @__PURE__ */
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:r})};let pe;if("text"===S.target.type)pe=/* @__PURE__ */f(n,{ref:D,id:`${z}-address`,size:"sm",type:"text",invalid:ne,"aria-label":$.address,"aria-describedby":ne?`${z}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:C,onChange:e=>(e=>{J(!1);const a=e.trim();a?Q(e)?(Y({text:e,against:a}),ie(a)):Y({text:e,against:U}):(Y({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===S.target.type?S.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):S.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:S.target.placeholder},...de(e,q)];pe=ce(S.label,q,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce($.linkType,S.value,H.map(e=>({value:e.value,label:e.label})),e=>{Y(null),J(!1);const a=H.find(a=>a.value===e);if(!a||"text"===a.target.type)return void W({kind:e,against:U});const l=h(a.target)[0];W({kind:e,against:l?l.value:""}),l?re(l.value,l.label):re("")},!1),pe,_&&ce($.filter,ee?.param??"",[{value:"",label:$.noFilter},...ee&&!ae?[V(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(q,I?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(y.withFilter(q,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce($.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(y.withFilter(q,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),ne&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),S.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:S.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!j)/* @__PURE__ */
4
+ return f("div",{ref:A,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:me});const fe=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:A,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[Z?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:a({inline:!0}),children:$.title}),me,
6
+ /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:$.remove}):null,
7
+ /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>B.current(),children:$.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
10
+ return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
+ /* @__PURE__ */f(n,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
+ /* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${r.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
+ /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,4 +1,4 @@
1
- import{useShellLanguage as e}from"./chunk-UPQW4GCT.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-VNACNNCJ.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.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-7TZV6G2F.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-CUKDQPEN.js";import{Icon as t}from"./chunk-2UO47XB4.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.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,2 +1,2 @@
1
- import{Tooltip as e}from"./chunk-6XBWM453.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,M=o(null),N=o({onResize:d,min:f,max:p,side:m});N.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const D=i(()=>{M.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>D,[D]);const C=e=>{M.current&&(e.currentTarget.hasPointerCapture?.(M.current.pointer)&&e.currentTarget.releasePointerCapture(M.current.pointer),D())},I="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",T="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=P?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
2
- return s(e,{content:z??k.hint,side:T,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),M.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=M.current;if(!r)return;if(0===e.buttons)return void D();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=N.current;o(l(r.width,t,s,n,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{M.current&&D()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
1
+ import{Tooltip as e}from"./chunk-Q3IR5SKD.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-GDQJBQ5B.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,D=o(null),N=o({onResize:d,min:f,max:p,side:m});N.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const I=i(()=>{D.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>I,[I]);const M=e=>{D.current&&(e.currentTarget.hasPointerCapture?.(D.current.pointer)&&e.currentTarget.releasePointerCapture(D.current.pointer),I())},C="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",R="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",T=P?`absolute inset-x-0 ${C} z-10 flex h-2`:`absolute inset-y-0 ${C} z-10 flex w-2`;/* @__PURE__ */
2
+ return s(e,{content:z??k.hint,side:R,delay:600,className:`${T} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),D.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=D.current;if(!r)return;if(0===e.buttons)return void I();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=N.current;o(l(r.width,t,s,n,i))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{D.current&&I()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${C} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${C} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
@@ -1,10 +1,10 @@
1
- import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-4PAWQEXM.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:E,addItemText:D}){const j=t().kanban,I=r(),M=N??j.loading,T=C??j.dropHere,A=D??j.addItem,[H,O]=o(null),[$,R]=o(null),S=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),q=()=>{O(null),R(null)},z=i(null),F=i(/* @__PURE__ */new Map);n(()=>{if(null!==H)return;const e=z.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=F.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),F.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[S,H]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:M}):0!==m.length||w?/* @__PURE__ */d("div",{ref:z,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=S[e.value]??[],t=null!==$&&$.col===e.value,r=null!==H?n.findIndex(e=>g(e)===H):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
- return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(H&&$&&$.col===e){const n=(S[e]??[]).findIndex(e=>g(e)===H),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(H,e,r)}}q()})(e.value)},children:[
1
+ import{useBrowserLayoutEffect as e}from"./chunk-D65T4H6J.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-GDQJBQ5B.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),T=N??j.loading,M=C??j.dropHere,A=E??j.addItem,[H,O]=o(null),[$,B]=o(null),Q=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),R=()=>{O(null),B(null)},S=i(null),q=i(/* @__PURE__ */new Map);e(()=>{if(null!==H)return;const e=S.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=q.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),q.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[Q,H]);return v?/* @__PURE__ */d(n,{size:"sm",padding:"p-4",label:T}):0!==m.length||w?/* @__PURE__ */d("div",{ref:S,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=Q[e.value]??[],t=null!==$&&$.col===e.value,r=null!==H?n.findIndex(e=>g(e)===H):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
+ return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(H&&$&&$.col===e){const n=(Q[e]??[]).findIndex(e=>g(e)===H),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(H,e,r)}}R()})(e.value)},children:[
3
3
  /* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
4
4
  /* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
5
5
  /* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
6
6
  /* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,I)})]}),
7
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>R(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===H;/* @__PURE__ */
7
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>B(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===H;/* @__PURE__ */
8
8
  return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
9
- /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==H?n.findIndex(e=>g(e)===H):-1,o=-1!==a&&a<r?r+1:r;R(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:q,onClick:b?()=>b(t):void 0,style:null===H?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:T})]}),E&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>E(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
9
+ /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==H?n.findIndex(e=>g(e)===H):-1,o=-1!==a&&a<r?r+1:r;B(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:R,onClick:b?()=>b(t):void 0,style:null===H?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
10
  /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),A]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
@@ -1,8 +1,8 @@
1
- import{useShellStrings as l,useShellLocale as e,DEFAULT_SHELL_STRINGS as t}from"./chunk-4PAWQEXM.js";import{formatPercent as n}from"./chunk-C3QOHMR6.js";import{jsxs as a,jsx as u}from"react/jsx-runtime";function s(l){return null!=l&&Number.isFinite(l)&&l>=0?l:null}function i(l,e){const t=s(l);if(null==t)return"no-reading";const n=s(e);return null==n||0===n?"no-budget":t>n?"over":"within"}var r=l=>Math.min(100,Math.max(0,l));function m({label:m,elapsed:o,budget:d,grace:c,detail:f,formatDuration:h,formatValue:x,pace:b,emptyLabel:g,noBudgetLabel:p,size:v="sm",ariaLabel:N,className:y=""}){const w=l().meter,M=e(),$=x??h??(l=>function(l,e=t.meter){const n=Math.round(l),a=Math.floor(n/3600),u=Math.floor(n%3600/60),s=n%60;return a>0?e.hoursMinutes(a,u):u>0?e.minutesSeconds(u,s):e.seconds(s)}(l,w)),k=g??w.noReading,j=p??w.noBudget,B=s(o),L=s(d),Q=null!=L&&L>0?L:null,R=s(c)??0,z="over"===i(o,d),A=null!=Q?Q+R:null,C=null!=Q&&null!=A?r(Q/A*100):null,D=z&&R>0,E=null==A||null==B?0:z?D?C??0:0:r(B/A*100),F=D?C??0:0,H=z?D&&null!=A&&null!=B?r(B/A*100):100:0,O=Math.max(0,H-F),P=s(b),S=null!=P&&null!=A?r(P/A*100):null,V=null!=B&&null!=Q?B/Q*100:null,W=null!=V?n(Math.round(V),0,M):null!=B?$(B):"—",X=f??(null==B?k:null==Q?j:`${$(B)} / ${$(Q)}`),q="md"===v?"h-2":"h-1.5",G=z?"text-red-600":null!=B?"text-gray-900":"text-gray-400",I=null!=B&&null!=Q&&null!=A?/* @__PURE__ */a("div",{role:"meter","aria-label":N??("string"==typeof m?m:void 0),"aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":Math.min(A,B),"aria-valuetext":w.ofBudget(W),className:`relative mt-2 ${q} overflow-hidden rounded-full bg-gray-200`,children:[(!z||D)&&/* @__PURE__ */u("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${E}%`}}),O>0&&/* @__PURE__ */u("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${F}%`,width:`${O}%`}}),R>0&&null!=C&&/* @__PURE__ */u("div",{title:w.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${C}%`}}),null!=S&&/* @__PURE__ */u("div",{title:w.pace,"data-pace":"true",className:"absolute inset-y-0 w-0.5 -translate-x-1/2 bg-gray-700",style:{left:`${S}%`}})]}):null;/* @__PURE__ */
1
+ import{useShellStrings as l,useShellLocale as e,DEFAULT_SHELL_STRINGS as t}from"./chunk-GDQJBQ5B.js";import{formatPercent as n}from"./chunk-C3QOHMR6.js";import{jsxs as a,jsx as u}from"react/jsx-runtime";function s(l){return null!=l&&Number.isFinite(l)&&l>=0?l:null}function i(l,e){const t=s(l);if(null==t)return"no-reading";const n=s(e);return null==n||0===n?"no-budget":t>n?"over":"within"}var r=l=>Math.min(100,Math.max(0,l));function m({label:m,elapsed:o,budget:d,grace:c,detail:f,formatDuration:h,formatValue:x,pace:b,emptyLabel:g,noBudgetLabel:p,size:v="sm",ariaLabel:N,className:y=""}){const w=l().meter,M=e(),$=x??h??(l=>function(l,e=t.meter){const n=Math.round(l),a=Math.floor(n/3600),u=Math.floor(n%3600/60),s=n%60;return a>0?e.hoursMinutes(a,u):u>0?e.minutesSeconds(u,s):e.seconds(s)}(l,w)),k=g??w.noReading,B=p??w.noBudget,j=s(o),L=s(d),Q=null!=L&&L>0?L:null,D=s(c)??0,R="over"===i(o,d),z=null!=Q?Q+D:null,C=null!=Q&&null!=z?r(Q/z*100):null,F=R&&D>0,G=null==z||null==j?0:R?F?C??0:0:r(j/z*100),H=F?C??0:0,J=R?F&&null!=z&&null!=j?r(j/z*100):100:0,O=Math.max(0,J-H),S=s(b),V=null!=S&&null!=z?r(S/z*100):null,q=null!=j&&null!=Q?j/Q*100:null,A=null!=q?n(Math.round(q),0,M):null!=j?$(j):"—",E=f??(null==j?k:null==Q?B:`${$(j)} / ${$(Q)}`),I="md"===v?"h-2":"h-1.5",K=R?"text-red-600":null!=j?"text-gray-900":"text-gray-400",P=null!=j&&null!=Q&&null!=z?/* @__PURE__ */a("div",{role:"meter","aria-label":N??("string"==typeof m?m:void 0),"aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":Math.min(z,j),"aria-valuetext":w.ofBudget(A),className:`relative mt-2 ${I} overflow-hidden rounded-full bg-gray-200`,children:[(!R||F)&&/* @__PURE__ */u("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${G}%`}}),O>0&&/* @__PURE__ */u("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${H}%`,width:`${O}%`}}),D>0&&null!=C&&/* @__PURE__ */u("div",{title:w.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${C}%`}}),null!=V&&/* @__PURE__ */u("div",{title:w.pace,"data-pace":"true",className:"absolute inset-y-0 w-0.5 -translate-x-1/2 bg-gray-700",style:{left:`${V}%`}})]}):null;/* @__PURE__ */
2
2
  return a("div","md"===v?{className:y,children:[null!=m&&/* @__PURE__ */u("div",{className:"text-3xs font-medium uppercase tracking-wide text-ink-faint",children:m}),
3
3
  /* @__PURE__ */a("div",{className:"mt-1 flex items-baseline gap-2",children:[
4
- /* @__PURE__ */u("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${G}`,children:W}),
5
- /* @__PURE__ */u("span",{className:"min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:X})]}),I]}:{className:y,children:[
4
+ /* @__PURE__ */u("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${K}`,children:A}),
5
+ /* @__PURE__ */u("span",{className:"min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:E})]}),P]}:{className:y,children:[
6
6
  /* @__PURE__ */a("div",{className:"flex items-baseline gap-2",children:[null!=m&&/* @__PURE__ */u("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:m}),
7
- /* @__PURE__ */u("span",{className:`text-sm font-semibold tabular-nums ${G}`,children:W}),
8
- /* @__PURE__ */u("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:X})]}),I]})}export{m as BudgetBar,i as budgetState};
7
+ /* @__PURE__ */u("span",{className:`text-sm font-semibold tabular-nums ${K}`,children:A}),
8
+ /* @__PURE__ */u("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:E})]}),P]})}export{m as BudgetBar,i as budgetState};
@@ -1,4 +1,4 @@
1
- import{TransferProgress as e}from"./chunk-UYRITNQW.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-4PAWQEXM.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
1
+ import{TransferProgress as e}from"./chunk-TLWGOQI3.js";import{Icon as r}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-GDQJBQ5B.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
2
2
  return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
3
3
  return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
4
4
  return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
@@ -0,0 +1,7 @@
1
+ import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-ZMRGHVKS.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-WZ5QSSUM.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:M}){const j=n().charts,w=m(),N=y??(e=>h(e,w)),$=M??j.nothingToBreakDown,B=c(null),S=r(B),C=v??S,[G,Q]=u(null),{highlighted:Z}=l(),z=e(p,C,d);if(0===z.length)/* @__PURE__ */
2
+ return s("div",{className:b,ref:B,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const A=k??i(0),D=Math.max(...z.map(e=>e.value),1),F=e=>34+e/D*62,H=e=>`color-mix(in oklab, ${A} ${F(e).toFixed(0)}%, ${o.surface})`,R=e=>F(e)>=55?o.surface:o.label,U=G??Z,V=G?z.find(e=>e.key===G):void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${b??""}`,ref:B,children:[
4
+ /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${C} ${d}`,role:"img","aria-label":j.treemap(p.length),onMouseLeave:()=>Q(null),children:z.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
+ return f("g",{opacity:U&&U!==e.key?.55:1,onMouseEnter:()=>Q(e.key),children:[
6
+ /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:H(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:R(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:R(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),V&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:V.label,rows:[{key:"value",label:j.value,color:H(V.value),value:N(V.value)}]})}),
7
+ /* @__PURE__ */s(t,{caption:j.treemap(p.length),head:[j.tableItem,j.value],rows:z.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
@@ -1,4 +1,4 @@
1
- import{ChartSkeleton as e}from"./chunk-M22B3Y5Y.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
1
+ import{ChartSkeleton as e}from"./chunk-3IUPYCW3.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
2
2
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
3
3
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
4
4
  return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-AKM6JBMD.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.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,W]=o("select"),[S,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),[X,Z]=o(!1),[q,G]=o(null),[Y,_]=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&&(F(Me.size),A(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),G(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,S,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:S,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),W("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:S,stroke:R};re(e=>[...e,t]),ie(t.id),W("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,S,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:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{G(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:S,size:H,font:T,bold:U,italic:K,underline:X,borderColor:q,background:Y,padding:J};re(t=>[...t,e]),ie(e.id),W("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]),We=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),Se=Me?.type??("select"===I?null:I),Be="rect"===Se||"circle"===Se||"arrow"===Se||"draw"===Se,Re="rect"===Se,je="text"===Se;/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-7ELJQL7J.js";import{useShellStrings as t}from"./chunk-GDQJBQ5B.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),E=r(null),P=t().annotator,$=r(P);$.current=P;const[I,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[H,F]=o(24),[T,U]=o(h[0].id),[A,O]=o(!0),[K,V]=o(!1),[Z,G]=o(!1),[J,Q]=o(null),[X,q]=o(null),[Y,_]=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&&(F(Me.size),U(Me.font),O(Me.bold),V(Me.italic),G(Me.underline),Q(Me.borderColor),q(Me.background),_(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{E.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=E.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: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=>{Q(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ee=e=>{q(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:A,italic:K,underline:Z,borderColor:J,background:X,padding:Y};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: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"===I?null:I),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:()=>{W(e.id),ie(null)},title:e.label,className:We(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:[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)),
4
4
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
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 "+(S===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
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,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:E[e.name]},e.id))}),
18
- /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(U),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
19
- /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
20
- /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(X),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,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:P[e.name]},e.id))}),
18
+ /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),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}),
22
+ /* @__PURE__ */c("span",{children:P.size}),
23
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
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}),q?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:q,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(S),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}),J?/* @__PURE__ */s(d,{children:[
27
+ /* @__PURE__ */c("input",{type:"color",value:J,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}),Y?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:Y,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}),X?/* @__PURE__ */s(d,{children:[
31
+ /* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>Ee(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:()=>Ee(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Ee("#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:Y,onChange:e=>{return t=Number(e.target.value),_(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:Y})]})]}),
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||!E.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(E.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=()=>{E.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:S,stroke:R});pe(b(I,t,t,S,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:S,size:H,font:h.find(e=>e.id===T)?.css??h[0].css,bold:U,italic:K,underline:X,borderColor:q,background:Y,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"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){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"!==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:H,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:K,underline:Z,borderColor:J,background:X,padding:Y,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"===I?oe?P.hintSelected:P.hintSelect:"text"===I?P.hintText:"crop"===I?P.hintCrop:"draw"===I?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__ */