efficient-shell 8.18.1 → 8.19.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 (293) hide show
  1. package/README.md +25 -8
  2. package/dist/{Browser-EE7TUWTN.js → Browser-MISWU3ND.js} +14 -14
  3. package/dist/Calculator-PH6NVEEZ.js +29 -0
  4. package/dist/{CurrencyConverter-NDMWLX7M.js → CurrencyConverter-PD2CEL6V.js} +8 -8
  5. package/dist/{Documents-XSDBD4T7.js → Documents-FQ6H7THR.js} +5 -5
  6. package/dist/{Files-B5HKRQN3.js → Files-R2657GKS.js} +24 -24
  7. package/dist/{Notepad-2SXHFPFX.js → Notepad-S3OWN7B7.js} +10 -10
  8. package/dist/{PdfViewer-456B27TB.js → PdfViewer-GODDA4GG.js} +1 -1
  9. package/dist/{PomodoroTimer-L72X22QZ.js → PomodoroTimer-JEQTTMGA.js} +57 -57
  10. package/dist/{Preview-DJHBCRKW.js → Preview-DR4RDUTU.js} +39 -39
  11. package/dist/Sidebar-SJMMY2Y2.js +43 -0
  12. package/dist/{Spreadsheet-VHFYYFLK.js → Spreadsheet-XJX6HY6R.js} +13 -13
  13. package/dist/{Stock-C3DDF3V3.js → Stock-VCMJMUCW.js} +7 -7
  14. package/dist/{Weather-2XG5AIW2.js → Weather-HF3E3N3M.js} +16 -16
  15. package/dist/{WorldClock-2MU5CFUN.js → WorldClock-PM5CJQSL.js} +6 -6
  16. package/dist/ai/index.js +11 -11
  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/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/StatTile.js +1 -1
  41. package/dist/charts/SunburstChart.js +1 -1
  42. package/dist/charts/TimeSeriesChart.js +1 -1
  43. package/dist/charts/TreemapChart.js +1 -1
  44. package/dist/charts/WaterfallChart.js +1 -1
  45. package/dist/{chunk-KH6GERFP.js → chunk-2GPXC6JX.js} +1 -1
  46. package/dist/{chunk-WDIFRAQM.js → chunk-2SHDXTB6.js} +4 -4
  47. package/dist/{chunk-QTNPOMXM.js → chunk-36DYXGQI.js} +5 -5
  48. package/dist/{chunk-O5PJELY7.js → chunk-3AVHOYQZ.js} +1 -1
  49. package/dist/{chunk-KW4VUPJV.js → chunk-3KDY6V6I.js} +8 -8
  50. package/dist/{chunk-Z7PS4QUO.js → chunk-3NWCVZRK.js} +6 -6
  51. package/dist/{chunk-JSVYN6D6.js → chunk-3P7SBAKK.js} +1 -1
  52. package/dist/{chunk-YFY2LSWZ.js → chunk-3RM3D2P3.js} +6 -6
  53. package/dist/{chunk-DQEST7MN.js → chunk-3V6UFR7M.js} +1 -1
  54. package/dist/{chunk-2ZIVFBJN.js → chunk-3WM23XSR.js} +6 -6
  55. package/dist/{chunk-TDAFCJY7.js → chunk-47MFBFIX.js} +4 -4
  56. package/dist/{chunk-BVDGHZ4H.js → chunk-4MTC6HA5.js} +2 -2
  57. package/dist/{chunk-DBBUHXRT.js → chunk-4TER5BHR.js} +1 -1
  58. package/dist/{chunk-3NU2B2WM.js → chunk-55DONELU.js} +9 -9
  59. package/dist/{chunk-F2HM7SV4.js → chunk-5GMWOYTF.js} +1 -1
  60. package/dist/{chunk-EA37JL6P.js → chunk-5JQCPUEO.js} +1 -1
  61. package/dist/{chunk-YGITR6I5.js → chunk-5TVF4BCM.js} +1 -1
  62. package/dist/{chunk-XW56UIDQ.js → chunk-5VUVKP55.js} +6 -6
  63. package/dist/{chunk-NQ46AZ3D.js → chunk-6SBPGUSR.js} +1 -1
  64. package/dist/{chunk-4JCNWUVZ.js → chunk-7HTURXIA.js} +2 -2
  65. package/dist/{chunk-A3MOA3T7.js → chunk-7RD623PT.js} +1 -1
  66. package/dist/{chunk-FJUFQXDS.js → chunk-7SPX7DLO.js} +21 -21
  67. package/dist/{chunk-DGTP6BGV.js → chunk-ABD5X73I.js} +1 -1
  68. package/dist/{chunk-UNDHDLWB.js → chunk-AILWMDWP.js} +1 -1
  69. package/dist/{chunk-HKAWQF7O.js → chunk-AK632G3F.js} +7 -7
  70. package/dist/{chunk-SACUPX6L.js → chunk-AZWEWGYG.js} +3 -3
  71. package/dist/chunk-B36HEVMT.js +28 -0
  72. package/dist/{chunk-ABD34D3N.js → chunk-B5MOPSMW.js} +3 -3
  73. package/dist/{chunk-R6WJ2NTT.js → chunk-BIEKHPZ5.js} +72 -72
  74. package/dist/chunk-BLO7KTPH.js +1 -0
  75. package/dist/chunk-BZWTFLQD.js +15 -0
  76. package/dist/{chunk-LWGNNVDA.js → chunk-CDBS47XI.js} +1 -1
  77. package/dist/{chunk-K2DUF2AR.js → chunk-CHOMUTLT.js} +1 -1
  78. package/dist/{chunk-U5YJREQJ.js → chunk-CIGHIX6Z.js} +10 -10
  79. package/dist/{chunk-P5ILG2DA.js → chunk-CQAXN3HN.js} +1 -1
  80. package/dist/{chunk-QTK5NV7L.js → chunk-CQXKO5PB.js} +1 -1
  81. package/dist/{chunk-6JLZMVVE.js → chunk-CVNM25BM.js} +5 -5
  82. package/dist/{chunk-TPDOOCFS.js → chunk-CY5N5OA3.js} +1 -1
  83. package/dist/{chunk-5WYCXSUM.js → chunk-D6FSZBJ5.js} +1 -1
  84. package/dist/chunk-DAJTVAWO.js +11 -0
  85. package/dist/{chunk-QCP4F6EF.js → chunk-DBDJQVQM.js} +1 -1
  86. package/dist/{chunk-HBBTB6RW.js → chunk-DBLJIK5J.js} +1 -1
  87. package/dist/{chunk-2VFRVO3N.js → chunk-DCNXCFAD.js} +28 -28
  88. package/dist/{chunk-TSOK3QNK.js → chunk-E2YGQAFU.js} +1 -1
  89. package/dist/{chunk-VSQSBY2P.js → chunk-ENVCMR3M.js} +5 -5
  90. package/dist/{chunk-Y67ILJVG.js → chunk-EVPOZQOI.js} +1 -1
  91. package/dist/{chunk-WVWIRII2.js → chunk-EXVR3BWW.js} +9 -9
  92. package/dist/{chunk-HIDOSOI4.js → chunk-F22KWATP.js} +1 -1
  93. package/dist/{chunk-AAYACT5T.js → chunk-F4PESM6A.js} +4 -4
  94. package/dist/{chunk-KAELFRN4.js → chunk-F5VXS5JO.js} +1 -1
  95. package/dist/{chunk-EOPPYQIT.js → chunk-FBSQABH2.js} +1 -1
  96. package/dist/{chunk-BG5BCF64.js → chunk-FFZ7KPIV.js} +7 -7
  97. package/dist/{chunk-NU55QIUV.js → chunk-G3IG4X4Z.js} +1 -1
  98. package/dist/chunk-GMEOULVW.js +11 -0
  99. package/dist/{chunk-ZVK74ERI.js → chunk-H5GQWWPA.js} +1 -1
  100. package/dist/chunk-H5VGRHNT.js +9 -0
  101. package/dist/{chunk-2MMEGCYI.js → chunk-HFSEPYFH.js} +1 -1
  102. package/dist/chunk-HLGE6TVE.js +4 -0
  103. package/dist/{chunk-HNFLUVVM.js → chunk-HME2P5VX.js} +22 -22
  104. package/dist/{chunk-ZQGPJZY4.js → chunk-HT33WUTK.js} +1 -1
  105. package/dist/{chunk-37DRDM4D.js → chunk-IGH6DECG.js} +13 -13
  106. package/dist/{chunk-EO2XHSIK.js → chunk-IH4SVMXJ.js} +2 -2
  107. package/dist/{chunk-CG4KTWP4.js → chunk-IM7QHAXT.js} +5 -5
  108. package/dist/{chunk-I5T3A4KI.js → chunk-J67YIQEN.js} +1 -1
  109. package/dist/{chunk-A3R6DKQ5.js → chunk-JJ6IUIYX.js} +1 -1
  110. package/dist/{chunk-7NOU275V.js → chunk-JSB5G2XQ.js} +2 -2
  111. package/dist/{chunk-LDHYCVMV.js → chunk-KATRRQD5.js} +1 -1
  112. package/dist/{chunk-APMBWBD7.js → chunk-KB6BGPQK.js} +1 -1
  113. package/dist/{chunk-MVYOBV4I.js → chunk-KE6NYTGF.js} +2 -2
  114. package/dist/chunk-KKZZAK76.js +1 -0
  115. package/dist/{chunk-DTJQHW3Q.js → chunk-KZ6P7WC6.js} +1 -1
  116. package/dist/{chunk-K5UPORAA.js → chunk-L2XGVLO7.js} +1 -1
  117. package/dist/{chunk-2QYQDCJE.js → chunk-LMOPRRQY.js} +10 -10
  118. package/dist/{chunk-3XLDWJDG.js → chunk-MBXTOYMX.js} +6 -6
  119. package/dist/{chunk-BJGD2ZWK.js → chunk-MQADQ4YF.js} +1 -1
  120. package/dist/{chunk-SGVIMTN6.js → chunk-MRBC7GLE.js} +17 -17
  121. package/dist/{chunk-CGY5RNAF.js → chunk-MVCNSGM4.js} +2 -2
  122. package/dist/chunk-N7GAQVSH.js +8 -0
  123. package/dist/{chunk-SLC3KT7F.js → chunk-N7KL336H.js} +6 -6
  124. package/dist/{chunk-HQIUFRWO.js → chunk-NDOW3VA6.js} +1 -1
  125. package/dist/{chunk-NADUURUA.js → chunk-NGVODCMV.js} +1 -1
  126. package/dist/chunk-NI76QOA2.js +2 -0
  127. package/dist/{chunk-GVYJYXVH.js → chunk-NZ67C5OK.js} +10 -10
  128. package/dist/{chunk-2RKTVTJJ.js → chunk-O3HXASSH.js} +1 -1
  129. package/dist/{chunk-HQNR4JQG.js → chunk-O43QLNPL.js} +1 -1
  130. package/dist/{chunk-Q6BY4BME.js → chunk-OAYHU7YN.js} +1 -1
  131. package/dist/{chunk-QMLG5XKP.js → chunk-OHSJWKNV.js} +5 -5
  132. package/dist/chunk-PTMPGFUQ.js +8 -0
  133. package/dist/{chunk-SS7BG7BS.js → chunk-PXCARPLZ.js} +1 -1
  134. package/dist/{chunk-73FD77RD.js → chunk-Q2S76TZH.js} +1 -1
  135. package/dist/{chunk-KIYO4U4T.js → chunk-Q6YPDR7U.js} +12 -12
  136. package/dist/{chunk-AG3ALTVD.js → chunk-Q75PSCZ5.js} +10 -10
  137. package/dist/{chunk-6EAVTBKE.js → chunk-QKHTL3FQ.js} +4 -4
  138. package/dist/{chunk-LJVLMM3Q.js → chunk-QSPW43OC.js} +7 -7
  139. package/dist/{chunk-ZXI4CWTI.js → chunk-R6L6PKQP.js} +1 -1
  140. package/dist/chunk-R7XAMDBY.js +2 -0
  141. package/dist/{chunk-Z3ZIVVKE.js → chunk-RC5SGXXR.js} +1 -1
  142. package/dist/{chunk-LAHK4WVH.js → chunk-RHYMHVFS.js} +8 -8
  143. package/dist/{chunk-MWGVFDEV.js → chunk-RQ5RVKRO.js} +2 -2
  144. package/dist/{chunk-2YZ3ITNG.js → chunk-RV6N2Y52.js} +2 -2
  145. package/dist/{chunk-JBMGI5YX.js → chunk-RZT7QES5.js} +4 -4
  146. package/dist/{chunk-S2PKTGHB.js → chunk-SIQSD3QT.js} +6 -6
  147. package/dist/chunk-TCB2J3PS.js +9 -0
  148. package/dist/{chunk-JLDGZFNY.js → chunk-TKBP5HRY.js} +12 -12
  149. package/dist/chunk-TMTTEBZV.js +19 -0
  150. package/dist/{chunk-RPY7FBYY.js → chunk-U62AWCZR.js} +1 -1
  151. package/dist/{chunk-EFUQ4KAH.js → chunk-UELYZT4T.js} +1 -1
  152. package/dist/{chunk-HKTU536H.js → chunk-UEMGH6EO.js} +1 -1
  153. package/dist/{chunk-FJ72DO6A.js → chunk-UEUCGC6G.js} +1 -1
  154. package/dist/{chunk-HMA4ZSCS.js → chunk-VO3HT6IK.js} +1 -1
  155. package/dist/{chunk-UB6TIA2R.js → chunk-VO3KDIDR.js} +1 -1
  156. package/dist/{chunk-5N6VSOZV.js → chunk-VWVFKMU7.js} +1 -1
  157. package/dist/{chunk-PEEVPAIJ.js → chunk-VXWCX65A.js} +1 -1
  158. package/dist/chunk-VYKITRFG.js +12 -0
  159. package/dist/{chunk-56CQPUIJ.js → chunk-WGSIYW63.js} +14 -14
  160. package/dist/chunk-WL3AJ2UB.js +8 -0
  161. package/dist/chunk-WMO2JQNL.js +8 -0
  162. package/dist/{chunk-WVSLFX37.js → chunk-XBXEK6XP.js} +7 -7
  163. package/dist/{chunk-V7NVQ3Z7.js → chunk-XSFQR374.js} +1 -1
  164. package/dist/{chunk-QAR4NYW6.js → chunk-XUK35DKG.js} +1 -1
  165. package/dist/{chunk-USE4HNZ2.js → chunk-XXBGWT7L.js} +1 -1
  166. package/dist/{chunk-I74FRKHQ.js → chunk-Y65MPP3M.js} +1 -1
  167. package/dist/{chunk-4NB3WHWK.js → chunk-YUIWG2QT.js} +1 -1
  168. package/dist/{chunk-6MN2JR25.js → chunk-YXS67QZO.js} +8 -8
  169. package/dist/{chunk-4S724CEA.js → chunk-YZCRHDOB.js} +1 -1
  170. package/dist/{chunk-W4YNYZDQ.js → chunk-Z4BJRPAF.js} +2 -2
  171. package/dist/{chunk-V5GDA4I6.js → chunk-Z6V3EY6F.js} +3 -3
  172. package/dist/{chunk-UJULZQM2.js → chunk-ZDJNTOUS.js} +1 -1
  173. package/dist/{chunk-ZVY4J3PU.js → chunk-ZLHF5XRR.js} +7 -7
  174. package/dist/{chunk-MPN267PR.js → chunk-ZNZDV6SN.js} +1 -1
  175. package/dist/data/DataTable.js +1 -1
  176. package/dist/data/Kanban.js +1 -1
  177. package/dist/data/ListFooter.js +1 -1
  178. package/dist/data/ListLoadError.js +1 -1
  179. package/dist/data/Pagination.js +1 -1
  180. package/dist/file-intake/index.js +1 -1
  181. package/dist/forms/BorderInput.js +1 -1
  182. package/dist/forms/BrandAssetEditor.js +1 -1
  183. package/dist/forms/Calendar.js +1 -1
  184. package/dist/forms/ColorPicker.js +1 -1
  185. package/dist/forms/ComposerAttachments.js +1 -1
  186. package/dist/forms/CornersInput.js +1 -1
  187. package/dist/forms/DatePicker.js +1 -1
  188. package/dist/forms/DateRangePicker.js +1 -1
  189. package/dist/forms/DateTimePicker.js +1 -1
  190. package/dist/forms/DisplayChips.js +1 -1
  191. package/dist/forms/FilePicker.js +1 -1
  192. package/dist/forms/FormErrorSummary.js +1 -1
  193. package/dist/forms/IconPicker.js +1 -1
  194. package/dist/forms/ImageFocusPoint.js +1 -1
  195. package/dist/forms/InputNumber.js +1 -1
  196. package/dist/forms/LinkPicker.js +1 -1
  197. package/dist/forms/MediaUploadField.js +1 -1
  198. package/dist/forms/MediaUploadGrid.js +1 -1
  199. package/dist/forms/MediaUsedInList.js +1 -1
  200. package/dist/forms/NumericKeypad.js +1 -1
  201. package/dist/forms/PositionInput.js +1 -1
  202. package/dist/forms/Select.js +1 -1
  203. package/dist/forms/SidesInput.js +1 -1
  204. package/dist/forms/Slider.js +1 -1
  205. package/dist/forms/Snippet.js +1 -1
  206. package/dist/forms/TagInput.js +1 -1
  207. package/dist/forms/TextToolbar.js +1 -1
  208. package/dist/forms/TimePicker.js +1 -1
  209. package/dist/forms/WidthsBar.js +1 -1
  210. package/dist/forms/mediaMoveItems.js +1 -1
  211. package/dist/forms/useFileIntake.js +1 -1
  212. package/dist/index.d.ts +16 -1
  213. package/dist/index.js +695 -695
  214. package/dist/locales/zh-Hans.js +1 -1
  215. package/dist/map/index.js +2 -2
  216. package/dist/page-tabs/index.js +4 -4
  217. package/dist/pdf/index.js +1 -1
  218. package/dist/shell/Accordion.js +1 -1
  219. package/dist/shell/AppUpdateBanner.js +1 -1
  220. package/dist/shell/Avatar.js +1 -1
  221. package/dist/shell/Banner.js +1 -1
  222. package/dist/shell/Breadcrumbs.js +1 -1
  223. package/dist/shell/BudgetBar.js +1 -1
  224. package/dist/shell/Card.js +1 -1
  225. package/dist/shell/ColoredBadge.js +1 -1
  226. package/dist/shell/ConfirmDialog.js +1 -1
  227. package/dist/shell/ContainerFillChart.js +1 -1
  228. package/dist/shell/CountBadge.js +1 -1
  229. package/dist/shell/Dialog.js +1 -1
  230. package/dist/shell/Drawer.js +1 -1
  231. package/dist/shell/EditableGrid.js +1 -1
  232. package/dist/shell/EmptyState.js +1 -1
  233. package/dist/shell/GlobalSearch.js +1 -1
  234. package/dist/shell/HelpCenter.js +1 -1
  235. package/dist/shell/IconRail.js +1 -1
  236. package/dist/shell/ImageLightbox.js +1 -1
  237. package/dist/shell/LanguageSelect.js +1 -1
  238. package/dist/shell/Markdown.js +1 -1
  239. package/dist/shell/MetricBar.js +1 -1
  240. package/dist/shell/MetricBarLegend.js +1 -1
  241. package/dist/shell/MilestoneTimeline.js +1 -1
  242. package/dist/shell/PageHeader.js +1 -1
  243. package/dist/shell/ProductionTimeline.js +1 -1
  244. package/dist/shell/ResizeHandle.js +1 -1
  245. package/dist/shell/Result.js +1 -1
  246. package/dist/shell/SearchableSelect.js +1 -1
  247. package/dist/shell/SettingReset.js +1 -1
  248. package/dist/shell/SettingRow.js +1 -1
  249. package/dist/shell/SidebarLayout.js +1 -1
  250. package/dist/shell/SidebarNav.js +1 -1
  251. package/dist/shell/SortableList.js +1 -1
  252. package/dist/shell/Statistic.js +1 -1
  253. package/dist/shell/TimeAgo.js +1 -1
  254. package/dist/shell/TimelineTrack.js +1 -1
  255. package/dist/shell/TransferProgress.js +1 -1
  256. package/dist/shell/Tree.js +1 -1
  257. package/dist/shell/language.js +1 -1
  258. package/dist/shell/strings.d.ts +3 -0
  259. package/dist/shell/strings.js +1 -1
  260. package/dist/shell/toast.js +1 -1
  261. package/dist/telemetry/index.js +1 -1
  262. package/dist/templates/AuthScreen.js +1 -1
  263. package/dist/templates/ChatTemplate.js +1 -1
  264. package/dist/templates/CheckoutTemplate.js +1 -1
  265. package/dist/templates/DashboardTemplate.js +1 -1
  266. package/dist/templates/DataTablePage.js +1 -1
  267. package/dist/templates/EmailTemplate.js +1 -1
  268. package/dist/templates/ErrorBoundary.js +1 -1
  269. package/dist/templates/ErrorPage.js +1 -1
  270. package/dist/templates/FormLayoutPage.js +1 -1
  271. package/dist/templates/GalleryTemplate.js +1 -1
  272. package/dist/ui/index.js +1 -1
  273. package/dist/version.js +1 -1
  274. package/package.json +1 -1
  275. package/dist/Calculator-YTIRFXXR.js +0 -29
  276. package/dist/Sidebar-YCSGGCLW.js +0 -43
  277. package/dist/chunk-7GCBMTP2.js +0 -4
  278. package/dist/chunk-B6BE4WSP.js +0 -8
  279. package/dist/chunk-BE4APEUI.js +0 -2
  280. package/dist/chunk-CKDFXYYY.js +0 -8
  281. package/dist/chunk-EUFALBK3.js +0 -1
  282. package/dist/chunk-FNQJO3HZ.js +0 -11
  283. package/dist/chunk-FTQ5DH5U.js +0 -8
  284. package/dist/chunk-GTRUBA2R.js +0 -1
  285. package/dist/chunk-GVKFLNRP.js +0 -12
  286. package/dist/chunk-MNQ6EPAR.js +0 -9
  287. package/dist/chunk-QSVKEONU.js +0 -2
  288. package/dist/chunk-QYGBWH5J.js +0 -15
  289. package/dist/chunk-VKLVHULL.js +0 -22
  290. package/dist/chunk-WEJFTUS7.js +0 -9
  291. package/dist/chunk-YULJ7F6Z.js +0 -19
  292. package/dist/chunk-ZGCLFQS5.js +0 -8
  293. package/dist/chunk-ZWQRFYE6.js +0 -11
