@p4code/cli 0.8.34 → 0.8.37

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 (308) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CvWinVsO.mjs → binCli-mInzhqSL.mjs} +2242 -1476
  3. package/dist/client/.vite/manifest.json +2034 -2019
  4. package/dist/client/assets/{2NI2N5EU-Dlr3FZf7.js → 2NI2N5EU-DVsZziQ3.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-Cy2sjs8O.js → 4UO7MD6I-Cs3yBe-m.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-DaCwFaTp.js → 5B3SVYGG-CxW0L1iX.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-BVM9871F.js → 5GK6JWQ2-Cb25PEnx.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-BVMU2dmG.js → 5N7A7DKN-udLyT643.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-2tkjJ38q.js → 5OC2THR4-DqD-reis.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-BGTQzE2T.js → 5S6HY5KT-Cy7mIKKq.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-DMdx9ktL.js → 6IMQ5BUJ-Qu9PVsT7.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-B0TXT19U.js → 6OLKWJ4F-BYzZS9mf.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-Cukz2OUS.js → 74OO7NKP-h3ga2-vb.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-D3k2sZNm.js → 75O6YZUN-ByAK3P56.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-CjIq7P_x.js → 77XECAW3-D_lZqaZv.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-hf0OeD7n.js → ABYRPUBD-BPWfXZyu.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-CHpFDL1r.js → AnimatedHeight-D0-6CAPr.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-whDvSlDA.js → AuthSurfaceShell-30QvY1bI.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-RUQPN7sp.js → BB2UYUI2-CGgafKC2.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-f5Ez9vSp.js → BUM34MOA-Cn4iaSBT.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-C2ZheKpY.js → CEQABKGZ-CmBEfzh3.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-B0KvwGJk.js → CXAC5362-xibpmz3Y.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-DU3PVHJW.js +2 -0
  25. package/dist/client/assets/{ChatMarkdown-C2KOLN1s.js → ChatMarkdown-D-cNSjFn.js} +9 -9
  26. package/dist/client/assets/{CheckboxIndicator-zwVHomgm.js → CheckboxIndicator-CZCy38xt.js} +2 -2
  27. package/dist/client/assets/{ClippedText-Cx9jjhQp.js → ClippedText-D_rM_XDj.js} +2 -2
  28. package/dist/client/assets/{CodexSetupSection.logic-150217tr.js → CodexSetupSection.logic-g6_GE4bw.js} +2 -2
  29. package/dist/client/assets/{ComboboxClear-tzFhNwrk.js → ComboboxClear-tOmMpuVi.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-C1Icd2UF.js → ComboboxGroupLabel-CgZZIHwV.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-D9QqOlDX.js → CommandBlock-6rjypfVF.js} +2 -2
  32. package/dist/client/assets/ComposerPromptEditor-Dxfhec2W.js +204 -0
  33. package/dist/client/assets/{CompositeRoot-BD0GlRg8.js → CompositeRoot-Bsb8efI6.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-BQ3BFqRL.js → ConnectionDiagnosisDetails-Q0M5gCCf.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-DLQm_zZ7.js → ConnectionStatusDot-DAuD0jkU.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-vgHnaBR1.js → DRLTVNUE-BVseXOzv.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-BQAAF_8A.js → DYY6UVD2-Bz33D3dq.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-Yd3YuPQd.js → DevicePanel-CsSQr7vQ.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-DW4g9NNK.js → DeviceSetup-Cl7L9wsi.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-DCMYEIWZ.js → DialogTitle-bcvBtKP-.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-BLItJ7Ia.js → DiffCommentAnnotation-bhzNqujM.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-B1-D1WV6.js → DiffFileTree-BySeJqhq.js} +2 -2
  43. package/dist/client/assets/DiffPanel-CCFas4eA.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-BzkGX7xm.js → DiffWorkerPoolProvider-CkkqWbz-.js} +2 -2
  45. package/dist/client/assets/EmbeddedDesign-B4RMmwTG.css +1 -0
  46. package/dist/client/assets/EmbeddedDesign-iuThcPT3.js +21 -0
  47. package/dist/client/assets/{EnvironmentMachineIcon-5-erc8l_.js → EnvironmentMachineIcon-iUmoTUYt.js} +2 -2
  48. package/dist/client/assets/{ExpandableText-D2jzDgm7.js → ExpandableText-ByCx68yv.js} +2 -2
  49. package/dist/client/assets/{FNOVOB4O-CE98DPML.js → FNOVOB4O-DK3iet1g.js} +2 -2
  50. package/dist/client/assets/{FieldControl-CBMzQqd5.js → FieldControl-DtsEariK.js} +2 -2
  51. package/dist/client/assets/{FileDiff-2qSm00aV.js → FileDiff-Bu2BSqBV.js} +2 -2
  52. package/dist/client/assets/{FilePreviewPanel-Drpn6NuE.js → FilePreviewPanel-8cI8gciT.js} +4 -4
  53. package/dist/client/assets/{FoldedSettingsSection-Db7e_9rd.js → FoldedSettingsSection-RYq8GTvV.js} +2 -2
  54. package/dist/client/assets/{FormContext-BGRz6hhb.js → FormContext-CIK8MKa2.js} +2 -2
  55. package/dist/client/assets/{HDGCDEEZ-C0-Zci_l.js → HDGCDEEZ-B_J1N6RY.js} +2 -2
  56. package/dist/client/assets/{HSJLKHB7-4e5L-KC4.js → HSJLKHB7-B2SbZQUf.js} +2 -2
  57. package/dist/client/assets/{Icons-DwLGuyWf.js → Icons-xsXA_L6w.js} +2 -2
  58. package/dist/client/assets/Input-D3Qi4jCN.js +2 -0
  59. package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +1 -0
  60. package/dist/client/assets/{K3MD6TGW-Gi4s7ooz.js → K3MD6TGW-VU68yYxr.js} +2 -2
  61. package/dist/client/assets/{K7RP3OMA-BVc6P2bZ.js → K7RP3OMA-zaD_NBVC.js} +2 -2
  62. package/dist/client/assets/{KeybindingsSettings.logic-CU23l8mP.js → KeybindingsSettings.logic-BJe27xmi.js} +2 -2
  63. package/dist/client/assets/{LHDIQX7Q-DbBCFdJr.js → LHDIQX7Q-DCLqoRGy.js} +2 -2
  64. package/dist/client/assets/{LUXOKEGN-C4n0-A1h.js → LUXOKEGN-CmxZpSzC.js} +2 -2
  65. package/dist/client/assets/{MathTypeset--azkeKic.js → MathTypeset-Hhqwg4PF.js} +2 -2
  66. package/dist/client/assets/{N3JZAHOW-2wC96xvZ.js → N3JZAHOW-Cev8Cn9M.js} +2 -2
  67. package/dist/client/assets/{NUIALGQ3-Di1L_kRJ.js → NUIALGQ3-CV92Kt25.js} +2 -2
  68. package/dist/client/assets/{NoProjectsHero-CC3oMKUV.js → NoProjectsHero-CMqIlSNl.js} +2 -2
  69. package/dist/client/assets/{O65XPQGZ-BeKB0m-p.js → O65XPQGZ-bGyTGMsB.js} +2 -2
  70. package/dist/client/assets/{O7XIQ6OM-1wrcdCMc.js → O7XIQ6OM-DVdEfB1N.js} +2 -2
  71. package/dist/client/assets/{OFQON5FD-CsMmmhLT.js → OFQON5FD-Ca_CNS26.js} +2 -2
  72. package/dist/client/assets/{P4ConnectAccountPages-BDxb29bY.js → P4ConnectAccountPages-Buss2oTL.js} +2 -2
  73. package/dist/client/assets/{P4ConnectSidebarSignIn-Dp5OsZBa.js → P4ConnectSidebarSignIn-D1n4y6Gq.js} +2 -2
  74. package/dist/client/assets/{PJQHF43J-CY_GpbqJ.js → PJQHF43J-B__IdKwP.js} +2 -2
  75. package/dist/client/assets/PanelLayoutControls-EIunk_2Q.js +216 -0
  76. package/dist/client/assets/{PierreEntryIcon-B5tjtDkE.js → PierreEntryIcon-GQImyog1.js} +2 -2
  77. package/dist/client/assets/{PopoverHandle-CZh3pqXt.js → PopoverHandle-Cj5egwXv.js} +2 -2
  78. package/dist/client/assets/PreviewPanel-BkFeksTl.js +2 -0
  79. package/dist/client/assets/ProjectDefaultsSettings-DX2Kf-tx.js +2 -0
  80. package/dist/client/assets/{ProjectFavicon-CkSteHLT.js → ProjectFavicon-OMOnEzVu.js} +3 -3
  81. package/dist/client/assets/{ProjectIconPickerDialog-9heAZbVC.js → ProjectIconPickerDialog-Q4GkqwDs.js} +2 -2
  82. package/dist/client/assets/{ProjectMonogram-DIqp1OmB.js → ProjectMonogram-Br5sgd24.js} +2 -2
  83. package/dist/client/assets/{ProviderAuthTerminal-BSsraub7.js → ProviderAuthTerminal-Q584HoOn.js} +2 -2
  84. package/dist/client/assets/ProviderModelPicker-JNM9nJs_.js +2 -0
  85. package/dist/client/assets/{ProviderSettingsForm-CAFBbrfr.js → ProviderSettingsForm-CdiKhrJE.js} +2 -2
  86. package/dist/client/assets/PullRequestCodeTab-Co76Qf6Z.js +6 -0
  87. package/dist/client/assets/{RHNBAITX-BdiF8iR_.js → RHNBAITX-Oryl0UiR.js} +2 -2
  88. package/dist/client/assets/{ReadOnlySourcePreview-BXDLfPcr.js → ReadOnlySourcePreview-aUjexBVb.js} +2 -2
  89. package/dist/client/assets/{RenderErrorBoundary-CR2cHAQ5.js → RenderErrorBoundary-Oe5BzG3n.js} +3 -3
  90. package/dist/client/assets/{SLD4V6NK-Bo1z-c9S.js → SLD4V6NK-DbsINoTD.js} +2 -2
  91. package/dist/client/assets/ScheduledTasksSettings-1uXNtcPA.js +4 -0
  92. package/dist/client/assets/{ScopedSwitch-CX4FTGjy.js → ScopedSwitch-D8-FelRH.js} +2 -2
  93. package/dist/client/assets/{ScrollAreaCorner-BCdJHqsj.js → ScrollAreaCorner-nnFi-Ecx.js} +2 -2
  94. package/dist/client/assets/{SecretInput-BPPzPNI1.js → SecretInput-CqAhFuNO.js} +2 -2
  95. package/dist/client/assets/{SelectScrollUpArrow-CR3Z6_pf.js → SelectScrollUpArrow-BQJrvk31.js} +2 -2
  96. package/dist/client/assets/{SettingsPanels-DoJnxtp0.js → SettingsPanels-CNgY_ZPe.js} +6 -6
  97. package/dist/client/assets/{SettingsPanels.logic-t7cG-B6z.js → SettingsPanels.logic-Dr_NyHjE.js} +2 -2
  98. package/dist/client/assets/{SettingsScopeNotice-DD4QFo3v.js → SettingsScopeNotice-BFxCBOnl.js} +2 -2
  99. package/dist/client/assets/{T3PCR2KE-Cg6A465M.js → T3PCR2KE-2R1FY5zG.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-CWeCEb5C.js → TKWO2OVW-BjhIZzCe.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-DTjzxHgA.js → TSHNXIZL-B_cvoUct.js} +2 -2
  102. package/dist/client/assets/{ThemeEditorPanel-BwydY72w.js → ThemeEditorPanel-B7MiqZ90.js} +3 -3
  103. package/dist/client/assets/{ThreadTerminalDrawer-QTFG89J_.js → ThreadTerminalDrawer-DHoyxd6-.js} +4 -4
  104. package/dist/client/assets/TooltipViewport-ThbbZQDo.js +2 -0
  105. package/dist/client/assets/{UQJE5E4I-DS4MjKhw.js → UQJE5E4I-2r98lr05.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-Be1OZGok.js → USNYFO5S-CvTI5t_o.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-BpizRoFL.js → Virtualizer-BgcEI5KE.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-oFS2VG1Y.js → WEVWDWVA-U7ygIdf3.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-ckARUoj9.js → WorkspaceBreadcrumb-_zND61qF.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-D5yW7_av.js → WorkspacePageContainer-LYv_7Qc0.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-CTWcEH7d.js → WorkspacePageHeader-B_0ute56.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-Bjw0rDxX.js → X5RFHQXM-D4S0_b0W.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-BPHYY59t.js → X62E3GBT-CrIC4h9P.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-W72qCYdc.js → XBNEOJTC-D2_RQZjM.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-DA_drdwk.js → YHV2MVVZ-BmAcJLBt.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-CsfrwNLG.js → YURCZMG2-RCCTu3bv.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-dXCBipzg.js → YVG2LODB-Cvp0Ei-1.js} +2 -2
  118. package/dist/client/assets/_chat-CwO3_WVM.js +45 -0
  119. package/dist/client/assets/{_chat.design-KVMajkdX.js → _chat.design-DX1VqYkX.js} +2 -2
  120. package/dist/client/assets/{_chat.index-BknTP6QZ.js → _chat.index-Dzh3d42S.js} +2 -2
  121. package/dist/client/assets/{_chat.new-DLFV1XOJ.js → _chat.new-BHRvXFPr.js} +3 -3
  122. package/dist/client/assets/_chat.pull-requests-BZilN1TK.js +2 -0
  123. package/dist/client/assets/{alert-Dh8AVuLe.js → alert-BN-r9V4f.js} +2 -2
  124. package/dist/client/assets/{assetUrls-C6W2_00u.js → assetUrls-B6vsSVWR.js} +2 -2
  125. package/dist/client/assets/assets-CID0y4Uv.js +2 -0
  126. package/dist/client/assets/{browserHistoryStore-CeBJcpoN.js → browserHistoryStore-CK4YsfkQ.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-D5ew8rLG.js → browserLinkTarget-BJ30b4-s.js} +2 -2
  128. package/dist/client/assets/{checkbox-Y4v7A1IZ.js → checkbox-BJhN1L_L.js} +2 -2
  129. package/dist/client/assets/{color-picker-DEWeNc5K.js → color-picker-D2LwMwlZ.js} +2 -2
  130. package/dist/client/assets/{combobox-DGrx2JGy.js → combobox-Cw2-7qyI.js} +2 -2
  131. package/dist/client/assets/{command-DR1GjC1a.js → command-BIELTYJu.js} +2 -2
  132. package/dist/client/assets/composer-logic-P-jVPXi4.js +6 -0
  133. package/dist/client/assets/{composerDraftUploads-DK6jH0cB.js → composerDraftUploads-S66xDlS0.js} +2 -2
  134. package/dist/client/assets/{connect-B1NcR-kN.js → connect-D4llmZsa.js} +2 -2
  135. package/dist/client/assets/{connect-agent-BNrm24qs.js → connect-agent-BlR0FAbF.js} +2 -2
  136. package/dist/client/assets/{design-CbG6XJYX.js → design-Cdl1XCBU.js} +2 -2
  137. package/dist/client/assets/{device-6R-yC55P.js → device-Bc5H3PTz.js} +2 -2
  138. package/dist/client/assets/{dialog-BwjzOzO6.js → dialog-BRtKKGzk.js} +2 -2
  139. package/dist/client/assets/{diffRendering-CG_sb5me.js → diffRendering-DtBTalAD.js} +2 -2
  140. package/dist/client/assets/{dist-CFar2AY1.js → dist-oE_MNxpZ.js} +3 -3
  141. package/dist/client/assets/{draft-input-CpqOZR5i.js → draft-input-vviXwx5Q.js} +2 -2
  142. package/dist/client/assets/{duoViewer-BhE8QUaC.js → duoViewer-kcp00m8a.js} +2 -2
  143. package/dist/client/assets/{dynamic-CIBySV57.js → dynamic-C8_ODyue.js} +2 -2
  144. package/dist/client/assets/{embeddedScripts-B0vXhhvs.js → embeddedScripts-skldQmE1.js} +2 -2
  145. package/dist/client/assets/{empty-C0oiFHy_.js → empty-rC3eYvxq.js} +2 -2
  146. package/dist/client/assets/entities-B8Vupv5g.js +2 -0
  147. package/dist/client/assets/{fileLinks-CP5NWXaI.js → fileLinks-BoyzENAX.js} +2 -2
  148. package/dist/client/assets/{fileTreeExpansion-BKVd4HrC.js → fileTreeExpansion-DndrZZAD.js} +2 -2
  149. package/dist/client/assets/{getDiffFileInput-CIK5OMl_.js → getDiffFileInput-C1QBFdFu.js} +2 -2
  150. package/dist/client/assets/{guideRunStore-CegZr43-.js → guideRunStore-BgFFILxA.js} +2 -2
  151. package/dist/client/assets/{htmlRender-NqJI2UJ2.js → htmlRender-ddkOIEbT.js} +2 -2
  152. package/dist/client/assets/{index-Czsz7nXH.js → index-BwdieRvq.js} +3 -3
  153. package/dist/client/assets/{input-BCWES8Y7.js → input-BYd74ook.js} +2 -2
  154. package/dist/client/assets/{input-group-CfPOCEuC.js → input-group-DMFlSk_7.js} +2 -2
  155. package/dist/client/assets/{kbd-EDrgCOls.js → kbd-rp5mX21h.js} +2 -2
  156. package/dist/client/assets/{keybindings-BG7j7M7S.js → keybindings-B_kRk5Fi.js} +2 -2
  157. package/dist/client/assets/{lazy-D6W01WxZ.js → lazy-CeaQ3-Fj.js} +4 -4
  158. package/dist/client/assets/{lazyRouteComponent-B8CSLurY.js → lazyRouteComponent-COYyJY2H.js} +2 -2
  159. package/dist/client/assets/{link-COzhJ6br.js → link-CsXnX9WM.js} +2 -2
  160. package/dist/client/assets/{linkedPrompt-X4NBlFef.js → linkedPrompt-B5iI7U8H.js} +2 -2
  161. package/dist/client/assets/main-DdVSHl80.css +2 -0
  162. package/dist/client/assets/main-VfCRP294.js +29 -0
  163. package/dist/client/assets/{mediaReference-CKap6oNP.js → mediaReference-ZW7gfO5X.js} +2 -2
  164. package/dist/client/assets/{mediaSource-DG5l5-5f.js → mediaSource-DsT6G6Wm.js} +2 -2
  165. package/dist/client/assets/number-field-CEA6qXbs.js +2 -0
  166. package/dist/client/assets/{observeResize-BUAH1dvA.js → observeResize-DSyLC8QK.js} +2 -2
  167. package/dist/client/assets/{onboarding-CnVH7A6c.js → onboarding-BPkAEHBV.js} +2 -2
  168. package/dist/client/assets/{openFileInPreview-B0i3eZpu.js → openFileInPreview-CGM83ICx.js} +2 -2
  169. package/dist/client/assets/{p4ProjectFile-0RRo3hX4.js → p4ProjectFile-CwpteA7b.js} +2 -2
  170. package/dist/client/assets/{pair-B4KNAPh5.js → pair-D9v8gc0o.js} +2 -2
  171. package/dist/client/assets/{pendingSendStore-Dzn7x7Cg.js → pendingSendStore-BuEVrrEM.js} +2 -2
  172. package/dist/client/assets/{phoneViewer-RhpfiwR2.js → phoneViewer-CNE0SVmy.js} +2 -2
  173. package/dist/client/assets/{pierre-icons-Cisj4-__.js → pierre-icons-ChDlOt-h.js} +2 -2
  174. package/dist/client/assets/{popover-BnqKHl4L.js → popover-BjUpdrKu.js} +2 -2
  175. package/dist/client/assets/{preview-CiojYkh4.js → preview-3EscFepc.js} +2 -2
  176. package/dist/client/assets/{preview-Dwq2O7nm.js → preview-DHLYKEKb.js} +2 -2
  177. package/dist/client/assets/{previewMiniPlayerStore-ByZNhmNc.js → previewMiniPlayerStore-DHjQeV1U.js} +2 -2
  178. package/dist/client/assets/primary-NcsmRI6j.js +2 -0
  179. package/dist/client/assets/primaryCloudLinkState-DkXIVBHW.js +2 -0
  180. package/dist/client/assets/projectFilesQueryState-0jxJ50Qq.js +2 -0
  181. package/dist/client/assets/{projectScriptEditor-B4iSq27p.js → projectScriptEditor-CMGXoIEJ.js} +2 -2
  182. package/dist/client/assets/{providerSkills-C4Fu_qyq.js → providerSkills-4hnESoi_.js} +2 -2
  183. package/dist/client/assets/{pullRequestDetail.logic-BmYDDw_8.js → pullRequestDetail.logic-sbOM8yDW.js} +4 -4
  184. package/dist/client/assets/{pullRequestIcons-DFcQ9rtl.js → pullRequestIcons-B7Om_B_D.js} +2 -2
  185. package/dist/client/assets/{pullRequestReviewStore-BGzKslrq.js → pullRequestReviewStore-CIL8WfOG.js} +2 -2
  186. package/dist/client/assets/pullRequests-CMTRCOu7.js +2 -0
  187. package/dist/client/assets/queries-hhl_J8u9.js +2 -0
  188. package/dist/client/assets/query-CfGzD8v6.js +2 -0
  189. package/dist/client/assets/{radio-group-DOHTpBxX.js → radio-group-up2QNXjf.js} +2 -2
  190. package/dist/client/assets/{renderScheduler-Df4T8RWh.js → renderScheduler-Dgqqs-EX.js} +2 -2
  191. package/dist/client/assets/rightPanelStore-CGF0-d-1.js +2 -0
  192. package/dist/client/assets/runtime-Ca_Z-vg5.js +3 -0
  193. package/dist/client/assets/runtime-OeWFs5Hf.js +6 -0
  194. package/dist/client/assets/runtimeModeConfig-BTG9FTYe.js +2 -0
  195. package/dist/client/assets/{scheduledTasksSettings.logic-7E0KSnA7.js → scheduledTasksSettings.logic-BeuOnCov.js} +3 -3
  196. package/dist/client/assets/{scroll-area-B9LorBFb.js → scroll-area-BNQKEZbp.js} +2 -2
  197. package/dist/client/assets/{select-Ctq0UILH.js → select-D_zHR42Y.js} +2 -2
  198. package/dist/client/assets/selfImproveFindings-CAZ0j1GD.js +2 -0
  199. package/dist/client/assets/server-6nKYyc8r.js +2 -0
  200. package/dist/client/assets/{session-C7ckxjAM.js → session-BxUdP61p.js} +2 -2
  201. package/dist/client/assets/session-logic-Dr1plzXe.js +26 -0
  202. package/dist/client/assets/{settings-BqhxEPKC.js → settings-DE_hSu0q.js} +2 -2
  203. package/dist/client/assets/{settings.appearance-DljtCz6-.js → settings.appearance-C--uy4It.js} +2 -2
  204. package/dist/client/assets/settings.archived-D-55XnxQ.js +2 -0
  205. package/dist/client/assets/settings.computer-use-DhnqPqMm.js +2 -0
  206. package/dist/client/assets/settings.connections-BPVLazeK.js +2 -0
  207. package/dist/client/assets/{settings.data-controls-Cdccmn63.js → settings.data-controls-CIzGvqCI.js} +2 -2
  208. package/dist/client/assets/settings.decisions-CU-6rIpn.js +2 -0
  209. package/dist/client/assets/{settings.designs-TeCw-uLf.js → settings.designs-DHYhhG4k.js} +2 -2
  210. package/dist/client/assets/settings.diagnostics-csgW1_E8.js +2 -0
  211. package/dist/client/assets/{settings.general-uxwywmhh.js → settings.general-CeBkrL9-.js} +2 -2
  212. package/dist/client/assets/settings.integrations-DqSYBosl.js +2 -0
  213. package/dist/client/assets/{settings.keybindings-C0FBNk1_.js → settings.keybindings-C7D1i238.js} +2 -2
  214. package/dist/client/assets/{settings.open-source-licenses-wMwaYCss.js → settings.open-source-licenses-6oFDgAt7.js} +2 -2
  215. package/dist/client/assets/{settings.plugins-CFiDE3ms.js → settings.plugins-DfM65Xio.js} +4 -4
  216. package/dist/client/assets/{settings.projects-DN0n2td7.js → settings.projects-CeoZzdMW.js} +4 -4
  217. package/dist/client/assets/settings.providers-BBgppyE3.js +3 -0
  218. package/dist/client/assets/{settings.scheduled-tasks-uCL4Wgvt.js → settings.scheduled-tasks-Csi8wfij.js} +2 -2
  219. package/dist/client/assets/{settings.snap-shot-C4OHP0nR.js → settings.snap-shot-BdVdSIJy.js} +2 -2
  220. package/dist/client/assets/{settings.source-control-pMBspYC4.js → settings.source-control-Bme3qg7j.js} +2 -2
  221. package/dist/client/assets/{settings.storage-QCydiEyw.js → settings.storage-DTcg-0aj.js} +2 -2
  222. package/dist/client/assets/settingsLayout-4ySvFdXb.js +3 -0
  223. package/dist/client/assets/{sidebar-CRr8B41y.js → sidebar-CHDwV4Ca.js} +2 -2
  224. package/dist/client/assets/{sidebarProjectGrouping-miDXfjI3.js → sidebarProjectGrouping-BcOVY8p-.js} +2 -2
  225. package/dist/client/assets/{skeleton-C9J-Xl06.js → skeleton-BcLPbojY.js} +2 -2
  226. package/dist/client/assets/{sourceControl-C8nJMDiL.js → sourceControl-CPrl7cyO.js} +2 -2
  227. package/dist/client/assets/{sourceControlClients-DKONtKbZ.js → sourceControlClients-oNOd36Cq.js} +2 -2
  228. package/dist/client/assets/{spinner-CNva85zM.js → spinner-_ourbdVb.js} +2 -2
  229. package/dist/client/assets/{terminal-links-BJzLp7ix.js → terminal-links-DuZi4b83.js} +2 -2
  230. package/dist/client/assets/{terminalSessions-BPc8sBGR.js → terminalSessions-D0vbdqqx.js} +2 -2
  231. package/dist/client/assets/{textarea-DjRGRzMg.js → textarea-DlXXDHPJ.js} +2 -2
  232. package/dist/client/assets/{themePalette-fhKYLCuU.js → themePalette-VIM7Gehx.js} +3 -3
  233. package/dist/client/assets/toast-DXWclCrr.js +2 -0
  234. package/dist/client/assets/{toggle-Bbnow7xY.js → toggle-Dofc34s2.js} +2 -2
  235. package/dist/client/assets/{toggle-group-Cilo8czD.js → toggle-group-CYKsfBbD.js} +2 -2
  236. package/dist/client/assets/{tooltip-T5ePvxsH.js → tooltip-CY3W5y-f.js} +2 -2
  237. package/dist/client/assets/{uiStateStore-D9r3BNZ-.js → uiStateStore-CdkBStdp.js} +2 -2
  238. package/dist/client/assets/{usage-QBPLx2wr.js → usage-DQcgd75_.js} +2 -2
  239. package/dist/client/assets/{usageAccess-DUfVA8nU.js → usageAccess-CCSxXl9X.js} +2 -2
  240. package/dist/client/assets/{usageFormat-C-mTuUS7.js → usageFormat-ByjmRjTe.js} +2 -2
  241. package/dist/client/assets/{usageShortcuts-CB6TvooP.js → usageShortcuts-DOWm0Vo9.js} +2 -2
  242. package/dist/client/assets/{use-atom-command-BNkv9iyk.js → use-atom-command-vqjL7n-x.js} +2 -2
  243. package/dist/client/assets/{useAriaLabelledBy-D5HM2KLM.js → useAriaLabelledBy-B7FNFpmO.js} +2 -2
  244. package/dist/client/assets/{useHandleNewThread-DntRaFvm.js → useHandleNewThread-BYNZXzR_.js} +2 -2
  245. package/dist/client/assets/{useLocation-DbWity7H.js → useLocation-B_XV0lDx.js} +2 -2
  246. package/dist/client/assets/{useNavigate-Cxh24teV.js → useNavigate-BWqAWfiZ.js} +2 -2
  247. package/dist/client/assets/{useNavigateBack-B5mTfIHJ.js → useNavigateBack-C52nbvbb.js} +2 -2
  248. package/dist/client/assets/{useP4ConnectAuthPrompt-sjWWPvrn.js → useP4ConnectAuthPrompt-DKhdNYj8.js} +2 -2
  249. package/dist/client/assets/{useParams-D9PdK0IA.js → useParams-ekGanxxb.js} +2 -2
  250. package/dist/client/assets/{usePermissionStatus-D6i3IaCj.js → usePermissionStatus-CWV_yoZe.js} +2 -2
  251. package/dist/client/assets/{usePullRequestActions-9274Vp3W.js → usePullRequestActions-DxtkLQ5D.js} +3 -3
  252. package/dist/client/assets/{useRegisterFieldControl-DZyLTxKX.js → useRegisterFieldControl-BAJIcFiO.js} +2 -2
  253. package/dist/client/assets/{useScopedModelAvailability-CmlQi7Iz.js → useScopedModelAvailability-815e0x20.js} +2 -2
  254. package/dist/client/assets/useSettings-gPlpTIWi.js +3 -0
  255. package/dist/client/assets/utils-DhUt689t.js +37 -0
  256. package/dist/client/assets/vcsRefInvalidation-CW_MIqdt.js +2 -0
  257. package/dist/client/assets/{welcome-DVusCS_L.js → welcome-k7S47hyM.js} +2 -2
  258. package/dist/client/index.html +1 -1
  259. package/dist/{renderer-CJXpJ36b.mjs → renderer-Ay-1ojn7.mjs} +26 -3
  260. package/dist/{runtime-EqYv-lrV.mjs → runtime-bP6MSuMS.mjs} +150 -4
  261. package/package.json +2 -2
  262. package/dist/client/assets/AlertDialogRoot-BUODcEy9.js +0 -2
  263. package/dist/client/assets/ChatGptUsageButton-CMIjZ66V.js +0 -2
  264. package/dist/client/assets/ComposerPromptEditor-D2ObH3Py.js +0 -204
  265. package/dist/client/assets/DiffPanel-BGnRzWM8.js +0 -2
  266. package/dist/client/assets/EmbeddedDesign-BV_FcJ4l.js +0 -21
  267. package/dist/client/assets/EmbeddedDesign-Cud7UEy4.css +0 -1
  268. package/dist/client/assets/Input-DLaKk0qb.js +0 -2
  269. package/dist/client/assets/JZOYTAAL-SLYGD65P.js +0 -1
  270. package/dist/client/assets/PanelLayoutControls-CqeL3uQz.js +0 -216
  271. package/dist/client/assets/PreviewPanel-CvBQAq3I.js +0 -2
  272. package/dist/client/assets/ProjectDefaultsSettings-DLJfUN7i.js +0 -2
  273. package/dist/client/assets/ProviderModelPicker-AkULlCAn.js +0 -2
  274. package/dist/client/assets/PullRequestCodeTab-BamXVeZz.js +0 -6
  275. package/dist/client/assets/ScheduledTasksSettings-DF_KhqLx.js +0 -4
  276. package/dist/client/assets/TooltipViewport-C14m3uB7.js +0 -2
  277. package/dist/client/assets/_chat-BIqme2Hz.js +0 -46
  278. package/dist/client/assets/_chat.pull-requests-BDLRkW2A.js +0 -2
  279. package/dist/client/assets/assets-D-xsxvzf.js +0 -2
  280. package/dist/client/assets/composer-logic-BW4G8aDL.js +0 -6
  281. package/dist/client/assets/entities-Om5Klild.js +0 -2
  282. package/dist/client/assets/main-BGaSDXjP.js +0 -29
  283. package/dist/client/assets/main-BP1f3auf.css +0 -2
  284. package/dist/client/assets/number-field-DGdBjQD2.js +0 -2
  285. package/dist/client/assets/primary-CMwTDEi1.js +0 -2
  286. package/dist/client/assets/primaryCloudLinkState-2j4MjqVh.js +0 -2
  287. package/dist/client/assets/projectFilesQueryState-DXrTSOqg.js +0 -2
  288. package/dist/client/assets/pullRequests-DT0oG7tF.js +0 -2
  289. package/dist/client/assets/queries-CXgT6mki.js +0 -2
  290. package/dist/client/assets/query-DlK0I8Jc.js +0 -2
  291. package/dist/client/assets/rightPanelStore-DXw7-xK3.js +0 -2
  292. package/dist/client/assets/runtime-BL7IF4n-.js +0 -3
  293. package/dist/client/assets/runtime-Dm3Pi31_.js +0 -6
  294. package/dist/client/assets/runtimeModeConfig-_-kQoAWi.js +0 -2
  295. package/dist/client/assets/server-BvxyePeo.js +0 -2
  296. package/dist/client/assets/session-logic-P8gC-UQc.js +0 -26
  297. package/dist/client/assets/settings.archived-SsFK0IFf.js +0 -2
  298. package/dist/client/assets/settings.computer-use-CVmc70Ib.js +0 -2
  299. package/dist/client/assets/settings.connections-BrPlTKQ_.js +0 -2
  300. package/dist/client/assets/settings.decisions-pkwqjsKP.js +0 -2
  301. package/dist/client/assets/settings.diagnostics-BZD1uMGP.js +0 -2
  302. package/dist/client/assets/settings.integrations-Du282Gn7.js +0 -2
  303. package/dist/client/assets/settings.providers-DeUZZg7C.js +0 -3
  304. package/dist/client/assets/settingsLayout-DFYjWgKN.js +0 -3
  305. package/dist/client/assets/toast-BcjbmUtS.js +0 -2
  306. package/dist/client/assets/useSettings-BL4ZWGQV.js +0 -3
  307. package/dist/client/assets/utils-CrFJwxSd.js +0 -37
  308. package/dist/client/assets/vcsRefInvalidation-BPy1eoDi.js +0 -2
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$T as i,Bf as a,Cf as o,Ef as s,K_ as c,Kf as l,Qd as u,Qu as d,V_ as f,Zw as p,dp as m,dr as h,eE as g,ed as _,fr as v,nE as y,nf as b,oE as x,pd as S,qT as C,t as w,tf as ee,ts as T,ux as E,z_ as D}from"./utils-CrFJwxSd.js";import{R as te,W as ne}from"./runtime-Dm3Pi31_.js";import{f as O,l as k,p as A}from"./TooltipViewport-C14m3uB7.js";import{i as j,p as M}from"./toast-BcjbmUtS.js";import{D as N,q as re}from"./useSettings-BL4ZWGQV.js";import{f as P}from"./server-BvxyePeo.js";import{i as ie,n as ae,t as oe}from"./session-C7ckxjAM.js";import{n as se}from"./query-DlK0I8Jc.js";import{t as ce}from"./use-atom-command-BNkv9iyk.js";import{a as F,o as I,u as le}from"./timestampFormat-wac2e_Jz.js";import{a as L,n as R,t as z}from"./tooltip-T5ePvxsH.js";import{n as ue,t as de}from"./toggle-group-Cilo8czD.js";import{t as fe}from"./input-BCWES8Y7.js";import{t as B}from"./scroll-area-B9LorBFb.js";import{F as pe,V as me,i as he,s as V,u as H}from"./settingsLayout-DFYjWgKN.js";import{t as ge}from"./ConnectionStatusDot-DLQm_zZ7.js";import{Oa as _e,Ta as ve,Zt as U,vi as ye}from"./main-BGaSDXjP.js";import{t as be}from"./usageAccess-DUfVA8nU.js";import{t as xe}from"./ExpandableText-D2jzDgm7.js";import{t as W}from"./SettingsScopeNotice-DD4QFo3v.js";var G=n(),K=e(r(),1);function q(e){let t=(0,G.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,K.jsx)(L,{render:(0,K.jsx)(v,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(R,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,K.jsxs)(z,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,K.jsx)(L,{render:(0,K.jsx)(v,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(R,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,K.jsxs)(z,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var J=e(t(),1);function Se(e){let t=(0,G.c)(10),n=N(),r=e===void 0?n?.environmentId??null:e,i=ie(r,D),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:P.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=se(a),s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={reportFailure:!1},t[3]=s):s=t[3];let c=ce(P.retryResourceTelemetry,s),l;t[4]!==r||t[5]!==c?(l=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!ae(r,`environment:maintain`)||!ae(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await c({environmentId:r,input:{}});if(e._tag===`Failure`)throw p(e.cause);return e.value.snapshot},t[4]=r,t[5]=c,t[6]=l):l=t[6];let u=l,d;return t[7]!==o||t[8]!==u?(d={...o,retry:u},t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Ce(e,t){let n=(0,G.c)(4),r=N(),i=t===void 0?r?.environmentId??null:t,a=ie(i,D),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:P.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],se(o)}function Y(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function we(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=Y(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(Y(n))&&i(n.identity.pid);return e.filter(e=>!r.has(Y(e)))}function Te(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function X(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function Ee(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var De=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function Oe(e){return`${U(e)}/s`}function ke(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function Ae(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function je(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Me(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Fe(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Ie(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Le(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function Re(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function ze(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Be(e){let t=(0,G.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??ze(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=w(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=w(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;t[13]===g?_=t[14]:(_=(0,K.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,K.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function Ve(e){let t=(0,G.c)(9),{sampledAt:n}=e;if(H(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=F(E(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,K.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function He(e){let t=(0,G.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,K.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,K.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=w(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,K.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,K.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,K.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function Ue(e){let t=(0,G.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=w(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,K.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,K.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,K.jsx)(We,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=U(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(We,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=Oe(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let _;t[22]===g?_=t[23]:(_=(0,K.jsx)(We,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=Oe(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,K.jsx)(We,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,K.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,K.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function We(e){let t=(0,G.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,K.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ge(e){let t=(0,G.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&C(r.lastError,Je),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let a=i,o;t[3]===n?o=t[4]:(o=(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=o);let s;t[5]!==a||t[6]!==r.lastError?(s=a?`Available when this page runs inside the desktop app.`:x(r.lastError,{onNone:qe,onSome:Ke}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let c;t[8]===s?c=t[9]:(c=(0,K.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=c);let l;t[10]!==o||t[11]!==c?(l=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12];let u;t[13]===a?u=t[14]:(u=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=u);let d;t[15]!==r.status||t[16]!==u?(d=(0,K.jsx)(Be,{label:``,status:r.status,presentation:u}),t[15]=r.status,t[16]=u,t[17]=d):d=t[17];let f;return t[18]!==l||t[19]!==d?(f=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20],f}function Ke(e){return e}function qe(){return`No reported errors`}function Je(e){return e.includes(`'web' mode`)}function Ye(e){let t=(0,G.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=w(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,K.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Xe(e){let t=(0,G.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=De.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=De.map(Ze),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,K.jsx)(ue,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ze(e){return(0,K.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Qe(e){let t=(0,G.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=Ee(n),s=Math.max(1,...n.map($e));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=X({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=X({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=X({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,K.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,K.jsx)(R,{side:`top`,className:`text-left`,children:(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,K.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`div`,{children:[`Read `,U(t.ioReadBytes)]}),(0,K.jsxs)(`div`,{children:[`Write `,U(t.ioWriteBytes)]})]})})]},E(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,K.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,K.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function $e(e){return e.ioReadBytes+e.ioWriteBytes}function et(e){let t=(0,G.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Pe(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,K.jsx)(k,{className:`size-3.5`,icon:r?A:O})}):(0,K.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=w(`size-1.5 rounded-full`,Ie(n.category)),t[10]=n.category,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,K.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=p);let m=n.command||n.name,g;t[16]===m?g=t[17]:(g=(0,K.jsx)(R,{side:`top`,variant:`code`,children:m}),t[16]=m,t[17]=g);let _;t[18]!==p||t[19]!==g?(_=(0,K.jsxs)(z,{children:[p,g]}),t[18]=p,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==f?(v=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,f,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=f,t[25]=v):v=t[25],v}function tt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function nt(e){let t=(0,G.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!tt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Me(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,K.jsx)(q,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function rt(e){let t=(0,G.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,J.useState)(it),c;t[0]!==o||t[1]!==n?(c=we(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Me(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[20%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[7%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[6%]`}),(0,K.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,K.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,K.jsx)(et,{process:e,collapsed:o.has(Me(e)),onToggle:d})}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Fe(e.category)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:ke(e.cpuTimeMs)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:U(e.residentBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:Oe(e.ioReadBytesPerSecond)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:Oe(e.ioWriteBytesPerSecond)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:U(e.ioReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{children:U(e.ioWriteBytes)})}),(0,K.jsx)(R,{side:`top`,children:Le(e.ioSemantics)})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,K.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,K.jsx)(nt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Me(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function it(){return new Set}function at(e){let t=(0,G.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[7%]`}),(0,K.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ot),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ot(e){return(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,K.jsx)(R,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Fe(e.category)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:ke(e.cpuTimeMs)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:U(e.peakRssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:U(e.ioReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:U(e.ioWriteBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Ne(e))}function st(e){let t=(0,G.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[22%]`}),(0,K.jsx)(`col`,{className:`w-[28%]`}),(0,K.jsx)(`col`,{className:`w-[14%]`}),(0,K.jsx)(`col`,{className:`w-[14%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ct),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,K.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ct(e){return(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:U(e.logicalReadBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:U(e.logicalWriteBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2),`s`]})]},`${e.component}:${e.operation}`)}function lt(e){let t=(0,G.c)(207),{environmentId:n}=e,[r,o]=(0,J.useState)(9e5),c;t[0]===r?c=t[1]:(c=De.find(e=>e.windowMs===r)??De[1],t[0]=r,t[1]=c);let l=c,u=ie(n,f),p=Se(n),v=p.retry,y;t[2]!==l.bucketMs||t[3]!==l.windowMs?(y={windowMs:l.windowMs,bucketMs:l.bucketMs},t[2]=l.bucketMs,t[3]=l.windowMs,t[4]=y):y=t[4];let C=Ce(y,n),w;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(w={reportFailure:!1},t[5]=w):w=t[5];let T=ce(P.signalProcess,w),[E,D]=(0,J.useState)(mt),O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=new Set,t[6]=O):O=t[6];let k=(0,J.useRef)(O),A=(0,J.useRef)(n),M,N;t[7]===n?(M=t[8],N=t[9]):(M=()=>(A.current=n,()=>{A.current=null}),N=[n],t[7]=n,t[8]=M,t[9]=N),(0,J.useEffect)(M,N);let[oe,se]=(0,J.useState)(!1),F=p.data,I=F?.groups.allP4,le;t[10]===T?le=t[11]:(le=async(e,t)=>{let n=A.current;if(n===null||!ae(n,`environment:maintain`))return;let r=Me(e);if(k.current.has(r))return;let a=new Set(k.current).add(r);k.current=a,D(a);let o=()=>{let e=new Set(k.current);e.delete(r),k.current=e,D(e)};if(t===`SIGKILL`){let n;try{n=await re().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;o(),j.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){o();return}}if(A.current!==n||!ae(n,`environment:maintain`)){o();return}T({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(te(n))return;throw ne(n)}n.value.signaled||j.add({type:`error`,title:`Could not send ${t}`,description:i(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{j.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{o()})},t[10]=T,t[11]=le);let ue=le,de;t[12]===v?de=t[13]:(de=()=>{let e=A.current;e!==null&&ae(e,`environment:maintain`)&&(se(!0),v().catch(pt).finally(()=>{se(!1)}))},t[12]=v,t[13]=de);let fe=de,B,pe,me,he,H,ge,ve,ye,be,xe,W,q,Y,we,X,Ee,Ne,Pe,Fe;if(t[14]!==I||t[15]!==F||t[16]!==p.error||t[17]!==p.isPending||t[18]!==p.refresh){H=F?g(F.speedLimitPercent):null;let e=F?.health.native.status??null,n;t[38]!==e||t[39]!==p.error?(n=Te({nativeStatus:e,error:p.error}),t[38]=e,t[39]=p.error,t[40]=n):n=t[40],me=n,he=F!==null&&(F.power.onBattery!==`unknown`||F.power.lowPowerMode!==`unknown`||F.power.idle!==`unknown`||F.power.locked!==`unknown`||F.power.thermalState!==`unknown`),pe=V,Ee=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(d,{className:`size-4 text-muted-foreground`}),t[41]=Ne):Ne=t[41];let r;t[42]===F?r=t[43]:(r=F?(0,K.jsx)(Be,{label:`Native`,status:F.health.native.status}):null,t[42]=F,t[43]=r);let i=F?.readAt??null,o;t[44]===i?o=t[45]:(o=(0,K.jsx)(Ve,{sampledAt:i}),t[44]=i,t[45]=o);let c;t[46]===p.isPending?c=t[47]:(c=(0,K.jsx)(_e,{size:`xs`,refreshing:p.isPending}),t[46]=p.isPending,t[47]=c);let l;t[48]!==c||t[49]!==p.isPending||t[50]!==p.refresh?(l=(0,K.jsx)(L,{render:(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost`,disabled:p.isPending,onClick:p.refresh,"aria-label":`Refresh resource telemetry`,children:c})}),t[48]=c,t[49]=p.isPending,t[50]=p.refresh,t[51]=l):l=t[51];let u;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(R,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=u):u=t[52];let f;t[53]===l?f=t[54]:(f=(0,K.jsxs)(z,{children:[l,u]}),t[53]=l,t[54]=f),t[55]!==r||t[56]!==o||t[57]!==f?(Pe=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,o,f]}),t[55]=r,t[56]=o,t[57]=f,t[58]=Pe):Pe=t[58],we=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let _;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),t[59]=_):_=t[59];let v;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,K.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=v):v=t[60];let y;t[61]===F?y=t[62]:(y=F?je(F.sampleIntervalMs):`...`,t[61]=F,t[62]=y),t[63]===y?X=t[64]:(X=(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[_,(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[v,`Sampling every `,y]})]}),t[63]=y,t[64]=X),ye=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let x;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,K.jsx)(ee,{className:`size-3.5`}),t[65]=x):x=t[65];let S;t[66]===I?S=t[67]:(S=I?`${I.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=I,t[67]=S);let C;t[68]===I?C=t[69]:(C=I?`${ke(I.cpuTimeMs)} observed CPU time`:void 0,t[68]=I,t[69]=C),t[70]!==S||t[71]!==C?(be=(0,K.jsx)(He,{icon:x,label:`Current CPU`,value:S,detail:C}),t[70]=S,t[71]=C,t[72]=be):be=t[72];let w;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(m,{className:`size-3.5`}),t[73]=w):w=t[73];let T;t[74]===I?T=t[75]:(T=I?U(I.currentRssBytes):`...`,t[74]=I,t[75]=T);let E;t[76]===I?E=t[77]:(E=I?`${U(I.peakRssBytes)} combined process peaks`:void 0,t[76]=I,t[77]=E),t[78]!==T||t[79]!==E?(xe=(0,K.jsx)(He,{icon:w,label:`Resident memory`,value:T,detail:E}),t[78]=T,t[79]=E,t[80]=xe):xe=t[80];let D;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,K.jsx)(d,{className:`size-3.5`}),t[81]=D):D=t[81];let te=I?String(I.processCount):`...`,ne=I?`${I.processStarts} starts · ${I.processExits} exits`:void 0;t[82]!==te||t[83]!==ne?(W=(0,K.jsx)(He,{icon:D,label:`Process count`,value:te,detail:ne}),t[82]=te,t[83]=ne,t[84]=W):W=t[84];let O;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(a,{className:`size-3.5`}),t[85]=O):O=t[85];let k;t[86]===I?k=t[87]:(k=I?Oe(I.ioReadBytesPerSecond):`...`,t[86]=I,t[87]=k);let A;t[88]===I?A=t[89]:(A=I?`${U(I.ioReadBytes)} observed`:void 0,t[88]=I,t[89]=A),t[90]!==k||t[91]!==A?(q=(0,K.jsx)(He,{icon:O,label:`Read throughput`,value:k,detail:A}),t[90]=k,t[91]=A,t[92]=q):q=t[92];let j;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(b,{className:`size-3.5`}),t[93]=j):j=t[93];let M;t[94]===I?M=t[95]:(M=I?Oe(I.ioWriteBytesPerSecond):`...`,t[94]=I,t[95]=M);let N;t[96]===I?N=t[97]:(N=I?`${U(I.ioWriteBytes)} observed`:void 0,t[96]=I,t[97]=N);let re=I&&I.ioWriteBytesPerSecond>=10485760?`danger`:I&&I.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==M||t[99]!==N||t[100]!==re?(Y=(0,K.jsx)(He,{icon:j,label:`Write throughput`,value:M,detail:N,tone:re}),t[98]=M,t[99]=N,t[100]=re,t[101]=Y):Y=t[101],B=He,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,K.jsx)(s,{className:`size-3.5`}),t[102]=Fe):Fe=t[102],ge=`CPU speed limit`,ve=F?H===null?`Unknown`:`${H.toFixed(0)}%`:`...`,t[14]=I,t[15]=F,t[16]=p.error,t[17]=p.isPending,t[18]=p.refresh,t[19]=B,t[20]=pe,t[21]=me,t[22]=he,t[23]=H,t[24]=ge,t[25]=ve,t[26]=ye,t[27]=be,t[28]=xe,t[29]=W,t[30]=q,t[31]=Y,t[32]=we,t[33]=X,t[34]=Ee,t[35]=Ne,t[36]=Pe,t[37]=Fe}else B=t[19],pe=t[20],me=t[21],he=t[22],H=t[23],ge=t[24],ve=t[25],ye=t[26],be=t[27],xe=t[28],W=t[29],q=t[30],Y=t[31],we=t[32],X=t[33],Ee=t[34],Ne=t[35],Pe=t[36],Fe=t[37];let Ie=F?`${F.power.thermalState} thermal state`:void 0,Le=H!==null&&H<80?`warning`:`default`,ze;t[103]!==B||t[104]!==ge||t[105]!==ve||t[106]!==Ie||t[107]!==Le||t[108]!==Fe?(ze=(0,K.jsx)(B,{icon:Fe,label:ge,value:ve,detail:Ie,tone:Le}),t[103]=B,t[104]=ge,t[105]=ve,t[106]=Ie,t[107]=Le,t[108]=Fe,t[109]=ze):ze=t[109];let We;t[110]!==ye||t[111]!==be||t[112]!==xe||t[113]!==W||t[114]!==q||t[115]!==Y||t[116]!==ze?(We=(0,K.jsxs)(`div`,{className:ye,children:[be,xe,W,q,Y,ze]}),t[110]=ye,t[111]=be,t[112]=xe,t[113]=W,t[114]=q,t[115]=Y,t[116]=ze,t[117]=We):We=t[117];let Ke;t[118]===p.error?Ke=t[119]:(Ke=p.error?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:p.error})]}):null,t[118]=p.error,t[119]=Ke);let qe;t[120]===F?qe=t[121]:(qe=F?(0,K.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,K.jsx)(Ue,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:F.groups.backend}),(0,K.jsx)(Ue,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:F.groups.electron}),(0,K.jsx)(Ue,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:F.groups.monitor})]}):null,t[120]=F,t[121]=qe);let Je;t[122]!==we||t[123]!==X||t[124]!==We||t[125]!==Ke||t[126]!==qe?(Je=(0,K.jsxs)(`div`,{className:we,children:[X,We,Ke,qe]}),t[122]=we,t[123]=X,t[124]=We,t[125]=Ke,t[126]=qe,t[127]=Je):Je=t[127];let Ze;t[128]!==pe||t[129]!==Ee||t[130]!==Ne||t[131]!==Pe||t[132]!==Je?(Ze=(0,K.jsx)(pe,{title:Ee,icon:Ne,headerAction:Pe,children:Je}),t[128]=pe,t[129]=Ee,t[130]=Ne,t[131]=Pe,t[132]=Je,t[133]=Ze):Ze=t[133];let $e;t[134]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,K.jsx)(s,{className:`size-4 text-muted-foreground`}),t[134]=$e):$e=t[134];let et;t[135]!==me||t[136]!==oe||t[137]!==fe?(et=me?(0,K.jsxs)(h,{size:`xs`,variant:`outline`,disabled:oe,onClick:fe,children:[(0,K.jsx)(_e,{size:`xs`,refreshing:oe}),`Retry monitor`]}):null,t[135]=me,t[136]=oe,t[137]=fe,t[138]=et):et=t[138];let tt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,K.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,K.jsx)(S,{className:`size-3.5`})}),`Host state`]}),t[139]=tt):tt=t[139];let nt;t[140]!==he||t[141]!==F?(nt=(0,K.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[tt,he&&F?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ye,{label:`Power source`,value:Re(F.power.onBattery,{true:`Battery`,false:`External power`})}),(0,K.jsx)(Ye,{label:`Low power mode`,value:Re(F.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,K.jsx)(Ye,{label:`Idle`,value:`${Re(F.power.idle,{true:`Idle`,false:`Active`})}${F.power.idleSeconds===null?``:` · ${Math.round(F.power.idleSeconds)}s`}`}),(0,K.jsx)(Ye,{label:`Session`,value:F.power.suspended?`Suspended`:Re(F.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,K.jsx)(Ye,{label:`Thermal`,value:F.power.thermalState,valueClassName:F.power.thermalState===`serious`||F.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,K.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,K.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),t[140]=he,t[141]=F,t[142]=nt):nt=t[142];let it;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,K.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,K.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),t[143]=it):it=t[143];let ot;t[144]===F?ot=t[145]:(ot=(0,K.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[it,F?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ge,{label:`Native process monitor`,health:F.health.native}),(0,K.jsx)(Ge,{label:`Electron main process`,health:F.health.desktop}),(0,K.jsx)(Ye,{label:`Collection time`,value:Ae(F.health.collectionDurationMicros)}),(0,K.jsx)(Ye,{label:`Process scan`,value:`${F.health.retainedProcessCount}/${F.health.scannedProcessCount} retained`}),(0,K.jsx)(Ye,{label:`Inaccessible`,value:String(F.health.inaccessibleProcessCount),valueClassName:F.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,K.jsx)(Ye,{label:`Sidecar`,value:x(F.health.sidecarVersion,{onNone:ft,onSome:e=>`${e}${x(F.health.sidecarPid,{onNone:dt,onSome:ut})}`})}),(0,K.jsx)(Ye,{label:`Restarts`,value:String(F.health.restartCount)})]}):(0,K.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=F,t[145]=ot);let ct;t[146]!==nt||t[147]!==ot?(ct=(0,K.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[nt,ot]}),t[146]=nt,t[147]=ot,t[148]=ct):ct=t[148];let lt;t[149]!==et||t[150]!==ct?(lt=(0,K.jsx)(V,{title:`Host & collection`,icon:$e,headerAction:et,children:ct}),t[149]=et,t[150]=ct,t[151]=lt):lt=t[151];let ht;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,K.jsx)(a,{className:`size-4 text-muted-foreground`}),t[152]=ht):ht=t[152];let gt;t[153]===r?gt=t[154]:(gt=(0,K.jsx)(Xe,{selectedWindowMs:r,onSelect:o}),t[153]=r,t[154]=gt);let _t;t[155]===C.isPending?_t=t[156]:(_t=(0,K.jsx)(_e,{size:`xs`,refreshing:C.isPending}),t[155]=C.isPending,t[156]=_t);let vt;t[157]!==C.isPending||t[158]!==C.refresh||t[159]!==_t?(vt=(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost`,disabled:C.isPending,onClick:C.refresh,"aria-label":`Refresh resource history`,children:_t}),t[157]=C.isPending,t[158]=C.refresh,t[159]=_t,t[160]=vt):vt=t[160];let yt;t[161]!==gt||t[162]!==vt?(yt=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[gt,vt]}),t[161]=gt,t[162]=vt,t[163]=yt):yt=t[163];let bt;t[164]===C.error?bt=t[165]:(bt=C.error?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:C.error})]}):null,t[164]=C.error,t[165]=bt);let Z;t[166]===C.data?.buckets?Z=t[167]:(Z=C.data?.buckets??[],t[166]=C.data?.buckets,t[167]=Z);let Q;t[168]===Z?Q=t[169]:(Q=(0,K.jsx)(Qe,{buckets:Z}),t[168]=Z,t[169]=Q);let xt;t[170]===C.data?.topProcesses?xt=t[171]:(xt=C.data?.topProcesses??[],t[170]=C.data?.topProcesses,t[171]=xt);let St;t[172]===xt?St=t[173]:(St=(0,K.jsx)(at,{processes:xt}),t[172]=xt,t[173]=St);let Ct;t[174]!==bt||t[175]!==Q||t[176]!==St?(Ct=(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[bt,Q,St]}),t[174]=bt,t[175]=Q,t[176]=St,t[177]=Ct):Ct=t[177];let wt;t[178]!==yt||t[179]!==Ct?(wt=(0,K.jsx)(V,{title:`Resource timeline`,icon:ht,headerAction:yt,children:Ct}),t[178]=yt,t[179]=Ct,t[180]=wt):wt=t[180];let Tt;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,K.jsx)(ee,{className:`size-4 text-muted-foreground`}),t[181]=Tt):Tt=t[181];let $;t[182]===F?$=t[183]:($=F?(0,K.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,K.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=F,t[183]=$);let Et;t[184]===F?.processes?Et=t[185]:(Et=F?.processes??[],t[184]=F?.processes,t[185]=Et);let Dt;t[186]!==u||t[187]!==ue||t[188]!==E||t[189]!==Et?(Dt=(0,K.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,K.jsx)(rt,{processes:Et,canMaintainEnvironment:u,signalingKeys:E,onSignal:ue})}),t[186]=u,t[187]=ue,t[188]=E,t[189]=Et,t[190]=Dt):Dt=t[190];let Ot;t[191]!==$||t[192]!==Dt?(Ot=(0,K.jsx)(V,{title:`Live process tree`,icon:Tt,headerAction:$,children:Dt}),t[191]=$,t[192]=Dt,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,K.jsx)(b,{className:`size-4 text-muted-foreground`}),At=(0,K.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),t[194]=kt,t[195]=At):(kt=t[194],At=t[195]);let jt;t[196]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,K.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),t[196]=jt):jt=t[196];let Mt;t[197]===F?.attribution.entries?Mt=t[198]:(Mt=F?.attribution.entries??[],t[197]=F?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,K.jsx)(V,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,K.jsx)(st,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Ze||t[202]!==lt||t[203]!==wt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,K.jsxs)(K.Fragment,{children:[Ze,lt,wt,Ot,Nt]}),t[201]=Ze,t[202]=lt,t[203]=wt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function ut(e){return` · PID ${e}`}function dt(){return``}function ft(){return`Unavailable`}function pt(e){j.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function mt(){return new Set}var ht=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],gt=e=>/^https?:\/\/./i.test(e);function _t(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function vt(){let e=(0,G.c)(3),{environment:t,scope:n}=me();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,K.jsx)(W,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,K.jsx)(yt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function yt(){let{environment:e}=me(),t=pe(e=>e.observability),[n,r]=(0,J.useState)({}),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),c=e?.environmentId,l=T(P.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,f]=(0,J.useState)(()=>Object.fromEntries(ht.filter(({key:e})=>gt(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),p=ce(P.updateSettings,{reportFailure:!0}),m=ce(P.checkOtlpEndpoint),g={...t,...n},_=ht.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await m({environmentId:c,input:{signal:t,url:n}});f(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},x=(e,t,n)=>{gt(n)&&(f(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},S=(0,J.useEffectEvent)(()=>{for(let{key:e,signal:t}of ht){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,J.useEffect)(()=>{u&&S()},[u]),(0,K.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,K.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await p({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!l&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),ht.map(({key:e,label:n,signal:a})=>{let o=g[e].trim(),c=u?_t(o,d[e]):null;return(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,K.jsx)(ge,{dotClassName:c.dot}),(0,K.jsxs)(ye,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(fe,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,K.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,disabled:!gt(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,K.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,K.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,K.jsx)(h,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of ht)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,K.jsx)(h,{type:`submit`,size:`xs`,disabled:!v||i||!l,children:i?`Saving…`:`Save`})]})]})]})})}var bt=new Intl.NumberFormat;function Z(e){return bt.format(e)}function Q(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function xt(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function St(e){return e?I(E(e)):`No trace records`}function Ct(e){return St(e).replaceAll(` `,`\xA0`)}function wt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Tt(e){return e?.includes(`not a live descendant`)??!1}function $(e){let t=(0,G.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let c;t[2]!==n||t[3]!==i?(c=i?(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,K.jsx)(l,{className:`size-3`})})}),(0,K.jsx)(R,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=c):c=t[4];let u;t[5]!==s||t[6]!==c?(u=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=u):u=t[7];let d=o===`warning`&&`text-warning-foreground`,f=o===`danger`&&`text-destructive`,p;t[8]!==d||t[9]!==f?(p=w(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,d,f),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]!==p||t[12]!==r?(m=(0,K.jsx)(`div`,{className:p,children:r}),t[11]=p,t[12]=r,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,K.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}function Et(e){let t=(0,G.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,K.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,K.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function Dt(e){let t=(0,G.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function Ot(e){let t=(0,G.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=w(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,K.jsx)(`colgroup`,{children:n.map((e,t)=>(0,K.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,K.jsx)(`th`,{className:w(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,K.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,K.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function kt(e){let t=(0,G.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:a}=M(r),o;t[1]===n?o=t[2]:(o=wt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,K.jsx)(R,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,K.jsxs)(z,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let d=a?`Copied trace ID`:`Copy trace ID`,f;t[10]!==i||t[11]!==n?(f=()=>i(n),t[10]=i,t[11]=n,t[12]=f):f=t[12];let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(u,{className:`size-3`}),t[13]=p):p=t[13];let m;t[14]!==d||t[15]!==f?(m=(0,K.jsx)(L,{render:(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":d,onClick:f,children:p})}),t[14]=d,t[15]=f,t[16]=m):m=t[16];let g=a?`Copied`:`Copy full trace ID`,_;t[17]===g?_=t[18]:(_=(0,K.jsx)(R,{side:`top`,children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==m?(v=(0,K.jsxs)(z,{children:[m,_]}),t[19]=_,t[20]=m,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l?(y=(0,K.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,v]}),t[22]=v,t[23]=l,t[24]=y):y=t[24],y}function At(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function jt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Mt(e){let t=(0,G.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=At(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,K.jsx)(h,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,K.jsx)(k,{className:`size-3.5`,icon:r?O:A})}):(0,K.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=f);let p;t[13]===n.command?p=t[14]:(p=(0,K.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let m;t[15]!==f||t[16]!==p?(m=(0,K.jsxs)(z,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=m):m=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==m?(g=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,m]}),t[18]=l,t[19]=u,t[20]=m,t[21]=g):g=t[21],g}function Nt(e){let t=(0,G.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,J.useState)(Pt),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[33%]`}),(0,K.jsx)(`col`,{className:`w-[8%]`}),(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,K.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,K.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:xt(e.rssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,K.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,K.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,K.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,K.jsx)(q,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Pt(){return new Set}var Ft=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function It(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Lt(e){let t=At(e);return t.length>42?`${t.slice(0,39)}...`:t}function Rt(e){let t=(0,G.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Lt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=w(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,K.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,K.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,K.jsxs)(z,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function zt(e){let t=(0,G.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Bt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,K.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,K.jsxs)(R,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},E(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,K.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,K.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Bt(e){return e.maxCpuPercent}function Vt(e){let t=(0,G.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=Ft.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Ft.map(Ht),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,K.jsx)(ue,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ht(e){return(0,K.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,G.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`}),(0,K.jsx)(`col`,{className:`w-[16%]`}),(0,K.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,K.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,K.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,K.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,K.jsx)(`tr`,{children:(0,K.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,K.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,K.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,K.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:xt(e.maxRssBytes)}),(0,K.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,K.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,K.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,K.jsx)(`div`,{className:`border-t border-border/60`,children:(0,K.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,K.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Wt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Gt(e){let t=(0,G.c)(7),{checkedAt:n}=e;H();let r;t[0]===n?r=t[1]:(r=le(n?E(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,K.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,K.jsxs)(K.Fragment,{children:[`Checked `,(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,K.jsxs)(K.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Kt(e){let t=(0,G.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,K.jsx)(_e,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,K.jsx)(L,{render:(0,K.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,K.jsx)(R,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,K.jsxs)(z,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=me(),t=e?.environmentId??null,n=ie(t,f),r=e?.serverConfig?.observability,a=e?.serverConfig?.availableEditors,s=ie(t,c),l=se(t===null?null:oe.sessionStateAtom(t)),u=be({connectionPhase:e?.connection.phase??`available`,session:l.data,hasSessionError:l.error!==null}),d=u.canReadDiagnostics,p=ce(P.signalProcess,{reportFailure:!1}),m=ve(t,a??[]),[v,b]=(0,J.useState)(9e5),x=Ft.find(e=>e.windowMs===v)??Ft[1],{data:S,error:C,isPending:ee,refresh:T}=se(t===null||!d?null:P.traceDiagnostics({environmentId:t,input:{}})),{data:D,error:O,isPending:k,refresh:A}=se(t===null||!d?null:P.processDiagnostics({environmentId:t,input:{}})),{data:M,error:N,isPending:F,refresh:I}=se(t===null||!d?null:P.processResourceHistory({environmentId:t,input:{windowMs:x.windowMs,bucketMs:x.bucketMs}})),[le,ue]=(0,J.useState)(!1),[de,fe]=(0,J.useState)(null),[pe,H]=(0,J.useState)(null),ge=(0,J.useRef)(null),_e=(0,J.useRef)(t),U=(0,J.useRef)(D);(0,J.useEffect)(()=>{U.current=D},[D]),(0,J.useEffect)(()=>(_e.current=t,()=>{_e.current=null}),[t]);let ye=(0,J.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&ae(t,`orchestration:operate`)&&(ue(!0),fe(null),(async()=>{let t=await m(e);if(ue(!1),t._tag===`Failure`&&!te(t)){let e=ne(t);fe(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,m]),W=ee&&S===null,G=k&&D===null,q=F&&M===null,[Se,Ce]=(0,J.useState)(null);Se!==t&&d&&!W&&!G&&!q&&Ce(t);let Y=(0,J.useCallback)(async(e,t)=>{let n=_e.current,r=U.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!ae(n,`environment:maintain`)||ge.current!==null)return;ge.current=e,H(e);let i=()=>{ge.current=null,H(null)};if(t===`SIGKILL`){let n=!1;try{n=await re().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),j.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let a=_e.current;if(a===null||a!==n||!ae(a,`environment:maintain`)){i();return}if(U.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await p({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!te(i)){let e=ne(i);j.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=y(i.value.message);if(A(),Tt(e)){j.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}j.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}A()}finally{i()}},[A,p]),we=D?g(D.error):null,Te=M?g(M.error):null,X=S?g(S.error):null,Ee=S?i(S.partialFailure,()=>!1):!1;return d?(0,K.jsxs)(he,{width:`expanded`,className:`gap-10`,children:[(0,K.jsx)(lt,{environmentId:t}),(0,K.jsxs)(V,{title:`Live Processes`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Gt,{checkedAt:D?.readAt??null}),(0,K.jsx)(Kt,{isPending:k,label:`Refresh process diagnostics`,onClick:A})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`Child Processes`,value:D?Z(D.processCount):`...`}),(0,K.jsx)($,{label:`CPU`,value:D?`${D.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,K.jsx)($,{label:`Memory`,value:D?xt(D.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,K.jsx)($,{label:`Server PID`,value:D?String(D.serverPid):`...`})]}),we||O?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[we?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:we.message})]}):null,O?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:O})]}):null]}):null,(0,K.jsx)(Nt,{processes:D?.processes??[],canMaintainEnvironment:n,signalingPid:pe,onSignal:Y,emptyLabel:G?`Loading live processes...`:`No live descendant processes found.`})]}),(0,K.jsxs)(V,{title:`Resource History`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Vt,{selectedWindowMs:v,onSelect:b}),(0,K.jsx)(Gt,{checkedAt:M?.readAt??null}),(0,K.jsx)(Kt,{isPending:F,label:`Refresh resource history`,onClick:I})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`CPU Time`,value:M?It(M.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,K.jsx)($,{label:`Samples`,value:M?Z(M.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,K.jsx)($,{label:`Interval`,value:M?M.sampleIntervalMs===0?`On demand`:Q(M.sampleIntervalMs):`...`}),(0,K.jsx)($,{label:`Processes`,value:M?Z(M.topProcesses.length):`...`})]}),Te||N?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Te?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:Te.message})]}):null,N?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:N})]}):null]}):null,(0,K.jsx)(zt,{buckets:M?.buckets??[]}),(0,K.jsx)(Ut,{processes:M?.topProcesses??[],emptyLabel:q?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,K.jsxs)(V,{title:`Trace Diagnostics`,headerAction:(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(Gt,{checkedAt:S?.readAt??null}),(0,K.jsxs)(z,{children:[(0,K.jsx)(L,{render:(0,K.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,disabled:!s||!r?.logsDirectoryPath||le,onClick:ye,"aria-label":`Open logs folder`,children:(0,K.jsx)(o,{})})}),(0,K.jsx)(R,{side:`top`,children:`Open logs folder`})]}),(0,K.jsx)(Kt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:T})]}),children:[(0,K.jsxs)(Et,{children:[(0,K.jsx)($,{label:`Spans`,value:S?Z(S.recordCount):`...`}),(0,K.jsx)($,{label:`Failures`,value:S?Z(S.failureCount):`...`,tone:S&&S.failureCount>0?`danger`:`default`}),(0,K.jsx)($,{label:`Slow Spans`,value:S?Z(S.slowSpanCount):`...`,tooltip:S?`Spans with a duration of ${Q(S.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:S&&S.slowSpanCount>0?`warning`:`default`}),(0,K.jsx)($,{label:`Parse Errors`,value:S?Z(S.parseErrorCount):`...`,tone:S&&S.parseErrorCount>0?`warning`:`default`})]}),de||X||C?(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[de?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:de})]}):null,X?(0,K.jsxs)(`div`,{className:w(`flex items-start gap-2`,Ee?`text-warning-foreground`:`text-destructive`),children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:Ee?`Some trace files could not be read, so diagnostics may be incomplete. ${X.message}`:X.message})]}):null,C?(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,K.jsx)(_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:C})]}):null]}):null]}),(0,K.jsx)(V,{title:`Latest Failures`,children:S&&S.latestFailures.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:S.latestFailures.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(xe,{text:e.cause})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:Ct(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,K.jsx)(Dt,{label:W?`Loading failures...`:`No failed spans found.`})}),(0,K.jsx)(V,{title:`Most Common Failures`,children:S&&S.commonFailures.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:S.commonFailures.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,K.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(xe,{text:e.cause})}),(0,K.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:Ct(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,K.jsx)(Dt,{label:W?`Loading failure groups...`:`No repeated failures found.`})}),(0,K.jsx)(V,{title:`Slowest Spans`,children:S&&S.slowestSpans.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:S.slowestSpans.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,K.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:Ct(e.endedAt)}),(0,K.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,K.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,K.jsx)(Dt,{label:W?`Loading slow spans...`:`No spans found.`})}),(0,K.jsx)(V,{title:`Span Logs`,children:S&&S.latestWarningAndErrorLogs.length>0?(0,K.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`w-[11%]`}),(0,K.jsx)(`col`,{className:`w-[9%]`}),(0,K.jsx)(`col`,{className:`w-[24%]`}),(0,K.jsx)(`col`,{className:`w-[26%]`}),(0,K.jsx)(`col`,{className:`w-[30%]`})]}),(0,K.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,K.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,K.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:S.latestWarningAndErrorLogs.map(e=>(0,K.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:Ct(e.seenAt)}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,K.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,K.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,K.jsx)(xe,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,K.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,K.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${E(e.seenAt)}:${e.message}`))})]})}):(0,K.jsx)(Dt,{label:W?`Loading recent logs...`:`No warnings or errors found.`})}),(0,K.jsx)(V,{title:`Top Span Names`,children:S&&S.topSpansByCount.length>0?(0,K.jsx)(Ot,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:S.topSpansByCount.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.failureCount)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.averageDurationMs)}),(0,K.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Q(e.maxDurationMs)})]},e.name))}):(0,K.jsx)(Dt,{label:W?`Loading span names...`:`No spans found.`})}),Se===t&&(0,K.jsx)(vt,{})]}):(0,K.jsx)(he,{children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:u.isPending?`Checking diagnostics access…`:u.error})})}var Jt=qt;export{Jt as component};
2
- //# sourceMappingURL=settings.diagnostics-BZD1uMGP.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{t as i}from"./cloud-Cnpuf424.js";import{t as a}from"./plus-BFikiw2m.js";import{t as o}from"./x-CJgPyqpa.js";import{$n as s,Bf as c,Ch as l,Dg as u,Gg as d,Jg as f,Jn as p,Jp as m,Jw as h,Mg as g,Od as _,Og as v,Pg as y,Q_ as b,Qn as x,Sh as S,Sp as C,Tp as w,Ty as T,Yg as E,Yn as D,Zn as O,Zw as k,ar as A,bb as j,dh as M,dr as N,fh as P,fr as F,iE as I,il as L,l as ee,mh as R,nh as z,od as te,qg as ne,rd as re,rf as ie,rl as ae,t as B,tr as oe,ur as V,wy as se,xh as H,xp as ce}from"./utils-CrFJwxSd.js";import{W as le}from"./runtime-Dm3Pi31_.js";import{T as ue}from"./entities-Om5Klild.js";import{a as U,r as de,t as W}from"./number-field-DGdBjQD2.js";import{a as G,c as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./select-Ctq0UILH.js";import{t as ve}from"./spinner-CNva85zM.js";import{i as K}from"./toast-BcjbmUtS.js";import{D as ye,E as be,J as xe,c as Se,o as Ce,r as we,s as q,x as J}from"./useSettings-BL4ZWGQV.js";import{f as Te}from"./server-BvxyePeo.js";import{i as Ee,n as De}from"./session-C7ckxjAM.js";import{t as Oe}from"./query-DlK0I8Jc.js";import{t as ke}from"./use-atom-command-BNkv9iyk.js";import{t as Ae}from"./env-wK1YYxA8.js";import{a as je,n as Me,t as Ne}from"./tooltip-T5ePvxsH.js";import{t as Pe}from"./input-BCWES8Y7.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,r as Be,s as Ve,t as He}from"./dialog-BwjzOzO6.js";import{i as Ue,t as We}from"./device-6R-yC55P.js";import{a as Ge,i as Ke,l as qe,n as Je,o as Ye,t as Xe,u as Ze}from"./DeviceSetup-DW4g9NNK.js";import{t as Qe}from"./AnimatedHeight-CHpFDL1r.js";import{i as $e,n as et}from"./Icons-DwLGuyWf.js";import{t as tt}from"./preview-CiojYkh4.js";import{n as nt}from"./preview-Dwq2O7nm.js";import{a as rt,i as it,o as at,t as ot}from"./popover-BnqKHl4L.js";import{F as st,R as ct,V as lt,a as Y,c as ut,i as dt,r as ft,s as pt,w as mt}from"./settingsLayout-DFYjWgKN.js";import{Ar as ht,Bi as gt,Fr as _t,Ir as vt,Mr as yt,Nr as bt,Oa as xt,Pr as St,ir as X,jr as Ct,qi as wt,va as Tt,zi as Et}from"./main-BGaSDXjP.js";import{t as Dt}from"./ProjectDefaultsSettings-DLJfUN7i.js";import{t as Ot}from"./draft-input-CpqOZR5i.js";import{t as kt}from"./ScopedSwitch-CX4FTGjy.js";import{t as At}from"./SecretInput-BPPzPNI1.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-D6i3IaCj.js";var Z=n(),Q=e(r(),1);function Pt(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(Ft).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)(F,{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)(at,{"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)(rt,{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)(it,{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)(ot,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=C):C=t[26],C}function Ft(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function It(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 Lt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Rt),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 Rt(e){return(0,Q.jsxs)(Ne,{children:[(0,Q.jsxs)(je,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(_,{className:`size-3`}):(0,Q.jsx)(ce,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(Me,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=j(T);function Bt(e){let{identityFile:t,...n}=e;return zt({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Vt(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function Ht(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 Ut(e){let t=ke(We.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Vt(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await Ht(e,n,async(e,n)=>{if(!De(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(h(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 Wt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[c,l]=(0,$.useState)(n),{checks:u,testConnection:d}=Ut(i),f=u[Vt(c)],p=Object.values(f??{}).some(Kt),m,h;t[0]===c?(m=t[1],h=t[2]):(m=Bt({...c,label:c.label.trim()||c.target}),h=I(m),t[0]=c,t[1]=m,t[2]=h);let g=h,v;t[3]===f?v=t[4]:(v=Object.values(f??{}).filter(Gt),t[3]=f,t[4]=v);let y=v.length,b;t[5]!==a||t[6]!==s?(b=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=b):b=t[7];let x=!a,S;t[8]!==a||t[9]!==p||t[10]!==c.label||t[11]!==m||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),I(m)&&c.label.trim()&&!a&&!p&&o(m.value)}}),t[8]=a,t[9]=p,t[10]=c.label,t[11]=m,t[12]=o,t[13]=S):S=t[13];let w=r?`Add device host`:`Edit device host`,T;t[14]===w?T=t[15]:(T=(0,Q.jsx)(Ie,{children:w}),t[14]=w,t[15]=T);let E=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,D;t[16]===E?D=t[17]:(D=(0,Q.jsxs)(Be,{children:[E,` `,`Hosts on the same machine are skipped.`]}),t[16]=E,t[17]=D);let O;t[18]!==T||t[19]!==D?(O=(0,Q.jsxs)(Fe,{children:[T,D]}),t[18]=T,t[19]=D,t[20]=O):O=t[20];let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=k):k=t[21];let A;t[22]===c?A=t[23]:(A=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=A);let j;t[24]!==a||t[25]!==c.label||t[26]!==A?(j=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[k,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:A,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=M):M=t[28];let P;t[29]===c?P=t[30]:(P=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=P);let F;t[31]!==a||t[32]!==c.target||t[33]!==P?(F=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(Pe,{required:!0,value:c.target,disabled:a,onChange:P,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=P,t[34]=F):F=t[34];let L=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 R;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=R):R=t[36];let te=c.identityFile??``,ne;t[37]===c?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[R,(0,Q.jsx)(Pe,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=c.port??``,B;t[44]===c?B=t[45]:(B=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=B);let oe;t[46]!==a||t[47]!==ae||t[48]!==B?(oe=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(Pe,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=oe):oe=t[49];let V;t[50]!==re||t[51]!==oe?(V=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,oe]}),t[50]=re,t[51]=oe,t[52]=V):V=t[52];let se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=se):se=t[53];let H;t[54]!==L||t[55]!==V?(H=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[ee,V,se]}),t[54]=L,t[55]=V,t[56]=H):H=t[56];let ce=p?`Checking environments…`:f?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,le;t[57]===ce?le=t[58]:(le=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce}),t[57]=ce,t[58]=le);let ue=a||p||!g,U;t[59]!==m||t[60]!==d?(U=()=>{I(m)&&d(m.value)},t[59]=m,t[60]=d,t[61]=U):U=t[61];let de;t[62]===p?de=t[63]:(de=p?(0,Q.jsx)(ve,{size:`xs`}):null,t[62]=p,t[63]=de);let W;t[64]!==ue||t[65]!==U||t[66]!==de?(W=(0,Q.jsxs)(N,{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]!==le||t[69]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[le,W]}),t[68]=le,t[69]=W,t[70]=G):G=t[70];let fe;t[71]!==f||t[72]!==i?(fe=f?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=f[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)(ve,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(C,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(z,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(Lt,{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]=f,t[72]=i,t[73]=fe):fe=t[73];let pe;t[74]!==G||t[75]!==fe?(pe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[G,fe]}),t[74]=G,t[75]=fe,t[76]=pe):pe=t[76];let me;t[77]!==j||t[78]!==F||t[79]!==H||t[80]!==pe?(me=(0,Q.jsxs)(ze,{children:[j,F,H,pe]}),t[77]=j,t[78]=F,t[79]=H,t[80]=pe,t[81]=me):me=t[81];let he;t[82]!==a||t[83]!==s?(he=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=he):he=t[84];let ge;t[85]!==a||t[86]!==p||t[87]!==c.label||t[88]!==g?(ge=a||p||!g||!c.label.trim(),t[85]=a,t[86]=p,t[87]=c.label,t[88]=g,t[89]=ge):ge=t[89];let _e;t[90]===a?_e=t[91]:(_e=a?(0,Q.jsx)(ve,{size:`xs`}):null,t[90]=a,t[91]=_e);let K;t[92]!==ge||t[93]!==_e?(K=(0,Q.jsxs)(N,{type:`submit`,disabled:ge,children:[_e,` Save host`]}),t[92]=ge,t[93]=_e,t[94]=K):K=t[94];let ye;t[95]!==he||t[96]!==K?(ye=(0,Q.jsxs)(Le,{children:[he,K]}),t[95]=he,t[96]=K,t[97]=ye):ye=t[97];let be;t[98]!==O||t[99]!==me||t[100]!==x||t[101]!==ye||t[102]!==S?(be=(0,Q.jsxs)(Ve,{showCloseButton:x,render:S,children:[O,me,ye]}),t[98]=O,t[99]=me,t[100]=x,t[101]=ye,t[102]=S,t[103]=be):be=t[103];let xe;return t[104]!==b||t[105]!==be?(xe=(0,Q.jsx)(He,{open:!0,onOpenChange:b,children:be}),t[104]=b,t[105]=be,t[106]=xe):xe=t[106],xe}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=lt(),i=Ee(e.environmentId,b),a=t.kind===`project`||t.kind===`checkout`,o=ke(Te.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:h,testConnection:g}=Ut(p),_=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(!De(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:It(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)(N,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({kind:`ssh`,id:ee(),label:``,target:``})},children:[(0,Q.jsx)(m,{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)(Jt,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!i||a||d,checks:h,testConnection:async e=>{let t=await g(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 _(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(Wt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void _(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 Jt(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:c,checks:l,testConnection:u}=e,{state:d}=Ue(r),f=ke(We.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=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]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Vt(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,_=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}),h.filter(Xt).map(Yt)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(Pt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.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,_?(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:_})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(ve,{size:`xs`}),g]}):null,(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(s,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(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]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=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]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let _;return t[25]!==h||t[26]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=_):_=t[27],_}function Yt(e){return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{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)($e,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(et,{className:`size-3.5`})}),(0,Q.jsx)(Me,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=j(se),Qt=e=>({kind:`eas`,id:e,label:`EAS Simulator`,accessToken:``,maxSessionMinutes:30,idleMinutes:10,maxConcurrentSessions:2});function $t(e,t,n){return n?e.filter(e=>e.id!==t.id):e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]}function en(e){return`Up to ${e.maxConcurrentSessions===1?`1 session`:`${e.maxConcurrentSessions} sessions`} at once, each stopped after ${e.maxSessionMinutes} min or ${e.idleMinutes} idle min`}var tn=`thread-project`,nn={settings:`the access token saved here`,env:`EXPO_TOKEN on the server`,"eas-login":`the server's eas login`},rn=e=>{let t=k(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=lt(),o=Ee(e.environmentId,b),s=n.kind===`project`||n.kind===`checkout`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=ke(Te.updateSettings,c),u;t[1]===e.environmentId?u=t[2]:(u=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=u);let d=r.find(u)?.serverConfig?.settings.easDeviceHosts??[],[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),g=!o||s||m||!e.environmentId,_=async(t,n)=>{if(!e.environmentId||!De(e.environmentId,`settings:write`))return;h(!0);let r=await l({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(d,t,n)}}});h(!1),r._tag===`Success`?p(null):K.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},v=Y,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=[`easDeviceHosts`],t[3]=y):y=t[3];let x=g||f!==null,S;t[4]===p?S=t[5]:(S=()=>p({host:Qt(ee()),isNew:!0}),t[4]=p,t[5]=S);let C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(a,{className:`size-3.5`}),t[6]=C):C=t[6];let w;t[7]!==x||t[8]!==S?(w=(0,Q.jsxs)(N,{size:`sm`,variant:`outline`,disabled:x,onClick:S,children:[C,` Add EAS host`]}),t[7]=x,t[8]=S,t[9]=w):w=t[9];let T=d.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No EAS hosts.`}):(0,Q.jsx)(`ul`,{className:`divide-y divide-border/40`,children:d.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate font-medium`,children:[(0,Q.jsx)(i,{className:`size-3.5 shrink-0`}),` `,e.label]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:en(e)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,Q.jsx)(N,{size:`sm`,variant:`ghost`,disabled:g,onClick:()=>p({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(N,{size:`sm`,variant:`ghost-destructive`,disabled:g,onClick:()=>void _(e,!0),children:`Remove`})]})]},e.id))}),E;t[10]!==m||t[11]!==f||t[12]!==e.environmentId||t[13]!==_||t[14]!==p?(E=f&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:f.host,isNew:f.isNew,busy:m,onSave:e=>void _(e,!1),onClose:()=>p(null)},f.host.id):null,t[10]=m,t[11]=f,t[12]=e.environmentId,t[13]=_,t[14]=p,t[15]=E):E=t[15];let D;t[16]!==T||t[17]!==E?(D=(0,Q.jsxs)(`div`,{className:`pt-3 pb-2`,children:[T,E]}),t[16]=T,t[17]=E,t[18]=D):D=t[18];let O;return t[19]!==v||t[20]!==w||t[21]!==D||t[22]!==y?(O=(0,Q.jsx)(v,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:y,description:`Run iOS Simulators in Expo's cloud from this environment. Sessions bill the Expo account until they stop, so each host limits how many run and for how long. Editing or removing a host stops its running sessions.`,control:w,children:D}),t[19]=v,t[20]=w,t[21]=D,t[22]=y,t[23]=O):O=t[23],O}function on(e){let t=(0,Z.c)(135),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=ke(We.easAccount,n),[i,a]=(0,$.useState)(e.host),s=(0,$.useId)(),c;t[1]===e.host.accessToken?c=t[2]:(c=e.host.accessToken?{kind:`saved`}:{kind:`cleared`},t[1]=e.host.accessToken,t[2]=c);let[l,u]=(0,$.useState)(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`checking`},t[3]=d):d=t[3];let[f,p]=(0,$.useState)(d),m,h;t[4]!==i||t[5]!==e.host.accessToken||t[6]!==l.kind||t[7]!==l.value?(m={...i,label:i.label.trim(),accessToken:l.kind===`saved`?e.host.accessToken:l.kind===`new`?l.value:``},h=I(Zt(m)),t[4]=i,t[5]=e.host.accessToken,t[6]=l.kind,t[7]=l.value,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g=h,_=g?null:i.maxSessionMinutes>0&&i.idleMinutes>=i.maxSessionMinutes?`Idle minutes must be smaller than session minutes.`:`Give the host a label and limits within the ranges shown.`,v;t[10]!==f.account||t[11]!==f.status?(v=f.status===`signed-in`?f.account.apps:[],t[10]=f.account,t[11]=f.status,t[12]=v):v=t[12];let y=v,b=(0,$.useRef)(0),x;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{b.current+=1,p({status:`idle`})},t[13]=x):x=t[13];let S=x,C;t[14]!==r||t[15]!==e.environmentId||t[16]!==e.host.id||t[17]!==e.isNew||t[18]!==l.kind||t[19]!==l.value?(C=async()=>{let t=b.current+=1,n=await r({environmentId:e.environmentId,input:{...l.kind===`saved`&&!e.isNew?{hostId:e.host.id}:{},...l.kind===`new`?{accessToken:l.value}:l.kind===`cleared`?{accessToken:``}:{}}});t===b.current&&p(n._tag===`Success`?{status:`signed-in`,account:n.value}:{status:`failed`,error:rn(n.cause)})},t[14]=r,t[15]=e.environmentId,t[16]=e.host.id,t[17]=e.isNew,t[18]=l.kind,t[19]=l.value,t[20]=C):C=t[20];let w=C,T;t[21]===w?T=t[22]:(T=()=>{p({status:`checking`}),w()},t[21]=w,t[22]=T);let E=T,D;t[23]===w?D=t[24]:(D=()=>void w(),t[23]=w,t[24]=D);let O=(0,$.useEffectEvent)(D),k;t[25]===O?k=t[26]:(k=()=>{O()},t[25]=O,t[26]=k);let A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=[],t[27]=A):A=t[27],(0,$.useEffect)(k,A);let j;t[28]!==i||t[29]!==e.busy?(j=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Pe,{type:`number`,min:1,max:r,value:i[t],disabled:e.busy,onChange:e=>{let n=Number(e.target.value);a(e=>({...e,[t]:n}))}})]}),t[28]=i,t[29]=e.busy,t[30]=j):j=t[30];let M=j,P;t[31]===e?P=t[32]:(P=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=P);let F=!e.busy,L;t[33]!==m||t[34]!==e||t[35]!==g?(L=t=>{t.preventDefault(),g&&!e.busy&&e.onSave(m)},t[33]=m,t[34]=e,t[35]=g,t[36]=L):L=t[36];let ee=e.isNew?`Add EAS host`:`Edit EAS host`,R;t[37]===ee?R=t[38]:(R=(0,Q.jsx)(Ie,{children:ee}),t[37]=ee,t[38]=R);let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(Be,{children:`The environment's server signs in to Expo and starts the sessions. Without a token here it uses EXPO_TOKEN, then its eas login.`}),t[39]=z):z=t[39];let te;t[40]===R?te=t[41]:(te=(0,Q.jsxs)(Fe,{children:[R,z]}),t[40]=R,t[41]=te);let ne;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=ne):ne=t[42];let re;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=re):re=t[43];let ie;t[44]!==i.label||t[45]!==e.busy?(ie=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[ne,(0,Q.jsx)(Pe,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:re})]}),t[44]=i.label,t[45]=e.busy,t[46]=ie):ie=t[46];let ae;t[47]===s?ae=t[48]:(ae=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=ae);let B=l.kind===`saved`,oe=l.kind===`new`?l.value:``,V;t[49]===e.host.accessToken?V=t[50]:(V=t=>{let n=t.target.value;u(n?{kind:`new`,value:n}:e.host.accessToken?{kind:`saved`}:{kind:`cleared`}),S()},t[49]=e.host.accessToken,t[50]=V);let se;t[51]!==e.busy||t[52]!==B||t[53]!==oe||t[54]!==V||t[55]!==s?(se=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:B,value:oe,disabled:e.busy,placeholder:`Optional`,onChange:V}),t[51]=e.busy,t[52]=B,t[53]=oe,t[54]=V,t[55]=s,t[56]=se):se=t[56];let H;t[57]===l.kind?H=t[58]:(H=l.kind===`cleared`?null:(0,Q.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,"aria-label":`Clear access token`,onClick:()=>{u({kind:`cleared`}),S()},children:(0,Q.jsx)(o,{className:`size-3.5`})}),t[57]=l.kind,t[58]=H);let ce;t[59]!==se||t[60]!==H?(ce=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[se,H]}),t[59]=se,t[60]=H,t[61]=ce):ce=t[61];let le;t[62]!==ae||t[63]!==ce?(le=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ae,ce]}),t[62]=ae,t[63]=ce,t[64]=le):le=t[64];let ue=f.status===`signed-in`?`Signed in as ${f.account.signedInAs} with ${nn[f.account.credentialSource]}.`:f.status===`failed`?f.error:f.status===`checking`?`Checking the Expo account…`:`Check the Expo account before choosing a project.`,U;t[65]===ue?U=t[66]:(U=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:ue}),t[65]=ue,t[66]=U);let de=e.busy||f.status===`checking`,W;t[67]===E?W=t[68]:(W=()=>void E(),t[67]=E,t[68]=W);let pe;t[69]===f.status?pe=t[70]:(pe=f.status===`checking`?(0,Q.jsx)(ve,{size:`xs`}):null,t[69]=f.status,t[70]=pe);let he;t[71]!==de||t[72]!==W||t[73]!==pe?(he=(0,Q.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:de,onClick:W,children:[pe,` Check account`]}),t[71]=de,t[72]=W,t[73]=pe,t[74]=he):he=t[74];let K;t[75]!==U||t[76]!==he?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[U,he]}),t[75]=U,t[76]=he,t[77]=K):K=t[77];let ye;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ye):ye=t[78];let be=i.appId??tn,xe=e.busy,Se;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=Se):Se=t[79];let Ce;t[80]===y?Ce=t[81]:(Ce=(0,Q.jsx)(ge,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(fe,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=Ce);let we;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Q.jsx)(G,{value:tn,children:`From the thread's project`}),t[82]=we):we=t[82];let q;t[83]!==y||t[84]!==i.appId?(q=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(G,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=q):q=t[85];let J;t[86]===y?J=t[87]:(J=y.map(sn),t[86]=y,t[87]=J);let Te;t[88]!==q||t[89]!==J?(Te=(0,Q.jsxs)(me,{children:[we,q,J]}),t[88]=q,t[89]=J,t[90]=Te):Te=t[90];let Ee;t[91]!==e.busy||t[92]!==be||t[93]!==Ce||t[94]!==Te?(Ee=(0,Q.jsxs)(_e,{value:be,disabled:xe,onValueChange:Se,children:[Ce,Te]}),t[91]=e.busy,t[92]=be,t[93]=Ce,t[94]=Te,t[95]=Ee):Ee=t[95];let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sessions bill the project's Expo account. "From the thread's project" reads extra.eas.projectId from the project's app config.`}),t[96]=De):De=t[96];let Oe;t[97]===Ee?Oe=t[98]:(Oe=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ye,Ee,De]}),t[97]=Ee,t[98]=Oe);let Ae;t[99]===M?Ae=t[100]:(Ae=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[M(`maxConcurrentSessions`,`Sessions at once`,20),M(`maxSessionMinutes`,`Session minutes`,115),M(`idleMinutes`,`Idle minutes`,60)]}),t[99]=M,t[100]=Ae);let je=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,Me;t[101]===je?Me=t[102]:(Me=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Expo allows sessions of up to 40 minutes on free accounts and 115 on paid ones, and ends one after the idle minutes without activity, so idle minutes must be smaller than session minutes.`,je]}),t[101]=je,t[102]=Me);let Ne;t[103]===_?Ne=t[104]:(Ne=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Ne);let Re;t[105]!==ie||t[106]!==le||t[107]!==K||t[108]!==Oe||t[109]!==Ae||t[110]!==Me||t[111]!==Ne?(Re=(0,Q.jsxs)(ze,{children:[ie,le,K,Oe,Ae,Me,Ne]}),t[105]=ie,t[106]=le,t[107]=K,t[108]=Oe,t[109]=Ae,t[110]=Me,t[111]=Ne,t[112]=Re):Re=t[112];let Ue;t[113]!==e.busy||t[114]!==e.onClose?(Ue=(0,Q.jsx)(N,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=Ue):Ue=t[115];let Ge=e.busy||!g,Ke;t[116]===e.busy?Ke=t[117]:(Ke=e.busy?(0,Q.jsx)(ve,{size:`xs`}):null,t[116]=e.busy,t[117]=Ke);let qe;t[118]!==Ge||t[119]!==Ke?(qe=(0,Q.jsxs)(N,{type:`submit`,disabled:Ge,children:[Ke,` Save host`]}),t[118]=Ge,t[119]=Ke,t[120]=qe):qe=t[120];let Je;t[121]!==Ue||t[122]!==qe?(Je=(0,Q.jsxs)(Le,{children:[Ue,qe]}),t[121]=Ue,t[122]=qe,t[123]=Je):Je=t[123];let Ye;t[124]!==L||t[125]!==te||t[126]!==Re||t[127]!==Je?(Ye=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:L,children:[te,Re,Je]}),t[124]=L,t[125]=te,t[126]=Re,t[127]=Je,t[128]=Ye):Ye=t[128];let Xe;t[129]!==F||t[130]!==Ye?(Xe=(0,Q.jsx)(Ve,{showCloseButton:F,children:Ye}),t[129]=F,t[130]=Ye,t[131]=Xe):Xe=t[131];let Ze;return t[132]!==P||t[133]!==Xe?(Ze=(0,Q.jsx)(He,{open:!0,onOpenChange:P,children:Xe}),t[132]=P,t[133]=Xe,t[134]=Ze):Ze=t[134],Ze}function sn(e){return(0,Q.jsx)(G,{value:e.id,children:e.fullName},e.id)}function cn(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function ln(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 un(e){return e.step!==`importing`}function dn(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 fn(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 pn(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:dn(e)}function mn(e){let t=pn(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function hn(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function gn(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function _n(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 vn(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=()=>dn(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=()=>cn(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=ee(),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=ln(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(fn(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=>hn(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=k);let A=k,j;t[15]===A?j=t[16]:(j=()=>A(`browser`,pn),t[15]=A,t[16]=j);let M=j,N;t[17]===A?N=t[18]:(N=()=>A(`fullDiskAccess`,mn),t[17]=A,t[18]=N);let P=N,F;t[19]!==u||t[20]!==m?(F=e=>e||!un(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=F):F=t[21];let I;t[22]===m?I=t[23]:(I=un(m),t[22]=m,t[23]=I);let L;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==M||t[31]!==P||t[32]!==O||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(L=m.step===`quit`?(0,Q.jsx)(yn,{source:d,onCancel:u,onRechecked:M}):m.step===`fullDiskAccess`?(0,Q.jsx)(Sn,{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:P,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(Tn,{}):m.step===`checking`?(0,Q.jsx)(En,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(Dn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(On,{source:d,reason:m.reason,onClose:u,onRetry:gn(m.reason)?O:void 0}):(0,Q.jsx)(Cn,{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]=M,t[31]=P,t[32]=O,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=L):L=t[39];let R;t[40]!==I||t[41]!==L?(R=(0,Q.jsx)(Ve,{className:`max-w-lg`,showCloseButton:I,children:L}),t[40]=I,t[41]=L,t[42]=R):R=t[42];let z;return t[43]!==R||t[44]!==F?(z=(0,Q.jsx)(He,{open:!0,onOpenChange:F,children:R}),t[43]=R,t[44]=F,t[45]=z):z=t[45],z}function yn(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)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Be,{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)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(N,{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)(Le,{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 bn(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function xn(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Sn(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===s?p=t[1]:(p=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=Nt(p,m),g;t[3]!==i||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(i).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=i,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Fe,{children:[(0,Q.jsxs)(Ie,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Be,{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]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(c,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(jt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==o?(T=h.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]=h,t[22]=o,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ze,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==a||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(Mt,{ready:O,busy:l,onClick:a,children:`Continue`}),t[32]=a,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Le,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,t[42]=j):j=t[42],j}function Cn(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,g=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),_;t[4]===n.name?_=t[5]:(_=(0,Q.jsxs)(Ie,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(Be,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,Q.jsxs)(Fe,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=b):b=t[11];let x;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(wn,{selected:o===e.directory,title:e.name,subtitle:bn(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],x=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=x}else x=t[15];let S;t[19]===x?S=t[20]:(S=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[b,x]}),t[19]=x,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(re,{className:`size-4 sm:hidden`}),(0,Q.jsx)(te,{className:`hidden size-4 sm:block`})]}),t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=w):w=t[22];let T;t[23]!==a||t[24]!==u||t[25]!==c.kind?(T=a?(0,Q.jsx)(wn,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=T):T=t[26];let E;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(wn,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],E=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=E}else E=t[31];let D;t[36]!==T||t[37]!==E?(D=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[w,T,E]}),t[36]=T,t[37]=E,t[38]=D):D=t[38];let O;t[39]!==D||t[40]!==S?(O=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[S,C,D]}),t[39]=D,t[40]=S,t[41]=O):O=t[41];let k;t[42]===g?k=t[43]:(k=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=k);let A;t[44]!==O||t[45]!==k?(A=(0,Q.jsxs)(ze,{children:[O,k]}),t[44]=O,t[45]=k,t[46]=A):A=t[46];let j;t[47]===d?j=t[48]:(j=(0,Q.jsx)(N,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=j);let M=o===``||m||h,P;t[49]!==f||t[50]!==M?(P=(0,Q.jsx)(N,{disabled:M,onClick:f,children:`Import`}),t[49]=f,t[50]=M,t[51]=P):P=t[51];let F;t[52]!==j||t[53]!==P?(F=(0,Q.jsxs)(Le,{children:[j,P]}),t[52]=j,t[53]=P,t[54]=F):F=t[54];let I;return t[55]!==A||t[56]!==F||t[57]!==y?(I=(0,Q.jsxs)(Q.Fragment,{children:[y,A,F]}),t[55]=A,t[56]=F,t[57]=y,t[58]=I):I=t[58],I}function wn(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=B(`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=B(`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)(_,{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 h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(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]=h):h=t[21],h}function Tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Fe,{children:[(0,Q.jsx)(Ie,{children:`Importing cookies`}),(0,Q.jsx)(Be,{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)(ze,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(ve,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function En(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ie,{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)(Be,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Fe,{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)(ve,{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)(ze,{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 Dn(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 ${xn(n)}`:r>0?`Skipped ${xn(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)(Ie,{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?` ${xn(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)(Be,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Fe,{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)(ze,{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:_n(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(N,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Le,{children:(0,Q.jsx)(Re,{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 On(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)(Ie,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=ae[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Be,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Fe,{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)(N,{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)(N,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Le,{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 kn=`fill`,An=`responsive`;async function jn(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 Mn(e,t,n,r=0){return(e||r>0)&&t&&n>0}var Nn={width:1280,height:800},Pn={useGrouping:!1},Fn={system:`System`,light:`Light`,dark:`Dark`},In=e=>`${Math.round(e*100)}%`,Ln=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},Rn=e=>{let t=String(e?.message??``);return L.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&&gt.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:gt.find(e=>e.id===t)?.label??`Responsive`},Vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,Hn=e=>({...e,width:e.height,height:e.width});function Un(e){let t=(0,Z.c)(42),{disabled:n}=e,r=q(Gn),i=J(),a=r._tag===`fill`?null:r,o=a?.width??Nn.width,s=a?.height??Nn.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 u=c,d;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(d=e=>{if(e===kn){i({browserDefaultViewport:v});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=gt.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]=d):d=t[6];let f=d,p;t[7]!==u||t[8]!==a||t[9]!==i?(p=(e,t)=>{if(t===null||!Vn(t))return;let n={...u,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=u,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 _;t[12]!==n||t[13]!==i||t[14]!==r._tag?(_=!n&&r._tag!==l._tag?(0,Q.jsx)(ft,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:l})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=_):_=t[15];let y;t[16]===r?y=t[17]:(y=zn(r),t[16]=r,t[17]=y);let b;t[18]===r?b=t[19]:(b=Bn(r),t[18]=r,t[19]=b);let x;t[20]===b?x=t[21]:(x=(0,Q.jsx)(ge,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(fe,{children:b})}),t[20]=b,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(G,{value:kn,children:`Fill panel`}),C=(0,Q.jsx)(G,{value:An,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)(me,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(he,{children:[(0,Q.jsx)(pe,{children:`Standard`}),gt.map(Wn)]})]}),t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==f||t[27]!==x||t[28]!==y?(T=(0,Q.jsxs)(_e,{value:y,onValueChange:f,disabled:n,children:[x,w]}),t[25]=n,t[26]=f,t[27]=x,t[28]=y,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==n||t[32]!==u||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)(W,{value:u.width,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`width`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(W,{value:u.height,min:240,max:g,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>m(`height`,e),children:(0,Q.jsx)(de,{children:(0,Q.jsx)(U,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${u.height>=u.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(Et,{})})}),(0,Q.jsx)(Me,{side:`top`,children:`Rotate`})]})]}):null,t[30]=m,t[31]=n,t[32]=u,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]!==_?(O=(0,Q.jsx)(Y,{...h,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:_,control:D}),t[39]=D,t[40]=_,t[41]=O):O=t[41],O}function Wn(e){return(0,Q.jsx)(G,{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 Gn(e){return e.browserDefaultViewport}function Kn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=q(Jn),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)(ft,{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=y.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=In(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(fe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:y.map(qn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(_e,{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 qn(e){return(0,Q.jsx)(G,{hideIndicator:!0,value:String(e),children:In(e)},e)}function Jn(e){return e.browserDefaultZoomFactor}function Yn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(Zn),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)(ft,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:u})}):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)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(fe,{children:c})}),t[7]=c,t[8]=l);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=d):d=t[9];let f;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(f=(0,Q.jsxs)(_e,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=f):f=t[14];let p;return t[15]!==o||t[16]!==f?(p=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:f}),t[15]=o,t[16]=f,t[17]=p):p=t[17],p}function Xn(e){let[t,n]=e;return(0,Q.jsx)(G,{hideIndicator:!0,value:t,children:n},t)}function Zn(e){return e.browserDefaultAppearance}function Qn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=q(er),i=q($n),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)(Tt,{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)(Tt,{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 $n(e){return e.browserRecordingShowMousePresses}function er(e){return e.browserRecordingShowKeyPresses}function tr(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(rr),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)(ft,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=P.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(fe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:P.map(nr)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(_e,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,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:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function nr(e){return(0,Q.jsxs)(G,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function rr(e){return e.browserRecordingFrameRate}var ir={system:`Your default browser`,app:`P4 Code`};function ar(e){let t=(0,Z.c)(19),{disabled:n}=e,r=q(sr),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)(ft,{label:`link target`,onClick:()=>i({browserLinkTarget:H})}):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=ir[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(fe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(ir),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:u.map(or)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(_e,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(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:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function or(e){return(0,Q.jsx)(G,{hideIndicator:!0,value:e,children:ir[e]},e)}function sr(e){return e.browserLinkTarget}var cr={duckduckgo:`DuckDuckGo`,google:`Google`,bing:`Bing`,brave:`Brave Search`,kagi:`Kagi`,ecosia:`Ecosia`,custom:`Custom`};function lr(){let e=(0,Z.c)(24),t=q(fr),n=q(dr),r=J(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=X(`browser-search-engine`),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==t||e[3]!==r?(a=t!==`duckduckgo`||n!==``?(0,Q.jsx)(ft,{label:`search engine`,onClick:()=>r({browserSearchEngine:S,browserCustomSearchUrl:``})}):null,e[1]=n,e[2]=t,e[3]=r,e[4]=a):a=e[4];let o;e[5]===r?o=e[6]:(o=e=>{let t=R.literals.find(t=>t===e);t!==void 0&&r({browserSearchEngine:t})},e[5]=r,e[6]=o);let s=cr[t],c;e[7]===s?c=e[8]:(c=(0,Q.jsx)(ge,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(fe,{children:s})}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(me,{align:`end`,alignItemWithTrigger:!1,children:R.literals.map(ur)}),e[9]=l):l=e[9];let u;e[10]!==t||e[11]!==o||e[12]!==c?(u=(0,Q.jsxs)(_e,{value:t,onValueChange:o,children:[c,l]}),e[10]=t,e[11]=o,e[12]=c,e[13]=u):u=e[13];let d;e[14]!==a||e[15]!==u?(d=(0,Q.jsx)(Y,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:u}),e[14]=a,e[15]=u,e[16]=d):d=e[16];let f;e[17]!==n||e[18]!==t||e[19]!==r?(f=t===`custom`?(0,Q.jsx)(Y,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:nt(n)?void 0:`Enter an http or https URL containing %s. Searches use DuckDuckGo until then.`,control:(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full sm:w-64`,"aria-label":`Custom search URL`,placeholder:`https://example.com/search?q=%s`,autoCapitalize:`none`,spellCheck:!1,maxLength:M,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=f):f=e[20];let p;return e[21]!==d||e[22]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ur(e){return(0,Q.jsx)(G,{hideIndicator:!0,value:e,children:cr[e]},e)}function dr(e){return e.browserCustomSearchUrl}function fr(e){return e.browserSearchEngine}function pr(){let e=(0,Z.c)(12),t=q(mr),n=J(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=X(`pull-request-links-open-in-app`),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=t?null:(0,Q.jsx)(ft,{label:`open pull requests in P4 Code`,onClick:()=>n({pullRequestLinksOpenInApp:!0})}),e[1]=t,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({pullRequestLinksOpenInApp:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t||e[7]!==a?(o=(0,Q.jsx)(Tt,{checked:t,onCheckedChange:a,"aria-label":`Open pull requests in P4 Code`}),e[6]=t,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,Q.jsx)(Y,{...r,description:`Clicking a pull request link opens it in P4 Code. Turn off to open pull request links like any other link, on GitHub or your git host.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function mr(e){return e.pullRequestLinksOpenInApp}function hr(){let e=(0,Z.c)(7),{search:t,environment:n}=lt(),r=st(),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)(pt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(gr,{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 gr({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=Ee(e,b),{state:i,loaded:a}=Ue(e),{scope:o,environments:s,connectedEnvironments:c}=lt(),l=ct(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=ke(We.configure,{reportFailure:!1}),p=ke(We.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 x=async(t,n)=>{if(e&&De(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(!De(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)}}},[S,C]=(0,$.useState)(null),w=i.hosts.find(e=>e.kind===`local`)?.tools,T=e=>{let t=w?.[e];return i.supportsToolUpdate&&t?!t.installedVersions.includes(t.requiredVersion):!1},E=(t,n=!1)=>{e&&(C(null),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=Oe(e.cause);C({tool:t,message:r}),n&&K.add({type:`error`,title:r})}}).finally(()=>h(null)))},D=t=>{e&&(h(t),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},O=t=>{let n=T(t);if(!n&&!i.supportsToolInspection)return null;let r=m===`update-${t}`||m===`check-${t}`,a=n?`Update to v${w?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(je,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||m!==null||g,"aria-label":a,onClick:()=>n?E(t,!0):D(`check-${t}`)}),children:(0,Q.jsxs)(`span`,{className:`grid *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-150 *:ease-out motion-reduce:*:transition-none`,children:[(0,Q.jsx)(`span`,{className:n&&!r?void 0:`scale-75 opacity-0`,children:(0,Q.jsx)(ie,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(xt,{refreshing:r})})]})}),(0,Q.jsx)(Me,{side:`top`,children:a})]})},k=t=>{let n=w?.[t];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&T(t)?(0,Q.jsx)(N,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>E(t),children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>D(`check`),children:m===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Ye,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:k(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),O(`hub`),m===`hub`?(0,Q.jsx)(Je,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Qe,{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)(Ke,{compact:!0,platform:`iOS`,status:qe(i,`ios`)}),(0,Q.jsx)(Ke,{compact:!0,platform:`Android`,status:qe(i,`android`)})]}),control:(0,Q.jsx)(N,{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:Ge,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:k(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),O(`agent`),m===`agent`?(0,Q.jsx)(Xe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{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 x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ze,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(qt,{environmentId:e}),i.supportsEasHosts?(0,Q.jsx)(an,{environmentId:e}):null]})}function _r(e){let t=(0,Z.c)(14),{disabled:n}=e,r=q(vr),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)(ft,{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)(Tt,{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 vr(e){return e.browserAutoShowFloatingPreview}function yr({disabled:e}){let t=q(e=>e.browserProfiles),n=q(e=>e.browserDefaultProfileId),r=Se(),i=J(),{environments:a,isReady:o}=be(),c=ye(),[l,u]=(0,$.useState)(null),[h,g]=(0,$.useState)(null),[_,v]=(0,$.useState)(null),[y,b]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[T,k]=(0,$.useState)(!1),j=ue(),M=ke(tt.clearProfile,{reportFailure:!1}),P={environmentIds:a.map(e=>e.environmentId).filter(e=>j.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await M({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw le(n)}},F=Mn(wt!==null,o,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,R]=(0,$.useState)(!1),z=e||!r,te=E(t).filter(e=>e.kind!==`incognito`),re=ne(te,n)?.id??`default`,ie=e=>{if(!r||I.current)return;let t=we().browserProfiles;if(t.length>=24)return;let n=E(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-${ee()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},ae=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=we().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},se=(e,t)=>{if(r&&!I.current){if(!F){K.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}jn(wt,a.map(e=>e.environmentId),e,P).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||I.current)return;if(!F){C(`Connect to an environment before removing this profile.`);return}C(null),k(!0);try{await jn(wt,o?a.map(e=>e.environmentId):[],e,P)}catch{C(`Profile data could not be deleted. Try again.`),k(!1);return}let t=we();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:d}:{}}),k(!1),v(null)},ce=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),U=(0,$.useCallback)(()=>{wt&&wt.listBrowserImportSources().then(u).catch(()=>u(e=>e??[]))},[]),de=async(e,t,n)=>{if(!wt||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!E(we().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,R(!0);try{let r=await wt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!E(we().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 Ce(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new Ln;let r=new Set(E(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 jn(wt,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof Ln?`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:Rn(e)}}finally{I.current=!1,R(!1)}},W=async e=>{if(wt)try{let t=await wt.listBrowserImportSources();return u(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)(D,{onOpenChange:e=>e&&U(),children:[(0,Q.jsxs)(V,{render:(0,Q.jsx)(N,{size:`sm`,variant:`outline`,disabled:z||L}),children:[(0,Q.jsx)(m,{}),`Add profile`]}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||G,onClick:()=>ie(`New profile`),children:`Blank profile`}),G?(0,Q.jsx)(s,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(A,{}),(0,Q.jsxs)(O,{children:[(0,Q.jsx)(x,{children:`Import from`}),l===null?(0,Q.jsx)(s,{disabled:!0,children:`Looking for browsers…`}):ce.length===0?(0,Q.jsx)(s,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[ce.map(e=>(0,Q.jsx)(s,{disabled:!r||c==null,onClick:()=>{r&&c!=null&&g({source:e,environmentId:c.environmentId,environmentName:mt({isPrimary:!0,environmentId:c.environmentId,runtimeLabel:c.label})})},children:e.name},e.id)),c==null?(0,Q.jsx)(s,{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:te.map((e,t)=>{let n=f(e.id),a=e.id===re;return(0,Q.jsxs)(`div`,{className:B(`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:B(`truncate text-sm text-foreground`,z&&`opacity-64`),children:e.name}):(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:z||L,maxLength:48,value:e.name,onCommit:t=>ae(e.id,t)}),a?(0,Q.jsx)(`span`,{className:B(`flex`,z&&`opacity-64`),children:(0,Q.jsx)(p,{children:`Default`})}):null]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(V,{render:(0,Q.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,disabled:z||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(oe,{align:`end`,children:[(0,Q.jsx)(s,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(s,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?b(e):se(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(s,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{}),(0,Q.jsx)(s,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ht,{open:_!==null,onOpenChange:e=>{!e&&!T&&(v(null),C(null))},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Remove “`,_?.name,`”?`]}),(0,Q.jsx)(yt,{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.`}),S?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:S}):null,F?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)(bt,{children:[(0,Q.jsx)(Ct,{disabled:T,render:(0,Q.jsx)(N,{variant:`outline`,disabled:T}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,disabled:T||!r||!F,onClick:()=>{_&&r&&F&&H(_.id)},children:T?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ht,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(St,{children:[(0,Q.jsxs)(vt,{children:[`Clear “`,y?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(yt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(bt,{children:[(0,Q.jsx)(Ct,{render:(0,Q.jsx)(N,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(N,{variant:`destructive`,onClick:()=>{y&&se(y.id,y.name),b(null)},children:`Clear data`})]})]})}),h?(0,Q.jsx)(vn,{source:h.source,destinationEnvironmentName:h.environmentName,targetProfiles:te.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!G,onImport:e=>de(h.source,h.environmentId,e),onRefreshSource:()=>W(h.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await xe()?.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:()=>g(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!Ae,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(yr,{disabled:t}),(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(Kn,{disabled:t}),(0,Q.jsx)(Yn,{disabled:t}),(0,Q.jsx)(tr,{disabled:t}),(0,Q.jsx)(Qn,{disabled:t}),(0,Q.jsx)(ar,{disabled:t}),(0,Q.jsx)(_r,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dt,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(dt,{children:[i,(0,Q.jsxs)(pt,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(ut,{message:`Only available in the desktop app.`,children:r}):r,(0,Q.jsx)(lr,{}),(0,Q.jsx)(pr,{})]}),(0,Q.jsx)(hr,{})]}),e[2]=a):a=e[2],a}var xr=br;export{xr as component};
2
- //# sourceMappingURL=settings.integrations-Du282Gn7.js.map