efficient-shell 12.30.0 → 12.33.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 (333) hide show
  1. package/README.md +77 -3
  2. package/dist/{Browser-FQHXHI3R.js → Browser-TYVPZ2NT.js} +16 -16
  3. package/dist/Calculator-2N7WJ6NR.js +29 -0
  4. package/dist/{CurrencyConverter-EHIQIFJK.js → CurrencyConverter-LJ73P5P7.js} +7 -7
  5. package/dist/Files-VUZWJMCE.js +141 -0
  6. package/dist/{Notepad-JPAXNEFR.js → Notepad-LXLUGQUN.js} +9 -9
  7. package/dist/PdfViewer-OLQBTKOC.js +1 -0
  8. package/dist/{PomodoroTimer-IVDZBBUN.js → PomodoroTimer-T34U5BLE.js} +69 -69
  9. package/dist/{Preview-KRK4XT2B.js → Preview-VRYWLVJY.js} +177 -177
  10. package/dist/Sidebar-I5QQHJSA.js +44 -0
  11. package/dist/{Stock-OBS2LPX4.js → Stock-BV36WRZA.js} +7 -7
  12. package/dist/{Weather-I4TJBIEN.js → Weather-YQQT5XYX.js} +20 -20
  13. package/dist/{WorldClock-YU2ZPVSA.js → WorldClock-WN2X3YIV.js} +7 -7
  14. package/dist/ai/index.js +88 -88
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.d.ts +51 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/{chunk-7DTWIWFO.js → chunk-2FQBY4ED.js} +6 -6
  47. package/dist/{chunk-3B3QIHF7.js → chunk-2LRSUDGN.js} +6 -6
  48. package/dist/{chunk-U22563X2.js → chunk-2UBR4YUF.js} +1 -1
  49. package/dist/{chunk-X27K2NCU.js → chunk-3DV5YLAI.js} +5 -5
  50. package/dist/chunk-3RX5KCUH.js +9 -0
  51. package/dist/{chunk-LQD54ZL5.js → chunk-3TCGXYUC.js} +1 -1
  52. package/dist/{chunk-77BK2IAJ.js → chunk-3U4IIEEY.js} +1 -1
  53. package/dist/{chunk-4FUQK2LK.js → chunk-3YCU6V3U.js} +1 -1
  54. package/dist/{chunk-FSORYU5C.js → chunk-44ZHEIJZ.js} +12 -12
  55. package/dist/{chunk-DOKA65JI.js → chunk-4HJNHI4A.js} +1 -1
  56. package/dist/{chunk-I6V4DMNR.js → chunk-4HJX2M4W.js} +1 -1
  57. package/dist/{chunk-37EYKPR6.js → chunk-4RSBPRCQ.js} +1 -1
  58. package/dist/{chunk-HJECGV6W.js → chunk-4YWQE67T.js} +1 -1
  59. package/dist/{chunk-KPPKPGQI.js → chunk-5LHEPE4B.js} +1 -1
  60. package/dist/{chunk-HRNT4UDG.js → chunk-5PSFENSW.js} +17 -17
  61. package/dist/{chunk-MYJ3HQYG.js → chunk-5UPLN44S.js} +9 -9
  62. package/dist/{chunk-CBBU74QT.js → chunk-65JCQLM4.js} +1 -1
  63. package/dist/{chunk-KKYNDLOC.js → chunk-6D6Q3ZCG.js} +6 -6
  64. package/dist/{chunk-UOHHIEH4.js → chunk-6SOS6OBB.js} +1 -1
  65. package/dist/{chunk-V64XY7L4.js → chunk-6XPS3H5Z.js} +8 -8
  66. package/dist/{chunk-4WW3SNL6.js → chunk-75TPMXA7.js} +1 -1
  67. package/dist/{chunk-5RLJAXDR.js → chunk-7VIRSTRC.js} +7 -7
  68. package/dist/{chunk-X5RFTIHV.js → chunk-7WMFHPKS.js} +1 -1
  69. package/dist/{chunk-MKPZIEQP.js → chunk-A6KFGANR.js} +22 -22
  70. package/dist/{chunk-VEF3STCH.js → chunk-AEMTJGD4.js} +1 -1
  71. package/dist/{chunk-KNNFNOX7.js → chunk-AJ5GLMGD.js} +7 -7
  72. package/dist/{chunk-DHRCI7KE.js → chunk-AKKDFFUO.js} +1 -1
  73. package/dist/{chunk-IBPULOGJ.js → chunk-APGIPXR7.js} +2 -2
  74. package/dist/{chunk-ILSE5F5F.js → chunk-ARBS2EZ6.js} +3 -3
  75. package/dist/chunk-B3KQELHS.js +7 -0
  76. package/dist/chunk-B447IHIL.js +4 -0
  77. package/dist/chunk-BLXEDMZM.js +8 -0
  78. package/dist/{chunk-ZSVBEJ4G.js → chunk-BLXHT72M.js} +1 -1
  79. package/dist/{chunk-O3SCB4QZ.js → chunk-BNPJHOAC.js} +9 -9
  80. package/dist/{chunk-6EXWWPAW.js → chunk-BRFUQAVC.js} +1 -1
  81. package/dist/{chunk-NLQLVXMJ.js → chunk-BSEQJM7X.js} +1 -1
  82. package/dist/{chunk-U45APXV3.js → chunk-BXZLSY2S.js} +1 -1
  83. package/dist/{chunk-3ZC53F4T.js → chunk-CBXEMPZL.js} +3 -3
  84. package/dist/{chunk-B27XRZ47.js → chunk-CCPUNN4F.js} +1 -1
  85. package/dist/{chunk-QHWD3G7T.js → chunk-COHFFGFE.js} +2 -2
  86. package/dist/{chunk-K6LO6QI5.js → chunk-CVXJKHPD.js} +5 -5
  87. package/dist/{chunk-7IGWU6DK.js → chunk-D53FU245.js} +8 -8
  88. package/dist/{chunk-2DCATU5B.js → chunk-DASRJ26L.js} +1 -1
  89. package/dist/chunk-DEJIH3ZQ.js +1 -0
  90. package/dist/{chunk-NSNM4QIV.js → chunk-DFOKJAIS.js} +5 -5
  91. package/dist/chunk-DGFFDZCY.js +15 -0
  92. package/dist/{chunk-QF4FYOVE.js → chunk-DU7TJVX5.js} +1 -1
  93. package/dist/{chunk-FPYOZOUY.js → chunk-DYOFTZOC.js} +8 -8
  94. package/dist/{chunk-YGKQMENL.js → chunk-E44RNULN.js} +1 -1
  95. package/dist/{chunk-TJ5ZX5HP.js → chunk-E6PDAYBR.js} +10 -10
  96. package/dist/chunk-EEFUXXYJ.js +22 -0
  97. package/dist/{chunk-P4NWDRHS.js → chunk-EQFWFQOZ.js} +6 -6
  98. package/dist/{chunk-6EETON2U.js → chunk-F3MO56N4.js} +1 -1
  99. package/dist/chunk-FBMYLCCE.js +11 -0
  100. package/dist/{chunk-AYCWVVJ3.js → chunk-FCILLVVT.js} +29 -29
  101. package/dist/{chunk-42GNFUAP.js → chunk-FCWBO7I3.js} +9 -9
  102. package/dist/{chunk-TIYRBJSB.js → chunk-FEQQMRHJ.js} +4 -4
  103. package/dist/{chunk-GANZLRMW.js → chunk-FOE2QHDE.js} +9 -9
  104. package/dist/{chunk-3N4XJS43.js → chunk-FUNGLFQE.js} +3 -3
  105. package/dist/{chunk-JA5WM66L.js → chunk-FVORTWUY.js} +1 -1
  106. package/dist/{chunk-2IEKMFVL.js → chunk-FXG7TOZN.js} +1 -1
  107. package/dist/{chunk-KLG6RYYC.js → chunk-G5U7IRH4.js} +5 -5
  108. package/dist/{chunk-IOIY54KO.js → chunk-GAGCE2ML.js} +1 -1
  109. package/dist/{chunk-OMSIXLK4.js → chunk-GHLXZDLU.js} +1 -1
  110. package/dist/{chunk-MHVWUYEN.js → chunk-H4GOJ26X.js} +1 -1
  111. package/dist/{chunk-QB7TIWHT.js → chunk-HTHD7STJ.js} +5 -5
  112. package/dist/{chunk-WM37FXRK.js → chunk-HTHNDX32.js} +1 -1
  113. package/dist/{chunk-QV5A7NFQ.js → chunk-HWJQLLJA.js} +8 -8
  114. package/dist/chunk-I4RJAMLJ.js +1 -0
  115. package/dist/{chunk-6UB6YY3H.js → chunk-ID35S5Y6.js} +1 -1
  116. package/dist/chunk-IESNUXYH.js +1 -0
  117. package/dist/{chunk-PBZ3UQMS.js → chunk-IEW5JTIR.js} +1 -1
  118. package/dist/{chunk-JGZEZHMP.js → chunk-IFLIE3EQ.js} +1 -1
  119. package/dist/{chunk-LBLWN3SH.js → chunk-IODIQ77P.js} +1 -1
  120. package/dist/{chunk-5O5QMMMG.js → chunk-IRCASURW.js} +8 -8
  121. package/dist/{chunk-VREZFFRE.js → chunk-ITEOA45V.js} +1 -1
  122. package/dist/{chunk-AIGLJYQ5.js → chunk-IYTOOV7Q.js} +1 -1
  123. package/dist/{chunk-36MM4YRK.js → chunk-JOYGSKWG.js} +9 -9
  124. package/dist/chunk-JTMR3EH3.js +28 -0
  125. package/dist/{chunk-YNE5YC6E.js → chunk-JWUNK2PW.js} +1 -1
  126. package/dist/{chunk-LHATGPIE.js → chunk-KITSIQCV.js} +19 -19
  127. package/dist/{chunk-M2GF44WC.js → chunk-KRCWLZV7.js} +12 -12
  128. package/dist/{chunk-64ZDYUE7.js → chunk-KV6XCHAG.js} +19 -19
  129. package/dist/chunk-KZQRUVII.js +12 -0
  130. package/dist/{chunk-IQTURGC4.js → chunk-LPAOHDUE.js} +1 -1
  131. package/dist/chunk-LSONG4QV.js +1 -0
  132. package/dist/{chunk-HU24RSAE.js → chunk-MZCYB2MW.js} +1 -1
  133. package/dist/{chunk-CIOPLPZW.js → chunk-NDWX5Z4D.js} +1 -1
  134. package/dist/{chunk-MVBDE4AX.js → chunk-NGG6DYNN.js} +1 -1
  135. package/dist/{chunk-QT34GMZR.js → chunk-NLHGFQ54.js} +1 -1
  136. package/dist/{chunk-HC3BZPWX.js → chunk-NUDL6UO3.js} +1 -1
  137. package/dist/{chunk-GKX3C3JE.js → chunk-P62QGXRW.js} +13 -13
  138. package/dist/{chunk-XXRUDMD5.js → chunk-PA3OU3Y7.js} +5 -5
  139. package/dist/{chunk-UEADX2GV.js → chunk-PC3MYH2K.js} +2 -2
  140. package/dist/{chunk-BEB3AGSY.js → chunk-PGATHOTX.js} +1 -1
  141. package/dist/{chunk-Q4BJW37U.js → chunk-PR6FNBKR.js} +1 -1
  142. package/dist/{chunk-NJ6WZHXC.js → chunk-PZNF2TEB.js} +5 -5
  143. package/dist/{chunk-JOANOIVK.js → chunk-Q6GECV4J.js} +1 -1
  144. package/dist/{chunk-Y6H5C6A4.js → chunk-QDEQHT2T.js} +1 -1
  145. package/dist/{chunk-RPXRMTOU.js → chunk-QDIPNQ6M.js} +1 -1
  146. package/dist/{chunk-MFZ4YMXE.js → chunk-QO7UHTUE.js} +6 -6
  147. package/dist/chunk-QXXMRV4E.js +2 -0
  148. package/dist/{chunk-GBPGZFBS.js → chunk-R5SVNFUG.js} +4 -4
  149. package/dist/{chunk-FM34DWV7.js → chunk-R5TSUJTK.js} +6 -6
  150. package/dist/{chunk-N2BWOHNM.js → chunk-RJ24VXBZ.js} +6 -6
  151. package/dist/chunk-RMEYKJEH.js +8 -0
  152. package/dist/{chunk-XMAOLCQV.js → chunk-ROKUEMAK.js} +1 -1
  153. package/dist/{chunk-2N6WWL7Y.js → chunk-ROPVIMIR.js} +1 -1
  154. package/dist/chunk-RTGGGZ2R.js +2 -0
  155. package/dist/{chunk-WCJR2GNH.js → chunk-S26FG4RF.js} +19 -19
  156. package/dist/{chunk-ANGNTN36.js → chunk-SQ4ZFG2B.js} +1 -1
  157. package/dist/{chunk-HOXXEF52.js → chunk-TAEO2JC6.js} +1 -1
  158. package/dist/{chunk-23CZSU3H.js → chunk-TDG5WGLR.js} +1 -1
  159. package/dist/{chunk-5X3Z45SL.js → chunk-TMSSR5UH.js} +1 -1
  160. package/dist/chunk-UHQBHSWL.js +11 -0
  161. package/dist/{chunk-KHFPF534.js → chunk-V3KQIY6T.js} +6 -6
  162. package/dist/chunk-V5VAKDLS.js +7 -0
  163. package/dist/{chunk-67JLD6AU.js → chunk-VMKTA5HL.js} +6 -6
  164. package/dist/{chunk-CVEVPB3O.js → chunk-VUM6BYAX.js} +3 -3
  165. package/dist/{chunk-XJTZU7UH.js → chunk-VVXBBU6R.js} +3 -3
  166. package/dist/{chunk-XK3VYRLR.js → chunk-VWYICGVA.js} +4 -4
  167. package/dist/{chunk-3HLV6BEC.js → chunk-W5HT23P7.js} +12 -12
  168. package/dist/{chunk-UK2D2CSB.js → chunk-WEZ2RO72.js} +11 -11
  169. package/dist/{chunk-PAVOVX3D.js → chunk-WKWZILZA.js} +2 -2
  170. package/dist/{chunk-4YCWO2GZ.js → chunk-WUEH6DLJ.js} +6 -6
  171. package/dist/chunk-WW5AXVBX.js +2 -0
  172. package/dist/{chunk-FIXZT5TZ.js → chunk-X22SFR5F.js} +7 -7
  173. package/dist/chunk-XBX3N3VG.js +26 -0
  174. package/dist/{chunk-5ZS3VOJH.js → chunk-XCY7A5UM.js} +1 -1
  175. package/dist/{chunk-HE2I6KWY.js → chunk-XPSWZQR4.js} +2 -2
  176. package/dist/{chunk-MRVW6F5E.js → chunk-XYMEC63O.js} +1 -1
  177. package/dist/{chunk-UQNKFMJR.js → chunk-Y43S6YS5.js} +12 -12
  178. package/dist/{chunk-JTRQ7HAS.js → chunk-YAM3L5N4.js} +1 -1
  179. package/dist/{chunk-GN3AHAVY.js → chunk-YEEMRWBS.js} +1 -1
  180. package/dist/{chunk-GL4NELAT.js → chunk-YM7AWNMY.js} +1 -1
  181. package/dist/{chunk-3R2TMLKH.js → chunk-YMUHIJDJ.js} +5 -5
  182. package/dist/{chunk-5XYRFK7D.js → chunk-YW6BODBX.js} +1 -1
  183. package/dist/{chunk-RMUOUMV2.js → chunk-ZDCCYRFF.js} +2 -2
  184. package/dist/{chunk-FYGPJPU7.js → chunk-ZDDMFFQK.js} +1 -1
  185. package/dist/{chunk-SAAXAAAH.js → chunk-ZGIAMYTI.js} +1 -1
  186. package/dist/chunk-ZHR2HNT2.js +20 -0
  187. package/dist/data/DataTable.js +1 -1
  188. package/dist/data/EntityList.js +1 -1
  189. package/dist/data/Gantt.d.ts +107 -0
  190. package/dist/data/Gantt.js +2 -0
  191. package/dist/data/Kanban.js +1 -1
  192. package/dist/data/ListFooter.js +1 -1
  193. package/dist/data/ListLoadError.js +1 -1
  194. package/dist/data/Pagination.js +1 -1
  195. package/dist/data/ResizableTable.js +1 -1
  196. package/dist/file-intake/index.js +1 -1
  197. package/dist/forms/BorderInput.js +1 -1
  198. package/dist/forms/BrandAssetEditor.js +1 -1
  199. package/dist/forms/Calendar.js +1 -1
  200. package/dist/forms/ColorPicker.js +1 -1
  201. package/dist/forms/ComposerAttachments.js +1 -1
  202. package/dist/forms/CornersInput.js +1 -1
  203. package/dist/forms/DatePicker.js +1 -1
  204. package/dist/forms/DateRangePicker.js +1 -1
  205. package/dist/forms/DateTimePicker.js +1 -1
  206. package/dist/forms/DisplayChips.js +1 -1
  207. package/dist/forms/FilePicker.js +1 -1
  208. package/dist/forms/FormErrorSummary.js +1 -1
  209. package/dist/forms/IconPicker.js +1 -1
  210. package/dist/forms/ImageFocusPoint.js +1 -1
  211. package/dist/forms/InputNumber.js +1 -1
  212. package/dist/forms/LinkPicker.js +1 -1
  213. package/dist/forms/MediaLibrary.js +1 -1
  214. package/dist/forms/MediaUploadField.js +1 -1
  215. package/dist/forms/MediaUploadGrid.js +1 -1
  216. package/dist/forms/MediaUsedInList.js +1 -1
  217. package/dist/forms/NumericKeypad.js +1 -1
  218. package/dist/forms/PictureTiles.d.ts +14 -2
  219. package/dist/forms/PictureTiles.js +1 -1
  220. package/dist/forms/PositionInput.js +1 -1
  221. package/dist/forms/Select.js +1 -1
  222. package/dist/forms/SidesInput.js +1 -1
  223. package/dist/forms/Slider.js +1 -1
  224. package/dist/forms/Snippet.js +1 -1
  225. package/dist/forms/TagInput.js +1 -1
  226. package/dist/forms/TextToolbar.js +1 -1
  227. package/dist/forms/TimePicker.js +1 -1
  228. package/dist/forms/WidthsBar.js +1 -1
  229. package/dist/forms/mediaLibraryMenu.js +1 -1
  230. package/dist/forms/mediaMoveItems.js +1 -1
  231. package/dist/forms/textAlign.js +1 -1
  232. package/dist/forms/useFileIntake.js +1 -1
  233. package/dist/hooks/useTheme.d.ts +1 -1
  234. package/dist/icons/efficient-glyphs.js +1 -1
  235. package/dist/icons/efficient-looks.js +1 -1
  236. package/dist/icons/efficient.js +1 -1
  237. package/dist/icons/looks/map.js +1 -1
  238. package/dist/icons/payment.js +1 -1
  239. package/dist/icons/sets.js +1 -1
  240. package/dist/index.d.ts +5 -4
  241. package/dist/index.js +361 -361
  242. package/dist/locales/zh-Hans.js +1 -1
  243. package/dist/map/index.js +1 -1
  244. package/dist/model-viewer/index.js +1 -1
  245. package/dist/page-tabs/index.js +5 -5
  246. package/dist/pdf/index.js +1 -1
  247. package/dist/shell/Accordion.js +1 -1
  248. package/dist/shell/AppUpdateBanner.js +1 -1
  249. package/dist/shell/Avatar.js +1 -1
  250. package/dist/shell/Banner.js +1 -1
  251. package/dist/shell/Breadcrumbs.js +1 -1
  252. package/dist/shell/BudgetBar.js +1 -1
  253. package/dist/shell/Card.js +1 -1
  254. package/dist/shell/ColoredBadge.js +1 -1
  255. package/dist/shell/ConfirmDialog.js +1 -1
  256. package/dist/shell/ContainerFillChart.js +1 -1
  257. package/dist/shell/CountBadge.js +1 -1
  258. package/dist/shell/Dialog.js +1 -1
  259. package/dist/shell/Drawer.js +1 -1
  260. package/dist/shell/EditableGrid.js +1 -1
  261. package/dist/shell/EmptyState.js +1 -1
  262. package/dist/shell/GlobalSearch.js +1 -1
  263. package/dist/shell/HelpCenter.js +1 -1
  264. package/dist/shell/IconRail.js +1 -1
  265. package/dist/shell/ImageLightbox.js +1 -1
  266. package/dist/shell/ItemCount.js +1 -1
  267. package/dist/shell/LanguageSelect.js +1 -1
  268. package/dist/shell/Markdown.js +1 -1
  269. package/dist/shell/MetricBar.js +1 -1
  270. package/dist/shell/MetricBarLegend.js +1 -1
  271. package/dist/shell/MilestoneTimeline.js +1 -1
  272. package/dist/shell/PageHeader.js +1 -1
  273. package/dist/shell/ProductionTimeline.js +1 -1
  274. package/dist/shell/ResizeHandle.js +1 -1
  275. package/dist/shell/Result.js +1 -1
  276. package/dist/shell/SearchableSelect.js +1 -1
  277. package/dist/shell/SettingReset.js +1 -1
  278. package/dist/shell/SettingRow.js +1 -1
  279. package/dist/shell/SidebarLayout.js +1 -1
  280. package/dist/shell/SidebarNav.js +1 -1
  281. package/dist/shell/SortableList.js +1 -1
  282. package/dist/shell/Statistic.js +1 -1
  283. package/dist/shell/TimeAgo.js +1 -1
  284. package/dist/shell/TimelineTrack.js +1 -1
  285. package/dist/shell/TransferProgress.js +1 -1
  286. package/dist/shell/Tree.js +1 -1
  287. package/dist/shell/discardGuard.js +1 -1
  288. package/dist/shell/language.js +1 -1
  289. package/dist/shell/strings.d.ts +30 -0
  290. package/dist/shell/strings.js +1 -1
  291. package/dist/shell/toast.js +1 -1
  292. package/dist/telemetry/index.js +1 -1
  293. package/dist/templates/AuthScreen.js +1 -1
  294. package/dist/templates/ChatTemplate.js +1 -1
  295. package/dist/templates/CheckoutTemplate.js +1 -1
  296. package/dist/templates/DashboardTemplate.js +1 -1
  297. package/dist/templates/DataTablePage.js +1 -1
  298. package/dist/templates/EmailTemplate.js +1 -1
  299. package/dist/templates/ErrorBoundary.d.ts +1 -1
  300. package/dist/templates/ErrorBoundary.js +1 -1
  301. package/dist/templates/ErrorPage.js +1 -1
  302. package/dist/templates/FormLayoutPage.js +1 -1
  303. package/dist/templates/GalleryTemplate.js +1 -1
  304. package/dist/ui/index.d.ts +2 -1
  305. package/dist/ui/index.js +1 -1
  306. package/dist/ui.css +35 -0
  307. package/dist/version.js +1 -1
  308. package/package.json +1 -1
  309. package/dist/Calculator-XCRU5K4O.js +0 -29
  310. package/dist/Files-LTUUGPAM.js +0 -141
  311. package/dist/PdfViewer-J55QKFNS.js +0 -1
  312. package/dist/Sidebar-FCXIPW5K.js +0 -44
  313. package/dist/chunk-4MCI7UHQ.js +0 -7
  314. package/dist/chunk-4SEPQN2N.js +0 -12
  315. package/dist/chunk-AJVL6LXI.js +0 -22
  316. package/dist/chunk-CHV7U5UV.js +0 -9
  317. package/dist/chunk-CXXMSYA6.js +0 -1
  318. package/dist/chunk-E7RMS776.js +0 -20
  319. package/dist/chunk-ESL5TDNA.js +0 -1
  320. package/dist/chunk-EWSOX4WP.js +0 -28
  321. package/dist/chunk-FEWWCWKV.js +0 -11
  322. package/dist/chunk-GCTJIZTJ.js +0 -2
  323. package/dist/chunk-HCDG7EUR.js +0 -1
  324. package/dist/chunk-KPFP2I2S.js +0 -8
  325. package/dist/chunk-MUSNAMWH.js +0 -1
  326. package/dist/chunk-PRWA4AAC.js +0 -11
  327. package/dist/chunk-RJG67VRP.js +0 -15
  328. package/dist/chunk-RVD6HJUJ.js +0 -4
  329. package/dist/chunk-TN3W72FC.js +0 -8
  330. package/dist/chunk-VLI2ED22.js +0 -7
  331. package/dist/chunk-VY5NO4TS.js +0 -2
  332. package/dist/chunk-YS3CF7GL.js +0 -2
  333. /package/dist/{chunk-GMHMWDXU.js → chunk-KH3253OM.js} +0 -0