@@ -0,0 +1 @@
1
+ var r="8.19.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -0,0 +1,15 @@
1
+ import{AccessibleTable as e}from"./chunk-X3II54HU.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-KKZZAK76.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),A=C??W.nothingToCompare,R=p(),[U,L]=u(null),{highlighted:T}=a(),Z=x;if(k.length<3||0===Z.length)/* @__PURE__ */
2
+ return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:A});const z=y/2,B=y/2,E=y/2-46,H=n(k.length),I=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...Z.map(e=>e.values[t]??0).filter(Number.isFinite))),K=(e,t)=>{const r=Math.max(0,Math.min(1,t/I[e])),l=H.center(e)-H.step/2;return[z+E*r*Math.cos(l),B+E*r*Math.sin(l)]},O=(e,t)=>null!==U?U!==e:null!==T&&T!==t,Y=null!==U?Z[U]:void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${$??""}`,children:[
4
+ /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":R,onMouseLeave:()=>L(null),children:[
5
+ /* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(Z.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=E*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:z,cy:B,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(z,B,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=K(t,I[t]);/* @__PURE__ */
6
+ return f("g",{children:[
7
+ /* @__PURE__ */d("line",{x1:z,y1:B,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
+ /* @__PURE__ */d("text",{x:z+(E+18)*Math.cos(H.center(t)-H.step/2),y:B+(E+18)*Math.sin(H.center(t)-H.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
+ /* @__PURE__ */d(r,{id:R,reveal:!!j&&"center-out"}),Z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>K(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:O(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),Y&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Y.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(U,3,Y.color,Y.tone),value:w(Y.values[t]??0)}))})}),
12
+ /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:Z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
+ /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
+ /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
+ /* @__PURE__ */d(e,{caption:W.acrossMeasures(Z.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:Z.map(e=>[e.label,...k.map((t,r)=>w(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -1,3 +1,3 @@
1
- import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-5SULG7D5.js";import{OneLineLabel as i}from"./chunk-7T3COEQK.js";import{Icon as r}from"./chunk-42BBJJDP.js";import{useShellStrings as s}from"./chunk-GTRUBA2R.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
1
+ import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-5SULG7D5.js";import{OneLineLabel as i}from"./chunk-7T3COEQK.js";import{Icon as r}from"./chunk-42BBJJDP.js";import{useShellStrings as s}from"./chunk-KKZZAK76.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
2
2
  return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
3
3
  /* @__PURE__ */n(i,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(r,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
@@ -1,2 +1,2 @@
1
- import{EmptyValue as r}from"./chunk-64WSMLXG.js";import{toInstant as e,timeAgo as t}from"./chunk-X2S2XDZI.js";import{formatDateTime as o}from"./chunk-5OTS2G3M.js";import{useShellLocale as c}from"./chunk-GTRUBA2R.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
1
+ import{EmptyValue as r}from"./chunk-64WSMLXG.js";import{toInstant as e,timeAgo as t}from"./chunk-X2S2XDZI.js";import{formatDateTime as o}from"./chunk-5OTS2G3M.js";import{useShellLocale as c}from"./chunk-KKZZAK76.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
2
2
  return i("time",{dateTime:u,title:o(u,{locale:s??a}),className:l,children:t(p,{precise:n,locale:s??a})})}export{m as TimeAgo};
@@ -1,14 +1,14 @@
1
- import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-GTRUBA2R.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const N=o().charts,L=i(),S=y??(e=>h(e,L)),j=A??N.noStages,z=c(),[V,w]=m(null),{highlighted:B}=e(),C=s(null),F=l(C,560),R=$??F;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const U=b??a(0),W=p??54*x.length,Z=Math.max(...x.map(e=>e.value),1),E="bars"===v,H=E?Math.round(Math.min(132,Math.max(80,.24*R))):Math.round(Math.min(168,Math.max(104,.38*R))),T=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},O=e=>{const t=T(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},P=E?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=O(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,Y=R-H-P,G=Math.max(E?2:0,Math.min(M,Y)),I=e=>Math.max(G,Y*Math.max(0,e/Z)),J=e=>I(e)/2,Q=H+Y/2,X=e=>46+e/Math.max(1,x.length-1)*54,q=e=>`color-mix(in oklab, ${U} ${X(e).toFixed(0)}%, ${n.surface})`,D=e=>X(e)>=55?n.surface:n.label,K=(e,t)=>null!==V?V!==e:null!==B&&B!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
1
+ import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-P5BOTIJU.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-KKZZAK76.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const N=o().charts,L=i(),S=y??(e=>h(e,L)),j=A??N.noStages,z=c(),[Z,V]=m(null),{highlighted:w}=e(),C=s(null),F=l(C,560),W=$??F;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const B=b??a(0),E=p??54*x.length,H=Math.max(...x.map(e=>e.value),1),K="bars"===v,U=K?Math.round(Math.min(132,Math.max(80,.24*W))):Math.round(Math.min(168,Math.max(104,.38*W))),O=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},P=e=>{const t=O(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},R=K?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=P(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,T=W-U-R,Y=Math.max(K?2:0,Math.min(M,T)),I=e=>Math.max(Y,T*Math.max(0,e/H)),J=e=>I(e)/2,Q=U+T/2,X=e=>46+e/Math.max(1,x.length-1)*54,q=e=>`color-mix(in oklab, ${B} ${X(e).toFixed(0)}%, ${n.surface})`,D=e=>X(e)>=55?n.surface:n.label,G=(e,t)=>null!==Z?Z!==e:null!==w&&w!==t,_=null!==Z?x[Z]:void 0;/* @__PURE__ */
2
2
  return f("div",{className:`relative ${k??""}`,ref:C,children:[
3
- /* @__PURE__ */f("svg",{width:"100%",height:W,viewBox:`0 0 ${R} ${W}`,role:"img","aria-labelledby":z,onMouseLeave:()=>w(null),children:[
4
- /* @__PURE__ */d("title",{id:z,children:N.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*W/x.length+g/2,a=(t+1)*W/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(E){const u=H,h=u+I(e.value),{count:c,drop:m}=O(t);/* @__PURE__ */
5
- return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>w(t),children:[
3
+ /* @__PURE__ */f("svg",{width:"100%",height:E,viewBox:`0 0 ${W} ${E}`,role:"img","aria-labelledby":z,onMouseLeave:()=>V(null),children:[
4
+ /* @__PURE__ */d("title",{id:z,children:N.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*E/x.length+g/2,a=(t+1)*E/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(K){const u=U,h=u+I(e.value),{count:c,drop:m}=P(t);/* @__PURE__ */
5
+ return f("g",{opacity:G(t,e.key)?.45:1,onMouseEnter:()=>V(t),children:[
6
6
  /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:q(t)}),
7
- /* @__PURE__ */d("text",{x:H-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:D(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
7
+ /* @__PURE__ */d("text",{x:U-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:D(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
8
  /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
- /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=J(e.value),c="cone"===v?J(x[t+1]?.value??e.value):h,m=T(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
- return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>w(t),children:[
9
+ /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=J(e.value),c="cone"===v?J(x[t+1]?.value??e.value):h,m=O(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
+ return f("g",{opacity:G(t,e.key)?.45:1,onMouseEnter:()=>V(t),children:[
11
11
  /* @__PURE__ */d("path",{d:`M${Q-h},${l} L${Q+h},${l} L${Q+c},${a} L${Q-c},${a} Z`,fill:q(t)}),
12
- /* @__PURE__ */d("text",{x:H-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
- /* @__PURE__ */f("text",{x:H-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
- /* @__PURE__ */d("text",{x:s?Q:Q+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?D(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:N.count,color:q(V),value:S(_.value)},{key:"share",label:N.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...V>0&&x[V-1].value>0?[{key:"drop",label:N.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
12
+ /* @__PURE__ */d("text",{x:U-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
+ /* @__PURE__ */f("text",{x:U-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
+ /* @__PURE__ */d("text",{x:s?Q:Q+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?D(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:N.count,color:q(Z),value:S(_.value)},{key:"share",label:N.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...Z>0&&x[Z-1].value>0?[{key:"drop",label:N.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[Z-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
@@ -1,4 +1,4 @@
1
- import{Tooltip as r}from"./chunk-2LXTJXWC.js";import{useShellStrings as e}from"./chunk-GTRUBA2R.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
1
+ import{Tooltip as r}from"./chunk-2LXTJXWC.js";import{useShellStrings as e}from"./chunk-KKZZAK76.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
2
2
  /* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
3
3
  /* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
4
4
  /* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-42BBJJDP.js";import{useShellStrings as r}from"./chunk-GTRUBA2R.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-42BBJJDP.js";import{useShellStrings as r}from"./chunk-KKZZAK76.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
2
2
  return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
3
3
  return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
4
4
  return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
@@ -1,8 +1,8 @@
1
- import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-GTRUBA2R.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
2
- return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":B,className:W=""}){const D=n(null),J=d(),L=d(),U=d();if(r(o),i(D,o,j),t(o),c(()=>{if(o)return s(()=>(N||a(),!0),()=>D.current)},[o,N,a]),!o)return null;const z="bottom"===p,A=z?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
1
+ import{dialogA11y as e}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as r}from"./chunk-PKXQDCNR.js";import{useFocusTrap as i,useScrollLock as t}from"./chunk-CDAJKLGL.js";import{Icon as o}from"./chunk-42BBJJDP.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-KKZZAK76.js";import{useRef as n,useId as d,useEffect as c}from"react";import{jsxs as m,jsx as h}from"react/jsx-runtime";var f={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},u={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function b({onClose:e}){const r=a().dialog;/* @__PURE__ */
2
+ return h("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */h(o,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function p({open:o,onClose:a,side:p="right",size:x="md",title:g,description:y,footer:v,children:k,blocking:N=!1,initialFocus:j,"aria-label":w,"aria-labelledby":C,"aria-describedby":K,className:W=""}){const B=n(null),D=d(),J=d(),L=d();if(r(o),i(B,o,j),t(o),c(()=>{if(o)return s(()=>(N||a(),!0),()=>B.current)},[o,N,a]),!o)return null;const z="bottom"===p,A=z?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
3
3
  return m("div",{className:"fixed inset-0",style:{zIndex:l.overlay},role:"presentation",children:[
4
4
  /* @__PURE__ */h("div",{className:"fixed inset-0 bg-black/30",onClick:N?void 0:a,"aria-hidden":"true"}),
5
- /* @__PURE__ */m("div",{ref:D,...e({modal:!0,titleId:g?U:void 0,labelledBy:C,label:w}),"aria-describedby":B??(y?L:k?J:void 0),style:A,className:["fixed flex flex-col bg-white shadow-xl",z?"":`w-full max-w-full ${f[x]}`,u[p],z?"rounded-t-xl":"",W].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
5
+ /* @__PURE__ */m("div",{ref:B,...e({modal:!0,titleId:g?L:void 0,labelledBy:C,label:w}),"aria-describedby":K??(y?J:k?D:void 0),style:A,className:["fixed flex flex-col bg-white shadow-xl",z?"":`w-full max-w-full ${f[x]}`,u[p],z?"rounded-t-xl":"",W].filter(Boolean).join(" "),children:[g?/* @__PURE__ */m("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
6
6
  /* @__PURE__ */m("div",{className:"min-w-0",children:[
7
- /* @__PURE__ */h("h2",{id:U,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:L,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!N&&/* @__PURE__ */h(b,{onClose:a})]}):!N&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
8
- /* @__PURE__ */m("div",{id:J,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:L,className:("mb-3 text-sm text-gray-500 "+(N?"":"pr-8")).trim(),children:y}),k]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
7
+ /* @__PURE__ */h("h2",{id:L,className:"text-base font-semibold text-gray-900",children:g}),y&&/* @__PURE__ */h("p",{id:J,className:"mt-0.5 text-sm text-gray-500",children:y})]}),!N&&/* @__PURE__ */h(b,{onClose:a})]}):!N&&/* @__PURE__ */h("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */h(b,{onClose:a})}),
8
+ /* @__PURE__ */m("div",{id:D,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[y&&!g&&/* @__PURE__ */h("p",{id:J,className:("mb-3 text-sm text-gray-500 "+(N?"":"pr-8")).trim(),children:y}),k]}),v&&/* @__PURE__ */h("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:v})]})]})}export{p as Drawer};
@@ -1,2 +1,2 @@
1
1
  import{createContext as t,useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";var n={},o=new Proxy(n,{get:(t,e)=>n[e],has:(t,e)=>e in n,ownKeys:()=>Object.keys(n),getOwnPropertyDescriptor(t,e){if(e in n)return{configurable:!0,enumerable:!0,value:n[e]}}});function a(t){for(const t of Object.keys(n))delete n[t];Object.assign(n,t)}var u={},i=[],c={erp:[],system:[],virtual:[],footer:[]},s=t({hasAnyPerm:()=>!0});function d({value:t,children:e}){/* @__PURE__ */
2
- return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=40,h=240,f=6,p=49,w=6,y=200,g=420,b="react-os-shell:work-area-changed";function v(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function x(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function M({over:t,residual:e},r){return e<=1||t-e>=r-2}function P(t,e,r){let n=t;for(const o of r)M(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function k(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function V(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function j(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{f as RAIL_COLLAPSED_INSET,p as RAIL_COLLAPSED_W,g as RAIL_MAX_W,w as RAIL_MENU_GAP,y as RAIL_MIN_W,h as RAIL_W,d as ShellAuthProvider,l as TAB_STRIP_H,b as WORK_AREA_CHANGED_EVENT,x as boxFillsWorkArea,v as computeMaximizedBox,k as growBoxToWidth,V as isSidebarStripReserved,o as navIcons,i as navSections,j as readAlwaysMaximizedFlag,M as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,P as widthToFit};
2
+ return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=42,h=240,f=6,p=49,w=6,y=200,g=420,b="react-os-shell:work-area-changed";function v(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function x(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function M({over:t,residual:e},r){return e<=1||t-e>=r-2}function P(t,e,r){let n=t;for(const o of r)M(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function k(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function V(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function j(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{f as RAIL_COLLAPSED_INSET,p as RAIL_COLLAPSED_W,g as RAIL_MAX_W,w as RAIL_MENU_GAP,y as RAIL_MIN_W,h as RAIL_W,d as ShellAuthProvider,l as TAB_STRIP_H,b as WORK_AREA_CHANGED_EVENT,x as boxFillsWorkArea,v as computeMaximizedBox,k as growBoxToWidth,V as isSidebarStripReserved,o as navIcons,i as navSections,j as readAlwaysMaximizedFlag,M as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,P as widthToFit};
@@ -1,4 +1,4 @@
1
- import{useShellLocale as e}from"./chunk-GTRUBA2R.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
1
+ import{useShellLocale as e}from"./chunk-KKZZAK76.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
2
2
  /* @__PURE__ */
3
3
  return l("span",{className:`relative inline-flex shrink-0 ${u}`.trim(),style:{width:h,height:h},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[y?/* @__PURE__ */a("img",{src:e,alt:"",onError:()=>g(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */a("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*h)},children:m(t)}),c&&/* @__PURE__ */a("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${o[c]}`,style:{width:f,height:f}})]})}function u({children:r,max:n,size:o="md",className:m=""}){const c=i.toArray(r),u=n?c.slice(0,n):c,h=n?c.length-u.length:0,f=s[o],d=Math.round(.3*f),g=e();/* @__PURE__ */
4
4
  return l("div",{className:`flex items-center ${m}`.trim(),children:[u.map((e,t)=>/* @__PURE__ */a("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-d},children:e},t)),h>0&&/* @__PURE__ */l("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:f,height:f,marginLeft:-d,fontSize:Math.round(.36*f)},children:["+",t(h,g)]})]})}export{c as Avatar,u as AvatarGroup};
