@p4code/cli 0.8.7 → 0.8.8

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 (340) hide show
  1. package/dist/AcpMcpStdioBridge-BFonJkL3.mjs +4 -0
  2. package/dist/{AcpMcpStdioBridge-DHwGLtep.mjs → AcpMcpStdioBridge-WH45ZIFK.mjs} +78 -11
  3. package/dist/{Effect-BahT0mOQ.mjs → Effect-B-zvTJgX.mjs} +2 -2
  4. package/dist/bin.mjs +2 -2
  5. package/dist/{binCli-D_84b0CF.mjs → binCli-CnPGSVWN.mjs} +114408 -113097
  6. package/dist/claude-history-worker.mjs +1 -1
  7. package/dist/{claudeHistoryWorker-v_0uyLGp.mjs → claudeHistoryWorker-C1bTkcUr.mjs} +2 -2
  8. package/dist/client/.vite/manifest.json +2067 -2066
  9. package/dist/client/assets/{AnimatedHeight-DewGDSmN.js → AnimatedHeight-CeIqOXkD.js} +2 -2
  10. package/dist/client/assets/{AuthSurfaceShell-D29U36jB.js → AuthSurfaceShell-CeFbPegZ.js} +2 -2
  11. package/dist/client/assets/{CSPContext-CB4Jj3Uk.js → CSPContext-BLmE8rVK.js} +2 -2
  12. package/dist/client/assets/ChatGptUsageButton-gEF4N7W7.js +2 -0
  13. package/dist/client/assets/ChatMarkdown-DQ3uXQzt.js +65 -0
  14. package/dist/client/assets/{CodexSetupSection.logic-DQMTTenV.js → CodexSetupSection.logic-DobP-gmw.js} +2 -2
  15. package/dist/client/assets/ComboboxClear-fNH6Tj-4.js +2 -0
  16. package/dist/client/assets/{CommandBlock-VzUG411k.js → CommandBlock-X-DC1M4o.js} +2 -2
  17. package/dist/client/assets/{ComposerPromptEditor-lIFv0Iko.js → ComposerPromptEditor-DiF8eMQV.js} +56 -56
  18. package/dist/client/assets/CompositeRoot-Bu_9wjlN.js +2 -0
  19. package/dist/client/assets/{ConnectionStatusDot-B0ZKI-zI.js → ConnectionStatusDot-0G2DkC_D.js} +2 -2
  20. package/dist/client/assets/DevicePanel-BkS5Q-Y2.js +2 -0
  21. package/dist/client/assets/{DeviceSetup-Bg5OpWbo.js → DeviceSetup-C0iRuaPp.js} +2 -2
  22. package/dist/client/assets/{DialogTitle-BVkBTuS9.js → DialogTitle-B7ZsIcBO.js} +2 -2
  23. package/dist/client/assets/{DiffCommentAnnotation-BsI9yTe1.js → DiffCommentAnnotation-UyWIyKIO.js} +2 -2
  24. package/dist/client/assets/{DiffFileTree-Bg8GHn2r.js → DiffFileTree-LZwmN24l.js} +2 -2
  25. package/dist/client/assets/DiffPanel-DfD6emFU.js +2 -0
  26. package/dist/client/assets/{DiffWorkerPoolProvider-B9BXoLYM.js → DiffWorkerPoolProvider-BCslhrpA.js} +3 -3
  27. package/dist/client/assets/{EnvironmentMachineIcon-DX1wHHgS.js → EnvironmentMachineIcon-Bn0qgNMW.js} +2 -2
  28. package/dist/client/assets/{ExpandableText-DfTvwfDp.js → ExpandableText-DPFtEjPq.js} +2 -2
  29. package/dist/client/assets/{FieldControl-CrNWnPN_.js → FieldControl-Dcug7PQN.js} +2 -2
  30. package/dist/client/assets/{FileDiff-Ds-DSHzC.js → FileDiff-CztExdxl.js} +2 -2
  31. package/dist/client/assets/{FilePreviewPanel-CyR5pXUr.js → FilePreviewPanel-C_Q3mPlo.js} +4 -4
  32. package/dist/client/assets/{FoldedSettingsSection-DQesC0Ch.js → FoldedSettingsSection-MrezZXWL.js} +2 -2
  33. package/dist/client/assets/{FormContext-CUf-dYwe.js → FormContext-N50VWQHc.js} +2 -2
  34. package/dist/client/assets/{Icons-DMu3kCVA.js → Icons-CBnVp61L.js} +2 -2
  35. package/dist/client/assets/{KeybindingsSettings.logic-BB1oFV_W.js → KeybindingsSettings.logic-CCa_n5Wn.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-D0SwrjYG.js → NoProjectsHero-sRJlYzCx.js} +2 -2
  37. package/dist/client/assets/PanelLayoutControls-bgJzxuTg.js +216 -0
  38. package/dist/client/assets/{PierreEntryIcon-BUl5qtCE.js → PierreEntryIcon-Bid6ECoT.js} +2 -2
  39. package/dist/client/assets/PreviewPanel-CQlsmVXf.js +2 -0
  40. package/dist/client/assets/ProjectDefaultsSettings-BaW9gkj0.js +2 -0
  41. package/dist/client/assets/ProjectFavicon-oQ8xOLai.js +3 -0
  42. package/dist/client/assets/{ProjectIconPickerDialog-C-KFxEg0.js → ProjectIconPickerDialog-D1QKDGMX.js} +2 -2
  43. package/dist/client/assets/{ProjectMonogram-B2dsNF6-.js → ProjectMonogram-wj_aiPmM.js} +2 -2
  44. package/dist/client/assets/{ProviderAuthTerminal-Cwr8Z1Ly.js → ProviderAuthTerminal-BXJZPbVk.js} +2 -2
  45. package/dist/client/assets/ProviderModelPicker-CQQUHTh0.js +2 -0
  46. package/dist/client/assets/{ProviderSettingsForm-DpmAB_Jq.js → ProviderSettingsForm-CX9Fb8_8.js} +2 -2
  47. package/dist/client/assets/PullRequestCodeTab-DLqbGyR7.js +6 -0
  48. package/dist/client/assets/{ReadOnlySourcePreview-C5y6ELAP.js → ReadOnlySourcePreview-B7C0GGAq.js} +2 -2
  49. package/dist/client/assets/{RenderErrorBoundary-CyH8UwmD.js → RenderErrorBoundary-DfL11xnF.js} +2 -2
  50. package/dist/client/assets/ScheduledTasksSettings-Di6Z2urM.js +4 -0
  51. package/dist/client/assets/{ScopedSwitch-pdvWIJp5.js → ScopedSwitch-DYM42LM4.js} +2 -2
  52. package/dist/client/assets/{SecretInput-C11F3Wuh.js → SecretInput-CpQgS_zs.js} +2 -2
  53. package/dist/client/assets/SettingsPanels-D-wcH1Qk.js +39 -0
  54. package/dist/client/assets/{SettingsPanels.logic-zUA6f3HT.js → SettingsPanels.logic-BQHrLt25.js} +2 -2
  55. package/dist/client/assets/{SettingsScopeNotice-N6bcXfto.js → SettingsScopeNotice-BbuY3OvE.js} +2 -2
  56. package/dist/client/assets/{T3ConnectAccountPages-uVnu-v4W.js → T3ConnectAccountPages-Bb49yKNe.js} +2 -2
  57. package/dist/client/assets/{T3ConnectSidebarSignIn-CZCWzt6C.js → T3ConnectSidebarSignIn-CjmtmsbE.js} +2 -2
  58. package/dist/client/assets/{ThemeEditorPanel-CjUB7HmU.js → ThemeEditorPanel-CeucoKK-.js} +3 -3
  59. package/dist/client/assets/{ThreadTerminalDrawer-CAh-h3eK.js → ThreadTerminalDrawer-Di41e66k.js} +4 -4
  60. package/dist/client/assets/{Virtualizer-CB4f0UTD.js → Virtualizer-YMJF6Rgn.js} +2 -2
  61. package/dist/client/assets/{WorkspaceBreadcrumb-3VgFkWcC.js → WorkspaceBreadcrumb-B4olYudc.js} +2 -2
  62. package/dist/client/assets/{WorkspacePageContainer-8jksqZGW.js → WorkspacePageContainer-D_NDP2pC.js} +2 -2
  63. package/dist/client/assets/{WorkspacePageHeader-IRvZnA0X.js → WorkspacePageHeader-CF_fkCJo.js} +2 -2
  64. package/dist/client/assets/_chat-BvSmDiLw.js +45 -0
  65. package/dist/client/assets/{_chat.index-DnYerwxz.js → _chat.index-B86aUAxh.js} +2 -2
  66. package/dist/client/assets/{_chat.new-XtBIcyRw.js → _chat.new-COnJvlNC.js} +3 -3
  67. package/dist/client/assets/_chat.pull-requests-CMa0EuoS.js +2 -0
  68. package/dist/client/assets/{abnfDiagram-VCTEODGH-DUPWAarL.js → abnfDiagram-VCTEODGH-GKlp-wAF.js} +2 -2
  69. package/dist/client/assets/{alert-DzxRsWWi.js → alert-BOSKZyDW.js} +2 -2
  70. package/dist/client/assets/architecture-7GRP2DOG-BTjma_hq.js +1 -0
  71. package/dist/client/assets/{architectureDiagram-5GKGNRK7-ipdl5Chl.js → architectureDiagram-5GKGNRK7-BbKUUHgQ.js} +2 -2
  72. package/dist/client/assets/assets-arnK8cZJ.js +2 -0
  73. package/dist/client/assets/{blockDiagram-I7D4REHJ-CCqcBoEP.js → blockDiagram-I7D4REHJ-BvV9OXgS.js} +2 -2
  74. package/dist/client/assets/{browserHistoryStore-TLJ0k3I1.js → browserHistoryStore-D3NmgwWz.js} +2 -2
  75. package/dist/client/assets/{browserLinkTarget-Du_qPFvd.js → browserLinkTarget-CTDv30-a.js} +2 -2
  76. package/dist/client/assets/{c4Diagram-7LVT6UL2-D0uMteR1.js → c4Diagram-7LVT6UL2-BT2fKwga.js} +2 -2
  77. package/dist/client/assets/channel-BbVwyPme.js +2 -0
  78. package/dist/client/assets/checkbox-B0Q9zWdp.js +2 -0
  79. package/dist/client/assets/{chunk-4HAMMTFA-B3SWgtem.js → chunk-4HAMMTFA-BPIUCP2N.js} +2 -2
  80. package/dist/client/assets/{chunk-75Z2AOVW-CXAakYxI.js → chunk-75Z2AOVW-BY1XFSYe.js} +2 -2
  81. package/dist/client/assets/{chunk-DU6HZSFF-B4qcstD9.js → chunk-DU6HZSFF-BhfbeXEz.js} +2 -2
  82. package/dist/client/assets/{chunk-F27PBJKO-DimzPDjs.js → chunk-F27PBJKO-CkPC4b2I.js} +2 -2
  83. package/dist/client/assets/{chunk-GMAD6QVW-BHA-Os4E.js → chunk-GMAD6QVW-D9bW2adv.js} +2 -2
  84. package/dist/client/assets/{chunk-GVQU2GXP-P9nMI_GJ.js → chunk-GVQU2GXP-C-gRpKGj.js} +2 -2
  85. package/dist/client/assets/{chunk-IMKFNOWR-RgWCceFN.js → chunk-IMKFNOWR-CGR_s6mQ.js} +2 -2
  86. package/dist/client/assets/{chunk-L3NEJ4N5-9p7zIkHC.js → chunk-L3NEJ4N5-BPN8qLtR.js} +2 -2
  87. package/dist/client/assets/{chunk-OSK3NFVY-C9IokqLY.js → chunk-OSK3NFVY-C83gEYhi.js} +2 -2
  88. package/dist/client/assets/{chunk-P2QGCYS3-Dwk8ORW_.js → chunk-P2QGCYS3-DoadH0FQ.js} +2 -2
  89. package/dist/client/assets/{chunk-POPQ4Y6H-BwYKYQwt.js → chunk-POPQ4Y6H-OENQdCtW.js} +2 -2
  90. package/dist/client/assets/{chunk-PWAF6VOD-BMw0rklB.js → chunk-PWAF6VOD-Bm9xwnBb.js} +2 -2
  91. package/dist/client/assets/{chunk-SHT3W25Y-D3ovSAoa.js → chunk-SHT3W25Y-CZdeFTa3.js} +2 -2
  92. package/dist/client/assets/{chunk-SVP7TREG-CpaRTznV.js → chunk-SVP7TREG-CWjZG-1G.js} +2 -2
  93. package/dist/client/assets/{chunk-TICWLB2K-CAtIccZJ.js → chunk-TICWLB2K-C6_3qr0T.js} +2 -2
  94. package/dist/client/assets/classDiagram-ZZMXUADV-BZN2DxkM.js +2 -0
  95. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BZN2DxkM.js +2 -0
  96. package/dist/client/assets/{color-picker-DYoHU1P8.js → color-picker-B_vY4rCj.js} +2 -2
  97. package/dist/client/assets/{combobox-Ddag8Jom.js → combobox-CZ_uig0z.js} +2 -2
  98. package/dist/client/assets/{command-B35zAYVN.js → command-DGoFksB6.js} +2 -2
  99. package/dist/client/assets/{connect-XgeleCz9.js → connect-CuZjH_Pw.js} +2 -2
  100. package/dist/client/assets/{connect-agent-BRIcxQbo.js → connect-agent-BhcB_UCW.js} +2 -2
  101. package/dist/client/assets/{cynefin-OW5HDTMX-Br0UWz2p.js → cynefin-OW5HDTMX-BBaHuZtP.js} +1 -1
  102. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Bz8AWXlE.js → cynefinDiagram-5FMLGOSQ-D0TOipYC.js} +2 -2
  103. package/dist/client/assets/{dagre-GXQ25YYZ-Kk1kLU-A.js → dagre-GXQ25YYZ-BqIStTWM.js} +2 -2
  104. package/dist/client/assets/{device-CJH4ixRH.js → device-Dy_6ukvt.js} +2 -2
  105. package/dist/client/assets/{diagram-S7CK7UJ4-Dogw5edZ.js → diagram-S7CK7UJ4-DtlY2HLu.js} +2 -2
  106. package/dist/client/assets/{diagram-UQ7AKVKN-kg5DSfbZ.js → diagram-UQ7AKVKN-AFvyPgaY.js} +2 -2
  107. package/dist/client/assets/{diagram-VSXAHHWV-DXdyRkdD.js → diagram-VSXAHHWV-BX0DQrOR.js} +2 -2
  108. package/dist/client/assets/{diagram-VX7I27RA-CNO5Z04I.js → diagram-VX7I27RA-RpuCJkmb.js} +2 -2
  109. package/dist/client/assets/{diagram-Z3DM3KII-7Pw0HXMg.js → diagram-Z3DM3KII-YDywc4a-.js} +2 -2
  110. package/dist/client/assets/{dialog-C9_Ef3sx.js → dialog-COvCzBu5.js} +2 -2
  111. package/dist/client/assets/{diffRendering-CAxImuLd.js → diffRendering-EBC4wPDV.js} +2 -2
  112. package/dist/client/assets/{discovery-list-DXE1P9pq.js → discovery-list-B1TD-soO.js} +2 -2
  113. package/dist/client/assets/{dist-DOyHkZUI.js → dist-Cg-eOU-v.js} +3 -3
  114. package/dist/client/assets/{draft-input-6dynCiw_.js → draft-input-DHW6QTyZ.js} +2 -2
  115. package/dist/client/assets/{duoViewer-BFeSS1Av.js → duoViewer-B9J_QozU.js} +2 -2
  116. package/dist/client/assets/{dynamic-BxCDxZLw.js → dynamic-CUevKA9_.js} +2 -2
  117. package/dist/client/assets/{ebnfDiagram-PWID7BFC-DD9UVmrJ.js → ebnfDiagram-PWID7BFC-CAfVAMWI.js} +2 -2
  118. package/dist/client/assets/{embeddedScripts-CIC2AYGL.js → embeddedScripts-Cvalo74G.js} +2 -2
  119. package/dist/client/assets/empty-Dmvz5ya5.js +2 -0
  120. package/dist/client/assets/entities-DPdxOTpx.js +2 -0
  121. package/dist/client/assets/{erDiagram-RLTQ6QDP-BJ--ph2e.js → erDiagram-RLTQ6QDP-B8I9HNiQ.js} +2 -2
  122. package/dist/client/assets/eventmodeling-NTZA5JFV-Cg0CFdkZ.js +1 -0
  123. package/dist/client/assets/{fileLinks-BZV-xG7Q.js → fileLinks-Cfgs6wOJ.js} +2 -2
  124. package/dist/client/assets/{fileTreeExpansion-SSkII8h0.js → fileTreeExpansion-BbO9lBJr.js} +2 -2
  125. package/dist/client/assets/flowDiagram-HODETNUW-RF9W51fq.js +1 -0
  126. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CAMkT1YN.js → ganttDiagram-EL5Y4UJY-G4XFicxk.js} +2 -2
  127. package/dist/client/assets/{getDiffFileInput-BbRHVLd8.js → getDiffFileInput-BhtRP4yl.js} +2 -2
  128. package/dist/client/assets/{gitGraph-4MIJSDKK-DsGem99u.js → gitGraph-4MIJSDKK-Dz9vbKwX.js} +1 -1
  129. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BkbTIyDI.js → gitGraphDiagram-WWUBYQGX-BRPk5Iff.js} +2 -2
  130. package/dist/client/assets/{guideRunStore-CRgghh5M.js → guideRunStore-OyuNEz1_.js} +2 -2
  131. package/dist/client/assets/{htmlRender-DhaCAG_8.js → htmlRender-94mfYlmv.js} +2 -2
  132. package/dist/client/assets/{index-CyuShNwE.js → index-BGHZIIwm.js} +3 -3
  133. package/dist/client/assets/{info-A6RAGUB7-BBQkQpY8.js → info-A6RAGUB7-C2HElvlZ.js} +1 -1
  134. package/dist/client/assets/{infoDiagram-27XIBGKW-B-aRfZJ5.js → infoDiagram-27XIBGKW-IOOCD2gD.js} +2 -2
  135. package/dist/client/assets/{input-BZEAWLAC.js → input-OK9fSGsW.js} +2 -2
  136. package/dist/client/assets/{input-group-DQ0hiSJt.js → input-group-DLt_QDs-.js} +2 -2
  137. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BuQT0JFA.js → ishikawaDiagram-5VMMS53U-DVm2wQsr.js} +2 -2
  138. package/dist/client/assets/{journeyDiagram-3NMN7TZE-DvMkIp6_.js → journeyDiagram-3NMN7TZE-KFjVMjGh.js} +2 -2
  139. package/dist/client/assets/{kanban-definition-UXKFOSKX-BH-BleQp.js → kanban-definition-UXKFOSKX-DxT40hgP.js} +2 -2
  140. package/dist/client/assets/{kbd-B5U1dWuw.js → kbd-LyGbiGLS.js} +2 -2
  141. package/dist/client/assets/{keybindings-BOV97yVS.js → keybindings-BWCWrY_-.js} +2 -2
  142. package/dist/client/assets/{lazyRouteComponent-Cz9CWj20.js → lazyRouteComponent-Doka-Cpt.js} +2 -2
  143. package/dist/client/assets/{line-ldmXyAfR.js → line-BUx_Qlcs.js} +2 -2
  144. package/dist/client/assets/{link-GWWfOiYJ.js → link-DaswZEsz.js} +2 -2
  145. package/dist/client/assets/{linkedPrompt-CUOURNo0.js → linkedPrompt-3u_uoe6Y.js} +2 -2
  146. package/dist/client/assets/main-BEavB8iB.css +2 -0
  147. package/dist/client/assets/main-DB45P6Gd.js +30 -0
  148. package/dist/client/assets/{mediaReference-CHMrPLS_.js → mediaReference-T3SNj1En.js} +2 -2
  149. package/dist/client/assets/{mediaSource-C2DVrhoI.js → mediaSource-DAJ35Twr.js} +2 -2
  150. package/dist/client/assets/{mermaid-parser.core-CLu3jfMo.js → mermaid-parser.core-CuUxy4fc.js} +4 -4
  151. package/dist/client/assets/{mermaid.core-CcbjUEO9.js → mermaid.core-CV-2Hipl.js} +5 -5
  152. package/dist/client/assets/{mindmap-definition-YA3MSWOX-BgA-mHTZ.js → mindmap-definition-YA3MSWOX-B5gC6PY9.js} +2 -2
  153. package/dist/client/assets/number-field-CHOp4dMK.js +2 -0
  154. package/dist/client/assets/{observeResize-DRhwSBbU.js → observeResize-B7tl_Rye.js} +2 -2
  155. package/dist/client/assets/{onboarding-JdAo8zsA.js → onboarding-CFB4Wz5g.js} +2 -2
  156. package/dist/client/assets/{openFileInPreview-fPqhkMo9.js → openFileInPreview-D80asiJZ.js} +2 -2
  157. package/dist/client/assets/{p4ProjectFile-CvON4UbU.js → p4ProjectFile-BfBM2HoW.js} +2 -2
  158. package/dist/client/assets/{packet-AYTQ26CC-DApn8qRX.js → packet-AYTQ26CC-CJ0qzIIY.js} +1 -1
  159. package/dist/client/assets/{pair-BZFzlFlB.js → pair-CQbNFhjc.js} +2 -2
  160. package/dist/client/assets/{pegDiagram-XKGWAZYB-CXEiF-e_.js → pegDiagram-XKGWAZYB-BzvO80-H.js} +2 -2
  161. package/dist/client/assets/{phoneViewer-B2PYzUOK.js → phoneViewer-BghY79hZ.js} +2 -2
  162. package/dist/client/assets/{pie-WAS4IAKB-CYqWZV05.js → pie-WAS4IAKB-M62byk0f.js} +1 -1
  163. package/dist/client/assets/{pieDiagram-E7YTZNPT-DI-IJXNl.js → pieDiagram-E7YTZNPT-O5p8eSgL.js} +2 -2
  164. package/dist/client/assets/{pierre-icons-bBNX7pHG.js → pierre-icons-BweC0Ojp.js} +2 -2
  165. package/dist/client/assets/popover-DzOky6C0.js +2 -0
  166. package/dist/client/assets/{preview-CBNZZm4k.js → preview-CP02VJQW.js} +2 -2
  167. package/dist/client/assets/{preview-BVbvXV-T.js → preview-DLjmZv-h.js} +2 -2
  168. package/dist/client/assets/{previewMiniPlayerStore-C_DZeWb5.js → previewMiniPlayerStore-DnzLYNg5.js} +2 -2
  169. package/dist/client/assets/primary-z0kWcTid.js +2 -0
  170. package/dist/client/assets/primaryCloudLinkState-Bup2zk6b.js +2 -0
  171. package/dist/client/assets/projectFilesQueryState-BKJPj8kq.js +2 -0
  172. package/dist/client/assets/projectScriptEditor-C10v2IgV.js +2 -0
  173. package/dist/client/assets/{providerSkills-JMYzRM2N.js → providerSkills-DPGvsbQq.js} +2 -2
  174. package/dist/client/assets/{pullRequestDetail.logic-BVBxawC1.js → pullRequestDetail.logic-CQ1l2jWB.js} +5 -5
  175. package/dist/client/assets/{pullRequestIcons-CuqlEFYV.js → pullRequestIcons-Cwz6tomi.js} +2 -2
  176. package/dist/client/assets/{pullRequestReviewStore-DmxuV1dp.js → pullRequestReviewStore-DejvzSy2.js} +2 -2
  177. package/dist/client/assets/pullRequests-DmlU8TRv.js +2 -0
  178. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Os8jPhhw.js → quadrantDiagram-AXDQQJYC-DMpTBqB0.js} +2 -2
  179. package/dist/client/assets/queries-DUuhuhAL.js +2 -0
  180. package/dist/client/assets/query-BWYUB_iK.js +2 -0
  181. package/dist/client/assets/{radar-RG4KPBEZ-BwFp-k4W.js → radar-RG4KPBEZ-CRHj_0uz.js} +1 -1
  182. package/dist/client/assets/radio-group-8ftKbjDf.js +2 -0
  183. package/dist/client/assets/{railroad-74A4TZTK-BhaeCUUR.js → railroad-74A4TZTK-LCbjmT_s.js} +1 -1
  184. package/dist/client/assets/railroad-abnf-HS5TGJTU-DJLpez1j.js +1 -0
  185. package/dist/client/assets/railroad-ebnf-LZEXJU2U-FSaf-eSC.js +1 -0
  186. package/dist/client/assets/railroad-peg-WCYAUIDC-pIcyAgnc.js +1 -0
  187. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BwEd4kBJ.js → railroadDiagram-O6MQD6OU-B1mHyPCC.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-C031Kal5.js → renderScheduler-D3-fIVU2.js} +2 -2
  189. package/dist/client/assets/{requirementDiagram-BXWQKSXE-B3cJlOEK.js → requirementDiagram-BXWQKSXE-BH8vaSWt.js} +2 -2
  190. package/dist/client/assets/{rightPanelStore-JWjHC9l1.js → rightPanelStore-Dfw-4Ia_.js} +2 -2
  191. package/dist/client/assets/runtime-VHJoq9so.js +6 -0
  192. package/dist/client/assets/runtime-ivCTGH5C.js +2 -0
  193. package/dist/client/assets/runtimeModeConfig-JkwDqP4L.js +2 -0
  194. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-C8CBmy9t.js → sankeyDiagram-P5KCCOFB-DqqzdGsV.js} +2 -2
  195. package/dist/client/assets/{scheduledTasksSettings.logic-CJBRz5bk.js → scheduledTasksSettings.logic-b-y7WIWN.js} +3 -3
  196. package/dist/client/assets/{scroll-area-D4H8QGpd.js → scroll-area-BtAqRLpC.js} +2 -2
  197. package/dist/client/assets/select-FY7psXk-.js +2 -0
  198. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-IbrowOt4.js → sequenceDiagram-WJ2MYXX4-D6EXXu_o.js} +2 -2
  199. package/dist/client/assets/server-C-qtaHHG.js +2 -0
  200. package/dist/client/assets/session-KZUTmmZy.js +2 -0
  201. package/dist/client/assets/{session-logic-CiMoVF-V.js → session-logic-Dy9r5m2F.js} +5 -5
  202. package/dist/client/assets/{settings-mAdVdtYz.js → settings-xVK7Yt1y.js} +2 -2
  203. package/dist/client/assets/settings.appearance-BUsQj9AN.js +2 -0
  204. package/dist/client/assets/settings.archived-B-IVcn1Z.js +2 -0
  205. package/dist/client/assets/{settings.computer-use-IGLZXOs8.js → settings.computer-use-CvtFf-rW.js} +2 -2
  206. package/dist/client/assets/settings.connections-C90xtGng.js +2 -0
  207. package/dist/client/assets/{settings.data-controls-FiLy_ddv.js → settings.data-controls-DemQiCxT.js} +2 -2
  208. package/dist/client/assets/{settings.decisions-DZO8QWHd.js → settings.decisions-DtOP9oNq.js} +2 -2
  209. package/dist/client/assets/settings.diagnostics-DXaoukRP.js +2 -0
  210. package/dist/client/assets/settings.general-DkWee1YY.js +2 -0
  211. package/dist/client/assets/settings.integrations-BXlqBhz3.js +2 -0
  212. package/dist/client/assets/{settings.keybindings-BYwCM_iI.js → settings.keybindings-Br0uBlw0.js} +2 -2
  213. package/dist/client/assets/{settings.open-source-licenses-CZcWXiGu.js → settings.open-source-licenses-C7LrTwqH.js} +2 -2
  214. package/dist/client/assets/{settings.plugins-P_B4taFp.js → settings.plugins-BWko147F.js} +4 -4
  215. package/dist/client/assets/settings.projects-Hlmn9qBx.js +4 -0
  216. package/dist/client/assets/settings.providers-CUBhfBx1.js +3 -0
  217. package/dist/client/assets/settings.scheduled-tasks-CDDYe3d2.js +2 -0
  218. package/dist/client/assets/{settings.snap-shot-uj9CX5J6.js → settings.snap-shot-BlVwefsY.js} +2 -2
  219. package/dist/client/assets/{settings.source-control-H60mYM0m.js → settings.source-control-b4BRd-7w.js} +2 -2
  220. package/dist/client/assets/{settings.storage--Ghi4ySm.js → settings.storage-DHuqQ3GN.js} +2 -2
  221. package/dist/client/assets/settingsLayout-CthFz77S.js +3 -0
  222. package/dist/client/assets/{sidebar-7a8hvtAS.js → sidebar-BvjZQtR9.js} +2 -2
  223. package/dist/client/assets/{sidebarProjectGrouping-BGgp_M_h.js → sidebarProjectGrouping-CvY13nmg.js} +2 -2
  224. package/dist/client/assets/skeleton-p05dxp84.js +2 -0
  225. package/dist/client/assets/{sortable.esm-CG0AZByT.js → sortable.esm-BVaB8fBB.js} +2 -2
  226. package/dist/client/assets/{sourceControl-B8VqenU-.js → sourceControl-CtDr1raw.js} +2 -2
  227. package/dist/client/assets/{spinner-YUJ6Pwvq.js → spinner-CTNKP1wB.js} +2 -2
  228. package/dist/client/assets/{standalone-page-BxErOfZy.js → standalone-page-BmCMlz1u.js} +2 -2
  229. package/dist/client/assets/{stateDiagram-D77RDMKH-C0i1_7JQ.js → stateDiagram-D77RDMKH-CVk9L7UB.js} +2 -2
  230. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DNtAQSJX.js +2 -0
  231. package/dist/client/assets/{swimlanes-42K2YHIH-DlWorw-a.js → swimlanes-42K2YHIH-eDs6vlYW.js} +2 -2
  232. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CEvm2POs.js +9 -0
  233. package/dist/client/assets/{terminal-links-DnuUiEnP.js → terminal-links-MjQ9lNGX.js} +2 -2
  234. package/dist/client/assets/{terminalSessions-B89lkZlG.js → terminalSessions-BEOZlx0H.js} +2 -2
  235. package/dist/client/assets/{textarea-Br1ny3dw.js → textarea-_oDVfjxe.js} +2 -2
  236. package/dist/client/assets/{themePalette-B4vIs8Bi.js → themePalette-DtFR3xYu.js} +3 -3
  237. package/dist/client/assets/threadSort-BgwLDPpx.js +2 -0
  238. package/dist/client/assets/{timeline-definition-24CTP7MA-f1puoyJY.js → timeline-definition-24CTP7MA-nEI4h-Tk.js} +2 -2
  239. package/dist/client/assets/toast-CyScduZI.js +2 -0
  240. package/dist/client/assets/{toggle-DNxTFG4o.js → toggle-BBpi92mE.js} +2 -2
  241. package/dist/client/assets/{toggle-group-CQtXH1ph.js → toggle-group--QyJ7uYY.js} +2 -2
  242. package/dist/client/assets/tooltip-DcTdC2PH.js +2 -0
  243. package/dist/client/assets/{treeView-Q6P3EWNA-cachkR0K.js → treeView-Q6P3EWNA-BqkVgtYX.js} +1 -1
  244. package/dist/client/assets/{treemap-WGGIJYW6-5vI1Z8yq.js → treemap-WGGIJYW6-DT4jZxe1.js} +1 -1
  245. package/dist/client/assets/usage-BoakMkho.js +2 -0
  246. package/dist/client/assets/{usageAccess-BRuBlcgN.js → usageAccess-Tjotp_ad.js} +2 -2
  247. package/dist/client/assets/{usageFormat-B0V5dWS3.js → usageFormat-C1GJS5IW.js} +2 -2
  248. package/dist/client/assets/{usageShortcuts-CK0JjnNA.js → usageShortcuts-BmYIhNjb.js} +2 -2
  249. package/dist/client/assets/{use-atom-command-JNR1Jqwn.js → use-atom-command-CYY238HA.js} +2 -2
  250. package/dist/client/assets/{useAriaLabelledBy-BNA1QLXP.js → useAriaLabelledBy-_J6EHbv7.js} +2 -2
  251. package/dist/client/assets/{useHandleNewThread-vYbjmg4i.js → useHandleNewThread-BhaVM65m.js} +2 -2
  252. package/dist/client/assets/{useLocation-D91_HRP0.js → useLocation-Cfwex-wi.js} +2 -2
  253. package/dist/client/assets/useNavigate-B3U2CN2A.js +2 -0
  254. package/dist/client/assets/{useNavigateBack-DnwpvjrN.js → useNavigateBack-B0NrYlh8.js} +2 -2
  255. package/dist/client/assets/{useParams-CYkWvywV.js → useParams-U7vgc6nk.js} +2 -2
  256. package/dist/client/assets/{usePermissionStatus-CuzpUXth.js → usePermissionStatus-Urd4cbKv.js} +2 -2
  257. package/dist/client/assets/usePullRequestActions-DpAVW9io.js +3 -0
  258. package/dist/client/assets/{useRegisterFieldControl-C127nghN.js → useRegisterFieldControl-B-o6bvd-.js} +2 -2
  259. package/dist/client/assets/{useScopedModelAvailability-BsIJUZbS.js → useScopedModelAvailability-CIh6LpSK.js} +2 -2
  260. package/dist/client/assets/useSettings-gJURpIkJ.js +3 -0
  261. package/dist/client/assets/{useT3ConnectAuthPrompt-DlW3HUgA.js → useT3ConnectAuthPrompt-Np9NC6fS.js} +2 -2
  262. package/dist/client/assets/utils-BBRDx4UJ.js +37 -0
  263. package/dist/client/assets/vcsRefInvalidation-DwljOjdx.js +2 -0
  264. package/dist/client/assets/{vennDiagram-4TSXK5OY-HkY_FANS.js → vennDiagram-4TSXK5OY-kVbUFMzz.js} +2 -2
  265. package/dist/client/assets/{wardley-WFR3VGLG-B9HKXiPi.js → wardley-WFR3VGLG-B5JrY4hA.js} +1 -1
  266. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CJL7EyS8.js → wardleyDiagram-VM6X3IG4-kNz0Ytm1.js} +2 -2
  267. package/dist/client/assets/{welcome-BOXDf4R_.js → welcome-vYaNWLrj.js} +2 -2
  268. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-Bsll1-pV.js → xychartDiagram-S5SC5T6Z-DGSU7PNa.js} +2 -2
  269. package/dist/client/index.html +1 -1
  270. package/package.json +1 -1
  271. package/dist/AcpMcpStdioBridge-CD9BQr2l.mjs +0 -4
  272. package/dist/client/assets/ChatGptUsageButton-CFN6c9Ue.js +0 -2
  273. package/dist/client/assets/ChatMarkdown-DTSMYNs8.js +0 -65
  274. package/dist/client/assets/ComboboxClear-D8WYxa7i.js +0 -2
  275. package/dist/client/assets/CompositeRoot-CLSWLNTl.js +0 -2
  276. package/dist/client/assets/DevicePanel-BQ6aWeSD.js +0 -2
  277. package/dist/client/assets/DiffPanel-D2TxWIFd.js +0 -2
  278. package/dist/client/assets/PanelLayoutControls-Bfgdx7QX.js +0 -215
  279. package/dist/client/assets/PreviewPanel-CbotCgGz.js +0 -2
  280. package/dist/client/assets/ProjectDefaultsSettings-GpUKCz2U.js +0 -2
  281. package/dist/client/assets/ProjectFavicon-BKEw0TrD.js +0 -3
  282. package/dist/client/assets/ProviderModelPicker-CIxbqWeL.js +0 -2
  283. package/dist/client/assets/PullRequestCodeTab-qEGBl5Kn.js +0 -6
  284. package/dist/client/assets/ScheduledTasksSettings-deUjWQ39.js +0 -4
  285. package/dist/client/assets/SettingsPanels-DExy67bz.js +0 -39
  286. package/dist/client/assets/_chat-BfQTKc_9.js +0 -45
  287. package/dist/client/assets/_chat.pull-requests-Dz-eLkAP.js +0 -2
  288. package/dist/client/assets/architecture-7GRP2DOG-DTyqnvkZ.js +0 -1
  289. package/dist/client/assets/assets-B7aY-rQd.js +0 -2
  290. package/dist/client/assets/channel-BO8pVrSI.js +0 -2
  291. package/dist/client/assets/checkbox-Gd1YCUIl.js +0 -2
  292. package/dist/client/assets/classDiagram-ZZMXUADV-Scmt9e5N.js +0 -2
  293. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Scmt9e5N.js +0 -2
  294. package/dist/client/assets/empty-BvJSXK20.js +0 -2
  295. package/dist/client/assets/entities-Dzl1j2jY.js +0 -2
  296. package/dist/client/assets/eventmodeling-NTZA5JFV-DrPNirV-.js +0 -1
  297. package/dist/client/assets/flowDiagram-HODETNUW-D4bD8hue.js +0 -1
  298. package/dist/client/assets/main-DJbmaTSv.js +0 -30
  299. package/dist/client/assets/main-bt-A8VDR.css +0 -2
  300. package/dist/client/assets/number-field-BuLW4JjE.js +0 -2
  301. package/dist/client/assets/popover-O8JaXWO5.js +0 -2
  302. package/dist/client/assets/primary-fvERVyIG.js +0 -2
  303. package/dist/client/assets/primaryCloudLinkState-CT9FDATw.js +0 -2
  304. package/dist/client/assets/projectFilesQueryState-D-fWLsA3.js +0 -2
  305. package/dist/client/assets/projectScriptEditor-BqddH5Lr.js +0 -2
  306. package/dist/client/assets/pullRequests-CEpTVk5m.js +0 -2
  307. package/dist/client/assets/queries-BBd2XSpN.js +0 -2
  308. package/dist/client/assets/query-fboCqXXy.js +0 -2
  309. package/dist/client/assets/radio-group-B2ziR973.js +0 -2
  310. package/dist/client/assets/railroad-abnf-HS5TGJTU-D_PV710-.js +0 -1
  311. package/dist/client/assets/railroad-ebnf-LZEXJU2U-CmXdS8HA.js +0 -1
  312. package/dist/client/assets/railroad-peg-WCYAUIDC-BpmFZ4-g.js +0 -1
  313. package/dist/client/assets/runtime-B-UcwNuZ.js +0 -2
  314. package/dist/client/assets/runtime-BVzm9sLS.js +0 -6
  315. package/dist/client/assets/runtimeModeConfig-Ce0Dnm2_.js +0 -2
  316. package/dist/client/assets/select-D0wmEFXx.js +0 -2
  317. package/dist/client/assets/server-97u7Iupv.js +0 -2
  318. package/dist/client/assets/session-CPQQ27HG.js +0 -2
  319. package/dist/client/assets/settings.appearance-SUyLnEit.js +0 -2
  320. package/dist/client/assets/settings.archived-C-clMQMK.js +0 -2
  321. package/dist/client/assets/settings.connections-DhpKQ7ay.js +0 -2
  322. package/dist/client/assets/settings.diagnostics-CG2kVUBD.js +0 -2
  323. package/dist/client/assets/settings.general-jsS1Ydzs.js +0 -2
  324. package/dist/client/assets/settings.integrations-DDlR7Et9.js +0 -2
  325. package/dist/client/assets/settings.projects-DqNHL2Mx.js +0 -4
  326. package/dist/client/assets/settings.providers-olNQXPOc.js +0 -3
  327. package/dist/client/assets/settings.scheduled-tasks-Dwr1Iiu5.js +0 -2
  328. package/dist/client/assets/settingsLayout-BdqCokK9.js +0 -3
  329. package/dist/client/assets/skeleton-7wGNlCET.js +0 -2
  330. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-nFt0QPRs.js +0 -2
  331. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Byr1T2AB.js +0 -9
  332. package/dist/client/assets/threadSort-BN7fK5qZ.js +0 -2
  333. package/dist/client/assets/toast-Bkc7xsho.js +0 -2
  334. package/dist/client/assets/tooltip-DH7_Fmka.js +0 -2
  335. package/dist/client/assets/usage-Cuwnw3mn.js +0 -2
  336. package/dist/client/assets/useNavigate-NmIi-1RV.js +0 -2
  337. package/dist/client/assets/usePullRequestActions-DqgBdoH5.js +0 -3
  338. package/dist/client/assets/useSettings-DYKTOdxY.js +0 -3
  339. package/dist/client/assets/utils-vKlT_s3D.js +0 -37
  340. package/dist/client/assets/vcsRefInvalidation-CC_2_Ufo.js +0 -2
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Au as n,Du as r,Em as i,Fm as a,Gf as o,Gn as s,HT as c,Hm as l,Jf as u,Jh as d,Jn as f,Ny as p,Qh as m,Qu as h,Rc as g,Uh as _,Um as v,Wf as y,Wh as b,Wn as x,Xh as S,Yn as C,Zn as w,_p as T,cr as E,dE as D,eg as O,gT as k,l as A,ng as j,or as M,p_ as N,qn as P,r_ as F,sr as I,sw as L,t as R,tg as ee,tr as te,uf as ne,zc as re}from"./utils-vKlT_s3D.js";import{U as ie}from"./runtime-BVzm9sLS.js";import{w as ae}from"./entities-Dzl1j2jY.js";import{a as oe,n as z,t as B}from"./tooltip-DH7_Fmka.js";import{a as se,r as ce,t as le}from"./number-field-BuLW4JjE.js";import{a as V,c as H,i as ue,o as U,r as de,s as W,t as G}from"./select-D0wmEFXx.js";import{t as fe}from"./spinner-YUJ6Pwvq.js";import{i as K}from"./toast-Bkc7xsho.js";import{D as pe,E as me,J as he,c as ge,o as _e,r as ve,s as q,x as J}from"./useSettings-DYKTOdxY.js";import{f as ye}from"./server-97u7Iupv.js";import{i as be,n as xe}from"./session-CPQQ27HG.js";import{t as Se}from"./use-atom-command-JNR1Jqwn.js";import{t as Ce}from"./env-wK1YYxA8.js";import{t as we}from"./input-BZEAWLAC.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./dialog-C9_Ef3sx.js";import{i as Ne,t as Pe}from"./device-CJH4ixRH.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,s as Be,t as Ve}from"./DeviceSetup-Bg5OpWbo.js";import{t as He}from"./AnimatedHeight-DewGDSmN.js";import{i as Ue,n as We}from"./Icons-DMu3kCVA.js";import{t as Ge}from"./preview-BVbvXV-T.js";import{a as Ke,i as qe,o as Je,t as Ye}from"./popover-O8JaXWO5.js";import{B as Xe,C as Ze,L as Qe,P as $e,a as Y,c as et,i as tt,r as nt,s as rt}from"./settingsLayout-BdqCokK9.js";import{Ar as it,Fr as at,Ir as ot,La as st,Mr as ct,Nr as lt,Pr as ut,aa as dt,fa as ft,ia as pt,ir as X,jr as mt}from"./main-DJbmaTSv.js";import{t as ht}from"./ProjectDefaultsSettings-GpUKCz2U.js";import{t as gt}from"./draft-input-6dynCiw_.js";import{t as _t}from"./ScopedSwitch-pdvWIJp5.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-CuzpUXth.js";var Z=D(),Q=e(c(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(E,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Je,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(Ke,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(qe,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let C;return t[24]!==S||t[25]!==m?(C=(0,Q.jsxs)(Ye,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=C):C=t[26],C}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(B,{children:[(0,Q.jsxs)(oe,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(h,{className:`size-3`}):(0,Q.jsx)(y,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(z,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=p(N);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=Se(Pe.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Ot(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await kt(e,n,async(e,n)=>{if(!xe(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(L(r.cause));return r.value},(e,t)=>{o[e]=t,r(n=>({...n,[a]:{...n[a],[e]:t}}))}),o}finally{i.current.delete(a)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:a,busy:s,onSave:c,onClose:l}=e,[u,d]=(0,$.useState)(n),{checks:f,testConnection:p}=At(a),m=f[Ot(u)],g=Object.values(m??{}).some(Nt),_,v;t[0]===u?(_=t[1],v=t[2]):(_=Dt({...u,label:u.label.trim()||u.target}),v=k(_),t[0]=u,t[1]=_,t[2]=v);let y=v,b;t[3]===m?b=t[4]:(b=Object.values(m??{}).filter(Mt),t[3]=m,t[4]=b);let x=b.length,S;t[5]!==s||t[6]!==l?(S=e=>{!e&&!s&&l()},t[5]=s,t[6]=l,t[7]=S):S=t[7];let C=!s,w;t[8]!==s||t[9]!==g||t[10]!==u.label||t[11]!==_||t[12]!==c?(w=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),k(_)&&u.label.trim()&&!s&&!g&&c(_.value)}}),t[8]=s,t[9]=g,t[10]=u.label,t[11]=_,t[12]=c,t[13]=w):w=t[13];let T=r?`Add device host`:`Edit device host`,E;t[14]===T?E=t[15]:(E=(0,Q.jsx)(Ee,{children:T}),t[14]=T,t[15]=E);let D=a.length===1?`Connect from ${a[0]?.label}.`:`Connect from ${a.length} selected environments.`,O;t[16]===D?O=t[17]:(O=(0,Q.jsxs)(Ae,{children:[D,` `,`Hosts on the same machine are skipped.`]}),t[16]=D,t[17]=O);let A;t[18]!==E||t[19]!==O?(A=(0,Q.jsxs)(Te,{children:[E,O]}),t[18]=E,t[19]=O,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=j):j=t[21];let M;t[22]===u?M=t[23]:(M=e=>d({...u,label:e.target.value}),t[22]=u,t[23]=M);let N;t[24]!==s||t[25]!==u.label||t[26]!==M?(N=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(we,{autoFocus:!0,required:!0,value:u.label,disabled:s,onChange:M,placeholder:`Mac mini`})]}),t[24]=s,t[25]=u.label,t[26]=M,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=P):P=t[28];let F;t[29]===u?F=t[30]:(F=e=>d({...u,target:e.target.value}),t[29]=u,t[30]=F);let L;t[31]!==s||t[32]!==u.target||t[33]!==F?(L=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[P,(0,Q.jsx)(we,{required:!0,value:u.target,disabled:s,onChange:F,placeholder:`user@host or SSH alias`})]}),t[31]=s,t[32]=u.target,t[33]=F,t[34]=L):L=t[34];let R=n.port!==void 0||n.identityFile!==void 0||void 0,ee;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=ee):ee=t[35];let te;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=te):te=t[36];let ne=u.identityFile??``,re;t[37]===u?re=t[38]:(re=e=>{let{identityFile:t,...n}=u;d(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=u,t[38]=re);let ie;t[39]!==s||t[40]!==ne||t[41]!==re?(ie=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[te,(0,Q.jsx)(we,{value:ne,disabled:s,onChange:re,placeholder:`SSH config default`})]}),t[39]=s,t[40]=ne,t[41]=re,t[42]=ie):ie=t[42];let ae;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ae):ae=t[43];let oe=u.port??``,z;t[44]===u?z=t[45]:(z=e=>{let{port:t,...n}=u;d(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=u,t[45]=z);let B;t[46]!==s||t[47]!==oe||t[48]!==z?(B=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ae,(0,Q.jsx)(we,{type:`number`,min:1,max:65535,value:oe,disabled:s,onChange:z,placeholder:`Default`})]}),t[46]=s,t[47]=oe,t[48]=z,t[49]=B):B=t[49];let se;t[50]!==ie||t[51]!==B?(se=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[ie,B]}),t[50]=ie,t[51]=B,t[52]=se):se=t[52];let ce;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=ce):ce=t[53];let le;t[54]!==R||t[55]!==se?(le=(0,Q.jsxs)(`details`,{open:R,className:`text-sm`,children:[ee,se,ce]}),t[54]=R,t[55]=se,t[56]=le):le=t[56];let V=g?`Checking environments…`:m?x?`${x} of ${a.length} failed`:`Connection checks passed`:`Check access before saving`,H;t[57]===V?H=t[58]:(H=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:V}),t[57]=V,t[58]=H);let ue=s||g||!y,U;t[59]!==_||t[60]!==p?(U=()=>{k(_)&&p(_.value)},t[59]=_,t[60]=p,t[61]=U):U=t[61];let de;t[62]===g?de=t[63]:(de=g?(0,Q.jsx)(fe,{size:`xs`}):null,t[62]=g,t[63]=de);let W;t[64]!==ue||t[65]!==U||t[66]!==de?(W=(0,Q.jsxs)(I,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:U,children:[de,` Test connection`]}),t[64]=ue,t[65]=U,t[66]=de,t[67]=W):W=t[67];let G;t[68]!==H||t[69]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[H,W]}),t[68]=H,t[69]=W,t[70]=G):G=t[70];let K;t[71]!==m||t[72]!==a?(K=m?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:a.map(e=>{let t=m[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(fe,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(o,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=m,t[72]=a,t[73]=K):K=t[73];let pe;t[74]!==G||t[75]!==K?(pe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[G,K]}),t[74]=G,t[75]=K,t[76]=pe):pe=t[76];let me;t[77]!==N||t[78]!==L||t[79]!==le||t[80]!==pe?(me=(0,Q.jsxs)(ke,{children:[N,L,le,pe]}),t[77]=N,t[78]=L,t[79]=le,t[80]=pe,t[81]=me):me=t[81];let he;t[82]!==s||t[83]!==l?(he=(0,Q.jsx)(I,{type:`button`,variant:`ghost`,disabled:s,onClick:l,children:`Cancel`}),t[82]=s,t[83]=l,t[84]=he):he=t[84];let ge;t[85]!==s||t[86]!==g||t[87]!==u.label||t[88]!==y?(ge=s||g||!y||!u.label.trim(),t[85]=s,t[86]=g,t[87]=u.label,t[88]=y,t[89]=ge):ge=t[89];let _e;t[90]===s?_e=t[91]:(_e=s?(0,Q.jsx)(fe,{size:`xs`}):null,t[90]=s,t[91]=_e);let ve;t[92]!==ge||t[93]!==_e?(ve=(0,Q.jsxs)(I,{type:`submit`,disabled:ge,children:[_e,` Save host`]}),t[92]=ge,t[93]=_e,t[94]=ve):ve=t[94];let q;t[95]!==he||t[96]!==ve?(q=(0,Q.jsxs)(De,{children:[he,ve]}),t[95]=he,t[96]=ve,t[97]=q):q=t[97];let J;t[98]!==A||t[99]!==me||t[100]!==C||t[101]!==q||t[102]!==w?(J=(0,Q.jsxs)(je,{showCloseButton:C,render:w,children:[A,me,q]}),t[98]=A,t[99]=me,t[100]=C,t[101]=q,t[102]=w,t[103]=J):J=t[103];let ye;return t[104]!==S||t[105]!==J?(ye=(0,Q.jsx)(Me,{open:!0,onOpenChange:S,children:J}),t[104]=S,t[105]=J,t[106]=ye):ye=t[106],ye}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:n,connectedEnvironments:r}=Xe(),i=be(e.environmentId,F),a=t.kind===`project`||t.kind===`checkout`,o=Se(ye.updateSettings,{reportFailure:!1}),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)(null),[d,f]=(0,$.useState)(!1),p=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:m,testConnection:h}=At(p),g=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){f(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!xe(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?c(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{f(!1)}}};return(0,Q.jsx)(Y,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(I,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({id:A(),label:``,target:``})},children:[(0,Q.jsx)(T,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[r.map(e=>(0,Q.jsxs)(`div`,{children:[r.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!i||a||d,checks:m,testConnection:async e=>{let t=await h(e);if(!t)return;let n=p.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${p.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{u(e),c(e)},onRemove:e=>void g(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(jt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void g(e,!1,l??e),onClose:()=>c(null)},s.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:c,checks:l,testConnection:d}=e,{state:f}=Ne(r),p=Se(Pe.list),[m,h]=(0,$.useState)(null),g;t[0]===i.length?g=t[1]:(g=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=g);let _;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==p||t[10]!==m||t[11]!==f||t[12]!==d){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==c||t[20]!==p||t[21]!==m||t[22]!==f||t[23]!==d?(e=e=>{let t=f.hostStatuses[e.id],i=l[Ot(e)]?.[r],g=(i?.status===`connected`?i.platforms:void 0)??f.hosts.find(t=>t.id===e.id)?.platforms??[],_=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),g.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:f.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:f.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,v?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:v})]})}):null]}),_?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(fe,{size:`xs`}),_]}):null,(0,Q.jsxs)(s,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(I,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(u,{})}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(C,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(C,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&f.supportsHostRetry&&f.hostStatus!==`disabled`?(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:a||m!==null,onClick:()=>{h(e.id),p({environmentId:r,input:{retryHostId:e.id}}).finally(()=>h(null))},children:m===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:a||_!==null,onClick:()=>void d(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=o,t[19]=c,t[20]=p,t[21]=m,t[22]=f,t[23]=d,t[24]=e):e=t[24],_=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=c,t[9]=p,t[10]=m,t[11]=f,t[12]=d,t[13]=_}else _=t[13];let v;return t[25]!==g||t[26]!==_?(v=(0,Q.jsxs)(Q.Fragment,{children:[g,_]}),t[25]=g,t[26]=_,t[27]=v):v=t[27],v}function It(e){return(0,Q.jsxs)(B,{children:[(0,Q.jsx)(oe,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Ue,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(We,{className:`size-3.5`})}),(0,Q.jsx)(z,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=A(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=zt(b,T.current,i);if(e===void 0){C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let O=D,k;t[13]===s?k=t[14]:(k=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=k);let j=k,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let R;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==O||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(R=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?O:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?O:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:O}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=O,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=R):R=t[39];let ee;t[40]!==L||t[41]!==R?(ee=(0,Q.jsx)(je,{className:`max-w-lg`,showCloseButton:L,children:R}),t[40]=L,t[41]=R,t[42]=ee):ee=t[42];let te;return t[43]!==ee||t[44]!==I?(te=(0,Q.jsx)(Me,{open:!0,onOpenChange:I,children:ee}),t[43]=ee,t[44]=I,t[45]=te):te=t[45],te}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Ae,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(I,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(I,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(De,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),f;t[0]===s?f=t[1]:(f=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={fullDiskAccess:!1},t[2]=p):p=t[2];let m=bt(f,p),h;t[3]!==i||t[4]!==c?(h=()=>{c||(l(!0),d(null),Promise.resolve().then(i).catch(()=>d(`Could not open System Settings. Try Allow again.`)).finally(()=>l(!1)))},t[3]=i,t[4]=c,t[5]=h):h=t[5];let g=h,_;t[6]===n.name?_=t[7]:(_=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Ae,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(ne,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=v):v=t[8];let y=`Read ${n.name}'s cookies for this import.`,b;t[9]===g?b=t[10]:(b=()=>void g(),t[9]=g,t[10]=b);let x;t[11]!==m.status.fullDiskAccess||t[12]!==y||t[13]!==b?(x=[{id:`fullDiskAccess`,icon:v,title:`Full Disk Access`,description:y,granted:m.status.fullDiskAccess,onAllow:b}],t[11]=m.status.fullDiskAccess,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]!==c||t[16]!==x?(S=(0,Q.jsx)(vt,{busy:c,permissions:x}),t[15]=c,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==u||t[19]!==m.error?(C=u||m.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:u??m.error}):null,t[18]=u,t[19]=m.error,t[20]=C):C=t[20];let w;t[21]!==m||t[22]!==o?(w=m.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:o?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=m,t[22]=o,t[23]=w):w=t[23];let T;t[24]!==C||t[25]!==w||t[26]!==S?(T=(0,Q.jsxs)(ke,{children:[S,C,w]}),t[24]=C,t[25]=w,t[26]=S,t[27]=T):T=t[27];let E;t[28]===r?E=t[29]:(E=(0,Q.jsx)(I,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=E);let D;t[30]===m?D=t[31]:(D=m.isReady([`fullDiskAccess`]),t[30]=m,t[31]=D);let O;t[32]!==a||t[33]!==c||t[34]!==D?(O=(0,Q.jsx)(yt,{ready:D,busy:c,onClick:a,children:`Continue`}),t[32]=a,t[33]=c,t[34]=D,t[35]=O):O=t[35];let k;t[36]!==E||t[37]!==O?(k=(0,Q.jsxs)(De,{children:[E,O]}),t[36]=E,t[37]=O,t[38]=k):k=t[38];let A;return t[39]!==T||t[40]!==k||t[41]!==_?(A=(0,Q.jsxs)(Q.Fragment,{children:[_,T,k]}),t[39]=T,t[40]=k,t[41]=_,t[42]=A):A=t[42],A}function $t(e){let t=(0,Z.c)(59),{source:i,destinationEnvironmentName:a,targetProfiles:o,canCreateProfile:s,sourceProfileDirectory:c,onSourceProfileChange:l,target:u,targetError:d,onTargetChange:f,onCancel:p,onImport:m}=e,h;t[0]!==u.kind||t[1]!==u.profileId||t[2]!==o?(h=u.kind===`existing`&&!o.some(e=>e.id===u.profileId),t[0]=u.kind,t[1]=u.profileId,t[2]=o,t[3]=h):h=t[3];let g=h,_=u.kind===`new`&&!s,v=d??(g?`That profile is no longer available. Choose where to import these cookies.`:_?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),y;t[4]===i.name?y=t[5]:(y=(0,Q.jsxs)(Ee,{children:[`Import from `,i.name]}),t[4]=i.name,t[5]=y);let b;t[6]===a?b=t[7]:(b=(0,Q.jsxs)(Ae,{children:[`Choose which cookies to import for `,a,`.`]}),t[6]=a,t[7]=b);let x;t[8]!==y||t[9]!==b?(x=(0,Q.jsxs)(Te,{children:[y,b]}),t[8]=y,t[9]=b,t[10]=x):x=t[10];let S;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=S):S=t[11];let C;if(t[12]!==l||t[13]!==i.profiles||t[14]!==c){let e;t[16]!==l||t[17]!==c?(e=e=>(0,Q.jsx)(en,{selected:c===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>l(e.directory)},e.directory),t[16]=l,t[17]=c,t[18]=e):e=t[18],C=i.profiles.map(e),t[12]=l,t[13]=i.profiles,t[14]=c,t[15]=C}else C=t[15];let w;t[19]===C?w=t[20]:(w=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[S,C]}),t[19]=C,t[20]=w);let T;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(r,{className:`size-4 sm:hidden`}),(0,Q.jsx)(n,{className:`hidden size-4 sm:block`})]}),t[21]=T):T=t[21];let E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=E):E=t[22];let D;t[23]!==s||t[24]!==f||t[25]!==u.kind?(D=s?(0,Q.jsx)(en,{selected:u.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>f({kind:`new`})}):null,t[23]=s,t[24]=f,t[25]=u.kind,t[26]=D):D=t[26];let O;if(t[27]!==f||t[28]!==u.kind||t[29]!==u.profileId||t[30]!==o){let e;t[32]!==f||t[33]!==u.kind||t[34]!==u.profileId?(e=e=>(0,Q.jsx)(en,{selected:u.kind===`existing`&&u.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>f({kind:`existing`,profileId:e.id})},e.id),t[32]=f,t[33]=u.kind,t[34]=u.profileId,t[35]=e):e=t[35],O=o.map(e),t[27]=f,t[28]=u.kind,t[29]=u.profileId,t[30]=o,t[31]=O}else O=t[31];let k;t[36]!==D||t[37]!==O?(k=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[E,D,O]}),t[36]=D,t[37]=O,t[38]=k):k=t[38];let A;t[39]!==k||t[40]!==w?(A=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[w,T,k]}),t[39]=k,t[40]=w,t[41]=A):A=t[41];let j;t[42]===v?j=t[43]:(j=v?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:v}):null,t[42]=v,t[43]=j);let M;t[44]!==A||t[45]!==j?(M=(0,Q.jsxs)(ke,{children:[A,j]}),t[44]=A,t[45]=j,t[46]=M):M=t[46];let N;t[47]===p?N=t[48]:(N=(0,Q.jsx)(I,{variant:`outline`,onClick:p,children:`Cancel`}),t[47]=p,t[48]=N);let P=c===``||g||_,F;t[49]!==m||t[50]!==P?(F=(0,Q.jsx)(I,{disabled:P,onClick:m,children:`Import`}),t[49]=m,t[50]=P,t[51]=F):F=t[51];let L;t[52]!==N||t[53]!==F?(L=(0,Q.jsxs)(De,{children:[N,F]}),t[52]=N,t[53]=F,t[54]=L):L=t[54];let R;return t[55]!==M||t[56]!==L||t[57]!==x?(R=(0,Q.jsxs)(Q.Fragment,{children:[x,M,L]}),t[55]=M,t[56]=L,t[57]=x,t[58]=R):R=t[58],R}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=R(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=R(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(h,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let g;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(g=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=g):g=t[21],g}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ee,{children:`Importing cookies`}),(0,Q.jsx)(Ae,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(fe,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ee,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Ae,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Te,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(fe,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Ee,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(Ae,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Te,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(ke,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(I,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(De,{children:(0,Q.jsx)(Oe,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Ee,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=g[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Ae,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Te,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(I,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(I,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(De,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return re.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&dt.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:dt.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=q(Sn),i=J(),a=r._tag===`fill`?null:r,o=a?.width??un.width,s=a?.height??un.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===on){i({browserDefaultViewport:b});return}if(e===sn){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??un.width,height:a?.height??un.height}});return}let t=dt.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let f=u,p;t[7]!==l||t[8]!==a||t[9]!==i?(p=(e,t)=>{if(t===null||!vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=p):p=t[10];let m=p,h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=X(`browser-default-viewport`),t[11]=h):h=t[11];let g;t[12]!==n||t[13]!==i||t[14]!==r._tag?(g=!n&&r._tag!==v._tag?(0,Q.jsx)(nt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:v})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=g):g=t[15];let _;t[16]===r?_=t[17]:(_=gn(r),t[16]=r,t[17]=_);let y;t[18]===r?y=t[19]:(y=_n(r),t[18]=r,t[19]=y);let x;t[20]===y?x=t[21]:(x=(0,Q.jsx)(W,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(H,{children:y})}),t[20]=y,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(V,{value:on,children:`Fill panel`}),C=(0,Q.jsx)(V,{value:sn,children:`Responsive`}),t[22]=S,t[23]=C):(S=t[22],C=t[23]);let w;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(U,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(de,{children:[(0,Q.jsx)(ue,{children:`Standard`}),dt.map(xn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==f||t[27]!==x||t[28]!==_?(T=(0,Q.jsxs)(G,{value:_,onValueChange:f,disabled:n,children:[x,w]}),t[25]=n,t[26]=f,t[27]=x,t[28]=_,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(E=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(le,{value:l.width,min:240,max:d,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`width`,e),children:(0,Q.jsx)(ce,{children:(0,Q.jsx)(se,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(le,{value:l.height,min:240,max:d,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`height`,e),children:(0,Q.jsx)(ce,{children:(0,Q.jsx)(se,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(oe,{render:(0,Q.jsx)(I,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:yn(a)}),children:(0,Q.jsx)(pt,{})})}),(0,Q.jsx)(z,{side:`top`,children:`Rotate`})]})]}):null,t[30]=m,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=E):E=t[35];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;return t[39]!==D||t[40]!==g?(O=(0,Q.jsx)(Y,{...h,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:g,control:D}),t[39]=D,t[40]=g,t[41]=O):O=t[41],O}function xn(e){return(0,Q.jsx)(V,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=q(Tn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)(nt,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=S.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(H,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:S.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(V,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(On),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:_})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(H,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(V,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=q(jn),i=q(An),a=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(Y,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(st,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(Y,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(st,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(Pn),i=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-frame-rate`),t[0]=o):o=t[0];let s;t[1]!==n||t[2]!==r||t[3]!==i?(s=!n&&r!==30?(0,Q.jsx)(nt,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c=String(r),l;t[5]===i?l=t[6]:(l=e=>{let t=a.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=l);let u;t[7]===r?u=t[8]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(H,{children:[r,` fps`]})}),t[7]=r,t[8]=u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:a.map(Nn)}),t[9]=d):d=t[9];let f;t[10]!==n||t[11]!==c||t[12]!==l||t[13]!==u?(f=(0,Q.jsxs)(G,{disabled:n,value:c,onValueChange:l,children:[u,d]}),t[10]=n,t[11]=c,t[12]=l,t[13]=u,t[14]=f):f=t[14];let p;return t[15]!==s||t[16]!==f?(p=(0,Q.jsx)(Y,{...o,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:s,control:f}),t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function Nn(e){return(0,Q.jsxs)(V,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=q(Rn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`link target`,onClick:()=>i({browserLinkTarget:l})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=Fn[r],u;t[7]===c?u=t[8]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(H,{children:c})}),t[7]=c,t[8]=u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=Object.keys(Fn),t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:d.map(Ln)}),t[10]=f):f=t[10];let p;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==u?(p=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[u,f]}),t[11]=n,t[12]=r,t[13]=s,t[14]=u,t[15]=p):p=t[15];let m;return t[16]!==o||t[17]!==p?(m=(0,Q.jsx)(Y,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:p}),t[16]=o,t[17]=p,t[18]=m):m=t[18],m}function Ln(e){return(0,Q.jsx)(V,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=Xe(),r=$e(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(rt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=be(e,F),{state:i,loaded:a}=Ne(e),{scope:o,environments:s,connectedEnvironments:c}=Xe(),l=Qe(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=Se(Pe.configure,{reportFailure:!1}),p=Se(Pe.list,{reportFailure:!1}),[m,h]=(0,$.useState)(null),g=i.hostStatus===`installing`||i.hostStatus===`starting`,_=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[v,y]=(0,$.useState)(!1);v&&!t&&y(!1),t&&!v&&(i.hostStatus===`ready`||_)&&m!==`hub`&&y(!0);let b=async(t,n)=>{if(e&&xe(e,`settings:write`)){h(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!xe(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return f({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{h(null)}}},[x,S]=(0,$.useState)(null),C=i.hosts.find(e=>e.kind===`local`)?.tools,w=t=>{let n=C?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[i.supportsToolUpdate&&r?(0,Q.jsx)(I,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>{e&&(S(null),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&S({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>h(null)))},children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Check versions`}):null]}),x?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:x.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:ze,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:w(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),m===`hub`?(0,Q.jsx)(Re,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void b(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(He,{children:v?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:c.length>1?`Status for ${c.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Le,{compact:!0,platform:`iOS`,status:Be(i,`ios`)}),(0,Q.jsx)(Le,{compact:!0,platform:`Android`,status:Be(i,`android`)})]}),control:(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:!e||!t||g||m!==null,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Fe,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:w(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),m===`agent`?(0,Q.jsx)(Ve,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||c.length===0||!u&&(!a||!d||g)||m!==null,"aria-label":`Agent device access`,onCheckedChange:e=>u?l({enableAgentDeviceAccess:!!e}):void b(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ie,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=q(Hn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)(nt,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(st,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(Y,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=q(e=>e.browserProfiles),n=q(e=>e.browserDefaultProfileId),r=ge(),i=J(),{environments:a,isReady:o}=me(),c=pe(),[l,d]=(0,$.useState)(null),[p,h]=(0,$.useState)(null),[g,_]=(0,$.useState)(null),[v,y]=(0,$.useState)(null),[b,S]=(0,$.useState)(null),[E,D]=(0,$.useState)(!1),k=ae(),N=Se(Ge.clearProfile,{reportFailure:!1}),F={environmentIds:a.map(e=>e.environmentId).filter(e=>k.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await N({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw ie(n)}},L=ln(ft!==null,o,a.length,F.environmentIds.length),ne=(0,$.useRef)(!1),[re,oe]=(0,$.useState)(!1),z=e||!r,B=j(t).filter(e=>e.kind!==`incognito`),se=O(B,n)?.id??`default`,ce=e=>{if(!r||ne.current)return;let t=ve().browserProfiles;if(t.length>=24)return;let n=j(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${A()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},le=(e,t)=>{if(!r||ne.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=ve().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},V=(e,t)=>{if(r&&!ne.current){if(!L){K.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(ft,a.map(e=>e.environmentId),e,F).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},H=async e=>{if(!r||ne.current)return;if(!L){S(`Connect to an environment before removing this profile.`);return}S(null),D(!0);try{await cn(ft,o?a.map(e=>e.environmentId):[],e,F)}catch{S(`Profile data could not be deleted. Try again.`),D(!1);return}let t=ve();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:m}:{}}),D(!1),_(null)},ue=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),U=(0,$.useCallback)(()=>{ft&&ft.listBrowserImportSources().then(d).catch(()=>d(e=>e??[]))},[]),de=async(e,t,n)=>{if(!ft||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!j(ve().browserProfiles).some(e=>e.id===n.target.profileId)||ne.current)return{kind:`blocked`,reason:`readFailed`};ne.current=!0,oe(!0);try{let r=await ft.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!j(ve().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await _e(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let r=new Set(j(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(ft,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{ne.current=!1,oe(!1)}},W=async e=>{if(ft)try{let t=await ft.listBrowserImportSources();return d(t),t.find(t=>t.id===e)}catch{return}},G=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(s,{onOpenChange:e=>e&&U(),children:[(0,Q.jsxs)(M,{render:(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:z||re}),children:[(0,Q.jsx)(T,{}),`Add profile`]}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(C,{disabled:!r||G,onClick:()=>ce(`New profile`),children:`Blank profile`}),G?(0,Q.jsx)(C,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(te,{}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(f,{children:`Import from`}),l===null?(0,Q.jsx)(C,{disabled:!0,children:`Looking for browsers…`}):ue.length===0?(0,Q.jsx)(C,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ue.map(e=>(0,Q.jsx)(C,{disabled:!r||c==null,onClick:()=>{r&&c!=null&&h({source:e,environmentId:c.environmentId,environmentName:Ze({isPrimary:!0,environmentId:c.environmentId,runtimeLabel:c.label})})},children:e.name},e.id)),c==null?(0,Q.jsx)(C,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:B.map((e,t)=>{let n=ee(e.id),a=e.id===se;return(0,Q.jsxs)(`div`,{className:R(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:R(`truncate text-sm text-foreground`,z&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:z||re,maxLength:48,value:e.name,onCommit:t=>le(e.id,t)}),a?(0,Q.jsx)(`span`,{className:R(`flex`,z&&`opacity-64`),children:(0,Q.jsx)(x,{children:`Default`})}):null]}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(I,{size:`icon-xs`,variant:`ghost-muted`,disabled:z||re,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(u,{})}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(C,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(C,{disabled:!r||!L,onClick:()=>{F.environmentIds.length>0?y(e):V(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(C,{variant:`destructive`,disabled:!r||!L,onClick:()=>{r&&_(e)},children:`Remove profile and data`}),L?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(te,{}),(0,Q.jsx)(C,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(it,{open:g!==null,onOpenChange:e=>{!e&&!E&&(_(null),S(null))},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Remove “`,g?.name,`”?`]}),(0,Q.jsx)(ct,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),b?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:b}):null,L?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{disabled:E,render:(0,Q.jsx)(I,{variant:`outline`,disabled:E}),children:`Cancel`}),(0,Q.jsx)(I,{variant:`destructive`,disabled:E||!r||!L,onClick:()=>{g&&r&&L&&H(g.id)},children:E?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(it,{open:v!==null,onOpenChange:e=>{e||y(null)},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Clear “`,v?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(ct,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{render:(0,Q.jsx)(I,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(I,{variant:`destructive`,onClick:()=>{v&&V(v.id,v.name),y(null)},children:`Clear data`})]})]})}),p?(0,Q.jsx)(Jt,{source:p.source,destinationEnvironmentName:p.environmentName,targetProfiles:B.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!G,onImport:e=>de(p.source,p.environmentId,e),onRefreshSource:()=>W(p.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await he()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>h(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!Ce,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(tt,{children:[i,(0,Q.jsx)(rt,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(et,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
2
- //# sourceMappingURL=settings.integrations-DDlR7Et9.js.map
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-C-KFxEg0.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-vKlT_s3D.js","assets/activity-C1Y3O_v1.js","assets/createLucideIcon-CacG5mZC.js","assets/alarm-clock-Pw90g7hE.js","assets/app-window-D2LBv8RE.js","assets/archive-0Qz6rgBl.js","assets/arrow-down-up-B46gw0xW.js","assets/arrow-down-DvRecXuy.js","assets/arrow-left-BLE461db.js","assets/arrow-right-left-BqjFeAD_.js","assets/arrow-right-CoV5ameY.js","assets/arrow-up-down-ibtVnemT.js","assets/arrow-up-left-BMvgV_8i.js","assets/arrow-up-right-C6IM-WPd.js","assets/arrow-up-3Yp3lsoe.js","assets/battery-Bjbw2yxu.js","assets/bell-CLuvLMth.js","assets/blocks-B-VfW07Q.js","assets/book-open-HEEW8eqT.js","assets/bookmark-HM-xwl47.js","assets/bot-DpQzHyXo.js","assets/box-CKWcQvdq.js","assets/bug-Dtc5BRVF.js","assets/calendar-arrow-down-CAFi0Chs.js","assets/calendar-arrow-up-Cs2MbLyZ.js","assets/calendar-clock-DTUOomkO.js","assets/calendar-c_JH_1V1.js","assets/camera-V1Ufc9sC.js","assets/chart-no-axes-column-DKbSsm0y.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-left-DrNh6cTh.js","assets/chevron-right-NbahR9_s.js","assets/chevron-up-C-w52bD6.js","assets/chevrons-left-right-ellipsis-D2Qu5H2y.js","assets/chevrons-up-down-BMPucOK_.js","assets/chromium-BusoCgri.js","assets/circle-alert-B83jEPoh.js","assets/circle-arrow-up-kT0Pa2jA.js","assets/circle-check-Y1T60J9X.js","assets/circle-dashed-ChJzoouS.js","assets/circle-dot-DSAuCGJf.js","assets/circle-slash-Ceo-2WKq.js","assets/circle-x-C-GXnJRB.js","assets/circle-4zZlZno3.js","assets/clock-3-SBiWJYHb.js","assets/clock-bc9N_wA2.js","assets/cloud-download-BE7c7r3I.js","assets/cloud-upload-noux3Cbp.js","assets/cloud-DyVMWy7X.js","assets/code-xml-CbuCFrkh.js","assets/code-DuFehkNQ.js","assets/columns-2-D1kdFD9w.js","assets/copy-CoM62e83.js","assets/corner-left-up-BCqW4dF8.js","assets/corner-up-right--t3OPVhh.js","assets/cpu-mffhvvYB.js","assets/database-DipbOz0U.js","assets/download-BAp4p4A-.js","assets/earth-CTY23Bx1.js","assets/ellipsis-vertical-fYTS1grT.js","assets/ellipsis-6x3R4_IB.js","assets/external-link-NWS0I_zo.js","assets/eye-off-BJFC-Vn7.js","assets/eye-Dh5UEUs_.js","assets/file-braces-CcggTVd0.js","assets/file-code-corner-Dt6PpZnb.js","assets/file-diff-BE4sroJp.js","assets/file-search-DotMSEoS.js","assets/file-spreadsheet-Boc78Vjm.js","assets/file-text-xj3y_Xbg.js","assets/file-1cutE11R.js","assets/files-CQwG7JjF.js","assets/film-CYJIuMHb.js","assets/flask-conical-WkWFg73e.js","assets/folder-closed-zBKiY8_q.js","assets/folder-cog-BMK_9DOi.js","assets/folder-git-2-BxqGR5ht.js","assets/folder-git-CoMYGJp_.js","assets/folder-open-BqgCWh1y.js","assets/folder-plus-BHa3aD6W.js","assets/folder-tree-CIpeR87A.js","assets/folder-CMIvEUJv.js","assets/gauge-C_4eEUrj.js","assets/git-branch-plus-BQ_ISFgF.js","assets/git-branch-CAP5iwh8.js","assets/git-commit-horizontal-6IR7R88i.js","assets/git-fork-BEEZa2l_.js","assets/git-merge-C47N_dux.js","assets/git-pull-request-arrow-C9_ZycDh.js","assets/git-pull-request-closed-BkRFT_Rl.js","assets/git-pull-request-draft-BNpXqUsz.js","assets/globe-BygqUCSx.js","assets/grip-vertical-B8ERFH5y.js","assets/hammer-BRTj-Vot.js","assets/hard-drive-CVWUL95f.js","assets/history-B22_6xEN.js","assets/house-D_gjXlRt.js","assets/image-xUrgiZ2i.js","assets/inbox-48iST-IJ.js","assets/info-BHB-83EA.js","assets/keyboard-9HUE6Zs7.js","assets/laptop-05PEAB3d.js","assets/layers-BqgDAlx3.js","assets/lightbulb-CEqRo_1f.js","assets/link-2-B_p2EG7Q.js","assets/link-zAXVcUwk.js","assets/list-checks-CQu2FTgJ.js","assets/list-filter-BOx8tW9q.js","assets/list-ordered-f2n8ZhGo.js","assets/list-todo-D7F9k-PE.js","assets/list-BAEaXVbr.js","assets/loader-circle-B3Ce8JIQ.js","assets/lock-open-Bt3QlIE2.js","assets/lock-Cc3mNdEd.js","assets/log-in-BpPtfyCd.js","assets/mail-J8kfrAC7.js","assets/maximize-2-CHT2IkVy.js","assets/maximize-CoWtPryT.js","assets/memory-stick-C7kBEkBW.js","assets/message-circle-question-mark-Blboafqi.js","assets/message-circle-CwQpPAbq.js","assets/message-square-dashed-DrEYZ6F3.js","assets/message-square-off-BstjdZP9.js","assets/message-square-text-CJTpB0rs.js","assets/message-square-warning-I95tWaoN.js","assets/message-square-DLzUyuIE.js","assets/messages-square-BNeF2306.js","assets/minimize-2-DOhpJbnX.js","assets/minus-C7W28oE7.js","assets/monitor-Ddj8MK6z.js","assets/moon-B9ss2TfK.js","assets/mouse-pointer-2-DbBU41il.js","assets/mouse-pointer-click-DsDE4K7M.js","assets/octagon-alert-BKVCgU--.js","assets/package-plus-Cl7EzKuY.js","assets/package-CeeyHFJU.js","assets/paintbrush-D1BKpWrm.js","assets/palette-Xj4s0pmv.js","assets/panel-bottom-BzpRd9wr.js","assets/panel-left-DzXd97so.js","assets/panel-right-C3EFo10c.js","assets/paperclip-BCpF_jt0.js","assets/panels-top-left-C5lf6BGD.js","assets/pen-line-BeMREvYs.js","assets/pencil-ruler-CU_Sl28D.js","assets/pencil-CnxrJI7X.js","assets/picture-in-picture-2-g5nsWFVw.js","assets/pilcrow-DMiXqMTk.js","assets/pin-DfMqpQHz.js","assets/play-Bvcnzkvl.js","assets/plug-2-DkrvJqyh.js","assets/plus-Cr075-cy.js","assets/plug-Cdxb0djR.js","assets/power-BZu57mPF.js","assets/presentation-DvMc9hxG.js","assets/puzzle-Bv9mngwk.js","assets/qr-code-D3ZNC-wH.js","assets/quote-zNyOHYG3.js","assets/radio-tower-CT5Np78y.js","assets/redo-2-DRHZshO-.js","assets/refresh-cw-PY_ECjtI.js","assets/rotate-ccw-Dr4MwDMq.js","assets/rotate-cw-10CQA0Ej.js","assets/route-CQ6wZzks.js","assets/rows-3-Bhc8vjss.js","assets/scale-V7dmr96y.js","assets/search-Cr9eaeTj.js","assets/send-CMOvB09P.js","assets/server-Le_hLOlf.js","assets/settings-2-XzWAl_8P.js","assets/settings-CTjEqsg3.js","assets/shield-check-k2SY7zjx.js","assets/shield-question-mark-pgYZYoSI.js","assets/shield-veV1FXDO.js","assets/sliders-horizontal-lg5XUMZM.js","assets/smartphone-zkhAIn1Q.js","assets/smile-plus-20kjE9KX.js","assets/sparkles-cStmYKbH.js","assets/square-arrow-out-up-right-DRKYZdVU.js","assets/square-pen-DIW48FdK.js","assets/square-plus-CeFmBUPF.js","assets/square-split-horizontal-Ba4BZbro.js","assets/square-split-vertical-BqJX4cZa.js","assets/square-terminal-CB0QR1vW.js","assets/square-DVrCvZRU.js","assets/star-DJ6Ycqv6.js","assets/sun-C8irSiA-.js","assets/tag-DhRIoqTo.js","assets/target-DziMQLku.js","assets/terminal-6kKaKv-Q.js","assets/text-align-start-C-EHiBr4.js","assets/text-search-BsqmpFYh.js","assets/text-wrap-C8SwAUbc.js","assets/ticket-LnwYlhC1.js","assets/trash-2-CiyAV2xI.js","assets/trending-down-CZZKiTTZ.js","assets/trending-up-CyMfjRD-.js","assets/triangle-alert-BiHUyRl3.js","assets/type-ChjbxAhu.js","assets/undo-2-ZlIXiNdF.js","assets/unlink-2-DKAoaBiV.js","assets/unplug-Dg15iaHA.js","assets/upload-D9-Kv89Z.js","assets/user-check-BtCtF_-l.js","assets/user-lock-BWt0Um72.js","assets/user-plus-DbG1t95t.js","assets/user-round-x-D7izbSMH.js","assets/user-round-GtkOza8y.js","assets/users-LmqvhHnq.js","assets/wifi-off-DtJhRDhE.js","assets/workflow-Za5zYpKH.js","assets/wrench-CSZxFJCP.js","assets/x-CSwbgjBe.js","assets/zap-CrtYfJ8v.js","assets/toggle-group-CQtXH1ph.js","assets/CompositeRoot-CLSWLNTl.js","assets/toggle-DNxTFG4o.js","assets/input-BZEAWLAC.js","assets/FieldControl-CrNWnPN_.js","assets/useRegisterFieldControl-C127nghN.js","assets/scroll-area-D4H8QGpd.js","assets/CSPContext-CB4Jj3Uk.js","assets/dialog-C9_Ef3sx.js","assets/DialogTitle-BVkBTuS9.js","assets/ProjectMonogram-B2dsNF6-.js","assets/dynamic-BxCDxZLw.js","assets/index-CyuShNwE.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-CyuShNwE.js";import{r as n}from"./Icon-l19w4AjM.js";import{$u as r,D as i,Fp as a,Gn as o,HT as s,Jn as c,KC as l,Ls as u,Rs as d,Vo as f,Wv as p,Yn as m,Zg as h,Zn as g,_p as _,dE as v,gc as y,hf as b,in as x,l_ as S,n as C,om as w,or as T,os as E,ps as D,qn as ee,r as O,r_ as k,sr as A,tr as te}from"./utils-vKlT_s3D.js";import{H as j,L as ne,R as M,U as re}from"./runtime-BVzm9sLS.js";import{C as N,P as ie,W as P,k as F}from"./entities-Dzl1j2jY.js";import{yn as I}from"./runtime-B-UcwNuZ.js";import{t as L}from"./useNavigate-NmIi-1RV.js";import{t as R}from"./useLocation-D91_HRP0.js";import{i as z}from"./toast-Bkc7xsho.js";import{E as ae,J as B,K as V,O as oe}from"./useSettings-DYKTOdxY.js";import{f as H,s as U}from"./server-97u7Iupv.js";import{n as W,o as G}from"./session-CPQQ27HG.js";import{t as K}from"./use-atom-command-JNR1Jqwn.js";import{n as q}from"./toastHelpers-Dsph6LwL.js";import{i as J,o as Y,r as X}from"./command-B35zAYVN.js";import{t as se}from"./input-BZEAWLAC.js";import{D as ce,E as le,O as ue,j as de,y as fe}from"./keybindings-BOV97yVS.js";import{t as pe}from"./PierreEntryIcon-BUl5qtCE.js";import{t as me}from"./ProjectFavicon-BKEw0TrD.js";import{d as he}from"./projectFilesQueryState-D-fWLsA3.js";import{n as ge}from"./p4ProjectFile-CvON4UbU.js";import{r as _e,t as ve}from"./alert-DzxRsWWi.js";import{B as ye,H as be,I as xe,a as Z,i as Se,r as Ce,s as we}from"./settingsLayout-BdqCokK9.js";import{Mi as Te,Sn as Ee,bn as De,pn as Oe,yi as ke}from"./main-DJbmaTSv.js";import{c as Ae,f as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./projectScriptEditor-BqddH5Lr.js";import{t as Re}from"./ProjectDefaultsSettings-GpUKCz2U.js";import{t as ze}from"./SettingsScopeNotice-N6bcXfto.js";var Be=v(),Q=e(n(),1),$=e(s(),1);function Ve(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function He(e,t){return!O(t)||I(e)}function Ue(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=he(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=V(),l=f(U),u=e.onPickExternal,d=C(typeof navigator>`u`?``:navigator.platform),p=(0,Q.useMemo)(()=>Oe(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(pe,{pathValue:t.path,kind:`file`,theme:c}),run:async()=>e.onSelect(t.path)})),[e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(X,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(J,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Ee,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(Y,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{z.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${d}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(De,{groups:p.length>0?[{value:`project-favicon-files`,label:e.projectName,items:p}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ve(t,s.error,s.isPending)})})}):null})}function We(e){let t=(0,Be.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:o}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let s;if(t[1]!==i||t[2]!==r||t[3]!==o||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==o?(e=e=>{let t=fe(r,ce(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Fe,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(A,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>o(e),children:(0,$.jsx)(a,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=o,t[9]=e):e=t[9],s=n.map(e),t[1]=i,t[2]=r,t[3]=o,t[4]=n,t[5]=s}else s=t[5];return s}function Ge(e){if(e._tag===`Failure`&&!ne(e)){let t=re(e);z.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return M(e,()=>void 0)}function Ke(e){let t=N(),[n,r]=(0,Q.useState)(!1),i=(0,Q.useRef)(!1),a=K(H.updateSettings,`project actions update`),o=K(H.upsertKeybinding,`action shortcut update`),s=K(H.removeKeybinding,`action shortcut removal`);async function c(n,c,u){if(i.current||e.length===0){let e=`No available machine, or another action change is saving.`;return z.add({type:`error`,title:`Actions not saved`,description:e}),E(l(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ge(E(l(new S({requiredScope:k,message:`This connection cannot change environment settings.`}))));i.current=!0,r(!0);try{for(let{environmentId:r,settings:i,keybindings:l,project:d}of e){let e=d?je(i,d):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await a({environmentId:r,input:{patch:d?{projectSettingsOverrides:{[d.id]:f===null?ge(i,d.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[d.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ge(m);let h=c?[c]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=ce(e),a=Ae(l,n),c=a?Ie({keybinding:a,command:n}):null,p=Ie({keybinding:u,command:n}),m=!f?.some(t=>t.id===e)&&(d&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==d?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==d?.id&&(d?je(i,t):t.scripts).some(t=>t.id===e))),h=p?await o({environmentId:r,input:c&&c.key!==p.key?{...p,replace:c}:p}):c&&!m?await s({environmentId:r,input:c}):null;if(h?._tag===`Failure`)return Ge(h)}}return D(void 0)}finally{i.current=!1,r(!1)}}function u(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ue(r.name,i),o=le(a,r);return c(e=>{let t=e.map(e=>e.id===a?o:de(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:c,submit:u}}function qe(){let e=(0,Be.c)(67),{scope:t,targets:n,target:i}=ye(),{environments:a}=ae(),s=t.kind===`project`||t.kind===`checkout`,l;e[0]!==a||e[1]!==i?(l=i?a.find(e=>e.environmentId===i.environmentId)?.serverConfig:void 0,e[0]=a,e[1]=i,e[2]=l):l=e[2];let u=l,d;e[3]===i?.settings.defaultProjectScripts?d=e[4]:(d=i?.settings.defaultProjectScripts??[],e[3]=i?.settings.defaultProjectScripts,e[4]=d);let f=d,h=u?.keybindings??y,v;if(e[5]!==f||e[6]!==n){let t;e[8]===f?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(f),e[8]=f,e[9]=t),v=n.some(t),e[5]=f,e[6]=n,e[7]=v}else v=e[7];let b=v,x=xe(),[S,C]=(0,Q.useState)(null),w,E,D;e[10]!==a||e[11]!==s||e[12]!==t.members||e[13]!==n?(w=new Map(s?t.members.map(Ye):[]),E=Ke,D=n.flatMap(e=>{let t=a.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?w.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=a,e[11]=s,e[12]=t.members,e[13]=n,e[14]=w,e[15]=E,e[16]=D):(w=e[14],E=e[15],D=e[16]);let{saving:O,persist:k,submit:j}=E(D),M;e[17]!==w||e[18]!==i?(M=i?.projectId?w.get(i.projectId):void 0,e[17]=w,e[18]=i,e[19]=M):M=e[19];let N=M,ie;e[20]===N?.environmentId?ie=e[21]:(ie=N?.environmentId??p.make(`none`),e[20]=N?.environmentId,e[21]=ie);let P=Pe(ie,N?.workspaceRoot??null),F;if(e[22]!==f||e[23]!==P.scripts){let t;e[25]===f?t=e[26]:(t=e=>!f.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=f,e[26]=t),F=P.scripts.filter(t),e[22]=f,e[23]=P.scripts,e[24]=F}else F=e[24];let I=F,L;e[27]===j?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await j(null,t);if(n._tag===`Failure`&&!ne(n)){let e=re(n);C({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=j,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===k?B=e[31]:(B=()=>void k(Je),e[30]=k,e[31]=B);let V;e[32]!==x||e[33]!==R||e[34]!==I||e[35]!==O?(V=I.length>0?(0,$.jsxs)(o,{children:[(0,$.jsxs)(T,{render:(0,$.jsx)(A,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:O||!x,type:`button`}),children:[`Import scripts`,(0,$.jsx)(r,{className:`size-3.5`})]}),(0,$.jsxs)(g,{align:`end`,children:[(0,$.jsxs)(ee,{children:[(0,$.jsx)(c,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(te,{}),I.map(e=>(0,$.jsxs)(m,{onClick:()=>void R(e),children:[(0,$.jsx)(Fe,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=x,e[33]=R,e[34]=I,e[35]=O,e[36]=V):V=e[36];let oe=O||!x||n.length===0,H,U;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>C({scriptId:null,initial:Le}),U=(0,$.jsx)(_,{className:`size-3.5`}),e[37]=H,e[38]=U):(H=e[37],U=e[38]);let W;e[39]===oe?W=e[40]:(W=(0,$.jsxs)(A,{size:`xs`,variant:`outline`,disabled:oe,onClick:H,children:[U,`Add action`]}),e[39]=oe,e[40]=W);let G;e[41]!==V||e[42]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,W]}),e[41]=V,e[42]=W,e[43]=G):G=e[43];let K;e[44]!==b||e[45]!==B||e[46]!==G?(K=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:b,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:G}),e[44]=b,e[45]=B,e[46]=G,e[47]=K):K=e[47];let q;e[48]!==x||e[49]!==h||e[50]!==b||e[51]!==O||e[52]!==f?(q=b?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(We,{scripts:f,keybindings:h,disabled:O||!x,onEdit:e=>C(Me(e,h))}),e[48]=x,e[49]=h,e[50]=b,e[51]=O,e[52]=f,e[53]=q):q=e[53];let J;e[54]===P.status?J=e[55]:(J=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=J);let Y;e[56]!==k||e[57]!==S||e[58]!==f||e[59]!==j||e[60]!==i?(Y=i&&(0,$.jsx)(Ne,{environmentId:i.environmentId,editScope:`settings:write`,request:S,scripts:f,onSubmit:j,onDelete:e=>void k(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>C(null)}),e[56]=k,e[57]=S,e[58]=f,e[59]=j,e[60]=i,e[61]=Y):Y=e[61];let X;return e[62]!==K||e[63]!==q||e[64]!==J||e[65]!==Y?(X=(0,$.jsxs)(we,{id:`project-actions`,title:`Actions`,children:[K,q,J,Y]}),e[62]=K,e[63]=q,e[64]=J,e[65]=Y,e[66]=X):X=e[66],X}function Je(){return null}function Ye(e){return[e.id,e]}function Xe(e,t,n){return n&&e.some(e=>e!==t)}var Ze=(0,Q.lazy)(()=>t(()=>import(`./ProjectIconPickerDialog-C-KFxEg0.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230])));function Qe(e){return`${e.environmentId}:${e.id}`}function $e(e){let t=(0,Be.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=be(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=L(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:tt},t[1]=u):u=t[1];let d=R(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(et)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(nt,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function et(e){return e.physicalProjectKey}function tt(e){return e.pathname}function nt({group:e,hasOtherMembers:t}){let n=L({from:`/settings`}),r=oe(),{environments:a}=ae(),o=(0,Q.useMemo)(()=>new Map(a.map(e=>[e.environmentId,e])),[a]),s=G(e.memberProjects,h),c=e.memberProjects.every(e=>s.has(e.environmentId)),f=e.memberProjects.find(e=>o.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],p=F(),m=Te(P.update,{reportFailure:!1}),g=Te(P.delete,{reportFailure:!1}),_=(0,Q.useRef)(!1),v=f.faviconPath??null,y=f.projectIcon??null,S=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&He(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,C=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||ne(t))return;let n=re(t);z.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),T=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,h));if(!n)return null;let r=E(l(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return C(t,r),r},[C]),ee=(0,Q.useCallback)(async(t,n)=>{let r=T(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=o.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=E(l(e));return C(n,t),t}for(let r of e.memberProjects){let i=T([r],n);if(i)return i;let a=M(await m({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return C(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return D(void 0)},[T,o,e.memberProjects,C,m]),O=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();if(!r){z.add({type:`warning`,title:`Project title cannot be empty`});return}Xe(e.memberProjects.map(e=>e.title),r,n)&&await ee({title:r},`Failed to rename project`)},[e.memberProjects,ee]),[k,te]=x(!c),[N,I]=x(!c),[R,V]=(0,Q.useState)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useCallback)(async e=>{if(!H.current){H.current=!0,V(!0);try{await ee(e,`Failed to update project icon`)}finally{H.current=!1,V(!1)}}},[ee]),K=e.memberProjects.length>1,J=(0,Q.useCallback)(async r=>{if(T(r,`Failed to remove project`))return;let a=B();if(!a)return;let o=new Set(r.map(Qe)),s=p.filter(e=>o.has(`${e.environmentId}:${e.projectId}`)),c=r.length===e.memberProjects.length,l=t||!c?`checkout`:`project`,f=r.length===1?r[0]:null,m=f?.title??e.displayName,h=await j(()=>a.dialogs.confirm([s.length>0?`Remove ${l} "${m}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${l} "${m}"?`,...f?[`Path: ${f.workspaceRoot}`,...f.environmentLabel?[`Environment: ${f.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],c&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
3
- `),{variant:`destructive`}));if(h._tag===`Failure`||!h.value||T(r,`Failed to remove project`))return;let _=i.getState();for(let e of r){if(T([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=M(await g({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){C(`Failed to remove "${e.title}"`,n);return}let r=u(e.environmentId,e.id);await ie(r),ke(r,t.map(e=>d(e.environmentId,e.id)));let i=_.getDraftThreadByProjectRef(r);i&&_.clearDraftThread(i.draftId),_.clearProjectDraftThreadId(r)}c&&!t&&n({to:`/`,replace:!0})},[T,g,e.displayName,e.memberProjects.length,t,n,C,p]),Y=(0,$.jsx)(we,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(A,{size:`sm`,variant:`outline`,disabled:!s.has(e.environmentId),onClick:()=>void J([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Se,{className:`gap-6`,children:[(0,$.jsxs)(ve,{variant:`info`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(we,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[c?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(se,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!c,defaultValue:e.displayName,onChange:()=>{_.current=!0},onBlur:e=>{let t=_.current;_.current=!1,O(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:y?.kind===`lucide`?`${y.name} · ${y.color}`:y?.kind===`monogram`?`${y.text} · ${y.color}`:y?.kind===`emoji`?y.emoji:v??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(Ce,{label:`project icon`,disabled:R||!c,onClick:()=>void U({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(me,{project:f,className:`size-6`}),(0,$.jsx)(A,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:R||!c,onClick:()=>I(!0),children:`Choose icon`}),(0,$.jsx)(A,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:R||!c,onClick:()=>te(!0),children:`Choose file`})]})})]}),(0,$.jsx)(Re,{category:`project`}),(0,$.jsx)(qe,{}),K?Y:null,(0,$.jsx)(we,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(A,{size:`sm`,variant:`destructive-outline`,disabled:!c,onClick:()=>void J(e.memberProjects),children:[(0,$.jsx)(w,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(Ue,{cwd:f.workspaceRoot,environmentId:f.environmentId,onOpenChange:te,...S?{onPickExternal:()=>S(f.workspaceRoot)}:{},onSelect:e=>void U({faviconPath:e,projectIcon:null}),open:k&&c,projectName:e.displayName},`${f.environmentId}:${f.workspaceRoot}:${k}`),N&&c?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Ze,{current:y,projectName:f.title,open:!0,onOpenChange:I,onSelect:e=>void U({faviconPath:null,projectIcon:e})})}):null]})}function rt(){let e=(0,Be.c)(7),{search:t,scope:n}=ye(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)($e,{projectKey:t.project,environmentId:t.machine?p.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(Se,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(ze,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var it=rt;export{it as component};
4
- //# sourceMappingURL=settings.projects-DqNHL2Mx.js.map