@@ -1,141 +0,0 @@
1
- import{openPreviewFile as e}from"./chunk-ANGNTN36.js";import{SidebarLayout as t}from"./chunk-KKYNDLOC.js";import"./chunk-QWK6DRSN.js";import"./chunk-UEADX2GV.js";import{SearchableSelect as n}from"./chunk-GKX3C3JE.js";import{Breadcrumbs as a}from"./chunk-GL4NELAT.js";import{Select_default as r}from"./chunk-LHATGPIE.js";import"./chunk-EO5RLFRX.js";import"./chunk-K5YT5PMJ.js";import"./chunk-2NMW66P5.js";import{useContextMenu as i,ContextMenu as s}from"./chunk-QMBMK6PP.js";import{Input_default as l}from"./chunk-PT4GMPUB.js";import{DropdownMenu as o}from"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import{IconButton_default as c}from"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{formatBytes as d}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as m,subscribeFilesChoice as h,getFilesChoice as u,holdFilesChoice as f,answerFilesChoice as p,choiceTakes as g}from"./chunk-4EFIUJ7X.js";import{AboutApp as k}from"./chunk-PAVOVX3D.js";import{getFilesStore as w,peekFilesViewRequest as y,consumeFilesViewRequest as v,FILES_SHOW_TRASH_EVENT as b,FILES_OPEN_DESKTOP_FOLDER_EVENT as x,subscribeDesktopFolders as N,getDesktopFoldersSnapshot as C,hasHostFilesStore as S,FolderGlyph as j,DesktopItemMiniIcon as D,desktopItemTypeLabel as M,FilesQuotaError as $,FILES_OFFICE_EXTENSIONS as T}from"./chunk-WBAWJIVM.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as L,WindowTitle as A}from"./chunk-AYCWVVJ3.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-2DCATU5B.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OMSIXLK4.js";import{confirm as P,prompt as E}from"./chunk-64ZDYUE7.js";import{Dialog as F}from"./chunk-RVD6HJUJ.js";import"./chunk-EIFNESXS.js";import{ItemCount as R}from"./chunk-Q4BJW37U.js";import"./chunk-RIG5FEVS.js";import"./chunk-CIOPLPZW.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-SAAXAAAH.js";import"./chunk-KPPKPGQI.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CXXMSYA6.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as W}from"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as z}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as O}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as K}from"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as I}from"./chunk-5X3Z45SL.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-HCDG7EUR.js";import"./chunk-C3QOHMR6.js";import{useState as U,useRef as G,useEffect as V,useCallback as Y,useSyncExternalStore as J,useMemo as X}from"react";import{jsxs as B,jsx as H,Fragment as Q}from"react/jsx-runtime";var Z={doc:"document",docx:"document",odt:"document",rtf:"document",txt:"document",md:"document",xls:"spreadsheet",xlsx:"spreadsheet",ods:"spreadsheet",csv:"spreadsheet",sheet:"spreadsheet",ppt:"slides",pptx:"slides",odp:"slides",key:"slides",slides:"slides",pdf:"pdf",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",heic:"image",tif:"image",tiff:"image",mp4:"video",mov:"video",webm:"video",avi:"video",mkv:"video",mp3:"audio",wav:"audio",m4a:"audio",ogg:"audio",flac:"audio",zip:"archive",rar:"archive","7z":"archive",gz:"archive",tar:"archive",dxf:"drawing",dwg:"drawing",stp:"drawing",step:"drawing",stl:"drawing",obj:"drawing",iges:"drawing",igs:"drawing","3mf":"drawing",glb:"drawing",gltf:"drawing"};function q(e){const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toLowerCase():""}function _(e){if("folder"===e.kind)return"folder";if("document"===e.officeKind)return"document";if("spreadsheet"===e.officeKind)return"spreadsheet";if("deck"===e.officeKind)return"slides";const t=e.contentType??"";return"application/pdf"===t?"pdf":t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":Z[q(e.name)]??"other"}var ee={folder:"Folder",document:"Document",spreadsheet:"Spreadsheet",slides:"Slides",pdf:"PDF",image:"Image",video:"Video",audio:"Audio",archive:"Archive",drawing:"Drawing",other:"File"},te={folder:{name:"folder",tone:"muted"},document:{name:"document",tone:"accent"},spreadsheet:{name:"table",tone:"success"},slides:{name:"presentation-chart-bar",tone:"warning"},pdf:{name:"document",tone:"danger"},image:{name:"image",tone:"muted"},video:{name:"play",tone:"muted"},audio:{name:"speaker-wave",tone:"muted"},archive:{name:"archive-box",tone:"muted"},drawing:{name:"cube-transparent",tone:"muted"},other:{name:"page",tone:"muted"}};function ne(e){const t=e.officeKind?T[e.officeKind]:"";return t&&e.name.toLowerCase().endsWith(t)&&e.name.length>t.length?e.name.slice(0,-t.length):e.name}function ae(e){return"folder"===e.kind||e.officeKind&&e.size<=2?"—":d(e.size)}function re(e,t=/* @__PURE__ */new Date){if(!e)return"—";const n=new Date(e);return isNaN(n.getTime())?"—":n.toDateString()===t.toDateString()?n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):n.getFullYear()===t.getFullYear()?n.toLocaleDateString(void 0,{day:"numeric",month:"short"}):n.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function ie(e){return"owner"===(e.role??"owner")?"me":e.owner?.name??"—"}var se=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function le(e,t){const n="asc"===t.dir?1:-1;return[...e].sort((e,a)=>e.kind!==a.kind?"folder"===e.kind?-1:1:n*((e,n)=>{switch(t.key){case"owner":return se.compare(ie(e),ie(n));case"size":return e.size-n.size;case"modified":return(Date.parse(e.modifiedAt)||0)-(Date.parse(n.modifiedAt)||0);default:return se.compare(ne(e),ne(n))}})(e,a)||se.compare(e.name,a.name))}var oe=["folder","document","spreadsheet","slides","pdf","image","video"],ce={today:"Today",week:"Last 7 days",month:"Last 30 days",year:"This year"};function de(e,t,n=/* @__PURE__ */new Date){const a=t.modified?function(e,t){const n=new Date(t);return n.setHours(0,0,0,0),"week"===e&&n.setDate(n.getDate()-6),"month"===e&&n.setDate(n.getDate()-29),"year"===e&&n.setMonth(0,1),n.getTime()}(t.modified,n):null;return e.filter(e=>{if(t.type&&_(e)!==t.type)return!1;if(t.person){const n="owner"===(e.role??"owner");if("me"===t.person?!n:n||e.owner?.id!==t.person)return!1}return null===a||(Date.parse(e.modifiedAt)||0)>=a})}var me=[{value:"viewer",label:"Viewer"},{value:"editor",label:"Editor"}];function he({store:e,entry:t,onClose:a,onChanged:i}){const[s,l]=U(null),[o,d]=U(""),[m,h]=U([]),[u,f]=U(!1),[p,g]=U(""),[k,w]=U("viewer"),[y,v]=U(!1),b=G(/* @__PURE__ */new Map),x=t?.id??null;if(V(()=>{if(l(null),g(""),d(""),!x||!e.shares)return;let t=!0;return e.shares(x).then(e=>{t&&l(e)}).catch(e=>{t&&(I.error(e.message),l([]))}),()=>{t=!1}},[x,e]),V(()=>{if(!e.searchPeople||!x)return;let t=!0;f(!0);const n=setTimeout(()=>{e.searchPeople(o).then(e=>{if(t){for(const t of e)b.current.set(t.id,t);h(e)}}).catch(()=>{t&&h([])}).finally(()=>{t&&f(!1)})},250);return()=>{t=!1,clearTimeout(n)}},[o,x,e]),!t)return null;const N=new Set((s??[]).map(e=>e.person.id)),C=m.filter(e=>!N.has(e.id)).map(e=>({value:e.id,label:e.name})),S=async n=>{v(!0);try{await n(),l(await e.shares(t.id)),i()}catch(e){I.error(e.message)}finally{v(!1)}};/* @__PURE__ */
2
- return B(F,{open:!0,onClose:a,size:"md",title:`Share “${t.name}”`,description:"folder"===t.kind?"Everything inside this folder is shared too. Editors’ uploads count toward your quota.":"Viewers can open and download it. Editors can also replace, rename and delete it.",footer:/* @__PURE__ */H(W,{variant:"secondary",onClick:a,children:"Done"}),children:[
3
- /* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
4
- /* @__PURE__ */H("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */H(n,{value:p,onChange:g,onSearchChange:d,loading:u&&0===m.length,options:C,placeholder:"Search colleagues by name","aria-label":"Colleague to share with"})}),
5
- /* @__PURE__ */H("div",{className:"w-28 shrink-0",children:/* @__PURE__ */H(r,{value:k,onChange:e=>w(e),options:me,"aria-label":"Access"})}),
6
- /* @__PURE__ */H(W,{variant:"primary",onClick:()=>{if(!p||!e.share)return;const n=b.current.get(p);S(async()=>{await e.share(t.id,p,k),g(""),d(""),n&&I.success(`Shared with ${n.name}`)})},disabled:!p||y,children:"Add"})]}),
7
- /* @__PURE__ */H("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */H(O,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */B("ul",{className:"divide-y divide-line-subtle text-sm",children:[
8
- /* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
9
- /* @__PURE__ */H("span",{className:"flex-1 truncate",children:"You"}),
10
- /* @__PURE__ */H("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
11
- /* @__PURE__ */H("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
12
- /* @__PURE__ */H("div",{className:"w-28 shrink-0",children:/* @__PURE__ */H(r,{value:n.role,onChange:a=>S(()=>e.share(t.id,n.person.id,a)),options:me,"aria-label":`Access for ${n.person.name}`,disabled:y})}),
13
- /* @__PURE__ */H(c,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:y,onClick:()=>S(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4",strokeWidth:1.8})})]},n.person.id))]})]})}function ue({store:e,items:t,from:n,onClose:a,onMove:r}){const[i,s]=U(n??null),[l,o]=U(null),[d,m]=U(!1);V(()=>{t&&s(n??null)},[t,n]),V(()=>{if(!t)return;let n=!0;return m(!0),e.list(i).then(e=>{n&&o(e)}).catch(()=>{n&&o(null)}).finally(()=>{n&&m(!1)}),()=>{n=!1}},[e,i,t]);const h=new Set((t??[]).map(e=>e.id)),u=(l?.entries??[]).filter(e=>"folder"===e.kind&&!h.has(e.id)),f=(l?.folder.path??[]).filter(e=>null!==e.id),p=f.length>1?f[f.length-2].id:null,g=l?.folder,k="viewer"!==(g?.role??"owner"),w=void 0!==n&&i===n,y=t?.length??0,v=1===y?`"${t[0].name}"`:`${y} items`;/* @__PURE__ */
14
- return B(F,{open:!!t,onClose:a,title:`Move ${v}`,size:"sm",footer:/* @__PURE__ */B(Q,{children:[
15
- /* @__PURE__ */H(W,{variant:"secondary",onClick:a,children:"Cancel"}),
16
- /* @__PURE__ */H(W,{variant:"primary",onClick:()=>r(i),disabled:d||!k||w,children:"Move here"})]}),children:[
17
- /* @__PURE__ */B("div",{className:"flex items-center gap-1 mb-2 min-h-8",children:[null!==i&&/* @__PURE__ */H(c,{"aria-label":"Back",size:"sm",onClick:()=>s(p),children:/* @__PURE__ */H(z,{name:"arrow-left",className:"h-4 w-4"})}),
18
- /* @__PURE__ */H("span",{className:"text-sm font-medium text-ink-strong truncate",children:null===i?"My files":g?.name??""})]}),
19
- /* @__PURE__ */H("div",{className:"border border-line rounded-(--radius-control) h-64 overflow-auto",children:d?/* @__PURE__ */H(O,{size:"sm",padding:"p-6",label:"Loading"}):0===u.length?/* @__PURE__ */H("div",{className:"p-6 text-center text-sm text-ink-faintest",children:"No folders here."}):/* @__PURE__ */H("ul",{children:u.map(e=>/* @__PURE__ */H("li",{children:/* @__PURE__ */B("button",{type:"button",onClick:()=>s(e.id),className:"flex w-full items-center gap-2 px-3 h-9 text-left text-sm hover:bg-row-hover",children:[
20
- /* @__PURE__ */H(z,{name:"folder",look:"solid",tone:"muted",className:"h-4 w-4 shrink-0"}),
21
- /* @__PURE__ */H("span",{className:"truncate flex-1",children:e.name}),
22
- /* @__PURE__ */H(z,{name:"chevron-right",tone:"muted",className:"h-4 w-4 shrink-0"})]})},e.id))})}),!k&&/* @__PURE__ */H("p",{className:"mt-2 text-xs text-ink-faint",children:"You can view this folder but not move things into it."})]})}function fe({store:e,entry:t,selectedCount:n,onClose:a}){const[r,i]=U(null),[s,l]=U(null);V(()=>{if(i(null),l(null),!t)return;let n=!0;return e.info?.(t.id).then(e=>{n&&i(e)}).catch(()=>{}),e.shares?.(t.id).then(e=>{n&&l(e)}).catch(()=>{}),()=>{n=!1}},[e,t]);const o=t?_(t):null,d=o?te[o]:null,m=r?.path.slice(0,-1).map(e=>e.name||"My files").join(" / "),h=(e,t)=>t?/* @__PURE__ */B("div",{className:"py-2",children:[
23
- /* @__PURE__ */H("dt",{className:"text-2xs text-ink-faint",children:e}),
24
- /* @__PURE__ */H("dd",{className:"text-sm text-ink break-words",children:t})]}):null;/* @__PURE__ */
25
- return B("aside",{className:"w-72 shrink-0 border-l border-line flex flex-col min-h-0 bg-surface","aria-label":"Details",children:[
26
- /* @__PURE__ */B("div",{className:"flex items-center gap-2 px-3 h-12 shrink-0",children:[d&&/* @__PURE__ */H(z,{name:d.name,tone:d.tone,className:"h-5 w-5 shrink-0"}),
27
- /* @__PURE__ */H("span",{className:"flex-1 truncate text-sm font-medium text-ink-strong",children:t?ne(t):n>1?`${n} items selected`:"Details"}),
28
- /* @__PURE__ */H(c,{"aria-label":"Close details",size:"sm",onClick:a,children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})})]}),
29
- /* @__PURE__ */H("div",{className:"flex-1 overflow-auto px-4 pb-4",children:t?/* @__PURE__ */B(Q,{children:[
30
- /* @__PURE__ */H("div",{className:"h-32 rounded-(--radius-control) bg-surface-sunken flex items-center justify-center mb-3",children:d&&/* @__PURE__ */H(z,{name:d.name,tone:d.tone,className:"h-12 w-12"})}),s&&/* @__PURE__ */B("div",{className:"mb-3",children:[
31
- /* @__PURE__ */H("div",{className:"text-xs font-medium text-ink-strong mb-1",children:"Who has access"}),0===s.length?/* @__PURE__ */B("p",{className:"text-sm text-ink-faint",children:["Only ","owner"!==t.role&&t.role?t.owner?.name??"its owner":"you"]}):/* @__PURE__ */H("ul",{className:"text-sm text-ink",children:s.map(e=>/* @__PURE__ */B("li",{className:"flex justify-between py-0.5",children:[
32
- /* @__PURE__ */H("span",{className:"truncate",children:e.person.name}),
33
- /* @__PURE__ */H("span",{className:"text-ink-faint text-xs",children:"editor"===e.role?"Editor":"Viewer"})]},e.person.id))})]}),
34
- /* @__PURE__ */B("dl",{className:"border-t border-line pt-2",children:[h("Type",o?ee[o]:null),"file"===t.kind&&h("Size",ae(t)),h("Location",m),h("Owner","me"===ie(t)?"me":ie(t)),h("Modified",t.modifiedAt?`${re(t.modifiedAt)}${t.modifiedBy?` by ${t.modifiedBy.name}`:""}`:null),h("Created",r?.createdAt?re(r.createdAt):null)]})]}):/* @__PURE__ */H("p",{className:"pt-6 text-center text-sm text-ink-faintest",children:n>1?"Select one item to see its details.":"Select a file or folder to see its details."})})]})}var pe=e=>"recent"===e||"starred"===e||"shared"===e||"search"===e,ge="files.layout",ke={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"},we=[{kind:"document",label:"Document"},{kind:"spreadsheet",label:"Spreadsheet"},{kind:"deck",label:"Slides"}],ye="application/x-efficient-files";function ve(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 be(){try{return"grid"===localStorage.getItem(ge)?"grid":"list"}catch{return"list"}}function xe(e){const t=e??"/",n=t.split("/").filter(Boolean);let a=m()??[];for(const e of n){const t=a.find(t=>"folder"===t.kind&&t.name===e);a=t?.children??[]}return{folder:{id:e,name:n[n.length-1]??"",role:"owner",path:[{id:null,name:""},...n.map((e,t)=>({id:"/"+n.slice(0,t+1).join("/"),name:e}))]},entries:a.map(e=>({id:("/"===t?"":t)+"/"+e.name,name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}}function Ne(e,t){return`Not enough space for “${e}” (${d(t.attempted)}). You've used ${d(t.used)} of ${d(t.limit)}. Empty Trash or ask an administrator for more space.`}var Ce=(e,t)=>e instanceof Error&&e.message||t;function Se(e){const t=[];for(const n of e)("divider"!==n.type||0!==t.length&&"divider"!==t[t.length-1].type)&&t.push(n);for(;t.length&&"divider"===t[t.length-1].type;)t.pop();return t}function je({entry:e,className:t="h-5 w-5"}){const{name:n,tone:a}=te[_(e)];/* @__PURE__ */
35
- return H(z,{name:n,tone:a,look:"folder"===e.kind?"solid":void 0,className:`${t} shrink-0`})}function De({entry:e,read:t}){const[n,a]=U(null),r="image"===_(e)&&e.size<=5242880;return V(()=>{if(!r||!t||"function"!=typeof URL.createObjectURL)return;let n=!0,i=null;return t(e.id).then(e=>{n&&(i=URL.createObjectURL(e),a(i))}).catch(()=>{}),()=>{n=!1,i&&URL.revokeObjectURL(i)}},[e.id,e.modifiedAt,r,t]),n?/* @__PURE__ */H("img",{src:n,alt:"",className:"h-full w-full object-cover",draggable:!1}):/* @__PURE__ */H(je,{entry:e,className:"h-10 w-10"})}function Me(){const n=w(),r=n.title??"Files",F=null!==m(),Z=!F&&!!n.shares&&!!n.sharedWithMe,[_,me]=U(null),[Me,$e]=U(null),[Te,Le]=U([]),[Ae,Pe]=U(()=>/* @__PURE__ */new Set),Ee=G(null),[Fe,Re]=U(!0),[We,ze]=U(!1),[Oe,Ke]=U(null),[Ie,Ue]=U(!1),[Ge,Ve]=U(null),[Ye,Je]=U(null),[Xe,Be]=U(null),[He,Qe]=U(be),[Ze,qe]=U(!1),[_e,et]=U(""),[tt,nt]=U(""),[at,rt]=U({}),[it,st]=U({key:"name",dir:"asc"}),[lt,ot]=U(()=>{const e=y();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"}),ct=G("files"),dt=G(lt);dt.current=lt,V(()=>{v()},[]);const[mt,ht]=U([]),ut=e=>{Qe(e);try{localStorage.setItem(ge,e)}catch{}},ft=Y(e=>{ot(e),rt({}),st("recent"===e?{key:"modified",dir:"desc"}:{key:"name",dir:"asc"}),"search"!==e&&(et(""),nt(""))},[]);V(()=>{const e=()=>{v(),ft("trash")},t=e=>{v();const t=e.detail?.folderId;t&&ft({desktopFolderId:t})};return window.addEventListener(b,e),window.addEventListener(x,t),()=>{window.removeEventListener(b,e),window.removeEventListener(x,t)}},[ft]);const pt=J(N,C,C),gt="object"==typeof lt?lt.desktopFolderId:null,kt=gt?pt?.folders.find(e=>e.id===gt)??null:null,wt=gt&&pt?.itemsByFolder[gt]||[];V(()=>{gt&&pt&&!pt.folders.some(e=>e.id===gt)&&ft("files")},[gt,pt,ft]);const yt=G(0),vt=G(null),bt=G(null),{openPage:xt,openEntity:Nt}=L(),Ct=i(),St=i(),jt=i(),Dt=J(h,u,u);V(()=>f(),[]),V(()=>{!Dt||"trash"!==lt&&"object"!=typeof lt||ft("files")},[Dt,lt,ft]);const Mt=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>xt(e)}):"page"===t.entityType?xt(t.entityId):Nt(t.entityType,t.entityId,null,t.label)},$t=Y(async()=>{if(!F)try{Ke(await n.quota())}catch{}},[n,F]),Tt=Y(async(e,t)=>{Re(!0);try{await e(),ze(!1)}catch(e){e instanceof TypeError?ze(!0):I.error(Ce(e,t))}finally{Re(!1)}},[]),Lt=Y(async e=>{if(F)return $e(xe(e)),ze(!1),void Re(!1);await Tt(async()=>{$e(await n.list(e))},"Failed to list"),$t()},[n,$t,F,Tt]),At=Y(async(e,t)=>{if("search"===e&&!n.search){const e=t.toLowerCase(),a=F?xe(_):await n.list(_).catch(()=>null);return Le((a?.entries??[]).filter(t=>t.name.toLowerCase().includes(e))),void Re(!1)}const a={recent:()=>n.recent?.()??Promise.resolve([]),starred:()=>n.starred?.()??Promise.resolve([]),shared:()=>n.sharedWithMe?.()??Promise.resolve([]),search:()=>n.search?.(t)??Promise.resolve([])}[e];await Tt(async()=>{Le(await a())},"Failed to list files")},[n,F,_,Tt]),Pt=Y(async()=>{if(F)return ht([]),void Re(!1);await Tt(async()=>{ht(await n.trash())},"Failed to list trash"),$t()},[n,$t,F,Tt]),Et=()=>{"files"===lt?Lt(_):pe(lt)?At(lt,tt):"trash"===lt&&Pt()};V(()=>{Pe(/* @__PURE__ */new Set),Ee.current=null,Et()},[_,lt,tt]),V(()=>{const e=_e.trim();if(!e)return;const t=setTimeout(()=>{e===tt&&"search"===dt.current||("search"!==dt.current&&(ct.current=dt.current),ot("search"),rt({}),nt(e))},300);return()=>clearTimeout(t)},[_e]);const Ft=()=>{et(""),"search"===dt.current&&ft(ct.current)},Rt=e=>{ft("files"),me(e)},Wt=async(e,t)=>{try{await e()}catch(e){I.error(Ce(e,t))}Et()},zt=e=>Wt(async()=>{await n.restore(e.id),I.success(`Restored "${e.name}"`)},"Restore failed"),Ot=async e=>{await P({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Wt(()=>n.purge(e.id),"Delete failed")},Kt=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){I.error(Ce(e,"Download failed"))}},It="files"===lt?Me?.folder??null:null,Ut=It?.role??"owner",Gt="owner"!==Ut,Vt="files"===lt?_:null,Yt=!F&&("files"!==lt||"viewer"!==Ut),Jt=!F&&"files"===lt&&"viewer"!==Ut,Xt=async(e,{withFolders:t=!1}={})=>{let a=0;for(const r of Array.from(e)){const e=r.webkitRelativePath??"",i=t?e.split("/").slice(0,-1).join("/"):"";try{await n.upload(Vt,r,i?{folderPath:i}:void 0),a++}catch(e){e instanceof $?I.error(Ne(r.name,e)):I.error(`Upload ${r.name}: ${Ce(e,"failed")}`)}}a>1&&I.success(`Uploaded ${a} files`),"files"===lt?Lt(_):Rt(null)},Bt=async e=>{const t=ne(e),a=await E({title:`Rename ${e.kind}`,defaultValue:t,confirmLabel:"Rename"});a&&a!==t&&(/[\\/]/.test(a)?I.error("Names cannot contain slashes"):Wt(()=>n.rename(e.id,function(e,t){const n=e.officeKind?T[e.officeKind]:"";return n&&!t.toLowerCase().endsWith(n)?t+n:t}(e,a)),"Rename failed"))},Ht=async e=>{if(0===e.length)return;const t=1===e.length?e[0]:null,a=e.some(e=>"owner"!==(e.role??"owner")),r=t?(t.owner??Me?.folder.owner)?.name??"its owner":"their owners";await P({title:t?`Move ${t.kind} to trash`:`Move ${e.length} items to trash`,message:(t?`"${ne(t)}"${"folder"===t.kind?" and everything inside":""}`:`${e.length} items`)+" will move to "+(a?`${r}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Move to trash",variant:"danger"})&&(await Wt(async()=>{for(const t of e)await n.remove(t.id)},"Delete failed"),I.success(t?`"${ne(t)}" moved to trash`:`${e.length} items moved to trash`))},Qt=(e,t)=>Wt(async()=>{for(const a of e)await n.setStarred(a.id,t)},t?"Star failed":"Unstar failed"),Zt=async(e,t)=>{Be(null);const a=e.filter(e=>e.id!==t);0!==a.length&&(await Wt(async()=>{for(const e of a)await n.move(e.id,t)},"Move failed"),I.success(1===a.length?`Moved "${ne(a[0])}"`:`Moved ${a.length} items`))},qt=()=>{yt.current=0,Ue(!1),Ve(null)};V(()=>{const e=()=>qt();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]);const _t="files"===lt?Me?.entries??[]:pe(lt)?Te:[],en=X(()=>le(de(_t,at),it),[_t,at,it]),tn=X(()=>new Map(en.map(e=>[e.id,e])),[en]),nn=[...Ae].map(e=>tn.get(e)).filter(e=>!!e),an=1===nn.length?nn[0]:null,rn=e=>e.role??("files"===lt?Ut:"owner"),sn=e=>!F&&"viewer"!==rn(e),ln=e=>Z&&"owner"===rn(e),on=e=>!!n.move&&sn(e),cn=(e,t)=>{if(Dt){const t=tn.get(e);if(t&&"file"===t.kind&&!mn(t))return;return void Pe(/* @__PURE__ */new Set([e]))}if(t.shiftKey&&Ee.current){const t=en.map(e=>e.id),n=t.indexOf(Ee.current),a=t.indexOf(e);if(n>=0&&a>=0)return void Pe(new Set(t.slice(Math.min(n,a),Math.max(n,a)+1)))}Ee.current=e,t.metaKey||t.ctrlKey?Pe(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}):Pe(/* @__PURE__ */new Set([e]))},dn=()=>{Pe(/* @__PURE__ */new Set),Ee.current=null},mn=e=>!!Dt&&"file"===e.kind&&g(Dt.request,e.name),hn=e=>Dt&&"file"===e.kind&&!mn(e)?"text-ink-faintest":"",un=e=>{if(!Dt||!mn(e))return;const t="files"===lt?Me?.folder:null,n=t?["owner"===t.role?"My files":"Shared with me",...t.path.filter(e=>null!==e.id).map(e=>e.name)].join(" › "):"shared"===lt?"Shared with me":"My files";p(Dt.id,{entry:e,folderId:"files"===lt?_:null,location:n})},fn=Dt&&an&&mn(an)?an:null,pn=t=>{"folder"===t.kind?Rt(t.id):Dt?un(t):(async t=>{if(F)return;if(n.open?.(t))return;const a=ke[q(t.name)];a?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:a,load:()=>n.read(t.id),onStaged:e=>xt(e)}):Kt(t)})(t)},gn=e=>{if(0===e.length)return[];const t=1===e.length?e[0]:null;if(Dt)return t&&("folder"===t.kind||mn(t))?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const a=t&&"file"===t.kind&&n.openLabel?.(t)||"Open",r=e.every(e=>"file"===e.kind),i=e.every(sn);if(F)return t?[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[];const s=e.some(e=>!e.starred);return Se([...t?[{key:"open",label:a,icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>pn(t)}]:[],{type:"divider",key:"d1"},...r?[{key:"download",label:"Download",icon:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"}),onSelect:()=>{e.forEach(Kt)}}]:[],...t&&i?[{key:"rename",label:"Rename",icon:/* @__PURE__ */H(z,{name:"edit",className:"h-4 w-4"}),onSelect:()=>Bt(t)}]:[],...r&&n.copy?[{key:"copy",label:"Make a copy",icon:/* @__PURE__ */H(z,{name:"copy",className:"h-4 w-4"}),onSelect:()=>(e=>Wt(async()=>{for(const t of e)await n.copy(t.id);I.success(1===e.length?`Copied "${ne(e[0])}"`:`Copied ${e.length} files`)},"Copy failed"))(e)}]:[],{type:"divider",key:"d2"},...t&&ln(t)?[{key:"share",label:"Share",icon:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"}),onSelect:()=>Je(t)}]:[],...e.every(on)?[{key:"move",label:"Move",icon:/* @__PURE__ */H(z,{name:"forward",className:"h-4 w-4"}),onSelect:()=>Be(e)}]:[],...n.setStarred?[{key:"star",label:s?"Add to starred":"Remove from starred",icon:/* @__PURE__ */H(z,{name:"star",className:"h-4 w-4"}),onSelect:()=>Qt(e,s)}]:[],...t?[{key:"info",label:"File information",icon:/* @__PURE__ */H(z,{name:"info",className:"h-4 w-4"}),onSelect:()=>{Pe(/* @__PURE__ */new Set([t.id])),qe(!0)}}]:[],{type:"divider",key:"d3"},...i?[{key:"trash",label:"Move to trash",danger:!0,icon:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Ht(e)}]:[]])},kn=(e,t)=>{const n=Ae.has(t.id)?nn:[t];Ct.open(e,n)&&!Ae.has(t.id)&&(Pe(/* @__PURE__ */new Set([t.id])),Ee.current=t.id)},wn=e=>on(e)?{draggable:!0,onDragStart:t=>{const n=Ae.has(e.id)?nn:[e];t.dataTransfer.setData(ye,JSON.stringify(n.map(e=>e.id))),t.dataTransfer.effectAllowed="move"}}:{},yn=e=>"folder"===e.kind&&sn(e)&&n.move?{onDragOver:t=>{t.dataTransfer.types.includes(ye)&&(t.preventDefault(),t.stopPropagation(),Ge!==e.id&&Ve(e.id))},onDragLeave:()=>{Ge===e.id&&Ve(null)},onDrop:t=>{if(!t.dataTransfer.types.includes(ye))return;t.preventDefault(),t.stopPropagation(),Ve(null);const n=JSON.parse(t.dataTransfer.getData(ye)||"[]").map(e=>tn.get(e)).filter(t=>!!t&&t.id!==e.id);Zt(n,e.id)}}:{};if(We)/* @__PURE__ */
36
- return B("div",{className:"flex flex-col h-full bg-surface",children:[
37
- /* @__PURE__ */H(A,{title:`${r} - offline`}),
38
- /* @__PURE__ */H("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */B("div",{className:"max-w-md",children:[
39
- /* @__PURE__ */H(z,{name:"close-circle",tone:"muted",className:"h-12 w-12 mx-auto mb-3",strokeWidth:1.4}),S()?/* @__PURE__ */B(Q,{children:[
40
- /* @__PURE__ */H("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
41
- /* @__PURE__ */H("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */B(Q,{children:[
42
- /* @__PURE__ */H("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
43
- /* @__PURE__ */B("p",{className:"text-sm text-ink-faint mb-3",children:["No response from the file server. Make sure the server is running — see ",
44
- /* @__PURE__ */H("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
45
- /* @__PURE__ */H(W,{variant:"primary",onClick:Et,children:"Retry"})]})})]});const vn=Oe&&Oe.limit>0?Math.min(100,Math.round(Oe.used/Oe.limit*100)):0,bn=vn>90?"bg-danger":vn>75?"bg-warning":"bg-accent-fill",xn=[Gt?{label:"Shared with me",onClick:()=>ft("shared")}:{label:"My files",onClick:()=>Rt(null)},...(It?.path??[]).filter(e=>null!==e.id).map(e=>({label:e.name,onClick:()=>Rt(e.id)}))],Nn="recent"===lt?"Recent":"starred"===lt?"Starred":"shared"===lt?"Shared with me":"search"===lt?`Results for “${tt}”`:"trash"===lt?"Trash":kt?kt.name:null,Cn=Dt?`${r} - Choosing`:Nn?`${r} - ${"search"===lt?"Search":Nn}`:It&&null!==It.id?`${r} - ${It.name}`:r,Sn=e=>"flex w-full items-center gap-3 rounded-full px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-accent-tint font-medium text-accent-text":"text-ink hover:bg-row-hover"),jn=Se([{key:"folder",label:"New folder",icon:/* @__PURE__ */H(z,{name:"folder-plus",className:"h-4 w-4"}),onSelect:async()=>{const e=await E({title:"New folder",placeholder:"Folder name",defaultValue:"Untitled folder",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?I.error("Folder names cannot contain slashes"):(await Wt(()=>n.createFolder(Vt,e),"Create folder failed"),"files"!==lt&&Rt(null)))}},{type:"divider",key:"d1"},{key:"upload",label:"File upload",icon:/* @__PURE__ */H(z,{name:"upload",className:"h-4 w-4"}),onSelect:()=>vt.current?.click()},...n.folderUpload?[{key:"upload-folder",label:"Folder upload",icon:/* @__PURE__ */H(z,{name:"cloud-arrow-up",className:"h-4 w-4"}),onSelect:()=>bt.current?.click()}]:[],{type:"divider",key:"d2"},...n.createOfficeFile?we.filter(e=>!n.officeKinds||n.officeKinds.includes(e.kind)).map(e=>{const t=te["deck"===e.kind?"slides":e.kind];return{key:e.kind,label:e.label,icon:/* @__PURE__ */H(z,{name:t.name,tone:t.tone,className:"h-4 w-4"}),onSelect:()=>{Promise.resolve(n.createOfficeFile(e.kind,Vt)).catch(e=>I.error(Ce(e,"Could not create it")))}}}):[]]),Dn=/* @__PURE__ */B("div",{className:"flex h-full flex-col",children:[
46
- /* @__PURE__ */H("div",{className:"p-3 pb-2",children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */B(Q,{children:[
47
- /* @__PURE__ */H(z,{name:"add",className:"h-5 w-5"}),
48
- /* @__PURE__ */H("span",{children:"New"})]}),items:jn,align:"start","aria-label":"New",disabled:!Yt,triggerClassName:"inline-flex items-center gap-2 h-11 pl-4 pr-5 rounded-2xl bg-surface-raised border border-line shadow-sm text-sm font-medium text-ink-strong hover:bg-row-hover disabled:opacity-50 rosh-focus-ring focus-visible:ring-2"})}),
49
- /* @__PURE__ */B("nav",{className:"px-2 flex-1 overflow-auto","aria-label":"Locations",children:[
50
- /* @__PURE__ */B("button",{onClick:()=>Rt(null),className:Sn("files"===lt&&!Gt),children:[
51
- /* @__PURE__ */H(z,{name:"home",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"My files"]}),n.recent&&!F&&/* @__PURE__ */B("button",{onClick:()=>ft("recent"),className:Sn("recent"===lt),children:[
52
- /* @__PURE__ */H(z,{name:"clock",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Recent"]}),n.starred&&!F&&/* @__PURE__ */B("button",{onClick:()=>ft("starred"),className:Sn("starred"===lt),children:[
53
- /* @__PURE__ */H(z,{name:"star",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Starred"]}),Z&&/* @__PURE__ */B("button",{onClick:()=>ft("shared"),className:Sn("shared"===lt||"files"===lt&&Gt),children:[
54
- /* @__PURE__ */H(z,{name:"team",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Shared with me"]}),!F&&/* @__PURE__ */B("button",{onClick:()=>ft("trash"),className:Sn("trash"===lt),children:[
55
- /* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),"Trash"]}),pt&&pt.folders.length>0&&/* @__PURE__ */B(Q,{children:[
56
- /* @__PURE__ */H("div",{className:"px-3 pt-4 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),pt.folders.map(e=>/* @__PURE__ */B("button",{onClick:()=>ft({desktopFolderId:e.id}),className:Sn(gt===e.id),children:[
57
- /* @__PURE__ */H(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
58
- /* @__PURE__ */H("span",{className:"truncate",children:e.name}),
59
- /* @__PURE__ */H(R,{count:e.itemCount,active:gt===e.id,className:"ml-auto"})]},e.id))]})]}),Oe&&/* @__PURE__ */B("div",{className:"px-5 py-3 shrink-0",title:`${d(Oe.used)} of ${d(Oe.limit)} used`,children:[
60
- /* @__PURE__ */H("div",{className:"h-1 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */H("div",{className:`h-full ${bn} transition-all`,style:{width:`${vn}%`}})}),
61
- /* @__PURE__ */B("div",{className:"mt-2 text-2xs text-ink-faint tabular-nums",children:[d(Oe.used)," of ",d(Oe.limit)," used"]})]})]}),Mn=(e,t)=>/* @__PURE__ */B("span",{className:"inline-flex items-center gap-1",children:[e,
62
- /* @__PURE__ */H(z,{name:"chevron-down",className:"h-3.5 w-3.5"}),t?"":null]}),$n=e=>"inline-flex items-center h-7 px-3 rounded-(--radius-control) border text-xs whitespace-nowrap rosh-focus-ring focus-visible:ring-2 "+(e?"border-accent-border bg-accent-tint text-accent-text":"border-line-strong text-ink-muted hover:bg-row-hover"),Tn=pe(lt)||"files"===lt,Ln=function(e){const t=/* @__PURE__ */new Map;for(const n of e)"owner"!==(n.role??"owner")&&n.owner&&t.set(n.owner.id,n.owner.name);return[...t].map(([e,t])=>({id:e,name:t})).sort((e,t)=>se.compare(e.name,t.name))}(_t),An=Tn&&_t.length>0?/* @__PURE__ */B("div",{className:"flex items-center gap-2 shrink-0",children:[
63
- /* @__PURE__ */H(o,{trigger:Mn(at.type?ee[at.type]:"Type",!!at.type),"aria-label":"Type",triggerClassName:$n(!!at.type),items:[...oe.map(e=>({type:"radio",key:e,label:ee[e],checked:at.type===e,onSelect:()=>rt(t=>({...t,type:t.type===e?null:e}))})),...at.type?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,type:null}))}]:[]]}),Z&&/* @__PURE__ */H(o,{trigger:Mn(at.person?"me"===at.person?"Owned by me":Ln.find(e=>e.id===at.person)?.name??"People":"People",!!at.person),"aria-label":"People",triggerClassName:$n(!!at.person),items:[{type:"radio",key:"me",label:"Owned by me",checked:"me"===at.person,onSelect:()=>rt(e=>({...e,person:"me"===e.person?null:"me"}))},...Ln.map(e=>({type:"radio",key:e.id,label:e.name,checked:at.person===e.id,onSelect:()=>rt(t=>({...t,person:t.person===e.id?null:e.id}))})),...at.person?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,person:null}))}]:[]]}),
64
- /* @__PURE__ */H(o,{trigger:Mn(at.modified?ce[at.modified]:"Modified",!!at.modified),"aria-label":"Modified",triggerClassName:$n(!!at.modified),items:[...Object.keys(ce).map(e=>({type:"radio",key:e,label:ce[e],checked:at.modified===e,onSelect:()=>rt(t=>({...t,modified:t.modified===e?null:e}))})),...at.modified?[{type:"divider",key:"d"},{key:"clear",label:"Clear",onSelect:()=>rt(e=>({...e,modified:null}))}]:[]]})]}):null,Pn=Tn&&nn.length>0&&!Dt?/* @__PURE__ */B("div",{className:"flex items-center gap-0.5 h-10 px-2 rounded-full bg-surface-sunken",role:"toolbar","aria-label":"Selection",children:[
65
- /* @__PURE__ */H(c,{"aria-label":"Clear selection",size:"sm",onClick:dn,children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})}),
66
- /* @__PURE__ */B("span",{className:"text-sm text-ink mr-2 whitespace-nowrap",children:[nn.length," selected"]}),an&&ln(an)&&/* @__PURE__ */H(c,{"aria-label":"Share",size:"sm",onClick:()=>Je(an),children:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"})}),!F&&nn.every(e=>"file"===e.kind)&&/* @__PURE__ */H(c,{"aria-label":"Download",size:"sm",onClick:()=>nn.forEach(Kt),children:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"})}),nn.every(on)&&/* @__PURE__ */H(c,{"aria-label":"Move",size:"sm",onClick:()=>Be(nn),children:/* @__PURE__ */H(z,{name:"forward",className:"h-4 w-4"})}),!F&&nn.every(sn)&&/* @__PURE__ */H(c,{"aria-label":"Move to trash",size:"sm",onClick:()=>Ht(nn),children:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"})}),
67
- /* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(nn)})]}):null,En=/* @__PURE__ */H("div",{className:"flex items-center gap-2 px-4 pb-2 min-h-12 shrink-0",children:Pn??/* @__PURE__ */B(Q,{children:[
68
- /* @__PURE__ */B("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:["files"===lt?/* @__PURE__ */H("div",{className:"min-w-0 text-base [&_*]:text-base",children:/* @__PURE__ */H(a,{items:xn,maxItems:5})}):"trash"===lt?/* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong",children:"Trash"}):"object"==typeof lt?/* @__PURE__ */B(Q,{children:[
69
- /* @__PURE__ */H(j,{className:"h-4 w-4 text-amber-500 shrink-0"}),
70
- /* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong truncate",children:kt?.name??"Desktop folder"}),
71
- /* @__PURE__ */H("span",{className:"text-2xs text-ink-faintest whitespace-nowrap",children:"Desktop shortcuts"})]}):/* @__PURE__ */H("span",{className:"text-base font-medium text-ink-strong truncate",children:Nn}),"files"===lt&&Gt&&"viewer"===Ut&&/* @__PURE__ */B("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs text-ink-faint whitespace-nowrap",children:[
72
- /* @__PURE__ */H(z,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),"files"===lt&&Gt&&It?.owner&&/* @__PURE__ */B("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",It.owner.name]})]}),An,"trash"===lt&&/* @__PURE__ */H(W,{variant:"secondary-danger",size:"sm",onClick:async()=>{if(0===mt.length)return;await P({title:"Empty trash",message:`${mt.length} item${1===mt.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"})&&Wt(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===mt.length,children:"Empty trash"})]})}),Fn=(e,t)=>Dt?null:/* @__PURE__ */B("div",{className:"flex items-center justify-end "+(t?"":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"),children:[ln(e)&&/* @__PURE__ */H(c,{"aria-label":"Share",size:"sm",onClick:t=>{t.stopPropagation(),Je(e)},children:/* @__PURE__ */H(z,{name:"add-person",className:"h-4 w-4"})}),!F&&"file"===e.kind&&/* @__PURE__ */H(c,{"aria-label":"Download",size:"sm",onClick:t=>{t.stopPropagation(),Kt(e)},children:/* @__PURE__ */H(z,{name:"download",className:"h-4 w-4"})}),n.setStarred&&!F&&/* @__PURE__ */H(c,{"aria-label":e.starred?"Remove from starred":"Add to starred","aria-pressed":!!e.starred,size:"sm",onClick:t=>{t.stopPropagation(),Qt([e],!e.starred)},children:/* @__PURE__ */H(z,{name:"star",look:e.starred?"solid":void 0,tone:e.starred?"warning":void 0,className:"h-4 w-4"})}),
73
- /* @__PURE__ */H("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(Ae.has(e.id)&&nn.length>1?nn:[e])})})]}),Rn=e=>/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
74
- /* @__PURE__ */H(je,{entry:e}),
75
- /* @__PURE__ */H("span",{className:"truncate",title:e.name,children:ne(e)}),!!e.shareCount&&/* @__PURE__ */H("span",{className:"shrink-0",role:"img","aria-label":"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),title:"Shared with "+(1===e.shareCount?"1 person":`${e.shareCount} people`),children:/* @__PURE__ */H(z,{name:"team",tone:"muted",className:"h-3.5 w-3.5"})}),e.starred&&/* @__PURE__ */H("span",{className:"shrink-0",role:"img","aria-label":"Starred",title:"Starred",children:/* @__PURE__ */H(z,{name:"star",look:"solid",tone:"warning",className:"h-3.5 w-3.5"})})]}),Wn=(e,t,n)=>{const a=it.key===e;/* @__PURE__ */
76
- return H("th",{className:`${K} font-medium px-3 h-9 ${n}`,"aria-sort":a?"asc"===it.dir?"ascending":"descending":void 0,children:/* @__PURE__ */B("button",{type:"button",className:"inline-flex items-center gap-1 rounded hover:text-ink "+(a?"text-ink":""),onClick:()=>st(t=>({key:e,dir:t.key===e&&"asc"===t.dir?"desc":"asc"})),children:[t,a&&("asc"===it.dir?/* @__PURE__ */H(z,{name:"arrow-up",className:"h-3 w-3"}):/* @__PURE__ */H(z,{name:"arrow-down",className:"h-3 w-3"}))]})})},zn="recent"===lt?"Files you and your colleagues change show here.":"starred"===lt?"Star the files and folders you want to find quickly.":"shared"===lt?"Nothing has been shared with you yet. Files and folders colleagues share with you show here.":"search"===lt?`Nothing matches “${tt}”.`:null,On=0===en.length?Fe?/* @__PURE__ */H(O,{size:"sm",padding:"p-6",label:"Loading"}):/* @__PURE__ */H("div",{className:"p-10 text-center text-sm text-ink-faintest",children:_t.length>0?"Nothing matches these filters.":zn??/* @__PURE__ */B(Q,{children:["This folder is empty.",Jt&&/* @__PURE__ */B(Q,{children:[" Drop files here or choose ",
77
- /* @__PURE__ */H("span",{className:"font-medium",children:"New"}),"."]})]})}):"grid"===He?/* @__PURE__ */H("div",{className:"px-4 pb-4",children:["folder","file"].map(e=>{const t=en.filter(t=>t.kind===e);return 0===t.length?null:/* @__PURE__ */B("section",{className:"mb-4",children:[
78
- /* @__PURE__ */H("h3",{className:"text-xs font-medium text-ink-faint mb-2",children:"folder"===e?"Folders":"Files"}),
79
- /* @__PURE__ */H("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.map(t=>{const a=Ae.has(t.id);/* @__PURE__ */
80
- return B("div",{role:"button",tabIndex:0,"aria-pressed":a,"aria-label":ne(t),onClick:e=>cn(t.id,e),onDoubleClick:()=>pn(t),onContextMenu:e=>kn(e,t),...wn(t),...yn(t),className:"group rounded-xl border cursor-default select-none outline-none focus-visible:ring-2 focus-visible:ring-accent-border "+(a||Ge===t.id?"border-accent-border bg-accent-tint":"border-line bg-surface-sunken hover:bg-row-hover"),children:[
81
- /* @__PURE__ */B("div",{className:"flex items-center gap-2 pl-3 pr-1 h-11",children:[
82
- /* @__PURE__ */H(je,{entry:t,className:"h-4 w-4"}),
83
- /* @__PURE__ */H("span",{className:"flex-1 truncate text-sm",title:t.name,children:ne(t)}),
84
- /* @__PURE__ */H("span",{onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:/* @__PURE__ */H(o,{trigger:/* @__PURE__ */H(z,{name:"more-vertical",className:"h-4 w-4"}),"aria-label":"More actions",items:gn(a&&nn.length>1?nn:[t])})})]}),"file"===e&&/* @__PURE__ */B(Q,{children:[
85
- /* @__PURE__ */H("div",{className:"mx-2 h-28 rounded-lg bg-surface flex items-center justify-center overflow-hidden",children:/* @__PURE__ */H(De,{entry:t,read:F?void 0:n.read})}),
86
- /* @__PURE__ */B("div",{className:"px-3 py-2 text-2xs text-ink-faint truncate",children:["me"===ie(t)?"You":ie(t)," · ",re(t.modifiedAt)]})]})]},t.id)})})]},e)})}):/* @__PURE__ */B("table",{className:"w-full text-sm table-fixed",children:[
87
- /* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[Wn("name","Name","text-left"),Z&&Wn("owner","Owner","text-left w-32"),Wn("modified","Modified","text-left w-28"),Wn("size","Size","text-right w-20"),
88
- /* @__PURE__ */H("th",{className:`${K} w-32`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
89
- /* @__PURE__ */H("tbody",{children:en.map(e=>{const t=Ae.has(e.id);/* @__PURE__ */
90
- return B("tr",{"aria-selected":t,onClick:t=>cn(e.id,t),onDoubleClick:()=>pn(e),onContextMenu:t=>kn(t,e),...wn(e),...yn(e),className:`group cursor-default select-none border-b border-line-subtle ${hn(e)} ${t||Ge===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
91
- /* @__PURE__ */H("td",{className:"px-3 h-11",children:Rn(e)}),Z&&/* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint truncate",children:ie(e)}),
92
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:ve(e.modifiedAt),children:re(e.modifiedAt)}),
93
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint whitespace-nowrap",children:Dt&&"file"===e.kind&&!mn(e)&&Dt.request.otherLabel?Dt.request.otherLabel:ae(e)}),
94
- /* @__PURE__ */H("td",{className:"px-2 h-11",children:Fn(e,t)})]},e.id)})})]}),Kn=Fe&&0===mt.length?/* @__PURE__ */H(O,{size:"sm",padding:"p-6",label:"Loading"}):0===mt.length?/* @__PURE__ */H("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty. What you delete stays here for 30 days."}):/* @__PURE__ */B("table",{className:"w-full text-sm table-fixed",children:[
95
- /* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[
96
- /* @__PURE__ */H("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
97
- /* @__PURE__ */H("th",{className:`${K} text-left font-medium px-3 h-9 w-48`,children:"Original location"}),
98
- /* @__PURE__ */H("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Deleted"}),
99
- /* @__PURE__ */H("th",{className:`${K} text-right font-medium px-3 h-9 w-24`,children:"Size"}),
100
- /* @__PURE__ */H("th",{className:`${K} w-28`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
101
- /* @__PURE__ */H("tbody",{children:mt.map(e=>/* @__PURE__ */B("tr",{className:"group border-b border-line-subtle hover:bg-row-hover",onContextMenu:t=>St.open(t,e),children:[
102
- /* @__PURE__ */H("td",{className:"px-3 h-11",children:/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
103
- /* @__PURE__ */H(je,{entry:e}),
104
- /* @__PURE__ */H("span",{className:"truncate",title:e.name,children:e.name})]})}),
105
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint text-xs truncate",title:e.originalPath,children:e.originalPath||"—"}),
106
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-ink-faint whitespace-nowrap",title:e.deletedAt?ve(e.deletedAt):void 0,children:e.deletedAt?re(e.deletedAt):"—"}),
107
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":d(e.size)}),
108
- /* @__PURE__ */H("td",{className:"px-2 h-11",children:/* @__PURE__ */B("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
109
- /* @__PURE__ */H(c,{"aria-label":"Restore",size:"sm",onClick:()=>zt(e),children:/* @__PURE__ */H(z,{name:"revert",className:"h-4 w-4"})}),
110
- /* @__PURE__ */H(c,{"aria-label":"Delete forever",size:"sm",variant:"ghost-danger",onClick:()=>Ot(e),children:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"})})]})})]},e.id))})]}),In=0===wt.length?/* @__PURE__ */H("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */B("table",{className:"w-full text-sm table-fixed",children:[
111
- /* @__PURE__ */H("thead",{className:"text-xs text-ink-faint border-b border-line",children:/* @__PURE__ */B("tr",{children:[
112
- /* @__PURE__ */H("th",{className:`${K} text-left font-medium px-3 h-9`,children:"Name"}),
113
- /* @__PURE__ */H("th",{className:`${K} text-left font-medium px-3 h-9 w-32`,children:"Type"}),
114
- /* @__PURE__ */H("th",{className:`${K} w-32`,children:/* @__PURE__ */H("span",{className:"sr-only",children:"Actions"})})]})}),
115
- /* @__PURE__ */H("tbody",{children:wt.map(e=>/* @__PURE__ */B("tr",{onDoubleClick:()=>Mt(e),onContextMenu:t=>jt.open(t,e),className:"group cursor-default border-b border-line-subtle hover:bg-row-hover",children:[
116
- /* @__PURE__ */H("td",{className:"px-3 h-11",children:/* @__PURE__ */B("span",{className:"flex items-center gap-3 min-w-0",children:[
117
- /* @__PURE__ */H(D,{item:e}),
118
- /* @__PURE__ */H("span",{className:"truncate",title:e.label,children:e.label})]})}),
119
- /* @__PURE__ */H("td",{className:"px-3 h-11 text-xs text-ink-faint",children:M(e)}),
120
- /* @__PURE__ */H("td",{className:"px-2 h-11",children:/* @__PURE__ */B("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",children:[
121
- /* @__PURE__ */H(c,{"aria-label":"Open",size:"sm",onClick:()=>Mt(e),children:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"})}),
122
- /* @__PURE__ */H(c,{"aria-label":"Move to desktop",size:"sm",onClick:()=>pt?.moveToDesktop([e]),children:/* @__PURE__ */H(z,{name:"desktop",className:"h-4 w-4"})}),
123
- /* @__PURE__ */H(c,{"aria-label":"Remove",size:"sm",variant:"ghost-danger",onClick:()=>pt?.removeShortcuts([e]),children:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"})})]})})]},`${e.entityType}|${e.entityId}`))})]});/* @__PURE__ */
124
- return B("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Jt&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),yt.current++,Ie||Ue(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{yt.current>0&&yt.current--,0===yt.current&&Ue(!1)},onDrop:e=>{e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),qt(),Jt&&e.dataTransfer.files?.length&&Xt(e.dataTransfer.files))},children:[
125
- /* @__PURE__ */H(A,{title:Cn}),
126
- /* @__PURE__ */H(k,{app:"files"}),
127
- /* @__PURE__ */H("input",{ref:vt,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Xt(e.target.files),vt.current&&(vt.current.value="")}}),
128
- /* @__PURE__ */H("input",{ref:e=>{bt.current=e,e?.setAttribute("webkitdirectory","")},type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Xt(e.target.files,{withFolders:!0}),bt.current&&(bt.current.value="")}}),
129
- /* @__PURE__ */H("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */H(t,{sidebar:Dn,storageKey:"files.sidebarWidth",defaultWidth:220,minWidth:170,maxWidth:320,children:/* @__PURE__ */B("div",{className:"flex h-full min-w-0",children:[
130
- /* @__PURE__ */B("div",{className:"flex flex-1 min-w-0 flex-col",children:[Dt&&/* @__PURE__ */B("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-line bg-accent-tint text-accent-text text-sm shrink-0",role:"status",children:[
131
- /* @__PURE__ */H(z,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
132
- /* @__PURE__ */H("span",{className:"flex-1 min-w-0 truncate",children:Dt.request.title}),
133
- /* @__PURE__ */H(W,{variant:"secondary",size:"sm",onClick:()=>p(Dt.id,null),children:"Cancel"}),
134
- /* @__PURE__ */H(W,{variant:"primary",size:"sm",disabled:!fn,onClick:()=>{fn&&un(fn)},children:"Open"})]}),
135
- /* @__PURE__ */B("div",{className:"flex items-center gap-1 px-4 py-2 shrink-0",children:[
136
- /* @__PURE__ */H("div",{className:"flex-1 min-w-48 max-w-2xl",role:"search",children:/* @__PURE__ */H(l,{type:"text",enterKeyHint:"search",value:_e,onChange:e=>{et(e.target.value),e.target.value.trim()||Ft()},onKeyDown:e=>{"Escape"===e.key&&_e&&(e.stopPropagation(),Ft())},placeholder:`Search in ${r}`,"aria-label":`Search in ${r}`,leftIcon:/* @__PURE__ */H(z,{name:"search",className:"h-4 w-4"}),endAction:_e?{label:"Clear search",icon:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"}),onClick:Ft}:void 0})}),
137
- /* @__PURE__ */H("div",{className:"flex-1"}),"object"!=typeof lt&&"trash"!==lt&&/* @__PURE__ */B(Q,{children:[
138
- /* @__PURE__ */H(c,{"aria-label":"List view","aria-pressed":"list"===He,onClick:()=>ut("list"),children:/* @__PURE__ */H(z,{name:"list",className:"h-4 w-4"})}),
139
- /* @__PURE__ */H(c,{"aria-label":"Grid view","aria-pressed":"grid"===He,onClick:()=>ut("grid"),children:/* @__PURE__ */H(z,{name:"grid",className:"h-4 w-4"})})]}),
140
- /* @__PURE__ */H(c,{"aria-label":"Details","aria-pressed":Ze,onClick:()=>qe(e=>!e),children:/* @__PURE__ */H(z,{name:"info",className:"h-4 w-4"})})]}),En,
141
- /* @__PURE__ */H("div",{className:"flex-1 overflow-auto outline-none",tabIndex:-1,onKeyDown:e=>{e.target instanceof HTMLInputElement||(Dt?"Enter"===e.key&&fn&&(e.preventDefault(),un(fn)):("Delete"===e.key||"Backspace"===e.key)&&nn.length&&nn.every(sn)?(e.preventDefault(),Ht(nn)):"Enter"===e.key&&an?(e.preventDefault(),pn(an)):(e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&en.length&&(e.preventDefault(),Pe(new Set(en.map(e=>e.id)))))},onClick:e=>{e.target===e.currentTarget&&dn()},children:"object"==typeof lt?In:"trash"===lt?Kn:On})]}),Ze&&Tn&&/* @__PURE__ */H(fe,{store:n,entry:an,selectedCount:nn.length,onClose:()=>qe(!1)})]})})}),Ct.state&&/* @__PURE__ */H(s,{...Ct.props,items:gn(Ct.state.data),"aria-label":"File actions"}),St.state&&/* @__PURE__ */H(s,{...St.props,"aria-label":"Trash actions",items:[{key:"restore",label:"Restore",icon:/* @__PURE__ */H(z,{name:"revert",className:"h-4 w-4"}),onSelect:()=>zt(St.state.data)},{type:"divider",key:"d"},{key:"purge",label:"Delete forever",danger:!0,icon:/* @__PURE__ */H(z,{name:"trash",className:"h-4 w-4"}),onSelect:()=>Ot(St.state.data)}]}),jt.state&&/* @__PURE__ */H(s,{...jt.props,"aria-label":"Shortcut actions",items:[{key:"open",label:"Open",icon:/* @__PURE__ */H(z,{name:"external",className:"h-4 w-4"}),onSelect:()=>Mt(jt.state.data)},{key:"desktop",label:"Move to desktop",icon:/* @__PURE__ */H(z,{name:"desktop",className:"h-4 w-4"}),onSelect:()=>pt?.moveToDesktop([jt.state.data])},{type:"divider",key:"d"},{key:"remove",label:"Remove",danger:!0,icon:/* @__PURE__ */H(z,{name:"close",className:"h-4 w-4"}),onSelect:()=>pt?.removeShortcuts([jt.state.data])}]}),Z&&/* @__PURE__ */H(he,{store:n,entry:Ye,onClose:()=>Je(null),onChanged:Et}),n.move&&/* @__PURE__ */H(ue,{store:n,items:Xe,from:"files"===lt?_:void 0,onClose:()=>Be(null),onMove:e=>Xe&&Zt(Xe,e)}),Ie&&/* @__PURE__ */H("div",{className:"absolute inset-0 bg-accent-tint border-4 border-dashed border-accent-border pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */H("div",{className:"px-4 py-2 rounded-md bg-accent-fill text-on-accent text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{Me as default,Ne as quotaExceededMessage};
@@ -1 +0,0 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-FSORYU5C.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-5X3Z45SL.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-HCDG7EUR.js";import"./chunk-C3QOHMR6.js";
@@ -1,44 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as r,RAIL_OPEN_SECTIONS_KEY as n,RAIL_WIDTH_KEY as i,toggleOpenSection as a,writeStored as o}from"./chunk-U6LKNGC6.js";import{ResizeHandle as l}from"./chunk-UEADX2GV.js";import{openGlobalSearch as s}from"./chunk-NJ6WZHXC.js";import{partitionNav as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as u}from"./chunk-HGOWQO63.js";import{BrandMark as h}from"./chunk-MI67DI3H.js";import{IconButton_default as p}from"./chunk-SV5RRBVA.js";import{RAIL_MENU_GAP as b,navSections as f,startMenuCategories as g,RAIL_W as x,TAB_STRIP_H as k,RAIL_COLLAPSED_INSET as y,RAIL_MAX_W as v,RAIL_MIN_W as N,navIcons as w,sectionIcons as j}from"./chunk-4LXCCZDM.js";import"./chunk-5A7MWTXX.js";import"./chunk-7QSDPSXP.js";import"./chunk-2QY5BJLA.js";import{PopupMenu as C,PopupMenuItem as S,PopupMenuDivider as L}from"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-M5K4AX4E.js";import{Icon as $}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useShellStrings as z}from"./chunk-HCDG7EUR.js";import"./chunk-C3QOHMR6.js";import{useMemo as A,useState as W,useRef as I,useEffect as T,isValidElement as H,cloneElement as D}from"react";import{jsx as R,jsxs as K,Fragment as M}from"react/jsx-runtime";var O="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),P=150,U=250;function Q(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var E=(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(" "),G="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",J="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function X({open:e,children:t}){const r=I(null);return T(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */R("div",{ref:r,className:"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",style:{gridTemplateRows:e?"1fr":"0fr",opacity:e?1:0},"aria-hidden":!e,"data-fold":e?"open":"closed",children:/* @__PURE__ */R("div",{className:"min-h-0 overflow-hidden",children:t})})}function B({open:e}){/* @__PURE__ */
2
- return R($,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function V({dir:e}){/* @__PURE__ */
3
- return R($,"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 F({className:e}){/* @__PURE__ */
4
- return R($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var Y=e=>.75+1.75*e+"rem";function Z({width:b,openWidth:P=x,collapsed:U,onToggleCollapsed:Z,onResize:_,onHome:q,onOpen:ee,activeRoute:te,profile:re,user:ne,onLogout:ie,onSwitchToDesktop:ae,onReportBug:oe,onClose:le,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=g,productName:ue,productIcon:he,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:fe=null,logoIsLight:ge=null}){const xe=z().layout,{hasAnyPerm:ke}=e(),ye=A(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=W(()=>t(r(n))),we=A(()=>[...ye.topItems.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),...[...ye.erpSections,...ye.systemSections,...ye.virtualSections,...ye.footerSections].map(e=>e.label)],[ye,ke]),je=(e,t=we)=>Ne(r=>{const i=a(r,e,t);return o(n,JSON.stringify([...i])),i}),[Ce,Se]=W(!1),Le=I(null),$e=U&&!le,[ze,Ae]=W(!1),We=I("pointer"),Ie=I(void 0),Te=I(!1),He=I(null),De=()=>{clearTimeout(Ie.current),Ie.current=void 0},Re=e=>{De(),We.current=e,Ae(!0)},Ke=()=>{De(),Ae(!1)};T(()=>{De(),Ae(!1)},[U]),T(()=>()=>De(),[]),T(()=>{if(!ze)return;const e=e=>{const t=e.target;t&&(He.current?.contains(t)||t.closest?.('[role="menu"]'))||(De(),Ae(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[ze]);const Me=U&&!ze,Oe=U&&ze?P:b,Pe=(e,t)=>{Ke(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Ue=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return R("span",{className:J,"aria-hidden":"true",children:r&&H(r)?D(r,{className:"size-[18px]"}):r})},Qe=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Ee=(e,t,r=we)=>{const n=d(e,ke),i=e.menuLabel??e.label;if(n.length>0){const a=`child:${e.to}`,o=ve.has(a),l=!o&&u(n,te,ke);/* @__PURE__ */
6
- return K("div",{children:[
7
- /* @__PURE__ */K("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:E(l,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ue(e.to,ce),
8
- /* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */R(B,{open:o})]}),
10
- /* @__PURE__ */R(X,{open:o,children:/* @__PURE__ */R("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Ee(e,t+1,Qe(n)))})}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
- return K("div",{children:[
12
- /* @__PURE__ */K("button",{type:"button",onClick:t=>Pe(e,t),onAuxClick:t=>{1===t.button&&Pe(e,t)},"aria-current":a?"page":void 0,className:E(a,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ue(e.to,ce),
13
- /* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)},Ge=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */R("span",{className:J,"aria-hidden":"true",children:e.icon}):Ue(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Me)/* @__PURE__ */
14
- return K("div",{children:[
15
- /* @__PURE__ */R("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),Re("tap")},className:E(a,!0),children:n}),o&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label);const l=ve.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
16
- return K("div",{children:[
17
- /* @__PURE__ */K("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:E(!l&&a,!1),children:[n,
18
- /* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */R(B,{open:l})]}),
20
- /* @__PURE__ */R(X,{open:l,children:/* @__PURE__ */R("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Ee(e,1,Qe(r)))})}),o&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Je=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Xe=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Be=re?.avatar_url?/* @__PURE__ */R("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */R("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:Xe}),Ve=Ce?Le.current?.getBoundingClientRect():void 0,Fe=Me?"":"px-3",Ye=Me?{paddingInline:y}:void 0,Ze=`${U?xe.expandSidebar:xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,_e=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:Z,label:U?xe.expandSidebar:xe.collapseSidebar,title:Ze},qe=/* @__PURE__ */K(M,{children:[he&&/* @__PURE__ */R(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Me&&/* @__PURE__ */K("span",{className:"min-w-0 text-left leading-tight",children:[
21
- /* @__PURE__ */R("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */R("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),et=ye.erpSections.length>0||ye.systemSections.length>0||ye.virtualSections.length>0;/* @__PURE__ */
22
- return K("aside",{ref:He,"aria-label":xe.navLabel,"data-rail-peek":ze?"":void 0,className:`fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-line bg-surface text-ink-strong ${U?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${ze?"rounded-r-(--radius-panel)":""}`,style:{width:Oe,boxShadow:ze?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(Te.current=!0,$e&&(ze?De():(De(),Ie.current=setTimeout(()=>Re("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(Te.current=!1,$e&&(De(),ze&&!Ce&&"pointer"===We.current&&(Ie.current=setTimeout(Ke,250))))},onFocus:e=>{$e&&!ze&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&Re("focus")},onBlur:e=>{if(!ze||"focus"!==We.current)return;const t=e.relatedTarget;t&&He.current?.contains(t)||Ce||Te.current||Ke()},onKeyDown:e=>{"Escape"===e.key&&ze&&Ke()},children:[
23
- /* @__PURE__ */K("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Me?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[_e?/* @__PURE__ */R("button",{type:"button",onClick:_e.run,"aria-label":_e.label,title:_e.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Me?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */R("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */R(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */R($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):U?ze&&
24
- /* @__PURE__ */R("button",{type:"button",onClick:()=>{Ke(),Z()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${O?"⌘":"Ctrl"} .)`,className:G,children:/* @__PURE__ */R(V,{dir:"right"})}):/* @__PURE__ */R("button",{type:"button",onClick:Z,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${O?"⌘":"Ctrl"} .)`,className:G,children:/* @__PURE__ */R(V,{dir:"left"})})]}),
25
- /* @__PURE__ */R("div",{className:`shrink-0 pt-3 ${Fe}`,style:Ye,children:Me?/* @__PURE__ */R("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${O?"⌘K":"Ctrl K"})`,className:E(!1,!0),children:/* @__PURE__ */R(F,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */K("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:[
26
- /* @__PURE__ */R(F,{className:"size-3.5 text-gray-500"}),
27
- /* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */R("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:O?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */K("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Fe} ${Me?"space-y-1":"space-y-0.5"}`,style:Ye,children:[Me&&/* @__PURE__ */R("button",{type:"button",onClick:Z,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${O?"⌘":"Ctrl"} .)`,className:`${E(!1,!0)} mb-3`,children:/* @__PURE__ */R(V,{dir:"right"})}),ye.topItems.map(e=>{if(!Me)return Ee(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
- return K("div",{children:[
31
- /* @__PURE__ */R("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Pe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),Re("tap")},className:E(r,!0),children:Ue(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.to)}),ye.topItems.length>0&&et&&!ye.topItems[ye.topItems.length-1].dividerAfter&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Ge(e,!1)),ye.systemSections.map(e=>Ge(e,!1)),ye.virtualSections.map(e=>Ge(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */R("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Ge(e,!1))]}),
32
- /* @__PURE__ */R("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Fe}`,style:Ye,children:/* @__PURE__ */K("button",{ref:Le,type:"button",onClick:()=>Se(e=>!e),"aria-haspopup":"menu","aria-expanded":Ce,"aria-label":Me?xe.accountMenu(Je):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Me?"justify-center py-2":"px-2 py-2"),children:[Be,!Me&&/* @__PURE__ */K("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */R("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Je}),ne?.email&&Je!==ne.email&&/* @__PURE__ */R("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),_&&!U&&!le&&/* @__PURE__ */R(l,{side:"left",width:b,onResize:_,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Ce&&Ve&&/* @__PURE__ */K(C,{portal:!0,minWidth:224,onClose:()=>{Se(!1),ze&&"pointer"===We.current&&!Te.current&&Ke()},style:Q(Oe,Ve,window.innerHeight),children:[Me&&/* @__PURE__ */K("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */R("p",{className:"truncate text-sm font-semibold text-gray-800",children:Je}),ne?.email&&/* @__PURE__ */R("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */K(S,{onClick:()=>{Se(!1),Ke(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */R($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */K(S,{onClick:()=>{Se(!1),Pe(e)},children:[
37
- /* @__PURE__ */R("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */K(S,{onClick:()=>{Se(!1),Ke(),oe()},children:[
38
- /* @__PURE__ */R($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */R(L,{}),ae&&/* @__PURE__ */K(M,{children:[
40
- /* @__PURE__ */K(S,{onClick:()=>{Se(!1),Ke(),ae()},children:[
41
- /* @__PURE__ */R($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
- /* @__PURE__ */R(L,{})]}),
43
- /* @__PURE__ */K(S,{danger:!0,onClick:()=>{Se(!1),Ke(),ie()},children:[
44
- /* @__PURE__ */R($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{U as RAIL_PEEK_CLOSE_MS,P as RAIL_PEEK_OPEN_MS,Q as accountMenuPosition,Z as default};
@@ -1,7 +0,0 @@
1
- import{writeClipboard as e}from"./chunk-WM37FXRK.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-5X3Z45SL.js";import{useShellStrings as a}from"./chunk-HCDG7EUR.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
- return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":R,className:C=""}){const[S,B]=i(!1),T=o(null),V=a().copy;c(()=>()=>{T.current&&clearTimeout(T.current)},[]);const D=l(async()=>{await e(t)?(B(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{B(!1),T.current=null},2e3),w?.(t)):n.error(V.failed)},[t,w,V]),{box:L,button:X}=p[g],z=!v;/* @__PURE__ */
4
- return m("div",{id:z?void 0:j,"aria-describedby":z?void 0:R,className:["inline-flex max-w-full items-center rounded-md",u[k],L,C].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
- /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:t,children:y??t}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?V.copyLabel(x):V.copy,"aria-describedby":R,onClick:D,className:`${X} text-gray-400`,children:/* @__PURE__ */s(S?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:S?V.copied:""})]})]})}export{y as Snippet};
@@ -1,12 +0,0 @@
1
- import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as a}from"./chunk-VFC6QUEN.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-HCDG7EUR.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=y??(e=>m(e,w)),E=b??C.nothingToPlot,P=h(),[T,U]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:E});const F=v/2,H=v/2,I=v/2-10,Q=x??Math.max(...g.map(e=>e.value),1),V="track"===k?Math.max(6,(I-.16*v)/g.length):0,W=Math.max(1,Math.floor((I-.16*v)/V||1)),Y="track"===k?g.slice(0,W):g,z=Math.min(j,Math.max(1,V-2)),A=r(Y.length,.03),B=null!==T?Y[T]:void 0;/* @__PURE__ */
2
- return d("div",{className:`relative ${N??""}`,children:[
3
- /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":P,onMouseLeave:()=>U(null),children:[
4
- /* @__PURE__ */p("title",{id:P,children:"track"===k?C.radialTrack(Y.length):C.radialCycle(Y.length)}),Y.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/Q)),c=((e,t)=>null!==T?T!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=I-r*V,m=o-V+z,h=-Math.PI/2;/* @__PURE__ */
5
- return d("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),className:M?e.sweep:void 0,style:M?t(r,70):void 0,children:[
6
- /* @__PURE__ */p("path",{d:a(F,H,m,o,h,h+f),fill:i.grid}),
7
- /* @__PURE__ */p("path",{d:a(F,H,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
- return p("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),children:/* @__PURE__ */p("path",{d:a(F,H,m,m+(I-m)*s,A(r),A(r)+A.step),fill:n})},l.key)})]}),B&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(n,{title:B.label,rows:[{key:"value",label:C.value,color:o(T,B.color,B.tone),value:R(B.value)}]})}),
9
- /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
10
- /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
11
- /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
12
- /* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:R(e.value)})]},e.key))})]})}export{g as RadialBarChart};
@@ -1,22 +0,0 @@
1
- import{ChartDefs as t,MOTION as e,stagger as a,fillFor as r,dashFor as o,maskId as l}from"./chunk-465RRWBY.js";import{ChartBrush as n}from"./chunk-TIYRBJSB.js";import{ChartDot as i}from"./chunk-CK2YOGUS.js";import{ChartSkeleton as s}from"./chunk-QT34GMZR.js";import{stepPath as c,curvePath as d,areaBetween as m,areaFrom as h}from"./chunk-VFC6QUEN.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-U22563X2.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as R}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as V,CHART_INK as z,STATUS_VARS as A}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as S}from"./chunk-TWVUQUUD.js";import{useShellStrings as W,useShellLocale as C}from"./chunk-HCDG7EUR.js";import{formatPercent as D,formatPlain as E}from"./chunk-C3QOHMR6.js";import{useRef as L,useState as T,useId as U,useEffect as I}from"react";import{jsx as P,jsxs as B}from"react/jsx-runtime";var F=12,O=16,Q=26,Y=52,G=t=>"number"==typeof t&&Number.isFinite(t);function H({series:H,labels:Z,height:J=200,stacked:K=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=W().charts,Rt=C(),Vt=rt??(t=>E(t,Rt)),zt=ot??Vt,At=jt??$t.noData,St=L(null),Wt=x(St),Ct=Nt??Wt,[Dt,Et]=T(null),[Lt,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Pt=ut??Lt,Bt=p(ht&&Pt?Pt[1]-Pt[0]+1:Z.length,pt);if(I(()=>{if(null!==Dt)return S(t=>"Escape"===t.key&&(Et(null),!0))},[Dt]),kt)/* @__PURE__ */
2
- return P("div",{className:wt,ref:St,children:/* @__PURE__ */P(s,{height:J,width:Nt??Wt})});const Ft=Z,Ot=ut??Lt??[0,Math.max(0,Ft.length-1)],[Qt,Yt]=Ot,Gt=t=>Bt.slice(ht?t.slice(Qt,Yt+1):t),Ht=lt?Gt(lt):void 0,Zt=H.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(G)).map(t=>({...t,data:Gt(t.data),pointTones:t.pointTones?Gt(t.pointTones):void 0})),Jt=t=>(ht?Qt:0)+(Bt.view?.[0]??0)+t;if(Z=Gt(Ft),0===Zt.length||0===Z.length)/* @__PURE__ */
3
- return P("div",{className:wt,ref:St,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:J},children:At})});const Kt=Z.map((t,e)=>Zt.reduce((t,a)=>t+(G(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Kt[e]>0?t/Kt[e]:null,qt=[];if(K){let t=Z.map(()=>0);for(const e of Zt)t=t.map((t,a)=>t+(G(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!K&&!_t&&void 0===et&&Zt.some(te)&&Zt.some(t=>!te(t)),ae=gt&&!K?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Zt.filter(t=>!te(t)):Zt).filter(t=>!re(t)),le=ee?Zt.filter(te).flatMap(t=>t.data.filter(G)):[],ne=K?(qt.at(-1)??[]).filter(G):oe.flatMap(t=>t.data.filter(G)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:K&&"percent"===X||_t||void 0!==et?null:b(K?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=K&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=K&&"percent"===X?t=>D(Math.round(100*t),0,Rt):Vt,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),Y),fe=ie?w(ie.right.ticks.map(Vt),O):O,pe={left:ue,right:Math.max(ue+1,Ct-fe),top:F,bottom:J-Q},ge=j(Z.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Zt.filter(re),Me=Math.max(0,...Z.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Re=t=>e=>{e.preventDefault(),Et(e=>{const a=(e??0)+t;return Math.min(Z.length-1,Math.max(0,a))})},Ve=Math.max(1,Math.ceil(Z.length/Math.max(1,Math.floor(Ct/96))));/* @__PURE__ */
4
- return B("div",{className:`relative ${wt??""}`,ref:St,children:[
5
- /* @__PURE__ */B("svg",{width:"100%",height:J,viewBox:`0 0 ${Ct} ${J}`,role:"img","aria-label":$t.overIntervals(Zt.map(t=>t.label),Z.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Et(null),onBlur:()=>Et(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Dt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Jt(Dt));"ArrowRight"===t.key&&Re(1)(t),"ArrowLeft"===t.key&&Re(-1)(t)},children:[
6
- /* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
7
- /* @__PURE__ */P(t,{id:It,fills:Zt.map((t,e)=>({color:V(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:K?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:z.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
8
- /* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:z.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:z.label,children:nt}),
9
- /* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${l(It)})`:void 0,children:Zt.map((t,l)=>{const n=V(t.slot,t.color,t.tone),i=t.mode??(K?"area":"line"),s=f(t.key,Ut);if("step"===i){const e=Z.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>G(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
- return P("path",{d:c(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},t.key)}const u=Z.map((e,a)=>{const r=K?qt[l]?.[a]:t.data[a];return G(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===i){const r=Math.max(1,.62*ge.bandwidth),o="solid"===t.fillVariant,i=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:Z.map((e,a)=>{const i=t.data[a];if(!G(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Zt[t]?.key)).reduce((t,a)=>t+Math.max(0,G(a.data[e])?a.data[e]:0),0))(l,a),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
- return P("rect",{x:ge.center(a)-r/2,y:c,width:r,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[a]?A[t.pointTones[a]]:n,fillOpacity:o?1:.55},a)})},t.key):/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:Z.map((s,c)=>{const d=K?qt[l]?.[c]:t.data[c];if(!G(d))return null;const m=i(d);/* @__PURE__ */
12
- return P("rect",{x:ge.center(c)-r/2,y:Math.min(m,xe),width:r,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:o?1:.35,className:xt?e.rise:void 0,style:xt?a(c,26):void 0},c)})},t.key)}const p=d(u,_,tt),g=K&&l>0?Z.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?m(p,g):h(p,u,xe);/* @__PURE__ */
13
- return B("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===i||K)&&
14
- /* @__PURE__ */P("path",{d:y,fill:r(It,l,t.fillVariant??bt,n),stroke:"none"}),
15
- /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:o(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?e.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??A[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
16
- return B("g",{children:[
17
- /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Zt.map((t,e)=>{if("column"===t.mode)return null;const a=ct??(st?"last":"none"),r=V(t.slot,t.color,t.tone),o=[...t.data].map(G).lastIndexOf(!0),l="all"===a?Z.map((t,e)=>e).filter(a=>G(K?qt[e]?.[a]:t.data[a])):o>=0?[o]:[];/* @__PURE__ */
18
- return B("g",{children:[l.map(a=>{const l=K?qt[e]?.[a]:t.data[a];return G(l)?/* @__PURE__ */P(i,{cx:ge.center(a),cy:je(t)(l),color:r,variant:dt,pulse:mt&&a===o,title:`${Z[a]}: ${t.label} ${Vt(l)}`},a):null}),st&&o>=0&&G(K?qt[e]?.[o]:t.data[o])&&/* @__PURE__ */P("text",{x:ge.center(o)-10,y:je(t)(K?qt[e]?.[o]:t.data[o])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(K?qt[e]?.[o]:t.data[o])})]},`dots-${t.key}`)}),Z.map((t,e)=>e%Ve===0?/* @__PURE__ */P("text",{x:ge.center(e),y:J-8,textAnchor:"middle",fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Dt&&/* @__PURE__ */P("line",{x1:ge.center(Dt),y1:pe.top,x2:ge.center(Dt),y2:pe.bottom,stroke:z.axis,strokeWidth:1}),ae&&Me>0&&
19
- /* @__PURE__ */B("g",{pointerEvents:"none","data-column-strip":"true",children:[
20
- /* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:z.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
21
- /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:z.label,style:{fontVariantNumeric:"tabular-nums"},children:Vt(Me)})]}),Bt.drag&&/* @__PURE__ */P(g,{x0:ge(Bt.drag[0]),x1:ge(Bt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),Z.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Et(e),onPointerDown:()=>Bt.press(e),onPointerEnter:()=>Bt.over(e),onPointerUp:Bt.release,onClick:yt?()=>yt(Jt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Bt.view&&/* @__PURE__ */P(y,{from:Ht?.[0]??Z[0],to:Ht?.at(-1)??Z[Z.length-1],count:Z.length,total:K&&"percent"!==X?zt(Kt.reduce((t,e)=>t+e,0)):ae?zt(be.reduce((t,e)=>t+e.data.filter(G).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Zt).filter(t=>t.data.some(G)).map(t=>{const e=t.data.filter(G),a=V(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=K||"column"===t.mode?zt(r):$t.zoomLevel(zt(r/e.length),zt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Bt.clear}),ht&&Ft.length>2&&/* @__PURE__ */P(n,{className:"mt-1",labels:Ft,width:Ct,data:H[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Dt&&
22
- /* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Dt),ge.bandwidth,Ct),children:/* @__PURE__ */P(R,{title:Ht?.[Dt]??Z[Dt],rows:Zt.map((t,e)=>({key:t.key,label:t.label,color:V(t.slot,t.color,t.tone),value:G(t.data[Dt])?K&&"percent"===X?`${D(100*(Xt(t.data[Dt],Dt)??0),1,Rt)} · ${zt(t.data[Dt])}`:zt(t.data[Dt]):void 0})),footnote:K&&"percent"===X?$t.inBucket(zt(Kt[Dt])):void 0})})]})}export{H as TimeSeriesChart};
@@ -1,9 +0,0 @@
1
- import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-CIOPLPZW.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-HCDG7EUR.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},D={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function W(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function P({onClose:e}){const t=b().dialog;/* @__PURE__ */
2
- return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function S({open:u,onClose:b,side:S="right",size:G="md",title:H,description:I,footer:U,children:V,blocking:E=!1,dirty:O=!1,initialFocus:R,"aria-label":z,"aria-labelledby":B,"aria-describedby":F,className:L=""}){const Q=g(null),T=x(),Y=x(),Z=x(),A=e(p()),[J,X]=y(null),$=a({open:u,dirty:O,onClose:b,title:H,layer:J}),q=g(null),K=t(u&&null!==A,q),M=r(u&&null!==A,q),_=i(M,J),ee=o(M),te=null!==M.host;if(c(u),m(Q,u&&null!==A,R,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(E||$(),!0),()=>Q.current)},[u,E,$,_]),!u||!A)return null;const re="bottom"===S,ie={...re?{maxHeight:"85vh"}:{},...K?W(S,K):{}};/* @__PURE__ */
3
- return k(N,{children:[/* @__PURE__ */j("span",{ref:q,hidden:!0,"data-popup-anchor":""}),w(
4
- /* @__PURE__ */j(n,{value:J,children:/* @__PURE__ */k("div",{ref:X,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(M),role:"presentation","data-overlay-layer":"",children:[
5
- /* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(M)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:E?void 0:$,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
6
- /* @__PURE__ */k("div",{ref:Q,...d({modal:!0,titleId:H?Z:void 0,labelledBy:B,label:z}),"aria-describedby":F??(I?Y:V?T:void 0),"data-drawer-side":S,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[G]}`,K?"":D[S],re?"rounded-t-xl":"",L].filter(Boolean).join(" "),children:[H?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
7
- /* @__PURE__ */k("div",{className:"min-w-0",children:[
8
- /* @__PURE__ */j("h2",{id:Z,className:"text-base font-semibold text-gray-900",children:H}),I&&/* @__PURE__ */j("p",{id:Y,className:"mt-0.5 text-sm text-gray-500",children:I})]}),!E&&/* @__PURE__ */j(P,{onClose:$})]}):!E&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(P,{onClose:$})}),
9
- /* @__PURE__ */k("div",{id:T,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[I&&!H&&/* @__PURE__ */j("p",{id:Y,className:("mb-3 text-sm text-gray-500 "+(E?"":"pr-8")).trim(),children:I}),V]}),U&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:U})]})]})}),A)]})}export{S as Drawer};
@@ -1 +0,0 @@
1
- var r="12.30.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,20 +0,0 @@
1
- import{Pagination as e}from"./chunk-HU24RSAE.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-G67CJAQ2.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-HCDG7EUR.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
2
- return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
3
- /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
4
- /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:H,rowClassName:z,onRow:T,rowHref:A,onRowPress:E,linkAs:I,emptyText:R,selection:D,footer:F,virtualized:L,stackOnNarrow:O=!1,stackBelow:P,className:G=""}){const K=s(),W=R??K.table.empty,J=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),U=O&&!L,Z=U?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),Q=e=>U?{role:e}:{},V=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[q,X]=i(0),Y=L?.overscan??6,_=L?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/L.rowHeight)-Y);X(e=>e===t?e:t)}:void 0,ee=L?Math.ceil(L.height/L.rowHeight)+2*Y:v.length,te=L?Math.min(q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=L?te*L.rowHeight:0,ne=L?(v.length-re)*L.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!L)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=Z.flatMap(e=>m(e)?e.columns:[e]),he=Z.some(m),ue=/* @__PURE__ */new Map;if(U)for(const e of Z)if(m(e))for(const t of e.columns)ue.set(t,V(e.title,e.label));const me=e=>{const t=V(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(D?.selected??[]),ge=D?v.map((e,t)=>J(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=D?36:0,we=de.length+(D?1:0),xe=de.some(e=>"left"===e.fixed),ve=U&&!D&&de.some(e=>e.cardCorner),ke=I??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
- return h("th",{scope:"col",...Q("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...L?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?L?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":L?"sticky z-10 bg-gray-50":"",U&&d?"rosh-dt-sort":"",U?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":U?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
6
- /* @__PURE__ */h(n,{children:e.title}),
7
- /* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
8
- /* @__PURE__ */c("div",{onScroll:_,style:L?{maxHeight:L.height}:void 0,className:`relative overflow-x-auto ${L?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${U?" rosh-dt-scroll":""}`.trim(),children:[B&&
9
- /* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
10
- /* @__PURE__ */h(r,{className:"h-6 w-6"}),
11
- /* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
12
- /* @__PURE__ */c("table",{...Q("table"),className:(U?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:H?{minWidth:H}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
13
- /* @__PURE__ */c("thead",{...Q("rowgroup"),className:U?"rosh-dt-head":void 0,children:[
14
- /* @__PURE__ */c("tr",{ref:le,...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:[D&&/* @__PURE__ */h("th",{scope:"col",...Q("columnheader"),rowSpan:he?2:void 0,style:{width:36,...L?{top:0}:{}},className:[Ne,o,xe||L?"sticky z-20 bg-gray-50":"",xe?"left-0":"",U?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!D)return;const e=new Set(ge);D.onChange(pe?D.selected.filter(t=>!e.has(t)):[...D.selected,...ge.filter(e=>!fe.has(e))])}})}),Z.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...Q("columnheader"),colSpan:e.columns.length,style:L?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",L?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:Z.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
- /* @__PURE__ */h("tbody",{...Q("rowgroup"),className:U?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=T?.(e,o),l=!!n?.current,s=A?.(e,o),i=void 0===s&&E?()=>E(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
- return c("tr",{...u(n),...Q("row"),style:L?{height:L.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[U?D?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",U&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",z?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[D&&(()=>{const r=J(e,o);/* @__PURE__ */
17
- return h("td",{...Q("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",U?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{D&&D.onChange(fe.has(e)?D.selected.filter(t=>t!==e):[...D.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=U&&!n&&"wide"!==e.only;/* @__PURE__ */
18
- return h("td",{...Q("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",U?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],U?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:U?
19
- /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},J(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...Q("row"),className:U?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...Q("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),F]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:U?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
- return h("div",U?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${G}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${G}`.trim(),children:Se}:{className:G,children:Se})}export{x as DataTable};
@@ -1 +0,0 @@
1
- var t="react-os-shell:pdf-preview-update",n=null,e=0;function a(a){const d=++e,o={token:d,data:a};return n=o,{update(e){n===o&&(o.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t,{detail:{token:d,data:e}}))}}}function d(){return n}function o(t){n===t&&(n=null)}export{t as PDF_PREVIEW_UPDATE_EVENT,o as claimPdfPreviewStage,d as peekPdfPreviewStage,a as setPdfPreview};