efficient-shell 12.8.1 → 12.11.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 (345) hide show
  1. package/README.md +37 -2
  2. package/dist/{Browser-DEXVIONU.js → Browser-6O7SDMZ5.js} +16 -16
  3. package/dist/Calculator-ALPNISJT.js +29 -0
  4. package/dist/{CurrencyConverter-H4M35SIY.js → CurrencyConverter-KBY2OXQ2.js} +8 -8
  5. package/dist/Files-3NTP7YKY.js +126 -0
  6. package/dist/{Notepad-PSDXZTBI.js → Notepad-GF5GBZGV.js} +9 -9
  7. package/dist/PdfViewer-L4FJS3M6.js +1 -0
  8. package/dist/{PomodoroTimer-SKAUQXPO.js → PomodoroTimer-NGQPYDI3.js} +68 -68
  9. package/dist/{Preview-HBB2SWJY.js → Preview-KVV6SE3C.js} +30 -30
  10. package/dist/Sidebar-QOGK5LJ2.js +44 -0
  11. package/dist/{Stock-X7GEAET7.js → Stock-O7AQ2WUN.js} +2 -2
  12. package/dist/{Weather-OH5PIQLU.js → Weather-WHXA5TTP.js} +21 -21
  13. package/dist/{WorldClock-S5NSJ7ZX.js → WorldClock-CZCIVYKB.js} +6 -6
  14. package/dist/ai/index.js +34 -34
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.d.ts +55 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FlowChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/SpecChart.js +1 -1
  42. package/dist/charts/StatTile.js +1 -1
  43. package/dist/charts/SunburstChart.js +1 -1
  44. package/dist/charts/TimeSeriesChart.js +1 -1
  45. package/dist/charts/TreemapChart.js +1 -1
  46. package/dist/charts/WaterfallChart.js +1 -1
  47. package/dist/{chunk-ROM25ZMZ.js → chunk-22LU6FKN.js} +10 -10
  48. package/dist/{chunk-NC36LJCA.js → chunk-2GS2VOQT.js} +10 -10
  49. package/dist/{chunk-UK6XNW3I.js → chunk-2NZBQOA6.js} +12 -12
  50. package/dist/{chunk-4ZUV6WQT.js → chunk-2WNTDGOP.js} +1 -1
  51. package/dist/{chunk-MZG3FS5T.js → chunk-2X4U3VX2.js} +6 -6
  52. package/dist/{chunk-6JDR6T4U.js → chunk-3RDJFCIZ.js} +1 -1
  53. package/dist/{chunk-5NDONLH5.js → chunk-42BVXJZN.js} +3 -3
  54. package/dist/{chunk-3KP3EIYP.js → chunk-457SK2XV.js} +5 -5
  55. package/dist/{chunk-Z2MNXUM6.js → chunk-4GTXRVDF.js} +2 -2
  56. package/dist/{chunk-G2X5YYIQ.js → chunk-4MUE4CYB.js} +2 -2
  57. package/dist/{chunk-3CMCGOOV.js → chunk-4UQNNA4K.js} +4 -4
  58. package/dist/{chunk-NEAT7BIP.js → chunk-5G4CB3E6.js} +1 -1
  59. package/dist/{chunk-PH3P54QQ.js → chunk-5HOXR3L4.js} +1 -1
  60. package/dist/{chunk-Y4RERPFN.js → chunk-5QVCBAK2.js} +1 -1
  61. package/dist/chunk-5RT5XDHG.js +6 -0
  62. package/dist/{chunk-3UHTHQGK.js → chunk-5S4YF5XA.js} +8 -8
  63. package/dist/{chunk-OGPCFMNA.js → chunk-5WCHUZ6O.js} +1 -1
  64. package/dist/{chunk-KUUZFLT6.js → chunk-5YPCZLBW.js} +1 -1
  65. package/dist/{chunk-PT77FC5X.js → chunk-5Z6XJPAX.js} +1 -1
  66. package/dist/{chunk-B7LNSGNR.js → chunk-63J2MBXV.js} +10 -10
  67. package/dist/chunk-675RYIWR.js +7 -0
  68. package/dist/{chunk-BDWZLMIT.js → chunk-67BWG353.js} +9 -9
  69. package/dist/{chunk-SCU2CWNJ.js → chunk-6BK3KRT5.js} +18 -18
  70. package/dist/{chunk-X7APOT53.js → chunk-6BQUSUNK.js} +7 -7
  71. package/dist/{chunk-NU7LUJX5.js → chunk-6ITEA6SX.js} +1 -1
  72. package/dist/{chunk-4KJ7MLWO.js → chunk-6JLXXX4H.js} +5 -5
  73. package/dist/{chunk-C37PXEEH.js → chunk-6P7SIIG4.js} +14 -14
  74. package/dist/{chunk-CNVYM3HP.js → chunk-6YIVKPWQ.js} +1 -1
  75. package/dist/{chunk-YJIFJIXV.js → chunk-7Q4DE4CT.js} +1 -1
  76. package/dist/chunk-7XGUX3TH.js +3 -0
  77. package/dist/{chunk-NKMSGZZ3.js → chunk-A2JYBUPB.js} +5 -5
  78. package/dist/{chunk-IYPRFUTT.js → chunk-AKTEMZOT.js} +1 -1
  79. package/dist/{chunk-F6QSHKUR.js → chunk-AMSE4PMQ.js} +4 -4
  80. package/dist/{chunk-TX5FZBPQ.js → chunk-ASOVTAIT.js} +1 -1
  81. package/dist/{chunk-CD7P34VC.js → chunk-AUCNJFTP.js} +7 -7
  82. package/dist/{chunk-BGJMDP6J.js → chunk-BJAJOIVY.js} +1 -1
  83. package/dist/chunk-BR7L5NE3.js +13 -0
  84. package/dist/{chunk-DJ2XDBAO.js → chunk-BUZ5AJLR.js} +6 -6
  85. package/dist/{chunk-EOGXCGQF.js → chunk-BYDSBDVS.js} +6 -6
  86. package/dist/{chunk-YUB3TJKO.js → chunk-C3E6XFIC.js} +3 -3
  87. package/dist/{chunk-45IVWLKF.js → chunk-C7M7KYNY.js} +1 -1
  88. package/dist/chunk-CA3OC4YY.js +9 -0
  89. package/dist/{chunk-H7HRYFRQ.js → chunk-CB5FQMFB.js} +9 -9
  90. package/dist/{chunk-UOUVHHTC.js → chunk-CINGDJPM.js} +1 -1
  91. package/dist/{chunk-6LYBE7LM.js → chunk-CRRC72EE.js} +9 -9
  92. package/dist/{chunk-NS37Y5CN.js → chunk-D4K72BHN.js} +1 -1
  93. package/dist/chunk-DVYIZP7X.js +31 -0
  94. package/dist/{chunk-BFO72WQB.js → chunk-EDANELWX.js} +1 -1
  95. package/dist/chunk-EHVBJUQI.js +28 -0
  96. package/dist/{chunk-ZC3TSMFK.js → chunk-EIXMUGVZ.js} +2 -2
  97. package/dist/{chunk-7FBAZLBX.js → chunk-EVEGK57J.js} +1 -1
  98. package/dist/{chunk-7HTDD37H.js → chunk-F7BXUVN4.js} +5 -5
  99. package/dist/{chunk-XFD4BLP7.js → chunk-FOCQEWUH.js} +1 -1
  100. package/dist/chunk-FQHY6DTF.js +4 -0
  101. package/dist/{chunk-4UGFNTZ3.js → chunk-FZWAOYAM.js} +7 -7
  102. package/dist/{chunk-NEYHBQLG.js → chunk-G3VRO4CK.js} +2 -2
  103. package/dist/{chunk-FPYABAOX.js → chunk-GB2XLSR5.js} +11 -11
  104. package/dist/{chunk-TS36J7RW.js → chunk-GBEDLYND.js} +2 -2
  105. package/dist/{chunk-4EVBKID5.js → chunk-GMJ5WOB2.js} +1 -1
  106. package/dist/{chunk-4JYHS4VJ.js → chunk-GMLDGXNQ.js} +1 -1
  107. package/dist/{chunk-PPSA3QLE.js → chunk-HD7OBASH.js} +1 -1
  108. package/dist/{chunk-NPIZ2Y3P.js → chunk-HE24VQMU.js} +1 -1
  109. package/dist/{chunk-3WFJ4PYV.js → chunk-HEX3EP5F.js} +3 -3
  110. package/dist/chunk-HL3V67JZ.js +2 -0
  111. package/dist/{chunk-5Q7VFXEO.js → chunk-HRDR56SK.js} +3 -3
  112. package/dist/chunk-HULQSIX5.js +8 -0
  113. package/dist/{chunk-OY3JH66O.js → chunk-HV4VQ5XV.js} +7 -7
  114. package/dist/{chunk-E227NVFX.js → chunk-IARCNQD3.js} +1 -1
  115. package/dist/{chunk-RJKMFIM3.js → chunk-ICNGLA5O.js} +6 -6
  116. package/dist/{chunk-VVQJHQW6.js → chunk-IIMFLLYT.js} +8 -8
  117. package/dist/{chunk-GHZ4PP62.js → chunk-INFL4YZF.js} +1 -1
  118. package/dist/{chunk-Y46WPTKY.js → chunk-ISU4FCEX.js} +7 -7
  119. package/dist/chunk-ISZOD5S6.js +2 -0
  120. package/dist/{chunk-H6PFTU3L.js → chunk-J4IT5C3A.js} +1 -1
  121. package/dist/{chunk-GLJILR2Y.js → chunk-J7BMSKOM.js} +5 -5
  122. package/dist/{chunk-DW45EZHA.js → chunk-JGJWPONL.js} +5 -5
  123. package/dist/{chunk-JY2OBPVO.js → chunk-JOD5ISTB.js} +1 -1
  124. package/dist/{chunk-TRWHVG3A.js → chunk-JTZVUO3I.js} +1 -1
  125. package/dist/{chunk-YMNWUQGV.js → chunk-JVNJCRHM.js} +4 -4
  126. package/dist/{chunk-N5LVUI7R.js → chunk-KFS7WSCC.js} +11 -11
  127. package/dist/{chunk-XZH5PEML.js → chunk-KIRLSUQT.js} +5 -5
  128. package/dist/{chunk-WMLBMR4E.js → chunk-KOPTKTHN.js} +3 -3
  129. package/dist/{chunk-3LTZ4N46.js → chunk-KPHYWZXL.js} +13 -13
  130. package/dist/{chunk-HQA7SPU5.js → chunk-KRUI4LVW.js} +1 -1
  131. package/dist/chunk-KVU5IQOZ.js +7 -0
  132. package/dist/{chunk-BXU3LX44.js → chunk-KWTK6TGH.js} +1 -1
  133. package/dist/{chunk-AXTVK6LU.js → chunk-KZ7RR7EU.js} +1 -1
  134. package/dist/{chunk-ZYW4KSEE.js → chunk-LFW3CQMF.js} +4 -4
  135. package/dist/{chunk-6HH6KNJB.js → chunk-LFWRHBTM.js} +2 -2
  136. package/dist/{chunk-X5ZY35KZ.js → chunk-LS6VU6F7.js} +1 -1
  137. package/dist/{chunk-5NONOFIV.js → chunk-M4MN2GOE.js} +1 -1
  138. package/dist/{chunk-GJ23UZDQ.js → chunk-MAI2DN7N.js} +1 -1
  139. package/dist/{chunk-7B5KFESH.js → chunk-MBXCXFQO.js} +1 -1
  140. package/dist/{chunk-32WEY6O5.js → chunk-MEAJGM6F.js} +1 -1
  141. package/dist/{chunk-DNLRUZGS.js → chunk-MPTOEXED.js} +1 -1
  142. package/dist/chunk-MTP3MBZA.js +22 -0
  143. package/dist/{chunk-EUUCNDIS.js → chunk-NAWIVFAN.js} +13 -13
  144. package/dist/{chunk-54K2ADBT.js → chunk-NDAZPAQL.js} +1 -1
  145. package/dist/{chunk-SYIJRZIS.js → chunk-NOC4WIME.js} +2 -2
  146. package/dist/chunk-NOCOLZ2W.js +1 -0
  147. package/dist/{chunk-SCGBCBXP.js → chunk-NV7QRWQJ.js} +1 -1
  148. package/dist/{chunk-XK4U5MAS.js → chunk-O3YCIWHF.js} +1 -1
  149. package/dist/{chunk-MCJ4JHLE.js → chunk-OAFFHLJ4.js} +5 -5
  150. package/dist/chunk-OSNHRKX6.js +5 -0
  151. package/dist/{chunk-BTUI3MKS.js → chunk-OSQ5NRV3.js} +1 -1
  152. package/dist/{chunk-GG4ZXQXG.js → chunk-OW5LQWPU.js} +3 -3
  153. package/dist/{chunk-3I67TIGD.js → chunk-PEIRPNXT.js} +21 -21
  154. package/dist/{chunk-LGK47SEN.js → chunk-PHJFGLXB.js} +12 -12
  155. package/dist/{chunk-7FRG5CF7.js → chunk-PICRPJBL.js} +1 -1
  156. package/dist/{chunk-HS6KTFW6.js → chunk-POOPWYJL.js} +10 -10
  157. package/dist/chunk-PY7GHIYF.js +19 -0
  158. package/dist/chunk-PYBPJL5R.js +1 -0
  159. package/dist/{chunk-7HIHQR3X.js → chunk-Q3RJMQYE.js} +1 -1
  160. package/dist/{chunk-QR46K5SB.js → chunk-QBSIM4JB.js} +1 -1
  161. package/dist/{chunk-LLUHE2ZW.js → chunk-QIMMZVWV.js} +1 -1
  162. package/dist/{chunk-NHWDB7R6.js → chunk-QMNDKNK2.js} +1 -1
  163. package/dist/{chunk-RIXX6NRV.js → chunk-QQM36CYU.js} +1 -1
  164. package/dist/{chunk-J33QE4J7.js → chunk-QSK2OWT3.js} +2 -2
  165. package/dist/{chunk-2JXGTA73.js → chunk-RAQBZUU2.js} +65 -65
  166. package/dist/{chunk-YMAU4EIK.js → chunk-RGKSJBXJ.js} +8 -8
  167. package/dist/{chunk-H6IGZWC2.js → chunk-RHD4V6CE.js} +9 -9
  168. package/dist/{chunk-VQJLH2BU.js → chunk-RIF6BFEH.js} +1 -1
  169. package/dist/{chunk-TXZR5G55.js → chunk-RLGPIJHB.js} +1 -1
  170. package/dist/{chunk-R3K3LVVS.js → chunk-RQKD5AAL.js} +1 -1
  171. package/dist/{chunk-I3QFYBOP.js → chunk-SEHKTBVM.js} +1 -1
  172. package/dist/{chunk-75MSXRFY.js → chunk-SFFELHLP.js} +5 -5
  173. package/dist/{chunk-SBZCJNNP.js → chunk-SY65V6K7.js} +10 -10
  174. package/dist/{chunk-UIWGVOFH.js → chunk-T3NLFOLW.js} +2 -1
  175. package/dist/{chunk-JYD6PSDA.js → chunk-TDMZFQRB.js} +1 -1
  176. package/dist/chunk-TJSJVC6P.js +1 -0
  177. package/dist/{chunk-MX2YRSMZ.js → chunk-TKFINWY6.js} +2 -2
  178. package/dist/{chunk-MM5AFQ24.js → chunk-TVVSFXWY.js} +7 -7
  179. package/dist/{chunk-EZWWQHD3.js → chunk-UD4NESX7.js} +1 -1
  180. package/dist/{chunk-NJTFI7AA.js → chunk-UG5GKEU5.js} +1 -1
  181. package/dist/{chunk-UZZVI7EN.js → chunk-UMZJRZFN.js} +1 -1
  182. package/dist/{chunk-LTESFDTF.js → chunk-V6FHZGCL.js} +1 -1
  183. package/dist/{chunk-2UBASCOK.js → chunk-VLCHHTX6.js} +1 -1
  184. package/dist/{chunk-VROBW74Y.js → chunk-VN3A43SA.js} +1 -1
  185. package/dist/{chunk-QQXQQPCD.js → chunk-VPZOSVDF.js} +9 -9
  186. package/dist/{chunk-DPUM3H5N.js → chunk-VWNHSLFY.js} +1 -1
  187. package/dist/{chunk-HE767CVB.js → chunk-W5B7UNMJ.js} +1 -1
  188. package/dist/{chunk-H27KA5IL.js → chunk-WDAOTHX5.js} +3 -3
  189. package/dist/{chunk-R3JKZXII.js → chunk-WJBP5SND.js} +5 -5
  190. package/dist/{chunk-LLAYWMYS.js → chunk-WM2BBRT6.js} +1 -1
  191. package/dist/{chunk-XVIDD6F3.js → chunk-Y4YXZIES.js} +8 -8
  192. package/dist/chunk-YMD2F3NL.js +1 -0
  193. package/dist/{chunk-525O4AUQ.js → chunk-YRG6XJ6M.js} +8 -8
  194. package/dist/chunk-YVAJ42M2.js +8 -0
  195. package/dist/{chunk-DZBGJ6X4.js → chunk-YVIV7SKG.js} +1 -1
  196. package/dist/{chunk-53EW4M5S.js → chunk-YX4MRM7A.js} +6 -6
  197. package/dist/{chunk-EZ6SVQSV.js → chunk-Z334LCCX.js} +1 -1
  198. package/dist/{chunk-7KIDOIPY.js → chunk-Z7RXWXR5.js} +1 -1
  199. package/dist/{chunk-23WJCEYD.js → chunk-ZC6MXV4L.js} +1 -1
  200. package/dist/{chunk-7H7U3HC6.js → chunk-ZR2UWJIR.js} +4 -4
  201. package/dist/data/DataTable.js +1 -1
  202. package/dist/data/EntityList.js +1 -1
  203. package/dist/data/Kanban.js +1 -1
  204. package/dist/data/ListFooter.js +1 -1
  205. package/dist/data/ListLoadError.js +1 -1
  206. package/dist/data/Pagination.js +1 -1
  207. package/dist/data/ResizableTable.js +1 -1
  208. package/dist/file-intake/index.js +1 -1
  209. package/dist/forms/BorderInput.js +1 -1
  210. package/dist/forms/BrandAssetEditor.js +1 -1
  211. package/dist/forms/Calendar.js +1 -1
  212. package/dist/forms/ColorPicker.js +1 -1
  213. package/dist/forms/ComposerAttachments.js +1 -1
  214. package/dist/forms/CornersInput.js +1 -1
  215. package/dist/forms/DatePicker.js +1 -1
  216. package/dist/forms/DateRangePicker.js +1 -1
  217. package/dist/forms/DateTimePicker.js +1 -1
  218. package/dist/forms/DisplayChips.js +1 -1
  219. package/dist/forms/FilePicker.js +1 -1
  220. package/dist/forms/FormErrorSummary.js +1 -1
  221. package/dist/forms/IconPicker.js +1 -1
  222. package/dist/forms/ImageFocusPoint.js +1 -1
  223. package/dist/forms/Input.js +1 -1
  224. package/dist/forms/InputNumber.js +1 -1
  225. package/dist/forms/LinkPicker.js +1 -1
  226. package/dist/forms/MediaLibrary.js +1 -1
  227. package/dist/forms/MediaUploadField.js +1 -1
  228. package/dist/forms/MediaUploadGrid.js +1 -1
  229. package/dist/forms/MediaUsedInList.js +1 -1
  230. package/dist/forms/NumericKeypad.js +1 -1
  231. package/dist/forms/PositionInput.js +1 -1
  232. package/dist/forms/RenameField.js +1 -1
  233. package/dist/forms/Select.js +1 -1
  234. package/dist/forms/SidesInput.js +1 -1
  235. package/dist/forms/Slider.js +1 -1
  236. package/dist/forms/Snippet.js +1 -1
  237. package/dist/forms/SplitButton.js +1 -1
  238. package/dist/forms/TagInput.js +1 -1
  239. package/dist/forms/TextToolbar.js +1 -1
  240. package/dist/forms/TimePicker.js +1 -1
  241. package/dist/forms/UnitMenu.js +1 -1
  242. package/dist/forms/WidthsBar.js +1 -1
  243. package/dist/forms/mediaLibraryMenu.js +1 -1
  244. package/dist/forms/mediaMoveItems.js +1 -1
  245. package/dist/forms/textAlign.js +1 -1
  246. package/dist/forms/useFileIntake.js +1 -1
  247. package/dist/icons/efficient-meanings.d.ts +37 -37
  248. package/dist/icons/efficient-meanings.js +1 -1
  249. package/dist/icons/efficient.js +1 -1
  250. package/dist/icons/index.js +1 -1
  251. package/dist/index.js +665 -665
  252. package/dist/locales/zh-Hans.js +1 -1
  253. package/dist/map/index.js +2 -2
  254. package/dist/markdown/index.js +1 -1
  255. package/dist/page-tabs/index.js +5 -5
  256. package/dist/pdf/index.js +1 -1
  257. package/dist/shell/Accordion.js +1 -1
  258. package/dist/shell/AppUpdateBanner.js +1 -1
  259. package/dist/shell/Avatar.js +1 -1
  260. package/dist/shell/Banner.js +1 -1
  261. package/dist/shell/Breadcrumbs.js +1 -1
  262. package/dist/shell/BudgetBar.js +1 -1
  263. package/dist/shell/Card.js +1 -1
  264. package/dist/shell/ColoredBadge.js +1 -1
  265. package/dist/shell/ConfirmDialog.js +1 -1
  266. package/dist/shell/ContainerFillChart.js +1 -1
  267. package/dist/shell/ContextMenu.js +1 -1
  268. package/dist/shell/CountBadge.js +1 -1
  269. package/dist/shell/Dialog.js +1 -1
  270. package/dist/shell/Drawer.js +1 -1
  271. package/dist/shell/DropdownMenu.js +1 -1
  272. package/dist/shell/EditableGrid.js +1 -1
  273. package/dist/shell/EmptyState.js +1 -1
  274. package/dist/shell/GlobalSearch.js +1 -1
  275. package/dist/shell/HelpCenter.js +1 -1
  276. package/dist/shell/IconRail.js +1 -1
  277. package/dist/shell/ImageLightbox.js +1 -1
  278. package/dist/shell/ItemCount.js +1 -1
  279. package/dist/shell/LanguageSelect.js +1 -1
  280. package/dist/shell/Markdown.js +1 -1
  281. package/dist/shell/MetricBar.js +1 -1
  282. package/dist/shell/MetricBarLegend.js +1 -1
  283. package/dist/shell/MilestoneTimeline.js +1 -1
  284. package/dist/shell/PageHeader.js +1 -1
  285. package/dist/shell/PopupMenu.js +1 -1
  286. package/dist/shell/ProductionTimeline.js +1 -1
  287. package/dist/shell/ResizeHandle.js +1 -1
  288. package/dist/shell/Result.js +1 -1
  289. package/dist/shell/SearchableSelect.js +1 -1
  290. package/dist/shell/SettingReset.js +1 -1
  291. package/dist/shell/SettingRow.js +1 -1
  292. package/dist/shell/SidebarLayout.js +1 -1
  293. package/dist/shell/SidebarNav.js +1 -1
  294. package/dist/shell/SortableList.js +1 -1
  295. package/dist/shell/Statistic.js +1 -1
  296. package/dist/shell/StepChain.js +1 -1
  297. package/dist/shell/Stepper.js +1 -1
  298. package/dist/shell/TimeAgo.js +1 -1
  299. package/dist/shell/TimelineTrack.js +1 -1
  300. package/dist/shell/TopNav.js +1 -1
  301. package/dist/shell/TransferProgress.js +1 -1
  302. package/dist/shell/Tree.js +1 -1
  303. package/dist/shell/discardGuard.js +1 -1
  304. package/dist/shell/language.js +1 -1
  305. package/dist/shell/strings.d.ts +8 -0
  306. package/dist/shell/strings.js +1 -1
  307. package/dist/shell/toast.js +1 -1
  308. package/dist/telemetry/index.js +1 -1
  309. package/dist/templates/AuthScreen.js +1 -1
  310. package/dist/templates/ChatTemplate.js +1 -1
  311. package/dist/templates/CheckoutTemplate.js +1 -1
  312. package/dist/templates/DashboardTemplate.js +1 -1
  313. package/dist/templates/DataTablePage.js +1 -1
  314. package/dist/templates/EmailTemplate.js +1 -1
  315. package/dist/templates/ErrorBoundary.js +1 -1
  316. package/dist/templates/ErrorPage.js +1 -1
  317. package/dist/templates/FormLayoutPage.js +1 -1
  318. package/dist/templates/GalleryTemplate.js +1 -1
  319. package/dist/ui/index.js +1 -1
  320. package/dist/version.js +1 -1
  321. package/package.json +1 -1
  322. package/dist/Calculator-NZ2S6CAK.js +0 -29
  323. package/dist/Files-HDTNIXUC.js +0 -121
  324. package/dist/PdfViewer-GUXUWGMG.js +0 -1
  325. package/dist/Sidebar-XGAVJGOL.js +0 -44
  326. package/dist/chunk-27TJNID7.js +0 -13
  327. package/dist/chunk-43MCNASD.js +0 -1
  328. package/dist/chunk-6DZGOGB2.js +0 -1
  329. package/dist/chunk-6EHPEBGP.js +0 -5
  330. package/dist/chunk-A6WZF65N.js +0 -22
  331. package/dist/chunk-C3SE57NF.js +0 -3
  332. package/dist/chunk-GEZ45J4Z.js +0 -2
  333. package/dist/chunk-HEAGOZKJ.js +0 -6
  334. package/dist/chunk-IFIMUNID.js +0 -4
  335. package/dist/chunk-IHPAYSTJ.js +0 -8
  336. package/dist/chunk-KETGA66S.js +0 -9
  337. package/dist/chunk-KO74S3FL.js +0 -28
  338. package/dist/chunk-M54OL3YR.js +0 -2
  339. package/dist/chunk-P2C33RHT.js +0 -1
  340. package/dist/chunk-QLVH66TE.js +0 -31
  341. package/dist/chunk-SE3S362N.js +0 -7
  342. package/dist/chunk-TWFD7A3K.js +0 -1
  343. package/dist/chunk-U5DSVCWV.js +0 -8
  344. package/dist/chunk-UDVQORQM.js +0 -19
  345. package/dist/chunk-WSRM6ZQS.js +0 -7
