efficient-shell 13.14.0 → 13.16.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 (301) hide show
  1. package/README.md +21 -2
  2. package/dist/Browser-4KWGT3FG.js +44 -0
  3. package/dist/Calculator-VURS4NAT.js +29 -0
  4. package/dist/CurrencyConverter-X5ENBDLK.js +21 -0
  5. package/dist/{Files-XLDCJ7DO.js → Files-NT76VUHQ.js} +64 -64
  6. package/dist/Notepad-6AMNAYQQ.js +24 -0
  7. package/dist/PomodoroTimer-KDXH5M3Q.js +91 -0
  8. package/dist/{Preview-24XTJDIR.js → Preview-QNJD5PVD.js} +27 -27
  9. package/dist/Sidebar-UCCVJFSY.js +44 -0
  10. package/dist/Stock-JR77FPOD.js +16 -0
  11. package/dist/{Weather-IWM5XTE5.js → Weather-MGSDU3M5.js} +18 -18
  12. package/dist/{WorldClock-35TNXAJM.js → WorldClock-GGAYPYIO.js} +7 -7
  13. package/dist/ai/index.js +44 -44
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/charts/ChartFrame.js +1 -1
  20. package/dist/charts/ChordChart.js +1 -1
  21. package/dist/charts/FlowChart.js +1 -1
  22. package/dist/charts/PieChart.js +1 -1
  23. package/dist/charts/RadarChart.js +1 -1
  24. package/dist/charts/RadialBarChart.js +1 -1
  25. package/dist/charts/SankeyChart.js +1 -1
  26. package/dist/charts/SpecChart.js +1 -1
  27. package/dist/charts/SunburstChart.js +1 -1
  28. package/dist/charts/TimeSeriesChart.js +1 -1
  29. package/dist/charts/TreemapChart.js +1 -1
  30. package/dist/{chunk-UGEA3C5C.js → chunk-23LK4PLJ.js} +5 -5
  31. package/dist/{chunk-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
  32. package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
  33. package/dist/{chunk-36UB4MJX.js → chunk-4G7PJ325.js} +1 -1
  34. package/dist/chunk-5URXJCNC.js +2 -0
  35. package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
  36. package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
  37. package/dist/chunk-74SCWPQF.js +1 -0
  38. package/dist/{chunk-QTVE3OSD.js → chunk-75R3EKWZ.js} +7 -7
  39. package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
  40. package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
  41. package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
  42. package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
  43. package/dist/{chunk-JPKNVTTK.js → chunk-BNPWUCZX.js} +1 -1
  44. package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
  45. package/dist/{chunk-ALHYNNE2.js → chunk-BVX7LUAW.js} +6 -6
  46. package/dist/chunk-BWJZTHZ6.js +1 -0
  47. package/dist/chunk-BWQHABH7.js +4 -0
  48. package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
  49. package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
  50. package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
  51. package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
  52. package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
  53. package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
  54. package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
  55. package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
  56. package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
  57. package/dist/chunk-EX3DARI3.js +7 -0
  58. package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
  59. package/dist/chunk-F2RAIGCG.js +6 -0
  60. package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
  61. package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
  62. package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
  63. package/dist/chunk-FMLUQCFB.js +2 -0
  64. package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
  65. package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
  66. package/dist/chunk-G2JPTPRS.js +13 -0
  67. package/dist/chunk-G5UGCAWN.js +17 -0
  68. package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
  69. package/dist/chunk-GMLOMLCS.js +24 -0
  70. package/dist/{chunk-QNQLKGBC.js → chunk-GNXAVDZD.js} +1 -1
  71. package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
  72. package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
  73. package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
  74. package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
  75. package/dist/{chunk-FUP2J2OX.js → chunk-IG3K6AGW.js} +1 -1
  76. package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
  77. package/dist/{chunk-RT77WNRB.js → chunk-IJJNJJ6I.js} +1 -1
  78. package/dist/chunk-IUQJGFEO.js +11 -0
  79. package/dist/{chunk-64PPKUJG.js → chunk-J4CVYOY3.js} +13 -13
  80. package/dist/{chunk-HTANBHNV.js → chunk-J4KPBR5B.js} +1 -1
  81. package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
  82. package/dist/{chunk-775K6APE.js → chunk-JFOMAXD2.js} +67 -67
  83. package/dist/chunk-JPE4TYRQ.js +14 -0
  84. package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
  85. package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
  86. package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
  87. package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
  88. package/dist/{chunk-YNVH2EIE.js → chunk-L4ZQY4ZG.js} +3 -3
  89. package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
  90. package/dist/chunk-LQCNIQ3I.js +8 -0
  91. package/dist/{chunk-RZJ63ZM4.js → chunk-MHQW6NAE.js} +11 -11
  92. package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
  93. package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
  94. package/dist/chunk-N5KJLHYI.js +9 -0
  95. package/dist/{chunk-YBYJUBWE.js → chunk-NW5NSV7N.js} +2 -2
  96. package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
  97. package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
  98. package/dist/{chunk-YY7OFUT2.js → chunk-OIEFMLYI.js} +3 -3
  99. package/dist/{chunk-FMERX3PG.js → chunk-OLSA36VX.js} +2 -2
  100. package/dist/chunk-OMOAD5LL.js +1 -0
  101. package/dist/chunk-OXWBSZL2.js +23 -0
  102. package/dist/chunk-PBSCF2ML.js +15 -0
  103. package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
  104. package/dist/{chunk-GTT7LIWK.js → chunk-PY4DTB6Y.js} +1 -1
  105. package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
  106. package/dist/chunk-QAAHFU2I.js +1 -0
  107. package/dist/{chunk-OYXA7SWV.js → chunk-QE2JX7D4.js} +1 -1
  108. package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
  109. package/dist/{chunk-WIFK6TLB.js → chunk-RDETBXMP.js} +1 -1
  110. package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
  111. package/dist/chunk-RJVIKGHJ.js +4 -0
  112. package/dist/chunk-S25KELFW.js +11 -0
  113. package/dist/chunk-SF4IIV5Z.js +2 -0
  114. package/dist/{chunk-ZDYIVU5R.js → chunk-SHHRC5XK.js} +8 -8
  115. package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
  116. package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
  117. package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
  118. package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
  119. package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
  120. package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
  121. package/dist/chunk-THAPVKEJ.js +15 -0
  122. package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
  123. package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
  124. package/dist/{chunk-EHM3ZVVT.js → chunk-UC5IC3AM.js} +4 -4
  125. package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
  126. package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
  127. package/dist/chunk-UTQN5AIO.js +6 -0
  128. package/dist/chunk-UVHXVSB2.js +1 -0
  129. package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
  130. package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
  131. package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
  132. package/dist/{chunk-G3MJO3A6.js → chunk-W6NGPSMM.js} +13 -13
  133. package/dist/chunk-WCCS4VFE.js +1 -0
  134. package/dist/{chunk-JWLOERV5.js → chunk-WLBWACKP.js} +2 -2
  135. package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
  136. package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
  137. package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
  138. package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
  139. package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
  140. package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
  141. package/dist/chunk-XXTAMF3O.js +28 -0
  142. package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
  143. package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
  144. package/dist/{chunk-KBQNMQCK.js → chunk-YQ5JHHLE.js} +1 -1
  145. package/dist/{chunk-2GMYO6ET.js → chunk-YT5HMLC7.js} +1 -1
  146. package/dist/chunk-YTDMCUL7.js +14 -0
  147. package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
  148. package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
  149. package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
  150. package/dist/chunk-ZDXRSY2Y.js +1 -0
  151. package/dist/chunk-ZISKHQZY.js +3 -0
  152. package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
  153. package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.js} +1 -1
  154. package/dist/data/DataTable.js +1 -1
  155. package/dist/data/EntityList.js +1 -1
  156. package/dist/data/Gantt.js +1 -1
  157. package/dist/data/Kanban.js +1 -1
  158. package/dist/data/ListLoadError.js +1 -1
  159. package/dist/data/ResizableTable.js +1 -1
  160. package/dist/data/statusColumn.js +1 -1
  161. package/dist/data/useColumnConfig.js +1 -1
  162. package/dist/data/useSort.js +1 -1
  163. package/dist/forms/AlignmentGrid.js +1 -1
  164. package/dist/forms/BorderInput.js +1 -1
  165. package/dist/forms/BrandAssetEditor.js +1 -1
  166. package/dist/forms/Button.js +1 -1
  167. package/dist/forms/Calendar.js +1 -1
  168. package/dist/forms/ColorPicker.js +1 -1
  169. package/dist/forms/ComposerAttachments.js +1 -1
  170. package/dist/forms/CornersInput.js +1 -1
  171. package/dist/forms/DatePicker.js +1 -1
  172. package/dist/forms/DateRangePicker.js +1 -1
  173. package/dist/forms/DisplayChips.js +1 -1
  174. package/dist/forms/FilePicker.js +1 -1
  175. package/dist/forms/IconButton.js +1 -1
  176. package/dist/forms/IconPicker.js +1 -1
  177. package/dist/forms/Input.js +1 -1
  178. package/dist/forms/InputNumber.js +1 -1
  179. package/dist/forms/LinkPicker.js +1 -1
  180. package/dist/forms/MediaLibrary.js +1 -1
  181. package/dist/forms/MediaUploadField.js +1 -1
  182. package/dist/forms/MediaUploadGrid.js +1 -1
  183. package/dist/forms/MediaUsedInList.js +1 -1
  184. package/dist/forms/NumericKeypad.js +1 -1
  185. package/dist/forms/PictureTiles.js +1 -1
  186. package/dist/forms/PositionInput.js +1 -1
  187. package/dist/forms/RenameField.js +1 -1
  188. package/dist/forms/Segmented.js +1 -1
  189. package/dist/forms/Select.js +1 -1
  190. package/dist/forms/SidesInput.js +1 -1
  191. package/dist/forms/Slider.js +1 -1
  192. package/dist/forms/Snippet.js +1 -1
  193. package/dist/forms/SplitButton.js +1 -1
  194. package/dist/forms/TagInput.js +1 -1
  195. package/dist/forms/TextToolbar.js +1 -1
  196. package/dist/forms/UnitMenu.js +1 -1
  197. package/dist/forms/WidthsBar.js +1 -1
  198. package/dist/forms/dropdownPosition.js +1 -1
  199. package/dist/hooks/index.d.ts +29 -0
  200. package/dist/hooks/index.js +2 -0
  201. package/dist/hooks/useTheme.js +1 -1
  202. package/dist/icons/brands.node.js +1 -1
  203. package/dist/icons/efficient-glyphs.js +1 -1
  204. package/dist/icons/efficient-looks.js +1 -1
  205. package/dist/icons/efficient.js +1 -1
  206. package/dist/icons/index.js +1 -1
  207. package/dist/icons/looks/map.js +1 -1
  208. package/dist/icons/sets.js +1 -1
  209. package/dist/index.d.ts +3 -40
  210. package/dist/index.js +514 -514
  211. package/dist/map/index.js +7 -7
  212. package/dist/markdown/index.js +1 -1
  213. package/dist/page-tabs/index.js +5 -5
  214. package/dist/shell/AppUpdateBanner.js +1 -1
  215. package/dist/shell/Card.js +1 -1
  216. package/dist/shell/ColoredBadge.js +1 -1
  217. package/dist/shell/ConfirmDialog.js +1 -1
  218. package/dist/shell/ContextMenu.js +1 -1
  219. package/dist/shell/Dialog.d.ts +14 -4
  220. package/dist/shell/Dialog.js +1 -1
  221. package/dist/shell/Drawer.js +1 -1
  222. package/dist/shell/DropdownMenu.js +1 -1
  223. package/dist/shell/EditableGrid.js +1 -1
  224. package/dist/shell/FloatingBar.js +1 -1
  225. package/dist/shell/GlobalSearch.js +1 -1
  226. package/dist/shell/HelpCenter.js +1 -1
  227. package/dist/shell/IconRail.js +1 -1
  228. package/dist/shell/ImageLightbox.js +1 -1
  229. package/dist/shell/ItemCount.js +1 -1
  230. package/dist/shell/Kbd.js +1 -1
  231. package/dist/shell/LanguageSelect.js +1 -1
  232. package/dist/shell/Markdown.js +1 -1
  233. package/dist/shell/MilestoneTimeline.js +1 -1
  234. package/dist/shell/Popover.js +1 -1
  235. package/dist/shell/PopupMenu.js +1 -1
  236. package/dist/shell/ProductionTimeline.js +1 -1
  237. package/dist/shell/ResizeHandle.js +1 -1
  238. package/dist/shell/SearchableSelect.js +1 -1
  239. package/dist/shell/SettingReset.js +1 -1
  240. package/dist/shell/SettingRow.js +1 -1
  241. package/dist/shell/ShellPrefs.js +1 -1
  242. package/dist/shell/SidebarLayout.js +1 -1
  243. package/dist/shell/SidebarNav.js +1 -1
  244. package/dist/shell/SortableList.js +1 -1
  245. package/dist/shell/StatusBadge.js +1 -1
  246. package/dist/shell/Tabs.js +1 -1
  247. package/dist/shell/TimelineTrack.js +1 -1
  248. package/dist/shell/Tooltip.js +1 -1
  249. package/dist/shell/TopNav.js +1 -1
  250. package/dist/shell/TransferProgress.js +1 -1
  251. package/dist/shell/Tree.js +1 -1
  252. package/dist/shell/discardGuard.js +1 -1
  253. package/dist/telemetry/index.js +1 -1
  254. package/dist/templates/AuthScreen.js +1 -1
  255. package/dist/templates/ChatTemplate.js +1 -1
  256. package/dist/templates/CheckoutTemplate.js +1 -1
  257. package/dist/templates/DashboardTemplate.js +1 -1
  258. package/dist/templates/DataTablePage.js +1 -1
  259. package/dist/templates/EmailTemplate.js +1 -1
  260. package/dist/templates/ErrorBoundary.js +1 -1
  261. package/dist/templates/FormLayoutPage.js +1 -1
  262. package/dist/templates/GalleryTemplate.js +1 -1
  263. package/dist/ui/index.js +1 -1
  264. package/dist/ui.css +4 -1
  265. package/dist/version.js +1 -1
  266. package/package.json +6 -1
  267. package/dist/Browser-FJSOZLWR.js +0 -44
  268. package/dist/Calculator-ZHINQHFI.js +0 -29
  269. package/dist/CurrencyConverter-AAXS7RPC.js +0 -21
  270. package/dist/Notepad-NENKOSXJ.js +0 -24
  271. package/dist/PomodoroTimer-XKSYNHS7.js +0 -91
  272. package/dist/Sidebar-GYGYAXS2.js +0 -44
  273. package/dist/Stock-TCQSVSSY.js +0 -16
  274. package/dist/chunk-3DSGJIC7.js +0 -7
  275. package/dist/chunk-47UTEV3P.js +0 -23
  276. package/dist/chunk-4S3E3VJH.js +0 -11
  277. package/dist/chunk-64RHGJXK.js +0 -4
  278. package/dist/chunk-6AUQWWUA.js +0 -17
  279. package/dist/chunk-7KWYVQMX.js +0 -2
  280. package/dist/chunk-7QSDPSXP.js +0 -1
  281. package/dist/chunk-A7ZYFJ6V.js +0 -28
  282. package/dist/chunk-ASDYAASN.js +0 -3
  283. package/dist/chunk-D65T4H6J.js +0 -1
  284. package/dist/chunk-DQTYV6AC.js +0 -9
  285. package/dist/chunk-EV5BEEVO.js +0 -1
  286. package/dist/chunk-FHNQC2MA.js +0 -1
  287. package/dist/chunk-FQD6P6EZ.js +0 -4
  288. package/dist/chunk-GOAFMGUI.js +0 -15
  289. package/dist/chunk-IQDHVQAQ.js +0 -14
  290. package/dist/chunk-JGKDWDVM.js +0 -27
  291. package/dist/chunk-KY3KGRGC.js +0 -1
  292. package/dist/chunk-MHCNQKEK.js +0 -4
  293. package/dist/chunk-RDGXSAOD.js +0 -2
  294. package/dist/chunk-RIG5FEVS.js +0 -1
  295. package/dist/chunk-SNHBDP4X.js +0 -15
  296. package/dist/chunk-SOZCWT6I.js +0 -6
  297. package/dist/chunk-WWCAVO3R.js +0 -14
  298. package/dist/chunk-XMFJDT6Y.js +0 -13
  299. package/dist/chunk-XSHDPG45.js +0 -9
  300. package/dist/chunk-YUDBB7VC.js +0 -11
  301. /package/dist/{chunk-JR2HHKVP.js → chunk-FRCTA5FS.js} +0 -0
