efficient-shell 12.28.0 → 12.30.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 (326) hide show
  1. package/README.md +38 -0
  2. package/dist/{Browser-PC45PVTN.js → Browser-FQHXHI3R.js} +16 -16
  3. package/dist/Calculator-XCRU5K4O.js +29 -0
  4. package/dist/{CurrencyConverter-BB4QWNER.js → CurrencyConverter-EHIQIFJK.js} +9 -9
  5. package/dist/Files-LTUUGPAM.js +141 -0
  6. package/dist/{Notepad-BLUA2254.js → Notepad-JPAXNEFR.js} +9 -9
  7. package/dist/PdfViewer-J55QKFNS.js +1 -0
  8. package/dist/{PomodoroTimer-KIJKDHVO.js → PomodoroTimer-IVDZBBUN.js} +8 -8
  9. package/dist/{Preview-JVL2N5GN.js → Preview-KRK4XT2B.js} +31 -31
  10. package/dist/Sidebar-FCXIPW5K.js +44 -0
  11. package/dist/{Stock-JQEJMIMG.js → Stock-OBS2LPX4.js} +7 -7
  12. package/dist/{Weather-FAQX55XL.js → Weather-I4TJBIEN.js} +18 -18
  13. package/dist/{WorldClock-YSZNGEL2.js → WorldClock-YU2ZPVSA.js} +6 -6
  14. package/dist/ai/index.js +134 -134
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ChartBrush.js +1 -1
  23. package/dist/charts/ChartFrame.js +1 -1
  24. package/dist/charts/ChartSkeleton.js +1 -1
  25. package/dist/charts/ChordChart.js +1 -1
  26. package/dist/charts/ColumnChart.js +1 -1
  27. package/dist/charts/FunnelChart.js +1 -1
  28. package/dist/charts/HeatmapChart.js +1 -1
  29. package/dist/charts/HistogramChart.js +1 -1
  30. package/dist/charts/Meter.js +1 -1
  31. package/dist/charts/PieChart.js +1 -1
  32. package/dist/charts/RadarChart.js +1 -1
  33. package/dist/charts/RadialBarChart.js +1 -1
  34. package/dist/charts/RangeChart.js +1 -1
  35. package/dist/charts/RankedBars.js +1 -1
  36. package/dist/charts/SankeyChart.js +1 -1
  37. package/dist/charts/ScatterChart.js +1 -1
  38. package/dist/charts/SpecChart.js +1 -1
  39. package/dist/charts/StatTile.js +1 -1
  40. package/dist/charts/SunburstChart.js +1 -1
  41. package/dist/charts/TimeSeriesChart.js +1 -1
  42. package/dist/charts/TreemapChart.js +1 -1
  43. package/dist/charts/WaterfallChart.js +1 -1
  44. package/dist/{chunk-W2663E4S.js → chunk-23CZSU3H.js} +3 -3
  45. package/dist/{chunk-47UH3D4B.js → chunk-2DCATU5B.js} +1 -1
  46. package/dist/{chunk-RF3ZFTAU.js → chunk-2IEKMFVL.js} +1 -1
  47. package/dist/{chunk-TDXRG43I.js → chunk-2N6WWL7Y.js} +1 -1
  48. package/dist/{chunk-O4YKOS74.js → chunk-36MM4YRK.js} +9 -9
  49. package/dist/{chunk-HLE4LTRU.js → chunk-37EYKPR6.js} +1 -1
  50. package/dist/{chunk-RVVQDBV7.js → chunk-3B3QIHF7.js} +5 -5
  51. package/dist/{chunk-BKYRHQK2.js → chunk-3HLV6BEC.js} +12 -12
  52. package/dist/{chunk-BT2YPDQL.js → chunk-3N4XJS43.js} +3 -3
  53. package/dist/{chunk-232YPI2L.js → chunk-3R2TMLKH.js} +5 -5
  54. package/dist/{chunk-CON5NRCO.js → chunk-3ZC53F4T.js} +3 -3
  55. package/dist/{chunk-ZGCCV4WE.js → chunk-42GNFUAP.js} +10 -10
  56. package/dist/{chunk-OMFYTCBI.js → chunk-4FUQK2LK.js} +1 -1
  57. package/dist/{chunk-WKYNPGFB.js → chunk-4MCI7UHQ.js} +5 -5
  58. package/dist/chunk-4SEPQN2N.js +12 -0
  59. package/dist/{chunk-GEVNBBM7.js → chunk-4WW3SNL6.js} +1 -1
  60. package/dist/chunk-4YCWO2GZ.js +14 -0
  61. package/dist/{chunk-XSVQ5V7L.js → chunk-5O5QMMMG.js} +9 -9
  62. package/dist/{chunk-EATV7FMU.js → chunk-5RLJAXDR.js} +8 -8
  63. package/dist/{chunk-3YBXA72C.js → chunk-5X3Z45SL.js} +1 -1
  64. package/dist/{chunk-UEFIUTOU.js → chunk-5XYRFK7D.js} +1 -1
  65. package/dist/{chunk-6KOMF6WL.js → chunk-5ZS3VOJH.js} +1 -1
  66. package/dist/{chunk-YWNHK6Z5.js → chunk-64ZDYUE7.js} +15 -15
  67. package/dist/{chunk-WX2Q76WC.js → chunk-67JLD6AU.js} +6 -6
  68. package/dist/{chunk-OM6VWUAZ.js → chunk-6EETON2U.js} +1 -1
  69. package/dist/{chunk-4PIQG2ZK.js → chunk-6EXWWPAW.js} +1 -1
  70. package/dist/{chunk-ATZ262BR.js → chunk-6UB6YY3H.js} +1 -1
  71. package/dist/{chunk-ZGWXSHVM.js → chunk-77BK2IAJ.js} +1 -1
  72. package/dist/{chunk-Y4FWTYZS.js → chunk-7DTWIWFO.js} +6 -6
  73. package/dist/chunk-7IGWU6DK.js +8 -0
  74. package/dist/{chunk-XAEI36TW.js → chunk-AIGLJYQ5.js} +1 -1
  75. package/dist/chunk-AJVL6LXI.js +22 -0
  76. package/dist/{chunk-2OUAPOLK.js → chunk-ANGNTN36.js} +1 -1
  77. package/dist/{chunk-BC4FE77W.js → chunk-AYCWVVJ3.js} +50 -50
  78. package/dist/{chunk-7GJIIBJD.js → chunk-B27XRZ47.js} +1 -1
  79. package/dist/{chunk-EWVE5XG6.js → chunk-BEB3AGSY.js} +1 -1
  80. package/dist/{chunk-DIHHV6T6.js → chunk-CBBU74QT.js} +1 -1
  81. package/dist/chunk-CHV7U5UV.js +9 -0
  82. package/dist/{chunk-TGLUENXE.js → chunk-CIOPLPZW.js} +1 -1
  83. package/dist/{chunk-SS3CROPR.js → chunk-CVEVPB3O.js} +3 -3
  84. package/dist/chunk-CXXMSYA6.js +1 -0
  85. package/dist/{chunk-6Q7L32LL.js → chunk-DHRCI7KE.js} +1 -1
  86. package/dist/{chunk-HNEI2RKX.js → chunk-DOKA65JI.js} +1 -1
  87. package/dist/{chunk-XKNKRKHH.js → chunk-E7RMS776.js} +14 -14
  88. package/dist/chunk-EWSOX4WP.js +28 -0
  89. package/dist/{chunk-K5PDLRYH.js → chunk-FEWWCWKV.js} +9 -9
  90. package/dist/{chunk-SR4W2SYQ.js → chunk-FIXZT5TZ.js} +7 -7
  91. package/dist/{chunk-LAO6GLBY.js → chunk-FM34DWV7.js} +6 -6
  92. package/dist/{chunk-VP2GI3UP.js → chunk-FPYOZOUY.js} +8 -8
  93. package/dist/{chunk-VLKJN6HX.js → chunk-FSORYU5C.js} +12 -12
  94. package/dist/{chunk-MKNDDB6U.js → chunk-FYGPJPU7.js} +1 -1
  95. package/dist/{chunk-AFWLCXQD.js → chunk-GANZLRMW.js} +8 -8
  96. package/dist/{chunk-N5RV73CI.js → chunk-GBPGZFBS.js} +4 -4
  97. package/dist/chunk-GKX3C3JE.js +13 -0
  98. package/dist/{chunk-JLRF6FN7.js → chunk-GL4NELAT.js} +1 -1
  99. package/dist/{chunk-DGHSCKOE.js → chunk-GN3AHAVY.js} +4 -4
  100. package/dist/{chunk-7ZJRBFHA.js → chunk-HC3BZPWX.js} +1 -1
  101. package/dist/{chunk-JSHMIMAJ.js → chunk-HCDG7EUR.js} +1 -1
  102. package/dist/{chunk-GUHCKMC7.js → chunk-HE2I6KWY.js} +2 -2
  103. package/dist/chunk-HJECGV6W.js +5 -0
  104. package/dist/{chunk-TYQ2JL4J.js → chunk-HOXXEF52.js} +1 -1
  105. package/dist/{chunk-34L5SRM7.js → chunk-HRNT4UDG.js} +18 -18
  106. package/dist/{chunk-WPG3ZHYT.js → chunk-HU24RSAE.js} +1 -1
  107. package/dist/{chunk-7TNZ3DTT.js → chunk-I6V4DMNR.js} +2 -2
  108. package/dist/{chunk-EEB5XPWP.js → chunk-IBPULOGJ.js} +2 -2
  109. package/dist/{chunk-RZ2DWX4N.js → chunk-ILSE5F5F.js} +5 -5
  110. package/dist/{chunk-KAKJ7ENS.js → chunk-IOIY54KO.js} +2 -2
  111. package/dist/{chunk-NUPK6CUV.js → chunk-IQTURGC4.js} +1 -1
  112. package/dist/{chunk-VBLCYL4L.js → chunk-JA5WM66L.js} +1 -1
  113. package/dist/{chunk-XAF5ZI7H.js → chunk-JGZEZHMP.js} +1 -1
  114. package/dist/{chunk-CBVKGAZH.js → chunk-JOANOIVK.js} +1 -1
  115. package/dist/{chunk-24Y5JHIR.js → chunk-JTRQ7HAS.js} +1 -1
  116. package/dist/{chunk-CEIIQRK5.js → chunk-K6LO6QI5.js} +6 -6
  117. package/dist/{chunk-VLBIM33E.js → chunk-KHFPF534.js} +6 -6
  118. package/dist/{chunk-WN3JHPJI.js → chunk-KKYNDLOC.js} +6 -6
  119. package/dist/{chunk-4IHYWLWE.js → chunk-KLG6RYYC.js} +5 -5
  120. package/dist/{chunk-7K3FYCRZ.js → chunk-KNNFNOX7.js} +9 -9
  121. package/dist/chunk-KPFP2I2S.js +8 -0
  122. package/dist/{chunk-JZBLOIL7.js → chunk-KPPKPGQI.js} +1 -1
  123. package/dist/{chunk-XHSMDUEW.js → chunk-LBLWN3SH.js} +3 -3
  124. package/dist/chunk-LHATGPIE.js +19 -0
  125. package/dist/{chunk-TKIYZE7V.js → chunk-LQD54ZL5.js} +1 -1
  126. package/dist/{chunk-MTYEY7HT.js → chunk-M2GF44WC.js} +12 -12
  127. package/dist/{chunk-56XCGOX5.js → chunk-MFZ4YMXE.js} +6 -6
  128. package/dist/{chunk-VFHKD7TQ.js → chunk-MHVWUYEN.js} +1 -1
  129. package/dist/{chunk-BFRGDRFK.js → chunk-MKPZIEQP.js} +22 -22
  130. package/dist/{chunk-LL4KF43W.js → chunk-MRVW6F5E.js} +1 -1
  131. package/dist/chunk-MUSNAMWH.js +1 -0
  132. package/dist/{chunk-VEQ45GAH.js → chunk-MVBDE4AX.js} +1 -1
  133. package/dist/{chunk-V3XS6BTJ.js → chunk-MYJ3HQYG.js} +12 -12
  134. package/dist/{chunk-JFGJJNT2.js → chunk-N2BWOHNM.js} +6 -6
  135. package/dist/{chunk-N2445WHJ.js → chunk-NJ6WZHXC.js} +5 -5
  136. package/dist/{chunk-OXRQIWRT.js → chunk-NLQLVXMJ.js} +1 -1
  137. package/dist/{chunk-HSUTZCRT.js → chunk-NSNM4QIV.js} +5 -5
  138. package/dist/{chunk-QB2GJNGB.js → chunk-O3SCB4QZ.js} +8 -8
  139. package/dist/{chunk-HVYXJLAV.js → chunk-OMSIXLK4.js} +1 -1
  140. package/dist/{chunk-74JMBOQH.js → chunk-P4NWDRHS.js} +26 -26
  141. package/dist/{chunk-X5MUSNKH.js → chunk-PAVOVX3D.js} +1 -1
  142. package/dist/{chunk-LIWBCIRZ.js → chunk-PBZ3UQMS.js} +4 -4
  143. package/dist/chunk-PRWA4AAC.js +11 -0
  144. package/dist/{chunk-MWTCGJAI.js → chunk-Q4BJW37U.js} +1 -1
  145. package/dist/{chunk-WNOXHJVT.js → chunk-QB7TIWHT.js} +5 -5
  146. package/dist/{chunk-YO26RV3H.js → chunk-QF4FYOVE.js} +1 -1
  147. package/dist/{chunk-DJXXY23A.js → chunk-QHWD3G7T.js} +2 -2
  148. package/dist/{chunk-WXZZGHET.js → chunk-QT34GMZR.js} +1 -1
  149. package/dist/{chunk-UH5ZGWSA.js → chunk-QV5A7NFQ.js} +8 -8
  150. package/dist/chunk-RJG67VRP.js +15 -0
  151. package/dist/{chunk-63IGYBCQ.js → chunk-RMUOUMV2.js} +2 -2
  152. package/dist/{chunk-3FBXJO77.js → chunk-RPXRMTOU.js} +1 -1
  153. package/dist/chunk-RVD6HJUJ.js +4 -0
  154. package/dist/{chunk-NN32QUCE.js → chunk-SAAXAAAH.js} +1 -1
  155. package/dist/chunk-TIYRBJSB.js +7 -0
  156. package/dist/{chunk-4BKJ6A5H.js → chunk-TJ5ZX5HP.js} +10 -10
  157. package/dist/chunk-TN3W72FC.js +8 -0
  158. package/dist/{chunk-2DYVVHZA.js → chunk-U22563X2.js} +1 -1
  159. package/dist/{chunk-QADNVFV5.js → chunk-U45APXV3.js} +1 -1
  160. package/dist/{chunk-OOWPLQD5.js → chunk-UEADX2GV.js} +2 -2
  161. package/dist/chunk-UK2D2CSB.js +14 -0
  162. package/dist/{chunk-Z66QBDNU.js → chunk-UOHHIEH4.js} +1 -1
  163. package/dist/{chunk-H2CPT6K3.js → chunk-UQNKFMJR.js} +12 -12
  164. package/dist/{chunk-SE6IQZYW.js → chunk-V64XY7L4.js} +9 -9
  165. package/dist/{chunk-75H4BWNC.js → chunk-VEF3STCH.js} +1 -1
  166. package/dist/chunk-VLI2ED22.js +7 -0
  167. package/dist/{chunk-V4XR4MOS.js → chunk-VREZFFRE.js} +1 -1
  168. package/dist/chunk-VY5NO4TS.js +2 -0
  169. package/dist/{chunk-CMJD5URC.js → chunk-WCJR2GNH.js} +18 -18
  170. package/dist/{chunk-Y7KDCC6E.js → chunk-WM37FXRK.js} +1 -1
  171. package/dist/{chunk-4LOHQ4QB.js → chunk-X27K2NCU.js} +5 -5
  172. package/dist/{chunk-ZBJ7FTA5.js → chunk-X5RFTIHV.js} +1 -1
  173. package/dist/chunk-XJTZU7UH.js +4 -0
  174. package/dist/{chunk-RBS3AWE7.js → chunk-XK3VYRLR.js} +1 -1
  175. package/dist/{chunk-FJVZ2W55.js → chunk-XMAOLCQV.js} +1 -1
  176. package/dist/{chunk-GC4N4UQM.js → chunk-XXRUDMD5.js} +5 -5
  177. package/dist/{chunk-AMIMNRYU.js → chunk-Y6H5C6A4.js} +1 -1
  178. package/dist/{chunk-YYGJJ6EI.js → chunk-YGKQMENL.js} +1 -1
  179. package/dist/{chunk-NOGSS432.js → chunk-YNE5YC6E.js} +1 -1
  180. package/dist/chunk-YS3CF7GL.js +2 -0
  181. package/dist/{chunk-IB3LLQZC.js → chunk-ZSVBEJ4G.js} +1 -1
  182. package/dist/data/DataTable.js +1 -1
  183. package/dist/data/EntityList.js +1 -1
  184. package/dist/data/Kanban.js +1 -1
  185. package/dist/data/ListFooter.js +1 -1
  186. package/dist/data/ListLoadError.js +1 -1
  187. package/dist/data/Pagination.js +1 -1
  188. package/dist/data/ResizableTable.js +1 -1
  189. package/dist/file-intake/index.js +1 -1
  190. package/dist/forms/BorderInput.js +1 -1
  191. package/dist/forms/BrandAssetEditor.js +1 -1
  192. package/dist/forms/Calendar.js +1 -1
  193. package/dist/forms/ColorPicker.js +1 -1
  194. package/dist/forms/ComposerAttachments.js +1 -1
  195. package/dist/forms/CornersInput.js +1 -1
  196. package/dist/forms/DatePicker.js +1 -1
  197. package/dist/forms/DateRangePicker.js +1 -1
  198. package/dist/forms/DateTimePicker.js +1 -1
  199. package/dist/forms/DisplayChips.js +1 -1
  200. package/dist/forms/FilePicker.js +1 -1
  201. package/dist/forms/FormErrorSummary.js +1 -1
  202. package/dist/forms/IconPicker.js +1 -1
  203. package/dist/forms/ImageFocusPoint.js +1 -1
  204. package/dist/forms/InputNumber.js +1 -1
  205. package/dist/forms/LinkPicker.js +1 -1
  206. package/dist/forms/MediaLibrary.js +1 -1
  207. package/dist/forms/MediaUploadField.js +1 -1
  208. package/dist/forms/MediaUploadGrid.js +1 -1
  209. package/dist/forms/MediaUsedInList.js +1 -1
  210. package/dist/forms/NumericKeypad.js +1 -1
  211. package/dist/forms/PositionInput.js +1 -1
  212. package/dist/forms/Select.js +1 -1
  213. package/dist/forms/SidesInput.d.ts +13 -2
  214. package/dist/forms/SidesInput.js +1 -1
  215. package/dist/forms/Slider.js +1 -1
  216. package/dist/forms/Snippet.js +1 -1
  217. package/dist/forms/TagInput.js +1 -1
  218. package/dist/forms/TextToolbar.js +1 -1
  219. package/dist/forms/TimePicker.js +1 -1
  220. package/dist/forms/WidthsBar.js +1 -1
  221. package/dist/forms/mediaLibraryMenu.js +1 -1
  222. package/dist/forms/mediaMoveItems.js +1 -1
  223. package/dist/forms/textAlign.js +1 -1
  224. package/dist/forms/useFileIntake.js +1 -1
  225. package/dist/hooks/useTheme.d.ts +1 -1
  226. package/dist/icons/efficient-glyphs.js +1 -1
  227. package/dist/icons/efficient-looks.js +1 -1
  228. package/dist/icons/efficient.js +1 -1
  229. package/dist/icons/looks/map.js +1 -1
  230. package/dist/icons/payment.js +1 -1
  231. package/dist/icons/sets.js +1 -1
  232. package/dist/index.d.ts +4 -4
  233. package/dist/index.js +132 -132
  234. package/dist/locales/zh-Hans.js +1 -1
  235. package/dist/map/index.js +4 -4
  236. package/dist/model-viewer/index.d.ts +123 -0
  237. package/dist/model-viewer/index.js +7 -0
  238. package/dist/page-tabs/index.js +5 -5
  239. package/dist/pdf/index.js +1 -1
  240. package/dist/shell/Accordion.js +1 -1
  241. package/dist/shell/AppUpdateBanner.js +1 -1
  242. package/dist/shell/Avatar.js +1 -1
  243. package/dist/shell/Banner.js +1 -1
  244. package/dist/shell/Breadcrumbs.js +1 -1
  245. package/dist/shell/BudgetBar.js +1 -1
  246. package/dist/shell/Card.js +1 -1
  247. package/dist/shell/ColoredBadge.js +1 -1
  248. package/dist/shell/ConfirmDialog.js +1 -1
  249. package/dist/shell/ContainerFillChart.js +1 -1
  250. package/dist/shell/CountBadge.js +1 -1
  251. package/dist/shell/Dialog.js +1 -1
  252. package/dist/shell/Drawer.js +1 -1
  253. package/dist/shell/EditableGrid.js +1 -1
  254. package/dist/shell/EmptyState.js +1 -1
  255. package/dist/shell/GlobalSearch.js +1 -1
  256. package/dist/shell/HelpCenter.js +1 -1
  257. package/dist/shell/IconRail.js +1 -1
  258. package/dist/shell/ImageLightbox.js +1 -1
  259. package/dist/shell/ItemCount.js +1 -1
  260. package/dist/shell/LanguageSelect.js +1 -1
  261. package/dist/shell/Markdown.js +1 -1
  262. package/dist/shell/MetricBar.js +1 -1
  263. package/dist/shell/MetricBarLegend.js +1 -1
  264. package/dist/shell/MilestoneTimeline.js +1 -1
  265. package/dist/shell/PageHeader.js +1 -1
  266. package/dist/shell/ProductionTimeline.js +1 -1
  267. package/dist/shell/ResizeHandle.js +1 -1
  268. package/dist/shell/Result.js +1 -1
  269. package/dist/shell/SearchableSelect.js +1 -1
  270. package/dist/shell/SettingReset.js +1 -1
  271. package/dist/shell/SettingRow.js +1 -1
  272. package/dist/shell/SidebarLayout.js +1 -1
  273. package/dist/shell/SidebarNav.js +1 -1
  274. package/dist/shell/SortableList.js +1 -1
  275. package/dist/shell/Statistic.js +1 -1
  276. package/dist/shell/TimeAgo.js +1 -1
  277. package/dist/shell/TimelineTrack.js +1 -1
  278. package/dist/shell/TransferProgress.js +1 -1
  279. package/dist/shell/Tree.js +1 -1
  280. package/dist/shell/discardGuard.js +1 -1
  281. package/dist/shell/language.js +1 -1
  282. package/dist/shell/strings.d.ts +10 -0
  283. package/dist/shell/strings.js +1 -1
  284. package/dist/shell/toast.js +1 -1
  285. package/dist/telemetry/index.js +1 -1
  286. package/dist/templates/AuthScreen.js +1 -1
  287. package/dist/templates/ChatTemplate.js +1 -1
  288. package/dist/templates/CheckoutTemplate.js +1 -1
  289. package/dist/templates/DashboardTemplate.js +1 -1
  290. package/dist/templates/DataTablePage.js +1 -1
  291. package/dist/templates/EmailTemplate.js +1 -1
  292. package/dist/templates/ErrorBoundary.d.ts +1 -1
  293. package/dist/templates/ErrorBoundary.js +1 -1
  294. package/dist/templates/ErrorPage.js +1 -1
  295. package/dist/templates/FormLayoutPage.js +1 -1
  296. package/dist/templates/GalleryTemplate.js +1 -1
  297. package/dist/ui/index.d.ts +1 -1
  298. package/dist/ui/index.js +1 -1
  299. package/dist/version.js +1 -1
  300. package/package.json +12 -1
  301. package/dist/Calculator-5TRNFPY4.js +0 -29
  302. package/dist/Files-BKEREVQK.js +0 -141
  303. package/dist/PdfViewer-4YLDY4JY.js +0 -1
  304. package/dist/Sidebar-SAGLPIOC.js +0 -44
  305. package/dist/chunk-2SGOKMUU.js +0 -13
  306. package/dist/chunk-4Y33Y4OX.js +0 -8
  307. package/dist/chunk-574SLTKO.js +0 -8
  308. package/dist/chunk-64J7TYJ3.js +0 -4
  309. package/dist/chunk-A4PFVMQ2.js +0 -7
  310. package/dist/chunk-BHHFVIAD.js +0 -2
  311. package/dist/chunk-DG2TGWXI.js +0 -15
  312. package/dist/chunk-DRMIQ3YE.js +0 -1
  313. package/dist/chunk-ENFXDIIZ.js +0 -8
  314. package/dist/chunk-FFUTSMF5.js +0 -28
  315. package/dist/chunk-FI6IJTAJ.js +0 -14
  316. package/dist/chunk-FVKXDF2Q.js +0 -12
  317. package/dist/chunk-IATKDC52.js +0 -9
  318. package/dist/chunk-JJ2OXUK7.js +0 -14
  319. package/dist/chunk-S6AN76R3.js +0 -4
  320. package/dist/chunk-T7D73HT7.js +0 -11
  321. package/dist/chunk-TU2L7NW3.js +0 -7
  322. package/dist/chunk-UFM4YBZ7.js +0 -1
  323. package/dist/chunk-VDYF3WPJ.js +0 -2
  324. package/dist/chunk-XMY2HKVD.js +0 -19
  325. package/dist/chunk-XQWHKXLS.js +0 -22
  326. package/dist/chunk-YX2OOGV7.js +0 -4
