@hienlh/ppm 0.22.5 → 0.22.6

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 (283) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/cli-reference.md +4 -4
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{accounts-settings-section-BoTvueNs.js → accounts-settings-section-SoZ-zMqL.js} +1 -1
  6. package/dist/web/assets/accounts-settings-section-SoZ-zMqL.js.br +0 -0
  7. package/dist/web/assets/accounts-settings-section-SoZ-zMqL.js.gz +0 -0
  8. package/dist/web/assets/{ai-resource-editor-BZz447ab.js → ai-resource-editor-b9DtpHrO.js} +1 -1
  9. package/dist/web/assets/ai-resource-editor-b9DtpHrO.js.br +0 -0
  10. package/dist/web/assets/ai-resource-editor-b9DtpHrO.js.gz +0 -0
  11. package/dist/web/assets/{ai-settings-section-DaBrO2Ce.js → ai-settings-section-BLXcu7H0.js} +1 -1
  12. package/dist/web/assets/{ai-settings-section-DR6ZplH4.js → ai-settings-section-CC8fy0wr.js} +1 -1
  13. package/dist/web/assets/ai-settings-section-CC8fy0wr.js.br +0 -0
  14. package/dist/web/assets/ai-settings-section-CC8fy0wr.js.gz +0 -0
  15. package/dist/web/assets/{appearance-settings-section-JSk2rrSM.js → appearance-settings-section-DrlvGnmZ.js} +1 -1
  16. package/dist/web/assets/appearance-settings-section-DrlvGnmZ.js.br +0 -0
  17. package/dist/web/assets/appearance-settings-section-DrlvGnmZ.js.gz +0 -0
  18. package/dist/web/assets/{branch-review-tab-BTobiTaa.js → branch-review-tab-BbzN5p9l.js} +1 -1
  19. package/dist/web/assets/branch-review-tab-BbzN5p9l.js.br +0 -0
  20. package/dist/web/assets/branch-review-tab-BbzN5p9l.js.gz +0 -0
  21. package/dist/web/assets/{chat-tab-XT-23JtV.js → chat-tab-zWnjUbGY.js} +3 -3
  22. package/dist/web/assets/chat-tab-zWnjUbGY.js.br +0 -0
  23. package/dist/web/assets/chat-tab-zWnjUbGY.js.gz +0 -0
  24. package/dist/web/assets/{code-editor-Jmst2xot.js → code-editor-Dsd0-t0B.js} +3 -3
  25. package/dist/web/assets/code-editor-Dsd0-t0B.js.br +0 -0
  26. package/dist/web/assets/code-editor-Dsd0-t0B.js.gz +0 -0
  27. package/dist/web/assets/{codex-daily-guard-C3m_OZs9.js → codex-daily-guard-5P7_OmUb.js} +1 -1
  28. package/dist/web/assets/codex-daily-guard-5P7_OmUb.js.br +0 -0
  29. package/dist/web/assets/codex-daily-guard-5P7_OmUb.js.gz +0 -0
  30. package/dist/web/assets/{conflict-editor-BYRCRGXw.js → conflict-editor-BGcWuObI.js} +1 -1
  31. package/dist/web/assets/conflict-editor-BGcWuObI.js.br +0 -0
  32. package/dist/web/assets/conflict-editor-BGcWuObI.js.gz +0 -0
  33. package/dist/web/assets/{csv-preview-D7OFzZJY.js → csv-preview-CSmQdPkY.js} +1 -1
  34. package/dist/web/assets/csv-preview-CSmQdPkY.js.br +0 -0
  35. package/dist/web/assets/csv-preview-CSmQdPkY.js.gz +0 -0
  36. package/dist/web/assets/{database-viewer-SSbCY87C.js → database-viewer-h7ffU0AC.js} +1 -1
  37. package/dist/web/assets/database-viewer-h7ffU0AC.js.br +0 -0
  38. package/dist/web/assets/database-viewer-h7ffU0AC.js.gz +0 -0
  39. package/dist/web/assets/{diff-viewer-CdYarQJB.js → diff-viewer-DgUhjbEV.js} +1 -1
  40. package/dist/web/assets/diff-viewer-DgUhjbEV.js.br +0 -0
  41. package/dist/web/assets/diff-viewer-DgUhjbEV.js.gz +0 -0
  42. package/dist/web/assets/{editor-language-service-DfbGcR8Z.js → editor-language-service-B_bF-m5B.js} +1 -1
  43. package/dist/web/assets/editor-language-service-B_bF-m5B.js.br +0 -0
  44. package/dist/web/assets/editor-language-service-B_bF-m5B.js.gz +0 -0
  45. package/dist/web/assets/{explorer-body-wFbIJgNp.js → explorer-body-DRrd8uMc.js} +1 -1
  46. package/dist/web/assets/explorer-body-DRrd8uMc.js.br +0 -0
  47. package/dist/web/assets/explorer-body-DRrd8uMc.js.gz +0 -0
  48. package/dist/web/assets/{explorer-window-content-DYq7KGcO.js → explorer-window-content-zc-kA_lW.js} +1 -1
  49. package/dist/web/assets/explorer-window-content-zc-kA_lW.js.br +0 -0
  50. package/dist/web/assets/explorer-window-content-zc-kA_lW.js.gz +0 -0
  51. package/dist/web/assets/{extension-manager-section-CCefvD3E.js → extension-manager-section-BimH6DIA.js} +1 -1
  52. package/dist/web/assets/extension-manager-section-BimH6DIA.js.br +0 -0
  53. package/dist/web/assets/extension-manager-section-BimH6DIA.js.gz +0 -0
  54. package/dist/web/assets/{extension-webview-FTboocO5.js → extension-webview-DJYTtv-_.js} +1 -1
  55. package/dist/web/assets/extension-webview-DJYTtv-_.js.br +0 -0
  56. package/dist/web/assets/extension-webview-DJYTtv-_.js.gz +0 -0
  57. package/dist/web/assets/{files-settings-section-UVl8GQsn.js → files-settings-section-B0jy7Rez.js} +1 -1
  58. package/dist/web/assets/files-settings-section-B0jy7Rez.js.br +0 -0
  59. package/dist/web/assets/files-settings-section-B0jy7Rez.js.gz +0 -0
  60. package/dist/web/assets/{general-settings-section-xGc2e0nY.js → general-settings-section-MmIFyRwa.js} +1 -1
  61. package/dist/web/assets/general-settings-section-MmIFyRwa.js.br +0 -0
  62. package/dist/web/assets/general-settings-section-MmIFyRwa.js.gz +0 -0
  63. package/dist/web/assets/{git-log-panel-CssMDe8Y.js → git-log-panel-BCTP0Wht.js} +1 -1
  64. package/dist/web/assets/git-log-panel-BCTP0Wht.js.br +0 -0
  65. package/dist/web/assets/git-log-panel-BCTP0Wht.js.gz +0 -0
  66. package/dist/web/assets/{glide-data-grid-Bhwst_aN.js → glide-data-grid-CrE5DlCa.js} +1 -1
  67. package/dist/web/assets/glide-data-grid-CrE5DlCa.js.br +0 -0
  68. package/dist/web/assets/glide-data-grid-CrE5DlCa.js.gz +0 -0
  69. package/dist/web/assets/{group-chat-tab-BwKqWjpw.js → group-chat-tab-DxS-3-0R.js} +1 -1
  70. package/dist/web/assets/group-chat-tab-DxS-3-0R.js.br +0 -0
  71. package/dist/web/assets/group-chat-tab-DxS-3-0R.js.gz +0 -0
  72. package/dist/web/assets/{index-CFa7UeZs.js → index-C2luKRaD.js} +4 -4
  73. package/dist/web/assets/index-C2luKRaD.js.br +0 -0
  74. package/dist/web/assets/index-C2luKRaD.js.gz +0 -0
  75. package/dist/web/assets/index-C3lfHthr.css +1 -0
  76. package/dist/web/assets/index-C3lfHthr.css.br +0 -0
  77. package/dist/web/assets/index-C3lfHthr.css.gz +0 -0
  78. package/dist/web/assets/{jira-watcher-section-twnJI1tr.js → jira-watcher-section-CUGDYREo.js} +1 -1
  79. package/dist/web/assets/jira-watcher-section-CUGDYREo.js.br +0 -0
  80. package/dist/web/assets/jira-watcher-section-CUGDYREo.js.gz +0 -0
  81. package/dist/web/assets/{keybindings-store-BRiD4H8E.js → keybindings-store-jilemP-j.js} +1 -1
  82. package/dist/web/assets/{keyboard-shortcuts-section-3C51ZVVe.js → keyboard-shortcuts-section-DgRgRYMp.js} +1 -1
  83. package/dist/web/assets/keyboard-shortcuts-section-DgRgRYMp.js.br +0 -0
  84. package/dist/web/assets/keyboard-shortcuts-section-DgRgRYMp.js.gz +0 -0
  85. package/dist/web/assets/{markdown-renderer-Cqs7nUrs.js → markdown-renderer-BkQLWgLf.js} +1 -1
  86. package/dist/web/assets/markdown-renderer-BkQLWgLf.js.br +0 -0
  87. package/dist/web/assets/markdown-renderer-BkQLWgLf.js.gz +0 -0
  88. package/dist/web/assets/{markdown-renderer-Bkd3ia2Q.js → markdown-renderer-CeA7gHO_.js} +1 -1
  89. package/dist/web/assets/{mobile-explorer-sheet-BTNZ26Fd.js → mobile-explorer-sheet-DbrEMTTr.js} +1 -1
  90. package/dist/web/assets/mobile-explorer-sheet-DbrEMTTr.js.br +0 -0
  91. package/dist/web/assets/mobile-explorer-sheet-DbrEMTTr.js.gz +0 -0
  92. package/dist/web/assets/{notification-store-B7U7DTsB.js → notification-store-B4AUFEhp.js} +1 -1
  93. package/dist/web/assets/onboarding-entry-C81awoR5.js +1 -0
  94. package/dist/web/assets/onboarding-entry-C81awoR5.js.br +0 -0
  95. package/dist/web/assets/onboarding-entry-C81awoR5.js.gz +0 -0
  96. package/dist/web/assets/{ppmbot-settings-section-nZNoD6vx.js → ppmbot-settings-section-CS1l8Mv9.js} +1 -1
  97. package/dist/web/assets/ppmbot-settings-section-CS1l8Mv9.js.br +0 -0
  98. package/dist/web/assets/ppmbot-settings-section-CS1l8Mv9.js.gz +0 -0
  99. package/dist/web/assets/{problems-panel-oY4-2MDR.js → problems-panel-fCMIRPtD.js} +1 -1
  100. package/dist/web/assets/problems-panel-fCMIRPtD.js.br +0 -0
  101. package/dist/web/assets/problems-panel-fCMIRPtD.js.gz +0 -0
  102. package/dist/web/assets/{process-table-BH-ID142.js → process-table-lC_6ZfjX.js} +1 -1
  103. package/dist/web/assets/process-table-lC_6ZfjX.js.br +0 -0
  104. package/dist/web/assets/process-table-lC_6ZfjX.js.gz +0 -0
  105. package/dist/web/assets/{proxy-settings-section-Dh-NGom9.js → proxy-settings-section-CuOBJ8hL.js} +1 -1
  106. package/dist/web/assets/proxy-settings-section-CuOBJ8hL.js.br +0 -0
  107. package/dist/web/assets/proxy-settings-section-CuOBJ8hL.js.gz +0 -0
  108. package/dist/web/assets/{remote-desktop-clipboard-notice-CTI13Chq.js → remote-desktop-clipboard-notice-Dq7vzYMn.js} +1 -1
  109. package/dist/web/assets/remote-desktop-clipboard-notice-Dq7vzYMn.js.br +0 -0
  110. package/dist/web/assets/{remote-desktop-clipboard-notice-CTI13Chq.js.gz → remote-desktop-clipboard-notice-Dq7vzYMn.js.gz} +0 -0
  111. package/dist/web/assets/{remote-desktop-mobile-sheet-Dwx3wwZ2.js → remote-desktop-mobile-sheet-Ld9ebBdx.js} +2 -2
  112. package/dist/web/assets/remote-desktop-mobile-sheet-Ld9ebBdx.js.br +0 -0
  113. package/dist/web/assets/remote-desktop-mobile-sheet-Ld9ebBdx.js.gz +0 -0
  114. package/dist/web/assets/{remote-desktop-mobile-view-BCTHG_gw.js → remote-desktop-mobile-view-CX6o3CnW.js} +1 -1
  115. package/dist/web/assets/remote-desktop-mobile-view-CX6o3CnW.js.br +0 -0
  116. package/dist/web/assets/remote-desktop-mobile-view-CX6o3CnW.js.gz +0 -0
  117. package/dist/web/assets/{remote-desktop-readiness-gate-BfLXj0rs.js → remote-desktop-readiness-gate-M5FT8r1R.js} +1 -1
  118. package/dist/web/assets/remote-desktop-readiness-gate-M5FT8r1R.js.br +0 -0
  119. package/dist/web/assets/remote-desktop-readiness-gate-M5FT8r1R.js.gz +0 -0
  120. package/dist/web/assets/{remote-desktop-window-content-DifWxLaW.js → remote-desktop-window-content-9VmDB-li.js} +1 -1
  121. package/dist/web/assets/remote-desktop-window-content-9VmDB-li.js.br +0 -0
  122. package/dist/web/assets/remote-desktop-window-content-9VmDB-li.js.gz +0 -0
  123. package/dist/web/assets/{schedules-settings-section-B5ub8-6k.js → schedules-settings-section-S1GGjkHd.js} +1 -1
  124. package/dist/web/assets/schedules-settings-section-S1GGjkHd.js.br +0 -0
  125. package/dist/web/assets/schedules-settings-section-S1GGjkHd.js.gz +0 -0
  126. package/dist/web/assets/{settings-body-pB2eNvZs.js → settings-body-7BozQZQk.js} +2 -2
  127. package/dist/web/assets/settings-body-7BozQZQk.js.br +0 -0
  128. package/dist/web/assets/settings-body-7BozQZQk.js.gz +0 -0
  129. package/dist/web/assets/{settings-tab-CKzSb8CD.js → settings-tab-YB7WKDB2.js} +1 -1
  130. package/dist/web/assets/{settings-window-content-CMrJh0P1.js → settings-window-content-B_7MLQMM.js} +1 -1
  131. package/dist/web/assets/{sql-query-editor-CpGE7sKJ.js → sql-query-editor-DH7KmPwl.js} +1 -1
  132. package/dist/web/assets/sql-query-editor-DH7KmPwl.js.br +0 -0
  133. package/dist/web/assets/sql-query-editor-DH7KmPwl.js.gz +0 -0
  134. package/dist/web/assets/{sqlite-viewer-BTfTkzaU.js → sqlite-viewer-DV48IAz3.js} +1 -1
  135. package/dist/web/assets/sqlite-viewer-DV48IAz3.js.br +0 -0
  136. package/dist/web/assets/sqlite-viewer-DV48IAz3.js.gz +0 -0
  137. package/dist/web/assets/{system-monitor-body-D4N-0ePl.js → system-monitor-body-CkzG57Wr.js} +2 -2
  138. package/dist/web/assets/system-monitor-body-CkzG57Wr.js.br +0 -0
  139. package/dist/web/assets/system-monitor-body-CkzG57Wr.js.gz +0 -0
  140. package/dist/web/assets/{system-monitor-tab-CbqRdflk.js → system-monitor-tab-DHxUvcC_.js} +1 -1
  141. package/dist/web/assets/{system-monitor-window-content-C4QqmYwM.js → system-monitor-window-content-B2_i1Q61.js} +1 -1
  142. package/dist/web/assets/{tab-host-window-content-By_8oxwV.js → tab-host-window-content-BZeCdBjG.js} +1 -1
  143. package/dist/web/assets/tab-host-window-content-BZeCdBjG.js.br +0 -0
  144. package/dist/web/assets/tab-host-window-content-BZeCdBjG.js.gz +0 -0
  145. package/dist/web/assets/{team-member-sheet-pTyGJL8v.js → team-member-sheet-DoeUyf_H.js} +2 -2
  146. package/dist/web/assets/team-member-sheet-DoeUyf_H.js.br +0 -0
  147. package/dist/web/assets/team-member-sheet-DoeUyf_H.js.gz +0 -0
  148. package/dist/web/assets/{team-member-window-content-Dxy7ualQ.js → team-member-window-content-Bcjjehng.js} +1 -1
  149. package/dist/web/assets/team-member-window-content-Bcjjehng.js.br +0 -0
  150. package/dist/web/assets/team-member-window-content-Bcjjehng.js.gz +0 -0
  151. package/dist/web/assets/{terminal-tab-DZ-DBHmv.js → terminal-tab-DUfUFotE.js} +1 -1
  152. package/dist/web/assets/terminal-tab-DUfUFotE.js.br +0 -0
  153. package/dist/web/assets/terminal-tab-DUfUFotE.js.gz +0 -0
  154. package/dist/web/assets/{tool-cards-CPf7WLQy.js → tool-cards-DxWaY8Or.js} +2 -2
  155. package/dist/web/assets/tool-cards-DxWaY8Or.js.br +0 -0
  156. package/dist/web/assets/tool-cards-DxWaY8Or.js.gz +0 -0
  157. package/dist/web/assets/{use-inline-blame-vXJpe0ON.js → use-inline-blame-Bxjr1iem.js} +1 -1
  158. package/dist/web/assets/use-inline-blame-Bxjr1iem.js.br +0 -0
  159. package/dist/web/assets/use-inline-blame-Bxjr1iem.js.gz +0 -0
  160. package/dist/web/assets/{use-lsp-BVZ0d9td.js → use-lsp-C-glLtst.js} +1 -1
  161. package/dist/web/assets/use-lsp-C-glLtst.js.br +0 -0
  162. package/dist/web/assets/use-lsp-C-glLtst.js.gz +0 -0
  163. package/dist/web/assets/{use-monaco-theme-D69h-y-X.js → use-monaco-theme-VsUPgzDf.js} +1 -1
  164. package/dist/web/assets/{use-websocket-DMoom-pE.js → use-websocket-CutSagT7.js} +1 -1
  165. package/dist/web/assets/{video-preview-DoeqTKYG.js → video-preview-dXES6MNI.js} +1 -1
  166. package/dist/web/assets/video-preview-dXES6MNI.js.br +0 -0
  167. package/dist/web/assets/video-preview-dXES6MNI.js.gz +0 -0
  168. package/dist/web/index.html +2 -2
  169. package/dist/web/index.html.br +0 -0
  170. package/dist/web/index.html.gz +0 -0
  171. package/dist/web/sw.js +1 -1
  172. package/dist/web/sw.js.br +0 -0
  173. package/dist/web/sw.js.gz +0 -0
  174. package/package.json +1 -1
  175. package/src/services/edge-forwarder.ts +191 -191
  176. package/src/services/windows-process-tree.ts +351 -351
  177. package/src/web/components/chat/chat-welcome.tsx +1 -1
  178. package/src/web/components/onboarding/onboarding-entry.tsx +13 -4
  179. package/dist/web/assets/accounts-settings-section-BoTvueNs.js.br +0 -0
  180. package/dist/web/assets/accounts-settings-section-BoTvueNs.js.gz +0 -0
  181. package/dist/web/assets/ai-resource-editor-BZz447ab.js.br +0 -0
  182. package/dist/web/assets/ai-resource-editor-BZz447ab.js.gz +0 -0
  183. package/dist/web/assets/ai-settings-section-DR6ZplH4.js.br +0 -0
  184. package/dist/web/assets/ai-settings-section-DR6ZplH4.js.gz +0 -0
  185. package/dist/web/assets/appearance-settings-section-JSk2rrSM.js.br +0 -0
  186. package/dist/web/assets/appearance-settings-section-JSk2rrSM.js.gz +0 -0
  187. package/dist/web/assets/branch-review-tab-BTobiTaa.js.br +0 -0
  188. package/dist/web/assets/branch-review-tab-BTobiTaa.js.gz +0 -0
  189. package/dist/web/assets/chat-tab-XT-23JtV.js.br +0 -0
  190. package/dist/web/assets/chat-tab-XT-23JtV.js.gz +0 -0
  191. package/dist/web/assets/code-editor-Jmst2xot.js.br +0 -0
  192. package/dist/web/assets/code-editor-Jmst2xot.js.gz +0 -0
  193. package/dist/web/assets/codex-daily-guard-C3m_OZs9.js.br +0 -0
  194. package/dist/web/assets/codex-daily-guard-C3m_OZs9.js.gz +0 -0
  195. package/dist/web/assets/conflict-editor-BYRCRGXw.js.br +0 -0
  196. package/dist/web/assets/conflict-editor-BYRCRGXw.js.gz +0 -0
  197. package/dist/web/assets/csv-preview-D7OFzZJY.js.br +0 -0
  198. package/dist/web/assets/csv-preview-D7OFzZJY.js.gz +0 -0
  199. package/dist/web/assets/database-viewer-SSbCY87C.js.br +0 -0
  200. package/dist/web/assets/database-viewer-SSbCY87C.js.gz +0 -0
  201. package/dist/web/assets/diff-viewer-CdYarQJB.js.br +0 -0
  202. package/dist/web/assets/diff-viewer-CdYarQJB.js.gz +0 -0
  203. package/dist/web/assets/editor-language-service-DfbGcR8Z.js.br +0 -0
  204. package/dist/web/assets/editor-language-service-DfbGcR8Z.js.gz +0 -0
  205. package/dist/web/assets/explorer-body-wFbIJgNp.js.br +0 -0
  206. package/dist/web/assets/explorer-body-wFbIJgNp.js.gz +0 -0
  207. package/dist/web/assets/explorer-window-content-DYq7KGcO.js.br +0 -0
  208. package/dist/web/assets/explorer-window-content-DYq7KGcO.js.gz +0 -0
  209. package/dist/web/assets/extension-manager-section-CCefvD3E.js.br +0 -0
  210. package/dist/web/assets/extension-manager-section-CCefvD3E.js.gz +0 -0
  211. package/dist/web/assets/extension-webview-FTboocO5.js.br +0 -0
  212. package/dist/web/assets/extension-webview-FTboocO5.js.gz +0 -0
  213. package/dist/web/assets/files-settings-section-UVl8GQsn.js.br +0 -0
  214. package/dist/web/assets/files-settings-section-UVl8GQsn.js.gz +0 -0
  215. package/dist/web/assets/general-settings-section-xGc2e0nY.js.br +0 -0
  216. package/dist/web/assets/general-settings-section-xGc2e0nY.js.gz +0 -0
  217. package/dist/web/assets/git-log-panel-CssMDe8Y.js.br +0 -0
  218. package/dist/web/assets/git-log-panel-CssMDe8Y.js.gz +0 -0
  219. package/dist/web/assets/glide-data-grid-Bhwst_aN.js.br +0 -0
  220. package/dist/web/assets/glide-data-grid-Bhwst_aN.js.gz +0 -0
  221. package/dist/web/assets/group-chat-tab-BwKqWjpw.js.br +0 -0
  222. package/dist/web/assets/group-chat-tab-BwKqWjpw.js.gz +0 -0
  223. package/dist/web/assets/index-CFa7UeZs.js.br +0 -0
  224. package/dist/web/assets/index-CFa7UeZs.js.gz +0 -0
  225. package/dist/web/assets/index-CWL5emyr.css +0 -1
  226. package/dist/web/assets/index-CWL5emyr.css.br +0 -0
  227. package/dist/web/assets/index-CWL5emyr.css.gz +0 -0
  228. package/dist/web/assets/jira-watcher-section-twnJI1tr.js.br +0 -0
  229. package/dist/web/assets/jira-watcher-section-twnJI1tr.js.gz +0 -0
  230. package/dist/web/assets/keyboard-shortcuts-section-3C51ZVVe.js.br +0 -0
  231. package/dist/web/assets/keyboard-shortcuts-section-3C51ZVVe.js.gz +0 -0
  232. package/dist/web/assets/markdown-renderer-Cqs7nUrs.js.br +0 -0
  233. package/dist/web/assets/markdown-renderer-Cqs7nUrs.js.gz +0 -0
  234. package/dist/web/assets/mobile-explorer-sheet-BTNZ26Fd.js.br +0 -0
  235. package/dist/web/assets/mobile-explorer-sheet-BTNZ26Fd.js.gz +0 -0
  236. package/dist/web/assets/onboarding-entry-BpvMFO1h.js +0 -1
  237. package/dist/web/assets/ppmbot-settings-section-nZNoD6vx.js.br +0 -0
  238. package/dist/web/assets/ppmbot-settings-section-nZNoD6vx.js.gz +0 -0
  239. package/dist/web/assets/problems-panel-oY4-2MDR.js.br +0 -0
  240. package/dist/web/assets/problems-panel-oY4-2MDR.js.gz +0 -0
  241. package/dist/web/assets/process-table-BH-ID142.js.br +0 -0
  242. package/dist/web/assets/process-table-BH-ID142.js.gz +0 -0
  243. package/dist/web/assets/proxy-settings-section-Dh-NGom9.js.br +0 -0
  244. package/dist/web/assets/proxy-settings-section-Dh-NGom9.js.gz +0 -0
  245. package/dist/web/assets/remote-desktop-clipboard-notice-CTI13Chq.js.br +0 -0
  246. package/dist/web/assets/remote-desktop-mobile-sheet-Dwx3wwZ2.js.br +0 -0
  247. package/dist/web/assets/remote-desktop-mobile-sheet-Dwx3wwZ2.js.gz +0 -0
  248. package/dist/web/assets/remote-desktop-mobile-view-BCTHG_gw.js.br +0 -0
  249. package/dist/web/assets/remote-desktop-mobile-view-BCTHG_gw.js.gz +0 -0
  250. package/dist/web/assets/remote-desktop-readiness-gate-BfLXj0rs.js.br +0 -0
  251. package/dist/web/assets/remote-desktop-readiness-gate-BfLXj0rs.js.gz +0 -0
  252. package/dist/web/assets/remote-desktop-window-content-DifWxLaW.js.br +0 -0
  253. package/dist/web/assets/remote-desktop-window-content-DifWxLaW.js.gz +0 -0
  254. package/dist/web/assets/schedules-settings-section-B5ub8-6k.js.br +0 -0
  255. package/dist/web/assets/schedules-settings-section-B5ub8-6k.js.gz +0 -0
  256. package/dist/web/assets/settings-body-pB2eNvZs.js.br +0 -0
  257. package/dist/web/assets/settings-body-pB2eNvZs.js.gz +0 -0
  258. package/dist/web/assets/sql-query-editor-CpGE7sKJ.js.br +0 -0
  259. package/dist/web/assets/sql-query-editor-CpGE7sKJ.js.gz +0 -0
  260. package/dist/web/assets/sqlite-viewer-BTfTkzaU.js.br +0 -0
  261. package/dist/web/assets/sqlite-viewer-BTfTkzaU.js.gz +0 -0
  262. package/dist/web/assets/system-monitor-body-D4N-0ePl.js.br +0 -0
  263. package/dist/web/assets/system-monitor-body-D4N-0ePl.js.gz +0 -0
  264. package/dist/web/assets/tab-host-window-content-By_8oxwV.js.br +0 -0
  265. package/dist/web/assets/tab-host-window-content-By_8oxwV.js.gz +0 -0
  266. package/dist/web/assets/team-member-sheet-pTyGJL8v.js.br +0 -0
  267. package/dist/web/assets/team-member-sheet-pTyGJL8v.js.gz +0 -0
  268. package/dist/web/assets/team-member-window-content-Dxy7ualQ.js.br +0 -0
  269. package/dist/web/assets/team-member-window-content-Dxy7ualQ.js.gz +0 -0
  270. package/dist/web/assets/terminal-tab-DZ-DBHmv.js.br +0 -0
  271. package/dist/web/assets/terminal-tab-DZ-DBHmv.js.gz +0 -0
  272. package/dist/web/assets/tool-cards-CPf7WLQy.js.br +0 -0
  273. package/dist/web/assets/tool-cards-CPf7WLQy.js.gz +0 -0
  274. package/dist/web/assets/use-inline-blame-vXJpe0ON.js.br +0 -0
  275. package/dist/web/assets/use-inline-blame-vXJpe0ON.js.gz +0 -0
  276. package/dist/web/assets/use-lsp-BVZ0d9td.js.br +0 -0
  277. package/dist/web/assets/use-lsp-BVZ0d9td.js.gz +0 -0
  278. package/dist/web/assets/video-preview-DoeqTKYG.js.br +0 -0
  279. package/dist/web/assets/video-preview-DoeqTKYG.js.gz +0 -0
  280. package/packages/vscode-compat/node_modules/.bin/tsc.bunx +0 -0
  281. package/packages/vscode-compat/node_modules/.bin/tsc.exe +0 -0
  282. package/packages/vscode-compat/node_modules/.bin/tsserver.bunx +0 -0
  283. package/packages/vscode-compat/node_modules/.bin/tsserver.exe +0 -0
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{$t as r,Ar as i,At as a,Br as o,N as s,O as c,On as l,Ot as u,Qn as d,Un as f,Ut as p,Vn as m,Vt as h,d as g,in as _,ir as v,j as y,kr as b,l as x,lt as S,mt as C,nr as ee,nt as te,p as ne,q as re,qn as ie,qt as ae,r as oe,st as se,tt as ce,u as le,ut as ue,w as de,wr as fe,zt as w}from"./icons-DQjqk0lJ.js";import{t as pe}from"./createLucideIcon-DoiEKeJ_.js";import{r as me,s as T}from"./api-client-Jn3njtNw.js";import{t as he}from"./react-Bghu0NUO.js";import{n as E}from"./utils-Bmf_8h7Y.js";import{t as ge}from"./window-store-UC1jJeLM.js";import{t as _e}from"./tab-store-krAuHQ6_.js";import{o as ve}from"./file-store-Ds3qJ4hC.js";import{n as D}from"./use-is-mobile-TkcwP1Gx.js";import{a as ye,d as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./format-file-meta-eKLstbCL.js";import{t as Ee}from"./file-icons-wS-OmEVu.js";import{i as De,n as Oe,o as ke,r as O,t as Ae}from"./mobile-bottom-sheet-C3TniEP-.js";import{n as k,t as je}from"./fs-api-orca76dV.js";import{Bt as A,Ct as Me,Dt as Ne,Et as Pe,Ft as Fe,Gt as Ie,It as j,Jt as Le,Kt as Re,Lt as ze,Mt as Be,Nt as M,Ot as N,Pt as Ve,Rt as He,St as Ue,Tt as We,Ut as Ge,Vt as Ke,Xt as qe,Yt as Je,_t as P,bt as Ye,ct as Xe,dt as Ze,en as Qe,ft as $e,jt as F,lt as et,mt as tt,pt as I,qt as nt,rn as rt,st as L,ut as it,v as at,wt as ot,xt as R,yt as st,zt as ct}from"./index-CFa7UeZs.js";import{a as z,o as B,s as lt}from"./can-open-in-ppm-CUW3vVJg.js";var ut=pe(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),dt=`ppm-explorer-pins`,ft=50;function pt(){try{let e=localStorage.getItem(dt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>!!e&&typeof e.path==`string`&&typeof e.name==`string`).slice(0,ft):[]}catch{return[]}}function mt(e){try{localStorage.setItem(dt,JSON.stringify(e))}catch{}}var V=he((e,t)=>({pins:pt(),isPinned:e=>t().pins.some(t=>t.path===e),pin:n=>{if(t().isPinned(n.path))return;let r=[...t().pins,n].slice(0,ft);mt(r),e({pins:r})},unpin:n=>{let r=t().pins.filter(e=>e.path!==n);mt(r),e({pins:r})}}));function ht(e){return z(e.name)?(_e.getState().openTab({type:lt(e.name)===`sqlite`?`sqlite`:`editor`,title:e.name,projectId:null,metadata:{filePath:e.path},closable:!0}),!0):!1}function gt(e){return ge.getState().open(`explorer`,{path:e})}async function _t(e){let t=e.filter(e=>e.type===`file`),n=e.length-t.length;n>0&&T.warning(n===1?`Folders cannot be downloaded`:`${n} folders skipped`);for(let e of t)try{be(await k.downloadUrl(e.path),e.name)}catch(t){T.error(`Download failed: ${e.name}`,{description:t instanceof Error?t.message:void 0})}}async function vt(e,t){e.length!==0&&(await rt(e.join(`
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import{$t as r,Ar as i,At as a,Br as o,N as s,O as c,On as l,Ot as u,Qn as d,Un as f,Ut as p,Vn as m,Vt as h,d as g,in as _,ir as v,j as y,kr as b,l as x,lt as S,mt as C,nr as ee,nt as te,p as ne,q as re,qn as ie,qt as ae,r as oe,st as se,tt as ce,u as le,ut as ue,w as de,wr as fe,zt as w}from"./icons-DQjqk0lJ.js";import{t as pe}from"./createLucideIcon-DoiEKeJ_.js";import{r as me,s as T}from"./api-client-Jn3njtNw.js";import{t as he}from"./react-Bghu0NUO.js";import{n as E}from"./utils-Bmf_8h7Y.js";import{t as ge}from"./window-store-UC1jJeLM.js";import{t as _e}from"./tab-store-krAuHQ6_.js";import{o as ve}from"./file-store-Ds3qJ4hC.js";import{n as D}from"./use-is-mobile-TkcwP1Gx.js";import{a as ye,d as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./format-file-meta-eKLstbCL.js";import{t as Ee}from"./file-icons-wS-OmEVu.js";import{i as De,n as Oe,o as ke,r as O,t as Ae}from"./mobile-bottom-sheet-C3TniEP-.js";import{n as k,t as je}from"./fs-api-orca76dV.js";import{Bt as A,Ct as Me,Dt as Ne,Et as Pe,Ft as Fe,Gt as Ie,It as j,Jt as Le,Kt as Re,Lt as ze,Mt as Be,Nt as M,Ot as N,Pt as Ve,Rt as He,St as Ue,Tt as We,Ut as Ge,Vt as Ke,Xt as qe,Yt as Je,_t as P,bt as Ye,ct as Xe,dt as Ze,en as Qe,ft as $e,jt as F,lt as et,mt as tt,pt as I,qt as nt,rn as rt,st as L,ut as it,v as at,wt as ot,xt as R,yt as st,zt as ct}from"./index-C2luKRaD.js";import{a as z,o as B,s as lt}from"./can-open-in-ppm-CUW3vVJg.js";var ut=pe(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),dt=`ppm-explorer-pins`,ft=50;function pt(){try{let e=localStorage.getItem(dt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>!!e&&typeof e.path==`string`&&typeof e.name==`string`).slice(0,ft):[]}catch{return[]}}function mt(e){try{localStorage.setItem(dt,JSON.stringify(e))}catch{}}var V=he((e,t)=>({pins:pt(),isPinned:e=>t().pins.some(t=>t.path===e),pin:n=>{if(t().isPinned(n.path))return;let r=[...t().pins,n].slice(0,ft);mt(r),e({pins:r})},unpin:n=>{let r=t().pins.filter(e=>e.path!==n);mt(r),e({pins:r})}}));function ht(e){return z(e.name)?(_e.getState().openTab({type:lt(e.name)===`sqlite`?`sqlite`:`editor`,title:e.name,projectId:null,metadata:{filePath:e.path},closable:!0}),!0):!1}function gt(e){return ge.getState().open(`explorer`,{path:e})}async function _t(e){let t=e.filter(e=>e.type===`file`),n=e.length-t.length;n>0&&T.warning(n===1?`Folders cannot be downloaded`:`${n} folders skipped`);for(let e of t)try{be(await k.downloadUrl(e.path),e.name)}catch(t){T.error(`Download failed: ${e.name}`,{description:t instanceof Error?t.message:void 0})}}async function vt(e,t){e.length!==0&&(await rt(e.join(`
2
2
  `)),T.success(e.length===1?`${t} copied`:`${e.length} ${t.toLowerCase()}s copied`))}var yt=/[<>:"|?*]/,bt=/[\u0000-\u001f]/,xt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;function St(e,t){if(!e)return`Name cannot be empty`;if(e===`.`||e===`..`)return`Reserved name`;if(e.includes(`/`)||e.includes(`\\`))return`Name cannot contain path separators`;if(bt.test(e))return`Invalid character in name`;if(t===`win32`){if(yt.test(e))return`Cannot contain < > : " | ? *`;if(xt.test(e))return`"${e}" is a reserved Windows name`;if(e.endsWith(`.`)||e.endsWith(` `))return`Cannot end with a dot or space`}return null}async function Ct(e,t,n,r){let i=we(e,t,r);try{return n===`folder`?await k.mkdir(i,!1):await k.touch(i),Pe(e),!0}catch(e){return T.error(n===`folder`?`Could not create folder`:`Could not create file`,{description:xe(e)}),!1}}async function wt(e,t,n){try{return await k.rename(e,t),Pe(Te(e,n)),!0}catch(e){return T.error(`Rename failed`,{description:xe(e)}),!1}}async function Tt(e,t,n){let r={removed:0,needsPermanent:[]},i=new Set;for(let a of e){i.add(Te(a,n));try{await k.remove(a,t),r.removed++}catch(e){if(e instanceof je&&e.code===`NO_TRASH`){r.needsPermanent.push(a);continue}T.error(`Delete failed`,{description:xe(e)})}}if(Pe(...i),r.removed>0){let e=`${r.removed} item${r.removed===1?``:`s`}`;T.success(t?`Deleted ${e}`:`Moved ${e} to Trash`)}return r}function Et(e,t){let n=e?Array.from({length:e.length},(t,n)=>e.item(n)).filter(e=>e!=null):[];return t(),n}var H=e(t(),1),U=n();function Dt(e){let t=(0,H.useRef)(null),n=(0,H.useRef)(null),r=typeof document<`u`&&`webkitdirectory`in document.createElement(`input`),i=t=>{let n=Et(t.target.files,()=>{t.target.value=``});n.length!==0&&e(n.map(e=>({file:e,relativePath:e.webkitRelativePath||e.name})))};return{supportsFolderPicker:r,openFilePicker:()=>t.current?.click(),openFolderPicker:()=>n.current?.click(),inputs:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{ref:t,type:`file`,multiple:!0,hidden:!0,onChange:i,"data-testid":`explorer-upload-file-input`}),r&&(0,U.jsx)(`input`,{ref:n,webkitdirectory:``,type:`file`,multiple:!0,hidden:!0,onChange:i,"data-testid":`explorer-upload-folder-input`})]})}}function Ot(e,t){let n=(0,H.useCallback)((t,n)=>$e(t,n,e.sep,e),[e]),r=Dt(e=>void n(e,t()));return{uploadInto:n,openUploadPicker:r.openFilePicker,openUploadFolderPicker:r.openFolderPicker,supportsFolderUpload:r.supportsFolderPicker,uploadInputs:r.inputs}}function kt(e,t,n,r){let i=N(e=>e.patch),a=Ze(),o=it(),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(null),p=(0,H.useRef)(t);p.current=t;let m=(0,H.useRef)(a);m.current=a;let h=(0,H.useRef)(o);h.current=o;let g=(0,H.useMemo)(()=>({get sep(){return p.current?.sep??`/`},resolve:e=>m.current.resolve(e),startBatch:()=>m.current.startBatch(),endBatch:()=>m.current.endBatch(),confirmPermanentOverwrite:e=>h.current.confirm(e)}),[]),_=()=>p.current?.path??``,v=Ot(g,_),y=(0,H.useMemo)(()=>({openEntry:e=>{e.type===`directory`?n.go(e.path):ht(e)},openInNewWindow:e=>{gt(e.type===`directory`?e.path:p.current?.path??e.path)},openInTerminal:e=>{tt(e?.type===`directory`?e.path:_())},cut:e=>ot(e.map(e=>e.path),`cut`),copy:e=>ot(e.map(e=>e.path),`copy`),paste:e=>void Me(e??_(),g),transferInto:async(e,t,n)=>{let r=await We(e,t,n,g);if(r.succeeded>0){let e=n===`copy`?`Copied`:`Moved`;T.success(`${e} ${r.succeeded} item${r.succeeded===1?``:`s`}`)}},uploadInto:v.uploadInto,openUploadPicker:v.openUploadPicker,openUploadFolderPicker:v.openUploadFolderPicker,supportsFolderUpload:v.supportsFolderUpload,startRename:t=>{f(null),i(e,{inlineEdit:{kind:`rename`,path:t.path,initial:t.name}})},startCreate:t=>{f(null),i(e,{inlineEdit:{kind:t,initial:``}})},cancelInline:()=>{f(null),i(e,{inlineEdit:null})},commitInline:async t=>{let n=p.current,a=n?.inlineEdit;if(!n||!a)return;let o=t.trim();if(a.kind===`rename`&&o===a.initial){i(e,{inlineEdit:null});return}let s=St(o,r);if(s){f(s);return}f(null),(a.kind===`rename`?await wt(a.path,o,n.sep):await Ct(n.path,o,a.kind===`new-folder`?`folder`:`file`,n.sep))&&i(e,{inlineEdit:null})},trash:e=>{Tt(e.map(e=>e.path),!1,p.current?.sep??`/`).then(e=>{e.needsPermanent.length>0&&c({paths:e.needsPermanent,names:e.needsPermanent.map(e=>e.split(/[/\\]/).pop()??e)})})},confirmPermanentDelete:e=>{e.length!==0&&c({paths:e.map(e=>e.path),names:e.map(e=>e.name)})},download:e=>void _t(e),copyPath:e=>void vt(e,`Path`),copyName:e=>void vt(e,`Name`),togglePin:(e,t)=>{let n=V.getState();n.isPinned(e)?n.unpin(e):n.pin({path:e,name:t})},showProperties:e=>u(e)}),[e,i,n,g,r,v]),b=(0,H.useCallback)(()=>{let e=s;c(null),e&&Tt(e.paths,!0,p.current?.sep??`/`)},[s]);return{actions:y,dialogs:{collision:a.state,pendingDelete:s,permanentOverwrite:o.state,properties:l,inlineError:d,closeDelete:()=>c(null),runPermanentDelete:b,closeProperties:()=>u(null),uploadInputs:v.uploadInputs}}}var At=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...e,children:(0,U.jsx)(`path`,{stroke:`#64748B`,strokeWidth:`2`,d:`M7.784 5H5a2 2 0 00-2 2v10a2 2 0 002 2h14a2 2 0 002-2V9.875a2 2 0 00-2-2h-6.284a2 2 0 01-1.27-.455L9.054 5.455A2 2 0 007.783 5z`})}),jt=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...e,children:(0,U.jsx)(`path`,{fill:`#64748B`,stroke:`#64748B`,strokeWidth:`2`,d:`M7.784 5H5a2 2 0 00-2 2v10a2 2 0 002 2h14a2 2 0 002-2V9.875a2 2 0 00-2-2h-6.284a2 2 0 01-1.27-.455L9.054 5.455A2 2 0 007.783 5z`})}),Mt=At,Nt=jt,Pt=(0,H.createContext)({closed:Mt,open:Nt}),Ft=Pt.Provider;function W({name:e,kind:t,open:n,className:r}){let i=(0,H.useContext)(Pt),o=E(`shrink-0`,r);return t===`directory`?(0,U.jsx)(n?i.open:i.closed,{className:o}):t===`symlink`?(0,U.jsx)(a,{className:E(o,`text-text-2`)}):t===`unknown`?(0,U.jsx)(h,{className:E(o,`text-text-subtle`)}):(0,U.jsx)(Ee,{name:e,className:o})}function It({className:e}){return(0,U.jsx)(W,{name:``,kind:`directory`,className:E(`size-4 shrink-0`,e)})}var Lt={fixed:w,removable:i,network:ut,unknown:w};function G({label:e,path:t,active:n,icon:r,onNavigate:i,onUnpin:a,run:o,uploadRun:s}){let c=Ue(),l=L({targetDir:t,run:o,onFiles:s});return(0,U.jsxs)(`div`,{className:`group/place relative flex items-center`,children:[(0,U.jsxs)(`button`,{type:`button`,title:t,onClick:()=>i(t),className:E(`flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[13px]`,c?`min-h-[44px]`:`min-h-0`,`can-hover:hover:bg-surface-elevated`,n?`bg-accent-wash text-text`:`text-text-2`,l.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...l.handlers,children:[(0,U.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}),(0,U.jsx)(`span`,{className:`truncate`,children:e})]}),a&&(0,U.jsx)(`button`,{type:`button`,"aria-label":`Unpin ${e}`,title:`Unpin`,onClick:a,className:`absolute right-1 rounded p-1 text-text-subtle can-hover:opacity-0 can-hover:group-hover/place:opacity-100 can-hover:hover:text-text`,children:(0,U.jsx)(f,{className:`size-3.5`})})]})}function K({title:e,children:t}){return(0,U.jsxs)(`div`,{className:`pb-2`,children:[(0,U.jsx)(`p`,{className:`px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase tracking-wide text-text-subtle`,children:e}),t]})}var Rt={home:`Home`,pinned:`Quick access`,known:`Folders`,drives:`Drives`};function zt({host:e,currentPath:t,onNavigate:n,vocab:r=Rt}){let i=V(e=>e.pins),a=V(e=>e.unpin),o=e=>e===t,{run:s,uploadRun:c,prompts:l}=Xe(e?.sep??`/`,e?.platform);return(0,U.jsxs)(`aside`,{"aria-label":`Places`,"data-testid":`explorer-sidebar`,className:`hidden w-44 shrink-0 overflow-y-auto border-r border-border bg-[var(--x-sidebar-bg,var(--panel-2))] px-1 py-1 sm:block`,children:[i.length>0&&(0,U.jsx)(K,{title:`Pinned`,children:i.map(e=>(0,U.jsx)(G,{label:e.name,path:e.path,icon:f,active:o(e.path),onNavigate:n,onUnpin:()=>a(e.path),run:s,uploadRun:c},e.path))}),e&&e.pinned.length>0&&(0,U.jsx)(K,{title:r.pinned,children:e.pinned.map(e=>(0,U.jsx)(G,{label:e.name,path:e.path,icon:It,active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))}),e&&(0,U.jsxs)(K,{title:r.known,children:[(0,U.jsx)(G,{label:r.home,path:e.homedir,icon:It,active:o(e.homedir),onNavigate:n,run:s,uploadRun:c}),e.knownFolders.map(e=>(0,U.jsx)(G,{label:e.name,path:e.path,icon:It,active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))]}),e&&e.drives.length>0&&(0,U.jsx)(K,{title:r.drives,children:e.drives.map(e=>(0,U.jsx)(G,{label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:Lt[e.kind],active:o(e.path),onNavigate:n,run:s,uploadRun:c},e.path))}),e?.warnings.map(e=>(0,U.jsxs)(`p`,{className:`flex gap-1.5 px-2 py-1 text-[11px] leading-snug text-text-subtle`,children:[(0,U.jsx)(oe,{className:`mt-0.5 size-3 shrink-0`}),(0,U.jsx)(`span`,{children:e})]},e)),l]})}var q=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Bt(e,t,n){switch(e){case`size`:return(t.size??0)-(n.size??0);case`modified`:return new Date(t.modified).getTime()-new Date(n.modified).getTime();case`kind`:{let e=q.compare(B(t.name),B(n.name));return e===0?q.compare(t.name,n.name):e}case`name`:return q.compare(t.name,n.name)}}function Vt(e,t,n){let r=t.trim().toLowerCase(),i=r?e.filter(e=>e.name.toLowerCase().includes(r)):e,a=n.dir===`asc`?1:-1;return[...i].sort((e,t)=>{let r=e.type===`directory`;if(r!==(t.type===`directory`))return r?-1:1;let i=Bt(n.key,e,t);return(i===0?q.compare(e.name,t.name):i)*a})}function Ht(e){return e.reduce((e,t)=>e+(t.type===`file`?t.size??0:0),0)}function Ut({entries:e,selection:t,truncated:n}){let r=e.filter(e=>t.has(e.path)),i=[`${e.length}${n?`+`:``} item${e.length===1?``:`s`}`];if(r.length>0){i.push(`${r.length} selected`);let e=Ht(r);e>0&&i.push(Se(e))}return(0,U.jsxs)(`div`,{"data-testid":`explorer-status`,className:`flex shrink-0 items-center gap-2 border-t border-border bg-panel-2 px-2 py-1 text-[11px] text-text-subtle`,children:[i.join(` · `),n&&(0,U.jsx)(`span`,{className:`ml-auto`,children:`Listing capped — narrow the filter to see the rest.`})]})}var Wt=3;function Gt({crumbs:e,onNavigate:t,className:n,sep:r}){let{run:i,prompts:a}=Xe(r);if(e.length===0)return(0,U.jsx)(`div`,{className:n});let o=e.length>Wt+2,s=o?e.slice(0,1):e,c=o?e.slice(1,e.length-Wt):[],u=o?e.slice(e.length-Wt):[];return(0,U.jsxs)(`nav`,{"aria-label":`Path`,className:E(`flex min-w-0 items-center gap-0.5 text-xs`,n),children:[s.map(n=>(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,U.jsx)(Kt,{crumb:n,last:!o&&n===e[e.length-1],onNavigate:t,run:i}),(0,U.jsx)(y,{className:`size-3 shrink-0 text-text-subtle`})]},n.path)),o&&(0,U.jsxs)(Ge,{children:[(0,U.jsx)(Qe,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":`Show hidden path segments`,className:`rounded px-1 py-0.5 text-text-2 can-hover:hover:bg-surface-elevated`,children:(0,U.jsx)(l,{className:`size-3.5`})})}),(0,U.jsx)(Ie,{align:`start`,className:`max-h-72 overflow-y-auto`,children:c.map(e=>(0,U.jsx)(Re,{onClick:()=>t(e.path),children:e.name},e.path))})]}),o&&(0,U.jsx)(y,{className:`size-3 shrink-0 text-text-subtle`}),u.map((e,n)=>(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-0.5`,children:[(0,U.jsx)(Kt,{crumb:e,last:n===u.length-1,onNavigate:t,run:i}),n<u.length-1&&(0,U.jsx)(y,{className:`size-3 shrink-0 text-text-subtle`})]},e.path)),a]})}function Kt({crumb:e,last:t,onNavigate:n,run:r}){let i=L({targetDir:e.path,run:r});return(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:E(`max-w-[12rem] truncate rounded px-1 py-0.5 can-hover:hover:bg-surface-elevated`,t?`font-medium text-text`:`text-text-2`,i.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...i.handlers,children:e.name})}var J=[{key:`name`,label:`Name`},{key:`size`,label:`Size`},{key:`modified`,label:`Modified`},{key:`kind`,label:`Kind`}],qt=[{dir:`asc`,label:`Ascending`},{dir:`desc`,label:`Descending`}];function Jt(e){return J.find(t=>t.key===e)?.label??e}function Yt(e){return qt.find(t=>t.dir===e)?.label??e}function Y(e){return E(`relative flex size-7 shrink-0 items-center justify-center rounded text-text-subtle can-hover:hover:bg-surface-elevated can-hover:hover:text-text disabled:opacity-30`,e&&`before:absolute before:-inset-2 before:content-['']`)}function Xt({coarse:e}){let t=N(e=>e.sort),n=N(e=>e.setPrefs),r=`Sort`,i=`${r}: ${Jt(t.key)}, ${Yt(t.dir)}`;return(0,U.jsxs)(Ge,{children:[(0,U.jsx)(Qe,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":r,title:i,className:Y(e),children:(0,U.jsx)(ne,{className:`size-4`})})}),(0,U.jsxs)(Ie,{align:`end`,children:[(0,U.jsx)(nt,{children:`Sort by`}),(0,U.jsx)(Le,{value:t.key,onValueChange:e=>n({sort:{key:e,dir:t.dir}}),children:J.map(({key:e,label:t})=>(0,U.jsx)(Je,{value:e,children:t},e))}),(0,U.jsx)(qe,{}),(0,U.jsx)(nt,{children:`Order`}),(0,U.jsx)(Le,{value:t.dir,onValueChange:e=>n({sort:{key:t.key,dir:e}}),children:qt.map(({dir:e,label:t})=>(0,U.jsx)(Je,{value:e,children:t},e))})]})]})}function X({targets:e,currentDir:t,hasClipboard:n,isPinned:r,actions:i}){let a=D(),o=e.length===1?e[0]:null,s=e.length>0&&e.every(e=>e.type===`directory`),c=e.length,l=c>1?` ${c} items`:``,u=N(e=>e.sort),d=N(e=>e.setPrefs);return c===0?(0,U.jsxs)(Be,{children:[(0,U.jsx)(M,{onClick:()=>i.startCreate(`new-file`),children:`New File`}),(0,U.jsx)(M,{onClick:()=>i.startCreate(`new-folder`),children:`New Folder`}),(0,U.jsx)(j,{}),(0,U.jsx)(M,{disabled:!n,onClick:()=>i.paste(),children:`Paste`}),(0,U.jsx)(j,{}),(0,U.jsx)(M,{onClick:()=>i.openUploadPicker(),children:`Upload Files…`}),i.supportsFolderUpload&&(0,U.jsx)(M,{onClick:()=>i.openUploadFolderPicker(),children:`Upload Folder…`}),(0,U.jsx)(j,{}),(0,U.jsx)(M,{onClick:()=>i.openInTerminal(),children:`Open in Terminal`}),(0,U.jsx)(j,{}),(0,U.jsxs)(ze,{children:[(0,U.jsx)(ct,{children:`Sort by`}),(0,U.jsxs)(He,{children:[(0,U.jsx)(Ve,{value:u.key,onValueChange:e=>d({sort:{key:e,dir:u.dir}}),children:J.map(({key:e,label:t})=>(0,U.jsx)(Fe,{value:e,children:t},e))}),(0,U.jsx)(j,{}),(0,U.jsx)(Ve,{value:u.dir,onValueChange:e=>d({sort:{key:u.key,dir:e}}),children:qt.map(({dir:e,label:t})=>(0,U.jsx)(Fe,{value:e,children:t},e))})]})]}),(0,U.jsx)(j,{}),(0,U.jsx)(M,{onClick:()=>i.copyPath([t]),children:`Copy Path`})]}):(0,U.jsxs)(Be,{children:[o&&(o.type===`directory`||z(o.name))&&(0,U.jsx)(M,{onClick:()=>i.openEntry(o),children:`Open`}),s&&o&&!a&&(0,U.jsx)(M,{onClick:()=>i.openInNewWindow(o),children:`Open in New Window`}),s&&o&&(0,U.jsx)(M,{onClick:()=>i.openInTerminal(o),children:`Open in Terminal`}),(0,U.jsx)(j,{}),(0,U.jsxs)(M,{onClick:()=>i.cut(e),children:[`Cut`,l]}),(0,U.jsxs)(M,{onClick:()=>i.copy(e),children:[`Copy`,l]}),s&&o&&(0,U.jsx)(M,{disabled:!n,onClick:()=>i.paste(o.path),children:`Paste`}),(0,U.jsx)(j,{}),o&&(0,U.jsx)(M,{onClick:()=>i.startRename(o),children:`Rename`}),(0,U.jsxs)(M,{onClick:()=>i.trash(e),children:[`Move to Trash`,l]}),(0,U.jsx)(M,{variant:`destructive`,onClick:()=>i.confirmPermanentDelete(e),children:`Delete permanently`}),(0,U.jsx)(j,{}),(0,U.jsx)(M,{onClick:()=>i.copyPath(e.map(e=>e.path)),children:`Copy Path`}),(0,U.jsx)(M,{onClick:()=>i.copyName(e.map(e=>e.name)),children:`Copy Name`}),e.some(e=>e.type===`file`)&&(0,U.jsx)(M,{onClick:()=>i.download(e),children:`Download`}),s&&o&&(0,U.jsx)(M,{onClick:()=>i.togglePin(o.path,o.name),children:r(o.path)?`Unpin from Sidebar`:`Pin to Sidebar`}),o&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(j,{}),(0,U.jsx)(M,{onClick:()=>i.showProperties(o),children:`Properties`})]})]})}function Zt(e){let{entry:t,dragPaths:n,run:r,springLoad:i,origin:a=`explorer`,projectName:o,extraData:s,onDragStarted:c,onFiles:l}=e,u=Ye({paths:n,origin:a,projectName:o,extraData:s,onDragStarted:c}),d=L({targetDir:t.type===`directory`?t.path:null,run:r,springLoad:t.type===`directory`?i:void 0,onFiles:l});return{props:(0,H.useMemo)(()=>({...u,...d.handlers}),[u,d.handlers]),isDropTarget:d.isOver}}function Qt(e){return e.type===`directory`||z(e.name)?`open`:`sheet`}function $t(e){return e.startsWith(`on`)&&e.length>2&&e[2]===e[2]?.toUpperCase()}function en(e,t){return n=>{e?.(n),t?.(n)}}function tn(e,t){if(!e)return t;let n={...e};for(let[e,r]of Object.entries(t)){let t=n[e];if($t(e)&&typeof t==`function`&&typeof r==`function`){n[e]=en(t,r);continue}if(e===`style`&&t&&r){n[e]={...t,...r};continue}if(e===`className`){n[e]=E(t,r);continue}r!==void 0&&(n[e]=r)}return n}function nn({entry:e,selected:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,rowHeight:o,onSelect:s,onOpen:c}){let l=Zt({entry:e,dragPaths:[e.path],run:a.transferInto,springLoad:s,onFiles:a.uploadInto});return(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsx)(rn,{entry:e,selected:t,rowHeight:o,onSelect:s,onOpen:c,dnd:l.props,dropActive:l.isDropTarget})}),(0,U.jsx)(X,{targets:[e],currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}var rn=(0,H.forwardRef)(function({entry:e,selected:t,rowHeight:n,onSelect:r,onOpen:i,dnd:a,dropActive:o,...s},c){let l=R(r),u=D(),{setOpen:d}=(0,H.useContext)(Oe),f=()=>{r(),!(!u||e.type===`directory`)&&(Qt(e)===`open`?i():d(!0))};return(0,U.jsxs)(`div`,{ref:c,...tn({...s,...l,...a},{role:`option`,"aria-selected":t,"data-testid":`explorer-column-row`,"data-path":e.path,title:e.name,style:{height:n},onContextMenu:e=>{r(),e.stopPropagation()},onClick:f,onDoubleClick:i,className:E(`flex w-full items-center gap-1.5 px-2 text-[13px] select-none`,`can-hover:hover:bg-surface-elevated`,t&&`bg-accent-wash text-text`,o&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[(0,U.jsx)(W,{name:e.name,kind:e.kind,className:`size-4 shrink-0`}),(0,U.jsx)(`span`,{className:E(`flex-1 truncate`,t?`text-text`:`text-text-2`),children:e.name}),e.type===`directory`&&(0,U.jsx)(`span`,{className:`text-text-subtle`,children:`›`})]})});function an({path:e,entries:t,loading:n,error:r,selectedPath:i,isFocused:a,currentDir:o,hasClipboard:s,isPinned:c,actions:l,rowHeight:u,onSelect:d,onOpen:f,onFocus:p,fullWidth:m}){let h=(0,H.useRef)(null);I(h);let g=m?48:u,_=Ke({count:t.length,getScrollElement:()=>h.current,estimateSize:()=>g,overscan:8}),v=L({targetDir:e,run:l.transferInto,onFiles:l.uploadInto,disabled:m});return(0,U.jsx)(`div`,{className:E(`flex h-full shrink-0 flex-col`,!m&&`border-r border-border`,a&&`bg-panel-2/40`),style:m?void 0:{width:220},children:(0,U.jsxs)(`div`,{ref:h,role:`listbox`,"aria-label":e,className:E(`flex-1 overflow-y-auto outline-none`,v.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...v.handlers,children:[n&&t.length===0&&(0,U.jsx)(`p`,{className:`p-2 text-xs text-text-subtle`,children:`Loading…`}),r&&(0,U.jsx)(`p`,{className:`p-2 text-xs text-error`,children:r}),!n&&!r&&t.length===0&&(0,U.jsx)(`p`,{className:`p-2 text-xs text-text-subtle`,children:`Empty`}),(0,U.jsx)(`div`,{className:`relative w-full`,style:{height:_.getTotalSize()},children:_.getVirtualItems().map(e=>{let n=t[e.index],r=n.path===i;return(0,U.jsx)(`div`,{className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:(0,U.jsx)(nn,{entry:n,selected:r,currentDir:o,hasClipboard:s,isPinned:c,actions:l,rowHeight:g,onSelect:()=>{p(),d(n)},onOpen:()=>f(n)})},n.path)})})]})})}function on({containerRef:e,onKeyDown:t,backgroundLongPress:n,columns:r,focusedIndex:i,setFocusedIndex:a,selectedPathFor:o,slice:s,hasClipboard:c,isPinned:l,actions:u,onSelect:d,onOpen:f}){let p=r[i];return(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:e,tabIndex:0,"data-testid":`explorer-columns`,"aria-label":`Column view`,onKeyDown:t,className:`flex h-full min-h-0 w-full flex-col outline-none`,...n,children:[i>0&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>e-1),"aria-label":`Back`,className:`flex h-11 shrink-0 items-center gap-1.5 border-b border-border px-3 text-sm text-text-2 active:bg-surface-elevated`,children:[(0,U.jsx)(x,{className:`size-4`}),` Back`]}),p&&(0,U.jsx)(`div`,{className:`min-h-0 flex-1 motion-safe:animate-in motion-safe:slide-in-from-right-4 motion-safe:duration-150`,children:(0,U.jsx)(an,{path:p.path,entries:p.entries,loading:p.loading,error:p.error,selectedPath:o(i),isFocused:!0,fullWidth:!0,rowHeight:48,currentDir:s.path,hasClipboard:c,isPinned:l,actions:u,onSelect:e=>d(i,e),onOpen:f,onFocus:()=>{}})},p.path)]})}),(0,U.jsx)(X,{targets:[],currentDir:s.path,hasClipboard:c,isPinned:l,actions:u})]})}var sn=0,cn=[];function ln(){return new Promise(e=>{let t=!1,n=()=>{sn++,e(()=>{if(t)return;t=!0,sn--;let e=cn.shift();e&&e()})};sn<24?n():cn.push(n)})}function un({entry:e,size:t,className:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null),c=(0,H.useRef)(null);return(0,H.useEffect)(()=>{i(null),o(!1)},[e.path]),(0,H.useEffect)(()=>{let t=s.current;if(!t||r||a)return;let n=new AbortController,l=null,u=new IntersectionObserver(t=>{t[0]?.isIntersecting&&(u.disconnect(),(async()=>{if(l=await ln(),n.signal.aborted){l();return}try{let t=me(),r=await fetch(`/api/fs/raw?path=${encodeURIComponent(e.path)}`,{headers:t?{Authorization:`Bearer ${t}`}:{},signal:n.signal});if(!r.ok)throw Error(String(r.status));let a=await r.blob();if(n.signal.aborted)return;let o=URL.createObjectURL(a);c.current=o,i(o)}catch{n.signal.aborted||o(!0)}finally{l?.()}})())},{rootMargin:`200px`});return u.observe(t),()=>{n.abort(),u.disconnect(),l?.()}},[e.path,r,a]),(0,H.useEffect)(()=>()=>{c.current&&URL.revokeObjectURL(c.current)},[]),a||!r?(0,U.jsx)(`div`,{ref:s,className:E(`flex items-center justify-center`,n),style:{width:t,height:t},children:(0,U.jsx)(W,{name:e.name,kind:e.kind,className:`size-1/2`})}):(0,U.jsx)(`div`,{ref:s,className:E(`flex items-center justify-center overflow-hidden`,n),style:{width:t,height:t},children:(0,U.jsx)(`img`,{src:r,alt:``,loading:`lazy`,className:`max-h-full max-w-full rounded object-contain`,onError:()=>o(!0)})})}function dn({entry:e,onOpen:t}){return e?(0,U.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col items-center gap-3 overflow-y-auto p-4 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 shrink-0 items-center justify-center`,children:e.type!==`directory`&&lt(e.name)===`image`?(0,U.jsx)(un,{entry:e,size:96}):(0,U.jsx)(W,{name:e.name,kind:e.kind,className:`size-16`})}),(0,U.jsx)(`p`,{className:`w-full truncate text-sm font-medium text-text`,title:e.name,children:e.name}),(0,U.jsxs)(`dl`,{className:`w-full space-y-1 text-left text-xs text-text-2`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,U.jsx)(`dt`,{className:`text-text-subtle`,children:`Kind`}),(0,U.jsx)(`dd`,{className:`truncate`,children:e.type===`directory`?`Folder`:B(e.name)||`File`})]}),e.type!==`directory`&&(0,U.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,U.jsx)(`dt`,{className:`text-text-subtle`,children:`Size`}),(0,U.jsx)(`dd`,{children:Se(e.size)})]}),(0,U.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,U.jsx)(`dt`,{className:`text-text-subtle`,children:`Modified`}),(0,U.jsx)(`dd`,{className:`truncate`,children:Ce(e.modified)})]})]}),z(e.name)&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(e),className:`mt-2 w-full rounded border border-border bg-panel-2 py-1.5 text-xs font-medium text-text can-hover:hover:bg-surface-elevated`,children:`Open`})]},e.path):(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-xs text-text-subtle`,children:`Select a file to preview`})}function fn(e,t){switch(t.type){case`sync`:{let{paths:n,lastEntries:r,lastLoading:i,makeAbort:a}=t,o=n.length-1,s=n.map((t,n)=>{let s=e.columns[n],c=n===o;return s&&s.path===t?c?{...s,entries:r,loading:i,error:null}:s:c?{path:t,entries:r,loading:i,error:null,abort:a()}:{path:t,entries:[],loading:!0,error:null,abort:a()}}),c=[];for(let t=0;t<e.columns.length;t++){let n=e.columns[t],r=s[t];(!r||r.path!==n.path)&&c.push(n.abort)}return{columns:s,staleControllers:c}}case`loaded`:return{columns:e.columns.map(e=>e.path===t.path?{...e,entries:t.entries,loading:!1,error:null}:e),staleControllers:[]};case`error`:return{columns:e.columns.map(e=>e.path===t.path?{...e,loading:!1,error:t.message}:e),staleControllers:[]}}}function pn(e,t,n){let[r,i]=(0,H.useReducer)(fn,{columns:[],staleControllers:[]}),a=(0,H.useRef)(new Set);(0,H.useEffect)(()=>{i({type:`sync`,paths:e,lastEntries:t,lastLoading:n,makeAbort:()=>new AbortController})},[e.join(`\0`),t,n]),(0,H.useEffect)(()=>{for(let e of r.staleControllers)e.abort()},[r.staleControllers]);let o=(0,H.useRef)(r.columns);return o.current=r.columns,(0,H.useEffect)(()=>()=>{for(let e of o.current)e.abort.abort()},[]),(0,H.useEffect)(()=>{let e=r.columns.length-1;r.columns.forEach((t,n)=>{n!==e&&(!t.loading||a.current.has(t.abort)||(a.current.add(t.abort),k.browse(t.path,{signal:t.abort.signal}).then(e=>{a.current.delete(t.abort),!t.abort.signal.aborted&&i({type:`loaded`,path:t.path,entries:e.entries})}).catch(e=>{a.current.delete(t.abort),!(t.abort.signal.aborted||e instanceof DOMException&&e.name===`AbortError`)&&i({type:`error`,path:t.path,message:e instanceof Error?e.message:`Failed to read directory`})})))})},[r.columns]),{columns:r.columns}}var mn=720;function hn({slice:e,entries:t,actions:n,selection:r,hasClipboard:i,isPinned:a,nav:o,backgroundLongPress:s,rowHeight:c}){let{columns:l}=pn((0,H.useMemo)(()=>e.breadcrumbs.length>0?e.breadcrumbs.map(e=>e.path):[e.path],[e.breadcrumbs,e.path]),t,e.loading),u=D(),d=(0,H.useRef)(null);I(d);let[f,p]=(0,H.useState)(l.length-1),[m,h]=(0,H.useState)(0),g=(0,H.useRef)(l.length);(0,H.useEffect)(()=>{let e=d.current;if(!e)return;let t=()=>h(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,H.useEffect)(()=>{if(l.length===g.current)return;g.current=l.length,p(l.length-1);let e=d.current;if(!e)return;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0;e.scrollTo({left:e.scrollWidth,behavior:t?`auto`:`smooth`})},[l.length]);let _=(0,H.useMemo)(()=>{if(!e.anchor)return null;for(let t of l){let n=t.entries.find(t=>t.path===e.anchor);if(n)return n}return null},[l,e.anchor]),v=t=>t===l.length-1?e.anchor:l[t+1]?.path??null,y=e=>{let t=l[e];if(!t)return null;let n=v(e);return t.entries.find(e=>e.path===n)??null},b=(e,t)=>{p(e),t.type===`directory`?o.go(t.path):r.selectOnly(t.path)},x=e=>n.openEntry(e),S=e=>{if(!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`ArrowRight`&&f<l.length-1){e.preventDefault(),e.stopPropagation(),p(f+1);return}if(e.key===`ArrowLeft`&&f>0){e.preventDefault(),e.stopPropagation(),p(f-1);return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){let t=l[f];if(!t)return;e.preventDefault(),e.stopPropagation();let n=y(f),r=n?t.entries.findIndex(e=>e.path===n.path):-1,i=e.key===`ArrowDown`?1:-1,a=Math.min(t.entries.length-1,Math.max(0,r<0?0:r+i)),o=t.entries[a];o&&b(f,o);return}if(e.key===`Enter`){let t=y(f);t&&(e.preventDefault(),e.stopPropagation(),x(t))}}},C=m>=mn;return u?(0,U.jsx)(on,{containerRef:d,onKeyDown:S,backgroundLongPress:s,columns:l,focusedIndex:f,setFocusedIndex:p,selectedPathFor:v,slice:e,hasClipboard:i,isPinned:a,actions:n,onSelect:b,onOpen:x}):(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:d,tabIndex:0,"data-testid":`explorer-columns`,"aria-label":`Column view`,onKeyDown:S,className:`flex h-full min-h-0 w-full overflow-x-auto outline-none`,...s,children:[l.map((t,r)=>(0,U.jsx)(an,{path:t.path,entries:t.entries,loading:t.loading,error:t.error,selectedPath:v(r),isFocused:r===f,currentDir:e.path,hasClipboard:i,isPinned:a,actions:n,rowHeight:c,onSelect:e=>b(r,e),onOpen:x,onFocus:()=>p(r)},t.path)),C&&(0,U.jsx)(`div`,{className:`min-w-[240px] flex-1 border-l border-border bg-panel-2/30`,children:(0,U.jsx)(dn,{entry:_,onOpen:x})})]})}),(0,U.jsx)(X,{targets:[],currentDir:e.path,hasClipboard:i,isPinned:a,actions:n})]})}function Z(e,t){if(e.selection.size>0)return t.filter(t=>e.selection.has(t.path));let n=t.find(t=>t.path===e.anchor);return n?[n]:[]}function gn({slice:e,entries:t,actions:n,selection:r,nav:i}){return(0,H.useCallback)(a=>{if(!e)return;let o=a.target;if(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.isContentEditable)return;let s=a.ctrlKey||a.metaKey,c=Z(e,t);if(s)switch(a.key.toLowerCase()){case`a`:a.preventDefault(),r.selectAll();return;case`c`:a.preventDefault(),n.copy(c);return;case`x`:a.preventDefault(),n.cut(c);return;case`v`:a.preventDefault(),n.paste();return;default:return}switch(a.key){case`ArrowDown`:a.preventDefault(),r.moveTo(1,a.shiftKey);return;case`ArrowUp`:a.preventDefault(),r.moveTo(-1,a.shiftKey);return;case`Home`:a.preventDefault(),t[0]&&r.selectOnly(t[0].path);return;case`End`:a.preventDefault(),t.length>0&&r.selectOnly(t[t.length-1].path);return;case`ArrowLeft`:a.altKey&&(a.preventDefault(),i.back());return;case`ArrowRight`:a.altKey&&(a.preventDefault(),i.forward());return;case`Backspace`:a.preventDefault(),i.back();return;case`Enter`:a.preventDefault(),c.length===1&&n.openEntry(c[0]);return;case`F2`:a.preventDefault(),c.length===1&&n.startRename(c[0]);return;case`Delete`:if(a.preventDefault(),c.length===0)return;a.shiftKey?n.confirmPermanentDelete(c):n.trash(c);return;case`Escape`:r.clear();return}a.key.length===1&&!a.altKey&&(a.preventDefault(),r.typeAhead(a.key))},[e,t,n,r,i])}function _n(e,t){let n=D(),r=P(e=>e.selectMode),{setOpen:i}=(0,H.useContext)(Oe);return{isMobile:n,selectMode:r,handleTap:(a,o)=>n?r?(t.onRowClick(a.path,{shiftKey:!1,ctrlKey:!0,metaKey:!1}),!0):(o||t.selectOnly(a.path),Qt(a)===`open`?e.openEntry(a):i(!0),!0):!1}}function vn({initial:e,error:t,onCommit:n,onCancel:r,className:i}){let[a,o]=(0,H.useState)(e),s=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let t=s.current;if(!t)return;t.focus();let n=e.lastIndexOf(`.`);n>0?t.setSelectionRange(0,n):t.select()},[e]),(0,U.jsxs)(`div`,{className:`relative flex-1 min-w-0`,children:[(0,U.jsx)(`input`,{ref:s,value:a,"aria-label":`Name`,"aria-invalid":!!t,onChange:e=>o(e.target.value),onBlur:()=>n(a),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?n(a):e.key===`Escape`&&r()},className:E(`w-full rounded-[var(--rad-sm)] border bg-panel px-1.5 py-0.5 text-[13px] text-text outline-none`,t?`border-error`:`border-primary`,i)}),t&&(0,U.jsx)(`span`,{className:`absolute left-0 top-full z-10 mt-0.5 rounded border border-border bg-panel-2 px-1.5 py-0.5 text-[11px] text-error shadow-sm`,children:t})]})}var yn=(0,H.memo)(function(e){let{entry:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,menuTargets:o}=e,s=Zt({entry:t,dragPaths:(0,H.useMemo)(()=>o.map(e=>e.path),[o]),run:a.transferInto,onFiles:a.uploadInto});return(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsx)(bn,{...e,dnd:s.props,dropActive:s.isDropTarget})}),(0,U.jsx)(X,{targets:o,currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}),bn=(0,H.forwardRef)(function({entry:e,selected:t,focused:n,cut:r,renaming:i,tileWidth:a,actions:o,selection:s,inlineError:c,currentDir:l,hasClipboard:u,isPinned:d,menuTargets:f,dnd:p,dropActive:m,...h},g){let _=R(()=>{t||s.selectOnly(e.path)}),{isMobile:v,selectMode:y,handleTap:b}=_n(o,s),x=e.type!==`directory`&&lt(e.name)===`image`;return(0,U.jsxs)(`div`,{ref:g,...tn({...h,..._,...p},{role:`gridcell`,"aria-selected":t,"data-testid":`explorer-tile`,"data-path":e.path,title:e.name,style:a?{width:a}:void 0,onContextMenu:n=>{t||s.selectOnly(e.path),n.stopPropagation()},onClick:n=>{b(e,t)||s.onRowClick(e.path,n)},onDoubleClick:()=>o.openEntry(e),className:E(`relative flex flex-col items-center gap-1 rounded p-2 text-center select-none`,!a&&`w-full`,`can-hover:hover:bg-surface-elevated`,n&&!t&&`bg-surface-elevated`,t&&`bg-accent-wash`,r&&`opacity-40`,m&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[v&&y&&(0,U.jsx)(`span`,{"aria-hidden":!0,className:E(`absolute left-1.5 top-1.5 flex size-5 items-center justify-center rounded border`,t?`border-primary bg-primary text-primary-foreground`:`border-border bg-panel`),children:t&&(0,U.jsx)(de,{className:`size-3.5`})}),(0,U.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center`,children:x?(0,U.jsx)(un,{entry:e,size:48}):(0,U.jsx)(W,{name:e.name,kind:e.kind,className:`size-12`})}),i?(0,U.jsx)(vn,{initial:e.name,error:c,onCommit:e=>void o.commitInline(e),onCancel:o.cancelInline}):(0,U.jsx)(`span`,{className:E(`line-clamp-2 w-full break-words text-[12px] leading-tight`,t?`text-text`:`text-text-2`),children:e.name})]})}),xn=96,Sn=88,Cn=4,wn=16,Tn=3;function En({slice:e,entries:t,actions:n,selection:r,inlineError:i,hasClipboard:a,isPinned:o,backgroundLongPress:s}){let c=ve(e=>e.clipboard?.operation===`cut`?e.clipboard.paths:null),l=(0,H.useRef)(null);I(l);let u=D(),[d,f]=(0,H.useState)(u?Tn:1);(0,H.useEffect)(()=>{if(u){f(Tn);return}let e=l.current;if(!e)return;let t=()=>{let t=e.clientWidth-wn+Cn;f(Math.max(1,Math.floor(t/(xn+Cn))))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[u]);let p=Ke({count:Math.ceil(t.length/d),getScrollElement:()=>l.current,estimateSize:()=>Sn,overscan:4}),m=e.anchor?t.findIndex(t=>t.path===e.anchor):-1,h=m>=0?Math.floor(m/d):-1;(0,H.useEffect)(()=>{h>=0&&p.scrollToIndex(h,{align:`auto`})},[h]);let g=(0,H.useMemo)(()=>Z(e,t),[e,t]),_=e.inlineEdit?.kind===`new-file`||e.inlineEdit?.kind===`new-folder`,v=L({targetDir:e.path,run:n.transferInto,onFiles:n.uploadInto}),y=e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case`ArrowDown`:e.preventDefault(),e.stopPropagation(),r.moveTo(d,e.shiftKey);return;case`ArrowUp`:e.preventDefault(),e.stopPropagation(),r.moveTo(-d,e.shiftKey);return;case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),r.moveTo(-1,e.shiftKey);return;case`ArrowRight`:e.preventDefault(),e.stopPropagation(),r.moveTo(1,e.shiftKey);return}};return(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:l,role:`grid`,tabIndex:0,"data-testid":`explorer-icons`,"aria-label":`File icons`,onKeyDown:y,onMouseDown:e=>{e.target===e.currentTarget&&r.clear()},className:E(`h-full flex-1 overflow-auto p-2 outline-none`,v.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...s,...v.handlers,children:[_&&(0,U.jsx)(`div`,{className:`mb-2 flex flex-col items-center gap-1 p-2`,style:u?void 0:{width:xn},children:(0,U.jsx)(vn,{initial:``,error:i,onCommit:e=>void n.commitInline(e),onCancel:n.cancelInline})}),(0,U.jsx)(`div`,{className:`relative w-full`,style:{height:p.getTotalSize()},children:p.getVirtualItems().map(s=>{let l=s.index*d,f=t.slice(l,l+d);return(0,U.jsx)(`div`,{role:`row`,className:E(`absolute left-0 top-0 w-full gap-1`,u?`grid grid-cols-3`:`flex`),style:{transform:`translateY(${s.start}px)`},children:f.map(t=>(0,U.jsx)(yn,{entry:t,currentDir:e.path,selected:e.selection.has(t.path),focused:e.anchor===t.path,cut:c?.includes(t.path)===!0,renaming:e.inlineEdit?.kind===`rename`&&e.inlineEdit.path===t.path,tileWidth:u?void 0:xn,menuTargets:e.selection.has(t.path)?g:[t],actions:n,selection:r,hasClipboard:a,isPinned:o,inlineError:i},t.path))},s.index)})}),t.length===0&&!e.loading&&!_&&(0,U.jsx)(`p`,{className:`p-3 text-xs text-text-subtle`,children:e.filter?`No entries match the filter.`:`This folder is empty.`})]})}),(0,U.jsx)(X,{targets:[],currentDir:e.path,hasClipboard:a,isPinned:o,actions:n})]})}var Dn=(0,H.memo)(function(e){let{entry:t,currentDir:n,hasClipboard:r,isPinned:i,actions:a,menuTargets:o}=e,s=Zt({entry:t,dragPaths:(0,H.useMemo)(()=>o.map(e=>e.path),[o]),run:a.transferInto,onFiles:a.uploadInto});return(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsx)(On,{...e,dnd:s.props,dropActive:s.isDropTarget})}),(0,U.jsx)(X,{targets:o,currentDir:n,hasClipboard:r,isPinned:i,actions:a})]})}),On=(0,H.forwardRef)(function({entry:e,selected:t,focused:n,cut:r,renaming:i,height:a,actions:o,selection:s,inlineError:c,currentDir:l,hasClipboard:u,isPinned:d,menuTargets:f,dnd:p,dropActive:m,...h},g){let _=R(()=>{t||s.selectOnly(e.path)}),{isMobile:v,selectMode:y,handleTap:b}=_n(o,s);return(0,U.jsxs)(`div`,{ref:g,...tn({...h,..._,...p},{role:`row`,"aria-selected":t,"data-testid":`explorer-row`,"data-path":e.path,title:e.name,style:{height:a},onContextMenu:n=>{t||s.selectOnly(e.path),n.stopPropagation()},onClick:n=>{b(e,t)||s.onRowClick(e.path,n)},onDoubleClick:()=>o.openEntry(e),className:E(`flex w-full items-center gap-2 px-2 text-[13px] select-none`,`can-hover:hover:bg-surface-elevated`,n&&!t&&`bg-surface-elevated`,t&&`bg-accent-wash`,r&&`opacity-40`,m&&`ring-1 ring-dashed ring-primary bg-primary/10`)}),children:[v&&y&&(0,U.jsx)(`span`,{"aria-hidden":!0,className:E(`flex size-5 shrink-0 items-center justify-center rounded border`,t?`border-primary bg-primary text-primary-foreground`:`border-border`),children:t&&(0,U.jsx)(de,{className:`size-3.5`})}),(0,U.jsx)(W,{name:e.name,kind:e.kind,className:`size-4`}),i?(0,U.jsx)(vn,{initial:e.name,error:c,onCommit:e=>void o.commitInline(e),onCancel:o.cancelInline}):(0,U.jsx)(`span`,{className:E(`flex-1 truncate`,t?`text-text`:`text-text-2`),children:e.name}),(0,U.jsx)(`span`,{className:`w-20 shrink-0 text-right tabular-nums text-text-subtle`,children:e.type===`directory`?``:Se(e.size)}),(0,U.jsx)(`span`,{className:`hidden w-24 shrink-0 text-right text-text-subtle sm:inline`,children:ye(e.modified)}),(0,U.jsx)(`span`,{className:`hidden w-16 shrink-0 truncate text-right text-text-subtle md:inline`,children:e.type===`directory`?`Folder`:B(e.name)||`File`})]})}),kn={name:`flex-1 text-left`,size:`w-20 text-right`,modified:`hidden w-24 text-right sm:block`,kind:`hidden w-16 text-right md:block`},An=J.map(e=>({...e,className:kn[e.key]}));function jn({slice:e,entries:t,actions:n,selection:r,inlineError:i,hasClipboard:a,isPinned:o,rowHeight:l,backgroundLongPress:u}){let d=N(e=>e.sort),f=N(e=>e.setPrefs),p=ve(e=>e.clipboard?.operation===`cut`?e.clipboard.paths:null),m=(0,H.useRef)(null);I(m);let h=at(),g=Ue(),_=Ke({count:t.length,getScrollElement:()=>m.current,estimateSize:()=>l,overscan:12}),v=e.anchor?t.findIndex(t=>t.path===e.anchor):-1;(0,H.useEffect)(()=>{v>=0&&_.scrollToIndex(v,{align:`auto`})},[v]);let y=(0,H.useMemo)(()=>Z(e,t),[e,t]),b=e.inlineEdit?.kind===`new-file`||e.inlineEdit?.kind===`new-folder`,x=L({targetDir:e.path,run:n.transferInto,onFiles:n.uploadInto}),S=e=>f({sort:{key:e,dir:d.key===e&&d.dir===`asc`?`desc`:`asc`}});return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,U.jsx)(`div`,{role:`row`,className:E(`flex shrink-0 items-center gap-2 border-b border-border bg-[var(--x-toolbar-bg,var(--panel-2))] px-2 py-1 text-[11px] font-medium text-text-subtle`,h.id===`windows`&&`divide-x divide-border`),children:An.map(e=>(0,U.jsxs)(`button`,{type:`button`,"aria-label":`Sort by ${e.label}`,onClick:()=>S(e.key),className:E(`relative flex items-center gap-0.5 can-hover:hover:text-text`,h.id===`windows`&&e.key!==`name`&&`pl-2`,e.className,e.key!==`name`&&`justify-end`,g&&`before:absolute before:-inset-x-2 before:-inset-y-3 before:content-['']`),children:[e.label,d.key===e.key&&(d.dir===`asc`?(0,U.jsx)(s,{className:`size-3`}):(0,U.jsx)(c,{className:`size-3`}))]},e.key))}),(0,U.jsxs)(F,{children:[(0,U.jsx)(A,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:m,role:`grid`,tabIndex:0,"data-testid":`explorer-list`,"aria-label":`File list`,onMouseDown:e=>{e.target===e.currentTarget&&r.clear()},className:E(`flex-1 overflow-auto outline-none`,x.isOver&&`ring-1 ring-dashed ring-primary bg-primary/10`),...u,...x.handlers,children:[b&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-2`,style:{height:l},children:[(0,U.jsx)(`span`,{className:`size-4 shrink-0`}),(0,U.jsx)(vn,{initial:``,error:i,onCommit:e=>void n.commitInline(e),onCancel:n.cancelInline})]}),(0,U.jsx)(`div`,{className:`relative w-full`,style:{height:_.getTotalSize()},children:_.getVirtualItems().map(s=>{let c=t[s.index];return(0,U.jsx)(`div`,{className:E(`absolute left-0 top-0 w-full`,h.id===`macos`&&s.index%2==1&&`bg-panel-2/40`),style:{transform:`translateY(${s.start}px)`},children:(0,U.jsx)(Dn,{entry:c,currentDir:e.path,selected:e.selection.has(c.path),focused:e.anchor===c.path,cut:p?.includes(c.path)===!0,renaming:e.inlineEdit?.kind===`rename`&&e.inlineEdit.path===c.path,height:l,menuTargets:e.selection.has(c.path)?y:[c],actions:n,selection:r,hasClipboard:a,isPinned:o,inlineError:i})},c.path)})}),t.length===0&&!e.loading&&!b&&(0,U.jsx)(`p`,{className:`p-3 text-xs text-text-subtle`,children:e.filter?`No entries match the filter.`:`This folder is empty.`})]})}),(0,U.jsx)(X,{targets:[],currentDir:e.path,hasClipboard:a,isPinned:o,actions:n})]})]})}var Mn={list:jn,icons:En,columns:hn},Nn=Object.keys(Mn);function Pn(e){return Mn[e]??jn}var Fn={list:_,icons:r,columns:ce},In={list:`List view`,icons:`Icons view`,columns:`Column view`};function Ln({windowId:e,slice:t,nav:n,actions:r}){let i=N(e=>e.patch),a=N(e=>e.showHidden),s=N(e=>e.viewMode),c=N(e=>e.setPrefs),[l,u]=(0,H.useState)(!1),[f,p]=(0,H.useState)(t.path);(0,H.useEffect)(()=>p(t.path),[t.path]);let h=Ue();return(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1 border-b border-border bg-[var(--x-toolbar-bg,var(--panel-2))] px-1.5 py-1`,children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":`Back`,title:`Back`,disabled:!n.canGoBack,onClick:n.back,className:Y(h),children:(0,U.jsx)(x,{className:`size-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Forward`,title:`Forward`,disabled:!n.canGoForward,onClick:n.forward,className:Y(h),children:(0,U.jsx)(le,{className:`size-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Up one level`,title:`Up`,disabled:!t.parent,onClick:n.up,className:Y(h),children:(0,U.jsx)(g,{className:`size-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Refresh`,title:`Refresh`,onClick:n.refresh,className:Y(h),children:(0,U.jsx)(d,{className:E(`size-4`,t.loading&&`animate-spin`)})}),(0,U.jsxs)(`div`,{className:`flex min-w-[8rem] flex-1 items-center gap-1 rounded border border-border bg-panel px-1`,children:[l?(0,U.jsx)(`input`,{autoFocus:!0,"aria-label":`Path`,value:f,onChange:e=>p(e.target.value),onBlur:()=>u(!1),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(n.go(f.trim()),u(!1)):e.key===`Escape`&&(p(t.path),u(!1))},className:`min-w-0 flex-1 bg-transparent py-1 font-mono text-xs text-text outline-none`}):(0,U.jsx)(Gt,{crumbs:t.breadcrumbs,onNavigate:n.go,sep:t.sep,className:`flex-1 overflow-hidden py-0.5`}),(0,U.jsx)(`button`,{type:`button`,"aria-label":l?`Show breadcrumb`:`Edit path`,title:l?`Show breadcrumb`:`Edit path`,onClick:()=>u(e=>!e),className:Y(h),children:(0,U.jsx)(m,{className:`size-3.5`})})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 rounded border border-border bg-panel px-1`,children:[(0,U.jsx)(v,{className:`size-3.5 shrink-0 text-text-subtle`}),(0,U.jsx)(`input`,{"aria-label":`Filter entries`,placeholder:`Filter`,value:t.filter,onChange:t=>i(e,{filter:t.target.value}),onKeyDown:t=>{t.stopPropagation(),t.key===`Escape`&&i(e,{filter:``})},className:`w-24 min-w-0 bg-transparent py-1 text-xs text-text outline-none placeholder:text-text-subtle`}),t.filter&&(0,U.jsx)(`button`,{type:`button`,"aria-label":`Clear filter`,onClick:()=>i(e,{filter:``}),className:Y(h),children:(0,U.jsx)(o,{className:`size-3.5`})})]}),Nn.length>1&&Nn.map(e=>{let t=Fn[e];return(0,U.jsx)(`button`,{type:`button`,"aria-label":In[e],title:In[e],"aria-pressed":s===e,onClick:()=>c({viewMode:e}),className:E(Y(h),s===e&&`bg-accent-wash text-primary`),children:(0,U.jsx)(t,{className:`size-4`})},e)}),(0,U.jsx)(Xt,{coarse:h}),r.supportsFolderUpload?(0,U.jsxs)(Ge,{children:[(0,U.jsx)(Qe,{asChild:!0,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":`Upload`,title:`Upload`,className:Y(h),children:(0,U.jsx)(b,{className:`size-4`})})}),(0,U.jsxs)(Ie,{align:`end`,children:[(0,U.jsx)(Re,{onClick:()=>r.openUploadPicker(),children:`Upload Files…`}),(0,U.jsx)(Re,{onClick:()=>r.openUploadFolderPicker(),children:`Upload Folder…`})]})]}):(0,U.jsx)(`button`,{type:`button`,"aria-label":`Upload`,title:`Upload`,onClick:()=>r.openUploadPicker(),className:Y(h),children:(0,U.jsx)(b,{className:`size-4`})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":a?`Hide hidden files`:`Show hidden files`,title:a?`Hide hidden files`:`Show hidden files`,"aria-pressed":a,onClick:()=>c({showHidden:!a}),className:E(Y(h),a&&`bg-accent-wash text-primary`),children:a?(0,U.jsx)(S,{className:`size-4`}):(0,U.jsx)(ue,{className:`size-4`})})]})}var Rn={list:_,icons:r,columns:ce},zn={list:`List`,icons:`Icons`,columns:`Columns`};function Bn(e){return{name:e.breadcrumbs[e.breadcrumbs.length-1]?.name??e.path,path:e.path,type:`directory`,kind:`directory`,modified:``}}function Vn({open:e,onClose:t,slice:n,actions:r,entries:i}){let a=N(e=>e.viewMode),o=N(e=>e.sort),s=N(e=>e.showHidden),c=N(e=>e.setPrefs),l=Z(n,i);return(0,U.jsxs)(Ae,{open:e,onClose:t,className:`p-2`,children:[(0,U.jsx)(ke,{children:`View`}),(0,U.jsx)(`div`,{className:`flex gap-1 px-2 pb-2`,children:Nn.map(e=>{let n=Rn[e];return(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":a===e,onClick:()=>{c({viewMode:e}),t()},className:E(`flex flex-1 flex-col items-center gap-1 rounded-lg py-2 text-xs active:bg-surface-elevated`,a===e?`bg-accent-wash text-primary`:`text-text-2`),children:[(0,U.jsx)(n,{className:`size-4`}),zn[e]]},e)})}),(0,U.jsx)(De,{}),(0,U.jsx)(ke,{children:`Sort by`}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1 px-2 pb-2`,children:J.map(({key:e,label:n})=>(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":o.key===e,onClick:()=>{c({sort:{key:e,dir:o.key===e&&o.dir===`asc`?`desc`:`asc`}}),t()},className:E(`inline-flex min-h-11 items-center justify-center rounded-full border px-3 py-1.5 text-xs active:bg-surface-elevated`,o.key===e?`border-primary bg-accent-wash text-text`:`border-border text-text-2`),children:[n,o.key===e?o.dir===`asc`?` ↑`:` ↓`:``]},e))}),(0,U.jsx)(De,{}),(0,U.jsxs)(O,{onClick:()=>c({showHidden:!s}),children:[s?(0,U.jsx)(S,{className:`size-4`}):(0,U.jsx)(ue,{className:`size-4`}),s?`Hide hidden files`:`Show hidden files`]}),(0,U.jsx)(De,{}),(0,U.jsxs)(O,{variant:`destructive`,disabled:l.length===0,onClick:()=>r.confirmPermanentDelete(l),children:[(0,U.jsx)(fe,{className:`size-4`}),`Delete permanently`,l.length>1?` (${l.length})`:``]}),(0,U.jsxs)(O,{onClick:()=>r.showProperties(Bn(n)),children:[(0,U.jsx)(ae,{className:`size-4`}),`Properties of this folder`]})]})}function Q({icon:e,label:t,onClick:n,disabled:r,destructive:i}){return(0,U.jsxs)(`button`,{type:`button`,"aria-label":t,title:t,disabled:r,onClick:n,className:`flex min-w-[44px] flex-1 flex-col items-center gap-0.5 rounded-lg py-1.5 text-[10px] active:bg-surface-elevated disabled:opacity-30 ${i?`text-error`:`text-text-2`}`,children:[(0,U.jsx)(e,{className:`size-5`}),(0,U.jsx)(`span`,{className:`truncate`,children:t})]})}function Hn({slice:e,nav:t,actions:n,entries:r,hasClipboard:i}){let a=P(e=>e.selectMode),s=P(e=>e.setSelectMode),[c,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),m=r.filter(t=>e.selection.has(t.path));return a?(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-t border-border px-1 py-1`,children:[(0,U.jsx)(Q,{icon:o,label:`Cancel`,onClick:()=>{s(!1)}}),(0,U.jsxs)(`span`,{className:`px-1 text-xs text-text-subtle`,children:[m.length,` selected`]}),(0,U.jsx)(`div`,{className:`flex-1`}),(0,U.jsx)(Q,{icon:ee,label:`Cut`,disabled:m.length===0,onClick:()=>n.cut(m)}),(0,U.jsx)(Q,{icon:te,label:`Copy`,disabled:m.length===0,onClick:()=>n.copy(m)}),(0,U.jsx)(Q,{icon:fe,label:`Trash`,disabled:m.length===0,destructive:!0,onClick:()=>n.trash(m)}),(0,U.jsx)(Q,{icon:se,label:`Download`,disabled:!m.some(e=>e.type===`file`),onClick:()=>n.download(m)}),m.length===1&&(0,U.jsx)(Q,{icon:ae,label:`Info`,onClick:()=>n.showProperties(m[0])})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-t border-border px-1 py-1`,children:[(0,U.jsx)(Q,{icon:x,label:`Back`,disabled:!t.canGoBack,onClick:t.back}),(0,U.jsx)(Q,{icon:ie,label:`New`,onClick:()=>d(!0)}),(0,U.jsx)(Q,{icon:re,label:`Paste`,disabled:!i,onClick:()=>n.paste()}),(0,U.jsx)(Q,{icon:de,label:`Select`,onClick:()=>s(!0)}),(0,U.jsx)(Q,{icon:l,label:`More`,onClick:()=>p(!0)})]}),(0,U.jsxs)(Ae,{open:c,onClose:()=>d(!1),className:`p-2`,children:[(0,U.jsxs)(O,{onClick:()=>n.startCreate(`new-file`),children:[(0,U.jsx)(C,{className:`size-4`}),` New File`]}),(0,U.jsxs)(O,{onClick:()=>n.startCreate(`new-folder`),children:[(0,U.jsx)(u,{className:`size-4`}),` New Folder`]}),(0,U.jsxs)(O,{onClick:()=>{d(!1),n.openUploadPicker()},children:[(0,U.jsx)(b,{className:`size-4`}),` Upload Files…`]})]}),(0,U.jsx)(Vn,{open:f,onClose:()=>p(!1),slice:e,actions:n,entries:r})]})}function Un(e){return e.breadcrumbs[e.breadcrumbs.length-1]?.name??e.path}function Wn({slice:e,onClose:t}){return(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[15px] font-semibold text-text`,children:Un(e)}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Close file explorer`,title:`Close`,onClick:t,className:`flex size-11 shrink-0 items-center justify-center rounded-full text-text-2 active:bg-surface-elevated`,children:(0,U.jsx)(o,{className:`size-5`})})]})}var Gn=`size-4 shrink-0 text-text-subtle`,Kn={fixed:w,removable:i,network:ut,unknown:w};function qn(){return(0,U.jsx)(W,{name:``,kind:`directory`,className:Gn})}function $({label:e,path:t,active:n,icon:r,onNavigate:i}){return(0,U.jsxs)(`button`,{type:`button`,title:t,onClick:()=>i(t),className:E(`flex min-h-[44px] w-full items-center gap-2.5 rounded-lg px-3 text-left text-sm active:bg-surface-elevated`,n?`bg-accent-wash text-text`:`text-text-2`),children:[r,(0,U.jsx)(`span`,{className:`truncate`,children:e})]})}function Jn({title:e,children:t}){return(0,U.jsxs)(`div`,{className:`pb-2`,children:[(0,U.jsx)(`p`,{className:`px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:e}),t]})}function Yn({open:e,onClose:t,host:n,currentPath:r,vocab:i,onNavigate:a}){let o=V(e=>e.pins),s=e=>e===r;return(0,U.jsx)(Ae,{open:e,onClose:t,zIndex:65,className:`p-1`,children:(0,U.jsxs)(`div`,{className:`max-h-[70vh] overflow-y-auto px-1 pb-2`,children:[o.length>0&&(0,U.jsx)(Jn,{title:`Pinned`,children:o.map(e=>(0,U.jsx)($,{label:e.name,path:e.path,icon:(0,U.jsx)(f,{className:Gn}),active:s(e.path),onNavigate:a},e.path))}),n&&n.pinned.length>0&&(0,U.jsx)(Jn,{title:i.pinned,children:n.pinned.map(e=>(0,U.jsx)($,{label:e.name,path:e.path,icon:qn(),active:s(e.path),onNavigate:a},e.path))}),n&&(0,U.jsxs)(Jn,{title:i.known,children:[(0,U.jsx)($,{label:i.home,path:n.homedir,icon:qn(),active:s(n.homedir),onNavigate:a}),n.knownFolders.map(e=>(0,U.jsx)($,{label:e.name,path:e.path,icon:qn(),active:s(e.path),onNavigate:a},e.path))]}),n&&n.drives.length>0&&(0,U.jsx)(Jn,{title:i.drives,children:n.drives.map(e=>{let t=Kn[e.kind];return(0,U.jsx)($,{label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:(0,U.jsx)(t,{className:Gn}),active:s(e.path),onNavigate:a},e.path)})})]})})}function Xn({className:e}){return(0,U.jsx)(W,{name:``,kind:`directory`,className:e})}var Zn={fixed:w,removable:i,network:ut,unknown:w};function Qn({chip:e,active:t,onNavigate:n}){let r=e.icon;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),title:e.path,className:E(`flex h-11 shrink-0 items-center gap-1.5 rounded-full border px-3 text-[13px] active:bg-surface-elevated`,t?`border-primary bg-accent-wash text-text`:`border-border text-text-2`),children:[(0,U.jsx)(r,{className:`size-4 shrink-0 text-text-subtle`}),(0,U.jsx)(`span`,{className:`max-w-[9rem] truncate`,children:e.label})]})}function $n({host:e,currentPath:t,onNavigate:n,vocab:r}){let i=V(e=>e.pins),[a,o]=(0,H.useState)(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 overflow-x-auto touch-pan-x border-b border-border px-2 py-1.5`,children:[[...i.map(e=>({key:`pin:${e.path}`,label:e.name,path:e.path,icon:f})),...e?[{key:`home`,label:r.home,path:e.homedir,icon:Xn}]:[],...e?.pinned.map(e=>({key:`os:${e.path}`,label:e.name,path:e.path,icon:Xn}))??[],...e?.drives.map(e=>({key:`drive:${e.path}`,label:e.label?`${e.label} (${e.name})`:e.name,path:e.path,icon:Zn[e.kind]}))??[]].map(e=>(0,U.jsx)(Qn,{chip:e,active:e.path===t,onNavigate:n},e.key)),(0,U.jsx)(`button`,{type:`button`,"aria-label":`All places`,title:`All places`,onClick:()=>o(!0),className:`flex h-11 shrink-0 items-center gap-1 rounded-full border border-border px-3 text-[13px] text-text-2 active:bg-surface-elevated`,children:(0,U.jsx)(l,{className:`size-4`})})]}),(0,U.jsx)(Yn,{open:a,onClose:()=>o(!1),host:e,currentPath:t,vocab:r,onNavigate:e=>{o(!1),n(e)}})]})}function er(e,t,n){let r=(0,H.useRef)(null),i=N(e=>e.patch),a=(0,H.useRef)(t?.path??``);a.current=t?.path??``;let o=(0,H.useRef)(n);o.current=n;let s=(0,H.useCallback)(async t=>{r.current?.abort();let n=new AbortController;r.current=n,i(e,{loading:!0,error:null});try{let r=await k.browse(t,{showHidden:o.current,signal:n.signal});if(n.signal.aborted)return;i(e,{entries:r.entries,breadcrumbs:r.breadcrumbs,parent:r.parent,sep:r.sep,truncated:r.truncated===!0,loading:!1,error:null})}catch(t){if(n.signal.aborted||t instanceof DOMException&&t.name===`AbortError`)return;i(e,{loading:!1,entries:[],error:t instanceof je?{message:t.message,code:t.code,hint:t.hint}:{message:t instanceof Error?t.message:`Failed to read directory`,code:`EUNKNOWN`}})}},[e,i]),c=t?.path;(0,H.useEffect)(()=>{if(c)return s(c),()=>r.current?.abort()},[c,n,s]),(0,H.useEffect)(()=>Ne(e=>{e===a.current&&s(e)}),[s]);let l=(0,H.useCallback)((t,n)=>{let r=N.getState().slices[e];if(!r||t===r.path)return;let a=n?.replace?[...r.history.slice(0,r.historyIndex),t]:[...r.history.slice(0,r.historyIndex+1),t];i(e,{path:t,history:a.slice(-100),historyIndex:Math.min(a.length,100)-1,selection:new Set,anchor:null,filter:``,inlineEdit:null}),ge.getState().setPayload(e,{path:t})},[e,i]),u=(0,H.useCallback)(t=>{let n=N.getState().slices[e];if(!n)return;let r=n.historyIndex+t,a=n.history[r];a!=null&&(i(e,{path:a,historyIndex:r,selection:new Set,anchor:null,filter:``,inlineEdit:null}),ge.getState().setPayload(e,{path:a}))},[e,i]),d=(0,H.useCallback)(()=>u(-1),[u]),f=(0,H.useCallback)(()=>u(1),[u]),p=(0,H.useCallback)(()=>{let t=N.getState().slices[e];t?.parent&&l(t.parent)},[e,l]),m=(0,H.useCallback)(()=>{a.current&&s(a.current)},[s]),h=(t?.historyIndex??0)>0,g=t?t.historyIndex<t.history.length-1:!1;return(0,H.useMemo)(()=>({go:l,back:d,forward:f,up:p,refresh:m,canGoBack:h,canGoForward:g}),[l,d,f,p,m,h,g])}function tr(e,t,n){let r=t==null?-1:e.indexOf(t),i=e.indexOf(n);if(i<0)return[];if(r<0)return[n];let[a,o]=r<=i?[r,i]:[i,r];return e.slice(a,o+1)}function nr(e,t,n){switch(n.type){case`clear`:return{selection:new Set,anchor:null};case`select-all`:return{selection:new Set(t),anchor:e.anchor??t[0]??null};case`set`:return{selection:new Set(n.paths),anchor:n.anchor===void 0?n.paths[n.paths.length-1]??null:n.anchor};case`click`:if(n.ctrl){let t=new Set(e.selection);return t.has(n.path)?t.delete(n.path):t.add(n.path),{selection:t,anchor:n.path}}if(n.shift){let r=tr(t,e.anchor,n.path);return{selection:new Set(r),anchor:e.anchor??n.path}}return{selection:new Set([n.path]),anchor:n.path}}}function rr(e,t,n){if(e.length===0)return null;let r=t==null?-1:e.indexOf(t);return r<0?n>0?e[0]:e[e.length-1]:e[Math.min(e.length-1,Math.max(0,r+n))]}function ir(e,t,n){if(!t)return-1;let r=t.toLowerCase(),i=n<0?0:n+1;for(let t=0;t<e.length;t++){let n=(i+t)%e.length;if(e[n].toLowerCase().startsWith(r))return n}return-1}function ar(e,t){let n=N(e=>e.patch),r=(0,H.useRef)(t);r.current=t;let i=(0,H.useRef)({text:``,at:0}),a=(0,H.useCallback)(t=>{let i=N.getState().slices[e];i&&n(e,nr(i,r.current,t))},[e,n]),o=(0,H.useCallback)((t,n)=>{let i=N.getState().slices[e];if(!i)return;let o=rr(r.current,i.anchor,t);o!=null&&a({type:`click`,path:o,shift:n})},[e,a]),s=(0,H.useCallback)(t=>{let n=N.getState().slices[e];if(!n)return null;let o=Date.now(),s=o-i.current.at>800?t:i.current.text+t;i.current={text:s,at:o};let c=r.current,l=ir(c.map(e=>e.split(/[/\\]/).pop()??e),s,s.length===1&&n.anchor?c.indexOf(n.anchor):-1);return l<0?null:(a({type:`click`,path:c[l]}),c[l])},[e,a]),c=(0,H.useCallback)((e,t)=>a({type:`click`,path:e,shift:t.shiftKey,ctrl:t.ctrlKey||t.metaKey}),[a]),l=(0,H.useCallback)(e=>a({type:`click`,path:e}),[a]),u=(0,H.useCallback)(()=>a({type:`select-all`}),[a]),d=(0,H.useCallback)(()=>a({type:`clear`}),[a]),f=(0,H.useCallback)((e,t)=>a({type:`set`,paths:e,anchor:t}),[a]);return(0,H.useMemo)(()=>({onRowClick:c,selectOnly:l,selectAll:u,clear:d,setSelection:f,moveTo:o,typeAhead:s}),[c,l,u,d,f,o,s])}var or=28,sr=36,cr=48;function lr({windowId:e,initialPath:t,variant:n=`window`}){let r=N(e=>e.ensure);(0,H.useEffect)(()=>r(e,t),[r,e,t]);let i=N(t=>t.slices[e]),a=N(e=>e.showHidden),o=N(e=>e.viewMode),s=N(e=>e.sort),{host:c}=st(),l=ve(e=>(e.clipboard?.paths.length??0)>0),u=V(e=>e.isPinned),d=Ue(),f=at(),m=er(e,i,a),{actions:h,dialogs:g}=kt(e,i,m,c?.platform),_=(0,H.useMemo)(()=>i?Vt(i.entries,i.filter,s):[],[i?.entries,i?.filter,s]),v=ar(e,(0,H.useMemo)(()=>_.map(e=>e.path),[_])),y=gn({slice:i,entries:_,actions:h,selection:v,nav:m}),b=R(),x=P(e=>e.close);if(!i)return null;let S=Pn(o),C=n===`sheet`,ee=C?cr:d?sr:or;return(0,U.jsxs)(`div`,{"data-skin":f.id,style:{fontFamily:`var(--x-font)`},className:`flex h-full min-h-0 w-full flex-col bg-panel text-text`,children:[C?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Wn,{slice:i,onClose:x}),(0,U.jsx)($n,{host:c,currentPath:i.path,onNavigate:m.go,vocab:f.vocab})]}):(0,U.jsx)(Ln,{windowId:e,slice:i,nav:m,actions:h}),i.error&&(0,U.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border bg-error/10 px-2 py-1.5 text-xs text-error`,children:[(0,U.jsx)(oe,{className:`mt-0.5 size-3.5 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`p`,{className:`break-words`,children:i.error.message}),i.error.hint&&(0,U.jsx)(`p`,{className:`mt-0.5 text-text-2`,children:i.error.hint})]}),c&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>m.go(c.homedir),className:`flex shrink-0 items-center gap-1 rounded border border-border px-1.5 py-0.5 text-text-2 can-hover:hover:bg-surface-elevated`,children:[(0,U.jsx)(p,{className:`size-3`}),` Go home`]})]}),(0,U.jsx)(Ft,{value:{closed:f.FolderIcon,open:f.FolderOpenIcon},children:(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[!C&&(0,U.jsx)(zt,{host:c,currentPath:i.path,onNavigate:m.go,vocab:f.vocab}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,onKeyDown:y,children:(0,U.jsx)(S,{windowId:e,slice:i,entries:_,actions:h,selection:v,inlineError:g.inlineError,hasClipboard:l,isPinned:u,rowHeight:ee,nav:m,backgroundLongPress:b})})]})}),C?(0,U.jsx)(Hn,{slice:i,nav:m,actions:h,entries:_,hasClipboard:l}):(0,U.jsx)(Ut,{entries:_,selection:i.selection,truncated:i.truncated}),(0,U.jsx)(et,{dialogs:g,platform:c?.platform,sep:i.sep})]})}export{lr as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import"./icons-DQjqk0lJ.js";import{t as r}from"./explorer-body-wFbIJgNp.js";import"./api-client-Jn3njtNw.js";import"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import"./portal-container-context-BarKmT4S.js";import"./panel-store-D20Zuf3i.js";import"./window-store-UC1jJeLM.js";import"./project-framework-store-ViZgce6y.js";import"./tab-store-krAuHQ6_.js";import"./context-menu-C6pIsf83.js";import"./file-store-Ds3qJ4hC.js";import"./use-is-mobile-TkcwP1Gx.js";import"./window-pip-registry-D1oXq-Dq.js";import"./format-file-meta-eKLstbCL.js";import"./button-B9CTrsEf.js";import"./dialog-B84_DJQ8.js";import"./file-icons-wS-OmEVu.js";import"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import"./fs-api-orca76dV.js";import{Ot as i,vt as a,yt as o}from"./index-CFa7UeZs.js";var s=e(t(),1),c=n();function l({id:e,payload:t}){let{host:n,error:l}=o(),u=i(e=>e.discard);(0,s.useEffect)(()=>()=>u(e),[e,u]);let d=(typeof t?.path==`string`?t.path:``)||a()||n?.homedir||``;return d?(0,c.jsx)(r,{windowId:e,initialPath:d}):(0,c.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-xs text-text-2`,children:l?`Could not reach the host: ${l}`:`Loading…`})}export{l as default};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import"./icons-DQjqk0lJ.js";import{t as r}from"./explorer-body-DRrd8uMc.js";import"./api-client-Jn3njtNw.js";import"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import"./portal-container-context-BarKmT4S.js";import"./panel-store-D20Zuf3i.js";import"./window-store-UC1jJeLM.js";import"./project-framework-store-ViZgce6y.js";import"./tab-store-krAuHQ6_.js";import"./context-menu-C6pIsf83.js";import"./file-store-Ds3qJ4hC.js";import"./use-is-mobile-TkcwP1Gx.js";import"./window-pip-registry-D1oXq-Dq.js";import"./format-file-meta-eKLstbCL.js";import"./button-B9CTrsEf.js";import"./dialog-B84_DJQ8.js";import"./file-icons-wS-OmEVu.js";import"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import"./fs-api-orca76dV.js";import{Ot as i,vt as a,yt as o}from"./index-C2luKRaD.js";var s=e(t(),1),c=n();function l({id:e,payload:t}){let{host:n,error:l}=o(),u=i(e=>e.discard);(0,s.useEffect)(()=>()=>u(e),[e,u]);let d=(typeof t?.path==`string`?t.path:``)||a()||n?.homedir||``;return d?(0,c.jsx)(r,{windowId:e,initialPath:d}):(0,c.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-xs text-text-2`,children:l?`Could not reach the host: ${l}`:`Loading…`})}export{l as default};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{At as r,Jn as i,Yn as a,ln as o,qn as s,wr as c}from"./icons-DQjqk0lJ.js";import{t as l}from"./createLucideIcon-DoiEKeJ_.js";import{n as u,s as d}from"./api-client-Jn3njtNw.js";import{t as f}from"./button-B9CTrsEf.js";import{t as p}from"./input-QNG_gTHh.js";import{nn as m}from"./index-CFa7UeZs.js";var h=l(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),g=e(t(),1),_=n();function v(){let[e,t]=(0,g.useState)([]),[n,l]=(0,g.useState)(!0),[v,y]=(0,g.useState)(``),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)(null),A=(0,g.useCallback)(async()=>{try{t(await u.get(`/api/extensions`))}catch(e){console.error(`Failed to load extensions:`,e)}finally{l(!1)}},[]);(0,g.useEffect)(()=>{A()},[A]);let j=async()=>{let e=v.trim();if(e){x(!0);try{await u.post(`/api/extensions/install`,{name:e}),d.success(`Installed ${e}`),y(``),A()}catch(e){d.error(e.message||`Install failed`)}finally{x(!1)}}},M=async e=>{D(e.id);try{await u.patch(`/api/extensions/${e.id}`,{enabled:!e.enabled}),A()}catch(e){d.error(e.message||`Toggle failed`)}finally{D(null)}},N=async e=>{k(e);try{await u.del(`/api/extensions/${e}`),d.success(`Removed ${e}`),A()}catch(e){d.error(e.message||`Remove failed`)}finally{k(null)}};return n?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,_.jsx)(o,{className:`size-4 animate-spin text-muted-foreground`})}):(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Install Extension`}),(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},placeholder:`npm package name (e.g. @ppm/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!v.trim()||b,onClick:j,children:[b?(0,_.jsx)(o,{className:`size-3 animate-spin`}):(0,_.jsx)(s,{className:`size-3`}),`Install`]})]}),(0,_.jsx)(`button`,{onClick:()=>T(!w),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,children:w?`Hide`:`Dev link local extension...`}),w&&(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:S,onChange:e=>C(e.target.value),placeholder:`Local path (e.g. ./packages/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!S.trim(),onClick:async()=>{try{await u.post(`/api/extensions/dev-link`,{path:S.trim()}),d.success(`Dev-linked successfully`),C(``),A()}catch(e){d.error(e.message||`Dev link failed`)}},children:[(0,_.jsx)(r,{className:`size-3`}),`Link`]})]})]}),(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Installed (`,e.length,`)`]}),e.length===0?(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-4 text-center`,children:`No extensions installed`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors`,children:[(0,_.jsx)(`div`,{className:`size-8 rounded-md bg-background flex items-center justify-center shrink-0`,children:(0,_.jsx)(m(e.icon)??a,{className:`size-4 text-muted-foreground`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs font-medium truncate`,children:e.displayName||e.id}),(0,_.jsxs)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:[e.id,` v`,e.version,e.activated&&(0,_.jsx)(`span`,{className:`ml-1 text-success`,children:`active`})]})]}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer`,title:e.enabled?`Disable`:`Enable`,disabled:E===e.id,onClick:()=>M(e),children:E===e.id?(0,_.jsx)(o,{className:`size-3.5 animate-spin`}):e.enabled?(0,_.jsx)(i,{className:`size-3.5 text-success`}):(0,_.jsx)(h,{className:`size-3.5 text-muted-foreground`})}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer text-destructive hover:text-destructive`,title:`Remove`,disabled:O===e.id,onClick:()=>N(e.id),children:O===e.id?(0,_.jsx)(o,{className:`size-3.5 animate-spin`}):(0,_.jsx)(c,{className:`size-3.5`})})]},e.id))})]})]})}export{v as ExtensionManagerSection};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{At as r,Jn as i,Yn as a,ln as o,qn as s,wr as c}from"./icons-DQjqk0lJ.js";import{t as l}from"./createLucideIcon-DoiEKeJ_.js";import{n as u,s as d}from"./api-client-Jn3njtNw.js";import{t as f}from"./button-B9CTrsEf.js";import{t as p}from"./input-QNG_gTHh.js";import{nn as m}from"./index-C2luKRaD.js";var h=l(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),g=e(t(),1),_=n();function v(){let[e,t]=(0,g.useState)([]),[n,l]=(0,g.useState)(!0),[v,y]=(0,g.useState)(``),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)(null),A=(0,g.useCallback)(async()=>{try{t(await u.get(`/api/extensions`))}catch(e){console.error(`Failed to load extensions:`,e)}finally{l(!1)}},[]);(0,g.useEffect)(()=>{A()},[A]);let j=async()=>{let e=v.trim();if(e){x(!0);try{await u.post(`/api/extensions/install`,{name:e}),d.success(`Installed ${e}`),y(``),A()}catch(e){d.error(e.message||`Install failed`)}finally{x(!1)}}},M=async e=>{D(e.id);try{await u.patch(`/api/extensions/${e.id}`,{enabled:!e.enabled}),A()}catch(e){d.error(e.message||`Toggle failed`)}finally{D(null)}},N=async e=>{k(e);try{await u.del(`/api/extensions/${e}`),d.success(`Removed ${e}`),A()}catch(e){d.error(e.message||`Remove failed`)}finally{k(null)}};return n?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,_.jsx)(o,{className:`size-4 animate-spin text-muted-foreground`})}):(0,_.jsxs)(`div`,{className:`space-y-4`,children:[(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Install Extension`}),(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},placeholder:`npm package name (e.g. @ppm/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!v.trim()||b,onClick:j,children:[b?(0,_.jsx)(o,{className:`size-3 animate-spin`}):(0,_.jsx)(s,{className:`size-3`}),`Install`]})]}),(0,_.jsx)(`button`,{onClick:()=>T(!w),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,children:w?`Hide`:`Dev link local extension...`}),w&&(0,_.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,_.jsx)(p,{value:S,onChange:e=>C(e.target.value),placeholder:`Local path (e.g. ./packages/ext-myext)`,className:`h-8 text-xs flex-1`}),(0,_.jsxs)(f,{variant:`outline`,size:`sm`,className:`h-8 text-xs px-3 gap-1 cursor-pointer`,disabled:!S.trim(),onClick:async()=>{try{await u.post(`/api/extensions/dev-link`,{path:S.trim()}),d.success(`Dev-linked successfully`),C(``),A()}catch(e){d.error(e.message||`Dev link failed`)}},children:[(0,_.jsx)(r,{className:`size-3`}),`Link`]})]})]}),(0,_.jsxs)(`section`,{className:`space-y-2`,children:[(0,_.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Installed (`,e.length,`)`]}),e.length===0?(0,_.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-4 text-center`,children:`No extensions installed`}):(0,_.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50 hover:bg-muted transition-colors`,children:[(0,_.jsx)(`div`,{className:`size-8 rounded-md bg-background flex items-center justify-center shrink-0`,children:(0,_.jsx)(m(e.icon)??a,{className:`size-4 text-muted-foreground`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs font-medium truncate`,children:e.displayName||e.id}),(0,_.jsxs)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:[e.id,` v`,e.version,e.activated&&(0,_.jsx)(`span`,{className:`ml-1 text-success`,children:`active`})]})]}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer`,title:e.enabled?`Disable`:`Enable`,disabled:E===e.id,onClick:()=>M(e),children:E===e.id?(0,_.jsx)(o,{className:`size-3.5 animate-spin`}):e.enabled?(0,_.jsx)(i,{className:`size-3.5 text-success`}):(0,_.jsx)(h,{className:`size-3.5 text-muted-foreground`})}),(0,_.jsx)(f,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 cursor-pointer text-destructive hover:text-destructive`,title:`Remove`,disabled:O===e.id,onClick:()=>N(e.id),children:O===e.id?(0,_.jsx)(o,{className:`size-3.5 animate-spin`}):(0,_.jsx)(c,{className:`size-3.5`})})]},e.id))})]})]})}export{v as ExtensionManagerSection};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{ln as r}from"./icons-DQjqk0lJ.js";import{r as i}from"./api-client-Jn3njtNw.js";import{r as a,t as o}from"./git-repo-store-BCEPfUGT.js";import{t as s}from"./apply-theme-CbR31K6I.js";import{cn as c}from"./index-CFa7UeZs.js";var l=e(t(),1),u=[[`--bg`,`--bg-solid`],[`--surface`,`--panel`],[`--selected`,`--accent-wash`],[`--text`,`--text`],[`--subtext`,`--text-2`],[`--subtle`,`--text-3`],[`--border`,`--border-soft`],[`--border2`,`--border`],[`--blue`,`--accent`],[`--green`,`--success`],[`--yellow`,`--warning`],[`--red`,`--error`]];function d(e){let t=[];for(let[n,r]of u){let i=e(r).replace(/[<>]/g,``).trim();i&&t.push(`${n}: ${i};`)}return t.length?`:root[data-ppm-theme] { ${t.join(` `)} }`:``}function f(e){let t=getComputedStyle(e);return{mode:e.classList.contains(`dark`)?`dark`:`light`,css:d(e=>t.getPropertyValue(e))}}var p=`ppm:theme`,m=`<script>
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{ln as r}from"./icons-DQjqk0lJ.js";import{r as i}from"./api-client-Jn3njtNw.js";import{r as a,t as o}from"./git-repo-store-BCEPfUGT.js";import{t as s}from"./apply-theme-CbR31K6I.js";import{cn as c}from"./index-C2luKRaD.js";var l=e(t(),1),u=[[`--bg`,`--bg-solid`],[`--surface`,`--panel`],[`--selected`,`--accent-wash`],[`--text`,`--text`],[`--subtext`,`--text-2`],[`--subtle`,`--text-3`],[`--border`,`--border-soft`],[`--border2`,`--border`],[`--blue`,`--accent`],[`--green`,`--success`],[`--yellow`,`--warning`],[`--red`,`--error`]];function d(e){let t=[];for(let[n,r]of u){let i=e(r).replace(/[<>]/g,``).trim();i&&t.push(`${n}: ${i};`)}return t.length?`:root[data-ppm-theme] { ${t.join(` `)} }`:``}function f(e){let t=getComputedStyle(e);return{mode:e.classList.contains(`dark`)?`dark`:`light`,css:d(e=>t.getPropertyValue(e))}}var p=`ppm:theme`,m=`<script>
2
2
  window.addEventListener("message",function(e){
3
3
  if(e.source!==window.parent)return;
4
4
  var m=e.data;
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Br as r,qn as i}from"./icons-DQjqk0lJ.js";import{n as a}from"./api-client-Jn3njtNw.js";import{i as o}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import{o as s}from"./file-store-Ds3qJ4hC.js";import{t as c}from"./button-B9CTrsEf.js";import{t as l}from"./input-QNG_gTHh.js";import{Z as u,at as d}from"./index-CFa7UeZs.js";import{t as f}from"./separator-DwDoQpxS.js";var p=e(t(),1);function m(){return a.get(`/api/settings/files`)}function h(e){return a.patch(`/api/settings/files`,e)}function g(e){return a.get(`/api/projects/${encodeURIComponent(e)}/settings`)}function _(e,t){return a.patch(`/api/projects/${encodeURIComponent(e)}/settings`,t)}var v=n();function y({value:e,onChange:t,placeholder:n=`e.g. **/*.log`,disabled:a=!1}){let o=(0,p.useRef)([]);function s(n,r){let i=[...e];i[n]=r,t(i)}function u(n){t(e.filter((e,t)=>t!==n)),setTimeout(()=>{let e=Math.max(n-1,0);o.current[e]?.focus()},0)}function d(){t([...e,``]),setTimeout(()=>{o.current[e.length]?.focus()},0)}function f(t,n){n.key===`Enter`?(n.preventDefault(),e[t]?.trim()&&d()):n.key===`Backspace`&&e[t]===``&&(n.preventDefault(),u(t))}return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[e.length===0&&(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-1`,children:`No patterns. Click "Add pattern" to start.`}),e.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,v.jsx)(l,{ref:e=>{o.current[t]=e},value:e,onChange:e=>s(t,e.target.value),onKeyDown:e=>f(t,e),placeholder:n,disabled:a,className:`h-8 text-xs flex-1 font-mono`,"aria-label":`Pattern ${t+1}`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>u(t),disabled:a,"aria-label":`Remove pattern ${t+1}`,className:`shrink-0 flex items-center justify-center p-2.5 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-40 disabled:pointer-events-none`,children:(0,v.jsx)(r,{className:`size-3.5`})})]},t)),(0,v.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:d,disabled:a,className:`h-8 text-xs gap-1.5 w-full cursor-pointer`,children:[(0,v.jsx)(i,{className:`size-3.5`}),`Add pattern`]})]})}var b={filesExclude:[],searchExclude:[],useIgnoreFiles:!0};function x(){let e=o(e=>e.activeProject),[t,n]=(0,p.useState)(`global`),[r,i]=(0,p.useState)([]),[a,l]=(0,p.useState)([]),[x,S]=(0,p.useState)(!0),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(null),[k,A]=(0,p.useState)(!1),j=(0,p.useRef)(null);(0,p.useEffect)(()=>{j.current?.abort();let n=new AbortController;return j.current=n,A(!0),O(null),(async()=>{try{if(t===`global`){let e=await m();if(n.signal.aborted)return;i(e.filesExclude),l(e.searchExclude),S(e.useIgnoreFiles)}else{if(!e)return;let t=await g(e.name);if(n.signal.aborted)return;let r=t.files??{};i(r.filesExclude??b.filesExclude),l(r.searchExclude??b.searchExclude),S(r.useIgnoreFiles??b.useIgnoreFiles)}}catch(e){if(n.signal.aborted)return;O(e.message)}finally{n.signal.aborted||A(!1)}})(),()=>n.abort()},[t,e?.name]);let M=async()=>{w(!0),E(!1),O(null);try{let n={filesExclude:r.filter(e=>e.trim()!==``),searchExclude:a.filter(e=>e.trim()!==``),useIgnoreFiles:x};if(t===`global`)await h(n);else{if(!e)throw Error(`No active project`);await _(e.name,{files:n})}let i=s.getState();i.invalidateIndex(),e&&i.loadIndex(e.name),E(!0),setTimeout(()=>E(!1),2e3)}catch(e){O(e.message)}finally{w(!1)}},N=!!e;return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`File Filters`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>n(`global`),className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer ${t===`global`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:`Global`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>N&&n(`project`),disabled:!N,title:N?void 0:`Open a project to edit per-project overrides`,className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${t===`project`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:e?e.name:`Per-project`})]}),t===`project`&&e&&(0,v.jsxs)(`p`,{className:`text-[11px] text-muted-foreground -mt-2`,children:[`Overrides for `,(0,v.jsx)(`span`,{className:`font-medium`,children:e.name}),`. Leave empty to use global settings.`]}),k?(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Files to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns hidden from the file tree and palette.`}),(0,v.jsx)(y,{value:r,onChange:i,placeholder:`e.g. **/*.log or node_modules/**`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Search to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns excluded from file index / palette search.`}),(0,v.jsx)(y,{value:a,onChange:l,placeholder:`e.g. dist/** or **/*.min.js`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(d,{className:`text-xs`,children:`Use .gitignore rules`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Respect .gitignore when filtering the file tree and index.`})]}),(0,v.jsx)(u,{checked:x,onCheckedChange:S,disabled:C})]}),D&&(0,v.jsx)(`p`,{className:`text-[11px] text-destructive`,children:D}),(0,v.jsx)(c,{onClick:M,disabled:C||k,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,children:C?`Saving...`:T?`Saved`:`Save`})]})]})}export{x as FilesSettingsSection};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Br as r,qn as i}from"./icons-DQjqk0lJ.js";import{n as a}from"./api-client-Jn3njtNw.js";import{i as o}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import{o as s}from"./file-store-Ds3qJ4hC.js";import{t as c}from"./button-B9CTrsEf.js";import{t as l}from"./input-QNG_gTHh.js";import{Z as u,at as d}from"./index-C2luKRaD.js";import{t as f}from"./separator-DwDoQpxS.js";var p=e(t(),1);function m(){return a.get(`/api/settings/files`)}function h(e){return a.patch(`/api/settings/files`,e)}function g(e){return a.get(`/api/projects/${encodeURIComponent(e)}/settings`)}function _(e,t){return a.patch(`/api/projects/${encodeURIComponent(e)}/settings`,t)}var v=n();function y({value:e,onChange:t,placeholder:n=`e.g. **/*.log`,disabled:a=!1}){let o=(0,p.useRef)([]);function s(n,r){let i=[...e];i[n]=r,t(i)}function u(n){t(e.filter((e,t)=>t!==n)),setTimeout(()=>{let e=Math.max(n-1,0);o.current[e]?.focus()},0)}function d(){t([...e,``]),setTimeout(()=>{o.current[e.length]?.focus()},0)}function f(t,n){n.key===`Enter`?(n.preventDefault(),e[t]?.trim()&&d()):n.key===`Backspace`&&e[t]===``&&(n.preventDefault(),u(t))}return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[e.length===0&&(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground py-1`,children:`No patterns. Click "Add pattern" to start.`}),e.map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,v.jsx)(l,{ref:e=>{o.current[t]=e},value:e,onChange:e=>s(t,e.target.value),onKeyDown:e=>f(t,e),placeholder:n,disabled:a,className:`h-8 text-xs flex-1 font-mono`,"aria-label":`Pattern ${t+1}`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>u(t),disabled:a,"aria-label":`Remove pattern ${t+1}`,className:`shrink-0 flex items-center justify-center p-2.5 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-40 disabled:pointer-events-none`,children:(0,v.jsx)(r,{className:`size-3.5`})})]},t)),(0,v.jsxs)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:d,disabled:a,className:`h-8 text-xs gap-1.5 w-full cursor-pointer`,children:[(0,v.jsx)(i,{className:`size-3.5`}),`Add pattern`]})]})}var b={filesExclude:[],searchExclude:[],useIgnoreFiles:!0};function x(){let e=o(e=>e.activeProject),[t,n]=(0,p.useState)(`global`),[r,i]=(0,p.useState)([]),[a,l]=(0,p.useState)([]),[x,S]=(0,p.useState)(!0),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(null),[k,A]=(0,p.useState)(!1),j=(0,p.useRef)(null);(0,p.useEffect)(()=>{j.current?.abort();let n=new AbortController;return j.current=n,A(!0),O(null),(async()=>{try{if(t===`global`){let e=await m();if(n.signal.aborted)return;i(e.filesExclude),l(e.searchExclude),S(e.useIgnoreFiles)}else{if(!e)return;let t=await g(e.name);if(n.signal.aborted)return;let r=t.files??{};i(r.filesExclude??b.filesExclude),l(r.searchExclude??b.searchExclude),S(r.useIgnoreFiles??b.useIgnoreFiles)}}catch(e){if(n.signal.aborted)return;O(e.message)}finally{n.signal.aborted||A(!1)}})(),()=>n.abort()},[t,e?.name]);let M=async()=>{w(!0),E(!1),O(null);try{let n={filesExclude:r.filter(e=>e.trim()!==``),searchExclude:a.filter(e=>e.trim()!==``),useIgnoreFiles:x};if(t===`global`)await h(n);else{if(!e)throw Error(`No active project`);await _(e.name,{files:n})}let i=s.getState();i.invalidateIndex(),e&&i.loadIndex(e.name),E(!0),setTimeout(()=>E(!1),2e3)}catch(e){O(e.message)}finally{w(!1)}},N=!!e;return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`File Filters`}),(0,v.jsxs)(`div`,{className:`flex gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,onClick:()=>n(`global`),className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer ${t===`global`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:`Global`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>N&&n(`project`),disabled:!N,title:N?void 0:`Open a project to edit per-project overrides`,className:`flex-1 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${t===`project`?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-accent`}`,children:e?e.name:`Per-project`})]}),t===`project`&&e&&(0,v.jsxs)(`p`,{className:`text-[11px] text-muted-foreground -mt-2`,children:[`Overrides for `,(0,v.jsx)(`span`,{className:`font-medium`,children:e.name}),`. Leave empty to use global settings.`]}),k?(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Files to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns hidden from the file tree and palette.`}),(0,v.jsx)(y,{value:r,onChange:i,placeholder:`e.g. **/*.log or node_modules/**`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(d,{className:`text-xs`,children:`Search to Exclude`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Glob patterns excluded from file index / palette search.`}),(0,v.jsx)(y,{value:a,onChange:l,placeholder:`e.g. dist/** or **/*.min.js`,disabled:C})]}),(0,v.jsx)(f,{}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(d,{className:`text-xs`,children:`Use .gitignore rules`}),(0,v.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Respect .gitignore when filtering the file tree and index.`})]}),(0,v.jsx)(u,{checked:x,onCheckedChange:S,disabled:C})]}),D&&(0,v.jsx)(`p`,{className:`text-[11px] text-destructive`,children:D}),(0,v.jsx)(c,{onClick:M,disabled:C||k,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,children:C?`Saving...`:T?`Saved`:`Save`})]})]})}export{x as FilesSettingsSection};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Xt as r,_r as i,lt as a,ut as o,w as s}from"./icons-DQjqk0lJ.js";import{a as c,n as l}from"./api-client-Jn3njtNw.js";import{t as u}from"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import"./portal-container-context-BarKmT4S.js";import"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./use-is-mobile-TkcwP1Gx.js";import"./onboarding-quick-orientation-Dqmis-E5.js";import{t as d}from"./button-B9CTrsEf.js";import"./dialog-B84_DJQ8.js";import{t as f}from"./input-QNG_gTHh.js";import{Ht as p,Z as m,at as h,c as g}from"./index-CFa7UeZs.js";import{t as _}from"./onboarding-entry-BpvMFO1h.js";import{t as v}from"./separator-DwDoQpxS.js";var y=e(t(),1),b=n();function x(){let[e,t]=(0,y.useState)(!1),[n,i]=(0,y.useState)(``),[u,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(!1),[v,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),w=u.length>0&&n!==u,T=n.trim().length>=4&&n===u&&!g,E=(0,y.useCallback)(async()=>{if(T){_(!0),C(null);try{let{token:e}=await l.put(`/api/settings/auth/password`,{password:n.trim(),confirm:u.trim()});c(e),x(!0),i(``),p(``),setTimeout(()=>{x(!1),t(!1)},1500)}catch(e){C(e instanceof Error?e.message:`Failed to change password`)}finally{_(!1)}}},[T,n,u]);return e?(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Change Password`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`New password`,value:n,onChange:e=>i(e.target.value),className:`h-8 text-xs pr-8`,autoFocus:!0}),(0,b.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground cursor-pointer`,onClick:()=>h(!m),tabIndex:-1,children:m?(0,b.jsx)(o,{className:`size-3.5`}):(0,b.jsx)(a,{className:`size-3.5`})})]}),(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`Confirm password`,value:u,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&E()},className:`h-8 text-xs`}),w&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Passwords do not match`}),S&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:S}),(0,b.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,b.jsx)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,onClick:()=>{t(!1),i(``),p(``),C(null)},children:`Cancel`}),(0,b.jsx)(d,{variant:v?`default`:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,disabled:!T,onClick:E,children:g?`...`:v?(0,b.jsx)(s,{className:`size-3.5`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Min 4 characters. You'll stay logged in on this device.`})]})]}):(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Security`}),(0,b.jsxs)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs gap-1.5 cursor-pointer`,onClick:()=>t(!0),children:[(0,b.jsx)(r,{className:`size-3.5`}),`Change Password`]})]})}function S(){let{deviceName:e,setDeviceName:t,version:n,keepScreenAwake:r,setKeepScreenAwake:a}=u(p(e=>({deviceName:e.deviceName,setDeviceName:e.setDeviceName,version:e.version,keepScreenAwake:e.keepScreenAwake,setKeepScreenAwake:e.setKeepScreenAwake}))),[o]=(0,y.useState)(g),[c,l]=(0,y.useState)(e??``),[S,C]=(0,y.useState)(!1),[w,T]=(0,y.useState)(!1),E=(0,y.useRef)(void 0),D=c.trim()!==(e??``),O=(0,y.useCallback)(async()=>{if(D){C(!0);try{await t(c),T(!0),clearTimeout(E.current),E.current=setTimeout(()=>T(!1),2e3)}finally{C(!1)}}},[c,D,t]);return(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`Learn PPM`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose your experience and a task. Guidance is saved in this browser.`}),(0,b.jsx)(_,{compact:!0})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(h,{htmlFor:`device-name`,children:`Device Name`}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(f,{id:`device-name`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&O()},placeholder:`My Device`,className:`flex-1`,maxLength:100}),(0,b.jsx)(d,{variant:w?`default`:`outline`,className:`cursor-pointer shrink-0`,disabled:!D||S,onClick:O,children:S?`...`:w?(0,b.jsx)(s,{className:`size-4`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shown in page title and synced to PPM Cloud.`})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(i,{className:`size-4 text-muted-foreground shrink-0`}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium`,children:`Keep Screen Awake`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o===`insecure`?`Unavailable over plain HTTP — reach PPM through its HTTPS tunnel address to use this.`:o===`unsupported`?`This browser does not support screen wake locks.`:`Stop this device dimming while a chat turn is running.`})]})]}),(0,b.jsx)(m,{checked:r&&o===`ok`,disabled:o!==`ok`,onCheckedChange:a})]}),(0,b.jsx)(v,{}),(0,b.jsx)(x,{}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-1`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`About`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`PPM — Personal Project Manager`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A mobile-first web IDE for managing your projects.`}),n&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Version `,n]})]})]})}export{S as GeneralSettingsSection};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Xt as r,_r as i,lt as a,ut as o,w as s}from"./icons-DQjqk0lJ.js";import{a as c,n as l}from"./api-client-Jn3njtNw.js";import{t as u}from"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import"./portal-container-context-BarKmT4S.js";import"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./use-is-mobile-TkcwP1Gx.js";import"./onboarding-quick-orientation-Dqmis-E5.js";import{t as d}from"./button-B9CTrsEf.js";import"./dialog-B84_DJQ8.js";import{t as f}from"./input-QNG_gTHh.js";import{Ht as p,Z as m,at as h,c as g}from"./index-C2luKRaD.js";import{t as _}from"./onboarding-entry-C81awoR5.js";import{t as v}from"./separator-DwDoQpxS.js";var y=e(t(),1),b=n();function x(){let[e,t]=(0,y.useState)(!1),[n,i]=(0,y.useState)(``),[u,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),[g,_]=(0,y.useState)(!1),[v,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),w=u.length>0&&n!==u,T=n.trim().length>=4&&n===u&&!g,E=(0,y.useCallback)(async()=>{if(T){_(!0),C(null);try{let{token:e}=await l.put(`/api/settings/auth/password`,{password:n.trim(),confirm:u.trim()});c(e),x(!0),i(``),p(``),setTimeout(()=>{x(!1),t(!1)},1500)}catch(e){C(e instanceof Error?e.message:`Failed to change password`)}finally{_(!1)}}},[T,n,u]);return e?(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Change Password`}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`New password`,value:n,onChange:e=>i(e.target.value),className:`h-8 text-xs pr-8`,autoFocus:!0}),(0,b.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground cursor-pointer`,onClick:()=>h(!m),tabIndex:-1,children:m?(0,b.jsx)(o,{className:`size-3.5`}):(0,b.jsx)(a,{className:`size-3.5`})})]}),(0,b.jsx)(f,{type:m?`text`:`password`,placeholder:`Confirm password`,value:u,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&E()},className:`h-8 text-xs`}),w&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Passwords do not match`}),S&&(0,b.jsx)(`p`,{className:`text-[11px] text-destructive`,children:S}),(0,b.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,b.jsx)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,onClick:()=>{t(!1),i(``),p(``),C(null)},children:`Cancel`}),(0,b.jsx)(d,{variant:v?`default`:`outline`,size:`sm`,className:`h-8 text-xs flex-1 cursor-pointer`,disabled:!T,onClick:E,children:g?`...`:v?(0,b.jsx)(s,{className:`size-3.5`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Min 4 characters. You'll stay logged in on this device.`})]})]}):(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Security`}),(0,b.jsxs)(d,{variant:`outline`,size:`sm`,className:`h-8 text-xs gap-1.5 cursor-pointer`,onClick:()=>t(!0),children:[(0,b.jsx)(r,{className:`size-3.5`}),`Change Password`]})]})}function S(){let{deviceName:e,setDeviceName:t,version:n,keepScreenAwake:r,setKeepScreenAwake:a}=u(p(e=>({deviceName:e.deviceName,setDeviceName:e.setDeviceName,version:e.version,keepScreenAwake:e.keepScreenAwake,setKeepScreenAwake:e.setKeepScreenAwake}))),[o]=(0,y.useState)(g),[c,l]=(0,y.useState)(e??``),[S,C]=(0,y.useState)(!1),[w,T]=(0,y.useState)(!1),E=(0,y.useRef)(void 0),D=c.trim()!==(e??``),O=(0,y.useCallback)(async()=>{if(D){C(!0);try{await t(c),T(!0),clearTimeout(E.current),E.current=setTimeout(()=>T(!1),2e3)}finally{C(!1)}}},[c,D,t]);return(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`Learn PPM`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose your experience and a task. Guidance is saved in this browser.`}),(0,b.jsx)(_,{compact:!0})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-2`,children:[(0,b.jsx)(h,{htmlFor:`device-name`,children:`Device Name`}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(f,{id:`device-name`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&O()},placeholder:`My Device`,className:`flex-1`,maxLength:100}),(0,b.jsx)(d,{variant:w?`default`:`outline`,className:`cursor-pointer shrink-0`,disabled:!D||S,onClick:O,children:S?`...`:w?(0,b.jsx)(s,{className:`size-4`}):`Save`})]}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Shown in page title and synced to PPM Cloud.`})]}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,b.jsx)(i,{className:`size-4 text-muted-foreground shrink-0`}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium`,children:`Keep Screen Awake`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o===`insecure`?`Unavailable over plain HTTP — reach PPM through its HTTPS tunnel address to use this.`:o===`unsupported`?`This browser does not support screen wake locks.`:`Stop this device dimming while a chat turn is running.`})]})]}),(0,b.jsx)(m,{checked:r&&o===`ok`,disabled:o!==`ok`,onCheckedChange:a})]}),(0,b.jsx)(v,{}),(0,b.jsx)(x,{}),(0,b.jsx)(v,{}),(0,b.jsxs)(`section`,{className:`space-y-1`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:`About`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`PPM — Personal Project Manager`}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A mobile-first web IDE for managing your projects.`}),n&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Version `,n]})]})]})}export{S as GeneralSettingsSection};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Qn as r,X as i,Y as a,a as o,d as s,ln as c,yr as l}from"./icons-DQjqk0lJ.js";import{n as u}from"./api-client-Jn3njtNw.js";import{n as d}from"./utils-Bmf_8h7Y.js";import{i as f}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./git-repo-store-BCEPfUGT.js";import"./scroll-area-C0fQWNnx.js";import{At as p,Ht as m,jn as h}from"./index-CFa7UeZs.js";var g=e(t(),1),_=n(),v=[`#2563eb`,`#16a34a`,`#d97706`,`#9333ea`,`#dc2626`,`#0891b2`,`#c026d3`,`#ea580c`];function y(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return v[Math.abs(t)%v.length]}function b({name:e,syncState:t,isHead:n,isTag:r,className:c}){let u=r?`#d97706`:y(e),f=r?l:t===`synced`?a:t===`ahead`?s:t===`behind`?o:t===`remote-only`?a:i,p=r?`Tag: ${e}`:t===`synced`?`${e} — synced with remote`:t===`ahead`?`${e} — ahead of remote`:t===`behind`?`${e} — behind remote`:t===`remote-only`?`${e} — remote only`:`${e} — local only`;return(0,_.jsxs)(`span`,{className:d(`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium leading-tight max-w-[220px]`,n&&`ring-1 ring-offset-1 ring-offset-background`,t===`remote-only`&&`opacity-70`,c),style:{borderColor:u,backgroundColor:u+`1A`,color:`var(--text)`,...n?{"--tw-ring-color":u}:{}},title:p,children:[(0,_.jsx)(f,{className:`size-3 shrink-0`,style:{color:u}}),(0,_.jsx)(`span`,{className:`truncate`,children:e})]})}function x(e,t,n,r){let i=[],a=e===r;for(let e of t)e.startsWith(`tag: `)&&i.push({name:e.slice(5),syncState:`synced`,isTag:!0});let o=n.filter(t=>t.commitHash===e),s=o.filter(e=>!e.remote),c=o.filter(e=>e.remote);new Set(s.map(e=>e.name));let l=new Set;for(let e of s){let t=`local-only`;e.remotes.length>0&&(t=e.ahead>0&&e.behind===0?`ahead`:e.behind>0&&e.ahead===0?`behind`:`synced`),i.push({name:e.name,syncState:t,isHead:a&&e.current});for(let t of c){let n=t.name.replace(/^remotes\//,``),r=n.indexOf(`/`);r<0||n.slice(r+1)===e.name&&l.add(t.name)}}for(let e of c){if(l.has(e.name))continue;let t=e.name.replace(/^remotes\//,``);i.push({name:t,syncState:`remote-only`})}return i}var S=100;function C({metadata:e}){let t=e?.projectName??f(m(e=>e.activeProject))?.name,{gitUrl:n}=p(t),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!1),[l,d]=(0,g.useState)(!0),v=(0,g.useRef)(null),y=(0,g.useCallback)(async(e=0,r=!1)=>{if(t){s(!0);try{let t=await u.get(n(`/graph?max=${S}&skip=${e}`));a(e=>r&&e?{...t,commits:[...e.commits,...t.commits]}:t),d(t.commits.length===S)}catch{}s(!1)}},[t]);(0,g.useEffect)(()=>{y()},[y]);let b=(0,g.useCallback)(()=>{o||!l||!i||y(i.commits.length,!0)},[o,l,i,y]),x=(0,g.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<200&&b()},[b]);return t?(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 border-b border-border shrink-0`,children:[(0,_.jsx)(h,{className:`size-4 text-text-secondary`}),(0,_.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:`Git Log`}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle`,children:i?`${i.commits.length} commits`:``}),(0,_.jsx)(`div`,{className:`flex-1`}),(0,_.jsx)(`button`,{onClick:()=>y(),disabled:o,className:`p-1 rounded text-text-subtle hover:text-text-secondary transition-colors`,title:`Refresh`,children:(0,_.jsx)(r,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),!i&&o?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(c,{className:`size-5 animate-spin text-primary`})}):i&&i.commits.length===0?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`No commits yet`}):i?(0,_.jsxs)(`div`,{ref:v,className:`flex-1 overflow-y-auto min-h-0`,onScroll:x,children:[i.commits.map(e=>(0,_.jsx)(w,{commit:e,branches:i.branches,head:i.head},e.hash)),o&&(0,_.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,_.jsx)(c,{className:`size-4 animate-spin text-text-subtle`})}),!l&&i.commits.length>0&&(0,_.jsx)(`div`,{className:`text-center text-[10px] text-text-subtle py-3`,children:`End of history`})]}):null]}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`Select a project to view git log`})}function w({commit:e,branches:t,head:n}){let r=e.hash===n,i=x(e.hash,e.refs,t,n);return(0,_.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-1.5 border-b border-border/50 hover:bg-surface-elevated transition-colors ${r?`bg-primary/5`:``}`,children:[(0,_.jsx)(`div`,{className:`flex items-center pt-1 shrink-0`,children:(0,_.jsx)(`span`,{className:`size-2.5 rounded-full border-2 ${r?`border-primary bg-primary`:`border-text-subtle bg-transparent`}`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[i.length>0&&(0,_.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mb-0.5`,children:i.map(e=>(0,_.jsx)(b,{...e},`${e.name}-${e.syncState}`))}),(0,_.jsx)(`p`,{className:`text-xs text-text-primary truncate leading-snug`,children:e.subject}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[10px] font-mono text-text-subtle`,children:e.abbreviatedHash}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate`,children:e.authorName}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:T(e.authorDate)})]})]})]})}function T(e){let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<30?`${a}d`:t.toLocaleDateString(`en`,{month:`short`,day:`numeric`})}export{C as GitLogPanel};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Qn as r,X as i,Y as a,a as o,d as s,ln as c,yr as l}from"./icons-DQjqk0lJ.js";import{n as u}from"./api-client-Jn3njtNw.js";import{n as d}from"./utils-Bmf_8h7Y.js";import{i as f}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./git-repo-store-BCEPfUGT.js";import"./scroll-area-C0fQWNnx.js";import{At as p,Ht as m,jn as h}from"./index-C2luKRaD.js";var g=e(t(),1),_=n(),v=[`#2563eb`,`#16a34a`,`#d97706`,`#9333ea`,`#dc2626`,`#0891b2`,`#c026d3`,`#ea580c`];function y(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return v[Math.abs(t)%v.length]}function b({name:e,syncState:t,isHead:n,isTag:r,className:c}){let u=r?`#d97706`:y(e),f=r?l:t===`synced`?a:t===`ahead`?s:t===`behind`?o:t===`remote-only`?a:i,p=r?`Tag: ${e}`:t===`synced`?`${e} — synced with remote`:t===`ahead`?`${e} — ahead of remote`:t===`behind`?`${e} — behind remote`:t===`remote-only`?`${e} — remote only`:`${e} — local only`;return(0,_.jsxs)(`span`,{className:d(`inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium leading-tight max-w-[220px]`,n&&`ring-1 ring-offset-1 ring-offset-background`,t===`remote-only`&&`opacity-70`,c),style:{borderColor:u,backgroundColor:u+`1A`,color:`var(--text)`,...n?{"--tw-ring-color":u}:{}},title:p,children:[(0,_.jsx)(f,{className:`size-3 shrink-0`,style:{color:u}}),(0,_.jsx)(`span`,{className:`truncate`,children:e})]})}function x(e,t,n,r){let i=[],a=e===r;for(let e of t)e.startsWith(`tag: `)&&i.push({name:e.slice(5),syncState:`synced`,isTag:!0});let o=n.filter(t=>t.commitHash===e),s=o.filter(e=>!e.remote),c=o.filter(e=>e.remote);new Set(s.map(e=>e.name));let l=new Set;for(let e of s){let t=`local-only`;e.remotes.length>0&&(t=e.ahead>0&&e.behind===0?`ahead`:e.behind>0&&e.ahead===0?`behind`:`synced`),i.push({name:e.name,syncState:t,isHead:a&&e.current});for(let t of c){let n=t.name.replace(/^remotes\//,``),r=n.indexOf(`/`);r<0||n.slice(r+1)===e.name&&l.add(t.name)}}for(let e of c){if(l.has(e.name))continue;let t=e.name.replace(/^remotes\//,``);i.push({name:t,syncState:`remote-only`})}return i}var S=100;function C({metadata:e}){let t=e?.projectName??f(m(e=>e.activeProject))?.name,{gitUrl:n}=p(t),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!1),[l,d]=(0,g.useState)(!0),v=(0,g.useRef)(null),y=(0,g.useCallback)(async(e=0,r=!1)=>{if(t){s(!0);try{let t=await u.get(n(`/graph?max=${S}&skip=${e}`));a(e=>r&&e?{...t,commits:[...e.commits,...t.commits]}:t),d(t.commits.length===S)}catch{}s(!1)}},[t]);(0,g.useEffect)(()=>{y()},[y]);let b=(0,g.useCallback)(()=>{o||!l||!i||y(i.commits.length,!0)},[o,l,i,y]),x=(0,g.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<200&&b()},[b]);return t?(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 border-b border-border shrink-0`,children:[(0,_.jsx)(h,{className:`size-4 text-text-secondary`}),(0,_.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:`Git Log`}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle`,children:i?`${i.commits.length} commits`:``}),(0,_.jsx)(`div`,{className:`flex-1`}),(0,_.jsx)(`button`,{onClick:()=>y(),disabled:o,className:`p-1 rounded text-text-subtle hover:text-text-secondary transition-colors`,title:`Refresh`,children:(0,_.jsx)(r,{className:`size-3.5 ${o?`animate-spin`:``}`})})]}),!i&&o?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(c,{className:`size-5 animate-spin text-primary`})}):i&&i.commits.length===0?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`No commits yet`}):i?(0,_.jsxs)(`div`,{ref:v,className:`flex-1 overflow-y-auto min-h-0`,onScroll:x,children:[i.commits.map(e=>(0,_.jsx)(w,{commit:e,branches:i.branches,head:i.head},e.hash)),o&&(0,_.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,_.jsx)(c,{className:`size-4 animate-spin text-text-subtle`})}),!l&&i.commits.length>0&&(0,_.jsx)(`div`,{className:`text-center text-[10px] text-text-subtle py-3`,children:`End of history`})]}):null]}):(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:`Select a project to view git log`})}function w({commit:e,branches:t,head:n}){let r=e.hash===n,i=x(e.hash,e.refs,t,n);return(0,_.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-1.5 border-b border-border/50 hover:bg-surface-elevated transition-colors ${r?`bg-primary/5`:``}`,children:[(0,_.jsx)(`div`,{className:`flex items-center pt-1 shrink-0`,children:(0,_.jsx)(`span`,{className:`size-2.5 rounded-full border-2 ${r?`border-primary bg-primary`:`border-text-subtle bg-transparent`}`})}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[i.length>0&&(0,_.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 mb-0.5`,children:i.map(e=>(0,_.jsx)(b,{...e},`${e.name}-${e.syncState}`))}),(0,_.jsx)(`p`,{className:`text-xs text-text-primary truncate leading-snug`,children:e.subject}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,_.jsx)(`span`,{className:`text-[10px] font-mono text-text-subtle`,children:e.abbreviatedHash}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate`,children:e.authorName}),(0,_.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:T(e.authorDate)})]})]})]})}function T(e){let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<30?`${a}d`:t.toLocaleDateString(`en`,{month:`short`,day:`numeric`})}export{C as GitLogPanel};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-BD9eJweQ.js","assets/rolldown-runtime-FhOqtrmT.js","assets/dist-BD2gbdy0.js","assets/vendor-markdown-CuWCHIVb.js","assets/vendor-ui-DmZ-Mb-H.js","assets/data-grid-types-C6UX8kgh.js","assets/number-overlay-editor-Bsr04yCI.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./rolldown-runtime-FhOqtrmT.js";import{C as n,S as r}from"./vendor-markdown-CuWCHIVb.js";import{pt as i}from"./vendor-ui-DmZ-Mb-H.js";import{$ as a,A as o,Br as s,Dr as c,It as l,Un as u,Wn as d,a as f,bt as p,ct as m,d as h,ir as g,j as _,ln as v,lt as y,pr as b,qn as x,st as S,tr as C,wr as w,zr as T}from"./icons-DQjqk0lJ.js";import{M as E,q as D}from"./vendor-mermaid-D6lgjvVE.js";import{t as O}from"./tab-store-krAuHQ6_.js";import{Ht as k,an as A,rn as ee,u as te}from"./index-CFa7UeZs.js";import{A as j,B as ne,C as M,D as re,E as N,F as ie,G as P,H as ae,I as F,L as oe,M as se,N as ce,O as I,P as L,R,S as le,T as ue,U as de,V as fe,W as pe,_ as me,a as he,b as ge,c as z,d as _e,f as ve,g as ye,h as B,i as be,j as V,k as H,l as U,m as xe,n as W,o as G,p as Se,r as Ce,s as we,t as K,u as Te,v as Ee,w as De,x as Oe,y as ke,z as Ae}from"./data-grid-types-C6UX8kgh.js";import{t as je}from"./dist-BD2gbdy0.js";import{t as Me}from"./use-monaco-theme-D69h-y-X.js";import{n as Ne}from"./csv-parser-DZ_75eCb.js";var Pe=/[A-Za-z0-9_]/,Fe=/^\$([A-Za-z_][A-Za-z0-9_]*)?\$/;function Ie(e){let t=[],n=1,r=-1,i=1,a=0,o=(n,a)=>{if(r===-1)return;let o=e.slice(r,n).trim();o&&t.push({sql:o,startLine:i,endLine:a}),r=-1};for(;a<e.length;){let t=e[a];if(t===`
2
+ import{o as e,t}from"./rolldown-runtime-FhOqtrmT.js";import{C as n,S as r}from"./vendor-markdown-CuWCHIVb.js";import{pt as i}from"./vendor-ui-DmZ-Mb-H.js";import{$ as a,A as o,Br as s,Dr as c,It as l,Un as u,Wn as d,a as f,bt as p,ct as m,d as h,ir as g,j as _,ln as v,lt as y,pr as b,qn as x,st as S,tr as C,wr as w,zr as T}from"./icons-DQjqk0lJ.js";import{M as E,q as D}from"./vendor-mermaid-D6lgjvVE.js";import{t as O}from"./tab-store-krAuHQ6_.js";import{Ht as k,an as A,rn as ee,u as te}from"./index-C2luKRaD.js";import{A as j,B as ne,C as M,D as re,E as N,F as ie,G as P,H as ae,I as F,L as oe,M as se,N as ce,O as I,P as L,R,S as le,T as ue,U as de,V as fe,W as pe,_ as me,a as he,b as ge,c as z,d as _e,f as ve,g as ye,h as B,i as be,j as V,k as H,l as U,m as xe,n as W,o as G,p as Se,r as Ce,s as we,t as K,u as Te,v as Ee,w as De,x as Oe,y as ke,z as Ae}from"./data-grid-types-C6UX8kgh.js";import{t as je}from"./dist-BD2gbdy0.js";import{t as Me}from"./use-monaco-theme-VsUPgzDf.js";import{n as Ne}from"./csv-parser-DZ_75eCb.js";var Pe=/[A-Za-z0-9_]/,Fe=/^\$([A-Za-z_][A-Za-z0-9_]*)?\$/;function Ie(e){let t=[],n=1,r=-1,i=1,a=0,o=(n,a)=>{if(r===-1)return;let o=e.slice(r,n).trim();o&&t.push({sql:o,startLine:i,endLine:a}),r=-1};for(;a<e.length;){let t=e[a];if(t===`
3
3
  `){n++,a++;continue}if(t===` `||t===` `||t===`\r`){a++;continue}if(t===`-`&&e[a+1]===`-`){for(;a<e.length&&e[a]!==`
4
4
  `;)a++;continue}if(t===`/`&&e[a+1]===`*`){let t=1;for(a+=2;a<e.length&&t>0;){if(e[a]===`/`&&e[a+1]===`*`){t++,a+=2;continue}if(e[a]===`*`&&e[a+1]===`/`){t--,a+=2;continue}e[a]===`
5
5
  `&&n++,a++}continue}if(r===-1&&(r=a,i=n),t===`;`){o(a+1,n),a++;continue}if(t===`'`||t===`"`){let r=e[a-1],i=e[a-2],o=t===`'`&&(r===`e`||r===`E`)&&!(i!==void 0&&Pe.test(i));for(a++;a<e.length;){let r=e[a];if(r===`
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Bn as r,Gn as i,Nr as a,ar as o,b as s,j as c,jr as l,ln as u,mr as d,rr as f,sr as p,wr as m}from"./icons-DQjqk0lJ.js";import"./api-client-Jn3njtNw.js";import"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import{n as h}from"./utils-Bmf_8h7Y.js";import"./portal-container-context-BarKmT4S.js";import"./panel-store-D20Zuf3i.js";import"./window-store-UC1jJeLM.js";import{i as g}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./tab-store-krAuHQ6_.js";import"./context-menu-C6pIsf83.js";import"./file-store-Ds3qJ4hC.js";import{n as _}from"./use-is-mobile-TkcwP1Gx.js";import"./git-repo-store-BCEPfUGT.js";import{t as v}from"./button-B9CTrsEf.js";import{a as y,n as b,o as x,t as S}from"./dialog-B84_DJQ8.js";import{t as C}from"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import"./fs-api-orca76dV.js";import"./ws-auth-CaxV807E.js";import{A as w,Bt as T,F as E,Ht as D,I as O,L as k,M as A,Mt as j,N as M,Nt as N,P as ee,R as te,j as P,jt as F,k as I,z as ne}from"./index-CFa7UeZs.js";import{t as L}from"./use-websocket-DMoom-pE.js";import{n as R}from"./tool-cards-CPf7WLQy.js";import"./use-blob-url-C0VR6Uhh.js";import{t as z}from"./markdown-renderer-Cqs7nUrs.js";import"./run-in-terminal-BFR70TLU.js";var B=e(t(),1),V=8e3;function re(e,t){let[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)([]),[o,s]=(0,B.useState)(`idle`),[c,l]=(0,B.useState)({}),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(null),v=(0,B.useRef)(new Map),y=(0,B.useCallback)(e=>{l(t=>{if(!t[e])return t;let n={...t};return delete n[e],n})},[]),b=(0,B.useCallback)(e=>{let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`ping`:return;case`group_state`:p(!0),s(t.status),a(t.members),h(t.status===`active`);return;case`group_message`:y(t.message.fromMember),r(e=>e.some(e=>e.id===t.message.id)?e:[...e,t.message]);return;case`member_status`:a(e=>e.map(e=>e.id===t.memberId?{...e,status:t.status}:e));return;case`typing`:{l(e=>({...e,[t.member]:!0}));let e=v.current,n=e.get(t.member);n&&clearTimeout(n),e.set(t.member,setTimeout(()=>y(t.member),V));return}case`turn_done`:return;case`group_done`:h(!1),s(`idle`),l({});return;case`error`:_(t.message),h(!1);return}},[y]),{send:x}=L({url:e&&t?`/ws/project/${encodeURIComponent(t)}/group/${encodeURIComponent(e)}`:``,onMessage:b,autoConnect:!!e&&!!t});return(0,B.useEffect)(()=>{let t=!1;r([]),a([]),l({}),s(`idle`),h(!1),_(null),p(!1);for(let e of v.current.values())clearTimeout(e);if(v.current.clear(),e)return d(!0),P(e,{limit:200}).then(e=>{t||r(t=>{let n=new Set(e.messages.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return[...e.messages,...r]})}).catch(e=>{t||_(e instanceof Error?e.message:`Failed to load feed`)}).finally(()=>{t||d(!1)}),()=>{t=!0}},[e]),{messages:n,members:i,status:o,typing:c,loading:u,isConnected:f,isRunning:m,error:g,sendMessage:(0,B.useCallback)(t=>{let n=t.trim();!n||!e||(_(null),h(!0),f?x(JSON.stringify({type:`message`,content:n})):O(e,n).catch(e=>{_(e instanceof Error?e.message:`Failed to send message`),h(!1)}))},[e,f,x]),stop:(0,B.useCallback)(()=>{e&&(f?x(JSON.stringify({type:`stop`})):k(e).catch(()=>{}),s(`paused`),h(!1))},[e,f,x]),resume:(0,B.useCallback)(()=>{e&&E(e).then(()=>{s(`active`),h(!0)}).catch(e=>_(e instanceof Error?e.message:`Failed to resume`))},[e])}}var H=n();function U(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function W(e){try{let t=e<0xe8d4a51000?e*1e3:e;return new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{return``}}function G(e,t){return e.split(/(@[\p{L}\p{N}_]+)/gu).map((e,n)=>{if(e.startsWith(`@`)&&e.length>1){let r=t(e.slice(1));return(0,H.jsx)(`span`,{className:h(`font-semibold`,!r&&`text-primary`),style:r?{color:r}:void 0,children:e},n)}return e})}var ie=(0,B.memo)(function({message:e,colorFor:t,isLeader:n,onViewFull:r}){let i=e.fromMember===`user`,a=i?`You`:e.fromMember,o=i?`var(--color-primary)`:t(e.fromMember)??`var(--accent)`,s=!i&&n(e.fromMember),c=e.summary??``,l=e.toMember&&e.toMember!==`all`?e.toMember:null,u=(0,H.jsxs)(`div`,{className:h(`group relative flex gap-2.5 px-3 py-2 transition-colors hover:bg-surface-elevated/50`,i&&`bg-primary/5`),style:{boxShadow:`inset 3px 0 0 0 ${o}`},children:[e.fullSessionRef&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(e),title:`View full transcript (AI's raw thinking / debug)`,"aria-label":`View full transcript`,className:`absolute right-1.5 top-1.5 hidden items-center rounded p-1 text-text-subtle/60 hover:bg-surface-elevated hover:text-text-secondary can-hover:group-hover:inline-flex`,children:(0,H.jsx)(f,{className:`size-3.5`})}),(0,H.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold text-white ring-2 ring-background`,style:{backgroundColor:o},"aria-hidden":!0,children:U(a)}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 can-hover:pr-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-sm font-semibold`,style:{color:i?`var(--color-foreground)`:o},children:a}),s&&(0,H.jsx)(`span`,{className:`rounded bg-surface-elevated px-1.5 py-px text-[10px] font-medium text-text-secondary`,children:`leader`}),l&&(0,H.jsxs)(`span`,{className:`text-[11px] text-text-subtle`,children:[`→ `,l]}),(0,H.jsx)(`span`,{className:`text-[11px] text-text-subtle`,children:W(e.createdAt)})]}),(0,H.jsx)(`div`,{className:`mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-text-secondary`,children:G(c,t)})]})]});return e.fullSessionRef?(0,H.jsxs)(F,{children:[(0,H.jsx)(T,{asChild:!0,children:u}),(0,H.jsx)(j,{children:(0,H.jsxs)(N,{onClick:()=>r(e),children:[(0,H.jsx)(f,{className:`size-4`}),` View full transcript`]})})]}):u}),K={idle:`bg-text-subtle`,working:`bg-primary animate-pulse`,done:`bg-emerald-500`,error:`bg-destructive`},q={idle:`Idle`,working:`Working`,done:`Done`,error:`Error`},J=(0,B.memo)(function({members:e,liveStatus:t,typing:n,busy:i,onAdd:a,onEdit:o,onRemove:s}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5 p-2`,children:[e.map(e=>{let a=n[e.name],c=t.get(e.id)??e.status;return(0,H.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,H.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white ring-2 ring-background`,style:{backgroundColor:e.color??`var(--accent)`},"aria-hidden":!0,children:e.name.slice(0,1).toUpperCase()}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs font-medium`,style:{color:e.color??`var(--color-foreground)`},children:e.name}),e.role===`leader`&&(0,H.jsx)(`span`,{className:`rounded-sm bg-accent-wash px-1 text-[9px] font-semibold uppercase text-primary`,children:`lead`})]}),(0,H.jsx)(`span`,{className:`block truncate text-[10px] text-text-subtle`,children:a?`typing…`:e.persona||q[c]})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 can-hover:opacity-0 can-hover:group-hover:opacity-100`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>o(e),disabled:i,"aria-label":`Edit ${e.name}`,className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground active:bg-surface-elevated disabled:opacity-40`,children:(0,H.jsx)(r,{className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>s(e),disabled:i,"aria-label":`Remove ${e.name}`,className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-destructive active:bg-surface-elevated disabled:opacity-40`,children:(0,H.jsx)(m,{className:`size-3.5`})})]}),(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-full`,K[c]),title:q[c],"aria-hidden":!0})]},e.id)}),(0,H.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,className:`mt-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-primary hover:bg-surface-elevated active:bg-surface-elevated disabled:opacity-40`,children:[(0,H.jsx)(l,{className:`size-4`}),` Add member`]})]})}),Y=`w-full min-h-[40px] rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary`;function ae({open:e,member:t,projectName:n,providerId:r=`claude`,onSubmit:i,onClose:a}){let o=_(),[s,c]=(0,B.useState)(t?.name??``),[l,d]=(0,B.useState)(t?.persona??``),[f,p]=(0,B.useState)(t?.model??null),[m,h]=(0,B.useState)(t?.role===`leader`),[g,w]=(0,B.useState)(!1),[T,E]=(0,B.useState)(null),D=(0,B.useCallback)(async()=>{let e=s.trim();if(!e){E(`Name is required`);return}w(!0),E(null);try{await i({name:e,persona:l.trim()||null,model:f,role:m?`leader`:`member`}),a()}catch(e){E(e instanceof Error?e.message:`Failed to save member`),w(!1)}},[s,l,f,m,i,a]),O=t?.role===`leader`,k=(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 px-1 py-1`,children:[(0,H.jsx)(`input`,{className:Y,value:s,onChange:e=>c(e.target.value),placeholder:`Member name`,autoFocus:!0}),(0,H.jsx)(`input`,{className:Y,value:l,onChange:e=>d(e.target.value),placeholder:`Persona (optional)`}),(0,H.jsx)(I,{value:f,onChange:p,projectName:n,providerId:r}),(0,H.jsxs)(`label`,{className:X(O),children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-[var(--color-primary)]`,checked:m,disabled:O,onChange:e=>h(e.target.checked)}),(0,H.jsx)(`span`,{children:O?`Leader (reassign from another member)`:`Set as leader`})]}),T&&(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:T}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,H.jsx)(v,{variant:`outline`,onClick:a,disabled:g,children:`Cancel`}),(0,H.jsxs)(v,{onClick:D,disabled:g,children:[g&&(0,H.jsx)(u,{className:`mr-1.5 size-4 animate-spin`}),t?`Save`:`Add member`]})]})]});if(!e)return null;let A=t?`Edit member`:`Add member`;return o?(0,H.jsx)(C,{open:!0,onClose:a,className:`flex max-h-[90vh] flex-col`,children:(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col px-4 pb-2`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-base font-semibold text-foreground`,children:A}),k]})}):(0,H.jsx)(S,{open:!0,onOpenChange:e=>{e||a()},children:(0,H.jsxs)(b,{className:`flex flex-col sm:max-w-md`,children:[(0,H.jsx)(y,{children:(0,H.jsx)(x,{children:A})}),k]})})}function X(e){return`flex items-center gap-2 text-sm text-text-secondary ${e?`opacity-60`:``}`}function Z({messages:e,config:t,projectName:n}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t&&(0,H.jsx)(ce,{config:t}),e.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-text-subtle`,children:e.role===`user`?`User`:e.role===`assistant`?`Assistant`:e.role}),(0,H.jsx)(oe,{message:e,projectName:n})]},e.id)),e.length===0&&(0,H.jsx)(`p`,{className:`py-6 text-center text-sm text-text-subtle`,children:`Transcript is empty.`})]})}function oe({message:e,projectName:t}){let n=e.events??[];if(n.length===0)return e.content.trim()?(0,H.jsx)(z,{content:e.content}):null;let r=new Map;for(let e of n)e.type===`tool_result`&&e.toolUseId&&r.set(e.toolUseId,e);return(0,H.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map((e,n)=>{if(e.type===`text`)return e.content.trim()?(0,H.jsx)(z,{content:e.content},n):null;if(e.type===`thinking`)return(0,H.jsx)(se,{content:e.content},n);if(e.type===`tool_use`){let i=e.toolUseId?r.get(e.toolUseId):void 0;return(0,H.jsx)(R,{tool:e,result:i,completed:!!i,projectName:t},n)}return null})})}function se({content:e}){let[t,n]=(0,B.useState)(!1);return(0,H.jsxs)(`div`,{className:`rounded-md border border-border bg-surface-elevated/40`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-xs text-text-subtle hover:text-text-secondary`,children:[(0,H.jsx)(c,{className:h(`size-3.5 transition-transform`,t&&`rotate-90`)}),(0,H.jsx)(s,{className:`size-3.5`}),(0,H.jsx)(`span`,{children:`Thinking`})]}),t&&(0,H.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-xs leading-relaxed text-text-secondary`,children:(0,H.jsx)(z,{content:e})})]})}function ce({config:e}){let[t,n]=(0,B.useState)(!1),r=[[`Model`,e.model],[`Permission`,e.permissionMode],[`CWD`,e.cwd],[`Git branch`,e.gitBranch],[`CLI version`,e.version]].filter(([,e])=>e);return r.length===0?null:(0,H.jsxs)(`div`,{className:`rounded-md border border-border bg-surface-elevated/40`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-text-secondary hover:text-foreground`,children:[(0,H.jsx)(c,{className:h(`size-3.5 transition-transform`,t&&`rotate-90`)}),(0,H.jsx)(p,{className:`size-3.5`}),(0,H.jsx)(`span`,{children:`Input config`})]}),t&&(0,H.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 border-t border-border px-3 py-2 text-xs`,children:r.map(([e,t])=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsx)(`dt`,{className:`text-text-subtle`,children:e}),(0,H.jsx)(`dd`,{className:`break-all font-mono text-text-secondary`,children:t})]},e))})]})}function le({groupId:e,message:t,onClose:n}){let r=_(),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(null),d=t?.fullSessionRef??null;if((0,B.useEffect)(()=>{if(!t||!d)return;let n=!1;return a(null),l(null),s(!0),M(e,d).then(e=>{n||a(e)}).catch(e=>{n||l(e instanceof Error?e.message:`Failed to load transcript`)}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,d,t]),!t)return null;let f=(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[o&&(0,H.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,H.jsx)(u,{className:`size-5 animate-spin text-primary`})}),c&&(0,H.jsxs)(`div`,{className:`px-1 py-4 text-sm text-text-secondary`,children:[(0,H.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Full transcript unavailable`}),(0,H.jsx)(`p`,{className:`text-xs text-text-subtle`,children:c}),t.summary&&(0,H.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-md bg-surface-elevated p-3 text-xs leading-relaxed text-text-secondary`,children:t.summary})]}),!o&&!c&&i!=null&&(0,H.jsx)(`div`,{className:`px-1 py-1`,children:(0,H.jsx)(Z,{messages:i.messages,config:i.config})})]}),p=`${t.fromMember} — full transcript`;return r?(0,H.jsx)(C,{open:!0,onClose:n,className:`max-h-[85vh] flex flex-col`,children:(0,H.jsxs)(`div`,{className:`flex flex-col min-h-0 px-4 pb-2`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-sm font-semibold text-foreground`,children:p}),f]})}):(0,H.jsx)(S,{open:!0,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(b,{className:`flex max-h-[80vh] flex-col sm:max-w-2xl`,children:[(0,H.jsx)(y,{children:(0,H.jsx)(x,{className:`text-sm`,children:p})}),f]})})}function Q({metadata:e}){let t=e?.groupId??null,{activeProject:n}=g(D(e=>({activeProject:e.activeProject}))),r=e?.projectName??n?.name??``,s=_(),{messages:c,members:l,status:f,typing:p,loading:m,isRunning:y,error:b,sendMessage:x,stop:S,resume:T}=re(t,r),[E,O]=(0,B.useState)(``),[k,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(!1),P=(0,B.useRef)(null),[F,I]=(0,B.useState)([]),[L,R]=(0,B.useState)(null),[z,V]=(0,B.useState)(!1),[U,W]=(0,B.useState)(null),[G,K]=(0,B.useState)(null),q=(0,B.useCallback)(async()=>{if(t)try{let e=await A(t);I(e.members),R(e.maxTurns)}catch{}},[t]),Y=(0,B.useCallback)(async e=>{if(!t)return;let n=Math.max(1,Math.min(50,Math.floor(e)||1));R(n);try{await ne(t,{maxTurns:n})}catch{q()}},[t,q]);(0,B.useEffect)(()=>{I([]),q()},[t,q]),(0,B.useEffect)(()=>{P.current?.scrollIntoView({block:`end`})},[c.length,p]);let X=(0,B.useMemo)(()=>new Map(l.map(e=>[e.id,e.status])),[l]),Z=F.length?F:l,oe=(0,B.useMemo)(()=>{let e=new Map(Z.map(e=>[e.name,e.color]));return t=>e.get(t)??null},[Z]),se=(0,B.useMemo)(()=>{let e=new Set(Z.filter(e=>e.role===`leader`).map(e=>e.name));return t=>e.has(t)},[Z]),ce=(0,B.useCallback)(async e=>{t&&(G?.member?await te(t,G.member.id,e):await w(t,e),await q())},[t,G,q]),Q=(0,B.useCallback)(async e=>{if(t){V(!0),W(null);try{await ee(t,e.id),await q()}catch(e){W(e instanceof Error?e.message:`Failed to remove member`)}finally{V(!1)}}},[t,q]),ue=(0,B.useCallback)(()=>{let e=E.trim();e&&(x(e),O(``))},[E,x]),$=Object.keys(p).filter(e=>p[e]);return t?(0,H.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-border px-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,H.jsx)(`span`,{className:h(`size-2 rounded-full`,f===`active`?`bg-primary animate-pulse`:f===`paused`?`bg-amber-500`:`bg-text-subtle`)}),(0,H.jsx)(`span`,{className:`capitalize`,children:f})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[y?(0,H.jsxs)(v,{size:`sm`,variant:`outline`,onClick:S,className:`h-8`,children:[(0,H.jsx)(d,{className:`mr-1 size-3.5`}),` Stop`]}):f===`paused`?(0,H.jsxs)(v,{size:`sm`,variant:`outline`,onClick:T,className:`h-8`,children:[(0,H.jsx)(i,{className:`mr-1 size-3.5`}),` Resume`]}):null,(0,H.jsx)(`button`,{type:`button`,onClick:()=>N(e=>!e),className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground`,"aria-label":`Toggle roster`,children:(0,H.jsx)(a,{className:`size-4`})})]})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:m?(0,H.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,H.jsx)(u,{className:`size-5 animate-spin text-primary`})}):c.length===0?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-sm text-text-subtle`,children:`Send a message to start the group.`}):(0,H.jsxs)(`div`,{className:`flex flex-col py-2`,children:[c.map(e=>(0,H.jsx)(ie,{message:e,colorFor:oe,isLeader:se,onViewFull:j},e.id)),$.length>0&&(0,H.jsxs)(`div`,{className:`px-3 py-1.5 text-xs italic text-text-subtle`,children:[$.join(`, `),` `,$.length===1?`is`:`are`,` typing…`]}),(0,H.jsx)(`div`,{ref:P})]})}),b&&(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:b}),(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border p-2`,children:(0,H.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,H.jsx)(`textarea`,{value:E,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!s&&(e.preventDefault(),ue())},rows:1,placeholder:`Message the group…`,className:`max-h-32 min-h-[44px] flex-1 resize-none rounded-md border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary`}),(0,H.jsx)(v,{onClick:ue,disabled:!E.trim(),className:`size-11 shrink-0 p-0`,"aria-label":`Send`,children:(0,H.jsx)(o,{className:`size-4`})})]})})]}),s?(0,H.jsxs)(C,{open:M,onClose:()=>N(!1),className:`flex max-h-[72vh] flex-col`,children:[(0,H.jsx)(`div`,{className:`flex h-11 shrink-0 items-center px-4 text-sm font-medium text-foreground`,children:`Members`}),(0,H.jsxs)(`div`,{className:`min-h-0 overflow-y-auto`,children:[L!==null&&(0,H.jsxs)(`label`,{className:`flex items-center gap-2 px-4 py-2 text-xs text-text-secondary`,children:[(0,H.jsx)(`span`,{children:`Reply cap`}),(0,H.jsx)(`input`,{type:`number`,min:1,max:50,value:L,onChange:e=>Y(Number(e.target.value)),className:`w-14 rounded border border-border bg-background px-1.5 py-1 text-xs text-foreground`}),(0,H.jsx)(`span`,{className:`text-text-subtle`,children:`turns/msg`})]}),U&&(0,H.jsx)(`p`,{className:`px-3 py-1 text-xs text-destructive`,children:U}),(0,H.jsx)(J,{members:F,liveStatus:X,typing:p,busy:z,onAdd:()=>K({member:null}),onEdit:e=>K({member:e}),onRemove:Q})]})]}):M&&(0,H.jsxs)(`div`,{className:`flex w-60 shrink-0 flex-col border-l border-border bg-panel`,children:[(0,H.jsx)(`div`,{className:`flex h-11 shrink-0 items-center border-b border-border px-3 text-sm font-medium text-foreground`,children:`Members`}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[L!==null&&(0,H.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-text-secondary`,children:[(0,H.jsx)(`span`,{children:`Reply cap`}),(0,H.jsx)(`input`,{type:`number`,min:1,max:50,value:L,onChange:e=>Y(Number(e.target.value)),className:`w-14 rounded border border-border bg-background px-1.5 py-1 text-xs text-foreground`}),(0,H.jsx)(`span`,{className:`text-text-subtle`,children:`turns/msg`})]}),U&&(0,H.jsx)(`p`,{className:`px-3 py-1 text-xs text-destructive`,children:U}),(0,H.jsx)(J,{members:F,liveStatus:X,typing:p,busy:z,onAdd:()=>K({member:null}),onEdit:e=>K({member:e}),onRemove:Q})]})]}),G&&(0,H.jsx)(ae,{open:!0,member:G.member,projectName:r,onSubmit:ce,onClose:()=>K(null)},G.member?.id??`add`),(0,H.jsx)(le,{groupId:t,message:k,onClose:()=>j(null)})]}):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-sm text-text-subtle`,children:`No group selected.`})}export{Q as GroupChatTab};
1
+ import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{C as t,S as n}from"./vendor-markdown-CuWCHIVb.js";import"./vendor-ui-DmZ-Mb-H.js";import{Bn as r,Gn as i,Nr as a,ar as o,b as s,j as c,jr as l,ln as u,mr as d,rr as f,sr as p,wr as m}from"./icons-DQjqk0lJ.js";import"./api-client-Jn3njtNw.js";import"./settings-store-tWrnlyEW.js";import"./vendor-mermaid-D6lgjvVE.js";import{n as h}from"./utils-Bmf_8h7Y.js";import"./portal-container-context-BarKmT4S.js";import"./panel-store-D20Zuf3i.js";import"./window-store-UC1jJeLM.js";import{i as g}from"./project-store-hNvwfqX3.js";import"./project-framework-store-ViZgce6y.js";import"./tab-store-krAuHQ6_.js";import"./context-menu-C6pIsf83.js";import"./file-store-Ds3qJ4hC.js";import{n as _}from"./use-is-mobile-TkcwP1Gx.js";import"./git-repo-store-BCEPfUGT.js";import{t as v}from"./button-B9CTrsEf.js";import{a as y,n as b,o as x,t as S}from"./dialog-B84_DJQ8.js";import{t as C}from"./mobile-bottom-sheet-C3TniEP-.js";import"./use-visual-viewport-Lp878uzs.js";import"./fs-api-orca76dV.js";import"./ws-auth-CaxV807E.js";import{A as w,Bt as T,F as E,Ht as D,I as O,L as k,M as A,Mt as j,N as M,Nt as N,P as ee,R as te,j as P,jt as F,k as I,z as ne}from"./index-C2luKRaD.js";import{t as L}from"./use-websocket-CutSagT7.js";import{n as R}from"./tool-cards-DxWaY8Or.js";import"./use-blob-url-C0VR6Uhh.js";import{t as z}from"./markdown-renderer-BkQLWgLf.js";import"./run-in-terminal-BFR70TLU.js";var B=e(t(),1),V=8e3;function re(e,t){let[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)([]),[o,s]=(0,B.useState)(`idle`),[c,l]=(0,B.useState)({}),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(null),v=(0,B.useRef)(new Map),y=(0,B.useCallback)(e=>{l(t=>{if(!t[e])return t;let n={...t};return delete n[e],n})},[]),b=(0,B.useCallback)(e=>{let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`ping`:return;case`group_state`:p(!0),s(t.status),a(t.members),h(t.status===`active`);return;case`group_message`:y(t.message.fromMember),r(e=>e.some(e=>e.id===t.message.id)?e:[...e,t.message]);return;case`member_status`:a(e=>e.map(e=>e.id===t.memberId?{...e,status:t.status}:e));return;case`typing`:{l(e=>({...e,[t.member]:!0}));let e=v.current,n=e.get(t.member);n&&clearTimeout(n),e.set(t.member,setTimeout(()=>y(t.member),V));return}case`turn_done`:return;case`group_done`:h(!1),s(`idle`),l({});return;case`error`:_(t.message),h(!1);return}},[y]),{send:x}=L({url:e&&t?`/ws/project/${encodeURIComponent(t)}/group/${encodeURIComponent(e)}`:``,onMessage:b,autoConnect:!!e&&!!t});return(0,B.useEffect)(()=>{let t=!1;r([]),a([]),l({}),s(`idle`),h(!1),_(null),p(!1);for(let e of v.current.values())clearTimeout(e);if(v.current.clear(),e)return d(!0),P(e,{limit:200}).then(e=>{t||r(t=>{let n=new Set(e.messages.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return[...e.messages,...r]})}).catch(e=>{t||_(e instanceof Error?e.message:`Failed to load feed`)}).finally(()=>{t||d(!1)}),()=>{t=!0}},[e]),{messages:n,members:i,status:o,typing:c,loading:u,isConnected:f,isRunning:m,error:g,sendMessage:(0,B.useCallback)(t=>{let n=t.trim();!n||!e||(_(null),h(!0),f?x(JSON.stringify({type:`message`,content:n})):O(e,n).catch(e=>{_(e instanceof Error?e.message:`Failed to send message`),h(!1)}))},[e,f,x]),stop:(0,B.useCallback)(()=>{e&&(f?x(JSON.stringify({type:`stop`})):k(e).catch(()=>{}),s(`paused`),h(!1))},[e,f,x]),resume:(0,B.useCallback)(()=>{e&&E(e).then(()=>{s(`active`),h(!0)}).catch(e=>_(e instanceof Error?e.message:`Failed to resume`))},[e])}}var H=n();function U(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function W(e){try{let t=e<0xe8d4a51000?e*1e3:e;return new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{return``}}function G(e,t){return e.split(/(@[\p{L}\p{N}_]+)/gu).map((e,n)=>{if(e.startsWith(`@`)&&e.length>1){let r=t(e.slice(1));return(0,H.jsx)(`span`,{className:h(`font-semibold`,!r&&`text-primary`),style:r?{color:r}:void 0,children:e},n)}return e})}var ie=(0,B.memo)(function({message:e,colorFor:t,isLeader:n,onViewFull:r}){let i=e.fromMember===`user`,a=i?`You`:e.fromMember,o=i?`var(--color-primary)`:t(e.fromMember)??`var(--accent)`,s=!i&&n(e.fromMember),c=e.summary??``,l=e.toMember&&e.toMember!==`all`?e.toMember:null,u=(0,H.jsxs)(`div`,{className:h(`group relative flex gap-2.5 px-3 py-2 transition-colors hover:bg-surface-elevated/50`,i&&`bg-primary/5`),style:{boxShadow:`inset 3px 0 0 0 ${o}`},children:[e.fullSessionRef&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(e),title:`View full transcript (AI's raw thinking / debug)`,"aria-label":`View full transcript`,className:`absolute right-1.5 top-1.5 hidden items-center rounded p-1 text-text-subtle/60 hover:bg-surface-elevated hover:text-text-secondary can-hover:group-hover:inline-flex`,children:(0,H.jsx)(f,{className:`size-3.5`})}),(0,H.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold text-white ring-2 ring-background`,style:{backgroundColor:o},"aria-hidden":!0,children:U(a)}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 can-hover:pr-6`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-sm font-semibold`,style:{color:i?`var(--color-foreground)`:o},children:a}),s&&(0,H.jsx)(`span`,{className:`rounded bg-surface-elevated px-1.5 py-px text-[10px] font-medium text-text-secondary`,children:`leader`}),l&&(0,H.jsxs)(`span`,{className:`text-[11px] text-text-subtle`,children:[`→ `,l]}),(0,H.jsx)(`span`,{className:`text-[11px] text-text-subtle`,children:W(e.createdAt)})]}),(0,H.jsx)(`div`,{className:`mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-text-secondary`,children:G(c,t)})]})]});return e.fullSessionRef?(0,H.jsxs)(F,{children:[(0,H.jsx)(T,{asChild:!0,children:u}),(0,H.jsx)(j,{children:(0,H.jsxs)(N,{onClick:()=>r(e),children:[(0,H.jsx)(f,{className:`size-4`}),` View full transcript`]})})]}):u}),K={idle:`bg-text-subtle`,working:`bg-primary animate-pulse`,done:`bg-emerald-500`,error:`bg-destructive`},q={idle:`Idle`,working:`Working`,done:`Done`,error:`Error`},J=(0,B.memo)(function({members:e,liveStatus:t,typing:n,busy:i,onAdd:a,onEdit:o,onRemove:s}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5 p-2`,children:[e.map(e=>{let a=n[e.name],c=t.get(e.id)??e.status;return(0,H.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,H.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white ring-2 ring-background`,style:{backgroundColor:e.color??`var(--accent)`},"aria-hidden":!0,children:e.name.slice(0,1).toUpperCase()}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs font-medium`,style:{color:e.color??`var(--color-foreground)`},children:e.name}),e.role===`leader`&&(0,H.jsx)(`span`,{className:`rounded-sm bg-accent-wash px-1 text-[9px] font-semibold uppercase text-primary`,children:`lead`})]}),(0,H.jsx)(`span`,{className:`block truncate text-[10px] text-text-subtle`,children:a?`typing…`:e.persona||q[c]})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 can-hover:opacity-0 can-hover:group-hover:opacity-100`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>o(e),disabled:i,"aria-label":`Edit ${e.name}`,className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground active:bg-surface-elevated disabled:opacity-40`,children:(0,H.jsx)(r,{className:`size-3.5`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>s(e),disabled:i,"aria-label":`Remove ${e.name}`,className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-destructive active:bg-surface-elevated disabled:opacity-40`,children:(0,H.jsx)(m,{className:`size-3.5`})})]}),(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-full`,K[c]),title:q[c],"aria-hidden":!0})]},e.id)}),(0,H.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,className:`mt-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-primary hover:bg-surface-elevated active:bg-surface-elevated disabled:opacity-40`,children:[(0,H.jsx)(l,{className:`size-4`}),` Add member`]})]})}),Y=`w-full min-h-[40px] rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary`;function ae({open:e,member:t,projectName:n,providerId:r=`claude`,onSubmit:i,onClose:a}){let o=_(),[s,c]=(0,B.useState)(t?.name??``),[l,d]=(0,B.useState)(t?.persona??``),[f,p]=(0,B.useState)(t?.model??null),[m,h]=(0,B.useState)(t?.role===`leader`),[g,w]=(0,B.useState)(!1),[T,E]=(0,B.useState)(null),D=(0,B.useCallback)(async()=>{let e=s.trim();if(!e){E(`Name is required`);return}w(!0),E(null);try{await i({name:e,persona:l.trim()||null,model:f,role:m?`leader`:`member`}),a()}catch(e){E(e instanceof Error?e.message:`Failed to save member`),w(!1)}},[s,l,f,m,i,a]),O=t?.role===`leader`,k=(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 px-1 py-1`,children:[(0,H.jsx)(`input`,{className:Y,value:s,onChange:e=>c(e.target.value),placeholder:`Member name`,autoFocus:!0}),(0,H.jsx)(`input`,{className:Y,value:l,onChange:e=>d(e.target.value),placeholder:`Persona (optional)`}),(0,H.jsx)(I,{value:f,onChange:p,projectName:n,providerId:r}),(0,H.jsxs)(`label`,{className:X(O),children:[(0,H.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-[var(--color-primary)]`,checked:m,disabled:O,onChange:e=>h(e.target.checked)}),(0,H.jsx)(`span`,{children:O?`Leader (reassign from another member)`:`Set as leader`})]}),T&&(0,H.jsx)(`p`,{className:`text-xs text-destructive`,children:T}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,H.jsx)(v,{variant:`outline`,onClick:a,disabled:g,children:`Cancel`}),(0,H.jsxs)(v,{onClick:D,disabled:g,children:[g&&(0,H.jsx)(u,{className:`mr-1.5 size-4 animate-spin`}),t?`Save`:`Add member`]})]})]});if(!e)return null;let A=t?`Edit member`:`Add member`;return o?(0,H.jsx)(C,{open:!0,onClose:a,className:`flex max-h-[90vh] flex-col`,children:(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col px-4 pb-2`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-base font-semibold text-foreground`,children:A}),k]})}):(0,H.jsx)(S,{open:!0,onOpenChange:e=>{e||a()},children:(0,H.jsxs)(b,{className:`flex flex-col sm:max-w-md`,children:[(0,H.jsx)(y,{children:(0,H.jsx)(x,{children:A})}),k]})})}function X(e){return`flex items-center gap-2 text-sm text-text-secondary ${e?`opacity-60`:``}`}function Z({messages:e,config:t,projectName:n}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t&&(0,H.jsx)(ce,{config:t}),e.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-text-subtle`,children:e.role===`user`?`User`:e.role===`assistant`?`Assistant`:e.role}),(0,H.jsx)(oe,{message:e,projectName:n})]},e.id)),e.length===0&&(0,H.jsx)(`p`,{className:`py-6 text-center text-sm text-text-subtle`,children:`Transcript is empty.`})]})}function oe({message:e,projectName:t}){let n=e.events??[];if(n.length===0)return e.content.trim()?(0,H.jsx)(z,{content:e.content}):null;let r=new Map;for(let e of n)e.type===`tool_result`&&e.toolUseId&&r.set(e.toolUseId,e);return(0,H.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map((e,n)=>{if(e.type===`text`)return e.content.trim()?(0,H.jsx)(z,{content:e.content},n):null;if(e.type===`thinking`)return(0,H.jsx)(se,{content:e.content},n);if(e.type===`tool_use`){let i=e.toolUseId?r.get(e.toolUseId):void 0;return(0,H.jsx)(R,{tool:e,result:i,completed:!!i,projectName:t},n)}return null})})}function se({content:e}){let[t,n]=(0,B.useState)(!1);return(0,H.jsxs)(`div`,{className:`rounded-md border border-border bg-surface-elevated/40`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-xs text-text-subtle hover:text-text-secondary`,children:[(0,H.jsx)(c,{className:h(`size-3.5 transition-transform`,t&&`rotate-90`)}),(0,H.jsx)(s,{className:`size-3.5`}),(0,H.jsx)(`span`,{children:`Thinking`})]}),t&&(0,H.jsx)(`div`,{className:`border-t border-border px-3 py-2 text-xs leading-relaxed text-text-secondary`,children:(0,H.jsx)(z,{content:e})})]})}function ce({config:e}){let[t,n]=(0,B.useState)(!1),r=[[`Model`,e.model],[`Permission`,e.permissionMode],[`CWD`,e.cwd],[`Git branch`,e.gitBranch],[`CLI version`,e.version]].filter(([,e])=>e);return r.length===0?null:(0,H.jsxs)(`div`,{className:`rounded-md border border-border bg-surface-elevated/40`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-text-secondary hover:text-foreground`,children:[(0,H.jsx)(c,{className:h(`size-3.5 transition-transform`,t&&`rotate-90`)}),(0,H.jsx)(p,{className:`size-3.5`}),(0,H.jsx)(`span`,{children:`Input config`})]}),t&&(0,H.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 border-t border-border px-3 py-2 text-xs`,children:r.map(([e,t])=>(0,H.jsxs)(`div`,{className:`contents`,children:[(0,H.jsx)(`dt`,{className:`text-text-subtle`,children:e}),(0,H.jsx)(`dd`,{className:`break-all font-mono text-text-secondary`,children:t})]},e))})]})}function le({groupId:e,message:t,onClose:n}){let r=_(),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(null),d=t?.fullSessionRef??null;if((0,B.useEffect)(()=>{if(!t||!d)return;let n=!1;return a(null),l(null),s(!0),M(e,d).then(e=>{n||a(e)}).catch(e=>{n||l(e instanceof Error?e.message:`Failed to load transcript`)}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,d,t]),!t)return null;let f=(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[o&&(0,H.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,H.jsx)(u,{className:`size-5 animate-spin text-primary`})}),c&&(0,H.jsxs)(`div`,{className:`px-1 py-4 text-sm text-text-secondary`,children:[(0,H.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Full transcript unavailable`}),(0,H.jsx)(`p`,{className:`text-xs text-text-subtle`,children:c}),t.summary&&(0,H.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-md bg-surface-elevated p-3 text-xs leading-relaxed text-text-secondary`,children:t.summary})]}),!o&&!c&&i!=null&&(0,H.jsx)(`div`,{className:`px-1 py-1`,children:(0,H.jsx)(Z,{messages:i.messages,config:i.config})})]}),p=`${t.fromMember} — full transcript`;return r?(0,H.jsx)(C,{open:!0,onClose:n,className:`max-h-[85vh] flex flex-col`,children:(0,H.jsxs)(`div`,{className:`flex flex-col min-h-0 px-4 pb-2`,children:[(0,H.jsx)(`h2`,{className:`mb-2 text-sm font-semibold text-foreground`,children:p}),f]})}):(0,H.jsx)(S,{open:!0,onOpenChange:e=>{e||n()},children:(0,H.jsxs)(b,{className:`flex max-h-[80vh] flex-col sm:max-w-2xl`,children:[(0,H.jsx)(y,{children:(0,H.jsx)(x,{className:`text-sm`,children:p})}),f]})})}function Q({metadata:e}){let t=e?.groupId??null,{activeProject:n}=g(D(e=>({activeProject:e.activeProject}))),r=e?.projectName??n?.name??``,s=_(),{messages:c,members:l,status:f,typing:p,loading:m,isRunning:y,error:b,sendMessage:x,stop:S,resume:T}=re(t,r),[E,O]=(0,B.useState)(``),[k,j]=(0,B.useState)(null),[M,N]=(0,B.useState)(!1),P=(0,B.useRef)(null),[F,I]=(0,B.useState)([]),[L,R]=(0,B.useState)(null),[z,V]=(0,B.useState)(!1),[U,W]=(0,B.useState)(null),[G,K]=(0,B.useState)(null),q=(0,B.useCallback)(async()=>{if(t)try{let e=await A(t);I(e.members),R(e.maxTurns)}catch{}},[t]),Y=(0,B.useCallback)(async e=>{if(!t)return;let n=Math.max(1,Math.min(50,Math.floor(e)||1));R(n);try{await ne(t,{maxTurns:n})}catch{q()}},[t,q]);(0,B.useEffect)(()=>{I([]),q()},[t,q]),(0,B.useEffect)(()=>{P.current?.scrollIntoView({block:`end`})},[c.length,p]);let X=(0,B.useMemo)(()=>new Map(l.map(e=>[e.id,e.status])),[l]),Z=F.length?F:l,oe=(0,B.useMemo)(()=>{let e=new Map(Z.map(e=>[e.name,e.color]));return t=>e.get(t)??null},[Z]),se=(0,B.useMemo)(()=>{let e=new Set(Z.filter(e=>e.role===`leader`).map(e=>e.name));return t=>e.has(t)},[Z]),ce=(0,B.useCallback)(async e=>{t&&(G?.member?await te(t,G.member.id,e):await w(t,e),await q())},[t,G,q]),Q=(0,B.useCallback)(async e=>{if(t){V(!0),W(null);try{await ee(t,e.id),await q()}catch(e){W(e instanceof Error?e.message:`Failed to remove member`)}finally{V(!1)}}},[t,q]),ue=(0,B.useCallback)(()=>{let e=E.trim();e&&(x(e),O(``))},[E,x]),$=Object.keys(p).filter(e=>p[e]);return t?(0,H.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-border px-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,H.jsx)(`span`,{className:h(`size-2 rounded-full`,f===`active`?`bg-primary animate-pulse`:f===`paused`?`bg-amber-500`:`bg-text-subtle`)}),(0,H.jsx)(`span`,{className:`capitalize`,children:f})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[y?(0,H.jsxs)(v,{size:`sm`,variant:`outline`,onClick:S,className:`h-8`,children:[(0,H.jsx)(d,{className:`mr-1 size-3.5`}),` Stop`]}):f===`paused`?(0,H.jsxs)(v,{size:`sm`,variant:`outline`,onClick:T,className:`h-8`,children:[(0,H.jsx)(i,{className:`mr-1 size-3.5`}),` Resume`]}):null,(0,H.jsx)(`button`,{type:`button`,onClick:()=>N(e=>!e),className:`flex size-8 items-center justify-center rounded-md text-text-subtle hover:bg-surface-elevated hover:text-foreground`,"aria-label":`Toggle roster`,children:(0,H.jsx)(a,{className:`size-4`})})]})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:m?(0,H.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,H.jsx)(u,{className:`size-5 animate-spin text-primary`})}):c.length===0?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-center text-sm text-text-subtle`,children:`Send a message to start the group.`}):(0,H.jsxs)(`div`,{className:`flex flex-col py-2`,children:[c.map(e=>(0,H.jsx)(ie,{message:e,colorFor:oe,isLeader:se,onViewFull:j},e.id)),$.length>0&&(0,H.jsxs)(`div`,{className:`px-3 py-1.5 text-xs italic text-text-subtle`,children:[$.join(`, `),` `,$.length===1?`is`:`are`,` typing…`]}),(0,H.jsx)(`div`,{ref:P})]})}),b&&(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:b}),(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border p-2`,children:(0,H.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,H.jsx)(`textarea`,{value:E,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!s&&(e.preventDefault(),ue())},rows:1,placeholder:`Message the group…`,className:`max-h-32 min-h-[44px] flex-1 resize-none rounded-md border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary`}),(0,H.jsx)(v,{onClick:ue,disabled:!E.trim(),className:`size-11 shrink-0 p-0`,"aria-label":`Send`,children:(0,H.jsx)(o,{className:`size-4`})})]})})]}),s?(0,H.jsxs)(C,{open:M,onClose:()=>N(!1),className:`flex max-h-[72vh] flex-col`,children:[(0,H.jsx)(`div`,{className:`flex h-11 shrink-0 items-center px-4 text-sm font-medium text-foreground`,children:`Members`}),(0,H.jsxs)(`div`,{className:`min-h-0 overflow-y-auto`,children:[L!==null&&(0,H.jsxs)(`label`,{className:`flex items-center gap-2 px-4 py-2 text-xs text-text-secondary`,children:[(0,H.jsx)(`span`,{children:`Reply cap`}),(0,H.jsx)(`input`,{type:`number`,min:1,max:50,value:L,onChange:e=>Y(Number(e.target.value)),className:`w-14 rounded border border-border bg-background px-1.5 py-1 text-xs text-foreground`}),(0,H.jsx)(`span`,{className:`text-text-subtle`,children:`turns/msg`})]}),U&&(0,H.jsx)(`p`,{className:`px-3 py-1 text-xs text-destructive`,children:U}),(0,H.jsx)(J,{members:F,liveStatus:X,typing:p,busy:z,onAdd:()=>K({member:null}),onEdit:e=>K({member:e}),onRemove:Q})]})]}):M&&(0,H.jsxs)(`div`,{className:`flex w-60 shrink-0 flex-col border-l border-border bg-panel`,children:[(0,H.jsx)(`div`,{className:`flex h-11 shrink-0 items-center border-b border-border px-3 text-sm font-medium text-foreground`,children:`Members`}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[L!==null&&(0,H.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-text-secondary`,children:[(0,H.jsx)(`span`,{children:`Reply cap`}),(0,H.jsx)(`input`,{type:`number`,min:1,max:50,value:L,onChange:e=>Y(Number(e.target.value)),className:`w-14 rounded border border-border bg-background px-1.5 py-1 text-xs text-foreground`}),(0,H.jsx)(`span`,{className:`text-text-subtle`,children:`turns/msg`})]}),U&&(0,H.jsx)(`p`,{className:`px-3 py-1 text-xs text-destructive`,children:U}),(0,H.jsx)(J,{members:F,liveStatus:X,typing:p,busy:z,onAdd:()=>K({member:null}),onEdit:e=>K({member:e}),onRemove:Q})]})]}),G&&(0,H.jsx)(ae,{open:!0,member:G.member,projectName:r,onSubmit:ce,onClose:()=>K(null)},G.member?.id??`add`),(0,H.jsx)(le,{groupId:t,message:k,onClose:()=>j(null)})]}):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-4 text-sm text-text-subtle`,children:`No group selected.`})}export{Q as GroupChatTab};