@@ -1,91 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-GTT7LIWK.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,pomodoroToday as u,migratePomodoroTasksOnce as d,pomoSwitchMode as m,pomoPause as h,pomoStart as p,ALARM_OPTIONS as g,playAlarm as k,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-RFR2K7JO.js";import{PLACEHOLDER_INK as x}from"./chunk-AYZY3YNC.js";import{formatTime as v}from"./chunk-NHKT5IH6.js";import"./chunk-36BRD5J3.js";import"./chunk-JRQMX4PK.js";import{pad2 as y}from"./chunk-LF27WIN2.js";import{useWidgetSettings as N}from"./chunk-775K6APE.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import"./chunk-JGKDWDVM.js";import"./chunk-FQD6P6EZ.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-RIG5FEVS.js";import"./chunk-JR2HHKVP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as C}from"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as S}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./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"./chunk-VQ35LXDC.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as j,useEffect as w,useMemo as B,useState as M,useRef as T,useCallback as P}from"react";import{jsxs as I,Fragment as D,jsx as A}from"react/jsx-runtime";var V="pomodoro_appearance",L="pomodoro_active_task_id",R={focus:"Pomodoro",short:"Short Break",long:"Long Break"},W={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var $=25,F=5,E=15,K=!1,G=!1,J=4,O=!0,Q=!0,U="bell",H=100,Z=1,_="none",X=50,Y=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function z(){const t=j(o,a,a),{prefs:k,save:b}=C(),x=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:Y(t.focusMinutes,1,120,$),shortBreakMinutes:Y(t.shortBreakMinutes,1,120,F),longBreakMinutes:Y(t.longBreakMinutes,1,120,E),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:K,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:G,longBreakInterval:Y(t.longBreakInterval,1,20,J),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:O,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:Q,alarmSound:g.some(e=>e.id===t.alarmSound)?t.alarmSound:U,alarmVolume:Y(t.alarmVolume,0,100,H),alarmRepeat:Y(t.alarmRepeat,1,5,Z),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:_,focusVolume:Y(t.focusVolume,0,100,X)}}(k.pomodoro_settings);w(()=>{n({focus:60*x.focusMinutes,short:60*x.shortBreakMinutes,long:60*x.longBreakMinutes})},[x.focusMinutes,x.shortBreakMinutes,x.longBreakMinutes]),w(()=>{r(x.alarmSound),s(x.alarmVolume,x.alarmRepeat)},[x.alarmSound,x.alarmVolume,x.alarmRepeat]),w(()=>{i({autoStartBreaks:x.autoStartBreaks,autoStartPomodoros:x.autoStartPomodoros,longBreakInterval:x.longBreakInterval})},[x.autoStartBreaks,x.autoStartPomodoros,x.longBreakInterval]),w(()=>{l(x.focusSound,x.focusVolume)},[x.focusSound,x.focusVolume]),w(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const z=c(),ee=z.tasks,te=B(()=>u(),[]),oe=function(e,t){return B(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(B(()=>ee.filter(e=>!!e.dueDate&&(e.dueDate===te||e.dueDate<te&&!e.done)),[ee,te]),x.checkToBottom),[ae,ne]=M(()=>localStorage.getItem(L)),[re,se]=M(!1),[ie,le]=M(null),ce=T(!1);w(()=>{ce.current||(ce.current=!0,d(ee,z.setAllTasks))},[]),w(()=>{try{ae?localStorage.setItem(L,ae):localStorage.removeItem(L)}catch{}},[ae]),w(()=>{if(!ie)return;const e=()=>le(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[ie]);const ue=T(t.streak);w(()=>{if(t.streak>ue.current&&ae){const e=ee.find(e=>e.id===ae);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=x.autoCheckTasks&&o>0&&t>=o;z.updateTask(ae,{completed:t,done:e.done||a})}}ue.current=t.streak},[t.streak,ae,x.autoCheckTasks,ee,z]);const me=oe.reduce((e,t)=>e+(t.completed??0),0),he=oe.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),pe=oe.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),ge=t.running&&"focus"===t.mode?t.remaining:0,ke=pe*x.focusMinutes*60+ge,fe=new Date(Date.now()+1e3*ke),be=v(fe.toISOString(),{clock:{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}}),xe=(ke/3600).toFixed(1),ve=ae?ee.find(e=>e.id===ae)??null:null,ye=y(Math.floor(t.remaining/60)),Ne=y(t.remaining%60),[Ce,Se]=M(()=>e(V)),[je,we]=M(!1),[Be,Me]=M(Ce),[Te,Pe]=M(x);N(P(()=>{Me({...Ce}),Pe({...x}),we(!0)},[Ce,x]));const Ie="focus"!==t.mode,De=W[t.mode],Ae=Ie?(Ve=De,Le=Ce.activeOpacity/100,`rgba(${parseInt(Ve.slice(1,3),16)}, ${parseInt(Ve.slice(3,5),16)}, ${parseInt(Ve.slice(5,7),16)}, ${Le})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${Ce.activeOpacity/100})`;var Ve,Le;const Re={primary:Ie?"text-white":"text-gray-900",secondary:Ie?"text-white/85":"text-gray-700",muted:Ie?"text-white/65":"text-gray-500",tabActive:Ie?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Ie?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Ie?"border-white/30":"border-gray-200",softDivider:Ie?"border-white/20":"border-gray-200",iconBtn:Ie?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Ie?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},We=Ie?De:"#0f172a";/* @__PURE__ */
2
- return I(D,{children:[
3
- /* @__PURE__ */I("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Re.primary}`,style:{backgroundColor:Ae,backdropFilter:Ce.activeBlur>0?`blur(${Ce.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */A("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */A("button",{onClick:()=>m(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Re.tabActive:Re.tabInactive}`,children:R[e]},e))}),
5
- /* @__PURE__ */I("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[ye,":",Ne]}),
6
- /* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?h():p(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:We,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
7
- /* @__PURE__ */A("div",{className:"px-3 py-3 text-center",children:ve?/* @__PURE__ */I(D,{children:[
8
- /* @__PURE__ */I("div",{className:`text-xs leading-tight ${Re.muted}`,children:["#",(ve.completed??0)+1]}),
9
- /* @__PURE__ */A("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Re.primary}`,children:ve.name})]}):/* @__PURE__ */A("div",{className:`text-xs italic ${Re.muted}`,children:"No task selected"})}),
10
- /* @__PURE__ */I("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
11
- /* @__PURE__ */A("h3",{className:`text-base font-bold tracking-tight ${Re.primary}`,children:"Tasks"}),
12
- /* @__PURE__ */A("button",{className:`rounded p-1 transition-colors ${Re.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */A(S,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
13
- /* @__PURE__ */A("div",{className:`border-t mx-3 mt-2 ${Re.divider}`}),
14
- /* @__PURE__ */I("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[oe.map(e=>{const t=e.id===ae;/* @__PURE__ */
15
- return I("div",{onClick:()=>ne(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
16
- /* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:We},children:/* @__PURE__ */A("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */A("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"10"})})}),
17
- /* @__PURE__ */A("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
18
- /* @__PURE__ */I("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
19
- /* @__PURE__ */A("span",{className:"font-bold text-gray-500",children:e.completed??0}),
20
- /* @__PURE__ */A("span",{className:"text-gray-400",children:" / "}),
21
- /* @__PURE__ */A("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
22
- /* @__PURE__ */I("div",{className:"relative",children:[
23
- /* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),le(ie===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(S,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),ie===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,z.removeTask(o),ae===o&&ne(null),le(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),re?/* @__PURE__ */A(de,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=z.addTask({name:o,estimated:t,completed:0,dueDate:te});ae||ne(a),se(!1)},onCancel:()=>se(!1),accentColor:We}):/* @__PURE__ */I("button",{onClick:()=>se(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Re.addTaskBtn}`,children:[
24
- /* @__PURE__ */A(S,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
25
- /* @__PURE__ */I("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Re.softDivider}`,children:[
26
- /* @__PURE__ */I("span",{className:Re.secondary,children:["Pomos: ",
27
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:me}),
28
- /* @__PURE__ */A("span",{className:Re.muted,children:" / "}),
29
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:he})]}),ke>0&&/* @__PURE__ */I("span",{className:Re.secondary,children:["Finish At: ",
30
- /* @__PURE__ */A("span",{className:`font-bold ${Re.primary}`,children:be}),
31
- /* @__PURE__ */I("span",{className:Re.muted,children:[" (",xe,"h)"]})]})]})]}),
32
- /* @__PURE__ */A(q,{open:je,onClose:()=>we(!1),onSave:()=>{Se(Be),localStorage.setItem(V,JSON.stringify(Be)),b({pomodoro_settings:Te}),we(!1)},configAppearance:Be,setConfigAppearance:Me,configPrefs:Te,setConfigPrefs:Pe})]})}function q({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
33
- return I(t,{open:e,onClose:o,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:a,children:[
34
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(le,{}),label:"TIMER",children:[
35
- /* @__PURE__ */I("div",{children:[
36
- /* @__PURE__ */A("p",{className:"text-sm font-bold text-gray-800 mb-2",children:"Time (minutes)"}),
37
- /* @__PURE__ */I("div",{className:"grid grid-cols-3 gap-3",children:[
38
- /* @__PURE__ */A(ae,{label:"Pomodoro",value:s.focusMinutes,onChange:e=>l("focusMinutes",e),max:120}),
39
- /* @__PURE__ */A(ae,{label:"Short Break",value:s.shortBreakMinutes,onChange:e=>l("shortBreakMinutes",e),max:120}),
40
- /* @__PURE__ */A(ae,{label:"Long Break",value:s.longBreakMinutes,onChange:e=>l("longBreakMinutes",e),max:120})]})]}),
41
- /* @__PURE__ */A(te,{label:"Auto Start Breaks",children:/* @__PURE__ */A(se,{checked:s.autoStartBreaks,onChange:e=>l("autoStartBreaks",e)})}),
42
- /* @__PURE__ */A(te,{label:"Auto Start Pomodoros",children:/* @__PURE__ */A(se,{checked:s.autoStartPomodoros,onChange:e=>l("autoStartPomodoros",e)})}),
43
- /* @__PURE__ */A(te,{label:"Long Break interval",children:/* @__PURE__ */A(ne,{value:s.longBreakInterval,onChange:e=>l("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
44
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(ce,{}),label:"TASK",children:[
45
- /* @__PURE__ */A(te,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */A(se,{checked:s.autoCheckTasks,onChange:e=>l("autoCheckTasks",e)})}),
46
- /* @__PURE__ */A(te,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */A(se,{checked:s.checkToBottom,onChange:e=>l("checkToBottom",e)})})]}),
47
- /* @__PURE__ */I(ee,{icon:/* @__PURE__ */A(ue,{}),label:"SOUND",children:[
48
- /* @__PURE__ */A(te,{label:"Alarm Sound",children:/* @__PURE__ */I("div",{className:"flex items-center gap-2",children:[
49
- /* @__PURE__ */A(re,{value:s.alarmSound,onChange:e=>l("alarmSound",e),options:g.map(e=>({id:e.id,label:e.label}))}),"off"!==s.alarmSound&&/* @__PURE__ */A("button",{type:"button",onClick:()=>k(s.alarmSound,{volume:s.alarmVolume,repeat:1}),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
50
- /* @__PURE__ */A(oe,{value:s.alarmVolume,onChange:e=>l("alarmVolume",e)}),
51
- /* @__PURE__ */A(te,{label:"repeat",children:/* @__PURE__ */A(ne,{value:s.alarmRepeat,onChange:e=>l("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
52
- /* @__PURE__ */A(te,{label:"Focus Sound",children:/* @__PURE__ */I("div",{className:"flex items-center gap-2",children:[
53
- /* @__PURE__ */A(re,{value:s.focusSound,onChange:e=>l("focusSound",e),options:f}),"none"!==s.focusSound&&/* @__PURE__ */A("button",{type:"button",onClick:()=>b(s.focusSound,s.focusVolume),className:"px-2 py-1 text-2xs rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
54
- /* @__PURE__ */A(oe,{value:s.focusVolume,onChange:e=>l("focusVolume",e)})]})]})}function ee({icon:e,label:t,children:o}){/* @__PURE__ */
55
- return I("div",{className:"border-t border-gray-200 pt-3 first:border-0 first:pt-0",children:[
56
- /* @__PURE__ */I("div",{className:"flex items-center gap-2 mb-3 text-ink-faintest",children:[e,
57
- /* @__PURE__ */A("span",{className:"text-xs font-bold tracking-[0.15em]",children:t})]}),
58
- /* @__PURE__ */A("div",{className:"space-y-3",children:o})]})}function te({label:e,info:t,children:o}){/* @__PURE__ */
59
- return I("div",{className:"flex items-center justify-between gap-3",children:[
60
- /* @__PURE__ */I("div",{className:"flex items-center gap-2 min-w-0",children:[
61
- /* @__PURE__ */A("span",{className:"text-sm font-semibold text-gray-800",children:e}),t&&/* @__PURE__ */A(ie,{title:t})]}),
62
- /* @__PURE__ */A("div",{className:"shrink-0",children:o})]})}function oe({value:e,onChange:t}){/* @__PURE__ */
63
- return I("div",{className:"flex items-center justify-end gap-3",children:[
64
- /* @__PURE__ */A("span",{className:"text-xs text-gray-400 w-7 text-right tabular-nums",children:e}),
65
- /* @__PURE__ */A("input",{type:"range",min:0,max:100,value:e,onChange:e=>t(parseInt(e.target.value,10)),className:"w-40 accent-blue-500"})]})}function ae({label:e,value:t,onChange:o,min:a=1,max:n=99}){/* @__PURE__ */
66
- return I("label",{className:"flex flex-col",children:[
67
- /* @__PURE__ */A("span",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),
68
- /* @__PURE__ */A(ne,{value:t,onChange:o,min:a,max:n})]})}function ne({value:e,onChange:t,min:o=1,max:a=99,className:n=""}){/* @__PURE__ */
69
- return A("input",{type:"number",min:o,max:a,value:e,onChange:e=>t(Math.max(o,Math.min(a,parseInt(e.target.value,10)||o))),className:`bg-gray-100 border-0 rounded-md px-2 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 w-full ${n}`})}function re({value:e,onChange:t,options:o}){/* @__PURE__ */
70
- return I("div",{className:"relative",children:[
71
- /* @__PURE__ */A("select",{value:e,onChange:e=>t(e.target.value),className:"appearance-none bg-gray-100 border-0 rounded-md pl-3 pr-8 h-8 text-sm font-medium text-ink-strong focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer",children:o.map(e=>/* @__PURE__ */A("option",{value:e.id,children:e.label},e.id))}),
72
- /* @__PURE__ */A(S,{name:"chevron-down",className:`absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 pointer-events-none ${x}`,strokeWidth:2.5})]})}function se({checked:e,onChange:t}){/* @__PURE__ */
73
- return A("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e?"bg-emerald-500":"bg-gray-300"),children:/* @__PURE__ */A("span",{className:"absolute h-5 w-5 rounded-full bg-white shadow transition-transform "+(e?"translate-x-[22px]":"translate-x-0.5")})})}function ie({title:e}){/* @__PURE__ */
74
- return A("span",{title:e,className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-gray-300 text-on-accent text-3xs font-bold cursor-help",children:"i"})}function le(){/* @__PURE__ */
75
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
76
- /* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"9"}),
77
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7v5l3 2"})]})}function ce(){/* @__PURE__ */
78
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
79
- /* @__PURE__ */A("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),
80
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})}function ue(){/* @__PURE__ */
81
- return I("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
82
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5L6 9H2v6h4l5 4V5z"}),
83
- /* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function de({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=M(""),[r,s]=M(1),i=()=>e(a,r);/* @__PURE__ */
84
- return I("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--elevation-panel)",children:[
85
- /* @__PURE__ */A("input",{autoFocus:!0,value:a,onChange:e=>n(e.target.value),placeholder:"What are you working on?",onKeyDown:e=>{"Enter"===e.key&&i(),"Escape"===e.key&&t()},className:"w-full text-base font-medium bg-transparent border-0 outline-none placeholder-gray-400"}),
86
- /* @__PURE__ */I("div",{className:"flex items-center justify-between mt-2",children:[
87
- /* @__PURE__ */A("span",{className:"text-xs font-semibold text-gray-500",children:"Est Pomodoros"}),
88
- /* @__PURE__ */A("input",{type:"number",min:1,max:20,value:r,onChange:e=>s(Math.max(1,Math.min(20,parseInt(e.target.value,10)||1))),className:"w-16 bg-gray-100 rounded px-2 py-1 text-sm text-right border-0 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),
89
- /* @__PURE__ */I("div",{className:"flex gap-2 mt-3 justify-end",children:[
90
- /* @__PURE__ */A("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
91
- /* @__PURE__ */A("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{z as default};
@@ -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-AQH6MAYK.js";import{ResizeHandle as l}from"./chunk-LXPDURUL.js";import{openGlobalSearch as s}from"./chunk-JNSRDEB6.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 S,PopupMenuItem as C,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 A}from"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useMemo as z,useState as W,useRef as I,useEffect as H,isValidElement as T,cloneElement as R}from"react";import{jsx as D,jsxs as M,Fragment as K}from"react/jsx-runtime";var P="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),O=150,Q=250;function U(e,t,r){const n=Math.max(8,r-t.bottom);return{left:e+b,bottom:n,maxHeight:r-n-8,overflowY:"auto"}}var B=(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(" "),J="flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",E="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function X({open:e,children:t}){const r=I(null);return H(()=>{r.current?.toggleAttribute("inert",!e)},[e]),/* @__PURE__ */D("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__ */D("div",{className:"min-h-0 overflow-hidden",children:t})})}function G({open:e}){/* @__PURE__ */
2
- return D($,{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 D($,"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 Y({className:e}){/* @__PURE__ */
4
- return D($,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var F=e=>.75+1.75*e+"rem";function _({width:b,openWidth:O=x,collapsed:Q,onToggleCollapsed:_,onResize:Z,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=A().layout,{hasAnyPerm:ke}=e(),ye=z(()=>c(se,me,ke),[se,me,ke]),[ve,Ne]=W(()=>t(r(n))),we=z(()=>[...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}),[Se,Ce]=W(!1),Le=I(null),$e=Q&&!le,[Ae,ze]=W(!1),We=I("pointer"),Ie=I(void 0),He=I(!1),Te=I(null),Re=()=>{clearTimeout(Ie.current),Ie.current=void 0},De=e=>{Re(),We.current=e,ze(!0)},Me=()=>{Re(),ze(!1)};H(()=>{Re(),ze(!1)},[Q]),H(()=>()=>Re(),[]),H(()=>{if(!Ae)return;const e=e=>{const t=e.target;t&&(Te.current?.contains(t)||t.closest?.('[data-popup-menu-tree], [role="menu"]'))||(Re(),ze(!1))};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[Ae]);const Ke=Q&&!Ae,Pe=Q&&Ae?O:b,Oe=(e,t)=>{Me(),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Qe=(e,t)=>{const r=t[e];/* @__PURE__ */
5
- return D("span",{className:E,"aria-hidden":"true",children:r&&T(r)?R(r,{className:"size-[18px]"}):r})},Ue=e=>e.filter(e=>d(e,ke).length>0).map(e=>`child:${e.to}`),Be=(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 M("div",{children:[
7
- /* @__PURE__ */M("button",{type:"button",onClick:()=>je(a,r),"aria-expanded":o,className:B(l,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
8
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
9
- /* @__PURE__ */D(G,{open:o})]}),
10
- /* @__PURE__ */D(X,{open:o,children:/* @__PURE__ */D("div",{className:"space-y-0.5 pt-0.5",children:n.map(e=>Be(e,t+1,Ue(n)))})}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(t)},"aria-hidden":"true"})]},e.to)}const a=e.to===te;/* @__PURE__ */
11
- return M("div",{children:[
12
- /* @__PURE__ */M("button",{type:"button",onClick:t=>Oe(e,t),onAuxClick:t=>{1===t.button&&Oe(e,t)},"aria-current":a?"page":void 0,className:B(a,!1),style:t>0?{paddingLeft:F(t)}:void 0,children:[0===t&&Qe(e.to,ce),
13
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i})]}),e.dividerAfter&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:F(t)},"aria-hidden":"true"})]},e.to)},Je=(e,t)=>{const r=t?e.items:m(e,ke);if(0===r.length)return null;const n="icon"in e&&e.icon?/* @__PURE__ */D("span",{className:E,"aria-hidden":"true",children:e.icon}):Qe(e.label,de),i=e.menuLabel??e.label,a=u(r,te,ke),o="dividerAfter"in e&&e.dividerAfter;if(Ke)/* @__PURE__ */
14
- return M("div",{children:[
15
- /* @__PURE__ */D("button",{type:"button",title:i,"aria-label":i,"aria-expanded":!1,onClick:()=>{ve.has(e.label)||je(e.label),De("tap")},className:B(a,!0),children:n}),o&&/* @__PURE__ */D("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 M("div",{children:[
17
- /* @__PURE__ */M("button",{type:"button",onClick:()=>je(e.label),"aria-expanded":l,"aria-controls":s,className:B(!l&&a,!1),children:[n,
18
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate",children:i}),
19
- /* @__PURE__ */D(G,{open:l})]}),
20
- /* @__PURE__ */D(X,{open:l,children:/* @__PURE__ */D("div",{id:s,role:"group","aria-label":i,className:"space-y-0.5 pt-0.5",children:r.map(e=>Be(e,1,Ue(r)))})}),o&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"})]},e.label)},Ee=re?.first_name?`${re.first_name} ${re.last_name||""}`.trim():ne?.email||"",Xe=(re?.first_name?.charAt(0)||ne?.email?.charAt(0)||"?").toUpperCase(),Ge=re?.avatar_url?/* @__PURE__ */D("img",{src:re.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */D("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=Se?Le.current?.getBoundingClientRect():void 0,Ye=Ke?"":"px-3",Fe=Ke?{paddingInline:y}:void 0,_e=`${Q?xe.expandSidebar:xe.collapseSidebar} (${P?"⌘":"Ctrl"} .)`,Ze=q?{run:q,label:xe.goHome,title:xe.goHome}:le?null:{run:_,label:Q?xe.expandSidebar:xe.collapseSidebar,title:_e},qe=/* @__PURE__ */M(K,{children:[he&&/* @__PURE__ */D(h,{src:he,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:fe,isLight:ge,size:28,decorative:!0}),!Ke&&/* @__PURE__ */M("span",{className:"min-w-0 text-left leading-tight",children:[
21
- /* @__PURE__ */D("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:ue??"Apps"}),pe&&/* @__PURE__ */D("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 M("aside",{ref:Te,"aria-label":xe.navLabel,"data-rail-peek":Ae?"":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 ${Q?"overflow-hidden transition-[width] duration-150 ease-out motion-reduce:transition-none":""} ${Ae?"rounded-r-(--radius-panel)":""}`,style:{width:Pe,boxShadow:Ae?"var(--elevation-popup)":void 0},onPointerEnter:e=>{"touch"!==e.pointerType&&(He.current=!0,$e&&(Ae?Re():(Re(),Ie.current=setTimeout(()=>De("pointer"),150))))},onPointerLeave:e=>{"touch"!==e.pointerType&&(He.current=!1,$e&&(Re(),Ae&&!Se&&"pointer"===We.current&&(Ie.current=setTimeout(Me,250))))},onFocus:e=>{$e&&!Ae&&(e=>{try{return e.matches(":focus-visible")}catch{return!1}})(e.target)&&De("focus")},onBlur:e=>{if(!Ae||"focus"!==We.current)return;const t=e.relatedTarget;t&&Te.current?.contains(t)||Se||He.current||Me()},onKeyDown:e=>{"Escape"===e.key&&Ae&&Me()},children:[
23
- /* @__PURE__ */M("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(Ke?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:k},children:[Ze?/* @__PURE__ */D("button",{type:"button",onClick:Ze.run,"aria-label":Ze.label,title:Ze.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(Ke?"justify-center p-0.5":"-ml-1 p-1"),children:qe}):/* @__PURE__ */D("span",{className:"flex min-w-0 items-center gap-2",children:qe}),le?/* @__PURE__ */D(p,{onClick:le,"aria-label":xe.closeMenu,children:/* @__PURE__ */D($,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):Q?Ae&&
24
- /* @__PURE__ */D("button",{type:"button",onClick:()=>{Me(),_()},"aria-label":xe.keepSidebarOpen,title:`${xe.keepSidebarOpen} (${P?"⌘":"Ctrl"} .)`,className:J,children:/* @__PURE__ */D(V,{dir:"right"})}):/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.collapseSidebar,title:`${xe.collapseSidebar} (${P?"⌘":"Ctrl"} .)`,className:J,children:/* @__PURE__ */D(V,{dir:"left"})})]}),
25
- /* @__PURE__ */D("div",{className:`shrink-0 pt-3 ${Ye}`,style:Fe,children:Ke?/* @__PURE__ */D("button",{type:"button",onClick:s,"aria-label":xe.search,title:`${xe.search} (${P?"⌘K":"Ctrl K"})`,className:B(!1,!0),children:/* @__PURE__ */D(Y,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */M("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__ */D(Y,{className:"size-3.5 text-gray-500"}),
27
- /* @__PURE__ */D("span",{className:"min-w-0 flex-1 truncate text-sm text-ink-faint",children:xe.search}),
28
- /* @__PURE__ */D("kbd",{className:"rounded border border-line bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-ink-faint",children:P?"⌘K":"Ctrl K"})]})}),
29
- /* @__PURE__ */M("nav",{"aria-label":xe.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ye} ${Ke?"space-y-1":"space-y-0.5"}`,style:Fe,children:[Ke&&/* @__PURE__ */D("button",{type:"button",onClick:_,"aria-label":xe.expandSidebar,title:`${xe.expandSidebar} (${P?"⌘":"Ctrl"} .)`,className:`${B(!1,!0)} mb-3`,children:/* @__PURE__ */D(V,{dir:"right"})}),ye.topItems.map(e=>{if(!Ke)return Be(e,0);const t=d(e,ke),r=e.to===te||u(t,te,ke),n=e.menuLabel??e.label;/* @__PURE__ */
30
- return M("div",{children:[
31
- /* @__PURE__ */D("button",{type:"button",title:n,"aria-label":n,onClick:r=>{if(0===t.length)return void Oe(e,r);const n=`child:${e.to}`;ve.has(n)||je(n),De("tap")},className:B(r,!0),children:Qe(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */D("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__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.erpSections.map(e=>Je(e,!1)),ye.systemSections.map(e=>Je(e,!1)),ye.virtualSections.map(e=>Je(e,!0)),ye.footerSections.length>0&&/* @__PURE__ */D("div",{className:"mx-2 my-2 border-t border-line","aria-hidden":"true"}),ye.footerSections.map(e=>Je(e,!1))]}),
32
- /* @__PURE__ */D("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ye}`,style:Fe,children:/* @__PURE__ */M("button",{ref:Le,type:"button",onClick:()=>Ce(e=>!e),"aria-haspopup":"menu","aria-expanded":Se,"aria-label":Ke?xe.accountMenu(Ee):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(Ke?"justify-center py-2":"px-2 py-2"),children:[Ge,!Ke&&/* @__PURE__ */M("span",{className:"min-w-0 flex-1 text-left",children:[
33
- /* @__PURE__ */D("span",{className:"block truncate text-sm font-semibold text-ink-strong",children:Ee}),ne?.email&&Ee!==ne.email&&/* @__PURE__ */D("span",{className:"block truncate text-2xs text-ink-faint",children:ne.email})]})]})}),Z&&!Q&&!le&&/* @__PURE__ */D(l,{side:"left",width:b,onResize:Z,min:N,max:v,defaultWidth:x,storageKey:i,label:xe.resizeSidebar}),Se&&Ve&&/* @__PURE__ */M(S,{portal:!0,minWidth:224,onClose:()=>{Ce(!1),Ae&&"pointer"===We.current&&!He.current&&Me()},style:U(Pe,Ve,window.innerHeight),children:[Ke&&/* @__PURE__ */M("div",{className:"border-b border-line px-3 py-3",children:[
34
- /* @__PURE__ */D("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ee}),ne?.email&&/* @__PURE__ */D("p",{className:"truncate text-xs text-gray-500",children:ne.email})]}),
35
- /* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Me(),ee("/profile",!1)},children:[
36
- /* @__PURE__ */D($,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.profile]}),ye.footerItems.map(e=>/* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Oe(e)},children:[
37
- /* @__PURE__ */D("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),oe&&/* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Me(),oe()},children:[
38
- /* @__PURE__ */D($,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.reportIssue]}),
39
- /* @__PURE__ */D(L,{}),ae&&/* @__PURE__ */M(K,{children:[
40
- /* @__PURE__ */M(C,{onClick:()=>{Ce(!1),Me(),ae()},children:[
41
- /* @__PURE__ */D($,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.switchToDesktop]}),
42
- /* @__PURE__ */D(L,{})]}),
43
- /* @__PURE__ */M(C,{danger:!0,onClick:()=>{Ce(!1),Me(),ie()},children:[
44
- /* @__PURE__ */D($,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),xe.signOut]})]})]})}export{Q as RAIL_PEEK_CLOSE_MS,O as RAIL_PEEK_OPEN_MS,U as accountMenuPosition,_ as default};
@@ -1,16 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-GTT7LIWK.js";import{useWidgetSettings as n}from"./chunk-775K6APE.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-5A7MWTXX.js";import"./chunk-ZDMZM7HD.js";import"./chunk-BG3C4ALM.js";import"./chunk-JGKDWDVM.js";import"./chunk-FQD6P6EZ.js";import"./chunk-EIFNESXS.js";import"./chunk-FTKLODQK.js";import"./chunk-RIG5FEVS.js";import"./chunk-JR2HHKVP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WLG7BE55.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-WU2ZA6J2.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./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"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as r,useCallback as c}from"react";import{jsxs as s,Fragment as i,jsx as a}from"react/jsx-runtime";var o=["AAPL","MSFT","GOOGL","TSLA","NVDA"],m="stock_symbols",l="stock_appearance",h={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},p=Object.keys(h);function u(){try{const e=JSON.parse(localStorage.getItem(m)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return o}var d=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function g(){const[o,g]=r(u),[k,x]=r(()=>e(l)),[j,b]=r(!1),[f,y]=r([]),[N,v]=r(k),[S,A]=r(""),D=c(()=>{y([...o]),v({...k}),A(""),b(!0)},[o,k]);n(D);const G=()=>{const e=S.trim().toUpperCase();!e||f.includes(e)||f.length>=8||(y(t=>[...t,e]),A(""))},M=p.filter(e=>!f.includes(e));/* @__PURE__ */
2
- return s(i,{children:[
3
- /* @__PURE__ */a("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${k.activeOpacity/100})`,backdropFilter:k.activeBlur>0?`blur(${k.activeBlur}px)`:void 0},children:/* @__PURE__ */a("div",{className:"px-4 py-3",children:0===o.length?/* @__PURE__ */a("div",{className:"text-xs text-gray-500 text-center py-6",children:"No symbols yet — add some in settings."}):/* @__PURE__ */a("div",{className:"space-y-0.5",children:o.map(e=>{const t=h[e],n=(t?.change??0)>=0,r=t?t.change>0?"text-green-600":t.change<0?"text-red-600":"text-gray-500":"text-gray-400";/* @__PURE__ */
4
- return s("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
5
- /* @__PURE__ */a("span",{className:"text-sm font-bold text-gray-800 tracking-tight",children:e}),t?/* @__PURE__ */s("div",{className:"flex flex-col items-end leading-tight",children:[
6
- /* @__PURE__ */a("span",{className:"text-sm font-mono font-semibold text-gray-900 tabular-nums",children:(c=t.price,`$${c.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`)}),
7
- /* @__PURE__ */s("span",{className:`text-2xs font-medium tabular-nums ${r}`,children:[n?"▲":"▼"," ",d(t.change)," (",d(t.changePct),"%)"]})]}):/* @__PURE__ */a("span",{className:"text-sm font-mono text-gray-400 tabular-nums",children:"—"})]},e);var c})})})}),
8
- /* @__PURE__ */a(t,{open:j,onClose:()=>b(!1),title:"Stock Settings",appearance:N,onAppearanceChange:v,onSave:()=>{const e=f.map(e=>e.toUpperCase()).slice(0,8);g(e),x(N),localStorage.setItem(m,JSON.stringify(e)),localStorage.setItem(l,JSON.stringify(N)),b(!1)},children:/* @__PURE__ */s("div",{children:[
9
- /* @__PURE__ */s("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Symbols ",
10
- /* @__PURE__ */s("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",f.length,"/",8,")"]})]}),
11
- /* @__PURE__ */s("div",{className:"space-y-1 mb-2",children:[f.map((e,t)=>/* @__PURE__ */s("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
12
- /* @__PURE__ */a("span",{className:"text-sm font-semibold text-gray-700",children:e}),
13
- /* @__PURE__ */a("button",{onClick:()=>y(e=>e.filter((e,n)=>n!==t)),className:"text-red-400 hover:text-red-600",children:"×"})]},t)),0===f.length&&/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest italic",children:"No symbols — add a ticker below."})]}),f.length<8?/* @__PURE__ */s("div",{className:"flex items-center gap-2",children:[
14
- /* @__PURE__ */a("input",{value:S,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&G()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
15
- /* @__PURE__ */a("button",{onClick:G,className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */s("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",8," symbols — remove one to add another."]}),M.length>0&&f.length<8&&/* @__PURE__ */a("div",{className:"flex flex-wrap gap-2 mt-2",children:M.map(e=>/* @__PURE__ */a("button",{onClick:()=>y(t=>t.length<8?[...t,e]:t),className:"text-2xs font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:e},e))}),
16
- /* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest mt-2",children:"Demo prices — static sample data, no live feed."})]})})]})}export{g as default};
@@ -1,7 +0,0 @@
1
- import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-UZFFSZFI.js";import{useTabLayer as n,focusableIn as o}from"./chunk-DWGYC7OD.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-GOAFMGUI.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k="inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",w=/(^|[\s:])!?z-/,D={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function j({trigger:j,items:S,align:W="end",side:$="bottom","aria-label":A,className:C="",triggerClassName:E,menuClassName:L="",minWidth:K=180,linkAs:U,disabled:H,id:I,"aria-describedby":N,"aria-disabled":T=!1,onOpenChange:G,footer:B,footerLabel:F}){const[M,q]=m(!1),[J,O]=m(-1),z=h(null),P=h(null),R=h(null),Y=h(null),Z=h(null),Q=null!=B&&!1!==B,V=h({text:"",at:0}),X=g(),_=g(),ee=I??_,te=h(G);te.current=G;const re=h(M);re.current=M;const ne=v(e=>{q(!1),re.current&&(re.current=!1,te.current?.(!1)),e&&P.current?.focus()},[]),oe=(t,r)=>{const n=S.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(S[i]))return i}return-1},ie=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!M)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||ie()?.contains(t))return;const r=ie()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||ne(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>ne(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[M,ne]);const ae=v(()=>{const e=ie(),t=P.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:W,side:$});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=W},[W,$]);p(()=>{M&&ae()}),b(()=>{if(M)return u(()=>P.current,ae)},[M,ae]),b(()=>{if(!M)return;const t=R.current,r=e(S[J])?t?.querySelector(`[data-dropdown-index="${J}"]`):null;(r??t)?.focus({preventScroll:!0})},[M,J]),b(()=>{if(M)return f(e=>"Escape"===e.key&&(ne(!0),!0),()=>Y.current)},[M,ne]),n(Y,M&&Q);const le=h(null),se=t=>{const r=S.findIndex(t=>"radio"===t.type&&"colour"===t.mark&&t.checked&&e(t));return r>=0?r:"first"===t?oe(0,1):oe(S.length-1,-1)},de=e=>{O(se(e)),q(!0),re.current||(re.current=!0,le.current=e,G?.(!0))};p(()=>{const e=le.current;if(!M||!e)return;le.current=null;const t=se(e);t!==J&&O(t)});const ce=t(S,X),ue="function"==typeof B?B({close:()=>ne(!0)}):B,pe={...w.test(L)?{}:{zIndex:s.popup},minWidth:K};/* @__PURE__ */
2
- return y("div",{ref:z,className:`relative inline-flex ${C}`.trim(),children:[
3
- /* @__PURE__ */x("button",{ref:P,id:ee,type:"button","aria-haspopup":"menu","aria-expanded":M,"aria-controls":M?X:void 0,"aria-label":A,"aria-describedby":N,"aria-disabled":T||void 0,disabled:H,onClick:()=>{T||(M?ne(!1):de("first"))},onKeyDown:e=>{T||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),de("first")):"ArrowUp"===e.key&&(e.preventDefault(),de("last")))},className:E??`${k} ${A?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"}`,children:j}),M&&
4
- /* @__PURE__ */x(i,{portal:!0,className:L,style:pe,children:/* @__PURE__ */y("div",{ref:Y,children:[
5
- /* @__PURE__ */x("div",{ref:R,id:X,role:"menu","aria-orientation":"vertical","aria-label":A,"aria-labelledby":A?void 0:ee,"aria-describedby":ce,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),O(oe(J+1,1));else if("ArrowUp"===t.key)t.preventDefault(),O(oe(J-1,-1));else if("Home"===t.key)t.preventDefault(),O(oe(0,1));else if("End"===t.key)t.preventDefault(),O(oe(S.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&Z.current?o(Z.current)[0]:void 0;e?e.focus({preventScroll:!0}):ne(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?J+1:Math.max(J,0),s=R.current,d=S.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(S[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void O(n)}})(t)},children:r(S,{menuId:X,choose:e=>{e.disabled||(ne(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>ne(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===J?0:-1,onMouseEnter:()=>{t.disabled||Z.current?.contains(document.activeElement)||O(e)}}),linkAs:U})}),Q&&/* @__PURE__ */y("div",{ref:Z,role:"group","aria-label":F,"data-dropdown-footer":"",onKeyDown:e=>{const t=Z.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${J}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),ne(!0))},children:[
6
- /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
- /* @__PURE__ */x("div",{style:D,children:ue})]})]})})]})}export{j as DropdownMenu,k as TRIGGER_CLASS};
@@ -1,23 +0,0 @@
1
- import{Calendar as e}from"./chunk-YMHCLK3F.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-PT4GMPUB.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as x}from"./chunk-D65T4H6J.js";import{buttonClasses as v}from"./chunk-UQYNPYF4.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useShellStrings as w,useShellLocale as N}from"./chunk-IUVGHHR3.js";import{useState as k,useRef as C,useId as M,useEffect as j}from"react";import{createPortal as D}from"react-dom";import{jsxs as W,Fragment as $,jsx as Y}from"react/jsx-runtime";var F=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],H=d;function S(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function O(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function R(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var L=/* @__PURE__ */new Map;function T({from:d,to:u,onChange:h,formatDisplay:H,clearable:T,required:G=!1,name:I,id:P,"aria-labelledby":U,"aria-label":B,weekStartsOn:V,placeholder:E,fullWidth:J=!1,min:q,max:A,disabled:K=!1,allowOpenEnd:Q=!1}){const Z=w().dateRange,z=N(),X=H??(z?function(e){let t=L.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),L.set(e,t));const r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(z):R),_=E??Z.placeholder,ee=T??!G,[te,re]=k(!1),[ne,ae]=k(d),[oe,ie]=k(u),[le,se]=k(null),[ce,de]=k("from"),me=C(null),ue=C(null),he=C(null),pe=M(),fe=M(),ge=M(),[be,xe]=k(!1),ve=b(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=C(null),we=C(null),[Ne,ke]=k(!0);x(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=C(null);x(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[Me,je]=k(!1);x(()=>{const e=!!P&&(ue.current?.labels?.length??0)>0;e!==Me&&je(e)});const De=!!B||!!U||Me,We=m(s())??/* @__PURE__ */new Date(0),[$e,Ye]=k(()=>d?d.slice(0,7):O(We,q,A)),Fe=F.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(S(e,We),q,A)),He=e=>e?X(e):"";j(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),j(()=>{K&&re(!1)},[K]);const Se=()=>{h("",""),re(!1)},Oe=ee&&!K&&Boolean(d||u),Re=d&&u?`${He(d)} — ${He(u)}`:d?Z.fromOnly(He(d)):u?Z.toOnly(He(u)):"",Le=c(z),Te=e=>{const t=m(e);return t?Le.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ge=d&&u?Z.range(Te(d),Te(u)):d?Z.fromOnly(Te(d)):u?Z.toOnly(Te(u)):_,Ie=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Pe=/* @__PURE__ */W($,{children:[Fe.map(e=>/* @__PURE__ */Y("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=S(e,We);ae(t.from),ie(t.to),se(e),Ye(t.from.slice(0,7))})(e),className:Ie(e),"aria-label":be?Z[e]:void 0,children:be?Ne?Z[e]:Z[`${e}Short`]:Z[e]},e)),
2
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>se("Custom"),className:Ie("Custom"),children:Z.custom})]}),Ue=(e,t)=>Q?/* @__PURE__ */Y("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Y("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Be=e=>Q&&ce===e?" ring-1 ring-blue-400":"",Ve=
3
- /* @__PURE__ */Y(e,{mode:"range",min:q,max:A,value:ne||null,endValue:oe||null,month:$e,onMonthChange:Ye,onSelect:e=>{se("Custom"),Q?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:V,"aria-label":Z.dialog});/* @__PURE__ */
4
- return W("div",{className:"relative"+(J?" w-full":""),ref:me,children:[
5
- /* @__PURE__ */W("div",{className:`relative ${J?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Oe?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${K?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{K||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),Ye(d?d.slice(0,7):O(We,q,A)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:P,disabled:K||void 0,"aria-label":B,"aria-labelledby":U,"aria-describedby":[De?fe:void 0,G?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(J?" min-w-0 flex-1 justify-start":""),children:[
7
- /* @__PURE__ */Y(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */Y("span",{className:"truncate",children:Re||_})]}),Oe&&/* @__PURE__ */Y(n,{children:/* @__PURE__ */Y(a,{action:{label:Z.clearRange,icon:/* @__PURE__ */Y(p,{name:"close"}),onClick:Se}})})]}),De&&/* @__PURE__ */Y("span",{id:fe,className:"sr-only",children:Ge}),G&&/* @__PURE__ */Y("span",{id:ge,className:"sr-only",children:Z.required}),I&&/* @__PURE__ */W($,{children:[
9
- /* @__PURE__ */Y("input",{type:"hidden",name:I.from,value:d,disabled:K||void 0}),
10
- /* @__PURE__ */Y("input",{type:"hidden",name:I.to,value:u,disabled:K||void 0})]}),te&&D(
11
- /* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":Z.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:g.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...y()},children:[
12
- /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ue("from",/* @__PURE__ */W($,{children:[
13
- /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.from}),
14
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Be("from")}`,children:ne?He(ne):Z.start})]})),!be&&/* @__PURE__ */Y("span",{className:"text-gray-300",children:"—"}),Ue("to",/* @__PURE__ */W($,{children:[
15
- /* @__PURE__ */Y("span",{className:"text-xs font-medium text-gray-500",children:Z.to}),
16
- /* @__PURE__ */Y("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Be("to")}`,children:oe?He(oe):Z.end})]}))]}),be?/* @__PURE__ */W($,{children:[Fe.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */Y("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:Z.lastHeading}),
17
- /* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Pe,Fe.map(e=>/* @__PURE__ */Y("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:Z[e]},e))]})]}),
18
- /* @__PURE__ */Y("div",{className:"w-full",children:Ve})]}):
19
- /* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */Y("div",{className:"w-64",children:Ve}),Fe.length>0&&/* @__PURE__ */Y("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Pe})]}),
21
- /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */Y("button",{type:"button",onClick:Se,className:v({variant:"ghost"}),children:Z.clear}),
22
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>re(!1),className:v({variant:"secondary"}),children:Z.cancel}),
23
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:Q?!ne&&!oe:!ne||!oe,className:v({variant:"primary"}),children:Z.apply})]})]}),document.body)]})}export{T as DateRangePicker,S as presetRange,H as toISODate};
@@ -1,11 +0,0 @@
1
- import{useShellLocale as e}from"./chunk-IUVGHHR3.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,H=w||k,A=H?"section":"div",C=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),R=n.toArray(e).length>0,B=R?"border-b border-line-subtle ":"",G="current"===f,I=G?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",L=G?"rounded-t-(--radius-card) bg-accent-tint ":"",M=`${B}${L}${y.edge} ${I}`;/* @__PURE__ */
2
- return t(A,{className:C,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&H?{"aria-describedby":v}:{},...G?{"aria-current":!0}:{},children:[$?
3
- /* @__PURE__ */t("div",{className:`${B}${L}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${I}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:I,children:r}):/* @__PURE__ */a("div",{className:I,children:r}),
4
- /* @__PURE__ */a("p",{id:v,className:G?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
5
- /* @__PURE__ */t("div",{className:`${M} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
6
- /* @__PURE__ */a(j,{id:N,className:M,children:r}):/* @__PURE__ */a("div",{className:M,children:r})),R&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
7
- return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
8
- /* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
9
- /* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
10
- /* @__PURE__ */t("div",{className:"mt-2 flex items-baseline gap-2",children:[
11
- /* @__PURE__ */a("span",{className:"text-2xl font-semibold text-gray-900",children:o}),l&&/* @__PURE__ */t("span",{className:`text-xs font-medium ${m}`,children:[b," ",l.value]})]})]})}export{s as Card,c as StatCard};
@@ -1,4 +0,0 @@
1
- import{useTabLayer as e,focusableIn as t,stopAfter as r}from"./chunk-DWGYC7OD.js";import{onOverlayOpen as n}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{popupBounds as o,VIEWPORT_MARGIN as a,placeMenu as c,followAnchor as s}from"./chunk-GLUJS42B.js";import{useHydrated as l,useBrowserLayoutEffect as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useState as p,useRef as f,useId as h,useCallback as g,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as x,jsx as w}from"react/jsx-runtime";var y=/(^|[\s:])!?z-/;function k({trigger:k,children:C,title:N,description:D,"aria-label":E,align:j="start",side:O="bottom",open:T,defaultOpen:L=!1,onOpenChange:$,matchTriggerWidth:H=!1,maxHeight:P,initialFocus:S,id:W,triggerLabel:M,"aria-describedby":U,disabled:z,className:K="",triggerClassName:Y,panelClassName:B=""}){const[F,G]=p(L),J=(T??F)&&!z,R=l(),I=f(null),Q=f(null),V=f(null),q=f(null),A=h(),X=W??A,Z=h(),_=h(),ee=h(),te=f(null),re=f(!1),ne=f({openProp:T,onOpenChange:$});ne.current={openProp:T,onOpenChange:$};const ie=g(e=>{void 0===ne.current.openProp&&G(e),ne.current.onOpenChange?.(e)},[]),oe=g((e=!1)=>{re.current=e,ie(!1)},[ie]),ae=e=>{te.current=e.nativeEvent},ce=g(()=>{const e=V.current,t=Q.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=o(t),i=Math.max(0,n.right-n.left-2*a),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${i}px`,s.maxHeight="none",s.width=H?`${Math.min(r.width,i)}px`:"";const l={width:e.offsetWidth,height:e.offsetHeight},u=P??1/0,d=c({trigger:r,menu:{width:l.width,height:Math.min(l.height,u)},bounds:n,align:j,side:O}),m=Math.min(d.maxHeight,u);s.left=`${d.left}px`,s.top=`${d.top}px`,s.maxHeight=`${m}px`,s.overflowY=l.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=j},[j,O,H,P]);u(()=>{J&&R&&ce()}),v(()=>{if(!J||!R)return;const e=s(()=>Q.current,ce),t=q.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>ce());return r.observe(t),()=>{e(),r.disconnect()}},[J,R,ce]),v(()=>{if(!J)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(te.current===e)return!1;const t=e.target;return!(t&&(I.current?.contains(t)||V.current?.contains(t)))})(e)&&oe(!0))},i=e=>{t=e,r=window.setTimeout(()=>n(e),0)},o=e=>n(e);return document.addEventListener(e,i,!0),window.addEventListener(e,o),()=>{window.clearTimeout(r),document.removeEventListener(e,i,!0),window.removeEventListener(e,o)}},t=e("pointerdown"),r=e("focusin"),i=n(()=>oe()),o=m(e=>"Escape"===e.key&&(oe(),Q.current?.focus(),!0),()=>V.current);return()=>{t(),r(),i(),o()}},[J,oe]),e(V,J&&R),u(()=>{if(!J||!R)return;const e=V.current;return()=>{if(re.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||Q.current?.focus({preventScroll:!0})}},[J,R]),v(()=>{if(!J||!R)return;const e=V.current;e&&(re.current=!1,(S?.current??t(e)[0]??e).focus({preventScroll:!0}))},[J,R]);const se="function"==typeof C?C({close:()=>oe()}):C,le=N?{"aria-labelledby":_}:E?{"aria-label":E}:{"aria-labelledby":X};/* @__PURE__ */
2
- return x("div",{ref:I,className:`relative inline-flex ${K}`.trim(),children:[
3
- /* @__PURE__ */w("button",{ref:Q,id:X,type:"button","aria-haspopup":"dialog","aria-expanded":J,"aria-controls":J&&R?Z:void 0,"aria-label":M,"aria-describedby":U,disabled:z,onClick:()=>J?oe():ie(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!J)return;const r=(()=>{const e=V.current;return e?t(e)[0]??e:null})();r&&(e.preventDefault(),r.focus({preventScroll:!0}))},className:Y??d({variant:"secondary"}),children:k}),J&&R&&b(
4
- /* @__PURE__ */w("div",{ref:V,id:Z,role:"dialog",...le,"aria-describedby":D?ee:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:ae,onFocusCapture:ae,onKeyDown:e=>{const n=V.current,i=Q.current;if("Tab"!==e.key||!n||!i||!n.contains(e.target))return;const o=t(n),a=document.activeElement;if(e.shiftKey){if(o.length>0&&a!==o[0]&&a!==n)return;return e.preventDefault(),void i.focus({preventScroll:!0})}if(o.length>0&&a!==o[o.length-1])return;e.preventDefault();const c=r(i,n);oe(!!c),(c??i).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${B}`.trim(),style:y.test(B)?void 0:{zIndex:i.popup},children:/* @__PURE__ */x("div",{ref:q,children:[N&&/* @__PURE__ */w("h2",{id:_,className:"text-sm font-semibold text-gray-900",children:N}),D&&/* @__PURE__ */w("p",{id:ee,className:"mt-1 text-sm text-gray-500",children:D}),N||D?/* @__PURE__ */w("div",{className:"mt-3",children:se}):se]})}),document.body)]})}export{k as Popover};
@@ -1,17 +0,0 @@
1
- import{ChartSkeleton as e}from"./chunk-ZNV75GAG.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{CHART_INK as t,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{jsx as n,jsxs as o,Fragment as c}from"react/jsx-runtime";function i({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
2
- return n("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
3
- return n("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
4
- return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
5
- return n("span",{className:`${a} h-2.5 w-2.5`,style:{backgroundColor:r}});case"bar":/* @__PURE__ */
6
- return n("span",{className:`${a} h-1 w-4 rounded-full`,style:{backgroundColor:r}});case"bar-vertical":/* @__PURE__ */
7
- return n("span",{className:`${a} h-3.5 w-1 rounded-full`,style:{backgroundColor:r}});default:/* @__PURE__ */
8
- return n("span",{className:`${a} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:r}})}}function d({entries:e,interactive:r,fallbackSwatch:t,onClick:l}){const{highlighted:d,setHighlighted:u}=a();/* @__PURE__ */
9
- return n("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,a)=>{const h=r&&null!==d&&d!==e.key,m=/* @__PURE__ */o(c,{children:[
10
- /* @__PURE__ */n(i,{shape:e.swatch??t,colour:s(a,e.color,e.tone)}),e.label]});/* @__PURE__ */
11
- return n("li",{className:"list-none",children:r||l?/* @__PURE__ */n("button",{type:"button",onClick:l?()=>l(e.key):void 0,"aria-pressed":l?Boolean(e.pressed):void 0,onMouseEnter:r?()=>u(e.key):void 0,onMouseLeave:r?()=>u(null):void 0,onFocus:r?()=>u(e.key):void 0,onBlur:r?()=>u(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */n("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function u({title:a,subtitle:s,legend:c,table:i,tableLabel:u,busy:h=!1,loading:m=!1,skeletonVariant:p="area",skeletonHeight:b,interactiveLegend:g=!0,legendSwatch:y="rounded-square",onLegendClick:f,actions:k,children:N,className:x}){const w=l().charts;/* @__PURE__ */
12
- return n(r,{children:/* @__PURE__ */o("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${x??""}`,"aria-busy":h||m||void 0,children:[
13
- /* @__PURE__ */o("header",{className:"flex items-start justify-between gap-4",children:[
14
- /* @__PURE__ */o("div",{className:"min-w-0",children:[
15
- /* @__PURE__ */n("h3",{className:"text-base font-semibold text-ink-strongest",children:a}),s&&/* @__PURE__ */n("p",{className:"mt-0.5 text-sm text-gray-500",children:s})]}),k&&/* @__PURE__ */n("div",{className:"shrink-0",children:k})]}),m?/* @__PURE__ */n(e,{variant:p,height:b}):/* @__PURE__ */n("div",{className:h?"opacity-60 transition-opacity":"transition-opacity",children:N}),!m&&c&&c.length>1&&/* @__PURE__ */n(d,{entries:c,interactive:g,fallbackSwatch:y,onClick:f}),!m&&i&&/* @__PURE__ */o("details",{className:"border-t border-gray-100 pt-3",children:[
16
- /* @__PURE__ */n("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:u??w.showTable}),
17
- /* @__PURE__ */n("div",{className:"mt-3 overflow-x-auto",style:{color:t.label},children:i})]})]})})}export{u as ChartFrame};
@@ -1,2 +0,0 @@
1
- import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=o(),j=c(null),k=c(p);k.current=p;const y=c(m);y.current=m;const D=a(()=>{const t=j.current,n=k.current();if(!t||!n)return;const o=(y.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{v&&D()}),u(()=>{if(!v)return;const t=n(()=>k.current(),D),e=j.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>D());return r.observe(e),()=>{t(),r.disconnect()}},[v,D]);return v&&p()?d(
2
- /* @__PURE__ */l("div",{ref:j,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
@@ -1 +0,0 @@
1
- import{dismissPopups as o}from"./chunk-PGN5ME7B.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";function m(m){r(()=>{m&&o()},[m])}export{m as useDismissPopupsOnOpen};
@@ -1,28 +0,0 @@
1
- import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-HVHIXX6O.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{ImageLightbox as a}from"./chunk-AWWNMSDN.js";import{Drawer as i}from"./chunk-XSHDPG45.js";import{EmptyState as t}from"./chunk-VXSYHTBP.js";import{DescriptionList as o}from"./chunk-SACUSHVN.js";import{Breadcrumbs as d}from"./chunk-OZ4R6U2M.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-L2WBCXG7.js";import{useMediaMoveItems as u}from"./chunk-ZCGT5YNR.js";import{RenameField as m}from"./chunk-QIPO4EVJ.js";import{NativeSelect as p}from"./chunk-DEYVAMJQ.js";import{MediaUploadGrid as h}from"./chunk-6CDWPEND.js";import{MediaUsedInList as f}from"./chunk-GURY4WS5.js";import{useMarquee as g}from"./chunk-OLFYNMTD.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{Segmented as k}from"./chunk-HNIIDDLJ.js";import{copyToClipboard as y}from"./chunk-UFX7F3KG.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-QMBMK6PP.js";import{Banner as N}from"./chunk-XWJT6TFU.js";import{Input_default as C}from"./chunk-PT4GMPUB.js";import{DropdownMenu as I}from"./chunk-3DSGJIC7.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-VFSAJMNX.js";import{setModalDragAside as z,modalIdHolding as T}from"./chunk-EIFNESXS.js";import{ColoredBadge as F}from"./chunk-WLG7BE55.js";import{Button_default as L}from"./chunk-EVYD6UFQ.js";import{Icon as O}from"./chunk-ISVODSRP.js";import{Tooltip as E}from"./chunk-SOZCWT6I.js";import{buttonClasses as P}from"./chunk-UQYNPYF4.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as M}from"./chunk-IUVGHHR3.js";import{useRef as R,useMemo as U,useCallback as V,useState as B,useEffect as G}from"react";import{jsxs as W,Fragment as H,jsx as K}from"react/jsx-runtime";var J="application/x-efficient-media-files",X="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function $(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Q={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */K(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */K(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */K(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */K(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */K(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */K(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */K(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */K(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */K(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */K(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */K(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */K(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */K(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */K(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */K(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */K(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */K(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */K(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */K(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */K(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(O){const{mode:$="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=Q,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ne,onRename:Ce,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:ze,onEmptyTrash:Te,onReplace:Fe,onCropEdit:Le,onOpenInDesign:Oe,onChoose:Ee,onCancel:Pe,pickNote:Ae,onDragOut:Me,className:Re=""}=O,Ue=M().mediaLibrary,Ve=M().media,Be="pick"===$,Ge=!Be,We=R(null),He=A(We,"phone"===_?343:1200),Ke="phone"===_||"auto"===_&&He<640,Je=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),Xe=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Ye=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Xe.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Xe]),$e=V(e=>{const n=[];for(let l=e?Xe.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Xe.get(l.parentId):void 0);return n},[Xe,le.length]),Qe=V((e,n)=>$e(e).some(e=>e.id===n),[$e]),[Ze,qe]=B(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=V(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;G(()=>{if("files"===ee.place)en(["@files",...$e(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Je.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?Je.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=v(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=R(!0);G(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");G(()=>{he&&mn.setSelection(he)},[gn]);const vn=R(gn??""),kn=pn.join("\0");G(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Be?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=B(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Xe.get(n.id)?.name:un.get(n.id)?.name)&&Ce?.(n,e)},Nn=async e=>{if(!Ne)return;const n=await Ne(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Cn=V(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=Xe.get(e.id);return n===e.id||n&&Qe(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:s,label:Ue.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of Ye.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[Ye,Xe,tn,Qe,on,Ue]),In=V(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=B(null),jn={words:Ue,media:Ve,denied:ve,moveTargets:Cn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ne&&Ge?e=>{Nn(e)}:void 0,rename:Ce&&Ge?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&Ge?Ie:void 0,trash:De&&Ge?De:void 0,deleteFolder:Se&&Ge?Se:void 0,folderNotEmpty:e=>!!Xe.get(e)?.notEmpty,replace:Fe&&Ge?Fe:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Ue.urlLabel,n)},openInDesign:Oe,restore:je,deleteForever:ze},zn=e=>c(e,jn),Tn=w(),Fn=(e,n)=>{Be||(mn.isSelected(e)||mn.select(e),Tn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Ln,On]=B(null),[En,Pn]=B(null),[An,Mn]=B(null);G(()=>{if(!En&&!Ln)return;const e=()=>{Pn(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[En,Ln]);const Rn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Be)&&(!!Rn(e,J)||!(!Rn(e,X)||!An)&&(n!==An&&!(n&&Qe(n,An)))),Vn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Ln!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),On(null),Rn(e,J)){let l;try{l=JSON.parse(e.dataTransfer.getData(J))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else An&&(Ie({kind:"folder",id:An},n),Mn(null))}}),Bn=e=>{const n=e=>Rn(e,J)||Rn(e,X)||Rn(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&En!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Gn=(e,n,l)=>/* @__PURE__ */K(E,{side:"right",content:En===e?Ue.noDropProducts:sn(l),open:En===e||!En&&void 0,children:/* @__PURE__ */K("span",{children:n})}),Wn=e=>({onContextMenu:n=>{Tn.open(n,e)}}),Hn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=Ze.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
2
- return W("div",{role:"none",className:"contents",children:[
3
- /* @__PURE__ */K(n,{label:Gn(i,e.name,t),level:r,icon:d&&o?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Bn(i),...Ge?Wn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */K(l,{children:Hn(d,r+1,t)})]},e.id)}),Kn=(e,r)=>(Ye.get(e)??[]).map(e=>{const a=Ye.get(e.id),i=Ze.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=zn({kind:"folder",id:e.id});/* @__PURE__ */
4
- return W("div",{role:"none",className:"contents",children:[
5
- /* @__PURE__ */K(n,{label:e.name,level:r,icon:a&&i?Z.folderOpen:Z.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:Ln===e.id?"into":void 0,dragging:An===e.id,draggable:Ge&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */K(m,{value:e.name,label:Ue.folderName,onDone:xn}):void 0,actions:Ge&&o.length?/* @__PURE__ */K(I,{align:"end","aria-label":Ue.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Vn(e.id,e.id),...Ge?Wn({kind:"folder",id:e.id}):{},...Ge&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(X,e.id),Mn(e.id)},onDragEnd:()=>{Mn(null),On(null)}}:{}}}),a&&i&&/* @__PURE__ */K(l,{children:Kn(e.id,r+1)})]},e.id)}),Jn=Ze.has("@files"),Xn=Ze.has("@products"),Yn=/* @__PURE__ */W(e,{"aria-label":Ue.folders,children:[re&&/* @__PURE__ */W(H,{children:[
6
- /* @__PURE__ */K(n,{label:Gn("@products",Ue.products),level:1,icon:Z.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:re.length?Xn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Xn&&re.length>0&&/* @__PURE__ */K(l,{children:Hn(re,2)})]}),
7
- /* @__PURE__ */K(n,{label:Ue.allFiles,level:1,icon:Jn?Z.folderOpen:Z.folder,count:ae,countLabel:null!=ae?Ue.fileCount(ae):void 0,expanded:Ye.get(null)?.length?Jn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===Ln?"into":void 0,rowProps:{"data-media-row":"@files",...Vn("@files",null)}}),Jn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */K(l,{children:Kn(null,2)}),Ge&&/* @__PURE__ */K(n,{label:Ue.trash,level:1,icon:Z.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),$n=(()=>{if(an)return[{label:Ue.trash}];if(rn){const e=ee.nodeId?Je.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=$e(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),Qn=rn?Ue.readOnly:ve.upload,Zn=!!xe&&!an&&!Qn,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Zn,onAccept:e=>xe?.(e,on)}),_n=rn?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */W("div",{className:"flex flex-wrap items-center gap-2",children:[Ge&&Ne&&!an&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{Nn(on)},...el(_n),children:Ue.newFolder}),xe&&!an&&/* @__PURE__ */K(L,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>qn.open(),...el(Qn),children:Ue.upload}),Ge&&an&&Te&&te.length>0&&/* @__PURE__ */K(L,{variant:"danger",size:"sm",onClick:Te,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */K("div",{style:{width:Ke?void 0:a,flex:Ke?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */K(p,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */W("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */K("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */K(C,{size:"sm",type:"search",leftIcon:Z.search,placeholder:rn?Ue.searchProducts:Ue.search,"aria-label":rn?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],rl("use"),130),ce&&Ge&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */K(k,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:Z.grid},{value:"list",label:Ue.list,icon:Z.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */K(F,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=Ge&&tn&&!!Ie&&!ve.move,dl=!!Me&&!an,sl=R(""),cl=R(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=R(Me);ml.current=Me;const pl=V(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),z(sl.current,!1),e&&ml.current?.(e))},[]),hl=V(e=>{pl(ul());const n=We.current?.ownerDocument;if(!n)return;sl.current=T(We.current);const l=We.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&z(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,z(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);G(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Me(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[Y]:gl(e)}}:{}})),kl=Ke?Math.max(72,Math.floor((He-24-16-1)/3)):112,yl=R(null),bl=g({containerRef:yl,enabled:Ge&&!Ke&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Be){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Ee?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},xl=te.length?null:oe?/* @__PURE__ */K(t,{variant:"dashed",title:Ue.noMatches}):rn?/* @__PURE__ */K(t,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */K(t,{variant:"dashed",title:Ue.trashEmpty}):!Zn||Be?/* @__PURE__ */K(t,{variant:"dashed",title:Ue.emptyFolder}):null,Nl="list"===me&&te.length>0,Cl=xl??(Nl?/* @__PURE__ */K("ul",{role:"listbox","aria-multiselectable":Ge||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */W("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>Fn(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
8
- /* @__PURE__ */K("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
9
- /* @__PURE__ */K("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
10
- /* @__PURE__ */K("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */K("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */K(h,{items:vl,readOnly:!Zn||Be,onFiles:Zn&&!Be?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?J:dl?Y:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:Ge?Fn:void 0,menuOnMedia:Ge})),Il=u({count:pn.length,kind:In(pn),targets:Cn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Dl=P({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */K(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */W(H,{children:[Z.folder,Ue.moveTo]}),items:Il,disabled:!!ve.move}),jl=Ge&&pn.length>1&&!rn?/* @__PURE__ */W("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
11
- /* @__PURE__ */K(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */W(H,an?{children:[je&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>je(pn),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */K(L,{variant:"secondary-danger",size:"sm",onClick:()=>ze(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Sl,Ce&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
12
- /* @__PURE__ */K(L,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,zl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,r?/* @__PURE__ */K(m,{value:e.name,label:Ue.fileName,onDone:xn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),rn?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const a=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
13
- return W("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
14
- /* @__PURE__ */K("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */K(N,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
15
- /* @__PURE__ */K(o,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */W("div",{className:"flex gap-2",children:[
16
- /* @__PURE__ */K("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */K(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
17
- /* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>jn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&Ge&&/* @__PURE__ */W("div",{className:"flex flex-wrap gap-2",children:[Fe&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>Fe(e.id),...el(ve.replace),children:Ue.replace}),Le&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>Le(e.id),children:Ue.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */K(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */W(H,{children:[Z.folder,Ue.moveTo]}),items:a.items,disabled:!!ve.move}),Ce&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */K(D,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:Z.trash})]}),an&&Ge&&/* @__PURE__ */W("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */K(L,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */K(L,{variant:"danger",size:"sm",onClick:()=>ze([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),rn&&Oe&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */K(f,{items:ge})]})},Tl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,Fl=Be?/* @__PURE__ */W("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
18
- /* @__PURE__ */K("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
19
- /* @__PURE__ */W("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */K(L,{variant:"secondary",size:"sm",onClick:Pe,children:Ue.cancel}),
20
- /* @__PURE__ */K(L,{variant:"primary",size:"sm",disabled:!hn,...el(Tl),onClick:()=>{hn&&!Tl&&Ee?.(hn)},children:Ue.chooseImage})]})]}):null,Ll=Ge&&!!hn,Ol=/* @__PURE__ */W("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */K(N,{tone:"neutral",children:Ae}),
21
- /* @__PURE__ */W("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
22
- /* @__PURE__ */K(d,{items:$n}),nl]}),al,jl,
23
- /* @__PURE__ */W("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{Ge&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Cl,
24
- /* @__PURE__ */K(r,{rect:bl.rect})]}),Zn&&/* @__PURE__ */K("input",{...qn.inputProps}),
25
- /* @__PURE__ */K(j,{rejections:qn.rejections})]});/* @__PURE__ */
26
- return W("div",{ref:We,"data-media-library":"","data-layout":Ke?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Re}`.trim(),children:[/* @__PURE__ */W("div",Ke?{className:"flex flex-col gap-3 p-3",children:[Yn,Ol]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
27
- /* @__PURE__ */K("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Yn}),
28
- /* @__PURE__ */K("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Ol}),Ll&&/* @__PURE__ */K("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:zl(hn)})]}),Fl,Ke&&/* @__PURE__ */K(i,{open:Ll,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&zl(hn)}),Tn.state&&/* @__PURE__ */K(x,{...Tn.props,items:zn(Tn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */K(a,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{J as MEDIA_FILES_DRAG_TYPE,Y as MEDIA_FILE_DRAG_TYPE,X as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,$ as readMediaFileDrag};
@@ -1,3 +0,0 @@
1
- import{DropdownMenu as e}from"./chunk-3DSGJIC7.js";import{Button_default as i}from"./chunk-EVYD6UFQ.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as l,useId as o}from"react";import{jsxs as s,jsx as t}from"react/jsx-runtime";var d="relative focus-visible:z-10",m={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},c=l(function({children:l,onClick:c,type:b="button",items:h,menuLabel:u,variant:f="primary",size:p="md",loading:v=!1,leftIcon:k,disabled:g=!1,disabledReason:N,tooltip:w,menuDisabled:x=!1,menuDisabledReason:j,onMenuOpenChange:y,menuFooter:C,menuFooterLabel:D,align:I="end",side:W="bottom",menuMinWidth:z,linkAs:F,block:O=!1,className:R=""},S){const L=g&&(null!=N&&""!==N&&!1!==N)&&!v,Y=x&&null!=j&&""!==j&&!1!==j,$=o(),A=/* @__PURE__ */t(i,{ref:S,type:b,variant:f,size:p,loading:v,leftIcon:k,block:O,disabled:g&&!L,"aria-disabled":!!L||void 0,disabledReason:L?N:void 0,onClick:c,className:`rounded-r-none ${d}`,children:l}),M=O?"relative flex min-w-0 flex-1":"relative inline-flex",P=p.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
2
- return s("div",{className:[O?"flex w-full":"inline-flex","items-stretch",R].filter(Boolean).join(" "),children:[null==w||""===w||L?A:/* @__PURE__ */t(r,{content:w,className:M,children:A}),
3
- /* @__PURE__ */t(r,{content:Y?j:u,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */t(e,{"aria-label":u,"aria-describedby":Y?$:void 0,items:h,align:I,side:W,minWidth:z,linkAs:F,disabled:x&&!Y,"aria-disabled":Y,onOpenChange:y,footer:C,footerLabel:D,triggerClassName:a({variant:f,size:p,className:`rounded-l-none ${m[f]} ${d}`}),trigger:/* @__PURE__ */t(n,{name:"chevron-down",className:P,strokeWidth:2,"aria-hidden":"true"})})}),Y&&/* @__PURE__ */t("span",{id:$,className:"sr-only",children:j})]})});export{c as SplitButton_default};
@@ -1 +0,0 @@
1
- import{useLayoutEffect as n,useEffect as r,useSyncExternalStore as t,useRef as e,useState as u,useCallback as c}from"react";var o="undefined"!=typeof window&&"undefined"!=typeof document?n:r,f=()=>()=>{},i=()=>!0,d=()=>!1;function p(){return t(f,i,d)}function a(n,r,e=f){return t(e,n,()=>r)}function l(n,r){const u=e(null);return t(f,()=>(u.current??={value:n()}).value,()=>r)}function m(n,r){const t=p(),[f,i]=u(()=>t?n():r),d=e(t),a=e(n);a.current=n,o(()=>{t&&!d.current&&(d.current=!0,i(a.current()))},[t]);return[f,c(n=>{d.current?i(n):(d.current=!0,i("function"==typeof n?n(a.current()):n))},[])]}export{o as useBrowserLayoutEffect,m as useBrowserState,a as useBrowserValue,l as useBrowserValueOnce,p as useHydrated};
@@ -1,9 +0,0 @@
1
- import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-IUVGHHR3.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,C=c(null),F=o(C),E=x??F,[H,A]=m(null),{highlighted:U}=n();if(0===f.length||0===k.length)/* @__PURE__ */
2
- return d("div",{className:M,ref:C,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const V=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),z=e=>V.length<=1?0:V.indexOf(e)/(V.length-1)*(E-g-140)+70,O=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),Q=/* @__PURE__ */new Map;for(const e of f)Q.set(e.depth,[...Q.get(e.depth)??[],e]);const R=Math.max(...[...Q.values()].map(e=>e.reduce((e,t)=>e+(O.get(t.key)??0),0))),W=p-20,Y=R>0?(W-y*(Math.max(...[...Q.values()].map(e=>e.length))-1))/R:0,B=/* @__PURE__ */new Map;for(const[e,t]of Q){const n=t.map(e=>Math.max(2,(O.get(e.key)??0)*Y)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>W&&l>0?Math.max(0,1-(o-W)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;B.set(t.key,{x:z(e),y:a,h:l,index:o}),a+=l+y})}const G=/* @__PURE__ */new Map,I=/* @__PURE__ */new Map,L=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,S="link"===H?.kind?k[H.index]:void 0,T="node"===H?.kind?f.find(e=>e.key===H.key):void 0;/* @__PURE__ */
3
- return u("div",{className:`relative ${M??""}`,ref:C,children:[
4
- /* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${E} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>A(null),children:[k.map((e,n)=>{const o=B.get(e.from),l=B.get(e.to);if(!o||!l)return null;const a=Math.max(1,e.value*Y),i=o.y+(G.get(e.from)??0)+a/2,s=l.y+(I.get(e.to)??0)+a/2;G.set(e.from,(G.get(e.from)??0)+a),I.set(e.to,(I.get(e.to)??0)+a);const h=o.x+g,c=l.x,m=r(o.index,e.color),u=`${e.from}→${e.to}`,f=L.get(u)??0;L.set(u,f+1);const k=((e,t)=>H?"link"===H.kind?H.index===t:P(e,H.key):null!==U?P(e,U):null)(e,n);/* @__PURE__ */
5
- return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>A({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=B.get(e.key);if(!t)return null;const n=t.x>E/2,o=(l=e.key,H?"node"===H.kind?H.key===l:P(k[H.index],l):null!==U?U===l:null);var l;/* @__PURE__ */
6
- return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>A({kind:"node",key:e.key}),children:[
7
- /* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:r(t.index,e.color,e.tone)}),
8
- /* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:a.label,children:e.label})]},e.key)})]}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:`${S.from} → ${S.to}`,rows:[{key:"value",label:b.flow,color:r(B.get(S.from)?.index??0,S.color),value:$(S.value)}]})}),T&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:T.label,rows:[{key:"value",label:b.throughput,color:r(B.get(T.key)?.index??0,T.color,T.tone),value:$(O.get(T.key)??0)}]})}),
9
- /* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,$(e.value)])})]})}export{f as SankeyChart};