efficient-shell 9.1.0 → 9.9.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 (451) hide show
  1. package/README.md +70 -20
  2. package/dist/Browser-ZPOVP4Z7.js +43 -0
  3. package/dist/Calculator-CSYRZAS5.js +29 -0
  4. package/dist/CurrencyConverter-SSR2XDIC.js +21 -0
  5. package/dist/{Documents-BOVXZFYC.js → Documents-T7JYO223.js} +27 -27
  6. package/dist/Files-HBGW3JWI.js +88 -0
  7. package/dist/Notepad-GO2QT55C.js +25 -0
  8. package/dist/PdfViewer-XSISAJZP.js +1 -0
  9. package/dist/{PomodoroTimer-ZCJBTFV5.js → PomodoroTimer-EV6D4OFU.js} +28 -28
  10. package/dist/Preview-Z2CRCDHA.js +177 -0
  11. package/dist/Sidebar-Y4DTQYW2.js +43 -0
  12. package/dist/Spreadsheet-GEE77GD3.js +37 -0
  13. package/dist/Stock-6ZIQHGPH.js +16 -0
  14. package/dist/Weather-II7NFRMK.js +60 -0
  15. package/dist/WorldClock-NBLNO63Q.js +32 -0
  16. package/dist/ai/index.d.ts +34 -3
  17. package/dist/ai/index.js +53 -53
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/brand.css +1 -1
  23. package/dist/charts/BoxPlotChart.js +1 -1
  24. package/dist/charts/CandlestickChart.js +1 -1
  25. package/dist/charts/CartesianPlot.js +1 -1
  26. package/dist/charts/ChartBrush.js +1 -1
  27. package/dist/charts/ChartFrame.js +1 -1
  28. package/dist/charts/ChartSkeleton.js +1 -1
  29. package/dist/charts/ChartTooltip.js +1 -1
  30. package/dist/charts/ChordChart.js +1 -1
  31. package/dist/charts/ColumnChart.js +1 -1
  32. package/dist/charts/FunnelChart.js +1 -1
  33. package/dist/charts/HeatmapChart.js +1 -1
  34. package/dist/charts/HistogramChart.js +1 -1
  35. package/dist/charts/Meter.js +1 -1
  36. package/dist/charts/PieChart.js +1 -1
  37. package/dist/charts/RadarChart.js +1 -1
  38. package/dist/charts/RadialBarChart.js +1 -1
  39. package/dist/charts/RangeChart.js +1 -1
  40. package/dist/charts/RankedBars.js +1 -1
  41. package/dist/charts/SankeyChart.js +1 -1
  42. package/dist/charts/ScatterChart.js +1 -1
  43. package/dist/charts/SpecChart.js +1 -1
  44. package/dist/charts/StatTile.js +1 -1
  45. package/dist/charts/SunburstChart.js +1 -1
  46. package/dist/charts/TimeSeriesChart.js +1 -1
  47. package/dist/charts/TreemapChart.js +1 -1
  48. package/dist/charts/WaterfallChart.js +1 -1
  49. package/dist/chunk-24K6GVNM.js +28 -0
  50. package/dist/{chunk-ZEKM6HAA.js → chunk-2HEJDLPP.js} +2 -2
  51. package/dist/{chunk-BRHIRE4D.js → chunk-2MLRK7IO.js} +2 -2
  52. package/dist/chunk-2R3BVU75.js +26 -0
  53. package/dist/chunk-2YLG32JY.js +2 -0
  54. package/dist/{chunk-TZSPJIP4.js → chunk-32VV2J22.js} +1 -1
  55. package/dist/{chunk-QQCHLRKG.js → chunk-3APSMJPN.js} +1 -1
  56. package/dist/{chunk-6SMQNPWS.js → chunk-43ONX6UZ.js} +1 -1
  57. package/dist/{chunk-L7IKTEOC.js → chunk-442FFHQJ.js} +13 -13
  58. package/dist/chunk-4MVRSCQE.js +1 -0
  59. package/dist/{chunk-BT3XDH3L.js → chunk-56RAOI7O.js} +6 -6
  60. package/dist/chunk-5F7HMNCX.js +5 -0
  61. package/dist/chunk-5GUBNCTP.js +1 -0
  62. package/dist/{chunk-LGLZTJ2W.js → chunk-5JRL5LXD.js} +6 -6
  63. package/dist/{chunk-OFHCDTJM.js → chunk-5VOVNIOU.js} +1 -1
  64. package/dist/{chunk-NID6MGGC.js → chunk-5VRMQTKV.js} +8 -8
  65. package/dist/chunk-6453ISTQ.js +4 -0
  66. package/dist/chunk-6FEL5D56.js +8 -0
  67. package/dist/{chunk-MVQBVPWP.js → chunk-6KBDNYRW.js} +1 -1
  68. package/dist/{chunk-D2AUUIKG.js → chunk-6MVHRNWC.js} +1 -1
  69. package/dist/{chunk-TW7TA2AB.js → chunk-6ZHX56NM.js} +1 -1
  70. package/dist/{chunk-RNBM5JZI.js → chunk-7JGR7WPD.js} +4 -4
  71. package/dist/{chunk-BIJ7ADTZ.js → chunk-7WGOLPGM.js} +1 -1
  72. package/dist/{chunk-SXSMIMFY.js → chunk-A6RB4PIX.js} +4 -4
  73. package/dist/chunk-AC373WIU.js +8 -0
  74. package/dist/{chunk-BMPBVI7P.js → chunk-AGUA3O5O.js} +1 -1
  75. package/dist/{chunk-UVUBZL7K.js → chunk-ANFLQSGX.js} +5 -5
  76. package/dist/chunk-ARWMJSQJ.js +3 -0
  77. package/dist/chunk-AYZY3YNC.js +1 -0
  78. package/dist/{chunk-BSNWVZHW.js → chunk-B4KMHEFZ.js} +1 -1
  79. package/dist/chunk-B6YOP2IX.js +6 -0
  80. package/dist/{chunk-4VLKDANH.js → chunk-BBEOFKLY.js} +1 -1
  81. package/dist/{chunk-22S6LG6D.js → chunk-BCDG4N6L.js} +1 -1
  82. package/dist/{chunk-DFDDRKIJ.js → chunk-BCUQXILM.js} +1 -1
  83. package/dist/chunk-BGRT775Y.js +2 -0
  84. package/dist/{chunk-5TFTSYOD.js → chunk-BVTNGW5S.js} +1 -1
  85. package/dist/{chunk-TVJRENCQ.js → chunk-BWUU565Y.js} +9 -9
  86. package/dist/{chunk-TFMC2WAS.js → chunk-BZBMZDLD.js} +1 -1
  87. package/dist/chunk-BZG5E7GF.js +6 -0
  88. package/dist/{chunk-SBHFEWR6.js → chunk-C4UL2UNR.js} +1 -1
  89. package/dist/{chunk-DOCUM3K7.js → chunk-CAG3TSV2.js} +1 -1
  90. package/dist/chunk-CE5BARZI.js +16 -0
  91. package/dist/chunk-CJB73MHF.js +2 -0
  92. package/dist/{chunk-N6DTTOB6.js → chunk-CKPVXDKX.js} +3 -3
  93. package/dist/chunk-CO5RKOVX.js +20 -0
  94. package/dist/chunk-CRXFSN5K.js +20 -0
  95. package/dist/chunk-CVNJSD2J.js +18 -0
  96. package/dist/{chunk-RYBJ6MMM.js → chunk-CXMTDYVI.js} +1 -1
  97. package/dist/chunk-D7IXMMZT.js +9 -0
  98. package/dist/{chunk-LBLV64XG.js → chunk-DLNYXXNE.js} +2 -2
  99. package/dist/chunk-DNWV6N4P.js +5 -0
  100. package/dist/{chunk-KZHPX4FM.js → chunk-DWBZ3Z34.js} +2 -2
  101. package/dist/chunk-DZTAGMNY.js +100 -0
  102. package/dist/chunk-E4E7MACR.js +20 -0
  103. package/dist/{chunk-DZNG34DC.js → chunk-EFFF3FCS.js} +23 -23
  104. package/dist/{chunk-CPK7JTN3.js → chunk-EGAV5LSX.js} +1 -1
  105. package/dist/{chunk-M5P6A7KS.js → chunk-ENL5L6NR.js} +1 -1
  106. package/dist/chunk-EW3L4W2I.js +14 -0
  107. package/dist/{chunk-6GWZ5UPX.js → chunk-EWVOGTEX.js} +1 -1
  108. package/dist/{chunk-I7HDD4IM.js → chunk-EXNAAHN4.js} +2 -2
  109. package/dist/{chunk-YDYDR72S.js → chunk-F4DIVARP.js} +1 -1
  110. package/dist/{chunk-WYN5KVU4.js → chunk-F7F6Z64G.js} +3 -3
  111. package/dist/{chunk-5PY4H4ZJ.js → chunk-FBUUXK5G.js} +1 -1
  112. package/dist/chunk-FKNJSD6B.js +14 -0
  113. package/dist/{chunk-D7FT2PXG.js → chunk-FLEG5KP5.js} +5 -5
  114. package/dist/{chunk-4OFD6ICH.js → chunk-FLQZ7GQ3.js} +10 -10
  115. package/dist/{chunk-DXTKNHWG.js → chunk-FPGRKHUW.js} +12 -12
  116. package/dist/chunk-G6CTTBKE.js +9 -0
  117. package/dist/{chunk-3CST4ZDP.js → chunk-GS5AISRS.js} +4 -4
  118. package/dist/{chunk-4Y4PWKMM.js → chunk-GVC535IA.js} +3 -3
  119. package/dist/chunk-HEEY4TVP.js +8 -0
  120. package/dist/chunk-HJWTWS5E.js +8 -0
  121. package/dist/{chunk-VH6GB73Q.js → chunk-HL6JSDN3.js} +1 -1
  122. package/dist/chunk-HNQPF5QZ.js +2 -0
  123. package/dist/{chunk-WRORJNS5.js → chunk-HQMN5THW.js} +10 -10
  124. package/dist/chunk-HUF34LSW.js +15 -0
  125. package/dist/chunk-IB4333CI.js +14 -0
  126. package/dist/chunk-IGNZULKG.js +17 -0
  127. package/dist/{chunk-EZULNHQH.js → chunk-IJIESSTX.js} +5 -5
  128. package/dist/{chunk-S7VSXUKS.js → chunk-IJWFKUYA.js} +4 -4
  129. package/dist/chunk-IK2WXW2E.js +27 -0
  130. package/dist/{chunk-UZMZ2EDW.js → chunk-IMOPDLMA.js} +1 -1
  131. package/dist/{chunk-2FLYC6I2.js → chunk-IN4KV3SJ.js} +1 -1
  132. package/dist/chunk-IPTCV6CQ.js +69 -0
  133. package/dist/{chunk-ZWAVSUWT.js → chunk-IQWIYZB5.js} +2 -2
  134. package/dist/chunk-IX6QMUJQ.js +9 -0
  135. package/dist/{chunk-4G5VLI7E.js → chunk-JDQGHQ2C.js} +1 -1
  136. package/dist/{chunk-3S3DYAVB.js → chunk-JIW5CJXC.js} +2 -2
  137. package/dist/{chunk-P42YNSKI.js → chunk-JKDEE35P.js} +1 -1
  138. package/dist/{chunk-CKZ6ZDU5.js → chunk-JS6ZSEZJ.js} +1 -1
  139. package/dist/chunk-K4D63NP3.js +12 -0
  140. package/dist/chunk-KEK47CP3.js +12 -0
  141. package/dist/chunk-KWT6GT4M.js +29 -0
  142. package/dist/chunk-L4TN4EWK.js +1 -0
  143. package/dist/{chunk-SR4XAYLC.js → chunk-L67VXJMF.js} +1 -1
  144. package/dist/chunk-LAEXWXJA.js +9 -0
  145. package/dist/{chunk-D323R2FT.js → chunk-LNARMEEZ.js} +1 -1
  146. package/dist/{chunk-CZ25A5RS.js → chunk-LNQVTH5S.js} +1 -1
  147. package/dist/chunk-LUWRPPJA.js +7 -0
  148. package/dist/chunk-M554OMPA.js +2 -0
  149. package/dist/{chunk-BVW5U7QQ.js → chunk-M5GMIQ47.js} +3 -3
  150. package/dist/{chunk-GX2GSDJP.js → chunk-MAMWQCJ6.js} +1 -1
  151. package/dist/{chunk-ZTB6EMC7.js → chunk-MV6WDGB6.js} +1 -1
  152. package/dist/chunk-MWIT4UN2.js +14 -0
  153. package/dist/{chunk-JPRJQ6B7.js → chunk-N3JXHNID.js} +10 -10
  154. package/dist/{chunk-EYKUKN32.js → chunk-N7T63BVD.js} +4 -4
  155. package/dist/chunk-NHH2MXFU.js +2 -0
  156. package/dist/chunk-NHVXVHUR.js +23 -0
  157. package/dist/{chunk-EYX6KLCZ.js → chunk-NWCW22U6.js} +2 -2
  158. package/dist/{chunk-J47HXHSL.js → chunk-O5LQBBW2.js} +7 -7
  159. package/dist/{chunk-IHQX4GYD.js → chunk-OQ2EDMB2.js} +1 -1
  160. package/dist/chunk-OUSKOWNP.js +12 -0
  161. package/dist/chunk-OV2SWQPT.js +22 -0
  162. package/dist/chunk-OX2DOOOI.js +8 -0
  163. package/dist/{chunk-6KO5VTL7.js → chunk-OZAAIE4E.js} +1 -1
  164. package/dist/chunk-P3OBE43Q.js +8 -0
  165. package/dist/{chunk-Z2YGQBLZ.js → chunk-P3Y5RFI4.js} +2 -2
  166. package/dist/{chunk-2UXAI77F.js → chunk-P4XTWAKJ.js} +1 -1
  167. package/dist/{chunk-7PCI6AUU.js → chunk-PB7G6CJ7.js} +1 -1
  168. package/dist/chunk-PDB5W7VI.js +6 -0
  169. package/dist/chunk-PDXPMHG3.js +4 -0
  170. package/dist/chunk-POCQ7ZL4.js +3 -0
  171. package/dist/chunk-PVR4KU7H.js +7 -0
  172. package/dist/{chunk-2RBWQVDC.js → chunk-PYLNMN6E.js} +13 -13
  173. package/dist/chunk-Q7KTTDUS.js +11 -0
  174. package/dist/{chunk-3PGK3VFS.js → chunk-QC6OK3ED.js} +1 -1
  175. package/dist/{chunk-MEJK6PBN.js → chunk-QSJR7EI7.js} +3 -3
  176. package/dist/chunk-QWHQJNKL.js +1 -0
  177. package/dist/chunk-QXWY3CJ2.js +11 -0
  178. package/dist/{chunk-QDLGU62M.js → chunk-QZKWIVZW.js} +1 -1
  179. package/dist/chunk-R2VKEMZH.js +3 -0
  180. package/dist/{chunk-EXWGPXOS.js → chunk-RBD7SB6M.js} +1 -1
  181. package/dist/chunk-RC6UHOAV.js +4 -0
  182. package/dist/{chunk-45S6M77O.js → chunk-RULVWW4A.js} +6 -6
  183. package/dist/chunk-RUTUVS4H.js +1 -0
  184. package/dist/{chunk-MAOJENIB.js → chunk-RWJCKZEY.js} +1 -1
  185. package/dist/chunk-S4Z657L6.js +6 -0
  186. package/dist/{chunk-Q3OCGLW7.js → chunk-SOP447EP.js} +2 -2
  187. package/dist/{chunk-CDRXZBVR.js → chunk-TBPHW42V.js} +1 -1
  188. package/dist/chunk-TLRCTNUF.js +6 -0
  189. package/dist/{chunk-KWX6NAOR.js → chunk-TVL3JPMY.js} +1 -1
  190. package/dist/{chunk-VYXDI63I.js → chunk-U4OGRIP6.js} +1 -1
  191. package/dist/chunk-U5N6PSXO.js +9 -0
  192. package/dist/{chunk-SZIENHKR.js → chunk-UKDJUYIV.js} +1 -1
  193. package/dist/chunk-UQYNPYF4.js +1 -0
  194. package/dist/chunk-URHGHXDN.js +1 -0
  195. package/dist/{chunk-6WWAQC5V.js → chunk-VG2R6PZV.js} +1 -1
  196. package/dist/{chunk-RWGSMZGS.js → chunk-VVAJ23SD.js} +1 -1
  197. package/dist/chunk-VVGL5O4F.js +8 -0
  198. package/dist/chunk-VVJIKS47.js +1 -0
  199. package/dist/chunk-WE7CYRZT.js +7 -0
  200. package/dist/{chunk-B2XDNBR3.js → chunk-WFHYU66E.js} +1 -1
  201. package/dist/{chunk-NGBT7AHL.js → chunk-WH3JHMEA.js} +8 -8
  202. package/dist/chunk-WUKN5WUM.js +11 -0
  203. package/dist/{chunk-ET2EF5CI.js → chunk-X7PM7JOD.js} +1 -1
  204. package/dist/{chunk-4NXMMWL6.js → chunk-XD34TCRG.js} +1 -1
  205. package/dist/chunk-XI4HKNFI.js +19 -0
  206. package/dist/{chunk-Y4MI6NRI.js → chunk-XNWQ72WA.js} +1 -1
  207. package/dist/{chunk-Y6IQYQYN.js → chunk-XS4HFUTW.js} +2 -2
  208. package/dist/{chunk-Y5T257HX.js → chunk-XZYAFTW4.js} +4 -4
  209. package/dist/{chunk-KFJIO5ED.js → chunk-Y44ABEW3.js} +1 -1
  210. package/dist/chunk-YWGC7J6B.js +11 -0
  211. package/dist/{chunk-MMFJBWJC.js → chunk-Z3JW77LH.js} +1 -1
  212. package/dist/chunk-ZAU2HIRH.js +21 -0
  213. package/dist/{chunk-Y53KNQKL.js → chunk-ZDMZM7HD.js} +2 -2
  214. package/dist/{chunk-ZCHBOAPA.js → chunk-ZHHEMSOD.js} +2 -2
  215. package/dist/chunk-ZOHQVSB3.js +27 -0
  216. package/dist/{chunk-G63BCOQ6.js → chunk-ZTL2RPNY.js} +1 -1
  217. package/dist/{chunk-U4BMS5EV.js → chunk-ZYDZY6ED.js} +1 -1
  218. package/dist/data/DataTable.js +1 -1
  219. package/dist/data/Kanban.js +1 -1
  220. package/dist/data/ListFooter.js +1 -1
  221. package/dist/data/ListLoadError.js +1 -1
  222. package/dist/data/Pagination.js +1 -1
  223. package/dist/file-intake/index.js +1 -1
  224. package/dist/forms/AlignmentGrid.js +1 -1
  225. package/dist/forms/BorderInput.js +1 -1
  226. package/dist/forms/BrandAssetEditor.js +1 -1
  227. package/dist/forms/Button.js +1 -1
  228. package/dist/forms/Calendar.js +1 -1
  229. package/dist/forms/ColorPicker.js +1 -1
  230. package/dist/forms/ComposerAttachments.js +1 -1
  231. package/dist/forms/CornersInput.js +1 -1
  232. package/dist/forms/DatePicker.js +1 -1
  233. package/dist/forms/DateRangePicker.js +1 -1
  234. package/dist/forms/DateTimePicker.js +1 -1
  235. package/dist/forms/DisplayChips.js +1 -1
  236. package/dist/forms/FilePicker.js +1 -1
  237. package/dist/forms/FormErrorSummary.js +1 -1
  238. package/dist/forms/FormField.js +1 -1
  239. package/dist/forms/IconButton.js +1 -1
  240. package/dist/forms/IconPicker.js +1 -1
  241. package/dist/forms/ImageFocusPoint.js +1 -1
  242. package/dist/forms/Input.js +1 -1
  243. package/dist/forms/InputNumber.js +1 -1
  244. package/dist/forms/LinkPicker.js +1 -1
  245. package/dist/forms/MediaLibrary.d.ts +6 -1
  246. package/dist/forms/MediaLibrary.js +1 -1
  247. package/dist/forms/MediaUploadField.js +1 -1
  248. package/dist/forms/MediaUploadGrid.js +1 -1
  249. package/dist/forms/MediaUsedInList.js +1 -1
  250. package/dist/forms/NumericKeypad.js +1 -1
  251. package/dist/forms/PictureTiles.js +1 -1
  252. package/dist/forms/PositionInput.js +1 -1
  253. package/dist/forms/RadioGroup.js +1 -1
  254. package/dist/forms/Segmented.js +1 -1
  255. package/dist/forms/Select.d.ts +6 -0
  256. package/dist/forms/Select.js +1 -1
  257. package/dist/forms/SidesInput.js +1 -1
  258. package/dist/forms/Slider.js +1 -1
  259. package/dist/forms/Snippet.js +1 -1
  260. package/dist/forms/SplitButton.js +1 -1
  261. package/dist/forms/TagInput.js +1 -1
  262. package/dist/forms/TextToolbar.js +1 -1
  263. package/dist/forms/Textarea.js +1 -1
  264. package/dist/forms/TimePicker.js +1 -1
  265. package/dist/forms/WidthsBar.d.ts +7 -8
  266. package/dist/forms/WidthsBar.js +1 -1
  267. package/dist/forms/buttonStyles.js +1 -1
  268. package/dist/forms/mediaLibraryMenu.js +1 -1
  269. package/dist/forms/mediaMoveItems.js +1 -1
  270. package/dist/forms/styles.d.ts +2 -2
  271. package/dist/forms/styles.js +1 -1
  272. package/dist/forms/textAlign.js +1 -1
  273. package/dist/forms/useFileIntake.js +1 -1
  274. package/dist/hooks/useTheme.d.ts +1 -1
  275. package/dist/icons/efficient-glyphs.js +1 -1
  276. package/dist/icons/efficient-looks.js +1 -1
  277. package/dist/icons/efficient.js +1 -1
  278. package/dist/icons/glyphs/SpinnerIcon.js +1 -1
  279. package/dist/icons/looks/map.js +1 -1
  280. package/dist/icons/sets.js +1 -1
  281. package/dist/index.d.ts +3 -1
  282. package/dist/index.js +695 -695
  283. package/dist/locales/zh-Hans.js +1 -1
  284. package/dist/map/index.js +12 -12
  285. package/dist/markdown/index.js +5 -5
  286. package/dist/page-tabs/index.js +5 -5
  287. package/dist/pdf/index.js +1 -1
  288. package/dist/shell/Accordion.js +1 -1
  289. package/dist/shell/AppUpdateBanner.js +1 -1
  290. package/dist/shell/Avatar.js +1 -1
  291. package/dist/shell/Banner.js +1 -1
  292. package/dist/shell/Breadcrumbs.js +1 -1
  293. package/dist/shell/BudgetBar.js +1 -1
  294. package/dist/shell/Card.js +1 -1
  295. package/dist/shell/ColoredBadge.js +1 -1
  296. package/dist/shell/ConfirmDialog.js +1 -1
  297. package/dist/shell/ContainerFillChart.js +1 -1
  298. package/dist/shell/ContextMenu.js +1 -1
  299. package/dist/shell/CountBadge.js +1 -1
  300. package/dist/shell/Dialog.js +1 -1
  301. package/dist/shell/Drawer.js +1 -1
  302. package/dist/shell/DropdownMenu.js +1 -1
  303. package/dist/shell/EditableGrid.js +1 -1
  304. package/dist/shell/EmptyState.js +1 -1
  305. package/dist/shell/EmptyValue.js +1 -1
  306. package/dist/shell/GlobalSearch.js +1 -1
  307. package/dist/shell/HelpCenter.js +1 -1
  308. package/dist/shell/IconRail.js +1 -1
  309. package/dist/shell/ImageLightbox.js +1 -1
  310. package/dist/shell/ItemCount.d.ts +20 -0
  311. package/dist/shell/ItemCount.js +1 -0
  312. package/dist/shell/Kbd.js +1 -1
  313. package/dist/shell/LanguageSelect.js +1 -1
  314. package/dist/shell/Markdown.js +1 -1
  315. package/dist/shell/MetricBar.js +1 -1
  316. package/dist/shell/MetricBarLegend.js +1 -1
  317. package/dist/shell/MilestoneTimeline.js +1 -1
  318. package/dist/shell/PageHeader.js +1 -1
  319. package/dist/shell/Popover.js +1 -1
  320. package/dist/shell/PopupMenu.js +1 -1
  321. package/dist/shell/ProductionTimeline.js +1 -1
  322. package/dist/shell/ResizeHandle.js +1 -1
  323. package/dist/shell/Result.js +1 -1
  324. package/dist/shell/SearchableSelect.js +1 -1
  325. package/dist/shell/SettingReset.js +1 -1
  326. package/dist/shell/SettingRow.js +1 -1
  327. package/dist/shell/SidebarLayout.js +1 -1
  328. package/dist/shell/SidebarNav.d.ts +19 -5
  329. package/dist/shell/SidebarNav.js +1 -1
  330. package/dist/shell/SortableList.js +1 -1
  331. package/dist/shell/Spinner.js +1 -1
  332. package/dist/shell/Statistic.js +1 -1
  333. package/dist/shell/StatusBadge.js +1 -1
  334. package/dist/shell/StepChain.js +1 -1
  335. package/dist/shell/Tabs.js +1 -1
  336. package/dist/shell/TimeAgo.js +1 -1
  337. package/dist/shell/TimelineTrack.js +1 -1
  338. package/dist/shell/Tooltip.js +1 -1
  339. package/dist/shell/TopNav.js +1 -1
  340. package/dist/shell/TransferProgress.js +1 -1
  341. package/dist/shell/Tree.d.ts +15 -6
  342. package/dist/shell/Tree.js +1 -1
  343. package/dist/shell/language.js +1 -1
  344. package/dist/shell/strings.d.ts +24 -2
  345. package/dist/shell/strings.js +1 -1
  346. package/dist/shell/toast.js +1 -1
  347. package/dist/telemetry/index.js +1 -1
  348. package/dist/templates/AuthScreen.js +1 -1
  349. package/dist/templates/ChatTemplate.js +1 -1
  350. package/dist/templates/CheckoutTemplate.js +1 -1
  351. package/dist/templates/DashboardTemplate.js +1 -1
  352. package/dist/templates/DataTablePage.js +1 -1
  353. package/dist/templates/EmailTemplate.js +1 -1
  354. package/dist/templates/ErrorBoundary.d.ts +1 -1
  355. package/dist/templates/ErrorBoundary.js +1 -1
  356. package/dist/templates/ErrorPage.js +1 -1
  357. package/dist/templates/FormLayoutPage.js +1 -1
  358. package/dist/templates/GalleryTemplate.js +1 -1
  359. package/dist/themes.css +101 -0
  360. package/dist/tokens/colour.d.ts +42 -0
  361. package/dist/tokens/colour.js +1 -0
  362. package/dist/tokens/elevation.d.ts +3 -1
  363. package/dist/tokens/elevation.js +1 -1
  364. package/dist/ui/index.d.ts +2 -0
  365. package/dist/ui/index.js +1 -1
  366. package/dist/ui.css +266 -24
  367. package/dist/version.js +1 -1
  368. package/package.json +1 -1
  369. package/dist/Browser-FTCJCMD3.js +0 -43
  370. package/dist/Calculator-7O7HXEKH.js +0 -29
  371. package/dist/CurrencyConverter-IVJJCYZ7.js +0 -21
  372. package/dist/Files-YWBBU2FZ.js +0 -87
  373. package/dist/Notepad-KKKCTUB3.js +0 -25
  374. package/dist/PdfViewer-KJCJ6EPG.js +0 -1
  375. package/dist/Preview-CHV67AA7.js +0 -177
  376. package/dist/Sidebar-6I4FC5AK.js +0 -43
  377. package/dist/Spreadsheet-SNLKLOLL.js +0 -37
  378. package/dist/Stock-PHY6Z26A.js +0 -16
  379. package/dist/Weather-YQA5CAFQ.js +0 -60
  380. package/dist/WorldClock-J6L7FWI2.js +0 -32
  381. package/dist/chunk-2NMT3Y5H.js +0 -20
  382. package/dist/chunk-3WC6ITJ3.js +0 -11
  383. package/dist/chunk-3ZHFKOFX.js +0 -14
  384. package/dist/chunk-454DAGYG.js +0 -19
  385. package/dist/chunk-4CANQ3B3.js +0 -1
  386. package/dist/chunk-4CFOKYVR.js +0 -12
  387. package/dist/chunk-4IU5BSVE.js +0 -2
  388. package/dist/chunk-4IVT244O.js +0 -8
  389. package/dist/chunk-4SZDP3JF.js +0 -12
  390. package/dist/chunk-63EK6S3W.js +0 -3
  391. package/dist/chunk-64WSMLXG.js +0 -2
  392. package/dist/chunk-6BCFVOG7.js +0 -22
  393. package/dist/chunk-6NMDKOQA.js +0 -7
  394. package/dist/chunk-7C56GLLI.js +0 -28
  395. package/dist/chunk-7DKPJUGU.js +0 -2
  396. package/dist/chunk-7MSFHQAY.js +0 -8
  397. package/dist/chunk-7OCNF4AI.js +0 -5
  398. package/dist/chunk-AAW27HJY.js +0 -3
  399. package/dist/chunk-BI6ZLD4X.js +0 -11
  400. package/dist/chunk-BIYL7CEI.js +0 -2
  401. package/dist/chunk-BOBUSE33.js +0 -2
  402. package/dist/chunk-BUGAWNOC.js +0 -14
  403. package/dist/chunk-CRLSG5AY.js +0 -9
  404. package/dist/chunk-DITCVBR7.js +0 -15
  405. package/dist/chunk-DODH46ZQ.js +0 -8
  406. package/dist/chunk-E5ALJIXV.js +0 -9
  407. package/dist/chunk-E6UCGCOC.js +0 -1
  408. package/dist/chunk-EGDJEY4K.js +0 -27
  409. package/dist/chunk-EL2RLUT6.js +0 -20
  410. package/dist/chunk-ET32NQHX.js +0 -2
  411. package/dist/chunk-EZ3BQ6PK.js +0 -18
  412. package/dist/chunk-FRPNTDP4.js +0 -8
  413. package/dist/chunk-GATKJSGL.js +0 -8
  414. package/dist/chunk-GNPTNAZH.js +0 -4
  415. package/dist/chunk-JPP7UWQA.js +0 -4
  416. package/dist/chunk-K7KQDPLW.js +0 -27
  417. package/dist/chunk-K7U4RWXJ.js +0 -1
  418. package/dist/chunk-KJY57QPT.js +0 -100
  419. package/dist/chunk-LGAN7DNC.js +0 -9
  420. package/dist/chunk-MEYYQC43.js +0 -8
  421. package/dist/chunk-MVP6Q6KV.js +0 -1
  422. package/dist/chunk-NDO24PK6.js +0 -21
  423. package/dist/chunk-OSA24YH6.js +0 -19
  424. package/dist/chunk-P5BOTIJU.js +0 -6
  425. package/dist/chunk-PCQPV6MS.js +0 -6
  426. package/dist/chunk-PF3ANJFI.js +0 -1
  427. package/dist/chunk-PXEEDRPW.js +0 -14
  428. package/dist/chunk-Q23EHOXW.js +0 -17
  429. package/dist/chunk-Q5MD3VY6.js +0 -3
  430. package/dist/chunk-QR4RM7PO.js +0 -1
  431. package/dist/chunk-REVC6YPT.js +0 -7
  432. package/dist/chunk-RSO67DWS.js +0 -8
  433. package/dist/chunk-S2OIRC5H.js +0 -12
  434. package/dist/chunk-SB7OTZI4.js +0 -69
  435. package/dist/chunk-SRKSGUGT.js +0 -23
  436. package/dist/chunk-SURSVJA2.js +0 -6
  437. package/dist/chunk-TH6EAYMO.js +0 -29
  438. package/dist/chunk-TIQKDAON.js +0 -11
  439. package/dist/chunk-TVDVVPTN.js +0 -1
  440. package/dist/chunk-VU6VPKM3.js +0 -11
  441. package/dist/chunk-W5M6P4DZ.js +0 -8
  442. package/dist/chunk-X6PPP6NX.js +0 -14
  443. package/dist/chunk-XLD53X4P.js +0 -9
  444. package/dist/chunk-XSPDPN5O.js +0 -26
  445. package/dist/chunk-Y37PBT4H.js +0 -9
  446. package/dist/chunk-YAEUF3GP.js +0 -1
  447. package/dist/chunk-YALPQIBR.js +0 -7
  448. package/dist/chunk-ZK2SULCA.js +0 -16
  449. package/dist/chunk-ZOSIPTXM.js +0 -6
  450. package/dist/chunk-ZSFUNXRD.js +0 -5
  451. /package/dist/{chunk-KJRYEKQP.js → chunk-DSIDJYH7.js} +0 -0