package/README.md CHANGED
@@ -319,8 +319,13 @@ values predate the labels and are kept so nobody's choice resets).
319
319
  are **grouped** by the taskbar's rule (a page's `taskbarGroup`, else its
320
320
  route — a record files under the list route it was opened with): they sit
321
321
  side by side under a chip naming the group, with a line along their foot.
322
- The chip folds the group to the chip and its tab on screen, and drags the
323
- whole group; a grouped tab drags only within its group, and nothing is
322
+ The chip folds and opens the group, and drags the whole group. **One group
323
+ is open at a time:** opening a group folds every other and shows its first
324
+ tab (unless one of its tabs is already on screen), and a strip starts with
325
+ only the group of the tab on screen open. Folding the group of the tab on
326
+ screen moves to the nearest tab outside it, and a tab of a folded group
327
+ that comes on screen opens its group. The chip's chevron points right while
328
+ its group is open and down while it is folded. A grouped tab drags only within its group, and nothing is
324
329
  dropped inside another group (it lands beside it). A new member of a group
325
330
  joins its end, wherever it was opened from.
326
331
 
@@ -1775,6 +1780,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1775
1780
  | `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (Notepad, Preview, Files, Browser): display name, independent app version and one-line description. Drives each app's "About" dialog (window title menu → About <App>), which also shows the shell version. The dialog's words, and each app's description, are the strings catalog's `aboutApp` section; `description` here is its English default. |
1776
1781
 
1777
1782
  | `setFilesStore`, `createFileServerStore`, `FilesQuotaError`, `FilesStore` (+ `FilesEntry`, `FilesListing`, `FilesFolder`, `FilesTrashEntry`, `FilesQuota`, `FilesShare`, `FilesPerson`, `FilesRole`) | Where the Files app keeps a person's files. See below. |
1783
+ | `chooseInFiles`, `withdrawFilesChoice`, `FILES_ROUTE` (+ `FilesChooseRequest`, `FilesChoice`) | Ask the Files window to choose a file for another window. See below. |
1778
1784
 
1779
1785
  **Documents and Spreadsheets moved to `efficient-office` in 12.0.0.** `utilityApps` no longer has `/spreadsheet`, `documentApps` no longer has `/documents`, and `Documents`, `Spreadsheet`, their `BUILTIN_APP_INFO` entries and the `documents` / `spreadsheet` string sections are gone. A host registers Office's apps at those two routes itself (`efficient-office/documents`, `efficient-office/spreadsheet`). The spreadsheet stage stays here — `setSpreadsheetPreview`, `peekSpreadsheetPreviewStage`, `claimSpreadsheetPreviewStage`, `SPREADSHEET_PREVIEW_UPDATE_EVENT`, `PendingSpreadsheetStage` — and `openAttachment` still opens CSV at `/spreadsheet`, so it reaches Office's window.
1780
1786
 
@@ -1818,11 +1824,40 @@ setFilesStore(driveStore);
1818
1824
  first when a file is opened: return `true` when the host opened it itself
1819
1825
  (an Office document in its editor) and Files does nothing more, `false` for
1820
1826
  Preview or a download as usual.
1827
+ `openLabel(entry)` names Open in the file's right-click menu ("Open in
1828
+ Documents"); unset or `null`, it says "Open".
1829
+ - **Right-click.** A file or folder's right-click menu has the actions its row
1830
+ has: Open, Download, Share, Rename and Delete, as the person may.
1821
1831
  - **Recent Documents.** Opening a file records a desktop shortcut. Give the
1822
1832
  store `shortcutPath(id)` (a stable path such as `drive:42`, never a
1823
1833
  presigned URL that expires) and `readShortcut(path)` (the bytes, or `null`
1824
1834
  for a path that is not the store's), and the shortcut reopens after a reload.
1825
1835
 
1836
+ #### Choosing a file in Files — `chooseInFiles`
1837
+
1838
+ A window that needs a file from the person's drive asks the one Files window to
1839
+ choose it (harness UI-52), rather than drawing a drive picker of its own:
1840
+
1841
+ ```ts
1842
+ import { chooseInFiles } from 'efficient-shell/apps';
1843
+
1844
+ const choice = await chooseInFiles(openPage, {
1845
+ title: 'Choosing a PowerPoint file for Slides',
1846
+ extensions: ['pptx'], // empty: any file
1847
+ otherLabel: 'Not a deck', // shown on a file it can't take
1848
+ });
1849
+ if (choice) {
1850
+ const bytes = await store.read(choice.entry.id);
1851
+ // choice.folderId: where it was; choice.location: "My files › Sales"
1852
+ }
1853
+ ```
1854
+
1855
+ Files opens, or comes forward, with a bar saying what it is choosing for,
1856
+ Cancel and Open. Files the request can't take are dimmed and can't be chosen;
1857
+ Open, or a double-click on a file it takes, answers. Cancel, closing the
1858
+ window, or a second request taking the window over answers `null`.
1859
+ `withdrawFilesChoice(requestId)` withdraws a request whose asker went away.
1860
+
1826
1861
  #### An embedded PDF — `PdfViewer`
1827
1862
 
1828
1863
  `PdfActionButton` and `setPdfPreview` open a PDF in a Preview **window**. (An
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-5Q7VFXEO.js";import"./chunk-SE3S362N.js";import"./chunk-JY2OBPVO.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-SYIJRZIS.js";import{WindowTitle as n}from"./chunk-2JXGTA73.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-HE767CVB.js";import{confirm as s}from"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-BXU3LX44.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-EZWWQHD3.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-TWFD7A3K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-6LYBE7LM.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-UIWGVOFH.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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[S,R]=c([w]),[E,z]=c(0),[D,L]=c(0),[H,T]=c(x),[U,G]=c(!1),[J,M]=c(null),B=i(null),A=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const F=e=>{const t=f(e);t&&(v(t),W(t),R(e=>{const o=e.slice(0,E+1);return o.push(t),o}),z(e=>e+1),G(!1))},P=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},X=()=>{const e=J?.trim();e?(T(t=>[...t,{label:e,url:w}]),M(null)):M(null)};l(()=>{if(null===J)return;B.current?.focus(),B.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||M(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==J]);const O=e=>{T(t=>t.filter((t,o)=>o!==e))},Y=E>0,K=E<S.length-1,Q=H.some(e=>e.url===w),V="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-HRDR56SK.js";import"./chunk-KVU5IQOZ.js";import"./chunk-JOD5ISTB.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-NOC4WIME.js";import{WindowTitle as n}from"./chunk-RAQBZUU2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-5QVCBAK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-W5B7UNMJ.js";import{confirm as s}from"./chunk-6BK3KRT5.js";import"./chunk-OSNHRKX6.js";import"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-MBXCXFQO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UD4NESX7.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-PYBPJL5R.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-CRRC72EE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-T3NLFOLW.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-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,R]=c(w),[W,S]=c([w]),[z,D]=c(0),[T,L]=c(0),[U,E]=c(x),[J,K]=c(!1),[M,H]=c(null),Q=i(null),O=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(U))}catch{}},[U]);const B=e=>{const t=f(e);t&&(v(t),R(t),S(e=>{const o=e.slice(0,z+1);return o.push(t),o}),D(e=>e+1),K(!1))},A=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},G=()=>{const e=M?.trim();e?(E(t=>[...t,{label:e,url:w}]),H(null)):H(null)};l(()=>{if(null===M)return;Q.current?.focus(),Q.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||H(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==M]);const X=e=>{E(t=>t.filter((t,o)=>o!==e))},P=z>0,V=z<W.length-1,F=U.some(e=>e.url===w),Y="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(E>0){const e=E-1;z(e),v(S[e]),W(S[e]),G(!1)}},disabled:!Y,className:V,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(E<S.length-1){const e=E+1;z(e),v(S[e]),W(S[e]),G(!1)}},disabled:!K,className:V,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>L(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>F(b),className:V,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),F(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(z>0){const e=z-1;D(e),v(W[e]),R(W[e]),K(!1)}},disabled:!P,className:Y,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(z<W.length-1){const e=z+1;D(e),v(W[e]),R(W[e]),K(!1)}},disabled:!V,className:Y,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>L(e=>e+1),className:Y,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>B(b),className:Y,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),B(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
- /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
- /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Q?O(H.findIndex(e=>e.url===w)):void M(N(w)),className:V+" "+(Q?"text-yellow-500":""),title:Q?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:Q?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:P,className:V,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>G(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
12
+ /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
+ /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>R(w)}})})]})}),
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>F?X(U.findIndex(e=>e.url===w)):void H(N(w)),className:Y+" "+(F?"text-yellow-500":""),title:F?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:F?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:A,className:Y,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>K(e=>!e),className:Y,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==M&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:B,type:"text",value:J,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key?X():"Escape"===e.key&&M(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:Q,type:"text",value:M,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&H(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>M(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:X,disabled:!J.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===H.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),H.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>F(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&O(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>H(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:G,disabled:!M.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===U.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),U.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>B(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&X(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:D,iframeRef:A,openExternal:P,showHelp:U,dismissHelp:()=>G(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:T,iframeRef:O,openExternal:A,showHelp:J,dismissHelp:()=>K(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-7Q4DE4CT.js";import{useWidgetSettings as n}from"./chunk-RAQBZUU2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-5QVCBAK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-W5B7UNMJ.js";import"./chunk-6BK3KRT5.js";import"./chunk-OSNHRKX6.js";import"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-MBXCXFQO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UD4NESX7.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-CRRC72EE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as r}from"./chunk-T3NLFOLW.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-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,E]=c(()=>e(h)),[W,D]=c(!1),[J,Q]=c(T),S=i(null);n(o(()=>{Q({...T}),D(!0)},[T]));const K=o(e=>{y(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),M=o(()=>{k("0"),d(null),g(null),N(!1)},[]),R=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),U=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=R(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,R]),w=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=R(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,R]),A=o(()=>{k(e=>String(parseFloat(e)/100))},[]),F=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?K(e.key):"."===e.key?K("."):"+"===e.key?U("+"):"-"===e.key?U("-"):"*"===e.key?U("×"):"/"===e.key?(e.preventDefault(),U("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&S.current?.contains(e.target)&&e.preventDefault(),w()):"Escape"===e.key?M():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[K,U,w,M,A]);const X="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",B=`${X} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,G=`${X} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,L=`${X} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,V=`${X} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:S,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(C||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:M,className:L,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:F,className:L,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:A,className:L,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>U("÷"),className:`${G} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>K("7"),className:B,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>K("8"),className:B,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>K("9"),className:B,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>U("×"),className:`${G} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>K("4"),className:B,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>K("5"),className:B,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>K("6"),className:B,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>U("-"),className:`${G} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>K("1"),className:B,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>K("2"),className:B,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>K("3"),className:B,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>U("+"),className:`${G} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>K("0"),className:`${B} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>K("."),className:B,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:w,className:V,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:W,onClose:()=>D(!1),title:"Calculator Settings",appearance:J,onAppearanceChange:Q,onSave:()=>{E(J),localStorage.setItem(h,JSON.stringify(J)),D(!1)}})]})}export{m as default};
@@ -1,21 +1,21 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-YJIFJIXV.js";import{useWidgetSettings as r}from"./chunk-2JXGTA73.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-HE767CVB.js";import"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-BXU3LX44.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-EZWWQHD3.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-6LYBE7LM.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-UIWGVOFH.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./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-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[B,G]=s(f),[A,H]=s("USD"),[M,R]=s("CNY");r(o(()=>{U([...u]),G({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-7Q4DE4CT.js";import{useWidgetSettings as r}from"./chunk-RAQBZUU2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-5QVCBAK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-W5B7UNMJ.js";import"./chunk-6BK3KRT5.js";import"./chunk-OSNHRKX6.js";import"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-MBXCXFQO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UD4NESX7.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-CRRC72EE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-T3NLFOLW.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./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-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[R,B]=s(f),[A,K]=s("USD"),[T,M]=s("CNY");r(o(()=>{U([...u]),B({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
3
  /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
- /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
6
+ /* @__PURE__ */m("span",{className:"text-base",children:j[t]||""}),
7
7
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
8
8
  /* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
9
- /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
9
+ /* @__PURE__ */m("span",{className:"text-base",children:j[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:B,onAppearanceChange:G,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(B),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(B)),v(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:R,onAppearanceChange:B,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),v(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
14
  /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
15
  /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
- /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
16
+ /* @__PURE__ */i("span",{className:"text-sm",children:[j[t]||""," ",t," → ",j[e]||""," ",e]}),
17
17
  /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:A,onChange:t=>H(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
18
+ /* @__PURE__ */m("select",{value:A,onChange:t=>K(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:M,onChange:t=>R(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{A!==M&&J.length<4&&U(t=>[...t,[A,M]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:T,onChange:t=>M(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{A!==T&&J.length<4&&U(t=>[...t,[A,T]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -0,0 +1,126 @@
1
+ import{openPreviewFile as e}from"./chunk-NDAZPAQL.js";import{SidebarLayout as t}from"./chunk-2X4U3VX2.js";import"./chunk-QWK6DRSN.js";import"./chunk-EIXMUGVZ.js";import{SearchableSelect as n}from"./chunk-BR7L5NE3.js";import{Breadcrumbs as a}from"./chunk-5Z6XJPAX.js";import{Select_default as r}from"./chunk-PY7GHIYF.js";import"./chunk-EO5RLFRX.js";import"./chunk-Q3RJMQYE.js";import"./chunk-2NMW66P5.js";import{useContextMenu as i,ContextMenu as s}from"./chunk-QSK2OWT3.js";import"./chunk-HRDR56SK.js";import"./chunk-KVU5IQOZ.js";import"./chunk-JOD5ISTB.js";import{IconButton_default as l}from"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{formatBytes as o}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as c,subscribeFilesChoice as d,getFilesChoice as h,holdFilesChoice as m,answerFilesChoice as p,choiceTakes as u}from"./chunk-NOCOLZ2W.js";import{AboutApp as f}from"./chunk-NOC4WIME.js";import{getFilesStore as x,peekFilesViewRequest as k,consumeFilesViewRequest as g,FILES_SHOW_TRASH_EVENT as b,FILES_OPEN_DESKTOP_FOLDER_EVENT as N,subscribeDesktopFolders as w,getDesktopFoldersSnapshot as v,hasHostFilesStore as y,FolderGlyph as j,DesktopItemMiniIcon as C,desktopItemTypeLabel as D,FilesQuotaError as L}from"./chunk-HV4VQ5XV.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as $,WindowTitle as T}from"./chunk-RAQBZUU2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-5QVCBAK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-W5B7UNMJ.js";import{confirm as W,prompt as E}from"./chunk-6BK3KRT5.js";import{Dialog as R}from"./chunk-OSNHRKX6.js";import{ItemCount as S}from"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-MBXCXFQO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UD4NESX7.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-PYBPJL5R.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-CRRC72EE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as M}from"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as F}from"./chunk-T3NLFOLW.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as P}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as A}from"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import{toast_default as V}from"./chunk-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useState as O,useSyncExternalStore as U,useEffect as J,useRef as Q,useCallback as K}from"react";import{jsxs as B,jsx as I,Fragment as X}from"react/jsx-runtime";var Y=[{value:"viewer",label:"Viewer"},{value:"editor",label:"Editor"}];function Z({store:e,entry:t,onClose:a,onChanged:i}){const[s,o]=O(null),[c,d]=O(""),[h,m]=O([]),[p,u]=O(!1),[f,x]=O(""),[k,g]=O("viewer"),[b,N]=O(!1),w=Q(/* @__PURE__ */new Map),v=t?.id??null;if(J(()=>{if(o(null),x(""),d(""),!v||!e.shares)return;let t=!0;return e.shares(v).then(e=>{t&&o(e)}).catch(e=>{t&&(V.error(e.message),o([]))}),()=>{t=!1}},[v,e]),J(()=>{if(!e.searchPeople||!v)return;let t=!0;u(!0);const n=setTimeout(()=>{e.searchPeople(c).then(e=>{if(t){for(const t of e)w.current.set(t.id,t);m(e)}}).catch(()=>{t&&m([])}).finally(()=>{t&&u(!1)})},250);return()=>{t=!1,clearTimeout(n)}},[c,v,e]),!t)return null;const y=new Set((s??[]).map(e=>e.person.id)),j=h.filter(e=>!y.has(e.id)).map(e=>({value:e.id,label:e.name})),C=async n=>{N(!0);try{await n(),o(await e.shares(t.id)),i()}catch(e){V.error(e.message)}finally{N(!1)}};/* @__PURE__ */
2
+ return B(R,{open:!0,onClose:a,size:"md",title:`Share “${t.name}”`,description:"folder"===t.kind?"Everything inside this folder is shared too. Editors’ uploads count toward your quota.":"Viewers can open and download it. Editors can also replace, rename and delete it.",footer:/* @__PURE__ */I(M,{variant:"secondary",onClick:a,children:"Done"}),children:[
3
+ /* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
4
+ /* @__PURE__ */I("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */I(n,{value:f,onChange:x,onSearchChange:d,loading:p&&0===h.length,options:j,placeholder:"Search colleagues by name","aria-label":"Colleague to share with"})}),
5
+ /* @__PURE__ */I("div",{className:"w-28 shrink-0",children:/* @__PURE__ */I(r,{value:k,onChange:e=>g(e),options:Y,"aria-label":"Access"})}),
6
+ /* @__PURE__ */I(M,{variant:"primary",onClick:()=>{if(!f||!e.share)return;const n=w.current.get(f);C(async()=>{await e.share(t.id,f,k),x(""),d(""),n&&V.success(`Shared with ${n.name}`)})},disabled:!f||b,children:"Add"})]}),
7
+ /* @__PURE__ */I("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===s?/* @__PURE__ */I(P,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */B("ul",{className:"divide-y divide-line-subtle text-sm",children:[
8
+ /* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
9
+ /* @__PURE__ */I("span",{className:"flex-1 truncate",children:"You"}),
10
+ /* @__PURE__ */I("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),s.map(n=>/* @__PURE__ */B("li",{className:"flex items-center gap-2 h-10",children:[
11
+ /* @__PURE__ */I("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
12
+ /* @__PURE__ */I("div",{className:"w-28 shrink-0",children:/* @__PURE__ */I(r,{value:n.role,onChange:a=>C(()=>e.share(t.id,n.person.id,a)),options:Y,"aria-label":`Access for ${n.person.name}`,disabled:b})}),
13
+ /* @__PURE__ */I(l,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:b,onClick:()=>C(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */I(F,{name:"close",className:"h-4 w-4",strokeWidth:1.8})})]},n.person.id))]})]})}var z={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function G(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function H(e,t){return`Not enough space for “${e}” (${o(t.attempted)}). You've used ${o(t.used)} of ${o(t.limit)}. Empty Trash or ask an administrator for more space.`}var q=(e,t)=>e instanceof Error&&e.message||t;function _(){const n=x(),r=null!==c(),l=!r&&!!n.shares&&!!n.sharedWithMe,[R,M]=O(null),[Y,_]=O(null),[ee,te]=O([]),[ne,ae]=O([]),[re,ie]=O(null),[se,le]=O(!0),[oe,ce]=O(!1),[de,he]=O(null),[me,pe]=O(!1),[ue,fe]=O(null),xe=i(),ke=U(d,h,h);J(()=>m(),[]);const[ge,be]=O(()=>{const e=k();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});J(()=>{g()},[]);const[Ne,we]=O([]);J(()=>{const e=()=>{g(),be("trash")},t=e=>{g();const t=e.detail?.folderId;t&&be({desktopFolderId:t})};return window.addEventListener(b,e),window.addEventListener(N,t),()=>{window.removeEventListener(b,e),window.removeEventListener(N,t)}},[]);const ve=U(w,v,v),ye="object"==typeof ge?ge.desktopFolderId:null,je=ye?ve?.folders.find(e=>e.id===ye)??null:null,Ce=ye&&ve?.itemsByFolder[ye]||[];J(()=>{ye&&ve&&!ve.folders.some(e=>e.id===ye)&&be("files")},[ye,ve]);const De=Q(0),Le=Q(null),{openPage:$e,openEntity:Te}=$(),We=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>$e(e)}):"page"===t.entityType?$e(t.entityId):Te(t.entityType,t.entityId,null,t.label)},Ee=K(async()=>{if(!r)try{he(await n.quota())}catch{}},[n,r]),Re=K(async e=>{if(ie(null),r){const t=function(e){const t=e??"/",n=t.split("/").filter(Boolean);let a=c()??[];for(const e of n){const t=a.find(t=>"folder"===t.kind&&t.name===e);a=t?.children??[]}return{folder:{id:e,name:n[n.length-1]??"",role:"owner",path:[{id:null,name:""},...n.map((e,t)=>({id:"/"+n.slice(0,t+1).join("/"),name:e}))]},entries:a.map(e=>({id:("/"===t?"":t)+"/"+e.name,name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}}(e);return _(t),ce(!1),le(!1),void(null===e&&te(t.entries.filter(e=>"folder"===e.kind)))}le(!0);try{const t=await n.list(e);_(t),ce(!1),null===e&&te(t.entries.filter(e=>"folder"===e.kind))}catch(e){e instanceof TypeError?ce(!0):V.error(q(e,"Failed to list"))}finally{le(!1)}Ee()},[n,Ee,r]),Se=K(async()=>{if(n.sharedWithMe){le(!0),ie(null);try{ae(await n.sharedWithMe()),ce(!1)}catch(e){e instanceof TypeError?ce(!0):V.error(q(e,"Failed to list shared files"))}finally{le(!1)}}},[n]),Me=K(async()=>{if(r)return we([]),void le(!1);le(!0),ie(null);try{we(await n.trash()),ce(!1)}catch(e){e instanceof TypeError?ce(!0):V.error(q(e,"Failed to list trash"))}finally{le(!1)}Ee()},[n,Ee,r]),Fe=()=>{"files"===ge?Re(R):"shared"===ge?Se():"trash"===ge&&Me()};J(()=>{Fe()},[R,ge]);const Pe=e=>{be("files"),M(e)};J(()=>{!ke||"trash"!==ge&&"object"!=typeof ge||be("files")},[ke,ge]);const Ae=async(e,t)=>{try{await e()}catch(e){V.error(q(e,t))}Fe()},Ve=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){V.error(q(e,"Download failed"))}},Oe=async e=>{for(const t of Array.from(e))try{await n.upload(R,t)}catch(e){e instanceof L?V.error(H(t.name,e)):V.error(`Upload ${t.name}: ${q(e,"failed")}`)}Re(R)},Ue=async e=>{const t=await E({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});t&&t!==e.name&&(/[\\/]/.test(t)?V.error("Names cannot contain slashes"):Ae(()=>n.rename(e.id,t),"Rename failed"))},Je=async e=>{const t="owner"!==(e.role??"owner");await W({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will move to `+(t?`${(e.owner??Y?.folder.owner)?.name??"its owner"}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Delete",variant:"danger"})&&Ae(()=>n.remove(e.id),"Delete failed")},Qe=()=>{De.current=0,pe(!1)};if(J(()=>{const e=()=>Qe();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),oe)/* @__PURE__ */
14
+ return B("div",{className:"flex flex-col h-full bg-surface",children:[
15
+ /* @__PURE__ */I(T,{title:"Files - offline"}),
16
+ /* @__PURE__ */I("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */B("div",{className:"max-w-md",children:[
17
+ /* @__PURE__ */I(F,{name:"close-circle",className:"h-12 w-12 mx-auto text-ink-faintest mb-3",strokeWidth:1.4}),y()?/* @__PURE__ */B(X,{children:[
18
+ /* @__PURE__ */I("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
19
+ /* @__PURE__ */I("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */B(X,{children:[
20
+ /* @__PURE__ */I("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
21
+ /* @__PURE__ */B("p",{className:"text-sm text-ink-faint mb-3",children:["No response from the file server. Make sure the server is running — see ",
22
+ /* @__PURE__ */I("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
23
+ /* @__PURE__ */I("button",{onClick:Fe,className:"px-3 h-8 text-sm bg-accent-fill text-on-accent rounded hover:bg-accent-fill-hover",children:"Retry"})]})})]});const Ke="files"===ge?Y?.folder??null:null,Be=Ke?.role??"owner",Ie="owner"!==Be,Xe=!r&&"files"===ge&&"viewer"!==Be,Ye="files"===ge?Y?.entries??[]:[],Ze=de&&de.limit>0?Math.min(100,Math.round(de.used/de.limit*100)):0,ze=Ze>90?"bg-danger":Ze>75?"bg-warning":"bg-accent-fill",Ge=(Ke?.path??[]).filter(e=>null!==e.id),He=[Ie?{label:"Shared with me",onClick:()=>be("shared")}:{label:"My files",onClick:()=>Pe(null)},...Ge.map(e=>({label:e.name,onClick:()=>Pe(e.id)}))],qe=Ge.length>1?Ge[Ge.length-2].id:null,_e=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-accent-tint font-medium text-accent-text":"text-ink hover:bg-row-hover"),et=e=>/* @__PURE__ */I("svg",{className:"h-4 w-4 shrink-0 text-ink-faintest",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),tt=/* @__PURE__ */B("nav",{className:"p-2",children:[
24
+ /* @__PURE__ */I("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
25
+ /* @__PURE__ */B("button",{onClick:()=>Pe(null),className:_e("files"===ge&&null===R),children:[et("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),ee.map(e=>/* @__PURE__ */B("button",{onClick:()=>Pe(e.id),className:_e("files"===ge&&R===e.id),children:[et("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
26
+ /* @__PURE__ */I("span",{className:"truncate",children:e.name})]},e.id)),l&&/* @__PURE__ */B("button",{onClick:()=>be("shared"),className:_e("shared"===ge||"files"===ge&&Ie),children:[
27
+ /* @__PURE__ */I(F,{name:"team",className:"h-4 w-4 shrink-0 text-ink-faintest",strokeWidth:1.6}),"Shared with me"]}),!r&&/* @__PURE__ */B("button",{onClick:()=>be("trash"),className:_e("trash"===ge),children:[et("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),ve&&ve.folders.length>0&&/* @__PURE__ */B(X,{children:[
28
+ /* @__PURE__ */I("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),ve.folders.map(e=>/* @__PURE__ */B("button",{onClick:()=>be({desktopFolderId:e.id}),className:_e(ye===e.id),children:[
29
+ /* @__PURE__ */I(j,{className:"h-4 w-4 shrink-0 text-amber-500"}),
30
+ /* @__PURE__ */I("span",{className:"truncate",children:e.name}),
31
+ /* @__PURE__ */I(S,{count:e.itemCount,active:ye===e.id,className:"ml-auto"})]},e.id))]})]}),nt=e=>/* @__PURE__ */I(F,"folder"===e?{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}:{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),at="px-2 py-0.5 rounded hover:bg-row-hover text-ink-faint text-2xs ml-1",rt=e=>ke&&"file"===e.kind&&!u(ke.request,e.name)?"text-ink-faintest":"",it=e=>!!ke&&"file"===e.kind&&u(ke.request,e.name),st=e=>{if(!ke||!it(e))return;const t="shared"===ge;p(ke.id,{entry:e,folderId:t?null:R,location:t?"Shared with me":He.map(e=>e.label).join(" › ")})},lt=t=>{"folder"===t.kind?Pe(t.id):ke?st(t):(async t=>{if(r)return;if(n.open?.(t))return;const a=(t.name.split(".").pop()||"").toLowerCase(),i=z[a];i?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:i,load:()=>n.read(t.id),onStaged:e=>$e(e)}):Ve(t)})(t)},ot=e=>{ke&&"file"===e.kind&&!it(e)||ie(e.id)},ct=ke?[...Ye,..."shared"===ge?ne:[]].find(e=>e.id===re&&it(e))??null:null,dt=(e,t,a)=>{const r=[{key:"open",label:"file"===e.kind&&!ke&&n.openLabel?.(e)||"Open",onSelect:()=>lt(e)}];return"file"===e.kind&&r.push({key:"download",label:"Download",onSelect:()=>{Ve(e)}}),l&&a&&r.push({key:"share",label:"Share",onSelect:()=>fe(e)}),t&&(r.push({key:"rename",label:"Rename",onSelect:()=>{Ue(e)}}),r.push({key:"divider",type:"divider"}),r.push({key:"delete",label:"Delete",danger:!0,onSelect:()=>{Je(e)}})),r},ht=ke?"Files - Choosing":je?`Files - ${je.name}`:"shared"===ge?"Files - Shared with me":"trash"===ge?"Files - Trash":Ke&&null!==Ke.id?`Files - ${Ke.name}`:"Files";/* @__PURE__ */
32
+ return B("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Xe&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),De.current++,me||pe(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{De.current>0&&De.current--,0===De.current&&pe(!1)},onDrop:e=>{e.preventDefault(),Qe(),Xe&&e.dataTransfer.files?.length&&Oe(e.dataTransfer.files)},children:[
33
+ /* @__PURE__ */I(T,{title:ht}),
34
+ /* @__PURE__ */I(f,{app:"files"}),
35
+ /* @__PURE__ */I("input",{ref:Le,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&Oe(e.target.files),Le.current&&(Le.current.value="")}}),
36
+ /* @__PURE__ */I("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */I(t,{sidebar:tt,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */B("div",{className:"flex h-full min-w-0 flex-col",children:[ke&&/* @__PURE__ */B("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-accent-tint text-accent-text text-sm shrink-0",role:"status",children:[
37
+ /* @__PURE__ */I(F,{name:"cursor",className:"h-4 w-4 shrink-0",strokeWidth:1.6}),
38
+ /* @__PURE__ */I("span",{className:"flex-1 min-w-0 truncate",children:ke.request.title}),
39
+ /* @__PURE__ */I("button",{onClick:()=>p(ke.id,null),className:"px-3 h-7 rounded border border-line-strong bg-surface text-ink hover:bg-row-hover",children:"Cancel"}),
40
+ /* @__PURE__ */I("button",{onClick:()=>{ct&&st(ct)},disabled:!ct,className:"px-3 h-7 rounded bg-accent-fill text-on-accent hover:bg-accent-fill-hover disabled:opacity-40",children:"Open"})]}),
41
+ /* @__PURE__ */B("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */B(X,"files"===ge?{children:[
42
+ /* @__PURE__ */I("button",{onClick:()=>{Ie&&Ge.length<=1?be("shared"):Pe(qe)},disabled:!Ie&&null===R,className:"px-2 py-1 rounded hover:bg-row-hover disabled:opacity-30 text-ink-muted",title:"Parent folder",children:/* @__PURE__ */I(F,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
43
+ /* @__PURE__ */B("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[
44
+ /* @__PURE__ */I("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */I(a,{items:He,maxItems:5})}),Ie&&"viewer"===Be&&/* @__PURE__ */B("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs text-ink-faint whitespace-nowrap",children:[
45
+ /* @__PURE__ */I(F,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),Ie&&Ke?.owner&&/* @__PURE__ */B("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",Ke.owner.name]})]}),
46
+ /* @__PURE__ */I("button",{onClick:Fe,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */I(F,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),Xe&&/* @__PURE__ */B(X,{children:[!Ie&&/* @__PURE__ */B("button",{onClick:()=>be("trash"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted flex items-center gap-1",title:"Open trash",children:[
47
+ /* @__PURE__ */I(F,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
48
+ /* @__PURE__ */B("button",{onClick:async()=>{const e=await E({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?V.error("Folder names cannot contain slashes"):Ae(()=>n.createFolder(R,e),"Create folder failed"))},className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted flex items-center gap-1",children:[
49
+ /* @__PURE__ */I(F,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
50
+ /* @__PURE__ */B("button",{onClick:()=>Le.current?.click(),className:"px-2 py-1 rounded bg-accent-fill text-on-accent hover:bg-accent-fill-hover flex items-center gap-1",children:[
51
+ /* @__PURE__ */I(F,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"shared"===ge?{children:[
52
+ /* @__PURE__ */I(F,{name:"team",className:"h-4 w-4 ml-1",strokeWidth:1.6}),
53
+ /* @__PURE__ */I("span",{className:"flex-1 text-ink font-medium px-1",children:"Shared with me"}),
54
+ /* @__PURE__ */I("button",{onClick:Se,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */I(F,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})})]}:"trash"===ge?{children:[
55
+ /* @__PURE__ */I("button",{onClick:()=>be("files"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Back to files",children:/* @__PURE__ */I(F,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
56
+ /* @__PURE__ */I("span",{className:"flex-1 text-ink font-medium px-2",children:"Trash"}),
57
+ /* @__PURE__ */I("button",{onClick:Me,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */I(F,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
58
+ /* @__PURE__ */I("button",{onClick:async()=>{if(0===Ne.length)return;await W({title:"Empty trash",message:`${Ne.length} item${1===Ne.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"})&&Ae(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===Ne.length,className:"px-2 py-1 rounded text-danger-text hover:bg-status-danger-soft disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
59
+ /* @__PURE__ */I("button",{onClick:()=>be("files"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Back to files",children:/* @__PURE__ */I(F,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
60
+ /* @__PURE__ */I(j,{className:"h-4 w-4 text-amber-500 ml-1"}),
61
+ /* @__PURE__ */I("span",{className:"flex-1 text-ink font-medium px-1 truncate",children:je?.name??"Desktop folder"}),
62
+ /* @__PURE__ */I("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),de&&/* @__PURE__ */B(X,{children:[
63
+ /* @__PURE__ */I("div",{className:"h-4 w-px bg-line-strong mx-1"}),
64
+ /* @__PURE__ */B("div",{className:"flex items-center gap-2",title:`${o(de.used)} of ${o(de.limit)} used`,children:[
65
+ /* @__PURE__ */I("div",{className:"w-20 h-1.5 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */I("div",{className:`h-full ${ze} transition-all`,style:{width:`${Ze}%`}})}),
66
+ /* @__PURE__ */B("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[o(de.used)," / ",o(de.limit)]})]})]})]}),
67
+ /* @__PURE__ */I("div",{className:"flex-1 overflow-auto",children:"object"==typeof ge?0===Ce.length?/* @__PURE__ */I("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */B("table",{className:"w-full text-sm",children:[
68
+ /* @__PURE__ */I("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */B("tr",{children:[
69
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8`,children:"Name"}),
70
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
71
+ /* @__PURE__ */I("th",{className:`${A} w-56`})]})}),
72
+ /* @__PURE__ */I("tbody",{children:Ce.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
73
+ return B("tr",{onClick:()=>ie(t),onDoubleClick:()=>We(e),className:"cursor-default border-b border-line-subtle "+(re===t?"bg-accent-tint":"hover:bg-row-hover"),children:[
74
+ /* @__PURE__ */B("td",{className:"px-3 h-8 flex items-center gap-2",children:[
75
+ /* @__PURE__ */I(C,{item:e}),
76
+ /* @__PURE__ */I("span",{className:"truncate",title:e.label,children:e.label})]}),
77
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-xs text-ink-faint",children:D(e)}),
78
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
79
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),We(e)},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Open"}),
80
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),ve?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-row-hover text-ink-faint text-2xs ml-1",children:"Move to desktop"}),
81
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),ve?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"shared"===ge?se&&0===ne.length?/* @__PURE__ */I(P,{size:"sm",padding:"p-6",label:"Loading"}):0===ne.length?/* @__PURE__ */I("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Nothing has been shared with you yet. Files and folders colleagues share with you show here."}):/* @__PURE__ */B("table",{className:"w-full text-sm",children:[
82
+ /* @__PURE__ */I("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */B("tr",{children:[
83
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8`,children:"Name"}),
84
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8 w-40`,children:"Owner"}),
85
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8 w-24`,children:"Access"}),
86
+ /* @__PURE__ */I("th",{className:`${A} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
87
+ /* @__PURE__ */I("th",{className:`${A} w-32`})]})}),
88
+ /* @__PURE__ */I("tbody",{children:ne.map(e=>/* @__PURE__ */B("tr",{onClick:()=>ot(e),onDoubleClick:()=>lt(e),onContextMenu:t=>xe.open(t,e),className:`cursor-default border-b border-line-subtle ${rt(e)} ${re===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
89
+ /* @__PURE__ */B("td",{className:"px-3 h-8 flex items-center gap-2",children:[nt(e.kind),
90
+ /* @__PURE__ */I("span",{className:"truncate",title:e.name,children:e.name})]}),
91
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-ink-faint truncate",children:e.owner?.name??"—"}),
92
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-ink-faint",children:"editor"===e.role?"Editor":"Viewer"}),
93
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":o(e.size)}),
94
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
95
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),lt(e)},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Open"}),"file"===e.kind&&/* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),Ve(e)},className:at,children:"Download"})]})]},e.id))})]}):"trash"===ge?se&&0===Ne.length?/* @__PURE__ */I(P,{size:"sm",padding:"p-6",label:"Loading"}):0===Ne.length?/* @__PURE__ */I("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty."}):/* @__PURE__ */B("table",{className:"w-full text-sm",children:[
96
+ /* @__PURE__ */I("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */B("tr",{children:[
97
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8`,children:"Name"}),
98
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8`,children:"Original location"}),
99
+ /* @__PURE__ */I("th",{className:`${A} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
100
+ /* @__PURE__ */I("th",{className:`${A} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
101
+ /* @__PURE__ */I("th",{className:`${A} w-44`})]})}),
102
+ /* @__PURE__ */I("tbody",{children:Ne.map(e=>/* @__PURE__ */B("tr",{className:"border-b border-line-subtle hover:bg-row-hover",children:[
103
+ /* @__PURE__ */B("td",{className:"px-3 h-8 flex items-center gap-2",children:[nt(e.kind),
104
+ /* @__PURE__ */I("span",{className:"truncate",title:e.name,children:e.name})]}),
105
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
106
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:o(e.size)}),
107
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?G(e.deletedAt):"—"}),
108
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
109
+ /* @__PURE__ */I("button",{onClick:()=>{return t=e,Ae(async()=>{await n.restore(t.id),V.success(`Restored "${t.name}"`)},"Restore failed");var t},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Restore"}),
110
+ /* @__PURE__ */I("button",{onClick:()=>(async e=>{await W({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&Ae(()=>n.purge(e.id),"Delete failed")})(e),className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):se&&0===Ye.length?/* @__PURE__ */I(P,{size:"sm",padding:"p-6",label:"Loading"}):0===Ye.length?/* @__PURE__ */B("div",{className:"p-10 text-center text-sm text-ink-faintest",children:["Empty folder.",Xe&&/* @__PURE__ */B(X,{children:[" Drop files here or click ",
111
+ /* @__PURE__ */I("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */B("table",{className:"w-full text-sm",children:[
112
+ /* @__PURE__ */I("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */B("tr",{children:[
113
+ /* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8`,children:"Name"}),
114
+ /* @__PURE__ */I("th",{className:`${A} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
115
+ /* @__PURE__ */I("th",{className:`${A} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),l&&!Ie&&/* @__PURE__ */I("th",{className:`${A} text-left font-medium px-3 h-8 w-28`,children:"Shared"}),
116
+ /* @__PURE__ */I("th",{className:`${A} w-48`})]})}),
117
+ /* @__PURE__ */I("tbody",{children:Ye.map(e=>{const t=e.role??Be,n="owner"===t,a=Xe&&"viewer"!==t;/* @__PURE__ */
118
+ return B("tr",{onClick:()=>ot(e),onDoubleClick:()=>lt(e),onContextMenu:t=>{r||xe.open(t,e)},className:`cursor-default border-b border-line-subtle ${rt(e)} ${re===e.id?"bg-accent-tint":"hover:bg-row-hover"}`,children:[
119
+ /* @__PURE__ */B("td",{className:"px-3 h-8 flex items-center gap-2",children:[nt(e.kind),
120
+ /* @__PURE__ */I("span",{className:"truncate",title:e.name,children:e.name})]}),
121
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint whitespace-nowrap",children:"folder"===e.kind?"—":ke&&!it(e)&&ke.request.otherLabel?ke.request.otherLabel:o(e.size)}),
122
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums whitespace-nowrap",children:G(e.modifiedAt)}),l&&!Ie&&/* @__PURE__ */I("td",{className:"px-3 h-8",children:e.shareCount?/* @__PURE__ */I("span",{className:"inline-flex rounded-full bg-accent-tint px-2 py-0.5 text-2xs text-accent-text whitespace-nowrap",children:1===e.shareCount?"1 person":`${e.shareCount} people`}):/* @__PURE__ */I("span",{className:"text-ink-faintest",children:"—"})}),
123
+ /* @__PURE__ */I("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!r&&!ke&&/* @__PURE__ */B(X,{children:["file"===e.kind&&/* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),Ve(e)},className:at,children:"Download"}),l&&n&&/* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),fe(e)},className:at,children:"Share"}),a&&/* @__PURE__ */B(X,{children:[
124
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),Ue(e)},className:at,children:"Rename"}),
125
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),Je(e)},className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Delete"})]})]})})]},e.id)})})]})})]})})}),xe.state&&(()=>{const e=xe.state.data,t=e.role??("shared"===ge?"viewer":Be),n=Xe&&"viewer"!==t;/* @__PURE__ */
126
+ return I(s,{...xe.props,items:dt(e,n,"owner"===t)})})(),l&&/* @__PURE__ */I(Z,{store:n,entry:ue,onClose:()=>fe(null),onChanged:()=>Re(R)}),me&&/* @__PURE__ */I("div",{className:"absolute inset-0 bg-accent-tint border-4 border-dashed border-accent-border pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */I("div",{className:"px-4 py-2 rounded-md bg-accent-fill text-on-accent text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{_ as default,H as quotaExceededMessage};
@@ -1,8 +1,8 @@
1
- import{getNumberingConfigs as e}from"./chunk-23WJCEYD.js";import{SidebarLayout as t}from"./chunk-MZG3FS5T.js";import"./chunk-QWK6DRSN.js";import"./chunk-ZC3TSMFK.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-SYIJRZIS.js";import{useWindowManager as o,client_default as i}from"./chunk-2JXGTA73.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y4RERPFN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-HE767CVB.js";import"./chunk-SCU2CWNJ.js";import"./chunk-6EHPEBGP.js";import"./chunk-BXU3LX44.js";import"./chunk-3DVNXNTF.js";import"./chunk-7B5KFESH.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-EZWWQHD3.js";import"./chunk-SCGBCBXP.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-TWFD7A3K.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-6LYBE7LM.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as s}from"./chunk-UIWGVOFH.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{toast_default as l}from"./chunk-TRWHVG3A.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=c(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),T=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}T.current=e},[v]);const w=j.notepad_notes||[],[C,W]=d(null),[_,S]=d(""),[D,X]=d(""),[G,$]=d("yellow"),[E,J]=d(!1),[M,F]=d(!1),U=a(null),K=a();p(()=>{if(!C&&w.length>0){const e=w[0];W(e.id),S(e.title),X(e.content),$(e.color)}},[w.length]);const B=m(e=>{N({notepad_notes:e})},[N]),H=m(()=>{if(!C||!E)return;const e=w.map(e=>e.id===C?{...e,title:_,content:D,color:G,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);B(e),J(!1)},[C,E,_,D,G,w,B]);p(()=>{if(E)return K.current&&clearTimeout(K.current),K.current=setTimeout(H,800),()=>{K.current&&clearTimeout(K.current)}},[E,H]),p(()=>()=>{E&&H()},[]);const R=e=>{E&&H(),W(e.id),S(e.title),X(e.content),$(e.color),J(!1),F(!1)},Z=e=>{const t=D.slice(0,e),r=D.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=D.slice(e+r[0].length);X(t+n+o),J(!0)},A=async(e,t)=>{const r=T.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):l.error(`${n} not found`)}catch{l.error(`Failed to look up ${n}`)}},Q="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",Y=/* @__PURE__ */h(g,{children:[
2
- /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{E&&H();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...w];B(t),W(e.id),S(""),X(""),$("yellow"),J(!1),F(!0),setTimeout(()=>U.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
1
+ import{getNumberingConfigs as e}from"./chunk-ZC6MXV4L.js";import{SidebarLayout as t}from"./chunk-2X4U3VX2.js";import"./chunk-QWK6DRSN.js";import"./chunk-EIXMUGVZ.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-NOC4WIME.js";import{useWindowManager as o,client_default as i}from"./chunk-RAQBZUU2.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-5QVCBAK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-W5B7UNMJ.js";import"./chunk-6BK3KRT5.js";import"./chunk-OSNHRKX6.js";import"./chunk-KWTK6TGH.js";import"./chunk-3DVNXNTF.js";import"./chunk-MBXCXFQO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UD4NESX7.js";import"./chunk-NV7QRWQJ.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-PYBPJL5R.js";import"./chunk-CDAJKLGL.js";import"./chunk-JMGDGNM7.js";import"./chunk-CRRC72EE.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as s}from"./chunk-T3NLFOLW.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{toast_default as l}from"./chunk-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=c(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),T=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}T.current=e},[v]);const w=j.notepad_notes||[],[_,C]=d(null),[W,X]=d(""),[D,S]=d(""),[J,U]=d("yellow"),[M,$]=d(!1),[K,Q]=d(!1),R=a(null),O=a();p(()=>{if(!_&&w.length>0){const e=w[0];C(e.id),X(e.title),S(e.content),U(e.color)}},[w.length]);const V=m(e=>{N({notepad_notes:e})},[N]),E=m(()=>{if(!_||!M)return;const e=w.map(e=>e.id===_?{...e,title:W,content:D,color:J,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);V(e),$(!1)},[_,M,W,D,J,w,V]);p(()=>{if(M)return O.current&&clearTimeout(O.current),O.current=setTimeout(E,800),()=>{O.current&&clearTimeout(O.current)}},[M,E]),p(()=>()=>{M&&E()},[]);const G=e=>{M&&E(),C(e.id),X(e.title),S(e.content),U(e.color),$(!1),Q(!1)},Z=e=>{const t=D.slice(0,e),r=D.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=D.slice(e+r[0].length);S(t+n+o),$(!0)},B=async(e,t)=>{const r=T.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):l.error(`${n} not found`)}catch{l.error(`Failed to look up ${n}`)}},L="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",F=/* @__PURE__ */h(g,{children:[
2
+ /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{M&&E();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...w];V(t),C(e.id),X(""),S(""),U("yellow"),$(!1),Q(!0),setTimeout(()=>R.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
3
3
  /* @__PURE__ */x(s,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
4
  /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===w.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):w.map(e=>{const t=(n=e.color,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
5
- return h("button",{onClick:()=>R(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(C===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
5
+ return h("button",{onClick:()=>G(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(_===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
6
6
  /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
8
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
@@ -10,15 +10,15 @@ return h("button",{onClick:()=>R(e),className:"w-full text-left px-3 py-3 border
10
10
  /* @__PURE__ */x("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
11
  return h("div",{className:"h-full",children:[
12
12
  /* @__PURE__ */x(n,{app:"notepad"}),
13
- /* @__PURE__ */x(t,{sidebar:Y,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:C?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
13
+ /* @__PURE__ */x(t,{sidebar:F,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
14
  /* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */x("input",{value:_,onChange:e=>{S(e.target.value),J(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{$(e.key),J(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${G===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=w.filter(t=>t.id!==e);if(B(t),C===e){const e=t[0];e?R(e):(W(null),S(""),X(""))}})(C),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(s,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),M?/* @__PURE__ */x("textarea",{ref:U,value:D,onChange:e=>{X(e.target.value),J(!0)},onBlur:()=>{F(!1),E&&H()},placeholder:Q,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{F(!0),setTimeout(()=>U.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:D?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=c.exec(e));){const e=l[1],t=l[2];if(T.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>A(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(l=b.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=a+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>Z(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(s,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
- return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(D):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:Q})}),
15
+ /* @__PURE__ */x("input",{value:W,onChange:e=>{X(e.target.value),$(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{U(e.key),$(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${J===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
+ /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=w.filter(t=>t.id!==e);if(V(t),_===e){const e=t[0];e?G(e):(C(null),X(""),S(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(s,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),K?/* @__PURE__ */x("textarea",{ref:R,value:D,onChange:e=>{S(e.target.value),$(!0)},onBlur:()=>{Q(!1),M&&E()},placeholder:L,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{Q(!0),setTimeout(()=>R.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:D?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=c.exec(e));){const e=l[1],t=l[2];if(T.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>B(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(l=b.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=a+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>Z(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(s,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
+ return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(D):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:L})}),
19
19
  /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
20
20
  /* @__PURE__ */x("span",{children:"[] checkbox"}),
21
21
  /* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
22
- /* @__PURE__ */x("span",{className:"ml-auto",children:M?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
22
+ /* @__PURE__ */x("span",{className:"ml-auto",children:K?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
23
23
  /* @__PURE__ */x(s,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
24
24
  /* @__PURE__ */x("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -0,0 +1 @@
1
+ export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-NAWIVFAN.js";import"./chunk-T3NLFOLW.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-JTZVUO3I.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TJSJVC6P.js";import"./chunk-C3QOHMR6.js";