@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
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ax as n,Cl as r,Ho as i,Nf as a,_m as o,bh as s,ha as c,l,nx as u,sr as d,vm as f,xl as p}from"./utils-DmfMX1v5.js";import{t as m}from"./check-Cmy7pM2Y.js";import{t as h}from"./chevron-right-NbahR9_s.js";import{t as g}from"./external-link-NWS0I_zo.js";import{L as _,U as v}from"./runtime-BQJQC-Ny.js";import{C as y,O as b,S as x,f as ee,q as te}from"./useSettings-CLtJrOYI.js";import{f as S}from"./server-BD_Y5Gsn.js";import{i as C,n as ne}from"./session-DsbInyNV.js";import{n as w}from"./query-DpwJQzeq.js";import{t as T}from"./use-atom-command-CQHjSXPR.js";import{n as E,t as D}from"./radio-group-fljQQ7Xp.js";import{t as re}from"./input-Cd_0h7h_.js";import{a as ie,c as ae,i as oe,r as se,s as ce,t as le}from"./dialog-Bn1u_Xoc.js";import{x as O}from"./Icons-DA4msgfR.js";import{t as k}from"./preview-CjgXQQdj.js";import{S as A,t as ue}from"./ChatGptUsageButton-D93cMeTp.js";import{a as de}from"./settingsLayout-jP1a50ek.js";import{Aa as j,Ki as fe,Ma as pe,fr as M,ja as me,ka as N,qi as he}from"./main-BB3F4O6Y.js";var P=e(t(),1),F=n(),I=e(c(),1);function L(e){let t=(0,F.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,I.jsx)(O,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,I.jsxs)(d,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function R(e){let t=(0,F.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(B),[s,c]=(0,P.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsxs)(ie,{children:[(0,I.jsx)(ae,{children:`Reconnect ChatGPT`}),(0,I.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(z),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:`chatgpt-change-account`}),(0,I.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,I.jsx)(`div`,{className:`px-6 pb-6`,children:(0,I.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,I.jsx)(oe,{children:(0,I.jsx)(L,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,I.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,I.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function z(e){return(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:e.id}),(0,I.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function B(e){return e.id.startsWith(`chatgpt-profile:`)}function V(e){let t=(0,F.c)(36),{environmentId:n,onClose:r,renderSetup:s,onAccountCreated:c}=e,u=C(n,a),p=ee(n),m;t[0]===n?m=t[1]:(m=S.providersValueAtom(n),t[0]=n,t[1]=m);let h=i(m),g=T(S.updateSettings,`Add ChatGPT account`),[_,v]=(0,P.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,P.useState)(null),[w,E]=(0,P.useState)(!1),D=h?.find(e=>e.instanceId===x),ie=A(D),ae=(0,P.useEffectEvent)(r);(0,P.useEffect)(()=>{ie&&ae()},[ie]);let oe;t[4]!==b||t[5]!==n||t[6]!==_||t[7]!==c||t[8]!==r||t[9]!==w||t[10]!==p||t[11]!==g?(oe=async()=>{if(w||!_.trim()||!ne(n,`providers:manage`))return;E(!0);let e=f.make(`codex_${l()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...p.providerInstances,[e]:{driver:o.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(c?(c(e,b),r()):te(e)),E(!1)},t[4]=b,t[5]=n,t[6]=_,t[7]=c,t[8]=r,t[9]=w,t[10]=p,t[11]=g,t[12]=oe):oe=t[12];let se=oe,ce=le,O=!ie,k;t[13]===r?k=t[14]:(k=e=>{e||r()},t[13]=r,t[14]=k);let ue=pe,fe=x?b:`Add ChatGPT account`,M;t[15]===fe?M=t[16]:(M=(0,I.jsx)(j,{title:fe,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=fe,t[16]=M);let he=me,L=x?D?.setup?s(x,D):(0,I.jsx)(de,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,I.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),se()},children:(0,I.jsx)(de,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,I.jsx)(re,{"aria-label":`Account name`,value:_,disabled:w,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),R;t[17]!==he||t[18]!==L?(R=(0,I.jsx)(he,{children:L}),t[17]=he,t[18]=L,t[19]=R):R=t[19];let z;t[20]!==u||t[21]!==x||t[22]!==_||t[23]!==r||t[24]!==w?(z=(0,I.jsx)(N,{children:x?(0,I.jsx)(d,{variant:`outline`,onClick:r,children:`Finish later`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d,{variant:`outline`,disabled:w,onClick:r,children:`Cancel`}),(0,I.jsx)(d,{type:`submit`,form:`add-codex-account`,disabled:w||!_.trim()||!u,children:w?`Adding account…`:`Continue`})]})}),t[20]=u,t[21]=x,t[22]=_,t[23]=r,t[24]=w,t[25]=z):z=t[25];let B;t[26]!==ue||t[27]!==R||t[28]!==z||t[29]!==M?(B=(0,I.jsxs)(ue,{size:`wide`,children:[M,R,z]}),t[26]=ue,t[27]=R,t[28]=z,t[29]=M,t[30]=B):B=t[30];let V;return t[31]!==ce||t[32]!==B||t[33]!==O||t[34]!==k?(V=(0,I.jsx)(ce,{open:O,onOpenChange:k,children:B}),t[31]=ce,t[32]=B,t[33]=O,t[34]=k,t[35]=V):V=t[35],V}var ge=s(p),_e=s(r),ve=/^[A-Za-z0-9_./:\\-]+$/;function ye(e,t,n){return ve.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function be(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function xe(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[be(n)]>H[be(e)])&&t.set(n.driver,n)}return t}var Se={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Ce(e,t){let n=Se[e];return t===`windows`?n.windows:n.posix}function we(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ge(r?.config??{});return`${ye(u(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=_e(r?.config??{});return`${ye(u(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var Te={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function U(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Ee(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var De={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Oe(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Ee(n)??t.recommendedRange;return{title:De[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Ee(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var ke=()=>void 0;function Ae(e){let t=(0,F.c)(11),[n,r]=(0,P.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=be(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,l;t[2]===e.provider?l=t[3]:(l=U(e.provider),t[2]=e.provider,t[3]=l);let u=l,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==u||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?u.headline:`Code with your ChatGPT subscription.`,control:o?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):c?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u.headline}):(0,I.jsx)(L,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,I.jsx)(Ne,{}),control:(0,I.jsx)(d,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,I.jsx)(de,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,I.jsx)(Me,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=u,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function je(e){let t=(0,F.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,o=C(n,a),s;t[0]!==o||t[1]!==n||t[2]!==r?(s=(e,t)=>(0,I.jsx)(Me,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!o,autoStart:!0,onAutoStartConsumed:ke,onModeChange:ke,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=o,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==s?(c=(0,I.jsx)(V,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:s}),t[4]=n,t[5]=i,t[6]=r,t[7]=s,t[8]=c):c=t[8],c}function Me({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:a,autoStart:o,onAutoStartConsumed:s,allowExistingCli:c=!0,presentation:l,displayName:u,onSignInCancelled:f}){let p={environmentId:e,input:{instanceId:t}},h=w(S.providerAuthState(p)),ee=w(S.providerInstallState(p)),[C,ne]=(0,P.useState)(null),E=w(C?S.chatGptHandoffState(C):null),D=E.data?.phase===`auth`?E.data.state:h.data,[ie,ae]=(0,P.useState)(!1),[oe,se]=(0,P.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,O=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,j=ee.data,pe=y(e),me=pe!==null&&k(new URL(pe).hostname),N={reportFailure:!1,reportDefect:!1},F=T(S.startProviderAuth,N),z=T(S.refreshProviders,N),B=T(S.completeProviderAuth,N),V=T(S.cancelProviderAuth,N),ge=T(S.logoutProviderAuth,N),_e=T(S.startProviderInstall,N),ve=T(S.cancelProviderInstall,N),ye=T(S.chatGptReconnectProfile,N),be=T(S.chatGptImportProfile,N),H=!C&&(!me||window.desktopBridge?.receiveProviderAuthCallback!==void 0),xe=H&&!window.desktopBridge?.receiveProviderAuthCallback,Se=b(),Ce=x(Se),we=y(Se),Te=!me&&Se&&Ce?.connection.phase===`connected`&&we&&k(new URL(we).hostname)&&(window.desktopBridge!==void 0||k(window.location.hostname))?Se:null,U=new URL(window.location.href);U.pathname===`/welcome`&&(U.hash=`agents:${e}`),U.pathname===`/settings/providers`&&U.searchParams.set(`instanceId`,t);let Ee=xe,De=(0,P.useId)(),[Oe,ke]=(0,P.useState)(!1),[Ae,je]=(0,P.useState)({flowId:``,value:``}),Me=Ae.flowId===D?.flowId?Ae.value:``,[W,Fe]=(0,P.useState)(!1),[Ie,Le]=(0,P.useState)(null),Re=(0,P.useRef)(!1),[ze,Be]=(0,P.useState)(null),G=(0,P.useRef)(null),Ve=(0,P.useRef)(!1),He=(0,P.useRef)(null),[Ue,We]=(0,P.useState)(!1),K=j?.installedVersion!=null,q=n?.auth.status===`authenticated`,Ge=K&&j?.source!==`local`&&j?.version!=null&&j.version!==j.installedVersion,Ke=Ie!==null&&!q&&(D?.phase===`succeeded`||Ie===`handoff`);(0,P.useEffect)(()=>{(q||D?.phase===`failed`||D?.phase===`cancelled`)&&Le(null)},[q,D?.phase]),(0,P.useEffect)(()=>{Ie&&D?.phase===`succeeded`&&z({environmentId:e,input:{instanceId:t}})},[Ie,D?.phase,z,e,t]);let qe=o&&!Ue,Je=Ie===`sign-in`&&!q&&(D===null||D.phase===`idle`),Ye=Ke||Je||C!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,J=j?.phase===`downloading`||j?.phase===`extracting`||j?.phase===`verifying`,Y=qe||Ye||W&&!J,X=i||!r||W||h.error!==null||ee.error!==null,Z=W||Ye||J,Q=(0,P.useCallback)(async(e,t)=>{if(Re.current)return!1;Re.current=!0,Fe(!0),Be(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!_(r)){let e=v(r);Be(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Be(`Codex setup failed. Try again.`)}return Re.current=!1,Fe(!1),n},[]),Xe=(0,P.useId)(),Ze=(0,P.useRef)(0),Qe=(0,P.useRef)(null),[$e,et]=(0,P.useState)(!1),tt=(0,P.useCallback)(async n=>{let r=await Q(()=>be({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Le(`handoff`),ne(null)),et(!r)},[Q,be,e,t]);(0,P.useEffect)(()=>{if(!C||E.data?.phase!==`finished`)return;let e=C.input.attemptId;Qe.current!==e&&(Qe.current=e,tt(E.data.profile))},[C,E.data,tt]),(0,P.useEffect)(()=>{C&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Be(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[C,E.data,E.error]);let nt=(0,P.useCallback)(()=>(Le(null),C?(ne(null),Promise.resolve()):Q(()=>V({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[C,Q,V,e,t,D]),rt=(0,P.useCallback)(async(n=`chatgpt`)=>{if(Re.current)return;Ve.current=!0,et(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),Te){let i=`${Xe}:${++Ze.current}`;await Q(()=>ye({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:Te,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ve.current=!1);return}await Q(()=>F({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>Le(`sign-in`))||(Ve.current=!1)},[e,t,Q,F,H,Te,ye,Xe]),$=(0,P.useCallback)(async(n=`chatgpt`)=>{X||Z||(K&&!Ge?await rt(n):(G.current=n,await Q(()=>_e({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[X,Z,K,Ge,rt,Q,_e,e,t]);(0,P.useEffect)(()=>{!o||Ue||X||Z||j===null||!n?.setup?.canInstall||(We(!0),s(),$())},[o,Ue,X,Z,j,n?.setup?.canInstall,s,$]),(0,P.useEffect)(()=>{if(!(!G.current||W||J)){if(j?.phase===`failed`||j?.phase===`cancelled`)G.current=null;else if(K){let e=G.current;G.current=null,rt(e)}}},[W,J,j?.phase,K,rt]);let it=(0,P.useRef)(null),at=D?.flowId,ot=(0,P.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&at){if(it.current===n){await te().shell.openExternal(n);return}it.current=n;let i=await r(n);if(it.current!==n)return;it.current=null,await Q(()=>B({environmentId:e,input:{instanceId:t,flowId:at,callbackUrl:i}}))}else await te().shell.openExternal(n)}catch{Be(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,at,Q,B,e,t]);(0,P.useEffect)(()=>{if(H&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{it.current===A&&(it.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[H,A]),(0,P.useEffect)(()=>{Ve.current&&D?.phase===`waiting`&&D.flowId&&A&&He.current!==D.flowId&&(He.current=D.flowId,Ve.current=!1,xe||ot(A))},[D?.phase,D?.flowId,A,ot,xe]);let st=j?.phase===`downloading`?`Downloading ${(j.downloadedBytes/1e6).toFixed(1)}${j.totalBytes===null?``:` of ${(j.totalBytes/1e6).toFixed(1)}`} MB.`:j?.phase===`extracting`?`Installing Codex.`:j?.phase===`verifying`?`Checking Codex.`:K?`${j?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${j?.installedVersion?` · v${j.installedVersion}`:``}.`:j?.message??`P4 Code downloads and manages Codex for you.`,ct=Ke?`Finishing sign-in...`:J?st:Y||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,lt=Ee&&A&&D?.flowId&&he(U.toString())?fe({authorizationUrl:A,returnUrl:U.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,ut=(0,I.jsx)(d,{size:`sm`,variant:xe?`default`:`outline`,className:l===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!$e:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?tt(E.data.profile):A&&ot(A)},children:Ke?`Finishing sign-in...`:E.data?.phase===`finished`?$e?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?xe?`Open ChatGPT sign-in`:`Open sign-in page`:l===`onboarding`?`Open sign-in page`:`Signing in...`}),dt=!C&&D?.phase===`waiting`&&A?(0,I.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,I.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Me.trim())return;let r=Me.trim(),i=D.flowId;Q(()=>B({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&je({flowId:i,value:``})})},children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(re,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Me,maxLength:16384,disabled:W||i,onChange:e=>je({flowId:D.flowId??``,value:e.target.value})})}),(0,I.jsx)(d,{variant:`outline`,type:`submit`,disabled:W||i||!Me.trim(),children:`Connect`})]}),xe?null:(0,I.jsx)(`div`,{children:(0,I.jsxs)(d,{size:`xs`,variant:`ghost-muted`,onClick:()=>void te().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,I.jsx)(g,{className:`size-3.5`})]})}),lt?(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,I.jsx)(d,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,I.jsx)(`a`,{href:lt}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ft=dt&&Oe?(0,I.jsx)(`div`,{id:De,className:`w-full border-t border-border/50 pt-3`,children:dt}):null,pt=Ee?dt:dt?(0,I.jsxs)(`div`,{className:`space-y-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(Ne,{label:`Having trouble signing in?`,expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}),ft]}):null,mt=(0,I.jsx)(R,{open:ie,methods:D?.methods??[],onClose:()=>ae(!1),onSelect:e=>{ae(!1),$(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),ht=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(l===`onboarding`){let r=ht??ze??(h.error||ee.error?`Could not read setup status. Reconnect and try again.`:j?.phase===`failed`?j.message:null);return(0,I.jsxs)(I.Fragment,{children:[mt,(0,I.jsxs)(Pe,{title:u||n?.displayName||`Codex`,description:J?st:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(M,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:dt&&!Ee?(0,I.jsx)(Ne,{expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}):qe||Je||D?.phase===`starting`||D?.phase===`waiting`||W&&!J?(0,I.jsx)(Ne,{}):Y||D?.phase===`failed`||D?.phase===`cancelled`?ct:`Code with your ChatGPT subscription.`,control:q&&!Z?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):Y?ut:(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:J||W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:Y&&!Ke||J?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:W||i,onClick:()=>{Ve.current=!1,G.current=null,C||Y&&D?.flowId?nt():j?.operationId&&Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}}))},children:`Cancel`}):!Y&&!q&&O?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):!Y&&!q&&c?(0,I.jsx)(d,{size:`sm`,variant:`ghost-muted`,disabled:i||Z,onClick:()=>a(`existing`),children:`Use existing CLI`}):null,children:[Ee?pt:ft,r?(0,I.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,I.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[mt,(0,I.jsx)(de,{title:`ChatGPT account`,description:ct,control:(0,I.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:Y?(0,I.jsxs)(I.Fragment,{children:[ut,!Ke&&(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{(C||D?.flowId)&&(Ve.current=!1,nt(),f?.())},children:`Cancel`})]}):J?(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{j?.operationId&&(G.current=null,Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}})))},children:`Cancel`}):q?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d,{size:`sm`,variant:`outline`,disabled:X||Z,onClick:()=>ae(!0),children:`Change account`}),(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void Q(()=>ge(p)),children:`Disconnect`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),O?(0,I.jsx)(d,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),q?(0,I.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,I.jsx)(ue,{})}):null,ht?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:ht}):null,pt?(0,I.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:pt}):null,ze||h.error||ee.error||j?.phase===`failed`?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:ze??(j?.phase===`failed`?j.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,F.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=S.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=w(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,I.jsx)(de,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,I.jsx)(de,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,I.jsx)(de,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,I.jsxs)(I.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ne(e){let t=(0,F.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,I.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,I.jsx)(h,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Pe(e){let t=(0,F.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=P.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(O,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,I.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,I.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,I.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Fe(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{Te as a,Ee as c,we as d,xe as f,Ae as i,be as l,je as n,U as o,L as p,W as r,Oe as s,Fe as t,Ce as u};
|
|
2
|
-
//# sourceMappingURL=CodexSetupSection.logic-DJw6xB7P.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,A as r,Ax as i,D as a,Gn as o,Hm as s,Ho as c,I as l,Ip as u,Jo as d,Ko as f,Qn as p,Uo as m,Vd as h,Wg as g,Wo as _,Yg as v,Zn as ee,ar as y,ha as te,ir as b,kc as x,or as ne,ov as S,ps as re,rr as C,sr as w,t as T,ug as ie,ys as ae}from"./utils-DmfMX1v5.js";import{t as oe}from"./check-Cmy7pM2Y.js";import{t as E}from"./chevron-down-DHV04o66.js";import{t as se}from"./columns-2-D1kdFD9w.js";import{t as ce}from"./folder-tree-CIpeR87A.js";import{t as le}from"./info-BHB-83EA.js";import{t as ue}from"./pilcrow-DMiXqMTk.js";import{t as D}from"./rows-3-Bhc8vjss.js";import{t as de}from"./text-wrap-C8SwAUbc.js";import{A as O,L as k,M as A,O as j,U as M,X as N,gt as fe,j as P}from"./runtime-BQJQC-Ny.js";import{s as F}from"./vcsRefInvalidation-nP-qgsHs.js";import{E as pe,O as I,S as L}from"./entities-82m-Smm-.js";import{t as R}from"./runtime-C6FwphD-.js";import{a as z,c as me,n as B,t as V,u as he}from"./tooltip-taOyJZax.js";import{t as ge}from"./useParams-BTKEXLBT.js";import{l as _e,p as ve}from"./toast-CjelgyqV.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./DiffFileTree-BhqF8nD5.js";import{K as we,s as Te,v as Ee}from"./useSettings-CLtJrOYI.js";import{f as De}from"./server-BD_Y5Gsn.js";import{n as Oe}from"./query-DpwJQzeq.js";import{t as ke}from"./use-atom-command-CQHjSXPR.js";import{n as Ae,r as je}from"./fileContextMenu-Dcs50sFI.js";import{t as Me,u as Ne}from"./queries-Cq5C9N-K.js";import{a as Pe,c as Fe,l as Ie,n as Le,o as Re,r as ze,s as Be,u as H}from"./diffRendering-C26rfQBu.js";import{F as Ve,I as He,L as Ue,M as We,P as Ge}from"./PanelLayoutControls-BfRIRM0o.js";import{t as Ke}from"./DiffCommentAnnotation-vAZP7JBy.js";import{c as qe}from"./timestampFormat-wac2e_Jz.js";import{n as Je}from"./fileCommentAnnotations-BgdL_7u9.js";import{n as Ye,t as Xe}from"./toggle-group-DCQTLIPb.js";import{i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt}from"./combobox-C81z_216.js";import{La as it,Ra as at,Wa as ot,gs as st,io as ct,qa as lt}from"./main-BB3F4O6Y.js";import{A as ut,D as U,E as dt,O as ft,T as pt,j as mt,k as ht,w as gt}from"./_chat-BKcYL38S.js";var W=e(t(),1),_t=he(),G=i();function vt(e,t){let n=(0,G.c)(4),r=Me(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var K=e(te(),1);function yt(e){let t=(0,G.c)(17),{filePath:n}=e,r=(0,W.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={onCopy:()=>U(r),onError:e=>dt(r,e),timeout:pt},t[0]=i):i=t[0];let{copyToClipboard:a,isCopied:o}=ve(i),s;t[1]!==a||t[2]!==n?(s=(0,K.jsx)(w,{ref:r,size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Copy file path`,onClick:()=>a(n,void 0)}),t[1]=a,t[2]=n,t[3]=s):s=t[3];let c=o&&`text-success`,l;t[4]===c?l=t[5]:(l=T(`size-3`,c),t[4]=c,t[5]=l);let u=o?_t.Check:_t.Copy,d;t[6]!==l||t[7]!==u?(d=(0,K.jsx)(me,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]!==s||t[10]!==d?(f=(0,K.jsx)(z,{render:s,children:d}),t[9]=s,t[10]=d,t[11]=f):f=t[11];let p=o?`Copied`:`Copy path`,m;t[12]===p?m=t[13]:(m=(0,K.jsx)(B,{children:(0,K.jsx)(`p`,{children:p})}),t[12]=p,t[13]=m);let h;return t[14]!==f||t[15]!==m?(h=(0,K.jsxs)(V,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var q=[];function J(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function bt(e,t,n){let r=J(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function xt(e){let t=(0,G.c)(66),{codeViewKey:n,files:i,sectionId:o,sectionTitle:s,composerDraftTarget:c,options:u,viewerRef:d,className:f,renderCodeViewFooter:p,unsafeCSSExtra:m,renderHeaderMetadata:h,renderHeaderFilenameSuffix:g,renderHeaderPrefix:_,onRevealSearchMatch:v}=e,ee=a(Et),y=a(Tt),te;t[0]===c?te=t[1]:(te=e=>e.getComposerDraft(c)?.reviewComments??q,t[0]=c,t[1]=te);let b=a(te),[x,ne]=(0,W.useState)(null),[S,re]=(0,W.useState)(null),[C,w]=(0,W.useState)(``),T;t[2]===i?T=t[3]:(T=new Map(i.map(wt)),t[2]=i,t[3]=T);let ie=T,ae;if(t[4]!==S||t[5]!==i||t[6]!==b||t[7]!==o){let e;t[9]!==S||t[10]!==b||t[11]!==o?(e=e=>{let{fileDiff:t,filePath:n,fileKey:r,fileVersion:i,collapsed:a}=e,s=b.filter(e=>e.sectionId===o&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=l(t,n);return r?bt(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),c=S?.fileKey===r?[...s,S.annotation]:s;return{id:r,type:`diff`,fileDiff:t,annotations:c,collapsed:a,version:Pe(`${i}:${a?`1`:`0`}:${c.flatMap(Ct).join(`:`)}`)}},t[9]=S,t[10]=b,t[11]=o,t[12]=e):e=t[12],ae=i.map(e),t[4]=S,t[5]=i,t[6]=b,t[7]=o,t[8]=ae}else ae=t[8];let oe=ae,E;t[13]!==c||t[14]!==S?.annotation||t[15]!==y?(E=e=>{ne(null),S?.annotation.metadata.entries.some(t=>t.id===e)?(re(null),w(``)):y(c,e)},t[13]=c,t[14]=S?.annotation,t[15]=y,t[16]=E):E=t[16];let se=E,ce;t[17]!==ee||t[18]!==c||t[19]!==S||t[20]!==ie||t[21]!==o||t[22]!==s?(ce=(e,t)=>{let n=S?.annotation.metadata.entries.find(t=>t.id===e),i=S?ie.get(S.fileKey):void 0;if(!n||!i)return;let a=r({id:n.id,sectionId:o,sectionTitle:s,filePath:i.filePath,fileDiff:i.fileDiff,range:n.range,text:t});a&&ee(c,a),ne(null),re(null),w(``)},t[17]=ee,t[18]=c,t[19]=S,t[20]=ie,t[21]=o,t[22]=s,t[23]=ce):ce=t[23];let le=ce,ue;t[24]!==o||t[25]!==s?(ue=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let i=Je(),a=r({id:i,sectionId:o,sectionTitle:s,filePath:H(n.fileDiff),fileDiff:n.fileDiff,range:e,text:``});a&&(w(``),re({fileKey:n.id,annotation:{side:J(e),lineNumber:e.end,metadata:{entries:[{id:i,kind:`draft`,range:e,rangeLabel:a.rangeLabel,text:``}]}}}))},t[24]=o,t[25]=s,t[26]=ue):ue=t[26];let D=ue,de=S!==null,O;t[27]===d?O=t[28]:(O=d?{viewerRef:d}:{},t[27]=d,t[28]=O);let k;t[29]===f?k=t[30]:(k=f?{className:f}:{},t[29]=f,t[30]=k);let A;t[31]===m?A=t[32]:(A=m?{unsafeCSSExtra:m}:{},t[31]=m,t[32]=A);let j;t[33]===h?j=t[34]:(j=h?{renderHeaderMetadata:e=>e.type===`diff`?h(e.fileDiff):null}:{},t[33]=h,t[34]=j);let M;t[35]===p?M=t[36]:(M=p?{renderCodeViewFooter:p}:{},t[35]=p,t[36]=M);let N;t[37]===v?N=t[38]:(N=e=>v(e.id),t[37]=v,t[38]=N);let fe=!de,P=!de,F;t[39]!==D||t[40]!==u||t[41]!==fe||t[42]!==P?(F={...u,enableGutterUtility:fe,enableLineSelection:P,onGutterUtilityClick:D},t[39]=D,t[40]=u,t[41]=fe,t[42]=P,t[43]=F):F=t[43];let pe;t[44]===g?pe=t[45]:(pe=e=>e.type===`diff`?g(e.fileDiff):null,t[44]=g,t[45]=pe);let I;t[46]===_?I=t[47]:(I=e=>e.type===`diff`?_(e.fileDiff,e.id,e.collapsed===!0):null,t[46]=_,t[47]=I);let L;t[48]!==C||t[49]!==se||t[50]!==le?(L=e=>{let t=e.metadata.entries.some(St);return(0,K.jsx)(`div`,{className:t?`py-1`:`divide-y divide-border/30 border-y border-border/30`,children:e.metadata.entries.map(e=>(0,K.jsx)(Ke,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.kind===`draft`?C:e.text,onTextChange:w,onCancel:()=>se(e.id),onComment:t=>le(e.id,t),onDelete:()=>se(e.id)},e.id))})},t[48]=C,t[49]=se,t[50]=le,t[51]=L):L=t[51];let R;return t[52]!==n||t[53]!==oe||t[54]!==x||t[55]!==j||t[56]!==M||t[57]!==N||t[58]!==F||t[59]!==pe||t[60]!==I||t[61]!==L||t[62]!==O||t[63]!==k||t[64]!==A?(R=(0,K.jsx)(Ge,{...O,...k,...A,...j,...M,items:oe,selectedLines:x,onSelectedLinesChange:ne,onRevealSearchMatch:N,options:F,renderHeaderFilenameSuffix:pe,renderHeaderPrefix:I,renderAnnotation:L},n),t[52]=n,t[53]=oe,t[54]=x,t[55]=j,t[56]=M,t[57]=N,t[58]=F,t[59]=pe,t[60]=I,t[61]=L,t[62]=O,t[63]=k,t[64]=A,t[65]=R):R=t[65],R}function St(e){return e.kind===`draft`}function Ct(e){return e.metadata.entries.map(Y)}function Y(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function wt(e){return[e.fileKey,e]}function Tt(e){return e.removeReviewComment}function Et(e){return e.addReviewComment}function Dt(e){let t=u(4),n=j();return{diffPreview:A(e,{label:`environment-data:review:diff-preview`,tag:x.reviewGetDiffPreview,staleTimeMs:5e3}),diffFilePatch:O(e,{label:`environment-data:review:diff-file-patch`,staleTimeMs:3e5,execute:e=>N(x.reviewGetDiffPreview,e.request).pipe(t.withPermit,v(t=>{let n=t.sources.find(t=>t.kind===e.request.file.sourceKind);return n?S(n):g(new h({operation:`review.diffFilePatch`,kind:`git`,detail:`Diff no longer available. Refresh the comparison.`}))}))}),diffFileContents:P(e,{label:`environment-data:review:diff-file-contents`,tag:x.reviewGetDiffFileContents,scheduler:n,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd,t.sourceKind,t.baseRef,t.headRef,t.oldPath,t.newPath,t.changeType])}})}}var Ot=Dt(R);function X(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function kt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&X(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function At(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var jt=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Mt(e){let t=(0,G.c)(86),{environmentId:n,cwd:r,source:i,baseRef:a,ignoreWhitespace:o,theme:s,revision:l,preview:u}=e,p=(0,W.useContext)(m),h;t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==o||t[4]!==i?.diffHash||t[5]!==i?.kind?(h=JSON.stringify([n,r,i?.kind,i?.diffHash,a,o]),t[0]=a,t[1]=r,t[2]=n,t[3]=o,t[4]=i?.diffHash,t[5]=i?.kind,t[6]=h):h=t[6];let g=h,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=[0,1,2,3],t[7]=v):v=t[7];let ee;t[8]===g?ee=t[9]:(ee={scope:g,indices:v},t[8]=g,t[9]=ee);let[y,te]=(0,W.useState)(ee),b;t[10]!==y.indices||t[11]!==y.scope||t[12]!==g?(b=y.scope===g?y.indices:[0,1,2,3],t[10]=y.indices,t[11]=y.scope,t[12]=g,t[13]=b):b=t[13];let x=b,ne;t[14]===i?.files?ne=t[15]:(ne=()=>i?.files?.toSorted(Z)??[],t[14]=i?.files,t[15]=ne),i?.files;let S;t[16]===ne?S=t[17]:(S=ne(),t[16]=ne,t[17]=S);let C=S,w;t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==C||t[22]!==o||t[23]!==x||t[24]!==g||t[25]!==i?(w=!n||!r||!i?[]:x.filter(e=>e<C.length).map(e=>{let t=C[e];return{index:e,query:Ot.diffFilePatch({environmentId:n,input:{cacheKey:g,request:{cwd:r,...a?{baseRef:a}:{},ignoreWhitespace:o,file:{path:t.path,previousPath:t.previousPath,sourceKind:i.kind}}}})}}),t[18]=a,t[19]=r,t[20]=n,t[21]=C,t[22]=o,t[23]=x,t[24]=g,t[25]=i,t[26]=w):w=t[26];let T=w,ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[],t[27]=ie):ie=t[27];let ae;t[28]!==l||t[29]!==g?(ae={scope:g,revision:l,queries:ie},t[28]=l,t[29]=g,t[30]=ae):ae=t[30];let oe=(0,W.useRef)(ae),E,se;t[31]!==T||t[32]!==p||t[33]!==l||t[34]!==g?(E=()=>{let e=oe.current;oe.current={scope:g,revision:l,queries:T};for(let{query:t}of T){let n=e.scope===g&&e.revision!==l,r=!e.queries.some(e=>e.query===t)&&p.get(t)._tag!==`Initial`&&!p.get(t).waiting;(n||r)&&p.refresh(t)}},se=[g,l,T,p],t[31]=T,t[32]=p,t[33]=l,t[34]=g,t[35]=E,t[36]=se):(E=t[35],se=t[36]),(0,W.useEffect)(E,se);let ce;t[37]===s?ce=t[38]:(ce=_(e=>d(e,e=>re(e,e=>{let t=Fe(e.diff,`diff-panel:${s}`,{compactPartialHunkOffsets:!0});if(t?.kind===`files`&&t.files.length===1&&e.files?.length===1){let n=e.files[0],r={...t.files[0],name:n.path};n.previousPath===null?delete r.prevName:r.prevName=n.previousPath,t={...t,files:[r]}}return{source:e,patch:t}}))),t[37]=s,t[38]=ce);let le=ce,ue;t[39]!==le||t[40]!==T?(ue=f(e=>new Map(T.map(t=>{let{index:n,query:r}=t;return[n,e(le(r))]}))),t[39]=le,t[40]=T,t[41]=ue):ue=t[41];let D=c(ue),de;t[42]===D?de=t[43]:(de=(e,t)=>{let n=D.get(t);return!n||n._tag===`Initial`},t[42]=D,t[43]=de);let O=C.findIndex(de),k=i?O<0?C.length:O:u?.kind===`files`?u.files.length:0,A;t[44]===g?A=t[45]:(A=e=>te(t=>{let n=t.scope===g?t.indices:[0,1,2,3],r=e.filter(e=>!n.includes(e));return r.length===0?t:{scope:g,indices:[...n,...r]}}),t[44]=g,t[45]=A);let j=A,M;t[46]!==j||t[47]!==k?(M=()=>j(Array.from({length:4},(e,t)=>k+t)),t[46]=j,t[47]=k,t[48]=M):M=t[48];let N=M,fe;t[49]===j?fe=t[50]:(fe=e=>j([e]),t[49]=j,t[50]=fe);let P=fe,F;t[51]!==C||t[52]!==T?(F={queries:T,files:C},t[51]=C,t[52]=T,t[53]=F):F=t[53];let pe=(0,W.useRef)(F),I,L;t[54]!==C||t[55]!==T?(I=()=>{pe.current={queries:T,files:C}},L=[T,C],t[54]=C,t[55]=T,t[56]=I,t[57]=L):(I=t[56],L=t[57]),(0,W.useLayoutEffect)(I,L);let R;t[58]===p?R=t[59]:(R=e=>{let{queries:t,files:n}=pe.current,r=t.find(t=>{let{index:r}=t;return n[r]?.path===e})?.query;r&&p.refresh(r)},t[58]=p,t[59]=R);let z=R,me;t[60]!==C||t[61]!==D||t[62]!==u||t[63]!==g||t[64]!==i?(me=i?C.map((e,t)=>{let n=D.get(t);if(n?._tag===`Success`&&n.value.patch?.kind===`files`){let t=n.value.patch.files.find(t=>H(t)===e.path);if(t)return t}return{name:e.path,...e.previousPath?{prevName:e.previousPath}:{},type:e.previousPath?`rename-changed`:`change`,hunks:[],additionLines:[],deletionLines:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,cacheKey:`${g}:${e.path}:pending`}}):(u?.kind===`files`?u.files:[]).toSorted(Ft),t[60]=C,t[61]=D,t[62]=u,t[63]=g,t[64]=i,t[65]=me):me=t[65];let B=me,V;if(t[66]!==C||t[67]!==D){let e;t[69]===D?e=t[70]:(e=(e,t)=>{let n=D.get(t);return[e.path,{error:n?._tag===`Failure`||n?._tag===`Success`&&(n.value.patch?.kind!==`files`||!n.value.patch.files.some(t=>H(t)===e.path)),truncated:n?._tag===`Success`&&n.value.source.truncated}]},t[69]=D,t[70]=e),V=new Map(C.map(e)),t[66]=C,t[67]=D,t[68]=V}else V=t[68];let he=V,ge;if(t[71]!==C||t[72]!==D){let e;t[74]===D?e=t[75]:(e=(e,t)=>{let n=D.get(t);return n&&n._tag!==`Initial`},t[74]=D,t[75]=e),ge=new Set(C.filter(e).map(Pt)),t[71]=C,t[72]=D,t[73]=ge}else ge=t[73];let _e=ge,ve=[...D.values()].some(Nt),ye;return t[76]!==he||t[77]!==N||t[78]!==_e||t[79]!==B||t[80]!==P||t[81]!==z||t[82]!==g||t[83]!==k||t[84]!==ve?(ye={scope:g,fileStates:he,isPending:ve,retry:z,requestFile:P,readyFilePaths:_e,renderableFiles:B,settledFileCount:k,loadNextFiles:N},t[76]=he,t[77]=N,t[78]=_e,t[79]=B,t[80]=P,t[81]=z,t[82]=g,t[83]=k,t[84]=ve,t[85]=ye):ye=t[85],ye}function Nt(e){return e._tag===`Initial`||e.waiting}function Pt(e){return e.path}function Ft(e,t){return jt.compare(H(e),H(t))}function Z(e,t){return jt.compare(e.path,t.path)}function It(e){let t=(0,G.c)(5),{load:n,count:r}=e,i=(0,W.useRef)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{if(!i.current)return;let e=new IntersectionObserver(e=>{e.some(Rt)&&n()},{rootMargin:`600px`});return e.observe(i.current),()=>e.disconnect()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,W.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=(0,K.jsx)(`div`,{ref:i,role:`status`,"aria-label":`Loading diff…`,children:Array.from({length:Math.min(r,4)},Lt)}),t[3]=r,t[4]=s),s}function Lt(e,t){return(0,K.jsx)(`div`,{"aria-hidden":!0,className:`border-b border-border/40`,children:(0,K.jsx)(Ve,{titleWidth:`medium`})},t)}function Rt(e){return e.isIntersecting}function Q(e){let t=(0,G.c)(16),{error:n,truncated:r,retry:i}=e;if(!n&&!r)return null;let a=n?`Retry loading diff`:`Partial diff preview`,o;t[0]!==n||t[1]!==i?(o=e=>{e.stopPropagation(),n&&i()},t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,K.jsx)(w,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":a,onClick:o}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=n?(0,K.jsx)(ct,{className:`size-3`}):(0,K.jsx)(le,{className:`size-3`}),t[6]=n,t[7]=c);let l;t[8]!==s||t[9]!==c?(l=(0,K.jsx)(z,{render:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10];let u=n?`Retry loading diff`:`This file is too large to show in full. Counts include all changes.`,d;t[11]===u?d=t[12]:(d=(0,K.jsx)(B,{children:u}),t[11]=u,t[12]=d);let f;return t[13]!==l||t[14]!==d?(f=(0,K.jsxs)(V,{children:[l,d]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}var zt=`__automatic_base_ref__`,Bt=`t3code.diffFileTreeOpen`,Vt=new WeakMap;function Ht(e){let t=Vt.get(e);if(t)return t;let n={fileDiff:e,fileKey:ze(e),fileVersion:Le(e)};return Vt.set(e,n),n}var Ut=new Set;function Wt(e){let t=(0,G.c)(21),{filePath:n,fileKey:r,collapsed:i,unavailable:a,iconClassName:o,onToggle:s}=e,c=i?`Expand ${n}`:`Collapse ${n}`,l=!i,u;t[0]!==r||t[1]!==s?(u=e=>{e.stopPropagation(),s(r)},t[0]=r,t[1]=s,t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==l||t[5]!==u||t[6]!==a?(d=(0,K.jsx)(w,{size:`icon-micro`,variant:`ghost`,className:`-ms-0.5`,"aria-label":c,"aria-expanded":l,disabled:a,onClick:u}),t[3]=c,t[4]=l,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=T(`size-4`,o),t[8]=o,t[9]=f);let p=i?_t.ChevronRight:_t.ChevronDown,m;t[10]!==f||t[11]!==p?(m=(0,K.jsx)(me,{className:f,icon:p}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,K.jsx)(z,{render:d,children:m}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let g=i?`Expand diff`:`Collapse diff`,_;t[16]===g?_=t[17]:(_=(0,K.jsx)(B,{side:`top`,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==h?(v=(0,K.jsxs)(V,{children:[h,_]}),t[18]=_,t[19]=h,t[20]=v):v=t[20],v}function Gt(e){let t=(0,G.c)(11),{filePath:n,hasStat:r,error:i,truncated:a,onRetry:o}=e,s;t[0]===n?s=t[1]:(s=(0,K.jsx)(yt,{filePath:n}),t[0]=n,t[1]=s);let c;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o||t[6]!==a?(c=r?(0,K.jsx)(Q,{error:i,truncated:a,retry:()=>o(n)}):null,t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==c?(l=(0,K.jsxs)(K.Fragment,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Kt({mode:e=`inline`,composerDraftTarget:t,workspaceMutationId:r}){let{resolvedTheme:i}=we(),a=Te(),l=a.diffLayout,u=Ee(),[d,f]=(0,W.useState)(a.wordWrap),[m,h]=(0,W.useState)(a.diffIgnoreWhitespace),[g,_]=ae(Bt,!1,s),[v,te]=(0,W.useState)(``),[x,S]=(0,W.useState)(()=>({scopeKey:null,fileKeys:Ut})),[re,le]=(0,W.useState)(0),[O,A]=(0,W.useState)(null),j=ge({strict:!1,select:e=>_e(e)}),N=j?.threadId??null,P=I(j),R=pe(j)?.projection??null,he=F(P?.environmentId??null),{canReadFiles:ve}=he,Me=P?.projectId??null,Pe=L(P&&Me?{environmentId:P.environmentId,projectId:Me}:null),Le=P?.worktreePath??Pe?.workspaceRoot,ze=P?.worktreePath?void 0:Pe?.repositoryIdentity?.rootPath,Ve=c(De.configValueAtom(P?.environmentId??null)),Ge=Ae(P?.environmentId??null),Ke=ot(P?.environmentId??null,Ve?.availableEditors??[]),Je=ke(Ot.diffFileContents),ct=Oe(P!=null&&Le!=null?Ne.status({environmentId:P.environmentId,input:{cwd:Le}}):null),U=mt(e=>ut(e.byThreadKey,j)),dt=ct.data?.isRepo??!0,{turnDiffSummaries:pt,inferredCheckpointTurnCountByRunId:G}=ht(R),yt=(0,W.useMemo)(()=>[...pt].toSorted((e,t)=>{let n=e.checkpointTurnCount??G[e.runId]??0,r=t.checkpointTurnCount??G[t.runId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[G,pt]);(0,W.useEffect)(()=>{j&&U.kind===`turn`&&mt.getState().reconcileTurnSelection(j,yt.map(e=>e.runId))},[U,yt,j]);let q=U.kind===`turn`?U.turnId:null,J=U.kind===`unstaged`?`unstaged`:`branch`,bt=U.kind===`branch`?U.baseRef:null,St=U.kind===`turn`?U.filePath:null,Ct=U.kind===`turn`?U.revealRequestId:0,Y=q===null?void 0:yt.find(e=>e.runId===q)??yt[0],wt=Y&&(Y.checkpointTurnCount??G[Y.runId]),Tt=yt[0],Et=q===null?J===`unstaged`?`Uncommitted`:`Changes`:Y?.runId===Tt?.runId?`Latest turn`:`Turn ${wt??`?`}`,Dt=Y?`turn:${Y.runId}`:J,X=j?`${j.environmentId}:${j.threadId}:${Dt}`:null,jt=`${X??Dt}:${re}`,Nt=Y?`Turn ${wt??`?`}`:J===`unstaged`?`Uncommitted`:`Changes`,Pt=(0,W.useMemo)(()=>typeof wt==`number`?{fromTurnCount:Math.max(0,wt-1),toTurnCount:wt}:null,[wt]),Ft=vt({environmentId:P?.environmentId??null,threadId:N,fromTurnCount:Pt?.fromTurnCount??null,toTurnCount:Pt?.toTurnCount??null,ignoreWhitespace:m,cacheScope:Y?`turn:${Y.runId}`:null},{enabled:dt&&Y!==void 0}),Z=Oe(ve&&q===null&&P&&Le?Ot.diffPreview({environmentId:P.environmentId,input:{cwd:Le,...bt?{baseRef:bt}:{},ignoreWhitespace:m}}):null),Lt=dt&&q===null&&P!=null&&Le!=null,Rt=j?`${j.environmentId}:${j.threadId}`:null,Q=Z.data?.sources.find(e=>e.kind===(J===`unstaged`?`working-tree`:`branch-range`)),Vt=Z.refresh,Kt=Vt,qt=(0,W.useMemo)(()=>{let e=Z.data;if(q===null&&P&&e&&Q&&ve)return We(Je,{environmentId:P.environmentId,cwd:e.cwd,sourceKind:Q.kind,baseRef:Q.baseRef,headRef:Q.headRef,cacheKey:Q.diffHash})},[P,Z.data,Je,ve,Q,q]),Jt=(0,W.useRef)(qt);Jt.current=qt;let Yt=(0,W.useCallback)(async e=>{let t=Jt.current;if(!t)throw Error(`Diff file contents are unavailable for this selection.`);return t(e)},[]),Xt=Oe(q===null&&J===`branch`&&P&&Z.data?.cwd?Ne.listRefs({environmentId:P.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...v.trim().length>0?{query:v.trim()}:{},limit:100}}):null),Zt=Oe(q===null&&J===`branch`&&P&&Z.data?.cwd?Ne.listRefs({environmentId:P.environmentId,input:{cwd:Z.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...v.trim().length>0?{query:v.trim()}:{},limit:100}}):null),Qt=kt(Xt.data?.refs.filter(e=>e.name!==Q?.headRef)??[],Zt.data?.refs??[]),$t=At(Qt,v),en=e=>bt&&bt===e.remote?.name?bt:e.local?.name??e.remote?.name??e.id,tn=[zt,...Qt.map(en)],nn=[...v.trim().length===0?[zt]:[],...$t.map(en)],rn=Q?.diff,an=Y?Ft.data?.diff:rn,on=!Y&&Q?.truncated===!0,sn=Y?Ft.isPending:Z.isPending,cn=Y?Ft.error:Z.error,ln=typeof an==`string`&&an.trim().length===0,$=!Y&&Q?.truncated&&Q.files?Q:null,un=(0,W.useMemo)(()=>$?null:Fe(an,`diff-panel:${i}`,{compactPartialHunkOffsets:q===null}),[$,i,an,q]),dn=(0,W.useMemo)(()=>new Map($?.files?.map(e=>[e.path,e])),[$?.files]),{scope:fn,isPending:pn,fileStates:mn,retry:hn,requestFile:gn,readyFilePaths:_n,renderableFiles:vn,settledFileCount:yn,loadNextFiles:bn}=Mt({environmentId:P?.environmentId,cwd:Z.data?.cwd,source:$,baseRef:$?.baseRef??bt,ignoreWhitespace:m,theme:i,revision:Z.data?ie(Z.data.generatedAt):void 0,preview:un}),xn=Vt;(0,W.useEffect)(()=>{if(!Lt)return;let e=()=>xn();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Lt,xn]),ft({enabled:Lt,mutationId:r,refresh:xn,resourceKey:`diff:${Rt??``}`});let Sn=Z.isPending||pn,Cn=(0,W.useMemo)(()=>vn.map(Ht),[vn]),wn=(0,W.useMemo)(()=>a.diffFilesCollapsed?new Set(Cn.map(e=>e.fileKey)):Ut,[Cn,a.diffFilesCollapsed]),Tn=x.scopeKey===X?x.fileKeys:wn,En=(0,W.useCallback)(()=>yn<vn.length?(0,K.jsx)(It,{load:bn,count:vn.length-yn}):null,[yn,vn.length,bn]),Dn=(0,W.useMemo)(()=>Cn.filter(({fileDiff:e})=>!$||_n.has(H(e))).map(({fileDiff:e,fileKey:t,fileVersion:n})=>({fileDiff:e,filePath:H(e),fileKey:t,fileVersion:n,collapsed:Tn.has(t)||e.cacheKey?.endsWith(`:pending`)===!0})),[Tn,Cn,$,_n]),On=(0,W.useMemo)(()=>Cn.map(e=>e.fileKey),[Cn]),kn=Se(On,Tn),An=(0,W.useMemo)(()=>!Y&&Q?.files?Q.files.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}):Be(vn),[vn,Q,Y]),jn=(0,W.useMemo)(()=>xe(vn),[vn]),Mn=St?Dn.find(e=>e.filePath===St)?.fileKey??null:null;(0,W.useEffect)(()=>{Mn&&O?.getInstance()&&O.scrollTo({type:`item`,id:Mn,align:`start`})},[O,jt,Mn,Ct]);let Nn=(0,W.useMemo)(()=>({collapseScopeKey:X,diffSelection:U}),[X,U]),Pn=ye(O,Nn,Dn.map(e=>e.fileKey)),Fn=(0,W.useCallback)(e=>{let t=Cn.findIndex(t=>H(t.fileDiff)===e),n=Cn[t];n&&(S(e=>{let t=new Set(e.scopeKey===X?e.fileKeys:wn);return t.delete(n.fileKey),{scopeKey:X,fileKeys:t}}),$&&t>=yn&&gn(t),Pn(n.fileKey))},[Cn,X,wn,Pn,$,yn,gn]),In=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!$||!St)return;let e=`${St}:${Ct}`;(In.current?.cache!==fn||In.current.key!==e)&&(In.current={cache:fn,key:e},Fn(St))},[$,St,Ct,fn,Fn]);let Ln=(0,W.useCallback)(e=>{je({threadRef:j,filePath:e,activeCwd:Le,repositoryRoot:ze,openInEditor:e=>{(async()=>{let t=await Ke(e);t._tag===`Failure`&&!k(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,...j?{environmentId:j.environmentId,threadId:j.threadId}:{},...fe(M(t))})})()}})},[Le,ze,Ke,j]),Rn=(0,W.useRef)({collapseScopeKey:X,defaultCollapsedDiffFileKeys:wn});(0,W.useLayoutEffect)(()=>{Rn.current={collapseScopeKey:X,defaultCollapsedDiffFileKeys:wn}},[X,wn]);let zn=(0,W.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Rn.current;S(r=>{let i=new Set(r.scopeKey===t?r.fileKeys:n);return i.has(e)?i.delete(e):i.add(e),{scopeKey:t,fileKeys:i}})},[]),Bn=(0,W.useCallback)(e=>{let{collapseScopeKey:t,defaultCollapsedDiffFileKeys:n}=Rn.current;S(r=>{let i=r.scopeKey===t?r.fileKeys:n;if(!i.has(e))return r;let a=new Set(i);return a.delete(e),{scopeKey:t,fileKeys:a}})},[]),Vn=(0,W.useCallback)(()=>{le(e=>e+1),S(e=>{let t=e.scopeKey===X?e.fileKeys:wn;return{scopeKey:X,fileKeys:be(On,t)}})},[X,wn,On]),Hn=e=>{j&&mt.getState().selectTurn(j,e)},Un=e=>{j&&mt.getState().selectGitScope(j,e)},Wn=e=>{j&&mt.getState().selectBranchBaseRef(j,e)},Gn=Y?`turn:${Y.runId}`:``,Kn=q===null?J:Y?.runId===Tt?.runId?`latest`:Gn,qn=e=>{if(e===`unstaged`||e===`branch`)Un(e);else if(e===`latest`)Tt&&Hn(Tt.runId);else{let t=yt.find(t=>`turn:${t.runId}`===e);t&&Hn(t.runId)}},Jn=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,K.jsxs)(o,{children:[(0,K.jsxs)(ne,{render:(0,K.jsx)(w,{size:`xs`,variant:`secondary`}),className:`max-w-full`,"aria-label":`Diff scope: ${Et}`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:Et}),(0,K.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsxs)(ee,{align:`start`,children:[(0,K.jsxs)(p,{value:Kn,onValueChange:qn,children:[(0,K.jsx)(n,{value:`branch`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Changes`})}),(0,K.jsx)(n,{value:`unstaged`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Uncommitted`})}),(0,K.jsx)(n,{value:`latest`,closeOnClick:!0,children:(0,K.jsx)(`span`,{children:`Latest turn`})})]}),(0,K.jsxs)(C,{children:[(0,K.jsx)(y,{children:`Turn`}),(0,K.jsx)(b,{children:(0,K.jsx)(p,{value:Gn,onValueChange:qn,children:yt.map(e=>{let t=e.checkpointTurnCount??G[e.runId]??`?`;return(0,K.jsx)(n,{value:`turn:${e.runId}`,closeOnClick:!0,children:(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{children:[`Turn `,t]}),(0,K.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:qe(e.completedAt,a.timestampFormat)})]})},e.runId)})})})]})]})]}),q===null&&J===`branch`&&Q?.baseRef&&(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,"aria-label":`Comparing ${Q.headRef??`HEAD`} against ${Q.baseRef}`,children:[(0,K.jsxs)(V,{children:[(0,K.jsxs)(z,{render:(0,K.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`}),children:[(0,K.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Q.headRef??`HEAD`}),(0,K.jsx)(st,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsx)(B,{side:`top`,children:`${Q.headRef??`HEAD`} → ${Q.baseRef}`})]}),(0,K.jsxs)(rt,{items:tn,filteredItems:nn,value:bt??zt,onOpenChange:e=>{e||te(``)},onValueChange:e=>{e&&Wn(e===zt?null:e)},children:[(0,K.jsxs)(Qe,{render:(0,K.jsx)(w,{variant:`ghost-muted`,size:`xs`}),className:`min-w-0 max-w-48`,"aria-label":`Change comparison target. Currently ${Q.baseRef}`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:Q.baseRef}),(0,K.jsx)(E,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,K.jsxs)(et,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden`,children:[(0,K.jsx)(nt,{placeholder:`Search refs...`,value:v,onChange:e=>te(e.target.value)}),(0,K.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-3xs text-muted-foreground uppercase tracking-wide`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`}),(0,K.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,K.jsx)(`span`,{children:`Branch`}),(0,K.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,K.jsx)($e,{children:`No matching refs.`}),(0,K.jsxs)(Ze,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,K.jsx)(tt,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:zt,children:(0,K.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),Qt.map(e=>{let t=en(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,K.jsx)(tt,{className:`w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]`,value:t,children:(0,K.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,K.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,K.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,K.jsx)(it,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Wn(n)}})}):e.remote?(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,children:(0,K.jsx)(oe,{role:`img`,"aria-label":`Remote only`,className:`size-3`})})}),(0,K.jsx)(B,{side:`top`,children:`Remote only`})]}):null]})},e.id)})]})]})]})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[Dn.length>0||!Y&&Q?.files?.length?(0,K.jsx)(gt,{additions:An.additions,deletions:An.deletions,className:`mr-1 text-2xs`,layout:`inline`}):null,Lt&&(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Sn?`Refreshing diff`:`Refresh diff`,onClick:Kt}),children:(0,K.jsx)(lt,{size:`sm`,refreshing:Sn})}),(0,K.jsx)(B,{side:`top`,children:Sn?`Refreshing diff…`:`Refresh diff`})]}),On.length>0&&(0,K.jsx)(w,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":kn?`Expand all files`:`Collapse all files`,onClick:Vn,children:(0,K.jsx)(me,{className:`size-3.5`,icon:kn?_t.ChevronsUpDown:_t.ChevronsDownUp})}),(0,K.jsxs)(Ye,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[l],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&u({diffLayout:t})},children:[(0,K.jsx)(Xe,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,K.jsx)(D,{className:`size-3.5`})}),(0,K.jsx)(Xe,{"aria-label":`Split diff view`,value:`split`,children:(0,K.jsx)(se,{className:`size-3.5`})})]}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":d?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:d,onPressedChange:e=>{f(!!e)}}),children:(0,K.jsx)(de,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:d?`Disable line wrapping`:`Enable line wrapping`})]}),(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":m?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:m,onPressedChange:e=>{h(!!e)}}),children:(0,K.jsx)(ue,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:m?`Show whitespace changes`:`Hide whitespace changes`})]}),On.length>0&&(0,K.jsxs)(V,{children:[(0,K.jsx)(z,{render:(0,K.jsx)(Xe,{"aria-label":g?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:g,onPressedChange:e=>_(!!e)}),children:(0,K.jsx)(ce,{className:`size-3.5`})}),(0,K.jsx)(B,{side:`top`,children:g?`Hide file tree`:`Show file tree`})]})]})]});return(0,K.jsx)(Ue,{mode:e,header:Jn,children:P?dt?q!==null&&yt.length===0?(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):q===null&&!ve?he.isPending?(0,K.jsx)(He,{label:`Checking file access...`}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:he.error??`This connection cannot read local diffs.`}):(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[on&&!$&&(0,K.jsxs)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-2xs text-muted-foreground`,children:[`This preview exceeds the size limit. Changes shown are incomplete.`,Q?.files?` Totals include all changes.`:``]}),cn&&!un&&(0,K.jsx)(`div`,{className:`px-3`,children:(0,K.jsx)(`p`,{className:`mb-2 text-2xs text-error/80`,children:cn})}),!un&&!$?sn?(0,K.jsx)(He,{label:Y?`Loading checkpoint diff...`:J===`unstaged`?`Loading uncommitted changes...`:`Loading changes...`}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,K.jsx)(`p`,{children:ln?`No net changes in this selection.`:`No patch available for this selection.`})}):$||un?.kind===`files`?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement&&(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement))return;let n=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent;if(n){Ln(n);return}let r=t.find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-diffs-header`))?.querySelector(`[data-title]`)?.textContent;if(!r)return;let i=Dn.find(e=>e.filePath===r);i&&zn(i.fileKey)},onContextMenuCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&(e.preventDefault(),Ge({environmentId:P?.environmentId??null,filePath:t,workspaceRoot:Le,repositoryRoot:ze},e))},children:(0,K.jsx)(xt,{viewerRef:A,codeViewKey:`${jt}:${$?fn:`preview`}`,className:`h-full min-h-0 overflow-auto`,files:Dn,renderCodeViewFooter:En,sectionId:Dt,sectionTitle:Nt,composerDraftTarget:t,renderHeaderFilenameSuffix:e=>{let t=H(e),n=mn.get(t);return(0,K.jsx)(Gt,{filePath:t,hasStat:dn.has(t),error:n?.error??!1,truncated:n?.truncated??!1,onRetry:hn})},...$?{unsafeCSSExtra:`[data-additions-count], [data-deletions-count] { display: none; }`,renderHeaderMetadata:e=>{let t=dn.get(H(e));return t?(0,K.jsx)(gt,{additions:t.additions,deletions:t.deletions}):null}}:{},onRevealSearchMatch:Bn,renderHeaderPrefix:(e,t)=>{let n=e.cacheKey?.endsWith(`:pending`)===!0;return(0,K.jsx)(Wt,{filePath:H(e),fileKey:t,collapsed:n||Tn.has(t),unavailable:n,iconClassName:Re(e),onToggle:zn})},options:{diffStyle:l===`split`?`split`:`unified`,lineDiffType:`none`,overflow:d?`wrap`:`scroll`,theme:Ie(i),preferredHighlighter:at,themeType:i,stickyHeaders:!0,...qt?{loadDiffFiles:Yt}:{}}},X??Dt)}),g?(0,K.jsx)(`aside`,{className:`flex w-[min(16rem,40%)] min-w-40 shrink-0 border-l border-border/60`,children:(0,K.jsx)(Ce,{ariaLabel:`${Nt} files`,entries:jn,selectedPath:St,revealRequestId:Ct,onSelectFile:Fn})}):null]}):(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-2xs text-muted-foreground/75`,children:un?.kind===`raw`?un.reason:null}),(0,K.jsx)(`pre`,{className:T(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-2xs leading-relaxed text-muted-foreground/90`,d?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:un?.kind===`raw`?un.text:null})]})})]})}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{Kt as default};
|
|
2
|
-
//# sourceMappingURL=DiffPanel-Dqh76p3E.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,Ax as r,D as i,Fo as a,Gn as o,Jn as s,Mf as c,No as l,Qn as u,Vs as d,Wn as f,Xl as p,Yn as m,Zn as h,ar as g,ha as _,ir as v,jo as y,nu as b,or as x,qn as S,rr as C,sr as w,t as T,tr as E,zo as D}from"./utils-DmfMX1v5.js";import{t as O}from"./camera-V1Ufc9sC.js";import{t as k}from"./ellipsis-vertical-fYTS1grT.js";import{t as ee}from"./external-link-NWS0I_zo.js";import{t as A}from"./globe-BygqUCSx.js";import{t as te}from"./minus-C7W28oE7.js";import{t as ne}from"./mouse-pointer-click-DsDE4K7M.js";import{t as re}from"./picture-in-picture-2-g5nsWFVw.js";import{t as ie}from"./plus-Cr075-cy.js";import{t as ae}from"./radio-tower-CT5Np78y.js";import{t as j}from"./x-CSwbgjBe.js";import{L as M,U as N}from"./runtime-BQJQC-Ny.js";import{b as oe}from"./entities-82m-Smm-.js";import{a as se,n as P,t as F}from"./tooltip-taOyJZax.js";import{ct as ce}from"./ChatMarkdown-CLD9Y6dg.js";import{i as I}from"./toast-CjelgyqV.js";import{C as le,O as L,S as ue,q as R}from"./useSettings-CLtJrOYI.js";import{i as de,n as z}from"./session-DsbInyNV.js";import{t as B}from"./use-atom-command-CQHjSXPR.js";import{l as V}from"./rightPanelStore-DqMd0tFH.js";import{n as H}from"./toastHelpers-Dsph6LwL.js";import{A as U,k as W}from"./PanelLayoutControls-BfRIRM0o.js";import{o as fe}from"./timestampFormat-wac2e_Jz.js";import{a as G,o as K,r as q,t as pe}from"./empty-C-gDaZ_z.js";import{a as me,i as he,t as ge}from"./previewMiniPlayerStore-B9Lqaaij.js";import{n as _e,t as ve}from"./discovery-list-Fg_u6w-x.js";import{t as ye}from"./observeResize-Csvw3hy4.js";import{n as be}from"./openFileInPreview-C3O_ayUT.js";import{T as xe,a as Se,b as Ce,f as we,i as Te,n as Ee,o as De,r as Oe,t as ke,u as Ae,w as je}from"./browserHistoryStore-BJD0OPpb.js";import{t as Me}from"./preview-CEMnbqVB.js";import{n as Ne,r as Pe,t as Fe}from"./preview-CjgXQQdj.js";import{n as Ie,r as Le,t as Re}from"./input-group-CJ7ZOvDN.js";import{Ji as ze,Mo as Be,Qi as Ve,Xi as He,Yi as Ue,Zi as We,ca as Ge,da as Ke,fa as J,gs as Y,ha as X,na as qe,oa as Je,oo as Ye,qa as Xe,ra as Ze,sa as Qe,ta as $e,vs as et}from"./main-BB3F4O6Y.js";import{a as tt,c as nt,d as rt,f as it,i as at,l as ot,n as st,o as ct,r as lt,s as ut,u as dt}from"./_chat-BKcYL38S.js";var Z=e(t(),1),Q=r(),ft=`data:image/png;base64,`;function pt(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(ft))return{status:`failed`};let n=X(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(_(),1),mt=()=>{};function ht(e){let t=(0,Q.c)(78),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:o,inputDisabled:s,focusUrlNonce:c,onBack:l,onForward:u,onRefresh:d,onSubmit:f,onOpenInBrowser:p,onCapture:m,captureDisabled:h,recording:g,onPictureInPicture:_,pictureInPicture:v,pictureInPictureDisabled:y,onPickElement:b,pickActive:x,pickDisabled:S,pickDisabledReason:C,trailingActions:E,leadingActions:D}=e,k=(0,Z.useRef)(null),[A,te]=(0,Z.useState)(n),[ie,ae]=(0,Z.useState)(!1),j,M;t[0]===c?(j=t[1],M=t[2]):(j=()=>{if(c==null)return;let e=k.current;e&&e.focus()},M=[c],t[0]=c,t[1]=j,t[2]=M),(0,Z.useEffect)(j,M);let N;t[3]!==A||t[4]!==f?(N=e=>{e?.preventDefault();let t=A.trim();t.length!==0&&(f(t),k.current?.blur())},t[3]=A,t[4]=f,t[5]=N):N=t[5];let oe=N,ce=i?l:mt,I=!i,le;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(et,{}),t[6]=le):le=t[6];let L;t[7]!==ce||t[8]!==I?(L=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:I,"aria-label":`Back`,type:`button`,children:le}),t[7]=ce,t[8]=I,t[9]=L):L=t[9];let ue=a?u:mt,R=!a,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(Y,{}),t[10]=de):de=t[10];let z;t[11]!==ue||t[12]!==R?(z=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:ue,disabled:R,"aria-label":`Forward`,type:`button`,children:de}),t[11]=ue,t[12]=R,t[13]=z):z=t[13];let B=o?mt:d,V=r?`Stop`:`Refresh`,H;t[14]!==o||t[15]!==B||t[16]!==V?(H=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:B,disabled:o,"aria-label":V,type:`button`}),t[14]=o,t[15]=B,t[16]=V,t[17]=H):H=t[17];let U;t[18]===r?U=t[19]:(U=(0,$.jsx)(Xe,{refreshing:r}),t[18]=r,t[19]=U);let W;t[20]!==H||t[21]!==U?(W=(0,$.jsx)(se,{render:H,children:U}),t[20]=H,t[21]=U,t[22]=W):W=t[22];let fe=r?`Loading…`:`Refresh`,G;t[23]===fe?G=t[24]:(G=(0,$.jsx)(P,{children:fe}),t[23]=fe,t[24]=G);let K;t[25]!==W||t[26]!==G?(K=(0,$.jsxs)(F,{children:[W,G]}),t[25]=W,t[26]=G,t[27]=K):K=t[27];let q;t[28]!==z||t[29]!==K||t[30]!==L?(q=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":`Navigation`,children:[L,z,K]}),t[28]=z,t[29]=K,t[30]=L,t[31]=q):q=t[31];let pe=ie?A:n,me;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>te(e.target.value),t[32]=me):me=t[32];let he;t[33]===n?he=t[34]:(he=()=>{te(n),ae(!0),queueMicrotask(()=>k.current?.select())},t[33]=n,t[34]=he);let ge;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{ae(!1)},t[35]=ge):ge=t[35];let _e;t[36]!==oe||t[37]!==n?(_e=e=>{e.key===`Enter`&&oe(e),e.key===`Escape`&&(e.preventDefault(),te(n),k.current?.blur())},t[36]=oe,t[37]=n,t[38]=_e):_e=t[38];let ve;t[39]!==s||t[40]!==pe||t[41]!==he||t[42]!==_e?(ve=(0,$.jsx)(F,{children:(0,$.jsx)(se,{render:(0,$.jsx)(Le,{ref:k,value:pe,onChange:me,onFocus:he,onBlur:ge,onKeyDown:_e,placeholder:`Search or enter URL`,spellCheck:!1,disabled:s,"data-preview-url-input":!0,size:`sm`})})}),t[39]=s,t[40]=pe,t[41]=he,t[42]=_e,t[43]=ve):ve=t[43];let ye;t[44]!==ie||t[45]!==p?(ye=p&&!ie?(0,$.jsx)(Ie,{align:`inline-end`,children:(0,$.jsx)(`span`,{className:`pointer-events-none flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,onClick:p,"aria-label":`Open in system browser`,type:`button`,children:(0,$.jsx)(ee,{})})})}):null,t[44]=ie,t[45]=p,t[46]=ye):ye=t[46];let be;t[47]!==ve||t[48]!==ye?(be=(0,$.jsxs)(Re,{variant:`ghost`,className:`group/address h-7 flex-1`,children:[ve,ye]}),t[47]=ve,t[48]=ye,t[49]=be):be=t[49];let xe;t[50]!==b||t[51]!==x||t[52]!==S||t[53]!==C?(xe=b?(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(w,{variant:x?`secondary`:`ghost`,size:`icon-xs`,onClick:b,disabled:S,"aria-label":x?`Cancel annotation`:`Annotate preview`,"aria-pressed":x?`true`:`false`,type:`button`}),children:(0,$.jsx)(ne,{className:T(x&&`text-primary`)})}),(0,$.jsx)(P,{children:S&&C?C:x?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[50]=b,t[51]=x,t[52]=S,t[53]=C,t[54]=xe):xe=t[54];let Se;t[55]!==h||t[56]!==m||t[57]!==g?(Se=m?(0,$.jsxs)(F,{children:[(0,$.jsxs)(se,{render:(0,$.jsx)(w,{variant:g?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>m(e.shiftKey),"aria-label":g?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:h}),children:[(0,$.jsx)(O,{className:T(g&&`text-destructive`)}),g?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(P,{children:g?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[55]=h,t[56]=m,t[57]=g,t[58]=Se):Se=t[58];let Ce;t[59]!==_||t[60]!==v||t[61]!==y?(Ce=_?(0,$.jsx)(w,{variant:v?`secondary`:`ghost`,size:`icon-xs`,onClick:_,"aria-label":v?`Close floating preview`:`Float preview over chat`,"aria-pressed":v?`true`:`false`,type:`button`,disabled:y,children:(0,$.jsx)(re,{className:T(v&&`text-primary`)})}):null,t[59]=_,t[60]=v,t[61]=y,t[62]=Ce):Ce=t[62];let we;t[63]!==D||t[64]!==oe||t[65]!==q||t[66]!==be||t[67]!==xe||t[68]!==Se||t[69]!==Ce||t[70]!==E?(we=(0,$.jsxs)(`form`,{onSubmit:oe,className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[q,D,be,xe,Se,Ce,E]}),t[63]=D,t[64]=oe,t[65]=q,t[66]=be,t[67]=xe,t[68]=Se,t[69]=Ce,t[70]=E,t[71]=we):we=t[71];let Te;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Te={boxShadow:`0 0 6px 1px var(--color-ring)`},t[72]=Te):Te=t[72];let Ee;t[73]===r?Ee=t[74]:(Ee=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Te}),t[73]=r,t[74]=Ee);let De;return t[75]!==we||t[76]!==Ee?(De=(0,$.jsxs)(`div`,{className:`relative`,children:[we,Ee]}),t[75]=we,t[76]=Ee,t[77]=De):De=t[77],De}function gt(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=_t(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(W,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(_e,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function _t(e){return e.processName?e.processName:`Listening`}function vt(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let s=o,c=s.pathname===`/`?``:s.pathname,l=`${s.host}${c}${s.search}${s.hash}`,u;t[2]===r.lastVisitedAt?u=t[3]:(u=ke(r.lastVisitedAt)?fe(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=u);let d=u;ut();let f;t[4]!==r.url||t[5]!==n?(f=(0,$.jsx)(W,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=f):f=t[6];let p=r.title??l,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:p}),t[7]=p,t[8]=m);let h=r.title?`${l} · `:``,g;t[9]!==h||t[10]!==d?(g=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[h,d]}),t[9]=h,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==i||t[16]!==f||t[17]!==_?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[f,_]}),t[15]=i,t[16]=f,t[17]=_,t[18]=v):v=t[18];let y=`Remove ${l} from history`,b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(j,{className:`size-3.5`}),t[19]=b):b=t[19];let x;t[20]!==a||t[21]!==y?(x=(0,$.jsx)(`button`,{type:`button`,"aria-label":y,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:b}),t[20]=a,t[21]=y,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==v?(S=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[v,x]}),t[23]=x,t[24]=v,t[25]=S):S=t[25],S}function yt(e){let t=(0,Q.c)(7),n=Ge(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:De(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=bt({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function bt(e){let t=new Map;for(let n of e.configuredUrls){let e=St(n);if(!e)continue;let r=xt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=xt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function xt(e,t){let n=e.toLowerCase();return`${Fe(n)?`loopback`:n}:${t}`}function St(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!Fe(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function Ct(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=yt(c),u,d,f,p;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(wt).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(pe,{children:[(0,$.jsx)(G,{variant:`icon`,children:(0,$.jsx)(A,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(K,{children:`No preview yet`}),(0,$.jsx)(q,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],p=e;break bb0}f=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,u=`mx-auto flex w-full max-w-xl flex-col gap-6`,d=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(Be,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(ve,{children:e.map(e=>(0,$.jsx)(vt,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else u=t[8],d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[13]!==s||t[14]!==l||t[15]!==n?(m=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(ae,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(ve,{children:l.map(e=>(0,$.jsx)(gt,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==u||t[18]!==d||t[19]!==m?(h=(0,$.jsxs)(`div`,{className:u,children:[d,m]}),t[17]=u,t[18]=d,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==f||t[22]!==h?(g=(0,$.jsx)(`div`,{className:f,children:h}),t[21]=f,t[22]=h,t[23]=g):g=t[23],g}function wt(e){return URL.canParse(e.url)}var Tt=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Et=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(x,{render:(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(k,{})}),(0,$.jsx)(P,{children:`More`})]}),e[0]=t):t=e[0],t};function Dt(e){let t=(0,Q.c)(74),{enabled:n,actions:r,zoomFactor:i,colorScheme:a,deviceToolbarVisible:c,onToggleDeviceToolbar:l,nativePictureInPicture:d,profileName:f,move:p}=e,_;t[0]===i?_=t[1]:(_=Math.round(i*100),t[0]=i,t[1]=_);let y=`${_}%`,b=!n,x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Et,{}),t[2]=x):x=t[2];let T;t[3]!==r.hardReload||t[4]!==b?(T=(0,$.jsx)(m,{onClick:r.hardReload,disabled:b,children:`Hard reload`}),t[3]=r.hardReload,t[4]=b,t[5]=T):T=t[5];let D;t[6]!==r.openDevTools||t[7]!==b?(D=r.openDevTools?(0,$.jsx)(m,{onClick:r.openDevTools,disabled:b,children:`Open DevTools`}):null,t[6]=r.openDevTools,t[7]=b,t[8]=D):D=t[8];let O;t[9]!==r.toggleNativePictureInPicture||t[10]!==b||t[11]!==d?(O=r.toggleNativePictureInPicture?(0,$.jsx)(m,{onClick:r.toggleNativePictureInPicture,disabled:b,children:d?`Close separate preview window`:`Open separate preview window`}):null,t[9]=r.toggleNativePictureInPicture,t[10]=b,t[11]=d,t[12]=O):O=t[12];let k;t[13]===p?k=t[14]:(k=p?(0,$.jsx)(m,{onClick:p.onMove,children:p.label}):null,t[13]=p,t[14]=k);let ee=c?`Hide device toolbar`:`Show device toolbar`,A;t[15]!==b||t[16]!==l||t[17]!==ee?(A=(0,$.jsx)(m,{onClick:l,disabled:b,children:ee}),t[15]=b,t[16]=l,t[17]=ee,t[18]=A):A=t[18];let ne;t[19]===b?ne=t[20]:(ne=(0,$.jsx)(g,{disabled:b,children:`Appearance`}),t[19]=b,t[20]=ne);let re;t[21]===r?re=t[22]:(re=e=>r.setColorScheme(e),t[21]=r,t[22]=re);let ae;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ae=Tt.map(kt),t[23]=ae):ae=t[23];let j;t[24]!==a||t[25]!==re?(j=(0,$.jsx)(v,{children:(0,$.jsx)(u,{value:a,onValueChange:re,children:ae})}),t[24]=a,t[25]=re,t[26]=j):j=t[26];let M;t[27]!==j||t[28]!==ne?(M=(0,$.jsxs)(C,{children:[ne,j]}),t[27]=j,t[28]=ne,t[29]=M):M=t[29];let N;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(E,{}),t[30]=N):N=t[30];let oe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(`span`,{children:`Zoom`}),t[31]=oe):oe=t[31];let se;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(te,{}),t[32]=se):se=t[32];let P;t[33]!==r.zoomOut||t[34]!==b?(P=(0,$.jsx)(w,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomOut,"aria-label":`Zoom out`,disabled:b,children:se}),t[33]=r.zoomOut,t[34]=b,t[35]=P):P=t[35];let F;t[36]===y?F=t[37]:(F=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:y}),t[36]=y,t[37]=F);let ce;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(ie,{}),t[38]=ce):ce=t[38];let I;t[39]!==r.zoomIn||t[40]!==b?(I=(0,$.jsx)(w,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomIn,"aria-label":`Zoom in`,disabled:b,children:ce}),t[39]=r.zoomIn,t[40]=b,t[41]=I):I=t[41];let le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(Ye,{}),t[42]=le):le=t[42];let L;t[43]!==r.resetZoom||t[44]!==b?(L=(0,$.jsx)(w,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:r.resetZoom,"aria-label":`Reset zoom`,disabled:b,children:le}),t[43]=r.resetZoom,t[44]=b,t[45]=L):L=t[45];let ue;t[46]!==P||t[47]!==F||t[48]!==I||t[49]!==L?(ue=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[P,F,I,L]}),t[46]=P,t[47]=F,t[48]=I,t[49]=L,t[50]=ue):ue=t[50];let R;t[51]!==b||t[52]!==ue?(R=(0,$.jsxs)(m,{closeOnClick:!1,onClick:Ot,className:`justify-between`,disabled:b,children:[oe,ue]}),t[51]=b,t[52]=ue,t[53]=R):R=t[53];let de;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(E,{}),t[54]=de):de=t[54];let z;t[55]===f?z=t[56]:(z=f?(0,$.jsx)(s,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,f]})}):null,t[55]=f,t[56]=z);let B;t[57]===r.clearCookies?B=t[58]:(B=(0,$.jsx)(m,{onClick:r.clearCookies,children:`Clear cookies`}),t[57]=r.clearCookies,t[58]=B);let V;t[59]===r.clearCache?V=t[60]:(V=(0,$.jsx)(m,{onClick:r.clearCache,children:`Clear cache`}),t[59]=r.clearCache,t[60]=V);let H;t[61]!==z||t[62]!==B||t[63]!==V?(H=(0,$.jsxs)(S,{children:[z,B,V]}),t[61]=z,t[62]=B,t[63]=V,t[64]=H):H=t[64];let U;return t[65]!==M||t[66]!==R||t[67]!==H||t[68]!==T||t[69]!==D||t[70]!==O||t[71]!==k||t[72]!==A?(U=(0,$.jsxs)(o,{children:[x,(0,$.jsxs)(h,{align:`end`,sideOffset:6,children:[T,D,O,k,A,M,N,R,de,H]})]}),t[65]=M,t[66]=R,t[67]=H,t[68]=T,t[69]=D,t[70]=O,t[71]=k,t[72]=A,t[73]=U):U=t[73],U}function Ot(e){return e.preventDefault()}function kt(e){return(0,$.jsx)(n,{value:e.value,children:e.label},e.value)}function At(e){return D[e]||(e.length>0?e:`Network error`)}function jt(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Ft(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(w,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function Mt(e){let t=(0,Q.c)(36),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Ft(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=At(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==o||t[15]!==s?(y=s?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:`Checking your connection`}),(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`})]})]}):null,t[14]=o,t[15]=s,t[16]=y):y=t[16];let b;t[17]===m?b=t[18]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[17]=m,t[18]=b);let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(Nt),t[19]=x):x=t[19];let S=s?`Hide details`:`Details`,C;t[20]===S?C=t[21]:(C=(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[20]=S,t[21]=C);let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`div`,{className:`flex-1`}),t[22]=T):T=t[22];let E;t[23]===o?E=t[24]:(E=o?(0,$.jsx)(w,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[23]=o,t[24]=E);let D;t[25]===a?D=t[26]:(D=(0,$.jsx)(w,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[25]=a,t[26]=D);let O;t[27]!==C||t[28]!==E||t[29]!==D?(O=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[C,T,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=O):O=t[30];let k;return t[31]!==O||t[32]!==v||t[33]!==y||t[34]!==b?(k=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,O]})}),t[31]=O,t[32]=v,t[33]=y,t[34]=b,t[35]=k):k=t[35],k}function Nt(e){return!e}function Pt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Ft(e){try{return new URL(e).host}catch{return null}}var It=1500,Lt=.001;function Rt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Lt))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},It),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=T(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function zt(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var Bt=typeof window>`u`?null:R();function Vt(e){let t=(0,Q.c)(12),n=rt(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?it({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void Bt?.shell.openExternal(e.url).catch(Ht),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(jt,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function Ht(){}function Ut({threadRef:e,tabId:t,configuredUrls:n,visible:r,onSendAnnotation:o}){let[s,c]=(0,Z.useState)(void 0),[u,m]=(0,Z.useState)(!1),h=de(e.environmentId,`orchestration:operate`)&&!!o,g=Ve(),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!0),x=(0,Z.useRef)(e);x.current=e;let S=a(e),C=Se(e,50),w=me(t=>he(t.byThreadKey,e)),E=i(e=>e.addPreviewAnnotation),D=i(e=>e.addImage),O=le(e.environmentId),k=O?new URL(O).hostname:null,ee=B(Me.open),A=B(Me.close,`preview close`),te=ue(e.environmentId)?.label??`the environment`,ne=L(),re=oe(e.environmentId),ie=B(Me.resize,`preview viewport resize`),ae=B(Me.adjust,`preview appearance or zoom`);st(e),(0,Z.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let j=t??S.activeTabId,R=j?qe(e,S.serverEpoch,j):null,U=j&&R?g.has(R)?R:ze(e,j):null,W=j?S.sessions[j]??null:null,fe=xe(e.environmentId,W),G=W?.runtime===`server`&&!fe,K=W?.runtime===`server`,q=(0,Z.useRef)(null),[pe,_e]=(0,Z.useState)(!1),ve=(0,Z.useRef)(null),[ke,je]=(0,Z.useState)(0),Fe=W?.runtime===`server`&&(W.viewport??p)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=ve.current;if(e&&Fe)return ye(e,([e])=>je(Math.max(1,Math.round(e?.contentRect.width??0))))},[Fe]);let[Ie,Le]=(0,Z.useState)(null),Re=G&&Ie!==R,[Be,Ge]=(0,Z.useState)(null),Y=j?S.desktopByTabId[j]??null:null,X=W?.navStatus??{_tag:`Idle`},Ye=X._tag===`Idle`?``:X.url,Xe=Y?.loading??X._tag===`Loading`,et=Y?.canGoBack??W?.canGoBack??!1,rt=Y?.canGoForward??W?.canGoForward??!1,it=X._tag===`Idle`,ut=X._tag===`LoadFailed`,Q=ct(W),ft=G&&!Q&&!ut&&Be!==R,mt=Y?.controller??`none`,gt=W?.viewport??p,_t=we(),vt=W?.profileId??`default`,yt=zt(_t.profiles,vt),bt=$e(e=>R?e.byTabId[R]?.rect??null:null),xt=X._tag===`Success`?X.url:null,St=X._tag===`Success`?X.title:null,wt=C[0]?.url,Tt=d(e);(0,Z.useEffect)(()=>{xt&&St&&wt&&Te(x.current,xt,St,k)},[k,wt,St,xt,Tt]);let Et=(0,Z.useCallback)(async t=>{if(G&&q.current)return!Re&&(q.current.navigate(t),y(e,t),!0);if(R&&J)return await J.navigate(R,t),y(e,t),!0;let n=await Ke({openPreview:ee,threadRef:e,url:t});if(n._tag===`Failure`&&!M(n)){let e=N(n);e instanceof be&&I.add({type:`error`,title:`Unable to open browser`,description:e.message})}return n._tag===`Success`},[G,ee,R,Re,e]),Ot=(0,Z.useCallback)(async t=>{try{let n=Pe(t);await Et(n)&&Ee(e,n)}catch{}},[Et,e]),kt=(0,Z.useCallback)(async t=>{try{let n=G||!J?Ne(t):De(e.environmentId,t);await Et(n)&&Ee(e,t)}catch{}},[G,Et,e]),At=(0,Z.useCallback)(()=>{G?q.current?.reload():J&&R&&J.refresh(R)},[G,R]),jt=(0,Z.useCallback)(async t=>{if(!j)return;let n=await ae({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:j,...t}});if(n._tag===`Failure`){let e=N(n);I.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}l(e,n.value)},[ae,j,e]),Nt=W?.zoomFactor??1,Pt=(0,Z.useCallback)(e=>{let t=b.indexOf(Nt),n=e===0?1:b[Math.min(Math.max((t<0?7:t)+e,0),b.length-1)];n!==Nt&&jt({zoomFactor:n})},[jt,Nt]),Ft=(0,Z.useCallback)(()=>{K?Pt(1):J&&R&&J.zoomIn(R)},[R,K,Pt]),It=(0,Z.useCallback)(()=>{K?Pt(-1):J&&R&&J.zoomOut(R)},[R,K,Pt]),Lt=(0,Z.useCallback)(()=>{K?Pt(0):J&&R&&J.resetZoom(R)},[R,K,Pt]),Ht=(0,Z.useCallback)(async t=>{if(!j)return;let n=await ie({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:j,viewport:t}});if(n._tag===`Failure`){let e=N(n);throw I.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}l(e,n.value)},[ie,j,e]),Ut=()=>{if(R){if(gt._tag!==`fill`){Je(R,p).catch(()=>void 0);return}Je(R,Ae({defaults:_t,panelRect:bt,zoomFactor:K?Nt:Y?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(R)return Qe(R,Ht)},[Ht,R]);let Wt=(0,Z.useCallback)(()=>{G?q.current?.history(-1):J&&R&&J.goBack(R)},[G,R]),Gt=(0,Z.useCallback)(()=>{G?q.current?.history(1):J&&R&&J.goForward(R)},[G,R]),Kt=(0,Z.useCallback)(()=>{Bt&&Ye&&Bt.shell.openExternal(Ye).catch(()=>void 0)},[Ye]),qt=Ce(e.environmentId,ne,re,W),Jt=qt===`server`?`Open in ${te}'s browser`:`Open on this computer`,Yt=(0,Z.useCallback)(async()=>{if(!qt||!j||!W)return;let t=await Ke({openPreview:ee,threadRef:e,...Ye?{url:qt===`desktop`?De(e.environmentId,Ye):Ye}:{},viewport:gt,...W.profileId===void 0?{}:{profileId:W.profileId},runtime:qt});if(t._tag===`Failure`){if(M(t))return;let e=N(t);I.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}V.getState().openBrowser(e,t.value.tabId),await ot({closePreview:A,snapshot:W,tabId:j,threadRef:e})},[A,qt,ee,W,j,e,Ye,gt]),Xt=(0,Z.useCallback)(()=>{if(j){if(w===j){me.getState().close(e);return}me.getState().open(e,ge(j)),V.getState().close(e)}},[w,j,e]),Zt=e=>()=>{e&&R&&e(R).catch(()=>void 0)},Qt=K?{hardReload:()=>void jt({hardReload:!0}),setColorScheme:e=>void jt({colorScheme:e}),zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void jt({clear:`cookies`}),clearCache:()=>void jt({clear:`cache`}),...fe&&J?{openDevTools:Zt(J.openDevTools),toggleNativePictureInPicture:()=>$t()}:{}}:J?{hardReload:Zt(J.hardReload),setColorScheme:e=>{R&&J?.setColorScheme(R,e).catch(()=>void 0)},zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void J?.clearCookies(e.environmentId,vt).catch(()=>void 0),clearCache:()=>void J?.clearCache(e.environmentId,vt).catch(()=>void 0),openDevTools:Zt(J.openDevTools),toggleNativePictureInPicture:()=>$t()}:null,$t=(0,Z.useCallback)(()=>{J&&R&&(Y?.pictureInPicture?J.pictureInPicture.close:J.pictureInPicture.open)(R).catch(e=>{I.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[Y?.pictureInPicture,R]),en=(0,Z.useCallback)(t=>{if(!J||!R||!j)return;let n=J;if(U){We(U).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{I.update(r,H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i},secondaryActionVariant:`outline`}}))};r=I.add(H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){He(R,e,j).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Ue(e)||I.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(R).then(e=>{let t={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{I.update(a,H({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=I.add(H({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[U,R,j,e]),tn=(0,Z.useCallback)(()=>{if(!J||!R)return;if(_.current){_.current.cancelled=!0,J.cancelPickElement(R).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;_.current=n,m(!0),(async()=>{try{if(await J.setAnnotationSendEnabled?.(R,!!o&&z(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await J.pickElement(R);if(!t||n.cancelled)return;_.current===n&&(_.current=null,v.current&&m(!1),r=!0);let{annotation:i,submission:a,screenshotFailed:s=!1}=t,c=pt(i),l=s||c.status===`failed`,u=c.status===`failed`?{...i,screenshot:null}:i;E(e,u),l&&I.add(H({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=c.status===`captured`?c.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&D(e,f),a===`send`&&z(e.environmentId,`orchestration:operate`)&&o?.(u,f)}catch{}finally{let e=_.current===n;if(e&&(_.current=null,v.current&&m(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[D,E,o,R,e]);return(0,Z.useEffect)(()=>{u&&J&&R&&J.setAnnotationSendEnabled?.(R,h).catch(()=>void 0)},[h,u,R]),(0,Z.useEffect)(()=>()=>{_.current&&(_.current.cancelled=!0,_.current=null,J&&R&&J.cancelPickElement(R).catch(()=>void 0),v.current&&m(!1))},[R]),(0,Z.useEffect)(()=>{if(r)return dt(e=>{switch(e){case`refresh`:At();return;case`focus-url`:c(e=>(e??0)+1);return;case`zoom-in`:Ft();return;case`zoom-out`:It();return;case`reset-zoom`:Lt();return;case`toggle-panel`:return}})},[At,Lt,Ft,It,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":d(e),children:[(0,$.jsx)(ht,{url:Ye,loading:Xe||ft,canGoBack:et&&!Re,canGoForward:rt&&!Re,refreshDisabled:it||Re,inputDisabled:Re,focusUrlNonce:s,onBack:Wt,onForward:Gt,onRefresh:At,onSubmit:e=>void Ot(e),onOpenInBrowser:j?Kt:void 0,onCapture:J&&j&&!G?en:void 0,captureDisabled:!Y||ut,recording:U!==null,onPictureInPicture:j&&(G||J)?Xt:void 0,pictureInPicture:w===j,pictureInPictureDisabled:ut||!G&&!Y?.hasWebContents,onPickElement:J&&j&&!G?tn:void 0,pickActive:u,pickDisabled:!j||ut,pickDisabledReason:ut?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:vt===_t.profileId?null:(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(f,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:yt})}),(0,$.jsx)(P,{side:`top`,children:yt})]}),trailingActions:Qt?(0,$.jsx)(Dt,{enabled:R!==null&&(K||(Y?.hasWebContents??!1)),actions:Qt,...qt?{move:{label:Jt,onMove:()=>void Yt()}}:{},profileName:yt,zoomFactor:K?Nt:Y?.zoomFactor??1,colorScheme:K?W?.colorScheme??`system`:Y?.colorScheme??`system`,deviceToolbarVisible:gt._tag!==`fill`,onToggleDeviceToolbar:Ut,nativePictureInPicture:Y?.pictureInPicture??!1}):null}),(0,$.jsxs)(`div`,{ref:ve,className:`relative min-h-0 flex-1 overflow-hidden`,children:[R&&W&&G?(0,$.jsxs)($.Fragment,{children:[gt._tag!==`fill`&&!Q&&!ut?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(Ze,{setting:gt,width:ke,aspectRatio:pe?gt.width/gt.height:null,onAspectRatioChange:e=>_e(e!==null),onChange:e=>Je(R,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:gt._tag===`fill`?0:38},children:(0,$.jsx)(lt,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:W.tabId,visible:r,onFirstFrame:()=>Ge(R),onControl:e=>Le(e?.controller===`you`?R:null),onPopup:t=>nt(e,t,`panel`),className:T(`absolute inset-0 h-full w-full`,(Q||ut)&&`invisible`)},R)})]}):R&&W&&!Q?J?(0,$.jsx)(tt,{tabId:R,visible:r&&!ut,className:`absolute inset-0 h-full w-full`},R):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,Q?(0,$.jsx)(Ct,{threadRef:e,environmentId:e.environmentId,configuredUrls:n,recentEntries:C,onRemoveRecent:t=>Oe(e,t),onOpenUrl:e=>void kt(e)}):null,W&&Y?(0,$.jsx)(Rt,{zoomFactor:Y.zoomFactor}):null,R&&Y&&!Q&&!ut&&!g.has(R)?(0,$.jsx)(at,{tabId:R,zoomFactor:Y.zoomFactor,controller:mt}):null,X._tag===`LoadFailed`&&X.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Vt,{threadRef:e,tabId:W?.tabId??``,url:X.url,download:X.download})}):X._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Mt,{url:X.url,code:X.code,description:X.description,onReload:At,...qt===`server`?{move:{label:Jt,onMove:()=>void Yt()}}:{}})}):null]})]})}function Wt(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o,onSendAnnotation:s}=e,l=je(r.environmentId),u=de(r.environmentId,c);if(!u||!l){let e=u?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(U,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let d;t[5]===i?d=t[6]:(d=i===void 0?{}:{tabId:i},t[5]=i,t[6]=d);let f;t[7]===s?f=t[8]:(f=s?{onSendAnnotation:s}:{},t[7]=s,t[8]=f);let p;t[9]!==a||t[10]!==d||t[11]!==f||t[12]!==r||t[13]!==o?(p=(0,$.jsx)(Ut,{threadRef:r,...d,configuredUrls:a,visible:o,...f}),t[9]=a,t[10]=d,t[11]=f,t[12]=r,t[13]=o,t[14]=p):p=t[14];let m;return t[15]!==n||t[16]!==p?(m=(0,$.jsx)(U,{mode:n,children:p}),t[15]=n,t[16]=p,t[17]=m):m=t[17],m}export{Wt as PreviewPanel};
|
|
2
|
-
//# sourceMappingURL=PreviewPanel-QkMfuC1J.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Ax as t,Ht as ee,Jt as te,Kt as n,Nt as ne,Ss as re,Vt as ie,ha as r,jl as i,nn as ae}from"./utils-DmfMX1v5.js";import{a,c as o,o as s,s as c,t as l}from"./select-B4VvMEs2.js";import{t as oe}from"./useNavigate-4thj06GJ.js";import{i as se}from"./toast-CjelgyqV.js";import{E as ce,i as le}from"./useSettings-CLtJrOYI.js";import{t as ue}from"./server-BD_Y5Gsn.js";import{t as u}from"./pullRequestDetail.logic-DTxWqKoX.js";import{i as de}from"./p4ProjectFile-BWszgcDk.js";import{B as fe,F as d,L as pe,N as me,P as he,S as ge,a as f,n as _e,p as ve,r as p,s as ye}from"./settingsLayout-jP1a50ek.js";import{La as be,ir as m}from"./main-BB3F4O6Y.js";import{t as xe}from"./ProviderModelPicker-Bfpy_Rw1.js";import{n as Se,t as Ce}from"./runtimeModeConfig-DKj6PlUP.js";var we=t(),h=e(r(),1),Te=[`recursive`,`top-level`,`none`];function Ee(e){return e!==null&&Te.includes(e)}function De(e){let t=(0,we.c)(95),{category:r}=e,{scope:De,target:g,targets:Me,connectedEnvironments:Ne}=fe(),_=he(),v=pe(),Pe=oe(),{environments:y}=ce(),b,x,S,C,w;if(t[0]!==y||t[1]!==_||t[2]!==g){S=g?y.find(e=>e.environmentId===g.environmentId):void 0;let e=S?.serverConfig?.providers??ue;C=n(e,_.defaultModelSelection),b=te(ie(ee(e),_,g?.projectId??null)),x=ne(_,e,C?.instanceId,C?.model),w=b.find(e=>e.instanceId===C?.instanceId),t[0]=y,t[1]=_,t[2]=g,t[3]=b,t[4]=x,t[5]=S,t[6]=C,t[7]=w}else b=t[3],x=t[4],S=t[5],C=t[6],w=t[7];let T=w,E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=[`defaultModelSelection`],t[8]=E):E=t[8];let D=d(E),O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=[`defaultRuntimeMode`],t[9]=O):O=t[9];let k=d(O),Fe=Ce[_.defaultRuntimeMode].icon,A;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(A=[`defaultThreadEnvMode`],t[10]=A):A=t[10];let j=d(A),M;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(M=[`worktreeSubmodules`],t[11]=M):M=t[11];let N=d(M),P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=[`enableAgentBrowserAccess`],t[12]=P):P=t[12];let F=d(P),I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=[`defaultAutoPull`],t[13]=I):I=t[13];let L=d(I),R;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(R=[`removeAgentCreditsOnMerge`],t[14]=R):R=t[14];let z=d(R),B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`pullRequestMergeMethod`],t[15]=B):B=t[15];let Ie=d(B),V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`defaultModelSelection`],t[16]=V):V=t[16];let Le=me(V),H=De.kind===`project`||De.kind===`checkout`,U=Ne.length===0,Re;t[17]===g?Re=t[18]:(Re=g?de(g.settings,null,null,null).settings:null,t[17]=g,t[18]=Re);let ze=Re,Be;t[19]!==b||t[20]!==y||t[21]!==_||t[22]!==Me?(Be=function(e,t){let te=b.find(t=>t.instanceId===e);for(let n of Me){let re=y.find(e=>e.environmentId===n.environmentId),r=re?.serverConfig;if(!r)continue;let i=ie(ee(r.providers),n.settings,n.projectId).find(t=>t.instanceId===e),ae=ne(le(n.settings,_),r.providers).get(e);if(!i?.enabled||!i.isAvailable||i.driverKind!==te?.driverKind||!ae?.some(e=>e.slug===t&&!e.isUnavailable))return`This model is unavailable on ${re?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},t[19]=b,t[20]=y,t[21]=_,t[22]=Me,t[23]=Be):Be=t[23];let W=Be,Ve;t[24]!==W||t[25]!==v?(Ve=e=>{let t=e?W(e.instanceId,e.model):null;if(t){se.add({type:`error`,title:`Default model not saved`,description:t});return}v({defaultModelSelection:e})},t[24]=W,t[25]=v,t[26]=Ve):Ve=t[26];let G=Ve,He;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`defaultModelSelection`],t[27]=He):He=t[27];let Ue=H?`Model for new threads in this project.`:`Default model for new threads. Projects can override it.`,We=U||D||Le===`project`?void 0:_.defaultModelSelection===null?`Automatic`:void 0,K;t[28]!==G||t[29]!==_.defaultModelSelection?(K=_.defaultModelSelection===null?null:(0,h.jsx)(p,{label:`default model`,onClick:()=>G(null)}),t[28]=G,t[29]=_.defaultModelSelection,t[30]=K):K=t[30];let q;t[31]!==T||t[32]!==b||t[33]!==D||t[34]!==W||t[35]!==x||t[36]!==Pe||t[37]!==S||t[38]!==C||t[39]!==G||t[40]!==_.planModeEnabled?(q=C&&T?(0,h.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[(0,h.jsx)(xe,{environmentId:S?.environmentId??null,activeInstanceId:C.instanceId,model:C.model,lockedProvider:null,instanceEntries:b,modelOptionsByInstance:x,triggerClassName:_e,...D?{triggerLabel:`Mixed`}:{},getModelDisabledReason:W,onOpenProviderSetup:e=>{S&&Pe({to:`/settings/providers`,search:{environmentId:S.environmentId,instanceId:e}})},onInstanceModelChange:(e,t)=>G(re(e,t))}),D?null:(0,h.jsx)(ae,{provider:T.driverKind,models:T.models,model:C.model,prompt:``,onPromptChange:je,modelOptions:C.options??[],allowPromptInjectedEffort:!1,planModeEnabled:_.planModeEnabled,triggerClassName:_e,onModelOptionsChange:e=>G(re(C.instanceId,C.model,e))})]}):(0,h.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No providers available`}),t[31]=T,t[32]=b,t[33]=D,t[34]=W,t[35]=x,t[36]=Pe,t[37]=S,t[38]=C,t[39]=G,t[40]=_.planModeEnabled,t[41]=q):q=t[41];let Ge;t[42]!==D||t[43]!==Ue||t[44]!==We||t[45]!==K||t[46]!==q?(Ge=(0,h.jsx)(f,{serverScoped:!0,settingKeys:He,mixed:D,id:`default-model`,title:`Model`,description:Ue,status:We,resetAction:K,control:q}),t[42]=D,t[43]=Ue,t[44]=We,t[45]=K,t[46]=q,t[47]=Ge):Ge=t[47];let Ke=Ge,qe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(qe=[`defaultThreadEnvMode`],t[48]=qe):qe=t[48];let Je;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Je=m(`new-threads`),t[49]=Je):Je=t[49];let Ye=H?`Where new threads in this project start.`:`Where new threads start. Projects and their p4.json can override it.`,J;t[50]!==H||t[51]!==_.defaultThreadEnvMode||t[52]!==v?(J=!H&&_.defaultThreadEnvMode!==null?(0,h.jsx)(p,{label:`default workspace`,onClick:()=>v({defaultThreadEnvMode:null})}):null,t[50]=H,t[51]=_.defaultThreadEnvMode,t[52]=v,t[53]=J):J=t[53];let Xe=j?null:ze?.defaultThreadEnvMode??null,Y;t[54]===v?Y=t[55]:(Y=e=>{(e===`auto`||e===`local`||e===`worktree`)&&v({defaultThreadEnvMode:e})},t[54]=v,t[55]=Y);let X;t[56]===U?X=t[57]:(X=(0,h.jsx)(c,{size:`sm`,"aria-label":`Default workspace`,children:(0,h.jsx)(o,{children:e=>e===`auto`||e===`local`||e===`worktree`?ge(e):U?`Unavailable`:`Mixed`})}),t[56]=U,t[57]=X);let Ze;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,h.jsx)(a,{value:`auto`,children:ge(`auto`)}),t[58]=Ze):Ze=t[58];let Qe;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,h.jsx)(a,{value:`local`,children:ge(`local`)}),t[59]=Qe):Qe=t[59];let $e;t[60]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,h.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[Ze,Qe,(0,h.jsx)(a,{value:`worktree`,children:ge(`worktree`)})]}),t[60]=$e):$e=t[60];let Z;t[61]!==Xe||t[62]!==Y||t[63]!==X?(Z=(0,h.jsxs)(l,{value:Xe,onValueChange:Y,children:[X,$e]}),t[61]=Xe,t[62]=Y,t[63]=X,t[64]=Z):Z=t[64];let et;t[65]!==j||t[66]!==Ye||t[67]!==J||t[68]!==Z?(et=(0,h.jsx)(f,{serverScoped:!0,settingKeys:qe,mixed:j,id:Je.id,title:`Workspace`,description:Ye,resetAction:J,control:Z}),t[65]=j,t[66]=Ye,t[67]=J,t[68]=Z,t[69]=et):et=t[69];let tt=et,nt=r===`general`||r===`project`?`project-defaults`:r===`integrations`?`browser-access`:`source-control-defaults`,rt=r===`general`||r===`project`?`New threads`:r===`integrations`?`Browser`:`Repositories`,Q;t[70]!==Fe||t[71]!==r||t[72]!==ze?.worktreeSubmodules||t[73]!==H||t[74]!==z||t[75]!==L||t[76]!==F||t[77]!==Ie||t[78]!==k||t[79]!==N||t[80]!==Ke||t[81]!==_.defaultAutoPull||t[82]!==_.defaultRuntimeMode||t[83]!==_.enableAgentBrowserAccess||t[84]!==_.pullRequestMergeMethod||t[85]!==_.removeAgentCreditsOnMerge||t[86]!==_.worktreeSubmodules||t[87]!==U||t[88]!==v||t[89]!==tt?(Q=r===`project`?(0,h.jsxs)(h.Fragment,{children:[Ke,tt]}):r===`general`?(0,h.jsxs)(h.Fragment,{children:[Ke,(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`defaultRuntimeMode`],mixed:k,...m(`default-permissions`),description:H?`Permissions for new threads in this project.`:`Default permissions for new threads. Projects can override them.`,resetAction:_.defaultRuntimeMode===i.defaultRuntimeMode?null:(0,h.jsx)(p,{label:`default permissions`,onClick:()=>v({defaultRuntimeMode:i.defaultRuntimeMode})}),control:(0,h.jsxs)(l,{value:k?null:_.defaultRuntimeMode,onValueChange:e=>{e&&v({defaultRuntimeMode:e})},children:[(0,h.jsxs)(c,{size:`sm`,"aria-label":`Default permissions`,children:[!k&&(0,h.jsx)(Fe,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,h.jsx)(o,{children:k?`Mixed`:Ce[_.defaultRuntimeMode].label})]}),(0,h.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:Se.map(Ae)})]})}),tt,(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`worktreeSubmodules`],mixed:N,...m(`worktree-submodules`),description:H?`How new worktrees in this project populate git submodules.`:`How new worktrees populate git submodules. Projects and their p4.json can override it.`,resetAction:!H&&_.worktreeSubmodules!==null?(0,h.jsx)(p,{label:`worktree submodules`,onClick:()=>v({worktreeSubmodules:null})}):null,control:(0,h.jsxs)(l,{value:N?null:ze?.worktreeSubmodules??null,onValueChange:e=>{Ee(e)&&v({worktreeSubmodules:e})},children:[(0,h.jsx)(c,{size:`sm`,"aria-label":`Worktree submodules`,children:(0,h.jsx)(o,{children:e=>Ee(e)?ve[e]:U?`Unavailable`:`Mixed`})}),(0,h.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:Te.map(ke)})]})})]}):r===`source-control`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`defaultAutoPull`],mixed:L,id:`automatic-pull`,title:`Automatically pull`,description:H?`Keeps this project's default branch current when the checkout has no local changes or commits.`:`Keeps the default branch current when the checkout has no local changes or commits. Projects can override it.`,resetAction:_.defaultAutoPull?(0,h.jsx)(p,{label:`default automatic pull`,tooltip:`Reset automatic pull to off`,onClick:()=>v({defaultAutoPull:!1})}):null,control:(0,h.jsx)(be,{"aria-label":`Default automatic pull`,mixed:L,checked:!L&&_.defaultAutoPull,onCheckedChange:e=>v({defaultAutoPull:e})})}),(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`removeAgentCreditsOnMerge`],mixed:z,...m(`remove-agent-credits-on-merge`),description:`Remove recognized agent credit lines from GitHub merge and squash messages, keeping human co-authors. Includes auto-merge. Excludes merge queues, stack merges, and existing commits.`,resetAction:_.removeAgentCreditsOnMerge?(0,h.jsx)(p,{label:`agent credit removal`,tooltip:`Keep agent credits`,onClick:()=>v({removeAgentCreditsOnMerge:!1})}):null,control:(0,h.jsx)(be,{"aria-label":`Remove agent credits when merging`,mixed:z,checked:!z&&_.removeAgentCreditsOnMerge,onCheckedChange:e=>v({removeAgentCreditsOnMerge:e})})}),(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`pullRequestMergeMethod`],mixed:Ie,...m(`pull-request-merge-method`),description:H?`Pull requests in this project start with this method.`:`Pull requests start with this method. Last selected reuses whatever you chose most recently on this device.`,resetAction:_.pullRequestMergeMethod===null?null:(0,h.jsx)(p,{label:`default merge method`,tooltip:`Reset to last selected`,onClick:()=>v({pullRequestMergeMethod:null})}),control:(0,h.jsxs)(l,{value:Ie?null:_.pullRequestMergeMethod??`last`,onValueChange:e=>{e===`last`?v({pullRequestMergeMethod:null}):(e===`merge`||e===`squash`||e===`rebase`)&&v({pullRequestMergeMethod:e})},children:[(0,h.jsx)(c,{size:`sm`,"aria-label":`Default pull request merge method`,children:(0,h.jsx)(o,{children:Oe})}),(0,h.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[(0,h.jsx)(a,{value:`last`,children:`Last selected`}),(0,h.jsx)(a,{value:`merge`,children:u.merge}),(0,h.jsx)(a,{value:`squash`,children:u.squash}),(0,h.jsx)(a,{value:`rebase`,children:u.rebase})]})]})})]}):(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(f,{serverScoped:!0,settingKeys:[`enableAgentBrowserAccess`],mixed:F,id:m(`agent-browser-access`).id,title:`Agent browser access`,description:H?`Allow agents in this project to use the shared browser. Applies when the agent session next starts.`:`Allow agents to use the shared browser. Projects can override it.`,resetAction:_.enableAgentBrowserAccess===i.enableAgentBrowserAccess?null:(0,h.jsx)(p,{label:`default browser access`,onClick:()=>v({enableAgentBrowserAccess:i.enableAgentBrowserAccess})}),control:(0,h.jsx)(be,{"aria-label":`Agent browser access`,mixed:F,checked:!F&&_.enableAgentBrowserAccess,onCheckedChange:e=>v({enableAgentBrowserAccess:e})})})}),t[70]=Fe,t[71]=r,t[72]=ze?.worktreeSubmodules,t[73]=H,t[74]=z,t[75]=L,t[76]=F,t[77]=Ie,t[78]=k,t[79]=N,t[80]=Ke,t[81]=_.defaultAutoPull,t[82]=_.defaultRuntimeMode,t[83]=_.enableAgentBrowserAccess,t[84]=_.pullRequestMergeMethod,t[85]=_.removeAgentCreditsOnMerge,t[86]=_.worktreeSubmodules,t[87]=U,t[88]=v,t[89]=tt,t[90]=Q):Q=t[90];let $;return t[91]!==nt||t[92]!==rt||t[93]!==Q?($=(0,h.jsx)(ye,{id:nt,title:rt,children:Q}),t[91]=nt,t[92]=rt,t[93]=Q,t[94]=$):$=t[94],$}function Oe(e){return e===`merge`||e===`squash`||e===`rebase`?u[e]:e===`last`?`Last selected`:`Mixed`}function ke(e){return(0,h.jsx)(a,{value:e,children:ve[e]},e)}function Ae(e){let t=Ce[e],ee=t.icon;return(0,h.jsx)(a,{value:e,className:`min-w-64`,children:(0,h.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,h.jsx)(ee,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,h.jsx)(`span`,{className:`text-xs leading-4 text-muted-foreground`,children:t.description})]})},e)}function je(){}export{De as t};
|
|
2
|
-
//# sourceMappingURL=ProjectDefaultsSettings-C6wxaRmJ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Ax as t,ha as n}from"./utils-DmfMX1v5.js";import{F as r}from"./settingsLayout-jP1a50ek.js";import{La as i}from"./main-BB3F4O6Y.js";var a=t(),o=e(n(),1);function s(e){let t=(0,a.c)(8),n,s,c;t[0]===e?(n=t[1],s=t[2],c=t[3]):({settingKeys:c,checked:n,...s}=e,t[0]=e,t[1]=n,t[2]=s,t[3]=c);let l=r(c),u=!l&&n,d;return t[4]!==l||t[5]!==s||t[6]!==u?(d=(0,o.jsx)(i,{...s,mixed:l,checked:u}),t[4]=l,t[5]=s,t[6]=u,t[7]=d):d=t[7],d}export{s as t};
|
|
2
|
-
//# sourceMappingURL=ScopedSwitch-DsEcG6rk.js.map
|