@@ -0,0 +1,11 @@
1
+ import{ZoomableImage as e}from"./chunk-U5KIRPLV.js";import{isVideoUrl as t,mediaFileName as r}from"./chunk-KB6BGPQK.js";import{dialogA11y as n}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as a}from"./chunk-UDD7GB4F.js";import{buttonClasses as s}from"./chunk-K7U4RWXJ.js";import{Icon as c}from"./chunk-42BBJJDP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-KKZZAK76.js";import{useRef as f,useState as p,useCallback as x,useEffect as b}from"react";import{createPortal as g}from"react-dom";import{jsx as k,jsxs as w,Fragment as v}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function N(e){return e.kind?e.kind:t(e.url)?"video":y.test(e.url)?"file":"image"}var j="max-w-[calc(100vw-144px)] max-h-[calc(100vh-128px)]",C="flex items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",K=e=>e.stopPropagation();function D({images:t,startIndex:y=0,onClose:D,onIndexChange:L,onOpenFile:A}){const J=h().lightbox,U=d(),$=f(null),z=f(null),[B,I]=p(y),P=t.length,R=U&&P>0,W=x(e=>{if(P<2)return;const t=((B+e)%P+P)%P;I(t),L?.(t)},[B,P,L]);if(o(R),l($,R,z),i(R),b(()=>{if(R)return u(()=>(D(),!0),()=>$.current)},[R,D]),b(()=>{if(!R)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),W("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[R,W]),!R)return null;const F=t[Math.min(B,P-1)],G=N(F),Q=F.caption||r(F.url);let V;return V="video"===G?/* @__PURE__ */k("video",{src:F.url,controls:!0,playsInline:!0,"aria-label":Q,onClick:K,className:`${j} rounded-lg bg-black`}):"file"===G?/* @__PURE__ */w("div",{onClick:K,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-white px-10 py-8 text-center text-gray-500",children:[
2
+ /* @__PURE__ */k(c,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
3
+ /* @__PURE__ */k("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:Q}),A?/* @__PURE__ */k(a,{size:"sm",onClick:()=>A(F),children:J.openFile}):/* @__PURE__ */k("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:J.openFile})]}):/* @__PURE__ */k(e,{src:F.url,alt:Q,className:`${j} object-contain`,frameClassName:"rounded-lg"}),g(
4
+ /* @__PURE__ */w("div",{ref:$,...n({role:"dialog",modal:!0,label:J.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:D,children:[V,
5
+ /* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:K,children:[
6
+ /* @__PURE__ */k("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:J.counter(B+1,P)}),
7
+ /* @__PURE__ */k("button",{ref:z,type:"button",onClick:D,"aria-label":J.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */k(c,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),P>1&&/* @__PURE__ */w(v,{children:[
8
+ /* @__PURE__ */k("button",{type:"button",onClick:e=>{K(e),W(-1)},"aria-label":J.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */k(c,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
+ /* @__PURE__ */k("button",{type:"button",onClick:e=>{K(e),W(1)},"aria-label":J.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */k(c,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
10
+ /* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:K,children:[
11
+ /* @__PURE__ */k("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:Q}),"file"!==G&&/* @__PURE__ */k("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-white/70 underline decoration-white/30 underline-offset-2 hover:text-white",children:J.openOriginal})]})]}),document.body)}export{D as ImageLightbox,N as lightboxKind};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a}from"./chunk-EO2XHSIK.js";import{Icon as e}from"./chunk-42BBJJDP.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
1
+ import{InputNumber_default as a}from"./chunk-IH4SVMXJ.js";import{Icon as e}from"./chunk-42BBJJDP.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var n="h-3.5 w-3.5",l={x:/* @__PURE__ */i(e,{name:"nudge-x","aria-hidden":"true",className:n}),y:/* @__PURE__ */i(e,{name:"nudge-y","aria-hidden":"true",className:n})};function s({label:e,value:n,onChange:s,words:m,placeholder:o,min:d=-200,max:c=200,step:t=1,readOnly:p}){const u=e=>/* @__PURE__ */i("div",{"data-axis":e,className:"min-w-0",children:/* @__PURE__ */i(a,{value:n[e],onChange:a=>s({...n,[e]:a}),min:d,max:c,step:t,precision:0,steppers:"compact",readOnly:p,placeholder:o[e],prefix:l[e],suffix:m.unit,"aria-label":m[e]})});/* @__PURE__ */
2
2
  return r("div",{role:"group","aria-label":e,className:"grid min-w-0 grid-cols-2 gap-2",children:[u("x"),u("y")]})}export{s as PositionInput};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-BVDGHZ4H.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
1
+ import{requestFilesTrashView as n}from"./chunk-4MTC6HA5.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-HIDOSOI4.js";import{useShellStrings as t}from"./chunk-GTRUBA2R.js";import{forwardRef as r,useRef as n,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 h=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],u=[{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),y=r(function({src:r,filename:y,onApply:m,onCancel:g},N){const L=n(null),z=n(null),D=n(null),I=n(null),P=t().annotator,$=n(P);$.current=P;const[E,S]=o("select"),[W,B]=o(h[0]),[R,j]=o(4),[H,T]=o(24),[F,U]=o(u[0].id),[A,O]=o(!0),[K,V]=o(!1),[Z,G]=o(!1),[X,q]=o(null),[Y,_]=o(null),[J,Q]=o(6),[ee,te]=o(12),[re,ne]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,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(()=>re.find(e=>e.id===oe)??null,[re,oe]);a(()=>{"select"===E&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(T(Me.size),U(Me.font),O(Me.bold),V(Me.italic),G(Me.underline),q(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{I.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),ne([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=r},[r]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>r&&(i=r,a=i/o),a>n&&(a=n,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(()=>re.filter(e=>"mosaic"===e.type),[re]);a(()=>{const e=I.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of Ne)C(r,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Le=e=>{we.current=e,be(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ce(e);if("draw"===t.kind)pe(b(E,t.start,r,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ne(r=>r.map(r=>r.id===t.id?v(t.original,e,n):r))}else"resize"===t.kind&&ne(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,c=i,s=o,d=a;"nw"===t&&(l=r.x,c=r.y);"ne"===t&&(s=r.x,c=r.y);"se"===t&&(s=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:c},{x:s,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=we.current;if(we.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 r={...e,id:p()};return ne(e=>[...e,r]),ie(r.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};ne(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[fe,E,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),ne(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),ne(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:K,underline:Z}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&G(t),oe&&ne(r=>r.map(r=>r.id===oe&&"text"===r.type?{...r,[e]:t}:r))},De=e=>{q(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ie=e=>{_(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Pe=e=>{if(!ye)return;const t=e??ye.value;if(!t.trim())return ye.editingId&&ne(e=>e.filter(e=>e.id!==ye.editingId)),void xe(null);if(ye.editingId)ne(e=>e.map(e=>e.id===ye.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:ye.x,y:ye.y,text:t,color:W,size:H,font:F,bold:A,italic:K,underline:Z,borderColor:X,background:Y,padding:J};ne(t=>[...t,e]),ie(e.id),S("select")}xe(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const n=r.getContext("2d");n.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}),n.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),r};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=y.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"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,y]);const Ee=i(()=>[{id:"select",label:P.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:P.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:P.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:P.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:P.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:P.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:P.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:P.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[P]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-white":"text-gray-700 hover:bg-gray-200"),We=Me?.type??("select"===E?null:E),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-F22KWATP.js";import{useShellStrings as t}from"./chunk-KKZZAK76.js";import{forwardRef as r,useRef as n,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 h=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],u=[{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),y=r(function({src:r,filename:y,onApply:m,onCancel:g},N){const L=n(null),z=n(null),D=n(null),P=n(null),$=t().annotator,E=n($);E.current=$;const[I,W]=o("select"),[S,B]=o(h[0]),[R,j]=o(4),[F,H]=o(24),[T,A]=o(u[0].id),[U,K]=o(!0),[O,Z]=o(!1),[V,X]=o(!1),[q,G]=o(null),[Y,_]=o(null),[J,Q]=o(6),[ee,te]=o(12),[re,ne]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,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(()=>re.find(e=>e.id===oe)??null,[re,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(H(Me.size),A(Me.font),K(Me.bold),Z(Me.italic),X(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}),ne([]),ie(null)},t.onerror=()=>e.error(E.current.loadFailed),t.src=r},[r]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>r&&(i=r,a=i/o),a>n&&(a=n,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(()=>re.filter(e=>"mosaic"===e.type),[re]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of Ne)C(r,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Le=e=>{we.current=e,be(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ce(e);if("draw"===t.kind)pe(b(I,t.start,r,S,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),pe({id:"",type:"draw",points:t.points.slice(),color:S,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ne(r=>r.map(r=>r.id===t.id?v(t.original,e,n):r))}else"resize"===t.kind&&ne(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,c=i,s=o,d=a;"nw"===t&&(l=r.x,c=r.y);"ne"===t&&(s=r.x,c=r.y);"se"===t&&(s=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:c},{x:s,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=we.current;if(we.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 r={...e,id:p()};return ne(e=>[...e,r]),ie(r.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};ne(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)}},[fe,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(),ne(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),ne(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:O,underline:V}[e];"bold"===e&&K(t),"italic"===e&&Z(t),"underline"===e&&X(t),oe&&ne(r=>r.map(r=>r.id===oe&&"text"===r.type?{...r,[e]:t}:r))},De=e=>{G(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{_(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},$e=e=>{if(!ye)return;const t=e??ye.value;if(!t.trim())return ye.editingId&&ne(e=>e.filter(e=>e.id!==ye.editingId)),void xe(null);if(ye.editingId)ne(e=>e.map(e=>e.id===ye.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:ye.x,y:ye.y,text:t,color:S,size:F,font:T,bold:U,italic:O,underline:V,borderColor:q,background:Y,padding:J};ne(t=>[...t,e]),ie(e.id),W("select")}xe(null)},Ee=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const n=r.getContext("2d");n.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}),n.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),r};l(N,()=>({save:async()=>{const t=await Ee();t&&t.toBlob(t=>{if(!t)return void e.error(E.current.exportFailed);const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=y.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"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,y]);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-white":"text-gray-700 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
- /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-white shrink-0 flex-wrap text-xs",children:[Ee.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(E===e.id),children:e.icon},e.id)),
3
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-white 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
- /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:h.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&ne(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(W===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
5
+ /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:h.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&ne(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:P.weight}),
8
+ /* @__PURE__ */c("span",{children:$.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&&ne(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:P.radius}),
13
+ /* @__PURE__ */c("span",{children:$.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&&ne(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:F,onChange:e=>{return t=e.target.value,U(t),void(oe&&ne(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:u.map(e=>/* @__PURE__ */c("option",{value:e.id,children:P[e.name]},e.id))}),
18
- /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),title:P.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:P.boldLetter})}),
19
- /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(K),title:P.italic,children:/* @__PURE__ */c("span",{className:"italic",children:P.italicLetter})}),
20
- /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:P.underline,children:/* @__PURE__ */c("span",{className:"underline",children:P.underlineLetter})}),
17
+ /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,A(t),void(oe&&ne(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:u.map(e=>/* @__PURE__ */c("option",{value:e.id,children:$[e.name]},e.id))}),
18
+ /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(U),title:$.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:$.boldLetter})}),
19
+ /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(O),title:$.italic,children:/* @__PURE__ */c("span",{className:"italic",children:$.italicLetter})}),
20
+ /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(V),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.underlineLetter})}),
21
21
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
- /* @__PURE__ */c("span",{children:P.size}),
23
- /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),T(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
- /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
22
+ /* @__PURE__ */c("span",{children:$.size}),
23
+ /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:F,onChange:e=>{return t=Number(e.target.value),H(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
+ /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:F})]}),
25
25
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
- /* @__PURE__ */c("span",{children:P.border}),X?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:P.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
- /* @__PURE__ */c("button",{onClick:()=>De(null),title:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:P.addBorder,className:"px-2 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:P.add})]}),
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-gray-300 text-gray-600 hover:bg-gray-100",children:$.add})]}),
29
29
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
- /* @__PURE__ */c("span",{children:P.fill}),Y?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:Y,onChange:e=>Ie(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
- /* @__PURE__ */c("button",{onClick:()=>Ie(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Ie("#ffffff"),title:P.addFill,className:"px-2 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:P.add})]}),
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-gray-300 text-gray-600 hover:bg-gray-100",children:$.add})]}),
33
33
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
- /* @__PURE__ */c("span",{children:P.padding}),
34
+ /* @__PURE__ */c("span",{children:$.padding}),
35
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&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
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:()=>he(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomOut,children:"−"}),
38
+ /* @__PURE__ */c("button",{onClick:()=>he(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:"−"}),
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:()=>he(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomIn,children:"+"}),
41
- /* @__PURE__ */c("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
40
+ /* @__PURE__ */c("button",{onClick:()=>he(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:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.fit}),
42
42
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
- /* @__PURE__ */c("button",{onClick:()=>{ne(e=>e.slice(0,-1)),ie(null)},disabled:0===re.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:P.undo}),
43
+ /* @__PURE__ */c("button",{onClick:()=>{ne(e=>e.slice(0,-1)),ie(null)},disabled:0===re.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:$.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||!I.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const o=n.getContext("2d");o.drawImage(I.current,0,0);for(const e of Ne)C(o,e);r.drawImage(n,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{I.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),ne(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=k(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:P.applyCrop}),
46
- /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:P.cancel}),
47
- /* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:P.apply})]})]})]}),
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 r=t.getContext("2d"),n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const o=n.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);r.drawImage(n,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}),ne(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=k(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(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})]})]})]}),
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"===E?"default":"text"===E?"text":"crosshair"},onPointerDown:e=>{if("select"===E)return void ie(null);if("text"===E){if(ye)return void Pe();const t=Ce(e);return void xe({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==E){if("draw"===E)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(E,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[re.map(e=>/* @__PURE__ */c(x,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===E&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&xe({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:r,start:Ce(e),original:t})})(t,e,r)},e.id)),ue&&/* @__PURE__ */c(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */c(f,{pendingText:ye,color:W,size:H,font:u.find(e=>e.id===F)?.css??u[0].css,bold:A,italic:K,underline:Z,borderColor:X,background:Y,padding:J,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:Pe,onCancel:()=>xe(null)})]})}),
51
- /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-gray-200 bg-white text-2xs text-gray-500 shrink-0",children:"select"===E?oe?P.hintSelected:P.hintSelect:"text"===E?P.hintText:"crop"===E?P.hintCrop:"draw"===E?P.hintDraw:P.hintShape})]})});function x({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),h=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__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",...h});else if("circle"===e.type)y=/* @__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,...h});else if("arrow"===e.type)y=/* @__PURE__ */c(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...h});else if("mosaic"===e.type)y=/* @__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,...h});else{const t=u.find(t=>t.id===e.font)?.css??u[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */s("g",{...h,...p,children:[n&&/* @__PURE__ */c("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),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(ye)return void $e();const t=Ce(e);return void xe({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:[re.map(e=>/* @__PURE__ */c(x,{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&&xe({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:r,start:Ce(e),original:t})})(t,e,r)},e.id)),ue&&/* @__PURE__ */c(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */c(f,{pendingText:ye,color:S,size:F,font:u.find(e=>e.id===T)?.css??u[0].css,bold:U,italic:O,underline:V,borderColor:q,background:Y,padding:J,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:$e,onCancel:()=>xe(null)})]})}),
51
+ /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-gray-200 bg-white text-2xs text-gray-500 shrink-0",children:"select"===I?oe?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.hintShape})]})});function x({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),h=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__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",...h});else if("circle"===e.type)y=/* @__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,...h});else if("arrow"===e.type)y=/* @__PURE__ */c(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...h});else if("mosaic"===e.type)y=/* @__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,...h});else{const t=u.find(t=>t.id===e.font)?.css??u[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */s("g",{...h,...p,children:[n&&/* @__PURE__ */c("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),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,r)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
53
53
  return s("g",{children:[y,t&&!r&&/* @__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/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:n,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:r}){const n=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-GTRUBA2R.js";import{formatPlain as l}from"./chunk-C3QOHMR6.js";import{jsxs as s,jsx as o}from"react/jsx-runtime";var d={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function i({label:i,value:m,unit:c,delta:h,deltaTone:p,trend:u,trendTone:g,footnote:x,className:f}){const y=r().charts,w=n(),N=null==h?null:h>0?"up":h<0?"down":"flat",b=p?t[p]:void 0,k=g?t[g]:a(0);/* @__PURE__ */
1
+ import{Sparkline as e}from"./chunk-CKCDGSTC.js";import{STATUS_VARS as t,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as n}from"./chunk-KKZZAK76.js";import{formatPlain as l}from"./chunk-C3QOHMR6.js";import{jsxs as s,jsx as o}from"react/jsx-runtime";var d={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function i({label:i,value:m,unit:c,delta:h,deltaTone:p,trend:u,trendTone:g,footnote:x,className:f}){const y=r().charts,w=n(),N=null==h?null:h>0?"up":h<0?"down":"flat",b=p?t[p]:void 0,k=g?t[g]:a(0);/* @__PURE__ */
2
2
  return s("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${f??""}`,children:[
3
3
  /* @__PURE__ */o("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i}),
4
4
  /* @__PURE__ */s("span",{className:"flex items-baseline gap-2",children:[
@@ -1,5 +1,5 @@
1
- import{InputNumber_default as e}from"./chunk-EO2XHSIK.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-E4Z5OXBI.js";import{useShellStrings as n}from"./chunk-GTRUBA2R.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
- return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:N,suffix:j,showInput:K=!0,emptyLabel:L,placeholderValue:A,stepFrom:E,label:M,"aria-labelledby":R,valueText:C,id:B,disabled:D,size:I="md",className:O="",auto:T}){const U=n(),V=o(),W=t(),X=T??W,q=o(),G=B??V,H=$??h(z),P=k??c,Z=N??S,J=void 0!==L||void 0!==A,Q=E??A,Y=p(r??A??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(j);w(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,K]);const ne=e=>C?C(e):"string"==typeof j?`${e.toFixed(H)} ${j}`:void 0,re=null==r?L??(null!=A?ne(A)??String(A):void 0):ne(r),le=`calc(${b([c.toFixed(H),S.toFixed(H),r?.toFixed(H),L,A?.toFixed(H)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,K?le:null)},[de,oe,le,K]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
3
- return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${O}`.trim(),children:[
4
- /* @__PURE__ */m("input",{id:G,type:"range",min:c,max:S,step:z,value:Y,disabled:D,"aria-label":R?void 0:M,"aria-labelledby":R,"aria-valuetext":re,"aria-describedby":X?q:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=F;if(!i&&!(null==r&&null!=Q))return;e.preventDefault();a(y((r??Q??Y)+t*(i?F??z:z),c,S,H))},onChange:e=>a(y(Number(e.target.value),c,S,H)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===I?"h-1":"h-1.5"}`}),K&&
5
- /* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<P||e>Z||a(e):J&&a(null)},min:P,max:Z,step:z,shiftStep:F,stepFrom:Q,precision:H,snap:!0,allowEmpty:J,suffix:j,disabled:D,placeholder:L??(null!=A?A.toFixed(H):void 0),size:se?void 0:"sm",auto:X,"aria-label":M?U.slider.value(M):void 0,"aria-labelledby":M?void 0:R})}),X&&/* @__PURE__ */m("span",{id:q,hidden:!0,children:U.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
1
+ import{InputNumber_default as e}from"./chunk-IH4SVMXJ.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-E4Z5OXBI.js";import{useShellStrings as n}from"./chunk-KKZZAK76.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
2
+ return m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:K,suffix:N,showInput:j=!0,emptyLabel:L,placeholderValue:M,stepFrom:A,label:C,"aria-labelledby":E,valueText:D,id:I,disabled:R,size:V="md",className:Z="",auto:B}){const O=n(),W=o(),X=t(),q=B??X,H=o(),J=I??W,P=$??h(z),T=k??c,U=K??S,G=void 0!==L||void 0!==M,Q=A??M,Y=p(r??M??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(N);w(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,j]);const ne=e=>D?D(e):"string"==typeof N?`${e.toFixed(P)} ${N}`:void 0,re=null==r?L??(null!=M?ne(M)??String(M):void 0):ne(r),le=`calc(${b([c.toFixed(P),S.toFixed(P),r?.toFixed(P),L,M?.toFixed(P)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,j?le:null)},[de,oe,le,j]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
3
+ return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${Z}`.trim(),children:[
4
+ /* @__PURE__ */m("input",{id:J,type:"range",min:c,max:S,step:z,value:Y,disabled:R,"aria-label":E?void 0:C,"aria-labelledby":E,"aria-valuetext":re,"aria-describedby":q?H:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=F;if(!i&&!(null==r&&null!=Q))return;e.preventDefault();a(y((r??Q??Y)+t*(i?F??z:z),c,S,P))},onChange:e=>a(y(Number(e.target.value),c,S,P)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===V?"h-1":"h-1.5"}`}),j&&
5
+ /* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<T||e>U||a(e):G&&a(null)},min:T,max:U,step:z,shiftStep:F,stepFrom:Q,precision:P,snap:!0,allowEmpty:G,suffix:N,disabled:R,placeholder:L??(null!=M?M.toFixed(P):void 0),size:se?void 0:"sm",auto:q,"aria-label":C?O.slider.value(C):void 0,"aria-labelledby":C?void 0:E})}),q&&/* @__PURE__ */m("span",{id:H,hidden:!0,children:O.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
@@ -1,4 +1,4 @@
1
- import{Breadcrumbs as e}from"./chunk-DBBUHXRT.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-4TER5BHR.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
2
2
  return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
3
3
  /* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
4
4
  /* @__PURE__ */t("div",{children:[
@@ -1,14 +1,14 @@
1
- import{CountBadge as e}from"./chunk-A3MOA3T7.js";import{SettingAutoContext as t,InSettingRowContext as a}from"./chunk-E4Z5OXBI.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{useShellStrings as n}from"./chunk-GTRUBA2R.js";import{jsx as s,jsxs as r}from"react/jsx-runtime";var l={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function d({label:d,icon:c,action:m,value:o,readout:p,description:h,children:x,controlId:u,unknownText:g="—",quiet:f=!1,size:v="default",viewState:y,divider:N=!0,showWhen:w,values:b,context:$,className:j=""}){const k=n();if(!i(w,b,$))return null;const P=l[v],T=void 0!==o||void 0===x&&null==m,A=null==o||""===o,B=f?"text-gray-500":"text-gray-800",O=A?"text-gray-400":f?"text-gray-500":"text-gray-900",I=null!=p&&!1!==p,R=`${P.text} font-medium ${B}${"compact"===v?" whitespace-nowrap":""}`,V=u?/* @__PURE__ */s("label",{htmlFor:u,className:R,children:d}):/* @__PURE__ */s("span",{className:R,children:d}),W="auto"===y?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-gray-200 px-1 text-2xs font-normal leading-4 text-gray-500",children:k.settingView.auto}):"edited"===y?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-7RD623PT.js";import{SettingAutoContext as t,InSettingRowContext as a}from"./chunk-E4Z5OXBI.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{useShellStrings as n}from"./chunk-KKZZAK76.js";import{jsx as s,jsxs as r}from"react/jsx-runtime";var l={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function d({label:d,icon:c,action:m,value:o,readout:p,description:h,children:x,controlId:u,unknownText:g="—",quiet:f=!1,size:v="default",viewState:y,divider:N=!0,showWhen:w,values:b,context:$,className:j=""}){const k=n();if(!i(w,b,$))return null;const P=l[v],T=void 0!==o||void 0===x&&null==m,K=null==o||""===o,Z=f?"text-gray-500":"text-gray-800",A=K?"text-gray-400":f?"text-gray-500":"text-gray-900",B=null!=p&&!1!==p,I=`${P.text} font-medium ${Z}${"compact"===v?" whitespace-nowrap":""}`,O=u?/* @__PURE__ */s("label",{htmlFor:u,className:I,children:d}):/* @__PURE__ */s("span",{className:I,children:d}),V="auto"===y?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-gray-200 px-1 text-2xs font-normal leading-4 text-gray-500",children:k.settingView.auto}):"edited"===y?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */s("span",{className:"sr-only",children:k.settingView.edited})]}):null,q=/* @__PURE__ */s(t.Provider,{value:"auto"===y,children:A?g:o}),z=[N?"border-t border-gray-100 first:border-t-0":"",P.pad,j].filter(Boolean).join(" "),C=null!=x&&!1!==x&&/* @__PURE__ */s("div",{className:`${P.bodyTop} border-t border-gray-100 ${P.bodyPad}`,children:x});/* @__PURE__ */
4
- return r("div",I?{className:z,"data-setting-row":"compact"===v?v:void 0,children:[
3
+ /* @__PURE__ */s("span",{className:"sr-only",children:k.settingView.edited})]}):null,W=/* @__PURE__ */s(t.Provider,{value:"auto"===y,children:K?g:o}),q=[N?"border-t border-gray-100 first:border-t-0":"",P.pad,j].filter(Boolean).join(" "),z=null!=x&&!1!==x&&/* @__PURE__ */s("div",{className:`${P.bodyTop} border-t border-gray-100 ${P.bodyPad}`,children:x});/* @__PURE__ */
4
+ return r("div",B?{className:q,"data-setting-row":"compact"===v?v:void 0,children:[
5
5
  /* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
6
- /* @__PURE__ */s("div",{"data-setting-name":"compact"===v?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${B}`,children:[null!=c&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),V,W]})}),
6
+ /* @__PURE__ */s("div",{"data-setting-name":"compact"===v?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${Z}`,children:[null!=c&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),O,V]})}),
7
7
  /* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
8
- /* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${P.text} ${f?"text-gray-500":"text-gray-900"}`,children:p}),("compact"===v||null!=m)&&/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]})]}),h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h}),void 0!==o&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${P.text} ${O}`,children:/* @__PURE__ */s(a.Provider,{value:"compact"===v,children:q})}),C]}:{className:z,"data-setting-row":"compact"===v?v:void 0,children:[
8
+ /* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${P.text} ${f?"text-gray-500":"text-gray-900"}`,children:p}),("compact"===v||null!=m)&&/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]})]}),h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h}),void 0!==o&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${P.text} ${A}`,children:/* @__PURE__ */s(a.Provider,{value:"compact"===v,children:W})}),z]}:{className:q,"data-setting-row":"compact"===v?v:void 0,children:[
9
9
  /* @__PURE__ */r("div",{className:"compact"===v?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${P.gap}`,children:[
10
10
  /* @__PURE__ */r("div",{"data-setting-name":"compact"===v?"":void 0,className:"compact"===v?"flex-1 basis-0":"min-w-0 flex-1",children:[null!=c?
11
- /* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${B}`,children:[
12
- /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),V,W]}):W?/* @__PURE__ */r("div",{className:"flex min-w-0 items-center gap-2",children:[V,W]}):V,h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h})]}),"compact"===v?
13
- /* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`flex items-center justify-end ${P.text} ${O}`,children:/* @__PURE__ */s(a.Provider,{value:!0,children:q})}),
14
- /* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]}):null!=m?/* @__PURE__ */r("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{className:`${P.text} ${O}`,children:q}),m]}):T&&/* @__PURE__ */s("div",{className:`shrink-0 ${P.text} ${O}`,children:q})]}),C]})}export{d as SettingRow};
11
+ /* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${Z}`,children:[
12
+ /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:c}),O,V]}):V?/* @__PURE__ */r("div",{className:"flex min-w-0 items-center gap-2",children:[O,V]}):O,h&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-gray-500",children:h})]}),"compact"===v?
13
+ /* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`flex items-center justify-end ${P.text} ${A}`,children:/* @__PURE__ */s(a.Provider,{value:!0,children:W})}),
14
+ /* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:m})]}):null!=m?/* @__PURE__ */r("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[T&&/* @__PURE__ */s("div",{className:`${P.text} ${A}`,children:W}),m]}):T&&/* @__PURE__ */s("div",{className:`shrink-0 ${P.text} ${A}`,children:W})]}),z]})}export{d as SettingRow};
@@ -1 +1 @@
1
- import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-GTRUBA2R.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
1
+ import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-KKZZAK76.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
@@ -1,6 +1,6 @@
1
- import{IconButton_default as e}from"./chunk-HMZLRXLA.js";import{Icon as l}from"./chunk-42BBJJDP.js";import{Tooltip as a}from"./chunk-2LXTJXWC.js";import{useShellStrings as r}from"./chunk-GTRUBA2R.js";import{jsx as n,jsxs as o,Fragment as s}from"react/jsx-runtime";var i=e=>e.preventDefault(),t=e=>null!=e&&!1!==e,d=["bold","italic","underline","strike","link","sup","sub","code"],c=["left","center","right","justify"];function u(e,l,a){const r={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===r||0===l.length)return;const n=[...e.currentTarget.querySelectorAll('[role="radio"]')],o=n.findIndex(l=>l===e.target||l.contains(e.target));if(o<0)return;e.preventDefault();const s=n.length,i="first"===r?0:"last"===r?s-1:(o+r+s)%s;n[i].disabled||(a(l[i]),n[i].focus())}function h(e,l){const a=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:a,link:a+(l?1:0)}}function p({offered:e,color:l,last:a,alignment:r,list:n,letterCase:o}){const s=d.filter(l=>e.has(l)).length+(l?1:0)+(t(a)?1:0),i=(r?c.filter(e=>r.allow.includes(e)).length:0)+(n&&e.has("bullet")?1:0)+(n&&e.has("number")?1:0)+(e.has("quote")?1:0)+(o?3:0);return{words:s>0,paragraph:i>0,oneRow:s>0&&i>0&&s+1+i<=9,flow:s>0&&i>0&&s+1+i>9&&s<=7,cells:{words:s,paragraph:i}}}function b(e,l){/* @__PURE__ */
2
- return n(a,{content:e,children:l},l.key??void 0)}function m({offered:a,pressed:d,onMark:m,color:g,linkOpen:w=!1,last:f,alignment:k,list:v,letterCase:N,disabled:C=!1,"aria-label":y,windows:D,className:M="",layout:x="grid"}){const j=r().textToolbar,L=p({offered:a,color:g,last:f,alignment:k,list:v,letterCase:N});if(!L.words&&!L.paragraph)return null;const R=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,A=(l,r,o,s)=>a.has(l)?b(r,/* @__PURE__ */n(e,"link"===l?{pressed:w,className:R(w),"aria-label":r,"aria-haspopup":"dialog","aria-expanded":w,"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o}:{className:R(Boolean(d[l])),"aria-label":r,"aria-pressed":Boolean(d[l]),"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o},l)):null,B=[["left",j.alignLeft,/* @__PURE__ */n(l,{name:"align-left"})],["center",j.alignCenter,/* @__PURE__ */n(l,{name:"align-center"})],["right",j.alignRight,/* @__PURE__ */n(l,{name:"align-right"})],["justify",j.alignJustify,/* @__PURE__ */n(l,{name:"align-justify"})]],q=k?c.filter(e=>k.allow.includes(e)):[],T=k&&q.includes(k.value)?k.value:q[0],$=[["none",j.caseNone,/* @__PURE__ */n(l,{name:"case-normal"})],["upper",j.caseUpper,/* @__PURE__ */n(l,{name:"case-upper"})],["lower",j.caseLower,/* @__PURE__ */n(l,{name:"case-lower"})]],I=/* @__PURE__ */o(s,{children:[A("bold",j.bold,/* @__PURE__ */n(l,{name:"bold"}),"Meta+B"),A("italic",j.italic,/* @__PURE__ */n(l,{name:"italic"}),"Meta+I"),A("underline",j.underline,/* @__PURE__ */n(l,{name:"underline"}),"Meta+U"),A("strike",j.strike,/* @__PURE__ */n(l,{name:"strike"})),g?b(j.color,/* @__PURE__ */n(e,{pressed:g.open,className:R(g.open,"rosh-tb-color"),"aria-label":j.color,"aria-haspopup":"dialog","aria-expanded":g.open,disabled:C,style:g.run?{"--rosh-tb-run":g.run}:void 0,onMouseDown:i,onClick:g.onToggle,children:/* @__PURE__ */n(l,{name:"text-color"})},"color")):null,A("link",j.link,/* @__PURE__ */n(l,{name:"link"}),"Meta+K"),A("sup",j.sup,/* @__PURE__ */n(l,{name:"superscript"})),A("sub",j.sub,/* @__PURE__ */n(l,{name:"subscript"})),A("code",j.code,/* @__PURE__ */n(l,{name:"code"})),t(f)?f:null]}),J=/* @__PURE__ */o(s,{children:[k&&q.length>0?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.alignment,onKeyDown:e=>u(e,q,e=>k.onChange(e)),children:B.map(([l,a,r])=>k.allow.includes(l)?b(a,/* @__PURE__ */n(e,{role:"radio",pressed:k.value===l,className:R(k.value===l),"aria-checked":k.value===l,"aria-label":a,tabIndex:l===T?0:-1,disabled:C||k.disabled,onMouseDown:i,onClick:()=>k.onChange(l),children:r},l)):null)}):null,v&&a.has("bullet")?b(j.bullet,/* @__PURE__ */n(e,{className:R("bullet"===v.pressed),"aria-label":j.bullet,"aria-pressed":"bullet"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("bullet"),children:/* @__PURE__ */n(l,{name:"list"})},"bullet")):null,v&&a.has("number")?b(j.number,/* @__PURE__ */n(e,{className:R("number"===v.pressed),"aria-label":j.number,"aria-pressed":"number"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("number"),children:/* @__PURE__ */n(l,{name:"numbered-list"})},"number")):null,A("quote",j.quote,/* @__PURE__ */n(l,{name:"quote"})),N?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.letterCase,onKeyDown:e=>u(e,$.map(([e])=>e),e=>N.onChange(e)),children:$.map(([l,a,r])=>b(a,/* @__PURE__ */n(e,{role:"radio",pressed:N.value===l,className:R(N.value===l),"aria-checked":N.value===l,"aria-label":a,tabIndex:l===(N.value||"none")?0:-1,disabled:C||N.disabled,onMouseDown:i,onClick:()=>N.onChange(N.value===l?"":l),children:r},l)))}):null]}),S="row"===x,U=S?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===f?" is-eight":"",K=h(a,Boolean(g)),X={"--rosh-tb-color-col":String(K.color),"--rosh-tb-link-col":String(K.link),...S?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let H;return H=S?/* @__PURE__ */o("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-para",children:J}):null]}):L.flow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-flow",children:[I,
1
+ import{IconButton_default as e}from"./chunk-HMZLRXLA.js";import{Icon as l}from"./chunk-42BBJJDP.js";import{Tooltip as a}from"./chunk-2LXTJXWC.js";import{useShellStrings as r}from"./chunk-KKZZAK76.js";import{jsx as n,jsxs as o,Fragment as s}from"react/jsx-runtime";var i=e=>e.preventDefault(),t=e=>null!=e&&!1!==e,d=["bold","italic","underline","strike","link","sup","sub","code"],c=["left","center","right","justify"];function u(e,l,a){const r={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===r||0===l.length)return;const n=[...e.currentTarget.querySelectorAll('[role="radio"]')],o=n.findIndex(l=>l===e.target||l.contains(e.target));if(o<0)return;e.preventDefault();const s=n.length,i="first"===r?0:"last"===r?s-1:(o+r+s)%s;n[i].disabled||(a(l[i]),n[i].focus())}function h(e,l){const a=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:a,link:a+(l?1:0)}}function p({offered:e,color:l,last:a,alignment:r,list:n,letterCase:o}){const s=d.filter(l=>e.has(l)).length+(l?1:0)+(t(a)?1:0),i=(r?c.filter(e=>r.allow.includes(e)).length:0)+(n&&e.has("bullet")?1:0)+(n&&e.has("number")?1:0)+(e.has("quote")?1:0)+(o?3:0);return{words:s>0,paragraph:i>0,oneRow:s>0&&i>0&&s+1+i<=9,flow:s>0&&i>0&&s+1+i>9&&s<=7,cells:{words:s,paragraph:i}}}function b(e,l){/* @__PURE__ */
2
+ return n(a,{content:e,children:l},l.key??void 0)}function m({offered:a,pressed:d,onMark:m,color:g,linkOpen:w=!1,last:f,alignment:k,list:v,letterCase:N,disabled:C=!1,"aria-label":y,windows:D,className:M="",layout:x="grid"}){const j=r().textToolbar,L=p({offered:a,color:g,last:f,alignment:k,list:v,letterCase:N});if(!L.words&&!L.paragraph)return null;const A=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(l,r,o,s)=>a.has(l)?b(r,/* @__PURE__ */n(e,"link"===l?{pressed:w,className:A(w),"aria-label":r,"aria-haspopup":"dialog","aria-expanded":w,"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o}:{className:A(Boolean(d[l])),"aria-label":r,"aria-pressed":Boolean(d[l]),"aria-keyshortcuts":s,disabled:C,onMouseDown:i,onClick:()=>m(l),children:o},l)):null,K=[["left",j.alignLeft,/* @__PURE__ */n(l,{name:"align-left"})],["center",j.alignCenter,/* @__PURE__ */n(l,{name:"align-center"})],["right",j.alignRight,/* @__PURE__ */n(l,{name:"align-right"})],["justify",j.alignJustify,/* @__PURE__ */n(l,{name:"align-justify"})]],R=k?c.filter(e=>k.allow.includes(e)):[],q=k&&R.includes(k.value)?k.value:R[0],$=[["none",j.caseNone,/* @__PURE__ */n(l,{name:"case-normal"})],["upper",j.caseUpper,/* @__PURE__ */n(l,{name:"case-upper"})],["lower",j.caseLower,/* @__PURE__ */n(l,{name:"case-lower"})]],I=/* @__PURE__ */o(s,{children:[B("bold",j.bold,/* @__PURE__ */n(l,{name:"bold"}),"Meta+B"),B("italic",j.italic,/* @__PURE__ */n(l,{name:"italic"}),"Meta+I"),B("underline",j.underline,/* @__PURE__ */n(l,{name:"underline"}),"Meta+U"),B("strike",j.strike,/* @__PURE__ */n(l,{name:"strike"})),g?b(j.color,/* @__PURE__ */n(e,{pressed:g.open,className:A(g.open,"rosh-tb-color"),"aria-label":j.color,"aria-haspopup":"dialog","aria-expanded":g.open,disabled:C,style:g.run?{"--rosh-tb-run":g.run}:void 0,onMouseDown:i,onClick:g.onToggle,children:/* @__PURE__ */n(l,{name:"text-color"})},"color")):null,B("link",j.link,/* @__PURE__ */n(l,{name:"link"}),"Meta+K"),B("sup",j.sup,/* @__PURE__ */n(l,{name:"superscript"})),B("sub",j.sub,/* @__PURE__ */n(l,{name:"subscript"})),B("code",j.code,/* @__PURE__ */n(l,{name:"code"})),t(f)?f:null]}),J=/* @__PURE__ */o(s,{children:[k&&R.length>0?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.alignment,onKeyDown:e=>u(e,R,e=>k.onChange(e)),children:K.map(([l,a,r])=>k.allow.includes(l)?b(a,/* @__PURE__ */n(e,{role:"radio",pressed:k.value===l,className:A(k.value===l),"aria-checked":k.value===l,"aria-label":a,tabIndex:l===q?0:-1,disabled:C||k.disabled,onMouseDown:i,onClick:()=>k.onChange(l),children:r},l)):null)}):null,v&&a.has("bullet")?b(j.bullet,/* @__PURE__ */n(e,{className:A("bullet"===v.pressed),"aria-label":j.bullet,"aria-pressed":"bullet"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("bullet"),children:/* @__PURE__ */n(l,{name:"list"})},"bullet")):null,v&&a.has("number")?b(j.number,/* @__PURE__ */n(e,{className:A("number"===v.pressed),"aria-label":j.number,"aria-pressed":"number"===v.pressed,disabled:C,onMouseDown:i,onClick:()=>v.onList("number"),children:/* @__PURE__ */n(l,{name:"numbered-list"})},"number")):null,B("quote",j.quote,/* @__PURE__ */n(l,{name:"quote"})),N?/* @__PURE__ */n("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":j.letterCase,onKeyDown:e=>u(e,$.map(([e])=>e),e=>N.onChange(e)),children:$.map(([l,a,r])=>b(a,/* @__PURE__ */n(e,{role:"radio",pressed:N.value===l,className:A(N.value===l),"aria-checked":N.value===l,"aria-label":a,tabIndex:l===(N.value||"none")?0:-1,disabled:C||N.disabled,onMouseDown:i,onClick:()=>N.onChange(N.value===l?"":l),children:r},l)))}):null]}),S="row"===x,T=S?" is-row":L.flow?" is-flow":L.oneRow?" is-one-row":L.words&&void 0===f?" is-eight":"",U=h(a,Boolean(g)),X={"--rosh-tb-color-col":String(U.color),"--rosh-tb-link-col":String(U.link),...S?{"--rosh-tb-cells":String(L.cells.words+L.cells.paragraph),"--rosh-tb-groupgap":L.words&&L.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Z;return Z=S?/* @__PURE__ */o("div",{className:"rosh-tb-row is-row",children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-para",children:J}):null]}):L.flow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-flow",children:[I,
3
3
  /* @__PURE__ */n("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),J]}):L.oneRow?/* @__PURE__ */o("div",{className:"rosh-tb-row is-one-row",children:[
4
4
  /* @__PURE__ */n("div",{className:"rosh-tb-words",children:I}),
5
- /* @__PURE__ */n("div",{className:"rosh-tb-para",children:J})]}):/* @__PURE__ */o(s,{children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-row"+(void 0===f?" is-eight":""),children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-row",children:J}):null]}),/* @__PURE__ */o("div",{className:`rosh-tb-wrap${U} ${M}`.trim(),style:X,children:[
6
- /* @__PURE__ */n("div",{className:"rosh-tb",role:"toolbar","aria-label":y??j.formatting,children:H}),D]})}export{m as TextToolbar,p as textToolbarRows,h as textToolbarWindowColumns};
5
+ /* @__PURE__ */n("div",{className:"rosh-tb-para",children:J})]}):/* @__PURE__ */o(s,{children:[L.words?/* @__PURE__ */n("div",{className:"rosh-tb-row"+(void 0===f?" is-eight":""),children:I}):null,L.paragraph?/* @__PURE__ */n("div",{className:"rosh-tb-row",children:J}):null]}),/* @__PURE__ */o("div",{className:`rosh-tb-wrap${T} ${M}`.trim(),style:X,children:[
6
+ /* @__PURE__ */n("div",{className:"rosh-tb",role:"toolbar","aria-label":y??j.formatting,children:Z}),D]})}export{m as TextToolbar,p as textToolbarRows,h as textToolbarWindowColumns};