bb-app 0.43.2 → 0.43.3

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 (437) hide show
  1. package/app/dist/assets/{AppFileExternalNavigationDispatcher-BjNBScqR.js → AppFileExternalNavigationDispatcher-CEr_pjYQ.js} +1 -1
  2. package/app/dist/assets/AppFileExternalNavigationDispatcher-CEr_pjYQ.js.br +0 -0
  3. package/app/dist/assets/AppFileExternalNavigationDispatcher-CEr_pjYQ.js.gz +0 -0
  4. package/app/dist/assets/{BbDiff-12uz9IAX.js → BbDiff-BKxQP2II.js} +1 -1
  5. package/app/dist/assets/BbDiff-BKxQP2II.js.br +0 -0
  6. package/app/dist/assets/BbDiff-BKxQP2II.js.gz +0 -0
  7. package/app/dist/assets/{BbSourceCode-B5ByV-FS.js → BbSourceCode-DKykSFN3.js} +1 -1
  8. package/app/dist/assets/BbSourceCode-DKykSFN3.js.br +0 -0
  9. package/app/dist/assets/BbSourceCode-DKykSFN3.js.gz +0 -0
  10. package/app/dist/assets/{BrowserTabDeck-CVRIa1t8.js → BrowserTabDeck-BGMPuTrp.js} +1 -1
  11. package/app/dist/assets/BrowserTabDeck-BGMPuTrp.js.br +0 -0
  12. package/app/dist/assets/BrowserTabDeck-BGMPuTrp.js.gz +0 -0
  13. package/app/dist/assets/{DiffHost-BMW3ydFS.js → DiffHost-CTr2vxLr.js} +2 -2
  14. package/app/dist/assets/DiffHost-CTr2vxLr.js.br +0 -0
  15. package/app/dist/assets/DiffHost-CTr2vxLr.js.gz +0 -0
  16. package/app/dist/assets/{ExperimentalFileLinkMenu-4-BPBhuh.js → ExperimentalFileLinkMenu-BlSwZZtX.js} +1 -1
  17. package/app/dist/assets/ExperimentalFileLinkMenu-BlSwZZtX.js.br +0 -0
  18. package/app/dist/assets/ExperimentalFileLinkMenu-BlSwZZtX.js.gz +0 -0
  19. package/app/dist/assets/{FilePreview-BLUhIkKE.js → FilePreview-Bf6cFFHd.js} +1 -1
  20. package/app/dist/assets/FilePreview-Bf6cFFHd.js.br +0 -0
  21. package/app/dist/assets/FilePreview-Bf6cFFHd.js.gz +0 -0
  22. package/app/dist/assets/{GitDiffCardHeader-EEoiwhTP.js → GitDiffCardHeader-rVj_UFjP.js} +1 -1
  23. package/app/dist/assets/GitDiffCardHeader-rVj_UFjP.js.br +0 -0
  24. package/app/dist/assets/GitDiffCardHeader-rVj_UFjP.js.gz +0 -0
  25. package/app/dist/assets/{MachineRenameDialog-D5punQm7.js → MachineRenameDialog-CIVshNWH.js} +1 -1
  26. package/app/dist/assets/MachineRenameDialog-CIVshNWH.js.br +0 -0
  27. package/app/dist/assets/MachineRenameDialog-CIVshNWH.js.gz +0 -0
  28. package/app/dist/assets/{MachineSettingsView-BB8sWZCY.js → MachineSettingsView-BG1TC1lz.js} +1 -1
  29. package/app/dist/assets/MachineSettingsView-BG1TC1lz.js.br +0 -0
  30. package/app/dist/assets/MachineSettingsView-BG1TC1lz.js.gz +0 -0
  31. package/app/dist/assets/{NewTabPage-BF31qJOv.js → NewTabPage-tSK_POcQ.js} +1 -1
  32. package/app/dist/assets/NewTabPage-tSK_POcQ.js.br +0 -0
  33. package/app/dist/assets/NewTabPage-tSK_POcQ.js.gz +0 -0
  34. package/app/dist/assets/{OptionPicker-CS_rzYKC.js → OptionPicker-BOubhr2j.js} +1 -1
  35. package/app/dist/assets/OptionPicker-BOubhr2j.js.br +0 -0
  36. package/app/dist/assets/OptionPicker-BOubhr2j.js.gz +0 -0
  37. package/app/dist/assets/{PaneMaximizeButton-BX9O85-9.js → PaneMaximizeButton-DgPCqAO1.js} +1 -1
  38. package/app/dist/assets/PaneMaximizeButton-DgPCqAO1.js.br +0 -0
  39. package/app/dist/assets/PaneMaximizeButton-DgPCqAO1.js.gz +0 -0
  40. package/app/dist/assets/{PierreLineSelectionActions-Dv6SPPb_.js → PierreLineSelectionActions-C5-PLqPI.js} +1 -1
  41. package/app/dist/assets/PierreLineSelectionActions-C5-PLqPI.js.br +0 -0
  42. package/app/dist/assets/PierreLineSelectionActions-C5-PLqPI.js.gz +0 -0
  43. package/app/dist/assets/{PluginPanelActions-Brw0eTmm.js → PluginPanelActions-Ijm2JjYk.js} +1 -1
  44. package/app/dist/assets/PluginPanelActions-Ijm2JjYk.js.br +0 -0
  45. package/app/dist/assets/PluginPanelActions-Ijm2JjYk.js.gz +0 -0
  46. package/app/dist/assets/{PluginPanelRightPanelHost-heDcnHb6.js → PluginPanelRightPanelHost-Bpv5KKG0.js} +1 -1
  47. package/app/dist/assets/PluginPanelRightPanelHost-Bpv5KKG0.js.br +0 -0
  48. package/app/dist/assets/PluginPanelRightPanelHost-Bpv5KKG0.js.gz +0 -0
  49. package/app/dist/assets/{ProjectDetailSettingsView-D_Vdu2ce.js → ProjectDetailSettingsView-BFpcwtLD.js} +1 -1
  50. package/app/dist/assets/ProjectDetailSettingsView-BFpcwtLD.js.br +0 -0
  51. package/app/dist/assets/ProjectDetailSettingsView-BFpcwtLD.js.gz +0 -0
  52. package/app/dist/assets/{ProjectMachineSetupDialog-BY8TrS7P.js → ProjectMachineSetupDialog-Bt-cA5q8.js} +1 -1
  53. package/app/dist/assets/ProjectMachineSetupDialog-Bt-cA5q8.js.br +0 -0
  54. package/app/dist/assets/ProjectMachineSetupDialog-Bt-cA5q8.js.gz +0 -0
  55. package/app/dist/assets/{ProjectsSettingsSection-DMgbOzi0.js → ProjectsSettingsSection-CWiPZs3X.js} +1 -1
  56. package/app/dist/assets/ProjectsSettingsSection-CWiPZs3X.js.br +0 -0
  57. package/app/dist/assets/ProjectsSettingsSection-CWiPZs3X.js.gz +0 -0
  58. package/app/dist/assets/{SecondaryPanelLayout-DK9e6Wvw.js → SecondaryPanelLayout-Cusv3Frw.js} +1 -1
  59. package/app/dist/assets/SecondaryPanelLayout-Cusv3Frw.js.br +0 -0
  60. package/app/dist/assets/SecondaryPanelLayout-Cusv3Frw.js.gz +0 -0
  61. package/app/dist/assets/{SettingsView-Dba7HBKl.js → SettingsView-KD5NmVsB.js} +3 -3
  62. package/app/dist/assets/SettingsView-KD5NmVsB.js.br +0 -0
  63. package/app/dist/assets/SettingsView-KD5NmVsB.js.gz +0 -0
  64. package/app/dist/assets/{SourceCodeHost-kd2wce0c.js → SourceCodeHost-Dg6LVIHE.js} +2 -2
  65. package/app/dist/assets/SourceCodeHost-Dg6LVIHE.js.br +0 -0
  66. package/app/dist/assets/SourceCodeHost-Dg6LVIHE.js.gz +0 -0
  67. package/app/dist/assets/{SplitWorkspaceRoute-DRdQCrgp.js → SplitWorkspaceRoute-Bd2sq5WI.js} +2 -2
  68. package/app/dist/assets/SplitWorkspaceRoute-Bd2sq5WI.js.br +0 -0
  69. package/app/dist/assets/SplitWorkspaceRoute-Bd2sq5WI.js.gz +0 -0
  70. package/app/dist/assets/{ThreadSearchPaletteMode-BG5X0DsN.js → ThreadSearchPaletteMode-BBY7LZSw.js} +1 -1
  71. package/app/dist/assets/ThreadSearchPaletteMode-BBY7LZSw.js.br +0 -0
  72. package/app/dist/assets/ThreadSearchPaletteMode-BBY7LZSw.js.gz +0 -0
  73. package/app/dist/assets/{ThreadSecondaryPanel-BWsbxGu_.js → ThreadSecondaryPanel-CR_8CHga.js} +1 -1
  74. package/app/dist/assets/ThreadSecondaryPanel-CR_8CHga.js.br +0 -0
  75. package/app/dist/assets/ThreadSecondaryPanel-CR_8CHga.js.gz +0 -0
  76. package/app/dist/assets/{ThreadSecondaryPanelTabContent-Hw4tkdnw.js → ThreadSecondaryPanelTabContent-GmKjRc60.js} +1 -1
  77. package/app/dist/assets/ThreadSecondaryPanelTabContent-GmKjRc60.js.br +0 -0
  78. package/app/dist/assets/ThreadSecondaryPanelTabContent-GmKjRc60.js.gz +0 -0
  79. package/app/dist/assets/{ThreadStorageFileTree-sMfYZ-yr.js → ThreadStorageFileTree-DGKmyDy_.js} +1 -1
  80. package/app/dist/assets/ThreadStorageFileTree-DGKmyDy_.js.br +0 -0
  81. package/app/dist/assets/ThreadStorageFileTree-DGKmyDy_.js.gz +0 -0
  82. package/app/dist/assets/{ThreadTerminalPanel-D8GLBGQ6.js → ThreadTerminalPanel-CbJxSH7Q.js} +1 -1
  83. package/app/dist/assets/ThreadTerminalPanel-CbJxSH7Q.js.br +0 -0
  84. package/app/dist/assets/ThreadTerminalPanel-CbJxSH7Q.js.gz +0 -0
  85. package/app/dist/assets/{TimelineDetailScroll-CJxHbZ11.js → TimelineDetailScroll-Dc92aq0I.js} +1 -1
  86. package/app/dist/assets/TimelineDetailScroll-Dc92aq0I.js.br +0 -0
  87. package/app/dist/assets/TimelineDetailScroll-Dc92aq0I.js.gz +0 -0
  88. package/app/dist/assets/{TimelineFileDiffBlock-D0UsFk6L.js → TimelineFileDiffBlock-XVL_v9Sv.js} +1 -1
  89. package/app/dist/assets/TimelineFileDiffBlock-XVL_v9Sv.js.br +0 -0
  90. package/app/dist/assets/TimelineFileDiffBlock-XVL_v9Sv.js.gz +0 -0
  91. package/app/dist/assets/{TimelineSelectionMenu-tjYTa_Nz.js → TimelineSelectionMenu-j-uLThcW.js} +1 -1
  92. package/app/dist/assets/TimelineSelectionMenu-j-uLThcW.js.br +0 -0
  93. package/app/dist/assets/TimelineSelectionMenu-j-uLThcW.js.gz +0 -0
  94. package/app/dist/assets/{ToolsView-oVQgCd9D.js → ToolsView-BqBbtO9Q.js} +1 -1
  95. package/app/dist/assets/ToolsView-BqBbtO9Q.js.br +0 -0
  96. package/app/dist/assets/ToolsView-BqBbtO9Q.js.gz +0 -0
  97. package/app/dist/assets/{absolute-file-path-B8rvpN6h.js → absolute-file-path-1onVupdg.js} +1 -1
  98. package/app/dist/assets/absolute-file-path-1onVupdg.js.br +0 -0
  99. package/app/dist/assets/absolute-file-path-1onVupdg.js.gz +0 -0
  100. package/app/dist/assets/{browser-url-DBXpmDyy.js → browser-url-CZ3HjlzM.js} +1 -1
  101. package/app/dist/assets/browser-url-CZ3HjlzM.js.br +0 -0
  102. package/app/dist/assets/browser-url-CZ3HjlzM.js.gz +0 -0
  103. package/app/dist/assets/{code-loading-skeletons-BSCBLTPn.js → code-loading-skeletons-B55l1zWf.js} +1 -1
  104. package/app/dist/assets/code-loading-skeletons-B55l1zWf.js.br +0 -0
  105. package/app/dist/assets/code-loading-skeletons-B55l1zWf.js.gz +0 -0
  106. package/app/dist/assets/{code-rendering-DpMXklPX.js → code-rendering-BFjfGlm3.js} +1 -1
  107. package/app/dist/assets/{code-theme-registration-tCUsiCnu.js → code-theme-registration-p5_Y9xRp.js} +1 -1
  108. package/app/dist/assets/{diff-stats-tally-DGP3JT_p.js → diff-stats-tally-s44Uatza.js} +1 -1
  109. package/app/dist/assets/{environment-queries-CPfRGBmD.js → environment-queries-DQRtId3I.js} +1 -1
  110. package/app/dist/assets/environment-queries-DQRtId3I.js.br +0 -0
  111. package/app/dist/assets/environment-queries-DQRtId3I.js.gz +0 -0
  112. package/app/dist/assets/{file-opener-preference-CNU-2AX-.js → file-opener-preference-BBzsNdAN.js} +1 -1
  113. package/app/dist/assets/{file-path-link-Cj-hPyCZ.js → file-path-link-BaN4e97c.js} +1 -1
  114. package/app/dist/assets/file-path-link-BaN4e97c.js.br +0 -0
  115. package/app/dist/assets/file-path-link-BaN4e97c.js.gz +0 -0
  116. package/app/dist/assets/{fixed-panel-tabs-state-DBvI_-nu.js → fixed-panel-tabs-state-BAooiNnZ.js} +1 -1
  117. package/app/dist/assets/{host-mutations-B97HiIxn.js → host-mutations-DpX66-O1.js} +1 -1
  118. package/app/dist/assets/host-mutations-DpX66-O1.js.br +0 -0
  119. package/app/dist/assets/host-mutations-DpX66-O1.js.gz +0 -0
  120. package/app/dist/assets/{icon-extended-EN13GZdT.js → icon-extended-BVbuxg1V.js} +1 -1
  121. package/app/dist/assets/icon-extended-BVbuxg1V.js.br +0 -0
  122. package/app/dist/assets/icon-extended-BVbuxg1V.js.gz +0 -0
  123. package/app/dist/assets/{index-C5R2EQf4.js → index-DecRjD4J.js} +5 -5
  124. package/app/dist/assets/index-DecRjD4J.js.br +0 -0
  125. package/app/dist/assets/index-DecRjD4J.js.gz +0 -0
  126. package/app/dist/assets/{launcherRow-jBXN_s_6.js → launcherRow-COr8pwMb.js} +1 -1
  127. package/app/dist/assets/launcherRow-COr8pwMb.js.br +0 -0
  128. package/app/dist/assets/launcherRow-COr8pwMb.js.gz +0 -0
  129. package/app/dist/assets/{machine-provider-queries-DKwDoXks.js → machine-provider-queries-3BwQeMu1.js} +1 -1
  130. package/app/dist/assets/machine-provider-queries-3BwQeMu1.js.br +0 -0
  131. package/app/dist/assets/machine-provider-queries-3BwQeMu1.js.gz +0 -0
  132. package/app/dist/assets/{markdown-file-image-routing-DkTKP8N7.js → markdown-file-image-routing-Ddaz9z2N.js} +1 -1
  133. package/app/dist/assets/{markdown-preview-DHAQdwAu.js → markdown-preview-pm-veEGv.js} +1 -1
  134. package/app/dist/assets/markdown-preview-pm-veEGv.js.br +0 -0
  135. package/app/dist/assets/markdown-preview-pm-veEGv.js.gz +0 -0
  136. package/app/dist/assets/{open-in-editor-button-EKbyr9fS.js → open-in-editor-button-DC5WlBTO.js} +1 -1
  137. package/app/dist/assets/{open-in-editor-button-EKbyr9fS.js.br → open-in-editor-button-DC5WlBTO.js.br} +0 -0
  138. package/app/dist/assets/open-in-editor-button-DC5WlBTO.js.gz +0 -0
  139. package/app/dist/assets/{page-shell-DHP7X_Rt.js → page-shell-KqI9laXh.js} +1 -1
  140. package/app/dist/assets/page-shell-KqI9laXh.js.br +0 -0
  141. package/app/dist/assets/page-shell-KqI9laXh.js.gz +0 -0
  142. package/app/dist/assets/{pierre-worker-pool-DddCdbqT.js → pierre-worker-pool-BIFn7Fjx.js} +1 -1
  143. package/app/dist/assets/pierre-worker-pool-BIFn7Fjx.js.br +0 -0
  144. package/app/dist/assets/pierre-worker-pool-BIFn7Fjx.js.gz +0 -0
  145. package/app/dist/assets/{plugin-catalog-queries-mWlJEp8o.js → plugin-catalog-queries-wLOKJfhz.js} +1 -1
  146. package/app/dist/assets/plugin-catalog-queries-wLOKJfhz.js.br +0 -0
  147. package/app/dist/assets/plugin-catalog-queries-wLOKJfhz.js.gz +0 -0
  148. package/app/dist/assets/{plugin-detail-navigation-BvnYG1vG.js → plugin-detail-navigation-Bs9RE1zg.js} +2 -2
  149. package/app/dist/assets/plugin-detail-navigation-Bs9RE1zg.js.br +0 -0
  150. package/app/dist/assets/plugin-detail-navigation-Bs9RE1zg.js.gz +0 -0
  151. package/app/dist/assets/{plugin-frontend-BZy0QzmI.js → plugin-frontend-CjiHa9bh.js} +3 -3
  152. package/app/dist/assets/plugin-frontend-CjiHa9bh.js.br +0 -0
  153. package/app/dist/assets/plugin-frontend-CjiHa9bh.js.gz +0 -0
  154. package/app/dist/assets/{project-default-execution-options-query-BXYO-hGv.js → project-default-execution-options-query-DgwHHJgk.js} +1 -1
  155. package/app/dist/assets/project-default-execution-options-query-DgwHHJgk.js.br +0 -0
  156. package/app/dist/assets/project-default-execution-options-query-DgwHHJgk.js.gz +0 -0
  157. package/app/dist/assets/{resource-list-D_oVsoA6.js → resource-list-Bjgzb5y2.js} +1 -1
  158. package/app/dist/assets/resource-list-Bjgzb5y2.js.br +0 -0
  159. package/app/dist/assets/resource-list-Bjgzb5y2.js.gz +0 -0
  160. package/app/dist/assets/{root-compose-create-preference-DCx3CWwe.js → root-compose-create-preference-B-HKV5cI.js} +1 -1
  161. package/app/dist/assets/root-compose-create-preference-B-HKV5cI.js.br +0 -0
  162. package/app/dist/assets/root-compose-create-preference-B-HKV5cI.js.gz +0 -0
  163. package/app/dist/assets/{settings-section-BEqzIulW.js → settings-section-Dl4EomFb.js} +1 -1
  164. package/app/dist/assets/settings-section-Dl4EomFb.js.br +0 -0
  165. package/app/dist/assets/settings-section-Dl4EomFb.js.gz +0 -0
  166. package/app/dist/assets/{thread-terminal-queries-y6HeNWQc.js → thread-terminal-queries-ZGKk1b-y.js} +1 -1
  167. package/app/dist/assets/thread-terminal-queries-ZGKk1b-y.js.br +0 -0
  168. package/app/dist/assets/thread-terminal-queries-ZGKk1b-y.js.gz +0 -0
  169. package/app/dist/assets/{threadRecentItems-DBmfDN5s.js → threadRecentItems-BxHtIsuB.js} +1 -1
  170. package/app/dist/assets/threadRecentItems-BxHtIsuB.js.br +0 -0
  171. package/app/dist/assets/threadRecentItems-BxHtIsuB.js.gz +0 -0
  172. package/app/dist/assets/{truncate-start-DjB5Y2C-.js → truncate-start-D4bEDc2D.js} +1 -1
  173. package/app/dist/assets/{use-hover-popover-BUPmV7Lx.js → use-hover-popover-TLC-UiLb.js} +1 -1
  174. package/app/dist/assets/use-hover-popover-TLC-UiLb.js.br +0 -0
  175. package/app/dist/assets/use-hover-popover-TLC-UiLb.js.gz +0 -0
  176. package/app/dist/assets/{useLocalOpenTargets-CDHNvnze.js → useLocalOpenTargets-xKhSZ1ao.js} +1 -1
  177. package/app/dist/assets/useLocalOpenTargets-xKhSZ1ao.js.br +0 -0
  178. package/app/dist/assets/useLocalOpenTargets-xKhSZ1ao.js.gz +0 -0
  179. package/app/dist/assets/{usePathSuggestions-Dhrastgl.js → usePathSuggestions-D0WVuHd1.js} +1 -1
  180. package/app/dist/assets/usePathSuggestions-D0WVuHd1.js.br +0 -0
  181. package/app/dist/assets/usePathSuggestions-D0WVuHd1.js.gz +0 -0
  182. package/app/dist/assets/{useResolvedLiveFileTarget-Ds5mNteC.js → useResolvedLiveFileTarget-o9WlVHUW.js} +1 -1
  183. package/app/dist/assets/useResolvedLiveFileTarget-o9WlVHUW.js.br +0 -0
  184. package/app/dist/assets/useResolvedLiveFileTarget-o9WlVHUW.js.gz +0 -0
  185. package/app/dist/assets/{useThreadTerminalController-BBSkeWRP.js → useThreadTerminalController-CgzAV-v7.js} +1 -1
  186. package/app/dist/assets/useThreadTerminalController-CgzAV-v7.js.br +0 -0
  187. package/app/dist/assets/useThreadTerminalController-CgzAV-v7.js.gz +0 -0
  188. package/app/dist/assets/{workspace-checkout-display-1eTCIlDv.js → workspace-checkout-display-Cm0qdHob.js} +3 -3
  189. package/app/dist/assets/workspace-checkout-display-Cm0qdHob.js.br +0 -0
  190. package/app/dist/assets/workspace-checkout-display-Cm0qdHob.js.gz +0 -0
  191. package/app/dist/index.html +1 -1
  192. package/app/dist/index.html.br +0 -0
  193. package/app/dist/index.html.gz +0 -0
  194. package/dist/index.d.ts +9 -9
  195. package/package.json +1 -1
  196. package/server/dist/builtin-plugins/account-pool/dist/app.meta.json +1 -1
  197. package/server/dist/builtin-plugins/account-pool/dist/server.js +24 -24
  198. package/server/dist/builtin-plugins/account-pool/dist/server.meta.json +1 -1
  199. package/server/dist/builtin-plugins/agent-annotations/dist/app.meta.json +1 -1
  200. package/server/dist/builtin-plugins/agent-annotations/dist/server.js +3 -3
  201. package/server/dist/builtin-plugins/agent-annotations/dist/server.meta.json +1 -1
  202. package/server/dist/builtin-plugins/ask-user-question/dist/app.meta.json +1 -1
  203. package/server/dist/builtin-plugins/ask-user-question/dist/server.js +4 -4
  204. package/server/dist/builtin-plugins/ask-user-question/dist/server.meta.json +1 -1
  205. package/server/dist/builtin-plugins/automations/dist/app.meta.json +1 -1
  206. package/server/dist/builtin-plugins/automations/dist/server.js +21 -21
  207. package/server/dist/builtin-plugins/automations/dist/server.meta.json +1 -1
  208. package/server/dist/builtin-plugins/bb-guide/dist/server.js +1 -1
  209. package/server/dist/builtin-plugins/bb-guide/dist/server.meta.json +1 -1
  210. package/server/dist/builtin-plugins/browser-automation/dist/app.meta.json +1 -1
  211. package/server/dist/builtin-plugins/browser-automation/dist/host.js +9 -9
  212. package/server/dist/builtin-plugins/browser-automation/dist/host.meta.json +2 -2
  213. package/server/dist/builtin-plugins/browser-automation/dist/server.js +5 -5
  214. package/server/dist/builtin-plugins/browser-automation/dist/server.meta.json +1 -1
  215. package/server/dist/builtin-plugins/concurrency-limit/dist/app.meta.json +1 -1
  216. package/server/dist/builtin-plugins/concurrency-limit/dist/host.js +3 -3
  217. package/server/dist/builtin-plugins/concurrency-limit/dist/host.meta.json +2 -2
  218. package/server/dist/builtin-plugins/concurrency-limit/dist/server.js +4 -4
  219. package/server/dist/builtin-plugins/concurrency-limit/dist/server.meta.json +1 -1
  220. package/server/dist/builtin-plugins/connect/dist/app.meta.json +1 -1
  221. package/server/dist/builtin-plugins/connect/dist/server.js +14 -14
  222. package/server/dist/builtin-plugins/connect/dist/server.meta.json +1 -1
  223. package/server/dist/builtin-plugins/custom-instructions/dist/server.js +2 -2
  224. package/server/dist/builtin-plugins/custom-instructions/dist/server.meta.json +1 -1
  225. package/server/dist/builtin-plugins/docs/dist/app.meta.json +1 -1
  226. package/server/dist/builtin-plugins/docs/dist/server.js +4 -4
  227. package/server/dist/builtin-plugins/docs/dist/server.meta.json +1 -1
  228. package/server/dist/builtin-plugins/drafts/dist/app.meta.json +1 -1
  229. package/server/dist/builtin-plugins/drafts/dist/server.js +1 -1
  230. package/server/dist/builtin-plugins/drafts/dist/server.meta.json +1 -1
  231. package/server/dist/builtin-plugins/environment-git-worktree/dist/app.meta.json +1 -1
  232. package/server/dist/builtin-plugins/environment-git-worktree/dist/host.js +8 -8
  233. package/server/dist/builtin-plugins/environment-git-worktree/dist/host.meta.json +2 -2
  234. package/server/dist/builtin-plugins/environment-git-worktree/dist/server.js +3 -3
  235. package/server/dist/builtin-plugins/environment-git-worktree/dist/server.meta.json +1 -1
  236. package/server/dist/builtin-plugins/environment-modal-sandbox/dist/app.meta.json +1 -1
  237. package/server/dist/builtin-plugins/environment-modal-sandbox/dist/server.js +19 -19
  238. package/server/dist/builtin-plugins/environment-modal-sandbox/dist/server.meta.json +1 -1
  239. package/server/dist/builtin-plugins/environment-personal-workspace/dist/host.js +4 -4
  240. package/server/dist/builtin-plugins/environment-personal-workspace/dist/host.meta.json +2 -2
  241. package/server/dist/builtin-plugins/environment-personal-workspace/dist/server.js +4 -4
  242. package/server/dist/builtin-plugins/environment-personal-workspace/dist/server.meta.json +1 -1
  243. package/server/dist/builtin-plugins/environment-project-checkout/dist/app.meta.json +1 -1
  244. package/server/dist/builtin-plugins/environment-project-checkout/dist/host.js +4 -4
  245. package/server/dist/builtin-plugins/environment-project-checkout/dist/host.meta.json +2 -2
  246. package/server/dist/builtin-plugins/environment-project-checkout/dist/server.js +4 -4
  247. package/server/dist/builtin-plugins/environment-project-checkout/dist/server.meta.json +1 -1
  248. package/server/dist/builtin-plugins/github/dist/app.meta.json +1 -1
  249. package/server/dist/builtin-plugins/github/dist/server.js +2 -2
  250. package/server/dist/builtin-plugins/github/dist/server.meta.json +1 -1
  251. package/server/dist/builtin-plugins/inline-vis/dist/app.meta.json +1 -1
  252. package/server/dist/builtin-plugins/inline-vis/dist/server.js +2 -2
  253. package/server/dist/builtin-plugins/inline-vis/dist/server.meta.json +1 -1
  254. package/server/dist/builtin-plugins/keep-awake/dist/app.meta.json +1 -1
  255. package/server/dist/builtin-plugins/keep-awake/dist/host.js +3 -3
  256. package/server/dist/builtin-plugins/keep-awake/dist/host.meta.json +2 -2
  257. package/server/dist/builtin-plugins/keep-awake/dist/server.js +3 -3
  258. package/server/dist/builtin-plugins/keep-awake/dist/server.meta.json +1 -1
  259. package/server/dist/builtin-plugins/memory/dist/app.meta.json +1 -1
  260. package/server/dist/builtin-plugins/memory/dist/server.js +3 -3
  261. package/server/dist/builtin-plugins/memory/dist/server.meta.json +1 -1
  262. package/server/dist/builtin-plugins/monaco-editor/dist/app.meta.json +1 -1
  263. package/server/dist/builtin-plugins/monaco-editor/dist/server.js +2 -2
  264. package/server/dist/builtin-plugins/monaco-editor/dist/server.meta.json +1 -1
  265. package/server/dist/builtin-plugins/pdf-preview/dist/app.meta.json +1 -1
  266. package/server/dist/builtin-plugins/pdf-preview/dist/server.js +1 -1
  267. package/server/dist/builtin-plugins/pdf-preview/dist/server.meta.json +1 -1
  268. package/server/dist/builtin-plugins/plugin-api-docs/dist/app.meta.json +1 -1
  269. package/server/dist/builtin-plugins/plugin-api-docs/dist/server.js +1 -1
  270. package/server/dist/builtin-plugins/plugin-api-docs/dist/server.meta.json +1 -1
  271. package/server/dist/builtin-plugins/plugin-api-tester/dist/app.meta.json +1 -1
  272. package/server/dist/builtin-plugins/plugin-api-tester/dist/server.js +1 -1
  273. package/server/dist/builtin-plugins/plugin-api-tester/dist/server.meta.json +1 -1
  274. package/server/dist/builtin-plugins/provider-acp/dist/host.js +15 -15
  275. package/server/dist/builtin-plugins/provider-acp/dist/host.meta.json +2 -2
  276. package/server/dist/builtin-plugins/provider-acp/dist/server.js +20 -20
  277. package/server/dist/builtin-plugins/provider-acp/dist/server.meta.json +1 -1
  278. package/server/dist/builtin-plugins/provider-claude-code/dist/host.js +30 -30
  279. package/server/dist/builtin-plugins/provider-claude-code/dist/host.meta.json +2 -2
  280. package/server/dist/builtin-plugins/provider-claude-code/dist/server.js +5 -5
  281. package/server/dist/builtin-plugins/provider-claude-code/dist/server.meta.json +1 -1
  282. package/server/dist/builtin-plugins/provider-codex/dist/host.js +23 -23
  283. package/server/dist/builtin-plugins/provider-codex/dist/host.meta.json +2 -2
  284. package/server/dist/builtin-plugins/provider-codex/dist/server.js +5 -5
  285. package/server/dist/builtin-plugins/provider-codex/dist/server.meta.json +1 -1
  286. package/server/dist/builtin-plugins/provider-pi/dist/app.meta.json +1 -1
  287. package/server/dist/builtin-plugins/provider-pi/dist/host.js +20 -20
  288. package/server/dist/builtin-plugins/provider-pi/dist/host.meta.json +2 -2
  289. package/server/dist/builtin-plugins/provider-pi/dist/server.js +3 -3
  290. package/server/dist/builtin-plugins/provider-pi/dist/server.meta.json +1 -1
  291. package/server/dist/builtin-plugins/provider-retry/dist/server.js +5 -5
  292. package/server/dist/builtin-plugins/provider-retry/dist/server.meta.json +1 -1
  293. package/server/dist/builtin-plugins/provider-usage/dist/app.meta.json +1 -1
  294. package/server/dist/builtin-plugins/provider-usage/dist/server.js +6 -6
  295. package/server/dist/builtin-plugins/provider-usage/dist/server.meta.json +1 -1
  296. package/server/dist/builtin-plugins/push-notifications/dist/app.meta.json +1 -1
  297. package/server/dist/builtin-plugins/push-notifications/dist/server.js +5 -5
  298. package/server/dist/builtin-plugins/push-notifications/dist/server.meta.json +1 -1
  299. package/server/dist/builtin-plugins/scheduled-send/dist/app.meta.json +1 -1
  300. package/server/dist/builtin-plugins/scheduled-send/dist/server.js +1 -1
  301. package/server/dist/builtin-plugins/scheduled-send/dist/server.meta.json +1 -1
  302. package/server/dist/builtin-plugins/secrets/dist/app.meta.json +1 -1
  303. package/server/dist/builtin-plugins/secrets/dist/server.js +3 -3
  304. package/server/dist/builtin-plugins/secrets/dist/server.meta.json +1 -1
  305. package/server/dist/builtin-plugins/side-chat/dist/app.meta.json +1 -1
  306. package/server/dist/builtin-plugins/side-chat/dist/server.js +2 -2
  307. package/server/dist/builtin-plugins/side-chat/dist/server.meta.json +1 -1
  308. package/server/dist/builtin-plugins/tasks/dist/app.meta.json +1 -1
  309. package/server/dist/builtin-plugins/tasks/dist/server.js +24 -24
  310. package/server/dist/builtin-plugins/tasks/dist/server.meta.json +1 -1
  311. package/server/dist/builtin-plugins/theme-preview/dist/app.meta.json +1 -1
  312. package/server/dist/builtin-plugins/theme-preview/dist/server.js +2 -2
  313. package/server/dist/builtin-plugins/theme-preview/dist/server.meta.json +1 -1
  314. package/server/dist/builtin-plugins/workflows/dist/app.meta.json +1 -1
  315. package/server/dist/builtin-plugins/workflows/dist/server.js +22 -22
  316. package/server/dist/builtin-plugins/workflows/dist/server.meta.json +1 -1
  317. package/app/dist/assets/AppFileExternalNavigationDispatcher-BjNBScqR.js.br +0 -0
  318. package/app/dist/assets/AppFileExternalNavigationDispatcher-BjNBScqR.js.gz +0 -0
  319. package/app/dist/assets/BbDiff-12uz9IAX.js.br +0 -0
  320. package/app/dist/assets/BbDiff-12uz9IAX.js.gz +0 -0
  321. package/app/dist/assets/BbSourceCode-B5ByV-FS.js.br +0 -0
  322. package/app/dist/assets/BbSourceCode-B5ByV-FS.js.gz +0 -0
  323. package/app/dist/assets/BrowserTabDeck-CVRIa1t8.js.br +0 -0
  324. package/app/dist/assets/BrowserTabDeck-CVRIa1t8.js.gz +0 -0
  325. package/app/dist/assets/DiffHost-BMW3ydFS.js.br +0 -0
  326. package/app/dist/assets/DiffHost-BMW3ydFS.js.gz +0 -0
  327. package/app/dist/assets/ExperimentalFileLinkMenu-4-BPBhuh.js.br +0 -0
  328. package/app/dist/assets/ExperimentalFileLinkMenu-4-BPBhuh.js.gz +0 -0
  329. package/app/dist/assets/FilePreview-BLUhIkKE.js.br +0 -0
  330. package/app/dist/assets/FilePreview-BLUhIkKE.js.gz +0 -0
  331. package/app/dist/assets/GitDiffCardHeader-EEoiwhTP.js.br +0 -0
  332. package/app/dist/assets/GitDiffCardHeader-EEoiwhTP.js.gz +0 -0
  333. package/app/dist/assets/MachineRenameDialog-D5punQm7.js.br +0 -0
  334. package/app/dist/assets/MachineRenameDialog-D5punQm7.js.gz +0 -0
  335. package/app/dist/assets/MachineSettingsView-BB8sWZCY.js.br +0 -0
  336. package/app/dist/assets/MachineSettingsView-BB8sWZCY.js.gz +0 -0
  337. package/app/dist/assets/NewTabPage-BF31qJOv.js.br +0 -0
  338. package/app/dist/assets/NewTabPage-BF31qJOv.js.gz +0 -0
  339. package/app/dist/assets/OptionPicker-CS_rzYKC.js.br +0 -0
  340. package/app/dist/assets/OptionPicker-CS_rzYKC.js.gz +0 -0
  341. package/app/dist/assets/PaneMaximizeButton-BX9O85-9.js.br +0 -0
  342. package/app/dist/assets/PaneMaximizeButton-BX9O85-9.js.gz +0 -0
  343. package/app/dist/assets/PierreLineSelectionActions-Dv6SPPb_.js.br +0 -0
  344. package/app/dist/assets/PierreLineSelectionActions-Dv6SPPb_.js.gz +0 -0
  345. package/app/dist/assets/PluginPanelActions-Brw0eTmm.js.br +0 -0
  346. package/app/dist/assets/PluginPanelActions-Brw0eTmm.js.gz +0 -0
  347. package/app/dist/assets/PluginPanelRightPanelHost-heDcnHb6.js.br +0 -0
  348. package/app/dist/assets/PluginPanelRightPanelHost-heDcnHb6.js.gz +0 -0
  349. package/app/dist/assets/ProjectDetailSettingsView-D_Vdu2ce.js.br +0 -0
  350. package/app/dist/assets/ProjectDetailSettingsView-D_Vdu2ce.js.gz +0 -0
  351. package/app/dist/assets/ProjectMachineSetupDialog-BY8TrS7P.js.br +0 -0
  352. package/app/dist/assets/ProjectMachineSetupDialog-BY8TrS7P.js.gz +0 -0
  353. package/app/dist/assets/ProjectsSettingsSection-DMgbOzi0.js.br +0 -0
  354. package/app/dist/assets/ProjectsSettingsSection-DMgbOzi0.js.gz +0 -0
  355. package/app/dist/assets/SecondaryPanelLayout-DK9e6Wvw.js.br +0 -0
  356. package/app/dist/assets/SecondaryPanelLayout-DK9e6Wvw.js.gz +0 -0
  357. package/app/dist/assets/SettingsView-Dba7HBKl.js.br +0 -0
  358. package/app/dist/assets/SettingsView-Dba7HBKl.js.gz +0 -0
  359. package/app/dist/assets/SourceCodeHost-kd2wce0c.js.br +0 -0
  360. package/app/dist/assets/SourceCodeHost-kd2wce0c.js.gz +0 -0
  361. package/app/dist/assets/SplitWorkspaceRoute-DRdQCrgp.js.br +0 -0
  362. package/app/dist/assets/SplitWorkspaceRoute-DRdQCrgp.js.gz +0 -0
  363. package/app/dist/assets/ThreadSearchPaletteMode-BG5X0DsN.js.br +0 -0
  364. package/app/dist/assets/ThreadSearchPaletteMode-BG5X0DsN.js.gz +0 -0
  365. package/app/dist/assets/ThreadSecondaryPanel-BWsbxGu_.js.br +0 -0
  366. package/app/dist/assets/ThreadSecondaryPanel-BWsbxGu_.js.gz +0 -0
  367. package/app/dist/assets/ThreadSecondaryPanelTabContent-Hw4tkdnw.js.br +0 -0
  368. package/app/dist/assets/ThreadSecondaryPanelTabContent-Hw4tkdnw.js.gz +0 -0
  369. package/app/dist/assets/ThreadStorageFileTree-sMfYZ-yr.js.br +0 -0
  370. package/app/dist/assets/ThreadStorageFileTree-sMfYZ-yr.js.gz +0 -0
  371. package/app/dist/assets/ThreadTerminalPanel-D8GLBGQ6.js.br +0 -0
  372. package/app/dist/assets/ThreadTerminalPanel-D8GLBGQ6.js.gz +0 -0
  373. package/app/dist/assets/TimelineDetailScroll-CJxHbZ11.js.br +0 -0
  374. package/app/dist/assets/TimelineDetailScroll-CJxHbZ11.js.gz +0 -0
  375. package/app/dist/assets/TimelineFileDiffBlock-D0UsFk6L.js.br +0 -0
  376. package/app/dist/assets/TimelineFileDiffBlock-D0UsFk6L.js.gz +0 -0
  377. package/app/dist/assets/TimelineSelectionMenu-tjYTa_Nz.js.br +0 -0
  378. package/app/dist/assets/TimelineSelectionMenu-tjYTa_Nz.js.gz +0 -0
  379. package/app/dist/assets/ToolsView-oVQgCd9D.js.br +0 -0
  380. package/app/dist/assets/ToolsView-oVQgCd9D.js.gz +0 -0
  381. package/app/dist/assets/absolute-file-path-B8rvpN6h.js.br +0 -0
  382. package/app/dist/assets/absolute-file-path-B8rvpN6h.js.gz +0 -0
  383. package/app/dist/assets/browser-url-DBXpmDyy.js.br +0 -0
  384. package/app/dist/assets/browser-url-DBXpmDyy.js.gz +0 -0
  385. package/app/dist/assets/code-loading-skeletons-BSCBLTPn.js.br +0 -0
  386. package/app/dist/assets/code-loading-skeletons-BSCBLTPn.js.gz +0 -0
  387. package/app/dist/assets/environment-queries-CPfRGBmD.js.br +0 -0
  388. package/app/dist/assets/environment-queries-CPfRGBmD.js.gz +0 -0
  389. package/app/dist/assets/file-path-link-Cj-hPyCZ.js.br +0 -0
  390. package/app/dist/assets/file-path-link-Cj-hPyCZ.js.gz +0 -0
  391. package/app/dist/assets/host-mutations-B97HiIxn.js.br +0 -0
  392. package/app/dist/assets/host-mutations-B97HiIxn.js.gz +0 -0
  393. package/app/dist/assets/icon-extended-EN13GZdT.js.br +0 -0
  394. package/app/dist/assets/icon-extended-EN13GZdT.js.gz +0 -0
  395. package/app/dist/assets/index-C5R2EQf4.js.br +0 -0
  396. package/app/dist/assets/index-C5R2EQf4.js.gz +0 -0
  397. package/app/dist/assets/launcherRow-jBXN_s_6.js.br +0 -0
  398. package/app/dist/assets/launcherRow-jBXN_s_6.js.gz +0 -0
  399. package/app/dist/assets/machine-provider-queries-DKwDoXks.js.br +0 -0
  400. package/app/dist/assets/machine-provider-queries-DKwDoXks.js.gz +0 -0
  401. package/app/dist/assets/markdown-preview-DHAQdwAu.js.br +0 -0
  402. package/app/dist/assets/markdown-preview-DHAQdwAu.js.gz +0 -0
  403. package/app/dist/assets/open-in-editor-button-EKbyr9fS.js.gz +0 -0
  404. package/app/dist/assets/page-shell-DHP7X_Rt.js.br +0 -0
  405. package/app/dist/assets/page-shell-DHP7X_Rt.js.gz +0 -0
  406. package/app/dist/assets/pierre-worker-pool-DddCdbqT.js.br +0 -0
  407. package/app/dist/assets/pierre-worker-pool-DddCdbqT.js.gz +0 -0
  408. package/app/dist/assets/plugin-catalog-queries-mWlJEp8o.js.br +0 -0
  409. package/app/dist/assets/plugin-catalog-queries-mWlJEp8o.js.gz +0 -0
  410. package/app/dist/assets/plugin-detail-navigation-BvnYG1vG.js.br +0 -0
  411. package/app/dist/assets/plugin-detail-navigation-BvnYG1vG.js.gz +0 -0
  412. package/app/dist/assets/plugin-frontend-BZy0QzmI.js.br +0 -0
  413. package/app/dist/assets/plugin-frontend-BZy0QzmI.js.gz +0 -0
  414. package/app/dist/assets/project-default-execution-options-query-BXYO-hGv.js.br +0 -0
  415. package/app/dist/assets/project-default-execution-options-query-BXYO-hGv.js.gz +0 -0
  416. package/app/dist/assets/resource-list-D_oVsoA6.js.br +0 -0
  417. package/app/dist/assets/resource-list-D_oVsoA6.js.gz +0 -0
  418. package/app/dist/assets/root-compose-create-preference-DCx3CWwe.js.br +0 -0
  419. package/app/dist/assets/root-compose-create-preference-DCx3CWwe.js.gz +0 -0
  420. package/app/dist/assets/settings-section-BEqzIulW.js.br +0 -0
  421. package/app/dist/assets/settings-section-BEqzIulW.js.gz +0 -0
  422. package/app/dist/assets/thread-terminal-queries-y6HeNWQc.js.br +0 -0
  423. package/app/dist/assets/thread-terminal-queries-y6HeNWQc.js.gz +0 -0
  424. package/app/dist/assets/threadRecentItems-DBmfDN5s.js.br +0 -0
  425. package/app/dist/assets/threadRecentItems-DBmfDN5s.js.gz +0 -0
  426. package/app/dist/assets/use-hover-popover-BUPmV7Lx.js.br +0 -0
  427. package/app/dist/assets/use-hover-popover-BUPmV7Lx.js.gz +0 -0
  428. package/app/dist/assets/useLocalOpenTargets-CDHNvnze.js.br +0 -0
  429. package/app/dist/assets/useLocalOpenTargets-CDHNvnze.js.gz +0 -0
  430. package/app/dist/assets/usePathSuggestions-Dhrastgl.js.br +0 -0
  431. package/app/dist/assets/usePathSuggestions-Dhrastgl.js.gz +0 -0
  432. package/app/dist/assets/useResolvedLiveFileTarget-Ds5mNteC.js.br +0 -0
  433. package/app/dist/assets/useResolvedLiveFileTarget-Ds5mNteC.js.gz +0 -0
  434. package/app/dist/assets/useThreadTerminalController-BBSkeWRP.js.br +0 -0
  435. package/app/dist/assets/useThreadTerminalController-BBSkeWRP.js.gz +0 -0
  436. package/app/dist/assets/workspace-checkout-display-1eTCIlDv.js.br +0 -0
  437. package/app/dist/assets/workspace-checkout-display-1eTCIlDv.js.gz +0 -0
@@ -1,7 +1,7 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$r as t,Ai as n,Gr as r,Zr as i,a,ai as o,bi as s,d as c,hi as l,hn as u,ii as d,o as f,pi as p,si as m,ti as h,u as g,yi as _}from"./boot-vendor-DmI63oXH.js";import{G as v,K as y,W as b,ct as x,lt as S}from"./workspace-checkout-display-1eTCIlDv.js";import{$ as C,$a as w,$r as T,A as E,Aa as D,An as O,Ao as k,Bp as A,Bu as j,C as M,Ca as N,Ch as P,Cm as F,Cu as I,D as L,Dh as R,Dm as z,Em as B,F as V,Fa as H,G as U,Ga as W,Gl as G,Go as K,Ia as q,It as ee,Iu as te,J as ne,Jo as re,Kn as ie,Ku as ae,L as oe,Ln as se,Lu as ce,M as le,Ma as ue,N as de,Na as fe,Nn as pe,O as me,Om as he,On as ge,Pa as _e,Qa as ve,Qu as ye,S as be,Sa as xe,Sm as Se,Ss as Ce,Su as we,T as Te,Tm as Ee,To as De,U as Oe,Uc as ke,Ui as Ae,Um as je,Vi as Me,Vp as Ne,W as Pe,Wi as Fe,X as Ie,Xo as Le,Y as Re,Ym as ze,Yu as Be,Z as Ve,_ as He,_m as Ue,_o as We,_r as Ge,_t as Ke,am as qe,at as Je,bm as Ye,bo as Xe,c as Ze,ca as Qe,ci as $e,dh as et,di as tt,do as nt,dt as rt,eo as it,et as at,ft as ot,g as st,gh as ct,gi as lt,go as ut,gr as dt,h as ft,hh as pt,hi as mt,ht,i as gt,ih as J,ii as _t,io as vt,ir as yt,it as bt,ja as xt,kn as St,li as Ct,lt as wt,m as Tt,mh as Et,na as Dt,nr as Ot,nt as kt,om as At,or as jt,ph as Mt,pi as Nt,pl as Pt,pt as Ft,pu as It,q as Lt,qu as Rt,ra as zt,rt as Bt,si as Vt,ss as Ht,ta as Ut,ti as Wt,tt as Gt,ut as Kt,vm as qt,vn as Jt,vt as Yt,wa as Xt,wm as Zt,wo as Qt,wu as $t,y as en,zu as tn}from"./index-C5R2EQf4.js";import{a as nn,i as rn,n as an,o as on,r as sn}from"./useLocalOpenTargets-CDHNvnze.js";import{t as cn}from"./index.browser-BTPGjbbX.js";import{t as ln}from"./file-opener-preference-CNU-2AX-.js";import{t as un}from"./OptionPicker-CS_rzYKC.js";import{d as dn,o as fn,s as pn,t as mn}from"./plugin-catalog-queries-mWlJEp8o.js";import{i as hn,r as gn}from"./code-rendering-DpMXklPX.js";import{b as _n,n as vn}from"./markdown-preview-DHAQdwAu.js";import{s as yn,t as bn}from"./page-shell-DHP7X_Rt.js";import{n as xn}from"./project-default-execution-options-query-BXYO-hGv.js";import{r as Sn,t as Cn}from"./machine-provider-queries-DKwDoXks.js";import{C as wn,T as Tn,_ as En,d as Dn,p as On,v as kn,w as An,x as jn,y as Mn}from"./resource-list-D_oVsoA6.js";import{a as Nn,c as Pn,i as Fn,n as In,r as Ln,s as Rn,t as zn}from"./MachineRenameDialog-D5punQm7.js";import{a as Bn,i as Vn,n as Hn,o as Un,r as Wn}from"./host-mutations-B97HiIxn.js";import{a as Y,i as Gn,o as X,r as Kn,t as qn}from"./settings-section-BEqzIulW.js";import{a as Jn,c as Yn,d as Xn,f as Zn,i as Qn,l as $n,o as er,p as tr,t as nr,u as rr}from"./ProjectsSettingsSection-DMgbOzi0.js";import"./icon-extended-EN13GZdT.js";import{i as ir,n as ar,r as or,t as sr}from"./root-compose-create-preference-DCx3CWwe.js";import{PluginDetailPaneView as cr,a as lr,i as ur,n as dr,o as fr,r as pr,t as mr}from"./ToolsView-oVQgCd9D.js";var Z=i(),Q=e(n(),1),$=e(s(),1);function hr(e){try{return new URL(e)}catch{return null}}function gr(){let e=Xe(),t=Zn(),n=e.data?.generalSettings,r=e.data?.serverAccess,i=n?.machineServerUrl??``,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l=!n||t.isPending,u=r?.defaultProviderId??`direct`,[d,f]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{d===u&&f(null)},[u,d]);let p=d??u;return{access:r,disabled:l,draft:a,error:s,effective:r?.providers.find(e=>e.id===p),configurationMessage:v(r,p),saving:t.isPending,selected:p,value:i,editDraft:e=>{o(e),c(null)},selectProvider:e=>{!n||e===p||(f(e),t.mutate({...n,defaultMachineAccess:e},{onError:()=>f(null)}))},commitUrl:async()=>{if(!n||a===null)return;let e=a.trim();if(e){let t=hr(e);if(t===null||![`http:`,`https:`].includes(t.protocol)||t.username||t.password){c(`Enter a valid HTTP or HTTPS URL without credentials`);return}if(Qe(e)){c(`Other machines cannot reach localhost. Use a domain or shared-network address.`);return}}try{await t.mutateAsync({...n,machineServerUrl:e||null})}catch(e){c(De({error:e,fallbackMessage:`Couldn't save the address.`}));return}o(null),c(null)}}}function _r(){let e=(0,Z.c)(2),t=gr(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(vr,{machineAccess:t}),e[0]=t,e[1]=n),n}function vr(e){let t=(0,Z.c)(7),{machineAccess:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(xr,{machineAccess:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=(0,$.jsx)(Cr,{machineAccess:n}),t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,$.jsx)(Y,{title:`Machine access`,description:`Choose how new machines connect to the bb server.`,action:r,bodyClassName:`space-y-3`,children:i}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function yr(e){let t=(0,Z.c)(3),{onNavigate:n}=e,r=gr(),i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(br,{machineAccess:r,onNavigate:n}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function br(e){let t=(0,Z.c)(9),{machineAccess:n,onNavigate:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`span`,{className:`text-sm font-normal text-foreground`,children:`Connection method`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(xr,{machineAccess:n})]}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=(0,$.jsx)(Cr,{machineAccess:n,onNavigate:r}),t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function xr(e){let t=(0,Z.c)(9),{machineAccess:n}=e,{access:r,disabled:i,selected:a}=n,o;t[0]===r?.providers?o=t[1]:(o=r?.providers??[],t[0]=r?.providers,t[1]=o);let s;t[2]===o?s=t[3]:(s=o.map(Sr),t[2]=o,t[3]=s);let c;return t[4]!==i||t[5]!==n.selectProvider||t[6]!==a||t[7]!==s?(c=(0,$.jsx)(un,{modal:!1,label:`Connection method`,value:a,disabled:i,showChevronWhenDisabled:!0,align:`end`,options:s,onChange:n.selectProvider}),t[4]=i,t[5]=n.selectProvider,t[6]=a,t[7]=s,t[8]=c):c=t[8],c}function Sr(e){return{value:e.id,label:e.displayName,description:e.description}}function Cr(e){let n=(0,Z.c)(22),{machineAccess:r,onNavigate:i}=e,{access:a,configurationMessage:o,disabled:s,draft:c,effective:l,error:u,saving:d,selected:f,value:p}=r,m=o===null,h;n[0]!==o||n[1]!==l||n[2]!==i||n[3]!==m||n[4]!==f?(h=f!==`direct`&&l!==void 0&&(0,$.jsx)(`div`,{className:`@container`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 @lg:flex-row @lg:items-center @lg:justify-between @lg:gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1 @lg:flex-1`,children:[(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium`,children:[m?(0,$.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-success`,"aria-hidden":`true`}):null,m?`Ready`:l.availability?.status===`unavailable`?`Unavailable`:`Needs configuration`]}),(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:o??(l.availability?.status===`available`?l.availability.serverUrl:null)??`Ready to add machines.`})]}),l.pluginId!==null&&(0,$.jsx)(J,{variant:m?`outline`:`default`,size:`sm`,className:`w-full @lg:w-auto`,asChild:!0,children:(0,$.jsxs)(t,{onClick:i,to:tn({pluginId:l.pluginId}),children:[m?`Manage`:`Set up ${l.displayName}`,(0,$.jsx)(P,{name:`ArrowRight`})]})})]})}),n[0]=o,n[1]=l,n[2]=i,n[3]=m,n[4]=f,n[5]=h):h=n[5];let g;n[6]!==l||n[7]!==f?(g=f!==`direct`&&l===void 0&&(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:`This connection method is not installed.`}),n[6]=l,n[7]=f,n[8]=g):g=n[8];let _;n[9]!==a?.effectiveUrl||n[10]!==s||n[11]!==c||n[12]!==u||n[13]!==r||n[14]!==d||n[15]!==f||n[16]!==p?(_=f===`direct`&&(0,$.jsx)(X,{label:`Server address`,description:u===null?`Use your own domain or an address on a shared network. Every machine you add must be able to reach this address; localhost won’t work.`:(0,$.jsx)(`span`,{role:`alert`,className:`text-destructive-text`,children:u}),controlPlacement:`below`,children:(0,$.jsxs)(`div`,{className:`flex max-w-xl flex-wrap items-center gap-2`,children:[(0,$.jsx)($e,{className:`min-w-0 flex-1 basis-48`,"aria-label":`Server address`,"aria-invalid":u!==null,value:c??p,placeholder:a?.effectiveUrl??`https://bb.example.com`,disabled:s,onChange:e=>r.editDraft(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r.commitUrl()}}),(0,$.jsx)(J,{variant:`outline`,className:`h-9 max-md:pointer-coarse:h-10`,disabled:s||c===null||c.trim()===p,onClick:()=>void r.commitUrl(),children:d?`Saving…`:`Save`})]})}),n[9]=a?.effectiveUrl,n[10]=s,n[11]=c,n[12]=u,n[13]=r,n[14]=d,n[15]=f,n[16]=p,n[17]=_):_=n[17];let v;return n[18]!==h||n[19]!==g||n[20]!==_?(v=(0,$.jsxs)($.Fragment,{children:[h,g,_]}),n[18]=h,n[19]=g,n[20]=_,n[21]=v):v=n[21],v}function wr(){Tt(),He(),be()}function Tr(e){ft(st(e)),en(e.resolvedCodeTheme),be()}function Er(){let e=(0,Z.c)(4),t=_(),n=(0,Q.useRef)(0),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>()=>{n.current+=1,wr()},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={prefetchThemes(e){for(let n of e)t.prefetchQuery(ut(n))},previewTheme(e){n.current+=1;let r=n.current;if(e===null){wr();return}t.fetchQuery(ut(e)).then(e=>{n.current===r&&Tr(e)},Dr)}},e[2]=t,e[3]=a),a}function Dr(){}function Or(e,t){if(t===null||e.length!==t.length||e.some(e=>!t.includes(e.id)))return e;let n=new Map(e.map(e=>[e.id,e]));return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[t]})}function kr(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1||r===i?null:f([...e],r,i)}function Ar(e,t,n){let r=Object.fromEntries(Object.entries(e.providerCompletedTurnDisplay).filter(([e])=>e!==t.id));return{...e,providerCompletedTurnDisplay:n===t.completedTurnDisplay?r:{...r,[t.id]:n}}}function jr(e){let t=(0,Z.c)(3),{provider:n}=e,r=U(`agent`,n.id,n)?.icon,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(`span`,{className:`flex size-5 items-center justify-center`,children:r?(0,$.jsx)(Pe,{provider:n,icon:r,className:ze}):(0,$.jsx)(P,{name:`Zap`,className:`text-muted-foreground`})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Mr(e){let t=(0,Z.c)(28),{disabled:n,generalSettings:r,index:i,onGeneralSettingsChange:a,provider:o}=e,s;t[0]!==n||t[1]!==o.displayName||t[2]!==o.id?(s={id:o.id,disabled:n,label:o.displayName},t[0]=n,t[1]=o.displayName,t[2]=o.id,t[3]=s):s=t[3];let{setNodeRef:c,style:l,isDragging:u,handle:d}=Jn(s),f=r.defaultProviderId===o.id||r.defaultProviderId===null&&i===0,p=u&&`relative z-10 rounded-md bg-card opacity-90 shadow-lift`,m;t[4]===p?m=t[5]:(m=R(`group/provider-row`,p),t[4]=p,t[5]=m);let h;t[6]===o?h=t[7]:(h=(0,$.jsx)(jr,{provider:o}),t[6]=o,t[7]=h);let g;t[8]===o.displayName?g=t[9]:(g=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:o.displayName}),t[8]=o.displayName,t[9]=g);let _;t[10]===o.available?_=t[11]:(_=o.available?null:(0,$.jsx)(qn,{children:`Unavailable`}),t[10]=o.available,t[11]=_);let v;t[12]!==n||t[13]!==r||t[14]!==f||t[15]!==a||t[16]!==o.available||t[17]!==o.id?(v=f?(0,$.jsx)(qn,{children:`Default`}):(0,$.jsx)(J,{variant:`ghost`,size:`sm`,disabled:n||!o.available,onClick:()=>a({...r,defaultProviderId:o.id}),children:`Make default`}),t[12]=n,t[13]=r,t[14]=f,t[15]=a,t[16]=o.available,t[17]=o.id,t[18]=v):v=t[18];let y;return t[19]!==d||t[20]!==c||t[21]!==l||t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==_||t[26]!==v?(y=(0,$.jsxs)(Kn,{ref:c,style:l,className:m,children:[d,h,g,_,v]}),t[19]=d,t[20]=c,t[21]=l,t[22]=m,t[23]=h,t[24]=g,t[25]=_,t[26]=v,t[27]=y):y=t[27],y}function Nr(e){let t=(0,Z.c)(17),{disabled:n,generalSettings:r,onGeneralSettingsChange:i,provider:a}=e,o=r.providerCompletedTurnDisplay[a.id]??a.completedTurnDisplay,s;t[0]===a?s=t[1]:(s=(0,$.jsx)(jr,{provider:a}),t[0]=a,t[1]=s);let c;t[2]===a.displayName?c=t[3]:(c=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:a.displayName}),t[2]=a.displayName,t[3]=c);let l=o===`collapse`,u=`Collapse finished ${a.displayName} turns`,d;t[4]!==r||t[5]!==i||t[6]!==a?(d=e=>i(Ar(r,a,e?`collapse`:`flat`)),t[4]=r,t[5]=i,t[6]=a,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,$.jsx)(xn,{checked:l,disabled:n,"aria-label":u,onCheckedChange:d}),t[8]=n,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==s||t[14]!==c||t[15]!==f?(p=(0,$.jsxs)(Kn,{children:[s,c,f]}),t[13]=s,t[14]=c,t[15]=f,t[16]=p):p=t[16],p}function Pr(e){let t=(0,Z.c)(5),{disabled:n,generalSettings:r,onGeneralSettingsChange:i}=e,a=Qt(),o=a.data??[],[s,c]=(0,Q.useState)(null),l=Or(o,s),u=l.map(Ir),d=a.isPending?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading providers…`}):l.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agent provider is enabled. Enable a provider plugin under Plugins.`}):(0,$.jsx)(Qn,{ids:u,disabled:n,onReorder:(e,t)=>{let n=kr(u,e,t);if(n===null)return;c(n);let a;try{a=i({...r,providerOrder:n})}catch{c(null);return}Promise.resolve(a).catch(Fr).finally(()=>c(null))},children:l.map((e,t)=>(0,$.jsx)(Mr,{disabled:n,generalSettings:r,index:t,onGeneralSettingsChange:i,provider:e},e.id))}),f;t[0]===d?f=t[1]:(f=(0,$.jsx)(Y,{title:`Providers`,description:`Set the default agent and its order in provider pickers. Configure each provider on its plugin page under Plugins.`,children:d}),t[0]=d,t[1]=f);let p=l.length===0?null:(0,$.jsx)(Y,{title:`Collapse finished turns`,description:`When a turn finishes, fold its work into one Worked for row and keep the final answer visible. Turn a provider off to keep every step of its finished turns visible.`,children:(0,$.jsx)(Gn,{children:l.map(e=>(0,$.jsx)(Nr,{disabled:n,generalSettings:r,onGeneralSettingsChange:i,provider:e},e.id))})}),m;return t[2]!==f||t[3]!==p?(m=(0,$.jsxs)($.Fragment,{children:[f,p]}),t[2]=f,t[3]=p,t[4]=m):m=t[4],m}function Fr(){}function Ir(e){return e.id}function Lr(e){let t=(0,Z.c)(29),{label:n,description:i,triggerAriaLabel:a,builtInDescription:o,preferenceAtom:s,slots:c}=e,[l,u]=r(s),d=c[0];if(d===void 0)return null;let f;t[0]===o?f=t[1]:(f={key:Ft,title:`bb (built-in)`,description:o},t[0]=o,t[1]=f);let p=f,m=`Currently using ${d.title} from ${d.pluginId}.`,h;t[2]===m?h=t[3]:(h={key:ot,title:`Automatic`,description:m},t[2]=m,t[3]=h);let g;t[4]!==p||t[5]!==c||t[6]!==h?(g=[h,p,...c.map(Rr)],t[4]=p,t[5]=c,t[6]=h,t[7]=g):g=t[7];let _=g,v;t[8]!==p||t[9]!==_||t[10]!==l?(v=_.find(e=>e.key===l)??p,t[8]=p,t[9]=_,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]===y.title?b=t[13]:(b=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:y.title}),t[12]=y.title,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[14]=x):x=t[14];let S;t[15]!==b||t[16]!==a?(S=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:`min-w-40 justify-between`,"aria-label":a,children:[b,x]})}),t[15]=b,t[16]=a,t[17]=S):S=t[17];let C;t[18]!==_||t[19]!==y.key||t[20]!==u?(C=(0,$.jsx)(tt,{align:`end`,className:`w-72`,children:_.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>u(e.key),className:`flex items-start gap-2`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.title}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.description})]}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto mt-0.5`,y.key!==e.key&&`opacity-0`,ze)})]},e.key))}),t[18]=_,t[19]=y.key,t[20]=u,t[21]=C):C=t[21];let w;t[22]!==S||t[23]!==C?(w=(0,$.jsxs)(Ct,{children:[S,C]}),t[22]=S,t[23]=C,t[24]=w):w=t[24];let T;return t[25]!==i||t[26]!==n||t[27]!==w?(T=(0,$.jsx)(X,{label:n,description:i,children:w}),t[25]=i,t[26]=n,t[27]=w,t[28]=T):T=t[28],T}function Rr(e){return{key:ht(e),title:e.title,description:e.description??`From the ${e.pluginId} plugin.`}}function zr(){let e=(0,Z.c)(7),{sourceCodeRenderers:t,diffRenderers:n}=nt(),r;e[0]===t?r=e[1]:(r=(0,$.jsx)(Lr,{label:`Source code`,triggerAriaLabel:`Source code`,description:`Choose automatic activation, BB's viewer, or a specific plugin on this device.`,builtInDescription:`Syntax highlighting and gutters from the bb code theme.`,preferenceAtom:hn,slots:t}),e[0]=t,e[1]=r);let i;e[2]===n?i=e[3]:(i=(0,$.jsx)(Lr,{label:`Diffs`,triggerAriaLabel:`Diffs`,description:`Applies to file diffs in threads, the diff panel, and plugin views.`,builtInDescription:`Unified and split diffs from the bb code theme.`,preferenceAtom:gn,slots:n}),e[2]=n,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,$.jsxs)($.Fragment,{children:[r,i]}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}function Br(){let e=(0,Z.c)(2),{threadLists:t}=nt(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Lr,{label:`Sidebar`,triggerAriaLabel:`Sidebar thread list`,description:`Choose automatic activation, BB's list, or a specific plugin on this device.`,builtInDescription:`Projects, sections, and nested threads.`,preferenceAtom:rt,slots:t}),e[0]=t,e[1]=n),n}function Vr(){let e=(0,Z.c)(15),t=Kt(),n;e[0]===t?n=e[1]:(n={onDragEnd(e){typeof e.active.id==`string`&&typeof e.over?.id==`string`&&t.move(e.active.id,e.over.id)}},e[0]=t,e[1]=n);let{dndContextProps:r,onClickCapture:i}=Jt(n),o;e[2]===t.items?o=e[3]:(o=t.items.map(Hr),e[2]=t.items,e[3]=o);let s;e[4]===t?s=e[5]:(s=t.items.map(e=>(0,$.jsx)(Ur,{item:e,visible:!t.hidden.includes(e.key),onVisibleChange:n=>t.setVisible(e.key,n)},e.key)),e[4]=t,e[5]=s);let l;e[6]!==o||e[7]!==s?(l=(0,$.jsx)(a,{items:o,strategy:g,children:s}),e[6]=o,e[7]=s,e[8]=l):l=e[8];let u;e[9]!==r||e[10]!==l?(u=(0,$.jsx)(c,{...r,children:l}),e[9]=r,e[10]=l,e[11]=u):u=e[11];let d;return e[12]!==i||e[13]!==u?(d=(0,$.jsx)(X,{label:`Sidebar footer`,description:`Drag to reorder. Hidden actions remain available in the footer’s More menu.`,controlPlacement:`below`,children:(0,$.jsx)(`div`,{className:`rounded-md border border-border`,onClickCapture:i,children:u})}),e[12]=i,e[13]=u,e[14]=d):d=e[14],d}function Hr(e){return e.key}function Ur({item:e,visible:t,onVisibleChange:n}){let{dragBindings:r,setNodeRef:i,style:a}=ee({id:e.key,disabled:!1});return(0,$.jsxs)(`div`,{ref:i,style:a,className:`flex items-center gap-2 border-b border-border px-2 py-2 last:border-b-0`,"data-footer-setting":e.key,children:[(0,$.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-7 touch-none text-muted-foreground`,ref:r.setActivatorNodeRef,...r.attributes,...r.listeners,"aria-label":`Reorder ${e.label}`,children:(0,$.jsx)(P,{name:`DragDropVertical`,className:`size-4`})}),(0,$.jsx)(wt,{item:e}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.label}),(0,$.jsx)(xn,{checked:t,onCheckedChange:n,"aria-label":`Show ${e.label} in footer`})]})}function Wr(){let e=(0,Z.c)(2),{experimentalSidebarNavigations:t}=nt(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Lr,{label:`Navigation`,triggerAriaLabel:`Sidebar navigation`,description:`Choose who arranges the host-owned sidebar destinations on this device.`,builtInDescription:`Native New thread, Search, Plugins, Skills, and plugin panels.`,preferenceAtom:L,slots:t}),e[0]=t,e[1]=n),n}var Gr=`Fade inactive splits`;function Kr(){let e=(0,Z.c)(3),[t,n]=r(G),i;return e[0]!==t||e[1]!==n?(i=(0,$.jsx)(X,{label:Gr,description:`Fade out splits that do not have focus.`,children:(0,$.jsx)(xn,{checked:t,onCheckedChange:n,"aria-label":Gr})}),e[0]=t,e[1]=n,e[2]=i):i=e[2],i}function qr(e){let t=(0,Z.c)(7),{pluginId:n}=e,{settingsSections:r}=nt(),i;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e.pluginId===n,t[3]=n,t[4]=e),i=r.filter(e),t[0]=n,t[1]=r,t[2]=i}else i=t[2];let a=i;if(a.length===0)return null;let o;return t[5]===a?o=t[6]:(o=(0,$.jsx)(Jr,{sections:a}),t[5]=a,t[6]=o),o}function Jr(e){let t=(0,Z.c)(4),{sections:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Yr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`space-y-6`,"data-testid":`plugin-settings-sections`,children:r}),t[2]=r,t[3]=i),i}function Yr(e){let t=`${e.pluginId}/${e.id}/${e.generation}`;return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[e.title===void 0?null:(0,$.jsx)(`h3`,{className:`text-xs font-medium text-foreground`,children:e.title}),e.description===void 0?null:(0,$.jsx)(`p`,{className:`text-xs leading-snug text-subtle-foreground/75`,children:e.description}),(0,$.jsx)(yt,{pluginId:e.pluginId,slotKind:`settingsSection`,slotId:e.id,children:(0,$.jsx)(e.component,{})})]},t)}function Xr(e){let t=(0,Z.c)(4),{pluginId:n}=e,{providers:r}=Cn(),i=Xe().data?.serverAccess;if(!(r??[]).some(e=>e.pluginId===n))return null;let a;t[0]===i?a=t[1]:(a=v(i),t[0]=i,t[1]=a);let o;return t[2]===a?o=t[3]:(o=(0,$.jsx)(Zr,{reason:a}),t[2]=a,t[3]=o),o}function Zr(e){let n=(0,Z.c)(8),{reason:r}=e;if(r===null)return null;let i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(P,{name:`AlertTriangle`,className:`mt-0.5 size-3.5 shrink-0 text-warning-text`,"aria-hidden":!0}),n[0]=i):i=n[0];let a;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:b}),n[1]=a):a=n[1];let o;n[2]===r?o=n[3]:(o=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[i,(0,$.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-snug text-subtle-foreground`,children:r})]})]}),n[2]=r,n[3]=o);let s;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Be(`machines`),n[4]=s):s=n[4];let c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(J,{asChild:!0,size:`sm`,variant:`outline`,className:`w-full shrink-0 @md:w-auto`,children:(0,$.jsxs)(t,{to:s,children:[`Set up machine access`,(0,$.jsx)(P,{name:`ArrowRight`})]})}),n[5]=c):c=n[5];let l;return n[6]===o?l=n[7]:(l=(0,$.jsx)(`div`,{className:`@container w-full`,children:(0,$.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-2 rounded-lg border border-border bg-card px-4 py-3 @md:flex-row @md:items-center @md:gap-4`,children:[o,c]})}),n[6]=o,n[7]=l),l}var Qr=`h-7 w-full justify-between border-border/60 bg-card px-2 text-xs sm:w-44`,$r=`min-w-[var(--radix-dropdown-menu-trigger-width)]`,ei=6,ti=24,ni=Symbol(),ri=`max-h-96 min-h-32 w-full resize-y overflow-y-auto font-mono text-xs field-sizing-content`;function ii(e){let t=e.split(`
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$r as t,Ai as n,Gr as r,Zr as i,a,ai as o,bi as s,d as c,hi as l,hn as u,ii as d,o as f,pi as p,si as m,ti as h,u as g,yi as _}from"./boot-vendor-DmI63oXH.js";import{G as v,K as y,W as b,ct as x,lt as S}from"./workspace-checkout-display-Cm0qdHob.js";import{$ as C,$a as w,$r as T,A as E,Aa as D,An as O,Ao as k,Bp as A,Bu as j,C as M,Ca as N,Ch as P,Cm as F,Cu as I,D as L,Dh as R,Dm as z,Em as B,F as V,Fa as H,G as U,Ga as W,Gl as G,Go as K,Ia as q,It as ee,Iu as te,J as ne,Jo as re,Kn as ie,Ku as ae,L as oe,Ln as se,Lu as ce,M as le,Ma as ue,N as de,Na as fe,Nn as pe,O as me,Om as he,On as ge,Pa as _e,Qa as ve,Qu as ye,S as be,Sa as xe,Sm as Se,Ss as Ce,Su as we,T as Te,Tm as Ee,To as De,U as Oe,Uc as ke,Ui as Ae,Um as je,Vi as Me,Vp as Ne,W as Pe,Wi as Fe,X as Ie,Xo as Le,Y as Re,Ym as ze,Yu as Be,Z as Ve,_ as He,_m as Ue,_o as We,_r as Ge,_t as Ke,am as qe,at as Je,bm as Ye,bo as Xe,c as Ze,ca as Qe,ci as $e,dh as et,di as tt,do as nt,dt as rt,eo as it,et as at,ft as ot,g as st,gh as ct,gi as lt,go as ut,gr as dt,h as ft,hh as pt,hi as mt,ht,i as gt,ih as J,ii as _t,io as vt,ir as yt,it as bt,ja as xt,kn as St,li as Ct,lt as wt,m as Tt,mh as Et,na as Dt,nr as Ot,nt as kt,om as At,or as jt,ph as Mt,pi as Nt,pl as Pt,pt as Ft,pu as It,q as Lt,qu as Rt,ra as zt,rt as Bt,si as Vt,ss as Ht,ta as Ut,ti as Wt,tt as Gt,ut as Kt,vm as qt,vn as Jt,vt as Yt,wa as Xt,wm as Zt,wo as Qt,wu as $t,y as en,zu as tn}from"./index-DecRjD4J.js";import{a as nn,i as rn,n as an,o as on,r as sn}from"./useLocalOpenTargets-xKhSZ1ao.js";import{t as cn}from"./index.browser-BTPGjbbX.js";import{t as ln}from"./file-opener-preference-BBzsNdAN.js";import{t as un}from"./OptionPicker-BOubhr2j.js";import{d as dn,o as fn,s as pn,t as mn}from"./plugin-catalog-queries-wLOKJfhz.js";import{i as hn,r as gn}from"./code-rendering-BFjfGlm3.js";import{b as _n,n as vn}from"./markdown-preview-pm-veEGv.js";import{s as yn,t as bn}from"./page-shell-KqI9laXh.js";import{n as xn}from"./project-default-execution-options-query-DgwHHJgk.js";import{r as Sn,t as Cn}from"./machine-provider-queries-3BwQeMu1.js";import{C as wn,T as Tn,_ as En,d as Dn,p as On,v as kn,w as An,x as jn,y as Mn}from"./resource-list-Bjgzb5y2.js";import{a as Nn,c as Pn,i as Fn,n as In,r as Ln,s as Rn,t as zn}from"./MachineRenameDialog-CIVshNWH.js";import{a as Bn,i as Vn,n as Hn,o as Un,r as Wn}from"./host-mutations-DpX66-O1.js";import{a as Y,i as Gn,o as X,r as Kn,t as qn}from"./settings-section-Dl4EomFb.js";import{a as Jn,c as Yn,d as Xn,f as Zn,i as Qn,l as $n,o as er,p as tr,t as nr,u as rr}from"./ProjectsSettingsSection-CWiPZs3X.js";import"./icon-extended-BVbuxg1V.js";import{i as ir,n as ar,r as or,t as sr}from"./root-compose-create-preference-B-HKV5cI.js";import{PluginDetailPaneView as cr,a as lr,i as ur,n as dr,o as fr,r as pr,t as mr}from"./ToolsView-BqBbtO9Q.js";var Z=i(),Q=e(n(),1),$=e(s(),1);function hr(e){try{return new URL(e)}catch{return null}}function gr(){let e=Xe(),t=Zn(),n=e.data?.generalSettings,r=e.data?.serverAccess,i=n?.machineServerUrl??``,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l=!n||t.isPending,u=r?.defaultProviderId??`direct`,[d,f]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{d===u&&f(null)},[u,d]);let p=d??u;return{access:r,disabled:l,draft:a,error:s,effective:r?.providers.find(e=>e.id===p),configurationMessage:v(r,p),saving:t.isPending,selected:p,value:i,editDraft:e=>{o(e),c(null)},selectProvider:e=>{!n||e===p||(f(e),t.mutate({...n,defaultMachineAccess:e},{onError:()=>f(null)}))},commitUrl:async()=>{if(!n||a===null)return;let e=a.trim();if(e){let t=hr(e);if(t===null||![`http:`,`https:`].includes(t.protocol)||t.username||t.password){c(`Enter a valid HTTP or HTTPS URL without credentials`);return}if(Qe(e)){c(`Other machines cannot reach localhost. Use a domain or shared-network address.`);return}}try{await t.mutateAsync({...n,machineServerUrl:e||null})}catch(e){c(De({error:e,fallbackMessage:`Couldn't save the address.`}));return}o(null),c(null)}}}function _r(){let e=(0,Z.c)(2),t=gr(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(vr,{machineAccess:t}),e[0]=t,e[1]=n),n}function vr(e){let t=(0,Z.c)(7),{machineAccess:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(xr,{machineAccess:n}),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=(0,$.jsx)(Cr,{machineAccess:n}),t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,$.jsx)(Y,{title:`Machine access`,description:`Choose how new machines connect to the bb server.`,action:r,bodyClassName:`space-y-3`,children:i}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function yr(e){let t=(0,Z.c)(3),{onNavigate:n}=e,r=gr(),i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(br,{machineAccess:r,onNavigate:n}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function br(e){let t=(0,Z.c)(9),{machineAccess:n,onNavigate:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`span`,{className:`text-sm font-normal text-foreground`,children:`Connection method`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(xr,{machineAccess:n})]}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=(0,$.jsx)(Cr,{machineAccess:n,onNavigate:r}),t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function xr(e){let t=(0,Z.c)(9),{machineAccess:n}=e,{access:r,disabled:i,selected:a}=n,o;t[0]===r?.providers?o=t[1]:(o=r?.providers??[],t[0]=r?.providers,t[1]=o);let s;t[2]===o?s=t[3]:(s=o.map(Sr),t[2]=o,t[3]=s);let c;return t[4]!==i||t[5]!==n.selectProvider||t[6]!==a||t[7]!==s?(c=(0,$.jsx)(un,{modal:!1,label:`Connection method`,value:a,disabled:i,showChevronWhenDisabled:!0,align:`end`,options:s,onChange:n.selectProvider}),t[4]=i,t[5]=n.selectProvider,t[6]=a,t[7]=s,t[8]=c):c=t[8],c}function Sr(e){return{value:e.id,label:e.displayName,description:e.description}}function Cr(e){let n=(0,Z.c)(22),{machineAccess:r,onNavigate:i}=e,{access:a,configurationMessage:o,disabled:s,draft:c,effective:l,error:u,saving:d,selected:f,value:p}=r,m=o===null,h;n[0]!==o||n[1]!==l||n[2]!==i||n[3]!==m||n[4]!==f?(h=f!==`direct`&&l!==void 0&&(0,$.jsx)(`div`,{className:`@container`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 @lg:flex-row @lg:items-center @lg:justify-between @lg:gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1 @lg:flex-1`,children:[(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium`,children:[m?(0,$.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-success`,"aria-hidden":`true`}):null,m?`Ready`:l.availability?.status===`unavailable`?`Unavailable`:`Needs configuration`]}),(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:o??(l.availability?.status===`available`?l.availability.serverUrl:null)??`Ready to add machines.`})]}),l.pluginId!==null&&(0,$.jsx)(J,{variant:m?`outline`:`default`,size:`sm`,className:`w-full @lg:w-auto`,asChild:!0,children:(0,$.jsxs)(t,{onClick:i,to:tn({pluginId:l.pluginId}),children:[m?`Manage`:`Set up ${l.displayName}`,(0,$.jsx)(P,{name:`ArrowRight`})]})})]})}),n[0]=o,n[1]=l,n[2]=i,n[3]=m,n[4]=f,n[5]=h):h=n[5];let g;n[6]!==l||n[7]!==f?(g=f!==`direct`&&l===void 0&&(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:`This connection method is not installed.`}),n[6]=l,n[7]=f,n[8]=g):g=n[8];let _;n[9]!==a?.effectiveUrl||n[10]!==s||n[11]!==c||n[12]!==u||n[13]!==r||n[14]!==d||n[15]!==f||n[16]!==p?(_=f===`direct`&&(0,$.jsx)(X,{label:`Server address`,description:u===null?`Use your own domain or an address on a shared network. Every machine you add must be able to reach this address; localhost won’t work.`:(0,$.jsx)(`span`,{role:`alert`,className:`text-destructive-text`,children:u}),controlPlacement:`below`,children:(0,$.jsxs)(`div`,{className:`flex max-w-xl flex-wrap items-center gap-2`,children:[(0,$.jsx)($e,{className:`min-w-0 flex-1 basis-48`,"aria-label":`Server address`,"aria-invalid":u!==null,value:c??p,placeholder:a?.effectiveUrl??`https://bb.example.com`,disabled:s,onChange:e=>r.editDraft(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r.commitUrl()}}),(0,$.jsx)(J,{variant:`outline`,className:`h-9 max-md:pointer-coarse:h-10`,disabled:s||c===null||c.trim()===p,onClick:()=>void r.commitUrl(),children:d?`Saving…`:`Save`})]})}),n[9]=a?.effectiveUrl,n[10]=s,n[11]=c,n[12]=u,n[13]=r,n[14]=d,n[15]=f,n[16]=p,n[17]=_):_=n[17];let v;return n[18]!==h||n[19]!==g||n[20]!==_?(v=(0,$.jsxs)($.Fragment,{children:[h,g,_]}),n[18]=h,n[19]=g,n[20]=_,n[21]=v):v=n[21],v}function wr(){Tt(),He(),be()}function Tr(e){ft(st(e)),en(e.resolvedCodeTheme),be()}function Er(){let e=(0,Z.c)(4),t=_(),n=(0,Q.useRef)(0),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>()=>{n.current+=1,wr()},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={prefetchThemes(e){for(let n of e)t.prefetchQuery(ut(n))},previewTheme(e){n.current+=1;let r=n.current;if(e===null){wr();return}t.fetchQuery(ut(e)).then(e=>{n.current===r&&Tr(e)},Dr)}},e[2]=t,e[3]=a),a}function Dr(){}function Or(e,t){if(t===null||e.length!==t.length||e.some(e=>!t.includes(e.id)))return e;let n=new Map(e.map(e=>[e.id,e]));return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[t]})}function kr(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1||r===i?null:f([...e],r,i)}function Ar(e,t,n){let r=Object.fromEntries(Object.entries(e.providerCompletedTurnDisplay).filter(([e])=>e!==t.id));return{...e,providerCompletedTurnDisplay:n===t.completedTurnDisplay?r:{...r,[t.id]:n}}}function jr(e){let t=(0,Z.c)(3),{provider:n}=e,r=U(`agent`,n.id,n)?.icon,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(`span`,{className:`flex size-5 items-center justify-center`,children:r?(0,$.jsx)(Pe,{provider:n,icon:r,className:ze}):(0,$.jsx)(P,{name:`Zap`,className:`text-muted-foreground`})}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Mr(e){let t=(0,Z.c)(28),{disabled:n,generalSettings:r,index:i,onGeneralSettingsChange:a,provider:o}=e,s;t[0]!==n||t[1]!==o.displayName||t[2]!==o.id?(s={id:o.id,disabled:n,label:o.displayName},t[0]=n,t[1]=o.displayName,t[2]=o.id,t[3]=s):s=t[3];let{setNodeRef:c,style:l,isDragging:u,handle:d}=Jn(s),f=r.defaultProviderId===o.id||r.defaultProviderId===null&&i===0,p=u&&`relative z-10 rounded-md bg-card opacity-90 shadow-lift`,m;t[4]===p?m=t[5]:(m=R(`group/provider-row`,p),t[4]=p,t[5]=m);let h;t[6]===o?h=t[7]:(h=(0,$.jsx)(jr,{provider:o}),t[6]=o,t[7]=h);let g;t[8]===o.displayName?g=t[9]:(g=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:o.displayName}),t[8]=o.displayName,t[9]=g);let _;t[10]===o.available?_=t[11]:(_=o.available?null:(0,$.jsx)(qn,{children:`Unavailable`}),t[10]=o.available,t[11]=_);let v;t[12]!==n||t[13]!==r||t[14]!==f||t[15]!==a||t[16]!==o.available||t[17]!==o.id?(v=f?(0,$.jsx)(qn,{children:`Default`}):(0,$.jsx)(J,{variant:`ghost`,size:`sm`,disabled:n||!o.available,onClick:()=>a({...r,defaultProviderId:o.id}),children:`Make default`}),t[12]=n,t[13]=r,t[14]=f,t[15]=a,t[16]=o.available,t[17]=o.id,t[18]=v):v=t[18];let y;return t[19]!==d||t[20]!==c||t[21]!==l||t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==_||t[26]!==v?(y=(0,$.jsxs)(Kn,{ref:c,style:l,className:m,children:[d,h,g,_,v]}),t[19]=d,t[20]=c,t[21]=l,t[22]=m,t[23]=h,t[24]=g,t[25]=_,t[26]=v,t[27]=y):y=t[27],y}function Nr(e){let t=(0,Z.c)(17),{disabled:n,generalSettings:r,onGeneralSettingsChange:i,provider:a}=e,o=r.providerCompletedTurnDisplay[a.id]??a.completedTurnDisplay,s;t[0]===a?s=t[1]:(s=(0,$.jsx)(jr,{provider:a}),t[0]=a,t[1]=s);let c;t[2]===a.displayName?c=t[3]:(c=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:a.displayName}),t[2]=a.displayName,t[3]=c);let l=o===`collapse`,u=`Collapse finished ${a.displayName} turns`,d;t[4]!==r||t[5]!==i||t[6]!==a?(d=e=>i(Ar(r,a,e?`collapse`:`flat`)),t[4]=r,t[5]=i,t[6]=a,t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,$.jsx)(xn,{checked:l,disabled:n,"aria-label":u,onCheckedChange:d}),t[8]=n,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==s||t[14]!==c||t[15]!==f?(p=(0,$.jsxs)(Kn,{children:[s,c,f]}),t[13]=s,t[14]=c,t[15]=f,t[16]=p):p=t[16],p}function Pr(e){let t=(0,Z.c)(5),{disabled:n,generalSettings:r,onGeneralSettingsChange:i}=e,a=Qt(),o=a.data??[],[s,c]=(0,Q.useState)(null),l=Or(o,s),u=l.map(Ir),d=a.isPending?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading providers…`}):l.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agent provider is enabled. Enable a provider plugin under Plugins.`}):(0,$.jsx)(Qn,{ids:u,disabled:n,onReorder:(e,t)=>{let n=kr(u,e,t);if(n===null)return;c(n);let a;try{a=i({...r,providerOrder:n})}catch{c(null);return}Promise.resolve(a).catch(Fr).finally(()=>c(null))},children:l.map((e,t)=>(0,$.jsx)(Mr,{disabled:n,generalSettings:r,index:t,onGeneralSettingsChange:i,provider:e},e.id))}),f;t[0]===d?f=t[1]:(f=(0,$.jsx)(Y,{title:`Providers`,description:`Set the default agent and its order in provider pickers. Configure each provider on its plugin page under Plugins.`,children:d}),t[0]=d,t[1]=f);let p=l.length===0?null:(0,$.jsx)(Y,{title:`Collapse finished turns`,description:`When a turn finishes, fold its work into one Worked for row and keep the final answer visible. Turn a provider off to keep every step of its finished turns visible.`,children:(0,$.jsx)(Gn,{children:l.map(e=>(0,$.jsx)(Nr,{disabled:n,generalSettings:r,onGeneralSettingsChange:i,provider:e},e.id))})}),m;return t[2]!==f||t[3]!==p?(m=(0,$.jsxs)($.Fragment,{children:[f,p]}),t[2]=f,t[3]=p,t[4]=m):m=t[4],m}function Fr(){}function Ir(e){return e.id}function Lr(e){let t=(0,Z.c)(29),{label:n,description:i,triggerAriaLabel:a,builtInDescription:o,preferenceAtom:s,slots:c}=e,[l,u]=r(s),d=c[0];if(d===void 0)return null;let f;t[0]===o?f=t[1]:(f={key:Ft,title:`bb (built-in)`,description:o},t[0]=o,t[1]=f);let p=f,m=`Currently using ${d.title} from ${d.pluginId}.`,h;t[2]===m?h=t[3]:(h={key:ot,title:`Automatic`,description:m},t[2]=m,t[3]=h);let g;t[4]!==p||t[5]!==c||t[6]!==h?(g=[h,p,...c.map(Rr)],t[4]=p,t[5]=c,t[6]=h,t[7]=g):g=t[7];let _=g,v;t[8]!==p||t[9]!==_||t[10]!==l?(v=_.find(e=>e.key===l)??p,t[8]=p,t[9]=_,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]===y.title?b=t[13]:(b=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:y.title}),t[12]=y.title,t[13]=b);let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[14]=x):x=t[14];let S;t[15]!==b||t[16]!==a?(S=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:`min-w-40 justify-between`,"aria-label":a,children:[b,x]})}),t[15]=b,t[16]=a,t[17]=S):S=t[17];let C;t[18]!==_||t[19]!==y.key||t[20]!==u?(C=(0,$.jsx)(tt,{align:`end`,className:`w-72`,children:_.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>u(e.key),className:`flex items-start gap-2`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.title}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.description})]}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto mt-0.5`,y.key!==e.key&&`opacity-0`,ze)})]},e.key))}),t[18]=_,t[19]=y.key,t[20]=u,t[21]=C):C=t[21];let w;t[22]!==S||t[23]!==C?(w=(0,$.jsxs)(Ct,{children:[S,C]}),t[22]=S,t[23]=C,t[24]=w):w=t[24];let T;return t[25]!==i||t[26]!==n||t[27]!==w?(T=(0,$.jsx)(X,{label:n,description:i,children:w}),t[25]=i,t[26]=n,t[27]=w,t[28]=T):T=t[28],T}function Rr(e){return{key:ht(e),title:e.title,description:e.description??`From the ${e.pluginId} plugin.`}}function zr(){let e=(0,Z.c)(7),{sourceCodeRenderers:t,diffRenderers:n}=nt(),r;e[0]===t?r=e[1]:(r=(0,$.jsx)(Lr,{label:`Source code`,triggerAriaLabel:`Source code`,description:`Choose automatic activation, BB's viewer, or a specific plugin on this device.`,builtInDescription:`Syntax highlighting and gutters from the bb code theme.`,preferenceAtom:hn,slots:t}),e[0]=t,e[1]=r);let i;e[2]===n?i=e[3]:(i=(0,$.jsx)(Lr,{label:`Diffs`,triggerAriaLabel:`Diffs`,description:`Applies to file diffs in threads, the diff panel, and plugin views.`,builtInDescription:`Unified and split diffs from the bb code theme.`,preferenceAtom:gn,slots:n}),e[2]=n,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,$.jsxs)($.Fragment,{children:[r,i]}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}function Br(){let e=(0,Z.c)(2),{threadLists:t}=nt(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Lr,{label:`Sidebar`,triggerAriaLabel:`Sidebar thread list`,description:`Choose automatic activation, BB's list, or a specific plugin on this device.`,builtInDescription:`Projects, sections, and nested threads.`,preferenceAtom:rt,slots:t}),e[0]=t,e[1]=n),n}function Vr(){let e=(0,Z.c)(15),t=Kt(),n;e[0]===t?n=e[1]:(n={onDragEnd(e){typeof e.active.id==`string`&&typeof e.over?.id==`string`&&t.move(e.active.id,e.over.id)}},e[0]=t,e[1]=n);let{dndContextProps:r,onClickCapture:i}=Jt(n),o;e[2]===t.items?o=e[3]:(o=t.items.map(Hr),e[2]=t.items,e[3]=o);let s;e[4]===t?s=e[5]:(s=t.items.map(e=>(0,$.jsx)(Ur,{item:e,visible:!t.hidden.includes(e.key),onVisibleChange:n=>t.setVisible(e.key,n)},e.key)),e[4]=t,e[5]=s);let l;e[6]!==o||e[7]!==s?(l=(0,$.jsx)(a,{items:o,strategy:g,children:s}),e[6]=o,e[7]=s,e[8]=l):l=e[8];let u;e[9]!==r||e[10]!==l?(u=(0,$.jsx)(c,{...r,children:l}),e[9]=r,e[10]=l,e[11]=u):u=e[11];let d;return e[12]!==i||e[13]!==u?(d=(0,$.jsx)(X,{label:`Sidebar footer`,description:`Drag to reorder. Hidden actions remain available in the footer’s More menu.`,controlPlacement:`below`,children:(0,$.jsx)(`div`,{className:`rounded-md border border-border`,onClickCapture:i,children:u})}),e[12]=i,e[13]=u,e[14]=d):d=e[14],d}function Hr(e){return e.key}function Ur({item:e,visible:t,onVisibleChange:n}){let{dragBindings:r,setNodeRef:i,style:a}=ee({id:e.key,disabled:!1});return(0,$.jsxs)(`div`,{ref:i,style:a,className:`flex items-center gap-2 border-b border-border px-2 py-2 last:border-b-0`,"data-footer-setting":e.key,children:[(0,$.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-7 touch-none text-muted-foreground`,ref:r.setActivatorNodeRef,...r.attributes,...r.listeners,"aria-label":`Reorder ${e.label}`,children:(0,$.jsx)(P,{name:`DragDropVertical`,className:`size-4`})}),(0,$.jsx)(wt,{item:e}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e.label}),(0,$.jsx)(xn,{checked:t,onCheckedChange:n,"aria-label":`Show ${e.label} in footer`})]})}function Wr(){let e=(0,Z.c)(2),{experimentalSidebarNavigations:t}=nt(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Lr,{label:`Navigation`,triggerAriaLabel:`Sidebar navigation`,description:`Choose who arranges the host-owned sidebar destinations on this device.`,builtInDescription:`Native New thread, Search, Plugins, Skills, and plugin panels.`,preferenceAtom:L,slots:t}),e[0]=t,e[1]=n),n}var Gr=`Fade inactive splits`;function Kr(){let e=(0,Z.c)(3),[t,n]=r(G),i;return e[0]!==t||e[1]!==n?(i=(0,$.jsx)(X,{label:Gr,description:`Fade out splits that do not have focus.`,children:(0,$.jsx)(xn,{checked:t,onCheckedChange:n,"aria-label":Gr})}),e[0]=t,e[1]=n,e[2]=i):i=e[2],i}function qr(e){let t=(0,Z.c)(7),{pluginId:n}=e,{settingsSections:r}=nt(),i;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e.pluginId===n,t[3]=n,t[4]=e),i=r.filter(e),t[0]=n,t[1]=r,t[2]=i}else i=t[2];let a=i;if(a.length===0)return null;let o;return t[5]===a?o=t[6]:(o=(0,$.jsx)(Jr,{sections:a}),t[5]=a,t[6]=o),o}function Jr(e){let t=(0,Z.c)(4),{sections:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Yr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`space-y-6`,"data-testid":`plugin-settings-sections`,children:r}),t[2]=r,t[3]=i),i}function Yr(e){let t=`${e.pluginId}/${e.id}/${e.generation}`;return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[e.title===void 0?null:(0,$.jsx)(`h3`,{className:`text-xs font-medium text-foreground`,children:e.title}),e.description===void 0?null:(0,$.jsx)(`p`,{className:`text-xs leading-snug text-subtle-foreground/75`,children:e.description}),(0,$.jsx)(yt,{pluginId:e.pluginId,slotKind:`settingsSection`,slotId:e.id,children:(0,$.jsx)(e.component,{})})]},t)}function Xr(e){let t=(0,Z.c)(4),{pluginId:n}=e,{providers:r}=Cn(),i=Xe().data?.serverAccess;if(!(r??[]).some(e=>e.pluginId===n))return null;let a;t[0]===i?a=t[1]:(a=v(i),t[0]=i,t[1]=a);let o;return t[2]===a?o=t[3]:(o=(0,$.jsx)(Zr,{reason:a}),t[2]=a,t[3]=o),o}function Zr(e){let n=(0,Z.c)(8),{reason:r}=e;if(r===null)return null;let i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(P,{name:`AlertTriangle`,className:`mt-0.5 size-3.5 shrink-0 text-warning-text`,"aria-hidden":!0}),n[0]=i):i=n[0];let a;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:b}),n[1]=a):a=n[1];let o;n[2]===r?o=n[3]:(o=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[i,(0,$.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-snug text-subtle-foreground`,children:r})]})]}),n[2]=r,n[3]=o);let s;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Be(`machines`),n[4]=s):s=n[4];let c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(J,{asChild:!0,size:`sm`,variant:`outline`,className:`w-full shrink-0 @md:w-auto`,children:(0,$.jsxs)(t,{to:s,children:[`Set up machine access`,(0,$.jsx)(P,{name:`ArrowRight`})]})}),n[5]=c):c=n[5];let l;return n[6]===o?l=n[7]:(l=(0,$.jsx)(`div`,{className:`@container w-full`,children:(0,$.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-2 rounded-lg border border-border bg-card px-4 py-3 @md:flex-row @md:items-center @md:gap-4`,children:[o,c]})}),n[6]=o,n[7]=l),l}var Qr=`h-7 w-full justify-between border-border/60 bg-card px-2 text-xs sm:w-44`,$r=`min-w-[var(--radix-dropdown-menu-trigger-width)]`,ei=6,ti=24,ni=Symbol(),ri=`max-h-96 min-h-32 w-full resize-y overflow-y-auto font-mono text-xs field-sizing-content`;function ii(e){let t=e.split(`
2
2
  `).length;return Math.min(ti,Math.max(ei,t+1))}function ai(e){return e.type===`string`&&e.experimental_multiline===!0&&e.secret!==!0}function oi(e){let t=(0,Z.c)(18),{ariaDescribedBy:n,ariaInvalid:r,ariaLabel:i,onSelect:a,options:o,valueLabel:s}=e,c;t[0]===s?c=t[1]:(c=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[0]=s,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[2]=l):l=t[2];let u;t[3]!==n||t[4]!==r||t[5]!==i||t[6]!==c?(u=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Qr,"aria-label":i,"aria-describedby":n,"aria-invalid":r,children:[c,l]})}),t[3]=n,t[4]=r,t[5]=i,t[6]=c,t[7]=u):u=t[7];let d;if(t[8]!==a||t[9]!==o){let e;t[11]===a?e=t[12]:(e=e=>(0,$.jsx)(Nt,{onSelect:()=>a(e.value),children:e.label},e.value),t[11]=a,t[12]=e),d=o.map(e),t[8]=a,t[9]=o,t[10]=d}else d=t[10];let f;t[13]===d?f=t[14]:(f=(0,$.jsx)(tt,{align:`end`,className:$r,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,$.jsxs)(Ct,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function si(e){let t=(0,Z.c)(58),{ariaDescribedBy:n,ariaInvalid:r,descriptor:i,draft:a,onBlur:o,onChange:s,storedValue:c}=e,l=i.type===`project`,u;t[0]===l?u=t[1]:(u={enabled:l},t[0]=l,t[1]=u);let d=Ce(u);if(i.type===`boolean`){let e=typeof a==`boolean`?a:typeof c==`boolean`?c:!1,o;return t[2]!==n||t[3]!==r||t[4]!==e||t[5]!==i.label||t[6]!==s?(o=(0,$.jsx)(xn,{checked:e,onCheckedChange:s,"aria-label":i.label,"aria-describedby":n,"aria-invalid":r}),t[2]=n,t[3]=r,t[4]=e,t[5]=i.label,t[6]=s,t[7]=o):o=t[7],o}if(i.type===`select`){let e=typeof a==`string`?a:typeof c==`string`?c:``,o=i.label,l=e.length>0?e:`Select…`,u;t[8]===i.options?u=t[9]:(u=i.options.map(li),t[8]=i.options,t[9]=u);let d;return t[10]!==n||t[11]!==r||t[12]!==i.label||t[13]!==s||t[14]!==l||t[15]!==u?(d=(0,$.jsx)(oi,{ariaDescribedBy:n,ariaInvalid:r,ariaLabel:o,valueLabel:l,options:u,onSelect:s}),t[10]=n,t[11]=r,t[12]=i.label,t[13]=s,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}if(i.type===`project`){let e=typeof a==`string`?a:typeof c==`string`?c:``,o=d.data,l;t[17]===o?l=t[18]:(l=o?[{label:o.personalProject.name,value:o.personalProject.id},...o.projects.map(ci)]:[],t[17]=o,t[18]=l);let u=l,f=u.find(t=>t.value===e)?.label??(e.length>0?e:`Select a project…`),p;return t[19]!==n||t[20]!==r||t[21]!==i.label||t[22]!==s||t[23]!==u||t[24]!==f?(p=(0,$.jsx)(oi,{ariaDescribedBy:n,ariaInvalid:r,ariaLabel:i.label,valueLabel:f,options:u,onSelect:s}),t[19]=n,t[20]=r,t[21]=i.label,t[22]=s,t[23]=u,t[24]=f,t[25]=p):p=t[25],p}if(i.type===`number`){let e=typeof a==`string`?a:typeof c==`number`?String(c):``,l;t[26]===s?l=t[27]:(l=e=>s(e.target.value),t[26]=s,t[27]=l);let u;return t[28]!==n||t[29]!==r||t[30]!==i.label||t[31]!==o||t[32]!==l||t[33]!==e?(u=(0,$.jsx)($e,{type:`number`,inputMode:`decimal`,step:`any`,value:e,"aria-label":i.label,"aria-describedby":n,"aria-invalid":r,onChange:l,onBlur:o,className:`h-7 w-full text-xs sm:w-64`}),t[28]=n,t[29]=r,t[30]=i.label,t[31]=o,t[32]=l,t[33]=e,t[34]=u):u=t[34],u}let f=i.secret===!0,p=f&&typeof c==`object`&&!!c&&`set`in c&&c.set===!0,m=typeof a==`string`?a:!f&&typeof c==`string`?c:``;if(ai(i)){let e=i.label,a;t[35]===m?a=t[36]:(a=ii(m),t[35]=m,t[36]=a);let c;t[37]===s?c=t[38]:(c=e=>s(e.target.value),t[37]=s,t[38]=c);let l;return t[39]!==n||t[40]!==r||t[41]!==i.label||t[42]!==o||t[43]!==a||t[44]!==c||t[45]!==m?(l=(0,$.jsx)(Yn,{value:m,"aria-label":e,"aria-describedby":n,"aria-invalid":r,rows:a,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,onChange:c,onBlur:o,className:ri}),t[39]=n,t[40]=r,t[41]=i.label,t[42]=o,t[43]=a,t[44]=c,t[45]=m,t[46]=l):l=t[46],l}let h=f?`password`:`text`,g=f?p?`[set]`:`[not set]`:void 0,_;t[47]===s?_=t[48]:(_=e=>s(e.target.value),t[47]=s,t[48]=_);let v;return t[49]!==n||t[50]!==r||t[51]!==i.label||t[52]!==o||t[53]!==h||t[54]!==g||t[55]!==_||t[56]!==m?(v=(0,$.jsx)($e,{type:h,value:m,"aria-label":i.label,"aria-describedby":n,"aria-invalid":r,placeholder:g,onChange:_,onBlur:o,className:`h-7 w-full text-xs sm:w-64`}),t[49]=n,t[50]=r,t[51]=i.label,t[52]=o,t[53]=h,t[54]=g,t[55]=_,t[56]=m,t[57]=v):v=t[57],v}function ci(e){return{label:e.name,value:e.id}}function li(e){return{label:e,value:e}}function ui(e,t){return e.type===`boolean`?typeof t==`boolean`?t:!1:e.type===`number`?typeof t==`number`?String(t):``:e.type===`string`&&e.secret===!0?``:typeof t==`string`?t:``}function di(e){let t=(0,Z.c)(59),{descriptor:n,pluginId:r,settingKey:i,storedValue:a}=e,o=_(),s=(0,Q.useId)(),c;t[0]!==n||t[1]!==a?(c=ui(n,a),t[0]=n,t[1]=a,t[2]=c):c=t[2];let l=c,u;t[3]===l?u=t[4]:(u={value:l,hasNewerDraft:!1},t[3]=l,t[4]=u);let[d,f]=(0,Q.useState)(u),m=d.value,h=`plugin-setting:${r}:${i}`,g;t[5]===h?g=t[6]:(g={id:h},t[5]=h,t[6]=g);let v;t[7]!==n.type||t[8]!==r||t[9]!==i?(v=e=>{if(e===ni)throw Error(`Enter a finite number`);let t=e;if(n.type===`number`){let n=typeof e==`string`?e.trim():``,r=Number(n);if(n.length>0&&!Number.isFinite(r))throw Error(`Enter a finite number`);t=n.length===0?null:r}return xe(fetch,r,{[i]:t})},t[7]=n.type,t[8]=r,t[9]=i,t[10]=v):v=t[10];let y;t[11]!==r||t[12]!==o?(y=e=>{E({queryClient:o,pluginId:r,view:e}),pe({queryClient:o})},t[11]=r,t[12]=o,t[13]=y):y=t[13];let b;t[14]!==g||t[15]!==v||t[16]!==y?(b={scope:g,mutationFn:v,onSuccess:y},t[14]=g,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x=p(b),S,C;t[18]!==d.hasNewerDraft||t[19]!==l||t[20]!==x.isError||t[21]!==x.isPending?(S=()=>{!d.hasNewerDraft&&!x.isPending&&!x.isError&&f({value:l,hasNewerDraft:!1})},C=[d.hasNewerDraft,l,x.isError,x.isPending],t[18]=d.hasNewerDraft,t[19]=l,t[20]=x.isError,t[21]=x.isPending,t[22]=S,t[23]=C):(S=t[22],C=t[23]),(0,Q.useEffect)(S,C);let w;t[24]!==n.type||t[25]!==x?(w=function(e){f({value:e,hasNewerDraft:n.type===`string`||n.type===`number`}),x.isPending||x.reset(),n.type!==`string`&&n.type!==`number`&&x.mutate(e)},t[24]=n.type,t[25]=x,t[26]=w):w=t[26];let T=w,D;t[27]!==n.secret||t[28]!==n.type||t[29]!==m||t[30]!==l||t[31]!==x||t[32]!==a?(D=function(e){if(!(n.type!==`string`&&n.type!==`number`)){if(n.type===`number`&&e.currentTarget.validity.badInput){f({value:l,hasNewerDraft:!1}),x.mutate(ni);return}if(n.type===`number`){let e=typeof m==`string`?m.trim():``,t=Number(e);if(e.length===0&&a===void 0||e.length>0&&t===a&&!x.isPending){f({value:m,hasNewerDraft:!1});return}}if(m===a&&!x.isPending||n.type===`string`&&n.secret===!0&&m===``){f({value:m,hasNewerDraft:!1});return}f({value:m,hasNewerDraft:!1}),x.mutate(m)}},t[27]=n.secret,t[28]=n.type,t[29]=m,t[30]=l,t[31]=x,t[32]=a,t[33]=D):D=t[33];let O=D,k;t[34]!==x.error||t[35]!==x.isError?(k=x.isError?De({error:x.error,fallbackMessage:`Could not save this setting`}):null,t[34]=x.error,t[35]=x.isError,t[36]=k):k=t[36];let A=k,j=n.type===`string`&&n.secret===!0?`secret`:void 0,M=ai(n)?`below`:`inline`,N;t[37]===n.description?N=t[38]:(N=n.description===void 0?{}:{description:n.description},t[37]=n.description,t[38]=N);let P=A===null?void 0:s,F=A!==null,I;t[39]!==T||t[40]!==n||t[41]!==m||t[42]!==O||t[43]!==a||t[44]!==P||t[45]!==F?(I=(0,$.jsx)(si,{ariaDescribedBy:P,ariaInvalid:F,descriptor:n,storedValue:a,draft:m,onBlur:O,onChange:T}),t[39]=T,t[40]=n,t[41]=m,t[42]=O,t[43]=a,t[44]=P,t[45]=F,t[46]=I):I=t[46];let L;t[47]!==s||t[48]!==A?(L=A===null?null:(0,$.jsx)(`p`,{id:s,className:`text-xs text-destructive`,role:`alert`,children:A}),t[47]=s,t[48]=A,t[49]=L):L=t[49];let R;t[50]!==I||t[51]!==L?(R=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[I,L]}),t[50]=I,t[51]=L,t[52]=R):R=t[52];let z;return t[53]!==n.label||t[54]!==j||t[55]!==M||t[56]!==N||t[57]!==R?(z=(0,$.jsx)(X,{label:n.label,labelBadge:j,controlPlacement:M,...N,children:R}),t[53]=n.label,t[54]=j,t[55]=M,t[56]=N,t[57]=R,t[58]=z):z=t[58],z}function fi(e){let t=(0,Z.c)(7),{pluginId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={enabled:!0},t[0]=r):r=t[0];let i=Xt(n,r).data??null;if(i===null||Object.keys(i.schema).length===0)return null;let a;t[1]===i.schema?a=t[2]:(a=Object.entries(i.schema),t[1]=i.schema,t[2]=a);let o;return t[3]!==n||t[4]!==a||t[5]!==i.values?(o=(0,$.jsx)(`div`,{className:`space-y-4`,children:a.map(e=>{let[t,r]=e;return(0,$.jsx)(di,{descriptor:r,pluginId:n,settingKey:t,storedValue:i.values[t]},t)})}),t[3]=n,t[4]=a,t[5]=i.values,t[6]=o):o=t[6],o}var pi=[`running`,`needs-configuration`,`degraded`];function mi(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:`flex h-5 items-center`,children:(0,$.jsx)(je,{className:`h-3.5 w-40 max-w-[60%]`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[t,(0,$.jsx)(`div`,{className:`flex h-4 items-center`,children:(0,$.jsx)(je,{className:`h-3 w-72 max-w-full`})})]}),e[1]=n):n=e[1],n}function hi(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`span`,{className:`sr-only`,children:`Loading plugin settings…`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(je,{className:`size-9 shrink-0`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`flex h-7 items-center`,children:(0,$.jsx)(je,{className:`h-4 w-44 max-w-full`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[n,(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`div`,{className:`flex h-4 items-center`,children:(0,$.jsx)(je,{className:`h-3 w-80 max-w-full`})})]})]}),(0,$.jsx)(je,{className:`h-5 w-9 shrink-0 rounded-full`})]}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(je,{className:`h-3.5 w-24`}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Dn,{label:a,children:(0,$.jsx)(En,{surface:`recessed`,className:`px-3 py-3`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(mi,{}),(0,$.jsx)(mi,{})]})})}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(je,{className:`h-3.5 w-28`}),e[6]=s):s=e[6];let c;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl`,"data-testid":`plugin-settings-skeleton`,role:`status`,"aria-busy":`true`,children:[t,(0,$.jsxs)(`div`,{"aria-hidden":!0,children:[i,(0,$.jsxs)(kn,{className:`mt-6`,children:[o,(0,$.jsx)(On,{label:s,children:(0,$.jsx)(`div`,{className:`flex h-5 items-center`,children:(0,$.jsx)(je,{className:`h-3 w-96 max-w-full`})})})]})]})]}),e[7]=c):c=e[7],c}function gi(e){let t=(0,Z.c)(9),{pluginId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={enabled:!0},t[0]=r):r=t[0];let i=N(r),a;t[1]!==i.data?.plugins||t[2]!==n?(a=i.data?.plugins.find(e=>e.id===n)??null,t[1]=i.data?.plugins,t[2]=n,t[3]=a):a=t[3];let o=a;if(i.data===void 0&&!i.isError){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(hi,{}),t[4]=e):e=t[4],e}if(i.data===void 0&&i.isError){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Could not load plugin settings.`}),t[5]=e):e=t[5],e}if(o===null){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`This plugin is not installed.`}),t[6]=e):e=t[6],e}let s;return t[7]===o?s=t[8]:(s=(0,$.jsx)(_i,{plugin:o},o.id),t[7]=o,t[8]=s),s}function _i(e){let n=(0,Z.c)(59),{plugin:r}=e,i=_(),{settingsSections:a}=nt(),o=me(),s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={showErrorToast:!1},n[0]=s):s=n[0];let c;n[1]!==r.id||n[2]!==o?(c=e=>o(r.id,e),n[1]=r.id,n[2]=o,n[3]=c):c=n[3];let l;n[4]===r.id?l=n[5]:(l=(e,t)=>{k.error(`${t?`Enabling`:`Disabling`} ${r.id} failed`,{description:e instanceof Error?e.message:String(e)})},n[4]=r.id,n[5]=l);let u;n[6]===i?u=n[7]:(u=async()=>{await le({queryClient:i}),await pe({queryClient:i})},n[6]=i,n[7]=u);let d;n[8]!==c||n[9]!==l||n[10]!==u?(d={meta:s,mutationFn:c,onError:l,onSettled:u},n[8]=c,n[9]=l,n[10]=u,n[11]=d):d=n[11];let f=p(d),m=f.isPending?f.variables:r.enabled,h;n[12]!==r.hasSettings||n[13]!==r.id||n[14]!==a?(h=r.hasSettings||a.some(e=>e.pluginId===r.id),n[12]=r.hasSettings,n[13]=r.id,n[14]=a,n[15]=h):h=n[15];let g=h,v;n[16]!==r.icon||n[17]!==r.id?(v=(0,$.jsx)(`div`,{className:`size-9 shrink-0`,children:(0,$.jsx)(Pt,{pluginId:r.id,icon:r.icon,className:`size-full`})}),n[16]=r.icon,n[17]=r.id,n[18]=v):v=n[18];let y=r.name??r.id,b;n[19]===y?b=n[20]:(b=(0,$.jsx)(`h1`,{className:`truncate text-lg font-semibold text-foreground`,children:y}),n[19]=y,n[20]=b);let x;n[21]===r.description?x=n[22]:(x=r.description?(0,$.jsx)(`p`,{className:`truncate text-xs text-subtle-foreground`,children:r.description}):null,n[21]=r.description,n[22]=x);let S;n[23]!==x||n[24]!==b?(S=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),n[23]=x,n[24]=b,n[25]=S):S=n[25];let C;n[26]!==S||n[27]!==v?(C=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[v,S]}),n[26]=S,n[27]=v,n[28]=C):C=n[28];let w;n[29]===f?w=n[30]:(w=e=>f.mutate(e),n[29]=f,n[30]=w);let T=`${m?`Disable`:`Enable`} ${r.id}`,E;n[31]!==m||n[32]!==w||n[33]!==T||n[34]!==f.isPending?(E=(0,$.jsx)(xn,{checked:m,disabled:f.isPending,onCheckedChange:w,"aria-label":T}),n[31]=m,n[32]=w,n[33]=T,n[34]=f.isPending,n[35]=E):E=n[35];let D;n[36]!==C||n[37]!==E?(D=(0,$.jsxs)(`header`,{className:`flex items-center justify-between gap-4`,children:[C,E]}),n[36]=C,n[37]=E,n[38]=D):D=n[38];let O;n[39]!==m||n[40]!==r.enabled||n[41]!==r.id?(O=m&&r.enabled?(0,$.jsx)(Xr,{pluginId:r.id}):null,n[39]=m,n[40]=r.enabled,n[41]=r.id,n[42]=O):O=n[42];let A;n[43]!==m||n[44]!==g||n[45]!==r?(A=m&&r.enabled&&g?(0,$.jsx)(Dn,{label:`Configuration`,children:(0,$.jsx)(vi,{plugin:r})}):null,n[43]=m,n[44]=g,n[45]=r,n[46]=A):A=n[46];let M;n[47]===r.id?M=n[48]:(M=j({pluginId:r.id,view:`installed`}),n[47]=r.id,n[48]=M);let N;n[49]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(P,{name:`ChevronRight`,className:`size-3.5 no-underline`,"aria-hidden":!0}),n[49]=N):N=n[49];let F;n[50]===M?F=n[51]:(F=(0,$.jsx)(On,{label:`Plugin details`,children:(0,$.jsxs)(`p`,{className:`max-w-none text-sm leading-relaxed text-muted-foreground`,children:[`Release, capabilities, and health live on`,` `,(0,$.jsxs)(t,{to:M,className:`inline-flex items-center gap-0.5 rounded-sm underline underline-offset-2 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[`its plugin page`,N]})]})}),n[50]=M,n[51]=F);let I;n[52]!==O||n[53]!==A||n[54]!==F?(I=(0,$.jsxs)(kn,{className:`mt-6`,children:[O,A,F]}),n[52]=O,n[53]=A,n[54]=F,n[55]=I):I=n[55];let L;return n[56]!==D||n[57]!==I?(L=(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl`,children:[D,I]}),n[56]=D,n[57]=I,n[58]=L):L=n[58],L}function vi(e){let t=(0,Z.c)(16),{plugin:n}=e,{settingsSections:r}=nt(),i=r.some(e=>e.pluginId===n.id),a;t[0]!==n.enabled||t[1]!==n.status?(a=n.enabled&&pi.includes(n.status),t[0]=n.enabled,t[1]=n.status,t[2]=a):a=t[2];let o=a;if(!n.hasSettings&&!i)return null;let s=`plugin-detail-${n.id}`,c;t[3]!==n.enabled||t[4]!==n.hasSettings||t[5]!==n.id||t[6]!==n.status||t[7]!==o?(c=n.hasSettings||!o?(0,$.jsx)(En,{surface:`recessed`,className:`px-3 py-3`,children:o?(0,$.jsx)(fi,{pluginId:n.id},n.id):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.enabled?`Settings are unavailable while the plugin is ${n.status}.`:`Enable this plugin to edit its settings.`})}):null,t[3]=n.enabled,t[4]=n.hasSettings,t[5]=n.id,t[6]=n.status,t[7]=o,t[8]=c):c=t[8];let l;t[9]!==n.id||t[10]!==o?(l=o?(0,$.jsx)(qr,{pluginId:n.id}):null,t[9]=n.id,t[10]=o,t[11]=l):l=t[11];let u;return t[12]!==s||t[13]!==c||t[14]!==l?(u=(0,$.jsxs)(`div`,{className:`space-y-6`,"data-testid":s,children:[c,l]}),t[12]=s,t[13]=c,t[14]=l,t[15]=u):u=t[15],u}var yi=`__automatic__`,bi=`Built-in preview`;function xi(){let e=(0,Z.c)(13),{fileOpeners:t}=nt(),[n,r]=ln(),i;e[0]===t?i=e[1]:(i=[...new Set(t.flatMap(Si))].sort(),e[0]=t,e[1]=i);let a=i;if(a.length===0)return null;let o;if(e[2]!==a||e[3]!==t||e[4]!==n||e[5]!==r){let i;e[7]!==t||e[8]!==n||e[9]!==r?(i=e=>(0,$.jsx)(Ci,{extension:e,openers:t.filter(t=>t.extensions.includes(e)),preference:n[e]??yi,onSelect:t=>r(n=>{let r={...n};return t===yi?delete r[e]:r[e]=t,r})},e),e[7]=t,e[8]=n,e[9]=r,e[10]=i):i=e[10],o=a.map(i),e[2]=a,e[3]=t,e[4]=n,e[5]=r,e[6]=o}else o=e[6];let s;return e[11]===o?s=e[12]:(s=(0,$.jsx)(Y,{title:`File openers`,description:`Automatically use matching plugins, or choose a viewer for each file type. Right-click a file link for a one-off choice.`,children:(0,$.jsx)(`div`,{className:`space-y-5`,children:o})}),e[11]=o,e[12]=s),s}function Si(e){return e.extensions}function Ci(e){let t=(0,Z.c)(25),{extension:n,onSelect:r,openers:i,preference:a}=e,o=i[0];if(o===void 0)return null;let s=`Automatic (${o.title})`,c;t[0]===s?c=t[1]:(c={key:yi,label:s},t[0]=s,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={key:Ke,label:bi},t[2]=l):l=t[2];let u;t[3]!==i||t[4]!==c?(u=[c,l,...i.map(wi)],t[3]=i,t[4]=c,t[5]=u):u=t[5];let d=u,f;t[6]!==d||t[7]!==a?(f=d.find(e=>e.key===a)??d[1],t[6]=d,t[7]=a,t[8]=f):f=t[8];let p=f;if(p===void 0)return null;let m=`.${n} files`,h=`Default opener for .${n} files`,g;t[9]===p.label?g=t[10]:(g=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:p.label}),t[9]=p.label,t[10]=g);let _;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[11]=_):_=t[11];let v;t[12]!==h||t[13]!==g?(v=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Qr,"aria-label":h,children:[g,_]})}),t[12]=h,t[13]=g,t[14]=v):v=t[14];let y;t[15]!==r||t[16]!==d||t[17]!==p.key?(y=(0,$.jsx)(tt,{align:`end`,className:$r,children:d.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>r(e.key),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,p.key!==e.key&&`opacity-0`,ze)})]},e.key))}),t[15]=r,t[16]=d,t[17]=p.key,t[18]=y):y=t[18];let b;t[19]!==v||t[20]!==y?(b=(0,$.jsxs)(Ct,{children:[v,y]}),t[19]=v,t[20]=y,t[21]=b):b=t[21];let x;return t[22]!==b||t[23]!==m?(x=(0,$.jsx)(X,{label:m,children:b}),t[22]=b,t[23]=m,t[24]=x):x=t[24],x}function wi(e){return{key:Yt(e),label:`${e.title} (${e.pluginId})`}}var Ti=`default`;function Ei(){return typeof navigator>`u`||!navigator.mediaDevices?.enumerateDevices?null:navigator.mediaDevices}function Di(e){if(e instanceof DOMException)switch(e.name){case`NotAllowedError`:case`SecurityError`:return`Microphone permission denied`;case`NotFoundError`:case`DevicesNotFoundError`:return`No microphones found`;default:return`Microphone devices unavailable`}return e instanceof Error&&e.message.trim().length>0?e.message.trim():`Microphone devices unavailable`}function Oi(e,t){let n=e.label.trim();return n.length>0?n:`Microphone ${t+1}`}function ki(e){let t=new Set,n=[];for(let r of e)r.kind!==`audioinput`||r.deviceId.length===0||r.deviceId===Ti||t.has(r.deviceId)||(t.add(r.deviceId),n.push({deviceId:r.deviceId,label:Oi(r,n.length)}));return n}async function Ai(e){return ki(await e.enumerateDevices())}function ji(e){e?.getTracks().forEach(e=>e.stop())}function Mi(){let[e,t]=(0,Q.useState)([]),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(()=>Ei()!==null),c=(0,Q.useCallback)(async(e={})=>{let n=Ei();if(s(n!==null),n===null){t([]),r(null);return}a(!0);let i=null;try{e.requestPermission&&(i=await n.getUserMedia({audio:!0})),t(await Ai(n)),r(null)}catch(e){r(Di(e))}finally{ji(i),a(!1)}},[]);return(0,Q.useEffect)(()=>{let e=Ei();if(s(e!==null),e===null)return;c();let t=()=>{c()};return e.addEventListener(`devicechange`,t),()=>{e.removeEventListener(`devicechange`,t)}},[c]),{devices:e,errorMessage:n,isLoading:i,isSupported:o,refresh:c}}var Ni=`System default`,Pi=`Microphone`;function Fi({devices:e,isSupported:t,preferredDeviceId:n}){return t?n===null?Ni:e.find(e=>e.deviceId===n)?.label??`Unavailable microphone`:`Unsupported`}function Ii({devices:e,errorMessage:t,isLoading:n,isSupported:r,preferredDeviceId:i}){return r?n?`Loading microphones.`:t===null?i!==null&&e.every(e=>e.deviceId!==i)?`Selected microphone is unavailable.`:e.length===0?`No microphones found.`:`Used for prompt voice input.`:t:`This browser does not expose microphone devices.`}function Li(e){let t=(0,Z.c)(65),{devices:n,errorMessage:r,isLoading:i,isSupported:a,onDeviceChange:o,onRefresh:s,preferredDeviceId:c}=e,l;t[0]!==n||t[1]!==a||t[2]!==c?(l=Fi({devices:n,isSupported:a,preferredDeviceId:c}),t[0]=n,t[1]=a,t[2]=c,t[3]=l):l=t[3];let u=l,d=!a||i,f;t[4]===s?f=t[5]:(f=()=>s(!0),t[4]=s,t[5]=f);let p=i?`Loading microphones`:`Load microphones`,m=i&&`animate-spin`,h;t[6]===m?h=t[7]:(h=R(`size-3.5`,m),t[6]=m,t[7]=h);let g;t[8]===h?g=t[9]:(g=(0,$.jsx)(P,{name:`RotateCcw`,className:h}),t[8]=h,t[9]=g);let _;t[10]!==d||t[11]!==f||t[12]!==p||t[13]!==g?(_=(0,$.jsx)(ct,{asChild:!0,children:(0,$.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-7 text-muted-foreground hover:text-foreground`,disabled:d,onClick:f,"aria-label":p,children:g})}),t[10]=d,t[11]=f,t[12]=p,t[13]=g,t[14]=_):_=t[14];let v;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Et,{side:`bottom`,children:`Load microphones`}),t[15]=v):v=t[15];let y;t[16]===_?y=t[17]:(y=(0,$.jsxs)(Mt,{delayDuration:300,disableHoverableContent:!0,children:[_,v]}),t[16]=_,t[17]=y);let b;t[18]!==n||t[19]!==r||t[20]!==i||t[21]!==a||t[22]!==c?(b=Ii({devices:n,errorMessage:r,isLoading:i,isSupported:a,preferredDeviceId:c}),t[18]=n,t[19]=r,t[20]=i,t[21]=a,t[22]=c,t[23]=b):b=t[23];let x;t[24]===s?x=t[25]:(x=e=>{e&&s(!1)},t[24]=s,t[25]=x);let S=!a,C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(P,{name:`Mic`,className:`size-3.5 shrink-0`}),t[26]=C):C=t[26];let w;t[27]===u?w=t[28]:(w=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[C,(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:u})]}),t[27]=u,t[28]=w);let T;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[29]=T):T=t[29];let E;t[30]!==S||t[31]!==w?(E=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Qr,"aria-label":Pi,disabled:S,children:[w,T]})}),t[30]=S,t[31]=w,t[32]=E):E=t[32];let D;t[33]===o?D=t[34]:(D=()=>o(null),t[33]=o,t[34]=D);let O=c!==null&&`opacity-0`,k;t[35]===O?k=t[36]:(k=R(`ml-auto`,O,ze),t[35]=O,t[36]=k);let A;t[37]===k?A=t[38]:(A=(0,$.jsx)(P,{name:`Check`,className:k}),t[37]=k,t[38]=A);let j;t[39]!==D||t[40]!==A?(j=(0,$.jsxs)(Nt,{onSelect:D,children:[Ni,A]}),t[39]=D,t[40]=A,t[41]=j):j=t[41];let M;t[42]===n.length?M=t[43]:(M=n.length>0?(0,$.jsx)(mt,{}):null,t[42]=n.length,t[43]=M);let N;if(t[44]!==n||t[45]!==o||t[46]!==c){let e;t[48]!==o||t[49]!==c?(e=e=>(0,$.jsxs)(Nt,{onSelect:()=>o(e.deviceId),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,c!==e.deviceId&&`opacity-0`,ze)})]},e.deviceId),t[48]=o,t[49]=c,t[50]=e):e=t[50],N=n.map(e),t[44]=n,t[45]=o,t[46]=c,t[47]=N}else N=t[47];let F;t[51]!==j||t[52]!==M||t[53]!==N?(F=(0,$.jsxs)(tt,{align:`end`,className:$r,mobileTitle:`Microphone`,children:[j,M,N]}),t[51]=j,t[52]=M,t[53]=N,t[54]=F):F=t[54];let I;t[55]!==x||t[56]!==E||t[57]!==F?(I=(0,$.jsxs)(Ct,{onOpenChange:x,children:[E,F]}),t[55]=x,t[56]=E,t[57]=F,t[58]=I):I=t[58];let L;t[59]!==b||t[60]!==I?(L=(0,$.jsx)(X,{label:Pi,description:b,children:I}),t[59]=b,t[60]=I,t[61]=L):L=t[61];let z;return t[62]!==y||t[63]!==L?(z=(0,$.jsx)(Y,{title:`Voice Input`,actionPlacement:`inline`,action:y,children:L}),t[62]=y,t[63]=L,t[64]=z):z=t[64],z}function Ri(){let e=(0,Z.c)(10),[t,n]=x(),{devices:r,errorMessage:i,isLoading:a,isSupported:o,refresh:s}=Mi(),c;e[0]===s?c=e[1]:(c=e=>{s({requestPermission:e})},e[0]=s,e[1]=c);let l;return e[2]!==r||e[3]!==i||e[4]!==a||e[5]!==o||e[6]!==t||e[7]!==n||e[8]!==c?(l=(0,$.jsx)(Li,{devices:r,errorMessage:i,isLoading:a,isSupported:o,onDeviceChange:n,onRefresh:c,preferredDeviceId:t}),e[2]=r,e[3]=i,e[4]=a,e[5]=o,e[6]=t,e[7]=n,e[8]=c,e[9]=l):l=e[9],l}var zi=`https://discord.gg/kvBU6tJhcJ`,Bi=`https://github.com/get-bb/bb`;function Vi(e){let t=(0,Z.c)(16),{description:n,href:r,icon:i,iconClassName:a,label:o,openLabel:s}=e,c;t[0]===r?c=t[1]:(c=()=>{oe(r)},t[0]=r,t[1]=c);let l;t[2]===a?l=t[3]:(l=R(`size-3.5 shrink-0`,a),t[2]=a,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,$.jsx)(P,{name:i,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(P,{name:`ExternalLink`,className:`size-3 shrink-0 text-muted-foreground`}),t[7]=d):d=t[7];let f;t[8]!==s||t[9]!==c||t[10]!==u?(f=(0,$.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2.5 text-xs`,"aria-label":s,onClick:c,children:[u,s,d]}),t[8]=s,t[9]=c,t[10]=u,t[11]=f):f=t[11];let p;return t[12]!==n||t[13]!==o||t[14]!==f?(p=(0,$.jsx)(X,{label:o,description:n,children:f}),t[12]=n,t[13]=o,t[14]=f,t[15]=p):p=t[15],p}function Hi(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Y,{title:`Community`,description:`Chat with other bb users and follow development on GitHub.`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsx)(Vi,{label:`Discord`,description:`Join the server for support, feedback, and announcements.`,href:zi,icon:`DiscordLogo`,iconClassName:`text-brand-discord`,openLabel:`Join Discord`}),(0,$.jsx)(Vi,{label:`GitHub`,description:`Source code, issues, and releases for the bb project.`,href:Bi,icon:`GithubLogo`,openLabel:`View on GitHub`})]})}),e[0]=t):t=e[0],t}var Ui=!1,Wi=new Set;function Gi(){for(let e of Wi)e()}function Ki(e){return Wi.add(e),()=>{Wi.delete(e)}}function qi(){return Ui}function Ji(e){return e instanceof Error&&e.message.length>0?e.message:`The update check did not complete.`}function Yi(e){Ui||(Ui=!0,Gi(),e().catch(e=>{k.error(`Update check failed`,{description:Ji(e)})}).finally(()=>{Ui=!1,Gi()}))}var Xi=`# Changelog
3
3
 
4
- ## 0.43.2
4
+ ## 0.43.3
5
5
 
6
6
  Save messages as drafts, annotate pages for your agent, and watch browser automation live in chat. This release also redesigns handoffs and improves everyday navigation, configuration across machines, and conversation performance.
7
7
 
@@ -1034,4 +1034,4 @@ This release expands agent and model support, introduces a redesigned Settings e
1034
1034
 
1035
1035
  New experiment to let you connect to bb from other computers.
1036
1036
  `;function Zi(e){let t=[],n=null,r=null,i=[],a=()=>n?r?r.blocks:n.lede:null,o=()=>{if(i.length===0)return;let e=i.join(` `).trim();i=[];let t=a();e&&t&&t.push({kind:`paragraph`,text:e})};for(let s of e.split(`
1037
- `)){let e=s.trimEnd();if(e.startsWith(`## `)&&!e.startsWith(`### `)){o(),r=null,n={version:e.slice(3).trim(),lede:[],sections:[]},t.push(n);continue}if(n){if(e.startsWith(`### `)){o(),r={title:e.slice(4).trim(),blocks:[]},n.sections.push(r);continue}if(e.startsWith(`- `)){o();let t=a();if(!t)continue;let n=t.at(-1),r=n?.kind===`list`?n:null;r||(r={kind:`list`,items:[]},t.push(r)),r.items.push(e.slice(2).trim());continue}if(e.startsWith(` `)&&e.trim()){let t=a()?.at(-1);if(t?.kind===`list`&&t.items.length>0){t.items[t.items.length-1]+=` ${e.trim()}`;continue}}if(!e.trim()){o();continue}i.push(e.trim())}}return o(),t}var Qi={"0.43.2":{date:`September 18, 2026`,headline:`Saved drafts, browser annotations, and live browser previews`},"0.43.0":{date:`September 11, 2026`,headline:`Custom environments, machine plugins, and browser control`},"0.42.0":{date:`September 5, 2026`,headline:`Account Pooler, push notifications, and a new plugin catalog`},"0.41.0":{date:`September 1, 2026`,headline:`Scheduled sends, concurrency limits, and a rebuilt mobile app`},"0.40.0":{date:`August 26, 2026`,headline:`File Editor, quick palette, and agent providers`},"0.39.0":{date:`August 19, 2026`,headline:`Faster large threads and a long list of fixes`},"0.38.0":{date:`August 15, 2026`,headline:`Extensions Page and Plugin Marketplaces`},"0.37.0":{date:`August 11, 2026`,headline:`A much faster mobile app`},"0.36.0":{date:`August 8, 2026`,headline:`Fixes and improvements`},"0.35.0":{date:`August 4, 2026`,headline:`Plugins`},"0.34.0":{date:`July 28, 2026`,headline:`Fresher models, cross-provider questions`},"0.33.0":{date:`July 21, 2026`,headline:`Quieter updates and safer approvals`},"0.0.31":{date:`July 17, 2026`,headline:`Splits for everyone`},"0.0.30":{date:`July 14, 2026`,headline:`Multi-machine workflows and bb Connect`},"0.0.29":{date:`July 9, 2026`,headline:`More agents, more models, redesigned Settings`}},$i=`https://raw.githubusercontent.com/get-bb/bb/main/CHANGELOG.md`,ea=Zi(Xi)[0]??null;async function ta(e,t){let n=await e($i,{signal:t});if(!n.ok)throw Error(`Changelog request failed (${n.status})`);let[r]=Zi(await n.text());if(r===void 0)throw Error(`The changelog has no releases`);return r}var na=new Map,ra=`https://getbb.app/changelog`,ia=5*6e4,aa=`bb.settings.updates.dismissed-changelog-version`,oa=2e3,sa=180;function ca(e,t){let n=/^\d+(?:\.\d+)*$/;if(!n.test(e)||!n.test(t))return e!==t;let r=e.split(`.`).map(Number),i=t.split(`.`).map(Number),a=Math.max(r.length,i.length);for(let e=0;e<a;e+=1){let t=r[e]??0,n=i[e]??0;if(t!==n)return t>n}return!1}var la=1;function ua(e){let t=(0,Z.c)(32),{label:n,tooltipLabel:r,icon:i,iconPosition:a,visibleLabel:o,className:s,variant:c,loading:l,disabled:u,disabledReason:d,onClick:f}=e,p=a===void 0?`start`:a,m=l===void 0?!1:l,h=u===void 0?!1:u;if(o===void 0){let e=c===`default`&&`bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground`,a;t[0]!==s||t[1]!==e?(a=R(`size-7`,e,s),t[0]=s,t[1]=e,t[2]=a):a=t[2];let o;t[3]===f?o=t[4]:(o=()=>f?.(),t[3]=f,t[4]=o);let l;return t[5]!==h||t[6]!==d||t[7]!==i||t[8]!==n||t[9]!==m||t[10]!==a||t[11]!==o||t[12]!==r?(l=(0,$.jsx)(Mn,{label:n,tooltipLabel:r,icon:i,loading:m,disabled:h,disabledReason:d,className:a,onClick:o}),t[5]=h,t[6]=d,t[7]=i,t[8]=n,t[9]=m,t[10]=a,t[11]=o,t[12]=r,t[13]=l):l=t[13],l}let g=c===void 0||c===`ghost`,_=c??`ghost`,v=g&&`text-subtle-foreground hover:text-foreground`,y;t[14]!==s||t[15]!==v?(y=R(`h-7 gap-1.5 px-2.5 font-normal`,v,s),t[14]=s,t[15]=v,t[16]=y):y=t[16];let b=p===`end`?o:null,x=m?`Spinner`:i,S=m&&`animate-spin`,C;t[17]===S?C=t[18]:(C=R(`size-3.5`,S),t[17]=S,t[18]=C);let w;t[19]!==C||t[20]!==x?(w=(0,$.jsx)(P,{"aria-hidden":!0,name:x,className:C}),t[19]=C,t[20]=x,t[21]=w):w=t[21];let T=p===`start`?o:null,E;return t[22]!==h||t[23]!==n||t[24]!==m||t[25]!==f||t[26]!==w||t[27]!==T||t[28]!==_||t[29]!==y||t[30]!==b?(E=(0,$.jsxs)(J,{type:`button`,variant:_,size:`sm`,"aria-label":n,"aria-busy":m,disabled:h,className:y,onClick:f,children:[b,w,T]}),t[22]=h,t[23]=n,t[24]=m,t[25]=f,t[26]=w,t[27]=T,t[28]=_,t[29]=y,t[30]=b,t[31]=E):E=t[31],E}var da=`grid min-w-0 grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-3`,fa=`py-2 first:pt-0 last:pb-0`;function pa(e){let t=(0,Z.c)(8),{leading:n,children:r,className:i}=e,a;t[0]===i?a=t[1]:(a=R(da,fa,`text-sm`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center`,children:n}),t[2]=n,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:a,children:[o,r]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function ma(e){let t=(0,Z.c)(6),{current:n,latest:r}=e;if(n===null)return null;let i;t[0]!==n||t[1]!==r?(i=r!==null&&r!==n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`px-1`,children:`→`}),(0,$.jsx)(`span`,{className:`font-semibold text-version-upgrade`,children:r})]}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]!==n||t[4]!==i?(a=(0,$.jsxs)(`span`,{"data-version-metadata":!0,className:`min-w-0 shrink text-2xs text-muted-foreground`,children:[n,i]}),t[3]=n,t[4]=i,t[5]=a):a=t[5],a}function ha(e){let t=(0,Z.c)(9),{name:n,detail:r,current:i,latest:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n}),t[0]=n,t[1]=o);let s;t[2]!==i||t[3]!==a?(s=(0,$.jsx)(ma,{current:i,latest:a}),t[2]=i,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==r||t[6]!==o||t[7]!==s?(c=(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[o,r,s]}),t[5]=r,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function ga(e){return ur[e].tone===`error`?`font-semibold text-destructive`:`font-semibold text-subtle-foreground`}function _a(e){let t=(0,Z.c)(5),{state:n,children:r}=e,i;t[0]===n?i=t[1]:(i=R(`shrink-0 text-xs`,ga(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,$.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function va(e){let t=(0,Z.c)(47),{state:n,actionIcon:r,actionLabel:i,actionTooltip:a,buttonLeading:o,buttonLabel:s,loading:c,live:l,onClick:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=ur[n],m=r??p.icon,h=n===`failed`?dr:null,g=d||p.inFlight===!0,_=p.label,v=p.inFlight!==!0;if(u!==void 0&&s!==void 0){let e;t[0]!==i||t[1]!==_?(e=[_,i].filter(Boolean),t[0]=i,t[1]=_,t[2]=e):e=t[2];let n=e.join(` · `),r;t[3]!==h||t[4]!==o||t[5]!==d?(r=d?(0,$.jsx)(P,{"aria-hidden":!0,name:`Loading`,className:`size-3 animate-spin`}):o===void 0?h===null?null:(0,$.jsx)(P,{"aria-hidden":!0,name:h,className:`size-3`}):o,t[3]=h,t[4]=o,t[5]=d,t[6]=r):r=t[6];let a;return t[7]!==s||t[8]!==d||t[9]!==u||t[10]!==n||t[11]!==r?(a=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,"aria-label":n,"aria-busy":d,disabled:d,className:`h-6 shrink-0 gap-1.5 px-2 text-xs`,onClick:u,children:[r,s]})}),t[7]=s,t[8]=d,t[9]=u,t[10]=n,t[11]=r,t[12]=a):a=t[12],a}if(u!==void 0&&m!==null){let e;t[13]!==i||t[14]!==_?(e=[_,i].filter(Boolean),t[13]=i,t[14]=_,t[15]=e):e=t[15];let n=e.join(` · `),r=a??i??p.label,o;return t[16]!==m||t[17]!==d||t[18]!==u||t[19]!==n||t[20]!==r?(o=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsx)(ua,{label:n,tooltipLabel:r,icon:m,loading:d,onClick:u})}),t[16]=m,t[17]=d,t[18]=u,t[19]=n,t[20]=r,t[21]=o):o=t[21],o}if(m===null){let e;return t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`flex h-7 shrink-0 items-center`}),t[22]=e):e=t[22],e}let y=f?`status`:void 0,b=f?`polite`:void 0,x=g&&`animate-spin`,S=p.tone===`muted`&&(n===`up-to-date`?`text-input`:`text-subtle-foreground`),C=p.tone===`error`&&`text-destructive`,w;t[23]!==x||t[24]!==S||t[25]!==C?(w=R(`size-4`,x,S,C),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26];let T;t[27]!==m||t[28]!==w?(T=(0,$.jsx)(P,{"aria-hidden":!0,name:m,className:w}),t[27]=m,t[28]=w,t[29]=T):T=t[29];let E;t[30]===_?E=t[31]:(E=(0,$.jsx)(`span`,{className:`sr-only`,children:_}),t[30]=_,t[31]=E);let D;t[32]!==n||t[33]!==E||t[34]!==y||t[35]!==b||t[36]!==T?(D=(0,$.jsxs)(`span`,{role:y,"aria-live":b,"data-update-state":n,className:`flex size-7 shrink-0 items-center justify-center`,children:[T,E]}),t[32]=n,t[33]=E,t[34]=y,t[35]=b,t[36]=T,t[37]=D):D=t[37];let O=D;if(!v){let e;return t[38]===O?e=t[39]:(e=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:O}),t[38]=O,t[39]=e),e}let k;t[40]===O?k=t[41]:(k=(0,$.jsx)(ct,{asChild:!0,children:O}),t[40]=O,t[41]=k);let A;t[42]===p.label?A=t[43]:(A=(0,$.jsx)(Et,{children:p.label}),t[42]=p.label,t[43]=A);let j;return t[44]!==k||t[45]!==A?(j=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsx)(pt,{delayDuration:250,children:(0,$.jsxs)(Mt,{children:[k,A]})})}),t[44]=k,t[45]=A,t[46]=j):j=t[46],j}function ya(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center justify-end gap-1`,children:n}),t[0]=n,t[1]=r),r}var ba={p:({children:e})=>(0,$.jsx)($.Fragment,{children:e}),a:({children:e,href:t})=>(0,$.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,onClick:e=>{e.preventDefault(),t!==void 0&&oe(t)},children:e}),code:({children:e})=>(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-foreground`,children:e}),strong:({children:e})=>(0,$.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e})};function xa(e){let t=(0,Z.c)(2),{text:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(_n,{components:ba,skipHtml:!0,children:n}),t[0]=n,t[1]=r),r}function Sa({blocks:e,lede:t=!1}){return e.map((e,n)=>e.kind===`list`?(0,$.jsx)(`ul`,{className:`mt-2.5 space-y-1.5`,children:e.items.map(e=>(0,$.jsx)(`li`,{className:`relative pl-4 text-sm leading-normal text-muted-foreground before:absolute before:left-0 before:top-2 before:size-1 before:rounded-sm before:bg-border`,children:(0,$.jsx)(xa,{text:e})},e))},n):(0,$.jsx)(`p`,{className:R(`mt-2.5 text-sm leading-relaxed text-muted-foreground first:mt-0`,t&&`text-foreground/80`),children:(0,$.jsx)(xa,{text:e.text})},n))}function Ca(){let e=(0,Z.c)(83),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[`updates`,`changelog`,`latest`],e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={queryKey:t,queryFn:Ea,placeholderData:ea??void 0,retry:!1,staleTime:ia},e[1]=n):n=e[1];let r=l(n),i=r.data??ea,[a,o]=(0,Q.useState)(Ta),[s,c]=(0,Q.useState)(null),u=et(),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(!1),m;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{e!==null&&p(e.scrollTop+e.clientHeight<e.scrollHeight-1)},e[2]=m):m=e[2];let h=m,g;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{h(d.current)},e[3]=g):g=e[3];let _;e[4]===i?_=e[5]:(_=[i],e[4]=i,e[5]=_),(0,Q.useEffect)(g,_);let v,y;e[6]===s?(v=e[7],y=e[8]):(v=()=>{if(s?.phase!==`confirming`)return;let e=window.setTimeout(()=>{c(e=>e?.version===s.version?{...e,phase:`exiting`}:e)},oa);return()=>window.clearTimeout(e)},y=[s],e[6]=s,e[7]=v,e[8]=y),(0,Q.useEffect)(v,y);let b,x;if(e[9]!==s||e[10]!==u?(b=()=>{if(s?.phase!==`exiting`)return;let e=s.version,t=window.setTimeout(()=>{o(e),c(t=>t?.version===e?null:t)},u?0:sa);return()=>window.clearTimeout(t)},x=[s,u],e[9]=s,e[10]=u,e[11]=b,e[12]=x):(b=e[11],x=e[12]),(0,Q.useEffect)(b,x),i===null||a.length>0&&(r.dataUpdatedAt===0||!ca(i.version,a)))return null;let S=Qi[i.version],C=s?.version===i.version?s.phase:`visible`,w=C===`visible`,T=C===`exiting`?`-mb-6 grid-rows-[0fr] -translate-y-1 opacity-0`:`grid-rows-[1fr] translate-y-0 opacity-100`,E;e[13]===T?E=e[14]:(E=R(`grid transition-[grid-template-rows,margin,opacity,transform] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none [&>section]:min-h-0 [&>section]:overflow-hidden`,T),e[13]=T,e[14]=E);let D=!w,O=w?`grid-rows-[1fr] opacity-100`:`pointer-events-none grid-rows-[0fr] opacity-0`,k;e[15]===O?k=e[16]:(k=R(`grid transition-[grid-template-rows,opacity] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,O),e[15]=O,e[16]=k);let A;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`h2`,{className:`min-w-0`,children:(0,$.jsx)(`span`,{"data-changelog-label":!0,className:`inline-flex rounded-sm border border-border bg-muted/40 px-2.5 py-1 text-xs font-medium leading-none text-muted-foreground`,children:`What's new`})}),e[17]=A):A=e[17];let j;e[18]!==i.version||e[19]!==w?(j=w?(0,$.jsxs)(Mt,{delayDuration:300,disableHoverableContent:!0,children:[(0,$.jsx)(ct,{asChild:!0,children:(0,$.jsx)(J,{"data-changelog-dismiss":!0,type:`button`,variant:`ghost`,size:`icon`,className:`size-7 text-muted-foreground hover:text-foreground`,"aria-label":`Dismiss bb ${i.version} changelog preview`,onClick:()=>{It.setItem(aa,i.version),c({phase:`confirming`,version:i.version})},children:(0,$.jsx)(P,{"aria-hidden":!0,name:`X`,className:`size-3.5`})})}),(0,$.jsx)(Et,{side:`bottom`,children:`Dismiss`})]}):null,e[18]=i.version,e[19]=w,e[20]=j):j=e[20];let M;e[21]===j?M=e[22]:(M=(0,$.jsxs)(`div`,{"data-changelog-header":!0,className:`flex min-w-0 items-center justify-between gap-4`,children:[A,j]}),e[21]=j,e[22]=M);let N;e[23]!==i.version||e[24]!==S?(N=S===void 0?null:(0,$.jsxs)(`div`,{className:`mt-4 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`span`,{"data-changelog-version":i.version,className:`inline-flex rounded-full border border-border bg-muted/30 px-2.5 py-1 font-mono text-xs font-semibold leading-none tracking-tight text-foreground`,children:i.version}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:S.date})]}),e[23]=i.version,e[24]=S,e[25]=N):N=e[25];let F=S===void 0?`mt-4`:`mt-3`,I;e[26]===F?I=e[27]:(I=R(`relative min-w-0`,F),e[26]=F,e[27]=I);let L;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>h(e.currentTarget),e[28]=L):L=e[28];let z=S?.headline??i.version,B;e[29]===z?B=e[30]:(B=(0,$.jsx)(`h3`,{className:`text-lg font-semibold leading-snug tracking-tight text-foreground`,children:z}),e[29]=z,e[30]=B);let V;e[31]===i.lede?V=e[32]:(V=i.lede.length===0?null:(0,$.jsx)(`div`,{className:`mt-2`,children:(0,$.jsx)(Sa,{blocks:i.lede,lede:!0})}),e[31]=i.lede,e[32]=V);let H;e[33]===i.sections?H=e[34]:(H=i.sections.map(wa),e[33]=i.sections,e[34]=H);let U;e[35]!==B||e[36]!==V||e[37]!==H?(U=(0,$.jsxs)(`div`,{ref:d,"data-changelog-release-scroll":!0,onScroll:L,className:`max-h-56 overflow-y-auto pr-3`,children:[B,V,H]}),e[35]=B,e[36]=V,e[37]=H,e[38]=U):U=e[38];let W;e[39]===f?W=e[40]:(W=f?(0,$.jsx)(ge,{placement:`below`,inset:!0}):null,e[39]=f,e[40]=W);let G;e[41]!==I||e[42]!==U||e[43]!==W?(G=(0,$.jsxs)(`div`,{className:I,children:[U,W]}),e[41]=I,e[42]=U,e[43]=W,e[44]=G):G=e[44];let K;e[45]!==M||e[46]!==N||e[47]!==G?(K=(0,$.jsxs)(`article`,{"data-changelog-preview":!0,className:`min-w-0 p-4 sm:p-5`,children:[M,N,G]}),e[45]=M,e[46]=N,e[47]=G,e[48]=K):K=e[48];let q=!w,ee=`Open the full bb ${i.version} changelog`,te;e[49]===i.version?te=e[50]:(te=()=>oe(`${ra}#${i.version.replaceAll(`.`,`-`)}`),e[49]=i.version,e[50]=te);let ne;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(P,{"aria-hidden":!0,name:`ExternalLink`,className:`size-3.5`}),e[51]=ne):ne=e[51];let re;e[52]!==q||e[53]!==ee||e[54]!==te?(re=(0,$.jsx)(`div`,{"data-changelog-footer":!0,className:`flex items-center justify-end border-t border-foreground bg-foreground px-4 py-2.5 text-background sm:px-5`,children:(0,$.jsxs)(`button`,{type:`button`,disabled:q,"aria-label":ee,onClick:te,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-xs font-semibold text-background underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-background`,children:[`Full changelog`,ne]})}),e[52]=q,e[53]=ee,e[54]=te,e[55]=re):re=e[55];let ie;e[56]!==K||e[57]!==re?(ie=(0,$.jsxs)(`div`,{className:`min-h-0 overflow-hidden`,children:[K,re]}),e[56]=K,e[57]=re,e[58]=ie):ie=e[58];let ae;e[59]!==D||e[60]!==k||e[61]!==ie?(ae=(0,$.jsx)(`div`,{"data-changelog-release-panel":!0,"aria-hidden":D,className:k,children:ie}),e[59]=D,e[60]=k,e[61]=ie,e[62]=ae):ae=e[62];let se=w?`pointer-events-none grid-rows-[0fr] opacity-0`:`grid-rows-[1fr] opacity-100`,ce;e[63]===se?ce=e[64]:(ce=R(`grid transition-[grid-template-rows,opacity] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,se),e[63]=se,e[64]=ce);let le;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(P,{"aria-hidden":!0,name:`CircleCheck`,className:`size-4 text-muted-foreground`}),e[65]=le):le=e[65];let ue;e[66]===i.version?ue=e[67]:(ue=(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[le,(0,$.jsx)(`span`,{className:`inline-flex rounded-full border border-border bg-muted/30 px-2.5 py-1 font-mono text-xs font-semibold leading-none tracking-tight text-foreground`,children:i.version})]}),e[66]=i.version,e[67]=ue);let de,fe;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(`h3`,{className:`mt-3 text-lg font-semibold leading-snug tracking-tight text-foreground`,children:`You're all caught up`}),fe=(0,$.jsx)(`p`,{className:`mt-1.5 text-sm leading-relaxed text-muted-foreground`,children:`We'll show the next bb release here.`}),e[68]=de,e[69]=fe):(de=e[68],fe=e[69]);let pe;e[70]===ue?pe=e[71]:(pe=(0,$.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:(0,$.jsx)(`div`,{className:`p-4 text-center sm:p-5`,children:(0,$.jsxs)(`div`,{className:`mx-auto max-w-sm`,children:[ue,de,fe]})})}),e[70]=ue,e[71]=pe);let me;e[72]!==w||e[73]!==ce||e[74]!==pe?(me=(0,$.jsx)(`div`,{"data-changelog-dismiss-confirmation":!0,role:`status`,"aria-live":`polite`,"aria-hidden":w,className:ce,children:pe}),e[72]=w,e[73]=ce,e[74]=pe,e[75]=me):me=e[75];let he;e[76]!==ae||e[77]!==me?(he=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-lg border border-border bg-card`,children:[ae,me]}),e[76]=ae,e[77]=me,e[78]=he):he=e[78];let _e;return e[79]!==C||e[80]!==E||e[81]!==he?(_e=(0,$.jsx)(`div`,{"data-updates-domain":`changelog`,"data-changelog-dismiss-phase":C,className:E,children:he}),e[79]=C,e[80]=E,e[81]=he,e[82]=_e):_e=e[82],_e}function wa(e){return(0,$.jsxs)(`div`,{className:`mt-4`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),(0,$.jsx)(Sa,{blocks:e.blocks})]},e.title)}function Ta(){return It.getItem(aa,``)}function Ea(e){let{signal:t}=e;return ta(fetch,t)}function Da(e){let t=(0,Z.c)(43),{systemVersion:n,desktopInfo:r,isDesktop:i,onRelaunchDesktop:a,onRetryDesktop:o,isChecking:s}=e,c=s===void 0?!1:s,l;t[0]===c?l=t[1]:(l=c?(0,$.jsx)(va,{live:!0,state:`in-progress`}):(0,$.jsx)(va,{state:`up-to-date`}),t[0]=c,t[1]=l);let u=l,d=Oa;if(i&&r===null){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=d((0,$.jsx)(ha,{name:`bb app`,current:null,latest:null}),(0,$.jsx)(va,{live:!0,state:`in-progress`})),t[2]=e):e=t[2],e}if(r!==null){let e=r.pendingVersion??r.latestVersion,n=r.updateAvailable?e:null,i;t[3]!==r.version||t[4]!==n?(i=(0,$.jsx)(ha,{name:`bb app`,current:r.version,latest:n}),t[3]=r.version,t[4]=n,t[5]=i):i=t[5];let s=i;if(r.updateDownloaded){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(lr,{className:`size-3`}),t[6]=e):e=t[6];let n;t[7]===a?n=t[8]:(n=(0,$.jsx)(va,{state:`restart-required`,buttonLeading:e,buttonLabel:`Relaunch`,actionLabel:`Relaunch bb to finish updating`,onClick:()=>a?.()}),t[7]=a,t[8]=n);let r;return t[9]!==s||t[10]!==n?(r=d(s,n),t[9]=s,t[10]=n,t[11]=r):r=t[11],r}if(r.downloadState===`downloading`){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(va,{live:!0,state:`in-progress`}),t[12]=e):e=t[12];let n;return t[13]===s?n=t[14]:(n=d(s,e),t[13]=s,t[14]=n),n}if(r.downloadState===`failed`){let e;t[15]===o?e=t[16]:(e=(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:`Retry the download`,onClick:()=>o?.()}),t[15]=o,t[16]=e);let n;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(_a,{state:`failed`,children:`Download failed`}),t[17]=n):n=t[17];let r;return t[18]!==s||t[19]!==e?(r=d(s,e,n),t[18]=s,t[19]=e,t[20]=r):r=t[20],r}if(r.updateAvailable){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(va,{state:`update-available`}),t[21]=e):e=t[21];let n;return t[22]===s?n=t[23]:(n=d(s,e),t[22]=s,t[23]=n),n}let c;return t[24]!==s||t[25]!==u?(c=d(s,u),t[24]=s,t[25]=u,t[26]=c):c=t[26],c}if(n===void 0){let e;return t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=d((0,$.jsx)(ha,{name:`bb app`,current:null,latest:null}),(0,$.jsx)(va,{state:`in-progress`})),t[27]=e):e=t[27],e}let f;t[28]!==n.updateAvailable||t[29]!==n.upgradeCommand?(f=n.updateAvailable?(0,$.jsx)(`span`,{className:`hidden truncate font-mono text-2xs text-muted-foreground sm:inline`,children:n.upgradeCommand}):void 0,t[28]=n.updateAvailable,t[29]=n.upgradeCommand,t[30]=f):f=t[30];let p=n.updateAvailable?n.latestVersion:null,m;t[31]!==n.currentVersion||t[32]!==f||t[33]!==p?(m=(0,$.jsx)(ha,{name:`bb app`,detail:f,current:n.currentVersion,latest:p}),t[31]=n.currentVersion,t[32]=f,t[33]=p,t[34]=m):m=t[34];let h=m;if(n.updateAvailable){let e;t[35]===n.upgradeCommand?e=t[36]:(e=(0,$.jsx)(va,{state:`update-available`,actionIcon:`Copy`,actionLabel:`Copy the upgrade command`,actionTooltip:`Copy command`,onClick:()=>{Ae(n.upgradeCommand,{successMessage:`Upgrade command copied`,errorMessage:`Couldn't copy upgrade command`})}}),t[35]=n.upgradeCommand,t[36]=e);let r;return t[37]!==h||t[38]!==e?(r=d(h,e),t[37]=h,t[38]=e,t[39]=r):r=t[39],r}let g;return t[40]!==h||t[41]!==u?(g=d(h,u),t[40]=h,t[41]=u,t[42]=g):g=t[42],g}function Oa(e,t,n){return(0,$.jsxs)(pa,{leading:(0,$.jsx)(`span`,{"data-bb-update-role":`app`,"aria-hidden":!0,children:(0,$.jsx)(lr,{className:`size-4`})}),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[e,n]}),(0,$.jsx)(ya,{children:t})]})}function ka(e){return e.statusError||e.canRetryDaemonUpdate||e.host.status!==`connected`}function Aa(e){return e.canRetryDaemonUpdate||e.host.status!==`connected`||e.statusError||e.statusPending||e.providerStatus===null?[]:e.issues.filter(at)}function ja(e){return e.canRetryDaemonUpdate||e.host.status!==`connected`||e.statusError||e.statusPending||e.providerStatus===null?[]:Gt(e.providerStatus).filter(e=>e.status.installed)}function Ma(e){let t=(0,Z.c)(27),{machine:n,now:r,retryUpdatePending:i,onRetryDaemonUpdate:a,onOpenMachine:o}=e,{host:s}=n,c;t[0]!==s||t[1]!==n.canRetryDaemonUpdate||t[2]!==r?(c=n.canRetryDaemonUpdate&&Ve(s,r),t[0]=s,t[1]=n.canRetryDaemonUpdate,t[2]=r,t[3]=c):c=t[3];let l=c,u=n.canRetryDaemonUpdate&&!l,d;t[4]===s?d=t[5]:(d=Ie(s)&&!Re(s),t[4]=s,t[5]=d);let f=d,p=s.status!==`connected`,m;t[6]!==f||t[7]!==l?(m=l?(0,$.jsx)(_a,{state:`failed`,children:`Update didn't finish`}):f?(0,$.jsx)(_a,{state:`offline`,children:`Update this app to reconnect`}):null,t[6]=f,t[7]=l,t[8]=m):m=t[8];let h=m,g=`Open ${s.name} settings`,_;t[9]!==s.id||t[10]!==o?(_=()=>o(s.id),t[9]=s.id,t[10]=o,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`span`,{"data-bb-update-role":`daemon`,"aria-hidden":!0,children:(0,$.jsx)(lr,{className:`size-4`})}),t[12]=v):v=t[12];let y;t[13]!==s.id||t[14]!==s.name||t[15]!==f||t[16]!==p||t[17]!==a||t[18]!==i||t[19]!==l||t[20]!==u?(y=u?(0,$.jsx)(va,{live:!0,state:`in-progress`}):l?(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:`Retry on ${s.name} now`,loading:i,onClick:()=>a(s.id)}):f||p?(0,$.jsx)(va,{state:`offline`}):null,t[13]=s.id,t[14]=s.name,t[15]=f,t[16]=p,t[17]=a,t[18]=i,t[19]=l,t[20]=u,t[21]=y):y=t[21];let b;return t[22]!==h||t[23]!==g||t[24]!==_||t[25]!==y?(b=(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:g,onOpen:_,leading:v,title:`bb daemon`,state:h,trailingMeta:null,actions:y}),t[22]=h,t[23]=g,t[24]=_,t[25]=y,t[26]=b):b=t[26],b}function Na(e){let t=(0,Z.c)(16),{machine:n,onRecheckClis:r,onOpenMachine:i}=e,{host:a}=n,o=`Open ${a.name} settings`,s;t[0]!==a.id||t[1]!==i?(s=()=>i(a.id),t[0]=a.id,t[1]=i,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(P,{"aria-hidden":!0,name:`Terminal`,className:`size-3.5 text-muted-foreground`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(_a,{state:`failed`,children:`Couldn't check for updates`}),t[4]=l):l=t[4];let u=`Check ${a.name}'s CLIs again`,d;t[5]!==a.id||t[6]!==r?(d=()=>r(a.id),t[5]=a.id,t[6]=r,t[7]=d):d=t[7];let f;t[8]!==n.statusFetching||t[9]!==u||t[10]!==d?(f=(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:u,loading:n.statusFetching,onClick:d}),t[8]=n.statusFetching,t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==o||t[13]!==s||t[14]!==f?(p=(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:o,onOpen:s,leading:c,title:`Provider CLIs`,state:l,trailingMeta:null,actions:f}),t[12]=o,t[13]=s,t[14]=f,t[15]=p):p=t[15],p}function Pa({issue:e}){return e===null?`up-to-date`:e.action===null?`update-manually`:`update-available`}function Fa(e){let t=(0,Z.c)(12),{machine:n,runningJobKey:r,queuedJobKeys:i,failuresByJobKey:a,onStartInstall:o,onOpenProvider:s}=e,c=a===void 0?na:a,{host:l}=n,u=Qt().data,d,f;if(t[0]!==c||t[1]!==l||t[2]!==n||t[3]!==s||t[4]!==o||t[5]!==u||t[6]!==i||t[7]!==r){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ja(n),t=new Map(Aa(n).map(Ia));if(e.length===0){f=null;break bb0}d=e.map(e=>{let{provider:n,status:a}=e,d=t.get(n)??null,f=Pa({issue:d}),p=bt(l.id,n),m=r===p,h=i.has(p),g=c.get(p)??null,_=d!==null&&g?.issueFingerprint===d.fingerprint?g:null,v=d!==null&&C(d)&&!m&&!h,y=n,b=u?.find(e=>e.id===y),x=U(`agent`,y,b??null)?.icon;return(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:`Open ${a.displayName} settings`,onOpen:()=>s(y),leading:x===void 0?null:(0,$.jsx)(`span`,{"data-provider-icon":y,"aria-hidden":!0,className:`flex size-3.5 shrink-0 items-center justify-center`,children:(0,$.jsx)(x,{className:`size-3.5 text-muted-foreground`})}),title:a.displayName,titleMeta:(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,$.jsx)(ma,{current:a.currentVersion,latest:d===null?null:a.latestVersion}),_===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_a,{state:`failed`,children:`Failed`}),(0,$.jsx)(`code`,{role:`alert`,className:`rounded bg-muted/70 px-1.5 py-0.5 font-mono text-xs text-destructive`,children:_.logDialogState.message})]})]}),trailingMeta:null,actions:m||h?(0,$.jsx)(va,{live:!0,state:`in-progress`}):_===null?f===null?null:(0,$.jsx)(va,{state:f,actionLabel:v?`${d.action.label} ${a.displayName} on ${l.name}`:void 0,actionTooltip:v?d.action.label:void 0,onClick:v?()=>o(l.id,d):void 0}):(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(ua,{label:`View ${a.displayName} update log`,tooltipLabel:`View log`,icon:`File`,onClick:()=>Bt(_.logDialogState)}),v?(0,$.jsx)(va,{state:`failed`,actionLabel:`Retry ${a.displayName} on ${l.name}`,actionTooltip:`Retry`,onClick:()=>o(l.id,d)}):null]})},n)})}t[0]=c,t[1]=l,t[2]=n,t[3]=s,t[4]=o,t[5]=u,t[6]=i,t[7]=r,t[8]=d,t[9]=f}else d=t[8],f=t[9];if(f!==Symbol.for(`react.early_return_sentinel`))return f;let p=d,m;return t[10]===p?m=t[11]:(m=(0,$.jsx)($.Fragment,{children:p}),t[10]=p,t[11]=m),m}function Ia(e){return[e.provider,e]}function La(e){let t=(0,Z.c)(19),{machine:n,isThisMachine:r,showServerBadge:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(P,{name:`Laptop`,className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===n.host.name?s=t[2]:(s=(0,$.jsx)(`span`,{className:`truncate`,children:n.host.name}),t[1]=n.host.name,t[2]=s);let c;t[3]===r?c=t[4]:(c=r?(0,$.jsx)(qn,{children:`This machine`}):null,t[3]=r,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,$.jsx)(qn,{children:`Server`}):null,t[5]=i,t[6]=l);let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[o,s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d;t[11]===a?d=t[12]:(d=(0,$.jsx)(Gn,{children:a}),t[11]=a,t[12]=d);let f;t[13]!==u||t[14]!==d?(f=(0,$.jsx)(`div`,{"data-updates-domain":`machine`,children:(0,$.jsx)(Y,{title:u,children:d})}),t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==n.host.id||t[17]!==f?(p=(0,$.jsx)(`div`,{"data-updates-machine":n.host.id,children:f}),t[16]=n.host.id,t[17]=f,t[18]=p):p=t[18],p}function Ra(e){let t=(0,Z.c)(5),{action:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,$.jsx)(`div`,{className:`space-y-6 pt-1.5`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,$.jsx)(Y,{action:n,bodyClassName:`border-0 bg-transparent p-0`,description:`Manage bb and provider CLI updates across all machines.`,title:`Machine updates`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function za(e){let t=(0,Z.c)(3),[n,r]=(0,Q.useState)(Ba),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{let t=setInterval(()=>r(Date.now()),e);return()=>clearInterval(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function Ba(){return Date.now()}function Va(e){let t=(0,Z.c)(84),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{showChangelogPreview:r}=n,i=r===void 0?!1:r,a=_(),o=m(),s=Lt(),{localDaemonHostId:c}=Dt(),l=Xe().data?.primaryHostId??null,{desktopApi:u,desktopInfo:d,isDesktop:f}=ie(),p=Bn(),h=(0,Q.useSyncExternalStore)(Ki,qi),g=za(3e4),{failuresByJobKey:v,queuedJobKeys:y,runningJobKey:b,startInstall:x}=kt(),S,C;if(t[2]!==s.machines||t[3]!==y||t[4]!==b){C=s.machines.flatMap(Ja);let e;t[7]!==y||t[8]!==b?(e=e=>{let{hostId:t,issue:n}=e,r=bt(t,n.provider);return b!==r&&!y.has(r)},t[7]=y,t[8]=b,t[9]=e):e=t[9],S=C.filter(qa).filter(e),t[2]=s.machines,t[3]=y,t[4]=b,t[5]=S,t[6]=C}else S=t[5],C=t[6];let w=S,T;t[10]===s.machines?T=t[11]:(T=s.machines.filter(Ka).map(Ga),t[10]=s.machines,t[11]=T);let E=T,D;t[12]!==E||t[13]!==u||t[14]!==a?(D=function(){Yi(async()=>{u===null?se({queryClient:a,version:await ke.system.version({force:!0})}):await u.checkForUpdates(),await Promise.all(E.map(e=>Je({queryClient:a,hostId:e})))})},t[12]=E,t[13]=u,t[14]=a,t[15]=D):D=t[15];let O=D,A=!s.isLoading,j=(0,Q.useRef)(!1),M;t[16]!==O||t[17]!==A?(M=()=>{j.current||!A||(j.current=!0,O())},t[16]=O,t[17]=A,t[18]=M):M=t[18];let N;t[19]===A?N=t[20]:(N=[A],t[19]=A,t[20]=N),(0,Q.useEffect)(M,N);let P=d?.updateAvailable===!0||s.systemVersion?.updateAvailable===!0||s.appUpdateAvailable,F,I;if(t[21]!==s.machines||t[22]!==g){F=s.machines.filter(ka);let e;t[25]===g?e=t[26]:(e=e=>e.canRetryDaemonUpdate&&Ve(e.host,g),t[25]=g,t[26]=e),I=F.filter(e),t[21]=s.machines,t[22]=g,t[23]=F,t[24]=I}else F=t[23],I=t[24];let L=I,R;t[27]===s.machines?R=t[28]:(R=s.machines.find(Wa)??s.machines[0]??null,t[27]=s.machines,t[28]=R);let z=R,B,V,H,U,W;if(t[29]!==w||t[30]!==z?.host||t[31]!==P||t[32]!==u||t[33]!==d||t[34]!==v||t[35]!==s.machines||t[36]!==s.systemVersion||t[37]!==h||t[38]!==f||t[39]!==c||t[40]!==o||t[41]!==g||t[42]!==a||t[43]!==y||t[44]!==F.length||t[45]!==p||t[46]!==b||t[47]!==l||t[48]!==i||t[49]!==L||t[50]!==x||t[51]!==C){let e;t[57]===z?.host?e=t[58]:(e=e=>e.host.id===z?.host.id||ka(e)||ja(e).length>0,t[57]=z?.host,t[58]=e);let n=s.machines.filter(e),r=P||C.length>0||L.length>0,m=F.length===0,_=!r&&!m&&f&&d===null,S;t[59]!==s.machines||t[60]!==p?(S=function(e){p.mutate(e,{onSuccess:()=>{let t=s.machines.find(t=>t.host.id===e);k.success(`Retrying the update on ${t?.host.name??`the requested machine`}`)}})},t[59]=s.machines,t[60]=p,t[61]=S):S=t[61];let T=S,E;t[62]!==p||t[63]!==L?(E=function(){for(let e of L)p.mutate(e.host.id);k.success(`Retrying the update on ${L.length} machines`)},t[62]=p,t[63]=L,t[64]=E):E=t[64];let D=E,O;t[65]!==w||t[66]!==x?(O=w.length>1?(0,$.jsx)(ua,{label:`Update all ${w.length} CLI tools`,tooltipLabel:`Update all`,icon:pr,visibleLabel:`Update all`,variant:`default`,onClick:()=>{for(let{hostId:e,issue:t}of w)x({hostId:e,issue:t})}}):null,t[65]=w,t[66]=x,t[67]=O):O=t[67];let A=O,j;t[68]!==D||t[69]!==L.length?(j=L.length>la?(0,$.jsx)(ua,{label:`Update all ${L.length} machines now`,visibleLabel:`Retry all`,icon:`RotateCcw`,iconPosition:`end`,variant:`default`,className:`font-medium`,onClick:D}):null,t[68]=D,t[69]=L.length,t[70]=j):j=t[70];let M=j,N;t[71]!==M||t[72]!==A?(N=M!==null||A!==null?(0,$.jsxs)(`div`,{role:`toolbar`,"aria-label":`Bulk update actions`,className:`flex flex-wrap items-center justify-end gap-2`,children:[M,A]}):null,t[71]=M,t[72]=A,t[73]=N):N=t[73];let I=N;U=`space-y-6`,t[74]===i?W=t[75]:(W=i?(0,$.jsx)(Ca,{}):null,t[74]=i,t[75]=W),B=Ra,V=I,H=n.length===0?(0,$.jsx)(jn,{state:`empty`,message:`No machines available.`}):n.map(e=>{let t=e.host.id===z?.host.id,n=e.canRetryDaemonUpdate||e.host.status!==`connected`;return(0,$.jsxs)(La,{machine:e,isThisMachine:s.machines.length>1&&e.host.id===c,showServerBadge:e.host.id===l,children:[t?(0,$.jsx)(Da,{systemVersion:s.systemVersion,desktopInfo:d,isDesktop:f,isChecking:h,onRelaunchDesktop:u===null||_?null:()=>{u.installUpdate().catch(Ua)},onRetryDesktop:u===null||_?null:()=>{u.checkForUpdates().catch(Ha)}}):null,n?(0,$.jsx)(Ma,{machine:e,now:g,retryUpdatePending:p.isPending&&p.variables===e.host.id,onRetryDaemonUpdate:T,onOpenMachine:e=>o(Rt(e))}):null,e.statusError?(0,$.jsx)(Na,{machine:e,onRecheckClis:e=>{Je({queryClient:a,hostId:e})},onOpenMachine:e=>o(Rt(e))}):null,(0,$.jsx)(Fa,{machine:e,runningJobKey:b,queuedJobKeys:y,failuresByJobKey:v,onStartInstall:(e,t)=>x({hostId:e,issue:t}),onOpenProvider:()=>o(Be(`providers`))})]},e.host.id)}),t[29]=w,t[30]=z?.host,t[31]=P,t[32]=u,t[33]=d,t[34]=v,t[35]=s.machines,t[36]=s.systemVersion,t[37]=h,t[38]=f,t[39]=c,t[40]=o,t[41]=g,t[42]=a,t[43]=y,t[44]=F.length,t[45]=p,t[46]=b,t[47]=l,t[48]=i,t[49]=L,t[50]=x,t[51]=C,t[52]=B,t[53]=V,t[54]=H,t[55]=U,t[56]=W}else B=t[52],V=t[53],H=t[54],U=t[55],W=t[56];let G;t[76]!==B||t[77]!==V||t[78]!==H?(G=(0,$.jsx)(B,{action:V,children:H}),t[76]=B,t[77]=V,t[78]=H,t[79]=G):G=t[79];let K;return t[80]!==U||t[81]!==W||t[82]!==G?(K=(0,$.jsxs)(`div`,{className:U,children:[W,G]}),t[80]=U,t[81]=W,t[82]=G,t[83]=K):K=t[83],K}function Ha(e){k.error(`Update retry failed`,{description:Ji(e)})}function Ua(e){k.error(`Relaunch failed`,{description:Ji(e)})}function Wa(e){return e.isPrimary}function Ga(e){return e.host.id}function Ka(e){return e.host.status===`connected`}function qa(e){return C(e.issue)}function Ja(e){return Aa(e).map(t=>({hostId:e.host.id,issue:t}))}var Ya=new Set([`Alt`,`Control`,`Meta`,`OS`,`Shift`]),Xa=new Set(Se);function Za(e,t){if(Ya.has(e.key)||e.key===`Dead`||e.key===`Unidentified`)return null;let n=Ee(e);if(n.length===0||n.length>32)return null;let r=Zt(t),i=r?e.metaKey:e.ctrlKey;return{key:n.length===1?n.toLowerCase():n,mod:i,meta:e.metaKey&&!(i&&r),control:e.ctrlKey&&!(i&&!r),alt:e.altKey,shift:e.shiftKey}}function Qa(e,t){return e.key.toLowerCase()===t.key.toLowerCase()&&e.mod===t.mod&&e.meta===t.meta&&e.control===t.control&&e.alt===t.alt&&e.shift===t.shift}function $a(e,t){return t.mod||t.meta||t.control||t.alt||/^F(?:[1-9]|1[0-9]|2[0-4])$/u.test(t.key)||Xa.has(e)}function eo(e,t,n,r,i){let a=Zt(i),o=null,s=!1;for(let t=e.length-1;t>=0;--t){let i=e[t];if(i?.command===n&&F(i,{isDesktop:r,isMac:a})){s=!0,o=i.shortcut;break}}if(!s)return null;let c=t.find(e=>e.command===n);return c===void 0?o:c.shortcut}function to(e,t,n,r){let i=Zt(r);return e.some(e=>e.command===t&&F(e,{isDesktop:n,isMac:i}))}function no(e,t,n,r,i,a){let o=eo(e,[],n,i,a),s=r!==null&&o!==null&&Qa(r,o),c=new Map(t.map(e=>[e.command,e.shortcut]));return s?c.delete(n):c.set(n,r),[...new Set([...Ye,...[...c.keys()].sort()])].flatMap(e=>c.has(e)?[{command:e,shortcut:c.get(e)??null}]:[])}function ro(e,t){return e.filter(e=>e.command!==t)}function io(e,t,n,r,i){let a=eo(e,t,n,r,i);return a===null?[]:[...new Set(e.map(e=>e.command))].filter(o=>{if(o===n)return!1;let s=eo(e,t,o,r,i);return s!==null&&w(a,s,i)})}var ao=[],oo=`rounded-none bg-transparent px-0 py-0 text-foreground opacity-100`,so=`bg-muted/40 px-1.5 py-0.5 text-foreground opacity-100`,co=`rounded-none border-l border-border bg-transparent px-1.5 py-0.5 text-foreground opacity-100`;function lo(e,t){return e===t||e!==null&&t!==null&&Qa(e,t)}var uo=(0,Q.memo)(function(e){let t=(0,Z.c)(34),{label:n,command:r,disabled:i,onChange:a,onRecordingChange:o,recording:s,shortcut:c}=e,l=it(),[u,d]=(0,Q.useState)(null),f=c===null?null:vt(c,l),p=f?.label??`unassigned`,m;t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==l||t[4]!==s||t[5]!==d?(m=function(e){if(!s)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){d(null),o(null);return}let t=Za(e,l);if(t===null){d(`Press a non-modifier key.`);return}if(!$a(r,t)){d(`Use Command, Control, or Alt with a key.`);return}d(null),a(r,t),o(null)},t[0]=r,t[1]=a,t[2]=o,t[3]=l,t[4]=s,t[5]=d,t[6]=m):m=t[6];let h=m,g=s?`Recording shortcut for ${n}. Press keys or Escape to cancel.`:`Record shortcut for ${n}, current shortcut ${p}`,_=s&&`border-ring text-foreground`,v;t[7]===_?v=t[8]:(v=R(`h-7 min-w-24 px-2 text-xs`,_),t[7]=_,t[8]=v);let y;t[9]!==o||t[10]!==d?(y=()=>{d(null),o(null)},t[9]=o,t[10]=d,t[11]=y):y=t[11];let b;t[12]!==r||t[13]!==o||t[14]!==s||t[15]!==d?(b=()=>{s||(d(null),o(r))},t[12]=r,t[13]=o,t[14]=s,t[15]=d,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==f?(x=s?`Press keys`:f===null?`Unassigned`:(0,$.jsx)(W,{className:oo,shortcut:f}),t[17]=s,t[18]=f,t[19]=x):x=t[19];let S;t[20]!==i||t[21]!==h||t[22]!==s||t[23]!==g||t[24]!==v||t[25]!==y||t[26]!==b||t[27]!==x?(S=(0,$.jsx)(J,{"aria-label":g,"aria-pressed":s,className:v,disabled:i,onBlur:y,onClick:b,onKeyDown:h,size:`sm`,type:`button`,variant:`outline`,children:x}),t[20]=i,t[21]=h,t[22]=s,t[23]=g,t[24]=v,t[25]=y,t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;t[29]===u?C=t[30]:(C=u?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:u}):null,t[29]=u,t[30]=C);let w;return t[31]!==S||t[32]!==C?(w=(0,$.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[S,C]}),t[31]=S,t[32]=C,t[33]=w):w=t[33],w},function(e,t){return e.label===t.label&&e.command===t.command&&e.disabled===t.disabled&&e.onChange===t.onChange&&e.onRecordingChange===t.onRecordingChange&&e.recording===t.recording&&lo(e.shortcut,t.shortcut)});function fo({label:e,description:t,labels:n,defaultConflicts:r,command:i,defaults:a,isDesktop:o,overrides:s,platform:c}){let l=eo(a,s,i,o,c),u=s.some(e=>e.command===i),d=a.filter(e=>e.command===i),f=eo(a,[],i,!1,c),p=eo(a,[],i,!0,c),m=to(a,i,o,c),h=d.length>0&&d.every(e=>e.desktopOnly);return{availableOnClient:m,command:i,conflicts:(u?io(a,s,i,o,c):[]).map(e=>n.get(e)??e),label:e,description:t,defaultConflicts:r.map(e=>n.get(e)??e),customized:u,desktopDefaultShortcut:p,desktopOnly:h,shortcut:l,webDefaultShortcut:f}}function po(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function mo(e,t){return e.command===t.command&&e.label===t.label&&e.description===t.description&&po(e.defaultConflicts,t.defaultConflicts)&&e.availableOnClient===t.availableOnClient&&e.customized===t.customized&&e.desktopOnly===t.desktopOnly&&lo(e.shortcut,t.shortcut)&&lo(e.webDefaultShortcut,t.webDefaultShortcut)&&lo(e.desktopDefaultShortcut,t.desktopDefaultShortcut)&&po(e.conflicts,t.conflicts)}var ho=(0,Q.memo)(function(e){let t=(0,Z.c)(72),{model:n,onChange:r,onReset:i,onRecordingChange:a,pending:o,platform:s,recording:c}=e,{availableOnClient:l,command:u,conflicts:d,customized:f,desktopDefaultShortcut:p,desktopOnly:m,shortcut:h,webDefaultShortcut:g}=n,_=n,v,y,b,x,S,C;if(t[0]!==f||t[1]!==p||t[2]!==m||t[3]!==_.description||t[4]!==_.label||t[5]!==o||t[6]!==s||t[7]!==g){let e=g!==null&&p!==null&&!Qa(g,p)?[{label:`Web`,shortcut:g},{label:`Desktop`,shortcut:p}]:null,n=e===null?g??p:null;S=o||void 0;let r=o&&`opacity-50`;t[14]===r?C=t[15]:(C=R(`flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:gap-5`,r),t[14]=r,t[15]=C),v=`min-w-0 flex-1`;let i;t[16]===_.label?i=t[17]:(i=(0,$.jsx)(`p`,{className:`text-sm text-foreground`,children:_.label}),t[16]=_.label,t[17]=i);let a;t[18]===m?a=t[19]:(a=m?(0,$.jsx)(qn,{children:`Desktop`}):null,t[18]=m,t[19]=a);let c;t[20]===f?c=t[21]:(c=f?(0,$.jsx)(qn,{children:`Custom`}):null,t[20]=f,t[21]=c),t[22]!==c||t[23]!==i||t[24]!==a?(y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[i,a,c]}),t[22]=c,t[23]=i,t[24]=a,t[25]=y):y=t[25],t[26]===_.description?b=t[27]:(b=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-snug text-subtle-foreground/75`,children:_.description}),t[26]=_.description,t[27]=b),x=e!==null||n!==null?(0,$.jsxs)(`div`,{"aria-label":`${e===null?`Default shortcut`:`Default shortcuts`} for ${_.label}`,className:`mt-1.5 flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-subtle-foreground/75`,children:e===null?`Default:`:`Defaults:`}),n===null?e?.map(e=>(0,$.jsxs)(`span`,{className:`inline-flex items-stretch overflow-hidden rounded border border-border text-foreground`,children:[(0,$.jsx)(`span`,{className:`inline-flex items-center bg-muted/40 px-1.5 text-2xs leading-none text-subtle-foreground`,children:e.label}),(0,$.jsx)(W,{ariaHidden:!1,className:co,shortcut:vt(e.shortcut,s)})]},e.label)):(0,$.jsx)(W,{ariaHidden:!1,className:so,shortcut:vt(n,s)})]}):null,t[0]=f,t[1]=p,t[2]=m,t[3]=_.description,t[4]=_.label,t[5]=o,t[6]=s,t[7]=g,t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S,t[13]=C}else v=t[8],y=t[9],b=t[10],x=t[11],S=t[12],C=t[13];let w;t[28]===n.defaultConflicts?w=t[29]:(w=n.defaultConflicts.length>0?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-warning-text`,children:[`Default shortcut left unbound: also used by`,` `,n.defaultConflicts.join(`, `),`.`]}):null,t[28]=n.defaultConflicts,t[29]=w);let T;t[30]===d?T=t[31]:(T=d.length>0?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-warning-text`,children:[`Also used by `,d.join(`, `),`. Context determines which command runs.`]}):null,t[30]=d,t[31]=T);let E;t[32]!==v||t[33]!==y||t[34]!==b||t[35]!==x||t[36]!==w||t[37]!==T?(E=(0,$.jsxs)(`div`,{className:v,children:[y,b,x,w,T]}),t[32]=v,t[33]=y,t[34]=b,t[35]=x,t[36]=w,t[37]=T,t[38]=E):E=t[38];let D=!l,O;t[39]!==u||t[40]!==_.label||t[41]!==r||t[42]!==a||t[43]!==c||t[44]!==h||t[45]!==D?(O=(0,$.jsx)(uo,{label:_.label,command:u,disabled:D,onChange:r,onRecordingChange:a,recording:c,shortcut:h}),t[39]=u,t[40]=_.label,t[41]=r,t[42]=a,t[43]=c,t[44]=h,t[45]=D,t[46]=O):O=t[46];let k=`Clear shortcut for ${_.label}`,A=!l||h===null,j;t[47]!==u||t[48]!==r?(j=()=>r(u,null),t[47]=u,t[48]=r,t[49]=j):j=t[49];let M;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(P,{name:`X`,className:`size-3.5`}),t[50]=M):M=t[50];let N;t[51]!==k||t[52]!==A||t[53]!==j?(N=(0,$.jsx)(J,{"aria-label":k,className:`size-7`,disabled:A,onClick:j,size:`icon`,type:`button`,variant:`ghost`,children:M}),t[51]=k,t[52]=A,t[53]=j,t[54]=N):N=t[54];let F=`Reset shortcut for ${_.label}`,I=!l||!f,L;t[55]!==u||t[56]!==i?(L=()=>i(u),t[55]=u,t[56]=i,t[57]=L):L=t[57];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`RotateCcw`,className:`size-3.5`}),t[58]=z):z=t[58];let B;t[59]!==F||t[60]!==I||t[61]!==L?(B=(0,$.jsx)(J,{"aria-label":F,className:`size-7`,disabled:I,onClick:L,size:`icon`,type:`button`,variant:`ghost`,children:z}),t[59]=F,t[60]=I,t[61]=L,t[62]=B):B=t[62];let V;t[63]!==O||t[64]!==N||t[65]!==B?(V=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-end gap-1`,children:[O,N,B]}),t[63]=O,t[64]=N,t[65]=B,t[66]=V):V=t[66];let H;return t[67]!==V||t[68]!==S||t[69]!==C||t[70]!==E?(H=(0,$.jsxs)(`div`,{"aria-busy":S,className:C,children:[E,V]}),t[67]=V,t[68]=S,t[69]=C,t[70]=E,t[71]=H):H=t[71],H},function(e,t){return e.onChange===t.onChange&&e.onReset===t.onReset&&e.onRecordingChange===t.onRecordingChange&&e.pending===t.pending&&e.platform===t.platform&&e.recording===t.recording&&mo(e.model,t.model)});function go(){let e=Xe(),t=Zn(),{isPending:n,mutate:r}=tr(),i=we()!==null,a=it(),o=e.data?.generalSettings??z,{defaults:s,commands:c,conflicts:l}=ve(),u=(0,Q.useMemo)(()=>[...D,{label:`Plugin commands`,commands:c.map(e=>({command:B(e.pluginId,e.id),label:e.title,description:`Plugin: ${e.pluginId}`}))}],[c]),d=(0,Q.useMemo)(()=>new Map(u.flatMap(e=>e.commands.map(e=>[e.command,e.label]))),[u]),[f,p]=(0,Q.useState)(null),m=e.data?.keybindingOverrides??ao,h=JSON.stringify(m),[g,_]=(0,Q.useState)(()=>({sourceKey:h,value:m})),v=g.sourceKey===h?g.value:m,[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(``),C=(0,Q.useRef)(null),w=(0,Q.useMemo)(()=>new Map(u.flatMap(e=>e.commands.map(({command:e,label:t,description:n})=>[e,fo({command:e,label:t,description:n,labels:d,defaultConflicts:l.get(e)??[],defaults:s,isDesktop:i,overrides:v,platform:a})]))),[u,l,s,i,d,v,a]),T=(0,Q.useMemo)(()=>{let e=x.trim().toLowerCase();return e.length===0?u:u.flatMap(t=>{let n=t.commands.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.command.toLowerCase().includes(e));return n.length===0?[]:[{...t,commands:n}]})},[u,x]),E=(0,Q.useRef)({defaults:s,isDesktop:i,overrides:v,platform:a,serverOverridesKey:h});(0,Q.useLayoutEffect)(()=>{E.current={defaults:s,isDesktop:i,overrides:v,platform:a,serverOverridesKey:h}},[s,i,v,a,h]);let O=(0,Q.useCallback)((e,t,n,i)=>{C.current=t,_({sourceKey:i,value:e}),r(e,{onError:()=>_({sourceKey:i,value:n})})},[r]),k=(0,Q.useCallback)((e,t,n)=>{let r=E.current,i=no(r.defaults,r.overrides,e,t,r.isDesktop,r.platform),a=io(r.defaults,i,e,r.isDesktop,r.platform);if(t!==null&&a.length>0&&!n){p({command:e,shortcut:t,conflicts:a});return}if(n)for(let e of a)i=no(r.defaults,i,e,null,r.isDesktop,r.platform);p(null),O(i,e,r.overrides,r.serverOverridesKey)},[O]),A=(0,Q.useCallback)((e,t)=>k(e,t,!1),[k]),j=(0,Q.useCallback)(e=>{let t=E.current;O(ro(t.overrides,e),e,t.overrides,t.serverOverridesKey)},[O]),M=n?C.current:null,N=e.data===void 0||n,P=v.length>0;return(0,$.jsx)(Y,{action:(0,$.jsx)(J,{disabled:N||!P,onClick:()=>O([],null,v,h),size:`sm`,type:`button`,variant:`outline`,children:`Reset all`}),description:`Click a shortcut, then press its new keys. Changes sync to every bb window.`,title:`Keyboard shortcuts`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsx)(X,{description:`Show shortcut badges after holding Command or Control.`,label:`Show keyboard hints when holding CMD / Control`,children:(0,$.jsx)(xn,{"aria-label":`Show keyboard hints when holding CMD / Control`,checked:o.showKeyboardHints,disabled:e.data===void 0||t.isPending,onCheckedChange:e=>t.mutate({...o,showKeyboardHints:e})})}),(0,$.jsx)($e,{"aria-label":`Search keyboard shortcuts`,onChange:e=>S(e.target.value),placeholder:`Search shortcuts`,value:x}),f===null?null:(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded border border-border p-3`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Shortcut already used by`,` `,f.conflicts.map(e=>d.get(e)??e).join(`, `),`. Replace it with`,` `,d.get(f.command)??f.command,`?`]}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(J,{disabled:N,onClick:()=>k(f.command,f.shortcut,!0),size:`sm`,children:`Replace binding`}),(0,$.jsx)(J,{onClick:()=>p(null),size:`sm`,variant:`outline`,children:`Cancel`})]})]}),(0,$.jsxs)(`fieldset`,{className:R(`m-0 min-w-0 space-y-5 border-0 p-0`,n&&`[&:disabled_button:not([disabled])]:opacity-100`),disabled:N,children:[T.map(e=>(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-subtle-foreground`,children:e.label}),(0,$.jsx)(`div`,{className:`divide-y divide-border`,children:e.commands.map(e=>{let t=w.get(e.command);return t===void 0?null:(0,$.jsx)(ho,{model:t,onChange:A,onReset:j,onRecordingChange:b,pending:M===e.command,platform:a,recording:y===e.command},e.command)})})]},e.label)),T.length===0?(0,$.jsxs)(`p`,{className:`py-6 text-center text-sm text-subtle-foreground`,children:[`No shortcuts match “`,x,`”.`]}):null]})]})})}function _o(e){let t=(0,Z.c)(10),{source:n,className:r}=e;if(n.icon){let e=n.icon,i;t[0]===r?i=t[1]:(i=R(`shrink-0 object-contain`,r),t[0]=r,t[1]=i);let a;return t[2]!==n.icon||t[3]!==i?(a=(0,$.jsx)(`img`,{src:e,alt:``,"aria-hidden":!0,draggable:!1,className:i}),t[2]=n.icon,t[3]=i,t[4]=a):a=t[4],a}let i;t[5]===r?i=t[6]:(i=R(`flex shrink-0 items-center justify-center bg-muted/60 text-subtle-foreground`,r),t[5]=r,t[6]=i);let a;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(P,{name:`Globe`,className:`size-[60%]`}),t[7]=a):a=t[7];let o;return t[8]===i?o=t[9]:(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,children:a}),t[8]=i,t[9]=o),o}var vo=`bb:browser-import:records`;function yo(e){try{let t=e?.getItem(vo);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof t!=`object`||!t)continue;let n=t;typeof n.at!=`number`||typeof n.profileName!=`string`||typeof n.imported!=`number`||typeof n.skipped!=`number`||!Array.isArray(n.skippedDomains)||(r[e]={at:n.at,profileName:n.profileName,imported:n.imported,skipped:n.skipped,skippedDomains:n.skippedDomains.filter(e=>typeof e==`string`)})}return r}catch{return{}}}function bo(e){return e.unavailable===`browserRunning`?{step:`blocked`,reason:`browserRunning`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,checked:!1}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function xo(e){return e===`needsFullDiskAccess`?{step:`fullDiskAccess`,checked:!0}:{step:`blocked`,reason:e}}function So(e,t){switch(t){case`browserRunning`:case`needsFullDiskAccess`:case`needsKeychainApproval`:case`keychainItemMissing`:return{...e,unavailable:t};default:return null}}function Co(e,t){if(e===void 0)return{step:`blocked`,reason:`unknownSource`};let n=bo(e);return n.step===`fullDiskAccess`&&t.step===`fullDiskAccess`?{step:`fullDiskAccess`,checked:!0}:n}function wo(e){return e.step!==`importing`}function To(e){return e.unavailable===void 0&&e.profiles.length>1}function Eo(e,t){return e!==null&&t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??null}function Do(e,t,n){return{at:n,profileName:t,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains}}function Oo(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function ko(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Ao(e){return e.filter(e=>e.unavailable!==`unsupportedPlatform`&&e.unavailable!==`notInstalled`)}function jo(e){let t=0,n=!1;for(let r of e.profiles){if(r.cookieCount===void 0)return;t+=r.cookieCount,n=!0}return n?t:void 0}function Mo(e,t){let n=e.profiles.length,r=`${n} ${n===1?`profile`:`profiles`}`,i=jo(e);switch(e.unavailable){case`browserRunning`:return{status:`Running · quit ${e.name} to import`,tone:`attention`,details:[],action:`recheck`,actionLabel:`Recheck`};case`needsFullDiskAccess`:return{status:`Needs Full Disk Access`,tone:`attention`,details:[],action:`grant`,actionLabel:`Grant access…`};case`needsKeychainApproval`:return{status:`Needs Keychain access`,tone:`attention`,details:[],action:`import`,actionLabel:`Import…`};case`keychainItemMissing`:return{status:`No encryption key in Keychain`,tone:`idle`,details:[],action:`recheck`,actionLabel:`Recheck`};case void 0:break;default:return{status:`Unavailable`,tone:`idle`,details:[],action:`none`,actionLabel:`Import…`}}return n===0||i===0?{status:`No cookies yet`,tone:`idle`,details:n===0?[]:[r],action:`none`,actionLabel:`Import…`}:{status:`Ready`,tone:`ready`,details:t?[`${t.profileName} · ${Oo(t.imported)} imported`,...t.skipped>0?[`${t.skipped.toLocaleString()} skipped${t.skippedDomains.length>0?` (${ko(t.skippedDomains)})`:``}`]:[]]:i===void 0?[r]:[r,Oo(i)],action:`import`,actionLabel:`Import…`}}var No=`flex w-full items-center gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-state-hover`,Po=`border-surface-selected-border bg-surface-selected`,Fo=`border-border`;function Io(e){let t=(0,Z.c)(47),{source:n,desktopBrowser:r,onClose:i,onImported:a}=e,[o,s]=(0,Q.useState)(n),c;t[0]===n?c=t[1]:(c=()=>bo(n),t[0]=n,t[1]=c);let[l,u]=(0,Q.useState)(c),d;t[2]===n?d=t[3]:(d=()=>Eo(null,n),t[2]=n,t[3]=d);let[f,p]=(0,Q.useState)(d),m=(0,Q.useRef)(!0),h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>(m.current=!0,()=>{m.current=!1}),g=[],t[4]=h,t[5]=g):(h=t[4],g=t[5]),(0,Q.useEffect)(h,g);let _,v,y,b,x,S,C,w;if(t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==f||t[11]!==l){let e;t[20]===f?e=t[21]:(e=e=>e.directory===f,t[20]=f,t[21]=e);let n=o.profiles.find(e),c=()=>{if(f===null||n===void 0||!r.importCookies){u({step:`blocked`,reason:`unknownSourceProfile`});return}let e=n.name;u({step:`importing`}),r.importCookies({sourceId:o.id,sourceProfileDirectory:f,profile:{kind:`personal`}}).then(t=>{if(m.current){if(t.ok){a(o,e,t),i();return}u(xo(t.reason))}}).catch(()=>{m.current&&u({step:`blocked`,reason:`readFailed`})})},d;t[22]!==r||t[23]!==o.id||t[24]!==l?(d=()=>{if(!r.listImportSources)return;let e=l;u({step:`checking`}),r.listImportSources().then(t=>{if(!m.current)return;let n=t.sources.find(e=>e.id===o.id);n&&(s(n),p(e=>Eo(e,n))),u(Co(n,e))}).catch(()=>{m.current&&u({step:`blocked`,reason:`readFailed`})})},t[22]=r,t[23]=o.id,t[24]=l,t[25]=d):d=t[25];let h=d,g;t[26]===l?g=t[27]:(g=wo(l),t[26]=l,t[27]=g);let T=g,E;t[28]===o?E=t[29]:(E=e=>(0,$.jsxs)(q,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(_o,{source:o,className:`size-5 rounded-[5px]`}),e]}),t[28]=o,t[29]=E);let D=E;v=xt,w=!0,t[30]!==T||t[31]!==i?(y=e=>{!e&&T&&i()},t[30]=T,t[31]=i,t[32]=y):y=t[32],_=ue,b=!T,t[33]===T?(x=t[34],S=t[35]):(x=e=>{T||e.preventDefault()},S=e=>{T||e.preventDefault()},t[33]=T,t[34]=x,t[35]=S),C=l.step===`fullDiskAccess`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Allow Full Disk Access for ${o.name}`),(0,$.jsxs)(fe,{children:[o.name,` keeps its cookies in a protected folder. Turn on Full Disk Access for BB in System Settings → Privacy & Security, then come back. You can turn it off again after the import.`]})]}),l.checked?(0,$.jsx)(`p`,{className:`text-xs text-destructive-text`,children:`Full Disk Access is still off. macOS may require quitting and reopening BB before the grant applies.`}):null,(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Cancel`}),r.openFullDiskAccessSettings?(0,$.jsx)(J,{variant:`outline`,onClick:()=>r.openFullDiskAccessSettings?.(),children:`Open System Settings`}):null,(0,$.jsx)(J,{onClick:h,children:`I've turned it on`})]})]}):l.step===`checking`?(0,$.jsxs)(H,{children:[D(`Checking ${o.name}…`),(0,$.jsx)(fe,{children:`This only takes a moment.`})]}):l.step===`importing`?(0,$.jsxs)(H,{children:[D(`Importing from ${o.name}…`),(0,$.jsx)(fe,{children:`Reading and decrypting cookies. macOS may ask for Keychain access.`})]}):l.step===`blocked`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Can't import from ${o.name}`),(0,$.jsx)(fe,{children:A[l.reason]})]}),(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Close`}),Ne(l.reason)?(0,$.jsx)(J,{onClick:h,children:l.reason===`browserRunning`?`I've quit it`:`Try again`}):null]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Import from ${o.name}`),(0,$.jsx)(fe,{children:`Which profile's cookies should be copied into the BB browser?`})]}),(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Source profile`,className:`flex flex-col gap-1.5`,children:o.profiles.map(e=>{let t=e.directory===f;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:R(No,t?Po:Fo),onClick:()=>p(e.directory),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:R(`flex size-3.5 shrink-0 items-center justify-center rounded-full border`,t?`border-foreground`:`border-border`),children:t?(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-foreground`}):null}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name}),e.cookieCount===void 0?null:(0,$.jsx)(`span`,{className:`block text-xs text-subtle-foreground`,children:Oo(e.cookieCount)})]})]},e.directory)})}),(0,$.jsxs)(`p`,{className:`text-xs text-subtle-foreground`,children:[o.name,` must stay closed during the import. macOS may ask for Keychain access to its encryption key; choose Allow.`]}),(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Cancel`}),(0,$.jsx)(J,{onClick:c,disabled:f===null,children:n?.cookieCount===void 0?`Import`:`Import ${Oo(n.cookieCount)}`})]})]}),t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=f,t[11]=l,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w}else _=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19];let T;t[36]!==_||t[37]!==b||t[38]!==x||t[39]!==S||t[40]!==C?(T=(0,$.jsx)(_,{hideCloseButton:b,onEscapeKeyDown:x,onInteractOutside:S,children:C}),t[36]=_,t[37]=b,t[38]=x,t[39]=S,t[40]=C,t[41]=T):T=t[41];let E;return t[42]!==v||t[43]!==y||t[44]!==T||t[45]!==w?(E=(0,$.jsx)(v,{open:w,onOpenChange:y,children:T}),t[42]=v,t[43]=y,t[44]=T,t[45]=w,t[46]=E):E=t[46],E}var Lo={ready:`bg-success`,attention:`bg-warning`,idle:`border border-muted-foreground`};function Ro(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function zo(e){let t=(0,Z.c)(51),{source:n,record:r,now:i,pending:a,onImport:o,onRecheck:s}=e,c,l,u,d,f,p,m,h,g,_,v;if(t[0]!==i||t[1]!==r||t[2]!==n){u=Mo(n,r),l=u.action!==`none`,c=Kn,v=`browser-import-${n.id}`,g=`group -mx-2 flex min-w-0 flex-1 items-center gap-3 rounded-md px-2 py-1.5`,t[14]===n?_=t[15]:(_=(0,$.jsx)(_o,{source:n,className:`size-7 rounded-[7px]`}),t[14]=n,t[15]=_),m=`min-w-0 flex-1 space-y-0.5`;let e;t[16]===n.name?e=t[17]:(e=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:n.name}),t[16]=n.name,t[17]=e);let a;t[18]!==i||t[19]!==r?(a=r?(0,$.jsxs)(qn,{children:[`imported `,Me({timestamp:r.at,now:i})]}):null,t[18]=i,t[19]=r,t[20]=a):a=t[20],t[21]!==a||t[22]!==e?(h=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e,a]}),t[21]=a,t[22]=e,t[23]=h):h=t[23],d=`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-subtle-foreground/75`;let o=u.tone===`attention`&&`text-warning-text`,s;t[24]===o?s=t[25]:(s=R(`inline-flex shrink-0 items-center gap-1.5`,o),t[24]=o,t[25]=s);let y=Lo[u.tone],b;t[26]===y?b=t[27]:(b=R(`size-1.5 shrink-0 rounded-full`,y),t[26]=y,t[27]=b);let x;t[28]===b?x=t[29]:(x=(0,$.jsx)(`span`,{"aria-hidden":!0,className:b}),t[28]=b,t[29]=x),f=(0,$.jsxs)(`span`,{className:s,children:[x,u.status]}),p=u.details.map(Bo),t[0]=i,t[1]=r,t[2]=n,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v}else c=t[3],l=t[4],u=t[5],d=t[6],f=t[7],p=t[8],m=t[9],h=t[10],g=t[11],_=t[12],v=t[13];let y;t[30]!==d||t[31]!==f||t[32]!==p?(y=(0,$.jsxs)(`div`,{className:d,children:[f,p]}),t[30]=d,t[31]=f,t[32]=p,t[33]=y):y=t[33];let b;t[34]!==m||t[35]!==h||t[36]!==y?(b=(0,$.jsxs)(`div`,{className:m,children:[h,y]}),t[34]=m,t[35]=h,t[36]=y,t[37]=b):b=t[37];let x=!l||a,S=u.action===`recheck`?s:o,C;t[38]!==u.actionLabel||t[39]!==x||t[40]!==S?(C=(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,$.jsx)(J,{size:`sm`,variant:`outline`,disabled:x,onClick:S,children:u.actionLabel})}),t[38]=u.actionLabel,t[39]=x,t[40]=S,t[41]=C):C=t[41];let w;t[42]!==b||t[43]!==C||t[44]!==g||t[45]!==_?(w=(0,$.jsxs)(`div`,{className:g,children:[_,b,C]}),t[42]=b,t[43]=C,t[44]=g,t[45]=_,t[46]=w):w=t[46];let T;return t[47]!==c||t[48]!==w||t[49]!==v?(T=(0,$.jsx)(c,{"data-testid":v,children:w}),t[47]=c,t[48]=w,t[49]=v,t[50]=T):T=t[50],T}function Bo(e){return(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e},e)}function Vo({desktopBrowser:e}){let t=e?.listImportSources!==void 0,[n,r]=(0,Q.useState)({status:`loading`}),[i,a]=(0,Q.useState)(()=>yo(Ro())),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(()=>new Set),u=c.size>0,d=(0,Q.useCallback)(()=>{e?.listImportSources&&(r(e=>e.status===`ready`?e:{status:`loading`}),e.listImportSources().then(e=>r({status:`ready`,sources:e.sources})).catch(e=>r({status:`error`,message:e instanceof Error?e.message:`Could not check installed browsers.`})))},[e]);(0,Q.useEffect)(()=>{d()},[d]);let f=(e,t,n)=>{let r=Do(n,t,Date.now());a(t=>{let n={...t,[e.id]:r};try{Ro()?.setItem(vo,JSON.stringify(n))}catch{return n}return n}),k.success(n.imported>0?`Imported ${Oo(n.imported)} from ${e.name}`:`No cookies were imported from ${e.name}`)},p=t=>{let n=t.profiles[0];if(!n||!e?.importCookies){s(t);return}l(e=>new Set(e).add(t.id)),e.importCookies({sourceId:t.id,sourceProfileDirectory:n.directory,profile:{kind:`personal`}}).then(e=>{if(e.ok){f(t,n.name,e);return}let r=So(t,e.reason);r?s(r):k.error(`${t.name}: ${A[e.reason]}`)}).catch(()=>{k.error(`Could not read ${t.name}'s cookies.`)}).finally(()=>{l(e=>{let n=new Set(e);return n.delete(t.id),n}),d()})},m=n.status===`ready`?Ao(n.sources):[],h=Date.now();return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Y,{title:`Browsers`,description:`Bring signed-in sessions from a browser on this machine into the BB browser, so previews and agent tabs open already logged in.`,action:t?(0,$.jsx)(J,{variant:`ghost`,size:`sm`,onClick:d,disabled:n.status===`loading`,children:`Refresh`}):void 0,children:t?n.status===`loading`?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}):n.status===`error`?(0,$.jsx)(`p`,{className:`text-sm text-destructive-text`,children:n.message}):m.length===0?(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`No supported browsers were found on this machine.`}):(0,$.jsx)(Gn,{children:m.map(e=>(0,$.jsx)(zo,{source:e,record:i[e.id],now:h,pending:u,onRecheck:d,onImport:()=>{To(e)?s(e):e.unavailable===void 0?p(e):s(e)}},e.id))}):(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`Only available in the BB desktop app.`})}),t?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-subtle-foreground/75`,children:[`Also from the CLI: `,(0,$.jsx)(`code`,{children:`bb browser import-sources`}),` and`,` `,(0,$.jsx)(`code`,{children:`bb browser import-cookies`}),`.`]}):null,o&&e?(0,$.jsx)(Io,{source:o,desktopBrowser:e,onClose:()=>{s(null),d()},onImported:f},`${o.id}:${o.unavailable??`ready`}`):null]})}function Ho(){let e=(0,Z.c)(2),[t]=(0,Q.useState)(I),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Vo,{desktopBrowser:t}),e[0]=t,e[1]=n),n}var Uo=`manual`;function Wo(e){let t=(0,Z.c)(12),{open:n,onOpenChange:r}=e,i=_t(),a;t[0]!==i||t[1]!==r?(a=e=>{e||i.refetch(),r(e)},t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==o||t[4]!==n?(s=n&&(0,$.jsx)(Go,{onOpenChange:o}),t[3]=o,t[4]=n,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(ue,{className:`max-h-[calc(100dvh-2rem)] overflow-y-auto`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==o||t[9]!==n||t[10]!==c?(l=(0,$.jsx)(xt,{open:n,onOpenChange:o,modal:!1,children:c}),t[8]=o,t[9]=n,t[10]=c,t[11]=l):l=t[11],l}function Go(e){let t=(0,Z.c)(13),{onOpenChange:n}=e,r=Xe(),i=_t();if(!y(r.data?.serverAccess)){let e;t[0]===r?e=t[1]:(e=r.isPending?{status:`checking`}:r.isError?{status:`failed`,onRetry:()=>void r.refetch()}:{status:`blocked`},t[0]=r,t[1]=e);let i;t[2]===n?i=t[3]:(i=(0,$.jsx)(yr,{onNavigate:()=>n(!1)}),t[2]=n,t[3]=i);let a;return t[4]!==e||t[5]!==i?(a=(0,$.jsx)(qo,{state:e,children:i}),t[4]=e,t[5]=i,t[6]=a):a=t[6],a}let a=r.data?.primaryHostId??null,o;t[7]!==i.data||t[8]!==a?(o=i.data?.find(e=>e.id===a)?.name??null,t[7]=i.data,t[8]=a,t[9]=o):o=t[9];let s=o,c;return t[10]!==n||t[11]!==s?(c=(0,$.jsx)(Jo,{serverMachineName:s,onOpenChange:n}),t[10]=n,t[11]=s,t[12]=c):c=t[12],c}function Ko(e){return e===null?`The new machine will connect to your bb server. Keep the server machine on so the new machine can keep working.`:`The new machine will connect to the bb server on ${e}. Keep that computer on so the new machine can keep working.`}function qo(e){let t=(0,Z.c)(7),{state:n,children:r}=e;if(n.status===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{className:`sr-only`,children:`Add a machine`}),(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-subtle-foreground`,children:`Checking machine access…`})]}),t[0]=e):e=t[0],e}if(n.status===`failed`){let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(H,{children:[(0,$.jsx)(q,{children:`Add a machine`}),(0,$.jsx)(fe,{className:`text-destructive-text`,children:`Couldn’t check whether machines can reach this server.`})]}),t[1]=e):e=t[1];let r;return t[2]===n.onRetry?r=t[3]:(r=(0,$.jsxs)($.Fragment,{children:[e,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(J,{variant:`outline`,size:`sm`,onClick:n.onRetry,children:`Try again`})})]}),t[2]=n.onRetry,t[3]=r),r}let i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(H,{children:[(0,$.jsx)(q,{children:`Set up machine access`}),(0,$.jsx)(fe,{children:`A new machine has to reach this server over the network. Choose the address it should use.`})]}),t[4]=i):i=t[4];let a;return t[5]===r?a=t[6]:(a=(0,$.jsxs)($.Fragment,{children:[i,r]}),t[5]=r,t[6]=a),a}function Jo({serverMachineName:e,onOpenChange:t}){let n=(0,Q.useRef)(null),r=(0,Q.useRef)(null),i=(0,Q.useRef)(new Set),a=(0,Q.useRef)(0),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null);(0,Q.useEffect)(()=>()=>{a.current+=1,n.current?.abort(),r.current=null;for(let e of i.current)ke.hosts.delete({hostId:e}).catch(()=>void 0);i.current.clear()},[]);let u=p({meta:{showErrorToast:!1},mutationFn:async e=>{let t=a.current;if(e.replaceLaunch){n.current?.abort(),n.current=null;let e=[...i.current];i.current.clear(),await Promise.all(e.map(e=>ke.hosts.delete({hostId:e}))),r.current=null}s(null);let o=new AbortController;n.current=o,r.current??=cn();try{let e=await ke.hosts.experimental_create({key:r.current,machineProviderId:Uo,inputs:null,wait:!1,signal:o.signal});if(i.current.add(e.id),t!==a.current)throw i.current.delete(e.id),await ke.hosts.delete({hostId:e.id}),Error(`Machine setup closed`);let n=null;for(;e.lifecycle.phase===`creating`;)o.signal.throwIfAborted(),n===null&&(n=await ke.hosts.experimental_getEnrollmentCommand({hostId:e.id,signal:o.signal}),s(n===null?null:{value:n.command,expiresAt:n.expiresAt})),await new Promise(e=>setTimeout(e,1e3)),o.signal.throwIfAborted(),e=await ke.hosts.get({hostId:e.id,signal:o.signal});if(r.current=null,i.current.delete(e.id),e.lifecycle.phase!==`active`)throw Error(e.lifecycle.message??`Machine setup cancelled`);return e}finally{n.current===o&&(n.current=null)}},onSuccess:e=>{r.current=null,l(e)}}),d=u.mutate;return(0,Q.useEffect)(()=>{d({replaceLaunch:!1})},[d]),(0,$.jsx)(Yo,{command:o,connectedHost:c,serverMachineName:e,errorMessage:u.isError?De({error:u.error,fallbackMessage:`Couldn't prepare an enrollment command.`}):null,onRetry:()=>u.mutate({replaceLaunch:!1}),onRegenerate:()=>u.mutate({replaceLaunch:!0}),onOpenMachine:()=>t(!1)})}function Yo(e){let n=(0,Z.c)(24),{command:r,connectedHost:i,serverMachineName:a,errorMessage:o,onRetry:s,onRegenerate:c,onOpenMachine:l}=e,u;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(q,{children:`Add a machine`}),n[0]=u):u=n[0];let d=o===null?void 0:`text-destructive-text`,f=o??`Run this command on the machine you want to add. It installs bb and keeps the machine connected to this server.`,p;n[1]!==d||n[2]!==f?(p=(0,$.jsxs)(H,{children:[u,(0,$.jsx)(fe,{className:d,children:f})]}),n[1]=d,n[2]=f,n[3]=p):p=n[3];let m;n[4]!==o||n[5]!==s?(m=o===null?null:(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(J,{variant:`outline`,size:`sm`,onClick:s,children:`Try again`})}),n[4]=o,n[5]=s,n[6]=m):m=n[6];let h;n[7]!==r||n[8]!==c?(h=r===null?null:(0,$.jsx)(Zo,{command:r.value,expiresAt:r.expiresAt,onRegenerate:c},r.value),n[7]=r,n[8]=c,n[9]=h):h=n[9];let g;n[10]!==r||n[11]!==i||n[12]!==o||n[13]!==l?(g=o===null?(0,$.jsx)(`div`,{className:`flex items-center gap-2.5 rounded-md bg-muted/40 px-3 py-2.5`,children:i===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(P,{name:`Spinner`,className:`size-4 shrink-0 animate-spin text-muted-foreground`}),(0,$.jsx)(`span`,{role:`status`,className:`text-sm text-muted-foreground`,children:r===null?`Preparing an enrollment command…`:`Waiting for the machine to connect…`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{connected:!0}),(0,$.jsxs)(`span`,{role:`status`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:[i.name,` connected`]}),(0,$.jsx)(J,{asChild:!0,size:`sm`,variant:`ghost`,className:`h-7 shrink-0 px-2 text-xs`,children:(0,$.jsxs)(t,{to:Rt(i.id),onClick:l,children:[`Open machine`,(0,$.jsx)(P,{name:`ArrowRight`})]})})]})}):null,n[10]=r,n[11]=i,n[12]=o,n[13]=l,n[14]=g):g=n[14];let _;n[15]!==o||n[16]!==a?(_=o===null?(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:Ko(a)}):null,n[15]=o,n[16]=a,n[17]=_):_=n[17];let v;return n[18]!==p||n[19]!==m||n[20]!==h||n[21]!==g||n[22]!==_?(v=(0,$.jsxs)($.Fragment,{children:[p,m,h,g,_]}),n[18]=p,n[19]=m,n[20]=h,n[21]=g,n[22]=_,n[23]=v):v=n[23],v}function Xo(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function Zo(e){let t=(0,Z.c)(25),{command:n,expiresAt:r,onRegenerate:i}=e,a;t[0]===n?a=t[1]:(a={text:n},t[0]=n,t[1]=a);let{copied:o,copy:s}=Fe(a),c;t[2]===r?c=t[3]:(c=()=>r-Date.now(),t[2]=r,t[3]=c);let[l,u]=(0,Q.useState)(c),d,f;t[4]===r?(d=t[5],f=t[6]):(d=()=>{let e=setInterval(()=>u(r-Date.now()),1e3);return()=>clearInterval(e)},f=[r],t[4]=r,t[5]=d,t[6]=f),(0,Q.useEffect)(d,f);let p=l<=0,m;t[7]===n?m=t[8]:(m=(0,$.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap break-all p-3 font-mono text-xs text-foreground`,children:n}),t[7]=n,t[8]=m);let h;t[9]!==p||t[10]!==i||t[11]!==l?(h=p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-subtle-foreground`,children:`Command expired`}),(0,$.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:i,children:`Generate a new command`})]}):(0,$.jsxs)(`span`,{role:`status`,className:`text-xs tabular-nums text-subtle-foreground`,children:[`Command expires in `,Xo(l)]}),t[9]=p,t[10]=i,t[11]=l,t[12]=h):h=t[12];let g;t[13]===s?g=t[14]:(g=()=>void s(),t[13]=s,t[14]=g);let _=o?`Copied`:`Copy`,v;t[15]!==p||t[16]!==g||t[17]!==_?(v=(0,$.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,className:`ml-auto h-7 px-2.5 text-xs`,disabled:p,onClick:g,children:_}),t[15]=p,t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==h||t[20]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-border px-3 py-2`,children:[h,v]}),t[19]=h,t[20]=v,t[21]=y):y=t[21];let b;return t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border bg-muted/30`,children:[m,y]}),t[22]=y,t[23]=m,t[24]=b):b=t[24],b}var Qo=Object.fromEntries(yn.map(e=>[e.value,e])),$o=`min-h-9 px-2.5 py-2`,es={darwin:`macOS`,linux:`Linux`,wsl:`WSL`,unknown:null};function ts(e){let n=(0,Z.c)(108),{host:r,isPrimary:i,isThisMachine:a,showServerBadge:o,platformLabel:s,projectCount:c,now:l,onRename:u,onRemove:d,onRetryUpdate:f,onSuspend:p,onResume:h,onRetryCleanup:g,canMoveServerHere:_,onMoveServerHere:v,serverMoveEnabled:y,lifecycleActionPending:b,retryUpdatePending:x,machineProvider:S}=e,C=m(),w;n[0]===r.id?w=n[1]:(w=Rt(r.id),n[0]=r.id,n[1]=w);let E=w,D=Qo[r.maxPermissionMode],O=`${c} ${c===1?`project`:`projects`}`,k;n[2]!==r||n[3]!==l?(k=In({host:r,now:l}),n[2]=r,n[3]=l,n[4]=k):k=n[4];let A=k,j;n[5]===r?j=n[6]:(j=ne(r),n[5]=r,n[6]=j);let M=j,N=i||void 0,F=i&&`cursor-not-allowed focus:bg-transparent`,I;n[7]===F?I=n[8]:(I=R($o,F),n[7]=F,n[8]=I);let L;n[9]!==i||n[10]!==d?(L=e=>{if(i){e.preventDefault();return}d()},n[9]=i,n[10]=d,n[11]=L):L=n[11];let z,B;n[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`Trash2`,"aria-hidden":!0}),B=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Remove machine`}),n[12]=z,n[13]=B):(z=n[12],B=n[13]);let V;n[14]!==N||n[15]!==I||n[16]!==L?(V=(0,$.jsxs)(Nt,{variant:`destructive`,"aria-disabled":N,className:I,onSelect:L,children:[z,B]}),n[14]=N,n[15]=I,n[16]=L,n[17]=V):V=n[17];let H=V,U;n[18]!==E||n[19]!==C?(U=e=>{Tn(e)||C(E)},n[18]=E,n[19]=C,n[20]=U):U=n[20];let W;n[21]===r.id?W=n[22]:(W=Rt(r.id),n[21]=r.id,n[22]=W);let G=`Open ${r.name}`,K;n[23]!==r||n[24]!==S?(K=(0,$.jsx)(Sn,{host:r,machineProvider:S,nameClassName:`text-sm font-medium text-foreground`}),n[23]=r,n[24]=S,n[25]=K):K=n[25];let q;n[26]===a?q=n[27]:(q=a?(0,$.jsx)(qn,{children:`this machine`}):null,n[26]=a,n[27]=q);let ee;n[28]===o?ee=n[29]:(ee=o?(0,$.jsx)(qn,{children:`server`}):null,n[28]=o,n[29]=ee);let te;n[30]!==K||n[31]!==q||n[32]!==ee?(te=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[K,q,ee]}),n[30]=K,n[31]=q,n[32]=ee,n[33]=te):te=n[33];let re;n[34]===r?re=n[35]:(re=Ln(r),n[34]=r,n[35]=re);let ie;n[36]===re?ie=n[37]:(ie=(0,$.jsx)(T,{tone:re}),n[36]=re,n[37]=ie);let ae;n[38]===A?ae=n[39]:(ae=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:A}),n[38]=A,n[39]=ae);let oe;n[40]!==ie||n[41]!==ae?(oe=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[ie,ae]}),n[40]=ie,n[41]=ae,n[42]=oe):oe=n[42];let se;n[43]===s?se=n[44]:(se=s===null?null:(0,$.jsx)(`span`,{className:`truncate`,children:s}),n[43]=s,n[44]=se);let ce;n[45]===O?ce=n[46]:(ce=(0,$.jsx)(`span`,{className:`shrink-0`,children:O}),n[45]=O,n[46]=ce);let le=D.tone===`warning`&&`text-warning-text`,ue;n[47]===le?ue=n[48]:(ue=R(`shrink-0`,le),n[47]=le,n[48]=ue);let de;n[49]!==D.label||n[50]!==ue?(de=(0,$.jsx)(`span`,{className:ue,children:D.label}),n[49]=D.label,n[50]=ue,n[51]=de):de=n[51];let fe;n[52]===M?fe=n[53]:(fe=M===null?null:(0,$.jsx)(`span`,{className:`min-w-0 text-warning-text`,children:M}),n[52]=M,n[53]=fe);let pe;n[54]!==oe||n[55]!==se||n[56]!==ce||n[57]!==de||n[58]!==fe?(pe=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-subtle-foreground/75`,children:[oe,se,ce,de,fe]}),n[54]=oe,n[55]=se,n[56]=ce,n[57]=de,n[58]=fe,n[59]=pe):pe=n[59];let me;n[60]!==te||n[61]!==pe?(me=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[te,pe]}),n[60]=te,n[61]=pe,n[62]=me):me=n[62];let he;n[63]!==W||n[64]!==G||n[65]!==me?(he=(0,$.jsx)(t,{to:W,"aria-label":G,className:`flex min-w-0 flex-1 items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:me}),n[63]=W,n[64]=G,n[65]=me,n[66]=he):he=n[66];let ge=`${r.name} actions`,_e;n[67]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(P,{name:`MoreHorizontal`,className:`size-4`}),n[67]=_e):_e=n[67];let ve;n[68]===ge?ve=n[69]:(ve=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsx)(J,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 data-[state=open]:bg-state-active data-[state=open]:text-foreground`,"aria-label":ge,children:_e})}),n[68]=ge,n[69]=ve);let ye,be;n[70]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(P,{name:`Edit`,"aria-hidden":!0}),be=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Rename`}),n[70]=ye,n[71]=be):(ye=n[70],be=n[71]);let xe;n[72]===u?xe=n[73]:(xe=(0,$.jsxs)(Nt,{className:$o,onSelect:u,children:[ye,be]}),n[72]=u,n[73]=xe);let Se;n[74]!==r||n[75]!==f||n[76]!==x?(Se=Re(r)?(0,$.jsxs)(Nt,{className:$o,disabled:x,onSelect:f,children:[(0,$.jsx)(P,{name:dr,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:x?`Retrying update…`:`Retry update`})]}):null,n[74]=r,n[75]=f,n[76]=x,n[77]=Se):Se=n[77];let Ce;n[78]!==r||n[79]!==b||n[80]!==S||n[81]!==h||n[82]!==g||n[83]!==p?(Ce=(0,$.jsx)(Pn,{host:r,machineProvider:S,pending:b,presentation:`menu`,onSuspend:p,onResume:h,onRetryCleanup:g}),n[78]=r,n[79]=b,n[80]=S,n[81]=h,n[82]=g,n[83]=p,n[84]=Ce):Ce=n[84];let we;n[85]!==_||n[86]!==v?(we=_?(0,$.jsxs)(Nt,{className:$o,onSelect:v,children:[(0,$.jsx)(P,{name:`MoveTo`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Move server here`})]}):null,n[85]=_,n[86]=v,n[87]=we):we=n[87];let Te;n[88]!==i||n[89]!==H||n[90]!==y?(Te=i?(0,$.jsxs)(Mt,{children:[(0,$.jsx)(ct,{asChild:!0,children:H}),(0,$.jsx)(Et,{side:`left`,children:Rn(y)})]}):H,n[88]=i,n[89]=H,n[90]=y,n[91]=Te):Te=n[91];let Ee;n[92]!==xe||n[93]!==Se||n[94]!==Ce||n[95]!==we||n[96]!==Te?(Ee=(0,$.jsxs)(tt,{align:`end`,className:`w-max min-w-0`,children:[xe,Se,Ce,we,Te]}),n[92]=xe,n[93]=Se,n[94]=Ce,n[95]=we,n[96]=Te,n[97]=Ee):Ee=n[97];let De;n[98]!==ve||n[99]!==Ee?(De=(0,$.jsx)(pt,{delayDuration:250,children:(0,$.jsxs)(Ct,{children:[ve,Ee]})}),n[98]=ve,n[99]=Ee,n[100]=De):De=n[100];let Oe;n[101]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(An,{}),n[101]=Oe):Oe=n[101];let ke;n[102]===De?ke=n[103]:(ke=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[De,Oe]}),n[102]=De,n[103]=ke);let Ae;return n[104]!==U||n[105]!==he||n[106]!==ke?(Ae=(0,$.jsx)(Kn,{children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:(0,$.jsxs)(`div`,{"data-machine-row":!0,className:`group group/machine -mx-2 flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 py-2 transition-colors hover:bg-state-hover focus-within:bg-state-hover`,onClick:U,children:[he,ke]})})}),n[104]=U,n[105]=he,n[106]=ke,n[107]=Ae):Ae=n[107],Ae}function ns(){let e=(0,Z.c)(97),t=Xe(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={includeCreating:!0},e[0]=n):n=e[0];let r=_t(n),{providers:i}=Cn(),{localDaemonHostId:a,platform:o}=Dt(),s=Ce(),c=Hn(),l=Bn(),u=Un(),d=Wn(),f=Vn(),p=Ze(),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),w=r.data,T=t.data?.primaryHostId??null,E=t.data?.experiments.serverMove??!1,D=p.data?.move??null,O=s.data?.projects,A;if(e[1]!==O){A=new Map;for(let e of O??[]){let t=new Set(e.sources.map(ss));for(let e of t)A.set(e,(A.get(e)??0)+1)}e[1]=O,e[2]=A}else A=e[2];let j=A,M;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(M=Date.now(),e[3]=M):M=e[3];let N=M,F=t.data?.primaryHostPlatform??null,I,L,z,B,V,H,U,W;if(e[4]!==w||e[5]!==a||e[6]!==o||e[7]!==i||e[8]!==F||e[9]!==j||e[10]!==c||e[11]!==d||e[12]!==f||e[13]!==l||e[14]!==D||e[15]!==E||e[16]!==T||e[17]!==g||e[18]!==u||e[19]!==t.data){let n=w?.filter(os);L=w?.filter(as);let r=g&&L!==void 0?[...n??[],...L]:n??[],s=(n?.length??0)>1,p=n!==void 0&&n.length>0,m;e[28]===i?m=e[29]:(m=new Map((i??[]).map(is)),e[28]=i,e[29]=m);let _=m,v;e[30]!==a||e[31]!==o||e[32]!==_||e[33]!==F||e[34]!==j||e[35]!==c||e[36]!==d||e[37]!==f||e[38]!==l||e[39]!==D||e[40]!==E||e[41]!==T||e[42]!==s||e[43]!==u||e[44]!==t.data?(v=e=>(0,$.jsx)(Gn,{children:e.map(e=>(0,$.jsx)(ts,{host:e,isPrimary:e.id===T,isThisMachine:s&&e.id===a,showServerBadge:e.id===T,platformLabel:e.id===a&&o!==null?es[o]:e.id===T&&F!==null?es[F]:null,projectCount:j.get(e.id)??0,now:N,onRename:()=>{c.reset(),y(e)},onRemove:()=>{x(e)},onRetryUpdate:()=>l.mutate(e.id,{onSuccess:()=>{k.success(`Update retry requested for ${e.name}`)}}),retryUpdatePending:l.isPending&&l.variables===e.id,onSuspend:()=>u.mutate(e.id,{onSuccess:()=>k.success(`${e.name} suspended`)}),onResume:()=>d.mutate(e.id,{onSuccess:()=>k.success(`${e.name} resumed`)}),onRetryCleanup:()=>f.mutate(e.id,{onSuccess:()=>k.success(`Cleanup retried for ${e.name}`)}),canMoveServerHere:t.data!==void 0&&gt({host:e,primaryHostId:T,move:D,serverMoveEnabled:E}),onMoveServerHere:()=>C(e),serverMoveEnabled:E,lifecycleActionPending:u.isPending&&u.variables===e.id||d.isPending&&d.variables===e.id||f.isPending&&f.variables===e.id,machineProvider:e.machineProviderId===null?null:_.get(e.machineProviderId)??null},e.id))}),e[30]=a,e[31]=o,e[32]=_,e[33]=F,e[34]=j,e[35]=c,e[36]=d,e[37]=f,e[38]=l,e[39]=D,e[40]=E,e[41]=T,e[42]=s,e[43]=u,e[44]=t.data,e[45]=v):v=e[45];let b=v;I=Y,V=`Machines`,H=`space-y-3 border-0 bg-transparent p-0`,e[46]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>h(!0),children:[(0,$.jsx)(P,{name:`Plus`,className:`size-3.5`}),`Add a machine`]}),e[46]=U):U=e[46];let S;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(P,{name:`Info`,className:`mt-0.5 size-4 shrink-0 text-subtle-foreground`,"aria-hidden":!0}),e[47]=S):S=e[47];let O,A;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`How machines connect`}),A=(0,$.jsx)(`p`,{children:`All your machines connect to one central bb server, where your threads and settings are stored. Choose a machine that can stay awake and online to run the server.`}),e[48]=O,e[49]=A):(O=e[48],A=e[49]);let M;e[50]===E?M=e[51]:(M=E?(0,$.jsxs)(`p`,{children:[`To change which machine runs the server, open the ⋯ menu on another machine below and choose`,` `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Move server here`}),`.`]}):null,e[50]=E,e[51]=M),e[52]===M?W=e[53]:(W=(0,$.jsxs)(`div`,{role:`note`,"aria-label":`About the bb server`,className:`flex items-start gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3`,children:[S,(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs leading-relaxed text-subtle-foreground`,children:[O,A,M]})]}),e[52]=M,e[53]=W);let G=p&&`py-2`;e[54]===G?z=e[55]:(z=R(`rounded-lg border border-border bg-card px-4 py-3.5`,G),e[54]=G,e[55]=z),B=w===void 0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}):r.length===0?(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`No machines yet.`}):b(r),e[4]=w,e[5]=a,e[6]=o,e[7]=i,e[8]=F,e[9]=j,e[10]=c,e[11]=d,e[12]=f,e[13]=l,e[14]=D,e[15]=E,e[16]=T,e[17]=g,e[18]=u,e[19]=t.data,e[20]=I,e[21]=L,e[22]=z,e[23]=B,e[24]=V,e[25]=H,e[26]=U,e[27]=W}else I=e[20],L=e[21],z=e[22],B=e[23],V=e[24],H=e[25],U=e[26],W=e[27];let G;e[56]!==L||e[57]!==g?(G=L!==void 0&&L.length>0?(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":g,onClick:()=>_(rs),className:`-ml-1 inline-flex items-center gap-1.5 self-start rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-state-hover hover:text-foreground`,children:[(0,$.jsx)(P,{name:`ChevronDown`,className:R(`size-3.5 transition-transform`,g&&`rotate-180`),"aria-hidden":!0}),(0,$.jsx)(`span`,{children:g?`Show fewer machines`:`Show all machines`})]}):null,e[56]=L,e[57]=g,e[58]=G):G=e[58];let K;e[59]!==z||e[60]!==B||e[61]!==G?(K=(0,$.jsxs)(`div`,{className:z,children:[B,G]}),e[59]=z,e[60]=B,e[61]=G,e[62]=K):K=e[62];let q;e[63]!==I||e[64]!==V||e[65]!==H||e[66]!==U||e[67]!==W||e[68]!==K?(q=(0,$.jsxs)(I,{title:V,bodyClassName:H,action:U,children:[W,K]}),e[63]=I,e[64]=V,e[65]=H,e[66]=U,e[67]=W,e[68]=K,e[69]=q):q=e[69];let ee;e[70]===m?ee=e[71]:(ee=(0,$.jsx)(Wo,{open:m,onOpenChange:h}),e[70]=m,e[71]=ee);let te;e[72]!==c.error||e[73]!==c.isError?(te=c.isError?De({error:c.error,fallbackMessage:`Couldn't rename the machine.`}):null,e[72]=c.error,e[73]=c.isError,e[74]=te):te=e[74];let ne;e[75]===c.isPending?ne=e[76]:(ne=e=>{!e&&!c.isPending&&y(null)},e[75]=c.isPending,e[76]=ne);let re;e[77]===c?re=e[78]:(re=(e,t)=>c.mutate({hostId:e.id,name:t},{onSuccess:()=>y(null)}),e[77]=c,e[78]=re);let ie;e[79]!==c.isPending||e[80]!==v||e[81]!==te||e[82]!==ne||e[83]!==re?(ie=(0,$.jsx)(zn,{target:v,pending:c.isPending,errorMessage:te,onOpenChange:ne,onRename:re}),e[79]=c.isPending,e[80]=v,e[81]=te,e[82]=ne,e[83]=re,e[84]=ie):ie=e[84];let ae;e[85]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e||x(null)},e[85]=ae):ae=e[85];let oe;e[86]===b?oe=e[87]:(oe=(0,$.jsx)(Nn,{target:b,onOpenChange:ae}),e[86]=b,e[87]=oe);let se;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e||C(null)},e[88]=se):se=e[88];let ce;e[89]===S?ce=e[90]:(ce=(0,$.jsx)(Fn,{target:S,onOpenChange:se}),e[89]=S,e[90]=ce);let le;return e[91]!==q||e[92]!==ee||e[93]!==ie||e[94]!==oe||e[95]!==ce?(le=(0,$.jsxs)($.Fragment,{children:[q,ee,ie,oe,ce]}),e[91]=q,e[92]=ee,e[93]=ie,e[94]=oe,e[95]=ce,e[96]=le):le=e[96],le}function rs(e){return!e}function is(e){return[e.id,e]}function as(e){return e.type===`ephemeral`}function os(e){return e.type===`persistent`}function ss(e){return e.hostId}var cs=`all`,ls=50,us=[{label:`All threads`,value:`all`},{label:`Root threads`,value:`root`},{label:`Child threads`,value:`child`}];function ds(e){let t=(0,Z.c)(22),{icon:n,label:r,onChange:i,options:a,value:o}=e,s;t[0]===n?s=t[1]:(s=(0,$.jsx)(P,{name:n,className:`size-3.5 shrink-0`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,$.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 shrink-0`}),t[7]=u):u=t[7];let d;t[8]===l?d=t[9]:(d=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{type:`button`,variant:`outline`,className:`h-8 min-w-36 justify-between gap-2 px-3 text-xs font-normal`,children:[l,u]})}),t[8]=l,t[9]=d);let f;if(t[10]!==i||t[11]!==a||t[12]!==o){let e;t[14]!==i||t[15]!==o?(e=e=>(0,$.jsxs)(Nt,{onSelect:()=>i(e.value),children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.value===o?(0,$.jsx)(P,{name:`Check`,className:`size-3.5`}):null]},e.value),t[14]=i,t[15]=o,t[16]=e):e=t[16],f=a.map(e),t[10]=i,t[11]=a,t[12]=o,t[13]=f}else f=t[13];let p;t[17]===f?p=t[18]:(p=(0,$.jsx)(tt,{align:`end`,className:`min-w-44`,children:f}),t[17]=f,t[18]=p);let m;return t[19]!==d||t[20]!==p?(m=(0,$.jsxs)(Ct,{children:[d,p]}),t[19]=d,t[20]=p,t[21]=m):m=t[21],m}function fs(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>K(e).toLocaleLowerCase().includes(n))}function ps(){let e=(0,Z.c)(65),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(`all`),[o,s]=(0,Q.useState)(cs),c=Ce(),l;e[0]===n?l=e[1]:(l=re(n),e[0]=n,e[1]=l);let u=l,d;e[2]===o?d=e[3]:(d=o===cs?{}:{projectId:o},e[2]=o,e[3]=d);let f;e[4]!==i||e[5]!==d?(f={...d,kind:i},e[4]=i,e[5]=d,e[6]=f):f=e[6];let p=!u,m;e[7]===p?m=e[8]:(m={enabled:p},e[7]=p,e[8]=m);let h=Le(f,m),g;e[9]!==n||e[10]!==u?(g={active:u,limitPerGroup:ls,query:n},e[9]=n,e[10]=u,e[11]=g):g=e[11];let _=Ht(g),v=Ot(),y;bb0:{if(!c.data){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[12]=t):t=e[12],y=t;break bb0}let t;e[13]!==c.data.personalProject||e[14]!==c.data.projects?(t=[c.data.personalProject,...c.data.projects],e[13]=c.data.personalProject,e[14]=c.data.projects,e[15]=t):t=e[15],y=t}let b=y,x;e[16]===b?x=e[17]:(x=new Map(b.map(gs)),e[16]=b,e[17]=x);let S=x,C;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(C={label:`All projects`,value:cs},e[18]=C):C=e[18];let w;e[19]===b?w=e[20]:(w=[C,...b.map(hs)],e[19]=b,e[20]=w);let T=w,E;if(e[21]!==h.data?.pages||e[22]!==i||e[23]!==o||e[24]!==n||e[25]!==u||e[26]!==_.data?.archived){let t=u?_.data?.archived.results.map(ms)??[]:(h.data?.pages??[]).flat(),r;e[28]!==i||e[29]!==o?(r=e=>e.archivedAt!==null&&(o===cs||e.projectId===o)&&(i===`all`||e.parentThreadId!==null==(i===`child`)),e[28]=i,e[29]=o,e[30]=r):r=e[30];let a=t.filter(r);E=u?a:fs(a,n),e[21]=h.data?.pages,e[22]=i,e[23]=o,e[24]=n,e[25]=u,e[26]=_.data?.archived,e[27]=E}else E=e[27];let D=E,O;if(e[31]!==D){let t=new Map;for(let e of D){let n=t.get(e.projectId);n?n.push(e):t.set(e.projectId,[e])}O=[...t.entries()],e[31]=D,e[32]=O}else O=e[32];let k=O,A;e[33]===i?A=e[34]:(A=us.find(e=>e.value===i)?.label??`All threads`,e[33]=i,e[34]=A);let j=A,M=T.find(e=>e.value===o)?.label??`All projects`,N=u?_.isDebouncing||_.isLoading&&_.data===void 0:h.isPending,F;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:`Archived threads`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-subtle-foreground`,children:`Find and restore archived threads from across your projects.`})]}),e[35]=F):F=e[35];let I;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(P,{name:`Search`,className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-subtle-foreground`}),e[36]=I):I=e[36];let L;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>r(e.target.value),e[37]=L):L=e[37];let R;e[38]===n?R=e[39]:(R=(0,$.jsxs)(`div`,{className:`relative min-w-56 flex-1`,children:[I,(0,$.jsx)($e,{"aria-label":`Search archived threads`,className:`h-8 pl-8 text-xs`,onChange:L,placeholder:`Search archived threads…`,value:n})]}),e[38]=n,e[39]=R);let z;e[40]!==i||e[41]!==j?(z=(0,$.jsx)(ds,{icon:`SlidersHorizontal`,label:j,onChange:a,options:us,value:i}),e[40]=i,e[41]=j,e[42]=z):z=e[42];let B;e[43]!==o||e[44]!==T||e[45]!==M?(B=(0,$.jsx)(ds,{icon:`Folder`,label:M,onChange:s,options:T,value:o}),e[43]=o,e[44]=T,e[45]=M,e[46]=B):B=e[46];let V;e[47]!==R||e[48]!==z||e[49]!==B?(V=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[R,z,B]}),e[47]=R,e[48]=z,e[49]=B,e[50]=V):V=e[50];let H;e[51]!==D||e[52]!==k||e[53]!==N||e[54]!==S||e[55]!==n||e[56]!==v?(H=N?(0,$.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading archived threads…`}):D.length===0?(0,$.jsx)(Vt,{className:`py-8`,children:n.trim().length>0?`No archived threads match your search.`:`No archived threads match these filters.`}):(0,$.jsx)(`div`,{className:`space-y-6`,children:k.map(e=>{let[n,r]=e;return(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-0.5 text-xs font-medium text-muted-foreground`,children:[(0,$.jsx)(P,{name:`Folder`,className:`size-3.5`}),(0,$.jsx)(`h3`,{className:`min-w-0 flex-1 truncate`,children:S.get(n)??`Unknown project`}),(0,$.jsxs)(`span`,{children:[r.length,` `,r.length===1?`thread`:`threads`]})]}),(0,$.jsx)(`div`,{className:`divide-y divide-border overflow-hidden rounded-lg border border-border bg-card`,children:r.map(e=>(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-2.5`,children:[(0,$.jsxs)(t,{className:`min-w-0 flex-1`,to:ye({projectId:e.projectId,threadId:e.id}),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:K(e)}),e.parentThreadId===null?null:(0,$.jsx)(jt,{variant:`outline`,className:`shrink-0`,children:`child`})]}),e.archivedAt===null?null:(0,$.jsxs)(`span`,{className:`mt-0.5 block text-xs text-subtle-foreground`,children:[`Archived`,` `,Me({timestamp:e.archivedAt,now:Date.now()})]})]}),(0,$.jsx)(ar,{variant:`secondary`,isPending:v.isPending&&v.variables?.id===e.id,onUnarchive:()=>v.mutate({id:e.id})})]},e.id))})]},n)})}),e[51]=D,e[52]=k,e[53]=N,e[54]=S,e[55]=n,e[56]=v,e[57]=H):H=e[57];let U;e[58]!==h||e[59]!==u?(U=!u&&h.hasNextPage?(0,$.jsx)(J,{type:`button`,variant:`ghost`,className:`h-9 w-full text-sm font-normal text-muted-foreground`,disabled:h.isFetchingNextPage,onClick:()=>h.fetchNextPage(),children:h.isFetchingNextPage?`Loading…`:`Load more`}):null,e[58]=h,e[59]=u,e[60]=U):U=e[60];let W;return e[61]!==V||e[62]!==H||e[63]!==U?(W=(0,$.jsxs)(`section`,{className:`space-y-5`,children:[F,V,H,U]}),e[61]=V,e[62]=H,e[63]=U,e[64]=W):W=e[64],W}function ms(e){return e.thread}function hs(e){return{label:e.name,value:e.id}}function gs(e){return[e.id,e.name]}var _s={installed:`Installed`,outdated:`Out of date`,missing:`Not installed`,unknown:null};function vs(e){return e.status===`connected`}function ys(e){return e.connected?e.status===void 0?null:_s[e.status]:`Disconnected`}function bs(e){let t=(0,Z.c)(32),{hosts:n,onCancel:r,onInstall:i,pending:a,statusByHostId:o}=e,s;t[0]===n?s=t[1]:(s=n.filter(vs).map(xs),t[0]=n,t[1]=s);let c=s,[l,u]=(0,Q.useState)(c),d=n.length>1,f;t[2]!==d||t[3]!==c||t[4]!==l?(f=d?l.filter(e=>c.includes(e)):c,t[2]=d,t[3]=c,t[4]=l,t[5]=f):f=t[5];let p=f,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(q,{children:`Install bb CLI skills`}),t[6]=m):m=t[6];let h=d?`Choose the machines to install them onto. Each one gets the skills in ~/.agents/skills and ~/.claude/skills, replacing any copy already there.`:`The skills go in ~/.agents/skills and ~/.claude/skills on ${n[0]?.name??`the selected machine`}, replacing any copy already there.`,g;t[7]===h?g=t[8]:(g=(0,$.jsxs)(H,{children:[m,(0,$.jsx)(fe,{children:h})]}),t[7]=h,t[8]=g);let _;t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==p||t[13]!==o?(_=d?(0,$.jsx)(`div`,{className:`flex flex-col gap-1 py-1`,children:n.map(e=>{let t=vs(e),n=ys({connected:t,status:o.get(e.id)});return(0,$.jsxs)(`label`,{className:`flex items-center gap-2.5 rounded-md px-1 py-2 text-sm has-[:disabled]:opacity-60`,children:[(0,$.jsx)(V,{checked:p.includes(e.id),disabled:!t||a,onCheckedChange:t=>u(n=>t===!0?[...n,e.id]:n.filter(t=>t!==e.id)),"aria-label":e.name}),(0,$.jsx)(T,{connected:t}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),n===null?null:(0,$.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-subtle-foreground`,children:n})]},e.id)})}):null,t[9]=d,t[10]=n,t[11]=a,t[12]=p,t[13]=o,t[14]=_):_=t[14];let v;t[15]!==r||t[16]!==a?(v=(0,$.jsx)(J,{type:`button`,variant:`outline`,disabled:a,onClick:r,children:`Cancel`}),t[15]=r,t[16]=a,t[17]=v):v=t[17];let y=a||p.length===0,b;t[18]!==i||t[19]!==p?(b=()=>i([...p]),t[18]=i,t[19]=p,t[20]=b):b=t[20];let x=a?`Installing…`:`Install`,S;t[21]!==x||t[22]!==y||t[23]!==b?(S=(0,$.jsx)(J,{type:`button`,disabled:y,onClick:b,children:x}),t[21]=x,t[22]=y,t[23]=b,t[24]=S):S=t[24];let C;t[25]!==S||t[26]!==v?(C=(0,$.jsxs)(_e,{children:[v,S]}),t[25]=S,t[26]=v,t[27]=C):C=t[27];let w;return t[28]!==C||t[29]!==g||t[30]!==_?(w=(0,$.jsxs)($.Fragment,{children:[g,_,C]}),t[28]=C,t[29]=g,t[30]=_,t[31]=w):w=t[31],w}function xs(e){return e.id}function Ss(e){let t=(0,Z.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({onOpenChange:r,open:i,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=i?(0,$.jsx)(bs,{...n}):null,t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;t[7]===a?o=t[8]:(o=(0,$.jsx)(ue,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==r||t[10]!==i||t[11]!==o?(s=(0,$.jsx)(xt,{open:i,onOpenChange:r,children:o}),t[9]=r,t[10]=i,t[11]=o,t[12]=s):s=t[12],s}var Cs=`bb CLI skills`;function ws(e){return e?`Install them into ~/.agents/skills and ~/.claude/skills so agents outside bb can use the bb CLI.`:`Connect a machine to install them into ~/.agents/skills and ~/.claude/skills.`}function Ts(e){let t=e.filter(e=>e!==`unknown`);if(t.length===0)return null;let n=t.filter(e=>e===`installed`).length;return n===t.length?t.length>1?`Installed on ${t.length} machines`:`Installed`:n>0?`Installed on ${n} of ${t.length} machines`:t.some(e=>e===`outdated`)?`Out of date`:`Not installed`}function Es(e){let t=(0,Z.c)(12),{hasConnectedMachine:n,onOpenPicker:r,pending:i,statusBadge:a}=e,o;t[0]===a?o=t[1]:(o=a===null?{}:{labelBadge:a},t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=ws(n),t[2]=n,t[3]=s);let c=!n||i,l=i?`Installing…`:`Install`,u;t[4]!==r||t[5]!==c||t[6]!==l?(u=(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:c,onClick:r,"aria-label":`Install ${Cs}`,children:l}),t[4]=r,t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==s||t[10]!==u?(d=(0,$.jsx)(Y,{title:`Skills`,children:(0,$.jsx)(X,{label:Cs,...o,description:s,children:u})}),t[8]=o,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function Ds(e){let t=e.results.filter(e=>e.ok),n=e.results.filter(e=>!e.ok);t.length>0&&k.success(`Installed the bb CLI skills on ${t.map(e=>e.hostName).join(`, `)}`);for(let e of n)k.error(`${e.hostName}: ${e.errorMessage}`)}function Os(e){return new Map((e?.machines??[]).map(e=>[e.hostId,e.status]))}function ks(){let e=(0,Z.c)(31),t=_t(),n=We(),r=$n(),[i,a]=(0,Q.useState)(!1),o;e[0]===t.data?o=e[1]:(o=Wt(t.data,`persistent`),e[0]=t.data,e[1]=o);let s=o,c,l,u,d,f;e[2]!==s||e[3]!==r.isPending||e[4]!==n.data?(l=Os(n.data),c=Es,e[10]===s?u=e[11]:(u=s.some(As),e[10]=s,e[11]=u),d=r.isPending,f=Ts([...l.values()]),e[2]=s,e[3]=r.isPending,e[4]=n.data,e[5]=c,e[6]=l,e[7]=u,e[8]=d,e[9]=f):(c=e[5],l=e[6],u=e[7],d=e[8],f=e[9]);let p;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>a(!0),e[12]=p):p=e[12];let m;e[13]!==c||e[14]!==u||e[15]!==d||e[16]!==f?(m=(0,$.jsx)(c,{hasConnectedMachine:u,pending:d,statusBadge:f,onOpenPicker:p}),e[13]=c,e[14]=u,e[15]=d,e[16]=f,e[17]=m):m=e[17];let h;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>a(!1),e[18]=h):h=e[18];let g;e[19]!==r||e[20]!==n?(g=e=>r.mutate({hostIds:e},{onSuccess:e=>{a(!1),Ds(e),n.refetch()}}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let _;e[22]!==s||e[23]!==r.isPending||e[24]!==i||e[25]!==l||e[26]!==g?(_=(0,$.jsx)(Ss,{open:i,onOpenChange:a,hosts:s,statusByHostId:l,pending:r.isPending,onCancel:h,onInstall:g}),e[22]=s,e[23]=r.isPending,e[24]=i,e[25]=l,e[26]=g,e[27]=_):_=e[27];let v;return e[28]!==m||e[29]!==_?(v=(0,$.jsxs)($.Fragment,{children:[m,_]}),e[28]=m,e[29]=_,e[30]=v):v=e[30],v}function As(e){return e.status===`connected`}var js=u(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-foreground text-background shadow-xs`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow-xs`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ms(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=R(js({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,$.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}var Ns=`https://example.com/marketplace.json`;function Ps(e){return e.lastError===null?e.lastRefreshAt===null?`Never refreshed`:`Refreshed ${new Date(e.lastRefreshAt).toLocaleString()}`:`Last refresh failed: ${e.lastError}`}function Fs(){let e=(0,Z.c)(60),t=_(),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(null),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={enabled:!0},e[0]=o):o=e[0];let s=dn(o),c;e[1]===s.data?c=e[2]:(c=s.data??[],e[1]=s.data,e[2]=c);let l=c,u;e[3]===t?u=e[4]:(u=()=>de({queryClient:t}),e[3]=t,e[4]=u);let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={showErrorToast:!1},e[5]=f):f=e[5];let m;e[6]===d?m=e[7]:(m={meta:f,mutationFn:Hs,onSuccess:e=>{r(``),d(),k.success(`Added ${e.displayName}`,{description:`${e.entryCount} plugins listed. Adding a marketplace installs nothing.`})},onError:Vs},e[6]=d,e[7]=m);let h=p(m),g;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(g={showErrorToast:!1},e[8]=g):g=e[8];let v;e[9]===d?v=e[10]:(v={meta:g,mutationFn:Bs,onSuccess:e=>{d();let t=e.filter(zs);if(t.length===0){k.success(`Marketplace refreshed`);return}k.error(`Refreshing the marketplace failed`,{description:`${t[0]?.error??`Unknown error`}. The last catalog bb validated is still in use.`})},onError:Rs},e[9]=d,e[10]=v);let y=p(v),b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b={showErrorToast:!1},e[11]=b):b=e[11];let x;e[12]===d?x=e[13]:(x={meta:b,mutationFn:Ls,onSuccess:e=>{a(null),d(),k.success(`Marketplace removed`,{description:e.convertedPluginIds.length===0?void 0:`Kept as direct installs: ${e.convertedPluginIds.join(`, `)}`})},onError:Is},e[12]=d,e[13]=x);let S=p(x),C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>r(e.target.value),e[14]=C):C=e[14];let w;e[15]===n?w=e[16]:(w=(0,$.jsx)($e,{value:n,"aria-label":`Marketplace source`,placeholder:Ns,className:`h-8 font-mono text-xs`,onChange:C}),e[15]=n,e[16]=w);let T;e[17]!==h.isPending||e[18]!==n?(T=n.trim().length===0||h.isPending,e[17]=h.isPending,e[18]=n,e[19]=T):T=e[19];let E;e[20]!==h||e[21]!==n?(E=()=>h.mutate(n.trim()),e[20]=h,e[21]=n,e[22]=E):E=e[22];let D=h.isPending?`Adding…`:`Add`,O;e[23]!==T||e[24]!==E||e[25]!==D?(O=(0,$.jsx)(J,{type:`button`,size:`sm`,disabled:T,onClick:E,children:D}),e[23]=T,e[24]=E,e[25]=D,e[26]=O):O=e[26];let A;e[27]!==w||e[28]!==O?(A=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[w,O]}),e[27]=w,e[28]=O,e[29]=A):A=e[29];let j;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`code`,{children:`git:<url>[@<ref>]`}),e[30]=j):j=e[30];let M;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(`p`,{className:`text-2xs text-subtle-foreground`,children:[`An https manifest URL, `,j,`, or`,` `,(0,$.jsx)(`code`,{children:`path:<directory>`}),` on the bb server’s machine.`]}),e[31]=M):M=e[31];let N;e[32]===A?N=e[33]:(N=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[A,M]}),e[32]=A,e[33]=N);let P;if(e[34]!==l||e[35]!==y){let t;e[37]===y?t=e[38]:(t=e=>(0,$.jsxs)(`li`,{className:`flex items-start gap-3 rounded-md border border-border p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[e.displayName,(0,$.jsx)(`span`,{className:`font-mono text-2xs text-subtle-foreground`,children:e.name}),e.official?(0,$.jsx)(Ms,{variant:`outline`,className:`text-2xs font-normal`,children:`Official`}):null]}),(0,$.jsx)(`p`,{className:`truncate font-mono text-2xs text-subtle-foreground`,children:e.source}),(0,$.jsxs)(`p`,{className:`text-2xs text-subtle-foreground`,children:[e.entryCount,` plugins ·`,` `,Ps(e)]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1.5`,children:[(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:y.isPending,"aria-label":`Refresh ${e.displayName}`,onClick:()=>y.mutate(e.name),children:`Refresh`}),e.official?null:(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,"aria-label":`Remove ${e.displayName}`,onClick:()=>a(e),children:`Remove`})]})]},e.name),e[37]=y,e[38]=t),P=l.map(t),e[34]=l,e[35]=y,e[36]=P}else P=e[36];let F;e[39]===P?F=e[40]:(F=(0,$.jsx)(`ul`,{className:`space-y-2 pt-3`,children:P}),e[39]=P,e[40]=F);let I=i!==null,L;e[41]===S.isPending?L=e[42]:(L=e=>{!e&&!S.isPending&&a(null)},e[41]=S.isPending,e[42]=L);let R=`Remove ${i?.displayName??`marketplace`}?`,z=S.isPending?`Removing…`:`Remove`,B;e[43]!==S||e[44]!==i?(B=()=>{i!==null&&S.mutate(i.name)},e[43]=S,e[44]=i,e[45]=B):B=e[45];let V;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>a(null),e[46]=V):V=e[46];let H;e[47]!==S.isPending||e[48]!==R||e[49]!==z||e[50]!==B?(H=(0,$.jsx)(Ge,{title:R,description:`Its catalog and cached icons are deleted. Plugins installed from it keep running as direct installs and keep checking for updates from their recorded source.`,confirmLabel:z,pending:S.isPending,onConfirm:B,onCancel:V}),e[47]=S.isPending,e[48]=R,e[49]=z,e[50]=B,e[51]=H):H=e[51];let U;e[52]!==I||e[53]!==L||e[54]!==H?(U=(0,$.jsx)(dt,{open:I,onOpenChange:L,children:H}),e[52]=I,e[53]=L,e[54]=H,e[55]=U):U=e[55];let W;return e[56]!==N||e[57]!==F||e[58]!==U?(W=(0,$.jsxs)(Y,{title:`Plugin marketplaces`,description:`bb reads plugin catalogs from these marketplaces. Adding one validates and caches its catalog; it never installs, updates, or runs plugin code.`,bodyClassName:`border-0 bg-transparent p-0`,children:[N,F,U]}),e[56]=N,e[57]=F,e[58]=U,e[59]=W):W=e[59],W}function Is(e){k.error(`Removing the marketplace failed`,{description:fr(e)})}function Ls(e){return pn(fetch,e)}function Rs(e){k.error(`Refreshing the marketplace failed`,{description:fr(e)})}function zs(e){return!e.ok}function Bs(e){return fn(fetch,e)}function Vs(e){k.error(`Adding the marketplace failed`,{description:fr(e)})}function Hs(e){return mn(fetch,e)}var Us=`https://github.com/get-bb/bb/blob/main/docs/multiple-devices.md#open-bb-from-another-browser`;function Ws(e,t){return Ue.find(t=>t.id===e.themeId)?.name??t.find(t=>t.id===e.themeId)?.name??e.themeId}var Gs=[{label:`System`,value:`system`},{label:`Light`,value:`light`},{label:`Dark`,value:`dark`}],Ks={dark:`Dark`,light:`Light`,system:`System`},qs=[{label:`Default`,value:`default`},{label:`Red`,value:`red`},{label:`Orange`,value:`orange`},{label:`Yellow`,value:`yellow`},{label:`Green`,value:`green`},{label:`Teal`,value:`teal`},{label:`Blue`,value:`blue`},{label:`Purple`,value:`purple`},{label:`Pink`,value:`pink`}],Js={blue:`Blue`,default:`Default`,green:`Green`,orange:`Orange`,pink:`Pink`,purple:`Purple`,red:`Red`,teal:`Teal`,yellow:`Yellow`},Ys=`h-7 w-full justify-between border-border/60 bg-card px-2 text-xs sm:w-36`,Xs=`min-w-[var(--radix-dropdown-menu-trigger-width)]`,Zs="Create a custom bb palette. First run `bb theme dir` to find the custom theme directory. Ask me for the palette name and visual direction, then create `<theme-dir>/<name>/theme.css` with light and dark theme variables compatible with bb's theme tokens.",Qs=`Palettes change bb's colors, including syntax colors in diffs and file previews. Choose a built-in palette or create one from a prompt.`;function $s(e){let t=(0,Z.c)(18),{active:n,children:r,onPreview:i,onSelect:a,themeId:o}=e,s;t[0]!==i||t[1]!==o?(s=()=>i(o),t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=()=>i(null),t[3]=i,t[4]=c);let l;t[5]!==a||t[6]!==o?(l=()=>a(o),t[5]=a,t[6]=o,t[7]=l):l=t[7];let u=!n&&`opacity-0`,d;t[8]===u?d=t[9]:(d=R(`ml-auto`,u,ze),t[8]=u,t[9]=d);let f;t[10]===d?f=t[11]:(f=(0,$.jsx)(P,{name:`Check`,className:d}),t[10]=d,t[11]=f);let p;return t[12]!==r||t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==f?(p=(0,$.jsxs)(Nt,{onFocus:s,onBlur:c,onSelect:l,children:[r,f]}),t[12]=r,t[13]=s,t[14]=c,t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function ec(e){let t=(0,Z.c)(10),{value:n}=e,r=n===`default`&&`bg-foreground`,i;t[0]===r?i=t[1]:(i=R(`size-4 shrink-0`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=O(),t[2]=a):a=t[2];let o;t[3]===n?o=t[4]:(o=n===`default`?void 0:{backgroundColor:St[n]},t[3]=n,t[4]=o);let s;t[5]===o?s=t[6]:(s={mask:`url("${a}") center / contain no-repeat`,...o},t[5]=o,t[6]=s);let c;return t[7]!==i||t[8]!==s?(c=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,style:s}),t[7]=i,t[8]=s,t[9]=c):c=t[9],c}function tc(e){let t=(0,Z.c)(19),{disabled:n,faviconColor:r,onFaviconColorChange:i}=e,a;t[0]===r?a=t[1]:(a=(0,$.jsx)(ec,{value:r}),t[0]=r,t[1]=a);let o=Js[r],s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==s?(c=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[7]=l):l=t[7];let u;t[8]!==n||t[9]!==c?(u=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Favicon color`,disabled:n,children:[c,l]})}),t[8]=n,t[9]=c,t[10]=u):u=t[10];let d;t[11]!==r||t[12]!==i?(d=qs.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>i(e.value),children:[(0,$.jsx)(ec,{value:e.value}),e.label,(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,r!==e.value&&`opacity-0`,ze)})]},e.value)),t[11]=r,t[12]=i,t[13]=d):d=t[13];let f;t[14]===d?f=t[15]:(f=(0,$.jsx)(tt,{align:`end`,className:Xs,children:d}),t[14]=d,t[15]=f);let p;return t[16]!==u||t[17]!==f?(p=(0,$.jsx)(X,{label:`Favicon color`,description:`Tint browser tabs to tell instances apart.`,children:(0,$.jsxs)(Ct,{children:[u,f]})}),t[16]=u,t[17]=f,t[18]=p):p=t[18],p}var nc={capability:`openDirectory`,emptyDescription:`No local app can open directories.`,label:`Directory default`},rc={capability:`openFile`,emptyDescription:`No local app can open files.`,label:`File default`};function ic(e){let t=(0,Z.c)(37),{definition:n,onTargetChange:r,preferredTargetId:i,targets:a}=e,o;if(t[0]!==n.capability||t[1]!==a){let e;t[3]===n.capability?e=t[4]:(e=e=>rn({capability:n.capability,target:e}),t[3]=n.capability,t[4]=e),o=a.filter(e),t[0]=n.capability,t[1]=a,t[2]=o}else o=t[2];let s=o,c;t[5]!==n.capability||t[6]!==i||t[7]!==a?(c=sn({capability:n.capability,preferredTargetId:i,targets:a}),t[5]=n.capability,t[6]=i,t[7]=a,t[8]=c):c=t[8];let l=c,u=s.length===0?n.emptyDescription:null,d=l?.id??i,f;t[9]!==i||t[10]!==l?.label?(f=l?.label??(i?ir(i):`Unavailable`),t[9]=i,t[10]=l?.label,t[11]=f):f=t[11];let p=f,m;t[12]!==l||t[13]!==d?(m=d?(0,$.jsx)(or,{...l?{target:l}:{targetId:d},className:`size-5`}):null,t[12]=l,t[13]=d,t[14]=m):m=t[14];let h;t[15]===p?h=t[16]:(h=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:p}),t[15]=p,t[16]=h);let g;t[17]!==m||t[18]!==h?(g=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[m,h]}),t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[20]=_):_=t[20];let v;t[21]!==n.label||t[22]!==g?(v=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":n.label,children:[g,_]})}),t[21]=n.label,t[22]=g,t[23]=v):v=t[23];let y;t[24]!==s||t[25]!==r||t[26]!==l?.id||t[27]!==u?(y=u?(0,$.jsx)(`div`,{role:`note`,className:`px-2 py-[0.3125rem] text-xs leading-snug text-foreground`,children:u}):s.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>r(e.id),children:[(0,$.jsx)(or,{target:e,className:`size-5`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,l?.id!==e.id&&`opacity-0`,ze)})]},e.id)),t[24]=s,t[25]=r,t[26]=l?.id,t[27]=u,t[28]=y):y=t[28];let b;t[29]===y?b=t[30]:(b=(0,$.jsx)(tt,{align:`end`,className:Xs,children:y}),t[29]=y,t[30]=b);let x;t[31]!==b||t[32]!==v?(x=(0,$.jsxs)(Ct,{children:[v,b]}),t[31]=b,t[32]=v,t[33]=x):x=t[33];let S;return t[34]!==n.label||t[35]!==x?(S=(0,$.jsx)(X,{label:n.label,children:x}),t[34]=n.label,t[35]=x,t[36]=S):S=t[36],S}function ac({accessState:e,directoryTargetId:t,fileTargetId:n,hasDaemon:r,onDirectoryTargetChange:i,onFileTargetChange:a,onRequestAccess:o,targets:s}){let[c,l]=(0,Q.useState)(!1);if(e===`unavailable`)return null;let u=async()=>{l(!0);try{await o()}finally{l(!1)}};if(!r){let t=e===`denied`,n=e===`available`;return(0,$.jsx)(Y,{title:`File Preferences`,children:(0,$.jsx)(X,{label:`Local editor integration`,description:(0,$.jsxs)($.Fragment,{children:[t?`Your browser blocked access to bb on this device. Allow local network access for this site in browser settings, then reload bb.`:n?`bb couldn’t connect to its local editor helper. Make sure the bb desktop app or CLI is running on this device, then retry. If it is already running, a remote browser origin may need to be configured.`:`Connect this browser to bb on this device so it can discover installed editors. bb only contacts the local helper after you choose Enable; your browser may ask for local network access.`,` `,(0,$.jsxs)(`a`,{href:Us,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 rounded-sm underline underline-offset-2 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:e=>{e.preventDefault(),oe(Us)},children:[`Setup guide`,(0,$.jsx)(P,{name:`ExternalLink`,className:`size-3 shrink-0`,"aria-hidden":!0})]})]}),children:(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:c||t,onClick:u,children:c?n?`Retrying…`:`Enabling…`:t?`Blocked`:n?`Retry`:`Enable`})})})}return(0,$.jsx)(Y,{title:`File Preferences`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsx)(ic,{definition:nc,onTargetChange:i,preferredTargetId:t,targets:s}),(0,$.jsx)(ic,{definition:rc,onTargetChange:a,preferredTargetId:n,targets:s})]})})}var oc=`Open links in the in-app browser`,sc=`Rewrite localhost links`,cc=`Navigate to threads on creation`,lc=`Markdown formatting in prompt box`,uc=`Show diagnostic events`,dc=`Default thread followup behavior`,fc=[{steerOnEnter:!1,label:`Queue`,description:`Enter adds a follow-up. It runs when the agent stops. Command+Enter (Ctrl+Enter on Windows and Linux) steers the run.`},{steerOnEnter:!0,label:`Steer`,description:`Enter steers the run now. Command+Enter (Ctrl+Enter on Windows and Linux) adds a follow-up for later.`}],pc=`Streamer mode`,mc=`New branch prefix`,hc=`fix-login-flow-thr_ab12cd34ef`;function gc(e){let t=(0,Z.c)(26),{disabled:n,onChange:r,value:i}=e,[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(i);i!==s&&(c(i),o(i));let l;t[0]===a?l=t[1]:(l=he.safeParse(a),t[0]=a,t[1]=l);let u=l.success,d;t[2]!==a||t[3]!==r||t[4]!==u||t[5]!==i?(d=()=>{if(!u){o(i);return}a!==i&&Promise.resolve(r(a)).catch(()=>o(i))},t[2]=a,t[3]=r,t[4]=u,t[5]=i,t[6]=d):d=t[6];let f=d,p;t[7]!==a||t[8]!==u?(p=u?`bb puts this in front of every branch it creates for a worktree, such as ${a}${hc}. Leave it empty for no prefix.`:(0,$.jsx)(`span`,{className:`text-destructive`,role:`alert`,children:`This prefix cannot start a valid git branch name.`}),t[7]=a,t[8]=u,t[9]=p):p=t[9];let m=!u,h=!u&&`border-destructive focus-visible:ring-destructive`,g;t[10]===h?g=t[11]:(g=R(`h-8 font-mono text-xs`,h),t[10]=h,t[11]=g);let _;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>o(e.target.value),t[12]=_):_=t[12];let v;t[13]!==f||t[14]!==i?(v=e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(e.preventDefault(),o(i))},t[13]=f,t[14]=i,t[15]=v):v=t[15];let y;t[16]!==f||t[17]!==n||t[18]!==a||t[19]!==m||t[20]!==g||t[21]!==v?(y=(0,$.jsx)($e,{value:a,"aria-label":mc,"aria-invalid":m,disabled:n,placeholder:`No prefix`,className:g,onChange:_,onBlur:f,onKeyDown:v}),t[16]=f,t[17]=n,t[18]=a,t[19]=m,t[20]=g,t[21]=v,t[22]=y):y=t[22];let b;return t[23]!==p||t[24]!==y?(b=(0,$.jsx)(X,{label:mc,description:p,controlPlacement:`below`,children:y}),t[23]=p,t[24]=y,t[25]=b):b=t[25],b}function _c(e){let t=(0,Z.c)(77),{appearance:n,appearanceDisabled:r,customThemes:i,pluginThemes:a,faviconColor:o,onAppearanceThemeChange:s,onAppearanceThemePrefetch:c,onAppearanceThemePreview:l,onFaviconColorChange:u,onCreatePalette:d,onThemePreferenceChange:f,themePreference:p}=e,m=(0,Q.useRef)(!1),h;t[0]===l?h=t[1]:(h=e=>{e===null&&m.current||l(e)},t[0]=l,t[1]=h);let g=h,_;t[2]===s?_=t[3]:(_=e=>{m.current=!0,s(e)},t[2]=s,t[3]=_);let v=_,y,b,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Br,{}),b=(0,$.jsx)(Wr,{}),x=(0,$.jsx)(zr,{}),t[4]=y,t[5]=b,t[6]=x):(y=t[4],b=t[5],x=t[6]);let S=Ks[p],C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[7]=C):C=t[7];let w;t[8]===S?w=t[9]:(w=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Theme`,children:[S,C]})}),t[8]=S,t[9]=w);let T;t[10]!==f||t[11]!==p?(T=Gs.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>f(e.value),children:[e.label,(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,p!==e.value&&`opacity-0`,ze)})]},e.value)),t[10]=f,t[11]=p,t[12]=T):T=t[12];let E;t[13]===T?E=t[14]:(E=(0,$.jsx)(tt,{align:`end`,className:Xs,children:T}),t[13]=T,t[14]=E);let D;t[15]!==E||t[16]!==w?(D=(0,$.jsx)(X,{label:`Theme`,children:(0,$.jsxs)(Ct,{children:[w,E]})}),t[15]=E,t[16]=w,t[17]=D):D=t[17];let O;t[18]!==i||t[19]!==c||t[20]!==a||t[21]!==g?(O=e=>{if(e){m.current=!1,c([...Ue.map(yc),...i,...a.map(vc)]);return}g(null)},t[18]=i,t[19]=c,t[20]=a,t[21]=g,t[22]=O):O=t[22];let k;t[23]!==n||t[24]!==a?(k=Ws(n,a),t[23]=n,t[24]=a,t[25]=k):k=t[25];let A;t[26]===k?A=t[27]:(A=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:k}),t[26]=k,t[27]=A);let j;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[28]=j):j=t[28];let M;t[29]!==r||t[30]!==A?(M=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Palette`,disabled:r,children:[A,j]})}),t[29]=r,t[30]=A,t[31]=M):M=t[31];let N;t[32]!==n||t[33]!==g||t[34]!==v?(N=Ue.map(e=>(0,$.jsx)($s,{themeId:e.id,active:n.themeId===e.id,onPreview:g,onSelect:v,children:e.name},e.id)),t[32]=n,t[33]=g,t[34]=v,t[35]=N):N=t[35];let F;if(t[36]!==n||t[37]!==i||t[38]!==g||t[39]!==v){let e;t[41]!==n||t[42]!==g||t[43]!==v?(e=e=>(0,$.jsx)($s,{themeId:e,active:n.themeId===e,onPreview:g,onSelect:v,children:e},`custom:${e}`),t[41]=n,t[42]=g,t[43]=v,t[44]=e):e=t[44],F=i.map(e),t[36]=n,t[37]=i,t[38]=g,t[39]=v,t[40]=F}else F=t[40];let I;if(t[45]!==n||t[46]!==a||t[47]!==g||t[48]!==v){let e;t[50]!==n||t[51]!==g||t[52]!==v?(e=e=>(0,$.jsxs)($s,{themeId:e.id,active:n.themeId===e.id,onPreview:g,onSelect:v,children:[e.name,(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.pluginId,`)`]})]},e.id),t[50]=n,t[51]=g,t[52]=v,t[53]=e):e=t[53],I=a.map(e),t[45]=n,t[46]=a,t[47]=g,t[48]=v,t[49]=I}else I=t[49];let L;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(mt,{}),t[54]=L):L=t[54];let z;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`Plus`,className:ze}),t[55]=z):z=t[55];let B;t[56]===d?B=t[57]:(B=(0,$.jsxs)(Nt,{onSelect:d,children:[z,`Create`]}),t[56]=d,t[57]=B);let V;t[58]!==N||t[59]!==F||t[60]!==I||t[61]!==B?(V=(0,$.jsxs)(tt,{align:`end`,className:Xs,children:[N,F,I,L,B]}),t[58]=N,t[59]=F,t[60]=I,t[61]=B,t[62]=V):V=t[62];let H;t[63]!==O||t[64]!==M||t[65]!==V?(H=(0,$.jsx)(X,{label:`Palette`,description:Qs,children:(0,$.jsxs)(Ct,{onOpenChange:O,children:[M,V]})}),t[63]=O,t[64]=M,t[65]=V,t[66]=H):H=t[66];let U;t[67]!==r||t[68]!==o||t[69]!==u?(U=(0,$.jsx)(tc,{disabled:r,faviconColor:o,onFaviconColorChange:u}),t[67]=r,t[68]=o,t[69]=u,t[70]=U):U=t[70];let W,G;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(Kr,{}),G=(0,$.jsx)(Vr,{}),t[71]=W,t[72]=G):(W=t[71],G=t[72]);let K;return t[73]!==D||t[74]!==H||t[75]!==U?(K=(0,$.jsx)(Y,{title:`Appearance`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[y,b,x,D,H,U,W,G]})}),t[73]=D,t[74]=H,t[75]=U,t[76]=K):K=t[76],K}function vc(e){return e.id}function yc(e){return e.id}function bc(e){let t=(0,Z.c)(41),{desktopBrowserAvailable:n,generalSettingsDisabled:r,managedBranchPrefix:i,navigateToThreadAfterCreate:a,onManagedBranchPrefixChange:o,onNavigateToThreadAfterCreateChange:s,onOpenLinksInAppBrowserChange:c,onRewriteLocalhostLinksChange:l,onRichTextEditingChange:u,onSteerActiveThreadOnEnterChange:d,openLinksInAppBrowser:f,rewriteLocalhostLinks:p,richTextEditing:m,steerActiveThreadOnEnter:h}=e,g;t[0]!==a||t[1]!==s?(g=(0,$.jsx)(X,{label:cc,children:(0,$.jsx)(xn,{checked:a,onCheckedChange:s,"aria-label":cc})}),t[0]=a,t[1]=s,t[2]=g):g=t[2];let _;t[3]!==u||t[4]!==m?(_=(0,$.jsx)(X,{label:lc,children:(0,$.jsx)(xn,{checked:m,onCheckedChange:u,"aria-label":lc})}),t[3]=u,t[4]=m,t[5]=_):_=t[5];let v=h?`Steer`:`Queue`,y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[6]=y):y=t[6];let b;t[7]!==r||t[8]!==v?(b=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,disabled:r,"aria-label":dc,children:[v,y]})}),t[7]=r,t[8]=v,t[9]=b):b=t[9];let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=R(Xs,`max-w-72`),t[10]=x):x=t[10];let S;t[11]!==d||t[12]!==h?(S=fc.map(e=>(0,$.jsxs)(Nt,{className:`items-start`,onSelect:()=>d(e.steerOnEnter),children:[(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block`,children:e.label}),(0,$.jsx)(`span`,{className:`block text-2xs leading-snug text-subtle-foreground`,children:e.description})]}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,h!==e.steerOnEnter&&`opacity-0`,ze)})]},e.label)),t[11]=d,t[12]=h,t[13]=S):S=t[13];let C;t[14]===S?C=t[15]:(C=(0,$.jsx)(tt,{align:`end`,className:x,children:S}),t[14]=S,t[15]=C);let w;t[16]!==b||t[17]!==C?(w=(0,$.jsx)(X,{label:dc,description:`What Enter does in the prompt box while the thread runs.`,children:(0,$.jsxs)(Ct,{children:[b,C]})}),t[16]=b,t[17]=C,t[18]=w):w=t[18];let T;t[19]!==g||t[20]!==_||t[21]!==w?(T=(0,$.jsx)(Y,{title:`Threads & editing`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[g,_,w]})}),t[19]=g,t[20]=_,t[21]=w,t[22]=T):T=t[22];let E;t[23]!==n||t[24]!==c||t[25]!==f?(E=n?(0,$.jsx)(X,{label:oc,description:`Open web links inside bb.`,children:(0,$.jsx)(xn,{checked:f,onCheckedChange:c,"aria-label":oc})}):null,t[23]=n,t[24]=c,t[25]=f,t[26]=E):E=t[26];let D;t[27]!==l||t[28]!==p?(D=(0,$.jsx)(X,{label:sc,description:`Point localhost links at this host.`,children:(0,$.jsx)(xn,{checked:p,onCheckedChange:l,"aria-label":sc})}),t[27]=l,t[28]=p,t[29]=D):D=t[29];let O;t[30]!==E||t[31]!==D?(O=(0,$.jsx)(Y,{title:`Links`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[E,D]})}),t[30]=E,t[31]=D,t[32]=O):O=t[32];let k;t[33]!==r||t[34]!==i||t[35]!==o?(k=(0,$.jsx)(Y,{title:`Git`,children:(0,$.jsx)(`div`,{className:`space-y-5`,children:(0,$.jsx)(gc,{value:i,disabled:r,onChange:o})})}),t[33]=r,t[34]=i,t[35]=o,t[36]=k):k=t[36];let A;return t[37]!==T||t[38]!==O||t[39]!==k?(A=(0,$.jsxs)($.Fragment,{children:[T,O,k]}),t[37]=T,t[38]=O,t[39]=k,t[40]=A):A=t[40],A}function xc(e){let t=(0,Z.c)(16),{disabled:n,enabled:r,onEnabledChange:i,streamerMode:a,onStreamerModeChange:o,telemetryEnabled:s,onTelemetryEnabledChange:c}=e,l;t[0]!==n||t[1]!==o||t[2]!==a?(l=(0,$.jsx)(X,{label:pc,description:`Hide the custom models from config.json in every model picker, so a screen share does not show them.`,children:(0,$.jsx)(xn,{checked:a,disabled:n,onCheckedChange:o,"aria-label":pc})}),t[0]=n,t[1]=o,t[2]=a,t[3]=l):l=t[3];let u;t[4]!==n||t[5]!==c||t[6]!==s?(u=(0,$.jsx)(X,{label:`Share anonymous usage data`,description:`Send anonymous app starts, thread and message counts, and plugin installs to help improve BB. Turning this off takes effect immediately for this server.`,children:(0,$.jsx)(xn,{checked:s,disabled:n,onCheckedChange:c,"aria-label":`Share anonymous usage data`})}),t[4]=n,t[5]=c,t[6]=s,t[7]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i?(d=(0,$.jsx)(X,{label:uc,description:`Show provider environment resolution and unhandled provider events for troubleshooting.`,children:(0,$.jsx)(xn,{checked:r,disabled:n,onCheckedChange:i,"aria-label":uc})}),t[8]=n,t[9]=r,t[10]=i,t[11]=d):d=t[11];let f;return t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,$.jsx)(Y,{title:`Privacy & diagnostics`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[l,u,d]})}),t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}var Sc={changelogPreview:{label:`Changelog preview`,description:`Show the latest release notes as a compact preview on the Updates page.`},mobileApp:{label:`Mobile app`,description:`Pair the bb mobile app over bb connect: shows Add mobile device under Remote access and enables bb connect machine-code.`},multiMachinePicker:{label:`Multi-machine picker`,description:`Use searchable, target-first environment and machine pickers when many machines are available.`},serverMove:{label:`Server move`,description:`Move the bb server to another machine from Settings → Machines, and export or import server data with bb server.`},sidebarProgressiveDisclosure:{label:`Sidebar progressive disclosure`,description:`In By project and By machine, show the first five groups in the current sort order, keep attention groups visible, and reveal ten more per click. Manually is unchanged.`},timelineWindowing:{label:`Timeline windowing`,description:`Mount only nearby rows in long timelines and expanded timeline details.`}};function Cc(e){let t=(0,Z.c)(6),{disabled:n,experiments:r,onExperimentChange:i}=e,a;t[0]!==n||t[1]!==r||t[2]!==i?(a=At.map(e=>{let t=Sc[e];return(0,$.jsx)(X,{label:t.label,description:t.description,children:(0,$.jsx)(xn,{checked:r[e],disabled:n,onCheckedChange:t=>i(e,t),"aria-label":t.label})},e)}),t[0]=n,t[1]=r,t[2]=i,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(Y,{title:`Experiments`,description:`Early features that are off by default. Opt in to try them.`,children:(0,$.jsx)(`div`,{className:`space-y-5`,children:a})}),t[4]=a,t[5]=o),o}function wc(){let e=(0,Z.c)(113),t=m(),n=Te(),r=Xe(),{hasDaemon:i}=Dt(),{accessState:a,requestAccess:s}=zt(),c;e[0]===i?c=e[1]:(c={enabled:i},e[0]=i,e[1]=c);let{workspaceOpenTargets:l}=an(c),[u,f]=on(l),[p,g]=nn(l),[_,v]=Oe(),[y,b]=vn(),[x,C]=sr(),[w,T]=S(),[E]=(0,Q.useState)($t),D=r.data?.experiments??qe,O=Xn(),k=r.data?.generalSettings??z,A=Zn(),j=r.data?.appearance??qt,N=rr(),P=Er(),F=o(),{activePluginId:I,activeSection:L,hasUnknownSection:R}=Ut();if(R){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(h,{to:ce,replace:!0}),e[2]=t):t=e[2],t}if(L===`plugins`){let t;e[3]===F.pathname?t=e[4]:(t=d(te,F.pathname)?.params.pluginId,e[3]=F.pathname,e[4]=t);let n=t,r;return e[5]===n?r=e[6]:(r=(0,$.jsx)(`div`,{className:`-mx-4 -mt-4 flex min-h-0 flex-1 flex-col overflow-hidden md:-mx-5 md:-mt-5`,children:n?(0,$.jsx)(cr,{pluginId:n}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col pt-4 md:pt-5`,children:(0,$.jsx)(mr,{mode:`installed`})})}),e[5]=n,e[6]=r),r}let B;if(I!==null){let t;e[7]===I?t=e[8]:(t=(0,$.jsx)(gi,{pluginId:I}),e[7]=I,e[8]=t),B=t}else if(L===`providers`){let t=r.data===void 0||A.isPending,n;e[9]===A?n=e[10]:(n=e=>A.mutateAsync(e),e[9]=A,e[10]=n);let i;e[11]!==k||e[12]!==t||e[13]!==n?(i=(0,$.jsx)(Pr,{disabled:t,generalSettings:k,onGeneralSettingsChange:n}),e[11]=k,e[12]=t,e[13]=n,e[14]=i):i=e[14],B=i}else if(L===`appearance`){let i=r.data===void 0||N.isPending,a;e[15]===r.data?.customThemes?a=e[16]:(a=r.data?.customThemes??[],e[15]=r.data?.customThemes,e[16]=a);let o;e[17]===r.data?.pluginThemes?o=e[18]:(o=r.data?.pluginThemes??[],e[17]=r.data?.pluginThemes,e[18]=o);let s;e[19]!==P||e[20]!==j.faviconColor||e[21]!==N?(s=e=>N.mutate({themeId:e,faviconColor:j.faviconColor},{onError:()=>P.previewTheme(null)}),e[19]=P,e[20]=j.faviconColor,e[21]=N,e[22]=s):s=e[22];let c;e[23]===t?c=e[24]:(c=()=>t(ae(),{state:{focusPrompt:!0,initialPrompt:Zs}}),e[23]=t,e[24]=c);let l;e[25]!==j.themeId||e[26]!==N?(l=e=>N.mutate({themeId:j.themeId,faviconColor:e}),e[25]=j.themeId,e[26]=N,e[27]=l):l=e[27];let u;e[28]!==P.prefetchThemes||e[29]!==P.previewTheme||e[30]!==j||e[31]!==i||e[32]!==a||e[33]!==o||e[34]!==s||e[35]!==c||e[36]!==l||e[37]!==n?(u=(0,$.jsx)(_c,{appearance:j,appearanceDisabled:i,customThemes:a,pluginThemes:o,faviconColor:j.faviconColor,themePreference:n,onAppearanceThemeChange:s,onAppearanceThemePrefetch:P.prefetchThemes,onAppearanceThemePreview:P.previewTheme,onCreatePalette:c,onFaviconColorChange:l,onThemePreferenceChange:M}),e[28]=P.prefetchThemes,e[29]=P.previewTheme,e[30]=j,e[31]=i,e[32]=a,e[33]=o,e[34]=s,e[35]=c,e[36]=l,e[37]=n,e[38]=u):u=e[38],B=u}else if(L===`keyboard`){let t;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(go,{}),e[39]=t):t=e[39],B=t}else if(L===`browser`){let t;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ho,{}),e[40]=t):t=e[40],B=t}else if(L===`files`){let t;e[41]!==a||e[42]!==u||e[43]!==p||e[44]!==i||e[45]!==s||e[46]!==f||e[47]!==g||e[48]!==l?(t=(0,$.jsx)(ac,{accessState:a,directoryTargetId:u,fileTargetId:p,hasDaemon:i,onDirectoryTargetChange:f,onFileTargetChange:g,onRequestAccess:s,targets:l}),e[41]=a,e[42]=u,e[43]=p,e[44]=i,e[45]=s,e[46]=f,e[47]=g,e[48]=l,e[49]=t):t=e[49];let n;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(xi,{}),e[50]=n):n=e[50];let r;e[51]===t?r=e[52]:(r=(0,$.jsxs)($.Fragment,{children:[t,n]}),e[51]=t,e[52]=r),B=r}else if(L===`projects`){let t;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[53]=t):t=e[53],B=t}else if(L===`machines`){let t;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ns,{}),(0,$.jsx)(_r,{})]}),e[54]=t):t=e[54],B=t}else if(L===`environment-variables`){let t;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(er,{}),e[55]=t):t=e[55],B=t}else if(L===`updates`){let t;e[56]===D.changelogPreview?t=e[57]:(t=(0,$.jsx)(Va,{showChangelogPreview:D.changelogPreview}),e[56]=D.changelogPreview,e[57]=t),B=t}else if(L===`experiments`){let t=r.data===void 0||O.isPending,n;e[58]!==D||e[59]!==O?(n=(e,t)=>O.mutate({...D,[e]:t}),e[58]=D,e[59]=O,e[60]=n):n=e[60];let i;e[61]!==D||e[62]!==t||e[63]!==n?(i=(0,$.jsx)(Cc,{disabled:t,experiments:D,onExperimentChange:n}),e[61]=D,e[62]=t,e[63]=n,e[64]=i):i=e[64],B=i}else if(L===`marketplaces`){let t;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Fs,{}),e[65]=t):t=e[65],B=t}else if(L===`community`){let t;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Hi,{}),e[66]=t):t=e[66],B=t}else if(L===`archived`){let t;e[67]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ps,{}),e[67]=t):t=e[67],B=t}else{let t=r.data===void 0||A.isPending,n;e[68]!==k||e[69]!==A?(n=async e=>{await A.mutateAsync({...k,managedBranchPrefix:e})},e[68]=k,e[69]=A,e[70]=n):n=e[70];let i;e[71]!==k||e[72]!==A?(i=e=>A.mutate({...k,steerActiveThreadOnEnter:e}),e[71]=k,e[72]=A,e[73]=i):i=e[73];let a;e[74]!==E||e[75]!==k.managedBranchPrefix||e[76]!==k.steerActiveThreadOnEnter||e[77]!==x||e[78]!==_||e[79]!==y||e[80]!==w||e[81]!==C||e[82]!==v||e[83]!==b||e[84]!==T||e[85]!==t||e[86]!==n||e[87]!==i?(a=(0,$.jsx)(bc,{desktopBrowserAvailable:E,generalSettingsDisabled:t,managedBranchPrefix:k.managedBranchPrefix,onManagedBranchPrefixChange:n,navigateToThreadAfterCreate:x,openLinksInAppBrowser:_,rewriteLocalhostLinks:y,richTextEditing:w,steerActiveThreadOnEnter:k.steerActiveThreadOnEnter,onNavigateToThreadAfterCreateChange:C,onOpenLinksInAppBrowserChange:v,onRewriteLocalhostLinksChange:b,onRichTextEditingChange:T,onSteerActiveThreadOnEnterChange:i}),e[74]=E,e[75]=k.managedBranchPrefix,e[76]=k.steerActiveThreadOnEnter,e[77]=x,e[78]=_,e[79]=y,e[80]=w,e[81]=C,e[82]=v,e[83]=b,e[84]=T,e[85]=t,e[86]=n,e[87]=i,e[88]=a):a=e[88];let o,s;e[89]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ks,{}),s=(0,$.jsx)(Ri,{}),e[89]=o,e[90]=s):(o=e[89],s=e[90]);let c;e[91]!==k||e[92]!==A?(c=e=>A.mutate({...k,telemetryEnabled:e}),e[91]=k,e[92]=A,e[93]=c):c=e[93];let l;e[94]!==k||e[95]!==A?(l=e=>A.mutate({...k,streamerMode:e}),e[94]=k,e[95]=A,e[96]=l):l=e[96];let u=r.data===void 0||A.isPending,d;e[97]!==k||e[98]!==A?(d=e=>A.mutate({...k,showDiagnosticEvents:e}),e[97]=k,e[98]=A,e[99]=d):d=e[99];let f;e[100]!==k.showDiagnosticEvents||e[101]!==k.streamerMode||e[102]!==k.telemetryEnabled||e[103]!==d||e[104]!==c||e[105]!==l||e[106]!==u?(f=(0,$.jsx)(xc,{telemetryEnabled:k.telemetryEnabled,onTelemetryEnabledChange:c,streamerMode:k.streamerMode,onStreamerModeChange:l,enabled:k.showDiagnosticEvents,disabled:u,onEnabledChange:d}),e[100]=k.showDiagnosticEvents,e[101]=k.streamerMode,e[102]=k.telemetryEnabled,e[103]=d,e[104]=c,e[105]=l,e[106]=u,e[107]=f):f=e[107];let p;e[108]!==f||e[109]!==a?(p=(0,$.jsxs)($.Fragment,{children:[a,o,s,f]}),e[108]=f,e[109]=a,e[110]=p):p=e[110],B=p}let V;return e[111]===B?V=e[112]:(V=(0,$.jsx)(bn,{contentClassName:`pt-4 md:pt-5`,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-3xl space-y-10`,children:B})}),e[111]=B,e[112]=V),V}export{wc as SettingsView};
1037
+ `)){let e=s.trimEnd();if(e.startsWith(`## `)&&!e.startsWith(`### `)){o(),r=null,n={version:e.slice(3).trim(),lede:[],sections:[]},t.push(n);continue}if(n){if(e.startsWith(`### `)){o(),r={title:e.slice(4).trim(),blocks:[]},n.sections.push(r);continue}if(e.startsWith(`- `)){o();let t=a();if(!t)continue;let n=t.at(-1),r=n?.kind===`list`?n:null;r||(r={kind:`list`,items:[]},t.push(r)),r.items.push(e.slice(2).trim());continue}if(e.startsWith(` `)&&e.trim()){let t=a()?.at(-1);if(t?.kind===`list`&&t.items.length>0){t.items[t.items.length-1]+=` ${e.trim()}`;continue}}if(!e.trim()){o();continue}i.push(e.trim())}}return o(),t}var Qi={"0.43.3":{date:`September 18, 2026`,headline:`Saved drafts, browser annotations, and live browser previews`},"0.43.0":{date:`September 11, 2026`,headline:`Custom environments, machine plugins, and browser control`},"0.42.0":{date:`September 5, 2026`,headline:`Account Pooler, push notifications, and a new plugin catalog`},"0.41.0":{date:`September 1, 2026`,headline:`Scheduled sends, concurrency limits, and a rebuilt mobile app`},"0.40.0":{date:`August 26, 2026`,headline:`File Editor, quick palette, and agent providers`},"0.39.0":{date:`August 19, 2026`,headline:`Faster large threads and a long list of fixes`},"0.38.0":{date:`August 15, 2026`,headline:`Extensions Page and Plugin Marketplaces`},"0.37.0":{date:`August 11, 2026`,headline:`A much faster mobile app`},"0.36.0":{date:`August 8, 2026`,headline:`Fixes and improvements`},"0.35.0":{date:`August 4, 2026`,headline:`Plugins`},"0.34.0":{date:`July 28, 2026`,headline:`Fresher models, cross-provider questions`},"0.33.0":{date:`July 21, 2026`,headline:`Quieter updates and safer approvals`},"0.0.31":{date:`July 17, 2026`,headline:`Splits for everyone`},"0.0.30":{date:`July 14, 2026`,headline:`Multi-machine workflows and bb Connect`},"0.0.29":{date:`July 9, 2026`,headline:`More agents, more models, redesigned Settings`}},$i=`https://raw.githubusercontent.com/get-bb/bb/main/CHANGELOG.md`,ea=Zi(Xi)[0]??null;async function ta(e,t){let n=await e($i,{signal:t});if(!n.ok)throw Error(`Changelog request failed (${n.status})`);let[r]=Zi(await n.text());if(r===void 0)throw Error(`The changelog has no releases`);return r}var na=new Map,ra=`https://getbb.app/changelog`,ia=5*6e4,aa=`bb.settings.updates.dismissed-changelog-version`,oa=2e3,sa=180;function ca(e,t){let n=/^\d+(?:\.\d+)*$/;if(!n.test(e)||!n.test(t))return e!==t;let r=e.split(`.`).map(Number),i=t.split(`.`).map(Number),a=Math.max(r.length,i.length);for(let e=0;e<a;e+=1){let t=r[e]??0,n=i[e]??0;if(t!==n)return t>n}return!1}var la=1;function ua(e){let t=(0,Z.c)(32),{label:n,tooltipLabel:r,icon:i,iconPosition:a,visibleLabel:o,className:s,variant:c,loading:l,disabled:u,disabledReason:d,onClick:f}=e,p=a===void 0?`start`:a,m=l===void 0?!1:l,h=u===void 0?!1:u;if(o===void 0){let e=c===`default`&&`bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground`,a;t[0]!==s||t[1]!==e?(a=R(`size-7`,e,s),t[0]=s,t[1]=e,t[2]=a):a=t[2];let o;t[3]===f?o=t[4]:(o=()=>f?.(),t[3]=f,t[4]=o);let l;return t[5]!==h||t[6]!==d||t[7]!==i||t[8]!==n||t[9]!==m||t[10]!==a||t[11]!==o||t[12]!==r?(l=(0,$.jsx)(Mn,{label:n,tooltipLabel:r,icon:i,loading:m,disabled:h,disabledReason:d,className:a,onClick:o}),t[5]=h,t[6]=d,t[7]=i,t[8]=n,t[9]=m,t[10]=a,t[11]=o,t[12]=r,t[13]=l):l=t[13],l}let g=c===void 0||c===`ghost`,_=c??`ghost`,v=g&&`text-subtle-foreground hover:text-foreground`,y;t[14]!==s||t[15]!==v?(y=R(`h-7 gap-1.5 px-2.5 font-normal`,v,s),t[14]=s,t[15]=v,t[16]=y):y=t[16];let b=p===`end`?o:null,x=m?`Spinner`:i,S=m&&`animate-spin`,C;t[17]===S?C=t[18]:(C=R(`size-3.5`,S),t[17]=S,t[18]=C);let w;t[19]!==C||t[20]!==x?(w=(0,$.jsx)(P,{"aria-hidden":!0,name:x,className:C}),t[19]=C,t[20]=x,t[21]=w):w=t[21];let T=p===`start`?o:null,E;return t[22]!==h||t[23]!==n||t[24]!==m||t[25]!==f||t[26]!==w||t[27]!==T||t[28]!==_||t[29]!==y||t[30]!==b?(E=(0,$.jsxs)(J,{type:`button`,variant:_,size:`sm`,"aria-label":n,"aria-busy":m,disabled:h,className:y,onClick:f,children:[b,w,T]}),t[22]=h,t[23]=n,t[24]=m,t[25]=f,t[26]=w,t[27]=T,t[28]=_,t[29]=y,t[30]=b,t[31]=E):E=t[31],E}var da=`grid min-w-0 grid-cols-[1.5rem_minmax(0,1fr)_auto] items-center gap-3`,fa=`py-2 first:pt-0 last:pb-0`;function pa(e){let t=(0,Z.c)(8),{leading:n,children:r,className:i}=e,a;t[0]===i?a=t[1]:(a=R(da,fa,`text-sm`,i),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center`,children:n}),t[2]=n,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:a,children:[o,r]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function ma(e){let t=(0,Z.c)(6),{current:n,latest:r}=e;if(n===null)return null;let i;t[0]!==n||t[1]!==r?(i=r!==null&&r!==n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`px-1`,children:`→`}),(0,$.jsx)(`span`,{className:`font-semibold text-version-upgrade`,children:r})]}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;return t[3]!==n||t[4]!==i?(a=(0,$.jsxs)(`span`,{"data-version-metadata":!0,className:`min-w-0 shrink text-2xs text-muted-foreground`,children:[n,i]}),t[3]=n,t[4]=i,t[5]=a):a=t[5],a}function ha(e){let t=(0,Z.c)(9),{name:n,detail:r,current:i,latest:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n}),t[0]=n,t[1]=o);let s;t[2]!==i||t[3]!==a?(s=(0,$.jsx)(ma,{current:i,latest:a}),t[2]=i,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==r||t[6]!==o||t[7]!==s?(c=(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[o,r,s]}),t[5]=r,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function ga(e){return ur[e].tone===`error`?`font-semibold text-destructive`:`font-semibold text-subtle-foreground`}function _a(e){let t=(0,Z.c)(5),{state:n,children:r}=e,i;t[0]===n?i=t[1]:(i=R(`shrink-0 text-xs`,ga(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,$.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function va(e){let t=(0,Z.c)(47),{state:n,actionIcon:r,actionLabel:i,actionTooltip:a,buttonLeading:o,buttonLabel:s,loading:c,live:l,onClick:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=ur[n],m=r??p.icon,h=n===`failed`?dr:null,g=d||p.inFlight===!0,_=p.label,v=p.inFlight!==!0;if(u!==void 0&&s!==void 0){let e;t[0]!==i||t[1]!==_?(e=[_,i].filter(Boolean),t[0]=i,t[1]=_,t[2]=e):e=t[2];let n=e.join(` · `),r;t[3]!==h||t[4]!==o||t[5]!==d?(r=d?(0,$.jsx)(P,{"aria-hidden":!0,name:`Loading`,className:`size-3 animate-spin`}):o===void 0?h===null?null:(0,$.jsx)(P,{"aria-hidden":!0,name:h,className:`size-3`}):o,t[3]=h,t[4]=o,t[5]=d,t[6]=r):r=t[6];let a;return t[7]!==s||t[8]!==d||t[9]!==u||t[10]!==n||t[11]!==r?(a=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,"aria-label":n,"aria-busy":d,disabled:d,className:`h-6 shrink-0 gap-1.5 px-2 text-xs`,onClick:u,children:[r,s]})}),t[7]=s,t[8]=d,t[9]=u,t[10]=n,t[11]=r,t[12]=a):a=t[12],a}if(u!==void 0&&m!==null){let e;t[13]!==i||t[14]!==_?(e=[_,i].filter(Boolean),t[13]=i,t[14]=_,t[15]=e):e=t[15];let n=e.join(` · `),r=a??i??p.label,o;return t[16]!==m||t[17]!==d||t[18]!==u||t[19]!==n||t[20]!==r?(o=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsx)(ua,{label:n,tooltipLabel:r,icon:m,loading:d,onClick:u})}),t[16]=m,t[17]=d,t[18]=u,t[19]=n,t[20]=r,t[21]=o):o=t[21],o}if(m===null){let e;return t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`flex h-7 shrink-0 items-center`}),t[22]=e):e=t[22],e}let y=f?`status`:void 0,b=f?`polite`:void 0,x=g&&`animate-spin`,S=p.tone===`muted`&&(n===`up-to-date`?`text-input`:`text-subtle-foreground`),C=p.tone===`error`&&`text-destructive`,w;t[23]!==x||t[24]!==S||t[25]!==C?(w=R(`size-4`,x,S,C),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26];let T;t[27]!==m||t[28]!==w?(T=(0,$.jsx)(P,{"aria-hidden":!0,name:m,className:w}),t[27]=m,t[28]=w,t[29]=T):T=t[29];let E;t[30]===_?E=t[31]:(E=(0,$.jsx)(`span`,{className:`sr-only`,children:_}),t[30]=_,t[31]=E);let D;t[32]!==n||t[33]!==E||t[34]!==y||t[35]!==b||t[36]!==T?(D=(0,$.jsxs)(`span`,{role:y,"aria-live":b,"data-update-state":n,className:`flex size-7 shrink-0 items-center justify-center`,children:[T,E]}),t[32]=n,t[33]=E,t[34]=y,t[35]=b,t[36]=T,t[37]=D):D=t[37];let O=D;if(!v){let e;return t[38]===O?e=t[39]:(e=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:O}),t[38]=O,t[39]=e),e}let k;t[40]===O?k=t[41]:(k=(0,$.jsx)(ct,{asChild:!0,children:O}),t[40]=O,t[41]=k);let A;t[42]===p.label?A=t[43]:(A=(0,$.jsx)(Et,{children:p.label}),t[42]=p.label,t[43]=A);let j;return t[44]!==k||t[45]!==A?(j=(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsx)(pt,{delayDuration:250,children:(0,$.jsxs)(Mt,{children:[k,A]})})}),t[44]=k,t[45]=A,t[46]=j):j=t[46],j}function ya(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center justify-end gap-1`,children:n}),t[0]=n,t[1]=r),r}var ba={p:({children:e})=>(0,$.jsx)($.Fragment,{children:e}),a:({children:e,href:t})=>(0,$.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,onClick:e=>{e.preventDefault(),t!==void 0&&oe(t)},children:e}),code:({children:e})=>(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-foreground`,children:e}),strong:({children:e})=>(0,$.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e})};function xa(e){let t=(0,Z.c)(2),{text:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(_n,{components:ba,skipHtml:!0,children:n}),t[0]=n,t[1]=r),r}function Sa({blocks:e,lede:t=!1}){return e.map((e,n)=>e.kind===`list`?(0,$.jsx)(`ul`,{className:`mt-2.5 space-y-1.5`,children:e.items.map(e=>(0,$.jsx)(`li`,{className:`relative pl-4 text-sm leading-normal text-muted-foreground before:absolute before:left-0 before:top-2 before:size-1 before:rounded-sm before:bg-border`,children:(0,$.jsx)(xa,{text:e})},e))},n):(0,$.jsx)(`p`,{className:R(`mt-2.5 text-sm leading-relaxed text-muted-foreground first:mt-0`,t&&`text-foreground/80`),children:(0,$.jsx)(xa,{text:e.text})},n))}function Ca(){let e=(0,Z.c)(83),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[`updates`,`changelog`,`latest`],e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n={queryKey:t,queryFn:Ea,placeholderData:ea??void 0,retry:!1,staleTime:ia},e[1]=n):n=e[1];let r=l(n),i=r.data??ea,[a,o]=(0,Q.useState)(Ta),[s,c]=(0,Q.useState)(null),u=et(),d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(!1),m;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{e!==null&&p(e.scrollTop+e.clientHeight<e.scrollHeight-1)},e[2]=m):m=e[2];let h=m,g;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{h(d.current)},e[3]=g):g=e[3];let _;e[4]===i?_=e[5]:(_=[i],e[4]=i,e[5]=_),(0,Q.useEffect)(g,_);let v,y;e[6]===s?(v=e[7],y=e[8]):(v=()=>{if(s?.phase!==`confirming`)return;let e=window.setTimeout(()=>{c(e=>e?.version===s.version?{...e,phase:`exiting`}:e)},oa);return()=>window.clearTimeout(e)},y=[s],e[6]=s,e[7]=v,e[8]=y),(0,Q.useEffect)(v,y);let b,x;if(e[9]!==s||e[10]!==u?(b=()=>{if(s?.phase!==`exiting`)return;let e=s.version,t=window.setTimeout(()=>{o(e),c(t=>t?.version===e?null:t)},u?0:sa);return()=>window.clearTimeout(t)},x=[s,u],e[9]=s,e[10]=u,e[11]=b,e[12]=x):(b=e[11],x=e[12]),(0,Q.useEffect)(b,x),i===null||a.length>0&&(r.dataUpdatedAt===0||!ca(i.version,a)))return null;let S=Qi[i.version],C=s?.version===i.version?s.phase:`visible`,w=C===`visible`,T=C===`exiting`?`-mb-6 grid-rows-[0fr] -translate-y-1 opacity-0`:`grid-rows-[1fr] translate-y-0 opacity-100`,E;e[13]===T?E=e[14]:(E=R(`grid transition-[grid-template-rows,margin,opacity,transform] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none [&>section]:min-h-0 [&>section]:overflow-hidden`,T),e[13]=T,e[14]=E);let D=!w,O=w?`grid-rows-[1fr] opacity-100`:`pointer-events-none grid-rows-[0fr] opacity-0`,k;e[15]===O?k=e[16]:(k=R(`grid transition-[grid-template-rows,opacity] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,O),e[15]=O,e[16]=k);let A;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`h2`,{className:`min-w-0`,children:(0,$.jsx)(`span`,{"data-changelog-label":!0,className:`inline-flex rounded-sm border border-border bg-muted/40 px-2.5 py-1 text-xs font-medium leading-none text-muted-foreground`,children:`What's new`})}),e[17]=A):A=e[17];let j;e[18]!==i.version||e[19]!==w?(j=w?(0,$.jsxs)(Mt,{delayDuration:300,disableHoverableContent:!0,children:[(0,$.jsx)(ct,{asChild:!0,children:(0,$.jsx)(J,{"data-changelog-dismiss":!0,type:`button`,variant:`ghost`,size:`icon`,className:`size-7 text-muted-foreground hover:text-foreground`,"aria-label":`Dismiss bb ${i.version} changelog preview`,onClick:()=>{It.setItem(aa,i.version),c({phase:`confirming`,version:i.version})},children:(0,$.jsx)(P,{"aria-hidden":!0,name:`X`,className:`size-3.5`})})}),(0,$.jsx)(Et,{side:`bottom`,children:`Dismiss`})]}):null,e[18]=i.version,e[19]=w,e[20]=j):j=e[20];let M;e[21]===j?M=e[22]:(M=(0,$.jsxs)(`div`,{"data-changelog-header":!0,className:`flex min-w-0 items-center justify-between gap-4`,children:[A,j]}),e[21]=j,e[22]=M);let N;e[23]!==i.version||e[24]!==S?(N=S===void 0?null:(0,$.jsxs)(`div`,{className:`mt-4 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,$.jsx)(`span`,{"data-changelog-version":i.version,className:`inline-flex rounded-full border border-border bg-muted/30 px-2.5 py-1 font-mono text-xs font-semibold leading-none tracking-tight text-foreground`,children:i.version}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:S.date})]}),e[23]=i.version,e[24]=S,e[25]=N):N=e[25];let F=S===void 0?`mt-4`:`mt-3`,I;e[26]===F?I=e[27]:(I=R(`relative min-w-0`,F),e[26]=F,e[27]=I);let L;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>h(e.currentTarget),e[28]=L):L=e[28];let z=S?.headline??i.version,B;e[29]===z?B=e[30]:(B=(0,$.jsx)(`h3`,{className:`text-lg font-semibold leading-snug tracking-tight text-foreground`,children:z}),e[29]=z,e[30]=B);let V;e[31]===i.lede?V=e[32]:(V=i.lede.length===0?null:(0,$.jsx)(`div`,{className:`mt-2`,children:(0,$.jsx)(Sa,{blocks:i.lede,lede:!0})}),e[31]=i.lede,e[32]=V);let H;e[33]===i.sections?H=e[34]:(H=i.sections.map(wa),e[33]=i.sections,e[34]=H);let U;e[35]!==B||e[36]!==V||e[37]!==H?(U=(0,$.jsxs)(`div`,{ref:d,"data-changelog-release-scroll":!0,onScroll:L,className:`max-h-56 overflow-y-auto pr-3`,children:[B,V,H]}),e[35]=B,e[36]=V,e[37]=H,e[38]=U):U=e[38];let W;e[39]===f?W=e[40]:(W=f?(0,$.jsx)(ge,{placement:`below`,inset:!0}):null,e[39]=f,e[40]=W);let G;e[41]!==I||e[42]!==U||e[43]!==W?(G=(0,$.jsxs)(`div`,{className:I,children:[U,W]}),e[41]=I,e[42]=U,e[43]=W,e[44]=G):G=e[44];let K;e[45]!==M||e[46]!==N||e[47]!==G?(K=(0,$.jsxs)(`article`,{"data-changelog-preview":!0,className:`min-w-0 p-4 sm:p-5`,children:[M,N,G]}),e[45]=M,e[46]=N,e[47]=G,e[48]=K):K=e[48];let q=!w,ee=`Open the full bb ${i.version} changelog`,te;e[49]===i.version?te=e[50]:(te=()=>oe(`${ra}#${i.version.replaceAll(`.`,`-`)}`),e[49]=i.version,e[50]=te);let ne;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(P,{"aria-hidden":!0,name:`ExternalLink`,className:`size-3.5`}),e[51]=ne):ne=e[51];let re;e[52]!==q||e[53]!==ee||e[54]!==te?(re=(0,$.jsx)(`div`,{"data-changelog-footer":!0,className:`flex items-center justify-end border-t border-foreground bg-foreground px-4 py-2.5 text-background sm:px-5`,children:(0,$.jsxs)(`button`,{type:`button`,disabled:q,"aria-label":ee,onClick:te,className:`inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-xs font-semibold text-background underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-background`,children:[`Full changelog`,ne]})}),e[52]=q,e[53]=ee,e[54]=te,e[55]=re):re=e[55];let ie;e[56]!==K||e[57]!==re?(ie=(0,$.jsxs)(`div`,{className:`min-h-0 overflow-hidden`,children:[K,re]}),e[56]=K,e[57]=re,e[58]=ie):ie=e[58];let ae;e[59]!==D||e[60]!==k||e[61]!==ie?(ae=(0,$.jsx)(`div`,{"data-changelog-release-panel":!0,"aria-hidden":D,className:k,children:ie}),e[59]=D,e[60]=k,e[61]=ie,e[62]=ae):ae=e[62];let se=w?`pointer-events-none grid-rows-[0fr] opacity-0`:`grid-rows-[1fr] opacity-100`,ce;e[63]===se?ce=e[64]:(ce=R(`grid transition-[grid-template-rows,opacity] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none`,se),e[63]=se,e[64]=ce);let le;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(P,{"aria-hidden":!0,name:`CircleCheck`,className:`size-4 text-muted-foreground`}),e[65]=le):le=e[65];let ue;e[66]===i.version?ue=e[67]:(ue=(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[le,(0,$.jsx)(`span`,{className:`inline-flex rounded-full border border-border bg-muted/30 px-2.5 py-1 font-mono text-xs font-semibold leading-none tracking-tight text-foreground`,children:i.version})]}),e[66]=i.version,e[67]=ue);let de,fe;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(`h3`,{className:`mt-3 text-lg font-semibold leading-snug tracking-tight text-foreground`,children:`You're all caught up`}),fe=(0,$.jsx)(`p`,{className:`mt-1.5 text-sm leading-relaxed text-muted-foreground`,children:`We'll show the next bb release here.`}),e[68]=de,e[69]=fe):(de=e[68],fe=e[69]);let pe;e[70]===ue?pe=e[71]:(pe=(0,$.jsx)(`div`,{className:`min-h-0 overflow-hidden`,children:(0,$.jsx)(`div`,{className:`p-4 text-center sm:p-5`,children:(0,$.jsxs)(`div`,{className:`mx-auto max-w-sm`,children:[ue,de,fe]})})}),e[70]=ue,e[71]=pe);let me;e[72]!==w||e[73]!==ce||e[74]!==pe?(me=(0,$.jsx)(`div`,{"data-changelog-dismiss-confirmation":!0,role:`status`,"aria-live":`polite`,"aria-hidden":w,className:ce,children:pe}),e[72]=w,e[73]=ce,e[74]=pe,e[75]=me):me=e[75];let he;e[76]!==ae||e[77]!==me?(he=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-lg border border-border bg-card`,children:[ae,me]}),e[76]=ae,e[77]=me,e[78]=he):he=e[78];let _e;return e[79]!==C||e[80]!==E||e[81]!==he?(_e=(0,$.jsx)(`div`,{"data-updates-domain":`changelog`,"data-changelog-dismiss-phase":C,className:E,children:he}),e[79]=C,e[80]=E,e[81]=he,e[82]=_e):_e=e[82],_e}function wa(e){return(0,$.jsxs)(`div`,{className:`mt-4`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),(0,$.jsx)(Sa,{blocks:e.blocks})]},e.title)}function Ta(){return It.getItem(aa,``)}function Ea(e){let{signal:t}=e;return ta(fetch,t)}function Da(e){let t=(0,Z.c)(43),{systemVersion:n,desktopInfo:r,isDesktop:i,onRelaunchDesktop:a,onRetryDesktop:o,isChecking:s}=e,c=s===void 0?!1:s,l;t[0]===c?l=t[1]:(l=c?(0,$.jsx)(va,{live:!0,state:`in-progress`}):(0,$.jsx)(va,{state:`up-to-date`}),t[0]=c,t[1]=l);let u=l,d=Oa;if(i&&r===null){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=d((0,$.jsx)(ha,{name:`bb app`,current:null,latest:null}),(0,$.jsx)(va,{live:!0,state:`in-progress`})),t[2]=e):e=t[2],e}if(r!==null){let e=r.pendingVersion??r.latestVersion,n=r.updateAvailable?e:null,i;t[3]!==r.version||t[4]!==n?(i=(0,$.jsx)(ha,{name:`bb app`,current:r.version,latest:n}),t[3]=r.version,t[4]=n,t[5]=i):i=t[5];let s=i;if(r.updateDownloaded){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(lr,{className:`size-3`}),t[6]=e):e=t[6];let n;t[7]===a?n=t[8]:(n=(0,$.jsx)(va,{state:`restart-required`,buttonLeading:e,buttonLabel:`Relaunch`,actionLabel:`Relaunch bb to finish updating`,onClick:()=>a?.()}),t[7]=a,t[8]=n);let r;return t[9]!==s||t[10]!==n?(r=d(s,n),t[9]=s,t[10]=n,t[11]=r):r=t[11],r}if(r.downloadState===`downloading`){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(va,{live:!0,state:`in-progress`}),t[12]=e):e=t[12];let n;return t[13]===s?n=t[14]:(n=d(s,e),t[13]=s,t[14]=n),n}if(r.downloadState===`failed`){let e;t[15]===o?e=t[16]:(e=(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:`Retry the download`,onClick:()=>o?.()}),t[15]=o,t[16]=e);let n;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(_a,{state:`failed`,children:`Download failed`}),t[17]=n):n=t[17];let r;return t[18]!==s||t[19]!==e?(r=d(s,e,n),t[18]=s,t[19]=e,t[20]=r):r=t[20],r}if(r.updateAvailable){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(va,{state:`update-available`}),t[21]=e):e=t[21];let n;return t[22]===s?n=t[23]:(n=d(s,e),t[22]=s,t[23]=n),n}let c;return t[24]!==s||t[25]!==u?(c=d(s,u),t[24]=s,t[25]=u,t[26]=c):c=t[26],c}if(n===void 0){let e;return t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=d((0,$.jsx)(ha,{name:`bb app`,current:null,latest:null}),(0,$.jsx)(va,{state:`in-progress`})),t[27]=e):e=t[27],e}let f;t[28]!==n.updateAvailable||t[29]!==n.upgradeCommand?(f=n.updateAvailable?(0,$.jsx)(`span`,{className:`hidden truncate font-mono text-2xs text-muted-foreground sm:inline`,children:n.upgradeCommand}):void 0,t[28]=n.updateAvailable,t[29]=n.upgradeCommand,t[30]=f):f=t[30];let p=n.updateAvailable?n.latestVersion:null,m;t[31]!==n.currentVersion||t[32]!==f||t[33]!==p?(m=(0,$.jsx)(ha,{name:`bb app`,detail:f,current:n.currentVersion,latest:p}),t[31]=n.currentVersion,t[32]=f,t[33]=p,t[34]=m):m=t[34];let h=m;if(n.updateAvailable){let e;t[35]===n.upgradeCommand?e=t[36]:(e=(0,$.jsx)(va,{state:`update-available`,actionIcon:`Copy`,actionLabel:`Copy the upgrade command`,actionTooltip:`Copy command`,onClick:()=>{Ae(n.upgradeCommand,{successMessage:`Upgrade command copied`,errorMessage:`Couldn't copy upgrade command`})}}),t[35]=n.upgradeCommand,t[36]=e);let r;return t[37]!==h||t[38]!==e?(r=d(h,e),t[37]=h,t[38]=e,t[39]=r):r=t[39],r}let g;return t[40]!==h||t[41]!==u?(g=d(h,u),t[40]=h,t[41]=u,t[42]=g):g=t[42],g}function Oa(e,t,n){return(0,$.jsxs)(pa,{leading:(0,$.jsx)(`span`,{"data-bb-update-role":`app`,"aria-hidden":!0,children:(0,$.jsx)(lr,{className:`size-4`})}),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[e,n]}),(0,$.jsx)(ya,{children:t})]})}function ka(e){return e.statusError||e.canRetryDaemonUpdate||e.host.status!==`connected`}function Aa(e){return e.canRetryDaemonUpdate||e.host.status!==`connected`||e.statusError||e.statusPending||e.providerStatus===null?[]:e.issues.filter(at)}function ja(e){return e.canRetryDaemonUpdate||e.host.status!==`connected`||e.statusError||e.statusPending||e.providerStatus===null?[]:Gt(e.providerStatus).filter(e=>e.status.installed)}function Ma(e){let t=(0,Z.c)(27),{machine:n,now:r,retryUpdatePending:i,onRetryDaemonUpdate:a,onOpenMachine:o}=e,{host:s}=n,c;t[0]!==s||t[1]!==n.canRetryDaemonUpdate||t[2]!==r?(c=n.canRetryDaemonUpdate&&Ve(s,r),t[0]=s,t[1]=n.canRetryDaemonUpdate,t[2]=r,t[3]=c):c=t[3];let l=c,u=n.canRetryDaemonUpdate&&!l,d;t[4]===s?d=t[5]:(d=Ie(s)&&!Re(s),t[4]=s,t[5]=d);let f=d,p=s.status!==`connected`,m;t[6]!==f||t[7]!==l?(m=l?(0,$.jsx)(_a,{state:`failed`,children:`Update didn't finish`}):f?(0,$.jsx)(_a,{state:`offline`,children:`Update this app to reconnect`}):null,t[6]=f,t[7]=l,t[8]=m):m=t[8];let h=m,g=`Open ${s.name} settings`,_;t[9]!==s.id||t[10]!==o?(_=()=>o(s.id),t[9]=s.id,t[10]=o,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`span`,{"data-bb-update-role":`daemon`,"aria-hidden":!0,children:(0,$.jsx)(lr,{className:`size-4`})}),t[12]=v):v=t[12];let y;t[13]!==s.id||t[14]!==s.name||t[15]!==f||t[16]!==p||t[17]!==a||t[18]!==i||t[19]!==l||t[20]!==u?(y=u?(0,$.jsx)(va,{live:!0,state:`in-progress`}):l?(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:`Retry on ${s.name} now`,loading:i,onClick:()=>a(s.id)}):f||p?(0,$.jsx)(va,{state:`offline`}):null,t[13]=s.id,t[14]=s.name,t[15]=f,t[16]=p,t[17]=a,t[18]=i,t[19]=l,t[20]=u,t[21]=y):y=t[21];let b;return t[22]!==h||t[23]!==g||t[24]!==_||t[25]!==y?(b=(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:g,onOpen:_,leading:v,title:`bb daemon`,state:h,trailingMeta:null,actions:y}),t[22]=h,t[23]=g,t[24]=_,t[25]=y,t[26]=b):b=t[26],b}function Na(e){let t=(0,Z.c)(16),{machine:n,onRecheckClis:r,onOpenMachine:i}=e,{host:a}=n,o=`Open ${a.name} settings`,s;t[0]!==a.id||t[1]!==i?(s=()=>i(a.id),t[0]=a.id,t[1]=i,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(P,{"aria-hidden":!0,name:`Terminal`,className:`size-3.5 text-muted-foreground`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(_a,{state:`failed`,children:`Couldn't check for updates`}),t[4]=l):l=t[4];let u=`Check ${a.name}'s CLIs again`,d;t[5]!==a.id||t[6]!==r?(d=()=>r(a.id),t[5]=a.id,t[6]=r,t[7]=d):d=t[7];let f;t[8]!==n.statusFetching||t[9]!==u||t[10]!==d?(f=(0,$.jsx)(va,{state:`failed`,buttonLabel:`Retry`,actionLabel:u,loading:n.statusFetching,onClick:d}),t[8]=n.statusFetching,t[9]=u,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==o||t[13]!==s||t[14]!==f?(p=(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:o,onOpen:s,leading:c,title:`Provider CLIs`,state:l,trailingMeta:null,actions:f}),t[12]=o,t[13]=s,t[14]=f,t[15]=p):p=t[15],p}function Pa({issue:e}){return e===null?`up-to-date`:e.action===null?`update-manually`:`update-available`}function Fa(e){let t=(0,Z.c)(12),{machine:n,runningJobKey:r,queuedJobKeys:i,failuresByJobKey:a,onStartInstall:o,onOpenProvider:s}=e,c=a===void 0?na:a,{host:l}=n,u=Qt().data,d,f;if(t[0]!==c||t[1]!==l||t[2]!==n||t[3]!==s||t[4]!==o||t[5]!==u||t[6]!==i||t[7]!==r){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ja(n),t=new Map(Aa(n).map(Ia));if(e.length===0){f=null;break bb0}d=e.map(e=>{let{provider:n,status:a}=e,d=t.get(n)??null,f=Pa({issue:d}),p=bt(l.id,n),m=r===p,h=i.has(p),g=c.get(p)??null,_=d!==null&&g?.issueFingerprint===d.fingerprint?g:null,v=d!==null&&C(d)&&!m&&!h,y=n,b=u?.find(e=>e.id===y),x=U(`agent`,y,b??null)?.icon;return(0,$.jsx)(wn,{className:fa,actionsVisibility:`always`,openLabel:`Open ${a.displayName} settings`,onOpen:()=>s(y),leading:x===void 0?null:(0,$.jsx)(`span`,{"data-provider-icon":y,"aria-hidden":!0,className:`flex size-3.5 shrink-0 items-center justify-center`,children:(0,$.jsx)(x,{className:`size-3.5 text-muted-foreground`})}),title:a.displayName,titleMeta:(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,$.jsx)(ma,{current:a.currentVersion,latest:d===null?null:a.latestVersion}),_===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_a,{state:`failed`,children:`Failed`}),(0,$.jsx)(`code`,{role:`alert`,className:`rounded bg-muted/70 px-1.5 py-0.5 font-mono text-xs text-destructive`,children:_.logDialogState.message})]})]}),trailingMeta:null,actions:m||h?(0,$.jsx)(va,{live:!0,state:`in-progress`}):_===null?f===null?null:(0,$.jsx)(va,{state:f,actionLabel:v?`${d.action.label} ${a.displayName} on ${l.name}`:void 0,actionTooltip:v?d.action.label:void 0,onClick:v?()=>o(l.id,d):void 0}):(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(ua,{label:`View ${a.displayName} update log`,tooltipLabel:`View log`,icon:`File`,onClick:()=>Bt(_.logDialogState)}),v?(0,$.jsx)(va,{state:`failed`,actionLabel:`Retry ${a.displayName} on ${l.name}`,actionTooltip:`Retry`,onClick:()=>o(l.id,d)}):null]})},n)})}t[0]=c,t[1]=l,t[2]=n,t[3]=s,t[4]=o,t[5]=u,t[6]=i,t[7]=r,t[8]=d,t[9]=f}else d=t[8],f=t[9];if(f!==Symbol.for(`react.early_return_sentinel`))return f;let p=d,m;return t[10]===p?m=t[11]:(m=(0,$.jsx)($.Fragment,{children:p}),t[10]=p,t[11]=m),m}function Ia(e){return[e.provider,e]}function La(e){let t=(0,Z.c)(19),{machine:n,isThisMachine:r,showServerBadge:i,children:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(P,{name:`Laptop`,className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=o):o=t[0];let s;t[1]===n.host.name?s=t[2]:(s=(0,$.jsx)(`span`,{className:`truncate`,children:n.host.name}),t[1]=n.host.name,t[2]=s);let c;t[3]===r?c=t[4]:(c=r?(0,$.jsx)(qn,{children:`This machine`}):null,t[3]=r,t[4]=c);let l;t[5]===i?l=t[6]:(l=i?(0,$.jsx)(qn,{children:`Server`}):null,t[5]=i,t[6]=l);let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[o,s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d;t[11]===a?d=t[12]:(d=(0,$.jsx)(Gn,{children:a}),t[11]=a,t[12]=d);let f;t[13]!==u||t[14]!==d?(f=(0,$.jsx)(`div`,{"data-updates-domain":`machine`,children:(0,$.jsx)(Y,{title:u,children:d})}),t[13]=u,t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==n.host.id||t[17]!==f?(p=(0,$.jsx)(`div`,{"data-updates-machine":n.host.id,children:f}),t[16]=n.host.id,t[17]=f,t[18]=p):p=t[18],p}function Ra(e){let t=(0,Z.c)(5),{action:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,$.jsx)(`div`,{className:`space-y-6 pt-1.5`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,$.jsx)(Y,{action:n,bodyClassName:`border-0 bg-transparent p-0`,description:`Manage bb and provider CLI updates across all machines.`,title:`Machine updates`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function za(e){let t=(0,Z.c)(3),[n,r]=(0,Q.useState)(Ba),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{let t=setInterval(()=>r(Date.now()),e);return()=>clearInterval(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function Ba(){return Date.now()}function Va(e){let t=(0,Z.c)(84),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{showChangelogPreview:r}=n,i=r===void 0?!1:r,a=_(),o=m(),s=Lt(),{localDaemonHostId:c}=Dt(),l=Xe().data?.primaryHostId??null,{desktopApi:u,desktopInfo:d,isDesktop:f}=ie(),p=Bn(),h=(0,Q.useSyncExternalStore)(Ki,qi),g=za(3e4),{failuresByJobKey:v,queuedJobKeys:y,runningJobKey:b,startInstall:x}=kt(),S,C;if(t[2]!==s.machines||t[3]!==y||t[4]!==b){C=s.machines.flatMap(Ja);let e;t[7]!==y||t[8]!==b?(e=e=>{let{hostId:t,issue:n}=e,r=bt(t,n.provider);return b!==r&&!y.has(r)},t[7]=y,t[8]=b,t[9]=e):e=t[9],S=C.filter(qa).filter(e),t[2]=s.machines,t[3]=y,t[4]=b,t[5]=S,t[6]=C}else S=t[5],C=t[6];let w=S,T;t[10]===s.machines?T=t[11]:(T=s.machines.filter(Ka).map(Ga),t[10]=s.machines,t[11]=T);let E=T,D;t[12]!==E||t[13]!==u||t[14]!==a?(D=function(){Yi(async()=>{u===null?se({queryClient:a,version:await ke.system.version({force:!0})}):await u.checkForUpdates(),await Promise.all(E.map(e=>Je({queryClient:a,hostId:e})))})},t[12]=E,t[13]=u,t[14]=a,t[15]=D):D=t[15];let O=D,A=!s.isLoading,j=(0,Q.useRef)(!1),M;t[16]!==O||t[17]!==A?(M=()=>{j.current||!A||(j.current=!0,O())},t[16]=O,t[17]=A,t[18]=M):M=t[18];let N;t[19]===A?N=t[20]:(N=[A],t[19]=A,t[20]=N),(0,Q.useEffect)(M,N);let P=d?.updateAvailable===!0||s.systemVersion?.updateAvailable===!0||s.appUpdateAvailable,F,I;if(t[21]!==s.machines||t[22]!==g){F=s.machines.filter(ka);let e;t[25]===g?e=t[26]:(e=e=>e.canRetryDaemonUpdate&&Ve(e.host,g),t[25]=g,t[26]=e),I=F.filter(e),t[21]=s.machines,t[22]=g,t[23]=F,t[24]=I}else F=t[23],I=t[24];let L=I,R;t[27]===s.machines?R=t[28]:(R=s.machines.find(Wa)??s.machines[0]??null,t[27]=s.machines,t[28]=R);let z=R,B,V,H,U,W;if(t[29]!==w||t[30]!==z?.host||t[31]!==P||t[32]!==u||t[33]!==d||t[34]!==v||t[35]!==s.machines||t[36]!==s.systemVersion||t[37]!==h||t[38]!==f||t[39]!==c||t[40]!==o||t[41]!==g||t[42]!==a||t[43]!==y||t[44]!==F.length||t[45]!==p||t[46]!==b||t[47]!==l||t[48]!==i||t[49]!==L||t[50]!==x||t[51]!==C){let e;t[57]===z?.host?e=t[58]:(e=e=>e.host.id===z?.host.id||ka(e)||ja(e).length>0,t[57]=z?.host,t[58]=e);let n=s.machines.filter(e),r=P||C.length>0||L.length>0,m=F.length===0,_=!r&&!m&&f&&d===null,S;t[59]!==s.machines||t[60]!==p?(S=function(e){p.mutate(e,{onSuccess:()=>{let t=s.machines.find(t=>t.host.id===e);k.success(`Retrying the update on ${t?.host.name??`the requested machine`}`)}})},t[59]=s.machines,t[60]=p,t[61]=S):S=t[61];let T=S,E;t[62]!==p||t[63]!==L?(E=function(){for(let e of L)p.mutate(e.host.id);k.success(`Retrying the update on ${L.length} machines`)},t[62]=p,t[63]=L,t[64]=E):E=t[64];let D=E,O;t[65]!==w||t[66]!==x?(O=w.length>1?(0,$.jsx)(ua,{label:`Update all ${w.length} CLI tools`,tooltipLabel:`Update all`,icon:pr,visibleLabel:`Update all`,variant:`default`,onClick:()=>{for(let{hostId:e,issue:t}of w)x({hostId:e,issue:t})}}):null,t[65]=w,t[66]=x,t[67]=O):O=t[67];let A=O,j;t[68]!==D||t[69]!==L.length?(j=L.length>la?(0,$.jsx)(ua,{label:`Update all ${L.length} machines now`,visibleLabel:`Retry all`,icon:`RotateCcw`,iconPosition:`end`,variant:`default`,className:`font-medium`,onClick:D}):null,t[68]=D,t[69]=L.length,t[70]=j):j=t[70];let M=j,N;t[71]!==M||t[72]!==A?(N=M!==null||A!==null?(0,$.jsxs)(`div`,{role:`toolbar`,"aria-label":`Bulk update actions`,className:`flex flex-wrap items-center justify-end gap-2`,children:[M,A]}):null,t[71]=M,t[72]=A,t[73]=N):N=t[73];let I=N;U=`space-y-6`,t[74]===i?W=t[75]:(W=i?(0,$.jsx)(Ca,{}):null,t[74]=i,t[75]=W),B=Ra,V=I,H=n.length===0?(0,$.jsx)(jn,{state:`empty`,message:`No machines available.`}):n.map(e=>{let t=e.host.id===z?.host.id,n=e.canRetryDaemonUpdate||e.host.status!==`connected`;return(0,$.jsxs)(La,{machine:e,isThisMachine:s.machines.length>1&&e.host.id===c,showServerBadge:e.host.id===l,children:[t?(0,$.jsx)(Da,{systemVersion:s.systemVersion,desktopInfo:d,isDesktop:f,isChecking:h,onRelaunchDesktop:u===null||_?null:()=>{u.installUpdate().catch(Ua)},onRetryDesktop:u===null||_?null:()=>{u.checkForUpdates().catch(Ha)}}):null,n?(0,$.jsx)(Ma,{machine:e,now:g,retryUpdatePending:p.isPending&&p.variables===e.host.id,onRetryDaemonUpdate:T,onOpenMachine:e=>o(Rt(e))}):null,e.statusError?(0,$.jsx)(Na,{machine:e,onRecheckClis:e=>{Je({queryClient:a,hostId:e})},onOpenMachine:e=>o(Rt(e))}):null,(0,$.jsx)(Fa,{machine:e,runningJobKey:b,queuedJobKeys:y,failuresByJobKey:v,onStartInstall:(e,t)=>x({hostId:e,issue:t}),onOpenProvider:()=>o(Be(`providers`))})]},e.host.id)}),t[29]=w,t[30]=z?.host,t[31]=P,t[32]=u,t[33]=d,t[34]=v,t[35]=s.machines,t[36]=s.systemVersion,t[37]=h,t[38]=f,t[39]=c,t[40]=o,t[41]=g,t[42]=a,t[43]=y,t[44]=F.length,t[45]=p,t[46]=b,t[47]=l,t[48]=i,t[49]=L,t[50]=x,t[51]=C,t[52]=B,t[53]=V,t[54]=H,t[55]=U,t[56]=W}else B=t[52],V=t[53],H=t[54],U=t[55],W=t[56];let G;t[76]!==B||t[77]!==V||t[78]!==H?(G=(0,$.jsx)(B,{action:V,children:H}),t[76]=B,t[77]=V,t[78]=H,t[79]=G):G=t[79];let K;return t[80]!==U||t[81]!==W||t[82]!==G?(K=(0,$.jsxs)(`div`,{className:U,children:[W,G]}),t[80]=U,t[81]=W,t[82]=G,t[83]=K):K=t[83],K}function Ha(e){k.error(`Update retry failed`,{description:Ji(e)})}function Ua(e){k.error(`Relaunch failed`,{description:Ji(e)})}function Wa(e){return e.isPrimary}function Ga(e){return e.host.id}function Ka(e){return e.host.status===`connected`}function qa(e){return C(e.issue)}function Ja(e){return Aa(e).map(t=>({hostId:e.host.id,issue:t}))}var Ya=new Set([`Alt`,`Control`,`Meta`,`OS`,`Shift`]),Xa=new Set(Se);function Za(e,t){if(Ya.has(e.key)||e.key===`Dead`||e.key===`Unidentified`)return null;let n=Ee(e);if(n.length===0||n.length>32)return null;let r=Zt(t),i=r?e.metaKey:e.ctrlKey;return{key:n.length===1?n.toLowerCase():n,mod:i,meta:e.metaKey&&!(i&&r),control:e.ctrlKey&&!(i&&!r),alt:e.altKey,shift:e.shiftKey}}function Qa(e,t){return e.key.toLowerCase()===t.key.toLowerCase()&&e.mod===t.mod&&e.meta===t.meta&&e.control===t.control&&e.alt===t.alt&&e.shift===t.shift}function $a(e,t){return t.mod||t.meta||t.control||t.alt||/^F(?:[1-9]|1[0-9]|2[0-4])$/u.test(t.key)||Xa.has(e)}function eo(e,t,n,r,i){let a=Zt(i),o=null,s=!1;for(let t=e.length-1;t>=0;--t){let i=e[t];if(i?.command===n&&F(i,{isDesktop:r,isMac:a})){s=!0,o=i.shortcut;break}}if(!s)return null;let c=t.find(e=>e.command===n);return c===void 0?o:c.shortcut}function to(e,t,n,r){let i=Zt(r);return e.some(e=>e.command===t&&F(e,{isDesktop:n,isMac:i}))}function no(e,t,n,r,i,a){let o=eo(e,[],n,i,a),s=r!==null&&o!==null&&Qa(r,o),c=new Map(t.map(e=>[e.command,e.shortcut]));return s?c.delete(n):c.set(n,r),[...new Set([...Ye,...[...c.keys()].sort()])].flatMap(e=>c.has(e)?[{command:e,shortcut:c.get(e)??null}]:[])}function ro(e,t){return e.filter(e=>e.command!==t)}function io(e,t,n,r,i){let a=eo(e,t,n,r,i);return a===null?[]:[...new Set(e.map(e=>e.command))].filter(o=>{if(o===n)return!1;let s=eo(e,t,o,r,i);return s!==null&&w(a,s,i)})}var ao=[],oo=`rounded-none bg-transparent px-0 py-0 text-foreground opacity-100`,so=`bg-muted/40 px-1.5 py-0.5 text-foreground opacity-100`,co=`rounded-none border-l border-border bg-transparent px-1.5 py-0.5 text-foreground opacity-100`;function lo(e,t){return e===t||e!==null&&t!==null&&Qa(e,t)}var uo=(0,Q.memo)(function(e){let t=(0,Z.c)(34),{label:n,command:r,disabled:i,onChange:a,onRecordingChange:o,recording:s,shortcut:c}=e,l=it(),[u,d]=(0,Q.useState)(null),f=c===null?null:vt(c,l),p=f?.label??`unassigned`,m;t[0]!==r||t[1]!==a||t[2]!==o||t[3]!==l||t[4]!==s||t[5]!==d?(m=function(e){if(!s)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){d(null),o(null);return}let t=Za(e,l);if(t===null){d(`Press a non-modifier key.`);return}if(!$a(r,t)){d(`Use Command, Control, or Alt with a key.`);return}d(null),a(r,t),o(null)},t[0]=r,t[1]=a,t[2]=o,t[3]=l,t[4]=s,t[5]=d,t[6]=m):m=t[6];let h=m,g=s?`Recording shortcut for ${n}. Press keys or Escape to cancel.`:`Record shortcut for ${n}, current shortcut ${p}`,_=s&&`border-ring text-foreground`,v;t[7]===_?v=t[8]:(v=R(`h-7 min-w-24 px-2 text-xs`,_),t[7]=_,t[8]=v);let y;t[9]!==o||t[10]!==d?(y=()=>{d(null),o(null)},t[9]=o,t[10]=d,t[11]=y):y=t[11];let b;t[12]!==r||t[13]!==o||t[14]!==s||t[15]!==d?(b=()=>{s||(d(null),o(r))},t[12]=r,t[13]=o,t[14]=s,t[15]=d,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==f?(x=s?`Press keys`:f===null?`Unassigned`:(0,$.jsx)(W,{className:oo,shortcut:f}),t[17]=s,t[18]=f,t[19]=x):x=t[19];let S;t[20]!==i||t[21]!==h||t[22]!==s||t[23]!==g||t[24]!==v||t[25]!==y||t[26]!==b||t[27]!==x?(S=(0,$.jsx)(J,{"aria-label":g,"aria-pressed":s,className:v,disabled:i,onBlur:y,onClick:b,onKeyDown:h,size:`sm`,type:`button`,variant:`outline`,children:x}),t[20]=i,t[21]=h,t[22]=s,t[23]=g,t[24]=v,t[25]=y,t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;t[29]===u?C=t[30]:(C=u?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:u}):null,t[29]=u,t[30]=C);let w;return t[31]!==S||t[32]!==C?(w=(0,$.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[S,C]}),t[31]=S,t[32]=C,t[33]=w):w=t[33],w},function(e,t){return e.label===t.label&&e.command===t.command&&e.disabled===t.disabled&&e.onChange===t.onChange&&e.onRecordingChange===t.onRecordingChange&&e.recording===t.recording&&lo(e.shortcut,t.shortcut)});function fo({label:e,description:t,labels:n,defaultConflicts:r,command:i,defaults:a,isDesktop:o,overrides:s,platform:c}){let l=eo(a,s,i,o,c),u=s.some(e=>e.command===i),d=a.filter(e=>e.command===i),f=eo(a,[],i,!1,c),p=eo(a,[],i,!0,c),m=to(a,i,o,c),h=d.length>0&&d.every(e=>e.desktopOnly);return{availableOnClient:m,command:i,conflicts:(u?io(a,s,i,o,c):[]).map(e=>n.get(e)??e),label:e,description:t,defaultConflicts:r.map(e=>n.get(e)??e),customized:u,desktopDefaultShortcut:p,desktopOnly:h,shortcut:l,webDefaultShortcut:f}}function po(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function mo(e,t){return e.command===t.command&&e.label===t.label&&e.description===t.description&&po(e.defaultConflicts,t.defaultConflicts)&&e.availableOnClient===t.availableOnClient&&e.customized===t.customized&&e.desktopOnly===t.desktopOnly&&lo(e.shortcut,t.shortcut)&&lo(e.webDefaultShortcut,t.webDefaultShortcut)&&lo(e.desktopDefaultShortcut,t.desktopDefaultShortcut)&&po(e.conflicts,t.conflicts)}var ho=(0,Q.memo)(function(e){let t=(0,Z.c)(72),{model:n,onChange:r,onReset:i,onRecordingChange:a,pending:o,platform:s,recording:c}=e,{availableOnClient:l,command:u,conflicts:d,customized:f,desktopDefaultShortcut:p,desktopOnly:m,shortcut:h,webDefaultShortcut:g}=n,_=n,v,y,b,x,S,C;if(t[0]!==f||t[1]!==p||t[2]!==m||t[3]!==_.description||t[4]!==_.label||t[5]!==o||t[6]!==s||t[7]!==g){let e=g!==null&&p!==null&&!Qa(g,p)?[{label:`Web`,shortcut:g},{label:`Desktop`,shortcut:p}]:null,n=e===null?g??p:null;S=o||void 0;let r=o&&`opacity-50`;t[14]===r?C=t[15]:(C=R(`flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:gap-5`,r),t[14]=r,t[15]=C),v=`min-w-0 flex-1`;let i;t[16]===_.label?i=t[17]:(i=(0,$.jsx)(`p`,{className:`text-sm text-foreground`,children:_.label}),t[16]=_.label,t[17]=i);let a;t[18]===m?a=t[19]:(a=m?(0,$.jsx)(qn,{children:`Desktop`}):null,t[18]=m,t[19]=a);let c;t[20]===f?c=t[21]:(c=f?(0,$.jsx)(qn,{children:`Custom`}):null,t[20]=f,t[21]=c),t[22]!==c||t[23]!==i||t[24]!==a?(y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[i,a,c]}),t[22]=c,t[23]=i,t[24]=a,t[25]=y):y=t[25],t[26]===_.description?b=t[27]:(b=(0,$.jsx)(`p`,{className:`mt-0.5 text-xs leading-snug text-subtle-foreground/75`,children:_.description}),t[26]=_.description,t[27]=b),x=e!==null||n!==null?(0,$.jsxs)(`div`,{"aria-label":`${e===null?`Default shortcut`:`Default shortcuts`} for ${_.label}`,className:`mt-1.5 flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-subtle-foreground/75`,children:e===null?`Default:`:`Defaults:`}),n===null?e?.map(e=>(0,$.jsxs)(`span`,{className:`inline-flex items-stretch overflow-hidden rounded border border-border text-foreground`,children:[(0,$.jsx)(`span`,{className:`inline-flex items-center bg-muted/40 px-1.5 text-2xs leading-none text-subtle-foreground`,children:e.label}),(0,$.jsx)(W,{ariaHidden:!1,className:co,shortcut:vt(e.shortcut,s)})]},e.label)):(0,$.jsx)(W,{ariaHidden:!1,className:so,shortcut:vt(n,s)})]}):null,t[0]=f,t[1]=p,t[2]=m,t[3]=_.description,t[4]=_.label,t[5]=o,t[6]=s,t[7]=g,t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S,t[13]=C}else v=t[8],y=t[9],b=t[10],x=t[11],S=t[12],C=t[13];let w;t[28]===n.defaultConflicts?w=t[29]:(w=n.defaultConflicts.length>0?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-warning-text`,children:[`Default shortcut left unbound: also used by`,` `,n.defaultConflicts.join(`, `),`.`]}):null,t[28]=n.defaultConflicts,t[29]=w);let T;t[30]===d?T=t[31]:(T=d.length>0?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-warning-text`,children:[`Also used by `,d.join(`, `),`. Context determines which command runs.`]}):null,t[30]=d,t[31]=T);let E;t[32]!==v||t[33]!==y||t[34]!==b||t[35]!==x||t[36]!==w||t[37]!==T?(E=(0,$.jsxs)(`div`,{className:v,children:[y,b,x,w,T]}),t[32]=v,t[33]=y,t[34]=b,t[35]=x,t[36]=w,t[37]=T,t[38]=E):E=t[38];let D=!l,O;t[39]!==u||t[40]!==_.label||t[41]!==r||t[42]!==a||t[43]!==c||t[44]!==h||t[45]!==D?(O=(0,$.jsx)(uo,{label:_.label,command:u,disabled:D,onChange:r,onRecordingChange:a,recording:c,shortcut:h}),t[39]=u,t[40]=_.label,t[41]=r,t[42]=a,t[43]=c,t[44]=h,t[45]=D,t[46]=O):O=t[46];let k=`Clear shortcut for ${_.label}`,A=!l||h===null,j;t[47]!==u||t[48]!==r?(j=()=>r(u,null),t[47]=u,t[48]=r,t[49]=j):j=t[49];let M;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(P,{name:`X`,className:`size-3.5`}),t[50]=M):M=t[50];let N;t[51]!==k||t[52]!==A||t[53]!==j?(N=(0,$.jsx)(J,{"aria-label":k,className:`size-7`,disabled:A,onClick:j,size:`icon`,type:`button`,variant:`ghost`,children:M}),t[51]=k,t[52]=A,t[53]=j,t[54]=N):N=t[54];let F=`Reset shortcut for ${_.label}`,I=!l||!f,L;t[55]!==u||t[56]!==i?(L=()=>i(u),t[55]=u,t[56]=i,t[57]=L):L=t[57];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`RotateCcw`,className:`size-3.5`}),t[58]=z):z=t[58];let B;t[59]!==F||t[60]!==I||t[61]!==L?(B=(0,$.jsx)(J,{"aria-label":F,className:`size-7`,disabled:I,onClick:L,size:`icon`,type:`button`,variant:`ghost`,children:z}),t[59]=F,t[60]=I,t[61]=L,t[62]=B):B=t[62];let V;t[63]!==O||t[64]!==N||t[65]!==B?(V=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-end gap-1`,children:[O,N,B]}),t[63]=O,t[64]=N,t[65]=B,t[66]=V):V=t[66];let H;return t[67]!==V||t[68]!==S||t[69]!==C||t[70]!==E?(H=(0,$.jsxs)(`div`,{"aria-busy":S,className:C,children:[E,V]}),t[67]=V,t[68]=S,t[69]=C,t[70]=E,t[71]=H):H=t[71],H},function(e,t){return e.onChange===t.onChange&&e.onReset===t.onReset&&e.onRecordingChange===t.onRecordingChange&&e.pending===t.pending&&e.platform===t.platform&&e.recording===t.recording&&mo(e.model,t.model)});function go(){let e=Xe(),t=Zn(),{isPending:n,mutate:r}=tr(),i=we()!==null,a=it(),o=e.data?.generalSettings??z,{defaults:s,commands:c,conflicts:l}=ve(),u=(0,Q.useMemo)(()=>[...D,{label:`Plugin commands`,commands:c.map(e=>({command:B(e.pluginId,e.id),label:e.title,description:`Plugin: ${e.pluginId}`}))}],[c]),d=(0,Q.useMemo)(()=>new Map(u.flatMap(e=>e.commands.map(e=>[e.command,e.label]))),[u]),[f,p]=(0,Q.useState)(null),m=e.data?.keybindingOverrides??ao,h=JSON.stringify(m),[g,_]=(0,Q.useState)(()=>({sourceKey:h,value:m})),v=g.sourceKey===h?g.value:m,[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(``),C=(0,Q.useRef)(null),w=(0,Q.useMemo)(()=>new Map(u.flatMap(e=>e.commands.map(({command:e,label:t,description:n})=>[e,fo({command:e,label:t,description:n,labels:d,defaultConflicts:l.get(e)??[],defaults:s,isDesktop:i,overrides:v,platform:a})]))),[u,l,s,i,d,v,a]),T=(0,Q.useMemo)(()=>{let e=x.trim().toLowerCase();return e.length===0?u:u.flatMap(t=>{let n=t.commands.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.command.toLowerCase().includes(e));return n.length===0?[]:[{...t,commands:n}]})},[u,x]),E=(0,Q.useRef)({defaults:s,isDesktop:i,overrides:v,platform:a,serverOverridesKey:h});(0,Q.useLayoutEffect)(()=>{E.current={defaults:s,isDesktop:i,overrides:v,platform:a,serverOverridesKey:h}},[s,i,v,a,h]);let O=(0,Q.useCallback)((e,t,n,i)=>{C.current=t,_({sourceKey:i,value:e}),r(e,{onError:()=>_({sourceKey:i,value:n})})},[r]),k=(0,Q.useCallback)((e,t,n)=>{let r=E.current,i=no(r.defaults,r.overrides,e,t,r.isDesktop,r.platform),a=io(r.defaults,i,e,r.isDesktop,r.platform);if(t!==null&&a.length>0&&!n){p({command:e,shortcut:t,conflicts:a});return}if(n)for(let e of a)i=no(r.defaults,i,e,null,r.isDesktop,r.platform);p(null),O(i,e,r.overrides,r.serverOverridesKey)},[O]),A=(0,Q.useCallback)((e,t)=>k(e,t,!1),[k]),j=(0,Q.useCallback)(e=>{let t=E.current;O(ro(t.overrides,e),e,t.overrides,t.serverOverridesKey)},[O]),M=n?C.current:null,N=e.data===void 0||n,P=v.length>0;return(0,$.jsx)(Y,{action:(0,$.jsx)(J,{disabled:N||!P,onClick:()=>O([],null,v,h),size:`sm`,type:`button`,variant:`outline`,children:`Reset all`}),description:`Click a shortcut, then press its new keys. Changes sync to every bb window.`,title:`Keyboard shortcuts`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsx)(X,{description:`Show shortcut badges after holding Command or Control.`,label:`Show keyboard hints when holding CMD / Control`,children:(0,$.jsx)(xn,{"aria-label":`Show keyboard hints when holding CMD / Control`,checked:o.showKeyboardHints,disabled:e.data===void 0||t.isPending,onCheckedChange:e=>t.mutate({...o,showKeyboardHints:e})})}),(0,$.jsx)($e,{"aria-label":`Search keyboard shortcuts`,onChange:e=>S(e.target.value),placeholder:`Search shortcuts`,value:x}),f===null?null:(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded border border-border p-3`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Shortcut already used by`,` `,f.conflicts.map(e=>d.get(e)??e).join(`, `),`. Replace it with`,` `,d.get(f.command)??f.command,`?`]}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(J,{disabled:N,onClick:()=>k(f.command,f.shortcut,!0),size:`sm`,children:`Replace binding`}),(0,$.jsx)(J,{onClick:()=>p(null),size:`sm`,variant:`outline`,children:`Cancel`})]})]}),(0,$.jsxs)(`fieldset`,{className:R(`m-0 min-w-0 space-y-5 border-0 p-0`,n&&`[&:disabled_button:not([disabled])]:opacity-100`),disabled:N,children:[T.map(e=>(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-subtle-foreground`,children:e.label}),(0,$.jsx)(`div`,{className:`divide-y divide-border`,children:e.commands.map(e=>{let t=w.get(e.command);return t===void 0?null:(0,$.jsx)(ho,{model:t,onChange:A,onReset:j,onRecordingChange:b,pending:M===e.command,platform:a,recording:y===e.command},e.command)})})]},e.label)),T.length===0?(0,$.jsxs)(`p`,{className:`py-6 text-center text-sm text-subtle-foreground`,children:[`No shortcuts match “`,x,`”.`]}):null]})]})})}function _o(e){let t=(0,Z.c)(10),{source:n,className:r}=e;if(n.icon){let e=n.icon,i;t[0]===r?i=t[1]:(i=R(`shrink-0 object-contain`,r),t[0]=r,t[1]=i);let a;return t[2]!==n.icon||t[3]!==i?(a=(0,$.jsx)(`img`,{src:e,alt:``,"aria-hidden":!0,draggable:!1,className:i}),t[2]=n.icon,t[3]=i,t[4]=a):a=t[4],a}let i;t[5]===r?i=t[6]:(i=R(`flex shrink-0 items-center justify-center bg-muted/60 text-subtle-foreground`,r),t[5]=r,t[6]=i);let a;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(P,{name:`Globe`,className:`size-[60%]`}),t[7]=a):a=t[7];let o;return t[8]===i?o=t[9]:(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,children:a}),t[8]=i,t[9]=o),o}var vo=`bb:browser-import:records`;function yo(e){try{let t=e?.getItem(vo);if(!t)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n)){if(typeof t!=`object`||!t)continue;let n=t;typeof n.at!=`number`||typeof n.profileName!=`string`||typeof n.imported!=`number`||typeof n.skipped!=`number`||!Array.isArray(n.skippedDomains)||(r[e]={at:n.at,profileName:n.profileName,imported:n.imported,skipped:n.skipped,skippedDomains:n.skippedDomains.filter(e=>typeof e==`string`)})}return r}catch{return{}}}function bo(e){return e.unavailable===`browserRunning`?{step:`blocked`,reason:`browserRunning`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,checked:!1}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function xo(e){return e===`needsFullDiskAccess`?{step:`fullDiskAccess`,checked:!0}:{step:`blocked`,reason:e}}function So(e,t){switch(t){case`browserRunning`:case`needsFullDiskAccess`:case`needsKeychainApproval`:case`keychainItemMissing`:return{...e,unavailable:t};default:return null}}function Co(e,t){if(e===void 0)return{step:`blocked`,reason:`unknownSource`};let n=bo(e);return n.step===`fullDiskAccess`&&t.step===`fullDiskAccess`?{step:`fullDiskAccess`,checked:!0}:n}function wo(e){return e.step!==`importing`}function To(e){return e.unavailable===void 0&&e.profiles.length>1}function Eo(e,t){return e!==null&&t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??null}function Do(e,t,n){return{at:n,profileName:t,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains}}function Oo(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function ko(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Ao(e){return e.filter(e=>e.unavailable!==`unsupportedPlatform`&&e.unavailable!==`notInstalled`)}function jo(e){let t=0,n=!1;for(let r of e.profiles){if(r.cookieCount===void 0)return;t+=r.cookieCount,n=!0}return n?t:void 0}function Mo(e,t){let n=e.profiles.length,r=`${n} ${n===1?`profile`:`profiles`}`,i=jo(e);switch(e.unavailable){case`browserRunning`:return{status:`Running · quit ${e.name} to import`,tone:`attention`,details:[],action:`recheck`,actionLabel:`Recheck`};case`needsFullDiskAccess`:return{status:`Needs Full Disk Access`,tone:`attention`,details:[],action:`grant`,actionLabel:`Grant access…`};case`needsKeychainApproval`:return{status:`Needs Keychain access`,tone:`attention`,details:[],action:`import`,actionLabel:`Import…`};case`keychainItemMissing`:return{status:`No encryption key in Keychain`,tone:`idle`,details:[],action:`recheck`,actionLabel:`Recheck`};case void 0:break;default:return{status:`Unavailable`,tone:`idle`,details:[],action:`none`,actionLabel:`Import…`}}return n===0||i===0?{status:`No cookies yet`,tone:`idle`,details:n===0?[]:[r],action:`none`,actionLabel:`Import…`}:{status:`Ready`,tone:`ready`,details:t?[`${t.profileName} · ${Oo(t.imported)} imported`,...t.skipped>0?[`${t.skipped.toLocaleString()} skipped${t.skippedDomains.length>0?` (${ko(t.skippedDomains)})`:``}`]:[]]:i===void 0?[r]:[r,Oo(i)],action:`import`,actionLabel:`Import…`}}var No=`flex w-full items-center gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-state-hover`,Po=`border-surface-selected-border bg-surface-selected`,Fo=`border-border`;function Io(e){let t=(0,Z.c)(47),{source:n,desktopBrowser:r,onClose:i,onImported:a}=e,[o,s]=(0,Q.useState)(n),c;t[0]===n?c=t[1]:(c=()=>bo(n),t[0]=n,t[1]=c);let[l,u]=(0,Q.useState)(c),d;t[2]===n?d=t[3]:(d=()=>Eo(null,n),t[2]=n,t[3]=d);let[f,p]=(0,Q.useState)(d),m=(0,Q.useRef)(!0),h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>(m.current=!0,()=>{m.current=!1}),g=[],t[4]=h,t[5]=g):(h=t[4],g=t[5]),(0,Q.useEffect)(h,g);let _,v,y,b,x,S,C,w;if(t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==f||t[11]!==l){let e;t[20]===f?e=t[21]:(e=e=>e.directory===f,t[20]=f,t[21]=e);let n=o.profiles.find(e),c=()=>{if(f===null||n===void 0||!r.importCookies){u({step:`blocked`,reason:`unknownSourceProfile`});return}let e=n.name;u({step:`importing`}),r.importCookies({sourceId:o.id,sourceProfileDirectory:f,profile:{kind:`personal`}}).then(t=>{if(m.current){if(t.ok){a(o,e,t),i();return}u(xo(t.reason))}}).catch(()=>{m.current&&u({step:`blocked`,reason:`readFailed`})})},d;t[22]!==r||t[23]!==o.id||t[24]!==l?(d=()=>{if(!r.listImportSources)return;let e=l;u({step:`checking`}),r.listImportSources().then(t=>{if(!m.current)return;let n=t.sources.find(e=>e.id===o.id);n&&(s(n),p(e=>Eo(e,n))),u(Co(n,e))}).catch(()=>{m.current&&u({step:`blocked`,reason:`readFailed`})})},t[22]=r,t[23]=o.id,t[24]=l,t[25]=d):d=t[25];let h=d,g;t[26]===l?g=t[27]:(g=wo(l),t[26]=l,t[27]=g);let T=g,E;t[28]===o?E=t[29]:(E=e=>(0,$.jsxs)(q,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(_o,{source:o,className:`size-5 rounded-[5px]`}),e]}),t[28]=o,t[29]=E);let D=E;v=xt,w=!0,t[30]!==T||t[31]!==i?(y=e=>{!e&&T&&i()},t[30]=T,t[31]=i,t[32]=y):y=t[32],_=ue,b=!T,t[33]===T?(x=t[34],S=t[35]):(x=e=>{T||e.preventDefault()},S=e=>{T||e.preventDefault()},t[33]=T,t[34]=x,t[35]=S),C=l.step===`fullDiskAccess`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Allow Full Disk Access for ${o.name}`),(0,$.jsxs)(fe,{children:[o.name,` keeps its cookies in a protected folder. Turn on Full Disk Access for BB in System Settings → Privacy & Security, then come back. You can turn it off again after the import.`]})]}),l.checked?(0,$.jsx)(`p`,{className:`text-xs text-destructive-text`,children:`Full Disk Access is still off. macOS may require quitting and reopening BB before the grant applies.`}):null,(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Cancel`}),r.openFullDiskAccessSettings?(0,$.jsx)(J,{variant:`outline`,onClick:()=>r.openFullDiskAccessSettings?.(),children:`Open System Settings`}):null,(0,$.jsx)(J,{onClick:h,children:`I've turned it on`})]})]}):l.step===`checking`?(0,$.jsxs)(H,{children:[D(`Checking ${o.name}…`),(0,$.jsx)(fe,{children:`This only takes a moment.`})]}):l.step===`importing`?(0,$.jsxs)(H,{children:[D(`Importing from ${o.name}…`),(0,$.jsx)(fe,{children:`Reading and decrypting cookies. macOS may ask for Keychain access.`})]}):l.step===`blocked`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Can't import from ${o.name}`),(0,$.jsx)(fe,{children:A[l.reason]})]}),(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Close`}),Ne(l.reason)?(0,$.jsx)(J,{onClick:h,children:l.reason===`browserRunning`?`I've quit it`:`Try again`}):null]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{children:[D(`Import from ${o.name}`),(0,$.jsx)(fe,{children:`Which profile's cookies should be copied into the BB browser?`})]}),(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Source profile`,className:`flex flex-col gap-1.5`,children:o.profiles.map(e=>{let t=e.directory===f;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:R(No,t?Po:Fo),onClick:()=>p(e.directory),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:R(`flex size-3.5 shrink-0 items-center justify-center rounded-full border`,t?`border-foreground`:`border-border`),children:t?(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-foreground`}):null}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name}),e.cookieCount===void 0?null:(0,$.jsx)(`span`,{className:`block text-xs text-subtle-foreground`,children:Oo(e.cookieCount)})]})]},e.directory)})}),(0,$.jsxs)(`p`,{className:`text-xs text-subtle-foreground`,children:[o.name,` must stay closed during the import. macOS may ask for Keychain access to its encryption key; choose Allow.`]}),(0,$.jsxs)(_e,{children:[(0,$.jsx)(J,{variant:`outline`,onClick:i,children:`Cancel`}),(0,$.jsx)(J,{onClick:c,disabled:f===null,children:n?.cookieCount===void 0?`Import`:`Import ${Oo(n.cookieCount)}`})]})]}),t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=f,t[11]=l,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w}else _=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19];let T;t[36]!==_||t[37]!==b||t[38]!==x||t[39]!==S||t[40]!==C?(T=(0,$.jsx)(_,{hideCloseButton:b,onEscapeKeyDown:x,onInteractOutside:S,children:C}),t[36]=_,t[37]=b,t[38]=x,t[39]=S,t[40]=C,t[41]=T):T=t[41];let E;return t[42]!==v||t[43]!==y||t[44]!==T||t[45]!==w?(E=(0,$.jsx)(v,{open:w,onOpenChange:y,children:T}),t[42]=v,t[43]=y,t[44]=T,t[45]=w,t[46]=E):E=t[46],E}var Lo={ready:`bg-success`,attention:`bg-warning`,idle:`border border-muted-foreground`};function Ro(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function zo(e){let t=(0,Z.c)(51),{source:n,record:r,now:i,pending:a,onImport:o,onRecheck:s}=e,c,l,u,d,f,p,m,h,g,_,v;if(t[0]!==i||t[1]!==r||t[2]!==n){u=Mo(n,r),l=u.action!==`none`,c=Kn,v=`browser-import-${n.id}`,g=`group -mx-2 flex min-w-0 flex-1 items-center gap-3 rounded-md px-2 py-1.5`,t[14]===n?_=t[15]:(_=(0,$.jsx)(_o,{source:n,className:`size-7 rounded-[7px]`}),t[14]=n,t[15]=_),m=`min-w-0 flex-1 space-y-0.5`;let e;t[16]===n.name?e=t[17]:(e=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:n.name}),t[16]=n.name,t[17]=e);let a;t[18]!==i||t[19]!==r?(a=r?(0,$.jsxs)(qn,{children:[`imported `,Me({timestamp:r.at,now:i})]}):null,t[18]=i,t[19]=r,t[20]=a):a=t[20],t[21]!==a||t[22]!==e?(h=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e,a]}),t[21]=a,t[22]=e,t[23]=h):h=t[23],d=`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-subtle-foreground/75`;let o=u.tone===`attention`&&`text-warning-text`,s;t[24]===o?s=t[25]:(s=R(`inline-flex shrink-0 items-center gap-1.5`,o),t[24]=o,t[25]=s);let y=Lo[u.tone],b;t[26]===y?b=t[27]:(b=R(`size-1.5 shrink-0 rounded-full`,y),t[26]=y,t[27]=b);let x;t[28]===b?x=t[29]:(x=(0,$.jsx)(`span`,{"aria-hidden":!0,className:b}),t[28]=b,t[29]=x),f=(0,$.jsxs)(`span`,{className:s,children:[x,u.status]}),p=u.details.map(Bo),t[0]=i,t[1]=r,t[2]=n,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v}else c=t[3],l=t[4],u=t[5],d=t[6],f=t[7],p=t[8],m=t[9],h=t[10],g=t[11],_=t[12],v=t[13];let y;t[30]!==d||t[31]!==f||t[32]!==p?(y=(0,$.jsxs)(`div`,{className:d,children:[f,p]}),t[30]=d,t[31]=f,t[32]=p,t[33]=y):y=t[33];let b;t[34]!==m||t[35]!==h||t[36]!==y?(b=(0,$.jsxs)(`div`,{className:m,children:[h,y]}),t[34]=m,t[35]=h,t[36]=y,t[37]=b):b=t[37];let x=!l||a,S=u.action===`recheck`?s:o,C;t[38]!==u.actionLabel||t[39]!==x||t[40]!==S?(C=(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,$.jsx)(J,{size:`sm`,variant:`outline`,disabled:x,onClick:S,children:u.actionLabel})}),t[38]=u.actionLabel,t[39]=x,t[40]=S,t[41]=C):C=t[41];let w;t[42]!==b||t[43]!==C||t[44]!==g||t[45]!==_?(w=(0,$.jsxs)(`div`,{className:g,children:[_,b,C]}),t[42]=b,t[43]=C,t[44]=g,t[45]=_,t[46]=w):w=t[46];let T;return t[47]!==c||t[48]!==w||t[49]!==v?(T=(0,$.jsx)(c,{"data-testid":v,children:w}),t[47]=c,t[48]=w,t[49]=v,t[50]=T):T=t[50],T}function Bo(e){return(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e},e)}function Vo({desktopBrowser:e}){let t=e?.listImportSources!==void 0,[n,r]=(0,Q.useState)({status:`loading`}),[i,a]=(0,Q.useState)(()=>yo(Ro())),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(()=>new Set),u=c.size>0,d=(0,Q.useCallback)(()=>{e?.listImportSources&&(r(e=>e.status===`ready`?e:{status:`loading`}),e.listImportSources().then(e=>r({status:`ready`,sources:e.sources})).catch(e=>r({status:`error`,message:e instanceof Error?e.message:`Could not check installed browsers.`})))},[e]);(0,Q.useEffect)(()=>{d()},[d]);let f=(e,t,n)=>{let r=Do(n,t,Date.now());a(t=>{let n={...t,[e.id]:r};try{Ro()?.setItem(vo,JSON.stringify(n))}catch{return n}return n}),k.success(n.imported>0?`Imported ${Oo(n.imported)} from ${e.name}`:`No cookies were imported from ${e.name}`)},p=t=>{let n=t.profiles[0];if(!n||!e?.importCookies){s(t);return}l(e=>new Set(e).add(t.id)),e.importCookies({sourceId:t.id,sourceProfileDirectory:n.directory,profile:{kind:`personal`}}).then(e=>{if(e.ok){f(t,n.name,e);return}let r=So(t,e.reason);r?s(r):k.error(`${t.name}: ${A[e.reason]}`)}).catch(()=>{k.error(`Could not read ${t.name}'s cookies.`)}).finally(()=>{l(e=>{let n=new Set(e);return n.delete(t.id),n}),d()})},m=n.status===`ready`?Ao(n.sources):[],h=Date.now();return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Y,{title:`Browsers`,description:`Bring signed-in sessions from a browser on this machine into the BB browser, so previews and agent tabs open already logged in.`,action:t?(0,$.jsx)(J,{variant:`ghost`,size:`sm`,onClick:d,disabled:n.status===`loading`,children:`Refresh`}):void 0,children:t?n.status===`loading`?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}):n.status===`error`?(0,$.jsx)(`p`,{className:`text-sm text-destructive-text`,children:n.message}):m.length===0?(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`No supported browsers were found on this machine.`}):(0,$.jsx)(Gn,{children:m.map(e=>(0,$.jsx)(zo,{source:e,record:i[e.id],now:h,pending:u,onRecheck:d,onImport:()=>{To(e)?s(e):e.unavailable===void 0?p(e):s(e)}},e.id))}):(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`Only available in the BB desktop app.`})}),t?(0,$.jsxs)(`p`,{className:`mt-4 text-xs text-subtle-foreground/75`,children:[`Also from the CLI: `,(0,$.jsx)(`code`,{children:`bb browser import-sources`}),` and`,` `,(0,$.jsx)(`code`,{children:`bb browser import-cookies`}),`.`]}):null,o&&e?(0,$.jsx)(Io,{source:o,desktopBrowser:e,onClose:()=>{s(null),d()},onImported:f},`${o.id}:${o.unavailable??`ready`}`):null]})}function Ho(){let e=(0,Z.c)(2),[t]=(0,Q.useState)(I),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(Vo,{desktopBrowser:t}),e[0]=t,e[1]=n),n}var Uo=`manual`;function Wo(e){let t=(0,Z.c)(12),{open:n,onOpenChange:r}=e,i=_t(),a;t[0]!==i||t[1]!==r?(a=e=>{e||i.refetch(),r(e)},t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]!==o||t[4]!==n?(s=n&&(0,$.jsx)(Go,{onOpenChange:o}),t[3]=o,t[4]=n,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(ue,{className:`max-h-[calc(100dvh-2rem)] overflow-y-auto`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==o||t[9]!==n||t[10]!==c?(l=(0,$.jsx)(xt,{open:n,onOpenChange:o,modal:!1,children:c}),t[8]=o,t[9]=n,t[10]=c,t[11]=l):l=t[11],l}function Go(e){let t=(0,Z.c)(13),{onOpenChange:n}=e,r=Xe(),i=_t();if(!y(r.data?.serverAccess)){let e;t[0]===r?e=t[1]:(e=r.isPending?{status:`checking`}:r.isError?{status:`failed`,onRetry:()=>void r.refetch()}:{status:`blocked`},t[0]=r,t[1]=e);let i;t[2]===n?i=t[3]:(i=(0,$.jsx)(yr,{onNavigate:()=>n(!1)}),t[2]=n,t[3]=i);let a;return t[4]!==e||t[5]!==i?(a=(0,$.jsx)(qo,{state:e,children:i}),t[4]=e,t[5]=i,t[6]=a):a=t[6],a}let a=r.data?.primaryHostId??null,o;t[7]!==i.data||t[8]!==a?(o=i.data?.find(e=>e.id===a)?.name??null,t[7]=i.data,t[8]=a,t[9]=o):o=t[9];let s=o,c;return t[10]!==n||t[11]!==s?(c=(0,$.jsx)(Jo,{serverMachineName:s,onOpenChange:n}),t[10]=n,t[11]=s,t[12]=c):c=t[12],c}function Ko(e){return e===null?`The new machine will connect to your bb server. Keep the server machine on so the new machine can keep working.`:`The new machine will connect to the bb server on ${e}. Keep that computer on so the new machine can keep working.`}function qo(e){let t=(0,Z.c)(7),{state:n,children:r}=e;if(n.status===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{className:`sr-only`,children:`Add a machine`}),(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-subtle-foreground`,children:`Checking machine access…`})]}),t[0]=e):e=t[0],e}if(n.status===`failed`){let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(H,{children:[(0,$.jsx)(q,{children:`Add a machine`}),(0,$.jsx)(fe,{className:`text-destructive-text`,children:`Couldn’t check whether machines can reach this server.`})]}),t[1]=e):e=t[1];let r;return t[2]===n.onRetry?r=t[3]:(r=(0,$.jsxs)($.Fragment,{children:[e,(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(J,{variant:`outline`,size:`sm`,onClick:n.onRetry,children:`Try again`})})]}),t[2]=n.onRetry,t[3]=r),r}let i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(H,{children:[(0,$.jsx)(q,{children:`Set up machine access`}),(0,$.jsx)(fe,{children:`A new machine has to reach this server over the network. Choose the address it should use.`})]}),t[4]=i):i=t[4];let a;return t[5]===r?a=t[6]:(a=(0,$.jsxs)($.Fragment,{children:[i,r]}),t[5]=r,t[6]=a),a}function Jo({serverMachineName:e,onOpenChange:t}){let n=(0,Q.useRef)(null),r=(0,Q.useRef)(null),i=(0,Q.useRef)(new Set),a=(0,Q.useRef)(0),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null);(0,Q.useEffect)(()=>()=>{a.current+=1,n.current?.abort(),r.current=null;for(let e of i.current)ke.hosts.delete({hostId:e}).catch(()=>void 0);i.current.clear()},[]);let u=p({meta:{showErrorToast:!1},mutationFn:async e=>{let t=a.current;if(e.replaceLaunch){n.current?.abort(),n.current=null;let e=[...i.current];i.current.clear(),await Promise.all(e.map(e=>ke.hosts.delete({hostId:e}))),r.current=null}s(null);let o=new AbortController;n.current=o,r.current??=cn();try{let e=await ke.hosts.experimental_create({key:r.current,machineProviderId:Uo,inputs:null,wait:!1,signal:o.signal});if(i.current.add(e.id),t!==a.current)throw i.current.delete(e.id),await ke.hosts.delete({hostId:e.id}),Error(`Machine setup closed`);let n=null;for(;e.lifecycle.phase===`creating`;)o.signal.throwIfAborted(),n===null&&(n=await ke.hosts.experimental_getEnrollmentCommand({hostId:e.id,signal:o.signal}),s(n===null?null:{value:n.command,expiresAt:n.expiresAt})),await new Promise(e=>setTimeout(e,1e3)),o.signal.throwIfAborted(),e=await ke.hosts.get({hostId:e.id,signal:o.signal});if(r.current=null,i.current.delete(e.id),e.lifecycle.phase!==`active`)throw Error(e.lifecycle.message??`Machine setup cancelled`);return e}finally{n.current===o&&(n.current=null)}},onSuccess:e=>{r.current=null,l(e)}}),d=u.mutate;return(0,Q.useEffect)(()=>{d({replaceLaunch:!1})},[d]),(0,$.jsx)(Yo,{command:o,connectedHost:c,serverMachineName:e,errorMessage:u.isError?De({error:u.error,fallbackMessage:`Couldn't prepare an enrollment command.`}):null,onRetry:()=>u.mutate({replaceLaunch:!1}),onRegenerate:()=>u.mutate({replaceLaunch:!0}),onOpenMachine:()=>t(!1)})}function Yo(e){let n=(0,Z.c)(24),{command:r,connectedHost:i,serverMachineName:a,errorMessage:o,onRetry:s,onRegenerate:c,onOpenMachine:l}=e,u;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(q,{children:`Add a machine`}),n[0]=u):u=n[0];let d=o===null?void 0:`text-destructive-text`,f=o??`Run this command on the machine you want to add. It installs bb and keeps the machine connected to this server.`,p;n[1]!==d||n[2]!==f?(p=(0,$.jsxs)(H,{children:[u,(0,$.jsx)(fe,{className:d,children:f})]}),n[1]=d,n[2]=f,n[3]=p):p=n[3];let m;n[4]!==o||n[5]!==s?(m=o===null?null:(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(J,{variant:`outline`,size:`sm`,onClick:s,children:`Try again`})}),n[4]=o,n[5]=s,n[6]=m):m=n[6];let h;n[7]!==r||n[8]!==c?(h=r===null?null:(0,$.jsx)(Zo,{command:r.value,expiresAt:r.expiresAt,onRegenerate:c},r.value),n[7]=r,n[8]=c,n[9]=h):h=n[9];let g;n[10]!==r||n[11]!==i||n[12]!==o||n[13]!==l?(g=o===null?(0,$.jsx)(`div`,{className:`flex items-center gap-2.5 rounded-md bg-muted/40 px-3 py-2.5`,children:i===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(P,{name:`Spinner`,className:`size-4 shrink-0 animate-spin text-muted-foreground`}),(0,$.jsx)(`span`,{role:`status`,className:`text-sm text-muted-foreground`,children:r===null?`Preparing an enrollment command…`:`Waiting for the machine to connect…`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(T,{connected:!0}),(0,$.jsxs)(`span`,{role:`status`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:[i.name,` connected`]}),(0,$.jsx)(J,{asChild:!0,size:`sm`,variant:`ghost`,className:`h-7 shrink-0 px-2 text-xs`,children:(0,$.jsxs)(t,{to:Rt(i.id),onClick:l,children:[`Open machine`,(0,$.jsx)(P,{name:`ArrowRight`})]})})]})}):null,n[10]=r,n[11]=i,n[12]=o,n[13]=l,n[14]=g):g=n[14];let _;n[15]!==o||n[16]!==a?(_=o===null?(0,$.jsx)(`p`,{className:`text-xs text-subtle-foreground`,children:Ko(a)}):null,n[15]=o,n[16]=a,n[17]=_):_=n[17];let v;return n[18]!==p||n[19]!==m||n[20]!==h||n[21]!==g||n[22]!==_?(v=(0,$.jsxs)($.Fragment,{children:[p,m,h,g,_]}),n[18]=p,n[19]=m,n[20]=h,n[21]=g,n[22]=_,n[23]=v):v=n[23],v}function Xo(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function Zo(e){let t=(0,Z.c)(25),{command:n,expiresAt:r,onRegenerate:i}=e,a;t[0]===n?a=t[1]:(a={text:n},t[0]=n,t[1]=a);let{copied:o,copy:s}=Fe(a),c;t[2]===r?c=t[3]:(c=()=>r-Date.now(),t[2]=r,t[3]=c);let[l,u]=(0,Q.useState)(c),d,f;t[4]===r?(d=t[5],f=t[6]):(d=()=>{let e=setInterval(()=>u(r-Date.now()),1e3);return()=>clearInterval(e)},f=[r],t[4]=r,t[5]=d,t[6]=f),(0,Q.useEffect)(d,f);let p=l<=0,m;t[7]===n?m=t[8]:(m=(0,$.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap break-all p-3 font-mono text-xs text-foreground`,children:n}),t[7]=n,t[8]=m);let h;t[9]!==p||t[10]!==i||t[11]!==l?(h=p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-subtle-foreground`,children:`Command expired`}),(0,$.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:i,children:`Generate a new command`})]}):(0,$.jsxs)(`span`,{role:`status`,className:`text-xs tabular-nums text-subtle-foreground`,children:[`Command expires in `,Xo(l)]}),t[9]=p,t[10]=i,t[11]=l,t[12]=h):h=t[12];let g;t[13]===s?g=t[14]:(g=()=>void s(),t[13]=s,t[14]=g);let _=o?`Copied`:`Copy`,v;t[15]!==p||t[16]!==g||t[17]!==_?(v=(0,$.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,className:`ml-auto h-7 px-2.5 text-xs`,disabled:p,onClick:g,children:_}),t[15]=p,t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==h||t[20]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-border px-3 py-2`,children:[h,v]}),t[19]=h,t[20]=v,t[21]=y):y=t[21];let b;return t[22]!==y||t[23]!==m?(b=(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border bg-muted/30`,children:[m,y]}),t[22]=y,t[23]=m,t[24]=b):b=t[24],b}var Qo=Object.fromEntries(yn.map(e=>[e.value,e])),$o=`min-h-9 px-2.5 py-2`,es={darwin:`macOS`,linux:`Linux`,wsl:`WSL`,unknown:null};function ts(e){let n=(0,Z.c)(108),{host:r,isPrimary:i,isThisMachine:a,showServerBadge:o,platformLabel:s,projectCount:c,now:l,onRename:u,onRemove:d,onRetryUpdate:f,onSuspend:p,onResume:h,onRetryCleanup:g,canMoveServerHere:_,onMoveServerHere:v,serverMoveEnabled:y,lifecycleActionPending:b,retryUpdatePending:x,machineProvider:S}=e,C=m(),w;n[0]===r.id?w=n[1]:(w=Rt(r.id),n[0]=r.id,n[1]=w);let E=w,D=Qo[r.maxPermissionMode],O=`${c} ${c===1?`project`:`projects`}`,k;n[2]!==r||n[3]!==l?(k=In({host:r,now:l}),n[2]=r,n[3]=l,n[4]=k):k=n[4];let A=k,j;n[5]===r?j=n[6]:(j=ne(r),n[5]=r,n[6]=j);let M=j,N=i||void 0,F=i&&`cursor-not-allowed focus:bg-transparent`,I;n[7]===F?I=n[8]:(I=R($o,F),n[7]=F,n[8]=I);let L;n[9]!==i||n[10]!==d?(L=e=>{if(i){e.preventDefault();return}d()},n[9]=i,n[10]=d,n[11]=L):L=n[11];let z,B;n[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`Trash2`,"aria-hidden":!0}),B=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Remove machine`}),n[12]=z,n[13]=B):(z=n[12],B=n[13]);let V;n[14]!==N||n[15]!==I||n[16]!==L?(V=(0,$.jsxs)(Nt,{variant:`destructive`,"aria-disabled":N,className:I,onSelect:L,children:[z,B]}),n[14]=N,n[15]=I,n[16]=L,n[17]=V):V=n[17];let H=V,U;n[18]!==E||n[19]!==C?(U=e=>{Tn(e)||C(E)},n[18]=E,n[19]=C,n[20]=U):U=n[20];let W;n[21]===r.id?W=n[22]:(W=Rt(r.id),n[21]=r.id,n[22]=W);let G=`Open ${r.name}`,K;n[23]!==r||n[24]!==S?(K=(0,$.jsx)(Sn,{host:r,machineProvider:S,nameClassName:`text-sm font-medium text-foreground`}),n[23]=r,n[24]=S,n[25]=K):K=n[25];let q;n[26]===a?q=n[27]:(q=a?(0,$.jsx)(qn,{children:`this machine`}):null,n[26]=a,n[27]=q);let ee;n[28]===o?ee=n[29]:(ee=o?(0,$.jsx)(qn,{children:`server`}):null,n[28]=o,n[29]=ee);let te;n[30]!==K||n[31]!==q||n[32]!==ee?(te=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[K,q,ee]}),n[30]=K,n[31]=q,n[32]=ee,n[33]=te):te=n[33];let re;n[34]===r?re=n[35]:(re=Ln(r),n[34]=r,n[35]=re);let ie;n[36]===re?ie=n[37]:(ie=(0,$.jsx)(T,{tone:re}),n[36]=re,n[37]=ie);let ae;n[38]===A?ae=n[39]:(ae=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:A}),n[38]=A,n[39]=ae);let oe;n[40]!==ie||n[41]!==ae?(oe=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[ie,ae]}),n[40]=ie,n[41]=ae,n[42]=oe):oe=n[42];let se;n[43]===s?se=n[44]:(se=s===null?null:(0,$.jsx)(`span`,{className:`truncate`,children:s}),n[43]=s,n[44]=se);let ce;n[45]===O?ce=n[46]:(ce=(0,$.jsx)(`span`,{className:`shrink-0`,children:O}),n[45]=O,n[46]=ce);let le=D.tone===`warning`&&`text-warning-text`,ue;n[47]===le?ue=n[48]:(ue=R(`shrink-0`,le),n[47]=le,n[48]=ue);let de;n[49]!==D.label||n[50]!==ue?(de=(0,$.jsx)(`span`,{className:ue,children:D.label}),n[49]=D.label,n[50]=ue,n[51]=de):de=n[51];let fe;n[52]===M?fe=n[53]:(fe=M===null?null:(0,$.jsx)(`span`,{className:`min-w-0 text-warning-text`,children:M}),n[52]=M,n[53]=fe);let pe;n[54]!==oe||n[55]!==se||n[56]!==ce||n[57]!==de||n[58]!==fe?(pe=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-subtle-foreground/75`,children:[oe,se,ce,de,fe]}),n[54]=oe,n[55]=se,n[56]=ce,n[57]=de,n[58]=fe,n[59]=pe):pe=n[59];let me;n[60]!==te||n[61]!==pe?(me=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[te,pe]}),n[60]=te,n[61]=pe,n[62]=me):me=n[62];let he;n[63]!==W||n[64]!==G||n[65]!==me?(he=(0,$.jsx)(t,{to:W,"aria-label":G,className:`flex min-w-0 flex-1 items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:me}),n[63]=W,n[64]=G,n[65]=me,n[66]=he):he=n[66];let ge=`${r.name} actions`,_e;n[67]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(P,{name:`MoreHorizontal`,className:`size-4`}),n[67]=_e):_e=n[67];let ve;n[68]===ge?ve=n[69]:(ve=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsx)(J,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0 data-[state=open]:bg-state-active data-[state=open]:text-foreground`,"aria-label":ge,children:_e})}),n[68]=ge,n[69]=ve);let ye,be;n[70]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(P,{name:`Edit`,"aria-hidden":!0}),be=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Rename`}),n[70]=ye,n[71]=be):(ye=n[70],be=n[71]);let xe;n[72]===u?xe=n[73]:(xe=(0,$.jsxs)(Nt,{className:$o,onSelect:u,children:[ye,be]}),n[72]=u,n[73]=xe);let Se;n[74]!==r||n[75]!==f||n[76]!==x?(Se=Re(r)?(0,$.jsxs)(Nt,{className:$o,disabled:x,onSelect:f,children:[(0,$.jsx)(P,{name:dr,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:x?`Retrying update…`:`Retry update`})]}):null,n[74]=r,n[75]=f,n[76]=x,n[77]=Se):Se=n[77];let Ce;n[78]!==r||n[79]!==b||n[80]!==S||n[81]!==h||n[82]!==g||n[83]!==p?(Ce=(0,$.jsx)(Pn,{host:r,machineProvider:S,pending:b,presentation:`menu`,onSuspend:p,onResume:h,onRetryCleanup:g}),n[78]=r,n[79]=b,n[80]=S,n[81]=h,n[82]=g,n[83]=p,n[84]=Ce):Ce=n[84];let we;n[85]!==_||n[86]!==v?(we=_?(0,$.jsxs)(Nt,{className:$o,onSelect:v,children:[(0,$.jsx)(P,{name:`MoveTo`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:`Move server here`})]}):null,n[85]=_,n[86]=v,n[87]=we):we=n[87];let Te;n[88]!==i||n[89]!==H||n[90]!==y?(Te=i?(0,$.jsxs)(Mt,{children:[(0,$.jsx)(ct,{asChild:!0,children:H}),(0,$.jsx)(Et,{side:`left`,children:Rn(y)})]}):H,n[88]=i,n[89]=H,n[90]=y,n[91]=Te):Te=n[91];let Ee;n[92]!==xe||n[93]!==Se||n[94]!==Ce||n[95]!==we||n[96]!==Te?(Ee=(0,$.jsxs)(tt,{align:`end`,className:`w-max min-w-0`,children:[xe,Se,Ce,we,Te]}),n[92]=xe,n[93]=Se,n[94]=Ce,n[95]=we,n[96]=Te,n[97]=Ee):Ee=n[97];let De;n[98]!==ve||n[99]!==Ee?(De=(0,$.jsx)(pt,{delayDuration:250,children:(0,$.jsxs)(Ct,{children:[ve,Ee]})}),n[98]=ve,n[99]=Ee,n[100]=De):De=n[100];let Oe;n[101]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(An,{}),n[101]=Oe):Oe=n[101];let ke;n[102]===De?ke=n[103]:(ke=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[De,Oe]}),n[102]=De,n[103]=ke);let Ae;return n[104]!==U||n[105]!==he||n[106]!==ke?(Ae=(0,$.jsx)(Kn,{children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:(0,$.jsxs)(`div`,{"data-machine-row":!0,className:`group group/machine -mx-2 flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 py-2 transition-colors hover:bg-state-hover focus-within:bg-state-hover`,onClick:U,children:[he,ke]})})}),n[104]=U,n[105]=he,n[106]=ke,n[107]=Ae):Ae=n[107],Ae}function ns(){let e=(0,Z.c)(97),t=Xe(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={includeCreating:!0},e[0]=n):n=e[0];let r=_t(n),{providers:i}=Cn(),{localDaemonHostId:a,platform:o}=Dt(),s=Ce(),c=Hn(),l=Bn(),u=Un(),d=Wn(),f=Vn(),p=Ze(),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),w=r.data,T=t.data?.primaryHostId??null,E=t.data?.experiments.serverMove??!1,D=p.data?.move??null,O=s.data?.projects,A;if(e[1]!==O){A=new Map;for(let e of O??[]){let t=new Set(e.sources.map(ss));for(let e of t)A.set(e,(A.get(e)??0)+1)}e[1]=O,e[2]=A}else A=e[2];let j=A,M;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(M=Date.now(),e[3]=M):M=e[3];let N=M,F=t.data?.primaryHostPlatform??null,I,L,z,B,V,H,U,W;if(e[4]!==w||e[5]!==a||e[6]!==o||e[7]!==i||e[8]!==F||e[9]!==j||e[10]!==c||e[11]!==d||e[12]!==f||e[13]!==l||e[14]!==D||e[15]!==E||e[16]!==T||e[17]!==g||e[18]!==u||e[19]!==t.data){let n=w?.filter(os);L=w?.filter(as);let r=g&&L!==void 0?[...n??[],...L]:n??[],s=(n?.length??0)>1,p=n!==void 0&&n.length>0,m;e[28]===i?m=e[29]:(m=new Map((i??[]).map(is)),e[28]=i,e[29]=m);let _=m,v;e[30]!==a||e[31]!==o||e[32]!==_||e[33]!==F||e[34]!==j||e[35]!==c||e[36]!==d||e[37]!==f||e[38]!==l||e[39]!==D||e[40]!==E||e[41]!==T||e[42]!==s||e[43]!==u||e[44]!==t.data?(v=e=>(0,$.jsx)(Gn,{children:e.map(e=>(0,$.jsx)(ts,{host:e,isPrimary:e.id===T,isThisMachine:s&&e.id===a,showServerBadge:e.id===T,platformLabel:e.id===a&&o!==null?es[o]:e.id===T&&F!==null?es[F]:null,projectCount:j.get(e.id)??0,now:N,onRename:()=>{c.reset(),y(e)},onRemove:()=>{x(e)},onRetryUpdate:()=>l.mutate(e.id,{onSuccess:()=>{k.success(`Update retry requested for ${e.name}`)}}),retryUpdatePending:l.isPending&&l.variables===e.id,onSuspend:()=>u.mutate(e.id,{onSuccess:()=>k.success(`${e.name} suspended`)}),onResume:()=>d.mutate(e.id,{onSuccess:()=>k.success(`${e.name} resumed`)}),onRetryCleanup:()=>f.mutate(e.id,{onSuccess:()=>k.success(`Cleanup retried for ${e.name}`)}),canMoveServerHere:t.data!==void 0&&gt({host:e,primaryHostId:T,move:D,serverMoveEnabled:E}),onMoveServerHere:()=>C(e),serverMoveEnabled:E,lifecycleActionPending:u.isPending&&u.variables===e.id||d.isPending&&d.variables===e.id||f.isPending&&f.variables===e.id,machineProvider:e.machineProviderId===null?null:_.get(e.machineProviderId)??null},e.id))}),e[30]=a,e[31]=o,e[32]=_,e[33]=F,e[34]=j,e[35]=c,e[36]=d,e[37]=f,e[38]=l,e[39]=D,e[40]=E,e[41]=T,e[42]=s,e[43]=u,e[44]=t.data,e[45]=v):v=e[45];let b=v;I=Y,V=`Machines`,H=`space-y-3 border-0 bg-transparent p-0`,e[46]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>h(!0),children:[(0,$.jsx)(P,{name:`Plus`,className:`size-3.5`}),`Add a machine`]}),e[46]=U):U=e[46];let S;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(P,{name:`Info`,className:`mt-0.5 size-4 shrink-0 text-subtle-foreground`,"aria-hidden":!0}),e[47]=S):S=e[47];let O,A;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`How machines connect`}),A=(0,$.jsx)(`p`,{children:`All your machines connect to one central bb server, where your threads and settings are stored. Choose a machine that can stay awake and online to run the server.`}),e[48]=O,e[49]=A):(O=e[48],A=e[49]);let M;e[50]===E?M=e[51]:(M=E?(0,$.jsxs)(`p`,{children:[`To change which machine runs the server, open the ⋯ menu on another machine below and choose`,` `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Move server here`}),`.`]}):null,e[50]=E,e[51]=M),e[52]===M?W=e[53]:(W=(0,$.jsxs)(`div`,{role:`note`,"aria-label":`About the bb server`,className:`flex items-start gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3`,children:[S,(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1 text-xs leading-relaxed text-subtle-foreground`,children:[O,A,M]})]}),e[52]=M,e[53]=W);let G=p&&`py-2`;e[54]===G?z=e[55]:(z=R(`rounded-lg border border-border bg-card px-4 py-3.5`,G),e[54]=G,e[55]=z),B=w===void 0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading…`}):r.length===0?(0,$.jsx)(`p`,{className:`text-sm text-subtle-foreground`,children:`No machines yet.`}):b(r),e[4]=w,e[5]=a,e[6]=o,e[7]=i,e[8]=F,e[9]=j,e[10]=c,e[11]=d,e[12]=f,e[13]=l,e[14]=D,e[15]=E,e[16]=T,e[17]=g,e[18]=u,e[19]=t.data,e[20]=I,e[21]=L,e[22]=z,e[23]=B,e[24]=V,e[25]=H,e[26]=U,e[27]=W}else I=e[20],L=e[21],z=e[22],B=e[23],V=e[24],H=e[25],U=e[26],W=e[27];let G;e[56]!==L||e[57]!==g?(G=L!==void 0&&L.length>0?(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":g,onClick:()=>_(rs),className:`-ml-1 inline-flex items-center gap-1.5 self-start rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-state-hover hover:text-foreground`,children:[(0,$.jsx)(P,{name:`ChevronDown`,className:R(`size-3.5 transition-transform`,g&&`rotate-180`),"aria-hidden":!0}),(0,$.jsx)(`span`,{children:g?`Show fewer machines`:`Show all machines`})]}):null,e[56]=L,e[57]=g,e[58]=G):G=e[58];let K;e[59]!==z||e[60]!==B||e[61]!==G?(K=(0,$.jsxs)(`div`,{className:z,children:[B,G]}),e[59]=z,e[60]=B,e[61]=G,e[62]=K):K=e[62];let q;e[63]!==I||e[64]!==V||e[65]!==H||e[66]!==U||e[67]!==W||e[68]!==K?(q=(0,$.jsxs)(I,{title:V,bodyClassName:H,action:U,children:[W,K]}),e[63]=I,e[64]=V,e[65]=H,e[66]=U,e[67]=W,e[68]=K,e[69]=q):q=e[69];let ee;e[70]===m?ee=e[71]:(ee=(0,$.jsx)(Wo,{open:m,onOpenChange:h}),e[70]=m,e[71]=ee);let te;e[72]!==c.error||e[73]!==c.isError?(te=c.isError?De({error:c.error,fallbackMessage:`Couldn't rename the machine.`}):null,e[72]=c.error,e[73]=c.isError,e[74]=te):te=e[74];let ne;e[75]===c.isPending?ne=e[76]:(ne=e=>{!e&&!c.isPending&&y(null)},e[75]=c.isPending,e[76]=ne);let re;e[77]===c?re=e[78]:(re=(e,t)=>c.mutate({hostId:e.id,name:t},{onSuccess:()=>y(null)}),e[77]=c,e[78]=re);let ie;e[79]!==c.isPending||e[80]!==v||e[81]!==te||e[82]!==ne||e[83]!==re?(ie=(0,$.jsx)(zn,{target:v,pending:c.isPending,errorMessage:te,onOpenChange:ne,onRename:re}),e[79]=c.isPending,e[80]=v,e[81]=te,e[82]=ne,e[83]=re,e[84]=ie):ie=e[84];let ae;e[85]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e||x(null)},e[85]=ae):ae=e[85];let oe;e[86]===b?oe=e[87]:(oe=(0,$.jsx)(Nn,{target:b,onOpenChange:ae}),e[86]=b,e[87]=oe);let se;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e||C(null)},e[88]=se):se=e[88];let ce;e[89]===S?ce=e[90]:(ce=(0,$.jsx)(Fn,{target:S,onOpenChange:se}),e[89]=S,e[90]=ce);let le;return e[91]!==q||e[92]!==ee||e[93]!==ie||e[94]!==oe||e[95]!==ce?(le=(0,$.jsxs)($.Fragment,{children:[q,ee,ie,oe,ce]}),e[91]=q,e[92]=ee,e[93]=ie,e[94]=oe,e[95]=ce,e[96]=le):le=e[96],le}function rs(e){return!e}function is(e){return[e.id,e]}function as(e){return e.type===`ephemeral`}function os(e){return e.type===`persistent`}function ss(e){return e.hostId}var cs=`all`,ls=50,us=[{label:`All threads`,value:`all`},{label:`Root threads`,value:`root`},{label:`Child threads`,value:`child`}];function ds(e){let t=(0,Z.c)(22),{icon:n,label:r,onChange:i,options:a,value:o}=e,s;t[0]===n?s=t[1]:(s=(0,$.jsx)(P,{name:n,className:`size-3.5 shrink-0`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,$.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 shrink-0`}),t[7]=u):u=t[7];let d;t[8]===l?d=t[9]:(d=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{type:`button`,variant:`outline`,className:`h-8 min-w-36 justify-between gap-2 px-3 text-xs font-normal`,children:[l,u]})}),t[8]=l,t[9]=d);let f;if(t[10]!==i||t[11]!==a||t[12]!==o){let e;t[14]!==i||t[15]!==o?(e=e=>(0,$.jsxs)(Nt,{onSelect:()=>i(e.value),children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.value===o?(0,$.jsx)(P,{name:`Check`,className:`size-3.5`}):null]},e.value),t[14]=i,t[15]=o,t[16]=e):e=t[16],f=a.map(e),t[10]=i,t[11]=a,t[12]=o,t[13]=f}else f=t[13];let p;t[17]===f?p=t[18]:(p=(0,$.jsx)(tt,{align:`end`,className:`min-w-44`,children:f}),t[17]=f,t[18]=p);let m;return t[19]!==d||t[20]!==p?(m=(0,$.jsxs)(Ct,{children:[d,p]}),t[19]=d,t[20]=p,t[21]=m):m=t[21],m}function fs(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>K(e).toLocaleLowerCase().includes(n))}function ps(){let e=(0,Z.c)(65),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(`all`),[o,s]=(0,Q.useState)(cs),c=Ce(),l;e[0]===n?l=e[1]:(l=re(n),e[0]=n,e[1]=l);let u=l,d;e[2]===o?d=e[3]:(d=o===cs?{}:{projectId:o},e[2]=o,e[3]=d);let f;e[4]!==i||e[5]!==d?(f={...d,kind:i},e[4]=i,e[5]=d,e[6]=f):f=e[6];let p=!u,m;e[7]===p?m=e[8]:(m={enabled:p},e[7]=p,e[8]=m);let h=Le(f,m),g;e[9]!==n||e[10]!==u?(g={active:u,limitPerGroup:ls,query:n},e[9]=n,e[10]=u,e[11]=g):g=e[11];let _=Ht(g),v=Ot(),y;bb0:{if(!c.data){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[12]=t):t=e[12],y=t;break bb0}let t;e[13]!==c.data.personalProject||e[14]!==c.data.projects?(t=[c.data.personalProject,...c.data.projects],e[13]=c.data.personalProject,e[14]=c.data.projects,e[15]=t):t=e[15],y=t}let b=y,x;e[16]===b?x=e[17]:(x=new Map(b.map(gs)),e[16]=b,e[17]=x);let S=x,C;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(C={label:`All projects`,value:cs},e[18]=C):C=e[18];let w;e[19]===b?w=e[20]:(w=[C,...b.map(hs)],e[19]=b,e[20]=w);let T=w,E;if(e[21]!==h.data?.pages||e[22]!==i||e[23]!==o||e[24]!==n||e[25]!==u||e[26]!==_.data?.archived){let t=u?_.data?.archived.results.map(ms)??[]:(h.data?.pages??[]).flat(),r;e[28]!==i||e[29]!==o?(r=e=>e.archivedAt!==null&&(o===cs||e.projectId===o)&&(i===`all`||e.parentThreadId!==null==(i===`child`)),e[28]=i,e[29]=o,e[30]=r):r=e[30];let a=t.filter(r);E=u?a:fs(a,n),e[21]=h.data?.pages,e[22]=i,e[23]=o,e[24]=n,e[25]=u,e[26]=_.data?.archived,e[27]=E}else E=e[27];let D=E,O;if(e[31]!==D){let t=new Map;for(let e of D){let n=t.get(e.projectId);n?n.push(e):t.set(e.projectId,[e])}O=[...t.entries()],e[31]=D,e[32]=O}else O=e[32];let k=O,A;e[33]===i?A=e[34]:(A=us.find(e=>e.value===i)?.label??`All threads`,e[33]=i,e[34]=A);let j=A,M=T.find(e=>e.value===o)?.label??`All projects`,N=u?_.isDebouncing||_.isLoading&&_.data===void 0:h.isPending,F;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-lg font-semibold text-foreground`,children:`Archived threads`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-subtle-foreground`,children:`Find and restore archived threads from across your projects.`})]}),e[35]=F):F=e[35];let I;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(P,{name:`Search`,className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-subtle-foreground`}),e[36]=I):I=e[36];let L;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>r(e.target.value),e[37]=L):L=e[37];let R;e[38]===n?R=e[39]:(R=(0,$.jsxs)(`div`,{className:`relative min-w-56 flex-1`,children:[I,(0,$.jsx)($e,{"aria-label":`Search archived threads`,className:`h-8 pl-8 text-xs`,onChange:L,placeholder:`Search archived threads…`,value:n})]}),e[38]=n,e[39]=R);let z;e[40]!==i||e[41]!==j?(z=(0,$.jsx)(ds,{icon:`SlidersHorizontal`,label:j,onChange:a,options:us,value:i}),e[40]=i,e[41]=j,e[42]=z):z=e[42];let B;e[43]!==o||e[44]!==T||e[45]!==M?(B=(0,$.jsx)(ds,{icon:`Folder`,label:M,onChange:s,options:T,value:o}),e[43]=o,e[44]=T,e[45]=M,e[46]=B):B=e[46];let V;e[47]!==R||e[48]!==z||e[49]!==B?(V=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[R,z,B]}),e[47]=R,e[48]=z,e[49]=B,e[50]=V):V=e[50];let H;e[51]!==D||e[52]!==k||e[53]!==N||e[54]!==S||e[55]!==n||e[56]!==v?(H=N?(0,$.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading archived threads…`}):D.length===0?(0,$.jsx)(Vt,{className:`py-8`,children:n.trim().length>0?`No archived threads match your search.`:`No archived threads match these filters.`}):(0,$.jsx)(`div`,{className:`space-y-6`,children:k.map(e=>{let[n,r]=e;return(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-0.5 text-xs font-medium text-muted-foreground`,children:[(0,$.jsx)(P,{name:`Folder`,className:`size-3.5`}),(0,$.jsx)(`h3`,{className:`min-w-0 flex-1 truncate`,children:S.get(n)??`Unknown project`}),(0,$.jsxs)(`span`,{children:[r.length,` `,r.length===1?`thread`:`threads`]})]}),(0,$.jsx)(`div`,{className:`divide-y divide-border overflow-hidden rounded-lg border border-border bg-card`,children:r.map(e=>(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-2.5`,children:[(0,$.jsxs)(t,{className:`min-w-0 flex-1`,to:ye({projectId:e.projectId,threadId:e.id}),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:K(e)}),e.parentThreadId===null?null:(0,$.jsx)(jt,{variant:`outline`,className:`shrink-0`,children:`child`})]}),e.archivedAt===null?null:(0,$.jsxs)(`span`,{className:`mt-0.5 block text-xs text-subtle-foreground`,children:[`Archived`,` `,Me({timestamp:e.archivedAt,now:Date.now()})]})]}),(0,$.jsx)(ar,{variant:`secondary`,isPending:v.isPending&&v.variables?.id===e.id,onUnarchive:()=>v.mutate({id:e.id})})]},e.id))})]},n)})}),e[51]=D,e[52]=k,e[53]=N,e[54]=S,e[55]=n,e[56]=v,e[57]=H):H=e[57];let U;e[58]!==h||e[59]!==u?(U=!u&&h.hasNextPage?(0,$.jsx)(J,{type:`button`,variant:`ghost`,className:`h-9 w-full text-sm font-normal text-muted-foreground`,disabled:h.isFetchingNextPage,onClick:()=>h.fetchNextPage(),children:h.isFetchingNextPage?`Loading…`:`Load more`}):null,e[58]=h,e[59]=u,e[60]=U):U=e[60];let W;return e[61]!==V||e[62]!==H||e[63]!==U?(W=(0,$.jsxs)(`section`,{className:`space-y-5`,children:[F,V,H,U]}),e[61]=V,e[62]=H,e[63]=U,e[64]=W):W=e[64],W}function ms(e){return e.thread}function hs(e){return{label:e.name,value:e.id}}function gs(e){return[e.id,e.name]}var _s={installed:`Installed`,outdated:`Out of date`,missing:`Not installed`,unknown:null};function vs(e){return e.status===`connected`}function ys(e){return e.connected?e.status===void 0?null:_s[e.status]:`Disconnected`}function bs(e){let t=(0,Z.c)(32),{hosts:n,onCancel:r,onInstall:i,pending:a,statusByHostId:o}=e,s;t[0]===n?s=t[1]:(s=n.filter(vs).map(xs),t[0]=n,t[1]=s);let c=s,[l,u]=(0,Q.useState)(c),d=n.length>1,f;t[2]!==d||t[3]!==c||t[4]!==l?(f=d?l.filter(e=>c.includes(e)):c,t[2]=d,t[3]=c,t[4]=l,t[5]=f):f=t[5];let p=f,m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(q,{children:`Install bb CLI skills`}),t[6]=m):m=t[6];let h=d?`Choose the machines to install them onto. Each one gets the skills in ~/.agents/skills and ~/.claude/skills, replacing any copy already there.`:`The skills go in ~/.agents/skills and ~/.claude/skills on ${n[0]?.name??`the selected machine`}, replacing any copy already there.`,g;t[7]===h?g=t[8]:(g=(0,$.jsxs)(H,{children:[m,(0,$.jsx)(fe,{children:h})]}),t[7]=h,t[8]=g);let _;t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==p||t[13]!==o?(_=d?(0,$.jsx)(`div`,{className:`flex flex-col gap-1 py-1`,children:n.map(e=>{let t=vs(e),n=ys({connected:t,status:o.get(e.id)});return(0,$.jsxs)(`label`,{className:`flex items-center gap-2.5 rounded-md px-1 py-2 text-sm has-[:disabled]:opacity-60`,children:[(0,$.jsx)(V,{checked:p.includes(e.id),disabled:!t||a,onCheckedChange:t=>u(n=>t===!0?[...n,e.id]:n.filter(t=>t!==e.id)),"aria-label":e.name}),(0,$.jsx)(T,{connected:t}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),n===null?null:(0,$.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-subtle-foreground`,children:n})]},e.id)})}):null,t[9]=d,t[10]=n,t[11]=a,t[12]=p,t[13]=o,t[14]=_):_=t[14];let v;t[15]!==r||t[16]!==a?(v=(0,$.jsx)(J,{type:`button`,variant:`outline`,disabled:a,onClick:r,children:`Cancel`}),t[15]=r,t[16]=a,t[17]=v):v=t[17];let y=a||p.length===0,b;t[18]!==i||t[19]!==p?(b=()=>i([...p]),t[18]=i,t[19]=p,t[20]=b):b=t[20];let x=a?`Installing…`:`Install`,S;t[21]!==x||t[22]!==y||t[23]!==b?(S=(0,$.jsx)(J,{type:`button`,disabled:y,onClick:b,children:x}),t[21]=x,t[22]=y,t[23]=b,t[24]=S):S=t[24];let C;t[25]!==S||t[26]!==v?(C=(0,$.jsxs)(_e,{children:[v,S]}),t[25]=S,t[26]=v,t[27]=C):C=t[27];let w;return t[28]!==C||t[29]!==g||t[30]!==_?(w=(0,$.jsxs)($.Fragment,{children:[g,_,C]}),t[28]=C,t[29]=g,t[30]=_,t[31]=w):w=t[31],w}function xs(e){return e.id}function Ss(e){let t=(0,Z.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({onOpenChange:r,open:i,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=i?(0,$.jsx)(bs,{...n}):null,t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;t[7]===a?o=t[8]:(o=(0,$.jsx)(ue,{children:a}),t[7]=a,t[8]=o);let s;return t[9]!==r||t[10]!==i||t[11]!==o?(s=(0,$.jsx)(xt,{open:i,onOpenChange:r,children:o}),t[9]=r,t[10]=i,t[11]=o,t[12]=s):s=t[12],s}var Cs=`bb CLI skills`;function ws(e){return e?`Install them into ~/.agents/skills and ~/.claude/skills so agents outside bb can use the bb CLI.`:`Connect a machine to install them into ~/.agents/skills and ~/.claude/skills.`}function Ts(e){let t=e.filter(e=>e!==`unknown`);if(t.length===0)return null;let n=t.filter(e=>e===`installed`).length;return n===t.length?t.length>1?`Installed on ${t.length} machines`:`Installed`:n>0?`Installed on ${n} of ${t.length} machines`:t.some(e=>e===`outdated`)?`Out of date`:`Not installed`}function Es(e){let t=(0,Z.c)(12),{hasConnectedMachine:n,onOpenPicker:r,pending:i,statusBadge:a}=e,o;t[0]===a?o=t[1]:(o=a===null?{}:{labelBadge:a},t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=ws(n),t[2]=n,t[3]=s);let c=!n||i,l=i?`Installing…`:`Install`,u;t[4]!==r||t[5]!==c||t[6]!==l?(u=(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:c,onClick:r,"aria-label":`Install ${Cs}`,children:l}),t[4]=r,t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==s||t[10]!==u?(d=(0,$.jsx)(Y,{title:`Skills`,children:(0,$.jsx)(X,{label:Cs,...o,description:s,children:u})}),t[8]=o,t[9]=s,t[10]=u,t[11]=d):d=t[11],d}function Ds(e){let t=e.results.filter(e=>e.ok),n=e.results.filter(e=>!e.ok);t.length>0&&k.success(`Installed the bb CLI skills on ${t.map(e=>e.hostName).join(`, `)}`);for(let e of n)k.error(`${e.hostName}: ${e.errorMessage}`)}function Os(e){return new Map((e?.machines??[]).map(e=>[e.hostId,e.status]))}function ks(){let e=(0,Z.c)(31),t=_t(),n=We(),r=$n(),[i,a]=(0,Q.useState)(!1),o;e[0]===t.data?o=e[1]:(o=Wt(t.data,`persistent`),e[0]=t.data,e[1]=o);let s=o,c,l,u,d,f;e[2]!==s||e[3]!==r.isPending||e[4]!==n.data?(l=Os(n.data),c=Es,e[10]===s?u=e[11]:(u=s.some(As),e[10]=s,e[11]=u),d=r.isPending,f=Ts([...l.values()]),e[2]=s,e[3]=r.isPending,e[4]=n.data,e[5]=c,e[6]=l,e[7]=u,e[8]=d,e[9]=f):(c=e[5],l=e[6],u=e[7],d=e[8],f=e[9]);let p;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>a(!0),e[12]=p):p=e[12];let m;e[13]!==c||e[14]!==u||e[15]!==d||e[16]!==f?(m=(0,$.jsx)(c,{hasConnectedMachine:u,pending:d,statusBadge:f,onOpenPicker:p}),e[13]=c,e[14]=u,e[15]=d,e[16]=f,e[17]=m):m=e[17];let h;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>a(!1),e[18]=h):h=e[18];let g;e[19]!==r||e[20]!==n?(g=e=>r.mutate({hostIds:e},{onSuccess:e=>{a(!1),Ds(e),n.refetch()}}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let _;e[22]!==s||e[23]!==r.isPending||e[24]!==i||e[25]!==l||e[26]!==g?(_=(0,$.jsx)(Ss,{open:i,onOpenChange:a,hosts:s,statusByHostId:l,pending:r.isPending,onCancel:h,onInstall:g}),e[22]=s,e[23]=r.isPending,e[24]=i,e[25]=l,e[26]=g,e[27]=_):_=e[27];let v;return e[28]!==m||e[29]!==_?(v=(0,$.jsxs)($.Fragment,{children:[m,_]}),e[28]=m,e[29]=_,e[30]=v):v=e[30],v}function As(e){return e.status===`connected`}var js=u(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-foreground text-background shadow-xs`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow-xs`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ms(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=R(js({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,$.jsx)(`div`,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}var Ns=`https://example.com/marketplace.json`;function Ps(e){return e.lastError===null?e.lastRefreshAt===null?`Never refreshed`:`Refreshed ${new Date(e.lastRefreshAt).toLocaleString()}`:`Last refresh failed: ${e.lastError}`}function Fs(){let e=(0,Z.c)(60),t=_(),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(null),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={enabled:!0},e[0]=o):o=e[0];let s=dn(o),c;e[1]===s.data?c=e[2]:(c=s.data??[],e[1]=s.data,e[2]=c);let l=c,u;e[3]===t?u=e[4]:(u=()=>de({queryClient:t}),e[3]=t,e[4]=u);let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={showErrorToast:!1},e[5]=f):f=e[5];let m;e[6]===d?m=e[7]:(m={meta:f,mutationFn:Hs,onSuccess:e=>{r(``),d(),k.success(`Added ${e.displayName}`,{description:`${e.entryCount} plugins listed. Adding a marketplace installs nothing.`})},onError:Vs},e[6]=d,e[7]=m);let h=p(m),g;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(g={showErrorToast:!1},e[8]=g):g=e[8];let v;e[9]===d?v=e[10]:(v={meta:g,mutationFn:Bs,onSuccess:e=>{d();let t=e.filter(zs);if(t.length===0){k.success(`Marketplace refreshed`);return}k.error(`Refreshing the marketplace failed`,{description:`${t[0]?.error??`Unknown error`}. The last catalog bb validated is still in use.`})},onError:Rs},e[9]=d,e[10]=v);let y=p(v),b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b={showErrorToast:!1},e[11]=b):b=e[11];let x;e[12]===d?x=e[13]:(x={meta:b,mutationFn:Ls,onSuccess:e=>{a(null),d(),k.success(`Marketplace removed`,{description:e.convertedPluginIds.length===0?void 0:`Kept as direct installs: ${e.convertedPluginIds.join(`, `)}`})},onError:Is},e[12]=d,e[13]=x);let S=p(x),C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>r(e.target.value),e[14]=C):C=e[14];let w;e[15]===n?w=e[16]:(w=(0,$.jsx)($e,{value:n,"aria-label":`Marketplace source`,placeholder:Ns,className:`h-8 font-mono text-xs`,onChange:C}),e[15]=n,e[16]=w);let T;e[17]!==h.isPending||e[18]!==n?(T=n.trim().length===0||h.isPending,e[17]=h.isPending,e[18]=n,e[19]=T):T=e[19];let E;e[20]!==h||e[21]!==n?(E=()=>h.mutate(n.trim()),e[20]=h,e[21]=n,e[22]=E):E=e[22];let D=h.isPending?`Adding…`:`Add`,O;e[23]!==T||e[24]!==E||e[25]!==D?(O=(0,$.jsx)(J,{type:`button`,size:`sm`,disabled:T,onClick:E,children:D}),e[23]=T,e[24]=E,e[25]=D,e[26]=O):O=e[26];let A;e[27]!==w||e[28]!==O?(A=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[w,O]}),e[27]=w,e[28]=O,e[29]=A):A=e[29];let j;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`code`,{children:`git:<url>[@<ref>]`}),e[30]=j):j=e[30];let M;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(`p`,{className:`text-2xs text-subtle-foreground`,children:[`An https manifest URL, `,j,`, or`,` `,(0,$.jsx)(`code`,{children:`path:<directory>`}),` on the bb server’s machine.`]}),e[31]=M):M=e[31];let N;e[32]===A?N=e[33]:(N=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[A,M]}),e[32]=A,e[33]=N);let P;if(e[34]!==l||e[35]!==y){let t;e[37]===y?t=e[38]:(t=e=>(0,$.jsxs)(`li`,{className:`flex items-start gap-3 rounded-md border border-border p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[e.displayName,(0,$.jsx)(`span`,{className:`font-mono text-2xs text-subtle-foreground`,children:e.name}),e.official?(0,$.jsx)(Ms,{variant:`outline`,className:`text-2xs font-normal`,children:`Official`}):null]}),(0,$.jsx)(`p`,{className:`truncate font-mono text-2xs text-subtle-foreground`,children:e.source}),(0,$.jsxs)(`p`,{className:`text-2xs text-subtle-foreground`,children:[e.entryCount,` plugins ·`,` `,Ps(e)]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1.5`,children:[(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:y.isPending,"aria-label":`Refresh ${e.displayName}`,onClick:()=>y.mutate(e.name),children:`Refresh`}),e.official?null:(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,"aria-label":`Remove ${e.displayName}`,onClick:()=>a(e),children:`Remove`})]})]},e.name),e[37]=y,e[38]=t),P=l.map(t),e[34]=l,e[35]=y,e[36]=P}else P=e[36];let F;e[39]===P?F=e[40]:(F=(0,$.jsx)(`ul`,{className:`space-y-2 pt-3`,children:P}),e[39]=P,e[40]=F);let I=i!==null,L;e[41]===S.isPending?L=e[42]:(L=e=>{!e&&!S.isPending&&a(null)},e[41]=S.isPending,e[42]=L);let R=`Remove ${i?.displayName??`marketplace`}?`,z=S.isPending?`Removing…`:`Remove`,B;e[43]!==S||e[44]!==i?(B=()=>{i!==null&&S.mutate(i.name)},e[43]=S,e[44]=i,e[45]=B):B=e[45];let V;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>a(null),e[46]=V):V=e[46];let H;e[47]!==S.isPending||e[48]!==R||e[49]!==z||e[50]!==B?(H=(0,$.jsx)(Ge,{title:R,description:`Its catalog and cached icons are deleted. Plugins installed from it keep running as direct installs and keep checking for updates from their recorded source.`,confirmLabel:z,pending:S.isPending,onConfirm:B,onCancel:V}),e[47]=S.isPending,e[48]=R,e[49]=z,e[50]=B,e[51]=H):H=e[51];let U;e[52]!==I||e[53]!==L||e[54]!==H?(U=(0,$.jsx)(dt,{open:I,onOpenChange:L,children:H}),e[52]=I,e[53]=L,e[54]=H,e[55]=U):U=e[55];let W;return e[56]!==N||e[57]!==F||e[58]!==U?(W=(0,$.jsxs)(Y,{title:`Plugin marketplaces`,description:`bb reads plugin catalogs from these marketplaces. Adding one validates and caches its catalog; it never installs, updates, or runs plugin code.`,bodyClassName:`border-0 bg-transparent p-0`,children:[N,F,U]}),e[56]=N,e[57]=F,e[58]=U,e[59]=W):W=e[59],W}function Is(e){k.error(`Removing the marketplace failed`,{description:fr(e)})}function Ls(e){return pn(fetch,e)}function Rs(e){k.error(`Refreshing the marketplace failed`,{description:fr(e)})}function zs(e){return!e.ok}function Bs(e){return fn(fetch,e)}function Vs(e){k.error(`Adding the marketplace failed`,{description:fr(e)})}function Hs(e){return mn(fetch,e)}var Us=`https://github.com/get-bb/bb/blob/main/docs/multiple-devices.md#open-bb-from-another-browser`;function Ws(e,t){return Ue.find(t=>t.id===e.themeId)?.name??t.find(t=>t.id===e.themeId)?.name??e.themeId}var Gs=[{label:`System`,value:`system`},{label:`Light`,value:`light`},{label:`Dark`,value:`dark`}],Ks={dark:`Dark`,light:`Light`,system:`System`},qs=[{label:`Default`,value:`default`},{label:`Red`,value:`red`},{label:`Orange`,value:`orange`},{label:`Yellow`,value:`yellow`},{label:`Green`,value:`green`},{label:`Teal`,value:`teal`},{label:`Blue`,value:`blue`},{label:`Purple`,value:`purple`},{label:`Pink`,value:`pink`}],Js={blue:`Blue`,default:`Default`,green:`Green`,orange:`Orange`,pink:`Pink`,purple:`Purple`,red:`Red`,teal:`Teal`,yellow:`Yellow`},Ys=`h-7 w-full justify-between border-border/60 bg-card px-2 text-xs sm:w-36`,Xs=`min-w-[var(--radix-dropdown-menu-trigger-width)]`,Zs="Create a custom bb palette. First run `bb theme dir` to find the custom theme directory. Ask me for the palette name and visual direction, then create `<theme-dir>/<name>/theme.css` with light and dark theme variables compatible with bb's theme tokens.",Qs=`Palettes change bb's colors, including syntax colors in diffs and file previews. Choose a built-in palette or create one from a prompt.`;function $s(e){let t=(0,Z.c)(18),{active:n,children:r,onPreview:i,onSelect:a,themeId:o}=e,s;t[0]!==i||t[1]!==o?(s=()=>i(o),t[0]=i,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=()=>i(null),t[3]=i,t[4]=c);let l;t[5]!==a||t[6]!==o?(l=()=>a(o),t[5]=a,t[6]=o,t[7]=l):l=t[7];let u=!n&&`opacity-0`,d;t[8]===u?d=t[9]:(d=R(`ml-auto`,u,ze),t[8]=u,t[9]=d);let f;t[10]===d?f=t[11]:(f=(0,$.jsx)(P,{name:`Check`,className:d}),t[10]=d,t[11]=f);let p;return t[12]!==r||t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==f?(p=(0,$.jsxs)(Nt,{onFocus:s,onBlur:c,onSelect:l,children:[r,f]}),t[12]=r,t[13]=s,t[14]=c,t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function ec(e){let t=(0,Z.c)(10),{value:n}=e,r=n===`default`&&`bg-foreground`,i;t[0]===r?i=t[1]:(i=R(`size-4 shrink-0`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=O(),t[2]=a):a=t[2];let o;t[3]===n?o=t[4]:(o=n===`default`?void 0:{backgroundColor:St[n]},t[3]=n,t[4]=o);let s;t[5]===o?s=t[6]:(s={mask:`url("${a}") center / contain no-repeat`,...o},t[5]=o,t[6]=s);let c;return t[7]!==i||t[8]!==s?(c=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,style:s}),t[7]=i,t[8]=s,t[9]=c):c=t[9],c}function tc(e){let t=(0,Z.c)(19),{disabled:n,faviconColor:r,onFaviconColorChange:i}=e,a;t[0]===r?a=t[1]:(a=(0,$.jsx)(ec,{value:r}),t[0]=r,t[1]=a);let o=Js[r],s;t[2]===o?s=t[3]:(s=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==s?(c=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[7]=l):l=t[7];let u;t[8]!==n||t[9]!==c?(u=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Favicon color`,disabled:n,children:[c,l]})}),t[8]=n,t[9]=c,t[10]=u):u=t[10];let d;t[11]!==r||t[12]!==i?(d=qs.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>i(e.value),children:[(0,$.jsx)(ec,{value:e.value}),e.label,(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,r!==e.value&&`opacity-0`,ze)})]},e.value)),t[11]=r,t[12]=i,t[13]=d):d=t[13];let f;t[14]===d?f=t[15]:(f=(0,$.jsx)(tt,{align:`end`,className:Xs,children:d}),t[14]=d,t[15]=f);let p;return t[16]!==u||t[17]!==f?(p=(0,$.jsx)(X,{label:`Favicon color`,description:`Tint browser tabs to tell instances apart.`,children:(0,$.jsxs)(Ct,{children:[u,f]})}),t[16]=u,t[17]=f,t[18]=p):p=t[18],p}var nc={capability:`openDirectory`,emptyDescription:`No local app can open directories.`,label:`Directory default`},rc={capability:`openFile`,emptyDescription:`No local app can open files.`,label:`File default`};function ic(e){let t=(0,Z.c)(37),{definition:n,onTargetChange:r,preferredTargetId:i,targets:a}=e,o;if(t[0]!==n.capability||t[1]!==a){let e;t[3]===n.capability?e=t[4]:(e=e=>rn({capability:n.capability,target:e}),t[3]=n.capability,t[4]=e),o=a.filter(e),t[0]=n.capability,t[1]=a,t[2]=o}else o=t[2];let s=o,c;t[5]!==n.capability||t[6]!==i||t[7]!==a?(c=sn({capability:n.capability,preferredTargetId:i,targets:a}),t[5]=n.capability,t[6]=i,t[7]=a,t[8]=c):c=t[8];let l=c,u=s.length===0?n.emptyDescription:null,d=l?.id??i,f;t[9]!==i||t[10]!==l?.label?(f=l?.label??(i?ir(i):`Unavailable`),t[9]=i,t[10]=l?.label,t[11]=f):f=t[11];let p=f,m;t[12]!==l||t[13]!==d?(m=d?(0,$.jsx)(or,{...l?{target:l}:{targetId:d},className:`size-5`}):null,t[12]=l,t[13]=d,t[14]=m):m=t[14];let h;t[15]===p?h=t[16]:(h=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:p}),t[15]=p,t[16]=h);let g;t[17]!==m||t[18]!==h?(g=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[m,h]}),t[17]=m,t[18]=h,t[19]=g):g=t[19];let _;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[20]=_):_=t[20];let v;t[21]!==n.label||t[22]!==g?(v=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":n.label,children:[g,_]})}),t[21]=n.label,t[22]=g,t[23]=v):v=t[23];let y;t[24]!==s||t[25]!==r||t[26]!==l?.id||t[27]!==u?(y=u?(0,$.jsx)(`div`,{role:`note`,className:`px-2 py-[0.3125rem] text-xs leading-snug text-foreground`,children:u}):s.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>r(e.id),children:[(0,$.jsx)(or,{target:e,className:`size-5`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,l?.id!==e.id&&`opacity-0`,ze)})]},e.id)),t[24]=s,t[25]=r,t[26]=l?.id,t[27]=u,t[28]=y):y=t[28];let b;t[29]===y?b=t[30]:(b=(0,$.jsx)(tt,{align:`end`,className:Xs,children:y}),t[29]=y,t[30]=b);let x;t[31]!==b||t[32]!==v?(x=(0,$.jsxs)(Ct,{children:[v,b]}),t[31]=b,t[32]=v,t[33]=x):x=t[33];let S;return t[34]!==n.label||t[35]!==x?(S=(0,$.jsx)(X,{label:n.label,children:x}),t[34]=n.label,t[35]=x,t[36]=S):S=t[36],S}function ac({accessState:e,directoryTargetId:t,fileTargetId:n,hasDaemon:r,onDirectoryTargetChange:i,onFileTargetChange:a,onRequestAccess:o,targets:s}){let[c,l]=(0,Q.useState)(!1);if(e===`unavailable`)return null;let u=async()=>{l(!0);try{await o()}finally{l(!1)}};if(!r){let t=e===`denied`,n=e===`available`;return(0,$.jsx)(Y,{title:`File Preferences`,children:(0,$.jsx)(X,{label:`Local editor integration`,description:(0,$.jsxs)($.Fragment,{children:[t?`Your browser blocked access to bb on this device. Allow local network access for this site in browser settings, then reload bb.`:n?`bb couldn’t connect to its local editor helper. Make sure the bb desktop app or CLI is running on this device, then retry. If it is already running, a remote browser origin may need to be configured.`:`Connect this browser to bb on this device so it can discover installed editors. bb only contacts the local helper after you choose Enable; your browser may ask for local network access.`,` `,(0,$.jsxs)(`a`,{href:Us,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-0.5 rounded-sm underline underline-offset-2 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,onClick:e=>{e.preventDefault(),oe(Us)},children:[`Setup guide`,(0,$.jsx)(P,{name:`ExternalLink`,className:`size-3 shrink-0`,"aria-hidden":!0})]})]}),children:(0,$.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:c||t,onClick:u,children:c?n?`Retrying…`:`Enabling…`:t?`Blocked`:n?`Retry`:`Enable`})})})}return(0,$.jsx)(Y,{title:`File Preferences`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsx)(ic,{definition:nc,onTargetChange:i,preferredTargetId:t,targets:s}),(0,$.jsx)(ic,{definition:rc,onTargetChange:a,preferredTargetId:n,targets:s})]})})}var oc=`Open links in the in-app browser`,sc=`Rewrite localhost links`,cc=`Navigate to threads on creation`,lc=`Markdown formatting in prompt box`,uc=`Show diagnostic events`,dc=`Default thread followup behavior`,fc=[{steerOnEnter:!1,label:`Queue`,description:`Enter adds a follow-up. It runs when the agent stops. Command+Enter (Ctrl+Enter on Windows and Linux) steers the run.`},{steerOnEnter:!0,label:`Steer`,description:`Enter steers the run now. Command+Enter (Ctrl+Enter on Windows and Linux) adds a follow-up for later.`}],pc=`Streamer mode`,mc=`New branch prefix`,hc=`fix-login-flow-thr_ab12cd34ef`;function gc(e){let t=(0,Z.c)(26),{disabled:n,onChange:r,value:i}=e,[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(i);i!==s&&(c(i),o(i));let l;t[0]===a?l=t[1]:(l=he.safeParse(a),t[0]=a,t[1]=l);let u=l.success,d;t[2]!==a||t[3]!==r||t[4]!==u||t[5]!==i?(d=()=>{if(!u){o(i);return}a!==i&&Promise.resolve(r(a)).catch(()=>o(i))},t[2]=a,t[3]=r,t[4]=u,t[5]=i,t[6]=d):d=t[6];let f=d,p;t[7]!==a||t[8]!==u?(p=u?`bb puts this in front of every branch it creates for a worktree, such as ${a}${hc}. Leave it empty for no prefix.`:(0,$.jsx)(`span`,{className:`text-destructive`,role:`alert`,children:`This prefix cannot start a valid git branch name.`}),t[7]=a,t[8]=u,t[9]=p):p=t[9];let m=!u,h=!u&&`border-destructive focus-visible:ring-destructive`,g;t[10]===h?g=t[11]:(g=R(`h-8 font-mono text-xs`,h),t[10]=h,t[11]=g);let _;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>o(e.target.value),t[12]=_):_=t[12];let v;t[13]!==f||t[14]!==i?(v=e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(e.preventDefault(),o(i))},t[13]=f,t[14]=i,t[15]=v):v=t[15];let y;t[16]!==f||t[17]!==n||t[18]!==a||t[19]!==m||t[20]!==g||t[21]!==v?(y=(0,$.jsx)($e,{value:a,"aria-label":mc,"aria-invalid":m,disabled:n,placeholder:`No prefix`,className:g,onChange:_,onBlur:f,onKeyDown:v}),t[16]=f,t[17]=n,t[18]=a,t[19]=m,t[20]=g,t[21]=v,t[22]=y):y=t[22];let b;return t[23]!==p||t[24]!==y?(b=(0,$.jsx)(X,{label:mc,description:p,controlPlacement:`below`,children:y}),t[23]=p,t[24]=y,t[25]=b):b=t[25],b}function _c(e){let t=(0,Z.c)(77),{appearance:n,appearanceDisabled:r,customThemes:i,pluginThemes:a,faviconColor:o,onAppearanceThemeChange:s,onAppearanceThemePrefetch:c,onAppearanceThemePreview:l,onFaviconColorChange:u,onCreatePalette:d,onThemePreferenceChange:f,themePreference:p}=e,m=(0,Q.useRef)(!1),h;t[0]===l?h=t[1]:(h=e=>{e===null&&m.current||l(e)},t[0]=l,t[1]=h);let g=h,_;t[2]===s?_=t[3]:(_=e=>{m.current=!0,s(e)},t[2]=s,t[3]=_);let v=_,y,b,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Br,{}),b=(0,$.jsx)(Wr,{}),x=(0,$.jsx)(zr,{}),t[4]=y,t[5]=b,t[6]=x):(y=t[4],b=t[5],x=t[6]);let S=Ks[p],C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[7]=C):C=t[7];let w;t[8]===S?w=t[9]:(w=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Theme`,children:[S,C]})}),t[8]=S,t[9]=w);let T;t[10]!==f||t[11]!==p?(T=Gs.map(e=>(0,$.jsxs)(Nt,{onSelect:()=>f(e.value),children:[e.label,(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,p!==e.value&&`opacity-0`,ze)})]},e.value)),t[10]=f,t[11]=p,t[12]=T):T=t[12];let E;t[13]===T?E=t[14]:(E=(0,$.jsx)(tt,{align:`end`,className:Xs,children:T}),t[13]=T,t[14]=E);let D;t[15]!==E||t[16]!==w?(D=(0,$.jsx)(X,{label:`Theme`,children:(0,$.jsxs)(Ct,{children:[w,E]})}),t[15]=E,t[16]=w,t[17]=D):D=t[17];let O;t[18]!==i||t[19]!==c||t[20]!==a||t[21]!==g?(O=e=>{if(e){m.current=!1,c([...Ue.map(yc),...i,...a.map(vc)]);return}g(null)},t[18]=i,t[19]=c,t[20]=a,t[21]=g,t[22]=O):O=t[22];let k;t[23]!==n||t[24]!==a?(k=Ws(n,a),t[23]=n,t[24]=a,t[25]=k):k=t[25];let A;t[26]===k?A=t[27]:(A=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:k}),t[26]=k,t[27]=A);let j;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[28]=j):j=t[28];let M;t[29]!==r||t[30]!==A?(M=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,"aria-label":`Palette`,disabled:r,children:[A,j]})}),t[29]=r,t[30]=A,t[31]=M):M=t[31];let N;t[32]!==n||t[33]!==g||t[34]!==v?(N=Ue.map(e=>(0,$.jsx)($s,{themeId:e.id,active:n.themeId===e.id,onPreview:g,onSelect:v,children:e.name},e.id)),t[32]=n,t[33]=g,t[34]=v,t[35]=N):N=t[35];let F;if(t[36]!==n||t[37]!==i||t[38]!==g||t[39]!==v){let e;t[41]!==n||t[42]!==g||t[43]!==v?(e=e=>(0,$.jsx)($s,{themeId:e,active:n.themeId===e,onPreview:g,onSelect:v,children:e},`custom:${e}`),t[41]=n,t[42]=g,t[43]=v,t[44]=e):e=t[44],F=i.map(e),t[36]=n,t[37]=i,t[38]=g,t[39]=v,t[40]=F}else F=t[40];let I;if(t[45]!==n||t[46]!==a||t[47]!==g||t[48]!==v){let e;t[50]!==n||t[51]!==g||t[52]!==v?(e=e=>(0,$.jsxs)($s,{themeId:e.id,active:n.themeId===e.id,onPreview:g,onSelect:v,children:[e.name,(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.pluginId,`)`]})]},e.id),t[50]=n,t[51]=g,t[52]=v,t[53]=e):e=t[53],I=a.map(e),t[45]=n,t[46]=a,t[47]=g,t[48]=v,t[49]=I}else I=t[49];let L;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(mt,{}),t[54]=L):L=t[54];let z;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(P,{name:`Plus`,className:ze}),t[55]=z):z=t[55];let B;t[56]===d?B=t[57]:(B=(0,$.jsxs)(Nt,{onSelect:d,children:[z,`Create`]}),t[56]=d,t[57]=B);let V;t[58]!==N||t[59]!==F||t[60]!==I||t[61]!==B?(V=(0,$.jsxs)(tt,{align:`end`,className:Xs,children:[N,F,I,L,B]}),t[58]=N,t[59]=F,t[60]=I,t[61]=B,t[62]=V):V=t[62];let H;t[63]!==O||t[64]!==M||t[65]!==V?(H=(0,$.jsx)(X,{label:`Palette`,description:Qs,children:(0,$.jsxs)(Ct,{onOpenChange:O,children:[M,V]})}),t[63]=O,t[64]=M,t[65]=V,t[66]=H):H=t[66];let U;t[67]!==r||t[68]!==o||t[69]!==u?(U=(0,$.jsx)(tc,{disabled:r,faviconColor:o,onFaviconColorChange:u}),t[67]=r,t[68]=o,t[69]=u,t[70]=U):U=t[70];let W,G;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(Kr,{}),G=(0,$.jsx)(Vr,{}),t[71]=W,t[72]=G):(W=t[71],G=t[72]);let K;return t[73]!==D||t[74]!==H||t[75]!==U?(K=(0,$.jsx)(Y,{title:`Appearance`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[y,b,x,D,H,U,W,G]})}),t[73]=D,t[74]=H,t[75]=U,t[76]=K):K=t[76],K}function vc(e){return e.id}function yc(e){return e.id}function bc(e){let t=(0,Z.c)(41),{desktopBrowserAvailable:n,generalSettingsDisabled:r,managedBranchPrefix:i,navigateToThreadAfterCreate:a,onManagedBranchPrefixChange:o,onNavigateToThreadAfterCreateChange:s,onOpenLinksInAppBrowserChange:c,onRewriteLocalhostLinksChange:l,onRichTextEditingChange:u,onSteerActiveThreadOnEnterChange:d,openLinksInAppBrowser:f,rewriteLocalhostLinks:p,richTextEditing:m,steerActiveThreadOnEnter:h}=e,g;t[0]!==a||t[1]!==s?(g=(0,$.jsx)(X,{label:cc,children:(0,$.jsx)(xn,{checked:a,onCheckedChange:s,"aria-label":cc})}),t[0]=a,t[1]=s,t[2]=g):g=t[2];let _;t[3]!==u||t[4]!==m?(_=(0,$.jsx)(X,{label:lc,children:(0,$.jsx)(xn,{checked:m,onCheckedChange:u,"aria-label":lc})}),t[3]=u,t[4]=m,t[5]=_):_=t[5];let v=h?`Steer`:`Queue`,y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(P,{name:`ChevronDown`,className:`size-3.5 text-muted-foreground`}),t[6]=y):y=t[6];let b;t[7]!==r||t[8]!==v?(b=(0,$.jsx)(lt,{asChild:!0,children:(0,$.jsxs)(J,{variant:`outline`,size:`sm`,className:Ys,disabled:r,"aria-label":dc,children:[v,y]})}),t[7]=r,t[8]=v,t[9]=b):b=t[9];let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=R(Xs,`max-w-72`),t[10]=x):x=t[10];let S;t[11]!==d||t[12]!==h?(S=fc.map(e=>(0,$.jsxs)(Nt,{className:`items-start`,onSelect:()=>d(e.steerOnEnter),children:[(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block`,children:e.label}),(0,$.jsx)(`span`,{className:`block text-2xs leading-snug text-subtle-foreground`,children:e.description})]}),(0,$.jsx)(P,{name:`Check`,className:R(`ml-auto`,h!==e.steerOnEnter&&`opacity-0`,ze)})]},e.label)),t[11]=d,t[12]=h,t[13]=S):S=t[13];let C;t[14]===S?C=t[15]:(C=(0,$.jsx)(tt,{align:`end`,className:x,children:S}),t[14]=S,t[15]=C);let w;t[16]!==b||t[17]!==C?(w=(0,$.jsx)(X,{label:dc,description:`What Enter does in the prompt box while the thread runs.`,children:(0,$.jsxs)(Ct,{children:[b,C]})}),t[16]=b,t[17]=C,t[18]=w):w=t[18];let T;t[19]!==g||t[20]!==_||t[21]!==w?(T=(0,$.jsx)(Y,{title:`Threads & editing`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[g,_,w]})}),t[19]=g,t[20]=_,t[21]=w,t[22]=T):T=t[22];let E;t[23]!==n||t[24]!==c||t[25]!==f?(E=n?(0,$.jsx)(X,{label:oc,description:`Open web links inside bb.`,children:(0,$.jsx)(xn,{checked:f,onCheckedChange:c,"aria-label":oc})}):null,t[23]=n,t[24]=c,t[25]=f,t[26]=E):E=t[26];let D;t[27]!==l||t[28]!==p?(D=(0,$.jsx)(X,{label:sc,description:`Point localhost links at this host.`,children:(0,$.jsx)(xn,{checked:p,onCheckedChange:l,"aria-label":sc})}),t[27]=l,t[28]=p,t[29]=D):D=t[29];let O;t[30]!==E||t[31]!==D?(O=(0,$.jsx)(Y,{title:`Links`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[E,D]})}),t[30]=E,t[31]=D,t[32]=O):O=t[32];let k;t[33]!==r||t[34]!==i||t[35]!==o?(k=(0,$.jsx)(Y,{title:`Git`,children:(0,$.jsx)(`div`,{className:`space-y-5`,children:(0,$.jsx)(gc,{value:i,disabled:r,onChange:o})})}),t[33]=r,t[34]=i,t[35]=o,t[36]=k):k=t[36];let A;return t[37]!==T||t[38]!==O||t[39]!==k?(A=(0,$.jsxs)($.Fragment,{children:[T,O,k]}),t[37]=T,t[38]=O,t[39]=k,t[40]=A):A=t[40],A}function xc(e){let t=(0,Z.c)(16),{disabled:n,enabled:r,onEnabledChange:i,streamerMode:a,onStreamerModeChange:o,telemetryEnabled:s,onTelemetryEnabledChange:c}=e,l;t[0]!==n||t[1]!==o||t[2]!==a?(l=(0,$.jsx)(X,{label:pc,description:`Hide the custom models from config.json in every model picker, so a screen share does not show them.`,children:(0,$.jsx)(xn,{checked:a,disabled:n,onCheckedChange:o,"aria-label":pc})}),t[0]=n,t[1]=o,t[2]=a,t[3]=l):l=t[3];let u;t[4]!==n||t[5]!==c||t[6]!==s?(u=(0,$.jsx)(X,{label:`Share anonymous usage data`,description:`Send anonymous app starts, thread and message counts, and plugin installs to help improve BB. Turning this off takes effect immediately for this server.`,children:(0,$.jsx)(xn,{checked:s,disabled:n,onCheckedChange:c,"aria-label":`Share anonymous usage data`})}),t[4]=n,t[5]=c,t[6]=s,t[7]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i?(d=(0,$.jsx)(X,{label:uc,description:`Show provider environment resolution and unhandled provider events for troubleshooting.`,children:(0,$.jsx)(xn,{checked:r,disabled:n,onCheckedChange:i,"aria-label":uc})}),t[8]=n,t[9]=r,t[10]=i,t[11]=d):d=t[11];let f;return t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,$.jsx)(Y,{title:`Privacy & diagnostics`,children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[l,u,d]})}),t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}var Sc={changelogPreview:{label:`Changelog preview`,description:`Show the latest release notes as a compact preview on the Updates page.`},mobileApp:{label:`Mobile app`,description:`Pair the bb mobile app over bb connect: shows Add mobile device under Remote access and enables bb connect machine-code.`},multiMachinePicker:{label:`Multi-machine picker`,description:`Use searchable, target-first environment and machine pickers when many machines are available.`},serverMove:{label:`Server move`,description:`Move the bb server to another machine from Settings → Machines, and export or import server data with bb server.`},sidebarProgressiveDisclosure:{label:`Sidebar progressive disclosure`,description:`In By project and By machine, show the first five groups in the current sort order, keep attention groups visible, and reveal ten more per click. Manually is unchanged.`},timelineWindowing:{label:`Timeline windowing`,description:`Mount only nearby rows in long timelines and expanded timeline details.`}};function Cc(e){let t=(0,Z.c)(6),{disabled:n,experiments:r,onExperimentChange:i}=e,a;t[0]!==n||t[1]!==r||t[2]!==i?(a=At.map(e=>{let t=Sc[e];return(0,$.jsx)(X,{label:t.label,description:t.description,children:(0,$.jsx)(xn,{checked:r[e],disabled:n,onCheckedChange:t=>i(e,t),"aria-label":t.label})},e)}),t[0]=n,t[1]=r,t[2]=i,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(Y,{title:`Experiments`,description:`Early features that are off by default. Opt in to try them.`,children:(0,$.jsx)(`div`,{className:`space-y-5`,children:a})}),t[4]=a,t[5]=o),o}function wc(){let e=(0,Z.c)(113),t=m(),n=Te(),r=Xe(),{hasDaemon:i}=Dt(),{accessState:a,requestAccess:s}=zt(),c;e[0]===i?c=e[1]:(c={enabled:i},e[0]=i,e[1]=c);let{workspaceOpenTargets:l}=an(c),[u,f]=on(l),[p,g]=nn(l),[_,v]=Oe(),[y,b]=vn(),[x,C]=sr(),[w,T]=S(),[E]=(0,Q.useState)($t),D=r.data?.experiments??qe,O=Xn(),k=r.data?.generalSettings??z,A=Zn(),j=r.data?.appearance??qt,N=rr(),P=Er(),F=o(),{activePluginId:I,activeSection:L,hasUnknownSection:R}=Ut();if(R){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(h,{to:ce,replace:!0}),e[2]=t):t=e[2],t}if(L===`plugins`){let t;e[3]===F.pathname?t=e[4]:(t=d(te,F.pathname)?.params.pluginId,e[3]=F.pathname,e[4]=t);let n=t,r;return e[5]===n?r=e[6]:(r=(0,$.jsx)(`div`,{className:`-mx-4 -mt-4 flex min-h-0 flex-1 flex-col overflow-hidden md:-mx-5 md:-mt-5`,children:n?(0,$.jsx)(cr,{pluginId:n}):(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col pt-4 md:pt-5`,children:(0,$.jsx)(mr,{mode:`installed`})})}),e[5]=n,e[6]=r),r}let B;if(I!==null){let t;e[7]===I?t=e[8]:(t=(0,$.jsx)(gi,{pluginId:I}),e[7]=I,e[8]=t),B=t}else if(L===`providers`){let t=r.data===void 0||A.isPending,n;e[9]===A?n=e[10]:(n=e=>A.mutateAsync(e),e[9]=A,e[10]=n);let i;e[11]!==k||e[12]!==t||e[13]!==n?(i=(0,$.jsx)(Pr,{disabled:t,generalSettings:k,onGeneralSettingsChange:n}),e[11]=k,e[12]=t,e[13]=n,e[14]=i):i=e[14],B=i}else if(L===`appearance`){let i=r.data===void 0||N.isPending,a;e[15]===r.data?.customThemes?a=e[16]:(a=r.data?.customThemes??[],e[15]=r.data?.customThemes,e[16]=a);let o;e[17]===r.data?.pluginThemes?o=e[18]:(o=r.data?.pluginThemes??[],e[17]=r.data?.pluginThemes,e[18]=o);let s;e[19]!==P||e[20]!==j.faviconColor||e[21]!==N?(s=e=>N.mutate({themeId:e,faviconColor:j.faviconColor},{onError:()=>P.previewTheme(null)}),e[19]=P,e[20]=j.faviconColor,e[21]=N,e[22]=s):s=e[22];let c;e[23]===t?c=e[24]:(c=()=>t(ae(),{state:{focusPrompt:!0,initialPrompt:Zs}}),e[23]=t,e[24]=c);let l;e[25]!==j.themeId||e[26]!==N?(l=e=>N.mutate({themeId:j.themeId,faviconColor:e}),e[25]=j.themeId,e[26]=N,e[27]=l):l=e[27];let u;e[28]!==P.prefetchThemes||e[29]!==P.previewTheme||e[30]!==j||e[31]!==i||e[32]!==a||e[33]!==o||e[34]!==s||e[35]!==c||e[36]!==l||e[37]!==n?(u=(0,$.jsx)(_c,{appearance:j,appearanceDisabled:i,customThemes:a,pluginThemes:o,faviconColor:j.faviconColor,themePreference:n,onAppearanceThemeChange:s,onAppearanceThemePrefetch:P.prefetchThemes,onAppearanceThemePreview:P.previewTheme,onCreatePalette:c,onFaviconColorChange:l,onThemePreferenceChange:M}),e[28]=P.prefetchThemes,e[29]=P.previewTheme,e[30]=j,e[31]=i,e[32]=a,e[33]=o,e[34]=s,e[35]=c,e[36]=l,e[37]=n,e[38]=u):u=e[38],B=u}else if(L===`keyboard`){let t;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(go,{}),e[39]=t):t=e[39],B=t}else if(L===`browser`){let t;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ho,{}),e[40]=t):t=e[40],B=t}else if(L===`files`){let t;e[41]!==a||e[42]!==u||e[43]!==p||e[44]!==i||e[45]!==s||e[46]!==f||e[47]!==g||e[48]!==l?(t=(0,$.jsx)(ac,{accessState:a,directoryTargetId:u,fileTargetId:p,hasDaemon:i,onDirectoryTargetChange:f,onFileTargetChange:g,onRequestAccess:s,targets:l}),e[41]=a,e[42]=u,e[43]=p,e[44]=i,e[45]=s,e[46]=f,e[47]=g,e[48]=l,e[49]=t):t=e[49];let n;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(xi,{}),e[50]=n):n=e[50];let r;e[51]===t?r=e[52]:(r=(0,$.jsxs)($.Fragment,{children:[t,n]}),e[51]=t,e[52]=r),B=r}else if(L===`projects`){let t;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[53]=t):t=e[53],B=t}else if(L===`machines`){let t;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ns,{}),(0,$.jsx)(_r,{})]}),e[54]=t):t=e[54],B=t}else if(L===`environment-variables`){let t;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(er,{}),e[55]=t):t=e[55],B=t}else if(L===`updates`){let t;e[56]===D.changelogPreview?t=e[57]:(t=(0,$.jsx)(Va,{showChangelogPreview:D.changelogPreview}),e[56]=D.changelogPreview,e[57]=t),B=t}else if(L===`experiments`){let t=r.data===void 0||O.isPending,n;e[58]!==D||e[59]!==O?(n=(e,t)=>O.mutate({...D,[e]:t}),e[58]=D,e[59]=O,e[60]=n):n=e[60];let i;e[61]!==D||e[62]!==t||e[63]!==n?(i=(0,$.jsx)(Cc,{disabled:t,experiments:D,onExperimentChange:n}),e[61]=D,e[62]=t,e[63]=n,e[64]=i):i=e[64],B=i}else if(L===`marketplaces`){let t;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Fs,{}),e[65]=t):t=e[65],B=t}else if(L===`community`){let t;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Hi,{}),e[66]=t):t=e[66],B=t}else if(L===`archived`){let t;e[67]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ps,{}),e[67]=t):t=e[67],B=t}else{let t=r.data===void 0||A.isPending,n;e[68]!==k||e[69]!==A?(n=async e=>{await A.mutateAsync({...k,managedBranchPrefix:e})},e[68]=k,e[69]=A,e[70]=n):n=e[70];let i;e[71]!==k||e[72]!==A?(i=e=>A.mutate({...k,steerActiveThreadOnEnter:e}),e[71]=k,e[72]=A,e[73]=i):i=e[73];let a;e[74]!==E||e[75]!==k.managedBranchPrefix||e[76]!==k.steerActiveThreadOnEnter||e[77]!==x||e[78]!==_||e[79]!==y||e[80]!==w||e[81]!==C||e[82]!==v||e[83]!==b||e[84]!==T||e[85]!==t||e[86]!==n||e[87]!==i?(a=(0,$.jsx)(bc,{desktopBrowserAvailable:E,generalSettingsDisabled:t,managedBranchPrefix:k.managedBranchPrefix,onManagedBranchPrefixChange:n,navigateToThreadAfterCreate:x,openLinksInAppBrowser:_,rewriteLocalhostLinks:y,richTextEditing:w,steerActiveThreadOnEnter:k.steerActiveThreadOnEnter,onNavigateToThreadAfterCreateChange:C,onOpenLinksInAppBrowserChange:v,onRewriteLocalhostLinksChange:b,onRichTextEditingChange:T,onSteerActiveThreadOnEnterChange:i}),e[74]=E,e[75]=k.managedBranchPrefix,e[76]=k.steerActiveThreadOnEnter,e[77]=x,e[78]=_,e[79]=y,e[80]=w,e[81]=C,e[82]=v,e[83]=b,e[84]=T,e[85]=t,e[86]=n,e[87]=i,e[88]=a):a=e[88];let o,s;e[89]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(ks,{}),s=(0,$.jsx)(Ri,{}),e[89]=o,e[90]=s):(o=e[89],s=e[90]);let c;e[91]!==k||e[92]!==A?(c=e=>A.mutate({...k,telemetryEnabled:e}),e[91]=k,e[92]=A,e[93]=c):c=e[93];let l;e[94]!==k||e[95]!==A?(l=e=>A.mutate({...k,streamerMode:e}),e[94]=k,e[95]=A,e[96]=l):l=e[96];let u=r.data===void 0||A.isPending,d;e[97]!==k||e[98]!==A?(d=e=>A.mutate({...k,showDiagnosticEvents:e}),e[97]=k,e[98]=A,e[99]=d):d=e[99];let f;e[100]!==k.showDiagnosticEvents||e[101]!==k.streamerMode||e[102]!==k.telemetryEnabled||e[103]!==d||e[104]!==c||e[105]!==l||e[106]!==u?(f=(0,$.jsx)(xc,{telemetryEnabled:k.telemetryEnabled,onTelemetryEnabledChange:c,streamerMode:k.streamerMode,onStreamerModeChange:l,enabled:k.showDiagnosticEvents,disabled:u,onEnabledChange:d}),e[100]=k.showDiagnosticEvents,e[101]=k.streamerMode,e[102]=k.telemetryEnabled,e[103]=d,e[104]=c,e[105]=l,e[106]=u,e[107]=f):f=e[107];let p;e[108]!==f||e[109]!==a?(p=(0,$.jsxs)($.Fragment,{children:[a,o,s,f]}),e[108]=f,e[109]=a,e[110]=p):p=e[110],B=p}let V;return e[111]===B?V=e[112]:(V=(0,$.jsx)(bn,{contentClassName:`pt-4 md:pt-5`,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-3xl space-y-10`,children:B})}),e[111]=B,e[112]=V),V}export{wc as SettingsView};