@p4code/cli 0.8.24 → 0.8.25
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/bin.mjs +1 -1
- package/dist/{binCli-DNod5652.mjs → binCli-DxnOvHXE.mjs} +610 -480
- package/dist/client/.vite/manifest.json +1316 -1316
- package/dist/client/assets/{AuthSurfaceShell-Wwq6fM9A.js → AuthSurfaceShell-CDrUzEa3.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-8lmdyDiG.js → ChatGptUsageButton-DkUVOC7j.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-Cd3yE4VU.js → ChatMarkdown-1bLgD-eb.js} +4 -4
- package/dist/client/assets/{CodexSetupSection.logic-oYzzgIWo.js → CodexSetupSection.logic-BGYo_Oa-.js} +2 -2
- package/dist/client/assets/{CommandBlock-ByCjpPww.js → CommandBlock-C1v99dbA.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-4EkkS1N5.js → ComposerPromptEditor-C462LHSn.js} +4 -4
- package/dist/client/assets/{DevicePanel-DWlHQcLW.js → DevicePanel-DoPmTqL7.js} +2 -2
- package/dist/client/assets/{DeviceSetup-Dm9ZbkMC.js → DeviceSetup-D1v4OInd.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-Dx-VhoLU.js → DiffCommentAnnotation-ByLSJGCC.js} +2 -2
- package/dist/client/assets/{DiffFileTree-BgjyfH71.js → DiffFileTree-DmXODV6-.js} +2 -2
- package/dist/client/assets/{DiffPanel-tZN29mdM.js → DiffPanel-DKvM9n17.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-C_yNvh6o.js → DiffWorkerPoolProvider-31z0fGQ6.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-DDApp-WI.js → EmbeddedDesign-CJh4mXjr.js} +2 -2
- package/dist/client/assets/{FileDiff-B_422yEN.js → FileDiff-Cb7Q8DoF.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-B26lXYsA.js → FilePreviewPanel-CN68pCae.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-TLqDB_1b.js → FoldedSettingsSection-TSMWCMo5.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-Bx1X9Us-.js → NoProjectsHero-B5wdlXLT.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-BWvaLOY-.js → P4ConnectAccountPages-BNv1XOMs.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-C8z-Gfq5.js → P4ConnectSidebarSignIn-BqW3vURC.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-C2deQDB2.js → PanelLayoutControls-CJ69MZ4v.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-Ddl-VPd4.js → PierreEntryIcon-BS77_eRn.js} +2 -2
- package/dist/client/assets/{PreviewPanel-8NDLwOfI.js → PreviewPanel-pImDpkWH.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-DN1GxlYC.js → ProjectDefaultsSettings-DY_6-1vn.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-BDaMxno-.js → ProjectFavicon-Bhsql8UU.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-Be5IQyyr.js → ProjectIconPickerDialog-D1bu7Uyx.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-BFGd236-.js → ProviderAuthTerminal-BRbiaLWc.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DMtMvBKn.js → ProviderModelPicker-DqLbhWdo.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-D6u9dY73.js → ProviderSettingsForm-DLBbky90.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-hXtKZAP9.js → PullRequestCodeTab-CKppy0OY.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-CDLZaWo2.js → ReadOnlySourcePreview-BJ6Yf9Nm.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BkcvpgEh.js → RenderErrorBoundary-DQlXjNRV.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-BJyFxVyR.js → ScheduledTasksSettings-DY0ICix9.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-yznbaSh9.js → ScopedSwitch-Ciu5HpYa.js} +2 -2
- package/dist/client/assets/{SettingsPanels-DdhZ2nXb.js → SettingsPanels-D8LJq_2u.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-DIuWE5Xf.js → SettingsPanels.logic-Dn4swS42.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-D8K81IzP.js → SettingsScopeNotice-FZ1p4m0I.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-ePX4nwaV.js → ThemeEditorPanel-CyGAzSmS.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-5z4y3z0y.js → ThreadTerminalDrawer-COPVkKqd.js} +2 -2
- package/dist/client/assets/{Virtualizer-DEM6HN7-.js → Virtualizer-Cy8TBFLE.js} +2 -2
- package/dist/client/assets/{_chat-C0vR23gu.js → _chat-CWIHenSN.js} +6 -6
- package/dist/client/assets/{_chat.design-CQ52N70I.js → _chat.design-CmJbkQbO.js} +2 -2
- package/dist/client/assets/{_chat.index-SFAYIX_P.js → _chat.index-6PXQMCFp.js} +2 -2
- package/dist/client/assets/{_chat.new-BO6oEisx.js → _chat.new-DlduiMxM.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-BfyCJw7Q.js → _chat.pull-requests-BVZO85Vs.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-DhiN6SMz.js → abnfDiagram-VCTEODGH-DoT8_FXH.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-ZioZXeD8.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-bs37U5FM.js → architectureDiagram-5GKGNRK7-HFFuwzkK.js} +2 -2
- package/dist/client/assets/{assets-BU-ex_t8.js → assets-v9gHTSJ2.js} +2 -2
- package/dist/client/assets/{blockDiagram-I7D4REHJ-Bz9mN89n.js → blockDiagram-I7D4REHJ-Df3TzjDM.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-KDG9Uz1t.js → browserHistoryStore-DY3kofkL.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-DmKK3HY0.js → browserLinkTarget-BHJMZNAn.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-CtkHQd_E.js → c4Diagram-7LVT6UL2-Bx6hu1pT.js} +2 -2
- package/dist/client/assets/channel-BY4Mhil-.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-BtUnQAH6.js → chunk-4HAMMTFA-DztP-PZY.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-CwSe19lZ.js → chunk-75Z2AOVW-uoFI_96z.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-Bwy7A0TF.js → chunk-DU6HZSFF-D_0nd_m5.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-CVsi2uk3.js → chunk-F27PBJKO-CVo5wWUL.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CVzXn5Hv.js → chunk-GMAD6QVW-DVJraU0z.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-7pPJVhuz.js → chunk-GVQU2GXP-D1KDAS1u.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-D-dmx49n.js → chunk-IMKFNOWR-B4iQ5Hh8.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-DEJnMXSk.js → chunk-L3NEJ4N5-Cg0GbrIO.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-CBtNmbZ8.js → chunk-OSK3NFVY-B4_CzVzL.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-TNHN3Sve.js → chunk-P2QGCYS3-DZOYqNgv.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-1cq1nl-Z.js → chunk-POPQ4Y6H-4nivFn8h.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-B85KpsBk.js → chunk-PWAF6VOD-HbLsvJ11.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-3tA2UDk1.js → chunk-SHT3W25Y-DFCZ-Krf.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-CHzBNDDY.js → chunk-SVP7TREG-BvQW-XJf.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-MeLbkhnz.js → chunk-TICWLB2K-BkfJ58tX.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-VEcRygcq.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-VEcRygcq.js +2 -0
- package/dist/client/assets/{composer-logic-DyIi6K9e.js → composer-logic-CwhwgR76.js} +2 -2
- package/dist/client/assets/{composerDraftUploads-BEFyD-t4.js → composerDraftUploads-DmqvTkwP.js} +2 -2
- package/dist/client/assets/{connect-BUAMGrjt.js → connect-DwVFJmN3.js} +2 -2
- package/dist/client/assets/{connect-agent-BNwEsc4t.js → connect-agent-DEQZN1JX.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-DTUXnTov.js → cynefin-OW5HDTMX-4JOEXKIi.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Cd9_EwZX.js → cynefinDiagram-5FMLGOSQ-Drs4oZCg.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-D0hUgab8.js → dagre-GXQ25YYZ-DKMbY0zs.js} +2 -2
- package/dist/client/assets/{design-DaqMSnWJ.js → design-CNu64Zbr.js} +2 -2
- package/dist/client/assets/{device-DnfWBPpo.js → device-BLFqXUPD.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-DY-wIVhL.js → diagram-S7CK7UJ4-BadxuMFL.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-CmWAx8wR.js → diagram-UQ7AKVKN-PnCAv0MQ.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-DvIYORJP.js → diagram-VSXAHHWV-Cny8HiZ9.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-Dj3l0KCm.js → diagram-VX7I27RA-CRUGb_uz.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-ClP8dtWB.js → diagram-Z3DM3KII-3me_mb7C.js} +2 -2
- package/dist/client/assets/{diffRendering-BWY0g219.js → diffRendering-D5-wCc8J.js} +2 -2
- package/dist/client/assets/{dist-C5JAYxip.js → dist-DJO3gX7B.js} +2 -2
- package/dist/client/assets/{duoViewer-fztyITHM.js → duoViewer-DLfl5Kz-.js} +2 -2
- package/dist/client/assets/{dynamic-CnYAeR9T.js → dynamic-BtC962Ss.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-DtbBVfJO.js → ebnfDiagram-PWID7BFC-CihgSPXH.js} +2 -2
- package/dist/client/assets/{embeddedScripts-Bf2j7tmA.js → embeddedScripts-BYDwhk1c.js} +2 -2
- package/dist/client/assets/{entities-BJgMc8pv.js → entities-BmcX1OB3.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-Dm2mBAGp.js → erDiagram-RLTQ6QDP-F6qh1mx2.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-CFX4D-ej.js +1 -0
- package/dist/client/assets/{fileLinks-C9oYzhXv.js → fileLinks-D6tZCcrX.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-CpkONCrM.js → fileTreeExpansion-XMXwSF13.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-fTwgLjbL.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-D4UHegQH.js → ganttDiagram-EL5Y4UJY-YGfup7SG.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-BKRfCrth.js → getDiffFileInput-CaAoEF2q.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-BUhEDO22.js → gitGraph-4MIJSDKK-lmNva9e6.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BwJT0OjN.js → gitGraphDiagram-WWUBYQGX-doYkHAhC.js} +2 -2
- package/dist/client/assets/{guideRunStore-DkBR0CPU.js → guideRunStore-DgsITXCn.js} +2 -2
- package/dist/client/assets/{index-BYQ1ybfT.js → index-CfFLhAIJ.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-scwAD75p.js → info-A6RAGUB7-D_A6DQid.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-BgR5Wn6l.js → infoDiagram-27XIBGKW-BRwXCKSf.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BOnOvOet.js → ishikawaDiagram-5VMMS53U-C7LnJqXH.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-B1wXWe62.js → journeyDiagram-3NMN7TZE-BzOGENTa.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-DI-FwQ_D.js → kanban-definition-UXKFOSKX-COHFjuBb.js} +2 -2
- package/dist/client/assets/{line-c6BqGnEH.js → line-CrPHt5m8.js} +2 -2
- package/dist/client/assets/{linkedPrompt-DjSidfRe.js → linkedPrompt-DcngDDYL.js} +2 -2
- package/dist/client/assets/{main-4dRVuXx2.js → main-DTxzRLjF.js} +7 -7
- package/dist/client/assets/{mediaReference-CWzBBNFa.js → mediaReference-DZXLlXcJ.js} +2 -2
- package/dist/client/assets/{mediaSource-CHfRwmOf.js → mediaSource-gPZdDlVt.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-DOOH_cP_.js → mermaid-parser.core-DWtiDQYU.js} +4 -4
- package/dist/client/assets/{mermaid.core-9Tao6ZdD.js → mermaid.core-BFUbfTlG.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-CqmRXnVH.js → mindmap-definition-YA3MSWOX-DBtRzghf.js} +2 -2
- package/dist/client/assets/{onboarding-BmDFkmWD.js → onboarding-DrdqSiQH.js} +2 -2
- package/dist/client/assets/{openFileInPreview-DF_vZEIK.js → openFileInPreview-weURIMTS.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-YfIRB1xP.js → p4ProjectFile-B8OhdeMF.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-B8LkZ5j3.js → packet-AYTQ26CC-DJZVK2K9.js} +1 -1
- package/dist/client/assets/{pair-DSE8uuft.js → pair-gR_rTadh.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-CS17GwTP.js → pegDiagram-XKGWAZYB-DDF_R7aG.js} +2 -2
- package/dist/client/assets/{phoneViewer-CYzqv5af.js → phoneViewer-DxQG2wwP.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-B0WBcNHW.js → pie-WAS4IAKB-DdceO1sC.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-Bk2IwUHp.js → pieDiagram-E7YTZNPT-BW2s3CyE.js} +2 -2
- package/dist/client/assets/{pierre-icons-CY4HbMoq.js → pierre-icons-CFlecESq.js} +2 -2
- package/dist/client/assets/{preview-B5v36DP8.js → preview-Dz5JGjMV.js} +2 -2
- package/dist/client/assets/{primary-BKQnuXrW.js → primary-CREvWUGh.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-CJSCsrUH.js → primaryCloudLinkState-C-mUT5JX.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DltGYM_H.js → projectFilesQueryState-Au75qUTL.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-CZb_iNq3.js → projectScriptEditor-4NhfCuq1.js} +2 -2
- package/dist/client/assets/{providerSkills-Ct4SZ-mY.js → providerSkills-BmzuNl-9.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-COstpMB1.js → pullRequestDetail.logic-yPUei2ak.js} +2 -2
- package/dist/client/assets/{pullRequests-ClG7PJe0.js → pullRequests-BBLgbQTu.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B0vWHjBG.js → quadrantDiagram-AXDQQJYC-Bf2672qf.js} +2 -2
- package/dist/client/assets/{queries-BWcz-n4a.js → queries-BJzayyNh.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-DmYBXYPt.js → radar-RG4KPBEZ-BiG5ioV7.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-D-4grcyc.js → railroad-74A4TZTK-DiRzkVRF.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CyBZRJjf.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-7jpgdtqn.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-Bhvv4cdb.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-C7n4Qist.js → railroadDiagram-O6MQD6OU-BschbLXV.js} +2 -2
- package/dist/client/assets/{renderScheduler-DrstEe4y.js → renderScheduler-BgjQdysj.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-BYX3uen6.js → requirementDiagram-BXWQKSXE-DIHx2XKp.js} +2 -2
- package/dist/client/assets/{runtime-Cj24N7je.js → runtime-DPOrcghx.js} +3 -3
- package/dist/client/assets/{runtime-CArTL2GH.js → runtime-SBjACoAG.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-tAgp-_Ny.js → sankeyDiagram-P5KCCOFB-B37UMb9Z.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-zleH3iJ_.js → scheduledTasksSettings.logic-l7uZVAyW.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-DlvnWAh_.js → sequenceDiagram-WJ2MYXX4-BWWC8joI.js} +2 -2
- package/dist/client/assets/{server-Vynm5NwP.js → server-BNs54wEo.js} +2 -2
- package/dist/client/assets/{session-DyiiEN5g.js → session-CFXzhAhI.js} +2 -2
- package/dist/client/assets/{session-logic-B8t9Dfk3.js → session-logic-Zk8ix8K9.js} +2 -2
- package/dist/client/assets/{settings-CjeBlT1I.js → settings-D8GZZ79P.js} +2 -2
- package/dist/client/assets/{settings.appearance-DUvYlE0y.js → settings.appearance-BGApKe_v.js} +2 -2
- package/dist/client/assets/settings.archived-QGKwBjUx.js +2 -0
- package/dist/client/assets/{settings.computer-use-S7DPGiAx.js → settings.computer-use-CeLystec.js} +2 -2
- package/dist/client/assets/{settings.connections-DJEqNVad.js → settings.connections-56mhuPd9.js} +2 -2
- package/dist/client/assets/{settings.data-controls-Bj1pQ5cL.js → settings.data-controls-D607JRzk.js} +2 -2
- package/dist/client/assets/{settings.decisions-BufUBcem.js → settings.decisions-C0aFb-Kn.js} +2 -2
- package/dist/client/assets/{settings.designs-bWCNQca4.js → settings.designs-DLcNkfmF.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-Dx_NdxOm.js → settings.diagnostics-Bk9ZlqSV.js} +2 -2
- package/dist/client/assets/{settings.general-BQ6775Hi.js → settings.general-D8pNduE9.js} +2 -2
- package/dist/client/assets/{settings.integrations-CgxBXw6p.js → settings.integrations-CyPCeqvd.js} +2 -2
- package/dist/client/assets/{settings.keybindings-DrBH8mlK.js → settings.keybindings-B6cKpR8G.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-B3CGE-JI.js → settings.open-source-licenses-Cdo94wbK.js} +2 -2
- package/dist/client/assets/{settings.plugins-BGUgmDOY.js → settings.plugins-B1SQQuJ1.js} +2 -2
- package/dist/client/assets/{settings.projects-BJ1cpGGM.js → settings.projects-HuCRzR1Z.js} +3 -3
- package/dist/client/assets/{settings.providers-D2I5mNzk.js → settings.providers-BsfVxPA5.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-D8hRaqp8.js → settings.scheduled-tasks-Chug6jlO.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-C2X5_E0H.js → settings.snap-shot-Dvf_zwkG.js} +2 -2
- package/dist/client/assets/{settings.source-control-Dvac_5mZ.js → settings.source-control-twI2L8vl.js} +2 -2
- package/dist/client/assets/{settings.storage-1JdpL3lo.js → settings.storage-af4E8nEQ.js} +2 -2
- package/dist/client/assets/{settingsLayout-CuUCC6iL.js → settingsLayout-BloLque1.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-r5ezKRMx.js → sidebarProjectGrouping-DwnHgZqz.js} +2 -2
- package/dist/client/assets/{sourceControl-b1QZpCro.js → sourceControl-wI790oDs.js} +2 -2
- package/dist/client/assets/{sourceControlClients-DUvOeR-2.js → sourceControlClients-CKlG76Mu.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-BOgNCEU1.js → stateDiagram-D77RDMKH-D8v7Nh9y.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DymT6Xtk.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-BZG7hJb7.js → swimlanes-42K2YHIH-8aPT3vMS.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CjvsefHc.js +9 -0
- package/dist/client/assets/{terminalSessions-BHzkH7av.js → terminalSessions-BVJWTQ-r.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-B5YiUA25.js → timeline-definition-24CTP7MA-qKze8CmD.js} +2 -2
- package/dist/client/assets/{toast-B3hjhWRf.js → toast-CfeQA1vM.js} +2 -2
- package/dist/client/assets/{treeView-Q6P3EWNA-Cb4H3xoG.js → treeView-Q6P3EWNA-DHv3H0LY.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-BdpTgSX1.js → treemap-WGGIJYW6-B3OEzWME.js} +1 -1
- package/dist/client/assets/{uiStateStore-DoJ0IbwQ.js → uiStateStore-DBCETYy3.js} +2 -2
- package/dist/client/assets/{usage-C2lJ6qWL.js → usage-C4KIRe38.js} +2 -2
- package/dist/client/assets/{use-atom-command-D34CFqu3.js → use-atom-command-BCNOgemk.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-DtUtwJAY.js → useHandleNewThread-B116cHue.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-D4kHnZ3Q.js → useP4ConnectAuthPrompt-qVqxcT08.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BypvA9CK.js → usePullRequestActions-CdOseawP.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-YXOv7_8D.js → useScopedModelAvailability-DL2tq_KI.js} +2 -2
- package/dist/client/assets/{useSettings-BcmuuiTp.js → useSettings-DkjziVJm.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-hPKz3TmL.js → vcsRefInvalidation-BPBh7p3I.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-D4zvlwrY.js → vennDiagram-4TSXK5OY-Yh5vCDok.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-Cscy0eBS.js → wardley-WFR3VGLG-BeDK7hdA.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-od5X9Ppf.js → wardleyDiagram-VM6X3IG4-BXdOv1zU.js} +2 -2
- package/dist/client/assets/{welcome-7UQgfS5x.js → welcome-wbx9XdLq.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-KWfWaW4I.js → xychartDiagram-S5SC5T6Z-mciO_D_V.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-Yd6b7qRF.js +0 -1
- package/dist/client/assets/channel-DrCQqhMU.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-MCjIu9oU.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-MCjIu9oU.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-rDo_pcJr.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-C55XBPww.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-6H_zYY6R.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-DYahAqN_.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-CdcgHAXA.js +0 -1
- package/dist/client/assets/settings.archived-B5WGVqfk.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-D00LPIWv.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-vkEAWikD.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{RE as t,mE as n}from"./utils-hgbJ2TVM.js";import{i as r}from"./main-
|
|
2
|
-
//# sourceMappingURL=settings.scheduled-tasks-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{RE as t,mE as n}from"./utils-hgbJ2TVM.js";import{i as r}from"./main-DTxzRLjF.js";import{t as i}from"./ScheduledTasksSettings-DY0ICix9.js";var a=t(),o=e(n());function s(){let e=(0,a.c)(2),t=r.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(i,{...t}),e[0]=t,e[1]=n),n}export{s as component};
|
|
2
|
+
//# sourceMappingURL=settings.scheduled-tasks-Chug6jlO.js.map
|
package/dist/client/assets/{settings.snap-shot-C2X5_E0H.js → settings.snap-shot-Dvf_zwkG.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,Ic as i,Ip as a,Mh as o,Nh as s,RE as c,Sh as l,Zn as u,cr as d,er as f,jc as p,lr as m,mE as h,qn as g,r as _,tr as v}from"./utils-hgbJ2TVM.js";import{n as y}from"./select-Bsag72zE.js";import{i as b,p as x}from"./toast-B3hjhWRf.js";import{K as S,s as C,v as w}from"./useSettings-BcmuuiTp.js";import{s as T}from"./server-Vynm5NwP.js";import{f as E,l as D}from"./diffRendering-BWY0g219.js";import{t as O}from"./FileDiff-B_422yEN.js";import{r as k,t as A}from"./dialog-Cgb4jap2.js";import{i as j,r as M,v as N}from"./keybindings-CqjUKNRx.js";import{b as P,y as F}from"./Icons-C0Zjws-3.js";import{n as I,t as L}from"./kbd-B2uytHus.js";import{a as R,c as z,i as B,s as V}from"./settingsLayout-CuUCC6iL.js";import{a as ee,d as H,l as U}from"./KeybindingsSettings.logic-D-GClV-c.js";import{Ht as W,Pt as te,aa as ne,ca as re,h as ie,la as G,m as ae,oa as oe,p as se,pa as ce,sa as K,tr as q}from"./main-4dRVuXx2.js";import{n as le,r as J,t as ue}from"./usePermissionStatus-SyBwmFSK.js";var Y=e(t(),1),X=c(),de={return:`enter`,page_up:`pageup`,page_down:`pagedown`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,plus:`+`,minus:`-`};function fe(e){let t=e.trim().replace(/^Press\s+/i,``);if(!t)return null;let n=t.match(/^((?:<[^<>]+>)+)([^<>]+)$/),r=(n?n[1].replace(/<([^<>]+)>/g,`$1+`)+n[2]:t).replace(/\b(super|win|primary)\b/gi,e=>e.toLowerCase()===`primary`?`ctrl`:`meta`);if(r!==`+`&&r.endsWith(`+`)&&!r.endsWith(`++`))return null;let a=i(r);if(!a)return null;let o=de[a.key]??a.key;return o!==` `&&!/^[^\s<>]$/u.test(o)&&!/^(?:f(?:[1-9]|1\d|2[0-4])|enter|tab|escape|backspace|delete|insert|home|end|pageup|pagedown|arrow(?:left|right|up|down)|pause|printscreen)$/i.test(o)?null:{...a,key:o}}function pe(e,t=navigator.platform){return l(e)?o(s(e),p(t)):j(e,t)}function me(e,t){return e===`shift`?`⇧`:p(t)?e===`meta`?`⌘`:e===`control`?`⌃`:`⌥`:e===`meta`?_(t)?`⊞`:`Super`:e===`control`?`Ctrl`:`Alt`}function he(e,t=navigator.platform){if(l(e)){let n=me(s(e),t);return[n,n]}let n=p(t);return[...[[e.ctrlKey||e.modKey&&!n,`control`],[e.altKey,`alt`],[e.shiftKey,`shift`],[e.metaKey||e.modKey&&n,`meta`]].filter(([e])=>e).map(([,e])=>me(e,t)),M(e.key)]}function ge(e,t,n=navigator.platform){return l(e)||l(t)?l(e)&&l(t)&&s(e)===s(t):N(e,n)===N(t,n)}function _e(e,t,n=navigator.platform){if(l(e))return null;let r=N(e,n);return t.find(e=>N(e.shortcut,n)===r)?.command??null}function ve(e){if(e.mode===`portal`)switch(e.linuxDesktop??Z(e)){case`gnome`:return`GNOME`;case`kde`:return`KDE Plasma`;case`niri`:return`Niri`;case`hyprland`:return`Hyprland`;default:return}}function Z(e){return e.mode===`portal`?e.linuxBackend===`niri`?`niri`:e.linuxBackend===`kde`?`kde`:e.linuxBackend===`hyprland`?`hyprland`:e.linuxBackend===`screenshot-portal`?`portal`:e.linuxBackend===`picker`&&e.gnomeExtension?.status===`unsupported`?`picker`:e.linuxBackend===`gnome-extension`||e.gnomeExtension?`gnome`:`picker`:`direct`}function Q(e){return e.mode===`unavailable`||e.message?!1:Z(e)===`gnome`?e.gnomeExtension?.status===`enabled`&&e.linuxBackend===`gnome-extension`:Z(e)===`kde`?e.kdeHelper?.status===`ready`:Z(e)!==`hyprland`||e.hyprlandHelper?.status===`ready`}function ye(e,t){let n=e.macPermissions;return!n||n.screenRecording&&(!t||n.accessibility)}function be(e){let t=Z(e),n=t===`gnome`;return e.message||n&&e.gnomeExtension?.status===`error`||t===`kde`&&e.kdeHelper?.status===`error`||t===`hyprland`&&e.hyprlandHelper?.status===`error`?`Still unable to check access. See Advanced for help.`:Z(e)===`picker`?`Ready. You'll choose a window each time.`:n&&e.gnomeExtension?.status===`restart-required`?`Still waiting for you to sign out and back in.`:Q(e)?`Ready. Continue to choose your shortcut.`:`Not ready yet. Finish the step above.`}function xe(e,t){return t||!Q(e)?!1:e.linuxBackend===`hyprland`?!!e.shortcutActionRegistered:e.linuxBackend===`niri`?!!e.shortcutBinding:e.shortcutRegistered||!!e.shortcutPending}function Se(e,t=`resume`){return Q(e)?t===`resume`?e.mode===`direct`&&!e.shortcutRegistered||Z(e)===`picker`?`access`:`shortcut`:t:`access`}function Ce(e,t){return!e&&!t}function we(e,t){return e?e.mode===`unavailable`?e.message??`Not supported on this platform.`:t?Te(e,t):`Turn this on to set up snapshots.`:`Checking snapshots…`}function Te(e,t){return e.message?`Capture needs attention`:e.linuxBackend===`hyprland`&&e.hyprlandHelper?.status!==`ready`?e.hyprlandHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:Z(e)===`gnome`&&e.gnomeExtension?.status!==`enabled`?`Set up active-window snapshots`:Z(e)===`kde`&&e.kdeHelper?.status!==`ready`?e.kdeHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:Z(e)===`picker`?`Manual capture only — you'll choose a window each time`:t?e.shortcutPending?e.linuxBackend===`hyprland`?`Connecting your shortcut…`:`Waiting for shortcut permission`:e.shortcutVerified?`Ready to capture`:e.linuxBackend===`niri`&&e.shortcutBinding||e.linuxBackend===`hyprland`&&e.shortcutActionRegistered?`Use your shortcut from another app`:e.shortcutRegistered?e.shortcutLabel?`Ready to capture`:`Shortcut saved`:`Finish shortcut setup`:`Enable capture to continue`}function Ee(e){return e?e.linuxBackend===`hyprland`?e.shortcutMessage:e.shortcutPending?`Approve the shortcut permission prompt to continue.`:e.shortcutRegistered?e.mode===`portal`?null:`Shortcut saved.`:e.shortcutMessage:null}function De(e){if(!e)return`Continue setup`;if(Q(e))return`Manage capture`;let t=ve(e);return t?`Set up ${t} capture`:`Continue setup`}function Oe(e,t){return e?.windows?!0:e?.macPermissions!==void 0&&Q(e)&&ye(e,t)&&e.shortcutRegistered}function ke(e){if(!(e?.mode!==`portal`||e.linuxFeedbackAvailable))return e.linuxBackend===`hyprland`?e.hyprlandHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`niri`?`Capture effects aren't available on Niri.`:e.linuxBackend===`kde`?e.kdeHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`gnome-extension`?`Update the GNOME extension, then sign out and back in to enable effects.`:Z(e)===`gnome`?`Finish extension setup to enable effects.`:`Capture effects aren't available on this desktop.`}function Ae(e){return e?.mode===`portal`&&Z(e)===`picker`?`Automatic capture isn't available here. Choose a window instead.`:`Capture a window and attach it to your current draft.`}function je(e){if(e?.mode===`portal`&&(e.linuxBackend===`picker`||e.linuxBackend===`screenshot-portal`))return`This desktop only provides a screenshot.`}function Me(e){if(!e)return typeof window<`u`&&window.desktopBridge?`Update the desktop app to use snapshots.`:`Only available in the desktop app.`}function Ne(e){return e===`off`?{snapShotPlaySound:!1}:{snapShotPlaySound:!0,snapShotSound:e}}function Pe(){let e=null;return{tryBegin(){return e?null:(e=Symbol(),e)},clear(){e=null},owns(t){return e===t}}}var $=e(h(),1);function Fe(e){let t=(0,X.c)(7),{shortcut:n,platform:r}=e,i=r===void 0?navigator.platform:r,a,o;if(t[0]!==i||t[1]!==n){let e=new Map;a=I,o=he(n,i).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),(0,$.jsx)(L,{"aria-hidden":!0,children:t},`${t}-${n}`)}),t[0]=i,t[1]=n,t[2]=a,t[3]=o}else a=t[2],o=t[3];let s;return t[4]!==a||t[5]!==o?(s=(0,$.jsx)(a,{children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}var Ie={Shift:`shift`,Meta:`meta`,OS:`meta`,Control:`control`,Alt:`alt`,AltGraph:`alt`},Le={shift:[`ShiftLeft`,`ShiftRight`],meta:[`MetaLeft`,`MetaRight`],control:[`ControlLeft`,`ControlRight`],alt:[`AltLeft`,`AltRight`]};function Re(e){let t=(0,X.c)(43),{shortcut:n,shortcutLabel:r,disabled:a,allowModifierPairs:o,onRecord:s,onStart:c,onError:u}=e,d=a!==void 0&&a,f=o===void 0||o,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=W(),t[0]=p):p=t[0];let h=p,g;t[1]!==n||t[2]!==r?(g=r?fe(r):n,t[1]=n,t[2]=r,t[3]=g):g=t[3];let _=g,[v,y]=(0,Y.useState)(!1),[b]=(0,Y.useState)(Pe),x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[4]=x):x=t[4];let S=(0,Y.useRef)(x),C;t[5]===b?C=t[6]:(C=()=>{b.clear(),S.current.clear(),y(!1),h?.setSnapShotShortcutSuppressed(!1).catch(Be)},t[5]=b,t[6]=C);let w=C,T;t[7]!==d||t[8]!==u||t[9]!==c||t[10]!==b?(T=async()=>{if(!h||d)return;let e=b.tryBegin();if(e){S.current.clear(),c?.();try{await h.setSnapShotShortcutSuppressed(!0),b.owns(e)&&y(!0)}catch(t){let n=t;if(!b.owns(e))return;b.clear(),u(n instanceof Error?n.message:`Could not start shortcut recording.`)}}},t[7]=d,t[8]=u,t[9]=c,t[10]=b,t[11]=T):T=t[11];let E=T,D,O;t[12]===b?(D=t[13],O=t[14]):(D=()=>()=>{b.clear(),h?.setSnapShotShortcutSuppressed(!1).catch(ze)},O=[h,b],t[12]=b,t[13]=D,t[14]=O),(0,Y.useEffect)(D,O);let k;t[15]!==f||t[16]!==u||t[17]!==s||t[18]!==v||t[19]!==w?(k=e=>{if(!v||e.key===`Tab`||e.repeat)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w();return}let t=Ie[e.key];if(t){let n=S.current;n.add(e.code);let[r,i]=Le[t];if(n.has(r)&&n.has(i)){if(!f){u(`Add a letter, number, or function key to your shortcut.`);return}w(),s(t===`shift`?{kind:`both-shift-keys`}:{kind:`modifier-pair`,modifier:t})}return}if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey)return;let n=U(e,navigator.platform);if(!n)return;let r=i(n);r&&(w(),s(r))},t[15]=f,t[16]=u,t[17]=s,t[18]=v,t[19]=w,t[20]=k):k=t[20];let A=k,j=v?`secondary`:`outline`,M;t[21]===_?M=t[22]:(M=_?`Record snapshot shortcut, currently ${pe(_)}`:`Change snapshot shortcut`,t[21]=_,t[22]=M);let N;t[23]===E?N=t[24]:(N=()=>void E(),t[23]=E,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>S.current.delete(e.code),t[25]=P):P=t[25];let F;t[26]!==f||t[27]!==_||t[28]!==v?(F=v?`Press shortcut…`:_?!f&&l(_)?`Choose shortcut`:(0,$.jsx)(Fe,{shortcut:_}):`Change shortcut`,t[26]=f,t[27]=_,t[28]=v,t[29]=F):F=t[29];let I;t[30]!==d||t[31]!==A||t[32]!==v||t[33]!==w||t[34]!==j||t[35]!==M||t[36]!==N||t[37]!==F?(I=(0,$.jsx)(m,{type:`button`,size:`xs`,variant:j,disabled:d,"aria-label":M,"aria-pressed":v,"data-keybinding-capture":``,onClick:N,onKeyDown:A,onKeyUp:P,onBlur:w,children:F}),t[30]=d,t[31]=A,t[32]=v,t[33]=w,t[34]=j,t[35]=M,t[36]=N,t[37]=F,t[38]=I):I=t[38];let L;return t[39]!==v||t[40]!==w||t[41]!==I?(L={recording:v,stopRecording:w,input:I},t[39]=v,t[40]=w,t[41]=I,t[42]=L):L=t[42],L}function ze(){}function Be(){}var Ve=i(`Ctrl+Shift+2`);function He({state:e,disabled:t=!1,onBusyChange:n,onSaved:r,onComplete:a}){let o=W(),{resolvedTheme:s}=S(),{copyToClipboard:c,isCopied:u}=x(),[d,f]=(0,Y.useState)(null),[p,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(null),[T,k]=(0,Y.useState)(!1),A=t||v!==null,j=!!(o?.previewSnapShotConfig&&o.applySnapShotConfig),M=d!==null&&d.before!==d.after,N=e.linuxBackend===`niri`,P=N?`Niri`:`Hyprland`,F=(C??d?.shortcut)?.trim(),I=Re({shortcut:F?i(F.replace(/super/gi,`meta`))??Ve:Ve,disabled:A,allowModifierPairs:!1,onStart:()=>_(null),onError:e=>_({message:e}),onRecord:e=>{l(e)||(w(H({...e,ctrlKey:e.ctrlKey||e.modKey,modKey:!1})),f(null),_(null))}}),L=A||I.recording,R=(0,Y.useMemo)(()=>d&&M?E({name:d.path,contents:d.before},{name:d.path,contents:d.after}):null,[d,M]),z=e=>{y(e),n?.(!0),_(null)},B=()=>{y(null),n?.(!1)},V=async(e=T,t=`install`)=>{if(!L&&o?.previewSnapShotConfig){z(`reading`),f(null),h(null),k(e);try{f(await o.previewSnapShotConfig({operation:t,chooseFile:e,...C?.trim()?{shortcut:C.trim()}:{}}))}catch(e){_({message:`Couldn't prepare the changes. Check Advanced for help.`,...e instanceof Error?{detail:e.message}:{}})}finally{B()}}},ee=async()=>{if(!L&&d&&o?.applySnapShotConfig){z(`writing`);try{let e=await o.applySnapShotConfig(d.id);h(e),await r?.(),!e.warning&&d.operation===`install`&&a&&(b.add({type:`success`,title:`Shortcut saved`,description:`Use ${d.shortcut} from another app.`}),await a())}catch(e){_({message:`Couldn't save your shortcut. Review the changes and try again.`,...e instanceof Error?{detail:e.message}:{}}),f(null)}finally{B()}}};return(0,$.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[p?null:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{children:`Shortcut`}),I.input]}),I.recording?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Press your shortcut. Esc cancels.`}):null,p?(0,$.jsx)(`p`,{role:`status`,children:p.warning?`Saved, but the shortcut needs attention. Check Advanced for help.`:d?.operation===`remove`?`Shortcut removed.`:`Use ${d?.shortcut} from another app to capture a window.`}):d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:M?d.operation===`remove`?`Review the change below to remove your shortcut.`:`Review the change below, then save your shortcut.`:d.operation===`remove`?`There's no capture shortcut to remove.`:`This shortcut is already set up.`}),R?(0,$.jsx)(`div`,{className:`max-h-80 overflow-auto rounded-lg border text-xs`,"aria-label":`Shortcut changes`,children:(0,$.jsx)(O,{fileDiff:R,options:{diffStyle:`unified`,theme:D(s),overflow:`wrap`}})}):null,M?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only these changes will be saved. We'll keep a backup.`}):null,(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[M||d.operation===`install`?(0,$.jsx)(m,{disabled:L||d.operation===`install`&&e.shortcutActionRegistered===!1,"aria-busy":v===`writing`,onClick:()=>void ee(),children:v===`writing`?`Saving…`:M?d.operation===`install`?`Save shortcut`:`Remove shortcut`:`Done`}):null,(0,$.jsx)(m,{variant:`ghost`,disabled:L,onClick:()=>f(null),children:`Cancel`})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Allow P4 Code to read your desktop settings. You'll review any changes here before saving.`}),(0,$.jsx)(m,{disabled:L||!j,"aria-busy":v===`reading`,onClick:()=>void V(),children:v===`reading`?`Preparing changes…`:`Review changes`}),j?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Update P4 Code to finish setting up your shortcut.`})]}),g?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:g.message}):null,e.shortcutActionRegistered===!1&&e.shortcutMessage?(0,$.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:e.shortcutPending?`Connecting to your desktop…`:`Restart P4 Code to finish connecting your shortcut.`}):null,(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,$.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[g?.detail||p?.warning?(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Troubleshooting`}),(0,$.jsx)(`p`,{className:`break-words`,children:g?.detail??p?.warning})]}):null,(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Settings file`}),(0,$.jsx)(`p`,{className:`break-all font-mono`,children:d?.path??e.shortcutConfigPath??(N?`~/.config/niri/config.kdl`:`~/.config/hypr/hyprland.conf`)}),N?(0,$.jsx)(`p`,{children:`P4 Code also reads any files included by this file.`}):null,d&&d.resolvedPath!==d.path?(0,$.jsxs)(`p`,{className:`break-all`,children:[`Linked to `,d.resolvedPath,`. The link will be kept.`]}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(!0),children:`Choose a different file…`}),(0,$.jsx)(m,{size:`sm`,variant:`ghost`,disabled:L||!j,onClick:()=>void V(T,`remove`),children:`Remove shortcut…`}),p?(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(),children:`Review changes`}):null]}),(0,$.jsxs)(`p`,{children:[`Use your desktop's shortcut settings file.`,` `,N?`A custom --config or NIRI_CONFIG can change its location.`:`On Omarchy, use your own bindings file, not its defaults.`]}),p?.backupPath?(0,$.jsxs)(`p`,{className:`break-all`,children:[`Backup: `,p.backupPath]}):null,(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Manual setup`}),(0,$.jsxs)(`p`,{children:[N?`Paste this inside binds { … } in your Niri config, then save.`:`Add this binding to your Hyprland config, then save.`,` `,`Change the keys if needed.`]}),(0,$.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-xl bg-muted/50 p-3`,children:e.shortcutBinding}),(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!e.shortcutBinding,onClick:()=>{e.shortcutBinding&&c(e.shortcutBinding)},children:u?`Copied`:`Copy shortcut`}),(0,$.jsxs)(`p`,{children:[`Turn capture off in P4 Code to stop it. Remove the shortcut from `,P,` to free up the keys.`]}),e.shortcutActionRegistered===!1?(0,$.jsx)(`p`,{role:`status`,children:e.shortcutMessage}):null,a?(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||e.shortcutActionRegistered===!1,onClick:()=>void a(),children:`I've added the shortcut`}):null]})]})]})}var Ue=[{id:`access`,label:`Access`},{id:`shortcut`,label:`Shortcut`}],We={"not-installed":{title:`Install the extension`,description:`The P4 Code GNOME extension lets you capture other windows and bring them into your draft. Sign out once after installing.`},"restart-required":{title:`Extension installed`,description:`Save your work, then sign out and back in. Your setup will be waiting here.`},"update-required":{title:`Update the extension`,description:`Install the update, then sign out and back in.`},"extensions-disabled":{title:`Allow GNOME extensions`,description:`Open GNOME Extensions and turn on extensions, then check again.`},disabled:{title:`Enable the extension`,description:`Enable P4 Code SnapShots to start capturing windows.`},enabled:{title:`Capture is ready`,description:`Next, choose your shortcut.`},unsupported:{title:`Automatic capture isn't available`,description:`Use Take snapshot from the command palette to choose a window.`},error:{title:`Couldn't set up the extension`,description:`Check P4 Code SnapShots in GNOME Extensions, then try again.`}};function Ge({state:e,initialStep:t,wasEnabled:n,includeAccessibility:r,busy:i,error:a,shortcutInput:o,shortcutStatus:s,shortcutChanged:c,canSaveShortcut:u,onSaveShortcut:d,onEnable:f,onAction:p,onRefresh:h,onClose:g,onLeaveStep:_}){let[v,y]=(0,Y.useState)(()=>Se(e,t)),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)(!1),E=i||b||w,D=Z(e),O=D===`niri`||D===`hyprland`,j=ve(e),M=e.gnomeExtension,N=D===`hyprland`?e.hyprlandHelper:e.kdeHelper,I=D===`kde`||D===`hyprland`,L=D===`hyprland`?`install-hyprland-helper`:`install-kde-helper`,R=D===`hyprland`?`remove-hyprland-helper`:`remove-kde-helper`,z=Q(e),B=ue(async()=>{let e=await h();if(!e?.macPermissions)throw Error(`Permission status unavailable`);return e.macPermissions},e.macPermissions??{screenRecording:!1,accessibility:!1},!!e.macPermissions&&v===`access`&&!E),V=e.macPermissions?B.status:void 0,ee=!V||B.isReady(r?[`screenRecording`,`accessibility`]:[`screenRecording`]),H=xe(e,c),U=M?.status===`not-installed`||M?.status===`update-required`,W=M?.status===`disabled`,te=e=>{_(),C(!1),y(e)},ie=async()=>{if(!E){x(!0),C(!1);try{C(await h()!==void 0)}finally{x(!1)}}},ae=e.message&&!V?{title:`Let's try that again`,description:`Couldn't check snapshots. Try again to continue.`}:D===`gnome`&&M?M.status===`enabled`&&!z?{title:`Check capture access`,description:`The extension isn't ready yet. Try again in a moment.`}:We[M.status]:I?N?.status===`ready`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:N?.status===`error`?{title:`Let's fix capture access`,description:`Try reinstalling the capture helper, then check again.`}:{title:N?.status===`update-required`?`Update the capture helper`:`Allow snapshots`,description:`P4 Code's capture helper lets you capture other apps and return to your draft. It's included with P4 Code.`}:D===`niri`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:D===`picker`?{title:`Choose a window each time`,description:`Your desktop doesn't support automatic capture. You'll choose the window to capture instead.`}:{title:`Allow snapshots`,description:D===`portal`?`Your desktop may ask for permission when you first capture.`:V?ee?`Test a snapshot of the current window. If macOS asks to bypass its window picker, choose Allow. The test image is discarded.`:`Allow each permission, then continue.`:`Allow access when prompted to start capturing windows.`},se=v===`access`?ae.title:`Choose your shortcut`,ce=v===`access`?ae.description:O?`Click the shortcut, then press the keys you want.`:e.mode===`portal`?`Choose your keys, then approve the permission prompt if asked.`:`Use both Shift keys, or record a different shortcut.`,q=Ue.findIndex(({id:e})=>e===v),X=[...new Set([a,...v===`access`?[e.message,D===`gnome`&&(M?.status===`error`||M?.status===`unsupported`)?M.message:null,I&&N?.status===`error`?N.message:null]:[]].filter(e=>e!==null))];return(0,$.jsx)(A,{open:!0,onOpenChange:e=>{!e&&!E&&g(!1)},children:(0,$.jsxs)(re,{showCloseButton:!E,children:[(0,$.jsx)(oe,{title:j?`Set up snapshots for ${j}`:`Set up snapshots`,children:(0,$.jsx)(G,{steps:Ue.map(e=>e.label),currentStep:q,isStepDisabled:e=>E||e>q,onStepChange:e=>{let t=Ue[e];t&&t.id!==v&&te(t.id)}})}),(0,$.jsx)(K,{children:(0,$.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,"aria-live":`polite`,children:[(0,$.jsx)(`h3`,{className:`flex items-center gap-2 font-medium`,children:se}),(0,$.jsx)(k,{children:ce})]}),v===`access`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{role:`status`,"aria-atomic":`true`,className:S&&!E&&!a?`text-xs text-muted-foreground`:`sr-only`,children:S&&!E&&!a?be(e):null}),V?(0,$.jsx)(le,{busy:E,permissions:[{id:`screenRecording`,icon:(0,$.jsx)(P,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Screen Recording`,description:`Capture the window you're using.`,granted:V.screenRecording,onAllow:()=>void p(`allow-screen-recording`)},{id:`accessibility`,icon:(0,$.jsx)(F,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Accessibility`,description:r?`Include text and controls from the captured app.`:`Optional. Include text and controls from the captured app.`,granted:V.accessibility,onAllow:()=>void p(`allow-accessibility`)}]}):null,B.error&&V?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:B.error}):null,I&&N?.status===`error`?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:E,onClick:()=>void p(L),children:`Reinstall helper`}):null]}):O?(0,$.jsx)(He,{state:e,disabled:i||b||!z,onBusyChange:T,onSaved:h,onComplete:()=>g(!0)}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[o,s?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:s}):null,!c&&!e.shortcutRegistered&&!e.shortcutPending&&e.shortcutCanRetry!==!1&&!l(e.shortcut)?(0,$.jsx)(m,{variant:`ghost`,size:`sm`,disabled:E,onClick:()=>void p(`retry-shortcut`),children:e.mode===`portal`?`Shortcut permissions`:`Try again`}):null]}),v===`shortcut`&&!z?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Capture needs attention. Go back to check access.`}):null,a?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Couldn't finish this step. Try again or check Advanced for help.`}):null,X.length>0||v===`access`&&(D===`gnome`||I)?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,$.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[X.map(e=>(0,$.jsx)(`p`,{className:`break-words`,children:e},e)),v===`access`&&(D===`gnome`||I)?(0,$.jsx)(`p`,{children:`Included with P4 Code. No download needed.`}):null,v===`access`&&D===`gnome`&&M?.status===`enabled`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void p(`disable-extension`),children:`Disable extension`}):null,v===`access`&&I&&N?.status!==`not-installed`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void p(R),children:`Remove capture helper`}):null]})]}):null]})}),(0,$.jsxs)(ne,{children:[v===`access`?null:(0,$.jsx)(m,{variant:`ghost`,disabled:E,onClick:()=>te(`access`),children:`Back`}),(0,$.jsx)(m,{variant:`ghost`,disabled:E,onClick:()=>void g(!1),children:n?`Close`:`Finish later`}),v===`access`?I&&!z&&N?.status!==`ready`?(0,$.jsx)(m,{disabled:E,"aria-busy":E,onClick:()=>void(N?.status===`error`?ie():p(L)),children:b?`Checking…`:E?`Installing…`:N?.status===`error`?`Check again`:N?.status===`update-required`?`Update helper`:`Install helper`}):D===`gnome`&&!z&&M?.status!==`enabled`?(0,$.jsx)(m,{disabled:E,"aria-busy":b,onClick:()=>void(U?p(`install-extension`):W?p(`enable-extension`):ie()),children:b?`Checking…`:E?U?`Installing…`:W?`Enabling…`:`Working…`:U?M?.status===`update-required`?`Update extension`:`Install extension`:W?`Enable extension`:`Check again`}):(0,$.jsx)(J,{ready:ee,busy:E,onClick:async()=>{await f()&&te(`shortcut`)},children:E?`Working…`:V?`Test capture and continue`:D===`direct`?`Allow capture`:!z&&!V?`Try again`:`Continue`}):O?null:(0,$.jsx)(m,{disabled:E||!z||(c?!u:!H),onClick:async()=>{(!c||await d())&&await g(!0)},children:E?`Saving…`:c?`Save and finish`:`Done`})]})]})})}var Ke=`grid grid-cols-[1fr_auto]`;function qe(e,t){return{title:e,message:t instanceof Error?t.message:`Try again.`}}function Je(){let e=C(),t=w(),i=r(T),o=W(),[s,c]=(0,Y.useState)(null),[p,h]=(0,Y.useState)(!1),[_,x]=(0,Y.useState)(null),[S,E]=(0,Y.useState)(null),[D,O]=(0,Y.useState)(e.snapShotShortcut),[k,A]=(0,Y.useState)({status:`idle`,availability:null}),j=(0,Y.useRef)(0),M=(0,Y.useRef)(0),N=Me(!!o),P=!!o&&s!==null&&s.mode!==`unavailable`,F=ke(s),I=e.snapShotShortcut,L=s?.linuxBackend===`niri`||s?.linuxBackend===`hyprland`,H=!L&&!ge(D,I),U=H?D:s?.shortcut??I,ne=H?_e(D,i):null,re=H&&ne===null&&k.availability?.available===!0,G=e.snapShotPlaySound?e.snapShotSound:`off`,oe=G===`off`?`Off`:G===`soft-pop`?`Whoosh (Default)`:`Click`,K=(0,Y.useCallback)(async()=>{let e=++M.current;try{if(o){let t=await o.getSnapShotState();return e===M.current&&c(t),t}}catch(t){e===M.current&&x(qe(`Couldn't check capture setup`,t))}},[o]),le=(0,Y.useCallback)(async e=>{if(o?.setupSnapShot&&!p){h(!0),x(null);try{s?.macPermissions&&S&&(e===`allow-screen-recording`||e===`allow-accessibility`)&&ie(S.wasEnabled),await o.setupSnapShot(e),await K()}catch(t){x(qe(e===`retry-shortcut`?`Couldn't open shortcut permissions`:`Couldn't complete capture setup`,t))}finally{h(!1)}}},[o,K,p,s,S]);(0,Y.useEffect)(()=>{_&&!S&&(b.add({type:`error`,title:_.title,description:_.message}),x(null))},[_,S]),(0,Y.useEffect)(()=>{let e=!1;return K().then(t=>{let n=ae();!e&&t?.macPermissions&&n&&E({initialStep:`access`,wasEnabled:n.wasEnabled})}),window.addEventListener(`focus`,K),()=>{e=!0,window.removeEventListener(`focus`,K)}},[K]),(0,Y.useEffect)(()=>o?.onSnapShotEvent(e=>{e.type===`shortcut-changed`&&K()}),[o,K]),(0,Y.useEffect)(()=>{j.current++,O(I),A({status:`idle`,availability:null})},[I]);let J=(0,Y.useCallback)(async e=>{x(null);try{return await t(e),await K()}catch(e){x(qe(`Couldn't save capture settings`,e))}},[K,t]),ue=(0,Y.useCallback)(async t=>{try{t&&e.snapShotEnabled&&await o?.requestSnapShotPermissions(!0),await J({snapShotIncludeAccessibility:t})}catch(e){x(qe(`Couldn't allow app text capture`,e))}},[o,J,e.snapShotEnabled]),X=(0,Y.useCallback)(async e=>{let t=++j.current;if(O(e),!_e(e,i)&&o){A({status:`checking`,availability:null});try{let n=await o.checkSnapShotShortcut(e);t===j.current&&A({status:`checked`,availability:n})}catch(e){if(t!==j.current)return;A({status:`checked`,availability:{available:!1,message:e instanceof Error?e.message:`Could not check this shortcut.`}})}}},[o,i]),{recording:de,stopRecording:fe,input:pe}=Re({shortcut:U,shortcutLabel:H?void 0:s?.shortcutLabel,disabled:p,allowModifierPairs:s?.mode!==`portal`,onRecord:e=>void X(e),onStart:()=>{j.current++,A({status:`idle`,availability:null})},onError:e=>A({status:`checked`,availability:{available:!1,message:e}})}),me=de?`Press your shortcut. Esc cancels.`:ne?`P4 Code already uses this for "${ee(ne)}".`:k.status===`checking`?`Checking shortcut…`:k.availability?k.availability.available?`Ready to save.`:k.availability.message:s?.mode===`portal`&&!s.shortcutLabel&&l(U)?`Try a shortcut such as Ctrl+Shift+2.`:Ee(s),he=async(t=`resume`)=>{if(s&&!p){fe(),j.current++,O(I),A({status:`idle`,availability:null}),x(null),h(!0);try{let n=await K();if(!n)return;if(n.macPermissions&&(t=`access`),!e.snapShotEnabled&&Se(n,t)!==`access`&&(n=await J({snapShotEnabled:!0}),!n)){E({initialStep:`access`,wasEnabled:!1});return}E({initialStep:Se(n,t),wasEnabled:e.snapShotEnabled})}finally{h(!1)}}},ve=async()=>{if(p)return!1;h(!0),x(null);try{if(s?.macPermissions){if(ie(S?.wasEnabled??e.snapShotEnabled),!o?.setupSnapShot)throw Error(`Restart P4 Code to finish capture setup.`);await o.setupSnapShot(`test-mac-capture`)}s?.mode===`direct`&&await o?.requestSnapShotPermissions(e.snapShotIncludeAccessibility);let t=e.snapShotEnabled&&!s?.message?await K():await J({snapShotEnabled:!0});return t!==void 0&&Q(t)}catch(e){return x(qe(`Couldn't verify capture access`,e)),!1}finally{h(!1)}},Z=async t=>{if(S&&!p){h(!0);try{if(e.snapShotEnabled&&Ce(S.wasEnabled,t)&&!await J({snapShotEnabled:!1}))return;fe(),x(null),se(),E(null)}catch(e){x(qe(`Couldn't close capture setup`,e))}finally{h(!1)}}},ye=async()=>{if(!re||p)return!1;h(!0);try{let e=await J({snapShotShortcut:D});return!!(e?.shortcutRegistered||e?.shortcutPending)}finally{h(!1)}};return(0,$.jsxs)(B,{children:[(0,$.jsx)(V,{id:`snap-shot`,title:`SnapShots`,children:(0,$.jsxs)(z,{message:N,children:[(0,$.jsx)(R,{...q(`snap-shot-enabled`),description:Ae(s),status:o?p&&!S?`Updating capture settings…`:we(s,e.snapShotEnabled):void 0,control:(0,$.jsxs)($.Fragment,{children:[e.snapShotEnabled&&!Oe(s,e.snapShotIncludeAccessibility)?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:p,onClick:()=>void he(),children:De(s)}):null,(0,$.jsx)(ce,{checked:e.snapShotEnabled||!!S,disabled:!P||p,"aria-label":`Enable snapshots`,onCheckedChange:e=>{e?s?.windows?J({snapShotEnabled:!0}):he():J({snapShotEnabled:!1})}})]})}),e.snapShotEnabled&&P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(R,{...q(`snap-shot-accessibility`),description:`Include text and controls when the app makes them available.`,status:je(s),control:(0,$.jsx)(ce,{checked:!je(s)&&e.snapShotIncludeAccessibility,disabled:!P||!!je(s),"aria-label":`Include app text in snapshots`,onCheckedChange:e=>void ue(e)})}),(0,$.jsx)(R,{...q(`snap-shot-shortcut`),description:s?.linuxBackend===`picker`?`Choose a window to capture from any app.`:`Capture the window you're using without switching apps.`,status:L?void 0:me,control:L?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:p,onClick:()=>void he(`shortcut`),children:`Change shortcut`}):(0,$.jsxs)($.Fragment,{children:[pe,H?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m,{size:`xs`,disabled:!re||p,onClick:()=>void ye(),children:p?`Saving…`:`Save`}),(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:p,onClick:()=>{fe(),j.current++,O(I),A({status:`idle`,availability:null})},children:`Cancel`})]}):s?.mode===`portal`&&s.shortcutCanRetry!==!1&&!l(I)?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:p||s.shortcutPending,onClick:()=>void le(`retry-shortcut`),children:`Shortcut permissions`}):null]})}),(0,$.jsx)(R,{...q(`snap-shot-sound`),description:`Choose the sound played when capture starts.`,control:(0,$.jsxs)(g,{children:[(0,$.jsx)(d,{"aria-label":`Snapshot sound: `+oe,render:(0,$.jsx)(y,{size:`sm`}),className:`w-auto min-w-0`,disabled:!P,children:G===`off`?`Off`:G===`soft-pop`?(0,$.jsxs)($.Fragment,{children:[`Whoosh `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}):`Click`}),(0,$.jsx)(n,{align:`end`,children:(0,$.jsxs)(f,{onValueChange:e=>void J(Ne(e)),value:G,children:[(0,$.jsx)(v,{closeOnClick:!0,value:`off`,children:`Off`}),(0,$.jsxs)(`div`,{className:Ke,children:[(0,$.jsxs)(v,{closeOnClick:!0,value:`soft-pop`,children:[`Whoosh `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}),(0,$.jsx)(u,{"aria-label":`Play Whoosh`,closeOnClick:!1,onClick:()=>te(`soft-pop`),children:(0,$.jsx)(a,{})})]}),(0,$.jsxs)(`div`,{className:Ke,children:[(0,$.jsx)(v,{closeOnClick:!0,value:`camera-shutter`,children:`Click`}),(0,$.jsx)(u,{"aria-label":`Play Click`,closeOnClick:!1,onClick:()=>te(`camera-shutter`),children:(0,$.jsx)(a,{})})]})]})})]})}),(0,$.jsx)(R,{...q(`snap-shot-flash`),description:`Show a gentle cue on the captured window.`,status:F,control:(0,$.jsx)(ce,{checked:!F&&e.snapShotFlash,disabled:!P||!!F,"aria-label":`Flash captured window`,onCheckedChange:e=>void J({snapShotFlash:e})})}),(0,$.jsx)(R,{...q(`snap-shot-animations`),description:`Animate captured windows into your draft.`,status:F,control:(0,$.jsx)(ce,{checked:!F&&e.snapShotAnimations,disabled:!P||!!F,"aria-label":`Animate snapshots`,onCheckedChange:e=>void J({snapShotAnimations:e})})})]}):null]})}),S&&s?(0,$.jsx)(Ge,{state:s,initialStep:S.initialStep,wasEnabled:S.wasEnabled,includeAccessibility:e.snapShotIncludeAccessibility,busy:p,error:_?.message??null,shortcutInput:pe,shortcutStatus:me,shortcutChanged:H,canSaveShortcut:re,onSaveShortcut:ye,onEnable:ve,onAction:le,onRefresh:K,onClose:Z,onLeaveStep:fe}):null]})}function Ye(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Je,{}),e[0]=t):t=e[0],t}export{Ye as component};
|
|
2
|
-
//# sourceMappingURL=settings.snap-shot-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,$o as r,Ic as i,Ip as a,Mh as o,Nh as s,RE as c,Sh as l,Zn as u,cr as d,er as f,jc as p,lr as m,mE as h,qn as g,r as _,tr as v}from"./utils-hgbJ2TVM.js";import{n as y}from"./select-Bsag72zE.js";import{i as b,p as x}from"./toast-CfeQA1vM.js";import{K as S,s as C,v as w}from"./useSettings-DkjziVJm.js";import{s as T}from"./server-BNs54wEo.js";import{f as E,l as D}from"./diffRendering-D5-wCc8J.js";import{t as O}from"./FileDiff-Cb7Q8DoF.js";import{r as k,t as A}from"./dialog-Cgb4jap2.js";import{i as j,r as M,v as N}from"./keybindings-CqjUKNRx.js";import{b as P,y as F}from"./Icons-C0Zjws-3.js";import{n as I,t as L}from"./kbd-B2uytHus.js";import{a as R,c as z,i as B,s as V}from"./settingsLayout-BloLque1.js";import{a as ee,d as H,l as U}from"./KeybindingsSettings.logic-D-GClV-c.js";import{Ht as W,Pt as te,aa as ne,ca as re,h as ie,la as G,m as ae,oa as oe,p as se,pa as ce,sa as K,tr as q}from"./main-DTxzRLjF.js";import{n as le,r as J,t as ue}from"./usePermissionStatus-SyBwmFSK.js";var Y=e(t(),1),X=c(),de={return:`enter`,page_up:`pageup`,page_down:`pagedown`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,plus:`+`,minus:`-`};function fe(e){let t=e.trim().replace(/^Press\s+/i,``);if(!t)return null;let n=t.match(/^((?:<[^<>]+>)+)([^<>]+)$/),r=(n?n[1].replace(/<([^<>]+)>/g,`$1+`)+n[2]:t).replace(/\b(super|win|primary)\b/gi,e=>e.toLowerCase()===`primary`?`ctrl`:`meta`);if(r!==`+`&&r.endsWith(`+`)&&!r.endsWith(`++`))return null;let a=i(r);if(!a)return null;let o=de[a.key]??a.key;return o!==` `&&!/^[^\s<>]$/u.test(o)&&!/^(?:f(?:[1-9]|1\d|2[0-4])|enter|tab|escape|backspace|delete|insert|home|end|pageup|pagedown|arrow(?:left|right|up|down)|pause|printscreen)$/i.test(o)?null:{...a,key:o}}function pe(e,t=navigator.platform){return l(e)?o(s(e),p(t)):j(e,t)}function me(e,t){return e===`shift`?`⇧`:p(t)?e===`meta`?`⌘`:e===`control`?`⌃`:`⌥`:e===`meta`?_(t)?`⊞`:`Super`:e===`control`?`Ctrl`:`Alt`}function he(e,t=navigator.platform){if(l(e)){let n=me(s(e),t);return[n,n]}let n=p(t);return[...[[e.ctrlKey||e.modKey&&!n,`control`],[e.altKey,`alt`],[e.shiftKey,`shift`],[e.metaKey||e.modKey&&n,`meta`]].filter(([e])=>e).map(([,e])=>me(e,t)),M(e.key)]}function ge(e,t,n=navigator.platform){return l(e)||l(t)?l(e)&&l(t)&&s(e)===s(t):N(e,n)===N(t,n)}function _e(e,t,n=navigator.platform){if(l(e))return null;let r=N(e,n);return t.find(e=>N(e.shortcut,n)===r)?.command??null}function ve(e){if(e.mode===`portal`)switch(e.linuxDesktop??Z(e)){case`gnome`:return`GNOME`;case`kde`:return`KDE Plasma`;case`niri`:return`Niri`;case`hyprland`:return`Hyprland`;default:return}}function Z(e){return e.mode===`portal`?e.linuxBackend===`niri`?`niri`:e.linuxBackend===`kde`?`kde`:e.linuxBackend===`hyprland`?`hyprland`:e.linuxBackend===`screenshot-portal`?`portal`:e.linuxBackend===`picker`&&e.gnomeExtension?.status===`unsupported`?`picker`:e.linuxBackend===`gnome-extension`||e.gnomeExtension?`gnome`:`picker`:`direct`}function Q(e){return e.mode===`unavailable`||e.message?!1:Z(e)===`gnome`?e.gnomeExtension?.status===`enabled`&&e.linuxBackend===`gnome-extension`:Z(e)===`kde`?e.kdeHelper?.status===`ready`:Z(e)!==`hyprland`||e.hyprlandHelper?.status===`ready`}function ye(e,t){let n=e.macPermissions;return!n||n.screenRecording&&(!t||n.accessibility)}function be(e){let t=Z(e),n=t===`gnome`;return e.message||n&&e.gnomeExtension?.status===`error`||t===`kde`&&e.kdeHelper?.status===`error`||t===`hyprland`&&e.hyprlandHelper?.status===`error`?`Still unable to check access. See Advanced for help.`:Z(e)===`picker`?`Ready. You'll choose a window each time.`:n&&e.gnomeExtension?.status===`restart-required`?`Still waiting for you to sign out and back in.`:Q(e)?`Ready. Continue to choose your shortcut.`:`Not ready yet. Finish the step above.`}function xe(e,t){return t||!Q(e)?!1:e.linuxBackend===`hyprland`?!!e.shortcutActionRegistered:e.linuxBackend===`niri`?!!e.shortcutBinding:e.shortcutRegistered||!!e.shortcutPending}function Se(e,t=`resume`){return Q(e)?t===`resume`?e.mode===`direct`&&!e.shortcutRegistered||Z(e)===`picker`?`access`:`shortcut`:t:`access`}function Ce(e,t){return!e&&!t}function we(e,t){return e?e.mode===`unavailable`?e.message??`Not supported on this platform.`:t?Te(e,t):`Turn this on to set up snapshots.`:`Checking snapshots…`}function Te(e,t){return e.message?`Capture needs attention`:e.linuxBackend===`hyprland`&&e.hyprlandHelper?.status!==`ready`?e.hyprlandHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:Z(e)===`gnome`&&e.gnomeExtension?.status!==`enabled`?`Set up active-window snapshots`:Z(e)===`kde`&&e.kdeHelper?.status!==`ready`?e.kdeHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:Z(e)===`picker`?`Manual capture only — you'll choose a window each time`:t?e.shortcutPending?e.linuxBackend===`hyprland`?`Connecting your shortcut…`:`Waiting for shortcut permission`:e.shortcutVerified?`Ready to capture`:e.linuxBackend===`niri`&&e.shortcutBinding||e.linuxBackend===`hyprland`&&e.shortcutActionRegistered?`Use your shortcut from another app`:e.shortcutRegistered?e.shortcutLabel?`Ready to capture`:`Shortcut saved`:`Finish shortcut setup`:`Enable capture to continue`}function Ee(e){return e?e.linuxBackend===`hyprland`?e.shortcutMessage:e.shortcutPending?`Approve the shortcut permission prompt to continue.`:e.shortcutRegistered?e.mode===`portal`?null:`Shortcut saved.`:e.shortcutMessage:null}function De(e){if(!e)return`Continue setup`;if(Q(e))return`Manage capture`;let t=ve(e);return t?`Set up ${t} capture`:`Continue setup`}function Oe(e,t){return e?.windows?!0:e?.macPermissions!==void 0&&Q(e)&&ye(e,t)&&e.shortcutRegistered}function ke(e){if(!(e?.mode!==`portal`||e.linuxFeedbackAvailable))return e.linuxBackend===`hyprland`?e.hyprlandHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`niri`?`Capture effects aren't available on Niri.`:e.linuxBackend===`kde`?e.kdeHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`gnome-extension`?`Update the GNOME extension, then sign out and back in to enable effects.`:Z(e)===`gnome`?`Finish extension setup to enable effects.`:`Capture effects aren't available on this desktop.`}function Ae(e){return e?.mode===`portal`&&Z(e)===`picker`?`Automatic capture isn't available here. Choose a window instead.`:`Capture a window and attach it to your current draft.`}function je(e){if(e?.mode===`portal`&&(e.linuxBackend===`picker`||e.linuxBackend===`screenshot-portal`))return`This desktop only provides a screenshot.`}function Me(e){if(!e)return typeof window<`u`&&window.desktopBridge?`Update the desktop app to use snapshots.`:`Only available in the desktop app.`}function Ne(e){return e===`off`?{snapShotPlaySound:!1}:{snapShotPlaySound:!0,snapShotSound:e}}function Pe(){let e=null;return{tryBegin(){return e?null:(e=Symbol(),e)},clear(){e=null},owns(t){return e===t}}}var $=e(h(),1);function Fe(e){let t=(0,X.c)(7),{shortcut:n,platform:r}=e,i=r===void 0?navigator.platform:r,a,o;if(t[0]!==i||t[1]!==n){let e=new Map;a=I,o=he(n,i).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),(0,$.jsx)(L,{"aria-hidden":!0,children:t},`${t}-${n}`)}),t[0]=i,t[1]=n,t[2]=a,t[3]=o}else a=t[2],o=t[3];let s;return t[4]!==a||t[5]!==o?(s=(0,$.jsx)(a,{children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}var Ie={Shift:`shift`,Meta:`meta`,OS:`meta`,Control:`control`,Alt:`alt`,AltGraph:`alt`},Le={shift:[`ShiftLeft`,`ShiftRight`],meta:[`MetaLeft`,`MetaRight`],control:[`ControlLeft`,`ControlRight`],alt:[`AltLeft`,`AltRight`]};function Re(e){let t=(0,X.c)(43),{shortcut:n,shortcutLabel:r,disabled:a,allowModifierPairs:o,onRecord:s,onStart:c,onError:u}=e,d=a!==void 0&&a,f=o===void 0||o,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=W(),t[0]=p):p=t[0];let h=p,g;t[1]!==n||t[2]!==r?(g=r?fe(r):n,t[1]=n,t[2]=r,t[3]=g):g=t[3];let _=g,[v,y]=(0,Y.useState)(!1),[b]=(0,Y.useState)(Pe),x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[4]=x):x=t[4];let S=(0,Y.useRef)(x),C;t[5]===b?C=t[6]:(C=()=>{b.clear(),S.current.clear(),y(!1),h?.setSnapShotShortcutSuppressed(!1).catch(Be)},t[5]=b,t[6]=C);let w=C,T;t[7]!==d||t[8]!==u||t[9]!==c||t[10]!==b?(T=async()=>{if(!h||d)return;let e=b.tryBegin();if(e){S.current.clear(),c?.();try{await h.setSnapShotShortcutSuppressed(!0),b.owns(e)&&y(!0)}catch(t){let n=t;if(!b.owns(e))return;b.clear(),u(n instanceof Error?n.message:`Could not start shortcut recording.`)}}},t[7]=d,t[8]=u,t[9]=c,t[10]=b,t[11]=T):T=t[11];let E=T,D,O;t[12]===b?(D=t[13],O=t[14]):(D=()=>()=>{b.clear(),h?.setSnapShotShortcutSuppressed(!1).catch(ze)},O=[h,b],t[12]=b,t[13]=D,t[14]=O),(0,Y.useEffect)(D,O);let k;t[15]!==f||t[16]!==u||t[17]!==s||t[18]!==v||t[19]!==w?(k=e=>{if(!v||e.key===`Tab`||e.repeat)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w();return}let t=Ie[e.key];if(t){let n=S.current;n.add(e.code);let[r,i]=Le[t];if(n.has(r)&&n.has(i)){if(!f){u(`Add a letter, number, or function key to your shortcut.`);return}w(),s(t===`shift`?{kind:`both-shift-keys`}:{kind:`modifier-pair`,modifier:t})}return}if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey)return;let n=U(e,navigator.platform);if(!n)return;let r=i(n);r&&(w(),s(r))},t[15]=f,t[16]=u,t[17]=s,t[18]=v,t[19]=w,t[20]=k):k=t[20];let A=k,j=v?`secondary`:`outline`,M;t[21]===_?M=t[22]:(M=_?`Record snapshot shortcut, currently ${pe(_)}`:`Change snapshot shortcut`,t[21]=_,t[22]=M);let N;t[23]===E?N=t[24]:(N=()=>void E(),t[23]=E,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>S.current.delete(e.code),t[25]=P):P=t[25];let F;t[26]!==f||t[27]!==_||t[28]!==v?(F=v?`Press shortcut…`:_?!f&&l(_)?`Choose shortcut`:(0,$.jsx)(Fe,{shortcut:_}):`Change shortcut`,t[26]=f,t[27]=_,t[28]=v,t[29]=F):F=t[29];let I;t[30]!==d||t[31]!==A||t[32]!==v||t[33]!==w||t[34]!==j||t[35]!==M||t[36]!==N||t[37]!==F?(I=(0,$.jsx)(m,{type:`button`,size:`xs`,variant:j,disabled:d,"aria-label":M,"aria-pressed":v,"data-keybinding-capture":``,onClick:N,onKeyDown:A,onKeyUp:P,onBlur:w,children:F}),t[30]=d,t[31]=A,t[32]=v,t[33]=w,t[34]=j,t[35]=M,t[36]=N,t[37]=F,t[38]=I):I=t[38];let L;return t[39]!==v||t[40]!==w||t[41]!==I?(L={recording:v,stopRecording:w,input:I},t[39]=v,t[40]=w,t[41]=I,t[42]=L):L=t[42],L}function ze(){}function Be(){}var Ve=i(`Ctrl+Shift+2`);function He({state:e,disabled:t=!1,onBusyChange:n,onSaved:r,onComplete:a}){let o=W(),{resolvedTheme:s}=S(),{copyToClipboard:c,isCopied:u}=x(),[d,f]=(0,Y.useState)(null),[p,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(null),[T,k]=(0,Y.useState)(!1),A=t||v!==null,j=!!(o?.previewSnapShotConfig&&o.applySnapShotConfig),M=d!==null&&d.before!==d.after,N=e.linuxBackend===`niri`,P=N?`Niri`:`Hyprland`,F=(C??d?.shortcut)?.trim(),I=Re({shortcut:F?i(F.replace(/super/gi,`meta`))??Ve:Ve,disabled:A,allowModifierPairs:!1,onStart:()=>_(null),onError:e=>_({message:e}),onRecord:e=>{l(e)||(w(H({...e,ctrlKey:e.ctrlKey||e.modKey,modKey:!1})),f(null),_(null))}}),L=A||I.recording,R=(0,Y.useMemo)(()=>d&&M?E({name:d.path,contents:d.before},{name:d.path,contents:d.after}):null,[d,M]),z=e=>{y(e),n?.(!0),_(null)},B=()=>{y(null),n?.(!1)},V=async(e=T,t=`install`)=>{if(!L&&o?.previewSnapShotConfig){z(`reading`),f(null),h(null),k(e);try{f(await o.previewSnapShotConfig({operation:t,chooseFile:e,...C?.trim()?{shortcut:C.trim()}:{}}))}catch(e){_({message:`Couldn't prepare the changes. Check Advanced for help.`,...e instanceof Error?{detail:e.message}:{}})}finally{B()}}},ee=async()=>{if(!L&&d&&o?.applySnapShotConfig){z(`writing`);try{let e=await o.applySnapShotConfig(d.id);h(e),await r?.(),!e.warning&&d.operation===`install`&&a&&(b.add({type:`success`,title:`Shortcut saved`,description:`Use ${d.shortcut} from another app.`}),await a())}catch(e){_({message:`Couldn't save your shortcut. Review the changes and try again.`,...e instanceof Error?{detail:e.message}:{}}),f(null)}finally{B()}}};return(0,$.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[p?null:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{children:`Shortcut`}),I.input]}),I.recording?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Press your shortcut. Esc cancels.`}):null,p?(0,$.jsx)(`p`,{role:`status`,children:p.warning?`Saved, but the shortcut needs attention. Check Advanced for help.`:d?.operation===`remove`?`Shortcut removed.`:`Use ${d?.shortcut} from another app to capture a window.`}):d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:M?d.operation===`remove`?`Review the change below to remove your shortcut.`:`Review the change below, then save your shortcut.`:d.operation===`remove`?`There's no capture shortcut to remove.`:`This shortcut is already set up.`}),R?(0,$.jsx)(`div`,{className:`max-h-80 overflow-auto rounded-lg border text-xs`,"aria-label":`Shortcut changes`,children:(0,$.jsx)(O,{fileDiff:R,options:{diffStyle:`unified`,theme:D(s),overflow:`wrap`}})}):null,M?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only these changes will be saved. We'll keep a backup.`}):null,(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[M||d.operation===`install`?(0,$.jsx)(m,{disabled:L||d.operation===`install`&&e.shortcutActionRegistered===!1,"aria-busy":v===`writing`,onClick:()=>void ee(),children:v===`writing`?`Saving…`:M?d.operation===`install`?`Save shortcut`:`Remove shortcut`:`Done`}):null,(0,$.jsx)(m,{variant:`ghost`,disabled:L,onClick:()=>f(null),children:`Cancel`})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Allow P4 Code to read your desktop settings. You'll review any changes here before saving.`}),(0,$.jsx)(m,{disabled:L||!j,"aria-busy":v===`reading`,onClick:()=>void V(),children:v===`reading`?`Preparing changes…`:`Review changes`}),j?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Update P4 Code to finish setting up your shortcut.`})]}),g?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:g.message}):null,e.shortcutActionRegistered===!1&&e.shortcutMessage?(0,$.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:e.shortcutPending?`Connecting to your desktop…`:`Restart P4 Code to finish connecting your shortcut.`}):null,(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,$.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[g?.detail||p?.warning?(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Troubleshooting`}),(0,$.jsx)(`p`,{className:`break-words`,children:g?.detail??p?.warning})]}):null,(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Settings file`}),(0,$.jsx)(`p`,{className:`break-all font-mono`,children:d?.path??e.shortcutConfigPath??(N?`~/.config/niri/config.kdl`:`~/.config/hypr/hyprland.conf`)}),N?(0,$.jsx)(`p`,{children:`P4 Code also reads any files included by this file.`}):null,d&&d.resolvedPath!==d.path?(0,$.jsxs)(`p`,{className:`break-all`,children:[`Linked to `,d.resolvedPath,`. The link will be kept.`]}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(!0),children:`Choose a different file…`}),(0,$.jsx)(m,{size:`sm`,variant:`ghost`,disabled:L||!j,onClick:()=>void V(T,`remove`),children:`Remove shortcut…`}),p?(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(),children:`Review changes`}):null]}),(0,$.jsxs)(`p`,{children:[`Use your desktop's shortcut settings file.`,` `,N?`A custom --config or NIRI_CONFIG can change its location.`:`On Omarchy, use your own bindings file, not its defaults.`]}),p?.backupPath?(0,$.jsxs)(`p`,{className:`break-all`,children:[`Backup: `,p.backupPath]}):null,(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`Manual setup`}),(0,$.jsxs)(`p`,{children:[N?`Paste this inside binds { … } in your Niri config, then save.`:`Add this binding to your Hyprland config, then save.`,` `,`Change the keys if needed.`]}),(0,$.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-xl bg-muted/50 p-3`,children:e.shortcutBinding}),(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||!e.shortcutBinding,onClick:()=>{e.shortcutBinding&&c(e.shortcutBinding)},children:u?`Copied`:`Copy shortcut`}),(0,$.jsxs)(`p`,{children:[`Turn capture off in P4 Code to stop it. Remove the shortcut from `,P,` to free up the keys.`]}),e.shortcutActionRegistered===!1?(0,$.jsx)(`p`,{role:`status`,children:e.shortcutMessage}):null,a?(0,$.jsx)(m,{size:`sm`,variant:`outline`,disabled:L||e.shortcutActionRegistered===!1,onClick:()=>void a(),children:`I've added the shortcut`}):null]})]})]})}var Ue=[{id:`access`,label:`Access`},{id:`shortcut`,label:`Shortcut`}],We={"not-installed":{title:`Install the extension`,description:`The P4 Code GNOME extension lets you capture other windows and bring them into your draft. Sign out once after installing.`},"restart-required":{title:`Extension installed`,description:`Save your work, then sign out and back in. Your setup will be waiting here.`},"update-required":{title:`Update the extension`,description:`Install the update, then sign out and back in.`},"extensions-disabled":{title:`Allow GNOME extensions`,description:`Open GNOME Extensions and turn on extensions, then check again.`},disabled:{title:`Enable the extension`,description:`Enable P4 Code SnapShots to start capturing windows.`},enabled:{title:`Capture is ready`,description:`Next, choose your shortcut.`},unsupported:{title:`Automatic capture isn't available`,description:`Use Take snapshot from the command palette to choose a window.`},error:{title:`Couldn't set up the extension`,description:`Check P4 Code SnapShots in GNOME Extensions, then try again.`}};function Ge({state:e,initialStep:t,wasEnabled:n,includeAccessibility:r,busy:i,error:a,shortcutInput:o,shortcutStatus:s,shortcutChanged:c,canSaveShortcut:u,onSaveShortcut:d,onEnable:f,onAction:p,onRefresh:h,onClose:g,onLeaveStep:_}){let[v,y]=(0,Y.useState)(()=>Se(e,t)),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)(!1),E=i||b||w,D=Z(e),O=D===`niri`||D===`hyprland`,j=ve(e),M=e.gnomeExtension,N=D===`hyprland`?e.hyprlandHelper:e.kdeHelper,I=D===`kde`||D===`hyprland`,L=D===`hyprland`?`install-hyprland-helper`:`install-kde-helper`,R=D===`hyprland`?`remove-hyprland-helper`:`remove-kde-helper`,z=Q(e),B=ue(async()=>{let e=await h();if(!e?.macPermissions)throw Error(`Permission status unavailable`);return e.macPermissions},e.macPermissions??{screenRecording:!1,accessibility:!1},!!e.macPermissions&&v===`access`&&!E),V=e.macPermissions?B.status:void 0,ee=!V||B.isReady(r?[`screenRecording`,`accessibility`]:[`screenRecording`]),H=xe(e,c),U=M?.status===`not-installed`||M?.status===`update-required`,W=M?.status===`disabled`,te=e=>{_(),C(!1),y(e)},ie=async()=>{if(!E){x(!0),C(!1);try{C(await h()!==void 0)}finally{x(!1)}}},ae=e.message&&!V?{title:`Let's try that again`,description:`Couldn't check snapshots. Try again to continue.`}:D===`gnome`&&M?M.status===`enabled`&&!z?{title:`Check capture access`,description:`The extension isn't ready yet. Try again in a moment.`}:We[M.status]:I?N?.status===`ready`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:N?.status===`error`?{title:`Let's fix capture access`,description:`Try reinstalling the capture helper, then check again.`}:{title:N?.status===`update-required`?`Update the capture helper`:`Allow snapshots`,description:`P4 Code's capture helper lets you capture other apps and return to your draft. It's included with P4 Code.`}:D===`niri`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:D===`picker`?{title:`Choose a window each time`,description:`Your desktop doesn't support automatic capture. You'll choose the window to capture instead.`}:{title:`Allow snapshots`,description:D===`portal`?`Your desktop may ask for permission when you first capture.`:V?ee?`Test a snapshot of the current window. If macOS asks to bypass its window picker, choose Allow. The test image is discarded.`:`Allow each permission, then continue.`:`Allow access when prompted to start capturing windows.`},se=v===`access`?ae.title:`Choose your shortcut`,ce=v===`access`?ae.description:O?`Click the shortcut, then press the keys you want.`:e.mode===`portal`?`Choose your keys, then approve the permission prompt if asked.`:`Use both Shift keys, or record a different shortcut.`,q=Ue.findIndex(({id:e})=>e===v),X=[...new Set([a,...v===`access`?[e.message,D===`gnome`&&(M?.status===`error`||M?.status===`unsupported`)?M.message:null,I&&N?.status===`error`?N.message:null]:[]].filter(e=>e!==null))];return(0,$.jsx)(A,{open:!0,onOpenChange:e=>{!e&&!E&&g(!1)},children:(0,$.jsxs)(re,{showCloseButton:!E,children:[(0,$.jsx)(oe,{title:j?`Set up snapshots for ${j}`:`Set up snapshots`,children:(0,$.jsx)(G,{steps:Ue.map(e=>e.label),currentStep:q,isStepDisabled:e=>E||e>q,onStepChange:e=>{let t=Ue[e];t&&t.id!==v&&te(t.id)}})}),(0,$.jsx)(K,{children:(0,$.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,"aria-live":`polite`,children:[(0,$.jsx)(`h3`,{className:`flex items-center gap-2 font-medium`,children:se}),(0,$.jsx)(k,{children:ce})]}),v===`access`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{role:`status`,"aria-atomic":`true`,className:S&&!E&&!a?`text-xs text-muted-foreground`:`sr-only`,children:S&&!E&&!a?be(e):null}),V?(0,$.jsx)(le,{busy:E,permissions:[{id:`screenRecording`,icon:(0,$.jsx)(P,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Screen Recording`,description:`Capture the window you're using.`,granted:V.screenRecording,onAllow:()=>void p(`allow-screen-recording`)},{id:`accessibility`,icon:(0,$.jsx)(F,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Accessibility`,description:r?`Include text and controls from the captured app.`:`Optional. Include text and controls from the captured app.`,granted:V.accessibility,onAllow:()=>void p(`allow-accessibility`)}]}):null,B.error&&V?(0,$.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:B.error}):null,I&&N?.status===`error`?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:E,onClick:()=>void p(L),children:`Reinstall helper`}):null]}):O?(0,$.jsx)(He,{state:e,disabled:i||b||!z,onBusyChange:T,onSaved:h,onComplete:()=>g(!0)}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[o,s?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:s}):null,!c&&!e.shortcutRegistered&&!e.shortcutPending&&e.shortcutCanRetry!==!1&&!l(e.shortcut)?(0,$.jsx)(m,{variant:`ghost`,size:`sm`,disabled:E,onClick:()=>void p(`retry-shortcut`),children:e.mode===`portal`?`Shortcut permissions`:`Try again`}):null]}),v===`shortcut`&&!z?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Capture needs attention. Go back to check access.`}):null,a?(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Couldn't finish this step. Try again or check Advanced for help.`}):null,X.length>0||v===`access`&&(D===`gnome`||I)?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,$.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[X.map(e=>(0,$.jsx)(`p`,{className:`break-words`,children:e},e)),v===`access`&&(D===`gnome`||I)?(0,$.jsx)(`p`,{children:`Included with P4 Code. No download needed.`}):null,v===`access`&&D===`gnome`&&M?.status===`enabled`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void p(`disable-extension`),children:`Disable extension`}):null,v===`access`&&I&&N?.status!==`not-installed`?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void p(R),children:`Remove capture helper`}):null]})]}):null]})}),(0,$.jsxs)(ne,{children:[v===`access`?null:(0,$.jsx)(m,{variant:`ghost`,disabled:E,onClick:()=>te(`access`),children:`Back`}),(0,$.jsx)(m,{variant:`ghost`,disabled:E,onClick:()=>void g(!1),children:n?`Close`:`Finish later`}),v===`access`?I&&!z&&N?.status!==`ready`?(0,$.jsx)(m,{disabled:E,"aria-busy":E,onClick:()=>void(N?.status===`error`?ie():p(L)),children:b?`Checking…`:E?`Installing…`:N?.status===`error`?`Check again`:N?.status===`update-required`?`Update helper`:`Install helper`}):D===`gnome`&&!z&&M?.status!==`enabled`?(0,$.jsx)(m,{disabled:E,"aria-busy":b,onClick:()=>void(U?p(`install-extension`):W?p(`enable-extension`):ie()),children:b?`Checking…`:E?U?`Installing…`:W?`Enabling…`:`Working…`:U?M?.status===`update-required`?`Update extension`:`Install extension`:W?`Enable extension`:`Check again`}):(0,$.jsx)(J,{ready:ee,busy:E,onClick:async()=>{await f()&&te(`shortcut`)},children:E?`Working…`:V?`Test capture and continue`:D===`direct`?`Allow capture`:!z&&!V?`Try again`:`Continue`}):O?null:(0,$.jsx)(m,{disabled:E||!z||(c?!u:!H),onClick:async()=>{(!c||await d())&&await g(!0)},children:E?`Saving…`:c?`Save and finish`:`Done`})]})]})})}var Ke=`grid grid-cols-[1fr_auto]`;function qe(e,t){return{title:e,message:t instanceof Error?t.message:`Try again.`}}function Je(){let e=C(),t=w(),i=r(T),o=W(),[s,c]=(0,Y.useState)(null),[p,h]=(0,Y.useState)(!1),[_,x]=(0,Y.useState)(null),[S,E]=(0,Y.useState)(null),[D,O]=(0,Y.useState)(e.snapShotShortcut),[k,A]=(0,Y.useState)({status:`idle`,availability:null}),j=(0,Y.useRef)(0),M=(0,Y.useRef)(0),N=Me(!!o),P=!!o&&s!==null&&s.mode!==`unavailable`,F=ke(s),I=e.snapShotShortcut,L=s?.linuxBackend===`niri`||s?.linuxBackend===`hyprland`,H=!L&&!ge(D,I),U=H?D:s?.shortcut??I,ne=H?_e(D,i):null,re=H&&ne===null&&k.availability?.available===!0,G=e.snapShotPlaySound?e.snapShotSound:`off`,oe=G===`off`?`Off`:G===`soft-pop`?`Whoosh (Default)`:`Click`,K=(0,Y.useCallback)(async()=>{let e=++M.current;try{if(o){let t=await o.getSnapShotState();return e===M.current&&c(t),t}}catch(t){e===M.current&&x(qe(`Couldn't check capture setup`,t))}},[o]),le=(0,Y.useCallback)(async e=>{if(o?.setupSnapShot&&!p){h(!0),x(null);try{s?.macPermissions&&S&&(e===`allow-screen-recording`||e===`allow-accessibility`)&&ie(S.wasEnabled),await o.setupSnapShot(e),await K()}catch(t){x(qe(e===`retry-shortcut`?`Couldn't open shortcut permissions`:`Couldn't complete capture setup`,t))}finally{h(!1)}}},[o,K,p,s,S]);(0,Y.useEffect)(()=>{_&&!S&&(b.add({type:`error`,title:_.title,description:_.message}),x(null))},[_,S]),(0,Y.useEffect)(()=>{let e=!1;return K().then(t=>{let n=ae();!e&&t?.macPermissions&&n&&E({initialStep:`access`,wasEnabled:n.wasEnabled})}),window.addEventListener(`focus`,K),()=>{e=!0,window.removeEventListener(`focus`,K)}},[K]),(0,Y.useEffect)(()=>o?.onSnapShotEvent(e=>{e.type===`shortcut-changed`&&K()}),[o,K]),(0,Y.useEffect)(()=>{j.current++,O(I),A({status:`idle`,availability:null})},[I]);let J=(0,Y.useCallback)(async e=>{x(null);try{return await t(e),await K()}catch(e){x(qe(`Couldn't save capture settings`,e))}},[K,t]),ue=(0,Y.useCallback)(async t=>{try{t&&e.snapShotEnabled&&await o?.requestSnapShotPermissions(!0),await J({snapShotIncludeAccessibility:t})}catch(e){x(qe(`Couldn't allow app text capture`,e))}},[o,J,e.snapShotEnabled]),X=(0,Y.useCallback)(async e=>{let t=++j.current;if(O(e),!_e(e,i)&&o){A({status:`checking`,availability:null});try{let n=await o.checkSnapShotShortcut(e);t===j.current&&A({status:`checked`,availability:n})}catch(e){if(t!==j.current)return;A({status:`checked`,availability:{available:!1,message:e instanceof Error?e.message:`Could not check this shortcut.`}})}}},[o,i]),{recording:de,stopRecording:fe,input:pe}=Re({shortcut:U,shortcutLabel:H?void 0:s?.shortcutLabel,disabled:p,allowModifierPairs:s?.mode!==`portal`,onRecord:e=>void X(e),onStart:()=>{j.current++,A({status:`idle`,availability:null})},onError:e=>A({status:`checked`,availability:{available:!1,message:e}})}),me=de?`Press your shortcut. Esc cancels.`:ne?`P4 Code already uses this for "${ee(ne)}".`:k.status===`checking`?`Checking shortcut…`:k.availability?k.availability.available?`Ready to save.`:k.availability.message:s?.mode===`portal`&&!s.shortcutLabel&&l(U)?`Try a shortcut such as Ctrl+Shift+2.`:Ee(s),he=async(t=`resume`)=>{if(s&&!p){fe(),j.current++,O(I),A({status:`idle`,availability:null}),x(null),h(!0);try{let n=await K();if(!n)return;if(n.macPermissions&&(t=`access`),!e.snapShotEnabled&&Se(n,t)!==`access`&&(n=await J({snapShotEnabled:!0}),!n)){E({initialStep:`access`,wasEnabled:!1});return}E({initialStep:Se(n,t),wasEnabled:e.snapShotEnabled})}finally{h(!1)}}},ve=async()=>{if(p)return!1;h(!0),x(null);try{if(s?.macPermissions){if(ie(S?.wasEnabled??e.snapShotEnabled),!o?.setupSnapShot)throw Error(`Restart P4 Code to finish capture setup.`);await o.setupSnapShot(`test-mac-capture`)}s?.mode===`direct`&&await o?.requestSnapShotPermissions(e.snapShotIncludeAccessibility);let t=e.snapShotEnabled&&!s?.message?await K():await J({snapShotEnabled:!0});return t!==void 0&&Q(t)}catch(e){return x(qe(`Couldn't verify capture access`,e)),!1}finally{h(!1)}},Z=async t=>{if(S&&!p){h(!0);try{if(e.snapShotEnabled&&Ce(S.wasEnabled,t)&&!await J({snapShotEnabled:!1}))return;fe(),x(null),se(),E(null)}catch(e){x(qe(`Couldn't close capture setup`,e))}finally{h(!1)}}},ye=async()=>{if(!re||p)return!1;h(!0);try{let e=await J({snapShotShortcut:D});return!!(e?.shortcutRegistered||e?.shortcutPending)}finally{h(!1)}};return(0,$.jsxs)(B,{children:[(0,$.jsx)(V,{id:`snap-shot`,title:`SnapShots`,children:(0,$.jsxs)(z,{message:N,children:[(0,$.jsx)(R,{...q(`snap-shot-enabled`),description:Ae(s),status:o?p&&!S?`Updating capture settings…`:we(s,e.snapShotEnabled):void 0,control:(0,$.jsxs)($.Fragment,{children:[e.snapShotEnabled&&!Oe(s,e.snapShotIncludeAccessibility)?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:p,onClick:()=>void he(),children:De(s)}):null,(0,$.jsx)(ce,{checked:e.snapShotEnabled||!!S,disabled:!P||p,"aria-label":`Enable snapshots`,onCheckedChange:e=>{e?s?.windows?J({snapShotEnabled:!0}):he():J({snapShotEnabled:!1})}})]})}),e.snapShotEnabled&&P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(R,{...q(`snap-shot-accessibility`),description:`Include text and controls when the app makes them available.`,status:je(s),control:(0,$.jsx)(ce,{checked:!je(s)&&e.snapShotIncludeAccessibility,disabled:!P||!!je(s),"aria-label":`Include app text in snapshots`,onCheckedChange:e=>void ue(e)})}),(0,$.jsx)(R,{...q(`snap-shot-shortcut`),description:s?.linuxBackend===`picker`?`Choose a window to capture from any app.`:`Capture the window you're using without switching apps.`,status:L?void 0:me,control:L?(0,$.jsx)(m,{size:`xs`,variant:`outline`,disabled:p,onClick:()=>void he(`shortcut`),children:`Change shortcut`}):(0,$.jsxs)($.Fragment,{children:[pe,H?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m,{size:`xs`,disabled:!re||p,onClick:()=>void ye(),children:p?`Saving…`:`Save`}),(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:p,onClick:()=>{fe(),j.current++,O(I),A({status:`idle`,availability:null})},children:`Cancel`})]}):s?.mode===`portal`&&s.shortcutCanRetry!==!1&&!l(I)?(0,$.jsx)(m,{size:`xs`,variant:`ghost`,disabled:p||s.shortcutPending,onClick:()=>void le(`retry-shortcut`),children:`Shortcut permissions`}):null]})}),(0,$.jsx)(R,{...q(`snap-shot-sound`),description:`Choose the sound played when capture starts.`,control:(0,$.jsxs)(g,{children:[(0,$.jsx)(d,{"aria-label":`Snapshot sound: `+oe,render:(0,$.jsx)(y,{size:`sm`}),className:`w-auto min-w-0`,disabled:!P,children:G===`off`?`Off`:G===`soft-pop`?(0,$.jsxs)($.Fragment,{children:[`Whoosh `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}):`Click`}),(0,$.jsx)(n,{align:`end`,children:(0,$.jsxs)(f,{onValueChange:e=>void J(Ne(e)),value:G,children:[(0,$.jsx)(v,{closeOnClick:!0,value:`off`,children:`Off`}),(0,$.jsxs)(`div`,{className:Ke,children:[(0,$.jsxs)(v,{closeOnClick:!0,value:`soft-pop`,children:[`Whoosh `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}),(0,$.jsx)(u,{"aria-label":`Play Whoosh`,closeOnClick:!1,onClick:()=>te(`soft-pop`),children:(0,$.jsx)(a,{})})]}),(0,$.jsxs)(`div`,{className:Ke,children:[(0,$.jsx)(v,{closeOnClick:!0,value:`camera-shutter`,children:`Click`}),(0,$.jsx)(u,{"aria-label":`Play Click`,closeOnClick:!1,onClick:()=>te(`camera-shutter`),children:(0,$.jsx)(a,{})})]})]})})]})}),(0,$.jsx)(R,{...q(`snap-shot-flash`),description:`Show a gentle cue on the captured window.`,status:F,control:(0,$.jsx)(ce,{checked:!F&&e.snapShotFlash,disabled:!P||!!F,"aria-label":`Flash captured window`,onCheckedChange:e=>void J({snapShotFlash:e})})}),(0,$.jsx)(R,{...q(`snap-shot-animations`),description:`Animate captured windows into your draft.`,status:F,control:(0,$.jsx)(ce,{checked:!F&&e.snapShotAnimations,disabled:!P||!!F,"aria-label":`Animate snapshots`,onCheckedChange:e=>void J({snapShotAnimations:e})})})]}):null]})}),S&&s?(0,$.jsx)(Ge,{state:s,initialStep:S.initialStep,wasEnabled:S.wasEnabled,includeAccessibility:e.snapShotIncludeAccessibility,busy:p,error:_?.message??null,shortcutInput:pe,shortcutStatus:me,shortcutChanged:H,canSaveShortcut:re,onSaveShortcut:ye,onEnable:ve,onAction:le,onRefresh:K,onClose:Z,onLeaveStep:fe}):null]})}function Ye(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Je,{}),e[0]=t):t=e[0],t}export{Ye as component};
|
|
2
|
+
//# sourceMappingURL=settings.snap-shot-Dvf_zwkG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$d as n,Ft as r,Ht as i,It as a,Jt as o,Kn as s,Ns as c,Nt as l,Qd as u,RE as d,RT as f,Vt as p,Zd as m,_h as h,gh as g,iT as _,ih as v,lr as y,mE as b,nT as x,nn as S,t as C,ur as w,xd as T}from"./utils-hgbJ2TVM.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-Dj0uYTJQ.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-Bsag72zE.js";import{t as ee}from"./useNavigate-DCj963r2.js";import{i as te}from"./toast-B3hjhWRf.js";import{F as ne,I as re,N as ie,P as ae,f as oe,z as se}from"./useSettings-BcmuuiTp.js";import{f as ce,t as le}from"./server-Vynm5NwP.js";import{n as ue}from"./query-BFP47tsD.js";import{t as de}from"./use-atom-command-D34CFqu3.js";import{a as fe,n as pe,t as me}from"./tooltip-D-SzZpgJ.js";import{t as I}from"./skeleton-Bq50sEah.js";import{t as he}from"./textarea-wDfYVvpo.js";import{t as ge}from"./input-D_jxqXLR.js";import{a as _e,i as ve,n as L,o as ye,r as be,t as xe}from"./empty-DHl8_LXy.js";import{t as R}from"./sourceControl-b1QZpCro.js";import{g as Se,m as Ce}from"./Icons-C0Zjws-3.js";import{n as we,t as Te}from"./sourceControlClients-DUvOeR-2.js";import{n as z}from"./pullRequestIcons-e8EZW8_y.js";import{B as Ee,F as De,L as Oe,P as ke,a as B,f as V,i as Ae,n as je,o as H,r as Me,s as Ne,t as Pe}from"./settingsLayout-CuUCC6iL.js";import{Ca as Fe,da as U,lr as Ie,nr as Le,pa as Re,pi as ze,sn as Be,tr as W,ua as Ve,ur as He}from"./main-4dRVuXx2.js";import{t as Ue}from"./ProviderModelPicker-DMtMvBKn.js";import{t as We}from"./useScopedModelAvailability-YXOv7_8D.js";import{t as Ge}from"./ProjectDefaultsSettings-DN1GxlYC.js";import{t as Ke}from"./SecretInput-itt3KL-b.js";import{t as qe}from"./ProviderSettingsForm-D6u9dY73.js";var G=d(),K=e(t(),1),q=e(b(),1);function Je({environmentId:e,definition:t,onSaved:n}){let r=oe(e,e=>e.sourceControlHosts[t.kind]),i=de(ce.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,K.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,q.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,q.jsx)(qe,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,q.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,q.jsx)(y,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Ye(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Xe(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var J=`active gh account`;function Y(e){let t=(0,G.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,q.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,q.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:He(e.account)}),(0,q.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Ze({environmentId:e,auth:t,onSaved:r}){let i=oe(e,Te).hosts,a=de(ce.updateSettings,{label:`save GitHub account settings`}),[o,s]=(0,K.useState)(!1),[c,l]=(0,K.useState)(!1),d=Ye(t.accounts??[]),f=async(t,n)=>{s(!0);try{(await a({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Xe(i,t,n)}}}}}))._tag===`Success`&&r()}finally{s(!1)}};return d.length===0?(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,q.jsxs)(`div`,{className:`grid gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>l(e=>!e),"aria-label":c?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":c,children:c?(0,q.jsx)(n,{}):(0,q.jsx)(u,{})})]}),d.map(e=>{let t=i[e.host],n=t?.enabled??!0,r=t?.account!==void 0&&!e.selectable.includes(t.account),a=t?.account!==void 0&&!r?t.account:J;return(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`Signed in as`}),(0,q.jsx)(Y,{revealed:c,account:e.selectable[0]})]}):null]}),(0,q.jsx)(Re,{checked:n,disabled:o,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void f(e.host,{enabled:t})})]}),e.selectable.length>1?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,q.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,q.jsxs)(F,{value:a,disabled:o||!n,onValueChange:t=>{typeof t==`string`&&f(e.host,{account:t===J?null:t})},children:[(0,q.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,q.jsx)(M,{children:t=>t===J?(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]}):(0,q.jsx)(Y,{revealed:c,account:t})})}),(0,q.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,q.jsx)(j,{value:J,children:(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,q.jsx)(j,{value:e,children:(0,q.jsx)(Y,{revealed:c,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,r?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,q.jsx)(y,{size:`xs`,variant:`outline`,disabled:o,onClick:()=>void f(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,q.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,q.jsx)(Y,{revealed:c,account:e.account}),(0,q.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,q.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var X=`github.com`;function Qe(e){return`https://${e}/settings/personal-access-tokens/new`}function $e({environmentId:e,onSaved:t}){let{tokens:n}=oe(e,Te),r=de(ce.updateSettings,{label:`save GitHub token`}),[i,a]=(0,K.useState)(X),[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(!1),u=i.trim().toLowerCase(),d=(n[u]??``).length>0,f=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),p=async(i,a)=>{l(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{l(!1)}};return(0,q.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&p(u,o.trim())},children:(0,q.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,q.jsxs)(w,{render:(0,q.jsx)(`a`,{href:Qe(u||X),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,q.jsx)(m,{"aria-hidden":!0,className:`size-3`})]})]}),(0,q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(ze,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,q.jsx)(ge,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:X,value:i,onChange:e=>a(e.target.value)})]}),(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(ze,{htmlFor:`github-token-${e}`,children:`Token`}),(0,q.jsx)(Ke,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${f.join(`, `)}.`}),(0,q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,q.jsx)(y,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void p(u,``),children:`Remove`}):null,(0,q.jsx)(y,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var et={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,G.c)(40),t=ke(),{targets:n}=Ee(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,K.useRef)(!1),o=(0,K.useRef)(!1),s=Oe(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=De(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=De(u),f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`branchNameInstructions`],e[4]=f):f=e[4];let p=De(f),m,h;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`branchNamingMode`],h=W(`worktree-branch-naming`),e[5]=m,e[6]=h):(m=e[5],h=e[6]);let _=!l&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,y;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(y=t.branchNamingMode!==g.branchNamingMode||l?(0,q.jsx)(Me,{label:`branch naming`,onClick:()=>s({branchNamingMode:g.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=y):y=e[10];let b=l?null:t.branchNamingMode,x;e[11]===s?x=e[12]:(x=e=>{v.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,q.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:v.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,q.jsxs)(F,{value:b,onValueChange:x,children:[S,C]}),e[15]=b,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==_||e[20]!==y?(T=(0,q.jsx)(B,{serverScoped:!0,settingKeys:m,...h,description:`Choose how new worktree branches are named from your first message.`,status:_,resetAction:y,control:w}),e[18]=w,e[19]=_,e[20]=y,e[21]=T):T=e[21];let E;e[22]!==l||e[23]!==d||e[24]!==i||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==s?(E=!l&&t.branchNamingMode===`static`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:d||t.branchNamePrefix!==g.branchNamePrefix?(0,q.jsx)(Me,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:g.branchNamePrefix})}):null,control:(0,q.jsx)(ge,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{a.current=!0},placeholder:d?`Mixed`:`No prefix`,defaultValue:d?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();a.current&&(d||n!==t.branchNamePrefix)&&s({branchNamePrefix:n}),a.current=!1}},`${i}:${d}:${t.branchNamePrefix}`)}):null,e[22]=l,e[23]=d,e[24]=i,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=s,e[28]=E):E=e[28];let D;e[29]!==p||e[30]!==l||e[31]!==i||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==s?(D=!l&&t.branchNamingMode===`custom`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:p||t.branchNameInstructions!==``?(0,q.jsx)(Me,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Branch naming instructions`,onChange:()=>{o.current=!0},rows:4,defaultValue:p?``:t.branchNameInstructions,placeholder:p?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();o.current&&(p||n!==t.branchNameInstructions)&&s({branchNameInstructions:n}),o.current=!1}},`${i}:${p}:${t.branchNameInstructions}`)})}):null,e[29]=p,e[30]=l,e[31]=i,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=s,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,q.jsxs)(q.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,q.jsx)(j,{value:e,children:et[e]},e)}function rt(e){return e===null?`Mixed`:et[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`In each project, matches recent change descriptions and change request titles.`},conventional_commits:{label:`Conventional Commits`,description:`Use Conventional Commit prefixes and keep change request text concise.`},custom:{label:`Custom instructions`,description:`Use your instructions for change descriptions and change requests in every project.`}};function ot(){let e=(0,G.c)(80),t=ke(),n=Oe(),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`reviewGuidesEnabled`],e[0]=s):s=e[0];let u=De(s),d=ee(),{environment:f,connectedEnvironments:m,targets:g,target:_}=Ee(),v=f?.environmentId??null,b=m.length>0,x=f?.serverConfig?.providers??le,C;e[1]===g?C=e[2]:(C=e=>{let t=g[0];return t!==void 0&&g.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=g,e[2]=C);let w=C,T;e[3]===w?T=e[4]:(T=w(`mode`),e[3]=w,e[4]=T);let E=T,D;e[5]===w?D=e[6]:(D=w(`customInstructions`),e[5]=w,e[6]=D);let O=D,k;e[7]===w?k=e[8]:(k=w(`followChangeRequestTemplates`),e[7]=w,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=De(ne),oe;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideModelSelection`],e[10]=oe):oe=e[10];let se=De(oe),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let ue=De(ce),de=(0,K.useRef)(!1),fe;e[12]===g?fe=e[13]:(fe=g.map(mt).join(`,`),e[12]=g,e[13]=fe);let pe=fe,me=(0,K.useRef)(null),[I,ge]=(0,K.useState)(!1),[_e,ve]=(0,K.useState)(null),L=t.sourceControlWritingStyle,ye=h.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=x.filter(pt),R=o(p(i(xe),t,_?.projectId??null)),Se=new Set(R.filter(ft).map(dt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=r(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=r({...t,textGenerationModelSelection:ae(t,Ce,_?.projectId??null)},Ce),V=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),Ae=l(t,Ce,z.instanceId,z.model),H=We(t,R),Pe=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,U=r({...t,textGenerationModelSelection:ie(t,xe,_?.projectId??null)},xe),Ie=l(t,xe,U.instanceId,U.model),Le=R.find(e=>e.instanceId===U.instanceId),ze=Ne,Be;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,q.jsx)(tt,{}),e[14]=Be):Be=e[14];let Ve;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=[`sourceControlWritingStyle`],e[15]=Ve):Ve=e[15];let He;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(He=W(`source-control-writing-style`),e[16]=He):He=e[16];let Ge=at[L.mode],Ke;e[17]!==be||e[18]!==n?(Ke=be?(0,q.jsx)(Me,{label:`source control writing style`,onClick:()=>n({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=n,e[19]=Ke):Ke=e[19];let qe=E?null:L.mode,Je;e[20]===n?Je=e[21]:(Je=e=>{let t=me.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=Je);let Ye;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,q.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,q.jsx)(M,{children:ut})}),e[22]=Ye):Ye=e[22];let Xe;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=Object.keys(at),e[23]=Xe):Xe=e[23];let J;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Xe.map(lt)}),e[24]=J):J=e[24];let Y;e[25]!==qe||e[26]!==Je?(Y=(0,q.jsxs)(F,{value:qe,onValueChange:Je,children:[Ye,J]}),e[25]=qe,e[26]=Je,e[27]=Y):Y=e[27];let Ze;e[28]!==_e||e[29]!==I||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==n||e[33]!==j?(Ze=j?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:I?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(he,{value:_e??``,onChange:e=>ve(e.target.value),rows:4,"aria-label":`Custom source control instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,q.jsx)(y,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,q.jsx)(y,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{ref:me,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep titles concise. Use short bullet points in descriptions.`,"aria-label":`Custom source control writing instructions`},L.customInstructions)}):null,e[28]=_e,e[29]=I,e[30]=L.customInstructions,e[31]=L.mode,e[32]=n,e[33]=j,e[34]=Ze):Ze=e[34];let X;e[35]!==Ge.description||e[36]!==Ke||e[37]!==Y||e[38]!==Ze||e[39]!==j?(X=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Ve,mixed:j,...He,description:Ge.description,resetAction:Ke,control:Y,children:Ze}),e[35]=Ge.description,e[36]=Ke,e[37]=Y,e[38]=Ze,e[39]=j,e[40]=X):X=e[40];let Qe;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=[`sourceControlWritingStyle`],e[41]=Qe):Qe=e[41];let $e;e[42]===Symbol.for(`react.memo_cache_sentinel`)?($e=W(`follow-change-request-templates`),e[42]=$e):$e=e[42];let et;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(et=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,q.jsx)(Me,{label:`change request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=et):et=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,q.jsx)(Re,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow change request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==et||e[54]!==it||e[55]!==A?(ot=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Qe,mixed:A,...$e,description:`Use the repository's template for change request descriptions when available.`,resetAction:et,control:it}),e[53]=et,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=W(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=b?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!V?(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&V?(0,q.jsx)(Ue,{environmentId:v,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ae,triggerClassName:je,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...v?{onOpenProviderSetup:e=>{d({to:`/settings/providers`,search:{environmentId:v,instanceId:e}})}}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Source control writer model not saved`,description:r});return}n({sourceControlWriterModelSelection:c(e,t)})}}):null,Te&&V&&!re&&Pe?(0,q.jsx)(S,{provider:Pe.driverKind,models:Pe.models,model:z.model,prompt:``,onPromptChange:ct,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(z.options),triggerClassName:je,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:c(z.instanceId,z.model,e)})}):null,(0,q.jsx)(Re,{checked:Te,disabled:!Te&&!V,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?c(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,q.jsx)(B,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=W(`review-guides`),e[62]=bt):bt=e[62];let xt=!u&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==u||e[66]!==xt||e[67]!==Z?(Q=(0,q.jsx)(Re,{mixed:u,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=u,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==u||e[70]!==Q?($=(0,q.jsx)(B,{serverScoped:!0,settingKeys:yt,mixed:u,...bt,description:`Adds a Guide tab to pull requests: an agent writes a tour of the change, stop by stop, with the calls a maintainer should make.`,control:Q}),e[69]=u,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...W(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:b?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||se)&&V?(0,q.jsx)(Ue,{environmentId:v,activeInstanceId:U.instanceId,model:U.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ie,triggerClassName:je,triggerAriaLabel:`Review guide model`,...se?{triggerLabel:`Mixed`}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Review guide model not saved`,description:r});return}n({reviewGuideModelSelection:c(e,t)})}}):null,Fe&&V&&!se&&Le?(0,q.jsx)(S,{provider:Le.driverKind,models:Le.models,model:U.model,prompt:``,onPromptChange:st,modelOptions:U.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(U.options),triggerClassName:je,onModelOptionsChange:e=>n({reviewGuideModelSelection:c(U.instanceId,U.model,e)})}):null,(0,q.jsx)(Re,{mixed:se,checked:!se&&Fe,disabled:!Fe&&!V,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=H(z.instanceId,z.model);if(t){te.add({type:`error`,title:`Review guide model not saved`,description:t});return}n({reviewGuideModelSelection:c(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...W(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:ue||t.reviewGuideInstructions!==``?(0,q.jsx)(Me,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Review guide instructions`,onChange:()=>{de.current=!0},rows:4,defaultValue:ue?``:t.reviewGuideInstructions,placeholder:ue?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();de.current&&(ue||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),de.current=!1}},`${pe}:${ue}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==ze||e[73]!==Be||e[74]!==X||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,q.jsxs)(ze,{id:`source-control-text-generation`,title:`Text generation`,children:[Be,X,ot,vt,$,St]}),e[72]=ze,e[73]=Be,e[74]=X,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,q.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:Ce,jj:Se},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(_(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:ne(e),overrides:n}}}function Z(e){return f(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,G.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,q.jsx)(Ie,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,G.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?we.find(n.kind):void 0,c=Q(n)?s&&Be(s):gt[n.kind];if(!c){o=(0,q.jsx)(`span`,{className:C(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,q.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=C(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,q.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,q.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,q.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,q.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:`Authenticated`}),n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,q.jsx)(Ct,{account:n})]}):null,e?(0,q.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,q.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,q.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,q.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,G.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,c=Q(n)?n.auth:null,l;t[2]===c?l=t[3]:(l=c?St(c):null,t[2]=c,t[3]=l);let u=l,d=c?Z(c.account):null,[f,p]=(0,K.useState)(!1),m=r!==void 0,h=V(),g;t[4]!==n.kind||t[5]!==h||t[6]!==p?(g=()=>{(n.kind===`git`&&h===W(`git-fetch-interval`).id||h===Le(n.kind)||n.kind===`github`&&h===W(`github-accounts`).id)&&p(!0)},t[4]=n.kind,t[5]=h,t[6]=p,t[7]=g):g=t[7];let _;t[8]!==n.kind||t[9]!==h?(_=[n.kind,h],t[8]=n.kind,t[9]=h,t[10]=_):_=t[10],(0,K.useEffect)(g,_);let v;t[11]===n?v=t[12]:(v=C(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=v);let b;t[13]===n?b=t[14]:(b=(0,q.jsx)(Tt,{item:n}),t[13]=n,t[14]=b);let x;t[15]===n.label?x=t[16]:(x=(0,q.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=x);let S;t[17]===a?S=t[18]:(S=a?(0,q.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=S);let w;t[19]===n?w=t[20]:(w=$(n)?(0,q.jsx)(s,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=w);let E;t[21]===u?E=t[22]:(E=u?.badge?(0,q.jsx)(s,{variant:u.badge,size:`sm`,children:u.label}):null,t[21]=u,t[22]=E);let D;t[23]!==x||t[24]!==S||t[25]!==w||t[26]!==E||t[27]!==b?(D=(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b,x,S,w,E]}),t[23]=x,t[24]=S,t[25]=w,t[26]=E,t[27]=b,t[28]=D):D=t[28];let O=Et({item:n,auth:c,authAccount:d}),k;t[29]===O?k=t[30]:(k=(0,q.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==m||t[35]!==f||t[36]!==n.label||t[37]!==p?(j=m?(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>p(Ot),"aria-expanded":f,"aria-label":`Toggle ${n.label} details`,children:(0,q.jsx)(T,{className:C(`size-3.5 transition-transform`,f&&`rotate-180`)})}):null,t[34]=m,t[35]=f,t[36]=n.label,t[37]=p,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,q.jsx)(Re,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,q.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==m||t[50]!==f||t[51]!==p?(F=m?(0,q.jsx)(Ve,{open:f,onOpenChange:p,children:(0,q.jsx)(U,{children:(0,q.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=m,t[50]=f,t[51]=p,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==v?(ee=(0,q.jsxs)(`div`,{className:v,children:[P,F]}),t[53]=P,t[54]=F,t[55]=v,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,G.c)(33),t=ke(),n=Oe(),r;e[0]===t?r=e[1]:(r=yt(se(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=yt(re(ne(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=W(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,q.jsx)(Pe,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=C(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,h;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(h=o?(0,q.jsx)(Me,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=h):h=e[12];let g;e[13]!==p||e[14]!==m||e[15]!==h?(g=(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,q.jsx)(`span`,{className:p,"aria-hidden":m,children:h})]}),e[13]=p,e[14]=m,e[15]=h,e[16]=g):g=e[16];let _;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=_):_=e[17];let v;e[18]===g?v=e[19]:(v=(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[g,_]}),e[18]=g,e[19]=v);let y;e[20]!==t.backgroundActivity||e[21]!==n?(y=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:x(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=y):y=e[22];let b;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,q.jsxs)(k,{children:[(0,q.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,q.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,q.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=b):b=e[23];let S;e[24]!==i||e[25]!==y?(S=(0,q.jsx)(A,{value:i,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:y,children:b}),e[24]=i,e[25]=y,e[26]=S):S=e[26];let w;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=w):w=e[27];let T;e[28]===S?T=e[29]:(T=(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[S,w]}),e[28]=S,e[29]=T);let j;return e[30]!==v||e[31]!==T?(j=(0,q.jsx)(H,{id:l,className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[v,T]})}),e[30]=v,e[31]=T,e[32]=j):j=e[32],j}function At(e){let t=(0,G.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(Ne,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,q.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,q.jsx)(I,{className:`size-4.5`}),(0,q.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,q.jsx)(I,{className:`size-7`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,G.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=W(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(_e,{variant:`icon`,children:(0,q.jsx)(z.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,q.jsx)(ye,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,q.jsx)(be,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,q.jsxs)(ve,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,q.jsx)(Fe,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,q.jsx)(L,{children:(0,q.jsxs)(y,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==m?(h=(0,q.jsx)(Ne,{id:o.id,title:`Server environment`,children:(0,q.jsxs)(xe,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=h):h=t[17],h}function Nt(){let e=(0,G.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Ee(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:R.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=ue(o),c=s.data??ht,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=we.find(e);if(t?.settings&&i!==null)return(0,q.jsx)(H,{id:Le(e),children:(0,q.jsx)(Je,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let h=m,g;e[7]===s.isPending?g=e[8]:(g=(0,q.jsx)(Fe,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=g);let _;e[9]!==s.isPending||e[10]!==p||e[11]!==g?(_=(0,q.jsx)(fe,{render:(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:g})}),e[9]=s.isPending,e[10]=p,e[11]=g,e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,q.jsx)(pe,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=v):v=e[13];let b;e[14]===_?b=e[15]:(b=(0,q.jsxs)(me,{children:[_,v]}),e[14]=_,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(Ge,{category:`source-control`}),e[16]=S):S=e[16];let C;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==h||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==x?(C=i===null?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Server environment`,children:(0,q.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(At,{title:`Version Control${a}`,headerAction:x}),(0,q.jsx)(At,{title:`Source Control Providers`})]}):u?(0,q.jsxs)(q.Fragment,{children:[l?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,q.jsx)(Ne,{id:l?void 0:W(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,q.jsx)(Dt,{item:e,children:e.kind===`github`?(0,q.jsx)(H,{id:W(`github-accounts`).id,children:(0,q.jsxs)(`div`,{className:`grid gap-6`,children:[(0,q.jsx)($e,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,q.jsx)(Ze,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):h(e.kind)},`provider:${e.kind}`))}):null]}):(0,q.jsx)(Mt,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=h,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=x,e[29]=C):C=e[29];let w;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(ot,{}),e[30]=w):w=e[30];let T;return e[31]===C?T=e[32]:(T=(0,q.jsxs)(Ae,{children:[S,C,w]}),e[31]=C,e[32]=T),T}function Pt(e){return(0,q.jsx)(Dt,{item:e,children:e.kind===`git`?(0,q.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
|
|
2
|
-
//# sourceMappingURL=settings.source-control-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$d as n,Ft as r,Ht as i,It as a,Jt as o,Kn as s,Ns as c,Nt as l,Qd as u,RE as d,RT as f,Vt as p,Zd as m,_h as h,gh as g,iT as _,ih as v,lr as y,mE as b,nT as x,nn as S,t as C,ur as w,xd as T}from"./utils-hgbJ2TVM.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-Dj0uYTJQ.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-Bsag72zE.js";import{t as ee}from"./useNavigate-DCj963r2.js";import{i as te}from"./toast-CfeQA1vM.js";import{F as ne,I as re,N as ie,P as ae,f as oe,z as se}from"./useSettings-DkjziVJm.js";import{f as ce,t as le}from"./server-BNs54wEo.js";import{n as ue}from"./query-BFP47tsD.js";import{t as de}from"./use-atom-command-BCNOgemk.js";import{a as fe,n as pe,t as me}from"./tooltip-D-SzZpgJ.js";import{t as I}from"./skeleton-Bq50sEah.js";import{t as he}from"./textarea-wDfYVvpo.js";import{t as ge}from"./input-D_jxqXLR.js";import{a as _e,i as ve,n as L,o as ye,r as be,t as xe}from"./empty-DHl8_LXy.js";import{t as R}from"./sourceControl-wI790oDs.js";import{g as Se,m as Ce}from"./Icons-C0Zjws-3.js";import{n as we,t as Te}from"./sourceControlClients-CKlG76Mu.js";import{n as z}from"./pullRequestIcons-e8EZW8_y.js";import{B as Ee,F as De,L as Oe,P as ke,a as B,f as V,i as Ae,n as je,o as H,r as Me,s as Ne,t as Pe}from"./settingsLayout-BloLque1.js";import{Ca as Fe,da as U,lr as Ie,nr as Le,pa as Re,pi as ze,sn as Be,tr as W,ua as Ve,ur as He}from"./main-DTxzRLjF.js";import{t as Ue}from"./ProviderModelPicker-DqLbhWdo.js";import{t as We}from"./useScopedModelAvailability-DL2tq_KI.js";import{t as Ge}from"./ProjectDefaultsSettings-DY_6-1vn.js";import{t as Ke}from"./SecretInput-itt3KL-b.js";import{t as qe}from"./ProviderSettingsForm-DLBbky90.js";var G=d(),K=e(t(),1),q=e(b(),1);function Je({environmentId:e,definition:t,onSaved:n}){let r=oe(e,e=>e.sourceControlHosts[t.kind]),i=de(ce.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,K.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,q.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,q.jsx)(qe,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,q.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,q.jsx)(y,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Ye(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Xe(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var J=`active gh account`;function Y(e){let t=(0,G.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,q.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,q.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:He(e.account)}),(0,q.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Ze({environmentId:e,auth:t,onSaved:r}){let i=oe(e,Te).hosts,a=de(ce.updateSettings,{label:`save GitHub account settings`}),[o,s]=(0,K.useState)(!1),[c,l]=(0,K.useState)(!1),d=Ye(t.accounts??[]),f=async(t,n)=>{s(!0);try{(await a({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Xe(i,t,n)}}}}}))._tag===`Success`&&r()}finally{s(!1)}};return d.length===0?(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,q.jsxs)(`div`,{className:`grid gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>l(e=>!e),"aria-label":c?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":c,children:c?(0,q.jsx)(n,{}):(0,q.jsx)(u,{})})]}),d.map(e=>{let t=i[e.host],n=t?.enabled??!0,r=t?.account!==void 0&&!e.selectable.includes(t.account),a=t?.account!==void 0&&!r?t.account:J;return(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`Signed in as`}),(0,q.jsx)(Y,{revealed:c,account:e.selectable[0]})]}):null]}),(0,q.jsx)(Re,{checked:n,disabled:o,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void f(e.host,{enabled:t})})]}),e.selectable.length>1?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,q.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,q.jsxs)(F,{value:a,disabled:o||!n,onValueChange:t=>{typeof t==`string`&&f(e.host,{account:t===J?null:t})},children:[(0,q.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,q.jsx)(M,{children:t=>t===J?(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]}):(0,q.jsx)(Y,{revealed:c,account:t})})}),(0,q.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,q.jsx)(j,{value:J,children:(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:c,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,q.jsx)(j,{value:e,children:(0,q.jsx)(Y,{revealed:c,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,r?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,q.jsx)(y,{size:`xs`,variant:`outline`,disabled:o,onClick:()=>void f(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,q.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,q.jsx)(Y,{revealed:c,account:e.account}),(0,q.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,q.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var X=`github.com`;function Qe(e){return`https://${e}/settings/personal-access-tokens/new`}function $e({environmentId:e,onSaved:t}){let{tokens:n}=oe(e,Te),r=de(ce.updateSettings,{label:`save GitHub token`}),[i,a]=(0,K.useState)(X),[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(!1),u=i.trim().toLowerCase(),d=(n[u]??``).length>0,f=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),p=async(i,a)=>{l(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{l(!1)}};return(0,q.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&p(u,o.trim())},children:(0,q.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,q.jsxs)(w,{render:(0,q.jsx)(`a`,{href:Qe(u||X),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,q.jsx)(m,{"aria-hidden":!0,className:`size-3`})]})]}),(0,q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(ze,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,q.jsx)(ge,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:X,value:i,onChange:e=>a(e.target.value)})]}),(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(ze,{htmlFor:`github-token-${e}`,children:`Token`}),(0,q.jsx)(Ke,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${f.join(`, `)}.`}),(0,q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,q.jsx)(y,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void p(u,``),children:`Remove`}):null,(0,q.jsx)(y,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var et={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,G.c)(40),t=ke(),{targets:n}=Ee(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,K.useRef)(!1),o=(0,K.useRef)(!1),s=Oe(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=De(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=De(u),f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`branchNameInstructions`],e[4]=f):f=e[4];let p=De(f),m,h;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`branchNamingMode`],h=W(`worktree-branch-naming`),e[5]=m,e[6]=h):(m=e[5],h=e[6]);let _=!l&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,y;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(y=t.branchNamingMode!==g.branchNamingMode||l?(0,q.jsx)(Me,{label:`branch naming`,onClick:()=>s({branchNamingMode:g.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=y):y=e[10];let b=l?null:t.branchNamingMode,x;e[11]===s?x=e[12]:(x=e=>{v.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,q.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:v.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,q.jsxs)(F,{value:b,onValueChange:x,children:[S,C]}),e[15]=b,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==_||e[20]!==y?(T=(0,q.jsx)(B,{serverScoped:!0,settingKeys:m,...h,description:`Choose how new worktree branches are named from your first message.`,status:_,resetAction:y,control:w}),e[18]=w,e[19]=_,e[20]=y,e[21]=T):T=e[21];let E;e[22]!==l||e[23]!==d||e[24]!==i||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==s?(E=!l&&t.branchNamingMode===`static`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:d||t.branchNamePrefix!==g.branchNamePrefix?(0,q.jsx)(Me,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:g.branchNamePrefix})}):null,control:(0,q.jsx)(ge,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{a.current=!0},placeholder:d?`Mixed`:`No prefix`,defaultValue:d?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();a.current&&(d||n!==t.branchNamePrefix)&&s({branchNamePrefix:n}),a.current=!1}},`${i}:${d}:${t.branchNamePrefix}`)}):null,e[22]=l,e[23]=d,e[24]=i,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=s,e[28]=E):E=e[28];let D;e[29]!==p||e[30]!==l||e[31]!==i||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==s?(D=!l&&t.branchNamingMode===`custom`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:p||t.branchNameInstructions!==``?(0,q.jsx)(Me,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Branch naming instructions`,onChange:()=>{o.current=!0},rows:4,defaultValue:p?``:t.branchNameInstructions,placeholder:p?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();o.current&&(p||n!==t.branchNameInstructions)&&s({branchNameInstructions:n}),o.current=!1}},`${i}:${p}:${t.branchNameInstructions}`)})}):null,e[29]=p,e[30]=l,e[31]=i,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=s,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,q.jsxs)(q.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,q.jsx)(j,{value:e,children:et[e]},e)}function rt(e){return e===null?`Mixed`:et[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`In each project, matches recent change descriptions and change request titles.`},conventional_commits:{label:`Conventional Commits`,description:`Use Conventional Commit prefixes and keep change request text concise.`},custom:{label:`Custom instructions`,description:`Use your instructions for change descriptions and change requests in every project.`}};function ot(){let e=(0,G.c)(80),t=ke(),n=Oe(),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`reviewGuidesEnabled`],e[0]=s):s=e[0];let u=De(s),d=ee(),{environment:f,connectedEnvironments:m,targets:g,target:_}=Ee(),v=f?.environmentId??null,b=m.length>0,x=f?.serverConfig?.providers??le,C;e[1]===g?C=e[2]:(C=e=>{let t=g[0];return t!==void 0&&g.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=g,e[2]=C);let w=C,T;e[3]===w?T=e[4]:(T=w(`mode`),e[3]=w,e[4]=T);let E=T,D;e[5]===w?D=e[6]:(D=w(`customInstructions`),e[5]=w,e[6]=D);let O=D,k;e[7]===w?k=e[8]:(k=w(`followChangeRequestTemplates`),e[7]=w,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=De(ne),oe;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideModelSelection`],e[10]=oe):oe=e[10];let se=De(oe),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let ue=De(ce),de=(0,K.useRef)(!1),fe;e[12]===g?fe=e[13]:(fe=g.map(mt).join(`,`),e[12]=g,e[13]=fe);let pe=fe,me=(0,K.useRef)(null),[I,ge]=(0,K.useState)(!1),[_e,ve]=(0,K.useState)(null),L=t.sourceControlWritingStyle,ye=h.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=x.filter(pt),R=o(p(i(xe),t,_?.projectId??null)),Se=new Set(R.filter(ft).map(dt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=r(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=r({...t,textGenerationModelSelection:ae(t,Ce,_?.projectId??null)},Ce),V=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),Ae=l(t,Ce,z.instanceId,z.model),H=We(t,R),Pe=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,U=r({...t,textGenerationModelSelection:ie(t,xe,_?.projectId??null)},xe),Ie=l(t,xe,U.instanceId,U.model),Le=R.find(e=>e.instanceId===U.instanceId),ze=Ne,Be;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,q.jsx)(tt,{}),e[14]=Be):Be=e[14];let Ve;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=[`sourceControlWritingStyle`],e[15]=Ve):Ve=e[15];let He;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(He=W(`source-control-writing-style`),e[16]=He):He=e[16];let Ge=at[L.mode],Ke;e[17]!==be||e[18]!==n?(Ke=be?(0,q.jsx)(Me,{label:`source control writing style`,onClick:()=>n({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=n,e[19]=Ke):Ke=e[19];let qe=E?null:L.mode,Je;e[20]===n?Je=e[21]:(Je=e=>{let t=me.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=Je);let Ye;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,q.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,q.jsx)(M,{children:ut})}),e[22]=Ye):Ye=e[22];let Xe;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=Object.keys(at),e[23]=Xe):Xe=e[23];let J;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Xe.map(lt)}),e[24]=J):J=e[24];let Y;e[25]!==qe||e[26]!==Je?(Y=(0,q.jsxs)(F,{value:qe,onValueChange:Je,children:[Ye,J]}),e[25]=qe,e[26]=Je,e[27]=Y):Y=e[27];let Ze;e[28]!==_e||e[29]!==I||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==n||e[33]!==j?(Ze=j?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:I?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(he,{value:_e??``,onChange:e=>ve(e.target.value),rows:4,"aria-label":`Custom source control instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,q.jsx)(y,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,q.jsx)(y,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{ref:me,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep titles concise. Use short bullet points in descriptions.`,"aria-label":`Custom source control writing instructions`},L.customInstructions)}):null,e[28]=_e,e[29]=I,e[30]=L.customInstructions,e[31]=L.mode,e[32]=n,e[33]=j,e[34]=Ze):Ze=e[34];let X;e[35]!==Ge.description||e[36]!==Ke||e[37]!==Y||e[38]!==Ze||e[39]!==j?(X=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Ve,mixed:j,...He,description:Ge.description,resetAction:Ke,control:Y,children:Ze}),e[35]=Ge.description,e[36]=Ke,e[37]=Y,e[38]=Ze,e[39]=j,e[40]=X):X=e[40];let Qe;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=[`sourceControlWritingStyle`],e[41]=Qe):Qe=e[41];let $e;e[42]===Symbol.for(`react.memo_cache_sentinel`)?($e=W(`follow-change-request-templates`),e[42]=$e):$e=e[42];let et;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(et=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,q.jsx)(Me,{label:`change request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=et):et=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,q.jsx)(Re,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow change request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==et||e[54]!==it||e[55]!==A?(ot=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Qe,mixed:A,...$e,description:`Use the repository's template for change request descriptions when available.`,resetAction:et,control:it}),e[53]=et,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=W(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=b?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!V?(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&V?(0,q.jsx)(Ue,{environmentId:v,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ae,triggerClassName:je,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...v?{onOpenProviderSetup:e=>{d({to:`/settings/providers`,search:{environmentId:v,instanceId:e}})}}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Source control writer model not saved`,description:r});return}n({sourceControlWriterModelSelection:c(e,t)})}}):null,Te&&V&&!re&&Pe?(0,q.jsx)(S,{provider:Pe.driverKind,models:Pe.models,model:z.model,prompt:``,onPromptChange:ct,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(z.options),triggerClassName:je,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:c(z.instanceId,z.model,e)})}):null,(0,q.jsx)(Re,{checked:Te,disabled:!Te&&!V,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?c(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,q.jsx)(B,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=W(`review-guides`),e[62]=bt):bt=e[62];let xt=!u&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==u||e[66]!==xt||e[67]!==Z?(Q=(0,q.jsx)(Re,{mixed:u,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=u,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==u||e[70]!==Q?($=(0,q.jsx)(B,{serverScoped:!0,settingKeys:yt,mixed:u,...bt,description:`Adds a Guide tab to pull requests: an agent writes a tour of the change, stop by stop, with the calls a maintainer should make.`,control:Q}),e[69]=u,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...W(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:b?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||se)&&V?(0,q.jsx)(Ue,{environmentId:v,activeInstanceId:U.instanceId,model:U.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ie,triggerClassName:je,triggerAriaLabel:`Review guide model`,...se?{triggerLabel:`Mixed`}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Review guide model not saved`,description:r});return}n({reviewGuideModelSelection:c(e,t)})}}):null,Fe&&V&&!se&&Le?(0,q.jsx)(S,{provider:Le.driverKind,models:Le.models,model:U.model,prompt:``,onPromptChange:st,modelOptions:U.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(U.options),triggerClassName:je,onModelOptionsChange:e=>n({reviewGuideModelSelection:c(U.instanceId,U.model,e)})}):null,(0,q.jsx)(Re,{mixed:se,checked:!se&&Fe,disabled:!Fe&&!V,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=H(z.instanceId,z.model);if(t){te.add({type:`error`,title:`Review guide model not saved`,description:t});return}n({reviewGuideModelSelection:c(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...W(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:ue||t.reviewGuideInstructions!==``?(0,q.jsx)(Me,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Review guide instructions`,onChange:()=>{de.current=!0},rows:4,defaultValue:ue?``:t.reviewGuideInstructions,placeholder:ue?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();de.current&&(ue||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),de.current=!1}},`${pe}:${ue}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==ze||e[73]!==Be||e[74]!==X||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,q.jsxs)(ze,{id:`source-control-text-generation`,title:`Text generation`,children:[Be,X,ot,vt,$,St]}),e[72]=ze,e[73]=Be,e[74]=X,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,q.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:Ce,jj:Se},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(_(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:ne(e),overrides:n}}}function Z(e){return f(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,G.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,q.jsx)(Ie,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,G.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?we.find(n.kind):void 0,c=Q(n)?s&&Be(s):gt[n.kind];if(!c){o=(0,q.jsx)(`span`,{className:C(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,q.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=C(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,q.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,q.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,q.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,q.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:`Authenticated`}),n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,q.jsx)(Ct,{account:n})]}):null,e?(0,q.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,q.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,q.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,q.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,G.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,c=Q(n)?n.auth:null,l;t[2]===c?l=t[3]:(l=c?St(c):null,t[2]=c,t[3]=l);let u=l,d=c?Z(c.account):null,[f,p]=(0,K.useState)(!1),m=r!==void 0,h=V(),g;t[4]!==n.kind||t[5]!==h||t[6]!==p?(g=()=>{(n.kind===`git`&&h===W(`git-fetch-interval`).id||h===Le(n.kind)||n.kind===`github`&&h===W(`github-accounts`).id)&&p(!0)},t[4]=n.kind,t[5]=h,t[6]=p,t[7]=g):g=t[7];let _;t[8]!==n.kind||t[9]!==h?(_=[n.kind,h],t[8]=n.kind,t[9]=h,t[10]=_):_=t[10],(0,K.useEffect)(g,_);let v;t[11]===n?v=t[12]:(v=C(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=v);let b;t[13]===n?b=t[14]:(b=(0,q.jsx)(Tt,{item:n}),t[13]=n,t[14]=b);let x;t[15]===n.label?x=t[16]:(x=(0,q.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=x);let S;t[17]===a?S=t[18]:(S=a?(0,q.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=S);let w;t[19]===n?w=t[20]:(w=$(n)?(0,q.jsx)(s,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=w);let E;t[21]===u?E=t[22]:(E=u?.badge?(0,q.jsx)(s,{variant:u.badge,size:`sm`,children:u.label}):null,t[21]=u,t[22]=E);let D;t[23]!==x||t[24]!==S||t[25]!==w||t[26]!==E||t[27]!==b?(D=(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b,x,S,w,E]}),t[23]=x,t[24]=S,t[25]=w,t[26]=E,t[27]=b,t[28]=D):D=t[28];let O=Et({item:n,auth:c,authAccount:d}),k;t[29]===O?k=t[30]:(k=(0,q.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==m||t[35]!==f||t[36]!==n.label||t[37]!==p?(j=m?(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>p(Ot),"aria-expanded":f,"aria-label":`Toggle ${n.label} details`,children:(0,q.jsx)(T,{className:C(`size-3.5 transition-transform`,f&&`rotate-180`)})}):null,t[34]=m,t[35]=f,t[36]=n.label,t[37]=p,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,q.jsx)(Re,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,q.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==m||t[50]!==f||t[51]!==p?(F=m?(0,q.jsx)(Ve,{open:f,onOpenChange:p,children:(0,q.jsx)(U,{children:(0,q.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=m,t[50]=f,t[51]=p,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==v?(ee=(0,q.jsxs)(`div`,{className:v,children:[P,F]}),t[53]=P,t[54]=F,t[55]=v,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,G.c)(33),t=ke(),n=Oe(),r;e[0]===t?r=e[1]:(r=yt(se(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=yt(re(ne(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=W(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,q.jsx)(Pe,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=C(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,h;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(h=o?(0,q.jsx)(Me,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=h):h=e[12];let g;e[13]!==p||e[14]!==m||e[15]!==h?(g=(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,q.jsx)(`span`,{className:p,"aria-hidden":m,children:h})]}),e[13]=p,e[14]=m,e[15]=h,e[16]=g):g=e[16];let _;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=_):_=e[17];let v;e[18]===g?v=e[19]:(v=(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[g,_]}),e[18]=g,e[19]=v);let y;e[20]!==t.backgroundActivity||e[21]!==n?(y=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:x(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=y):y=e[22];let b;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,q.jsxs)(k,{children:[(0,q.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,q.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,q.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=b):b=e[23];let S;e[24]!==i||e[25]!==y?(S=(0,q.jsx)(A,{value:i,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:y,children:b}),e[24]=i,e[25]=y,e[26]=S):S=e[26];let w;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=w):w=e[27];let T;e[28]===S?T=e[29]:(T=(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[S,w]}),e[28]=S,e[29]=T);let j;return e[30]!==v||e[31]!==T?(j=(0,q.jsx)(H,{id:l,className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[v,T]})}),e[30]=v,e[31]=T,e[32]=j):j=e[32],j}function At(e){let t=(0,G.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(Ne,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,q.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,q.jsx)(I,{className:`size-4.5`}),(0,q.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,q.jsx)(I,{className:`size-7`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,G.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=W(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(_e,{variant:`icon`,children:(0,q.jsx)(z.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,q.jsx)(ye,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,q.jsx)(be,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,q.jsxs)(ve,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,q.jsx)(Fe,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,q.jsx)(L,{children:(0,q.jsxs)(y,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==m?(h=(0,q.jsx)(Ne,{id:o.id,title:`Server environment`,children:(0,q.jsxs)(xe,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=h):h=t[17],h}function Nt(){let e=(0,G.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Ee(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:R.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=ue(o),c=s.data??ht,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=we.find(e);if(t?.settings&&i!==null)return(0,q.jsx)(H,{id:Le(e),children:(0,q.jsx)(Je,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let h=m,g;e[7]===s.isPending?g=e[8]:(g=(0,q.jsx)(Fe,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=g);let _;e[9]!==s.isPending||e[10]!==p||e[11]!==g?(_=(0,q.jsx)(fe,{render:(0,q.jsx)(y,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:g})}),e[9]=s.isPending,e[10]=p,e[11]=g,e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,q.jsx)(pe,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=v):v=e[13];let b;e[14]===_?b=e[15]:(b=(0,q.jsxs)(me,{children:[_,v]}),e[14]=_,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(Ge,{category:`source-control`}),e[16]=S):S=e[16];let C;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==h||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==x?(C=i===null?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Server environment`,children:(0,q.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(At,{title:`Version Control${a}`,headerAction:x}),(0,q.jsx)(At,{title:`Source Control Providers`})]}):u?(0,q.jsxs)(q.Fragment,{children:[l?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,q.jsx)(Ne,{id:l?void 0:W(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,q.jsx)(Dt,{item:e,children:e.kind===`github`?(0,q.jsx)(H,{id:W(`github-accounts`).id,children:(0,q.jsxs)(`div`,{className:`grid gap-6`,children:[(0,q.jsx)($e,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,q.jsx)(Ze,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):h(e.kind)},`provider:${e.kind}`))}):null]}):(0,q.jsx)(Mt,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=h,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=x,e[29]=C):C=e[29];let w;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(ot,{}),e[30]=w):w=e[30];let T;return e[31]===C?T=e[32]:(T=(0,q.jsxs)(Ae,{children:[S,C,w]}),e[31]=C,e[32]=T),T}function Pt(e){return(0,q.jsx)(Dt,{item:e,children:e.kind===`git`?(0,q.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
|
|
2
|
+
//# sourceMappingURL=settings.source-control-twI2L8vl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,RE as r,lr as i,mE as a,rs as o}from"./utils-hgbJ2TVM.js";import{R as s,W as c}from"./runtime-Cj24N7je.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-Dj0uYTJQ.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-Bsag72zE.js";import{i as y}from"./toast-B3hjhWRf.js";import{f as b}from"./server-Vynm5NwP.js";import{t as x}from"./use-atom-command-D34CFqu3.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-D_jxqXLR.js";import{a as w}from"./p4ProjectFile-YfIRB1xP.js";import{B as T,F as E,L as D,M as O,P as k,U as A,a as j,i as M,r as N,s as P,u as F}from"./settingsLayout-CuUCC6iL.js";import{pa as I,tr as L}from"./main-4dRVuXx2.js";import{t as R}from"./FoldedSettingsSection-TLqDB_1b.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-D8K81IzP.js";var V=r(),H=e(t(),1),U=e(a(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=T(),r=k(),i=D(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=E(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=L(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(N,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(j,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(I,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(j,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){F(6e4);let{connectedEnvironments:e}=T(),[t,r]=(0,H.useState)(!1),a=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=n((0,H.useMemo)(()=>o(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){r(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await a({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{r(!1)}}};return(0,U.jsxs)(P,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(A,{children:(0,U.jsx)(j,{...L(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(i,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=T(),a=k(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=D(),S=O(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let E=C,A;e[15]===x?A=e[16]:(A=e=>x({storageCleanup:e}),e[15]=x,e[16]=A);let N=A,F;e[17]!==o||e[18]!==N||e[19]!==x?(F=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):N(e),e[17]=o,e[18]=N,e[19]=x,e[20]=F):F=e[20];let R=F;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(j,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==E||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(j,{title:`Delete worktrees with deleted threads`,status:E(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(j,{title:`Delete inactive worktrees`,status:E(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete merged worktrees`,status:E(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(j,{title:`Delete unchanged worktrees`,status:E(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(j,{...L(`storage-worktree-keep-when`),status:E(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:E(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:E(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=E,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(P,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==E||e[48]!==u||e[49]!==N?(Y=!o&&(0,U.jsxs)(P,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(j,{title:`Delete old browser artifacts`,status:E(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>N({browserArtifactsAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete old rotated logs`,status:E(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>N({logsAfterDays:e})})})]}),e[46]=o,e[47]=E,e[48]=u,e[49]=N,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(M,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
|
|
2
|
-
//# sourceMappingURL=settings.storage-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,RE as r,lr as i,mE as a,rs as o}from"./utils-hgbJ2TVM.js";import{R as s,W as c}from"./runtime-DPOrcghx.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-Dj0uYTJQ.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-Bsag72zE.js";import{i as y}from"./toast-CfeQA1vM.js";import{f as b}from"./server-BNs54wEo.js";import{t as x}from"./use-atom-command-BCNOgemk.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-D_jxqXLR.js";import{a as w}from"./p4ProjectFile-B8OhdeMF.js";import{B as T,F as E,L as D,M as O,P as k,U as A,a as j,i as M,r as N,s as P,u as F}from"./settingsLayout-BloLque1.js";import{pa as I,tr as L}from"./main-DTxzRLjF.js";import{t as R}from"./FoldedSettingsSection-TSMWCMo5.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-FZ1p4m0I.js";var V=r(),H=e(t(),1),U=e(a(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=T(),r=k(),i=D(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=E(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=L(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(N,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(j,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(I,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(j,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){F(6e4);let{connectedEnvironments:e}=T(),[t,r]=(0,H.useState)(!1),a=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=n((0,H.useMemo)(()=>o(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){r(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await a({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{r(!1)}}};return(0,U.jsxs)(P,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(A,{children:(0,U.jsx)(j,{...L(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(i,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=T(),a=k(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=D(),S=O(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let E=C,A;e[15]===x?A=e[16]:(A=e=>x({storageCleanup:e}),e[15]=x,e[16]=A);let N=A,F;e[17]!==o||e[18]!==N||e[19]!==x?(F=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):N(e),e[17]=o,e[18]=N,e[19]=x,e[20]=F):F=e[20];let R=F;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(j,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==E||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(j,{title:`Delete worktrees with deleted threads`,status:E(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(j,{title:`Delete inactive worktrees`,status:E(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete merged worktrees`,status:E(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(j,{title:`Delete unchanged worktrees`,status:E(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(j,{...L(`storage-worktree-keep-when`),status:E(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:E(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:E(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=E,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(P,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==E||e[48]!==u||e[49]!==N?(Y=!o&&(0,U.jsxs)(P,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(j,{title:`Delete old browser artifacts`,status:E(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>N({browserArtifactsAfterDays:e})})}),(0,U.jsx)(j,{title:`Delete old rotated logs`,status:E(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>N({logsAfterDays:e})})})]}),e[46]=o,e[47]=E,e[48]=u,e[49]=N,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(M,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
|
|
2
|
+
//# sourceMappingURL=settings.storage-af4E8nEQ.js.map
|