efficient-shell 10.1.1 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-Q34VNUTL.js → Browser-LLDEI3D4.js} +14 -14
  3. package/dist/Calculator-S5OP2NS6.js +29 -0
  4. package/dist/CurrencyConverter-MQ3OOVX4.js +21 -0
  5. package/dist/Documents-R4PFEZFW.js +52 -0
  6. package/dist/Files-QN442YH7.js +88 -0
  7. package/dist/Notepad-HNO5KF7B.js +24 -0
  8. package/dist/{PdfViewer-WNKGFJD6.js → PdfViewer-Z4YKDHIH.js} +1 -1
  9. package/dist/{PomodoroTimer-X5Y3LA3V.js → PomodoroTimer-CX677P57.js} +25 -25
  10. package/dist/{Preview-3FZTC25R.js → Preview-BE4R3UND.js} +44 -44
  11. package/dist/Sidebar-QCUDD4OU.js +44 -0
  12. package/dist/Spreadsheet-2JP2EAFZ.js +37 -0
  13. package/dist/{Stock-KESFJPYD.js → Stock-PWPUDMK2.js} +4 -4
  14. package/dist/{Weather-BYGZVNNK.js → Weather-3N3MSFQV.js} +15 -15
  15. package/dist/{WorldClock-P4JVDPGE.js → WorldClock-6QYLEBLL.js} +7 -7
  16. package/dist/ai/index.js +59 -59
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +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-2JG5JU4M.js +8 -0
  48. package/dist/{chunk-5VSP3TYU.js → chunk-2K2W6VIR.js} +1 -1
  49. package/dist/{chunk-QXRRAADR.js → chunk-2SY76NFO.js} +4 -4
  50. package/dist/{chunk-BMXMSAQE.js → chunk-2VTO64YC.js} +7 -7
  51. package/dist/{chunk-HL6JSDN3.js → chunk-34URULVW.js} +1 -1
  52. package/dist/{chunk-RZR3OAKV.js → chunk-35DG7Y4M.js} +1 -1
  53. package/dist/{chunk-MH6DI6YY.js → chunk-37U326EL.js} +12 -12
  54. package/dist/{chunk-YL6LLHJA.js → chunk-3CPB3WP2.js} +18 -18
  55. package/dist/chunk-3DVNXNTF.js +1 -0
  56. package/dist/{chunk-CKPVXDKX.js → chunk-3ELLBQPS.js} +3 -3
  57. package/dist/{chunk-A6RB4PIX.js → chunk-3NW5LD7D.js} +4 -4
  58. package/dist/{chunk-BNQRPLBW.js → chunk-3RORPK2J.js} +1 -1
  59. package/dist/{chunk-U5DMF2TX.js → chunk-4BYJQU37.js} +1 -1
  60. package/dist/chunk-4PAWQEXM.js +1 -0
  61. package/dist/{chunk-N6TK43YN.js → chunk-573EHCD7.js} +54 -54
  62. package/dist/{chunk-CUA6CREW.js → chunk-5S3YYN7M.js} +7 -7
  63. package/dist/{chunk-Q5YM65DZ.js → chunk-632N62BY.js} +8 -8
  64. package/dist/{chunk-LOYCPZUB.js → chunk-63L5ORRZ.js} +1 -1
  65. package/dist/{chunk-B7HW6XZD.js → chunk-67JCJ2MG.js} +1 -1
  66. package/dist/{chunk-4VDGVF5T.js → chunk-6PFZK6ED.js} +1 -1
  67. package/dist/{chunk-P6LB3I3D.js → chunk-6RX4PVBU.js} +1 -1
  68. package/dist/chunk-6XBWM453.js +6 -0
  69. package/dist/{chunk-ZG2HMC7S.js → chunk-7SMV6G4Z.js} +1 -1
  70. package/dist/{chunk-X6YT3I5F.js → chunk-7X3XNVES.js} +1 -1
  71. package/dist/{chunk-WUMHSI4U.js → chunk-7X5FABQS.js} +1 -1
  72. package/dist/{chunk-JZK3UDOT.js → chunk-7YOQS3C6.js} +1 -1
  73. package/dist/{chunk-TDLU6GF5.js → chunk-7Z4PTLDL.js} +4 -4
  74. package/dist/{chunk-2OJ3HGFY.js → chunk-A4HJDSRA.js} +6 -6
  75. package/dist/chunk-A5BV6NFA.js +7 -0
  76. package/dist/{chunk-42XMT5JN.js → chunk-AJO72CPB.js} +2 -2
  77. package/dist/{chunk-OQW42DOR.js → chunk-AKM6JBMD.js} +1 -1
  78. package/dist/chunk-AM2F5ZXH.js +2 -0
  79. package/dist/{chunk-4WZRNPIG.js → chunk-AUWTGM65.js} +1 -1
  80. package/dist/chunk-B73AXE6P.js +1 -0
  81. package/dist/{chunk-V4RYE6KA.js → chunk-C2P2Z6HU.js} +11 -11
  82. package/dist/{chunk-WKSNTMEJ.js → chunk-CAVADOJK.js} +1 -1
  83. package/dist/chunk-CBEKJTXU.js +9 -0
  84. package/dist/{chunk-Q4LBBFLO.js → chunk-CGQAKGPT.js} +6 -6
  85. package/dist/{chunk-AEQFFD5I.js → chunk-CHBRMAJV.js} +1 -1
  86. package/dist/{chunk-2OE5VVBE.js → chunk-CPZ42W2B.js} +1 -1
  87. package/dist/{chunk-BDAKGS7O.js → chunk-D7F442OZ.js} +1 -1
  88. package/dist/{chunk-BZPPDYEE.js → chunk-DDCMMOB4.js} +1 -1
  89. package/dist/{chunk-5VTRKWKO.js → chunk-DKGZPVLL.js} +1 -1
  90. package/dist/{chunk-XABYSSXW.js → chunk-DLNIRZNR.js} +1 -1
  91. package/dist/{chunk-RBIGSJ2J.js → chunk-DRDYZ633.js} +2 -2
  92. package/dist/{chunk-FS2KWQJW.js → chunk-E5MVH3SH.js} +10 -10
  93. package/dist/chunk-EU3JZGV2.js +14 -0
  94. package/dist/{chunk-GGIFS34Z.js → chunk-EYZZW6SO.js} +5 -5
  95. package/dist/{chunk-43T5JGFB.js → chunk-EZEYKCI6.js} +1 -1
  96. package/dist/{chunk-DTJRIWFR.js → chunk-F27JJHNJ.js} +1 -1
  97. package/dist/{chunk-7ILNRFEV.js → chunk-FFIQPFUR.js} +1 -1
  98. package/dist/{chunk-TLRCTNUF.js → chunk-G4GVLK44.js} +1 -1
  99. package/dist/chunk-G5NQOV7L.js +6 -0
  100. package/dist/{chunk-JB3WKDD7.js → chunk-GGK27H67.js} +1 -1
  101. package/dist/{chunk-2YLG32JY.js → chunk-GISDIVFK.js} +1 -1
  102. package/dist/{chunk-FFASZGNZ.js → chunk-GNHLVGG5.js} +3 -3
  103. package/dist/{chunk-6FPDOEOX.js → chunk-GSKLHUQ6.js} +1 -1
  104. package/dist/chunk-GTNJAKFO.js +29 -0
  105. package/dist/{chunk-GY67Y5SN.js → chunk-H4HB5OET.js} +1 -1
  106. package/dist/{chunk-6L2UAAGT.js → chunk-HNBGLF4B.js} +1 -1
  107. package/dist/{chunk-YJSX6JAC.js → chunk-I2XGPTCN.js} +1 -1
  108. package/dist/{chunk-NHH2MXFU.js → chunk-I4VIEGCX.js} +1 -1
  109. package/dist/chunk-IKNG7EFQ.js +12 -0
  110. package/dist/{chunk-RQNZ2PVW.js → chunk-INNIWRVU.js} +4 -4
  111. package/dist/{chunk-J53OQCKC.js → chunk-IOJNSX4N.js} +7 -7
  112. package/dist/{chunk-JKZJVQIB.js → chunk-IPFWXM2Y.js} +6 -6
  113. package/dist/{chunk-WMQ2URP4.js → chunk-JQYNMUZW.js} +1 -1
  114. package/dist/{chunk-K7PCBUDC.js → chunk-JRZ7PPVJ.js} +6 -6
  115. package/dist/chunk-JSGQWVYH.js +7 -0
  116. package/dist/{chunk-ZCV377AG.js → chunk-KEPJWZJZ.js} +3 -3
  117. package/dist/{chunk-JJP54OT4.js → chunk-KJ4CBZEQ.js} +1 -1
  118. package/dist/{chunk-XHMIJ7S3.js → chunk-KP2THXEI.js} +6 -6
  119. package/dist/{chunk-GKK7DR2H.js → chunk-LCJRTJXT.js} +9 -9
  120. package/dist/{chunk-Q3MNSM7W.js → chunk-LDE5IV2M.js} +4 -4
  121. package/dist/{chunk-MZ26SYFY.js → chunk-LEDUD23S.js} +1 -1
  122. package/dist/chunk-LNWQBSYD.js +5 -0
  123. package/dist/{chunk-7TONF2PM.js → chunk-LOFYSLC7.js} +9 -9
  124. package/dist/{chunk-AGLBDT7X.js → chunk-LTKXAHS3.js} +8 -8
  125. package/dist/{chunk-WP4CIYJ7.js → chunk-LYIXZFMP.js} +1 -1
  126. package/dist/{chunk-BMQCUHSD.js → chunk-M22B3Y5Y.js} +1 -1
  127. package/dist/{chunk-CLQFP42I.js → chunk-MBXLROCD.js} +1 -1
  128. package/dist/{chunk-KCV7BFKJ.js → chunk-MCDM2G4W.js} +1 -1
  129. package/dist/{chunk-R4Q5653D.js → chunk-MNXRAZJV.js} +20 -20
  130. package/dist/{chunk-VC42SDAC.js → chunk-MQU3PZUS.js} +1 -1
  131. package/dist/{chunk-OZAAIE4E.js → chunk-MVZRZTQP.js} +1 -1
  132. package/dist/{chunk-NNOA7AVG.js → chunk-MXH3UPCH.js} +5 -5
  133. package/dist/{chunk-ZLHPCPXS.js → chunk-N4DI5F74.js} +18 -18
  134. package/dist/{chunk-EIUCHQI2.js → chunk-N67QX3WW.js} +2 -2
  135. package/dist/{chunk-MLKY5ESV.js → chunk-O45WQK57.js} +1 -1
  136. package/dist/{chunk-RSIGTZMU.js → chunk-O4V5PEA3.js} +1 -1
  137. package/dist/{chunk-M554OMPA.js → chunk-O6JJIR4H.js} +1 -1
  138. package/dist/{chunk-APXQMZSV.js → chunk-O7DW2BKY.js} +26 -26
  139. package/dist/{chunk-UB5TLWZN.js → chunk-ON67HF5K.js} +8 -8
  140. package/dist/{chunk-KZQAGXME.js → chunk-ORIGX2H5.js} +4 -4
  141. package/dist/chunk-OTGQYHVC.js +9 -0
  142. package/dist/{chunk-4UEXVRBC.js → chunk-OUAOK44B.js} +1 -1
  143. package/dist/chunk-OW7MLJ3Y.js +1 -0
  144. package/dist/{chunk-JRBQLRAZ.js → chunk-OZBM2XFQ.js} +1 -1
  145. package/dist/{chunk-ZRZ5LOW3.js → chunk-PBWUEBJ5.js} +1 -1
  146. package/dist/{chunk-CMHLXELO.js → chunk-PGGBOZE5.js} +3 -3
  147. package/dist/chunk-PJQGYKN6.js +11 -0
  148. package/dist/chunk-PN65IIYN.js +8 -0
  149. package/dist/chunk-PUF75SMJ.js +1 -0
  150. package/dist/{chunk-5EX6XXUX.js → chunk-PXDDCD5X.js} +1 -1
  151. package/dist/{chunk-RKFEJ5CX.js → chunk-PXQG5EIH.js} +1 -1
  152. package/dist/{chunk-5VDT4762.js → chunk-QEKOEIOQ.js} +2 -2
  153. package/dist/{chunk-GMRZX2ET.js → chunk-QHOBK35Y.js} +1 -1
  154. package/dist/{chunk-7VCAMNCH.js → chunk-QP4UPCXQ.js} +1 -1
  155. package/dist/chunk-QQPIQCT7.js +11 -0
  156. package/dist/{chunk-GVY2X4CC.js → chunk-QWWJUYZI.js} +17 -17
  157. package/dist/{chunk-CL7SBEBQ.js → chunk-QYRMFGES.js} +1 -1
  158. package/dist/{chunk-3V6ZERBS.js → chunk-RBQWIHYD.js} +1 -1
  159. package/dist/chunk-RCPFUDPS.js +4 -0
  160. package/dist/chunk-RPYFOQM2.js +6 -0
  161. package/dist/{chunk-53KQSCMG.js → chunk-SDQIXE5M.js} +9 -9
  162. package/dist/{chunk-NW7Z3G7P.js → chunk-SF654IHN.js} +13 -13
  163. package/dist/{chunk-LPDI5NL6.js → chunk-SO6X4CII.js} +2 -2
  164. package/dist/{chunk-VP63OOO4.js → chunk-SOECV4V5.js} +3 -3
  165. package/dist/chunk-SWN3LSQX.js +12 -0
  166. package/dist/{chunk-TBPHW42V.js → chunk-TKJBZIHT.js} +1 -1
  167. package/dist/chunk-TMNAHOJ7.js +9 -0
  168. package/dist/{chunk-CBGKLHPB.js → chunk-TOVKWNI2.js} +6 -6
  169. package/dist/{chunk-PF5CKD4C.js → chunk-TVH7IZQ4.js} +2 -2
  170. package/dist/{chunk-LNARMEEZ.js → chunk-TXDA7TTP.js} +1 -1
  171. package/dist/{chunk-SKY2NBTQ.js → chunk-UBOP6HFI.js} +5 -5
  172. package/dist/{chunk-J7CIBRDS.js → chunk-UDRMZ22J.js} +1 -1
  173. package/dist/{chunk-IWJRSC7M.js → chunk-ULAGXDOL.js} +1 -1
  174. package/dist/{chunk-O6ABVKHU.js → chunk-ULXCDM7Y.js} +10 -10
  175. package/dist/{chunk-MVQMAIZM.js → chunk-UPQW4GCT.js} +1 -1
  176. package/dist/{chunk-E3RHEEA6.js → chunk-URERZUX5.js} +1 -1
  177. package/dist/{chunk-RPMWF42S.js → chunk-UTWJKSET.js} +5 -5
  178. package/dist/{chunk-SWO4VPOB.js → chunk-UWIZX3RK.js} +1 -1
  179. package/dist/{chunk-EQN65XOO.js → chunk-UYRITNQW.js} +4 -4
  180. package/dist/{chunk-QSW3YHPK.js → chunk-VKKK4WLS.js} +4 -4
  181. package/dist/{chunk-JJYAYMY7.js → chunk-VTFZ6W2D.js} +2 -2
  182. package/dist/chunk-W35N7SL3.js +8 -0
  183. package/dist/{chunk-IWEL2ZCV.js → chunk-W5CJD54C.js} +1 -1
  184. package/dist/{chunk-45XXERGA.js → chunk-W6SC3ZNO.js} +2 -2
  185. package/dist/{chunk-ZF545DXX.js → chunk-W6URVLQF.js} +14 -14
  186. package/dist/{chunk-R5EJJ6HC.js → chunk-WINNA7LS.js} +1 -1
  187. package/dist/chunk-WMEYNKXZ.js +22 -0
  188. package/dist/{chunk-DKQWFQAV.js → chunk-WN5HHHLO.js} +1 -1
  189. package/dist/chunk-WTTSB4SV.js +3 -0
  190. package/dist/{chunk-4UX6ET7G.js → chunk-XKDBYJHF.js} +1 -1
  191. package/dist/{chunk-HI6IE5HI.js → chunk-XO7URRTM.js} +1 -1
  192. package/dist/chunk-Y3R267FV.js +15 -0
  193. package/dist/chunk-YAW54RRC.js +1 -0
  194. package/dist/{chunk-Y23TGQFN.js → chunk-YCOYCPAH.js} +3 -3
  195. package/dist/chunk-YGSU5KCP.js +9 -0
  196. package/dist/{chunk-VMDBVXDJ.js → chunk-YJLLLO5R.js} +1 -1
  197. package/dist/{chunk-BDFZNLFQ.js → chunk-YWDEFPSW.js} +3 -3
  198. package/dist/{chunk-FMC2XNSP.js → chunk-ZNAVCHBV.js} +6 -6
  199. package/dist/{chunk-B7AHMB3U.js → chunk-ZURB2DCM.js} +1 -1
  200. package/dist/{chunk-NQJKANUP.js → chunk-ZUS7FXKE.js} +13 -13
  201. package/dist/{chunk-3V74SUZO.js → chunk-ZZOBG6GP.js} +17 -17
  202. package/dist/chunk-ZZVE64OI.js +2 -0
  203. package/dist/data/DataTable.js +1 -1
  204. package/dist/data/Kanban.js +1 -1
  205. package/dist/data/ListFooter.js +1 -1
  206. package/dist/data/ListLoadError.js +1 -1
  207. package/dist/data/Pagination.js +1 -1
  208. package/dist/file-intake/index.js +1 -1
  209. package/dist/format/index.js +1 -1
  210. package/dist/forms/AlignmentGrid.js +1 -1
  211. package/dist/forms/BorderInput.js +1 -1
  212. package/dist/forms/BrandAssetEditor.js +1 -1
  213. package/dist/forms/Button.js +1 -1
  214. package/dist/forms/Calendar.js +1 -1
  215. package/dist/forms/ColorPicker.js +1 -1
  216. package/dist/forms/ComposerAttachments.js +1 -1
  217. package/dist/forms/CornersInput.js +1 -1
  218. package/dist/forms/DatePicker.js +1 -1
  219. package/dist/forms/DateRangePicker.js +1 -1
  220. package/dist/forms/DateTimePicker.js +1 -1
  221. package/dist/forms/DisplayChips.js +1 -1
  222. package/dist/forms/FilePicker.js +1 -1
  223. package/dist/forms/FormErrorSummary.js +1 -1
  224. package/dist/forms/IconButton.js +1 -1
  225. package/dist/forms/IconPicker.js +1 -1
  226. package/dist/forms/ImageFocusPoint.js +1 -1
  227. package/dist/forms/InputNumber.js +1 -1
  228. package/dist/forms/LinkPicker.js +1 -1
  229. package/dist/forms/MediaLibrary.js +1 -1
  230. package/dist/forms/MediaUploadField.js +1 -1
  231. package/dist/forms/MediaUploadGrid.js +1 -1
  232. package/dist/forms/MediaUsedInList.js +1 -1
  233. package/dist/forms/NumericKeypad.js +1 -1
  234. package/dist/forms/PictureTiles.js +1 -1
  235. package/dist/forms/PositionInput.js +1 -1
  236. package/dist/forms/Segmented.js +1 -1
  237. package/dist/forms/Select.js +1 -1
  238. package/dist/forms/SidesInput.js +1 -1
  239. package/dist/forms/Slider.js +1 -1
  240. package/dist/forms/Snippet.js +1 -1
  241. package/dist/forms/SplitButton.js +1 -1
  242. package/dist/forms/TagInput.js +1 -1
  243. package/dist/forms/TextToolbar.js +1 -1
  244. package/dist/forms/TimePicker.js +1 -1
  245. package/dist/forms/WidthsBar.js +1 -1
  246. package/dist/forms/mediaLibraryMenu.js +1 -1
  247. package/dist/forms/mediaMoveItems.js +1 -1
  248. package/dist/forms/textAlign.js +1 -1
  249. package/dist/forms/useFileIntake.js +1 -1
  250. package/dist/hooks/useTheme.d.ts +1 -1
  251. package/dist/icons/efficient-glyphs.js +1 -1
  252. package/dist/icons/efficient-looks.js +1 -1
  253. package/dist/icons/efficient.js +1 -1
  254. package/dist/icons/index.js +1 -1
  255. package/dist/icons/looks/map.js +1 -1
  256. package/dist/icons/sets.js +1 -1
  257. package/dist/index.d.ts +2 -1
  258. package/dist/index.js +130 -130
  259. package/dist/locales/zh-Hans.js +1 -1
  260. package/dist/map/index.js +8 -8
  261. package/dist/page-tabs/index.js +5 -5
  262. package/dist/pdf/index.js +1 -1
  263. package/dist/shell/Accordion.js +1 -1
  264. package/dist/shell/AppUpdateBanner.js +1 -1
  265. package/dist/shell/Avatar.js +1 -1
  266. package/dist/shell/Banner.js +1 -1
  267. package/dist/shell/Breadcrumbs.js +1 -1
  268. package/dist/shell/BudgetBar.js +1 -1
  269. package/dist/shell/Card.js +1 -1
  270. package/dist/shell/ColoredBadge.js +1 -1
  271. package/dist/shell/ConfirmDialog.js +1 -1
  272. package/dist/shell/ContainerFillChart.js +1 -1
  273. package/dist/shell/ContextMenu.js +1 -1
  274. package/dist/shell/CountBadge.js +1 -1
  275. package/dist/shell/Dialog.d.ts +16 -3
  276. package/dist/shell/Dialog.js +1 -1
  277. package/dist/shell/Drawer.d.ts +6 -2
  278. package/dist/shell/Drawer.js +1 -1
  279. package/dist/shell/DropdownMenu.js +1 -1
  280. package/dist/shell/EditableGrid.js +1 -1
  281. package/dist/shell/EmptyState.js +1 -1
  282. package/dist/shell/FloatingBar.js +1 -1
  283. package/dist/shell/GlobalSearch.js +1 -1
  284. package/dist/shell/HelpCenter.js +1 -1
  285. package/dist/shell/IconRail.js +1 -1
  286. package/dist/shell/ImageLightbox.js +1 -1
  287. package/dist/shell/ItemCount.js +1 -1
  288. package/dist/shell/LanguageSelect.js +1 -1
  289. package/dist/shell/Markdown.js +1 -1
  290. package/dist/shell/MetricBar.js +1 -1
  291. package/dist/shell/MetricBarLegend.js +1 -1
  292. package/dist/shell/MilestoneTimeline.js +1 -1
  293. package/dist/shell/PageHeader.js +1 -1
  294. package/dist/shell/PopupMenu.js +1 -1
  295. package/dist/shell/ProductionTimeline.js +1 -1
  296. package/dist/shell/ResizeHandle.js +1 -1
  297. package/dist/shell/Result.js +1 -1
  298. package/dist/shell/SearchableSelect.js +1 -1
  299. package/dist/shell/SettingReset.js +1 -1
  300. package/dist/shell/SettingRow.js +1 -1
  301. package/dist/shell/SidebarLayout.js +1 -1
  302. package/dist/shell/SidebarNav.js +1 -1
  303. package/dist/shell/SortableList.js +1 -1
  304. package/dist/shell/Statistic.js +1 -1
  305. package/dist/shell/StatusBadge.js +1 -1
  306. package/dist/shell/Tabs.js +1 -1
  307. package/dist/shell/TimeAgo.js +1 -1
  308. package/dist/shell/TimelineTrack.js +1 -1
  309. package/dist/shell/Tooltip.js +1 -1
  310. package/dist/shell/TopNav.js +1 -1
  311. package/dist/shell/TransferProgress.js +1 -1
  312. package/dist/shell/Tree.js +1 -1
  313. package/dist/shell/discardGuard.d.ts +43 -0
  314. package/dist/shell/discardGuard.js +2 -0
  315. package/dist/shell/language.js +1 -1
  316. package/dist/shell/strings.d.ts +6 -0
  317. package/dist/shell/strings.js +1 -1
  318. package/dist/shell/toast.js +1 -1
  319. package/dist/telemetry/index.js +1 -1
  320. package/dist/templates/AuthScreen.js +1 -1
  321. package/dist/templates/ChatTemplate.js +1 -1
  322. package/dist/templates/CheckoutTemplate.js +1 -1
  323. package/dist/templates/DashboardTemplate.js +1 -1
  324. package/dist/templates/DataTablePage.js +1 -1
  325. package/dist/templates/EmailTemplate.js +1 -1
  326. package/dist/templates/ErrorBoundary.d.ts +1 -1
  327. package/dist/templates/ErrorBoundary.js +1 -1
  328. package/dist/templates/ErrorPage.js +1 -1
  329. package/dist/templates/FormLayoutPage.js +1 -1
  330. package/dist/templates/GalleryTemplate.js +1 -1
  331. package/dist/ui/index.d.ts +1 -0
  332. package/dist/ui/index.js +1 -1
  333. package/dist/ui.css +5 -0
  334. package/dist/utils/glass.d.ts +4 -2
  335. package/dist/utils/glass.js +1 -1
  336. package/dist/version.js +1 -1
  337. package/package.json +1 -1
  338. package/dist/Calculator-63XNC3BA.js +0 -29
  339. package/dist/CurrencyConverter-Q4HYAY4N.js +0 -21
  340. package/dist/Documents-KLVVF4KK.js +0 -52
  341. package/dist/Files-AOIBTQTE.js +0 -88
  342. package/dist/Notepad-SOUIZDKN.js +0 -24
  343. package/dist/Sidebar-4OI4LP6G.js +0 -44
  344. package/dist/Spreadsheet-RBEVCQIV.js +0 -37
  345. package/dist/chunk-2SLQD57V.js +0 -6
  346. package/dist/chunk-4X6GIVTI.js +0 -29
  347. package/dist/chunk-5GUBNCTP.js +0 -1
  348. package/dist/chunk-A3VJ4PRU.js +0 -11
  349. package/dist/chunk-ACVKU6YW.js +0 -7
  350. package/dist/chunk-AG2OLB3E.js +0 -15
  351. package/dist/chunk-AXL7VTNM.js +0 -11
  352. package/dist/chunk-BCDG4N6L.js +0 -6
  353. package/dist/chunk-DY2M6BIG.js +0 -12
  354. package/dist/chunk-F7A6K3D5.js +0 -9
  355. package/dist/chunk-GZYTCHPX.js +0 -8
  356. package/dist/chunk-IFANUMK3.js +0 -4
  357. package/dist/chunk-IGEFUHYE.js +0 -12
  358. package/dist/chunk-K64JRGNE.js +0 -6
  359. package/dist/chunk-KE5U4KKG.js +0 -4
  360. package/dist/chunk-KFRU53WD.js +0 -8
  361. package/dist/chunk-N6VP75F5.js +0 -3
  362. package/dist/chunk-OPB3I4JH.js +0 -8
  363. package/dist/chunk-QASKQDUR.js +0 -22
  364. package/dist/chunk-QMUAY24U.js +0 -8
  365. package/dist/chunk-QZ3MO3HB.js +0 -1
  366. package/dist/chunk-RUTUVS4H.js +0 -1
  367. package/dist/chunk-SDI2UGAG.js +0 -1
  368. package/dist/chunk-SKETTGCJ.js +0 -2
  369. package/dist/chunk-UP442DPT.js +0 -9
  370. package/dist/chunk-VO3ZB7C6.js +0 -14
  371. package/dist/chunk-W244OMOU.js +0 -7
  372. package/dist/chunk-X2PZMXDP.js +0 -1
  373. package/dist/chunk-YVTKTWZX.js +0 -9
  374. package/dist/chunk-ZN2BFSQR.js +0 -2
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-CLQFP42I.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-KKSVRIMP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-X2PZMXDP.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),M=v.trim().toLowerCase(),L=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),P=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),_=n(()=>L.map(e=>({...e,docs:e.docs.filter(P)})).filter(e=>e.docs.length>0),[L,M]),A=n(()=>_.flatMap(e=>e.docs),[_]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,K=e=>!!M||(C[e]??e===E?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-MBXLROCD.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-KKSVRIMP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-4PAWQEXM.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),M=v.trim().toLowerCase(),L=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>L.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[L,M]),E=n(()=>A.flatMap(e=>e.docs),[A]),R=(w?E.find(e=>e.slug===w):void 0)??E[0]??null,B=e=>!!M||(C[e]??e===R?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */o("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=K(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===A.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):A.map(e=>{const t=B(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!K(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!B(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=R?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:R?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:R.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[R.category_label,!1===R.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(R),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(R):R.body?/* @__PURE__ */o(e,{children:R.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-N6TK43YN.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-573EHCD7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -1,4 +1,4 @@
1
- import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
1
+ import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
2
2
  return i("div",{className:n,children:/* @__PURE__ */s("svg",{width:"100%",height:o,viewBox:`0 0 ${a} ${o}`,role:"img","aria-label":p,"aria-busy":"true",children:[
3
3
  /* @__PURE__ */i("defs",{children:/* @__PURE__ */s("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[
4
4
  /* @__PURE__ */i("stop",{offset:"0%",stopColor:r.surface,stopOpacity:"0"}),
@@ -1,4 +1,4 @@
1
- import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-NHH2MXFU.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as r}from"./chunk-X2PZMXDP.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
1
+ import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-I4VIEGCX.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as r}from"./chunk-4PAWQEXM.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
2
2
  return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
3
3
  /* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
4
4
  /* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
@@ -1 +1 @@
1
- import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-OQW42DOR.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-AKM6JBMD.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
@@ -1,23 +1,23 @@
1
- import{Calendar as e,fromKey as t}from"./chunk-FS2KWQJW.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-AYZY3YNC.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as i}from"./chunk-UQYNPYF4.js";import{Icon as l}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-X2PZMXDP.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(i(1)),to:$(o)};case"last3Months":return{from:$(i(3)),to:$(o)};case"last6Months":return{from:$(i(6)),to:$(o)};case"last12Months":return{from:$(i(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function Y({from:M,to:$,onChange:Y,formatDisplay:O,clearable:R,required:T=!1,name:H,id:J,"aria-labelledby":L,"aria-label":P,weekStartsOn:B,placeholder:E,fullWidth:G=!1,min:I,max:U,disabled:q=!1,allowOpenEnd:A=!1}){const K=p().dateRange,Z=h(),Q=O??(Z?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(Z):S),V=E??K.placeholder,X=R??!T,[z,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[ie,le]=f("from"),se=g(null),ce=g(null),de=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=d(se,z,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:de}),be=g(null),xe=g(null),[ve,ye]=f(!0);m(()=>{const e=xe.current;if(!z||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ve&&ye(a)});const we=g(null);m(()=>{const e=de.current;if(!z||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!J&&(ce.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!P||!!L||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,I,U)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),I,U)),je=e=>e?Q(e):"";x(()=>{if(!z)return;const e=e=>{const t=e.target;se.current?.contains(t)||de.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[z]),x(()=>{q&&_(!1)},[q]);const Se=()=>{Y("",""),_(!1)},Fe=M&&$?`${je(M)} — ${je($)}`:M?K.fromOnly(je(M)):$?K.toOnly(je($)):"",Ye=o(Z),Oe=e=>{const r=t(e);return r?Ye.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=M&&$?K.range(Oe(M),Oe($)):M?K.fromOnly(Oe(M)):$?K.toOnly(Oe($)):V,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),He=/* @__PURE__ */y(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?K[e]:void 0,children:he?ve?K[e]:K[`${e}Short`]:K[e]},e)),
2
- /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:K.custom})]}),Je=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>le(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Le=e=>A&&ie===e?" ring-1 ring-blue-400":"",Pe=
3
- /* @__PURE__ */N(e,{mode:"range",min:I,max:U,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),A?"from"===ie?(re&&e>re?(te(re),ne(e)):te(e),le("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:B,"aria-label":K.dialog});/* @__PURE__ */
1
+ import{Calendar as e,fromKey as t}from"./chunk-E5MVH3SH.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-AYZY3YNC.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as i}from"./chunk-UQYNPYF4.js";import{Icon as l}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useDropdownPosition as d}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-F27JJHNJ.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-4PAWQEXM.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],M=e=>`${e.getFullYear()}-${C(e.getMonth()+1)}`,C=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${C(e.getMonth()+1)}-${C(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(i(1)),to:$(o)};case"last3Months":return{from:$(i(3)),to:$(o)};case"last6Months":return{from:$(i(6)),to:$(o)};case"last12Months":return{from:$(i(12)),to:$(o)}}}function W(e,t,r){const n=M(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function S(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var F=/* @__PURE__ */new Map;function Y({from:C,to:$,onChange:Y,formatDisplay:H,clearable:O,required:E=!1,name:J,id:T,"aria-labelledby":L,"aria-label":R,weekStartsOn:A,placeholder:B,fullWidth:G=!1,min:P,max:U,disabled:q=!1,allowOpenEnd:I=!1}){const V=p().dateRange,K=h(),Q=H??(K?function(e){let t=F.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),F.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(K):S),Z=B??V.placeholder,z=O??!E,[X,_]=f(!1),[ee,te]=f(C),[re,ne]=f($),[ae,oe]=f(null),[ie,le]=f("from"),se=g(null),ce=g(null),de=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=d(se,X,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:de}),be=g(null),xe=g(null),[ve,ye]=f(!0);m(()=>{const e=xe.current;if(!X||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ve&&ye(a)});const we=g(null);m(()=>{const e=de.current;if(!X||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!T&&(ce.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Me=!!R||!!L||Ne,Ce=/* @__PURE__ */new Date,[$e,De]=f(()=>C?M(j(C)):W(Ce,P,U)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Ce),P,U)),je=e=>e?Q(e):"";x(()=>{if(!X)return;const e=e=>{const t=e.target;se.current?.contains(t)||de.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[X]),x(()=>{q&&_(!1)},[q]);const Se=()=>{Y("",""),_(!1)},Fe=C&&$?`${je(C)} — ${je($)}`:C?V.fromOnly(je(C)):$?V.toOnly(je($)):"",Ye=o(K),He=e=>{const r=t(e);return r?Ye.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Oe=C&&$?V.range(He(C),He($)):C?V.fromOnly(He(C)):$?V.toOnly(He($)):Z,Ee=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Je=/* @__PURE__ */y(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Ce);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Ee(e),"aria-label":he?V[e]:void 0,children:he?ve?V[e]:V[`${e}Short`]:V[e]},e)),
2
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Ee("Custom"),children:V.custom})]}),Te=(e,t)=>I?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>le(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Le=e=>I&&ie===e?" ring-1 ring-blue-400":"",Re=
3
+ /* @__PURE__ */N(e,{mode:"range",min:P,max:U,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),I?"from"===ie?(re&&e>re?(te(re),ne(e)):te(e),le("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:A,"aria-label":V.dialog});/* @__PURE__ */
4
4
  return y("div",{className:"relative"+(G?" w-full":""),ref:se,children:[
5
- /* @__PURE__ */y("div",{className:`${G?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */y("button",{ref:ce,type:"button",onClick:()=>{q||(te(M),ne($),oe(null),le(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,I,U)),_(!0))},"aria-haspopup":"dialog","aria-expanded":z,id:J,disabled:q||void 0,"aria-label":P,"aria-labelledby":L,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":z?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(G?" min-w-0 flex-1 justify-start":""),children:[
5
+ /* @__PURE__ */y("div",{className:`${G?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${C||$?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */y("button",{ref:ce,type:"button",onClick:()=>{q||(te(C),ne($),oe(null),le(C&&!$?"to":"from"),De(C?M(j(C)):W(Ce,P,U)),_(!0))},"aria-haspopup":"dialog","aria-expanded":X,id:T,disabled:q||void 0,"aria-label":R,"aria-labelledby":L,"aria-describedby":[Me?ue:void 0,E?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":X?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(G?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */N(l,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */N("span",{className:"truncate",children:Fe||V})]}),X&&!q&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":K.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:K.required}),H&&/* @__PURE__ */y(w,{children:[
9
- /* @__PURE__ */N("input",{type:"hidden",name:H.from,value:M,disabled:q||void 0}),
10
- /* @__PURE__ */N("input",{type:"hidden",name:H.to,value:$,disabled:q||void 0})]}),z&&v(
11
- /* @__PURE__ */y("div",{ref:de,id:me,role:"dialog","aria-label":K.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:c.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
12
- /* @__PURE__ */y("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Je("from",/* @__PURE__ */y(w,{children:[
13
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
14
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:ee?je(ee):K.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Je("to",/* @__PURE__ */y(w,{children:[
15
- /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
16
- /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:re?je(re):K.end})]}))]}),he?/* @__PURE__ */y(w,{children:[We.length>0&&/* @__PURE__ */y("div",{className:"mb-3 @container",children:[!ve&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
17
- /* @__PURE__ */y("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[He,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
18
- /* @__PURE__ */N("div",{className:"w-full",children:Pe})]}):
8
+ /* @__PURE__ */N("span",{className:"truncate",children:Fe||Z})]}),z&&!q&&(C||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Se,"aria-label":V.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Me&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Oe}),E&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:V.required}),J&&/* @__PURE__ */y(w,{children:[
9
+ /* @__PURE__ */N("input",{type:"hidden",name:J.from,value:C,disabled:q||void 0}),
10
+ /* @__PURE__ */N("input",{type:"hidden",name:J.to,value:$,disabled:q||void 0})]}),X&&v(
11
+ /* @__PURE__ */y("div",{ref:de,id:me,role:"dialog","aria-label":V.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:c.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
12
+ /* @__PURE__ */y("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Te("from",/* @__PURE__ */y(w,{children:[
13
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
14
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("from")}`,children:ee?je(ee):V.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Te("to",/* @__PURE__ */y(w,{children:[
15
+ /* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
16
+ /* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Le("to")}`,children:re?je(re):V.end})]}))]}),he?/* @__PURE__ */y(w,{children:[We.length>0&&/* @__PURE__ */y("div",{className:"mb-3 @container",children:[!ve&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:V.lastHeading}),
17
+ /* @__PURE__ */y("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Je,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
18
+ /* @__PURE__ */N("div",{className:"w-full",children:Re})]}):
19
19
  /* @__PURE__ */y("div",{ref:be,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */N("div",{className:"w-64",children:Pe}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:He})]}),
21
- /* @__PURE__ */y("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:i({variant:"ghost"}),children:K.clear}),
22
- /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:i({variant:"secondary"}),children:K.cancel}),
23
- /* @__PURE__ */N("button",{type:"button",onClick:()=>{Y(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:i({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{Y as DateRangePicker,D as presetRange,$ as toISODate};
20
+ /* @__PURE__ */N("div",{className:"w-64",children:Re}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Je})]}),
21
+ /* @__PURE__ */y("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[z&&/* @__PURE__ */N("button",{type:"button",onClick:Se,className:i({variant:"ghost"}),children:V.clear}),
22
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:i({variant:"secondary"}),children:V.cancel}),
23
+ /* @__PURE__ */N("button",{type:"button",onClick:()=>{Y(ee,re),_(!1)},disabled:I?!ee&&!re:!ee||!re,className:i({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{Y as DateRangePicker,D as presetRange,$ as toISODate};
@@ -1 +1 @@
1
- import{toast_default as t}from"./chunk-OQW42DOR.js";import{currentShellStrings as e}from"./chunk-X2PZMXDP.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-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 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-BCDG4N6L.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-6XBWM453.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-VC42SDAC.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{toast_default as t}from"./chunk-OQW42DOR.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as a}from"./chunk-X2PZMXDP.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:T=""}){const[D,P]=i(!1),R=o(null),S=a().copy;c(()=>()=>{R.current&&clearTimeout(R.current)},[]);const V=l(async()=>{await e(n)?(P(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{P(!1),R.current=null},2e3),w?.(n)):t.error(S.failed)},[n,w,S]),{box:B,button:K}=p[g],M=!v;/* @__PURE__ */
4
- return m("div",{id:M?void 0:j,"aria-describedby":M?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],B,T].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":M,className:P=""}){const[B,C]=i(!1),K=o(null),S=a().copy;c(()=>()=>{K.current&&clearTimeout(K.current)},[]);const T=l(async()=>{await e(n)?(C(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{C(!1),K.current=null},2e3),w?.(n)):t.error(S.failed)},[n,w,S]),{box:U,button:A}=p[g],J=!v;/* @__PURE__ */
4
+ return m("div",{id:J?void 0:j,"aria-describedby":J?void 0:M,className:["inline-flex max-w-full items-center rounded-md",u[k],U,P].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:n,children:y??n}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?S.copyLabel(x):S.copy,"aria-describedby":C,onClick:V,className:`${K} text-gray-400`,children:/* @__PURE__ */s(D?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:D?S.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?S.copyLabel(x):S.copy,"aria-describedby":M,onClick:T,className:`${A} text-gray-400`,children:/* @__PURE__ */s(B?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:B?S.copied:""})]})]})}export{y as Snippet};
@@ -1,19 +1,19 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QODTON7V.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-X2PZMXDP.js";import{forwardRef as k,useId as N,useState as w,useRef as $,useMemo as D,useCallback as j,useEffect as S,useLayoutEffect as T}from"react";import{createPortal as H}from"react-dom";import{jsxs as I,jsx as O,Fragment as C}from"react/jsx-runtime";var E=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=k(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},k){const w=t,$=x(),D=d(),j=f??D,S=N(),T=/* @__PURE__ */I("select",{ref:k,value:e,multiple:b||void 0,onChange:e=>w(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
- /* @__PURE__ */O(R,{items:r})]});return j?/* @__PURE__ */I(C,{children:[T,
3
- /* @__PURE__ */O("span",{id:S,hidden:!0,children:$.settingView.auto})]}):T});function R({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return O(C,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=k(function({value:l,onChange:u,options:k,placeholder:z,invalid:K,className:P="",id:V,disabled:A,size:U,touchSize:B,title:M,multiple:W,renderOption:F,renderValue:L,valueText:G,readOnly:X=!1,footer:Y,changed:J=!1,auto:q,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=w(!1),[ie,ae]=w(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=w(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),ke=N(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=q??je,Te=`${ke}-auto`,He=[Q,J?De:void 0,Se?Te:void 0].filter(Boolean).join(" ")||void 0,Ie=D(()=>i(k),[k]),Oe=W?l:[],Ce=u,Ee=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze="undefined"==typeof window?S:T,Re=`${re}|${Ee?.top}|${Ee?.bottom}|${Ee?.maxHeight}|${k.length}`;ze(()=>{be(null)},[Re]),ze(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Re]);const Ke=W?Ie.findIndex(e=>Oe.includes(e.value)):Ie.findIndex(e=>e.value===l),Pe=W?Ie.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ke>=0?Ie[Ke].label:void 0,Ve=!W&&Ke>=0?Ie[Ke].lang:void 0,Ae=W?Ie.filter(e=>Oe.includes(e.value)):Ke>=0?[Ie[Ke]]:[],Ue=L&&Ae.length?L(Ae):void 0,Be=void 0!==Ue&&G?G(Ae):void 0,Me=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),We=j(()=>{A||X||(ae(Ke>=0?Ke:e(Ie)),ne(!0))},[A,X,Ie,Ke]),Fe=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(W){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),Me()}},[Ie,W,l,Ce,Me]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),S(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Le=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ke,i=t(Ie,r.buffer,n);i<0||(re?ae(i):W?(ae(i),ne(!0)):Fe(i))},[re,ie,Ke,Ie,Fe,W]),Ge=re?a(k,(e,t)=>{const r=(n=e.value,W?Oe.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
5
- return I("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */O(o,{selected:r}),F?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
6
- /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:E(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
- /* @__PURE__ */I(C,{children:[
8
- /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:E(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Xe=void 0!==Ue?
9
- /* @__PURE__ */I("span",{className:"relative block min-w-0 truncate",children:[
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QODTON7V.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-4PAWQEXM.js";import{forwardRef as N,useId as k,useState as w,useRef as $,useMemo as D,useCallback as j,useEffect as S,useLayoutEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as E,jsx as O,Fragment as C}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},N){const w=t,$=x(),D=d(),j=f??D,S=k(),H=/* @__PURE__ */E("select",{ref:N,value:e,multiple:b||void 0,onChange:e=>w(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
+ /* @__PURE__ */O(A,{items:r})]});return j?/* @__PURE__ */E(C,{children:[H,
3
+ /* @__PURE__ */O("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function A({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
+ return O(C,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:K,className:V="",id:P,disabled:R,size:U,touchSize:B,title:M,multiple:W,renderOption:F,renderValue:J,valueText:L,readOnly:G=!1,footer:Y,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=w(!1),[ie,ae]=w(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=w(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),Ne=k(),ke=`${Ne}-listbox`,we=P??`${Ne}-trigger`,$e=e=>`${Ne}-opt-${e}`,De=`${Ne}-changed`,je=d(),Se=X??je,He=`${Ne}-auto`,Te=[q,Q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ee=D(()=>i(N),[N]),Oe=W?l:[],Ce=u,Ie=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze="undefined"==typeof window?S:H,Ae=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;ze(()=>{be(null)},[Ae]),ze(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Ae]);const Ke=W?Ee.findIndex(e=>Oe.includes(e.value)):Ee.findIndex(e=>e.value===l),Ve=W?Ee.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ke>=0?Ee[Ke].label:void 0,Pe=!W&&Ke>=0?Ee[Ke].lang:void 0,Re=W?Ee.filter(e=>Oe.includes(e.value)):Ke>=0?[Ee[Ke]]:[],Ue=J&&Re.length?J(Re):void 0,Be=void 0!==Ue&&L?L(Re):void 0,Me=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),We=j(()=>{R||G||(ae(Ke>=0?Ke:e(Ee)),ne(!0))},[R,G,Ee,Ke]),Fe=j(e=>{const t=Ee[e];if(t&&!t.disabled){if(W){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),Me()}},[Ee,W,l,Ce,Me]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),S(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Je=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ke,i=t(Ee,r.buffer,n);i<0||(re?ae(i):W?(ae(i),ne(!0)):Fe(i))},[re,ie,Ke,Ee,Fe,W]),Le=re?a(N,(e,t)=>{const r=(n=e.value,W?Oe.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
5
+ return E("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */O(o,{selected:r}),F?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):W?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1",children:[
6
+ /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
+ /* @__PURE__ */E(C,{children:[
8
+ /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.label]},e.value)},Ne,"mx-1"):null,Ge=void 0!==Ue?
9
+ /* @__PURE__ */E("span",{className:"relative block min-w-0 truncate",children:[
10
10
  /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ue}),
11
- /* @__PURE__ */O("span",{lang:void 0===Be?Ve:void 0,className:"sr-only",children:Be??Pe})]}):/* @__PURE__ */O("span",{lang:Ve,className:`block truncate ${void 0===Pe?c:""}`,children:Pe??z??" "}),Ye={zIndex:h.popup,left:Ee?.left,top:Ee?.top,bottom:Ee?.bottom,width:Ee?.width,maxHeight:Ee?.maxHeight??b,visibility:Ee?void 0:"hidden",...g()},Je=/* @__PURE__ */O("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Ge}),qe=pe?/* @__PURE__ */I("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Je,
12
- /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
- /* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
14
- return I("div",{ref:le,className:"relative",children:[
15
- /* @__PURE__ */O("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":K||void 0,"aria-describedby":He,"aria-label":Z,"aria-labelledby":_,title:M,disabled:A,"aria-readonly":X||void 0,onClick:()=>re?Me():We(),onKeyDown:t=>{if(!A&&!X)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ie,e,1)):We());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ie,e,-1)):We());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Fe(ie)));case" ":return t.preventDefault(),void(re?Fe(ie):We());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:s({invalid:K,size:U,readOnly:X,auto:Se,className:`${X?"":"pr-8 "}text-left ${P}`.trim()}),children:J?
16
- /* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Xe,
17
- /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Xe}),J&&/* @__PURE__ */O("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */O("span",{id:Te,hidden:!0,children:ge.settingView.auto}),!X&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
- /* @__PURE__ */I("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Ce(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:A,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:z}),
19
- /* @__PURE__ */O(R,{items:k})]}),re&&H(qe,document.body)]})}),P=k(function({touchSize:e,...t},r){const n=u(),i=e??"touch";return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(z,{ref:r,...t,size:i}):/* @__PURE__ */O(K,{ref:r,...t}):/* @__PURE__ */O(K,{ref:r,...t,size:i})});export{z as NativeSelect,P as Select_default};
11
+ /* @__PURE__ */O("span",{lang:void 0===Be?Pe:void 0,className:"sr-only",children:Be??Ve})]}):/* @__PURE__ */O("span",{lang:Pe,className:`block truncate ${void 0===Ve?c:""}`,children:Ve??z??" "}),Ye={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...g()},Qe=/* @__PURE__ */O("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Le}),Xe=pe?/* @__PURE__ */E("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Qe,
12
+ /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */E("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
+ /* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
14
+ return E("div",{ref:le,className:"relative",children:[
15
+ /* @__PURE__ */O("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":K||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:M,disabled:R,"aria-readonly":G||void 0,onClick:()=>re?Me():We(),onKeyDown:t=>{if(!R&&!G)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ee,e,1)):We());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ee,e,-1)):We());case"Home":return void(re&&(t.preventDefault(),ae(e(Ee))));case"End":return void(re&&(t.preventDefault(),ae(r(Ee))));case"Enter":return void(re&&(t.preventDefault(),Fe(ie)));case" ":return t.preventDefault(),void(re?Fe(ie):We());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Je(t.key))}},className:s({invalid:K,size:U,readOnly:G,auto:Se,className:`${G?"":"pr-8 "}text-left ${V}`.trim()}),children:Q?
16
+ /* @__PURE__ */E("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
17
+ /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),Q&&/* @__PURE__ */O("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */O("span",{id:He,hidden:!0,children:ge.settingView.auto}),!G&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
+ /* @__PURE__ */E("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Ce(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:R,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:z}),
19
+ /* @__PURE__ */O(A,{items:N})]}),re&&T(Xe,document.body)]})}),V=N(function({touchSize:e,...t},r){const n=u(),i=e??"touch";return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(z,{ref:r,...t,size:i}):/* @__PURE__ */O(K,{ref:r,...t}):/* @__PURE__ */O(K,{ref:r,...t,size:i})});export{z as NativeSelect,V as Select_default};
@@ -1,2 +1,2 @@
1
- import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-DTJRIWFR.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=o(),j=c(null),W=c(p);W.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=j.current,n=W.current();if(!t||!n)return;const o=(k.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{v&&y()}),u(()=>{if(!v)return;const t=n(()=>W.current(),y),e=j.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[v,y]);return v&&p()?d(
2
- /* @__PURE__ */l("div",{ref:j,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
1
+ import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-F27JJHNJ.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=o(),J=c(null),j=c(p);j.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=J.current,n=j.current();if(!t||!n)return;const o=(k.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{v&&y()}),u(()=>{if(!v)return;const t=n(()=>j.current(),y),e=J.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[v,y]);return v&&p()?d(
2
+ /* @__PURE__ */l("div",{ref:J,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-CBGKLHPB.js";import{Select_default as l}from"./chunk-ZLHPCPXS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-6FPDOEOX.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-NHH2MXFU.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-TOVKWNI2.js";import{Select_default as l}from"./chunk-N4DI5F74.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-GSKLHUQ6.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-KKSVRIMP.js";import{useShellStrings as i}from"./chunk-X2PZMXDP.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-KKSVRIMP.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
2
  return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
3
  /* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
4
  /* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
@@ -1,2 +1,2 @@
1
- import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-HL6JSDN3.js";import{Tooltip as o}from"./chunk-BCDG4N6L.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
1
+ import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-34URULVW.js";import{Tooltip as o}from"./chunk-6XBWM453.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
2
2
  return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-OQW42DOR.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.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),$=t().annotator,E=r($);E.current=$;const[I,W]=o("select"),[S,B]=o(u[0]),[R,j]=o(4),[H,F]=o(24),[T,U]=o(h[0].id),[A,O]=o(!0),[K,X]=o(!1),[Z,V]=o(!1),[q,G]=o(null),[Y,_]=o(null),[Q,J]=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),X(Me.italic),V(Me.underline),G(Me.borderColor),_(Me.background),J(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(E.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:A,italic:K,underline:Z}[e];"bold"===e&&O(t),"italic"===e&&X(t),"underline"===e&&V(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))},$e=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:A,italic:K,underline:Z,borderColor:q,background:Y,padding:Q};re(t=>[...t,e]),ie(e.id),W("select")}ye(null)},Ee=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 Ee();t&&t.toBlob(t=>{if(!t)return void e.error(E.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(E.current.clipboardUnsupported);const t=await Ee();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success(E.current.copied)}catch{e.error(E.current.copyRefused)}else e.error(E.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:$.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:$.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:$.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:$.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:$.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:$.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:$.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:$.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"})})}],[$]),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-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__ */
2
2
  return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
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)),
4
4
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(S===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:$.weight}),
8
+ /* @__PURE__ */c("span",{children:E.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:$.radius}),
13
+ /* @__PURE__ */c("span",{children:E.radius}),
14
14
  /* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
15
15
  /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
16
16
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
- /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:$[e.name]},e.id))}),
18
- /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(A),title:$.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:$.boldLetter})}),
19
- /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:$.italic,children:/* @__PURE__ */c("span",{className:"italic",children:$.italicLetter})}),
20
- /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(Z),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.underlineLetter})}),
17
+ /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,A(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children: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})}),
21
21
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
- /* @__PURE__ */c("span",{children:$.size}),
22
+ /* @__PURE__ */c("span",{children:E.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:$.border}),q?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>De(e.target.value),title:$.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:$.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(S),title:$.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
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})]}),
29
29
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
- /* @__PURE__ */c("span",{children:$.fill}),Y?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:Y,onChange:e=>Pe(e.target.value),title:$.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:$.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:$.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
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})]}),
33
33
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
- /* @__PURE__ */c("span",{children:$.padding}),
35
- /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:Q,onChange:e=>{return t=Number(e.target.value),J(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:Q})]})]}),
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})]})]}),
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:$.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:E.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:$.zoomIn,children:"+"}),
41
- /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.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: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}),
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:$.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:E.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:$.applyCrop}),
46
- /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:$.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:$.cancel}),
47
- /* @__PURE__ */c("button",{onClick:async()=>{const t=await Ee();t?t.toBlob(t=>{t?m(t):e.error(E.current.exportFailed)},"image/png"):e.error(E.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:$.apply})]})]})]}),
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})]})]})]}),
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 $e();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:A,italic:K,underline:Z,borderColor:q,background:Y,padding:Q,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:$e,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?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.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 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}),
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__ */