@p4code/cli 0.8.3 → 0.8.4
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.
- package/dist/{AcpMcpStdioBridge-D_JnxPWS.mjs → AcpMcpStdioBridge-CD9BQr2l.mjs} +1 -1
- package/dist/{AcpMcpStdioBridge-DBONIB-w.mjs → AcpMcpStdioBridge-DHwGLtep.mjs} +61 -4
- package/dist/bin.mjs +2 -2
- package/dist/{binCli-DouSNynJ.mjs → binCli-Bgjc_5FL.mjs} +406 -247
- package/dist/client/.vite/manifest.json +2125 -2102
- package/dist/client/assets/{AnimatedHeight-DoG4b7y8.js → AnimatedHeight-DYUgtGfz.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DbeJoeXz.js → AuthSurfaceShell-CfLnzrCc.js} +2 -2
- package/dist/client/assets/{CSPContext-DkFc4cYo.js → CSPContext-i9QaQnwk.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-BWTEbaUC.js +2 -0
- package/dist/client/assets/ChatMarkdown-C6UsXjP9.js +65 -0
- package/dist/client/assets/CodexSetupSection.logic-VTayPks4.js +2 -0
- package/dist/client/assets/{ComboboxClear-ZQvkAjz8.js → ComboboxClear-B-iYnTX_.js} +2 -2
- package/dist/client/assets/{CommandBlock-c98wFxMU.js → CommandBlock-dh2vBT70.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-CBuOXkT9.js → ComposerPromptEditor-fIqs_--j.js} +12 -12
- package/dist/client/assets/{CompositeRoot-BMUI_bmJ.js → CompositeRoot-JeAqW-33.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-B69zfKRh.js → ConnectionStatusDot-BCSqqCpf.js} +2 -2
- package/dist/client/assets/{DevicePanel-1xw7KQ15.js → DevicePanel-BckpiUTa.js} +2 -2
- package/dist/client/assets/{DeviceSetup-DemgUuG-.js → DeviceSetup-L8Q-0h1V.js} +2 -2
- package/dist/client/assets/{DialogTitle-BXot7RA0.js → DialogTitle-BRYusK7T.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-vAZP7JBy.js → DiffCommentAnnotation-DxxGd0sM.js} +3 -3
- package/dist/client/assets/{DiffFileTree-BhqF8nD5.js → DiffFileTree-C2N3dwbB.js} +2 -2
- package/dist/client/assets/DiffPanel-0HWHkPjD.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-D4VIo5Vu.js → DiffWorkerPoolProvider-Dd8cIhyy.js} +3 -3
- package/dist/client/assets/{EnvironmentMachineIcon-DPQkDtvr.js → EnvironmentMachineIcon-giyHKjbh.js} +2 -2
- package/dist/client/assets/{ExpandableText-EZ9C25tN.js → ExpandableText-dJhpznMp.js} +3 -3
- package/dist/client/assets/{FieldControl-C4IsJLMZ.js → FieldControl-CxuWXcJE.js} +2 -2
- package/dist/client/assets/{FileDiff-H9QHqXa0.js → FileDiff-EWd5oWlS.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-DGm_SU_e.js → FilePreviewPanel-D3kud1xs.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-BSYFyChk.js → FoldedSettingsSection-CsN_jb3V.js} +2 -2
- package/dist/client/assets/{FormContext-DiXpMuU8.js → FormContext-Vk5aZcR6.js} +2 -2
- package/dist/client/assets/{Icons-DA4msgfR.js → Icons-DM1SzuL7.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-7EBA0xLE.js → KeybindingsSettings.logic-BcJGxVhV.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-YjEc2OIw.js → NoProjectsHero-DrkWMiG4.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-BfRIRM0o.js → PanelLayoutControls-DjmAXscr.js} +8 -8
- package/dist/client/assets/{PierreEntryIcon-BxxykifK.js → PierreEntryIcon-BJ8xtDqQ.js} +2 -2
- package/dist/client/assets/PreviewPanel-D_JLD7YP.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-Bqo3T1SR.js +2 -0
- package/dist/client/assets/{ProjectFavicon-CiauSitF.js → ProjectFavicon-By6-kpgk.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-GDqk2LEH.js → ProjectIconPickerDialog-Cx-QcJLy.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Bqe3OyZR.js → ProjectMonogram-BJVBhwjz.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-D_OC5vdS.js → ProviderAuthTerminal-DBiUwanv.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-Bfpy_Rw1.js → ProviderModelPicker-DV64N-fE.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-BA6yGdRn.js → ProviderSettingsForm-Tkr5xKCJ.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-BOM7mgfd.js → PullRequestCodeTab-DijqMjN0.js} +3 -3
- package/dist/client/assets/{ReadOnlySourcePreview-C3LnvSkA.js → ReadOnlySourcePreview-CydDaO9-.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-C-EIIrrq.js → RenderErrorBoundary-D4M2khxk.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-DFtwNfb8.js → ScheduledTasksSettings-D_Z_3GVl.js} +4 -4
- package/dist/client/assets/ScopedSwitch-B8wdvttG.js +2 -0
- package/dist/client/assets/{SecretInput-Be5Akw8x.js → SecretInput-CNWNAhNe.js} +2 -2
- package/dist/client/assets/SettingsPanels-DAv_V_mk.js +39 -0
- package/dist/client/assets/{SettingsPanels.logic-CLB8Pu-U.js → SettingsPanels.logic-BYa5iHwl.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CVoWG1oN.js → SettingsScopeNotice-CcLrVZWz.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-ClNzwIQw.js → T3ConnectAccountPages-DjITJ87o.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-BqM_Vqe1.js → T3ConnectSidebarSignIn-B-rQNmqG.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-vVmQV_Vv.js → ThemeEditorPanel-CJGqmeTA.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-aLeVbe6g.js → ThreadTerminalDrawer-Cdl3DAIx.js} +4 -4
- package/dist/client/assets/{Virtualizer-DTOYU5Jp.js → Virtualizer-Bk-YJlPj.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-C9OPPGJE.js → WorkspaceBreadcrumb-DSFWvH19.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-DtXJ5ept.js → WorkspacePageContainer-BXUbfbEU.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-5zzLFpEN.js → WorkspacePageHeader-LbIzJCDs.js} +2 -2
- package/dist/client/assets/_chat-oHhtDqeh.js +45 -0
- package/dist/client/assets/{_chat.index-BP1JWABB.js → _chat.index-CTew1WmI.js} +2 -2
- package/dist/client/assets/_chat.new-COSURrfS.js +4 -0
- package/dist/client/assets/{_chat.pull-requests-B6-Vck8B.js → _chat.pull-requests-BlXnsqov.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-BXvAfzAg.js → abnfDiagram-VCTEODGH-brKh7bzh.js} +2 -2
- package/dist/client/assets/{alert-B-or1ble.js → alert-quTC4YbH.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-BMFS-mJW.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-MEUA3QVe.js → architectureDiagram-5GKGNRK7-BVDiXgfK.js} +2 -2
- package/dist/client/assets/archive-x-D3w6saMD.js +2 -0
- package/dist/client/assets/arrow-left-BFquhiaO.js +1 -0
- package/dist/client/assets/arrow-right-DiV8cYUQ.js +1 -0
- package/dist/client/assets/arrow-up-down-BDQTjPr1.js +1 -0
- package/dist/client/assets/assets-CRmNKuHc.js +2 -0
- package/dist/client/assets/bell-BvJp3v99.js +1 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BOdLeYJh.js → blockDiagram-I7D4REHJ-CzoRCJDe.js} +2 -2
- package/dist/client/assets/blocks-NuR9qdGl.js +1 -0
- package/dist/client/assets/bot-mvw1ddnU.js +1 -0
- package/dist/client/assets/{browserHistoryStore-BJD0OPpb.js → browserHistoryStore-Cw3ffhOV.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CoogLhhO.js → browserLinkTarget-KTI1tSl7.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-COZrm1O8.js → c4Diagram-7LVT6UL2-CfyobiDu.js} +2 -2
- package/dist/client/assets/calendar-clock-CuvWKWXS.js +1 -0
- package/dist/client/assets/channel-Cf2J77rP.js +2 -0
- package/dist/client/assets/chart-no-axes-column-Hfs9TSWj.js +1 -0
- package/dist/client/assets/checkbox-BHsP70Vt.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-Bs-Fo0v1.js → chunk-4HAMMTFA-CPnMRFld.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-DpOWzc3R.js → chunk-75Z2AOVW-C85FbOND.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-Bgpi4W6E.js → chunk-DU6HZSFF-s_qrqgaz.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-CLxgnzXS.js → chunk-F27PBJKO-90tTgV9x.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-D98J5Pan.js → chunk-GMAD6QVW-CYRPr7hZ.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-VuCIOHGI.js → chunk-GVQU2GXP-CxAvUb1-.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-DXIyBsaE.js → chunk-IMKFNOWR-794woOlB.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-CrMlU3ZU.js → chunk-L3NEJ4N5-JXcRdiIo.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-V2__4gNB.js → chunk-OSK3NFVY-ToxVvjW1.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-BrPw6V5F.js → chunk-P2QGCYS3-JB1PmfIc.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-DBQ9Y51x.js → chunk-POPQ4Y6H-RMxlqjhd.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-BN6AAbfF.js → chunk-PWAF6VOD-AB579n2y.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-Vay44dCU.js → chunk-SHT3W25Y-CV2hE9-g.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-CcGlNErV.js → chunk-SVP7TREG-b2Gs4u5W.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-Dk1P_xkD.js → chunk-TICWLB2K-CtkYqLLJ.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-D9m4giYc.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-D9m4giYc.js +2 -0
- package/dist/client/assets/{color-picker-gBclRe5T.js → color-picker-CFc6YapE.js} +2 -2
- package/dist/client/assets/{combobox-C81z_216.js → combobox-WVgW_agq.js} +2 -2
- package/dist/client/assets/{command-DnJZPOmf.js → command-w6WcFbeZ.js} +2 -2
- package/dist/client/assets/{connect-Am2IS-vZ.js → connect-D_ncSJiK.js} +2 -2
- package/dist/client/assets/{connect-agent-Cw1s7hYt.js → connect-agent-8mHL_bau.js} +2 -2
- package/dist/client/assets/corner-left-up-DedXC9IG.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-0s30RxOq.js → cynefin-OW5HDTMX-BDIjrXPB.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Drd0Msog.js → cynefinDiagram-5FMLGOSQ-h9tw36zs.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-BMfu7T0o.js → dagre-GXQ25YYZ-D3s1T81F.js} +2 -2
- package/dist/client/assets/{device-C_oIGJqy.js → device-DhvzgETq.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-8egngY0E.js → diagram-S7CK7UJ4-DTawhR4X.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-BALPQoDH.js → diagram-UQ7AKVKN-CTUDQHKY.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BjyJZVGC.js → diagram-VSXAHHWV-DsbNNWnj.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-B9f6eKkq.js → diagram-VX7I27RA-BBy99N9O.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-CRUj2d3v.js → diagram-Z3DM3KII-CEy69xv1.js} +2 -2
- package/dist/client/assets/{dialog-Bn1u_Xoc.js → dialog-CPLO59bH.js} +2 -2
- package/dist/client/assets/{diffRendering-C26rfQBu.js → diffRendering-BlmxsRF9.js} +2 -2
- package/dist/client/assets/{discovery-list-Fg_u6w-x.js → discovery-list-D0LBmkzJ.js} +2 -2
- package/dist/client/assets/{dist-DtKaGeij.js → dist-DZWol-cd.js} +3 -3
- package/dist/client/assets/download-CUcdw53T.js +1 -0
- package/dist/client/assets/{draft-input-D8eUYug0.js → draft-input-CmvO5rl_.js} +2 -2
- package/dist/client/assets/{duoViewer-CBoAg4hS.js → duoViewer-B0QD-fyi.js} +2 -2
- package/dist/client/assets/dynamic-tF-2a8Zt.js +3 -0
- package/dist/client/assets/earth-BqADiov-.js +1 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-BSbPiqg7.js → ebnfDiagram-PWID7BFC-B9LWNbny.js} +2 -2
- package/dist/client/assets/ellipsis-BUF_4-Z7.js +1 -0
- package/dist/client/assets/{embeddedScripts-Dsi0aZEx.js → embeddedScripts-B1MGNr-e.js} +2 -2
- package/dist/client/assets/{empty-C-gDaZ_z.js → empty-tr-EsB66.js} +2 -2
- package/dist/client/assets/entities-DqhRur25.js +2 -0
- package/dist/client/assets/{erDiagram-RLTQ6QDP-sL_q0j_k.js → erDiagram-RLTQ6QDP-Nu9IMF5-.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-CHuv5_8f.js +1 -0
- package/dist/client/assets/eye-C8OhITrC.js +1 -0
- package/dist/client/assets/file-search-ComEiFQ8.js +1 -0
- package/dist/client/assets/{fileLinks-DubkPNVt.js → fileLinks-BHAkEh9k.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-VtSAPhxL.js → fileTreeExpansion-BierCVUV.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-wmC7eeQc.js +1 -0
- package/dist/client/assets/folder-git-2-COyuVTXA.js +1 -0
- package/dist/client/assets/folder-open-DZzz50kK.js +1 -0
- package/dist/client/assets/folder-plus-BzJT8jXs.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DCiKb0rQ.js → ganttDiagram-EL5Y4UJY-D_s5F9rI.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-DU5zpXo3.js → getDiffFileInput-B5j6sQbM.js} +2 -2
- package/dist/client/assets/git-branch-CCzcdr93.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-DfRe6ZT5.js → gitGraph-4MIJSDKK-BASxGOL3.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Bt7diV1n.js → gitGraphDiagram-WWUBYQGX-BtA4z_1S.js} +2 -2
- package/dist/client/assets/grip-vertical-COceJQZo.js +1 -0
- package/dist/client/assets/{guideRunStore-CF9bByzk.js → guideRunStore-C95PbUuP.js} +2 -2
- package/dist/client/assets/hard-drive-BKLzbeTS.js +1 -0
- package/dist/client/assets/history-CAAEfWkp.js +1 -0
- package/dist/client/assets/house-U4txgvXa.js +1 -0
- package/dist/client/assets/{htmlRender-vOqAdlJH.js → htmlRender-DgdJ8GkZ.js} +2 -2
- package/dist/client/assets/{index-1HGbj0-7.js → index-D_uSeco8.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-0FtL6-Am.js → info-A6RAGUB7-Q4Qe5TI_.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-BPLvtPCc.js → infoDiagram-27XIBGKW-CNnDxcfZ.js} +2 -2
- package/dist/client/assets/{input-Cd_0h7h_.js → input-DaCwubQj.js} +2 -2
- package/dist/client/assets/{input-group-CJ7ZOvDN.js → input-group-DJwXFHGO.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DVcx0XTh.js → ishikawaDiagram-5VMMS53U-Drb03OY6.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-w46bbjL2.js → journeyDiagram-3NMN7TZE-CynC6Up1.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-C41yE_yV.js → kanban-definition-UXKFOSKX-DfyC_hIe.js} +2 -2
- package/dist/client/assets/{kbd-c17EHIx1.js → kbd-R3wkAau0.js} +2 -2
- package/dist/client/assets/{keybindings-uYm_vnXl.js → keybindings-QrjnJ5jB.js} +2 -2
- package/dist/client/assets/keyboard-kgy5M4lo.js +1 -0
- package/dist/client/assets/{lazyRouteComponent-CTVuEvaz.js → lazyRouteComponent-cLZROdN-.js} +2 -2
- package/dist/client/assets/{line-tu9XZ0qp.js → line-C3gvAOpf.js} +2 -2
- package/dist/client/assets/{link-C4sEUNOK.js → link-Bl21VXlj.js} +2 -2
- package/dist/client/assets/link-C1k5F8-V.js +1 -0
- package/dist/client/assets/{linkedPrompt-VYl90REW.js → linkedPrompt-DAcv0O_f.js} +2 -2
- package/dist/client/assets/list-CU7BIfIS.js +1 -0
- package/dist/client/assets/main-BsiZpg85.css +2 -0
- package/dist/client/assets/main-uLg3xUJM.js +30 -0
- package/dist/client/assets/{mediaReference-BTVvzs2e.js → mediaReference-DN8lzwOF.js} +2 -2
- package/dist/client/assets/{mediaSource-DXHFWHMA.js → mediaSource-0nIWHHoL.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-DNd412Oc.js → mermaid-parser.core-B3cYmj0d.js} +4 -4
- package/dist/client/assets/{mermaid.core-CyE6QOQY.js → mermaid.core-9ekBSYCO.js} +5 -5
- package/dist/client/assets/message-circle-question-mark-wTwD9xwk.js +1 -0
- package/dist/client/assets/message-square-dashed-Hcy2Q2EP.js +1 -0
- package/dist/client/assets/message-square-lCzwndCW.js +1 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-DH1uxdTm.js → mindmap-definition-YA3MSWOX-K4rtZu2z.js} +2 -2
- package/dist/client/assets/mouse-pointer-2-BFFAEWXU.js +1 -0
- package/dist/client/assets/number-field-pAaF-e0N.js +2 -0
- package/dist/client/assets/{observeResize-Csvw3hy4.js → observeResize-BEjNJ-rK.js} +2 -2
- package/dist/client/assets/{onboarding-CJPrQc71.js → onboarding--LqcHqO0.js} +2 -2
- package/dist/client/assets/openFileInPreview-NwK1GJFN.js +2 -0
- package/dist/client/assets/{p4ProjectFile-BWszgcDk.js → p4ProjectFile-CVEoe1SJ.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-DflCOkCN.js → packet-AYTQ26CC-kDkfULQq.js} +1 -1
- package/dist/client/assets/{pair-Dd_e1jxq.js → pair-Bxo10T5t.js} +2 -2
- package/dist/client/assets/palette-BkpHEJXn.js +1 -0
- package/dist/client/assets/panel-left-DNz3ps89.js +1 -0
- package/dist/client/assets/panels-top-left-bKuZF4FX.js +1 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-Cnx9j2xX.js → pegDiagram-XKGWAZYB-6b8AqBYd.js} +2 -2
- package/dist/client/assets/{phoneViewer-B9EUVDD2.js → phoneViewer-Vql_2ZzY.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-CDwew7fN.js → pie-WAS4IAKB-CfoqFIwI.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-BxejSN6k.js → pieDiagram-E7YTZNPT-i8FgTMai.js} +2 -2
- package/dist/client/assets/{pierre-icons-C839Otpo.js → pierre-icons-CBmlpFgP.js} +2 -2
- package/dist/client/assets/{popover-CKyetthu.js → popover-BXin7C0B.js} +2 -2
- package/dist/client/assets/{preview-CjgXQQdj.js → preview-6t42evKb.js} +2 -2
- package/dist/client/assets/{preview-CEMnbqVB.js → preview-C9iPHfb1.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-B9Lqaaij.js → previewMiniPlayerStore-BDRPsVx0.js} +2 -2
- package/dist/client/assets/primary-DOpcfgLH.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-Dulej3bP.js +2 -0
- package/dist/client/assets/projectFilesQueryState-C1crs3C8.js +2 -0
- package/dist/client/assets/projectScriptEditor-ku2tGeKq.js +2 -0
- package/dist/client/assets/providerSkills-D0IxW0_5.js +2 -0
- package/dist/client/assets/{pullRequestDetail.logic-DTxWqKoX.js → pullRequestDetail.logic-BiwUoz1M.js} +4 -4
- package/dist/client/assets/{pullRequestReviewStore-C5gaoGaz.js → pullRequestReviewStore-J7YIGsZ9.js} +2 -2
- package/dist/client/assets/pullRequests-BQ9KruZm.js +2 -0
- package/dist/client/assets/puzzle-wfhgUaHl.js +1 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Bj4FEpOg.js → quadrantDiagram-AXDQQJYC-DzvIAxCm.js} +2 -2
- package/dist/client/assets/queries-CEjFwxVW.js +2 -0
- package/dist/client/assets/query-D5pQUQvZ.js +2 -0
- package/dist/client/assets/{radar-RG4KPBEZ-DEopr2Gv.js → radar-RG4KPBEZ-BnTV8utT.js} +1 -1
- package/dist/client/assets/{radio-group-fljQQ7Xp.js → radio-group-DhpPG5HP.js} +2 -2
- package/dist/client/assets/{railroad-74A4TZTK-BSAOgUn6.js → railroad-74A4TZTK-nxEBKbUo.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-bDIjPMME.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BREFlihg.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-B0hEZefb.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-BSOJGJ6v.js → railroadDiagram-O6MQD6OU-DFdlMVKn.js} +2 -2
- package/dist/client/assets/{renderScheduler-v8LIpnE2.js → renderScheduler-DWKKtxcJ.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-Bp5TqEho.js → requirementDiagram-BXWQKSXE-BW8o0F_p.js} +2 -2
- package/dist/client/assets/{rightPanelStore-DqMd0tFH.js → rightPanelStore-CQ94819A.js} +2 -2
- package/dist/client/assets/rotate-ccw-CkpQmcC5.js +1 -0
- package/dist/client/assets/rotate-cw-BAiACGtX.js +1 -0
- package/dist/client/assets/runtime-Bsb2I_n2.js +2 -0
- package/dist/client/assets/runtime-DkYxB4ri.js +6 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-C7KUHrP7.js → sankeyDiagram-P5KCCOFB-JA6FB6i0.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-C3Mbc4mh.js → scheduledTasksSettings.logic-C_AdQNVz.js} +3 -3
- package/dist/client/assets/{scroll-area-LhpLVf8r.js → scroll-area-BYyfw-9F.js} +2 -2
- package/dist/client/assets/select-CjGEfXy_.js +2 -0
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-Bs9mfTLC.js → sequenceDiagram-WJ2MYXX4-DgBrrcVR.js} +2 -2
- package/dist/client/assets/server-BYntb2dN.js +2 -0
- package/dist/client/assets/session-eLrubJEW.js +2 -0
- package/dist/client/assets/{session-logic-DneZDyPZ.js → session-logic-l1juLk9v.js} +5 -5
- package/dist/client/assets/settings-2-CDBTJPBs.js +1 -0
- package/dist/client/assets/settings-DDvSs7LG.js +1 -0
- package/dist/client/assets/{settings-C8FiUQu0.js → settings-xKzLy5aw.js} +2 -2
- package/dist/client/assets/settings.appearance-CEA3GKAa.js +2 -0
- package/dist/client/assets/settings.archived-DPWjmD2l.js +2 -0
- package/dist/client/assets/{settings.computer-use-B3Ujc2AS.js → settings.computer-use-DZu90DiM.js} +2 -2
- package/dist/client/assets/settings.connections-BKWbsMUk.js +2 -0
- package/dist/client/assets/settings.data-controls-CBrcsSvm.js +2 -0
- package/dist/client/assets/{settings.decisions-C5UE4drK.js → settings.decisions-CGz9znLs.js} +2 -2
- package/dist/client/assets/settings.diagnostics-DKkOOzoq.js +2 -0
- package/dist/client/assets/settings.general-CoPWyKC4.js +2 -0
- package/dist/client/assets/{settings.integrations-BCtpk2dY.js → settings.integrations-K3Jwfkyd.js} +2 -2
- package/dist/client/assets/{settings.keybindings-DfFrYXxY.js → settings.keybindings-BbR3qnVs.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-CqRM1gRd.js → settings.open-source-licenses-Mh-zg97k.js} +2 -2
- package/dist/client/assets/settings.plugins-BI68kAsM.js +5 -0
- package/dist/client/assets/{settings.projects-CT-l0EfX.js → settings.projects-BahZsoyx.js} +4 -4
- package/dist/client/assets/settings.providers-Dsnq0-AL.js +3 -0
- package/dist/client/assets/settings.scheduled-tasks-BOpVl_XK.js +2 -0
- package/dist/client/assets/{settings.snap-shot-BMxV-ClC.js → settings.snap-shot-Bs_DZS7D.js} +2 -2
- package/dist/client/assets/settings.source-control-Akrp_mGm.js +2 -0
- package/dist/client/assets/{settings.storage-DKm6BZ2r.js → settings.storage-fl2BN0Cu.js} +2 -2
- package/dist/client/assets/settingsLayout-DV36_Jgq.js +3 -0
- package/dist/client/assets/shield-check-yRjvgn4y.js +1 -0
- package/dist/client/assets/shield-question-mark-DyVUewRO.js +1 -0
- package/dist/client/assets/{sidebar-DI1ZJMkM.js → sidebar-MBwCdIpv.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DXRKqrOP.js → sidebarProjectGrouping-Sm7y9bd1.js} +2 -2
- package/dist/client/assets/{skeleton-BlMPaSbD.js → skeleton-CS8ffFVv.js} +2 -2
- package/dist/client/assets/{sortable.esm-CnSn9HhJ.js → sortable.esm-CwrTFe-B.js} +2 -2
- package/dist/client/assets/{sourceControl-ogZI3Qhj.js → sourceControl-DyHbbOxl.js} +2 -2
- package/dist/client/assets/{spinner-I_NrXl2i.js → spinner-B7a-VUeR.js} +2 -2
- package/dist/client/assets/square-pen-BrE59gWn.js +1 -0
- package/dist/client/assets/{standalone-page-C0mvdk0N.js → standalone-page-DTvNMgJy.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-lcvbm4gc.js → stateDiagram-D77RDMKH-gHEAo7xC.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CGT21P8W.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-BftXRbCQ.js → swimlanes-42K2YHIH-_qZ90QGb.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-D9Ttx7dQ.js +9 -0
- package/dist/client/assets/{terminal-links-BWEpET__.js → terminal-links-Dc2HX7Ov.js} +2 -2
- package/dist/client/assets/{terminalSessions-CQOPPXfy.js → terminalSessions-DK9WKgga.js} +2 -2
- package/dist/client/assets/text-search-CFbEY3qo.js +1 -0
- package/dist/client/assets/{textarea-Bu723jDd.js → textarea-CYXHTTG6.js} +2 -2
- package/dist/client/assets/{themePalette-CAxv2FDZ.js → themePalette-zVYGoviO.js} +3 -3
- package/dist/client/assets/threadSort-Byzu7B1A.js +2 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-_aV_EuqE.js → timeline-definition-24CTP7MA-BxWmcZQs.js} +2 -2
- package/dist/client/assets/toast-BX9uiMAh.js +2 -0
- package/dist/client/assets/{toggle-B5fidRv0.js → toggle-fk33ppsB.js} +2 -2
- package/dist/client/assets/{toggle-group-DCQTLIPb.js → toggle-group-W0bDGcPB.js} +2 -2
- package/dist/client/assets/tooltip-B0rhqi5b.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-ALGd5g_W.js → treeView-Q6P3EWNA-BsPhq-Fl.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-CGQrkzMs.js → treemap-WGGIJYW6-DZ3fnU-o.js} +1 -1
- package/dist/client/assets/{usage-DmGxFUdr.js → usage-DlNazxzV.js} +2 -2
- package/dist/client/assets/{usageAccess-CY-JtQnU.js → usageAccess-Mp1Nbm2r.js} +2 -2
- package/dist/client/assets/{usageFormat-Cs-UHzLq.js → usageFormat-ZiOrCBxk.js} +2 -2
- package/dist/client/assets/{usageShortcuts-CP952NDO.js → usageShortcuts-Be5hddhr.js} +2 -2
- package/dist/client/assets/use-atom-command-RgcuqzP9.js +2 -0
- package/dist/client/assets/{useAriaLabelledBy-4I5xhNlP.js → useAriaLabelledBy-D-n0SDV6.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-Bzaf_PDE.js → useHandleNewThread-BQ5wqZab.js} +2 -2
- package/dist/client/assets/{useLocation-QINZoaPz.js → useLocation-BN5q7LjL.js} +2 -2
- package/dist/client/assets/useNavigate-CDvr3Yvg.js +2 -0
- package/dist/client/assets/{useNavigateBack-CbbWf0z6.js → useNavigateBack-BWhsiBJ5.js} +2 -2
- package/dist/client/assets/{useParams-BTKEXLBT.js → useParams-DQgx0pmy.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-Zbsv_90x.js → usePermissionStatus-FtemMvNg.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-DGTJ6ne6.js → usePullRequestActions-D97OVSkM.js} +3 -3
- package/dist/client/assets/{useRegisterFieldControl-Cr87Snzk.js → useRegisterFieldControl-KOnbOVnX.js} +2 -2
- package/dist/client/assets/useScopedModelAvailability-BTR7tHpB.js +2 -0
- package/dist/client/assets/useSettings-BIggY3j1.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-BYqrzQIx.js → useT3ConnectAuthPrompt-CPGDAWRk.js} +2 -2
- package/dist/client/assets/{utils-DmfMX1v5.js → utils-BxISc9RR.js} +17 -17
- package/dist/client/assets/vcsRefInvalidation-h_E9Figo.js +2 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-9Jx7JrgE.js → vennDiagram-4TSXK5OY-BnH-hzBf.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-qG58RzFw.js → wardley-WFR3VGLG-BbiFWq4f.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-8Ml3tzfR.js → wardleyDiagram-VM6X3IG4-DPf4ISf5.js} +2 -2
- package/dist/client/assets/{welcome-CPcQsM9H.js → welcome-DjYohRu3.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-C-u_0wo0.js → xychartDiagram-S5SC5T6Z-oaZh5sFY.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ChatGptUsageButton-D93cMeTp.js +0 -2
- package/dist/client/assets/ChatMarkdown-CLD9Y6dg.js +0 -65
- package/dist/client/assets/CodexSetupSection.logic-DJw6xB7P.js +0 -2
- package/dist/client/assets/DiffPanel-Dqh76p3E.js +0 -2
- package/dist/client/assets/PreviewPanel-QkMfuC1J.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-C6wxaRmJ.js +0 -2
- package/dist/client/assets/ScopedSwitch-DsEcG6rk.js +0 -2
- package/dist/client/assets/SettingsPanels-CI-FknGh.js +0 -39
- package/dist/client/assets/_chat-BKcYL38S.js +0 -45
- package/dist/client/assets/_chat.new-BX5LyFum.js +0 -4
- package/dist/client/assets/architecture-7GRP2DOG-DqzmsB35.js +0 -1
- package/dist/client/assets/archive-x-BN7DYXYC.js +0 -2
- package/dist/client/assets/arrow-left-DI1Oo3nI.js +0 -1
- package/dist/client/assets/arrow-right-DRgAj8le.js +0 -1
- package/dist/client/assets/arrow-up-down-C6OEPUz7.js +0 -1
- package/dist/client/assets/assets-_CWIS9vb.js +0 -2
- package/dist/client/assets/bell-DW1iPWzH.js +0 -1
- package/dist/client/assets/blocks-DKOyf4K4.js +0 -1
- package/dist/client/assets/bot-DYcBiSui.js +0 -1
- package/dist/client/assets/calendar-clock-BqL7OneL.js +0 -1
- package/dist/client/assets/channel-DbsUczqI.js +0 -2
- package/dist/client/assets/chart-no-axes-column-CtQ7A5KE.js +0 -1
- package/dist/client/assets/checkbox-CaZu1EKJ.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-DotTjRcO.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-DotTjRcO.js +0 -2
- package/dist/client/assets/corner-left-up-BT-2gfvH.js +0 -1
- package/dist/client/assets/download-DNjijPHR.js +0 -1
- package/dist/client/assets/dynamic-p5s8CQGu.js +0 -3
- package/dist/client/assets/earth-DGA4iwBJ.js +0 -1
- package/dist/client/assets/ellipsis-Cbd-Ac19.js +0 -1
- package/dist/client/assets/entities-82m-Smm-.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-OEIkdS25.js +0 -1
- package/dist/client/assets/eye-BUplLfz9.js +0 -1
- package/dist/client/assets/file-search-CcnLiCku.js +0 -1
- package/dist/client/assets/fileContextMenu-Dcs50sFI.js +0 -2
- package/dist/client/assets/flowDiagram-HODETNUW-BDZPeVYD.js +0 -1
- package/dist/client/assets/folder-git-2-5RczFn6m.js +0 -1
- package/dist/client/assets/folder-open-PwiT4lvQ.js +0 -1
- package/dist/client/assets/folder-plus--IokSBmG.js +0 -1
- package/dist/client/assets/git-branch-jf-x2c63.js +0 -1
- package/dist/client/assets/grip-vertical-OASdudbE.js +0 -1
- package/dist/client/assets/hard-drive-BxN5msOb.js +0 -1
- package/dist/client/assets/history-DdVU5lcf.js +0 -1
- package/dist/client/assets/house-mbks5FAa.js +0 -1
- package/dist/client/assets/keyboard-DckDn_SM.js +0 -1
- package/dist/client/assets/link-Dw3ue0Rm.js +0 -1
- package/dist/client/assets/list-1rglB5Lq.js +0 -1
- package/dist/client/assets/main-BB3F4O6Y.js +0 -30
- package/dist/client/assets/main-CnVegMVf.css +0 -2
- package/dist/client/assets/message-circle-question-mark-CLPs5tYP.js +0 -1
- package/dist/client/assets/message-square-BInn4EwR.js +0 -1
- package/dist/client/assets/message-square-dashed-Dea7_sXv.js +0 -1
- package/dist/client/assets/mouse-pointer-2-BPl1Yb5N.js +0 -1
- package/dist/client/assets/number-field-CVtwAsLe.js +0 -2
- package/dist/client/assets/openFileInPreview-C3O_ayUT.js +0 -2
- package/dist/client/assets/palette-DC6st-Ld.js +0 -1
- package/dist/client/assets/panel-left-BxNE-mqR.js +0 -1
- package/dist/client/assets/panels-top-left-CpwWAaSX.js +0 -1
- package/dist/client/assets/primary-uszZTzpR.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-CWT2YTBZ.js +0 -2
- package/dist/client/assets/projectFilesQueryState-ELgLflk5.js +0 -2
- package/dist/client/assets/projectScriptEditor-BAuP_HeU.js +0 -2
- package/dist/client/assets/pullRequests-DjbQ49mZ.js +0 -2
- package/dist/client/assets/puzzle-foT3lPUZ.js +0 -1
- package/dist/client/assets/queries-Cq5C9N-K.js +0 -2
- package/dist/client/assets/query-DpwJQzeq.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-C_4g8TOP.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-CHZB5YoP.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-B-PbMjlp.js +0 -1
- package/dist/client/assets/rotate-ccw-rssHZoOL.js +0 -1
- package/dist/client/assets/rotate-cw-D726GGah.js +0 -1
- package/dist/client/assets/runtime-BQJQC-Ny.js +0 -6
- package/dist/client/assets/runtime-C6FwphD-.js +0 -2
- package/dist/client/assets/select-B4VvMEs2.js +0 -2
- package/dist/client/assets/server-BD_Y5Gsn.js +0 -2
- package/dist/client/assets/session-DsbInyNV.js +0 -2
- package/dist/client/assets/settings-2-Qrnq-5XQ.js +0 -1
- package/dist/client/assets/settings-MUAsYy_j.js +0 -1
- package/dist/client/assets/settings.appearance-B5-X4oyX.js +0 -2
- package/dist/client/assets/settings.archived-DVUmF0nS.js +0 -2
- package/dist/client/assets/settings.connections-EQYBOa7e.js +0 -2
- package/dist/client/assets/settings.diagnostics-CBcOEqPM.js +0 -2
- package/dist/client/assets/settings.general-BOmr4mSV.js +0 -2
- package/dist/client/assets/settings.plugins-DC4js6dE.js +0 -5
- package/dist/client/assets/settings.providers-CJuBTAiR.js +0 -3
- package/dist/client/assets/settings.scheduled-tasks-CvLNaadX.js +0 -2
- package/dist/client/assets/settings.source-control-DJWucVsM.js +0 -2
- package/dist/client/assets/settingsLayout-jP1a50ek.js +0 -3
- package/dist/client/assets/shield-check-k2SY7zjx.js +0 -2
- package/dist/client/assets/shield-question-mark-kKJBH4Uj.js +0 -1
- package/dist/client/assets/square-pen-DilH8raK.js +0 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DuLLhUia.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BrHQKVnf.js +0 -9
- package/dist/client/assets/text-search-DpDcKspl.js +0 -1
- package/dist/client/assets/threadSort-BoaTqeGH.js +0 -2
- package/dist/client/assets/toast-CjelgyqV.js +0 -2
- package/dist/client/assets/tooltip-taOyJZax.js +0 -2
- package/dist/client/assets/use-atom-command-CQHjSXPR.js +0 -2
- package/dist/client/assets/useNavigate-4thj06GJ.js +0 -2
- package/dist/client/assets/useScopedModelAvailability-BEfh0WXx.js +0 -2
- package/dist/client/assets/useSettings-CLtJrOYI.js +0 -3
- package/dist/client/assets/vcsRefInvalidation-nP-qgsHs.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$b as n,$g as r,$n as i,Bf as a,Cf as o,Df as s,Ef as c,Ff as l,Gf as u,Gm as d,Gn as f,Go as p,Ho as m,If as h,Ko as g,Lf as _,Mf as v,Nf as y,Of as b,Pf as x,Qn as S,Rf as C,Ro as w,Vf as T,Yn as E,Zn as D,Zo as O,_v as k,ar as A,ch as j,cr as M,dg as N,es as P,ha as ee,ir as te,jf as ne,jx as re,kc as ie,mf as ae,nx as oe,or as se,ox as ce,pp as le,rr as ue,rx as F,sl as de,sr as I,t as fe,tr as pe,vf as me,wf as L,xf as he,xg as ge,zf as R}from"./utils-BxISc9RR.js";import{t as _e}from"./chevron-right-NbahR9_s.js";import{t as ve}from"./chevrons-left-right-ellipsis-D2Qu5H2y.js";import{t as ye}from"./plus-Cr075-cy.js";import{t as be}from"./qr-code-D3ZNC-wH.js";import{t as xe}from"./route-CQ6wZzks.js";import{t as Se}from"./terminal-6kKaKv-Q.js";import{t as z}from"./x-CSwbgjBe.js";import{At as B,C as Ce,Dn as we,Dt as Te,Et as V,Ht as Ee,L as De,Ot as Oe,P as ke,Tt as Ae,U as je,Vt as Me,an as Ne,b as Pe,et as H,o as Fe}from"./runtime-DkYxB4ri.js";import{E as U,Et as W,F as Ie,S as Le,St as Re,Tt as ze,_ as Be,bt as Ve,t as G}from"./runtime-Bsb2I_n2.js";import{a as He,n as Ue,t as We}from"./tooltip-B0rhqi5b.js";import{a as Ge,c as Ke,o as qe,s as Je,t as Ye}from"./select-CjGEfXy_.js";import{t as Xe}from"./spinner-B7a-VUeR.js";import{i as K,p as Ze}from"./toast-BX9uiMAh.js";import{A as Qe,D as $e,E as et,O as tt,b as q,c as nt,et as rt,s as it,v as at}from"./useSettings-BIggY3j1.js";import{f as ot,h as st,s as ct}from"./server-BYntb2dN.js";import{a as J,i as lt,n as ut,s as dt}from"./session-eLrubJEW.js";import{n as ft}from"./query-D5pQUQvZ.js";import{t as pt}from"./use-atom-command-RgcuqzP9.js";import{n as Y}from"./toastHelpers-Dsph6LwL.js";import{i as mt,r as ht}from"./timestampFormat-wac2e_Jz.js";import{t as gt}from"./checkbox-BHsP70Vt.js";import{t as _t}from"./textarea-CYXHTTG6.js";import{_ as vt,b as yt,g as bt,h as xt,v as St,x as Ct,y as wt}from"./command-w6WcFbeZ.js";import{t as Tt}from"./input-DaCwubQj.js";import{t as Et}from"./scroll-area-BYyfw-9F.js";import{a as Dt,c as Ot,i as kt,l as At,n as jt,o as Mt,r as Nt,s as Pt,t as Ft}from"./dialog-CPLO59bH.js";import{n as It}from"./T3ConnectAccountPages-DjITJ87o.js";import{a as Lt,i as Rt,o as zt,r as Bt,t as Vt}from"./empty-tr-EsB66.js";import{t as Ht}from"./AnimatedHeight-DYUgtGfz.js";import{C as Ut,_ as Wt,w as Gt,y as Kt}from"./keybindings-QrjnJ5jB.js";import{i as qt,o as Jt,t as Yt}from"./popover-BXin7C0B.js";import{a as Xt,b as Zt,c as Qt,h as $t,i as en,l as tn,m as nn,n as rn,o as an,p as on,s as sn,t as cn,u as ln}from"./sortable.esm-CwrTFe-B.js";import{n as un,t as dn}from"./EnvironmentMachineIcon-giyHKjbh.js";import{r as fn,t as pn}from"./alert-quTC4YbH.js";import{a as mn,i as hn,s as gn,u as _n}from"./settingsLayout-DV36_Jgq.js";import{t as vn}from"./ConnectionStatusDot-BCSqqCpf.js";import{a as yn,n as X,o as bn,s as xn,t as Sn}from"./primary-DOpcfgLH.js";import{n as Cn,t as wn}from"./onboarding--LqcHqO0.js";import{Ar as Tn,Er as En,Fr as Dn,Gn as On,Ir as kn,Jn as An,Kn as jn,La as Mn,Mr as Nn,Nr as Pn,Or as Fn,Pr as In,Qn as Ln,Qo as Rn,Ro as zn,T as Bn,Tr as Vn,Xn as Hn,Yn as Un,Zn as Wn,_r as Gn,an as Kn,ci as qn,gr as Jn,hr as Yn,in as Xn,ir as Zn,jr as Qn,kr as $n,mr as er,nn as tr,on as nr,qn as rr,si as ir}from"./main-uLg3xUJM.js";import{t as ar}from"./FoldedSettingsSection-CsN_jb3V.js";var Z=re(),or=[{scope:v,title:`View environment`,description:`Read threads, status, checkpoints, and configuration.`},{scope:ne,title:`Operate tasks`,description:`Start, update, and stop tasks.`},{scope:_,title:`Change environment settings`,description:`Edit environment preferences and keybindings.`},{scope:x,title:`Manage providers`,description:`Configure, install, sign in to, and update providers and usage sources.`},{scope:c,title:`Maintain environment`,description:`Update the server and control environment processes.`},{scope:y,title:`Control previews`,description:`Open browser previews and host browser automation.`},{scope:L,title:`View diagnostics and usage`,description:`Read process diagnostics, resource history, and usage totals.`},{scope:T,title:`View terminals`,description:`Read existing terminal output and status.`},{scope:a,title:`Use terminals`,description:`Create terminals and send input to running shells.`},{scope:C,title:`Change source control`,description:`Commit, push, manage branches and repositories, and change pull requests.`},{scope:s,title:`Read files`,description:`Browse host files, search workspaces, and inspect local changes.`},{scope:b,title:`Write files`,description:`Edit workspace files and save plans to disk.`},{scope:he,title:`View access`,description:`Inspect pairing links and authorized clients.`},{scope:o,title:`Manage access`,description:`Issue and revoke credentials for other clients.`},{scope:l,title:`View relay`,description:`Inspect managed relay connectivity.`},{scope:h,title:`Manage relay`,description:`Change managed tunnel connectivity.`}],Q=e(ee(),1);function sr(e){let t=(0,Z.c)(4),{environmentId:n,connected:r,routeContext:i}=e,a=i!==void 0&&i,o=J(n),s;return t[0]!==r||t[1]!==a||t[2]!==o?(s=r&&!o.hasError&&!o.isPending&&o.data?.authenticated?(0,Q.jsxs)(`div`,{className:`space-y-3 py-3 text-xs`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:a?`These permissions apply to your active route. Other routes may have different permissions.`:`These permissions apply to this client’s current connection.`}),(0,Q.jsx)(`ul`,{className:`grid gap-x-6 gap-y-2 sm:grid-cols-2`,children:or.map(e=>{let{scope:t,title:n}=e;return(0,Q.jsxs)(`li`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:u(o.data,t)?`Allowed`:`Not granted`})]},t)})})]}):(0,Q.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:`Permissions not checked. Connect to this environment to view this session’s permissions.`}),t[0]=r,t[1]=a,t[2]=o,t[3]=s):s=t[3],s}var $=e(t(),1);function cr(e,t){let n=new URL(e);return n.pathname=`/pair`,W(n,t).toString()}function lr(e,t){return new URL(e).protocol===`https:`?Le({host:e,token:t}):null}function ur(){let e=(0,Z.c)(48),t=window.desktopBridge?.setLocalEnvironmentEnabled,[n]=(0,$.useState)(dr),[r,i]=(0,$.useState)(!1),[a,o]=(0,$.useState)(!1),[s,c]=(0,$.useState)(null);if(!t)return null;let l;e[0]===n?l=e[1]:(l=async()=>{o(!0),c(null);try{await t(!n)}catch(e){let t=e;c(t instanceof Error?t.message:`Couldn't change this setting.`),o(!1)}},e[0]=n,e[1]=l);let u=l,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=Zn(`local-environment`),e[2]=d):d=e[2];let f=n?`Run agents on this computer. Turn off to use P4 Code only with remote environments.`:`Turned off. Agents only run in remote environments.`,p;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>i(!0),e[3]=p):p=e[3];let m;e[4]!==n||e[5]!==a?(m=(0,Q.jsx)(Mn,{checked:n,disabled:a,onCheckedChange:p,"aria-label":`Local environment`}),e[4]=n,e[5]=a,e[6]=m):m=e[6];let h;e[7]!==f||e[8]!==m?(h=(0,Q.jsx)(mn,{...d,description:f,control:m}),e[7]=f,e[8]=m,e[9]=h):h=e[9];let g;e[10]===a?g=e[11]:(g=e=>{a||(i(e),e||c(null))},e[10]=a,e[11]=g);let _=n?`Turn off local environment?`:`Turn on local environment?`,v;e[12]===_?v=e[13]:(v=(0,Q.jsx)(kn,{children:_}),e[12]=_,e[13]=v);let y=n?`P4 Code will restart without running a server on this computer. Any agents and terminals running here will stop, and other devices will no longer be able to connect to this computer. Your projects, history, and remote environments are unaffected.`:`P4 Code will restart and start running a server on this computer again.`,b;e[14]===y?b=e[15]:(b=(0,Q.jsx)(Nn,{children:y}),e[14]=y,e[15]=b);let x;e[16]!==b||e[17]!==v?(x=(0,Q.jsxs)(In,{children:[v,b]}),e[16]=b,e[17]=v,e[18]=x):x=e[18];let S;e[19]===s?S=e[20]:(S=s?(0,Q.jsx)(`p`,{className:`px-6 pb-4 text-sm text-destructive`,children:s}):null,e[19]=s,e[20]=S);let C;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(I,{variant:`outline`}),e[21]=C):C=e[21];let w;e[22]===a?w=e[23]:(w=(0,Q.jsx)(Qn,{disabled:a,render:C,children:`Cancel`}),e[22]=a,e[23]=w);let T=n?`destructive`:`default`,E;e[24]===u?E=e[25]:(E=()=>void u(),e[24]=u,e[25]=E);let D;e[26]!==n||e[27]!==a?(D=a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Restarting…`]}):n?`Restart and turn off`:`Restart and turn on`,e[26]=n,e[27]=a,e[28]=D):D=e[28];let O;e[29]!==a||e[30]!==T||e[31]!==E||e[32]!==D?(O=(0,Q.jsx)(I,{variant:T,disabled:a,onClick:E,children:D}),e[29]=a,e[30]=T,e[31]=E,e[32]=D,e[33]=O):O=e[33];let k;e[34]!==w||e[35]!==O?(k=(0,Q.jsxs)(Pn,{children:[w,O]}),e[34]=w,e[35]=O,e[36]=k):k=e[36];let A;e[37]!==x||e[38]!==S||e[39]!==k?(A=(0,Q.jsxs)(Dn,{children:[x,S,k]}),e[37]=x,e[38]=S,e[39]=k,e[40]=A):A=e[40];let j;e[41]!==r||e[42]!==A||e[43]!==g?(j=(0,Q.jsx)(Tn,{open:r,onOpenChange:g,children:A}),e[41]=r,e[42]=A,e[43]=g,e[44]=j):j=e[44];let M;return e[45]!==j||e[46]!==h?(M=(0,Q.jsxs)(Q.Fragment,{children:[h,j]}),e[45]=j,e[46]=h,e[47]=M):M=e[47],M}function dr(){return!Ce()}function fr(e){return e.serverConfig===null?`Connect to this environment to change its icon.`:e.serverConfig.environment.capabilities.environmentIcon===!0?e.operateAccess===`granted`?null:`Your session on this environment cannot change its settings.`:`This environment's server is too old to keep an icon. Update it to choose one.`}function pr(e){let t=(0,Z.c)(27),{environmentId:n,serverConfig:r}=e,a=q(n),o=lt(n,`settings:write`)?`granted`:`denied`,s;t[0]!==o||t[1]!==r?(s=fr({serverConfig:r,operateAccess:o}),t[0]=o,t[1]=r,t[2]=s):s=t[2];let c=s,l=r?.environment.platform.machine??`server`,u;t[3]===r?u=t[4]:(u=de(r),t[3]=r,t[4]=u);let d=u,f;t[5]===d?f=t[6]:(f=(0,Q.jsxs)(A,{children:[(0,Q.jsx)(un,{kind:d}),`Icon`]}),t[5]=d,t[6]=f);let p;t[7]===c?p=t[8]:(p=c===null?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{disabled:!0,className:`whitespace-normal`,children:c}),(0,Q.jsx)(pe,{})]}),t[7]=c,t[8]=p);let m;t[9]!==l||t[10]!==c||t[11]!==a?(m=e=>{c===null&&me(e)&&a({environmentIcon:e===l?null:e})},t[9]=l,t[10]=c,t[11]=a,t[12]=m):m=t[12];let h;t[13]!==l||t[14]!==c||t[15]!==r?.environment?(h=ae.map(e=>(0,Q.jsx)(i,{value:e,disabled:c!==null,children:(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(un,{kind:e,className:`size-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:dn[e]}),e===l?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:r?.environment.platform.machine?`detected`:`default`}):null]})},e)),t[13]=l,t[14]=c,t[15]=r?.environment,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==m||t[19]!==h?(g=(0,Q.jsx)(S,{value:d,onValueChange:m,children:h}),t[17]=d,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]!==p||t[22]!==g?(_=(0,Q.jsxs)(te,{children:[p,g]}),t[21]=p,t[22]=g,t[23]=_):_=t[23];let v;return t[24]!==f||t[25]!==_?(v=(0,Q.jsxs)(ue,{children:[f,_]}),t[24]=f,t[25]=_,t[26]=v):v=t[26],v}function mr(e){let t=(0,Z.c)(31),{environment:n,onAddRoute:r}=e,i=Oe(n.entry),a=i.map(gr),[o,s]=(0,$.useState)(null),c=o!==null&&o.length===a.length&&o.some((e,t)=>e!==a[t])?[...o]:a,l=new Map(i.map(hr)),u=c.flatMap(e=>l.get(e)??[]),d=dt(n.environmentId),f;t[0]!==n.connection||t[1]!==d._tag||t[2]!==d.value?(f=d._tag===`Some`&&n.connection.phase===`connected`?V(d.value.target):null,t[0]=n.connection,t[1]=d._tag,t[2]=d.value,t[3]=f):f=t[3];let p=f,m=pt(st.reorderRoutes,`Reorder routes`),h=pt(st.removeRoute,`Remove route`),g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g={activationConstraint:{distance:4}},t[4]=g):g=t[4];let _;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_={coordinateGetter:en},t[5]=_):_=t[5];let v=nn(on(tn,g),on(Qt,_)),y;t[6]!==n.environmentId||t[7]!==h?(y=async e=>{let t=Ae(e);await rt(`Remove ${Te(e)} route?${t===null?``:`\n${t}`}`,{variant:`destructive`})===!0&&await h({environmentId:n.environmentId,routeId:V(e.target)})},t[6]=n.environmentId,t[7]=h,t[8]=y):y=t[8];let b=y,x=e=>{if(e.over===null||e.active.id===e.over.id)return;let t=rn(c,c.indexOf(String(e.active.id)),c.indexOf(String(e.over.id)));s(t),m({environmentId:n.environmentId,routeIds:t}).then(e=>{e._tag===`Failure`&&s(null)})},S=sn,C=ln,w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=[qn,ir],t[9]=w):w=t[9];let T=cn,E=an,D=`Routes to ${n.label}, preferred first`,O=u.map((e,t)=>(0,Q.jsx)(_r,{route:e,position:t+1,inUse:V(e.target)===p,removable:u.length>1&&!B(e),onRemove:()=>void b(e)},V(e.target))),k;t[10]!==O||t[11]!==D?(k=(0,Q.jsx)(`ol`,{"aria-label":D,children:O}),t[10]=O,t[11]=D,t[12]=k):k=t[12];let A;t[13]!==T||t[14]!==c||t[15]!==k||t[16]!==E?(A=(0,Q.jsx)(T,{items:c,strategy:E,children:k}),t[13]=T,t[14]=c,t[15]=k,t[16]=E,t[17]=A):A=t[17];let j;t[18]!==S||t[19]!==x||t[20]!==v||t[21]!==A||t[22]!==C||t[23]!==w?(j=(0,Q.jsx)(S,{sensors:v,collisionDetection:C,modifiers:w,onDragEnd:x,children:A}),t[18]=S,t[19]=x,t[20]=v,t[21]=A,t[22]=C,t[23]=w,t[24]=j):j=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(ye,{className:`size-3`}),t[25]=M):M=t[25];let N;t[26]===r?N=t[27]:(N=(0,Q.jsx)(`div`,{className:`-ml-1.5 pt-1`,children:(0,Q.jsxs)(I,{size:`xs`,variant:`ghost-muted`,onClick:r,children:[M,`Add route`]})}),t[26]=r,t[27]=N);let P;return t[28]!==j||t[29]!==N?(P=(0,Q.jsxs)(`div`,{className:`mt-2 border-t border-border/50 py-2`,children:[j,N]}),t[28]=j,t[29]=N,t[30]=P):P=t[30],P}function hr(e){return[V(e.target),e]}function gr(e){return V(e.target)}function _r(e){let t=(0,Z.c)(43),{route:n,position:r,inUse:i,removable:a,onRemove:o}=e,s;t[0]===n.target?s=t[1]:(s=V(n.target),t[0]=n.target,t[1]=s);let c=s,l;t[2]===n?l=t[3]:(l=Te(n),t[2]=n,t[3]=l);let u=l,d;t[4]===n?d=t[5]:(d=Ae(n),t[4]=n,t[5]=d);let f=d,p;t[6]===c?p=t[7]:(p={id:c},t[6]=c,t[7]=p);let{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=Xt(p),x;t[8]===v?x=t[9]:(x=$t.Translate.toString(v),t[8]=v,t[9]=x);let S;t[10]!==x||t[11]!==y?(S={transform:x,transition:y},t[10]=x,t[11]=y,t[12]=S):S=t[12];let C=b&&`relative z-10 rounded-md bg-background shadow-md`,w;t[13]===C?w=t[14]:(w=fe(`flex items-center gap-2 py-2`,C),t[13]=C,t[14]=w);let T;t[15]===i?T=t[16]:(T=i?(0,Q.jsx)(`span`,{className:`rounded-sm bg-success/12 px-1 text-2xs font-normal text-success-foreground`,children:`In use`}):null,t[15]=i,t[16]=T);let E;t[17]!==u||t[18]!==T?(E=(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[u,T]}),t[17]=u,t[18]=T,t[19]=E):E=t[19];let D;t[20]!==f||t[21]!==n?(D=f===null?null:(0,Q.jsxs)(`p`,{className:`truncate text-2xs text-muted-foreground`,children:[f,B(n)?` · found automatically`:``]}),t[20]=f,t[21]=n,t[22]=D):D=t[22];let O;t[23]!==E||t[24]!==D?(O=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[E,D]}),t[23]=E,t[24]=D,t[25]=O):O=t[25];let k=`Reorder ${u}, position ${r}`,A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(zn,{className:`size-3.5`}),t[26]=A):A=t[26];let j;t[27]!==m||t[28]!==h||t[29]!==_||t[30]!==k?(j=(0,Q.jsx)(`button`,{type:`button`,ref:_,...m,...h,"aria-label":k,className:`flex size-6 shrink-0 cursor-grab touch-none items-center justify-center rounded text-muted-foreground/70 outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:cursor-grabbing`,children:A}),t[27]=m,t[28]=h,t[29]=_,t[30]=k,t[31]=j):j=t[31];let M;t[32]!==u||t[33]!==o||t[34]!==a?(M=a?(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(I,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`Remove ${u} route`,onClick:o}),children:(0,Q.jsx)(z,{className:`size-3`})}),(0,Q.jsx)(Ue,{side:`top`,children:`Remove route`})]}):null,t[32]=u,t[33]=o,t[34]=a,t[35]=M):M=t[35];let N;return t[36]!==g||t[37]!==O||t[38]!==j||t[39]!==M||t[40]!==S||t[41]!==w?(N=(0,Q.jsxs)(`li`,{ref:g,style:S,className:w,children:[O,j,M]}),t[36]=g,t[37]=O,t[38]=j,t[39]=M,t[40]=S,t[41]=w,t[42]=N):N=t[42],N}function vr(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function yr(e,t=null){let{entry:n}=e;if(n.target._tag===`PrimaryConnectionTarget`)return`This machine`;let r=Oe(n);if(r.length>1){let e=t===null?void 0:r.find(e=>V(e.target)===V(t));return e===void 0?Te(r[0]):`via ${Te(e)}`}return e.relayManaged?`P4 Connect`:Be(n.target)?`WSL`:n.target._tag===`SshConnectionTarget`&&F(n.profile)&&n.profile.value._tag===`SshConnectionProfile`?`SSH ${vr(n.profile.value.target)}`:e.displayUrl??`Remote link`}function br(e){let t=(0,Z.c)(23),{kind:n,label:r,subtitle:i,below:a,detail:o,dimmed:s,className:c,children:l}=e,u=s!==void 0&&s&&`opacity-60`,d;t[0]!==c||t[1]!==u?(d=fe(`grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-3 px-3 py-2.5 sm:px-4`,u,c),t[0]=c,t[1]=u,t[2]=d):d=t[2];let f;t[3]===n?f=t[4]:(f=(0,Q.jsx)(un,{"aria-hidden":!0,kind:n,className:`size-4 text-muted-foreground`}),t[3]=n,t[4]=f);let p;t[5]===r?p=t[6]:(p=(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,children:r}),t[5]=r,t[6]=p);let m;t[7]===i?m=t[8]:(m=(0,Q.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:i}),t[7]=i,t[8]=m);let h;t[9]!==a||t[10]!==p||t[11]!==m?(h=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[p,m,a]}),t[9]=a,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===l?g=t[14]:(g=(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:l}),t[13]=l,t[14]=g);let _;t[15]===o?_=t[16]:(_=o?(0,Q.jsx)(`div`,{className:`col-span-2 col-start-2 min-w-0`,children:o}):null,t[15]=o,t[16]=_);let v;return t[17]!==d||t[18]!==f||t[19]!==h||t[20]!==g||t[21]!==_?(v=(0,Q.jsxs)(`div`,{className:d,children:[f,h,g,_]}),t[17]=d,t[18]=f,t[19]=h,t[20]=g,t[21]=_,t[22]=v):v=t[22],v}var xr=[{value:100,label:`Prefer`},{value:50,label:`Normal`},{value:25,label:`Less often`},{value:0,label:`Manual only`}];function Sr(e){return e===void 0||e===50?50:e===0?0:e<50?25:100}function Cr(e){return xr.find(t=>t.value===e).label}function wr(e,t){let n=e.flatMap(e=>{let n=Sr(t[e.environmentId]);return n===50?[]:[`${e.label} ${Cr(n).toLowerCase()}`]});return n.length===0?null:n.join(` · `)}function Tr(e){let t=(0,Z.c)(27),{environments:n}=e,r=it(),i=nt(),a=at();if(n.length<2)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=Zn(`load-balancing`),t[0]=o):o=t[0];let{id:s,title:c}=o,l;t[1]!==n||t[2]!==r.loadBalancingEnabled||t[3]!==r.loadBalancingWeights?(l=r.loadBalancingEnabled?wr(n,r.loadBalancingWeights):`Off`,t[1]=n,t[2]=r.loadBalancingEnabled,t[3]=r.loadBalancingWeights,t[4]=l):l=t[4];let u=!i,d;t[5]===a?d=t[6]:(d=e=>a({loadBalancingEnabled:e}),t[5]=a,t[6]=d);let f;t[7]!==r.loadBalancingEnabled||t[8]!==u||t[9]!==d?(f=(0,Q.jsx)(Mn,{"aria-label":`Automatically balance load`,checked:r.loadBalancingEnabled,disabled:u,onCheckedChange:d}),t[7]=r.loadBalancingEnabled,t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:`New threads in shared projects start on the machine with the most free CPU and memory, weighted by each machine's preference.`}),t[11]=p):p=t[11];let m;if(t[12]!==n||t[13]!==r.loadBalancingEnabled||t[14]!==r.loadBalancingWeights||t[15]!==i||t[16]!==a){let e;t[18]!==r.loadBalancingEnabled||t[19]!==r.loadBalancingWeights||t[20]!==i||t[21]!==a?(e=e=>(0,Q.jsx)(br,{kind:de(e.serverConfig),label:e.label,subtitle:yr(e),children:(0,Q.jsxs)(Ye,{items:xr,value:Sr(r.loadBalancingWeights[e.environmentId]),disabled:!i||!r.loadBalancingEnabled,onValueChange:t=>{t!==null&&a({loadBalancingWeights:{...r.loadBalancingWeights,[e.environmentId]:t}})},children:[(0,Q.jsx)(Je,{size:`xs`,className:`w-32`,"aria-label":`${e.label} load preference`,children:(0,Q.jsx)(Ke,{})}),(0,Q.jsx)(qe,{align:`end`,alignItemWithTrigger:!1,children:xr.map(Er)})]})},e.environmentId),t[18]=r.loadBalancingEnabled,t[19]=r.loadBalancingWeights,t[20]=i,t[21]=a,t[22]=e):e=t[22],m=n.map(e),t[12]=n,t[13]=r.loadBalancingEnabled,t[14]=r.loadBalancingWeights,t[15]=i,t[16]=a,t[17]=m}else m=t[17];let h;return t[23]!==l||t[24]!==f||t[25]!==m?(h=(0,Q.jsxs)(ar,{id:s,title:c,summary:l,control:f,children:[p,m]}),t[23]=l,t[24]=f,t[25]=m,t[26]=h):h=t[26],h}function Er(e){let{value:t,label:n}=e;return(0,Q.jsx)(Ge,{value:t,children:n},t)}var Dr=[{value:`off`,label:`Off`},{value:`read`,label:`Read PRs`},{value:`read-write`,label:`Read and act`}],Or={"read-write":`read and act`,read:`read PRs`};function kr(e){let t=[`read-write`,`read`].flatMap(t=>{let n=e.filter(e=>e.permission===t);return n.length===0?[]:[`${n.map(e=>e.label).join(`, `)} ${Or[t]}`]});return t.length===0?null:t.join(` · `)}function Ar(e){let t=(0,Z.c)(19),{environments:n}=e,r=m(st.githubRoutingPermissionsValueAtom),i=m(st.catalogValueAtom),a=pt(st.setGitHubRoutingPermission),[o,s]=(0,$.useState)(!1);if(n.length<2)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=Zn(`github-routing`),t[0]=c):c=t[0];let{id:l,title:u}=c,d;t[1]!==n||t[2]!==r?(d=kr(n.map(e=>({label:e.label,permission:Ee(e.entry,r)})))??`Off`,t[1]=n,t[2]=r,t[3]=d):d=t[3];let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:`Machines you trust here can read PR data through each other's GitHub access. Enable both machines. Read and act may use broader permissions than the machine that owns them. This applies only to this device.`}),t[4]=f):f=t[4];let p;if(t[5]!==i||t[6]!==n||t[7]!==r||t[8]!==o||t[9]!==a){let e;t[11]!==i||t[12]!==r||t[13]!==o||t[14]!==a?(e=e=>(0,Q.jsx)(br,{kind:de(e.serverConfig),label:e.label,subtitle:yr(e),children:(0,Q.jsxs)(Ye,{items:Dr,value:Ee(e.entry,r),disabled:!i.isReady||o||Me(e.entry)===null,onValueChange:t=>{t!==null&&(s(!0),a({environmentId:e.environmentId,permission:t}).then(e=>{s(!1),e._tag===`Failure`&&K.add({type:`error`,title:`Could not save GitHub routing permission`})}))},children:[(0,Q.jsx)(Je,{size:`xs`,className:`w-32`,"aria-label":`${e.label} GitHub routing`,children:(0,Q.jsx)(Ke,{})}),(0,Q.jsx)(qe,{align:`end`,alignItemWithTrigger:!1,children:Dr.map(jr)})]})},e.environmentId),t[11]=i,t[12]=r,t[13]=o,t[14]=a,t[15]=e):e=t[15],p=n.map(e),t[5]=i,t[6]=n,t[7]=r,t[8]=o,t[9]=a,t[10]=p}else p=t[10];let h;return t[16]!==d||t[17]!==p?(h=(0,Q.jsxs)(ar,{id:l,title:u,summary:d,children:[f,p]}),t[16]=d,t[17]=p,t[18]=h):h=t[18],h}function jr(e){let{value:t,label:n}=e;return(0,Q.jsx)(Ge,{value:t,children:n},t)}function Mr(e){let t=(0,Z.c)(26),{environmentLabel:n,onCancel:r,onConfirm:i}=e,a=It(),[o,s]=(0,$.useState)(n);n!==null&&n!==o&&s(n);let c=a.open,l=n!==null,u;t[0]===r?u=t[1]:(u=e=>{e||r()},t[0]=r,t[1]=u);let d;t[2]===o?d=t[3]:(d=(0,Q.jsxs)(kn,{children:[`Remove `,o,` from this device?`]}),t[2]=o,t[3]=d);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(Nn,{children:`This forgets its pairing, credentials, and cached threads here.`}),t[4]=f):f=t[4];let p;t[5]!==r||t[6]!==c?(p=c?(0,Q.jsx)(M,{onClick:()=>{r(),c()},children:`P4 Connect settings`}):`P4 Connect settings`,t[5]=r,t[6]=c,t[7]=p):p=t[7];let m;t[8]===p?m=t[9]:(m=(0,Q.jsxs)(Nn,{children:[`It stays on your P4 Connect account and keeps its host space. Deregister it in`,` `,p,` `,`to free it.`]}),t[8]=p,t[9]=m);let h;t[10]!==d||t[11]!==m?(h=(0,Q.jsxs)(In,{children:[d,f,m]}),t[10]=d,t[11]=m,t[12]=h):h=t[12];let g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(Qn,{render:(0,Q.jsx)(I,{variant:`outline`}),children:`Cancel`}),t[13]=g):g=t[13];let _;t[14]===i?_=t[15]:(_=(0,Q.jsxs)(Pn,{children:[g,(0,Q.jsx)(I,{variant:`destructive`,onClick:i,children:`Remove from this device`})]}),t[14]=i,t[15]=_);let v;t[16]!==h||t[17]!==_?(v=(0,Q.jsxs)(Dn,{children:[h,_]}),t[16]=h,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==l||t[20]!==v||t[21]!==u?(y=(0,Q.jsx)(Tn,{open:l,onOpenChange:u,children:v}),t[19]=l,t[20]=v,t[21]=u,t[22]=y):y=t[22];let b;return t[23]!==a.portals||t[24]!==y?(b=(0,Q.jsxs)(Q.Fragment,{children:[y,a.portals]}),t[23]=a.portals,t[24]=y,t[25]=b):b=t[25],b}var Nr={pairingLinks:[],clientSessions:[]};function Pr(e,t,n){let r=n(t);return[...e.filter(e=>n(e)!==r),t]}function Fr(e,t){switch(t.type){case`snapshot`:return t.payload;case`pairingLinkUpserted`:return{...e,pairingLinks:Pr(e.pairingLinks,t.payload,e=>e.id)};case`pairingLinkRemoved`:return{...e,pairingLinks:e.pairingLinks.filter(e=>e.id!==t.payload.id)};case`clientUpserted`:return{...e,clientSessions:Pr(e.clientSessions,t.payload,e=>e.sessionId)};case`clientRemoved`:return{...e,clientSessions:e.clientSessions.filter(e=>e.sessionId!==t.payload.sessionId)}}}function Ir(e,t){let n=Fr(e,t);return[n,[{version:1,revision:t.revision,type:`snapshot`,payload:n}]]}function Lr(e){return{accessChanges:ke(e,{label:`environment-data:server:auth-access-changes`,subscribe:e=>H(ie.subscribeAuthAccess,{}).pipe(le(()=>Nr,Ir))})}}var Rr=Lr(G),zr=3e4,Br=class extends j()(`DesktopNetworkAccessUnavailableError`,{}){get message(){return`Desktop network access is unavailable.`}},Vr=class extends j()(`DesktopServerExposureStateLoadError`,{cause:d()}){get message(){return`Failed to load desktop server exposure state.`}},Hr=class extends j()(`DesktopAdvertisedEndpointsLoadError`,{cause:d()}){get message(){return`Failed to load advertised desktop endpoints.`}};function Ur(){return typeof window>`u`?void 0:window.desktopBridge}function Wr(e){let t=r(`loadDesktopNetworkAccess`)(function*(){let t=e();if(!t)return yield*new Br;let[n,r]=yield*ge([k({try:()=>t.getServerExposureState(),catch:e=>new Vr({cause:e})}),k({try:()=>t.getAdvertisedEndpoints(),catch:e=>new Hr({cause:e})})],{concurrency:`unbounded`});return{advertisedEndpoints:r,serverExposureState:n}});return g(t()).pipe(O({staleTime:zr,revalidateOnMount:!0}),p,P(`desktop:network-access`))}var Gr=Wr(Ur);function Kr(){w.refresh(Gr)}function qr(e,t){let n=t.trim().toLowerCase();if(n.length===0)return e;let r=[],i=[];for(let t of e){let e=t.alias.toLowerCase();e.startsWith(n)?r.push(t):e.includes(n)&&i.push(t)}return[...r,...i]}var Jr=class extends j()(`DesktopSshDiscoveryUnavailableError`,{}){get message(){return`Desktop SSH host discovery is unavailable.`}},Yr=class extends j()(`DesktopSshDiscoveryError`,{cause:d()}){get message(){return`Failed to discover SSH hosts.`}};function Xr(){return typeof window>`u`?void 0:window.desktopBridge}function Zr(e){let t=r(`discoverDesktopSshHosts`)(function*(){let t=e();return t?yield*k({try:()=>t.discoverSshHosts(),catch:e=>new Yr({cause:e})}):yield*new Jr});return g(t()).pipe(O({staleTime:3e4,revalidateOnMount:!0}),p,P(`desktop:ssh-hosts`))}var Qr=Zr(Xr),$r=443,ei=[],ti=[],ni=`backend:default-wsl`,ri=`backend:wsl-off`,ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function ai(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:ii.format(t)}function oi(e){let t=(0,Z.c)(13),{scopes:n,label:r}=e,i=`${n.length} ${n.length===1?`scope`:`scopes`}`,a=`${r}: show ${i}`,o;t[0]===a?o=t[1]:(o=(0,Q.jsx)(`button`,{type:`button`,"aria-label":a,className:`cursor-help underline decoration-border underline-offset-2 outline-hidden hover:text-foreground focus-visible:text-foreground`}),t[0]=a,t[1]=o);let s;t[2]!==i||t[3]!==o?(s=(0,Q.jsx)(Jt,{openOnHover:!0,delay:250,closeDelay:100,render:o,children:i}),t[2]=i,t[3]=o,t[4]=s):s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`p`,{className:`mb-1 font-medium`,children:`Granted scopes`}),t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n.map(si),t[6]=n,t[7]=l);let u;t[8]===l?u=t[9]:(u=(0,Q.jsxs)(qt,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max max-w-80 whitespace-normal`,children:[c,(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:l})]}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Yt,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function si(e){return(0,Q.jsx)(`code`,{className:`font-mono text-foreground/85`,children:e},e)}function ci(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function li(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=U(n);if(r)return{host:r.host,pairingCode:r.token};let i=ze(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function ui(e){let t=li(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function di(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var fi=`first:rounded-t-xl last:rounded-b-xl px-3 py-2.5 sm:px-4`;function pi(e){return Xn}function mi(e,t){return e===`endpoint-rail`?fe(`relative first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,!t&&`bg-muted/15`):fe(fi,!t&&`bg-muted/24`)}function hi(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function gi(e,t){return[`${e.length} ${e.length===1?`client`:`clients`}`,t.length>0?`${t.length} ${t.length===1?`pairing link`:`pairing links`}`:null].filter(e=>e!==null).join(` · `)}function _i(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function vi(e){return{...e,scopes:e.permissions??e.scopes,createdAt:N(e.createdAt),expiresAt:N(e.expiresAt)}}function yi(e){return{...e,scopes:e.permissions??e.scopes,issuedAt:N(e.issuedAt),expiresAt:N(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:N(e.lastConnectedAt)}}function bi(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>Si(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function xi(e){return e.id.startsWith(`tailscale-magicdns:`)}function Si(e){if(e.id.startsWith(`desktop-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(xi(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function Ci(e,t){return e.compatibility.hostedHttpsApp===`compatible`?lr(e.httpBaseUrl,t)??cr(e.httpBaseUrl,t):cr(e.httpBaseUrl,t)}function wi(e){let t=new URL(`/pair`,window.location.href);return W(t,e).toString()}function Ti(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}function Ei(e,t){if(Ti(t))return`Opens the hosted app, no install needed`;switch(e.reachability){case`lan`:return`Devices on the same network`;case`private-network`:return`Devices on your private network`;case`public`:return`Reachable from anywhere`;case`loopback`:return`Clients on this machine`}}var Di=(0,$.memo)(function(e){let t=(0,Z.c)(131),{pairingLink:n,credential:r,endpointUrl:i,endpoints:a,defaultEndpointKey:o,presentation:s,revokingPairingLinkId:c,onRevoke:l,canRevoke:u}=e,d=s===void 0?`current`:s,f=_n(1e3),p=new Date(n.expiresAt).getTime(),[m,h]=(0,$.useState)(!1),[g,_]=(0,$.useState)(!1),[v,y]=(0,$.useState)(null),b=(0,$.useId)(),x;t[0]===r?x=t[1]:(x=r?wi(r):null,t[0]=r,t[1]=x);let S=x,C;t[2]!==r||t[3]!==i?(C=r&&i!=null&&i!==``?lr(i,r):null,t[2]=r,t[3]=i,t[4]=C):C=t[4];let w=C,T;if(t[5]!==r||t[6]!==o||t[7]!==a){let e=bi(a,o);T=e&&r?Ci(e,r):null,t[5]=r,t[6]=o,t[7]=a,t[8]=T}else T=t[8];let E=T,D;if(t[9]!==r||t[10]!==a){bb0:{let e=[];if(!r){D=e;break bb0}for(let t of a){if(t.status===`unavailable`)continue;let n=Ci(t,r);e.push({id:t.id,preferenceKey:Si(t),label:t.label,url:n,detail:Ei(t,n),qrShareable:rr(t)})}D=e}t[9]=r,t[10]=a,t[11]=D}else D=t[11];let O=D,k;t[12]!==r||t[13]!==S||t[14]!==E||t[15]!==i||t[16]!==w?(k=E??(r&&i!=null&&i!==``?w??cr(i,r):Pe(window.location.hostname)?null:S),t[12]=r,t[13]=S,t[14]=E,t[15]=i,t[16]=w,t[17]=k):k=t[17];let A=k,[j,M]=(0,$.useState)(null),N=j??A??r??``,P=N!==r,ee=P&&Ti(N),te=O.find(e=>e.url===N)?.qrShareable??!0,ne=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re={onCopy:Yi,onError:(e,t)=>{let{value:n,kind:r}=t;M(n),h(!0),K.add(Y({type:`error`,title:ne?r===`hosted-link`?`Could not copy hosted app link`:r===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:ne?e.message:`Showing the full value instead.`}))}},t[18]=re):re=t[18];let{copyToClipboard:ie}=Ze(re),ae;t[19]===ie?ae=t[20]:(ae=(e,t)=>{ie(e,{value:e,kind:t})},t[19]=ie,t[20]=ae);let oe=ae,se=Xi,ce;t[21]!==oe||t[22]!==r?(ce=()=>{r&&oe(r,`code`)},t[21]=oe,t[22]=r,t[23]=ce):ce=t[23];let le=ce,ue;t[24]===n.expiresAt?ue=t[25]:(ue=ai(n.expiresAt),t[24]=n.expiresAt,t[25]=ue);let F=ue,de=n.label??`Pairing link`,pe;t[26]!==o||t[27]!==O||t[28]!==v?(pe=Un(O,v,o),t[26]=o,t[27]=O,t[28]=v,t[29]=pe):pe=t[29];let me=pe,L=me?.url??A,he=me?.qrShareable??!0;if(p<=f)return null;let ge;t[30]===d?ge=t[31]:(ge=pi(d),t[30]=d,t[31]=ge);let R;t[32]===n.createdAt?R=t[33]:(R=ai(n.createdAt),t[32]=n.createdAt,t[33]=R);let _e=`Link created at ${R}`,ve;t[34]===_e?ve=t[35]:(ve=(0,Q.jsx)(vn,{tooltipText:_e,dotClassName:`bg-warning`}),t[34]=_e,t[35]=ve);let ye;t[36]===de?ye=t[37]:(ye=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:de}),t[36]=de,t[37]=ye);let xe;t[38]!==ve||t[39]!==ye?(xe=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[ve,ye]}),t[38]=ve,t[39]=ye,t[40]=xe):xe=t[40];let Se;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Q.jsx)(`span`,{}),t[41]=Se):Se=t[41];let z;t[42]!==f||t[43]!==n.expiresAt?(z=mt(n.expiresAt,f),t[42]=f,t[43]=n.expiresAt,t[44]=z):z=t[44];let B;t[45]===z?B=t[46]:(B=(0,Q.jsx)(He,{render:Se,children:z}),t[45]=z,t[46]=B);let Ce;t[47]===F?Ce=t[48]:(Ce=(0,Q.jsx)(Ue,{side:`top`,children:F}),t[47]=F,t[48]=Ce);let we;t[49]!==B||t[50]!==Ce?(we=(0,Q.jsxs)(We,{children:[B,Ce]}),t[49]=B,t[50]=Ce,t[51]=we):we=t[51];let Te;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Q.jsx)(`span`,{"aria-hidden":!0,children:` · `}),t[52]=Te):Te=t[52];let V;t[53]===n.scopes?V=t[54]:(V=(0,Q.jsx)(oi,{scopes:n.scopes,label:`Pairing link scopes`}),t[53]=n.scopes,t[54]=V);let Ee;t[55]!==we||t[56]!==V?(Ee=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[we,Te,V]}),t[55]=we,t[56]=V,t[57]=Ee):Ee=t[57];let De;t[58]!==r||t[59]!==A?(De=r?A===null?(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null:(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground/70`,children:`Create a new link to share from this client.`}),t[58]=r,t[59]=A,t[60]=De):De=t[60];let Oe;t[61]!==xe||t[62]!==Ee||t[63]!==De?(Oe=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[xe,Ee,De]}),t[61]=xe,t[62]=Ee,t[63]=De,t[64]=Oe):Oe=t[64];let ke;t[65]!==g||t[66]!==b||t[67]!==A?(ke=A&&ne?(0,Q.jsxs)(I,{size:`xs`,variant:`outline`,"aria-expanded":g,"aria-controls":b,onClick:()=>_(Zi),children:[(0,Q.jsx)(be,{"aria-hidden":!0}),`Share`]}):null,t[65]=g,t[66]=b,t[67]=A,t[68]=ke):ke=t[68];let Ae=r!==void 0&&m,je;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(je=e=>{h(e),e||M(null)},t[69]=je):je=t[69];let Me;t[70]!==r||t[71]!==le||t[72]!==A?(Me=r?ne?A?null:(0,Q.jsx)(I,{size:`xs`,variant:`outline`,onClick:le,children:`Copy code`}):(0,Q.jsx)(At,{render:(0,Q.jsx)(I,{size:`xs`,variant:`outline`}),children:A?`Show link`:`Show code`}):null,t[70]=r,t[71]=le,t[72]=A,t[73]=Me):Me=t[73];let Ne=P?ee?`Hosted app pairing link`:`Pairing link`:`Pairing code`,H;t[74]===Ne?H=t[75]:(H=(0,Q.jsx)(Ot,{children:Ne}),t[74]=Ne,t[75]=H);let Fe=P?ee?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,U;t[76]===Fe?U=t[77]:(U=(0,Q.jsx)(Nt,{children:Fe}),t[76]=Fe,t[77]=U);let W;t[78]!==H||t[79]!==U?(W=(0,Q.jsxs)(Dt,{children:[H,U]}),t[78]=H,t[79]=U,t[80]=W):W=t[80];let Ie=P?4:3,Le;t[81]!==N||t[82]!==Ie?(Le=(0,Q.jsx)(_t,{readOnly:!0,value:N,rows:Ie,onFocus:Qi,onClick:$i}),t[81]=N,t[82]=Ie,t[83]=Le):Le=t[83];let Re;t[84]!==te||t[85]!==P||t[86]!==N?(Re=P&&te?(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,Q.jsx)(Bn,{value:N,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[84]=te,t[85]=P,t[86]=N,t[87]=Re):Re=t[87];let ze;t[88]!==Le||t[89]!==Re?(ze=(0,Q.jsxs)(Mt,{children:[Le,Re]}),t[88]=Le,t[89]=Re,t[90]=ze):ze=t[90];let Be;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Q.jsx)(I,{variant:`outline`,onClick:()=>h(!1),children:`Done`}),t[91]=Be):Be=t[91];let Ve;t[92]===le?Ve=t[93]:(Ve=ne?(0,Q.jsx)(I,{variant:`outline`,onClick:le,children:`Copy code`}):null,t[92]=le,t[93]=Ve);let G;t[94]===Ve?G=t[95]:(G=(0,Q.jsxs)(kt,{variant:`bare`,children:[Be,Ve]}),t[94]=Ve,t[95]=G);let Ge;t[96]!==W||t[97]!==ze||t[98]!==G?(Ge=(0,Q.jsxs)(Pt,{className:`max-w-md`,children:[W,ze,G]}),t[96]=W,t[97]=ze,t[98]=G,t[99]=Ge):Ge=t[99];let Ke;t[100]!==Ae||t[101]!==Me||t[102]!==Ge?(Ke=(0,Q.jsxs)(Ft,{open:Ae,onOpenChange:je,children:[Me,Ge]}),t[100]=Ae,t[101]=Me,t[102]=Ge,t[103]=Ke):Ke=t[103];let qe=!u||c===n.id,Je;t[104]!==l||t[105]!==n.id?(Je=()=>void l(n.id),t[104]=l,t[105]=n.id,t[106]=Je):Je=t[106];let Ye=c===n.id?`Revoking…`:`Revoke`,Xe;t[107]!==qe||t[108]!==Je||t[109]!==Ye?(Xe=(0,Q.jsx)(I,{size:`xs`,variant:`destructive-outline`,disabled:qe,onClick:Je,children:Ye}),t[107]=qe,t[108]=Je,t[109]=Ye,t[110]=Xe):Xe=t[110];let Qe;t[111]!==ke||t[112]!==Ke||t[113]!==Xe?(Qe=(0,Q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[ke,Ke,Xe]}),t[111]=ke,t[112]=Ke,t[113]=Xe,t[114]=Qe):Qe=t[114];let $e;t[115]!==Oe||t[116]!==Qe?($e=(0,Q.jsxs)(`div`,{className:Kn,children:[Oe,Qe]}),t[115]=Oe,t[116]=Qe,t[117]=$e):$e=t[117];let et;t[118]!==he||t[119]!==oe||t[120]!==O||t[121]!==le||t[122]!==g||t[123]!==L||t[124]!==b||t[125]!==me?.id?(et=g&&L!==null?(0,Q.jsxs)(`div`,{id:b,className:`mt-3 flex flex-col gap-4 border-t border-border/50 pt-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[O.length>1?(0,Q.jsxs)(`div`,{className:`space-y-1.5`,role:`radiogroup`,"aria-label":`Endpoint the pairing QR code and URL use`,children:[(0,Q.jsx)(`p`,{className:`text-2xs text-muted-foreground/70`,children:`Reach this machine via`}),O.map(e=>{let t=e.id===me?.id;return(0,Q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,className:fe(`flex w-full items-baseline gap-2 rounded-lg border px-2.5 py-1.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t?`border-foreground/60 bg-muted/30`:`border-border/50 hover:bg-muted/20`),onClick:()=>y(e.id),children:[(0,Q.jsx)(`span`,{className:fe(`text-xs font-medium`,t?`text-foreground`:`text-muted-foreground`),children:e.label}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-2xs text-muted-foreground/70`,children:e.detail})]},e.id)})]}):null,(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-muted/30 px-2.5 py-1.5`,children:[(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-2xs text-muted-foreground`,children:L})}),(0,Q.jsx)(Ue,{side:`top`,children:L})]}),(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,className:`shrink-0`,onClick:()=>oe(L,se(L)),children:`Copy link`})]}),(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,onClick:le,children:`Copy code only`})]}),he?(0,Q.jsx)(`div`,{className:`w-fit shrink-0 self-center rounded-xl bg-white p-3 sm:self-start`,children:(0,Q.jsx)(Bn,{value:L,size:168,level:`M`,marginSize:1,title:`Pairing link — scan to open on another device`})}):(0,Q.jsx)(`div`,{className:`flex size-[192px] shrink-0 items-center justify-center self-center rounded-xl border border-border/50 p-4 sm:self-start`,children:(0,Q.jsx)(`p`,{className:`text-center text-2xs text-muted-foreground/70`,children:`No QR for this endpoint. Another device scanning a loopback link would dial itself; copy the URL for use on this machine instead.`})})]}):null,t[118]=he,t[119]=oe,t[120]=O,t[121]=le,t[122]=g,t[123]=L,t[124]=b,t[125]=me?.id,t[126]=et):et=t[126];let tt;return t[127]!==ge||t[128]!==$e||t[129]!==et?(tt=(0,Q.jsxs)(`div`,{className:ge,children:[$e,et]}),t[127]=ge,t[128]=$e,t[129]=et,t[130]=tt):tt=t[130],tt}),Oi=(0,$.memo)(function(e){let t=(0,Z.c)(54),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a,canRevoke:o}=e,s=r===void 0?`current`:r,c=_n(1e3),l=n.current||n.connected,u=n.lastConnectedAt,d;t[0]!==l||t[1]!==u||t[2]!==c?(d=l?u?`Connected for ${ht(u,c)}`:`Connected`:u?`Last connected at ${ai(u)}`:`Not connected yet.`,t[0]=l,t[1]=u,t[2]=c,t[3]=d):d=t[3];let f=d,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(ea),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===s?x=t[17]:(x=pi(s),t[16]=s,t[17]=x);let S=l?`bg-success`:`bg-muted-foreground/30`,C=l?`bg-success/60 duration-2000`:null,w;t[18]!==f||t[19]!==S||t[20]!==C?(w=(0,Q.jsx)(vn,{tooltipText:f,dotClassName:S,pingClassName:C}),t[18]=f,t[19]=S,t[20]=C,t[21]=w):w=t[21];let T;t[22]===b?T=t[23]:(T=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:b}),t[22]=b,t[23]=T);let E;t[24]===n.current?E=t[25]:(E=n.current?(0,Q.jsx)(`span`,{className:`text-3xs text-muted-foreground/80 rounded-md border border-border/50 bg-muted/50 px-1 py-0.5`,children:`This device`}):null,t[24]=n.current,t[25]=E);let D;t[26]!==w||t[27]!==T||t[28]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[w,T,E]}),t[26]=w,t[27]=T,t[28]=E,t[29]=D):D=t[29];let O;t[30]===v?O=t[31]:(O=v.length>0?(0,Q.jsxs)(Q.Fragment,{children:[v.join(` · `),(0,Q.jsx)(`span`,{"aria-hidden":!0,children:` · `})]}):null,t[30]=v,t[31]=O);let k;t[32]===n.scopes?k=t[33]:(k=(0,Q.jsx)(oi,{scopes:n.scopes,label:`Client scopes`}),t[32]=n.scopes,t[33]=k);let A;t[34]!==O||t[35]!==k?(A=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[O,k]}),t[34]=O,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==D||t[38]!==A?(j=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,A]}),t[37]=D,t[38]=A,t[39]=j):j=t[39];let M;t[40]!==o||t[41]!==n.current||t[42]!==n.sessionId||t[43]!==a||t[44]!==i?(M=n.current?null:(0,Q.jsx)(I,{size:`xs`,variant:`destructive-outline`,disabled:!o||i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[40]=o,t[41]=n.current,t[42]=n.sessionId,t[43]=a,t[44]=i,t[45]=M):M=t[45];let N;t[46]===M?N=t[47]:(N=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:M}),t[46]=M,t[47]=N);let P;t[48]!==j||t[49]!==N?(P=(0,Q.jsxs)(`div`,{className:Kn,children:[j,N]}),t[48]=j,t[49]=N,t[50]=P):P=t[50];let ee;return t[51]!==P||t[52]!==x?(ee=(0,Q.jsx)(`div`,{className:x,children:P}),t[51]=P,t[52]=x,t[53]=ee):ee=t[53],ee}),ki=(0,$.memo)(function({onPairingLinkCreated:e,clientSessions:t,isRevokingOtherClients:n,onRevokeOtherClients:r,delegatableScopes:i}){let a=tt(),[o,c]=(0,$.useState)(!1),[l,u]=(0,$.useState)(``),[d,f]=(0,$.useState)([...R]),p=d.filter(e=>i.includes(e)),[m,h]=(0,$.useState)(!1),g=(0,$.useCallback)(async()=>{if(a!==null&&p.length!==0&&ut(a,`access:write`)&&p.every(e=>ut(a,e))){h(!0);try{e(await X({label:l,scopes:p})),u(``),f(R.filter(e=>i.includes(e))),c(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;K.add(Y({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{h(!1)}}},[i,e,l,a,p]),_=(0,$.useCallback)((e,t)=>{f(n=>Hn(n,e,t))},[]);return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(I,{size:`xs`,variant:`destructive-outline`,disabled:n||!jn(t),onClick:()=>void r(),children:n?`Revoking…`:`Revoke others`}),(0,Q.jsxs)(Ft,{open:o,onOpenChange:e=>{c(e),e||(u(``),f(R.filter(e=>i.includes(e))))},children:[(0,Q.jsx)(At,{render:(0,Q.jsxs)(I,{size:`xs`,variant:`default`,children:[(0,Q.jsx)(ye,{className:`size-3`}),`Create link`]})}),(0,Q.jsxs)(Pt,{className:`max-w-md`,children:[(0,Q.jsxs)(Dt,{children:[(0,Q.jsx)(Ot,{children:`Create pairing link`}),(0,Q.jsx)(Nt,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,Q.jsxs)(Mt,{children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,Q.jsx)(Tt,{value:l,onChange:e=>u(e.target.value),placeholder:`e.g. Living room iPad`,disabled:m,autoFocus:!0})]}),(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-xs font-medium text-foreground`,children:`Permissions`}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Limit what the paired client can do.`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(I,{size:`xs`,variant:`outline`,disabled:m,onClick:()=>f([v,s,L,T].filter(e=>i.includes(e))),children:`Read only`}),(0,Q.jsx)(I,{size:`xs`,variant:`outline`,disabled:m,onClick:()=>f(R.filter(e=>i.includes(e))),children:`Standard`})]})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-border/60 rounded-lg border border-input bg-muted/25`,children:or.filter(({scope:e})=>i.includes(e)).map(({scope:e,title:t,description:n})=>(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 px-3 py-2.5 transition-colors hover:bg-muted/40`,children:[(0,Q.jsx)(gt,{className:`mt-0.5`,checked:d.includes(e),disabled:m,onCheckedChange:t=>_(e,t===!0)}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-xs font-medium text-foreground`,children:t}),(0,Q.jsx)(`span`,{className:`block text-xs leading-snug text-muted-foreground`,children:n})]})]},e))}),p.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Select at least one permission.`}):p.includes(`access:write`)?(0,Q.jsx)(`p`,{className:`text-xs text-warning`,children:`This client can create or revoke access for other devices.`}):null]})]}),(0,Q.jsxs)(kt,{variant:`bare`,children:[(0,Q.jsx)(I,{variant:`outline`,disabled:m,onClick:()=>c(!1),children:`Cancel`}),(0,Q.jsx)(I,{disabled:m||p.length===0,onClick:()=>void g(),children:m?`Creating…`:`Create link`})]})]})]})]})}),Ai=(0,$.memo)(function(e){let t=(0,Z.c)(39),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,createdPairingCredentials:c,clientSessions:l,revokingPairingLinkId:u,revokingClientSessionId:d,onRevokePairingLink:f,onRevokeClientSession:p,canRevoke:m}=e,h=a===void 0?`current`:a,g;if(t[0]!==m||t[1]!==c||t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==f||t[6]!==s||t[7]!==h||t[8]!==u){let e;t[10]!==m||t[11]!==c||t[12]!==i||t[13]!==n||t[14]!==r||t[15]!==f||t[16]!==h||t[17]!==u?(e=e=>(0,Q.jsx)(Di,{pairingLink:e,credential:c.get(e.id),endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:h,revokingPairingLinkId:u,onRevoke:f,canRevoke:m},e.id),t[10]=m,t[11]=c,t[12]=i,t[13]=n,t[14]=r,t[15]=f,t[16]=h,t[17]=u,t[18]=e):e=t[18],g=s.map(e),t[0]=m,t[1]=c,t[2]=i,t[3]=n,t[4]=r,t[5]=f,t[6]=s,t[7]=h,t[8]=u,t[9]=g}else g=t[9];let _;if(t[19]!==m||t[20]!==l||t[21]!==p||t[22]!==h||t[23]!==d){let e;t[25]!==m||t[26]!==p||t[27]!==h||t[28]!==d?(e=e=>(0,Q.jsx)(Oi,{clientSession:e,presentation:h,revokingClientSessionId:d,onRevokeSession:p,canRevoke:m},e.sessionId),t[25]=m,t[26]=p,t[27]=h,t[28]=d,t[29]=e):e=t[29],_=l.map(e),t[19]=m,t[20]=l,t[21]=p,t[22]=h,t[23]=d,t[24]=_}else _=t[24];let v;t[30]!==l.length||t[31]!==o||t[32]!==s.length||t[33]!==h?(v=s.length===0&&l.length===0&&!o?(0,Q.jsx)(`div`,{className:pi(h),children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[30]=l.length,t[31]=o,t[32]=s.length,t[33]=h,t[34]=v):v=t[34];let y;return t[35]!==g||t[36]!==_||t[37]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[g,_,v]}),t[35]=g,t[36]=_,t[37]=v,t[38]=y):y=t[38],y}),ji=(0,$.memo)(function(e){let t=(0,Z.c)(50),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=xi(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n?p=t[3]:(p=xi(n)&&n.status===`available`,t[2]=n,t[3]=p);let m=p,h=!f,g=l===`endpoint-rail`,_;t[4]!==u||t[5]!==l?(_=mi(l,u),t[4]=u,t[5]=l,t[6]=_):_=t[6];let v;t[7]!==r||t[8]!==g?(v=g&&r?(0,Q.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[7]=r,t[8]=g,t[9]=v):v=t[9];let y;t[10]===n.label?y=t[11]:(y=(0,Q.jsx)(`h3`,{className:`shrink-0 text-sm leading-5 font-medium text-foreground`,children:n.label}),t[10]=n.label,t[11]=y);let b;t[12]!==n.httpBaseUrl||t[13]!==h?(b=h?(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,children:n.httpBaseUrl})}),(0,Q.jsx)(Ue,{side:`top`,children:n.httpBaseUrl})]}):null,t[12]=n.httpBaseUrl,t[13]=h,t[14]=b):b=t[14];let x;t[15]===u?x=t[16]:(x=u?null:(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-3xs text-muted-foreground`,children:`Setup required`}),t[15]=u,t[16]=x);let S;t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[y,b,x]}),t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20];let C;t[21]===r?C=t[22]:(C=r?(0,Q.jsx)(`span`,{className:`rounded-md border border-primary/30 bg-primary/10 px-1 py-0.5 text-3xs text-primary`,children:`Default`}):null,t[21]=r,t[22]=C);let w;t[23]!==n||t[24]!==c||t[25]!==f||t[26]!==o?(w=f?(0,Q.jsx)(I,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[23]=n,t[24]=c,t[25]=f,t[26]=o,t[27]=w):w=t[27];let T;t[28]!==m||t[29]!==n||t[30]!==c||t[31]!==s?(T=m?(0,Q.jsx)(I,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[28]=m,t[29]=n,t[30]=c,t[31]=s,t[32]=T):T=t[32];let E;t[33]!==n||t[34]!==r||t[35]!==f||t[36]!==a?(E=!f&&!r?(0,Q.jsx)(I,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[33]=n,t[34]=r,t[35]=f,t[36]=a,t[37]=E):E=t[37];let D;t[38]!==C||t[39]!==w||t[40]!==T||t[41]!==E?(D=(0,Q.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[C,w,T,E]}),t[38]=C,t[39]=w,t[40]=T,t[41]=E,t[42]=D):D=t[42];let O;t[43]!==D||t[44]!==S?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[S,D]}),t[43]=D,t[44]=S,t[45]=O):O=t[45];let k;return t[46]!==O||t[47]!==_||t[48]!==v?(k=(0,Q.jsxs)(`div`,{className:_,children:[v,O]}),t[46]=O,t[47]=_,t[48]=v,t[49]=k):k=t[49],k});function Mi(e){let t=(0,Z.c)(14),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]!==i||t[3]!==r?(c=r>0?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[2]=i,t[3]=r,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u=l,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[8]=d):d=t[8];let f;return t[9]!==i||t[10]!==r||t[11]!==a||t[12]!==u?(f=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[d,r>0?(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:u}):(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:u})]}),t[9]=i,t[10]=r,t[11]=a,t[12]=u,t[13]=f):f=t[13],f}function Ni(e){if(!e.entry.enabled&&e.connection.phase!==`unsupported`)return{text:`Off`,tone:`muted`};let{connection:t}=e;switch(t.phase){case`connected`:return{text:`Connected`,tone:`muted`};case`connecting`:return{text:`Connecting`,tone:`muted`};case`reconnecting`:return{text:t.error?`Reconnecting: ${t.error}`:`Reconnecting`,tone:`error`};case`unsupported`:return{text:`Client not supported`,tone:`muted`};case`error`:return{text:t.error?`Connection failed: ${t.error}`:`Connection failed`,tone:`error`};case`offline`:return{text:`Offline`,tone:`muted`};case`available`:return{text:`Not connected`,tone:`muted`}}}function Pi(e){let t=(0,Z.c)(161),{environment:r,removingEnvironmentId:i,onSetEnabled:a,onRemove:o,onAddRoute:s}=e,[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(!1),p=r.environmentId,h=r.connection.phase===`unsupported`,g=r.entry.enabled&&!h,_=r.connection.phase===`connected`,v=i===p,y=r.connection.traceId,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={target:`trace ID`,onCopy:Hi,onError:Vi},t[0]=b):b=t[0];let{copyToClipboard:x}=Ze(b),S;t[1]===x?S=t[2]:(S=e=>{x(e,{traceId:e})},t[1]=x,t[2]=S);let C=S,w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w={target:`MCP URL`,onCopy:Bi,onError:zi},t[3]=w):w=t[3];let{copyToClipboard:T}=Ze(w),O;t[4]===r.serverConfig?O=t[5]:(O=Vn(r.serverConfig),t[4]=r.serverConfig,t[5]=O);let k=O,A;t[6]===p?A=t[7]:(A=ot.updateStateAtom(p),t[6]=p,t[7]=A);let j=m(A),M=j.status===`running`&&j.stage===`resuming`,N;t[8]===r?N=t[9]:(N=Ni(r),t[8]=r,t[9]=N);let P=N,ee=r.serverConfig?.environment.serverVersion??null,te=Qe(),ne;t[10]!==p||t[11]!==te.environments?(ne=n(te.environments.get(p)?.status??ce())?.descriptor,t[10]=p,t[11]=te.environments,t[12]=ne):ne=t[12];let re=ne,[ie,ae]=(0,$.useState)(re);re!==void 0&&re!==ie&&ae(re);let oe;t[13]!==p||t[14]!==te.environments?(oe=te.environments.get(p)?.environment.endpoint.httpBaseUrl,t[13]=p,t[14]=te.environments,t[15]=oe):oe=t[15];let le=oe,[ue,F]=(0,$.useState)(le);le!==void 0&&le!==ue&&F(le);let me=dt(p),L=_&&me._tag===`Some`?me.value.target:null,he=le??ue,ge;t[16]!==L||t[17]!==r.entry||t[18]!==he?(ge=Re({entry:r.entry,relayHttpBaseUrl:he,connectedTarget:L}),t[16]=L,t[17]=r.entry,t[18]=he,t[19]=ge):ge=t[19];let R=ge,ve;t[20]!==r.serverConfig||t[21]!==ie?(ve=r.serverConfig??(ie===void 0?null:{environment:ie}),t[20]=r.serverConfig,t[21]=ie,t[22]=ve):ve=t[22];let ye;t[23]===ve?ye=t[24]:(ye=de(ve),t[23]=ve,t[24]=ye);let be=ye,Se;t[25]===r.entry?Se=t[26]:(Se=Oe(r.entry),t[25]=r.entry,t[26]=Se);let z=Se.length,B;t[27]!==L||t[28]!==r?(B=yr(r,L),t[27]=L,t[28]=r,t[29]=B):B=t[29];let Ce=M?`Restarting`:P.text,we=g&&k?ee:null,Te;t[30]!==B||t[31]!==Ce||t[32]!==we?(Te=[B,Ce,we].filter(Ri),t[30]=B,t[31]=Ce,t[32]=we,t[33]=Te):Te=t[33];let V=Te.join(` · `),Ee=g&&_&&k!==null&&(j.status===`idle`||j.status===`failed`),De;t[34]!==g||t[35]!==r.connection||t[36]!==h?(De=h?r.connection.error??Ve(r.connection):g?Ve(r.connection):`Switched off`,t[34]=g,t[35]=r.connection,t[36]=h,t[37]=De):De=t[37];let ke=`${De}${k?`\nUpdate available: ${k.serverVersion} → ${k.clientVersion}`:``}`,Ae=r.label,je=!g,Me=g&&P.tone===`error`&&!M&&`text-destructive`,Ne;t[38]===Me?Ne=t[39]:(Ne=fe(`min-w-0 truncate`,Me),t[38]=Me,t[39]=Ne);let Pe;t[40]===Ne?Pe=t[41]:(Pe=(0,Q.jsx)(`span`,{className:Ne}),t[40]=Ne,t[41]=Pe);let H;t[42]!==ke||t[43]!==V||t[44]!==Pe?(H=(0,Q.jsx)(He,{payload:ke,render:Pe,children:V}),t[42]=ke,t[43]=V,t[44]=Pe,t[45]=H):H=t[45];let Fe;t[46]===ke?Fe=t[47]:(Fe=(0,Q.jsx)(Ue,{side:`top`,className:`whitespace-pre-wrap`,children:ke}),t[46]=ke,t[47]=Fe);let U;t[48]!==H||t[49]!==Fe?(U=(0,Q.jsxs)(We,{children:[H,Fe]}),t[48]=H,t[49]=Fe,t[50]=U):U=t[50];let W;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0`,children:`·`}),t[51]=W):W=t[51];let Le;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>l(Li),t[52]=Le):Le=t[52];let ze=z===1?`Routes`:`${z} routes`,Be=c&&`rotate-90`,G;t[53]===Be?G=t[54]:(G=fe(`size-3 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,Be),t[53]=Be,t[54]=G);let Ge;t[55]===G?Ge=t[56]:(Ge=(0,Q.jsx)(_e,{"aria-hidden":!0,className:G}),t[55]=G,t[56]=Ge);let Ke;t[57]!==c||t[58]!==ze||t[59]!==Ge?(Ke=(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":c,onClick:Le,className:`inline-flex shrink-0 items-center gap-0.5 rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring`,children:[ze,Ge]}),t[57]=c,t[58]=ze,t[59]=Ge,t[60]=Ke):Ke=t[60];let qe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0`,children:`·`}),t[61]=qe):qe=t[61];let Je=`remote-permissions-${p}`,Ye;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=()=>d(Ii),t[62]=Ye):Ye=t[62];let Xe=u&&`rotate-90`,K;t[63]===Xe?K=t[64]:(K=fe(`size-3 shrink-0 transition-transform duration-150 motion-reduce:transition-none`,Xe),t[63]=Xe,t[64]=K);let $e;t[65]===K?$e=t[66]:($e=(0,Q.jsx)(_e,{"aria-hidden":!0,className:K}),t[65]=K,t[66]=$e);let et;t[67]!==u||t[68]!==Je||t[69]!==$e?(et=(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":u,"aria-controls":Je,onClick:Ye,className:`inline-flex shrink-0 items-center gap-0.5 rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring`,children:[`Permissions`,$e]}),t[67]=u,t[68]=Je,t[69]=$e,t[70]=et):et=t[70];let tt;t[71]!==U||t[72]!==Ke||t[73]!==et?(tt=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[U,W,Ke,qe,et]}),t[71]=U,t[72]=Ke,t[73]=et,t[74]=tt):tt=t[74];let q;t[75]===j?q=t[76]:(q=j.status===`idle`?null:(0,Q.jsx)(`div`,{className:`mt-1 max-w-md`,children:(0,Q.jsx)(Jn,{state:j})}),t[75]=j,t[76]=q);let nt;t[77]!==r||t[78]!==s||t[79]!==c?(nt=c&&(0,Q.jsx)(mr,{environment:r,onAddRoute:()=>s(r)}),t[77]=r,t[78]=s,t[79]=c,t[80]=nt):nt=t[80];let rt;t[81]!==p||t[82]!==_||t[83]!==u?(rt=u&&(0,Q.jsx)(`div`,{id:`remote-permissions-${p}`,className:`mt-2 border-t border-border/50`,children:(0,Q.jsx)(sr,{environmentId:p,connected:_,routeContext:!0})}),t[81]=p,t[82]=_,t[83]=u,t[84]=rt):rt=t[84];let it;t[85]!==nt||t[86]!==rt?(it=(0,Q.jsxs)(Q.Fragment,{children:[nt,rt]}),t[85]=nt,t[86]=rt,t[87]=it):it=t[87];let at;t[88]!==r.entry.serverUpdateRequired||t[89]!==r.label||t[90]!==p||t[91]!==ie?.serverVersion||t[92]!==j.status||t[93]!==h?(at=h&&r.entry.serverUpdateRequired===!0&&j.status!==`running`?(0,Q.jsx)(er,{environmentId:p,serverLabel:`${r.label} server`,fromVersion:ie?.serverVersion,targetVersion:Ie,label:j.status===`failed`?`Retry update`:`Update`}):null,t[88]=r.entry.serverUpdateRequired,t[89]=r.label,t[90]=p,t[91]=ie?.serverVersion,t[92]=j.status,t[93]=h,t[94]=at):at=t[94];let st;t[95]!==r.label||t[96]!==r.serverConfig||t[97]!==p||t[98]!==j.status||t[99]!==Ee||t[100]!==k?(st=Ee?(0,Q.jsx)(Yn,{environmentId:p,serverLabel:`${r.label} server`,selfUpdate:En(r.serverConfig),installation:r.serverConfig?.environment.capabilities.serverInstallation,desktopAppUpdate:Fn(r.serverConfig),threadContinuation:$n(r.serverConfig),targetVersion:k.clientVersion,label:j.status===`failed`?`Retry update`:`Update`,appearance:`icon`}):null,t[95]=r.label,t[96]=r.serverConfig,t[97]=p,t[98]=j.status,t[99]=Ee,t[100]=k,t[101]=st):st=t[101];let ct=v||h,J=`${g?`Switch off`:`Switch on`} ${r.label}`,lt;t[102]!==p||t[103]!==a?(lt=e=>a(p,e),t[102]=p,t[103]=a,t[104]=lt):lt=t[104];let ut;t[105]!==g||t[106]!==ct||t[107]!==J||t[108]!==lt?(ut=(0,Q.jsx)(He,{render:(0,Q.jsx)(Mn,{size:`sm`,checked:g,disabled:ct,"aria-label":J,onCheckedChange:lt})}),t[105]=g,t[106]=ct,t[107]=J,t[108]=lt,t[109]=ut):ut=t[109];let ft=h?`Client not supported`:g?`Switch off`:`Switch on`,pt;t[110]===ft?pt=t[111]:(pt=(0,Q.jsx)(Ue,{side:`top`,children:ft}),t[110]=ft,t[111]=pt);let Y;t[112]!==ut||t[113]!==pt?(Y=(0,Q.jsxs)(We,{children:[ut,pt]}),t[112]=ut,t[113]=pt,t[114]=Y):Y=t[114];let mt=`More actions for ${r.label}`,ht;t[115]!==v||t[116]!==mt?(ht=(0,Q.jsx)(I,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,disabled:v,"aria-label":mt}),t[115]=v,t[116]=mt,t[117]=ht):ht=t[117];let gt;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,Q.jsx)(Rn,{className:`size-3.5`}),t[118]=gt):gt=t[118];let _t;t[119]===ht?_t=t[120]:(_t=(0,Q.jsx)(se,{render:ht,children:gt}),t[119]=ht,t[120]=_t);let vt;t[121]!==r.serverConfig||t[122]!==p?(vt=(0,Q.jsx)(pr,{environmentId:p,serverConfig:r.serverConfig}),t[121]=r.serverConfig,t[122]=p,t[123]=vt):vt=t[123];let yt,bt;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(yt=()=>l(Fi),bt=(0,Q.jsx)(xe,{}),t[124]=yt,t[125]=bt):(yt=t[124],bt=t[125]);let xt=c?`Hide routes`:`Routes`,St;t[126]===xt?St=t[127]:(St=(0,Q.jsxs)(E,{onClick:yt,children:[bt,xt]}),t[126]=xt,t[127]=St);let Ct;t[128]!==T||t[129]!==R?(Ct=R?(0,Q.jsx)(E,{onClick:()=>T(R,{url:R}),children:`Copy MCP URL`}):null,t[128]=T,t[129]=R,t[130]=Ct):Ct=t[130];let wt;t[131]!==C||t[132]!==y?(wt=y?(0,Q.jsx)(E,{onClick:()=>C(y),children:`Copy trace ID`}):null,t[131]=C,t[132]=y,t[133]=wt):wt=t[133];let Tt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=(0,Q.jsx)(pe,{}),t[134]=Tt):Tt=t[134];let Et;t[135]!==r||t[136]!==o?(Et=()=>o(r),t[135]=r,t[136]=o,t[137]=Et):Et=t[137];let Dt=v?`Removing…`:`Remove from this device…`,Ot;t[138]!==Et||t[139]!==Dt?(Ot=(0,Q.jsx)(E,{variant:`destructive`,onClick:Et,children:Dt}),t[138]=Et,t[139]=Dt,t[140]=Ot):Ot=t[140];let kt;t[141]!==vt||t[142]!==St||t[143]!==Ct||t[144]!==wt||t[145]!==Ot?(kt=(0,Q.jsxs)(D,{align:`end`,children:[vt,St,Ct,wt,Tt,Ot]}),t[141]=vt,t[142]=St,t[143]=Ct,t[144]=wt,t[145]=Ot,t[146]=kt):kt=t[146];let At;t[147]!==_t||t[148]!==kt?(At=(0,Q.jsxs)(f,{children:[_t,kt]}),t[147]=_t,t[148]=kt,t[149]=At):At=t[149];let jt;return t[150]!==r.label||t[151]!==be||t[152]!==je||t[153]!==tt||t[154]!==q||t[155]!==it||t[156]!==at||t[157]!==st||t[158]!==Y||t[159]!==At?(jt=(0,Q.jsxs)(br,{kind:be,label:Ae,dimmed:je,subtitle:tt,below:q,detail:it,children:[at,st,Y,At]}),t[150]=r.label,t[151]=be,t[152]=je,t[153]=tt,t[154]=q,t[155]=it,t[156]=at,t[157]=st,t[158]=Y,t[159]=At,t[160]=jt):jt=t[160],jt}function Fi(e){return!e}function Ii(e){return!e}function Li(e){return!e}function Ri(e){return e!==null}function zi(e){K.add(Y({type:`error`,title:`Could not copy MCP URL`,description:e.message}))}function Bi(e){let{url:t}=e;K.add({type:`success`,title:`MCP URL copied`,description:`Add it to an agent, e.g. claude mcp add --transport http p4 ${t}`})}function Vi(e){K.add(Y({type:`error`,title:`Could not copy trace ID`,description:e.message}))}function Hi(e){let{traceId:t}=e;K.add({type:`success`,title:`Trace ID copied`,description:t})}function Ui(e){let t=(0,Z.c)(10),{checked:n,disabled:r,disabledReason:i,onCheckedChange:a,ariaLabel:o}=e,s=o===void 0?`Enable P4 Connect`:o,c;t[0]===a?c=t[1]:(c=a?{onCheckedChange:a}:{},t[0]=a,t[1]=c);let l;t[2]!==s||t[3]!==n||t[4]!==r||t[5]!==c?(l=(0,Q.jsx)(Mn,{"aria-label":s,checked:n,disabled:r,...c}),t[2]=s,t[3]=n,t[4]=r,t[5]=c,t[6]=l):l=t[6];let u=l,d;return t[7]!==u||t[8]!==i?(d=i?(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:u})}),(0,Q.jsx)(Ue,{side:`top`,children:i})]}):u,t[7]=u,t[8]=i,t[9]=d):d=t[9],d}function Wi(e){let t=(0,Z.c)(44),{canManageRelay:n}=e,r=tt(),{isSignedIn:i,linkState:a,linkRevoked:o,managedTunnelActive:s,managedTunnelOutOfSync:c,publishAgentActivity:l,holdWebhooksWhileOffline:u,operationError:d,reconcileCloudState:f}=nr(),[p,m]=(0,$.useState)(!1),[h,g]=(0,$.useState)(!1),_=i?n?null:`Your session does not have permission to manage P4 Connect access.`:`Sign in to P4 Connect to manage this environment.`,v=p||h,y;t[0]!==r||t[1]!==l||t[2]!==f?(y=async e=>{r!==null&&ut(r,`relay:write`)&&(m(!0),await f({managedTunnel:e,publish:l})&&K.add({type:`success`,title:e?`P4 Connect linked`:l?`P4 Connect tunnel disabled`:`P4 Connect unlinked`,description:e?`This environment is available through P4 Connect.`:l?`The managed tunnel was removed. Agent activity publishing stays on.`:`This environment is no longer available through P4 Connect.`}),m(!1))},t[0]=r,t[1]=l,t[2]=f,t[3]=y):y=t[3];let b=y,x;t[4]!==s||t[5]!==r||t[6]!==f?(x=async e=>{r!==null&&ut(r,`relay:write`)&&(g(!0),await f({managedTunnel:s,publish:e})&&K.add({type:`success`,title:e?`Agent activity enabled`:`Agent activity disabled`,description:e?`This environment publishes agent activity to your mobile clients.`:`This environment will stop publishing agent activity.`}),g(!1))},t[4]=s,t[5]=r,t[6]=f,t[7]=x):x=t[7];let S=x,C;t[8]!==s||t[9]!==l||t[10]!==f?(C=async e=>{g(!0),await f({managedTunnel:s,publish:l,holdWebhooksWhileOffline:e})&&K.add({type:`success`,title:e?`Webhooks held while offline`:`Webhooks no longer held`,description:e?`P4 Connect keeps webhook requests for up to 24 hours while this environment is offline.`:`Requests to an offline environment now fail. Anything already held is still delivered.`}),g(!1)},t[8]=s,t[9]=l,t[10]=f,t[11]=C):C=t[11];let w=C,T;t[12]!==n||t[13]!==_||t[14]!==v||t[15]!==i||t[16]!==o||t[17]!==s||t[18]!==c||t[19]!==d||t[20]!==a||t[21]!==b?(T=window.desktopBridge?(0,Q.jsx)(mn,{title:Zn(`t3-connect`).title,description:o?`This environment was removed from P4 Connect. Turn it on to link it again.`:s?`This environment is available to your other devices through P4 Connect.`:c?`P4 Connect is out of sync. This environment is linked only to publish agent activity, so other devices cannot connect. Turn P4 Connect on to repair it.`:`Make this environment available to your other devices through P4 Connect.`,status:d??a.error,control:(0,Q.jsx)(Ui,{checked:s,disabled:!n||!i||a.data===null||a.isPending||v,disabledReason:_,onCheckedChange:e=>void b(e)})}):o?(0,Q.jsx)(mn,{title:Zn(`t3-connect`).title,description:"This environment was removed from P4 Connect. Run `p4c connect link` on the host to link it again."}):null,t[12]=n,t[13]=_,t[14]=v,t[15]=i,t[16]=o,t[17]=s,t[18]=c,t[19]=d,t[20]=a,t[21]=b,t[22]=T):T=t[22];let E;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=Zn(`publish-agent-activity`),t[23]=E):E=t[23];let D=!n||!i||a.data===null||a.isPending||v,O;t[24]===S?O=t[25]:(O=e=>void S(e),t[24]=S,t[25]=O);let k;t[26]!==_||t[27]!==l||t[28]!==D||t[29]!==O?(k=(0,Q.jsx)(mn,{title:E.title,description:`Send activity to mobile notifications and Live Activities without P4 Connect.`,control:(0,Q.jsx)(Ui,{ariaLabel:`Publish agent activity to mobile clients`,checked:l,disabled:D,disabledReason:_,onCheckedChange:O})}),t[26]=_,t[27]=l,t[28]=D,t[29]=O,t[30]=k):k=t[30];let A;t[31]!==n||t[32]!==_||t[33]!==u||t[34]!==v||t[35]!==i||t[36]!==s||t[37]!==a||t[38]!==w?(A=s?(0,Q.jsx)(mn,{title:Zn(`hold-webhooks-while-offline`).title,description:`Keep webhook requests for up to 24 hours while this environment is offline, then deliver them. Off: P4 Connect only forwards requests and stores nothing.`,control:(0,Q.jsx)(Ui,{ariaLabel:`Hold webhook requests while this environment is offline`,checked:u,disabled:!n||!i||a.isPending||v,disabledReason:_,onCheckedChange:e=>void w(e)})}):null,t[31]=n,t[32]=_,t[33]=u,t[34]=v,t[35]=i,t[36]=s,t[37]=a,t[38]=w,t[39]=A):A=t[39];let j;return t[40]!==T||t[41]!==k||t[42]!==A?(j=(0,Q.jsxs)(Q.Fragment,{children:[T,k,A]}),t[40]=T,t[41]=k,t[42]=A,t[43]=j):j=t[43],j}function Gi(e){let t=(0,Z.c)(3),{canReadRelay:n,canManageRelay:r}=e;if(!Fe())return null;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(mn,{title:`P4 Connect`,description:`To edit these settings, pair this connection with both View relay and Manage relay permissions.`}),t[0]=e):e=t[0],e}let i;return t[1]===r?i=t[2]:(i=(0,Q.jsx)(Wi,{canManageRelay:r}),t[1]=r,t[2]=i),i}function Ki(e){let t=(0,Z.c)(4),{cloudEnabled:n}=e,r=n===void 0||n,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Lt,{variant:`icon`,children:(0,Q.jsx)(ve,{})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(zt,{children:`No saved remote environments`}),t[1]=a):a=t[1];let o=r?`Click “Add environment” to pair another environment, or connect one from P4 Connect.`:`Click “Add environment” to pair another environment.`,s;return t[2]===o?s=t[3]:(s=(0,Q.jsxs)(Vt,{className:`min-h-52`,children:[i,(0,Q.jsxs)(Rt,{children:[a,(0,Q.jsx)(Bt,{children:o})]})]}),t[2]=o,t[3]=s),s}function qi(e){let t=(0,Z.c)(3),{primaryEnvironmentId:n,savedEnvironments:r}=e,i;return t[0]!==n||t[1]!==r?(i=Fe()?(0,Q.jsx)(tr,{primaryEnvironmentId:n,savedEnvironments:r,empty:(0,Q.jsx)(Ki,{})}):r.length===0?(0,Q.jsx)(Ki,{cloudEnabled:!1}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Ji(){let e=window.desktopBridge,t=m(ct),{environments:n}=et(),r=$e(),i=pt(wn,{reportFailure:!1}),a=pt(Cn,{reportFailure:!1}),s=pt(st.remove,{reportFailure:!1}),u=pt(st.register,{reportFailure:!1}),d=Qe(),p=pt(st.setEnabled,{reportFailure:!1}),_=r?.environmentId??null,v=Sn(),y=v.data?.authenticated?v.data.permissions??v.data.scopes??null:null,b=e?null:v.data?.auth.policy??null,x=(0,$.useMemo)(()=>n.filter(e=>e.entry.target._tag!==`PrimaryConnectionTarget`),[n]),S=(0,$.useMemo)(()=>x.filter(e=>!Be(e.entry.target)),[x]),C=(0,$.useMemo)(()=>g(e=>x.map(t=>({environment:t,updateStatus:e(ot.updateStateAtom(t.environmentId)).status}))),[x]),w=m(C),T=(0,$.useMemo)(()=>w.flatMap(({environment:e,updateStatus:t})=>{let n=Vn(e.serverConfig),r=En(e.serverConfig),i=Fn(e.serverConfig);return!n||t===`running`||!e.entry.enabled||e.connection.phase!==`connected`||Be(e.entry.target)||r===null||r===`desktop-managed`&&!i?[]:[{environmentId:e.environmentId,serverLabel:e.label,selfUpdate:r,installation:e.serverConfig?.environment.capabilities.serverInstallation,desktopAppUpdate:i,threadContinuation:$n(e.serverConfig),continueThreadsAfterServerUpdate:e.serverConfig?.settings.continueThreadsAfterServerUpdate??!1,targetVersion:n.clientVersion}]}),[w]),E=(0,$.useMemo)(()=>[...r?[r]:[],...x.filter(e=>e.entry.enabled)],[r,x]),O=(0,$.useMemo)(()=>{let e=new Set;for(let t of x){let n=t.entry.profile;if(t.entry.target._tag!==`SshConnectionTarget`||oe(n)||n.value._tag!==`SshConnectionProfile`)continue;let r=n.value.target;e.add(r.alias),e.add(vr(r))}return e},[x]),[k,A]=(0,$.useState)(null),[j,M]=(0,$.useState)(null),[N,P]=(0,$.useState)(()=>new Map),ee=(0,$.useCallback)(e=>{P(t=>new Map(t).set(e.id,e.credential))},[]),[te,ne]=(0,$.useState)(null),[re,ie]=(0,$.useState)(null),[ae,ce]=(0,$.useState)(!1),[le,ue]=(0,$.useState)(!1),[F,pe]=(0,$.useState)(null),[me,L]=(0,$.useState)(`remote`),[ge,R]=(0,$.useState)(``),[be,xe]=(0,$.useState)(``),[z,B]=(0,$.useState)(``),[Te,V]=(0,$.useState)(``),[Ee,Oe]=(0,$.useState)(``),[ke,Ae]=(0,$.useState)(!1),Me=(0,$.useRef)(void 0),[Pe,H]=(0,$.useState)(null),[U,W]=(0,$.useState)(!1),[Ie,Le]=(0,$.useState)(null),[Re,ze]=(0,$.useState)(!1),[Ve,G]=(0,$.useState)(!1),[Ze,tt]=(0,$.useState)(!1),[q,nt]=(0,$.useState)(!1),[it,at]=(0,$.useState)(null),[J,dt]=(0,$.useState)(null),mt=J!==null,[ht,gt]=(0,$.useState)(null),[_t,It]=(0,$.useState)(!1),[Lt,Rt]=(0,$.useState)(String($r)),[zt,Bt]=(0,$.useState)(null),Vt=r?.serverConfig??null,qt=Vn(Vt),Jt=m(ot.updateStateAtom(_)),[Yt,Xt]=(0,$.useState)(!1),Qt=Zt(e=>e.defaultAdvertisedEndpointKey),$t=Zt(e=>e.setDefaultAdvertisedEndpointKey),en=lt(_,he),tn=lt(_,o),nn=lt(_,l),rn=lt(_,c),an=lt(_,h),on=!Ce()&&rn,sn=ft(en&&_!==null?Rr.accessChanges({environmentId:_,input:null}):null),cn=ft(on&&e?Gr:null),ln=e!==void 0&&le&&me===`ssh`,dn=ft(ln?Qr:null),_n=dn.refresh;(0,$.useEffect)(()=>{ln&&_n()},[ln,_n]);let vn=ft(on&&e?Wn:null),X=vn.data,jn=it??vn.error,zn=vn.isPending&&vn.data===null,Bn=dn.data??ti,Hn=(0,$.useMemo)(()=>Bn.filter(e=>{let t=vr(e);return!O.has(e.alias)&&!O.has(t)}),[Bn,O]),Un=(0,$.useMemo)(()=>qr(Hn,z),[z,Hn]),Kn=dn.isPending&&dn.data===null,qn=dn.error,Xn=e!==void 0&&(Kn||Hn.length>0),er=cn.data?.serverExposureState??null,tr=cn.data?.advertisedEndpoints??ei,nr=k??cn.error,rr=j??sn.error,ir=sn.isPending&&sn.data===null,Z=(0,$.useMemo)(()=>{let e=sn.data;return e?.type===`snapshot`?hi(e.payload.pairingLinks.map(e=>vi(e))):[]},[sn.data]),or=(0,$.useMemo)(()=>{let e=sn.data;return e?.type===`snapshot`?_i(e.payload.clientSessions.map(e=>yi(e))):[]},[sn.data]),cr=e?er?.mode===`network-accessible`:b===`remote-reachable`,lr=Lt.trim(),dr=Number(lr),fr=/^\d+$/u.test(lr)&&Number.isInteger(dr)&&dr>=1&&dr<=65535,mr=(0,$.useMemo)(()=>{if(!ht)return null;if(!fr||dr===$r)return ht.httpBaseUrl;try{let e=new URL(ht.httpBaseUrl);return e.port=String(dr),e.toString().replace(/\/$/u,``)}catch{return ht.httpBaseUrl}},[fr,dr,ht]),hr=(0,$.useCallback)(async t=>{if(e&&_!==null&&ut(_,`environment:maintain`)){ze(!0),A(null);try{await e.setServerExposureMode(t?`network-accessible`:`local-only`),Kr(),G(!1),ze(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;G(!1),A(t),K.add(Y({type:`error`,title:`Could not update network access`,description:t})),ze(!1)}}},[e,_]),gr=(0,$.useCallback)(()=>{zt!==null&&hr(zt===`network-accessible`)},[hr,zt]),_r=(0,$.useCallback)(async()=>{if(e&&_!==null&&ut(_,`environment:maintain`)&&fr){tt(!0),A(null);try{await e.setTailscaleServeEnabled({enabled:!0,port:dr}),Kr(),gt(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;A(t),K.add(Y({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{tt(!1)}}},[e,fr,dr,_]),yr=(0,$.useCallback)(e=>{Rt(String(er?.tailscaleServePort??$r)),gt(e)},[er?.tailscaleServePort]),br=(0,$.useCallback)(async()=>{if(e&&_!==null&&ut(_,`environment:maintain`)){tt(!0),A(null);try{await e.setTailscaleServeEnabled({enabled:!1,port:er?.tailscaleServePort??$r}),Kr(),It(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;A(t),K.add(Y({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{tt(!1)}}},[e,er,_]),xr=(0,$.useCallback)(e=>{It(!0)},[]),Sr=(0,$.useCallback)(async e=>{if(_!==null&&ut(_,`access:write`)){ne(e),M(null);try{await xn(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;M(t),K.add(Y({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{ne(null)}}},[_]),Cr=(0,$.useCallback)(async e=>{if(_!==null&&ut(_,`access:write`)){ie(e),M(null);try{await bn(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;M(t),K.add(Y({type:`error`,title:`Could not revoke client access`,description:t}))}finally{ie(null)}}},[_]),wr=(0,$.useCallback)(async()=>{if(_!==null&&ut(_,`access:write`)){ce(!0),M(null);try{let e=await yn();K.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;M(t),K.add(Y({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{ce(!1)}}},[_]),Er=(0,$.useCallback)(async e=>{W(!0),H(null);let t=await a({target:e,label:``,...F?{expectedEnvironmentId:F.environmentId}:{}});if(t._tag===`Failure`){De(t)||H(di(je(t))),W(!1);return}R(``),xe(``),B(``),V(``),Oe(``),ue(!1),K.add({type:`success`,title:F?`Route added`:`Environment connected`,description:F?`${F.label} can now be reached over SSH ${e.alias}.`:`${e.alias} is ready over an SSH-managed tunnel.`}),W(!1)},[a,F]),Dr=(0,$.useCallback)(async()=>{if(me===`ssh`){let e;try{e=ci({host:z,username:Te,port:Ee})}catch(e){H(di(e));return}await Er(e);return}W(!0),H(null);let e;try{e=ui({host:ge,pairingCode:be})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;H(t),K.add(Y({type:`error`,title:`Could not add backend`,description:t})),W(!1);return}let t=await i({...e,...F?{expectedEnvironmentId:F.environmentId}:{}});if(t._tag===`Failure`){if(!De(t)){let e=je(t),n=e instanceof Error?e.message:`Failed to add backend.`;H(n),K.add(Y({type:`error`,title:`Could not add backend`,description:n}))}W(!1);return}R(``),xe(``),B(``),V(``),Oe(``),ue(!1),K.add(F?{type:`success`,title:`Route added`,description:`${F.label} now has another way to connect.`}:{type:`success`,title:`Backend added`,description:`The environment is saved and will reconnect on app startup.`}),W(!1)},[F,i,Er,ge,me,be,z,Ee,Te]),Or=(0,$.useCallback)(e=>{e.nativeEvent.isComposing||e.keyCode===229||e.key===`Enter`&&z.trim().length>0&&(e.preventDefault(),Dr())},[Dr,z]),kr=(0,$.useCallback)(async t=>{if(U||!e)return;W(!0),H(null),B(t.alias);let n;try{n=await e.resolveSshHost(t.alias)}catch(e){H(di(e)),W(!1);return}V(n.username??``),Oe(n.port===null?``:String(n.port)),await Er(n)},[Er,e,U]),jr=(0,$.useCallback)(e=>{if(e.nativeEvent.isComposing||e.keyCode===229)return;let n=ke&&Xn;if(n){let n=Wt(e,t,{platform:navigator.platform,context:{modelPickerOpen:!1}}),r=Gt(n??``),i=r===null?void 0:Un[r];if(i){e.preventDefault(),e.stopPropagation(),Ae(!1),kr(i);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation();return}}let r=n&&Me.current!==void 0;!e.defaultPrevented&&!r&&e.key===`Enter`&&z.trim().length>0&&(e.preventDefault(),Dr())},[Un,Dr,kr,Xn,t,z,ke]),Nr=(0,$.useCallback)(async(e,t)=>{H(null);let n=await p({environmentId:e,enabled:t});if(n._tag===`Failure`&&!De(n)){let e=je(n),r=e instanceof Error?e.message:`Failed to switch the backend ${t?`on`:`off`}.`;H(r),K.add(Y({type:`error`,title:`Could not switch backend ${t?`on`:`off`}`,description:r}))}},[p]),Pr=(0,$.useCallback)(async e=>{let t=e.environmentId;Le(t),H(null);let n=await s(t);if(Le(null),n._tag===`Failure`&&!De(n)){let e=je(n),t=e instanceof Error?e.message:`Failed to remove backend.`;H(t),K.add(Y({type:`error`,title:`Could not remove backend`,description:t}))}},[s]),[Fr,Ir]=(0,$.useState)(null),Lr=(0,$.useCallback)(async e=>{if(e.relayManaged&&Fe()){Ir(e);return}await rt(`Remove ${e.label} from this device?\nThis forgets its pairing, credentials, and cached threads here. Switch it off instead to keep it saved.`,{variant:`destructive`})===!0&&await Pr(e)},[Pr]),zr=Z,Br=(0,$.useMemo)(()=>tr.find(xi)??null,[tr]),Vr=(0,$.useMemo)(()=>cr?tr.filter(e=>!xi(e)):[],[tr,cr]),Hr=(0,$.useMemo)(()=>Br?[...Vr,Br]:Vr,[Br,Vr]),Ur=(0,$.useMemo)(()=>bi(Vr,Qt),[Qt,Vr]),Wr=(0,$.useMemo)(()=>Ur??bi(Br?[Br]:[],Qt),[Qt,Ur,Br]),Jr=Wr?Si(Wr):null,Yr=(0,$.useCallback)(e=>{$t(Si(e))},[$t]),Xr=(0,$.useCallback)(e=>{let t=li(e);if(t){R(t.host),xe(t.pairingCode);return}R(e)},[]),Zr=e=>{let t=me===e.mode;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:fe(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:U,onClick:()=>{L(e.mode)},children:[e.icon?(0,Q.jsx)(`span`,{className:fe(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})},ii=()=>(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,Q.jsx)(Tt,{value:ge,onChange:e=>Xr(e.target.value),placeholder:`backend.example.com`,disabled:U,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,Q.jsx)(Tt,{value:be,onChange:e=>xe(e.target.value),placeholder:`PAIRCODE`,disabled:U,spellCheck:!1})]})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`span`,{className:`mt-1 block text-2xs text-muted-foreground`,children:`Paste a full pairing URL here to fill both fields automatically.`})})]}),ai=F!==null&&!F.relayManaged&&d.environments.has(F.environmentId)?d.environments.get(F.environmentId).environment:null,oi=async()=>{if(ai===null||F===null)return;W(!0);let e=await u(new Ne({target:new we({environmentId:ai.environmentId,label:F.label})}));if(W(!1),e._tag===`Failure`){if(!De(e)){let t=je(e);H(t instanceof Error?t.message:`Could not add the route.`)}return}ue(!1),K.add({type:`success`,title:`Route added`,description:`${F.label} falls back to P4 Connect when its other routes are unreachable.`})},si=()=>(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[ai===null?null:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This machine is on your P4 Connect account. Use it as a fallback route.`}),(0,Q.jsx)(I,{size:`xs`,variant:`outline`,disabled:U,onClick:()=>void oi(),children:`Add P4 Connect`})]}),ii(),Pe?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:Pe}):null,(0,Q.jsxs)(I,{variant:`outline`,className:`w-full`,disabled:U,onClick:()=>void Dr(),children:[(0,Q.jsx)(ye,{className:`size-3.5`}),U?`Adding…`:F?`Add route`:`Add environment`]})]}),fi=()=>(0,Q.jsx)(`div`,{className:`space-y-4`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`block`,children:[(0,Q.jsx)(`label`,{htmlFor:`saved-backend-ssh-host`,className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,Q.jsxs)(bt,{items:Un,itemToStringValue:e=>e.alias,mode:`none`,openOnInputClick:!0,open:ke,onOpenChange:Ae,onItemHighlighted:e=>{Me.current=e},value:z,onValueChange:(e,t)=>{if(B(e),t.reason!==`item-press`)return;let n=Un.find(t=>t.alias===e);n&&kr(n)},children:[(0,Q.jsx)(St,{id:`saved-backend-ssh-host`,onKeyDown:jr,placeholder:`Search hosts or type devbox`,disabled:U,spellCheck:!1}),Xn?(0,Q.jsx)(Ct,{children:Kn?(0,Q.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`Loading hosts…`}):Un.length>0?(0,Q.jsx)(yt,{className:`max-h-72`,children:Un.map((e,n)=>{let r=vr(e),i=n<9?Ut(n):null,a=i?Kt(t,i,navigator.platform):null;return(0,Q.jsxs)(wt,{value:e,className:`h-8 min-h-8 whitespace-nowrap`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.alias}),r===e.alias?(0,Q.jsx)(`span`,{className:`flex-1`}):(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:r}),a?(0,Q.jsx)(xt,{className:`shrink-0`,children:a}):null]},`${e.alias}:${e.hostname}:${e.port??``}`)})}):(0,Q.jsxs)(vt,{className:`break-all`,children:[`No hosts match "`,z.trim(),`".`]})}):null]})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,Q.jsx)(Tt,{value:Te,onChange:e=>V(e.target.value),onKeyDown:Or,placeholder:`root`,disabled:U,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,Q.jsx)(Tt,{value:Ee,onChange:e=>Oe(e.target.value),onKeyDown:Or,placeholder:`22`,inputMode:`numeric`,disabled:U,spellCheck:!1})]})]}),Pe||qn?(0,Q.jsx)(pn,{variant:`error`,children:(0,Q.jsx)(fn,{children:Pe??qn})}):null,(0,Q.jsxs)(I,{variant:`outline`,className:`w-full`,disabled:U,onClick:()=>void Dr(),children:[(0,Q.jsx)(ye,{className:`size-3.5`}),U?`Adding…`:F?`Add route`:`Add environment`]})]})}),mi=()=>(0,Q.jsx)(Mn,{checked:er?.mode===`network-accessible`,disabled:!er||Re,onCheckedChange:e=>{Bt(e?`network-accessible`:`local-only`),G(!0)},"aria-label":`Enable network access`}),Ci=e=>Yt?Vr.map(t=>{let n=Si(t);return(0,Q.jsx)(ji,{endpoint:t,isDefault:n===Jr,presentation:e,onSetDefault:Yr,onSetupTailscaleServe:yr,onDisableTailscaleServe:xr,isUpdatingTailscaleServe:Ze},t.id)}):null,wi=(0,$.useCallback)(async t=>{if(e&&_!==null&&ut(_,`environment:maintain`)){nt(!0),at(null);try{await t(),Ln()}catch(e){let t=e instanceof Error?e.message:`Failed to update WSL backend.`;at(t),K.add(Y({type:`error`,title:`Could not change WSL backend`,description:t})),Ln()}finally{nt(!1)}}},[e,_]),Ti=(0,$.useCallback)(()=>{at(null),Ln()},[]),Ei=(0,$.useMemo)(()=>n.some(e=>Be(e.entry.target)),[n]),Di=(0,$.useCallback)(t=>{if(!e||!X)return;let n=X.distros.find(e=>e.isDefault)?.name??null;if(t===ri){if(!X.enabled&&!X.wslOnly)return;let t=X.wslOnly;if(Ei||t){dt({kind:`disable`,wasWslOnly:t});return}wi(()=>e.setWslBackendEnabled(!1));return}let r=t===ni?null:t,i=r??n;if(!X.enabled){dt({kind:`enable`,nextDistro:r});return}if((X.distro??n)!==i){if(Ei||X.wslOnly){dt({kind:`distro`,nextDistro:r});return}wi(()=>e.setWslDistro(r))}},[wi,e,X,Ei]),Oi=(0,$.useCallback)(t=>{if(!e||!J||J.kind!==`enable`)return;let n=J.nextDistro;dt(null);let r=X?.distro??null;wi(()=>On({bridge:e,mode:t,nextDistro:n,persistedDistro:r}))},[wi,e,X,J]),Ni=(0,$.useCallback)(t=>{e&&X&&X.wslOnly!==t&&dt({kind:`wsl-only`,nextValue:t})},[e,X]),Fi=(0,$.useCallback)(()=>{if(!e||!J)return;let t=J;if(t.kind!==`enable`){if(dt(null),t.kind===`disable`){wi(async()=>{let n=await e.setWslBackendEnabled(!1);return t.wasWslOnly?await e.setWslOnly(!1):n});return}if(t.kind===`distro`){wi(()=>e.setWslDistro(t.nextDistro));return}wi(()=>e.setWslOnly(t.nextValue))}},[wi,e,J]),Ii=()=>{if(!X)return An({state:null,error:jn})&&on?(0,Q.jsx)(mn,{...Zn(`wsl-backend`),description:`Couldn't load the WSL backend state.`,status:(0,Q.jsx)(`span`,{className:`block text-destructive`,children:jn}),control:(0,Q.jsx)(I,{size:`sm`,variant:`outline`,onClick:Ti,disabled:zn,children:zn?`Retrying…`:`Retry`})}):null;if(!An({state:X,error:jn}))return null;if(!X.available)return(0,Q.jsx)(mn,{...Zn(`wsl-backend`),description:`WSL is unavailable, so Windows is running instead. Turn WSL off to clear this preference.`,status:jn?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:jn}):null,control:(0,Q.jsx)(I,{size:`sm`,variant:`outline`,disabled:q,onClick:()=>Di(ri),children:`Switch to Windows`})});let e=X.distros.find(e=>e.isDefault)?.name??null,t=X.enabled?X.distro??e??ni:ri,n=t===ri?`Off`:t===ni?`Default distro`:t;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(mn,{...Zn(`wsl-backend`),description:`Run the selected WSL distro alongside Windows. Projects remain on their current filesystem.`,status:jn?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:jn}):X.preflightError?(0,Q.jsxs)(`span`,{className:`block text-destructive`,children:[`WSL backend couldn't start: `,X.preflightError]}):null,control:(0,Q.jsxs)(Ye,{value:t,onValueChange:e=>{typeof e==`string`&&Di(e)},children:[(0,Q.jsx)(Je,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`WSL backend`,disabled:q,children:(0,Q.jsx)(Ke,{children:n})}),(0,Q.jsxs)(qe,{align:`end`,alignItemWithTrigger:!1,children:[(0,Q.jsx)(Ge,{hideIndicator:!0,value:ri,children:`Off`}),X.distros.length===0?(0,Q.jsx)(Ge,{hideIndicator:!0,value:ni,children:`Default distro`}):X.distros.map(e=>(0,Q.jsxs)(Ge,{hideIndicator:!0,value:e.name,children:[e.name,e.isDefault?` (default)`:``]},e.name))]})]})}),X.enabled?(0,Q.jsx)(mn,{title:`WSL only`,description:`Run only the WSL backend. P4 Code restarts when this changes.`,className:`bg-muted/20 pl-7 sm:pl-8`,control:(0,Q.jsx)(Mn,{checked:X.wslOnly,disabled:q,onCheckedChange:e=>Ni(e),"aria-label":`Run WSL only`})}):null]})},Li=()=>(0,Q.jsx)(mn,{title:Zn(`tailscale-https`).title,description:Br?Br.status===`available`?Br.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,control:Br?(0,Q.jsx)(Mn,{checked:Br.status===`available`,disabled:Ze,onCheckedChange:e=>{if(e){yr(Br);return}xr(Br)},"aria-label":`Enable Tailscale HTTPS`}):null}),Ri=e=>(0,Q.jsxs)(Q.Fragment,{children:[rr?(0,Q.jsx)(`div`,{className:pi(e),children:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:rr})}):null,(0,Q.jsx)(Ai,{endpointUrl:er?.endpointUrl,endpoints:Hr,defaultEndpointKey:Jr,presentation:e,isLoading:ir,pairingLinks:zr,createdPairingCredentials:N,clientSessions:or,revokingPairingLinkId:te,revokingClientSessionId:re,onRevokePairingLink:Sr,onRevokeClientSession:Cr,canRevoke:tn})]}),zi=()=>(0,Q.jsx)(mn,{title:Zn(`network-access`).title,description:cr?(0,Q.jsx)(Mi,{endpoint:Ur,hiddenEndpointCount:Math.max(Vr.length-1,0),expanded:Yt,onToggleExpanded:()=>Xt(e=>!e),fallback:er?.endpointUrl?`Reachable at ${er.endpointUrl}`:er?.advertisedHost?`Exposed on all interfaces. Pairing links use ${er.advertisedHost}.`:`Exposed on all interfaces.`}):er?`Limited to this machine.`:`Loading…`,status:nr?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:nr}):null,control:mi()}),Bi=()=>(0,Q.jsx)(mn,{title:Zn(`network-access`).title,description:e?`This connection cannot view or change network exposure.`:b===`remote-reachable`?`Remote access is already configured. Change network exposure where the server starts.`:b===`loopback-browser`?`Only this machine can connect. Restart with a non-loopback host for remote pairing.`:`Network exposure information is unavailable.`,control:!e&&(b===`remote-reachable`||b===`loopback-browser`)?(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(Mn,{checked:cr,disabled:!0,"aria-label":`Enable network access`})})}),(0,Q.jsx)(Ue,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]}):void 0}),Vi=(0,Q.jsx)(Q.Fragment,{children:_===null?(0,Q.jsxs)(gn,{...Zn(`connections-environment`),children:[(0,Q.jsx)(mn,{title:`No environment selected`,description:`Connect an environment to view its settings and access.`}),(0,Q.jsx)(ur,{}),nn||an?(0,Q.jsx)(Gi,{canReadRelay:nn,canManageRelay:an}):null]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(gn,{...Zn(`connections-environment`),title:r?.label??(e?`This machine`:`Primary environment`),icon:(0,Q.jsx)(un,{"aria-hidden":!0,kind:Vt?de(Vt):`desktop`,className:`size-4`}),headerAction:_===null?null:(0,Q.jsxs)(f,{children:[(0,Q.jsx)(se,{render:(0,Q.jsx)(I,{type:`button`,variant:`ghost-muted`,size:`icon-xs`,"aria-label":`More actions for this machine`}),children:(0,Q.jsx)(Rn,{className:`size-3.5`})}),(0,Q.jsx)(D,{align:`end`,children:(0,Q.jsx)(pr,{environmentId:_,serverConfig:Vt})})]}),children:[(0,Q.jsx)(ur,{}),on?(0,Q.jsx)(mn,{title:`Version`,description:Jt.status===`idle`?[Vt?.environment.serverVersion??null,r?.displayUrl??null].filter(e=>e!==null).join(` · `)||`Loading…`:(0,Q.jsx)(Jn,{state:Jt}),control:qt&&_!==null&&Jt.status!==`running`?(0,Q.jsx)(Yn,{size:`sm`,environmentId:_,serverLabel:r?`${r.label} server`:`server`,selfUpdate:En(Vt),installation:Vt?.environment.capabilities.serverInstallation,desktopAppUpdate:Fn(Vt),threadContinuation:$n(Vt),targetVersion:qt.clientVersion,label:Jt.status===`failed`?`Retry update`:`Update to ${qt.clientVersion}`}):Jt.status===`idle`&&Vt?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Up to date`}):void 0}):null,on&&e?(0,Q.jsxs)(Q.Fragment,{children:[zi(),Ci(`endpoint-rail`),Li(),Ii(),nn||an?(0,Q.jsx)(Gi,{canReadRelay:nn,canManageRelay:an}):null]}):on?(0,Q.jsxs)(Q.Fragment,{children:[Bi(),nn||an?(0,Q.jsx)(Gi,{canReadRelay:nn,canManageRelay:an}):null]}):null,r?(0,Q.jsxs)(`details`,{className:`group px-3 sm:px-4`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-2 rounded-md text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring [&::-webkit-details-marker]:hidden`,children:[`Permissions`,(0,Q.jsx)(_e,{"aria-hidden":!0,className:`size-3 text-muted-foreground group-open:rotate-90`})]}),(0,Q.jsx)(sr,{environmentId:r.environmentId,connected:r.connection.phase===`connected`})]}):null]}),en||tn?(0,Q.jsx)(ar,{id:`authorized-clients`,title:`Authorized clients`,summary:gi(or,zr),control:tn?(0,Q.jsx)(ki,{delegatableScopes:y??[],onPairingLinkCreated:ee,clientSessions:en&&sn.error===null&&sn.data?.type===`snapshot`?or:null,isRevokingOtherClients:ae,onRevokeOtherClients:wr}):void 0,children:(0,Q.jsx)(Et,{scrollFade:!0,chainVerticalScroll:!0,className:`max-h-[22.5rem]`,"data-testid":`authorized-clients-scroll-area`,children:en?Ri(`current`):(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`This connection can create access links but cannot view authorized clients.`})})}):null,(0,Q.jsx)(Tn,{open:Ve&&on,onOpenChange:e=>{Re||G(e)},onOpenChangeComplete:e=>{e||Bt(null)},children:(0,Q.jsxs)(Dn,{children:[(0,Q.jsxs)(In,{children:[(0,Q.jsx)(kn,{children:zt===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,Q.jsx)(Nn,{children:zt===`network-accessible`?`Let your other devices connect to P4 Code over the network. Pair devices to give them access. P4 Code will restart.`:`Devices connected over your local network will disconnect. Existing tunnels, such as P4 Connect or Tailscale HTTPS, keep working. P4 Code will restart.`})]}),(0,Q.jsxs)(Pn,{children:[(0,Q.jsx)(Qn,{disabled:Re,render:(0,Q.jsx)(I,{variant:`outline`,disabled:Re}),children:(0,Q.jsx)(`span`,{className:`[text-box:trim-both_cap_alphabetic]`,children:`Cancel`})}),(0,Q.jsxs)(I,{variant:`default`,onClick:gr,disabled:!on||zt===null||Re,children:[Re&&(0,Q.jsx)(Xe,{size:`sm`}),(0,Q.jsx)(`span`,{className:`[text-box:trim-both_cap_alphabetic]`,children:Re?`Restarting…`:zt===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})]})}),(0,Q.jsx)(Tn,{open:mt&&on,onOpenChange:e=>{q||e||dt(null)},children:(0,Q.jsxs)(Dn,{children:[(0,Q.jsxs)(In,{children:[(0,Q.jsx)(kn,{children:J?.kind===`disable`?J.wasWslOnly?`Turn off WSL and switch back to Windows?`:`Disable WSL backend?`:J?.kind===`distro`?`Switch WSL distro?`:J?.kind===`enable`?`Start the WSL backend`:J?.nextValue?`Run only the WSL backend?`:`Re-enable the Windows backend?`}),(0,Q.jsx)(Nn,{children:J?.kind===`disable`?J.wasWslOnly?`P4 Code will restart on the Windows backend. Threads and projects opened against WSL stay safe inside the distro and become available again when you re-enable WSL.`:`The WSL backend will stop. Threads and projects opened against WSL stay safe inside the distro, but they'll be unavailable in P4 Code until you re-enable WSL.`:J?.kind===`distro`?`P4 Code will restart the WSL backend on the new distro. Sessions still running on the current distro will be interrupted.`:J?.kind===`enable`?`Run the WSL backend alongside the Windows one, or stop the Windows backend and use only WSL? You can change this later from Settings.`:J?.nextValue?`P4 Code will restart and start only the WSL backend. Your Windows-side projects won't be accessible until you turn this off again.`:`P4 Code will restart and bring the Windows backend back up alongside WSL.`})]}),(0,Q.jsxs)(Pn,{children:[(0,Q.jsx)(Qn,{disabled:q,render:(0,Q.jsx)(I,{variant:`outline`,disabled:q}),children:`Cancel`}),J?.kind===`enable`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(I,{variant:`outline`,onClick:()=>Oi(`wsl-only`),disabled:q||!on,children:q?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Applying…`]}):`Use only WSL`}),(0,Q.jsx)(I,{variant:`default`,onClick:()=>Oi(`both`),disabled:q||!on,children:q?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Applying…`]}):`Run both backends`})]}):(0,Q.jsx)(I,{variant:J?.kind===`disable`||J?.kind===`wsl-only`&&J.nextValue?`destructive`:`default`,onClick:Fi,disabled:q||!on,children:q?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Applying…`]}):J?.kind===`disable`?J.wasWslOnly?`Switch to Windows`:`Disable WSL`:J?.kind===`distro`?`Switch distro`:J?.nextValue?`Restart and enable`:`Restart and disable`})]})]})}),(0,Q.jsx)(Tn,{open:_t&&on,onOpenChange:e=>{Ze||It(e)},children:(0,Q.jsxs)(Dn,{children:[(0,Q.jsxs)(In,{children:[(0,Q.jsx)(kn,{children:`Disable Tailscale HTTPS?`}),(0,Q.jsx)(Nn,{children:`P4 Code will restart the local backend without Tailscale Serve.`})]}),(0,Q.jsxs)(Pn,{children:[(0,Q.jsx)(Qn,{disabled:Ze,render:(0,Q.jsx)(I,{variant:`outline`,disabled:Ze}),children:`Cancel`}),(0,Q.jsx)(I,{variant:`destructive`,onClick:()=>void br(),disabled:Ze||!on,children:Ze?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,Q.jsx)(Ft,{open:ht!==null,onOpenChange:e=>{Ze||e||gt(null)},children:(0,Q.jsxs)(Pt,{className:`max-w-md`,children:[(0,Q.jsxs)(Dt,{children:[(0,Q.jsx)(Ot,{children:`Set up Tailscale HTTPS?`}),(0,Q.jsx)(Nt,{children:`P4 Code will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,Q.jsxs)(Mt,{children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,Q.jsx)(Tt,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:Lt,onChange:e=>Rt(e.target.value),disabled:Ze})]}),fr?null:(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,Q.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,children:mr??`Pending MagicDNS endpoint`})}),mr?(0,Q.jsx)(Ue,{side:`top`,children:mr}):null]})]})]}),(0,Q.jsxs)(kt,{children:[(0,Q.jsx)(jt,{disabled:Ze,render:(0,Q.jsx)(I,{variant:`outline`,disabled:Ze}),children:`Cancel`}),(0,Q.jsx)(I,{onClick:()=>void _r(),disabled:Ze||!fr,children:Ze?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{size:`sm`}),`Restarting…`]}):`Enable`})]})]})})]})});return(0,Q.jsxs)(hn,{children:[Vi,(0,Q.jsxs)(gn,{...Zn(`remote-environments`),title:`Environments`,headerAction:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[T.length>0?(0,Q.jsx)(Gn,{targets:T,variant:`ghost-muted`}):null,(0,Q.jsxs)(Ft,{open:le,onOpenChange:e=>{ue(e),e?pe(null):H(null)},children:[(0,Q.jsxs)(We,{children:[(0,Q.jsx)(He,{render:(0,Q.jsx)(At,{render:(0,Q.jsxs)(I,{size:`xs`,variant:`ghost-muted`,"aria-label":`Add environment`,children:[(0,Q.jsx)(ye,{className:`size-3`}),(0,Q.jsx)(`span`,{children:`Add environment`})]})})}),(0,Q.jsx)(Ue,{side:`top`,children:`Add environment`})]}),(0,Q.jsxs)(Pt,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,Q.jsxs)(Dt,{children:[(0,Q.jsx)(Ot,{children:F?`Add a route to ${F.label}`:`Add Environment`}),(0,Q.jsx)(Nt,{children:F?`Pair this machine again over another address, such as its Tailscale name. It joins the existing routes instead of adding a second machine.`:`Pair another environment to this client.`})]}),(0,Q.jsx)(Mt,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Zr({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,Q.jsx)(ve,{"aria-hidden":!0,className:`size-4`})}),e?Zr({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,Q.jsx)(Se,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,Q.jsx)(Ht,{children:me===`ssh`?fi():si()})]})})]})]})]}),children:[S.map(e=>(0,Q.jsx)(Pi,{environment:e,removingEnvironmentId:Ie,onSetEnabled:Nr,onRemove:Lr,onAddRoute:e=>{pe(e),H(null),ue(!0)}},e.environmentId)),(0,Q.jsx)(qi,{primaryEnvironmentId:_,savedEnvironments:x})]}),Fe()?(0,Q.jsx)(Mr,{environmentLabel:Fr?.label??null,onCancel:()=>Ir(null),onConfirm:()=>{Fr&&(Ir(null),Pr(Fr))}}):null,(0,Q.jsx)(Tr,{environments:E}),(0,Q.jsx)(Ar,{environments:E})]})}function Yi(e){let{kind:t}=e;K.add({type:`success`,title:t===`hosted-link`?`Hosted app link copied`:t===`link`?`Pairing URL copied`:`Pairing code copied`,description:t===`hosted-link`?`Open it in the browser on the device you want to connect.`:t===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function Xi(e){return Ti(e)?`hosted-link`:`link`}function Zi(e){return!e}function Qi(e){return e.currentTarget.select()}function $i(e){return e.currentTarget.select()}function ea(e){return e!==null}var ta=Ji;export{ta as component};
|
|
2
|
+
//# sourceMappingURL=settings.connections-BKWbsMUk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ho as n,ha as r,jf as i,sr as a,zs as o}from"./utils-BxISc9RR.js";import{U as s}from"./runtime-DkYxB4ri.js";import{B as c,K as l,k as u,q as d}from"./entities-DqhRur25.js";import{Lt as f,Pt as p}from"./runtime-Bsb2I_n2.js";import{t as m}from"./link-Bl21VXlj.js";import{q as h}from"./useSettings-BIggY3j1.js";import{o as g}from"./session-eLrubJEW.js";import{g as _}from"./queries-CEjFwxVW.js";import{r as v}from"./SettingsPanels-DAv_V_mk.js";import{l as y}from"./openFileInPreview-NwK1GJFN.js";import{B as b,a as x,i as S,s as C}from"./settingsLayout-DV36_Jgq.js";import{Mi as w,_i as T,ji as E}from"./main-uLg3xUJM.js";import{t as D}from"./legalLinks-C4VP5hPh.js";var O=e(t(),1),k=e(r(),1);function A(){let{scope:e,search:t,connectedEnvironments:r}=b(),A=u(),j=n((0,O.useMemo)(()=>l({environmentIds:e.environmentIds,shellStateValueAtom:d.stateValueAtom}),[e.environmentIds])),M=E(e.environmentIds),N=g(r,i),{changedSettingLabels:P,restoreDefaults:F}=v(),I=w(c.archive,{reportFailure:!1}),{deleteThread:L}=T(),R=y(_.v2.threadProjection,{reportFailure:!1}),[z,B]=(0,O.useState)(null),V=(0,O.useRef)(!1),[H,U]=(0,O.useState)(null),[W,G]=(0,O.useState)(null),K=e.kind===`project`||e.kind===`checkout`?new Set(e.members.map(e=>`${e.environmentId}:${e.id}`)):null,q=[...new Map([...A,...M.snapshots.flatMap(({environmentId:e,snapshot:t})=>t.threads.map(t=>p(e,t)))].filter(t=>e.environmentIds.includes(t.environmentId)&&(K===null||K.has(`${t.environmentId}:${t.projectId}`))).map(e=>[`${e.environmentId}:${e.id}`,e])).values()],J=q.filter(e=>e.archivedAt===null&&f(e.runtime)),Y=j&&e.environmentIds.length>0&&!M.isLoading&&!M.error&&e.environmentIds.every(e=>r.some(t=>t.environmentId===e)&&M.snapshots.some(t=>t.environmentId===e)),X=Y&&e.environmentIds.every(e=>N.has(e)),Z=async t=>{if(V.current)return;V.current=!0,B(t===`export`?t:`confirm`),U(null),G(null);let n=t===`archive`?J:q,r=0;try{if(t!==`export`&&!await h().dialogs.confirm(t===`delete`?`Permanently delete all ${n.length} chats in ${e.label}, including archived chats? This cannot be undone.`:`Archive ${n.length} inactive chats in ${e.label}? Active chats stay open. You can restore archived chats later.`,{variant:t===`delete`?`destructive`:`default`}))return;B(t);let i=[];for(let e of n){let n=o(e.environmentId,e.id);if(t===`export`){let t=await R({environmentId:e.environmentId,input:{threadId:e.id}});if(t._tag===`Failure`)throw s(t);i.push({environmentId:e.environmentId,thread:t.value.thread,messages:t.value.messages})}else{let r=t===`archive`?await I({environmentId:e.environmentId,input:{threadId:e.id}}):await L(n);if(r._tag===`Failure`)throw s(r)}r++}if(t===`export`){let e=URL.createObjectURL(new Blob([JSON.stringify({version:1,exportedAt:new Date().toISOString(),conversations:i},null,2)],{type:`application/json`})),t=document.createElement(`a`);t.href=e,t.download=`p4-chats-${new Date().toISOString().slice(0,10)}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}U(`${r} chats ${t===`archive`?`archived`:t===`delete`?`deleted`:`exported`}.`)}catch(e){G(`${r} of ${n.length} completed. ${e instanceof Error?e.message:`The action failed. Try again.`}`)}finally{M.refresh(),V.current=!1,B(null)}};return(0,k.jsxs)(S,{width:`wide`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Data controls`}),(0,k.jsxs)(C,{title:`Data controls`,hideTitle:!0,id:`data-controls`,children:[(0,k.jsx)(x,{title:`Connected devices and access`,description:`Manage pairing links, devices, and access to your environments.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/connections`,search:t}),children:`Manage`})}),(0,k.jsx)(x,{title:`Model training`,description:`Your provider account controls how it uses your chats. P4 cannot change that preference for you.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/providers`,search:t}),children:`Providers`})}),(0,k.jsx)(x,{title:`Network access`,description:`Manage how devices connect to your P4 server.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/connections`,search:t}),children:`Manage`})}),(0,k.jsx)(x,{title:`Reset preferences`,description:`Restore default appearance and behavior settings. Your chats and provider credentials are kept.`,control:(0,k.jsx)(a,{variant:`destructive-outline`,size:`sm`,disabled:!!z||!P.length,onClick:()=>void F(),children:`Reset`})}),(0,k.jsx)(x,{title:`MCP access`,description:`Manage the MCP servers available to agents and their sign-ins.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/plugins`,hash:`mcp-servers`,search:t}),children:`Manage`})}),(0,k.jsx)(x,{title:`Archived chats`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(m,{to:`/settings/archived`,search:t}),children:`Manage`})}),(0,k.jsx)(x,{title:`Archive all chats`,description:`Archives inactive chats in the selected scope.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,disabled:!!z||!X||!J.length,onClick:()=>void Z(`archive`),children:z===`archive`?`Archiving…`:`Archive all`})}),(0,k.jsx)(x,{title:`Delete all chats`,description:`Permanently deletes chats in the selected scope, including the archive.`,control:(0,k.jsx)(a,{variant:`destructive-outline`,size:`sm`,disabled:!!z||!X||!q.length,onClick:()=>void Z(`delete`),children:z===`delete`?`Deleting…`:`Delete all`})}),(0,k.jsx)(x,{title:`Export chat data`,description:`Download chat metadata and messages as JSON. Attachment files and tool output are not included.`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,disabled:!!z||!Y||!q.length,onClick:()=>void Z(`export`),children:z===`export`?`Exporting…`:`Export`})}),(0,k.jsx)(x,{title:`Privacy policy`,control:(0,k.jsx)(a,{variant:`soft`,size:`sm`,render:(0,k.jsx)(`a`,{href:D,target:`_blank`,rel:`noreferrer`}),children:`Read`})})]}),W||M.error?(0,k.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:W??M.error}):null,H?(0,k.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:H}):null,Y?null:(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect all environments in this scope and wait for chats to load to use bulk actions.`})]})}var j=A;export{j as component};
|
|
2
|
+
//# sourceMappingURL=settings.data-controls-CBrcsSvm.js.map
|
package/dist/client/assets/{settings.decisions-C5UE4drK.js → settings.decisions-CGz9znLs.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{
|
|
2
|
-
//# sourceMappingURL=settings.decisions-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Eh as n,Tu as r,ha as i,jx as a,sr as o,wu as s}from"./utils-BxISc9RR.js";import{a as c,c as l,o as u,s as d,t as f}from"./select-CjGEfXy_.js";import{t as p}from"./input-DaCwubQj.js";import{I as m,L as h,P as g,a as _,i as v,s as y}from"./settingsLayout-DV36_Jgq.js";import{La as b}from"./main-uLg3xUJM.js";var x=a(),S=e(t(),1),C=e(i(),1);function w(){let e=(0,x.c)(28),t=g(T),n=h(),r=m(),[i,a]=(0,S.useState)(``),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`decisionOpenRouterKey`],e[0]=s):s=e[0];let c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,C.jsxs)(C.Fragment,{children:[`Used by Jev and Luna Decisions.`,` `,(0,C.jsx)(`a`,{href:`https://openrouter.ai/settings/keys`,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:`Get an API key`})]}),e[1]=c):c=e[1];let l=t?`Key saved`:`No key saved`,u;e[2]!==r||e[3]!==i||e[4]!==n?(u=e=>{e.preventDefault(),i.trim()&&r&&(n({decisionOpenRouterKey:i.trim()}),a(``))},e[2]=r,e[3]=i,e[4]=n,e[5]=u):u=e[5];let d=!r,f=t?`Replace saved key`:`API key`,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>a(e.target.value),e[6]=v):v=e[6];let y;e[7]!==i||e[8]!==d||e[9]!==f?(y=(0,C.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,C.jsx)(p,{"aria-label":`OpenRouter API key`,type:`password`,autoComplete:`off`,value:i,disabled:d,placeholder:f,onChange:v})}),e[7]=i,e[8]=d,e[9]=f,e[10]=y):y=e[10];let b;e[11]!==r||e[12]!==i?(b=!r||!i.trim(),e[11]=r,e[12]=i,e[13]=b):b=e[13];let w;e[14]===b?w=e[15]:(w=(0,C.jsx)(o,{type:`submit`,size:`sm`,disabled:b,children:`Save`}),e[14]=b,e[15]=w);let E;e[16]!==r||e[17]!==t||e[18]!==n?(E=t&&(0,C.jsx)(o,{type:`button`,size:`sm`,variant:`outline`,disabled:!r,onClick:()=>n({decisionOpenRouterKey:``}),children:`Remove`}),e[16]=r,e[17]=t,e[18]=n,e[19]=E):E=e[19];let D;e[20]!==E||e[21]!==u||e[22]!==y||e[23]!==w?(D=(0,C.jsxs)(`form`,{className:`flex max-w-lg flex-wrap items-center gap-2`,onSubmit:u,children:[y,w,E]}),e[20]=E,e[21]=u,e[22]=y,e[23]=w,e[24]=D):D=e[24];let O;return e[25]!==D||e[26]!==l?(O=(0,C.jsx)(_,{title:`OpenRouter API key`,serverScoped:!0,settingKeys:s,description:c,status:l,children:D}),e[25]=D,e[26]=l,e[27]=O):O=e[27],O}function T(e){return!!e.decisionOpenRouterKey}function E(){let e=(0,x.c)(23),t=g(),i=h(),a=m(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`decisionModel`],e[0]=o):o=e[0];let c=!a,p;e[1]===i?p=e[2]:(p=e=>{n(r)(e)&&i({decisionModel:e})},e[1]=i,e[2]=p);let S=s[t.decisionModel],T;e[3]===S?T=e[4]:(T=(0,C.jsx)(d,{"aria-label":`Decision model`,children:(0,C.jsx)(l,{children:S})}),e[3]=S,e[4]=T);let E;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,C.jsx)(u,{children:r.literals.map(D)}),e[5]=E):E=e[5];let O;e[6]!==t.decisionModel||e[7]!==c||e[8]!==p||e[9]!==T?(O=(0,C.jsx)(_,{id:`decision-model`,title:`Decision model`,serverScoped:!0,settingKeys:o,description:`Fast, structured answers for agents, fit scores on question options, and Computer Use navigation.`,control:(0,C.jsxs)(f,{value:t.decisionModel,disabled:c,onValueChange:p,children:[T,E]})}),e[6]=t.decisionModel,e[7]=c,e[8]=p,e[9]=T,e[10]=O):O=e[10];let k;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,C.jsx)(w,{}),e[11]=k):k=e[11];let A;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=[`decisionVisionEnabled`],e[12]=A):A=e[12];let j=!a,M;e[13]===i?M=e[14]:(M=e=>i({decisionVisionEnabled:e}),e[13]=i,e[14]=M);let N;e[15]!==t.decisionVisionEnabled||e[16]!==M||e[17]!==j?(N=(0,C.jsx)(_,{title:`Computer Use vision`,serverScoped:!0,settingKeys:A,description:`Use screenshots with Decisions to suggest navigation targets. Jev vision is experimental.`,control:(0,C.jsx)(b,{"aria-label":`Computer Use vision`,checked:t.decisionVisionEnabled,disabled:j,onCheckedChange:M})}),e[15]=t.decisionVisionEnabled,e[16]=M,e[17]=j,e[18]=N):N=e[18];let P;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,C.jsx)(_,{title:`What is shared`,description:`Decision requests send their text and any included images to the selected service. Computer Use vision also sends screenshots. Keys stay in this environment's secret store.`}),e[19]=P):P=e[19];let F;return e[20]!==N||e[21]!==O?(F=(0,C.jsx)(v,{children:(0,C.jsxs)(y,{title:`Decisions`,children:[O,k,N,P]})}),e[20]=N,e[21]=O,e[22]=F):F=e[22],F}function D(e){return(0,C.jsx)(c,{value:e,children:s[e]},e)}var O=E;export{O as component};
|
|
2
|
+
//# sourceMappingURL=settings.decisions-CGz9znLs.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$b as n,Ef as r,Ho as i,Kb as a,Qb as o,ax as s,cr as c,dg as l,fy as u,ha as d,jf as f,jx as p,sr as m,t as h,tx as g,wf as _}from"./utils-BxISc9RR.js";import{t as v}from"./activity-C1Y3O_v1.js";import{t as y}from"./battery-Bjbw2yxu.js";import{t as b}from"./copy-CoM62e83.js";import{t as x}from"./cpu-mffhvvYB.js";import{t as S}from"./database-DipbOz0U.js";import{t as ee}from"./gauge-C_4eEUrj.js";import{t as C}from"./info-BHB-83EA.js";import{t as te}from"./memory-stick-C7kBEkBW.js";import{t as w}from"./triangle-alert-BiHUyRl3.js";import{L as ne,U as re}from"./runtime-DkYxB4ri.js";import{a as T,c as E,n as D,t as O,u as k}from"./tooltip-B0rhqi5b.js";import{i as A,p as j}from"./toast-BX9uiMAh.js";import{D as M,q as ie}from"./useSettings-BIggY3j1.js";import{f as N}from"./server-BYntb2dN.js";import{i as ae,n as oe,t as se}from"./session-eLrubJEW.js";import{n as P}from"./query-D5pQUQvZ.js";import{t as ce}from"./use-atom-command-RgcuqzP9.js";import{a as F,o as le,u as I}from"./timestampFormat-wac2e_Jz.js";import{n as L,t as ue}from"./toggle-group-W0bDGcPB.js";import{t as de}from"./input-DaCwubQj.js";import{t as fe}from"./scroll-area-BYyfw-9F.js";import{B as pe,P as me,i as he,s as R,u as ge}from"./settingsLayout-DV36_Jgq.js";import{t as _e}from"./ConnectionStatusDot-BCSqqCpf.js";import{Io as ve,Ni as z,Wa as ye,Wo as be,qa as xe}from"./main-uLg3xUJM.js";import{t as Se}from"./usageAccess-Mp1Nbm2r.js";import{t as B}from"./ExpandableText-dJhpznMp.js";import{t as V}from"./formatBytes-D8LhsSVR.js";import{t as H}from"./SettingsScopeNotice-CcLrVZWz.js";var U=p(),W=e(d(),1);function G(e){let t=(0,U.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,W.jsx)(T,{render:(0,W.jsx)(c,{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,W.jsx)(D,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,W.jsxs)(O,{children:[a,o]}),t[6]=a,t[7]=s);let l;t[8]===r?l=t[9]:(l=()=>r(`SIGKILL`),t[8]=r,t[9]=l);let u;t[10]!==n||t[11]!==l?(u=(0,W.jsx)(T,{render:(0,W.jsx)(c,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:l,children:`KILL`})}),t[10]=n,t[11]=l,t[12]=u):u=t[12];let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsx)(D,{side:`top`,children:`Send SIGKILL`}),t[13]=d):d=t[13];let f;t[14]===u?f=t[15]:(f=(0,W.jsxs)(O,{children:[u,d]}),t[14]=u,t[15]=f);let p;return t[16]!==s||t[17]!==f?(p=(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,f]}),t[16]=s,t[17]=f,t[18]=p):p=t[18],p}var K=e(t(),1),q=k();function Ce(e){let t=(0,U.c)(10),n=M(),r=e===void 0?n?.environmentId??null:e,i=ae(r,_),a;t[0]!==i||t[1]!==r?(a=r===null||!i?null:N.resourceTelemetry({environmentId:r,input:{}}),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=P(a),s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s={reportFailure:!1},t[3]=s):s=t[3];let c=ce(N.retryResourceTelemetry,s),l;t[4]!==r||t[5]!==c?(l=async()=>{if(r===null)throw Error(`No environment is selected.`);if(!oe(r,`environment:maintain`)||!oe(r,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await c({environmentId:r,input:{}});if(e._tag===`Failure`)throw u(e.cause);return e.value.snapshot},t[4]=r,t[5]=c,t[6]=l):l=t[6];let d=l,f;return t[7]!==o||t[8]!==d?(f={...o,retry:d},t[7]=o,t[8]=d,t[9]=f):f=t[9],f}function we(e,t){let n=(0,U.c)(4),r=M(),i=t===void 0?r?.environmentId??null:t,a=ae(i,_),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:N.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],P(o)}function J(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Te(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=J(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(J(n))&&i(n.identity.pid);return e.filter(e=>!r.has(J(e)))}function Ee(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function Y(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function De(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Oe=[{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 ke(e){return`${V(e)}/s`}function Ae(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 je(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} s`}function Me(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 Ne(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Pe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Fe(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 Ie(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-t3`:return`P4 process`}}function Le(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function Re(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 ze(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function Be(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function Ve(e){let t=(0,U.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??Be(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=h(`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`,g=o===`danger`&&`bg-destructive`,_;t[8]!==g||t[9]!==f||t[10]!==p||t[11]!==m?(_=h(`size-1.5 rounded-full`,f,p,m,g),t[8]=g,t[9]=f,t[10]=p,t[11]=m,t[12]=_):_=t[12];let v;t[13]===_?v=t[14]:(v=(0,W.jsx)(`span`,{className:_}),t[13]=_,t[14]=v);let y=i?.label??r,b;return t[15]!==n||t[16]!==v||t[17]!==y||t[18]!==d?(b=(0,W.jsxs)(`span`,{className:d,children:[v,n,` `,y]}),t[15]=n,t[16]=v,t[17]=y,t[18]=d,t[19]=b):b=t[19],b}function He(e){let t=(0,U.c)(9),{sampledAt:n}=e;if(ge(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.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(l(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,W.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,W.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,W.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 Ue(e){let t=(0,U.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,W.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,W.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,W.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=h(`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,W.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let g;t[13]===a?g=t[14]:(g=a?(0,W.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=g);let _;return t[15]!==u||t[16]!==m||t[17]!==g?(_=(0,W.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,g]}),t[15]=u,t[16]=m,t[17]=g,t[18]=_):_=t[18],_}function We(e){let t=(0,U.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=h(`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,W.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,W.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,W.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,W.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,W.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=V(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let g;t[18]===m?g=t[19]:(g=(0,W.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=g);let _;t[20]===i.ioReadBytesPerSecond?_=t[21]:(_=ke(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=_);let v;t[22]===_?v=t[23]:(v=(0,W.jsx)(Ge,{label:`Read`,value:_}),t[22]=_,t[23]=v);let y;t[24]===i.ioWriteBytesPerSecond?y=t[25]:(y=ke(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=y);let b;t[26]===y?b=t[27]:(b=(0,W.jsx)(Ge,{label:`Write`,value:y}),t[26]=y,t[27]=b);let x;t[28]!==g||t[29]!==v||t[30]!==b||t[31]!==p?(x=(0,W.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,g,v,b]}),t[28]=g,t[29]=v,t[30]=b,t[31]=p,t[32]=x):x=t[32];let S;return t[33]!==x||t[34]!==o||t[35]!==u?(S=(0,W.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,x]}),t[33]=x,t[34]=o,t[35]=u,t[36]=S):S=t[36],S}function Ge(e){let t=(0,U.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,W.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,W.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,W.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ke(e){let t=(0,U.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&a(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let o=i,c;t[3]===n?c=t[4]:(c=(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=c);let l;t[5]!==o||t[6]!==r.lastError?(l=o?`Available when this page runs inside the desktop app.`:s(r.lastError,{onNone:Je,onSome:qe}),t[5]=o,t[6]=r.lastError,t[7]=l):l=t[7];let u;t[8]===l?u=t[9]:(u=(0,W.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:l}),t[8]=l,t[9]=u);let d;t[10]!==c||t[11]!==u?(d=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[c,u]}),t[10]=c,t[11]=u,t[12]=d):d=t[12];let f;t[13]===o?f=t[14]:(f=o?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=o,t[14]=f);let p;t[15]!==r.status||t[16]!==f?(p=(0,W.jsx)(Ve,{label:``,status:r.status,presentation:f}),t[15]=r.status,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==d||t[19]!==p?(m=(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[d,p]}),t[18]=d,t[19]=p,t[20]=m):m=t[20],m}function qe(e){return e}function Je(){return`No reported errors`}function Ye(e){return e.includes(`'web' mode`)}function Xe(e){let t=(0,U.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.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=h(`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,W.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,W.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 Ze(e){let t=(0,U.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=Oe.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=Oe.map(Qe),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,W.jsx)(L,{"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 Qe(e){return(0,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function $e(e){let t=(0,U.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=De(n),s=Math.max(1,...n.map(et));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,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=u):u=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,u,(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.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=Y({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=Y({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=Y({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,W.jsx)(D,{side:`top`,className:`text-left`,children:(0,W.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,W.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`Read `,V(t.ioReadBytes)]}),(0,W.jsxs)(`div`,{children:[`Write `,V(t.ioWriteBytes)]})]})})]},l(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,W.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,W.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function et(e){return e.ioReadBytes+e.ioWriteBytes}function tt(e){let t=(0,U.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Fe(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,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronRight:q.ChevronDown})}):(0,W.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=h(`size-1.5 rounded-full`,Le(n.category)),t[10]=n.category,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,W.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=p);let g=n.command||n.name,_;t[16]===g?_=t[17]:(_=(0,W.jsx)(D,{side:`top`,variant:`code`,children:g}),t[16]=g,t[17]=_);let v;t[18]!==p||t[19]!==_?(v=(0,W.jsxs)(O,{children:[p,_]}),t[18]=p,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==l||t[23]!==u||t[24]!==f?(y=(0,W.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,v]}),t[21]=v,t[22]=l,t[23]=u,t[24]=f,t[25]=y):y=t[25],y}function nt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function rt(e){let t=(0,U.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!nt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.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(Ne(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,W.jsx)(G,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function it(e){let t=(0,U.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,K.useState)(at),c;t[0]!==o||t[1]!==n?(c=Te(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=Ne(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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[20%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`}),(0,W.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsx)(tt,{process:e,collapsed:o.has(Ne(e)),onToggle:d})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.residentBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:ke(e.ioReadBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:ke(e.ioWriteBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:V(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{children:V(e.ioWriteBytes)})}),(0,W.jsx)(D,{side:`top`,children:Re(e.ioSemantics)})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,W.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,W.jsx)(rt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Ne(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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(fe,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,W.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 at(){return new Set}function ot(e){let t=(0,U.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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(st),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(fe,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,W.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 st(e){return(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Ie(e.category)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:Ae(e.cpuTimeMs)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:V(e.peakRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.ioWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Pe(e))}function ct(e){let t=(0,U.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[22%]`}),(0,W.jsx)(`col`,{className:`w-[28%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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(lt),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,W.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,W.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 lt(e){return(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:V(e.logicalReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:V(e.logicalWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,W.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 ut(e){let t=(0,U.c)(207),{environmentId:i}=e,[a,c]=(0,K.useState)(9e5),l;t[0]===a?l=t[1]:(l=Oe.find(e=>e.windowMs===a)??Oe[1],t[0]=a,t[1]=l);let u=l,d=ae(i,r),f=Ce(i),p=f.retry,h;t[2]!==u.bucketMs||t[3]!==u.windowMs?(h={windowMs:u.windowMs,bucketMs:u.bucketMs},t[2]=u.bucketMs,t[3]=u.windowMs,t[4]=h):h=t[4];let g=we(h,i),_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_={reportFailure:!1},t[5]=_):_=t[5];let b=ce(N.signalProcess,_),[C,E]=(0,K.useState)(ht),k;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=new Set,t[6]=k):k=t[6];let j=(0,K.useRef)(k),M=(0,K.useRef)(i),se,P;t[7]===i?(se=t[8],P=t[9]):(se=()=>(M.current=i,()=>{M.current=null}),P=[i],t[7]=i,t[8]=se,t[9]=P),(0,K.useEffect)(se,P);let[F,le]=(0,K.useState)(!1),I=f.data,L=I?.groups.allT3,ue;t[10]===b?ue=t[11]:(ue=async(e,t)=>{let n=M.current;if(n===null||!oe(n,`environment:maintain`))return;let r=Ne(e);if(j.current.has(r))return;let i=new Set(j.current).add(r);j.current=i,E(i);let a=()=>{let e=new Set(j.current);e.delete(r),j.current=e,E(e)};if(t===`SIGKILL`){let n;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){let n=e;a(),A.add({type:`error`,title:`Could not confirm signal`,description:n instanceof Error?n.message:`Failed to send ${t}.`});return}if(!n){a();return}}if(M.current!==n||!oe(n,`environment:maintain`)){a();return}b({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ne(n))return;throw re(n)}n.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:o(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},t[10]=b,t[11]=ue);let de=ue,fe;t[12]===p?fe=t[13]:(fe=()=>{let e=M.current;e!==null&&oe(e,`environment:maintain`)&&(le(!0),p().catch(mt).finally(()=>{le(!1)}))},t[12]=p,t[13]=fe);let pe=fe,me,he,ge,_e,z,ye,be,Se,B,H,G,q,J,Te,Y,De,Pe,Fe,Ie;if(t[14]!==L||t[15]!==I||t[16]!==f.error||t[17]!==f.isPending||t[18]!==f.refresh){z=I?n(I.speedLimitPercent):null;let e=I?.health.native.status??null,r;t[38]!==e||t[39]!==f.error?(r=Ee({nativeStatus:e,error:f.error}),t[38]=e,t[39]=f.error,t[40]=r):r=t[40],ge=r,_e=I!==null&&(I.power.onBattery!==`unknown`||I.power.lowPowerMode!==`unknown`||I.power.idle!==`unknown`||I.power.locked!==`unknown`||I.power.thermalState!==`unknown`),he=R,De=`Resource monitor`,t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,W.jsx)(v,{className:`size-4 text-muted-foreground`}),t[41]=Pe):Pe=t[41];let i;t[42]===I?i=t[43]:(i=I?(0,W.jsx)(Ve,{label:`Native`,status:I.health.native.status}):null,t[42]=I,t[43]=i);let a=I?.readAt??null,o;t[44]===a?o=t[45]:(o=(0,W.jsx)(He,{sampledAt:a}),t[44]=a,t[45]=o);let s;t[46]===f.isPending?s=t[47]:(s=(0,W.jsx)(xe,{size:`xs`,refreshing:f.isPending}),t[46]=f.isPending,t[47]=s);let c;t[48]!==s||t[49]!==f.isPending||t[50]!==f.refresh?(c=(0,W.jsx)(T,{render:(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:f.isPending,onClick:f.refresh,"aria-label":`Refresh resource telemetry`,children:s})}),t[48]=s,t[49]=f.isPending,t[50]=f.refresh,t[51]=c):c=t[51];let l;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(D,{side:`top`,children:`Refresh telemetry snapshot`}),t[52]=l):l=t[52];let u;t[53]===c?u=t[54]:(u=(0,W.jsxs)(O,{children:[c,l]}),t[53]=c,t[54]=u),t[55]!==i||t[56]!==o||t[57]!==u?(Fe=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,o,u]}),t[55]=i,t[56]=o,t[57]=u,t[58]=Fe):Fe=t[58],Te=`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`;let d;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,W.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]=d):d=t[59];let p;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),t[60]=p):p=t[60];let h;t[61]===I?h=t[62]:(h=I?Me(I.sampleIntervalMs):`...`,t[61]=I,t[62]=h),t[63]===h?Y=t[64]:(Y=(0,W.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:[d,(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[p,`Sampling every `,h]})]}),t[63]=h,t[64]=Y),Se=`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`;let g;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(x,{className:`size-3.5`}),t[65]=g):g=t[65];let _;t[66]===L?_=t[67]:(_=L?`${L.currentCpuPercent.toFixed(1)}%`:`...`,t[66]=L,t[67]=_);let y;t[68]===L?y=t[69]:(y=L?`${Ae(L.cpuTimeMs)} observed CPU time`:void 0,t[68]=L,t[69]=y),t[70]!==_||t[71]!==y?(B=(0,W.jsx)(Ue,{icon:g,label:`Current CPU`,value:_,detail:y}),t[70]=_,t[71]=y,t[72]=B):B=t[72];let b;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,W.jsx)(te,{className:`size-3.5`}),t[73]=b):b=t[73];let C;t[74]===L?C=t[75]:(C=L?V(L.currentRssBytes):`...`,t[74]=L,t[75]=C);let w;t[76]===L?w=t[77]:(w=L?`${V(L.peakRssBytes)} combined process peaks`:void 0,t[76]=L,t[77]=w),t[78]!==C||t[79]!==w?(H=(0,W.jsx)(Ue,{icon:b,label:`Resident memory`,value:C,detail:w}),t[78]=C,t[79]=w,t[80]=H):H=t[80];let ne;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,W.jsx)(v,{className:`size-3.5`}),t[81]=ne):ne=t[81];let re=L?String(L.processCount):`...`,E=L?`${L.processStarts} starts · ${L.processExits} exits`:void 0;t[82]!==re||t[83]!==E?(G=(0,W.jsx)(Ue,{icon:ne,label:`Process count`,value:re,detail:E}),t[82]=re,t[83]=E,t[84]=G):G=t[84];let k;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,W.jsx)(ve,{className:`size-3.5`}),t[85]=k):k=t[85];let A;t[86]===L?A=t[87]:(A=L?ke(L.ioReadBytesPerSecond):`...`,t[86]=L,t[87]=A);let j;t[88]===L?j=t[89]:(j=L?`${V(L.ioReadBytes)} observed`:void 0,t[88]=L,t[89]=j),t[90]!==A||t[91]!==j?(q=(0,W.jsx)(Ue,{icon:k,label:`Read throughput`,value:A,detail:j}),t[90]=A,t[91]=j,t[92]=q):q=t[92];let M;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,W.jsx)(S,{className:`size-3.5`}),t[93]=M):M=t[93];let ie;t[94]===L?ie=t[95]:(ie=L?ke(L.ioWriteBytesPerSecond):`...`,t[94]=L,t[95]=ie);let N;t[96]===L?N=t[97]:(N=L?`${V(L.ioWriteBytes)} observed`:void 0,t[96]=L,t[97]=N);let ae=L&&L.ioWriteBytesPerSecond>=10485760?`danger`:L&&L.ioWriteBytesPerSecond>=1048576?`warning`:`default`;t[98]!==ie||t[99]!==N||t[100]!==ae?(J=(0,W.jsx)(Ue,{icon:M,label:`Write throughput`,value:ie,detail:N,tone:ae}),t[98]=ie,t[99]=N,t[100]=ae,t[101]=J):J=t[101],me=Ue,t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,W.jsx)(ee,{className:`size-3.5`}),t[102]=Ie):Ie=t[102],ye=`CPU speed limit`,be=I?z===null?`Unknown`:`${z.toFixed(0)}%`:`...`,t[14]=L,t[15]=I,t[16]=f.error,t[17]=f.isPending,t[18]=f.refresh,t[19]=me,t[20]=he,t[21]=ge,t[22]=_e,t[23]=z,t[24]=ye,t[25]=be,t[26]=Se,t[27]=B,t[28]=H,t[29]=G,t[30]=q,t[31]=J,t[32]=Te,t[33]=Y,t[34]=De,t[35]=Pe,t[36]=Fe,t[37]=Ie}else me=t[19],he=t[20],ge=t[21],_e=t[22],z=t[23],ye=t[24],be=t[25],Se=t[26],B=t[27],H=t[28],G=t[29],q=t[30],J=t[31],Te=t[32],Y=t[33],De=t[34],Pe=t[35],Fe=t[36],Ie=t[37];let Le=I?`${I.power.thermalState} thermal state`:void 0,Re=z!==null&&z<80?`warning`:`default`,Be;t[103]!==me||t[104]!==ye||t[105]!==be||t[106]!==Le||t[107]!==Re||t[108]!==Ie?(Be=(0,W.jsx)(me,{icon:Ie,label:ye,value:be,detail:Le,tone:Re}),t[103]=me,t[104]=ye,t[105]=be,t[106]=Le,t[107]=Re,t[108]=Ie,t[109]=Be):Be=t[109];let Ge;t[110]!==Se||t[111]!==B||t[112]!==H||t[113]!==G||t[114]!==q||t[115]!==J||t[116]!==Be?(Ge=(0,W.jsxs)(`div`,{className:Se,children:[B,H,G,q,J,Be]}),t[110]=Se,t[111]=B,t[112]=H,t[113]=G,t[114]=q,t[115]=J,t[116]=Be,t[117]=Ge):Ge=t[117];let qe;t[118]===f.error?qe=t[119]:(qe=f.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:f.error})]}):null,t[118]=f.error,t[119]=qe);let Je;t[120]===I?Je=t[121]:(Je=I?(0,W.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,W.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:I.groups.backend}),(0,W.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:I.groups.electron}),(0,W.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:I.groups.monitor})]}):null,t[120]=I,t[121]=Je);let Ye;t[122]!==Te||t[123]!==Y||t[124]!==Ge||t[125]!==qe||t[126]!==Je?(Ye=(0,W.jsxs)(`div`,{className:Te,children:[Y,Ge,qe,Je]}),t[122]=Te,t[123]=Y,t[124]=Ge,t[125]=qe,t[126]=Je,t[127]=Ye):Ye=t[127];let Qe;t[128]!==he||t[129]!==De||t[130]!==Pe||t[131]!==Fe||t[132]!==Ye?(Qe=(0,W.jsx)(he,{title:De,icon:Pe,headerAction:Fe,children:Ye}),t[128]=he,t[129]=De,t[130]=Pe,t[131]=Fe,t[132]=Ye,t[133]=Qe):Qe=t[133];let et;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,W.jsx)(ee,{className:`size-4 text-muted-foreground`}),t[134]=et):et=t[134];let tt;t[135]!==ge||t[136]!==F||t[137]!==pe?(tt=ge?(0,W.jsxs)(m,{size:`xs`,variant:`outline`,disabled:F,onClick:pe,children:[(0,W.jsx)(xe,{size:`xs`,refreshing:F}),`Retry monitor`]}):null,t[135]=ge,t[136]=F,t[137]=pe,t[138]=tt):tt=t[138];let nt;t[139]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(y,{className:`size-3.5`})}),`Host state`]}),t[139]=nt):nt=t[139];let rt;t[140]!==_e||t[141]!==I?(rt=(0,W.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[nt,_e&&I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xe,{label:`Power source`,value:ze(I.power.onBattery,{true:`Battery`,false:`External power`})}),(0,W.jsx)(Xe,{label:`Low power mode`,value:ze(I.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,W.jsx)(Xe,{label:`Idle`,value:`${ze(I.power.idle,{true:`Idle`,false:`Active`})}${I.power.idleSeconds===null?``:` · ${Math.round(I.power.idleSeconds)}s`}`}),(0,W.jsx)(Xe,{label:`Session`,value:I.power.suspended?`Suspended`:ze(I.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,W.jsx)(Xe,{label:`Thermal`,value:I.power.thermalState,valueClassName:I.power.thermalState===`serious`||I.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,W.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,W.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]=_e,t[141]=I,t[142]=rt):rt=t[142];let at;t[143]===Symbol.for(`react.memo_cache_sentinel`)?(at=(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(ee,{className:`size-3.5`})}),`Collection health`]}),t[143]=at):at=t[143];let st;t[144]===I?st=t[145]:(st=(0,W.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[at,I?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ke,{label:`Native process monitor`,health:I.health.native}),(0,W.jsx)(Ke,{label:`Electron main process`,health:I.health.desktop}),(0,W.jsx)(Xe,{label:`Collection time`,value:je(I.health.collectionDurationMicros)}),(0,W.jsx)(Xe,{label:`Process scan`,value:`${I.health.retainedProcessCount}/${I.health.scannedProcessCount} retained`}),(0,W.jsx)(Xe,{label:`Inaccessible`,value:String(I.health.inaccessibleProcessCount),valueClassName:I.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,W.jsx)(Xe,{label:`Sidecar`,value:s(I.health.sidecarVersion,{onNone:pt,onSome:e=>`${e}${s(I.health.sidecarPid,{onNone:ft,onSome:dt})}`})}),(0,W.jsx)(Xe,{label:`Restarts`,value:String(I.health.restartCount)})]}):(0,W.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]}),t[144]=I,t[145]=st);let lt;t[146]!==rt||t[147]!==st?(lt=(0,W.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:[rt,st]}),t[146]=rt,t[147]=st,t[148]=lt):lt=t[148];let ut;t[149]!==tt||t[150]!==lt?(ut=(0,W.jsx)(R,{title:`Host & collection`,icon:et,headerAction:tt,children:lt}),t[149]=tt,t[150]=lt,t[151]=ut):ut=t[151];let gt;t[152]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,W.jsx)(ve,{className:`size-4 text-muted-foreground`}),t[152]=gt):gt=t[152];let _t;t[153]===a?_t=t[154]:(_t=(0,W.jsx)(Ze,{selectedWindowMs:a,onSelect:c}),t[153]=a,t[154]=_t);let vt;t[155]===g.isPending?vt=t[156]:(vt=(0,W.jsx)(xe,{size:`xs`,refreshing:g.isPending}),t[155]=g.isPending,t[156]=vt);let yt;t[157]!==g.isPending||t[158]!==g.refresh||t[159]!==vt?(yt=(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:g.isPending,onClick:g.refresh,"aria-label":`Refresh resource history`,children:vt}),t[157]=g.isPending,t[158]=g.refresh,t[159]=vt,t[160]=yt):yt=t[160];let bt;t[161]!==_t||t[162]!==yt?(bt=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_t,yt]}),t[161]=_t,t[162]=yt,t[163]=bt):bt=t[163];let xt;t[164]===g.error?xt=t[165]:(xt=g.error?(0,W.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,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:g.error})]}):null,t[164]=g.error,t[165]=xt);let X;t[166]===g.data?.buckets?X=t[167]:(X=g.data?.buckets??[],t[166]=g.data?.buckets,t[167]=X);let Z;t[168]===X?Z=t[169]:(Z=(0,W.jsx)($e,{buckets:X}),t[168]=X,t[169]=Z);let St;t[170]===g.data?.topProcesses?St=t[171]:(St=g.data?.topProcesses??[],t[170]=g.data?.topProcesses,t[171]=St);let Ct;t[172]===St?Ct=t[173]:(Ct=(0,W.jsx)(ot,{processes:St}),t[172]=St,t[173]=Ct);let wt;t[174]!==xt||t[175]!==Z||t[176]!==Ct?(wt=(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[xt,Z,Ct]}),t[174]=xt,t[175]=Z,t[176]=Ct,t[177]=wt):wt=t[177];let Tt;t[178]!==bt||t[179]!==wt?(Tt=(0,W.jsx)(R,{title:`Resource timeline`,icon:gt,headerAction:bt,children:wt}),t[178]=bt,t[179]=wt,t[180]=Tt):Tt=t[180];let Et;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Et=(0,W.jsx)(x,{className:`size-4 text-muted-foreground`}),t[181]=Et):Et=t[181];let Q;t[182]===I?Q=t[183]:(Q=I?(0,W.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,W.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,t[182]=I,t[183]=Q);let Dt;t[184]===I?.processes?Dt=t[185]:(Dt=I?.processes??[],t[184]=I?.processes,t[185]=Dt);let $;t[186]!==d||t[187]!==de||t[188]!==C||t[189]!==Dt?($=(0,W.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,W.jsx)(it,{processes:Dt,canMaintainEnvironment:d,signalingKeys:C,onSignal:de})}),t[186]=d,t[187]=de,t[188]=C,t[189]=Dt,t[190]=$):$=t[190];let Ot;t[191]!==Q||t[192]!==$?(Ot=(0,W.jsx)(R,{title:`Live process tree`,icon:Et,headerAction:Q,children:$}),t[191]=Q,t[192]=$,t[193]=Ot):Ot=t[193];let kt,At;t[194]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,W.jsx)(S,{className:`size-4 text-muted-foreground`}),At=(0,W.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,W.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]===I?.attribution.entries?Mt=t[198]:(Mt=I?.attribution.entries??[],t[197]=I?.attribution.entries,t[198]=Mt);let Nt;t[199]===Mt?Nt=t[200]:(Nt=(0,W.jsx)(R,{title:`Instrumented application I/O`,icon:kt,headerAction:At,children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[jt,(0,W.jsx)(ct,{entries:Mt})]})}),t[199]=Mt,t[200]=Nt);let Pt;return t[201]!==Qe||t[202]!==ut||t[203]!==Tt||t[204]!==Ot||t[205]!==Nt?(Pt=(0,W.jsxs)(W.Fragment,{children:[Qe,ut,Tt,Ot,Nt]}),t[201]=Qe,t[202]=ut,t[203]=Tt,t[204]=Ot,t[205]=Nt,t[206]=Pt):Pt=t[206],Pt}function dt(e){return` · PID ${e}`}function ft(){return``}function pt(){return`Unavailable`}function mt(e){A.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}function ht(){return new Set}var gt=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],_t=e=>/^https?:\/\/./i.test(e);function vt(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 yt(){let e=(0,U.c)(3),{environment:t,scope:n}=pe();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,W.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsx)(H,{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,W.jsx)(bt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function bt(){let{environment:e}=pe(),t=me(e=>e.observability),[n,r]=(0,K.useState)({}),[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=e?.environmentId,u=i(N.checkOtlpEndpoint.permissionAtom(l??null)),d=u&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[f,p]=(0,K.useState)(()=>Object.fromEntries(gt.filter(({key:e})=>_t(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),h=ce(N.updateSettings,{reportFailure:!0}),g=ce(N.checkOtlpEndpoint),_={...t,...n},v=gt.filter(({key:e})=>_[e].trim()!==t[e]),y=v.length>0,b=e?.serverConfig?.observability,x=async(e,t,n)=>{if(!l)return;let r=await g({environmentId:l,input:{signal:t,url:n}});p(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})},S=(e,t,n)=>{_t(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),x(e,t,n))},ee=(0,K.useEffectEvent)(()=>{for(let{key:e,signal:t}of gt){let n=f[e];n?.result===null&&x(e,t,n.url)}});return(0,K.useEffect)(()=>{d&&ee()},[d]),(0,W.jsx)(R,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!a){o(!0),c(null);try{(await h({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(v.map(({key:e})=>[e,_[e]]))}}}))._tag===`Success`&&(r({}),c(`Saved. Restart the server to apply.`))}finally{o(!1)}}},children:[(0,W.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.`}),!u&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),gt.map(({key:e,label:n,signal:i})=>{let o=_[e].trim(),s=d?vt(o,f[e]):null;return(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s&&(0,W.jsx)(_e,{dotClassName:s.dot}),(0,W.jsxs)(z,{htmlFor:e,children:[n,` endpoint`]})]}),s&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.label})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(de,{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/${i}`,value:_[e],disabled:a||!u,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),c(null)}}),d&&(0,W.jsx)(m,{type:`button`,size:`sm`,variant:`outline`,disabled:!_t(o)||f[e]?.result===null,onClick:()=>void S(e,i,o),children:`Test`})]}),t[e]!==(b?.[e]??``)&&(0,W.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,b?.[e]||`Disabled`]})]},e)}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:s}),(0,W.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,W.jsx)(m,{type:`button`,size:`xs`,variant:`outline`,disabled:!y||a||!u,onClick:()=>{if(r({}),c(null),d)for(let{key:e,signal:n}of gt)f[e]?.url!==t[e]&&S(e,n,t[e])},children:`Discard`}),(0,W.jsx)(m,{type:`submit`,size:`xs`,disabled:!y||a||!u,children:a?`Saving…`:`Save`})]})]})]})})}var xt=new Intl.NumberFormat;function X(e){return xt.format(e)}function Z(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2)} s`}function St(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 Ct(e){return e?le(l(e)):`No trace records`}function wt(e){return Ct(e).replaceAll(` `,`\xA0`)}function Tt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function Et(e){return e?.includes(`not a live descendant`)??!1}function Q(e){let t=(0,U.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,W.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.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,W.jsx)(C,{className:`size-3`})})}),(0,W.jsx)(D,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==s||t[6]!==c?(l=(0,W.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]=l):l=t[7];let u=o===`warning`&&`text-warning-foreground`,d=o===`danger`&&`text-destructive`,f;t[8]!==u||t[9]!==d?(f=h(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,u,d),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==f||t[12]!==r?(p=(0,W.jsx)(`div`,{className:f,children:r}),t[11]=f,t[12]=r,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==p?(m=(0,W.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[l,p]}),t[14]=l,t[15]=p,t[16]=m):m=t[16],m}function Dt(e){let t=(0,U.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,W.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,W.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,W.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,W.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 $(e){let t=(0,U.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,W.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,U.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=h(`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,W.jsx)(`colgroup`,{children:n.map((e,t)=>(0,W.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,W.jsx)(`th`,{className:h(`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,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,W.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,W.jsx)(fe,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.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,U.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}=j(r),o;t[1]===n?o=t[2]:(o=Tt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,W.jsx)(T,{render:(0,W.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,W.jsx)(D,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,W.jsxs)(O,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,d;t[10]!==i||t[11]!==n?(d=()=>i(n),t[10]=i,t[11]=n,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,W.jsx)(b,{className:`size-3`}),t[13]=f):f=t[13];let p;t[14]!==u||t[15]!==d?(p=(0,W.jsx)(T,{render:(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:d,children:f})}),t[14]=u,t[15]=d,t[16]=p):p=t[16];let h=a?`Copied`:`Copy full trace ID`,g;t[17]===h?g=t[18]:(g=(0,W.jsx)(D,{side:`top`,children:h}),t[17]=h,t[18]=g);let _;t[19]!==g||t[20]!==p?(_=(0,W.jsxs)(O,{children:[p,g]}),t[19]=g,t[20]=p,t[21]=_):_=t[21];let v;return t[22]!==_||t[23]!==l?(v=(0,W.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,_]}),t[22]=_,t[23]=l,t[24]=v):v=t[24],v}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,U.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,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,W.jsx)(E,{className:`size-3.5`,icon:r?q.ChevronDown:q.ChevronRight})}):(0,W.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,W.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,W.jsx)(T,{render:(0,W.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,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let h;t[15]!==f||t[16]!==p?(h=(0,W.jsxs)(O,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=h):h=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==h?(g=(0,W.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,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Nt(e){let t=(0,U.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,K.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,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[33%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Mt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.rssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:jt(e)}),(0,W.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,W.jsx)(G,{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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(fe,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,W.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,U.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,W.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=h(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,W.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,W.jsx)(T,{render:(0,W.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,W.jsx)(D,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let g;t[13]!==m||t[14]!==p?(g=(0,W.jsxs)(O,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=g):g=t[15];let _;return t[16]!==g||t[17]!==s||t[18]!==c||t[19]!==f?(_=(0,W.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,g]}),t[16]=g,t[17]=s,t[18]=c,t[19]=f,t[20]=_):_=t[20],_}function zt(e){let t=(0,U.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,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,W.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,W.jsxs)(D,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},l(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,W.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,W.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,U.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,W.jsx)(L,{"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,W.jsx)(ue,{value:String(e.windowMs),children:e.label},e.windowMs)}function Ut(e){let t=(0,U.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Wt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[16%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.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,W.jsx)(`tr`,{children:(0,W.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,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Rt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:It(e.cpuSecondsApprox)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:St(e.maxRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(D,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.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,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(fe,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,W.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,U.c)(7),{checkedAt:n}=e;ge();let r;t[0]===n?r=t[1]:(r=I(n?l(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,W.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,W.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,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,W.jsxs)(W.Fragment,{children:[`Checked `,(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,W.jsxs)(W.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,U.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.jsx)(xe,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,W.jsx)(T,{render:(0,W.jsx)(m,{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,W.jsx)(D,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,W.jsxs)(O,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function qt(){let{environment:e}=pe(),t=e?.environmentId??null,i=ae(t,r),a=e?.serverConfig?.observability,s=e?.serverConfig?.availableEditors,c=ae(t,f),u=P(t===null?null:se.sessionStateAtom(t)),d=Se({connectionPhase:e?.connection.phase??`available`,session:u.data,hasSessionError:u.error!==null}),p=d.canReadDiagnostics,_=ce(N.signalProcess,{reportFailure:!1}),v=ye(t,s??[]),[y,b]=(0,K.useState)(9e5),x=Ft.find(e=>e.windowMs===y)??Ft[1],{data:S,error:ee,isPending:C,refresh:te}=P(t===null||!p?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:k,isPending:j,refresh:M}=P(t===null||!p?null:N.processDiagnostics({environmentId:t,input:{}})),{data:F,error:le,isPending:I,refresh:L}=P(t===null||!p?null:N.processResourceHistory({environmentId:t,input:{windowMs:x.windowMs,bucketMs:x.bucketMs}})),[ue,de]=(0,K.useState)(!1),[me,ge]=(0,K.useState)(null),[_e,ve]=(0,K.useState)(null),z=(0,K.useRef)(null),xe=(0,K.useRef)(t),V=(0,K.useRef)(E);(0,K.useEffect)(()=>{V.current=E},[E]),(0,K.useEffect)(()=>(xe.current=t,()=>{xe.current=null}),[t]);let H=(0,K.useCallback)(()=>{let e=a?.logsDirectoryPath??null;e&&t!==null&&oe(t,`orchestration:operate`)&&(de(!0),ge(null),(async()=>{let t=await v(e);if(de(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);ge(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,a?.logsDirectoryPath,v]),U=C&&S===null,G=j&&E===null,q=I&&F===null,[Ce,we]=(0,K.useState)(null);Ce!==t&&p&&!U&&!G&&!q&&we(t);let J=(0,K.useCallback)(async(e,t)=>{let n=xe.current,r=V.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!oe(n,`environment:maintain`)||z.current!==null)return;z.current=e,ve(e);let i=()=>{z.current=null,ve(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),A.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=xe.current;if(a===null||a!==n||!oe(a,`environment:maintain`)){i();return}if(V.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs){i();return}try{let i=await _({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ne(i)){let e=re(i);A.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=g(i.value.message);if(M(),Et(e)){A.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}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}M()}finally{i()}},[M,_]),Te=E?n(E.error):null,Ee=F?n(F.error):null,Y=S?n(S.error):null,De=S?o(S.partialFailure,()=>!1):!1;return p?(0,W.jsxs)(he,{width:`expanded`,className:`gap-10`,children:[(0,W.jsx)(ut,{environmentId:t}),(0,W.jsxs)(R,{title:`Live Processes`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:E?.readAt??null}),(0,W.jsx)(Kt,{isPending:j,label:`Refresh process diagnostics`,onClick:M})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Child Processes`,value:E?X(E.processCount):`...`}),(0,W.jsx)(Q,{label:`CPU`,value:E?`${E.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,W.jsx)(Q,{label:`Memory`,value:E?St(E.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,W.jsx)(Q,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),Te||k?(0,W.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,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Te.message})]}):null,k?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:k})]}):null]}):null,(0,W.jsx)(Nt,{processes:E?.processes??[],canMaintainEnvironment:i,signalingPid:_e,onSignal:J,emptyLabel:G?`Loading live processes...`:`No live descendant processes found.`})]}),(0,W.jsxs)(R,{title:`Resource History`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Vt,{selectedWindowMs:y,onSelect:b}),(0,W.jsx)(Gt,{checkedAt:F?.readAt??null}),(0,W.jsx)(Kt,{isPending:I,label:`Refresh resource history`,onClick:L})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`CPU Time`,value:F?It(F.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,W.jsx)(Q,{label:`Samples`,value:F?X(F.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,W.jsx)(Q,{label:`Interval`,value:F?F.sampleIntervalMs===0?`On demand`:Z(F.sampleIntervalMs):`...`}),(0,W.jsx)(Q,{label:`Processes`,value:F?X(F.topProcesses.length):`...`})]}),Ee||le?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Ee?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:Ee.message})]}):null,le?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:le})]}):null]}):null,(0,W.jsx)(zt,{buckets:F?.buckets??[]}),(0,W.jsx)(Ut,{processes:F?.topProcesses??[],emptyLabel:q?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,W.jsxs)(R,{title:`Trace Diagnostics`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Gt,{checkedAt:S?.readAt??null}),(0,W.jsxs)(O,{children:[(0,W.jsx)(T,{render:(0,W.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,disabled:!c||!a?.logsDirectoryPath||ue,onClick:H,"aria-label":`Open logs folder`,children:(0,W.jsx)(be,{})})}),(0,W.jsx)(D,{side:`top`,children:`Open logs folder`})]}),(0,W.jsx)(Kt,{isPending:C,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,W.jsxs)(Dt,{children:[(0,W.jsx)(Q,{label:`Spans`,value:S?X(S.recordCount):`...`}),(0,W.jsx)(Q,{label:`Failures`,value:S?X(S.failureCount):`...`,tone:S&&S.failureCount>0?`danger`:`default`}),(0,W.jsx)(Q,{label:`Slow Spans`,value:S?X(S.slowSpanCount):`...`,tooltip:S?`Spans with a duration of ${Z(S.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:S&&S.slowSpanCount>0?`warning`:`default`}),(0,W.jsx)(Q,{label:`Parse Errors`,value:S?X(S.parseErrorCount):`...`,tone:S&&S.parseErrorCount>0?`warning`:`default`})]}),me||Y||ee?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[me?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:me})]}):null,Y?(0,W.jsxs)(`div`,{className:h(`flex items-start gap-2`,De?`text-warning-foreground`:`text-destructive`),children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:De?`Some trace files could not be read, so diagnostics may be incomplete. ${Y.message}`:Y.message})]}):null,ee?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:ee})]}):null]}):null]}),(0,W.jsx)(R,{title:`Latest Failures`,children:S&&S.latestFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:S.latestFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(B,{text:e.cause})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:wt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)($,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,W.jsx)(R,{title:`Most Common Failures`,children:S&&S.commonFailures.length>0?(0,W.jsx)(Ot,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:S.commonFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(B,{text:e.cause})}),(0,W.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:wt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,W.jsx)($,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,W.jsx)(R,{title:`Slowest Spans`,children:S&&S.slowestSpans.length>0?(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.durationMs)}),(0,W.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:wt(e.endedAt)}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)($,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,W.jsx)(R,{title:`Span Logs`,children:S&&S.latestWarningAndErrorLogs.length>0?(0,W.jsx)(fe,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[26%]`}),(0,W.jsx)(`col`,{className:`w-[30%]`})]}),(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:S.latestWarningAndErrorLogs.map(e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:wt(e.seenAt)}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.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,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(B,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,W.jsx)(kt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${l(e.seenAt)}:${e.message}`))})]})}):(0,W.jsx)($,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,W.jsx)(R,{title:`Top Span Names`,children:S&&S.topSpansByCount.length>0?(0,W.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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.count)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:X(e.failureCount)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.averageDurationMs)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Z(e.maxDurationMs)})]},e.name))}):(0,W.jsx)($,{label:U?`Loading span names...`:`No spans found.`})}),Ce===t&&(0,W.jsx)(yt,{})]}):(0,W.jsx)(he,{children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:d.isPending?`Checking diagnostics access…`:d.error})})}var Jt=qt;export{Jt as component};
|
|
2
|
+
//# sourceMappingURL=settings.diagnostics-DKkOOzoq.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{ha as t,jx as n}from"./utils-BxISc9RR.js";import{n as r}from"./SettingsPanels-DAv_V_mk.js";var i=n(),a=e(t());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
|
|
2
|
+
//# sourceMappingURL=settings.general-CoPWyKC4.js.map
|