@@ -0,0 +1,69 @@
1
+ import{toast_default as e}from"./chunk-XD34TCRG.js";import{useShellStrings as t}from"./chunk-QWHQJNKL.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),P=r(null),$=t().annotator,E=r($);E.current=$;const[I,W]=o("select"),[S,B]=o(u[0]),[R,j]=o(4),[H,T]=o(24),[F,U]=o(h[0].id),[A,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[G,q]=o(null),[Q,Y]=o(null),[_,J]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(T(Me.size),U(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),q(Me.borderColor),Y(Me.background),J(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error(E.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(I,t.start,n,S,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:S,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),W("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:S,stroke:R};re(e=>[...e,t]),ie(t.id),W("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,I,S,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:K,underline:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{q(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},$e=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:S,size:H,font:F,bold:A,italic:K,underline:X,borderColor:G,background:Q,padding:_};re(t=>[...t,e]),ie(e.id),W("select")}ye(null)},Ee=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await Ee();t&&t.toBlob(t=>{if(!t)return void e.error(E.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error(E.current.clipboardUnsupported);const t=await Ee();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success(E.current.copied)}catch{e.error(E.current.copyRefused)}else e.error(E.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:$.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:$.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:$.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:$.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:$.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:$.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:$.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:$.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[$]),We=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),Se=Me?.type??("select"===I?null:I),Be="rect"===Se||"circle"===Se||"arrow"===Se||"draw"===Se,Re="rect"===Se,je="text"===Se;/* @__PURE__ */
2
+ return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{W(e.id),ie(null)},title:e.label,className:We(I===e.id),children:e.icon},e.id)),
4
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
+ /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(S===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
6
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
7
+ /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
8
+ /* @__PURE__ */c("span",{children:$.weight}),
9
+ /* @__PURE__ */c("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&re(e=>e.map(e=>e.id!==oe?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
10
+ /* @__PURE__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
11
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
12
+ /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
13
+ /* @__PURE__ */c("span",{children:$.radius}),
14
+ /* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
15
+ /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
16
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
+ /* @__PURE__ */c("select",{value:F,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:$[e.name]},e.id))}),
18
+ /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(A),title:$.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:$.boldLetter})}),
19
+ /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:$.italic,children:/* @__PURE__ */c("span",{className:"italic",children:$.italicLetter})}),
20
+ /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(X),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.underlineLetter})}),
21
+ /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
+ /* @__PURE__ */c("span",{children:$.size}),
23
+ /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),T(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
+ /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
25
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
+ /* @__PURE__ */c("span",{children:$.border}),G?/* @__PURE__ */s(d,{children:[
27
+ /* @__PURE__ */c("input",{type:"color",value:G,onChange:e=>De(e.target.value),title:$.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
+ /* @__PURE__ */c("button",{onClick:()=>De(null),title:$.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(S),title:$.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
29
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
+ /* @__PURE__ */c("span",{children:$.fill}),Q?/* @__PURE__ */s(d,{children:[
31
+ /* @__PURE__ */c("input",{type:"color",value:Q,onChange:e=>Pe(e.target.value),title:$.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
+ /* @__PURE__ */c("button",{onClick:()=>Pe(null),title:$.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:$.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
33
+ /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
+ /* @__PURE__ */c("span",{children:$.padding}),
35
+ /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),J(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
+ /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
37
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
38
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.zoomOut,children:"−"}),
39
+ /* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
40
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.zoomIn,children:"+"}),
41
+ /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.fit}),
42
+ /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
+ /* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:$.undo}),
44
+ /* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */s(d,{children:[
45
+ /* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{P.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:$.applyCrop}),
46
+ /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:$.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:$.cancel}),
47
+ /* @__PURE__ */c("button",{onClick:async()=>{const t=await Ee();t?t.toBlob(t=>{t?m(t):e.error(E.current.exportFailed)},"image/png"):e.error(E.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:$.apply})]})]})]}),
48
+ /* @__PURE__ */c("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ve&&ae&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ve.w,height:ve.h},children:[
49
+ /* @__PURE__ */c("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
50
+ /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void $e();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:S,stroke:R});pe(b(I,t,t,S,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:S,size:H,font:h.find(e=>e.id===F)?.css??h[0].css,bold:A,italic:K,underline:X,borderColor:G,background:Q,padding:_,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:$e,onCancel:()=>ye(null)})]})}),
51
+ /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
52
+ /* @__PURE__ */c("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,n)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===n?0:1.2*e.size,children:t},n))})]})}/* @__PURE__ */
53
+ return s("g",{children:[x,t&&!n&&/* @__PURE__ */s(d,{children:[
54
+ /* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/r,strokeDasharray:`${6/r},${4/r}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:r,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:n}){const r=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
55
+ return s(d,{children:[
56
+ /* @__PURE__ */c("circle",{cx:e.x1,cy:e.y1,r:r,...i("grab"),onPointerDown:e=>n(e,"start")}),
57
+ /* @__PURE__ */c("circle",{cx:e.x2,cy:e.y2,r:r,...i("grab"),onPointerDown:e=>n(e,"end")})]});if("text"===e.type||"draw"===e.type)return null;const a=e.x,l=e.y,u=e.w,h=e.h;/* @__PURE__ */
58
+ return s(d,{children:[
59
+ /* @__PURE__ */c("circle",{cx:a,cy:l,r:r,...i("nwse-resize"),onPointerDown:e=>n(e,"nw")}),
60
+ /* @__PURE__ */c("circle",{cx:a+u,cy:l,r:r,...i("nesw-resize"),onPointerDown:e=>n(e,"ne")}),
61
+ /* @__PURE__ */c("circle",{cx:a+u,cy:l+h,r:r,...i("nwse-resize"),onPointerDown:e=>n(e,"se")}),
62
+ /* @__PURE__ */c("circle",{cx:a,cy:l+h,r:r,...i("nesw-resize"),onPointerDown:e=>n(e,"sw")})]})}function g({anno:e,interactive:t}){const n=Math.max(12,4*e.stroke),r=Math.atan2(e.y2-e.y1,e.x2-e.x1),o=r+Math.PI-Math.PI/7,i=r+Math.PI+Math.PI/7,a=`M${e.x2},${e.y2} L${e.x2+n*Math.cos(o)},${e.y2+n*Math.sin(o)} L${e.x2+n*Math.cos(i)},${e.y2+n*Math.sin(i)} Z`;/* @__PURE__ */
63
+ return s("g",{...t,children:[
64
+ /* @__PURE__ */c("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round"}),
65
+ /* @__PURE__ */c("path",{d:a,fill:e.color})]})}function f({rect:e,imageSize:t}){/* @__PURE__ */
66
+ return s("g",{pointerEvents:"none",children:[
67
+ /* @__PURE__ */c("path",{d:`M0,0 H${t.w} V${t.h} H0 Z M${e.x},${e.y} V${e.y+e.h} H${e.x+e.w} V${e.y} Z`,fill:"rgba(0,0,0,0.45)",fillRule:"evenodd"}),
68
+ /* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"8,6"})]})}function w({pendingText:e,color:n,size:o,font:i,bold:l,italic:s,underline:d,borderColor:u,background:h,padding:p,scale:x,onChange:y,onCommit:m,onCancel:g}){const f=r(null),w=t().annotator;a(()=>{const e=requestAnimationFrame(()=>{f.current?.focus(),f.current?.select?.()});return()=>cancelAnimationFrame(e)},[]);const b=()=>m(f.current?.value),v=u?Math.max(1,Math.round(o/12)):0;/* @__PURE__ */
69
+ return c("div",{style:{position:"absolute",left:e.x*x+"px",top:e.y*x+"px",transform:"translateY(-2px)",zIndex:5},onPointerDown:e=>e.stopPropagation(),children:/* @__PURE__ */c("textarea",{ref:f,value:e.value,onChange:e=>y(e.target.value),onBlur:b,onKeyDown:e=>{"Escape"===e.key?(e.preventDefault(),g()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),b())},placeholder:w.textPlaceholder,rows:1,className:"outline-none resize-none shadow-(--elevation-panel)",style:{color:n,fontSize:o*x+"px",fontFamily:i,fontWeight:l?700:400,fontStyle:s?"italic":"normal",textDecoration:d?"underline":void 0,minWidth:80,padding:p*x+"px",borderRadius:Math.min(8,p)*x+"px",border:u?`${v*x}px solid ${u}`:"1px dashed #60a5fa",background:h??"rgba(255,255,255,0.95)"}})})}function b(e,t,n,r,o,i){if("rect"===e){const e=M(t,n);return{id:"",type:"rect",x:e.x,y:e.y,w:e.w,h:e.h,color:r,stroke:o,radius:i}}if("circle"===e){const e=M(t,n);return{id:"",type:"circle",x:e.x,y:e.y,w:e.w,h:e.h,color:r,stroke:o}}if("arrow"===e)return{id:"",type:"arrow",x1:t.x,y1:t.y,x2:n.x,y2:n.y,color:r,stroke:o};if("mosaic"===e){const e=M(t,n);return{id:"",type:"mosaic",x:e.x,y:e.y,w:e.w,h:e.h}}return null}function v(e,t,n){return"arrow"===e.type?{...e,x1:e.x1+t,y1:e.y1+n,x2:e.x2+t,y2:e.y2+n}:"draw"===e.type?{...e,points:e.points.map(e=>({x:e.x+t,y:e.y+n}))}:(e.type,{...e,x:e.x+t,y:e.y+n})}function k(e){if("arrow"===e.type){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}if("draw"===e.type){if(0===e.points.length)return{x:0,y:0,w:0,h:0};let t=e.points[0].x,n=e.points[0].x,r=e.points[0].y,o=e.points[0].y;for(const i of e.points)i.x<t&&(t=i.x),i.x>n&&(n=i.x),i.y<r&&(r=i.y),i.y>o&&(o=i.y);return{x:t,y:r,w:n-t,h:o-r}}if("text"===e.type){const t=e.text.split("\n"),n=t.reduce((e,t)=>Math.max(e,t.length),0);return{x:e.x,y:e.y,w:n*e.size*.55,h:t.length*e.size*1.2}}return{x:e.x,y:e.y,w:e.w,h:e.h}}function M(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function N(e){if(0===e.length)return"";let t=`M ${e[0].x} ${e[0].y}`;for(let n=1;n<e.length;n++)t+=` L ${e[n].x} ${e[n].y}`;return t}function C(e,t){const n=Math.round(Math.max(0,t.x)),r=Math.round(Math.max(0,t.y)),o=Math.round(Math.min(e.canvas.width-n,t.w)),i=Math.round(Math.min(e.canvas.height-r,t.h));if(o<2||i<2)return;const a=e.getImageData(n,r,o,i);for(let e=0;e<i;e+=12)for(let t=0;t<o;t+=12){let n=0,r=0,l=0,c=0,s=0;const d=Math.min(12,o-t),u=Math.min(12,i-e);for(let i=0;i<u;i++)for(let u=0;u<d;u++){const d=4*((e+i)*o+(t+u));n+=a.data[d],r+=a.data[d+1],l+=a.data[d+2],c+=a.data[d+3],s++}n=Math.round(n/s),r=Math.round(r/s),l=Math.round(l/s),c=Math.round(c/s);for(let i=0;i<u;i++)for(let s=0;s<d;s++){const d=4*((e+i)*o+(t+s));a.data[d]=n,a.data[d+1]=r,a.data[d+2]=l,a.data[d+3]=c}}e.putImageData(a,n,r)}export{x as ImageAnnotator_default};
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-Y6IQYQYN.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-DXTKNHWG.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),j=a(),[A,S]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});S(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),Q=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{A&&!Q.current&&D&&(Q.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[A,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=A?{left:A.left,top:A.top,maxHeight:A.maxHeight,...A.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:j,role:"menu","aria-label":b,"aria-describedby":y?t(y,j):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:j,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-XS4HFUTW.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-FPGRKHUW.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),S=a(),[U,j]=d(null),A=s(w);A.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});j(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const W=s(null),C=s(!1);m(()=>(W.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||W.current?.focus?.({preventScroll:!0})}),[]),m(()=>{U&&!C.current&&D&&(C.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[U,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(A.current(),!0),()=>L.current),[]),m(()=>{const e=()=>A.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const F=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void A.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),T=U?{left:U.left,top:U.top,maxHeight:U.maxHeight,...U.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:T,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:S,role:"menu","aria-label":b,"aria-describedby":y?t(y,S):void 0,"data-context-menu":"",onKeyDown:F,children:[y&&e(y,{menuId:S,choose:e=>{e.disabled||(A.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>A.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
@@ -0,0 +1,9 @@
1
+ import{toISODate as e}from"./chunk-NHVXVHUR.js";import{Calendar as t}from"./chunk-N3JXHNID.js";import{inputClasses as r,PLACEHOLDER_INK as a}from"./chunk-AYZY3YNC.js";import{calendarNames as n}from"./chunk-5OTS2G3M.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-QWHQJNKL.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as N}from"react/jsx-runtime";var x=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(x.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!x.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function F(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var S=f(function({value:f,onChange:x,min:S,max:B,invalid:C,size:I,native:W,weekStartsOn:$,className:q="","aria-label":E,"aria-describedby":H,"aria-labelledby":J,id:L,name:M,disabled:O,placeholder:T,required:U,clearable:z,form:V,title:Y,tabIndex:G,autoFocus:P,onFocus:Q,onBlur:R,...X},A){const K=z??!U,Z=w(f),_=w(S),ee=w(B),te=c().datePicker,re=m(),ae=n(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!L&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!E&&(!!J||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),W)/* @__PURE__ */
2
+ return y("input",{ref:A,type:"date",lang:re,id:L,name:M,disabled:O,"aria-label":E,"aria-describedby":H,"aria-invalid":C||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>x?.(D(e.target.value)),className:r({invalid:C,size:I,className:q}),"aria-labelledby":J,required:U,form:V,title:Y,tabIndex:G,autoFocus:P,onFocus:Q,onBlur:R,...X});const he=Object.fromEntries(Object.entries(X).filter(([e])=>k.test(e)&&!j.has(e))),ve=X["aria-required"],ge=!!U||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,H].filter(Boolean).join(" ")||void 0,Ne=e(/* @__PURE__ */new Date),xe=(!_||Ne>=_)&&(!ee||Ne<=ee),ke=T??te.placeholder;/* @__PURE__ */
3
+ return N("div",{ref:oe,className:"relative",children:[
4
+ /* @__PURE__ */y("input",{ref:A,type:"hidden",name:M,form:V,value:Z}),
5
+ /* @__PURE__ */N("button",{ref:le,type:"button",...he,id:L,disabled:O,title:Y,tabIndex:G,autoFocus:P,onFocus:Q,onBlur:R,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":J,"aria-describedby":ye,"aria-label":E?`${E}${Z?`, ${F(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${r({invalid:C,size:I,className:q})} flex items-center justify-between text-left`,children:[
6
+ /* @__PURE__ */y("span",{className:Z?"text-ink-strongest":a,children:Z?F(Z,ae):ke}),
7
+ /* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:Z?F(Z,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
8
+ /* @__PURE__ */N("div",{ref:se,id:de,role:"dialog","aria-label":E??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
+ /* @__PURE__ */y(t,{value:Z||null,min:_||null,max:ee||null,weekStartsOn:$,onSelect:e=>{ie(!1),le.current?.focus(),x?.(D(e))}}),(K||xe)&&/* @__PURE__ */N("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[K&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),x?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),xe&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),x?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{S as DatePicker_default};
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";var r={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function o(e=!1,n=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",n].filter(Boolean).join(" ")}function i({size:e="md",selected:n,disabled:t=!1,block:o=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",r[e],n?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",t?"cursor-not-allowed opacity-40":"cursor-pointer",o?"flex-1":""].filter(Boolean).join(" ")}function l(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function a({icon:r,label:o}){/* @__PURE__ */
1
+ import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";var r={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function o(e=!1,n=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",n].filter(Boolean).join(" ")}function i({size:e="md",selected:n,disabled:t=!1,block:o=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",r[e],n?"bg-accent-fill text-on-accent shadow-sm rosh-segmented-on":"text-gray-600 hover:text-ink-strongest",t?"cursor-not-allowed opacity-40":"cursor-pointer",o?"flex-1":""].filter(Boolean).join(" ")}function l(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function a({icon:r,label:o}){/* @__PURE__ */
2
2
  return e(n,{children:[r?/* @__PURE__ */t("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:r}):null,o]})}export{a as ChoiceContent,i as choiceItemClass,l as choiceTipClass,o as choiceTrackClass};
@@ -1,4 +1,4 @@
1
- import{ColorPicker as e}from"./chunk-4OFD6ICH.js";import{InputNumber_default as t}from"./chunk-ZCHBOAPA.js";import{Segmented as l}from"./chunk-N6DTTOB6.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as a,Fragment as o,jsx as i}from"react/jsx-runtime";var s=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */i(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */i(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */i(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */i(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */i(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */i(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */i(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */i(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,k=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},C=(e,l,r,a,o,s)=>/* @__PURE__ */i("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */i(t,{value:a,onChange:s,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":l})}),O=n.map(j),S="number"==typeof d.width?d.width:O.every(e=>null!==e&&e===O[0])?O[0]:null,F=null===S&&O.some(e=>null!==e),H=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",I=e=>j(e)??("number"==typeof d.width?d.width:null),z=d.style??u.style;/* @__PURE__ */
2
- return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[C("left",b.sides.left,h.left,I("left"),String(u.sides.left),e=>k("left",e)),C("top",b.sides.top,h.top,I("top"),String(u.sides.top),e=>k("top",e)),C("right",b.sides.right,h.right,I("right"),String(u.sides.right),e=>k("right",e)),C("bottom",b.sides.bottom,h.bottom,I("bottom"),String(u.sides.bottom),e=>k("bottom",e))]}):C("all",b.width,h.all,S,F?"–":H,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */i("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */i(l,{block:!0,size:"sm",label:b.style,value:z,onChange:e=>{x||m({...d,style:e})},options:s.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
1
+ import{ColorPicker as e}from"./chunk-FLQZ7GQ3.js";import{InputNumber_default as t}from"./chunk-ZHHEMSOD.js";import{Segmented as l}from"./chunk-CKPVXDKX.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as a,Fragment as o,jsx as i}from"react/jsx-runtime";var s=["solid","dashed","dotted"],n=["top","right","bottom","left"];function d(e){const t=e??{},l="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:l]))}function m(e,t){const l=e??{},r=d(t),a=n.some(e=>"number"==typeof l[e]),o=n.map(e=>"number"==typeof l[e]?l[e]:"number"==typeof l.width?l.width:a?0:r[e]);return!o.every(e=>e===o[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */i(r,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */i(r,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */i(r,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */i(r,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */i(r,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */i(r,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */i(r,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */i(r,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:r,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:y=!0,min:g=0,max:v=20,step:N=1,readOnly:x}){const S=e=>"number"==typeof d[e]?d[e]:null,j=(e,t)=>{const l={...d};if("number"==typeof d.width)for(const e of n)null===S(e)&&(l[e]=d.width);l[e]=t,delete l.width,m(l)},k=(e,l,r,a,o,s)=>/* @__PURE__ */i("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */i(t,{value:a,onChange:s,min:g,max:v,step:N,precision:0,steppers:"compact",readOnly:x,placeholder:o,prefix:r,suffix:b.unit,"aria-label":l})}),C=n.map(S),O="number"==typeof d.width?d.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,F=null===O&&C.some(e=>null!==e),H=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",z=e=>S(e)??("number"==typeof d.width?d.width:null),D=d.style??u.style;/* @__PURE__ */
2
+ return a("div",{role:"group","aria-label":r,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(o,{children:[k("left",b.sides.left,h.left,z("left"),String(u.sides.left),e=>j("left",e)),k("top",b.sides.top,h.top,z("top"),String(u.sides.top),e=>j("top",e)),k("right",b.sides.right,h.right,z("right"),String(u.sides.right),e=>j("right",e)),k("bottom",b.sides.bottom,h.bottom,z("bottom"),String(u.sides.bottom),e=>j("bottom",e))]}):k("all",b.width,h.all,O,F?"–":H,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,y&&/* @__PURE__ */i("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */i(l,{block:!0,size:"sm",label:b.style,value:D,onChange:e=>{x||m({...d,style:e})},options:s.map(e=>({value:e,label:/* @__PURE__ */a(o,{children:[p[e],
3
3
  /* @__PURE__ */i("span",{className:"sr-only",children:b.styles[e]})]}),title:b.styles[e]}))})}),
4
4
  /* @__PURE__ */i("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */i(e,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{s as BORDER_LINE_STYLES,u as BorderInput,d as borderSides,m as borderStartEach};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-VU6VPKM3.js";import{FormField as t}from"./chunk-MVQBVPWP.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-GX2GSDJP.js";import{Button_default as a}from"./chunk-4IU5BSVE.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
1
+ import{Card as e}from"./chunk-WUKN5WUM.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-MAMWQCJ6.js";import{Button_default as a}from"./chunk-NHH2MXFU.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
2
2
  return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
3
3
  /* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
4
4
  /* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
@@ -1,4 +1,4 @@
1
- import{Breadcrumbs as e}from"./chunk-6SMQNPWS.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-43ONX6UZ.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
2
2
  return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
3
3
  /* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
4
4
  /* @__PURE__ */t("div",{children:[
@@ -0,0 +1,12 @@
1
+ import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-TLRCTNUF.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-QWHQJNKL.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=y??(e=>m(e,w)),T=b??C.nothingToPlot,E=h(),[L,P]=u(null),{highlighted:Q}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:T});const U=v/2,$=v/2,F=v/2-10,H=x??Math.max(...g.map(e=>e.value),1),W="track"===k?Math.max(6,(F-.16*v)/g.length):0,Y=Math.max(1,Math.floor((F-.16*v)/W||1)),z="track"===k?g.slice(0,Y):g,A=Math.min(j,Math.max(1,W-2)),B=n(z.length,.03),I=null!==L?z[L]:void 0;/* @__PURE__ */
2
+ return d("div",{className:`relative ${N??""}`,children:[
3
+ /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":E,onMouseLeave:()=>P(null),children:[
4
+ /* @__PURE__ */p("title",{id:E,children:"track"===k?C.radialTrack(z.length):C.radialCycle(z.length)}),z.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/H)),c=((e,t)=>null!==L?L!==e:null!==Q&&Q!==t)(r,l.key);if("track"===k){const o=F-r*W,m=o-W+A,h=-Math.PI/2;/* @__PURE__ */
5
+ return d("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
6
+ /* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f),fill:i.grid}),
7
+ /* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
+ return p("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),children:/* @__PURE__ */p("path",{d:e(U,$,m,m+(F-m)*s,B(r),B(r)+B.step),fill:n})},l.key)})]}),I&&null!==L&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:I.label,rows:[{key:"value",label:C.value,color:o(L,I.color,I.tone),value:R(I.value)}]})}),
9
+ /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
10
+ /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
11
+ /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
12
+ /* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:R(e.value)})]},e.key))})]})}export{g as RadialBarChart};
@@ -0,0 +1,12 @@
1
+ import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-5F7HMNCX.js";import{INPUT_BASE_ON as a,INPUT_BASE as s}from"./chunk-AYZY3YNC.js";import{Button_default as u}from"./chunk-NHH2MXFU.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import{Tooltip as d}from"./chunk-BCDG4N6L.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as g,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-QWHQJNKL.js";import{useState as x,useId as k,useRef as N,useMemo as $,useEffect as j}from"react";import{createPortal as D}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function L({onClear:e,ariaLabel:t}){/* @__PURE__ */
2
+ return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function R(R){const{options:F,placeholder:M,emptyOptionLabel:E,className:T="",disabled:z,id:H,filter:A=!1,allowFreeText:O=!1,freeTextOption:U,onSearchChange:B,loading:I=!1,error:J,onRetry:G,rightAdornment:K,renderOption:Q,clearable:X=!0,"aria-label":Y,"aria-labelledby":P,"aria-describedby":V}=R,Z=!0===R.multiple,q=R.multiple?R.value:R.value?[R.value]:[],_=R.multiple?"":R.value,ee=e=>{R.multiple?R.onChange(e):R.onChange(e[0]??"")},te=q.length>0,ne=A&&te&&!z,re=Z||A,le=null!=U,oe=O||le,[ie,ae]=x(!1),[se,ue]=x(-1),ce=k(),de=H??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),be=w(),ge=E??be.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=N(null),we=N(null),xe=N(null),ke=N(null),Ne=N(ie);Ne.current=ie;const $e=N(!1),je=e=>{Ne.current&&(Ne.current=!1,e&&O&&!le&&Xe&&(Z?q.includes(Xe)||ee([...q,Xe]):Xe!==_&&ee([Xe])),ae(!1),ve(""))},De=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Ye?ve(""):ue(t));ee([e.value]),je(!1)}},[Ce,Se]=x(null);b(()=>{if(!K||ie)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Ee?32:8)+6:null)});const We=m(we,ie,re?{popupRef:xe}:{matchTriggerWidth:!0}),Le=$(()=>t(F),[F]),Re=q.join("\0"),Fe=$(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Le)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Le,Re,oe]),Me=Fe.join(", "),Ee=X&&te&&!z,[Te,ze]=x(null),He=N(null),Ae=N(""),Oe=N(()=>{});Oe.current=()=>{const e=we.current,t=He.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Fe.join("\0")}`;if(o===Ae.current)return;Ae.current=o;let i=null;r>0&&Fe.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=W(Fe,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),ze(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},b(()=>{Oe.current()}),j(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Oe.current());return t.observe(e),()=>t.disconnect()},[Z]);const Ue=Fe.length,Be=!Z||!Te||Te.shown>=Ue?Me:0===Te.shown?be.select.selectedCount(Ue):`${Fe.slice(0,Te.shown).join(", ")} +${Ue-Te.shown}`,Ie=Z&&null!==Te&&(Te.shown<Ue||Te.cut),Je=ie&&te&&re;j(()=>{if(!ie)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||je(!0)};document.addEventListener("mousedown",e);const t=h(()=>je(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ie,O,me,Re,R.onChange]),j(()=>{if(ie)return y(e=>!("Escape"!==e.key||!Ne.current)&&(je(!1),we.current?.blur(),!0),()=>xe.current)},[ie]);const Ge=$(()=>{const e=/* @__PURE__ */new Set;return n(F,t=>!e.has(t.value)&&(e.add(t.value),!0))},[F]),Ke=$(()=>{if(B)return Ge;const e=me.trim().toLowerCase();return e?n(Ge,t=>r(t,e)):Ge},[Ge,me,B]),Qe=$(()=>t(Ke),[Ke]),Xe=me.trim(),Ye=$(()=>le&&Xe?Le.some(e=>e.label===Xe)||q.includes(Xe)?null:{value:Xe,label:Xe}:null,[le,Xe,Le,Re]),Pe=$(()=>Ye?[...Qe,Ye]:Qe,[Qe,Ye]);/* @__PURE__ */
3
+ return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||$e.current||document.activeElement!==we.current&&je(!0)},children:[(Ve=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ie,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ie?he:void 0,"aria-activedescendant":ie&&se>=0&&se<Pe.length?pe(se):void 0,"aria-label":P?void 0:Y,"aria-labelledby":P,"aria-describedby":V,value:ie?me:Be,onChange:e=>{ve(e.target.value),ae(!0)},onFocus:()=>{z||(ve(""),ae(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(z)return;if(t.preventDefault(),!ie)return void ae(!0);if(0===Pe.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Pe,t,n))}"Enter"===t.key?(t.preventDefault(),ie&&se>=0&&se<Pe.length?De(Pe[se],se):1!==Qe.length||Qe[0].disabled?O&&!le&&Xe&&(Z?(q.includes(Xe)||ee([...q,Xe]),ve("")):(ee([Xe]),je(!1),we.current?.blur())):De(Qe[0],0)):"Escape"===t.key?(je(!1),we.current?.blur()):"Tab"===t.key&&je(!0)},placeholder:Je?Be:M||ge,className:`${ne?a:s} ${T} ${Ee?"pr-8":""} ${z?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Je?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:z}),Z?/* @__PURE__ */S(d,{content:!ie&&Ie?Me:null,className:"block",children:Ve}):Ve),Z&&
4
+ /* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:He,className:"whitespace-pre"})}),Ee&&/* @__PURE__ */S(L,{ariaLabel:be.select.clear,onClear:()=>{ee([]),je(!1)}}),K&&!ie&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Ee?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:K}),ie&&D(
5
+ /* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{$e.current=!0,setTimeout(()=>{$e.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&X&&!z&&
6
+ /* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${g}`,children:be.select.clearAll}),I?
7
+ /* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:be.search.searching}):J?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
8
+ /* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:J}),G&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:G,className:"shrink-0",children:be.list.retry})]}):null,
9
+ /* @__PURE__ */C("div",{id:he,role:Pe.length?"listbox":void 0,"aria-labelledby":Pe.length?P??(Y?void 0:de):void 0,"aria-label":Pe.length&&!P?Y:void 0,"aria-multiselectable":!(!Pe.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Pe.length?I||J?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:be.select.noMatches}):0===Qe.length?null:l(Ke,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
10
+ return C("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Z)&&n.preventDefault(),De(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Z&&/* @__PURE__ */S(o,{selected:n}),
11
+ /* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:Q?Q(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(i,{grows:re,children:e.sublabel})]},e.value)},ce),Ye&&U&&
12
+ /* @__PURE__ */S("button",{id:pe(Qe.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),De(Ye,Qe.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${Qe.length?`border-t ${g}`:""} ${se===Qe.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:U(Ye.value)})},`${ce}-typed`)]})]}),document.body)]});var Ve}export{R as SearchableSelect,W as fitChoice};
@@ -0,0 +1,29 @@
1
+ import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-CRXFSN5K.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-EWVOGTEX.js";import{ImageLightbox as r}from"./chunk-Q7KTTDUS.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-O5LQBBW2.js";import{Breadcrumbs as d}from"./chunk-43ONX6UZ.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-UKDJUYIV.js";import{useMediaMoveItems as p}from"./chunk-BCUQXILM.js";import{copyToClipboard as h}from"./chunk-FBUUXK5G.js";import{DropdownMenu as f}from"./chunk-PVR4KU7H.js";import{NativeSelect as g}from"./chunk-CO5RKOVX.js";import{MediaUploadGrid as v}from"./chunk-IB4333CI.js";import{MediaUsedInList as k}from"./chunk-ARWMJSQJ.js";import{Segmented as y}from"./chunk-CKPVXDKX.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-IQWIYZB5.js";import{Banner as C}from"./chunk-IMOPDLMA.js";import{Input_default as N}from"./chunk-MAMWQCJ6.js";import{IconButton_default as I}from"./chunk-RUTUVS4H.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-F4DIVARP.js";import{ColoredBadge as j}from"./chunk-X7PM7JOD.js";import{Button_default as z}from"./chunk-NHH2MXFU.js";import{buttonClasses as F}from"./chunk-UQYNPYF4.js";import{Icon as T}from"./chunk-FSPFV4MI.js";import{Tooltip as O}from"./chunk-BCDG4N6L.js";import{usePlotWidth as L}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-QWHQJNKL.js";import{useRef as M,useMemo as A,useCallback as U,useState as E,useEffect as K}from"react";import{jsxs as R,Fragment as B,jsx as V}from"react/jsx-runtime";var X="application/x-efficient-media-files",J="application/x-efficient-media-folder",Q="application/x-efficient-media-file";function W(e){if(!e||!Array.from(e.types).includes(Q))return null;try{const n=JSON.parse(e.getData(Q));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var H={type:"all",use:"any",sort:"newest"},G={lock:/* @__PURE__ */V(T,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */V(T,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */V(T,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */V(T,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */V(T,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */V(T,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */V(T,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */V(T,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */V(T,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */V(T,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */V(T,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */V(T,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */V(T,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */V(T,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */V(T,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */V(T,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},$={link:/* @__PURE__ */V(T,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */V(T,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */V(T,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */V(T,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function Y({value:e,label:n,onDone:l}){const[a,i]=E(e),r=M(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
2
+ return V(N,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function q(T){const{mode:W="manage",layout:q="auto",location:Z,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=H,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ce,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Fe,onOpenInDesign:Te,onChoose:Oe,onCancel:Le,pickNote:Pe,onDragOut:Me,className:Ae=""}=T,Ue=P().mediaLibrary,Ee=P().media,Ke="pick"===W,Re=!Ke,Be=M(null),Ve=L(Be,"phone"===q?343:1200),Xe="phone"===q||"auto"===q&&Ve<640,Je=A(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),Qe=A(()=>new Map(ee.map(e=>[e.id,e])),[ee]),We=A(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Qe.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Qe]),He=U(e=>{const n=[];for(let l=e?Qe.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Qe.get(l.parentId):void 0);return n},[Qe,ee.length]),Ge=U((e,n)=>He(e).some(e=>e.id===n),[He]),[$e,Ye]=E(()=>/* @__PURE__ */new Set(["@files"])),qe=e=>Ye(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Ze=U(e=>{Ye(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=Z).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;K(()=>{if("files"===Z.place)Ze(["@files",...He(Z.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===Z.place){const e=Z.nodeId?Je.get(Z.nodeId)?.path??[]:[];Ze(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===Z.place,ln="trash"===Z.place,an="files"===Z.place,rn=an?Z.folderId:null,tn=nn&&Z.nodeId?Je.get(Z.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,dn=A(()=>ie.map(e=>e.id),[ie]),sn=A(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=A(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=M(!0);K(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");K(()=>{me&&cn.setSelection(me)},[hn]);const fn=M(hn??""),gn=un.join("\0");K(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{Ke?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=E(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?Qe.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);Ze(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=U(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ue.alreadyHere:void 0;const l=Qe.get(e.id);return n===e.id||n&&Ge(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:u,label:Ue.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of We.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[We,Qe,an,Ge,rn,Ue]),Cn=U(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=E(null),Dn={words:Ue,media:Ee,denied:fe,moveTargets:xn,kindOf:Cn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Re?e=>{wn(e)}:void 0,rename:xe&&Re?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ce&&Re?Ce:void 0,trash:Ne&&Re?Ne:void 0,deleteFolder:Ie&&Re?Ie:void 0,folderNotEmpty:e=>!!Qe.get(e)?.notEmpty,replace:ze&&Re?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&h(Ue.urlLabel,n)},openInDesign:Te,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),zn=(e,n)=>{Ke||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Fn,Tn]=E(null),[On,Ln]=E(null),[Pn,Mn]=E(null);K(()=>{if(!On&&!Fn)return;const e=()=>{Ln(null),Tn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Fn]);const An=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ce||fe.move||Ke)&&(!!An(e,X)||!(!An(e,J)||!Pn)&&(n!==Pn&&!(n&&Ge(n,Pn)))),En=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),Tn(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Fn!==e&&Tn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Tn(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),Tn(null),An(e,X)){let l;try{l=JSON.parse(e.dataTransfer.getData(X))}catch{l=null}Array.isArray(l)&&l.length&&Ce({kind:"files",ids:l.map(String)},n)}else Pn&&(Ce({kind:"folder",id:Pn},n),Mn(null))}}),Kn=e=>{const n=e=>An(e,X)||An(e,J)||An(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&On!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Rn=(e,n,l)=>/* @__PURE__ */V(O,{side:"right",content:On===e?Ue.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */V("span",{children:n})}),Bn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Vn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=$e.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
3
+ return R("div",{role:"none",className:"contents",children:[
4
+ /* @__PURE__ */V(n,{label:Rn(r,e.name,t),level:a,icon:d&&o?G.folderOpen:G.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:nn&&Z.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>qe(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Kn(r),...Re?Bn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */V(l,{children:Vn(d,a+1,t)})]},e.id)}),Xn=(e,a)=>(We.get(e)??[]).map(e=>{const i=We.get(e.id),r=$e.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
5
+ return R("div",{role:"none",className:"contents",children:[
6
+ /* @__PURE__ */V(n,{label:e.name,level:a,icon:i&&r?G.folderOpen:G.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||an&&Z.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Fn===e.id?"into":void 0,dragging:Pn===e.id,draggable:Re&&!!Ce&&!fe.move,rename:t?/* @__PURE__ */V(Y,{value:e.name,label:Ue.folderName,onDone:bn}):void 0,actions:Re&&o.length?/* @__PURE__ */V(f,{align:"end","aria-label":Ue.folderActions,trigger:G.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...En(e.id,e.id),...Re?Bn({kind:"folder",id:e.id}):{},...Re&&Ce&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(J,e.id),Mn(e.id)},onDragEnd:()=>{Mn(null),Tn(null)}}:{}}}),i&&r&&/* @__PURE__ */V(l,{children:Xn(e.id,a+1)})]},e.id)}),Jn=$e.has("@files"),Qn=$e.has("@products"),Wn=/* @__PURE__ */R(e,{"aria-label":Ue.folders,children:[ne&&/* @__PURE__ */R(B,{children:[
7
+ /* @__PURE__ */V(n,{label:Rn("@products",Ue.products),level:1,icon:G.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:ne.length?Qn:void 0,onToggle:()=>qe("@products"),selected:nn&&null==Z.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Kn("@products")}}),Qn&&ne.length>0&&/* @__PURE__ */V(l,{children:Vn(ne,2)})]}),
8
+ /* @__PURE__ */V(n,{label:Ue.allFiles,level:1,icon:Jn?G.folderOpen:G.folder,count:le,countLabel:null!=le?Ue.fileCount(le):void 0,expanded:We.get(null)?.length?Jn:void 0,onToggle:()=>qe("@files"),selected:an&&null==Z.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Fn?"into":void 0,rowProps:{"data-media-row":"@files",...En("@files",null)}}),Jn&&(We.get(null)?.length??0)>0&&/* @__PURE__ */V(l,{children:Xn(null,2)}),Re&&/* @__PURE__ */V(n,{label:Ue.trash,level:1,icon:G.trash,count:ae,countLabel:null!=ae?Ue.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Hn=(()=>{if(ln)return[{label:Ue.trash}];if(nn){const e=Z.nodeId?Je.get(Z.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=He(rn);return[{label:Ue.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Gn=nn?Ue.readOnly:fe.upload,$n=!!be&&!ln&&!Gn,Yn=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!$n,onAccept:e=>be?.(e,rn)}),qn=nn?Ue.noProductFolder:fe.newFolder,Zn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[Re&&we&&!ln&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.folderPlus,onClick:()=>{wn(rn)},...Zn(qn),children:Ue.newFolder}),be&&!ln&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:G.upload,onClick:()=>Yn.open(),...Zn(Gn),children:Ue.upload}),Re&&ln&&je&&ie.length>0&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:je,...Zn(fe.deleteForever),children:Ue.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */V("div",{style:{width:Xe?void 0:i,flex:Xe?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */V(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */V("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */V(N,{size:"sm",type:"search",leftIcon:G.search,placeholder:nn?Ue.searchProducts:Ue.search,"aria-label":nn?Ue.searchProducts:Ue.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ue.mediaType,oe.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ue.use,oe.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],nl("use"),130),de&&Re&&el(Ue.sort,oe.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */V(y,{size:"sm",label:Ue.view,value:ce,onChange:ue,options:[{value:"grid",label:Ue.grid,icon:G.grid},{value:"list",label:Ue.list,icon:G.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:$.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:$.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:$.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:$.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */V(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Re&&an&&!!Ce&&!fe.move,tl=!!Me&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Q]:ol(e)}}:{}})),sl=Xe?Math.max(72,Math.floor((Ve-24-16-1)/3)):112,cl=M(null),ul=c({containerRef:cl,enabled:Re&&!Xe&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ke){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */V(i,{variant:"dashed",title:Ue.noMatches}):nn?/* @__PURE__ */V(i,{variant:"dashed",title:Ue.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */V(i,{variant:"dashed",title:Ue.trashEmpty}):!$n||Ke?/* @__PURE__ */V(i,{variant:"dashed",title:Ue.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */V("ul",{role:"listbox","aria-multiselectable":Re||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */R("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Q,ol(e)),Me("start")}:void 0,onDragEnd:ol(e)?e=>Me("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
9
+ /* @__PURE__ */V("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
10
+ /* @__PURE__ */V("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
11
+ /* @__PURE__ */V("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */V("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */V(v,{items:dl,readOnly:!$n||Ke,onFiles:$n&&!Ke?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?X:tl?Q:void 0,onDragOutChange:tl?e=>Me(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Re?zn:void 0,menuOnMedia:Re})),gl=p({count:un.length,kind:Cn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ce?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=F({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */V(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(B,{children:[G.folder,Ue.moveTo]}),items:gl,disabled:!!fe.move}),yl=Re&&un.length>1&&!nn?/* @__PURE__ */R("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
12
+ /* @__PURE__ */V(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ue.selected(un.length)}),/* @__PURE__ */R(B,ln?{children:[De&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.undo,onClick:()=>De(un),...Zn(fe.restore),children:Ue.restore}),Se&&/* @__PURE__ */V(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...Zn(fe.deleteForever),children:Ue.deleteForever})]}:{children:[Ce&&kl,xe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.edit,disabled:!0,children:Ue.rename}),Ne&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.trash,onClick:()=>Ne({kind:"files",ids:un}),...Zn(fe.trash),children:Ue.moveFilesToTrash(un.length)})]}),
13
+ /* @__PURE__ */V(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ue.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ue.name,a?/* @__PURE__ */V(Y,{value:e.name,label:Ue.fileName,onDone:bn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),nn?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
14
+ return R("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
15
+ /* @__PURE__ */V("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */V(C,{tone:"neutral",title:Ue.readOnlyBadge,children:on(tn)}),
16
+ /* @__PURE__ */V(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */R("div",{className:"flex gap-2",children:[
17
+ /* @__PURE__ */V("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */V(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
18
+ /* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.copy,onClick:()=>Dn.copyUrl(e.id),children:Ue.copyUrl})]}),an&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.swap,onClick:()=>ze(e.id),...Zn(fe.replace),children:Ue.replace}),Fe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.crop,onClick:()=>Fe(e.id),children:Ue.cropEdit}),Ce&&"submenu"===i?.type&&/* @__PURE__ */V(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(B,{children:[G.folder,Ue.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.edit,onClick:()=>yn({kind:"file",id:e.id}),...Zn(fe.rename),children:Ue.rename}),Ne&&/* @__PURE__ */V(I,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:G.trash})]}),ln&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:G.undo,onClick:()=>De([e.id]),...Zn(fe.restore),children:Ue.restore}),Se&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...Zn(fe.deleteForever),children:Ue.deleteForever})]}),nn&&Te&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:G.external,onClick:()=>Te({kind:"render",id:e.id}),children:Ue.openInDesign}),he&&/* @__PURE__ */V(k,{items:he})]})},wl=mn?mn.private?Ue.privateNoPick:mn.pickDisabledReason:void 0,xl=Ke?/* @__PURE__ */R("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
19
+ /* @__PURE__ */V("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ue.oneChosen(mn.name):Ue.noneChosen}),
20
+ /* @__PURE__ */R("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",onClick:Le,children:Ue.cancel}),
21
+ /* @__PURE__ */V(z,{variant:"primary",size:"sm",disabled:!mn,...Zn(wl),onClick:()=>{mn&&!wl&&Oe?.(mn)},children:Ue.chooseImage})]})]}):null,Cl=Re&&!!mn,Nl=/* @__PURE__ */R("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */V(C,{tone:"neutral",children:Pe}),
22
+ /* @__PURE__ */R("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
23
+ /* @__PURE__ */V(d,{items:Hn}),_n]}),ll,yl,
24
+ /* @__PURE__ */R("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Re&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
25
+ /* @__PURE__ */V(a,{rect:ul.rect})]}),$n&&/* @__PURE__ */V("input",{...Yn.inputProps}),
26
+ /* @__PURE__ */V(S,{rejections:Yn.rejections})]});/* @__PURE__ */
27
+ return R("div",{ref:Be,"data-media-library":"","data-layout":Xe?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ae}`.trim(),children:[/* @__PURE__ */R("div",Xe?{className:"flex flex-col gap-3 p-3",children:[Wn,Nl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
28
+ /* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Wn}),
29
+ /* @__PURE__ */V("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Nl}),Cl&&/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,Xe&&/* @__PURE__ */V(o,{open:Cl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */V(x,{...jn.props,items:Sn(jn.state.data)}),null!=Nn&&ie.length>0&&/* @__PURE__ */V(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Nn,ie.length-1),onClose:()=>In(null)})]})}export{X as MEDIA_FILES_DRAG_TYPE,Q as MEDIA_FILE_DRAG_TYPE,J as MEDIA_FOLDER_DRAG_TYPE,q as MediaLibrary,W as readMediaFileDrag};
@@ -0,0 +1 @@
1
+ var r="9.9.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,4 +1,4 @@
1
- import{Banner as e}from"./chunk-UZMZ2EDW.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as n}from"./chunk-E6UCGCOC.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
1
+ import{Banner as e}from"./chunk-IMOPDLMA.js";import{Button_default as t}from"./chunk-NHH2MXFU.js";import{useShellStrings as n}from"./chunk-QWHQJNKL.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
2
2
  return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
3
3
  /* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
4
4
  /* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
@@ -0,0 +1,9 @@
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-DZTAGMNY.js";import{navIcons as r}from"./chunk-CY5N5OA3.js";import{VERSION as s}from"./chunk-L4TN4EWK.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-QWHQJNKL.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.2.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.0.2",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"1.1.1",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.2",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),N=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function v({app:n}){const o=u[n],[f,v]=m(!1),w=c(()=>v(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,w,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):N,[j,A]=a(b.partOf);/* @__PURE__ */
2
+ return p(t,{open:!0,onClose:()=>v(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
+ /* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
+ /* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
5
+ /* @__PURE__ */p("p",{className:"text-2xs font-mono text-ink-faintest",children:b.version(o.version)}),
6
+ /* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[n]}),
7
+ /* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
+ /* @__PURE__ */h("p",{className:"text-2xs text-ink-faint",children:[j,
9
+ /* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),A]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{v as AboutApp,u as BUILTIN_APP_INFO};
@@ -1,3 +1,3 @@
1
- import{OneLineLabel as t}from"./chunk-6KO5VTL7.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
1
+ import{OneLineLabel as t}from"./chunk-OZAAIE4E.js";import{createContext as s,useContext as a,useCallback as r}from"react";import{jsx as o}from"react/jsx-runtime";var e="inline-flex max-w-full items-center whitespace-nowrap rounded-full",n={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},u={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function i(t,s="subtle"){return"solid"===s?u[t]:n[t]}var l=s({}),c=s(void 0);function d(t){return t.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function v({groups:t,labelFor:s,children:a}){/* @__PURE__ */
2
2
  return o(l.Provider,{value:t,children:/* @__PURE__ */o(c.Provider,{value:s,children:a})})}function f(){const t=a(c);return r(s=>t?.(s)??d(s),[t])}function g({status:s,label:r,emphasis:n="subtle"}){const u=i(a(l)[s]??"neutral",n),v=a(c),f=r??v?.(s)??d(s);/* @__PURE__ */
3
3
  return o("span",{className:`${e} px-3 py-0.5 text-xs font-medium ${u}`,children:/* @__PURE__ */o(t,{children:f})})}export{e as BADGE_PILL,n as GROUP_COLORS,u as GROUP_COLORS_SOLID,g as StatusBadge,v as StatusBadgeProvider,i as groupColors,f as useStatusLabel};
@@ -1,2 +1,2 @@
1
- import{EmptyValue as r}from"./chunk-64WSMLXG.js";import{toInstant as e,timeAgo as t}from"./chunk-X2S2XDZI.js";import{formatDateTime as o}from"./chunk-5OTS2G3M.js";import{useShellLocale as c}from"./chunk-E6UCGCOC.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
1
+ import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-X2S2XDZI.js";import{formatDateTime as o}from"./chunk-5OTS2G3M.js";import{useShellLocale as c}from"./chunk-QWHQJNKL.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
2
2
  return i("time",{dateTime:u,title:o(u,{locale:s??a}),className:l,children:t(p,{precise:n,locale:s??a})})}export{m as TimeAgo};
@@ -0,0 +1,7 @@
1
+ import{writeClipboard as e}from"./chunk-FBUUXK5G.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{toast_default as t}from"./chunk-XD34TCRG.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as a}from"./chunk-QWHQJNKL.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
+ return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":T,className:C=""}){const[U,B]=i(!1),F=o(null),G=a().copy;c(()=>()=>{F.current&&clearTimeout(F.current)},[]);const H=l(async()=>{await e(n)?(B(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{B(!1),F.current=null},2e3),v?.(n)):t.error(G.failed)},[n,v,G]),{box:K,button:L}=p[g],Q=!N;/* @__PURE__ */
4
+ return m("div",{id:Q?void 0:j,"aria-describedby":Q?void 0:T,className:["inline-flex max-w-full items-center rounded-md",u[k],K,C].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
+ /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!N&&/* @__PURE__ */m(d,{children:[
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?G.copyLabel(x):G.copy,"aria-describedby":T,onClick:H,className:`${L} text-gray-400`,children:/* @__PURE__ */s(U?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:U?G.copied:""})]})]})}export{y as Snippet};
@@ -0,0 +1,2 @@
1
+ import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-HL6JSDN3.js";import{Tooltip as o}from"./chunk-BCDG4N6L.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
2
+ return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
@@ -1,4 +1,4 @@
1
- import{Popover as e}from"./chunk-RNBM5JZI.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{Tooltip as a}from"./chunk-22S6LG6D.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useRef as t}from"react";import{jsx as i,jsxs as o}from"react/jsx-runtime";var s={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function c({value:c,onChange:m,options:u,label:d,emptyValue:h,columns:p=5,disabled:f=!1,className:v=""}){const g=l(),b=g.iconPicker,N=g.iconNames,x=e=>e.label??N[e.value]??e.value,w=t([]),k=Math.max(0,u.findIndex(e=>e.value===c)),C=u[k],j=C?.value===h,A=t(null);/* @__PURE__ */
2
- return i(e,{className:v,disabled:f,triggerLabel:C?b.button(d,x(C)):d,"aria-label":d,initialFocus:A,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */i("span",j||!C?{className:"text-sm",children:C?x(C):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:C.icon}),
1
+ import{Popover as e}from"./chunk-7JGR7WPD.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{Tooltip as a}from"./chunk-BCDG4N6L.js";import{useShellStrings as l}from"./chunk-QWHQJNKL.js";import{useRef as t}from"react";import{jsx as i,jsxs as o}from"react/jsx-runtime";var s={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function c({value:c,onChange:m,options:u,label:d,emptyValue:h,columns:p=5,disabled:f=!1,className:v=""}){const g=l(),b=g.iconPicker,N=g.iconNames,x=e=>e.label??N[e.value]??e.value,w=t([]),k=Math.max(0,u.findIndex(e=>e.value===c)),j=u[k],A=j?.value===h,C=t(null);/* @__PURE__ */
2
+ return i(e,{className:v,disabled:f,triggerLabel:j?b.button(d,x(j)):d,"aria-label":d,initialFocus:C,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */i("span",A||!j?{className:"text-sm",children:j?x(j):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:j.icon}),
3
3
  /* @__PURE__ */i(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */i("div",{role:"listbox","aria-label":d,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${p}, 2rem)`},children:u.map((n,l)=>{const t=n.value===c;/* @__PURE__ */
4
- return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(A.current=e)},role:"option","aria-selected":t,"aria-label":x(n),pressed:t,tabIndex:l===k?0:-1,onKeyDown:e=>((e,r)=>{const n=s[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/p)+n[0],l=e%p+n[1];if(a<0||l<0||l>=p)return;const t=a*p+l;if(!(t>=u.length)){for(const[e,r]of w.current.entries())r?.setAttribute("tabindex",e===t?"0":"-1");w.current[t]?.focus()}})(l,e),onClick:()=>{m(n.value),e()},children:/* @__PURE__ */i("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}export{c as IconPicker};
4
+ return i(a,{content:x(n),children:/* @__PURE__ */i(r,{ref:e=>{w.current[l]=e,l===k&&(C.current=e)},role:"option","aria-selected":t,"aria-label":x(n),pressed:t,tabIndex:l===k?0:-1,onKeyDown:e=>((e,r)=>{const n=s[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/p)+n[0],l=e%p+n[1];if(a<0||l<0||l>=p)return;const t=a*p+l;if(!(t>=u.length)){for(const[e,r]of w.current.entries())r?.setAttribute("tabindex",e===t?"0":"-1");w.current[t]?.focus()}})(l,e),onClick:()=>{m(n.value),e()},children:/* @__PURE__ */i("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}export{c as IconPicker};
@@ -1,2 +1,2 @@
1
- import{inputClasses as e,PLACEHOLDER_INK as a}from"./chunk-PF3ANJFI.js";import{forwardRef as r}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i=r(function({invalid:r,leftIcon:i,rightAdornment:l,size:s,className:o="",readOnly:c,...m},d){const p=`${i?"pl-10":""} ${l?"pr-10":""}`.trim(),f=
1
+ import{inputClasses as e,PLACEHOLDER_INK as a}from"./chunk-AYZY3YNC.js";import{forwardRef as r}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i=r(function({invalid:r,leftIcon:i,rightAdornment:l,size:s,className:o="",readOnly:c,...m},d){const p=`${i?"pl-10":""} ${l?"pr-10":""}`.trim(),f=
2
2
  /* @__PURE__ */t("input",{ref:d,"aria-invalid":r||void 0,readOnly:c,className:e({invalid:r,size:s,readOnly:c,className:[p,o].filter(Boolean).join(" ")}),...m});return i||l?/* @__PURE__ */n("div",{className:"relative",children:[i&&/* @__PURE__ */t("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${a}`,children:i}),f,l&&/* @__PURE__ */t("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:l})]}):f});export{i as Input_default};
@@ -1 +1 @@
1
- import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-4NXMMWL6.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-XD34TCRG.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
@@ -0,0 +1,14 @@
1
+ import{CountBadge as e}from"./chunk-RWJCKZEY.js";import{isShown as t}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as a,SettingAutoContext as i,InSettingRowContext as n}from"./chunk-L65BESIE.js";import{useShellStrings as s}from"./chunk-QWHQJNKL.js";import{useId as l}from"react";import{jsx as r,jsxs as d}from"react/jsx-runtime";var c={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"py-2",gap:"gap-2",text:"text-sm",bodyTop:"mt-2",bodyPad:"pt-2"}};function m({label:m,icon:o,action:p,value:h,readout:u,description:x,children:f,controlId:v,labelId:g,unknownText:N="—",quiet:w=!1,size:y="default",viewState:b,divider:k=!0,showWhen:$,values:j,context:P,className:T=""}){const W=s(),E=l();if(!t($,j,P))return null;const I=c[y],L=void 0!==h||void 0===f&&null==p,B=null==h||""===h,C=w?"text-gray-500":"text-gray-800",H=B?"text-gray-400":w?"text-gray-500":"text-gray-900",J=null!=u&&!1!==u,K=`${I.text} font-medium ${C}${"compact"===y?" whitespace-nowrap":""}`,Q=g??("compact"===y?E:void 0),S=v?/* @__PURE__ */r("label",{htmlFor:v,id:Q,className:K,children:m}):/* @__PURE__ */r("span",{id:Q,className:K,children:m}),V="auto"===b?/* @__PURE__ */r("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===b?/* @__PURE__ */d("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
+ /* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */r(e,{dot:!0,tone:"accent"})}),
3
+ /* @__PURE__ */r("span",{className:"sr-only",children:W.settingView.edited})]}):null,q=/* @__PURE__ */r(a.Provider,{value:Q,children:/* @__PURE__ */r(i.Provider,{value:"auto"===b,children:B?N:h})}),z=[k?"border-t border-line-subtle first:border-t-0":"",I.pad,T].filter(Boolean).join(" "),A=null!=f&&!1!==f&&/* @__PURE__ */r("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:f});/* @__PURE__ */
4
+ return d("div",J?{className:z,"data-setting-row":"compact"===y?y:void 0,children:[
5
+ /* @__PURE__ */d("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
6
+ /* @__PURE__ */r("div",{"data-setting-name":"compact"===y?"":void 0,className:"flex-1 basis-0",children:/* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${C}`,children:[null!=o&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),S,V]})}),
7
+ /* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
8
+ /* @__PURE__ */r("span",{"data-setting-readout":"",className:`whitespace-nowrap ${I.text} ${w?"text-ink-faint":"text-ink-strongest"}`,children:u}),("compact"===y||null!=p)&&/* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]})]}),x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x}),void 0!==h&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${I.text} ${H}`,children:/* @__PURE__ */r(n.Provider,{value:"compact"===y,children:q})}),A]}:{className:z,"data-setting-row":"compact"===y?y:void 0,children:[
9
+ /* @__PURE__ */d("div",{className:"compact"===y?"flex flex-wrap items-center justify-between gap-x-2 gap-y-2":`flex items-center justify-between ${I.gap}`,children:[
10
+ /* @__PURE__ */d("div",{"data-setting-name":"compact"===y?"":void 0,className:"compact"===y?"flex-1 basis-0":"min-w-0 flex-1",children:[null!=o?
11
+ /* @__PURE__ */d("div",{className:`flex min-w-0 items-center gap-2 ${C}`,children:[
12
+ /* @__PURE__ */r("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),S,V]}):V?/* @__PURE__ */d("div",{className:"flex min-w-0 items-center gap-2",children:[S,V]}):S,x&&/* @__PURE__ */r("p",{className:"mt-0.5 text-xs text-ink-faint",children:x})]}),"compact"===y?
13
+ /* @__PURE__ */d("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[L&&/* @__PURE__ */r("div",{"data-setting-value":"",className:`flex items-center justify-end ${I.text} ${H}`,children:/* @__PURE__ */r(n.Provider,{value:!0,children:q})}),
14
+ /* @__PURE__ */r("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:p})]}):null!=p?/* @__PURE__ */d("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[L&&/* @__PURE__ */r("div",{className:`${I.text} ${H}`,children:q}),p]}):L&&/* @__PURE__ */r("div",{className:`shrink-0 ${I.text} ${H}`,children:q})]}),A]})}export{m as SettingRow};