efficient-shell 9.9.1 → 9.10.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 (309) hide show
  1. package/dist/{Browser-GQ2ZK4PR.js → Browser-VUQISZ2Z.js} +14 -14
  2. package/dist/Calculator-IZXBE6R7.js +29 -0
  3. package/dist/{CurrencyConverter-SSR2XDIC.js → CurrencyConverter-AW7BB3DD.js} +8 -8
  4. package/dist/{Documents-5AC4WSNK.js → Documents-WPTBUSKV.js} +7 -7
  5. package/dist/Files-IZ6N6SG6.js +88 -0
  6. package/dist/{Notepad-EUIQXFUA.js → Notepad-VRQH524R.js} +10 -10
  7. package/dist/{PdfViewer-XSISAJZP.js → PdfViewer-FFQOKKFW.js} +1 -1
  8. package/dist/{PomodoroTimer-EV6D4OFU.js → PomodoroTimer-5VCWY4QT.js} +25 -25
  9. package/dist/{Preview-QK5HYJ6U.js → Preview-SP3WIE54.js} +14 -14
  10. package/dist/Sidebar-PUXP2DFI.js +43 -0
  11. package/dist/{Spreadsheet-HR6GBICY.js → Spreadsheet-4U4ABNE2.js} +13 -13
  12. package/dist/{Stock-6ZIQHGPH.js → Stock-2VWS2IQJ.js} +4 -4
  13. package/dist/{Weather-II7NFRMK.js → Weather-4MEYBP4D.js} +18 -18
  14. package/dist/{WorldClock-NBLNO63Q.js → WorldClock-Y4YRJ43F.js} +6 -6
  15. package/dist/ai/index.js +56 -56
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.d.ts +24 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.d.ts +4 -1
  29. package/dist/charts/ColumnChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/SpecChart.js +1 -1
  42. package/dist/charts/StatTile.js +1 -1
  43. package/dist/charts/SunburstChart.js +1 -1
  44. package/dist/charts/TimeSeriesChart.d.ts +1 -1
  45. package/dist/charts/TimeSeriesChart.js +1 -1
  46. package/dist/charts/TreemapChart.js +1 -1
  47. package/dist/charts/WaterfallChart.js +1 -1
  48. package/dist/charts/types.d.ts +35 -1
  49. package/dist/{chunk-7WGOLPGM.js → chunk-2AHLONPR.js} +1 -1
  50. package/dist/{chunk-2MLRK7IO.js → chunk-2GPHHW7C.js} +4 -4
  51. package/dist/{chunk-P3OBE43Q.js → chunk-2LDOLQ7F.js} +6 -6
  52. package/dist/{chunk-EFFF3FCS.js → chunk-2SJDTKQA.js} +19 -19
  53. package/dist/{chunk-DZTAGMNY.js → chunk-2XBJNB7D.js} +34 -34
  54. package/dist/{chunk-HQMN5THW.js → chunk-3FBYM6O5.js} +14 -14
  55. package/dist/{chunk-EXNAAHN4.js → chunk-3MHBALGV.js} +2 -2
  56. package/dist/{chunk-CJB73MHF.js → chunk-3XRBVYTO.js} +2 -2
  57. package/dist/{chunk-BVTNGW5S.js → chunk-46YVA2BF.js} +1 -1
  58. package/dist/chunk-4CPE5NBC.js +8 -0
  59. package/dist/{chunk-CO5RKOVX.js → chunk-4DBPKTVX.js} +16 -16
  60. package/dist/{chunk-DNWV6N4P.js → chunk-4SZ3NNVF.js} +1 -1
  61. package/dist/{chunk-XD34TCRG.js → chunk-4XZXY2AF.js} +1 -1
  62. package/dist/{chunk-5JRL5LXD.js → chunk-5AWV5R6E.js} +6 -6
  63. package/dist/{chunk-PYLNMN6E.js → chunk-5CVQN2BR.js} +8 -8
  64. package/dist/{chunk-RWJCKZEY.js → chunk-5Q3PFKB5.js} +1 -1
  65. package/dist/{chunk-LUWRPPJA.js → chunk-5R6RNUDB.js} +5 -5
  66. package/dist/{chunk-WUKN5WUM.js → chunk-5RAOFJYT.js} +6 -6
  67. package/dist/{chunk-SC63O7AL.js → chunk-5VYBPDZ2.js} +1 -1
  68. package/dist/{chunk-ZAU2HIRH.js → chunk-5XNN2SSR.js} +4 -4
  69. package/dist/{chunk-O5LQBBW2.js → chunk-5Y6LGPZI.js} +7 -7
  70. package/dist/{chunk-ZYDZY6ED.js → chunk-5Y7JITHW.js} +1 -1
  71. package/dist/{chunk-3APSMJPN.js → chunk-64R3IYAM.js} +1 -1
  72. package/dist/{chunk-Z3JW77LH.js → chunk-65DYHG73.js} +1 -1
  73. package/dist/{chunk-5VOVNIOU.js → chunk-6O2W4X2V.js} +1 -1
  74. package/dist/{chunk-VVGL5O4F.js → chunk-6TRE326A.js} +6 -6
  75. package/dist/{chunk-ZTL2RPNY.js → chunk-73W7537K.js} +1 -1
  76. package/dist/{chunk-GS5AISRS.js → chunk-7IC4JMFA.js} +4 -4
  77. package/dist/{chunk-OV2SWQPT.js → chunk-7JJUI52C.js} +1 -1
  78. package/dist/{chunk-IMOPDLMA.js → chunk-7WLFHDWA.js} +1 -1
  79. package/dist/chunk-7YZJLFAK.js +11 -0
  80. package/dist/{chunk-56RAOI7O.js → chunk-AG63JVX7.js} +6 -6
  81. package/dist/{chunk-WH3JHMEA.js → chunk-AGETTWMK.js} +1 -1
  82. package/dist/{chunk-6MVHRNWC.js → chunk-BF7PZFKT.js} +1 -1
  83. package/dist/{chunk-IJWFKUYA.js → chunk-BJONHLET.js} +4 -4
  84. package/dist/{chunk-B4KMHEFZ.js → chunk-BNKULSCG.js} +1 -1
  85. package/dist/{chunk-RULVWW4A.js → chunk-BRHKQMRH.js} +6 -6
  86. package/dist/{chunk-VG2R6PZV.js → chunk-BYHKYYL6.js} +1 -1
  87. package/dist/{chunk-UE4PVCA5.js → chunk-CB6ROWOC.js} +2 -2
  88. package/dist/chunk-CBMXYXBH.js +15 -0
  89. package/dist/{chunk-6JU3WQOR.js → chunk-CFO54C3H.js} +1 -1
  90. package/dist/{chunk-P3DTYFMC.js → chunk-CJI3POCE.js} +2 -2
  91. package/dist/{chunk-GVC535IA.js → chunk-D4KZOYXQ.js} +1 -1
  92. package/dist/chunk-D7JY2KHG.js +7 -0
  93. package/dist/{chunk-PDXPMHG3.js → chunk-DRNB7KDC.js} +1 -1
  94. package/dist/{chunk-RDKBMX6U.js → chunk-DWSCYYDM.js} +1 -1
  95. package/dist/{chunk-U5N6PSXO.js → chunk-E6EUGQGA.js} +5 -5
  96. package/dist/{chunk-N3JXHNID.js → chunk-E72USUUR.js} +10 -10
  97. package/dist/{chunk-C4UL2UNR.js → chunk-EOWOVR55.js} +1 -1
  98. package/dist/{chunk-CE5BARZI.js → chunk-EWJELWIT.js} +3 -3
  99. package/dist/{chunk-OQ2EDMB2.js → chunk-FEPBXJUR.js} +1 -1
  100. package/dist/{chunk-BWUU565Y.js → chunk-FKA6ZVQO.js} +9 -9
  101. package/dist/{chunk-QZKWIVZW.js → chunk-FNSVXN7B.js} +1 -1
  102. package/dist/{chunk-CRXFSN5K.js → chunk-G6LOKIFC.js} +11 -11
  103. package/dist/chunk-GCB5S2OI.js +8 -0
  104. package/dist/{chunk-LNQVTH5S.js → chunk-GP5UNEKY.js} +1 -1
  105. package/dist/{chunk-EW3L4W2I.js → chunk-GVAWCTJN.js} +8 -8
  106. package/dist/{chunk-X7PM7JOD.js → chunk-H2XCQJRG.js} +1 -1
  107. package/dist/{chunk-FBUUXK5G.js → chunk-H4YFANH5.js} +1 -1
  108. package/dist/chunk-HHOXLECO.js +29 -0
  109. package/dist/{chunk-442FFHQJ.js → chunk-HRAK46H7.js} +12 -12
  110. package/dist/chunk-HSTIEPLI.js +1 -0
  111. package/dist/chunk-I5XVZLDH.js +14 -0
  112. package/dist/{chunk-H7MJM2WI.js → chunk-IBIUI2D3.js} +2 -2
  113. package/dist/{chunk-CXMTDYVI.js → chunk-IENPHB5B.js} +1 -1
  114. package/dist/{chunk-FLQZ7GQ3.js → chunk-IEPSBXMU.js} +12 -12
  115. package/dist/{chunk-732XHVR4.js → chunk-IUWAMMDN.js} +3 -3
  116. package/dist/{chunk-B6YOP2IX.js → chunk-IVY7CCTS.js} +3 -3
  117. package/dist/{chunk-JKDEE35P.js → chunk-IZQ3XTD2.js} +1 -1
  118. package/dist/chunk-J7OKOVSL.js +11 -0
  119. package/dist/{chunk-IB4333CI.js → chunk-JECMVR4S.js} +7 -7
  120. package/dist/{chunk-6ZHX56NM.js → chunk-JQDRM6UK.js} +1 -1
  121. package/dist/{chunk-QC6OK3ED.js → chunk-JVYSRH6U.js} +1 -1
  122. package/dist/{chunk-5VRMQTKV.js → chunk-KAHYUBXM.js} +7 -7
  123. package/dist/{chunk-YWGC7J6B.js → chunk-KECOZKJU.js} +7 -7
  124. package/dist/{chunk-JIW5CJXC.js → chunk-KOSV4UPK.js} +2 -2
  125. package/dist/{chunk-NHVXVHUR.js → chunk-KQSUSVMF.js} +17 -17
  126. package/dist/{chunk-BBEOFKLY.js → chunk-KTRNAMHY.js} +1 -1
  127. package/dist/chunk-LFPJ263N.js +6 -0
  128. package/dist/{chunk-F4DIVARP.js → chunk-LYX55RI3.js} +1 -1
  129. package/dist/{chunk-XZYAFTW4.js → chunk-M5MAIJQQ.js} +4 -4
  130. package/dist/{chunk-XNWQ72WA.js → chunk-MCMUJDEP.js} +1 -1
  131. package/dist/{chunk-ZOHQVSB3.js → chunk-MUHWI4GK.js} +12 -12
  132. package/dist/chunk-N3CTLEJS.js +9 -0
  133. package/dist/{chunk-HJWTWS5E.js → chunk-N52D37FS.js} +5 -5
  134. package/dist/chunk-NBKQADMY.js +9 -0
  135. package/dist/{chunk-P4XTWAKJ.js → chunk-NCRLKFXD.js} +1 -1
  136. package/dist/{chunk-43ONX6UZ.js → chunk-NGQHXTUK.js} +1 -1
  137. package/dist/{chunk-SOP447EP.js → chunk-NRGBXEBU.js} +1 -1
  138. package/dist/{chunk-JS6ZSEZJ.js → chunk-O426Q7KC.js} +1 -1
  139. package/dist/{chunk-CAG3TSV2.js → chunk-O4NPQ23Q.js} +1 -1
  140. package/dist/{chunk-ZHHEMSOD.js → chunk-ODOEH5QZ.js} +2 -2
  141. package/dist/{chunk-ENL5L6NR.js → chunk-P65C5TUU.js} +1 -1
  142. package/dist/chunk-PEM7UXQ3.js +1 -0
  143. package/dist/chunk-PTA7A7GF.js +22 -0
  144. package/dist/{chunk-FLEG5KP5.js → chunk-PWBLGKQ3.js} +5 -5
  145. package/dist/chunk-QCFN3ET4.js +9 -0
  146. package/dist/{chunk-F7F6Z64G.js → chunk-QLOKT22X.js} +1 -1
  147. package/dist/{chunk-IK2WXW2E.js → chunk-QLYOGT3U.js} +13 -13
  148. package/dist/{chunk-N7T63BVD.js → chunk-QMYQ4B5A.js} +3 -3
  149. package/dist/{chunk-EWVOGTEX.js → chunk-QSUQC4AN.js} +1 -1
  150. package/dist/chunk-QYJQAY6C.js +2 -0
  151. package/dist/{chunk-M5GMIQ47.js → chunk-R7JTTKG2.js} +3 -3
  152. package/dist/{chunk-Y44ABEW3.js → chunk-REGXKU74.js} +1 -1
  153. package/dist/{chunk-AGUA3O5O.js → chunk-RLLONZJJ.js} +1 -1
  154. package/dist/chunk-RSHNWBW2.js +4 -0
  155. package/dist/chunk-SC6HJBQA.js +8 -0
  156. package/dist/{chunk-OUSKOWNP.js → chunk-SGR4V5YI.js} +3 -3
  157. package/dist/{chunk-CVNJSD2J.js → chunk-T2ITXX7R.js} +6 -6
  158. package/dist/chunk-T76X2SHR.js +4 -0
  159. package/dist/{chunk-ARWMJSQJ.js → chunk-T7O2TNNX.js} +1 -1
  160. package/dist/chunk-TBLN4MDQ.js +6 -0
  161. package/dist/{chunk-ANFLQSGX.js → chunk-TQH6E5V2.js} +1 -1
  162. package/dist/{chunk-KEK47CP3.js → chunk-TRUPMMDJ.js} +9 -9
  163. package/dist/{chunk-L67VXJMF.js → chunk-UL4G6JY2.js} +1 -1
  164. package/dist/chunk-UYDP4DK3.js +9 -0
  165. package/dist/{chunk-E4E7MACR.js → chunk-UZGVIHFI.js} +14 -14
  166. package/dist/{chunk-DWBZ3Z34.js → chunk-V5QEPNPK.js} +2 -2
  167. package/dist/{chunk-MV6WDGB6.js → chunk-VANJPZ3H.js} +1 -1
  168. package/dist/{chunk-VVAJ23SD.js → chunk-VBNA237H.js} +1 -1
  169. package/dist/{chunk-24K6GVNM.js → chunk-VR4GSAFM.js} +17 -17
  170. package/dist/{chunk-2R3BVU75.js → chunk-VZV7Q5V2.js} +1 -1
  171. package/dist/{chunk-IJIESSTX.js → chunk-WIOG2NOJ.js} +5 -5
  172. package/dist/{chunk-BCUQXILM.js → chunk-WZQCRTXF.js} +1 -1
  173. package/dist/chunk-X4BKHXU5.js +9 -0
  174. package/dist/{chunk-UKDJUYIV.js → chunk-XI45TSEK.js} +1 -1
  175. package/dist/{chunk-MWIT4UN2.js → chunk-XREN3AKD.js} +9 -9
  176. package/dist/{chunk-IGNZULKG.js → chunk-YBU7NOD7.js} +1 -1
  177. package/dist/{chunk-QSJR7EI7.js → chunk-YQB5OYDC.js} +1 -1
  178. package/dist/{chunk-TVL3JPMY.js → chunk-YWR2WRDR.js} +1 -1
  179. package/dist/{chunk-2HEJDLPP.js → chunk-ZA6S5XVM.js} +2 -2
  180. package/dist/{chunk-K4D63NP3.js → chunk-ZC3CCRPG.js} +7 -7
  181. package/dist/{chunk-IPTCV6CQ.js → chunk-ZPW3KQ27.js} +30 -30
  182. package/dist/data/DataTable.js +1 -1
  183. package/dist/data/Kanban.js +1 -1
  184. package/dist/data/ListFooter.js +1 -1
  185. package/dist/data/ListLoadError.js +1 -1
  186. package/dist/data/Pagination.js +1 -1
  187. package/dist/file-intake/index.js +1 -1
  188. package/dist/forms/BorderInput.js +1 -1
  189. package/dist/forms/BrandAssetEditor.js +1 -1
  190. package/dist/forms/Calendar.js +1 -1
  191. package/dist/forms/ColorPicker.js +1 -1
  192. package/dist/forms/ComposerAttachments.js +1 -1
  193. package/dist/forms/CornersInput.js +1 -1
  194. package/dist/forms/DatePicker.js +1 -1
  195. package/dist/forms/DateRangePicker.js +1 -1
  196. package/dist/forms/DateTimePicker.js +1 -1
  197. package/dist/forms/DisplayChips.js +1 -1
  198. package/dist/forms/FilePicker.js +1 -1
  199. package/dist/forms/FormErrorSummary.js +1 -1
  200. package/dist/forms/IconPicker.js +1 -1
  201. package/dist/forms/ImageFocusPoint.js +1 -1
  202. package/dist/forms/InputNumber.js +1 -1
  203. package/dist/forms/LinkPicker.js +1 -1
  204. package/dist/forms/MediaLibrary.js +1 -1
  205. package/dist/forms/MediaUploadField.js +1 -1
  206. package/dist/forms/MediaUploadGrid.js +1 -1
  207. package/dist/forms/MediaUsedInList.js +1 -1
  208. package/dist/forms/NumericKeypad.js +1 -1
  209. package/dist/forms/PositionInput.js +1 -1
  210. package/dist/forms/Select.js +1 -1
  211. package/dist/forms/SidesInput.js +1 -1
  212. package/dist/forms/Slider.js +1 -1
  213. package/dist/forms/Snippet.js +1 -1
  214. package/dist/forms/TagInput.js +1 -1
  215. package/dist/forms/TextToolbar.js +1 -1
  216. package/dist/forms/TimePicker.js +1 -1
  217. package/dist/forms/WidthsBar.js +1 -1
  218. package/dist/forms/mediaLibraryMenu.js +1 -1
  219. package/dist/forms/mediaMoveItems.js +1 -1
  220. package/dist/forms/textAlign.js +1 -1
  221. package/dist/forms/useFileIntake.js +1 -1
  222. package/dist/index.js +114 -114
  223. package/dist/locales/zh-Hans.js +1 -1
  224. package/dist/map/index.js +7 -7
  225. package/dist/page-tabs/index.js +5 -5
  226. package/dist/pdf/index.js +1 -1
  227. package/dist/shell/Accordion.js +1 -1
  228. package/dist/shell/AppUpdateBanner.js +1 -1
  229. package/dist/shell/Avatar.js +1 -1
  230. package/dist/shell/Banner.js +1 -1
  231. package/dist/shell/Breadcrumbs.js +1 -1
  232. package/dist/shell/BudgetBar.js +1 -1
  233. package/dist/shell/Card.js +1 -1
  234. package/dist/shell/ColoredBadge.js +1 -1
  235. package/dist/shell/ConfirmDialog.js +1 -1
  236. package/dist/shell/ContainerFillChart.js +1 -1
  237. package/dist/shell/CountBadge.js +1 -1
  238. package/dist/shell/Dialog.js +1 -1
  239. package/dist/shell/Drawer.js +1 -1
  240. package/dist/shell/EditableGrid.js +1 -1
  241. package/dist/shell/EmptyState.js +1 -1
  242. package/dist/shell/GlobalSearch.js +1 -1
  243. package/dist/shell/HelpCenter.js +1 -1
  244. package/dist/shell/IconRail.js +1 -1
  245. package/dist/shell/ImageLightbox.js +1 -1
  246. package/dist/shell/ItemCount.js +1 -1
  247. package/dist/shell/LanguageSelect.js +1 -1
  248. package/dist/shell/Markdown.js +1 -1
  249. package/dist/shell/MetricBar.js +1 -1
  250. package/dist/shell/MetricBarLegend.js +1 -1
  251. package/dist/shell/MilestoneTimeline.js +1 -1
  252. package/dist/shell/PageHeader.js +1 -1
  253. package/dist/shell/ProductionTimeline.js +1 -1
  254. package/dist/shell/ResizeHandle.js +1 -1
  255. package/dist/shell/Result.js +1 -1
  256. package/dist/shell/SearchableSelect.js +1 -1
  257. package/dist/shell/SettingReset.js +1 -1
  258. package/dist/shell/SettingRow.js +1 -1
  259. package/dist/shell/SidebarLayout.js +1 -1
  260. package/dist/shell/SidebarNav.js +1 -1
  261. package/dist/shell/SortableList.js +1 -1
  262. package/dist/shell/Statistic.js +1 -1
  263. package/dist/shell/TimeAgo.js +1 -1
  264. package/dist/shell/TimelineTrack.js +1 -1
  265. package/dist/shell/TransferProgress.js +1 -1
  266. package/dist/shell/Tree.js +1 -1
  267. package/dist/shell/language.js +1 -1
  268. package/dist/shell/strings.d.ts +6 -0
  269. package/dist/shell/strings.js +1 -1
  270. package/dist/shell/toast.js +1 -1
  271. package/dist/telemetry/index.js +1 -1
  272. package/dist/templates/AuthScreen.js +1 -1
  273. package/dist/templates/ChatTemplate.js +1 -1
  274. package/dist/templates/CheckoutTemplate.js +1 -1
  275. package/dist/templates/DashboardTemplate.js +1 -1
  276. package/dist/templates/DataTablePage.js +1 -1
  277. package/dist/templates/EmailTemplate.js +1 -1
  278. package/dist/templates/ErrorBoundary.js +1 -1
  279. package/dist/templates/ErrorPage.js +1 -1
  280. package/dist/templates/FormLayoutPage.js +1 -1
  281. package/dist/templates/GalleryTemplate.js +1 -1
  282. package/dist/ui/index.js +1 -1
  283. package/dist/version.js +1 -1
  284. package/package.json +1 -1
  285. package/dist/Calculator-CSYRZAS5.js +0 -29
  286. package/dist/Files-4SD6LLKX.js +0 -88
  287. package/dist/Sidebar-Y4DTQYW2.js +0 -43
  288. package/dist/chunk-5SJ45P5E.js +0 -8
  289. package/dist/chunk-6453ISTQ.js +0 -4
  290. package/dist/chunk-D7IXMMZT.js +0 -9
  291. package/dist/chunk-FKNJSD6B.js +0 -14
  292. package/dist/chunk-G4EVQD5U.js +0 -8
  293. package/dist/chunk-G6CTTBKE.js +0 -9
  294. package/dist/chunk-HUF34LSW.js +0 -15
  295. package/dist/chunk-IMA5SXEC.js +0 -2
  296. package/dist/chunk-IX6QMUJQ.js +0 -9
  297. package/dist/chunk-JKHWZ2ZY.js +0 -19
  298. package/dist/chunk-KWT6GT4M.js +0 -29
  299. package/dist/chunk-LB3A53D5.js +0 -8
  300. package/dist/chunk-MG7A3R75.js +0 -1
  301. package/dist/chunk-N45ACN3G.js +0 -6
  302. package/dist/chunk-OX2DOOOI.js +0 -8
  303. package/dist/chunk-PDB5W7VI.js +0 -6
  304. package/dist/chunk-Q7KTTDUS.js +0 -11
  305. package/dist/chunk-QWHQJNKL.js +0 -1
  306. package/dist/chunk-RC6UHOAV.js +0 -4
  307. package/dist/chunk-TNTQL6SX.js +0 -1
  308. package/dist/chunk-TTHWXGT7.js +0 -11
  309. package/dist/chunk-WE7CYRZT.js +0 -7