@@ -1,4 +1,4 @@
1
- import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-7GJIIBJD.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-V4XR4MOS.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-JSHMIMAJ.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{IconButton_default as e}from"./chunk-SV5RRBVA.js";import{CloseGlyph as t}from"./chunk-B27XRZ47.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-VREZFFRE.js";import{Button_default as s}from"./chunk-EVYD6UFQ.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-HCDG7EUR.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
@@ -6,8 +6,8 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
7
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
8
8
  /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function b({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
10
- /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
9
+ /* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const R=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),L=l([]);return o(()=>{j&&R.rejections.length>0&&R.rejections!==L.current&&(L.current=R.rejections,j(R.rejections))},[R.rejections,j]),/* @__PURE__ */u(h,{intake:R,dropLabel:p,className:N,children:[v,
10
+ /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{R.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
- /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
- /* @__PURE__ */d(a,{rejections:L.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
12
+ /* @__PURE__ */d(b,{onClick:R.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
13
+ /* @__PURE__ */d(a,{rejections:R.rejections})]})}export{b as AttachButton,h as AttachmentDropZone,f as AttachmentList,x as ComposerAttachments,m as PaperclipGlyph};
@@ -1,14 +1,14 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-7GJIIBJD.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-V4XR4MOS.js";import{ColoredBadge as u}from"./chunk-NN32QUCE.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:T,onDragOutChange:C,dropType:K,onDropData:I,label:S,hint:A,error:O,required:F,className:M,accept:P="image/*",maxSizeBytes:z,maxFiles:E,fit:L="cover",thumbSize:$=96,placeholder:R,cta:H,acceptHint:B,showCover:J=!1,coverLabel:W,busy:Q=!1,busyLabel:q,progress:U,disabled:V=!1,readOnly:G=!1,selected:X,onItemClick:Y,onItemDoubleClick:Z,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=W??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=V||Q,de=!(!k&&!N||se||G),ce=!!w&&!se&&!G,ue=!!j&&!se&&!G,me=!!T&&!V&&!ue,pe=!(!K||!I||se||G),fe=t(se),he=R??r(P,te),ge=d({accept:P,maxSizeBytes:z,maxFiles:E,acceptHint:B,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(K),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(K);t&&I(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Te=null==X?null:new Set(X),Ce=!!Y,Ke=$<112,Ie=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=J&&(e.cover??0===t);/* @__PURE__ */
2
- return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Te?Te.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:Z?()=>Z(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(T,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Te?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:L}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:L}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
- /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ke?
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-B27XRZ47.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-VREZFFRE.js";import{ColoredBadge as u}from"./chunk-SAAXAAAH.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{useShellStrings as h}from"./chunk-HCDG7EUR.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:A,onDragOutChange:T,dropType:C,onDropData:K,label:S,hint:F,error:I,required:O,className:E,accept:R="image/*",maxSizeBytes:P,maxFiles:z,fit:L="cover",thumbSize:$=96,placeholder:H,cta:M,acceptHint:B,showCover:W=!1,coverLabel:Z,busy:q=!1,busyLabel:Q,progress:U,disabled:V=!1,readOnly:X=!1,selected:G,onItemClick:Y,onItemDoubleClick:J,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=M??te.cta,ae=Z??te.cover,ne=Q??te.uploading,le=g(),[ie,oe]=b(null),se=V||q,de=!(!k&&!N||se||X),ce=!!w&&!se&&!X,ue=!!j&&!se&&!X,me=!!A&&!V&&!ue,pe=!(!C||!K||se||X),fe=t(se),he=H??r(R,te),ge=d({accept:R,maxSizeBytes:P,maxFiles:z,acceptHint:B,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&K(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Ae=null==G?null:new Set(G),Te=!!Y,Ce=$<112,Ke=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,R),a=e.name??o(e.url),n=W&&(e.cover??0===t);/* @__PURE__ */
2
+ return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ae?Ae.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:J?()=>J(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(A,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id,t.currentTarget)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Y(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ae?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:L}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:L}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
+ /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
4
4
  /* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
5
5
  /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Se=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
6
6
  /* @__PURE__ */x(a,{className:"h-5 w-5"}),
7
- /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ae=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
7
+ /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Fe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
8
8
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
9
9
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
10
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:Q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
- return v(e,{label:S,labelId:S?`${le}-label`:void 0,htmlFor:le,hint:A,error:O,required:F,className:M,children:[
12
- /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":S?`${le}-label`:void 0,"aria-describedby":O?`${le}-error`:A?`${le}-hint`:void 0,"aria-busy":Q||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ae:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
13
- /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Te||void 0,"aria-label":"string"==typeof S?S:te.files,className:"contents",children:p.map(Ie)}):p.map(Ie),Se]}),Q&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
10
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:q?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
+ return v(e,{label:S,labelId:S?`${le}-label`:void 0,htmlFor:le,hint:F,error:I,required:O,className:E,children:[
12
+ /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":S?`${le}-label`:void 0,"aria-describedby":I?`${le}-error`:F?`${le}-hint`:void 0,"aria-busy":q||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Fe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
13
+ /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ae||void 0,"aria-label":"string"==typeof S?S:te.files,className:"contents",children:p.map(Ke)}):p.map(Ke),Se]}),q&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
14
14
  /* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
@@ -1,3 +1,3 @@
1
- import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-ISVODSRP.js";import{useShellStrings as t}from"./chunk-HCDG7EUR.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
2
2
  return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
3
3
  return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-3YBXA72C.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.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 s,jsxs as c,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,S]=o("select"),[W,B]=o(h[0]),[R,j]=o(4),[H,F]=o(24),[T,A]=o(u[0].id),[U,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[Y,q]=o(null),[G,J]=o(null),[_,Q]=o(6),[ee,te]=o(12),[re,ne]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[se,ce]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,ve]=o(!1),be=i(()=>se?{w:se.w*de,h:se.h*de}:null,[se,de]),ke=be&&ae?be.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&&(F(Me.size),A(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),q(Me.borderColor),J(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),ce({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,se]);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,ve(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ce(e);if("draw"===t.kind)pe(v(I,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?b(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,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:s},{x:c,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,ve(!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,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),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:K,underline:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(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))},Pe=e=>{J(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:W,size:H,font:T,bold:U,italic:K,underline:X,borderColor:Y,background:G,padding:_};ne(t=>[...t,e]),ie(e.id),S("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),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,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__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:$.toolDraw,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("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__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:$.toolEllipse,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:$.toolArrow,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:$.toolMosaic,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:$.toolText,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:$.toolCrop,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[$]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-5X3Z45SL.js";import{useShellStrings as t}from"./chunk-HCDG7EUR.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 s,jsxs as c,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),E=n(null),P=t().annotator,$=n(P);$.current=P;const[I,S]=o("select"),[W,B]=o(h[0]),[R,j]=o(4),[H,F]=o(24),[T,U]=o(u[0].id),[A,O]=o(!0),[K,Z]=o(!1),[V,X]=o(!1),[G,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),[se,ce]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,ve]=o(!1),be=i(()=>se?{w:se.w*de,h:se.h*de}:null,[se,de]),ke=be&&ae?be.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&&(F(Me.size),U(Me.font),O(Me.bold),Z(Me.italic),X(Me.underline),q(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{E.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),ce({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=E.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,se]);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,ve(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ce(e);if("draw"===t.kind)pe(v(I,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?b(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,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:s},{x:c,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,ve(!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,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),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:V}[e];"bold"===e&&O(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=>{q(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ee=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:T,bold:A,italic:K,underline:V,borderColor:G,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),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,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 Ie=i(()=>[{id:"select",label:P.toolSelect,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:P.toolDraw,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("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__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:P.toolEllipse,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:P.toolArrow,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:P.toolMosaic,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:P.toolText,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:P.toolCrop,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[P]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
2
2
  return c("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
3
  /* @__PURE__ */c("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */s("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===e.id),children:e.icon},e.id)),
4
4
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
5
  /* @__PURE__ */s("div",{className:"flex items-center gap-1",children:h.map(e=>/* @__PURE__ */s("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__ */c(d,{children:[
6
6
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
7
7
  /* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
8
- /* @__PURE__ */s("span",{children:$.weight}),
8
+ /* @__PURE__ */s("span",{children:P.weight}),
9
9
  /* @__PURE__ */s("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__ */s("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */c(d,{children:[
11
11
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
12
12
  /* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
13
- /* @__PURE__ */s("span",{children:$.radius}),
13
+ /* @__PURE__ */s("span",{children:P.radius}),
14
14
  /* @__PURE__ */s("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__ */s("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */c(d,{children:[
16
16
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
- /* @__PURE__ */s("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__ */s("option",{value:e.id,children:$[e.name]},e.id))}),
18
- /* @__PURE__ */s("button",{onClick:()=>ze("bold"),className:Se(U),title:$.bold,children:/* @__PURE__ */s("span",{className:"font-bold",children:$.boldLetter})}),
19
- /* @__PURE__ */s("button",{onClick:()=>ze("italic"),className:Se(K),title:$.italic,children:/* @__PURE__ */s("span",{className:"italic",children:$.italicLetter})}),
20
- /* @__PURE__ */s("button",{onClick:()=>ze("underline"),className:Se(X),title:$.underline,children:/* @__PURE__ */s("span",{className:"underline",children:$.underlineLetter})}),
17
+ /* @__PURE__ */s("select",{value:T,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__ */s("option",{value:e.id,children:P[e.name]},e.id))}),
18
+ /* @__PURE__ */s("button",{onClick:()=>ze("bold"),className:Se(A),title:P.bold,children:/* @__PURE__ */s("span",{className:"font-bold",children:P.boldLetter})}),
19
+ /* @__PURE__ */s("button",{onClick:()=>ze("italic"),className:Se(K),title:P.italic,children:/* @__PURE__ */s("span",{className:"italic",children:P.italicLetter})}),
20
+ /* @__PURE__ */s("button",{onClick:()=>ze("underline"),className:Se(V),title:P.underline,children:/* @__PURE__ */s("span",{className:"underline",children:P.underlineLetter})}),
21
21
  /* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
- /* @__PURE__ */s("span",{children:$.size}),
22
+ /* @__PURE__ */s("span",{children:P.size}),
23
23
  /* @__PURE__ */s("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),F(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
24
  /* @__PURE__ */s("span",{className:"tabular-nums w-7 text-right",children:H})]}),
25
25
  /* @__PURE__ */c("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
- /* @__PURE__ */s("span",{children:$.border}),Y?/* @__PURE__ */c(d,{children:[
27
- /* @__PURE__ */s("input",{type:"color",value:Y,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__ */s("button",{onClick:()=>De(null),title:$.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>De(W),title:$.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
26
+ /* @__PURE__ */s("span",{children:P.border}),G?/* @__PURE__ */c(d,{children:[
27
+ /* @__PURE__ */s("input",{type:"color",value:G,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__ */s("button",{onClick:()=>De(null),title:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>De(W),title:P.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
29
29
  /* @__PURE__ */c("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
- /* @__PURE__ */s("span",{children:$.fill}),G?/* @__PURE__ */c(d,{children:[
31
- /* @__PURE__ */s("input",{type:"color",value:G,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__ */s("button",{onClick:()=>Pe(null),title:$.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>Pe("#ffffff"),title:$.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
30
+ /* @__PURE__ */s("span",{children:P.fill}),Y?/* @__PURE__ */c(d,{children:[
31
+ /* @__PURE__ */s("input",{type:"color",value:Y,onChange:e=>Ee(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
+ /* @__PURE__ */s("button",{onClick:()=>Ee(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>Ee("#ffffff"),title:P.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
33
33
  /* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
- /* @__PURE__ */s("span",{children:$.padding}),
35
- /* @__PURE__ */s("input",{type:"range",min:0,max:40,step:1,value:_,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
- /* @__PURE__ */s("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
34
+ /* @__PURE__ */s("span",{children:P.padding}),
35
+ /* @__PURE__ */s("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
+ /* @__PURE__ */s("span",{className:"tabular-nums w-6 text-right",children:J})]})]}),
37
37
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
38
- /* @__PURE__ */s("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:"−"}),
38
+ /* @__PURE__ */s("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:"−"}),
39
39
  /* @__PURE__ */c("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
40
- /* @__PURE__ */s("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__ */s("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.fit}),
40
+ /* @__PURE__ */s("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__ */s("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
42
42
  /* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
- /* @__PURE__ */s("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}),
43
+ /* @__PURE__ */s("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}),
44
44
  /* @__PURE__ */c("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */c(d,{children:[
45
- /* @__PURE__ */s("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=>b(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__ */s("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:$.cancel})]}),m&&!me&&/* @__PURE__ */c(d,{children:[g&&/* @__PURE__ */s("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:$.cancel}),
47
- /* @__PURE__ */s("button",{onClick:async()=>{const t=await Ee();t?t.toBlob(t=>{t?m(t):e.error(E.current.exportFailed)},"image/png"):e.error(E.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:$.apply})]})]})]}),
45
+ /* @__PURE__ */s("button",{onClick:()=>{if(!me||!E.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const o=n.getContext("2d");o.drawImage(E.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=()=>{E.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),ne(t=>t.filter(e=>"mosaic"!==e.type).map(t=>b(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__ */s("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.cancel})]}),m&&!me&&/* @__PURE__ */c(d,{children:[g&&/* @__PURE__ */s("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__ */s("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:P.apply})]})]})]}),
48
48
  /* @__PURE__ */s("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:be&&ae&&/* @__PURE__ */c("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:be.w,height:be.h},children:[
49
49
  /* @__PURE__ */s("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
50
- /* @__PURE__ */c("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:W,stroke:R});pe(v(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[re.map(e=>/* @__PURE__ */s(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__ */s(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */s(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */s(f,{pendingText:ye,color:W,size:H,font:u.find(e=>e.id===T)?.css??u[0].css,bold:U,italic:K,underline:X,borderColor:Y,background:G,padding:_,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:$e,onCancel:()=>xe(null)})]})}),
51
- /* @__PURE__ */s("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.hintShape})]})});function 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__ */s("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__ */s("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__ */s(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */s("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__ */s("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...h,style:t?{...h.style,stroke:"var(--rosh-annotator-selection)"}:h.style});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__ */c("g",{...h,...p,children:[n&&/* @__PURE__ */s("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__ */c("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 Pe();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:W,stroke:R});pe(v(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[re.map(e=>/* @__PURE__ */s(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__ */s(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */s(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */s(f,{pendingText:ye,color:W,size:H,font:u.find(e=>e.id===T)?.css??u[0].css,bold:A,italic:K,underline:V,borderColor:G,background:Y,padding:J,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:Pe,onCancel:()=>xe(null)})]})}),
51
+ /* @__PURE__ */s("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?P.hintSelected:P.hintSelect:"text"===I?P.hintText:"crop"===I?P.hintCrop:"draw"===I?P.hintDraw:P.hintShape})]})});function 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__ */s("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__ */s("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__ */s(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */s("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__ */s("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...h,style:t?{...h.style,stroke:"var(--rosh-annotator-selection)"}:h.style});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__ */c("g",{...h,...p,children:[n&&/* @__PURE__ */s("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__ */s("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__ */s("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
53
53
  return c("g",{children:[y,t&&!r&&/* @__PURE__ */c(d,{children:[
54
54
  /* @__PURE__ */s("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",strokeWidth:2/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none",style:{stroke:"var(--rosh-annotator-selection)"}}),a&&/* @__PURE__ */s(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:"white",strokeWidth:o,pointerEvents:"all",style:{cursor:e,stroke:"var(--rosh-annotator-selection)"},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-BC4FE77W.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-UFM4YBZ7.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,C]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-AYCWVVJ3.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-CXXMSYA6.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-HCDG7EUR.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:s}){const i=x[s],[h,v]=l(!1),N=m(()=>v(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,N,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,C]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -1,9 +1,9 @@
1
- import{STATUS_VARS as e,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as a,useShellLocale as t}from"./chunk-JSHMIMAJ.js";import{formatPercent as i}from"./chunk-C3QOHMR6.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";var s=e=>Math.max(0,Math.min(1,e));function o({value:o,segments:m,objective:u,label:d,detail:c,formatValue:h,tone:f,className:x,unavailableLabel:b}){const v=a().charts,g=t(),p=h??(e=>i(100*e,1,g)),N=b??v.notEnough;if(null==o||!Number.isFinite(o))/* @__PURE__ */
1
+ import{STATUS_VARS as e,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as a,useShellLocale as t}from"./chunk-HCDG7EUR.js";import{formatPercent as i}from"./chunk-C3QOHMR6.js";import{jsxs as n,jsx as r}from"react/jsx-runtime";var s=e=>Math.max(0,Math.min(1,e));function o({value:o,segments:m,objective:u,label:d,detail:c,formatValue:h,tone:f,className:x,unavailableLabel:b}){const v=a().charts,g=t(),p=h??(e=>i(100*e,1,g)),N=b??v.notEnough;if(null==o||!Number.isFinite(o))/* @__PURE__ */
2
2
  return n("div",{className:x,children:[d&&/* @__PURE__ */r("p",{className:"text-sm font-medium text-gray-700",children:d}),
3
- /* @__PURE__ */r("p",{className:"mt-1 text-sm text-gray-500",children:N})]});const j=s(o),y=null==u||o>=u,k=f??(y?"good":"critical"),M=e[k],w=[m?.length?m.map(e=>`${e.label} ${p(e.value)}`).join(" · "):"",c??"",null!=u?(y?v.objectiveMet:v.objectiveMissed)(p(u)):""].filter(Boolean).join(" · ");/* @__PURE__ */
3
+ /* @__PURE__ */r("p",{className:"mt-1 text-sm text-gray-500",children:N})]});const j=s(o),y=null==u||o>=u,k=f??(y?"good":"critical"),w=e[k],$=[m?.length?m.map(e=>`${e.label} ${p(e.value)}`).join(" · "):"",c??"",null!=u?(y?v.objectiveMet:v.objectiveMissed)(p(u)):""].filter(Boolean).join(" · ");/* @__PURE__ */
4
4
  return n("div",{className:x,children:[
5
5
  /* @__PURE__ */n("div",{className:"mb-2 flex items-baseline justify-between gap-3",children:[
6
6
  /* @__PURE__ */r("span",{className:"text-sm font-medium text-gray-700",children:d}),
7
- /* @__PURE__ */r("span",{className:"text-sm font-semibold tabular-nums",style:{color:M},children:p(o)})]}),
7
+ /* @__PURE__ */r("span",{className:"text-sm font-semibold tabular-nums",style:{color:w},children:p(o)})]}),
8
8
  /* @__PURE__ */n("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*j).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":p(o),"aria-label":d,children:[
9
- /* @__PURE__ */r("div",m?.length?{className:"flex h-full overflow-hidden rounded-full",children:m.map((l,a)=>/* @__PURE__ */r("div",{className:"h-full shrink-0"+(a===m.length-1?" rounded-r-full":""),style:{width:`${(100*s(l.value)).toFixed(2)}%`,backgroundColor:e[l.tone??(0===a?k:"neutral")]}},`${l.label}-${a}`))}:{className:"h-full rounded-full",style:{width:`${(100*j).toFixed(2)}%`,backgroundColor:M}}),null!=u&&/* @__PURE__ */r("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*s(u)).toFixed(2)}%`,height:20,backgroundColor:l.axis},"aria-hidden":"true"})]}),w&&/* @__PURE__ */r("p",{className:"mt-2 text-xs text-ink-faint",children:w})]})}export{o as Meter};
9
+ /* @__PURE__ */r("div",m?.length?{className:"flex h-full overflow-hidden rounded-full",children:m.map((l,a)=>/* @__PURE__ */r("div",{className:"h-full shrink-0"+(a===m.length-1?" rounded-r-full":""),style:{width:`${(100*s(l.value)).toFixed(2)}%`,backgroundColor:e[l.tone??(0===a?k:"neutral")]}},`${l.label}-${a}`))}:{className:"h-full rounded-full",style:{width:`${(100*j).toFixed(2)}%`,backgroundColor:w}}),null!=u&&/* @__PURE__ */r("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*s(u)).toFixed(2)}%`,height:20,backgroundColor:l.axis},"aria-hidden":"true"})]}),$&&/* @__PURE__ */r("p",{className:"mt-2 text-xs text-ink-faint",children:$})]})}export{o as Meter};
@@ -0,0 +1,11 @@
1
+ import{usePlotWidth as e}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as t}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-HCDG7EUR.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),C=$??(e=>o(e,U)),D=b??j.intensity,z=w??j.noActivity,F=h(null),R=e(F),S=g??R,V=c(),[E,G]=s(null);if(m(()=>{if(null!==E)return n(e=>"Escape"===e.key&&(G(null),!0))},[E]),0===x.length||0===d.length)/* @__PURE__ */
2
+ return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:z})});const L=y??l(0),Q=v??Math.max(1,...p.flat().filter(Number.isFinite)),B=96,H=26*x.length,I=M??H+26+26,T=Math.max(2,(Math.max(97,S)-B)/d.length),W=e=>{const t=Q>0?Math.max(0,Math.min(1,e/Q)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
3
+ return u("div",{className:`relative ${k??""}`,ref:F,children:[
4
+ /* @__PURE__ */u("svg",{width:"100%",height:I,viewBox:`0 0 ${S} ${I}`,role:"img","aria-label":j.heatmap(D,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>G(null),onBlur:()=>G(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),G(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
5
+ /* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:V,x1:"0",x2:"1",children:[
6
+ /* @__PURE__ */f("stop",{offset:"0",stopColor:W(0)}),
7
+ /* @__PURE__ */f("stop",{offset:"1",stopColor:W(Q)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=E&&(E.r!==t||E.c!==r);/* @__PURE__ */
8
+ return f("rect",{x:B+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>G({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${C(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((S-B)/56))))===0?/* @__PURE__ */f("text",{x:B+t*T+T/2,y:H+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
9
+ /* @__PURE__ */f("rect",{x:B,y:H+26,width:Math.min(180,Math.max(40,S-B)),height:8,rx:4,fill:`url(#${V})`}),
10
+ /* @__PURE__ */f("text",{x:B,y:H+48,fontSize:11,fill:r.label,children:"0"}),
11
+ /* @__PURE__ */f("text",{x:B+Math.min(180,Math.max(40,S-B)),y:H+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:C(Q)})]}),E&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(t,{title:`${x[E.r]} · ${d[E.c]}`,rows:[{key:"v",label:D,color:L,value:null==p[E.r]?.[E.c]?void 0:C(p[E.r][E.c])}]})})]})}export{x as HeatmapChart};
@@ -1,4 +1,4 @@
1
- import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-JSHMIMAJ.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
1
+ import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-HCDG7EUR.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
2
2
  return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
3
3
  /* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
4
4
  /* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
@@ -1,9 +1,9 @@
1
- import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,C=c(null),F=o(C),A=x??F,[E,H]=m(null),{highlighted:z}=n();if(0===f.length||0===k.length)/* @__PURE__ */
2
- return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const O=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),Q=e=>O.length<=1?0:O.indexOf(e)/(O.length-1)*(A-g-140)+70,S=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),U=/* @__PURE__ */new Map;for(const e of f)U.set(e.depth,[...U.get(e.depth)??[],e]);const V=Math.max(...[...U.values()].map(e=>e.reduce((e,t)=>e+(S.get(t.key)??0),0))),W=p-20,Y=V>0?(W-y*(Math.max(...[...U.values()].map(e=>e.length))-1))/V:0,B=/* @__PURE__ */new Map;for(const[e,t]of U){const n=t.map(e=>Math.max(2,(S.get(e.key)??0)*Y)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>W&&l>0?Math.max(0,1-(o-W)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;B.set(t.key,{x:Q(e),y:a,h:l,index:o}),a+=l+y})}const I=/* @__PURE__ */new Map,J=/* @__PURE__ */new Map,L=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,R="link"===E?.kind?k[E.index]:void 0,T="node"===E?.kind?f.find(e=>e.key===E.key):void 0;/* @__PURE__ */
1
+ import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-HCDG7EUR.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,C=c(null),E=o(C),F=x??E,[A,H]=m(null),{highlighted:U}=n();if(0===f.length||0===k.length)/* @__PURE__ */
2
+ return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const z=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),O=e=>z.length<=1?0:z.indexOf(e)/(z.length-1)*(F-g-140)+70,Q=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),R=/* @__PURE__ */new Map;for(const e of f)R.set(e.depth,[...R.get(e.depth)??[],e]);const V=Math.max(...[...R.values()].map(e=>e.reduce((e,t)=>e+(Q.get(t.key)??0),0))),W=p-20,Y=V>0?(W-y*(Math.max(...[...R.values()].map(e=>e.length))-1))/V:0,B=/* @__PURE__ */new Map;for(const[e,t]of R){const n=t.map(e=>Math.max(2,(Q.get(e.key)??0)*Y)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>W&&l>0?Math.max(0,1-(o-W)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;B.set(t.key,{x:O(e),y:a,h:l,index:o}),a+=l+y})}const D=/* @__PURE__ */new Map,G=/* @__PURE__ */new Map,L=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,S="link"===A?.kind?k[A.index]:void 0,T="node"===A?.kind?f.find(e=>e.key===A.key):void 0;/* @__PURE__ */
3
3
  return u("div",{className:`relative ${M??""}`,ref:C,children:[
4
- /* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${A} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>H(null),children:[k.map((e,n)=>{const o=B.get(e.from),l=B.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*Y),i=o.y+(I.get(e.from)??0)+a/2,s=l.y+(J.get(e.to)??0)+a/2;I.set(e.from,(I.get(e.from)??0)+a),J.set(e.to,(J.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=L.get(u)??0;L.set(u,f+1);const k=((e,t)=>E?"link"===E.kind?E.index===t:P(e,E.key):null!==z?P(e,z):null)(e,n);/* @__PURE__ */
5
- return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>H({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=B.get(e.key);if(!t)return null;const n=t.x>A/2,o=(l=e.key,E?"node"===E.kind?E.key===l:P(k[E.index],l):null!==z?z===l:null);var l;/* @__PURE__ */
4
+ /* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${F} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>H(null),children:[k.map((e,n)=>{const o=B.get(e.from),l=B.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*Y),i=o.y+(D.get(e.from)??0)+a/2,s=l.y+(G.get(e.to)??0)+a/2;D.set(e.from,(D.get(e.from)??0)+a),G.set(e.to,(G.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=L.get(u)??0;L.set(u,f+1);const k=((e,t)=>A?"link"===A.kind?A.index===t:P(e,A.key):null!==U?P(e,U):null)(e,n);/* @__PURE__ */
5
+ return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>H({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=B.get(e.key);if(!t)return null;const n=t.x>F/2,o=(l=e.key,A?"node"===A.kind?A.key===l:P(k[A.index],l):null!==U?U===l:null);var l;/* @__PURE__ */
6
6
  return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>H({kind:"node",key:e.key}),children:[
7
7
  /* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:r(t.index,e.color,e.tone)}),
8
- /* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),R&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:`${R.from} → ${R.to}`,rows:[{key:"value",label:b.flow,color:r(B.get(R.from)?.index??0,R.color),value:$(R.value)}]})}),T&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:T.label,rows:[{key:"value",label:b.throughput,color:r(B.get(T.key)?.index??0,T.color,T.tone),value:$(S.get(T.key)??0)}]})}),
8
+ /* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:`${S.from} → ${S.to}`,rows:[{key:"value",label:b.flow,color:r(B.get(S.from)?.index??0,S.color),value:$(S.value)}]})}),T&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:T.label,rows:[{key:"value",label:b.throughput,color:r(B.get(T.key)?.index??0,T.color,T.tone),value:$(Q.get(T.key)??0)}]})}),
9
9
  /* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,$(e.value)])})]})}export{f as SankeyChart};
@@ -1,4 +1,4 @@
1
- import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-JSHMIMAJ.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
1
+ import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-HCDG7EUR.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
2
2
  return i("span",{"aria-hidden":"true",className:`h-3 w-0.5 shrink-0 rounded-[1px] ${e}`})}function t({link:t,className:l=""}){const c=n().meter;/* @__PURE__ */
3
3
  return r("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500 ${l}`.trim(),children:[
4
4
  /* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
@@ -1,2 +1,2 @@
1
- import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-3YBXA72C.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,X=[],q=!1,J=null,L=/* @__PURE__ */new Set;function Y(){for(const t of L)t()}function $(t){X=t,Y()}function z(){const t=W;return t?J=t.list().then(e=>{W===t&&(X=e,q=!0,Y())}).catch(()=>{W===t&&(q=!0,Y())}).finally(()=>{J=null}):(X=[],q=!0,Y(),Promise.resolve())}function H(t){W=t,X=[],q=!1,t?z():Y()}function Q(t){return L.add(t),!W||q||J||z(),()=>{L.delete(t)}}function U(){return X}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(Q,U,U),i=o(t=>{const n=W;if(!n)return e.addTask(t);const o="tmp-"+E(),a=K(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...X,r]),n.create({...t,name:t.name.trim()}).then(t=>$(X.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(X.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=W;if(!o)return e.updateTask(t,n);$(X.map(e=>e.id===t?{...e,...n,id:t,updatedAt:K()}:e)),o.update(t,n).catch(()=>{z()})},[e]),l=o(t=>{const n=W;if(!n)return e.removeTask(t);const o=X;$(X.filter(e=>e.id!==t)),n.remove(t).catch(()=>$(o))},[e]),s=o(t=>{if(!W)return e.toggleDone(t);const n=X.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{W||e.setAllTasks(t)},[e]);return null===W?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
1
+ import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-5X3Z45SL.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function K(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var L=null,W=[],X=!1,q=null,J=/* @__PURE__ */new Set;function Z(){for(const t of J)t()}function $(t){W=t,Z()}function z(){const t=L;return t?q=t.list().then(e=>{L===t&&(W=e,X=!0,Z())}).catch(()=>{L===t&&(X=!0,Z())}).finally(()=>{q=null}):(W=[],X=!0,Z(),Promise.resolve())}function H(t){L=t,W=[],X=!1,t?z():Z()}function Q(t){return J.add(t),!L||X||q||z(),()=>{J.delete(t)}}function U(){return W}function Y(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=K(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:K()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(Q,U,U),i=o(t=>{const n=L;if(!n)return e.addTask(t);const o="tmp-"+E(),a=K(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...W,r]),n.create({...t,name:t.name.trim()}).then(t=>$(W.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(W.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=L;if(!o)return e.updateTask(t,n);$(W.map(e=>e.id===t?{...e,...n,id:t,updatedAt:K()}:e)),o.update(t,n).catch(()=>{z()})},[e]),l=o(t=>{const n=L;if(!n)return e.removeTask(t);const o=W;$(W.filter(e=>e.id!==t)),n.remove(t).catch(()=>$(o))},[e]),s=o(t=>{if(!L)return e.toggleDone(t);const n=W.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{L||e.setAllTasks(t)},[e]);return null===L?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=K(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Y as useTodoTasks};
@@ -1,4 +1,4 @@
1
- import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
1
+ import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-HCDG7EUR.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
2
2
  return i("div",{className:n,children:/* @__PURE__ */s("svg",{width:"100%",height:o,viewBox:`0 0 ${a} ${o}`,role:"img","aria-label":p,"aria-busy":"true",children:[
3
3
  /* @__PURE__ */i("defs",{children:/* @__PURE__ */s("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[
4
4
  /* @__PURE__ */i("stop",{offset:"0%",stopColor:r.surface,stopOpacity:"0"}),
@@ -1,11 +1,11 @@
1
- import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-7GJIIBJD.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-JSHMIMAJ.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function I({images:r,startIndex:y=0,onClose:I,onIndexChange:J,onOpenFile:U}){const $=h().lightbox,z=u(),A=p(null),F=p(null),[P,S]=x(y),W=r.length,Y=z&&W>0,G=b(e=>{if(W<2)return;const t=((P+e)%W+W)%W;S(t),J?.(t)},[P,W,J]);if(a(Y),l(A,Y,F),i(Y),k(()=>{if(Y)return f(()=>(I(),!0),()=>A.current)},[Y,I]),k(()=>{if(!Y)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y,G]),!Y)return null;const L=r[Math.min(P,W-1)],M=j(L),O=L.caption||n(L.url);let Q;return Q="video"===M?/* @__PURE__ */v("video",{src:L.url,controls:!0,playsInline:!0,"aria-label":O,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===M?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
1
+ import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-B27XRZ47.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-HCDG7EUR.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function U({images:r,startIndex:y=0,onClose:U,onIndexChange:$,onOpenFile:z}){const F=h().lightbox,I=u(),P=p(null),R=p(null),[W,Y]=x(y),A=r.length,E=I&&A>0,G=b(e=>{if(A<2)return;const t=((W+e)%A+A)%A;Y(t),$?.(t)},[W,A,$]);if(a(E),l(P,E,R),i(E),k(()=>{if(E)return f(()=>(U(),!0),()=>P.current)},[E,U]),k(()=>{if(!E)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E,G]),!E)return null;const L=r[Math.min(W,A-1)],O=j(L),Q=L.caption||n(L.url);let S;return S="video"===O?/* @__PURE__ */v("video",{src:L.url,controls:!0,playsInline:!0,"aria-label":Q,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===O?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
2
2
  /* @__PURE__ */v(s,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
3
- /* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:O}),U?/* @__PURE__ */v(c,{size:"sm",onClick:()=>U(L),children:$.openFile}):/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:L.url,alt:O,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
4
- /* @__PURE__ */w("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:I,children:[Q,
3
+ /* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:Q}),z?/* @__PURE__ */v(c,{size:"sm",onClick:()=>z(L),children:F.openFile}):/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:F.openFile})]}):/* @__PURE__ */v(t,{src:L.url,alt:Q,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
4
+ /* @__PURE__ */w("div",{ref:P,...o({role:"dialog",modal:!0,label:F.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:U,children:[S,
5
5
  /* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:D,children:[
6
- /* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(P+1,W)}),
7
- /* @__PURE__ */v("button",{ref:F,type:"button",onClick:I,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
8
- /* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
- /* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
6
+ /* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:F.counter(W+1,A)}),
7
+ /* @__PURE__ */v("button",{ref:R,type:"button",onClick:U,"aria-label":F.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),A>1&&/* @__PURE__ */w(N,{children:[
8
+ /* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(-1)},"aria-label":F.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
+ /* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),G(1)},"aria-label":F.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
10
10
  /* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:D,children:[
11
- /* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:O}),"file"!==M&&/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{I as ImageLightbox,j as lightboxKind};
11
+ /* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:Q}),"file"!==O&&/* @__PURE__ */v("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:F.openOriginal})]})]}),document.body)}export{U as ImageLightbox,j as lightboxKind};
@@ -0,0 +1,15 @@
1
+ import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{ChartDefs as t,maskId as r}from"./chunk-465RRWBY.js";import{polygonPoints as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-HCDG7EUR.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:C,emptyLabel:$}){const W=m().charts,F=c(),R=N??(e=>h(e,F)),w=$??W.nothingToCompare,A=p(),[E,H]=u(null),{highlighted:L}=a(),U=x;if(k.length<3||0===U.length)/* @__PURE__ */
2
+ return d("p",{className:`text-sm text-gray-500 ${C??""}`,children:w});const Y=y/2,z=y/2,B=y/2-46,Q=o(k.length),T=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...U.map(e=>e.values[t]??0).filter(Number.isFinite))),V=(e,t)=>{const r=Math.max(0,Math.min(1,t/T[e])),l=Q.center(e)-Q.step/2;return[Y+B*r*Math.cos(l),z+B*r*Math.sin(l)]},D=(e,t)=>null!==E?E!==e:null!==L&&L!==t,G=null!==E?U[E]:void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${C??""}`,children:[
4
+ /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":A,onMouseLeave:()=>H(null),children:[
5
+ /* @__PURE__ */d("title",{id:A,children:W.acrossMeasures(U.map(e=>e.label),k.length)}),Array.from({length:M},(e,t)=>{const r=B*(t+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:Y,cy:z,r:r,fill:"none",stroke:i.grid,strokeWidth:1},t):/* @__PURE__ */d("path",{d:g(l(Y,z,r,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},t)}),k.map((e,t)=>{const[r,l]=V(t,T[t]);/* @__PURE__ */
6
+ return f("g",{children:[
7
+ /* @__PURE__ */d("line",{x1:Y,y1:z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
+ /* @__PURE__ */d("text",{x:Y+(B+18)*Math.cos(Q.center(t)-Q.step/2),y:z+(B+18)*Math.sin(Q.center(t)-Q.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
+ /* @__PURE__ */d(t,{id:A,reveal:!!j&&"center-out"}),U.map((e,t)=>{const l=s(t,3,e.color,e.tone),a=k.map((t,r)=>V(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:D(t,e.key)?.3:1,onMouseEnter:()=>H(t),mask:j?`url(#${r(A)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:l,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:l,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],r)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:l,stroke:i.surface,strokeWidth:1.5},r))]},e.key)})]}),G&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:G.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(E,3,G.color,G.tone),value:R(G.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:U.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(U.map(e=>e.label),k.length),head:[W.tableSeries,...k.map(e=>e.label)],rows:U.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};