@@ -1,88 +0,0 @@
1
- import{openPreviewFile as e}from"./chunk-MV6WDGB6.js";import{SidebarLayout as t}from"./chunk-5JRL5LXD.js";import"./chunk-QWK6DRSN.js";import"./chunk-DWBZ3Z34.js";import{Breadcrumbs as a}from"./chunk-43ONX6UZ.js";import{formatBytes as n}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{getFilesDemoTree as r}from"./chunk-TGLHJS3M.js";import{AboutApp as i}from"./chunk-732XHVR4.js";import{peekFilesViewRequest as s,consumeFilesViewRequest as o,FILES_SHOW_TRASH_EVENT as l,FILES_OPEN_DESKTOP_FOLDER_EVENT as c,subscribeDesktopFolders as d,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-GSBIJLTD.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-DZTAGMNY.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-AGUA3O5O.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-VG2R6PZV.js";import{confirm as g,prompt as k}from"./chunk-IK2WXW2E.js";import"./chunk-6453ISTQ.js";import"./chunk-KC3EX26K.js";import{ItemCount as b}from"./chunk-PDXPMHG3.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as y}from"./chunk-XD34TCRG.js";import"./chunk-UGTRSRIW.js";import"./chunk-X7PM7JOD.js";import"./chunk-CDAJKLGL.js";import"./chunk-TNTQL6SX.js";import"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import{Icon as N}from"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import{TH_ONE_LINE as v}from"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-QWHQJNKL.js";import"./chunk-C3QOHMR6.js";import{useState as j,useEffect as $,useSyncExternalStore as D,useRef as C,useCallback as T}from"react";import{jsxs as L,jsx as R,Fragment as E}from"react/jsx-runtime";var W="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",M={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function S(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function P(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function A(){const A=W.replace(/\/$/,""),F=null!==r(),[U,I]=j("/"),[O,H]=j([]),[J,G]=j([]),[V,X]=j(null),[B,K]=j(!0),[Z,Q]=j(!1),[z,_]=j(null),[Y,q]=j(!1),[ee,te]=j(()=>{const e=s();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{o()},[]);const[ae,ne]=j([]);$(()=>{const e=()=>{o(),te("trash")},t=e=>{o();const t=e.detail?.folderId;t&&te({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const re=D(d,m,m),ie="object"==typeof ee?ee.desktopFolderId:null,se=ie?re?.folders.find(e=>e.id===ie)??null:null,oe=ie&&re?.itemsByFolder[ie]||[];$(()=>{ie&&re&&!re.folders.some(e=>e.id===ie)&&te("files")},[ie,re]);const le=C(0),ce=C(null),{openPage:de,openEntity:me}=f(),he=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):me(t.entityType,t.entityId,null,t.label)},pe=T((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),ue=T(async()=>{try{const e=await pe(`${A}/api/quota`);if(e.ok){const t=await e.json();_({used:t.used,limit:t.limit})}}catch{}},[pe,A]),fe=T(async e=>{if(X(null),F){const t=function(e){const t=r();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return H(t),I(e),Q(!1),K(!1),void("/"===e&&G(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}K(!0);try{const t=await pe(`${A}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),n=a.entries||[];H(n),I(a.path||e),Q(!1),"/"===(a.path||e)&&G(n.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){Q(!0)}finally{K(!1)}ue()},[pe,A,ue,F]),xe=T(async()=>{if(F)return ne([]),void K(!1);K(!0),X(null);try{const e=await pe(`${A}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ne(t.entries||[]),Q(!1)}catch{Q(!0)}finally{K(!1)}ue()},[pe,A,ue,F]);$(()=>{"files"===ee?fe(U):"trash"===ee&&xe()},[U,ee]);const ge=async e=>{const t=S(U,e.name);try{const a=await pe(`${A}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void y.error(`Download failed (${a.status})`);const n=await a.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){y.error(e?.message||"Download failed")}},ke=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await pe(`${A}/api/upload?path=${encodeURIComponent(U)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));y.error(`Quota exceeded — ${n(a)} free, ${e.name} is ${n(t.attempted||e.size)}`)}else y.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){y.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}fe(U)},be=()=>{le.current=0,q(!1)};if($(()=>{const e=()=>be();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),Z)/* @__PURE__ */
2
- return L("div",{className:"flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */R(x,{title:"Files - offline"}),
4
- /* @__PURE__ */R("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
- /* @__PURE__ */R(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
- /* @__PURE__ */R("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
- /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
- /* @__PURE__ */R("span",{className:"font-mono",children:A}),". Make sure the server is running — see ",
9
- /* @__PURE__ */R("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
- /* @__PURE__ */R("button",{onClick:()=>fe(U),className:"px-3 h-8 text-sm bg-blue-500 text-on-accent rounded hover:bg-blue-600",children:"Retry"})]})})]});const ye="/"===U?[]:U.split("/").filter(Boolean),Ne=z&&z.limit>0?Math.min(100,Math.round(z.used/z.limit*100)):0,we=Ne>90?"bg-red-500":Ne>75?"bg-amber-500":"bg-blue-500",ve=[{label:"My files",onClick:()=>I("/")},...ye.map((e,t)=>({label:e,onClick:()=>I("/"+ye.slice(0,t+1).join("/"))}))],je=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */R("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */R("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),De=/* @__PURE__ */L("nav",{className:"p-2",children:[
11
- /* @__PURE__ */R("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
12
- /* @__PURE__ */L("button",{onClick:()=>{te("files"),I("/")},className:je("files"===ee&&"/"===U),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),J.map(e=>/* @__PURE__ */L("button",{onClick:()=>{te("files"),I("/"+e)},className:je("files"===ee&&U==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
13
- /* @__PURE__ */R("span",{className:"truncate",children:e})]},e)),!F&&/* @__PURE__ */L("button",{onClick:()=>te("trash"),className:je("trash"===ee),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */L(E,{children:[
14
- /* @__PURE__ */R("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>te({desktopFolderId:e.id}),className:je(ie===e.id),children:[
15
- /* @__PURE__ */R(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
- /* @__PURE__ */R("span",{className:"truncate",children:e.name}),
17
- /* @__PURE__ */R(b,{count:e.itemCount,active:ie===e.id,className:"ml-auto"})]},e.id))]})]});/* @__PURE__ */
18
- return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{F||"object"==typeof ee||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,Y||q(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&q(!1)},onDrop:e=>{e.preventDefault(),be(),F||"object"==typeof ee||e.dataTransfer.files?.length&&ke(e.dataTransfer.files)},children:[
19
- /* @__PURE__ */R(x,{title:se?`Files - ${se.name}`:"Files"+("/"===U?"":" - "+U)}),
20
- /* @__PURE__ */R(i,{app:"files"}),
21
- /* @__PURE__ */R("input",{ref:ce,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ke(e.target.files),ce.current&&(ce.current.value="")}}),
22
- /* @__PURE__ */R("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */R(t,{sidebar:De,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
23
- /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */L(E,"files"===ee?{children:[
24
- /* @__PURE__ */R("button",{onClick:()=>I(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(U)),disabled:"/"===U,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */R(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
25
- /* @__PURE__ */R("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */R(a,{items:ve,maxItems:5})}),
26
- /* @__PURE__ */R("button",{onClick:()=>fe(U),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */R(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!F&&/* @__PURE__ */L(E,{children:[
27
- /* @__PURE__ */L("button",{onClick:()=>te("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
28
- /* @__PURE__ */R(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
29
- /* @__PURE__ */L("button",{onClick:async()=>{const e=await k({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void y.error("Folder names cannot contain slashes");const t=S(U,e),a=await pe(`${A}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void y.error(e.error||`Create folder failed (${a.status})`)}fe(U)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
30
- /* @__PURE__ */R(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
31
- /* @__PURE__ */L("button",{onClick:()=>ce.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
32
- /* @__PURE__ */R(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===ee?{children:[
33
- /* @__PURE__ */R("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */R(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
34
- /* @__PURE__ */R("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
35
- /* @__PURE__ */R("button",{onClick:xe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */R(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
36
- /* @__PURE__ */R("button",{onClick:async()=>{if(0===ae.length)return;if(!await g({title:"Empty trash",message:`${ae.length} item${1===ae.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await pe(`${A}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Empty trash failed (${e.status})`)}xe()},disabled:0===ae.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
37
- /* @__PURE__ */R("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */R(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
38
- /* @__PURE__ */R(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
39
- /* @__PURE__ */R("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
40
- /* @__PURE__ */R("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),z&&/* @__PURE__ */L(E,{children:[
41
- /* @__PURE__ */R("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
42
- /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${n(z.used)} of ${n(z.limit)} used`,children:[
43
- /* @__PURE__ */R("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */R("div",{className:`h-full ${we} transition-all`,style:{width:`${Ne}%`}})}),
44
- /* @__PURE__ */L("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[n(z.used)," / ",n(z.limit)]})]})]})]}),
45
- /* @__PURE__ */R("div",{className:"flex-1 overflow-auto",children:"object"==typeof ee?0===oe.length?/* @__PURE__ */R("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
46
- /* @__PURE__ */R("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
47
- /* @__PURE__ */R("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
48
- /* @__PURE__ */R("th",{className:`${v} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
49
- /* @__PURE__ */R("th",{className:`${v} w-56`})]})}),
50
- /* @__PURE__ */R("tbody",{children:oe.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
51
- return L("tr",{onClick:()=>X(t),onDoubleClick:()=>he(e),className:"cursor-default border-b border-gray-100 "+(V===t?"bg-blue-50":"hover:bg-gray-50"),children:[
52
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
53
- /* @__PURE__ */R(p,{item:e}),
54
- /* @__PURE__ */R("span",{className:"truncate",title:e.label,children:e.label})]}),
55
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-xs text-ink-faint",children:u(e)}),
56
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
57
- /* @__PURE__ */R("button",{onClick:t=>{t.stopPropagation(),he(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
58
- /* @__PURE__ */R("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Move to desktop"}),
59
- /* @__PURE__ */R("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===ee?B&&0===ae.length?/* @__PURE__ */R(w,{size:"sm",padding:"p-6",label:"Loading"}):0===ae.length?/* @__PURE__ */R("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
60
- /* @__PURE__ */R("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
61
- /* @__PURE__ */R("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
62
- /* @__PURE__ */R("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Original location"}),
63
- /* @__PURE__ */R("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
64
- /* @__PURE__ */R("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
65
- /* @__PURE__ */R("th",{className:`${v} w-44`})]})}),
66
- /* @__PURE__ */R("tbody",{children:ae.map(e=>/* @__PURE__ */L("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
67
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */R(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */R(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
68
- /* @__PURE__ */R("span",{className:"truncate",title:e.name,children:e.name})]}),
69
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
70
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:n(e.size)}),
71
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?P(e.deletedAt):"—"}),
72
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
73
- /* @__PURE__ */R("button",{onClick:()=>(async e=>{const t=await pe(`${A}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Restore failed (${t.status})`)}y.success(`Restored "${e.name}"`),xe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
74
- /* @__PURE__ */R("button",{onClick:()=>(async e=>{if(!await g({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await pe(`${A}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Delete failed (${t.status})`)}xe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):B&&0===O.length?/* @__PURE__ */R(w,{size:"sm",padding:"p-6",label:"Loading"}):0===O.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!F&&/* @__PURE__ */L(E,{children:[" Drop files here or click ",
75
- /* @__PURE__ */R("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
76
- /* @__PURE__ */R("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
77
- /* @__PURE__ */R("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
78
- /* @__PURE__ */R("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
79
- /* @__PURE__ */R("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
80
- /* @__PURE__ */R("th",{className:`${v} w-32`})]})}),
81
- /* @__PURE__ */R("tbody",{children:O.map(t=>/* @__PURE__ */L("tr",{onClick:()=>X(t.name),onDoubleClick:()=>{"folder"===t.kind?I(S(U,t.name)):(async t=>{if(F)return;const a=S(U,t.name),n=(t.name.split(".").pop()||"").toLowerCase(),r=M[n];r?await e({filePath:a,filename:t.name,kind:r,onStaged:e=>de(e)}):ge(t)})(t)},className:"cursor-default border-b border-gray-100 "+(V===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
82
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */R(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */R(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
83
- /* @__PURE__ */R("span",{className:"truncate",title:t.name,children:t.name})]}),
84
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===t.kind?"—":n(t.size)}),
85
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:P(t.modifiedAt)}),
86
- /* @__PURE__ */R("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!F&&/* @__PURE__ */L(E,{children:["file"===t.kind&&/* @__PURE__ */R("button",{onClick:e=>{e.stopPropagation(),ge(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs",children:"Download"}),
87
- /* @__PURE__ */R("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await k({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void y.error("Names cannot contain slashes");const a=S(U,e.name),n=S(U,t),r=await pe(`${A}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:n})});if(!r.ok){const e=await r.json().catch(()=>({}));return void y.error(e.error||`Rename failed (${r.status})`)}fe(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Rename"}),
88
- /* @__PURE__ */R("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=S(U,e.name),a=await pe(`${A}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void y.error(e.error||`Delete failed (${a.status})`)}fe(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),Y&&/* @__PURE__ */R("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */R("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{A as default};
@@ -1,43 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as a,RAIL_OPEN_SECTIONS_KEY as r,RAIL_WIDTH_KEY as n,toggleOpenSection as i,writeStored as l}from"./chunk-Y65MPP3M.js";import{ResizeHandle as o}from"./chunk-DWBZ3Z34.js";import{openGlobalSearch as s}from"./chunk-ZOHQVSB3.js";import{partitionNav as c,flyoutGroups as d,visibleSectionItems as m,rowsContainRoute as h,visibleNavChildren as u}from"./chunk-WGRS6QBT.js";import{BrandMark as p}from"./chunk-MI67DI3H.js";import{IconButton_default as b}from"./chunk-RUTUVS4H.js";import{RAIL_MENU_GAP as g,navSections as f,startMenuCategories as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_W as N,RAIL_MAX_W as v,RAIL_MIN_W as j,navIcons as C,sectionIcons as w}from"./chunk-CY5N5OA3.js";import"./chunk-5A7MWTXX.js";import"./chunk-PKXQDCNR.js";import{PopupMenu as S,PopupMenuItem as L,PopupMenuDivider as W,PopupMenuLabel as z}from"./chunk-FPGRKHUW.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UQYNPYF4.js";import"./chunk-HL6JSDN3.js";import{Icon as H}from"./chunk-FSPFV4MI.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import{useShellStrings as $}from"./chunk-QWHQJNKL.js";import"./chunk-C3QOHMR6.js";import{useMemo as R,useState as A,useRef as I,useEffect as M,isValidElement as T,cloneElement as D}from"react";import{jsx as K,jsxs as P,Fragment as Q}from"react/jsx-runtime";var B="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform);function J(e,t,a){const r=Math.max(8,a-t.bottom);return{left:e+g,bottom:r,maxHeight:a-r-8,overflowY:"auto"}}var U=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),F="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function G({open:e}){/* @__PURE__ */
2
- return K(H,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function O({dir:e}){/* @__PURE__ */
3
- return K(H,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function V({className:e}){/* @__PURE__ */
4
- return K(H,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var Z=e=>.75+1.75*e+"rem";function _({width:_,collapsed:Y,onToggleCollapsed:X,onResize:E,onHome:q,onOpen:ee,activeRoute:te,profile:ae,user:re,onLogout:ne,onSwitchToDesktop:ie,onReportBug:le,onClose:oe,navSections:se=f,navIcons:ce=C,sectionIcons:de=w,categories:me=x,productName:he,productIcon:ue,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:ge=null,logoIsLight:fe=null}){const xe=$().layout,{hasAnyPerm:ke}=e(),ye=R(()=>c(se,me,ke),[se,me,ke]),[Ne,ve]=A(()=>t(a(r))),je=e=>ve(t=>{const a=i(t,e);return l(r,JSON.stringify([...a])),a}),[Ce,we]=A(null),[Se,Le]=A(!1),We=I(null);M(()=>{Y||we(null)},[Y]);const ze=(e,t)=>{we(null),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},He=(e,t)=>{const a=t[e];/* @__PURE__ */
5
- return K("span",{className:F,"aria-hidden":"true",children:a&&T(a)?D(a,{className:"size-[18px]"}):a})},$e=(e,t)=>{const a=u(e,ke),r=e.menuLabel??e.label;if(a.length>0){const n=`child:${e.to}`,i=Ne.has(n),l=!i&&h(a,te,ke);/* @__PURE__ */
6
- return P("div",{children:[
7
- /* @__PURE__ */P("button",{type:"button",onClick:()=>je(n),"aria-expanded":i,className:U(l,!1),style:t>0?{paddingLeft:Z(t)}:void 0,children:[0===t&&He(e.to,ce),
8
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:r}),
9
- /* @__PURE__ */K(G,{open:i})]}),i&&/* @__PURE__ */K("div",{className:"space-y-0.5 pt-0.5",children:a.map(e=>$e(e,t+1))}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Z(t)},"aria-hidden":"true"})]},e.to)}const n=e.to===te;/* @__PURE__ */
10
- return P("div",{children:[
11
- /* @__PURE__ */P("button",{type:"button",onClick:t=>ze(e,t),onAuxClick:t=>{1===t.button&&ze(e,t)},"aria-current":n?"page":void 0,className:U(n,!1),style:t>0?{paddingLeft:Z(t)}:void 0,children:[0===t&&He(e.to,ce),
12
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:r})]}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Z(t)},"aria-hidden":"true"})]},e.to)},Re=(e,t)=>{const a=t?e.items:m(e,ke);if(0===a.length)return null;const r="icon"in e&&e.icon?/* @__PURE__ */K("span",{className:F,"aria-hidden":"true",children:e.icon}):He(e.label,de),n=e.menuLabel??e.label,i=h(a,te,ke),l="dividerAfter"in e&&e.dividerAfter;if(Y)/* @__PURE__ */
13
- return P("div",{children:[
14
- /* @__PURE__ */K("button",{type:"button",title:n,"aria-label":n,"aria-haspopup":"menu","aria-expanded":Ce?.label===e.label,onClick:t=>{const r=t.currentTarget.getBoundingClientRect();we(t=>t?.label===e.label?null:{label:e.label,items:a,top:r.top})},className:U(i||Ce?.label===e.label,!0),children:r}),l&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const o=Ne.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
15
- return P("div",{children:[
16
- /* @__PURE__ */P("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":o,"aria-controls":s,className:U(!o&&i,!1),children:[r,
17
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:n}),
18
- /* @__PURE__ */K(G,{open:o})]}),
19
- /* @__PURE__ */K("div",{id:s,role:"group","aria-label":n,hidden:!o,className:"space-y-0.5 pt-0.5",children:o&&a.map(e=>$e(e,1))}),l&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ae=ae?.first_name?`${ae.first_name} ${ae.last_name||""}`.trim():re?.email||"",Ie=(ae?.first_name?.charAt(0)||re?.email?.charAt(0)||"?").toUpperCase(),Me=ae?.avatar_url?/* @__PURE__ */K("img",{src:ae.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */K("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Ie}),Te=Se?We.current?.getBoundingClientRect():void 0,De=Y?"":"px-3",Ke=Y?{paddingInline:y}:void 0,Pe=`${Y?xe.expandSidebar:xe.collapseSidebar} (${B?"⌘":"Ctrl"} .)`,Qe=q?{run:q,label:xe.goHome,title:xe.goHome}:oe?null:{run:X,label:Y?xe.expandSidebar:xe.collapseSidebar,title:Pe},Be=/* @__PURE__ */P(Q,{children:[ue&&/* @__PURE__ */K(p,{src:ue,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:ge,isLight:fe,size:28,decorative:!0}),!Y&&/* @__PURE__ */P("span",{className:"min-w-0 text-left leading-tight",children:[
20
- /* @__PURE__ */K("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:he??"Apps"}),pe&&/* @__PURE__ */K("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),Je=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
21
- return P("aside",{"aria-label":xe.navLabel,className:"fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong",style:{width:_},children:[
22
- /* @__PURE__ */P("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Y?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Qe?/* @__PURE__ */K("button",{type:"button",onClick:Qe.run,"aria-label":Qe.label,title:Qe.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Y?"justify-center p-0.5":"-ml-1 p-1"),children:Be}):/* @__PURE__ */K("span",{className:"flex min-w-0 items-center gap-2",children:Be}),oe?/* @__PURE__ */K(b,{onClick:oe,"aria-label":xe.closeMenu,children:/* @__PURE__ */K(H,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):!Y&&/* @__PURE__ */K("button",{type:"button",onClick:X,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${B?"⌘":"Ctrl"} .)`,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:/* @__PURE__ */K(O,{dir:"left"})})]}),
23
- /* @__PURE__ */K("div",{className:`shrink-0 pt-3 ${De}`,style:Ke,children:Y?/* @__PURE__ */K("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${B?"⌘K":"Ctrl K"})`,className:U(!1,!0),children:/* @__PURE__ */K(V,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */P("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-line bg-surface px-3 text-left transition-colors hover:bg-gray-100",children:[
24
- /* @__PURE__ */K(V,{className:"size-3.5 text-gray-500"}),
25
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
26
- /* @__PURE__ */K("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:B?"⌘K":"Ctrl K"})]})}),
27
- /* @__PURE__ */P("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${De} ${Y?"space-y-1":"space-y-0.5"}`,style:Ke,children:[Y&&/* @__PURE__ */K("button",{type:"button",onClick:X,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${B?"⌘":"Ctrl"} .)`,className:`${U(!1,!0)} mb-3`,children:/* @__PURE__ */K(O,{dir:"right"})}),ye.topItems.map(e=>{if(!Y)return $e(e,0);const t=u(e,ke),a=e.to===te||h(t,te,ke),r=e.menuLabel??e.label;/* @__PURE__ */
28
- return P("div",{children:[
29
- /* @__PURE__ */K("button",{type:"button",title:r,"aria-label":r,onClick:a=>{if(0===t.length)return void ze(e,a);const r=a.currentTarget.getBoundingClientRect();we(a=>a?.label===e.to?null:{label:e.to,items:t,top:r.top})},className:U(a,!0),children:He(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&Je&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Re(e,!1)),ye.systemSections.map(e=>Re(e,!1)),ye.virtualSections.map(e=>Re(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */K("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Re(e,!1))]}),
30
- /* @__PURE__ */K("div",{className:`shrink-0 border-t border-gray-200 py-2 ${De}`,style:Ke,children:/* @__PURE__ */P("button",{ref:We,type:"button",onClick:()=>Le(e=>!e),"aria-haspopup":"menu","aria-expanded":Se,"aria-label":Y?xe.accountMenu(Ae):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Y?"justify-center py-2":"px-2 py-2"),children:[Me,!Y&&/* @__PURE__ */P("span",{className:"min-w-0 flex-1 text-left",children:[
31
- /* @__PURE__ */K("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ae}),re?.email&&Ae!==re.email&&/* @__PURE__ */K("span",{className:"block truncate text-2xs text-ink-faint",children:re.email})]})]})}),E&&!Y&&!oe&&/* @__PURE__ */K(o,{side:"left",width:_,onResize:E,min:j,max:v,defaultWidth:N,storageKey:n,label:xe.resizeSidebar}),Se&&Te&&/* @__PURE__ */P(S,{portal:!0,minWidth:224,onClose:()=>Le(!1),style:J(_,Te,window.innerHeight),children:[Y&&/* @__PURE__ */P("div",{className:"border-b border-line px-3 py-3",children:[
32
- /* @__PURE__ */K("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ae}),re?.email&&/* @__PURE__ */K("p",{className:"truncate text-xs text-gray-500",children:re.email})]}),
33
- /* @__PURE__ */P(L,{onClick:()=>{Le(!1),ee("/profile",!1)},children:[
34
- /* @__PURE__ */K(H,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */P(L,{onClick:()=>{Le(!1),ze(e)},children:[
35
- /* @__PURE__ */K("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),le&&/* @__PURE__ */P(L,{onClick:()=>{Le(!1),le()},children:[
36
- /* @__PURE__ */K(H,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
37
- /* @__PURE__ */K(W,{}),ie&&/* @__PURE__ */P(Q,{children:[
38
- /* @__PURE__ */P(L,{onClick:()=>{Le(!1),ie()},children:[
39
- /* @__PURE__ */K(H,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
40
- /* @__PURE__ */K(W,{})]}),
41
- /* @__PURE__ */P(L,{danger:!0,onClick:()=>{Le(!1),ne()},children:[
42
- /* @__PURE__ */K(H,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]}),Ce&&Y&&/* @__PURE__ */K(S,{portal:!0,minWidth:220,onClose:()=>we(null),style:{left:_+g,top:Math.min(Ce.top,window.innerHeight-48*Math.min(Ce.items.length,10)-16)},children:d(Ce.items,ke).map((e,t)=>/* @__PURE__ */P("div",{role:e.heading?"group":void 0,"aria-label":e.heading?e.heading.menuLabel??e.heading.label:void 0,children:[t>0&&/* @__PURE__ */K(W,{}),e.heading&&/* @__PURE__ */K(z,{children:e.heading.menuLabel??e.heading.label}),e.items.map(e=>/* @__PURE__ */P(L,{onClick:()=>ze(e),children:[He(e.to,ce),
43
- /* @__PURE__ */K("span",{className:e.to===te?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))]},e.heading?.to??`run-${t}`))})]})}export{J as accountMenuPosition,_ as default};
@@ -1,8 +0,0 @@
1
- import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-QWHQJNKL.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useRef as d,useState as u,useId as f,useEffect as x}from"react";import{jsx as g,jsxs as p}from"react/jsx-runtime";function y({labels:y,values:v,height:b=220,width:k,bandPadding:M=.24,min:N,max:w,yTickCount:A=4,formatValue:$,yAxisLabel:j,xTickAnchor:R="center",children:E,overlay:L,tooltip:U,onSelect:z,ariaLabel:C,className:D,emptyLabel:P}){const W=s().charts,F=c(),I=$??(t=>m(t,F)),Q=P??W.noData,S=d(null),T=o(S),V=k??T,[B,H]=u(null),J=f();if(x(()=>{if(null!==B)return a(t=>"Escape"===t.key&&(H(null),!0))},[B]),0===y.length||!v.some(Number.isFinite))/* @__PURE__ */
2
- return g("div",{className:D,ref:S,children:/* @__PURE__ */g("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:b},children:Q})});const K=v.filter(Number.isFinite),Z=K.every(Number.isInteger),G=void 0===N&&void 0===w?e(Math.min(0,...K),Math.max(0,...K),{intervals:A+1,integer:Z}):null,O=void 0!==N&&void 0===w?e(N,Math.max(N,...K),{intervals:A+1,integer:Z,zero:!1}):null,X=G?G.lo:N??Math.min(0,...K),q=G?G.hi:O?O.hi:w??i(Math.max(...K,0)),Y=G?G.ticks:O?[X,...O.ticks.filter(t=>t>X)]:r([X,q],{from:0,to:1}).ticks(A+1),_={top:12,right:16,bottom:26,left:n(Y.map(I),48)+(j?10:0)},tt=_.left,et=Math.max(tt+1,V-_.right),it=_.top,rt=b-_.bottom,nt=r([X,q],{from:rt,to:it}),lt=l(y.length,{from:tt,to:et},M),ot=(et-tt)/Math.max(1,y.length),at=ot>=48,ht=at?1:Math.max(1,Math.ceil(y.length/Math.max(1,Math.floor(V/84)))),st=Math.max(2,Math.floor((ot-6)/6.6)),ct=t=>at&&t.length>st?`${t.slice(0,st-1).trimEnd()}…`:t;/* @__PURE__ */
3
- return p("div",{className:`relative ${D??""}`,ref:S,children:[
4
- /* @__PURE__ */p("svg",{width:"100%",height:b,viewBox:`0 0 ${V} ${b}`,role:"img","aria-label":C,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>H(null),onBlur:()=>H(null),onKeyDown:t=>{if(z&&null!==B&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void z(B);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e="ArrowRight"===t.key?1:-1;H(t=>Math.min(y.length-1,Math.max(0,(t??0)+e)))},children:[
5
- /* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:J,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${t}`)),
6
- /* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Y.map(t=>/* @__PURE__ */g("text",{x:tt-8,y:nt(t)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:I(t)},`t${t}`)),j&&/* @__PURE__ */g("text",{x:14,y:(it+rt)/2,transform:`rotate(-90 14 ${(it+rt)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:j}),
7
- /* @__PURE__ */g("g",{clipPath:`url(#${J})`,children:E({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:V,height:b,clipId:J,active:B})}),L?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:V,height:b,clipId:J,active:B}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===R?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:ct(t)},`x${e}`):null),y.map((t,e)=>/* @__PURE__ */g("rect",{x:lt.center(e)-(et-tt)/y.length/2,y:it,width:(et-tt)/y.length,height:rt-it,fill:"transparent",onMouseEnter:()=>H(e),onClick:z?()=>z(e):void 0,style:z?{cursor:"pointer"}:void 0},`h${e}`))]}),U&&null!==B&&
8
- /* @__PURE__ */g("div",{className:"pointer-events-none absolute top-2 z-10",style:t(lt.center(B),lt.bandwidth,V),children:U(B)})]})}export{y as CartesianPlot};
@@ -1,4 +0,0 @@
1
- import{useOverlayTarget as e,OverlayLayerProvider as r}from"./chunk-4AJRHTTB.js";import{dialogA11y as i}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as t}from"./chunk-PKXQDCNR.js";import{useFocusTrap as a,useScrollLock as o}from"./chunk-CDAJKLGL.js";import{Icon as l}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{useHydrated as n}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as d}from"./chunk-TWVUQUUD.js";import{useShellStrings as c}from"./chunk-QWHQJNKL.js";import{useRef as m,useId as u,useState as f,useEffect as h}from"react";import{createPortal as p}from"react-dom";import{jsx as x,jsxs as b}from"react/jsx-runtime";var g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function v({open:v,onClose:y,title:k,description:N,role:j="dialog",children:w,footer:W,blocking:C=!1,size:J="md",aside:L=!1,initialFocus:T,"aria-label":D,"aria-labelledby":Q,"aria-describedby":A,className:F=""}){const H=m(null),I=u(),K=u(),U=!C,V=u(),z=c().dialog,B=e(n()),[G,P]=f(null);return t(v),a(H,v&&null!==B,T),o(v),h(()=>{if(v)return d(()=>(C||y(),!0),()=>H.current)},[v,C,y]),v&&B?p(
2
- /* @__PURE__ */x(r,{value:G,children:/* @__PURE__ */b("div",{ref:P,className:"fixed inset-0"+(L?" pointer-events-none opacity-0":""),style:{zIndex:s.overlay},role:"presentation","data-aside":L?"":void 0,children:[
3
- /* @__PURE__ */x("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
4
- /* @__PURE__ */x("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:C?void 0:e=>{e.target===e.currentTarget&&y()},children:/* @__PURE__ */b("div",{ref:H,...i({role:j,modal:!0,titleId:k?V:void 0,labelledBy:Q,label:D}),"aria-describedby":A??(N?K:w?I:void 0),className:`relative max-h-full w-full ${g[J]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${F}`.trim(),children:[k&&/* @__PURE__ */x("h2",{id:V,className:(U?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:k}),N&&/* @__PURE__ */x("p",{id:K,className:((k?"mt-1":U?"pr-8":"")+" text-sm text-gray-500").trim(),children:N}),w&&/* @__PURE__ */x("div",{id:I,className:"mt-2 text-sm text-gray-600",children:w}),W&&/* @__PURE__ */x("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:W}),U&&/* @__PURE__ */x("button",{type:"button",onClick:y,"aria-label":z.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */x(l,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),B):null}export{v as Dialog};
@@ -1,9 +0,0 @@
1
- import{AccessibleTable as e}from"./chunk-TBPHW42V.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-TLRCTNUF.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-QWHQJNKL.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,N=s(),j=v??(e=>h(e,N)),$=w??b.noFlows,C=c(null),F=l(C),E=x??F,[T,A]=m(null),{highlighted:H}=n();if(0===f.length||0===k.length)/* @__PURE__ */
2
- return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const L=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),Q=e=>L.length<=1?0:L.indexOf(e)/(L.length-1)*(E-g-140)+70,U=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),W=/* @__PURE__ */new Map;for(const e of f)W.set(e.depth,[...W.get(e.depth)??[],e]);const z=Math.max(...[...W.values()].map(e=>e.reduce((e,t)=>e+(U.get(t.key)??0),0))),O=p-20,P=z>0?(O-y*(Math.max(...[...W.values()].map(e=>e.length))-1))/z:0,R=/* @__PURE__ */new Map;for(const[e,t]of W){const n=t.map(e=>Math.max(2,(U.get(e.key)??0)*P)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>O&&l>0?Math.max(0,1-(o-O)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;R.set(t.key,{x:Q(e),y:a,h:l,index:o}),a+=l+y})}const V=/* @__PURE__ */new Map,B=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,Y=(e,t)=>e.from===t||e.to===t,Z="link"===T?.kind?k[T.index]:void 0,J="node"===T?.kind?f.find(e=>e.key===T.key):void 0;/* @__PURE__ */
3
- return u("div",{className:`relative ${M??""}`,ref:C,children:[
4
- /* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${E} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>A(null),children:[k.map((e,n)=>{const o=R.get(e.from),l=R.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*P),i=o.y+(V.get(e.from)??0)+a/2,s=l.y+(B.get(e.to)??0)+a/2;V.set(e.from,(V.get(e.from)??0)+a),B.set(e.to,(B.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=S.get(u)??0;S.set(u,f+1);const k=((e,t)=>T?"link"===T.kind?T.index===t:Y(e,T.key):null!==H?Y(e,H):null)(e,n);/* @__PURE__ */
5
- return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>A({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=R.get(e.key);if(!t)return null;const n=t.x>E/2,o=(l=e.key,T?"node"===T.kind?T.key===l:Y(k[T.index],l):null!==H?H===l:null);var l;/* @__PURE__ */
6
- return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>A({kind:"node",key:e.key}),children:[
7
- /* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:r(t.index,e.color,e.tone)}),
8
- /* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:`${Z.from} → ${Z.to}`,rows:[{key:"value",label:b.flow,color:r(R.get(Z.from)?.index??0,Z.color),value:j(Z.value)}]})}),J&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:J.label,rows:[{key:"value",label:b.throughput,color:r(R.get(J.key)?.index??0,J.color,J.tone),value:j(U.get(J.key)??0)}]})}),
9
- /* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,j(e.value)])})]})}export{f as SankeyChart};
@@ -1,14 +0,0 @@
1
- import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-TLRCTNUF.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-QWHQJNKL.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:N}){const L=o().charts,A=i(),S=y??(e=>h(e,A)),j=N??L.noStages,z=c(),[C,F]=m(null),{highlighted:V}=e(),W=s(null),w=l(W,560),H=$??w;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Z=b??a(0),E=p??54*x.length,Q=Math.max(...x.map(e=>e.value),1),R="bars"===v,T=R?Math.round(Math.min(132,Math.max(80,.24*H))):Math.round(Math.min(168,Math.max(104,.38*H))),U=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},B=e=>{const t=U(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,A)}`:""}},Y=R?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=B(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,J=H-T-Y,K=Math.max(R?2:0,Math.min(M,J)),O=e=>Math.max(K,J*Math.max(0,e/Q)),P=e=>O(e)/2,X=T+J/2,q=e=>46+e/Math.max(1,x.length-1)*54,D=e=>`color-mix(in oklab, ${Z} ${q(e).toFixed(0)}%, ${n.surface})`,G=e=>q(e)>=55?n.surface:n.label,I=(e,t)=>null!==C?C!==e:null!==V&&V!==t,_=null!==C?x[C]:void 0;/* @__PURE__ */
2
- return f("div",{className:`relative ${k??""}`,ref:W,children:[
3
- /* @__PURE__ */f("svg",{width:"100%",height:E,viewBox:`0 0 ${H} ${E}`,role:"img","aria-labelledby":z,onMouseLeave:()=>F(null),children:[
4
- /* @__PURE__ */d("title",{id:z,children:L.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*E/x.length+g/2,a=(t+1)*E/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,A),i=.62*o.length*12+12;if(R){const u=T,h=u+O(e.value),{count:c,drop:m}=B(t);/* @__PURE__ */
5
- return f("g",{opacity:I(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
6
- /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:D(t)}),
7
- /* @__PURE__ */d("text",{x:T-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:G(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
- /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
- /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=P(e.value),c="cone"===v?P(x[t+1]?.value??e.value):h,m=U(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
- return f("g",{opacity:I(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
11
- /* @__PURE__ */d("path",{d:`M${X-h},${l} L${X+h},${l} L${X+c},${a} L${X-c},${a} Z`,fill:D(t)}),
12
- /* @__PURE__ */d("text",{x:T-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
- /* @__PURE__ */f("text",{x:T-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,A)}`:""]}),
14
- /* @__PURE__ */d("text",{x:s?X:X+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?G(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==C&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:L.count,color:D(C),value:S(_.value)},{key:"share",label:L.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,A)},...C>0&&x[C-1].value>0?[{key:"drop",label:L.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[C-1].value),1,A)}`}]:[]]})})]})}export{x as FunnelChart};
@@ -1,8 +0,0 @@
1
- import{ChartTooltip as e}from"./chunk-TLRCTNUF.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{CHART_INK as s,resolveSeriesColorWithin as c}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-QWHQJNKL.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:N,xDomain:$,yDomain:j,xScale:w="linear",yScale:R="linear",radiusRange:L=[4,22],className:U,emptyLabel:S}){const D=m().charts,W=h(),C=z??(e=>f(e,W)),P=N??(e=>f(e,W)),Q=S??D.noObservations,T=u(null),E=n(T),F=v??E,O=p(),[V,B]=d(null);x(()=>{if(null!==V)return a(e=>"Escape"===e.key&&(B(null),!0))},[V]);const H=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),I=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),J=$||j?I.map(e=>({...e,points:e.points.filter(e=>H(e.x,$)&&H(e.y,j))})).filter(e=>e.points.length>0):I,K=I.reduce((e,t)=>e+t.points.length,0)-J.reduce((e,t)=>e+t.points.length,0);if(0===J.length)/* @__PURE__ */
2
- return y("div",{className:U,ref:T,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:Q})});const X=J.flatMap(e=>e.points),Z=X.some(e=>null!=e.size),Y=14,q=20,G=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(X.map(e=>e.y),j,R,{from:k-G,to:Y}),ie=t(te.ticks(5).map(P),_),le=Math.max(ie+1,F-q),re=ee(X.map(e=>e.x),$,w,{from:ie,to:le}),oe=i([0,Math.max(...X.map(e=>e.size??1))],{from:L[0],to:L[1]}),ne=V?J[V.s]:void 0,ae=V&&ne?ne.points[V.i]:void 0,se=J.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
3
- return g("div",{className:`relative ${U??""}`,ref:T,children:[
4
- /* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${F} ${k}`,role:"img","aria-label":D.scatter(J.map(e=>e.label),A??D.yAxis,M??D.xAxis)+(K>0?`. ${D.outsideRange(K)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>B(null),onBlur:()=>B(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=V?se.findIndex(e=>e.s===V.s&&e.i===V.i):0;B(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
5
- /* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:O,children:/* @__PURE__ */y("rect",{x:ie-L[1],y:Y-L[1],width:le-ie+2*L[1],height:k-G-Y+2*L[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
6
- /* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:s.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
7
- /* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:s.label,style:{fontVariantNumeric:"tabular-nums"},children:C(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:s.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:s.label,children:A}),
8
- /* @__PURE__ */y("g",{clipPath:`url(#${O})`,children:J.map((e,t)=>{const i=c(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):L[0]+1,fill:i,fillOpacity:V&&V.s!==t?.25:.62,stroke:s.surface,strokeWidth:2,onMouseEnter:()=>B({s:t,i:r})},`${e.key}-${r}`))})})]}),V&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??D.xAxis,color:c(ne.slot,3,ne.color,ne.tone),value:C(ae.x)},{key:"y",label:A??D.yAxis,color:c(ne.slot,3,ne.color,ne.tone),value:P(ae.y)},...null!=ae.size?[{key:"size",label:D.size,color:s.muted,value:f(ae.size,W)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
@@ -1,9 +0,0 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-VVGL5O4F.js";import{Segmented as i}from"./chunk-CKPVXDKX.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-GVC535IA.js";import{TransferProgress as u}from"./chunk-IJWFKUYA.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-F4DIVARP.js";import{Icon as p}from"./chunk-FSPFV4MI.js";import{useShellStrings as b}from"./chunk-QWHQJNKL.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:F,onFile:R,label:C,hint:U,error:P,required:V,className:I,accept:K="image/*",maxSizeBytes:O,fit:$="cover",height:z=112,placeholder:A,cta:H,acceptHint:W,showFilename:q=!0,allowReplace:B=!0,allowRemove:D=!0,replaceLabel:S,removeLabel:G,busy:J=!1,busyLabel:Q,choosingLabel:X,pickFailedLabel:Y,progress:_,disabled:M=!1,kind:E,onKindChange:T,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,oe=E??(/video/.test(K)&&!/image/.test(K)?"video":"image"),re="string"==typeof G&&G?G:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=J||ne,me=ne&&!J?X??ie.choosing:Q??ie.uploading,he=P??(se?Y??ie.pickFailed:void 0),pe=e=>{if(!F)return;ce(!1);const a=F(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=M||ue,ke=!!w&&(t(w,K)||w===ve),je=A??o(K,ie),xe=S??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{F?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:K,maxSizeBytes:O,acceptHint:W,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Fe=()=>{ye||(F?pe():we.open())},Re=w?r(w):"",Ce=!ke&&!!ee,Ue=M||!B&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[B&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Fe(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
- /* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),D&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:z},children:[Ce?
4
- /* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:$,objectPosition:Z||void 0}}),q&&w&&/* @__PURE__ */j(n,{children:Re}),Ue,ue&&/* @__PURE__ */j(l,{label:me,progress:_,rounded:"rounded-md"})]}),Ve=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Fe(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":V||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:z},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:_}):/* @__PURE__ */k(x,{children:[
5
- /* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
6
- /* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
7
- /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),W&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:W})]})});/* @__PURE__ */
8
- return k(e,{label:C,htmlFor:be,hint:U,error:he,required:V,className:I,children:[T&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),w?Pe:Ve,!F&&/* @__PURE__ */j("input",{...we.inputProps}),
9
- /* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
@@ -1,15 +0,0 @@
1
- import{AccessibleTable as e}from"./chunk-TBPHW42V.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-TLRCTNUF.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-QWHQJNKL.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:N=4,formatValue:M,animate:j=!0,className:W,emptyLabel:$}){const C=m().charts,F=c(),L=M??(e=>h(e,F)),R=$??C.nothingToCompare,T=p(),[w,A]=u(null),{highlighted:H}=a(),Q=x;if(k.length<3||0===Q.length)/* @__PURE__ */
2
- return d("p",{className:`text-sm text-gray-500 ${W??""}`,children:R});const U=y/2,z=y/2,B=y/2-46,E=n(k.length),V=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...Q.map(e=>e.values[t]??0).filter(Number.isFinite))),Y=(e,t)=>{const r=Math.max(0,Math.min(1,t/V[e])),l=E.center(e)-E.step/2;return[U+B*r*Math.cos(l),z+B*r*Math.sin(l)]},J=(e,t)=>null!==w?w!==e:null!==H&&H!==t,O=null!==w?Q[w]:void 0;/* @__PURE__ */
3
- return f("div",{className:`relative ${W??""}`,children:[
4
- /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":T,onMouseLeave:()=>A(null),children:[
5
- /* @__PURE__ */d("title",{id:T,children:C.acrossMeasures(Q.map(e=>e.label),k.length)}),Array.from({length:N},(e,r)=>{const l=B*(r+1)/N;return"circle"===v?/* @__PURE__ */d("circle",{cx:U,cy:z,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(U,z,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=Y(t,V[t]);/* @__PURE__ */
6
- return f("g",{children:[
7
- /* @__PURE__ */d("line",{x1:U,y1:z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
- /* @__PURE__ */d("text",{x:U+(B+18)*Math.cos(E.center(t)-E.step/2),y:z+(B+18)*Math.sin(E.center(t)-E.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
- /* @__PURE__ */d(r,{id:T,reveal:!!j&&"center-out"}),Q.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>Y(r,e.values[r]??0));/* @__PURE__ */
10
- return f("g",{opacity:J(t,e.key)?.3:1,onMouseEnter:()=>A(t),mask:j?`url(#${l(T)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
- /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),O&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:O.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(w,3,O.color,O.tone),value:L(O.values[t]??0)}))})}),
12
- /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:Q.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
- /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
- /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
- /* @__PURE__ */d(e,{caption:C.acrossMeasures(Q.map(e=>e.label),k.length),head:[C.tableSeries,...k.map(e=>e.label)],rows:Q.map(e=>[e.label,...k.map((t,r)=>L(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -1,2 +0,0 @@
1
- import{ChartTooltip as t}from"./chunk-TLRCTNUF.js";import{CartesianPlot as o}from"./chunk-5SJ45P5E.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-QWHQJNKL.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const L=e().charts,N=i(),v=d??(t=>Number.isInteger(t)?m(t,N):n(t,1,N)),w=x??(t=>m(t,N)),A=g??L.countAxis,C=k??L.distribution,M=h??r(c??[],s),R=a(0,b,f),T=M.map(t=>v(t.from)),J=M.map(t=>t.count);/* @__PURE__ */
2
- return l(o,{labels:T,values:J,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:w,yAxisLabel:A,className:y,emptyLabel:j,ariaLabel:L.histogram(C,M.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${v(M[o].from)} – ${v(M[o].to)}`,rows:[{key:"count",label:L.observations,color:R,value:w(M[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:M.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:R,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
@@ -1,9 +0,0 @@
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,19 +0,0 @@
1
- import{ChartDot as t}from"./chunk-CK2YOGUS.js";import{stepPath as e,curvePath as a,areaBetween as r,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as o,fillFor as s,dashFor as c,maskId as h}from"./chunk-465RRWBY.js";import{ChartSkeleton as m}from"./chunk-XNWQ72WA.js";import{useHighlight as d,highlightOpacity as u}from"./chunk-CNYAHYE6.js";import{ChartTooltip as f}from"./chunk-TLRCTNUF.js";import{tooltipBesideBand as p}from"./chunk-MG7A3R75.js";import{pairedAxes as g,niceAxis as k,niceMax as y,linearScale as x,axisGutter as v,bandScale as b,ladderScale as M}from"./chunk-2JWPNR2U.js";import{usePlotWidth as N}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as j}from"./chunk-TWVUQUUD.js";import{ChartBrush as $}from"./chunk-N7T63BVD.js";import{resolveSeriesColor as w,CHART_INK as A,STATUS_VARS as V}from"./chunk-TZFACUMR.js";import{useShellStrings as W,useShellLocale as L}from"./chunk-QWHQJNKL.js";import{formatPercent as R,formatPlain as z}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as U,useId as D,useEffect as S}from"react";import{jsx as E,jsxs as T}from"react/jsx-runtime";var F=12,I=16,Q=26,B=52,O=t=>"number"==typeof t&&Number.isFinite(t);function P({series:P,labels:Y,height:H=200,stacked:K=!1,stackMode:G="value",levels:J,curve:X="linear",tension:Z=0,max:q,yTickCount:_=4,formatValue:tt,formatTooltipValue:et,tooltipLabels:at,yAxisLabel:rt,referenceLines:lt,labelEndpoints:nt=!1,dots:it,dotVariant:ot="border",pulse:st=!1,brush:ct=!1,range:ht,onRangeChange:mt,loading:dt=!1,animate:ut=!0,reveal:ft="left-to-right",fillVariant:pt="gradient",gridStyle:gt="solid",width:kt,className:yt,emptyLabel:xt}){const vt=W().charts,bt=L(),Mt=tt??(t=>z(t,bt)),Nt=et??Mt,jt=xt??vt.noData,$t=C(null),wt=N($t),At=kt??wt,[Vt,Wt]=U(null),[Lt,Rt]=U(null),{highlighted:zt}=d(),Ct=D();if(S(()=>{if(null!==Vt)return j(t=>"Escape"===t.key&&(Wt(null),!0))},[Vt]),dt)/* @__PURE__ */
2
- return E("div",{className:yt,ref:$t,children:/* @__PURE__ */E(m,{height:H,width:kt??wt})});const Ut=Y,Dt=ht??Lt??[0,Math.max(0,Ut.length-1)],[St,Et]=Dt,Tt=t=>ct?t.slice(St,Et+1):t,Ft=P.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(O)).map(t=>({...t,data:Tt(t.data)}));if(Y=Tt(Ut),0===Ft.length||0===Y.length)/* @__PURE__ */
3
- return E("div",{className:yt,ref:$t,children:/* @__PURE__ */E("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:jt})});const It=Y.map((t,e)=>Ft.reduce((t,a)=>t+(O(a.data[e])?a.data[e]:0),0)),Qt=(t,e)=>It[e]>0?t/It[e]:null,Bt=[];if(K){let t=Y.map(()=>0);for(const e of Ft)t=t.map((t,a)=>t+(O(e.data[a])?e.data[a]:0)),Bt.push("percent"===G?t.map((t,e)=>Qt(t,e)):[...t])}const Ot=!!J&&J.length>0,Pt=t=>"right"===t.axis,Yt=!K&&!Ot&&void 0===q&&Ft.some(Pt)&&Ft.some(t=>!Pt(t)),Ht=Yt?Ft.filter(t=>!Pt(t)):Ft,Kt=Yt?Ft.filter(Pt).flatMap(t=>t.data.filter(O)):[],Gt=K?(Bt.at(-1)??[]).filter(O):Ht.flatMap(t=>t.data.filter(O)),Jt=Yt?g([Math.min(0,...Gt),Math.max(0,...Gt)],[Math.min(0,...Kt),Math.max(0,...Kt)],{intervals:_+1,integerLeft:Gt.every(Number.isInteger),integerRight:Kt.every(Number.isInteger)}):null,Xt=Jt?Jt.left:K&&"percent"===G||Ot||void 0!==q?null:k(K?0:Math.min(0,...Gt),Math.max(0,...Gt),{intervals:_+1,integer:Gt.every(Number.isInteger)}),Zt=Xt?Xt.lo:0,qt=K&&"percent"===G?1:Xt?Xt.hi:q??y(Math.max(...Gt,0)),_t=K&&"percent"===G?t=>R(Math.round(100*t),0,bt):Mt,te=Ot?J:Xt?Xt.ticks:x([Zt,qt],{from:0,to:1}).ticks(_+1),ee=v(te.map(_t),B),ae=Jt?v(Jt.right.ticks.map(Mt),I):I,re={left:ee,right:Math.max(ee+1,At-ae),top:F,bottom:H-Q},le=b(Y.length,{from:re.left,to:re.right}),ne=Ot?M(J,{from:re.bottom,to:re.top}):null,ie=x([Zt,qt],{from:re.bottom,to:re.top}),oe=ie(Math.max(Zt,0)),se=t=>ne?ne(t):ie(t),ce=Jt?x([Jt.right.lo,Jt.right.hi],{from:re.bottom,to:re.top}):null,he=t=>ce&&Pt(t)?ce:se,me=ne?ne.levels.map(t=>({value:t,y:ne(t)})):te.map(t=>({value:t,y:ie(t)})),de=t=>e=>{e.preventDefault(),Wt(e=>{const a=(e??0)+t;return Math.min(Y.length-1,Math.max(0,a))})},ue=Math.max(1,Math.ceil(Y.length/Math.max(1,Math.floor(At/96))));/* @__PURE__ */
4
- return T("div",{className:`relative ${yt??""}`,ref:$t,children:[
5
- /* @__PURE__ */T("svg",{width:"100%",height:H,viewBox:`0 0 ${At} ${H}`,role:"img","aria-label":vt.overIntervals(Ft.map(t=>t.label),Y.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Wt(null),onBlur:()=>Wt(null),onKeyDown:t=>{"ArrowRight"===t.key&&de(1)(t),"ArrowLeft"===t.key&&de(-1)(t)},children:[
6
- /* @__PURE__ */E("defs",{children:/* @__PURE__ */E("clipPath",{id:Ct,children:/* @__PURE__ */E("rect",{x:re.left,y:re.top,width:re.right-re.left,height:re.bottom-re.top})})}),
7
- /* @__PURE__ */E(n,{id:Ct,fills:Ft.map((t,e)=>({color:w(t.slot,t.color,t.tone),variant:t.fillVariant??pt})),fadeFrom:K?.42:.3,reveal:!!ut&&ft}),me.map(t=>/* @__PURE__ */E("line",{x1:re.left,y1:t.y,x2:re.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===gt?"3 3":void 0},`grid-${t.value}`)),
8
- /* @__PURE__ */E("line",{x1:re.left,y1:oe,x2:re.right,y2:oe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),me.map(t=>/* @__PURE__ */E("text",{x:re.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:_t(t.value)},`ytick-${t.value}`)),Jt&&me.map((t,e)=>/* @__PURE__ */E("text",{x:re.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(Jt.right.ticks[e])},`ytick-r-${t.value}`)),rt&&/* @__PURE__ */E("text",{x:12,y:(re.top+re.bottom)/2,transform:`rotate(-90 12 ${(re.top+re.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:rt}),
9
- /* @__PURE__ */E("g",{clipPath:`url(#${Ct})`,mask:ut&&ft?`url(#${h(Ct)})`:void 0,children:Ft.map((t,n)=>{const h=w(t.slot,t.color,t.tone),m=t.mode??(K?"area":"line"),d=u(t.key,zt);if("step"===m){const a=Y.map((e,a)=>({start:le(a),end:le.end(a),value:t.data[a]})).filter(t=>O(t.value)).map(e=>({start:e.start,end:e.end,y:he(t)(e.value)}));/* @__PURE__ */
10
- return E("path",{d:e(a),fill:"none",stroke:h,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:d??void 0,className:"rosh-viz-mark"},t.key)}const f=Y.map((e,a)=>{const r=K?Bt[n]?.[a]:t.data[a];return O(r)?[le.center(a),he(t)(r)]:null}).filter(t=>null!==t);if(0===f.length)return null;if("column"===m){const e=Math.max(1,.62*le.bandwidth),a="solid"===t.fillVariant,r=he(t);/* @__PURE__ */
11
- return E("g",{opacity:d??void 0,className:"rosh-viz-mark",children:Y.map((l,s)=>{const c=K?Bt[n]?.[s]:t.data[s];if(!O(c))return null;const m=r(c);/* @__PURE__ */
12
- return E("rect",{x:le.center(s)-e/2,y:Math.min(m,oe),width:e,height:Math.abs(oe-m),rx:2,fill:h,fillOpacity:a?1:.35,className:ut?i.rise:void 0,style:ut?o(s,26):void 0},s)})},t.key)}const p=a(f,X,Z),g=K&&n>0?Y.map((t,e)=>[le.center(e),se(Bt[n-1]?.[e]??0)-2]):null,k=g?r(p,g):l(p,f,oe);/* @__PURE__ */
13
- return T("g",{opacity:d??void 0,className:"rosh-viz-mark",children:[("area"===m||K)&&
14
- /* @__PURE__ */E("path",{d:k,fill:s(Ct,n,t.fillVariant??pt,h),stroke:"none"}),
15
- /* @__PURE__ */E("path",{d:p,fill:"none",stroke:h,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:c(t.stroke??(t.forecast?"animated-dashed":"solid")),className:ut&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),lt?.map((t,e)=>{const a=t.color??V[t.tone??"critical"],r=se(t.value);/* @__PURE__ */
16
- return T("g",{children:[
17
- /* @__PURE__ */E("line",{x1:re.left,y1:r,x2:re.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */E("text",{x:re.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(it??(nt?"last":"none"))&&Ft.map((e,a)=>{if("column"===e.mode)return null;const r=it??(nt?"last":"none"),l=w(e.slot,e.color,e.tone),n=[...e.data].map(O).lastIndexOf(!0),i="all"===r?Y.map((t,e)=>e).filter(t=>O(K?Bt[a]?.[t]:e.data[t])):n>=0?[n]:[];/* @__PURE__ */
18
- return T("g",{children:[i.map(r=>{const i=K?Bt[a]?.[r]:e.data[r];return O(i)?/* @__PURE__ */E(t,{cx:le.center(r),cy:he(e)(i),color:l,variant:ot,pulse:st&&r===n,title:`${Y[r]}: ${e.label} ${Mt(i)}`},r):null}),nt&&n>=0&&O(K?Bt[a]?.[n]:e.data[n])&&/* @__PURE__ */E("text",{x:le.center(n)-10,y:he(e)(K?Bt[a]?.[n]:e.data[n])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:Mt(K?Bt[a]?.[n]:e.data[n])})]},`dots-${e.key}`)}),Y.map((t,e)=>e%ue===0?/* @__PURE__ */E("text",{x:le.center(e),y:H-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Vt&&/* @__PURE__ */E("line",{x1:le.center(Vt),y1:re.top,x2:le.center(Vt),y2:re.bottom,stroke:A.axis,strokeWidth:1}),Y.map((t,e)=>/* @__PURE__ */E("rect",{x:le(e),y:re.top,width:Math.max(1,le.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>Wt(e)},`hit-${e}`))]}),ct&&Ut.length>2&&/* @__PURE__ */E($,{className:"mt-1",labels:Ut,width:At,data:P[0]?.data??[],range:Dt,onRangeChange:t=>{mt?mt(t):Rt(t)}}),null!==Vt&&
19
- /* @__PURE__ */E("div",{className:"pointer-events-none absolute top-2 z-10",style:p(le.center(Vt),le.bandwidth,At),children:/* @__PURE__ */E(f,{title:at?.[Vt]??Y[Vt],rows:Ft.map((t,e)=>({key:t.key,label:t.label,color:w(t.slot,t.color,t.tone),value:O(t.data[Vt])?K&&"percent"===G?`${R(100*(Qt(t.data[Vt],Vt)??0),1,bt)} · ${Nt(t.data[Vt])}`:Nt(t.data[Vt]):void 0})),footnote:K&&"percent"===G?vt.inBucket(Nt(It[Vt])):void 0})})]})}export{P as TimeSeriesChart};
@@ -1,29 +0,0 @@
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};
@@ -1,8 +0,0 @@
1
- import{ChartDefs as t,MOTION as e,stagger as a,glowId as n}from"./chunk-465RRWBY.js";import{ChartSkeleton as i}from"./chunk-XNWQ72WA.js";import{useHighlight as r,autoHighlightIndex as l,highlightOpacity as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as m}from"./chunk-TLRCTNUF.js";import{CartesianPlot as s}from"./chunk-5SJ45P5E.js";import{CHART_INK as u,STATUS_VARS as h,resolveSeriesColor as c}from"./chunk-TZFACUMR.js";import{useShellStrings as d,useShellLocale as f}from"./chunk-QWHQJNKL.js";import{formatPercent as b,formatPlain as p}from"./chunk-C3QOHMR6.js";import{useId as x}from"react";import{jsx as y,jsxs as M}from"react/jsx-runtime";function g({series:g,labels:v,stacked:k=!1,stackMode:N="value",height:$=220,width:w,max:F,formatValue:L,yAxisLabel:j,className:A,emptyLabel:C,radius:S=3,loading:R=!1,animate:T=!0,glow:V=!1,emphasise:W=!1,activeKey:z,highlight:E="none",valueLabels:Q=!1,onSelect:H,min:O,formatTooltipValue:Y,tooltipLabels:B,barGap:J=4,seriesLabels:K=!1}){const U=x(),{highlighted:G}=r(),P=d().charts,X=f(),Z=L??(t=>p(t,X)),q=Y??Z;if(R)/* @__PURE__ */return y(i,{height:$,width:w,variant:"bars",className:A});const D=(t,e)=>{const a=t.pointColors?.[e];if(a)return a;const n=t.pointTones?.[e];return n?h[n]:c(t.slot,t.color,t.tone)},I=g.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(t=>Number.isFinite(t))),_=(t,e)=>{const a=t.data[e];return"number"==typeof a&&Number.isFinite(a)?a:0},tt=v.map((t,e)=>I.reduce((t,a)=>t+_(a,e),0)),et=v.map((t,e)=>I.reduce((t,a)=>t+Math.max(0,_(a,e)),0)),at=v.map((t,e)=>I.reduce((t,a)=>t+Math.min(0,_(a,e)),0)),nt=k&&"percent"===N,it=(t,e)=>tt[e]>0?t/tt[e]:null,rt=nt?[1]:k?[...et,...at]:I.flatMap(t=>t.data.filter(Number.isFinite)),lt=(t,e)=>{const a=t.bandwidth/Math.max(1,I.length),n=I.length>1?Math.min(J,.25*a):0;return{offset:e*a+n/2,width:Math.max(1,a-n)}},ot=K&&!k?({x:t,y:e})=>{const a=Math.min(e.domain[1],Math.max(e.domain[0],0));return v.map((n,i)=>I.map((n,r)=>{const l=n.data[i];if(!Number.isFinite(l))return null;const o=Math.min(e.domain[1],Math.max(e.domain[0],l)),{offset:m,width:s}=lt(t,r),h=t(i)+m+s/2,c=Math.min(e(o),e(a)),d=Math.max(e(o),e(a));if(s<13)return null;const f=Math.floor((d-c-12)/6.6),b=f>=Math.min(4,n.label.length),p=b&&n.label.length>f?`${n.label.slice(0,f-1).trimEnd()}…`:n.label,x=b?d-6:c-4;/* @__PURE__ */
2
- return y("text",{"data-series-label":"true",x:h,y:x,transform:`rotate(-90 ${h} ${x})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:b?u.surface:u.label,children:p},`n${n.key}-${i}`)}))}:null;/* @__PURE__ */
3
- return y(s,{labels:v,values:rt,height:$,width:w,max:nt?1:F,min:nt?void 0:O,formatValue:nt?t=>b(Math.round(100*t),0,X):Z,yAxisLabel:j,className:A,emptyLabel:C,onSelect:H,ariaLabel:P.acrossCategories(I.map(t=>t.label),v.length),tooltip:t=>/* @__PURE__ */y(m,{title:B?.[t]??v[t],rows:I.map(e=>({key:e.key,label:e.label,color:D(e,t),value:Number.isFinite(e.data[t])?nt?`${b(100*(it(e.data[t],t)??0),1,X)} · ${q(e.data[t])}`:q(e.data[t]):void 0})),footnote:nt?P.inCategory(q(tt[t])):void 0}),overlay:Q&&!nt||ot?({x:t,y:e})=>/* @__PURE__ */M("g",{pointerEvents:"none",children:[ot?.({x:t,y:e}),Q&&!nt&&v.map((a,n)=>{if(k){if(!I.some(t=>Number.isFinite(t.data[n])))return null;const a=I.reduce((t,e)=>t+_(e,n),0),i=a>=0?et[n]:at[n];/* @__PURE__ */
4
- return y("text",{"data-value-label":"true",x:t.center(n),y:a>=0?e(i)-4:e(i)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(a)},`v${n}`)}return I.map((a,i)=>{const r=a.data[n];if(!Number.isFinite(r))return null;const l=r,{offset:o,width:m}=lt(t,i);/* @__PURE__ */
5
- return y("text",{"data-value-label":"true",x:t(n)+o+m/2,y:l>=0?e(l)-4:e(l)+12,textAnchor:"middle",fontSize:11,fill:u.label,style:{fontVariantNumeric:"tabular-nums"},children:Z(l)},`v${a.key}-${n}`)})})]}):void 0,children:({x:i,y:r,bottom:m,active:s})=>{const h=z?v.indexOf(z):-1,c=l(k?tt:I[0]?.data??[],E),d=s??(h>=0?h:c);/* @__PURE__ */
6
- return M("g",{children:[
7
- /* @__PURE__ */y(t,{id:U,glow:V}),v.map((t,l)=>{let m=0,s=0;const h=r(Math.min(r.domain[1],Math.max(r.domain[0],0)));return I.map((t,c)=>{const f=t.data[l];if(!Number.isFinite(f))return null;const b=nt?it(f,l):f;if(null===b)return null;const p=D(t,l),x=lt(i,c),M=k?i(l):i(l)+x.offset,g=k?Math.max(1,i.bandwidth):x.width;let v,N,$=!0;if(k){const t=b>=0?m:s,e=t+b;b>=0?m=e:s=e,v=r(Math.max(t,e)),N=r(Math.min(t,e)),$=0===t}else v=Math.min(r(b),h),N=Math.max(r(b),h);const w=Math.max(0,N-v-(k&&!$?2:0)),F=null===d||d===l,L=F?p:W?u.muted:p,j=o(t.key,G);/* @__PURE__ */
8
- return y("rect",{x:M,y:v,width:g,height:w,rx:S,fill:L,fillOpacity:j??(F?1:W?.32:.45),filter:V&&d===l?`url(#${n(U)})`:void 0,className:"rosh-viz-mark"+(T?` ${e.rise}`:""),style:T?a(l*(k?1:I.length)+c,26):void 0},`${t.key}-${l}`)})}),null!==s&&!W&&/* @__PURE__ */y("line",{x1:i.center(s),y1:r(r.domain[1]),x2:i.center(s),y2:m,stroke:u.axis,strokeWidth:1})]})}})}export{g as ColumnChart};
@@ -1 +0,0 @@
1
- function t(t,c,r){const e=(c/2+8).toFixed(1),x=t=>{return`clamp(0px, calc(${c=t,r>0?(c/r*100).toFixed(2):"0.00"}% + ${e}px), calc(100% - 184px))`;var c};return t<=r/2?{left:x(t)}:{right:x(r-t)}}export{t as tooltipBesideBand};
@@ -1,6 +0,0 @@
1
- import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-TLRCTNUF.js";import{CartesianPlot as t}from"./chunk-5SJ45P5E.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-QWHQJNKL.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:L,tone:j,label:v,className:N,emptyLabel:M,radius:C=3}){const F=o().charts,O=n(),Q=w??(e=>h(e,O)),W=v??F.range,A=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),R=r(0,L,j);/* @__PURE__ */
2
- return s(t,{labels:d,values:A,height:k,width:g,max:b,min:x,formatValue:Q,yAxisLabel:y,className:N,emptyLabel:M,bandPadding:"bar"===p?.34:0,ariaLabel:F.rangeLabel(W,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:F.high,color:R,value:null==u[e]?void 0:Q(u[e].high)},{key:"low",label:F.low,color:R,value:null==u[e]?void 0:Q(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:C,fill:R,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
3
- return m(c,{children:[
4
- /* @__PURE__ */s("path",{d:e(i(r,f),a),fill:R,fillOpacity:.2,stroke:"none"}),
5
- /* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:R,strokeWidth:2,strokeLinejoin:"round"}),
6
- /* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:R,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
@@ -1,8 +0,0 @@
1
- import{AccessibleTable as t}from"./chunk-TBPHW42V.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-TLRCTNUF.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-QWHQJNKL.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,N=i(),w=k??(t=>s(t,N)),j=M??$.noFlows,[y,F]=c(null),{highlighted:C}=o(),E=h(u,f,x,$.other),{labels:L,matrix:Q,otherIndex:T,foldedCount:z}=E,A=(t,e)=>Q[t]?.[e]??0,H=t=>t===T?r.muted:a(t),I=E.totals,W=L.map((t,e)=>e).sort((t,e)=>I[e]-I[t]),O=W.reduce((t,e)=>t+I[e],0);if(O<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const P=p/2,R=p/2,U=p/2-44,V=U-b,B=g*W.length,Y=/* @__PURE__ */new Map;let J=-Math.PI/2;W.forEach((t,e)=>{const o=I[t]/O*(2*Math.PI-B);Y.set(t,{start:J,end:J+o,slot:e}),J+=o+g});const K=/* @__PURE__ */new Map,S=[];for(const t of W)for(const e of W){const o=A(t,e);if(o<=0)continue;const n=Y.get(t),r=o/Math.max(1,I[t])*(n.end-n.start),a=K.get(t)??0;K.set(t,a+r),S.push({from:t,to:e,value:o,a:n.start+a+r/2,b:Y.get(e).start+(Y.get(e).end-Y.get(e).start)/2})}const Z=(t,e)=>[P+e*Math.cos(t),R+e*Math.sin(t)],q="arc"===y?.kind?y.index:void 0,D="ribbon"===y?.kind?S[y.index]:void 0;/* @__PURE__ */
2
- return m("div",{className:`relative ${v??""}`,children:[
3
- /* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(W.length),onMouseLeave:()=>F(null),children:[S.map((t,e)=>{const[o,n]=Z(t.a,V),[r,a]=Z(t.b,V),l=H(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==C?L[t.from]===C||L[t.to]===C:null)(t,e);/* @__PURE__ */
4
- return d("path",{d:`M${o},${n} Q${P},${R} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/O*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>F({kind:"ribbon",index:e})},`${L[t.from]}→${L[t.to]}`)}),W.map(t=>{const o=Y.get(t),n=(o.start+o.end)/2,[a,l]=Z(n,U+16),i=(t=>y?"arc"===y.kind?y.index===t:S[y.index].from===t||S[y.index].to===t:null!==C?L[t]===C:null)(t);/* @__PURE__ */
5
- return m("g",{onMouseEnter:()=>F({kind:"arc",index:t}),children:[
6
- /* @__PURE__ */d("path",{d:e(P,R,V,U,o.start,o.end),fill:H(t),fillOpacity:null===i||i?1:.45}),
7
- /* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:L[t]})]},t)})]}),z>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(z)}),void 0!==q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:L[q],rows:[{key:"total",label:$.totalFlow,color:H(q),value:w(I[q])}]})}),D&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${L[D.from]} → ${L[D.to]}`,rows:[{key:"value",label:$.flow,color:H(D.from),value:w(D.value)}]})}),
8
- /* @__PURE__ */d(t,{caption:$.chord(W.length),head:[$.tableFrom,$.tableTo,$.value],rows:S.map(t=>[L[t.from],L[t.to],w(t.value)])})]})}export{u as ChordChart,h as foldChord};