@p4code/cli 0.8.13 → 0.8.14
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-B9aQxlIK.mjs → binCli-BvhJ8Jqb.mjs} +253 -102
- package/dist/client/.vite/manifest.json +1283 -1283
- package/dist/client/assets/{AuthSurfaceShell-CJdXkxyH.js → AuthSurfaceShell-Dfm2iXjM.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-7u9uPgbK.js → ChatGptUsageButton-BE2a_fvh.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-C22JFyYa.js → ChatMarkdown-2qihmx2E.js} +4 -4
- package/dist/client/assets/{CodexSetupSection.logic-CEAT7YdZ.js → CodexSetupSection.logic-CZIedhFM.js} +2 -2
- package/dist/client/assets/{CommandBlock-CWt29kmi.js → CommandBlock-cV3B4sIS.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Bt_L4smq.js → ComposerPromptEditor-l0YJjut-.js} +4 -4
- package/dist/client/assets/{DevicePanel-CZm-f5TC.js → DevicePanel-CyqJ_QAv.js} +2 -2
- package/dist/client/assets/{DeviceSetup-BdrkGme6.js → DeviceSetup-B9gRys_T.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-B-XoYYxb.js → DiffCommentAnnotation-DqJdp0B7.js} +2 -2
- package/dist/client/assets/{DiffFileTree-CwTkSU3R.js → DiffFileTree-C0BZv_u5.js} +2 -2
- package/dist/client/assets/{DiffPanel-BCI9XXpF.js → DiffPanel-DvpW3Wct.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-OPZsOibX.js → DiffWorkerPoolProvider-C0s_fra9.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-DwRAPHYl.js → EmbeddedDesign-DGCXXVf5.js} +2 -2
- package/dist/client/assets/{FileDiff-BkJG5QAe.js → FileDiff-BtKZeeO5.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-CURtQAD1.js → FilePreviewPanel-DzVGuSCc.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-B9B8i8Gg.js → FoldedSettingsSection-VCEXXLW3.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CkhVaJk9.js → NoProjectsHero-BQBJO2CN.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CxuV0JO3.js → PanelLayoutControls-DnSdAhOm.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-CPG-jnaN.js → PierreEntryIcon-B1r7qMgq.js} +2 -2
- package/dist/client/assets/{PreviewPanel-Doh1peEu.js → PreviewPanel-CtXaNx5N.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-DfhAk0_Y.js → ProjectDefaultsSettings-BYtlqxeq.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-DUW6Bo66.js → ProjectFavicon-B5bWp7V6.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-C613hnVY.js → ProjectIconPickerDialog-BWSyrwJD.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-eq346NX_.js → ProviderAuthTerminal-B2L5_uXE.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DPb-88ui.js → ProviderModelPicker-B8ibbi9S.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-DTYqzs8W.js → ProviderSettingsForm-DYn7It9I.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-BBz0FfLD.js → PullRequestCodeTab-BfSQc1r1.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-CkeeLVAm.js → ReadOnlySourcePreview-8MghAaC9.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-mfAvIiFU.js → RenderErrorBoundary-Dm9BLD1I.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-BMUE9M9Z.js → ScheduledTasksSettings-ClZG_1G7.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BKOdsllO.js → ScopedSwitch-C7nxtEAT.js} +2 -2
- package/dist/client/assets/{SettingsPanels-BHhMJaVc.js → SettingsPanels-kXpGLc3M.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-BwmY39Sq.js → SettingsPanels.logic-CcNyZsm-.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DAPsshab.js → SettingsScopeNotice-CM4ubyNs.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-CDuVbE2z.js → T3ConnectAccountPages-Cm4JG3hx.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-BSQHp-Xq.js → T3ConnectSidebarSignIn-CmvCTtlG.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BiuI7Uiy.js → ThemeEditorPanel-kOwPAMtd.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-B8n6TAqv.js → ThreadTerminalDrawer-CK0khkH6.js} +2 -2
- package/dist/client/assets/{Virtualizer-CTnacEby.js → Virtualizer-B895TWmX.js} +2 -2
- package/dist/client/assets/{_chat-z348gvgF.js → _chat-akhFQFVf.js} +5 -5
- package/dist/client/assets/{_chat.index-CBbUzaK7.js → _chat.index-P-ZRID1j.js} +2 -2
- package/dist/client/assets/{_chat.new-7TTfcDf1.js → _chat.new-DXkFcRYp.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-BE7Q2lUu.js → _chat.pull-requests-BYR5YTIM.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-HaXM7twL.js → abnfDiagram-VCTEODGH-CcoyEMJc.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-BCI44Tco.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-BhWXFsXS.js → architectureDiagram-5GKGNRK7-CXxubV6d.js} +2 -2
- package/dist/client/assets/{assets-DXnV2oRj.js → assets-C7tdule6.js} +2 -2
- package/dist/client/assets/{blockDiagram-I7D4REHJ-D213N9iF.js → blockDiagram-I7D4REHJ-DWnNJQVf.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-DURO3U2L.js → browserHistoryStore-PqPCT4tW.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-DcGx3A8F.js → browserLinkTarget-CWURM-O2.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-58POuQV-.js → c4Diagram-7LVT6UL2-DKlxhhfG.js} +2 -2
- package/dist/client/assets/channel-FPHxEbB1.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-Bcwcw8Wz.js → chunk-4HAMMTFA-BXCbWh-l.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-BaYdZ0Fq.js → chunk-75Z2AOVW-ByRA_PDR.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-B6TRgw4-.js → chunk-DU6HZSFF-CxOE2RJx.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-B5arSwg6.js → chunk-F27PBJKO-DXbxgIcF.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-XeNCd3gb.js → chunk-GMAD6QVW-C-CPxvzK.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-CWVbbWh7.js → chunk-GVQU2GXP-N8FA1SLM.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-Cb-yxIAE.js → chunk-IMKFNOWR-DTBCxfEA.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-Di7nZhzu.js → chunk-L3NEJ4N5-DpY0Sgfm.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-DcqBXKUK.js → chunk-OSK3NFVY-BZXi7c79.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-DJ1kMiTY.js → chunk-P2QGCYS3-CEZ0Wrp3.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-Ba9RYr-b.js → chunk-POPQ4Y6H-ChY6VtHX.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-D4Ch07S8.js → chunk-PWAF6VOD-ynZZsG4M.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-BafMUZgc.js → chunk-SHT3W25Y-B2nWifo1.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-CsEVe0s3.js → chunk-SVP7TREG-B8mLhKtO.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-D3tgdZlp.js → chunk-TICWLB2K-DRpXMD23.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BmhihMCg.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BmhihMCg.js +2 -0
- package/dist/client/assets/{connect-Vt7wlrih.js → connect-C2Pvay2K.js} +2 -2
- package/dist/client/assets/{connect-agent-CX70rAkF.js → connect-agent-F9m6jdrN.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-CU8HnD4F.js → cynefin-OW5HDTMX-Bdj9a2Tr.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-Cvc6_oYZ.js → cynefinDiagram-5FMLGOSQ-CI4Z0tY2.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-Bx5buWLS.js → dagre-GXQ25YYZ-BiXNu3UE.js} +2 -2
- package/dist/client/assets/{device-BgvBRE7C.js → device-dy573Bzs.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-CPZrAy0P.js → diagram-S7CK7UJ4-BoHm89r6.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-kBtSnHpL.js → diagram-UQ7AKVKN-C-2Ubrz8.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-DQP2q1tS.js → diagram-VSXAHHWV-5CTD9pHp.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-DRUN0yEk.js → diagram-VX7I27RA-BJfYpp_F.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-D4WMsQZZ.js → diagram-Z3DM3KII-z35dx_kK.js} +2 -2
- package/dist/client/assets/{diffRendering-iR2meoVj.js → diffRendering-BiYYLTwl.js} +2 -2
- package/dist/client/assets/{dist-vr51zfzA.js → dist-Bl7QV0pY.js} +2 -2
- package/dist/client/assets/{duoViewer-DTVry3xd.js → duoViewer-CPD9Wvk1.js} +2 -2
- package/dist/client/assets/{dynamic-CuoX2JEO.js → dynamic-DcfMLaU_.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-BNUtunQw.js → ebnfDiagram-PWID7BFC-C2Fa8ORo.js} +2 -2
- package/dist/client/assets/{embeddedScripts-BMvBWRz_.js → embeddedScripts-DFdnbLSr.js} +2 -2
- package/dist/client/assets/{entities-7B8nzlQw.js → entities-B2DNkHHQ.js} +2 -2
- package/dist/client/assets/{environments-DYIXXf7q.js → environments-Bqz0Jaj_.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-DHjjowZq.js → erDiagram-RLTQ6QDP-WIlBdlNc.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-Q6rJ-HVs.js +1 -0
- package/dist/client/assets/{fileLinks-BYi-XNUG.js → fileLinks-Y7rrQ-ob.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-DIOxQqDo.js → fileTreeExpansion-CktIYdPM.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-Dyon23dU.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DEPOqoj0.js → ganttDiagram-EL5Y4UJY-CzIDxrzr.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-DMj15wpy.js → getDiffFileInput-DaXZ00WD.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-BGKW_zhb.js → gitGraph-4MIJSDKK-VJZ5WW8j.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-7UhsI5zi.js → gitGraphDiagram-WWUBYQGX--N7ACKgH.js} +2 -2
- package/dist/client/assets/{guideRunStore-BEkwZ9H7.js → guideRunStore-C8Xso-YV.js} +2 -2
- package/dist/client/assets/{index-C_MVyH59.js → index-9_IX9wXh.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-jvyzx_4e.js → info-A6RAGUB7-BsLL2HTs.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-lTTpu3as.js → infoDiagram-27XIBGKW-H0RWUQa6.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DlrQNGG9.js → ishikawaDiagram-5VMMS53U-BoBtpQFP.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-Buy9e-fU.js → journeyDiagram-3NMN7TZE-rcwS0plS.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-1KgAXH0g.js → kanban-definition-UXKFOSKX-CMC0FYSq.js} +2 -2
- package/dist/client/assets/{line-DUV1hs6X.js → line-CbOfbAku.js} +2 -2
- package/dist/client/assets/{linkedPrompt-Da8rJho3.js → linkedPrompt-Bw0INRKj.js} +2 -2
- package/dist/client/assets/{main-Bh6Hj0_-.js → main-C6Kmott7.js} +7 -7
- package/dist/client/assets/{mediaReference-CLlAiRVc.js → mediaReference-CRKV_ScS.js} +2 -2
- package/dist/client/assets/{mediaSource-BTCWn94E.js → mediaSource-Hn2lPB2b.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-CsBuWV4-.js → mermaid-parser.core-BGJPFG4o.js} +4 -4
- package/dist/client/assets/{mermaid.core-BcICv5EB.js → mermaid.core-Bt6Qv84k.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-BqCqe4io.js → mindmap-definition-YA3MSWOX-4Y8RevXP.js} +2 -2
- package/dist/client/assets/{onboarding-COQ6KgRG.js → onboarding-BnJjKcjq.js} +2 -2
- package/dist/client/assets/{openFileInPreview-BhRAqg63.js → openFileInPreview-BupyBOTN.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-z5Hlq99W.js → p4ProjectFile-CUk0B5Zd.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-BYCaPqFA.js → packet-AYTQ26CC-CRQRHja4.js} +1 -1
- package/dist/client/assets/{pair-BDKjGij-.js → pair-ohR-X0pV.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-CqCw5Z-L.js → pegDiagram-XKGWAZYB-Dk0K8AzU.js} +2 -2
- package/dist/client/assets/{phoneViewer-DLSM0QXE.js → phoneViewer-DD_58CZV.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-BfOlqQx1.js → pie-WAS4IAKB-CWKurrWM.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-DZpCrUQF.js → pieDiagram-E7YTZNPT-DlRA_ADi.js} +2 -2
- package/dist/client/assets/{pierre-icons-BG7vd34x.js → pierre-icons-Bj2UJzq7.js} +2 -2
- package/dist/client/assets/{preview-bd-MGMMz.js → preview-Czvs-xjq.js} +2 -2
- package/dist/client/assets/{primary-BwHoAoya.js → primary-C0h34HcZ.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-DtOYGRkF.js → primaryCloudLinkState-EkUmcneJ.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-BP_JvI7-.js → projectFilesQueryState-DDX2gPG6.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-BGLshibY.js → projectScriptEditor-B-W-Sbdv.js} +2 -2
- package/dist/client/assets/{providerSkills-DxYtwoxJ.js → providerSkills-OoPsDyac.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-C_aVDAY_.js → pullRequestDetail.logic-BZIPv0wR.js} +2 -2
- package/dist/client/assets/{pullRequests-D0no1PZS.js → pullRequests-BuF4aTBF.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BTtuOXlL.js → quadrantDiagram-AXDQQJYC-Cgrn1gJf.js} +2 -2
- package/dist/client/assets/{queries-DkmaXOL-.js → queries-B5qQohie.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-BiJgnIUY.js → radar-RG4KPBEZ-BNds8J7E.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-C0CA0mcr.js → railroad-74A4TZTK-c-ku32yb.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DdK1L4Kf.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-DAIwdsWb.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-B6SwzZWt.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-WczOSoF4.js → railroadDiagram-O6MQD6OU-CQ0Qmd0t.js} +2 -2
- package/dist/client/assets/{renderScheduler-BLjFSKnt.js → renderScheduler-CFozWmL-.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-B3qCIQP5.js → requirementDiagram-BXWQKSXE-ssGfFSCi.js} +2 -2
- package/dist/client/assets/{runtime-Bni_zt6P.js → runtime-C2Cbg6bw.js} +2 -2
- package/dist/client/assets/{runtime-D8mKjOP-.js → runtime-C9FXEGBC.js} +3 -3
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-e2-j7ERe.js → sankeyDiagram-P5KCCOFB-CTZUXdFj.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-BNC897-_.js → scheduledTasksSettings.logic-Cucrqmxt.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-DG7-8UJk.js → sequenceDiagram-WJ2MYXX4-B8uW-gHN.js} +2 -2
- package/dist/client/assets/{server-CaLEm3Wt.js → server-B3nCKBrK.js} +2 -2
- package/dist/client/assets/{session-2CRBJwS7.js → session-DtKtS09P.js} +2 -2
- package/dist/client/assets/{session-logic-BLOBsHEA.js → session-logic-P3KsudEl.js} +2 -2
- package/dist/client/assets/{settings-BIwaDm1N.js → settings-BNJbLRpG.js} +2 -2
- package/dist/client/assets/{settings.appearance-ToUM8fHh.js → settings.appearance-DKLKCSXj.js} +2 -2
- package/dist/client/assets/settings.archived-BeEB6d0D.js +2 -0
- package/dist/client/assets/{settings.computer-use-BEghs16L.js → settings.computer-use-BcdKzzUy.js} +2 -2
- package/dist/client/assets/{settings.connections-C_LVk0gJ.js → settings.connections-Cjmfz_7g.js} +2 -2
- package/dist/client/assets/{settings.data-controls-BaTil8NB.js → settings.data-controls-CZHmsfBq.js} +2 -2
- package/dist/client/assets/{settings.decisions-JTbMt08J.js → settings.decisions-C3WA_g2Z.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-ByG62ZGs.js → settings.diagnostics-Bfh6T3JX.js} +2 -2
- package/dist/client/assets/{settings.general-BT78z_Cn.js → settings.general-HB-_Jy6d.js} +2 -2
- package/dist/client/assets/{settings.integrations-C3jj2T1d.js → settings.integrations-C-uLxrlE.js} +2 -2
- package/dist/client/assets/{settings.keybindings-CeqZWQEi.js → settings.keybindings-BGq7j4EC.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-BAFwkfI8.js → settings.open-source-licenses-VexlqZXJ.js} +2 -2
- package/dist/client/assets/settings.plugins-P_jMyYCz.js +5 -0
- package/dist/client/assets/{settings.projects-Cqx1zAvs.js → settings.projects-Bl6-Pt9m.js} +3 -3
- package/dist/client/assets/{settings.providers-CS55UrI1.js → settings.providers-Dk00EIn3.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-CFJTEOb1.js → settings.scheduled-tasks-IH5fvnPs.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-E3AITJyC.js → settings.snap-shot-CaOvSkk3.js} +2 -2
- package/dist/client/assets/{settings.source-control-CWWy9E3b.js → settings.source-control-hwzkeaj5.js} +2 -2
- package/dist/client/assets/{settings.storage-BnUI1rFT.js → settings.storage-YtslAsAl.js} +2 -2
- package/dist/client/assets/{settingsLayout-DHc6oKfL.js → settingsLayout-Oe2gP0HD.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DD4nu9RX.js → sidebarProjectGrouping-zfg6kMP5.js} +2 -2
- package/dist/client/assets/{sortable.esm-BAEGChD3.js → sortable.esm-CFdu6ubt.js} +2 -2
- package/dist/client/assets/{sourceControl-BAghu6LN.js → sourceControl-CNpb3juM.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-CpZF58eW.js → stateDiagram-D77RDMKH-BXjvJECk.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DoChugDq.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-D1b49puG.js → swimlanes-42K2YHIH-BuQKiVFK.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Bwk0C9Yw.js +9 -0
- package/dist/client/assets/{terminalSessions-Q2t1JYPS.js → terminalSessions-C0i8FMIw.js} +2 -2
- package/dist/client/assets/{threadSort-C5oCCRfj.js → threadSort-urWEkJav.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-89AJY6KO.js → timeline-definition-24CTP7MA-gsy_kdrp.js} +2 -2
- package/dist/client/assets/{toast-DhMYg_gN.js → toast-D1xgN6T2.js} +2 -2
- package/dist/client/assets/{treeView-Q6P3EWNA-CqNF2YcW.js → treeView-Q6P3EWNA-BHvMPOqK.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-LJa3ZEYA.js → treemap-WGGIJYW6-D8SWHA1Z.js} +1 -1
- package/dist/client/assets/{usage-CJVyABbK.js → usage-BsNTrKRO.js} +2 -2
- package/dist/client/assets/{use-atom-command-x4GQBtio.js → use-atom-command-DFVJioxM.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-CReGBX6y.js → useHandleNewThread-D3kzOunA.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BL4mjngC.js → usePullRequestActions-eR9_K37m.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-CBOIiaXC.js → useScopedModelAvailability-DloNarQ1.js} +2 -2
- package/dist/client/assets/{useSettings-Dx076NWT.js → useSettings-BVUg52H2.js} +2 -2
- package/dist/client/assets/{useT3ConnectAuthPrompt-1zTdZLsH.js → useT3ConnectAuthPrompt-iHfw63uu.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-46AnO9mr.js → vcsRefInvalidation-DZeFb_fD.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-CvvE7gMp.js → vennDiagram-4TSXK5OY-DWeHYWRx.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-Ca8Qzkpo.js → wardley-WFR3VGLG-CfPV8k7N.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-BBSNgSMI.js → wardleyDiagram-VM6X3IG4-D0SH6I3q.js} +2 -2
- package/dist/client/assets/{welcome-B3wsq5wK.js → welcome-BWkyKuVQ.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-D8OhWe48.js → xychartDiagram-S5SC5T6Z-CHYweeaE.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-C4CdFj__.mjs → renderer-BFtino0A.mjs} +2 -2
- package/dist/{runtime-CCVFqL3Y.mjs → runtime-ERvpj9Mz.mjs} +3 -3
- package/package.json +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-CiMEl2LX.js +0 -1
- package/dist/client/assets/channel-CDbYAV2D.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cdtwlmxc.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cdtwlmxc.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-DNKqiuCf.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-CbOoDtR7.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BtC_0p6z.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-IeTBC6cs.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-DLoLKYq3.js +0 -1
- package/dist/client/assets/settings.archived-Cq_qclay.js +0 -2
- package/dist/client/assets/settings.plugins-D5l1ZPSB.js +0 -5
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DewOo-MV.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-d9EGwk-5.js +0 -9
package/dist/client/assets/{settings.integrations-C3jj2T1d.js → settings.integrations-C-uLxrlE.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{$y as n,C_ as r,Df as i,Dw as a,Gn as o,Jn as s,LT as c,NE as l,N_ as u,Pp as d,Qc as f,Qm as p,Um as m,Wn as h,Wu as g,Yn as _,Zc as v,Zn as y,bg as b,cg as x,cp as S,cr as C,dp as w,fg as T,gg as E,hd as D,l as O,lE as k,mg as A,oh as j,or as M,qn as N,qu as P,sg as F,sh as I,sp as L,sr as R,t as z,tr as ee,vg as te,yg as ne}from"./utils-BEVyjoxo.js";import{W as re}from"./runtime-D8mKjOP-.js";import{w as ie}from"./entities-7B8nzlQw.js";import{a as ae,r as B,t as V}from"./number-field-DIYUxout.js";import{a as H,c as oe,i as se,o as U,r as ce,s as W,t as G}from"./select-B47XfaxQ.js";import{t as le}from"./spinner-CpLstN6u.js";import{i as K}from"./toast-DhMYg_gN.js";import{a as ue,n as q,t as de}from"./tooltip-Cq9yz15d.js";import{a as fe,o as pe}from"./environments-DYIXXf7q.js";import{f as me}from"./server-CaLEm3Wt.js";import{i as he,n as ge}from"./session-2CRBJwS7.js";import{t as J}from"./use-atom-command-x4GQBtio.js";import{R as _e,c as ve,o as ye,r as be,s as xe,x as Se}from"./useSettings-Dx076NWT.js";import{t as Ce}from"./env-wK1YYxA8.js";import{t as we}from"./input-RqvQJ9gh.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./dialog-DmneyTGi.js";import{i as Ne,t as Pe}from"./device-BgvBRE7C.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,s as Be,t as Ve}from"./DeviceSetup-BdrkGme6.js";import{t as He}from"./AnimatedHeight-CH-N3JTc.js";import{i as Ue,n as We}from"./Icons-B5JVkp3z.js";import{t as Ge}from"./preview-bd-MGMMz.js";import{a as Ke,i as qe,o as Je,t as Ye}from"./popover-DE9WCm99.js";import{B as Xe,C as Ze,L as Qe,P as $e,a as Y,c as et,i as tt,r as nt,s as rt}from"./settingsLayout-DHc6oKfL.js";import{Ar as it,Fr as at,Ir as ot,La as st,Mr as ct,Nr as lt,Pr as ut,aa as dt,fa as ft,ia as pt,ir as X,jr as mt}from"./main-Bh6Hj0_-.js";import{t as ht}from"./ProjectDefaultsSettings-DfhAk0_Y.js";import{t as gt}from"./draft-input-DHZ1J7B_.js";import{t as _t}from"./ScopedSwitch-BKOdsllO.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-C4aMrLLP.js";var Z=l(),Q=e(k(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(C,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Je,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(Ke,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(qe,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let w;return t[24]!==S||t[25]!==m?(w=(0,Q.jsxs)(Ye,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=w):w=t[26],w}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(de,{children:[(0,Q.jsxs)(ue,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(D,{className:`size-3`}):(0,Q.jsx)(L,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(q,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=n(u);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=J(Pe.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let o=Ot(n);if(i.current.has(o))return;i.current.add(o),r(e=>({...e,[o]:{}}));let s={};try{return await kt(e,n,async(e,n)=>{if(!ge(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(a(r.cause));return r.value},(e,t)=>{s[e]=t,r(n=>({...n,[o]:{...n[o],[e]:t}}))}),s}finally{i.current.delete(o)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[l,u]=(0,$.useState)(n),{checks:d,testConnection:f}=At(i),p=d[Ot(l)],h=Object.values(p??{}).some(Nt),g,_;t[0]===l?(g=t[1],_=t[2]):(g=Dt({...l,label:l.label.trim()||l.target}),_=c(g),t[0]=l,t[1]=g,t[2]=_);let v=_,y;t[3]===p?y=t[4]:(y=Object.values(p??{}).filter(Mt),t[3]=p,t[4]=y);let b=y.length,x;t[5]!==a||t[6]!==s?(x=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=x):x=t[7];let C=!a,w;t[8]!==a||t[9]!==h||t[10]!==l.label||t[11]!==g||t[12]!==o?(w=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),c(g)&&l.label.trim()&&!a&&!h&&o(g.value)}}),t[8]=a,t[9]=h,t[10]=l.label,t[11]=g,t[12]=o,t[13]=w):w=t[13];let T=r?`Add device host`:`Edit device host`,E;t[14]===T?E=t[15]:(E=(0,Q.jsx)(Ee,{children:T}),t[14]=T,t[15]=E);let O=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,k;t[16]===O?k=t[17]:(k=(0,Q.jsxs)(Ae,{children:[O,` `,`Hosts on the same machine are skipped.`]}),t[16]=O,t[17]=k);let A;t[18]!==E||t[19]!==k?(A=(0,Q.jsxs)(Te,{children:[E,k]}),t[18]=E,t[19]=k,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=j):j=t[21];let M;t[22]===l?M=t[23]:(M=e=>u({...l,label:e.target.value}),t[22]=l,t[23]=M);let N;t[24]!==a||t[25]!==l.label||t[26]!==M?(N=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(we,{autoFocus:!0,required:!0,value:l.label,disabled:a,onChange:M,placeholder:`Mac mini`})]}),t[24]=a,t[25]=l.label,t[26]=M,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=P):P=t[28];let F;t[29]===l?F=t[30]:(F=e=>u({...l,target:e.target.value}),t[29]=l,t[30]=F);let I;t[31]!==a||t[32]!==l.target||t[33]!==F?(I=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[P,(0,Q.jsx)(we,{required:!0,value:l.target,disabled:a,onChange:F,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=l.target,t[33]=F,t[34]=I):I=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=z):z=t[35];let ee;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=ee):ee=t[36];let te=l.identityFile??``,ne;t[37]===l?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=l;u(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=l,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ee,(0,Q.jsx)(we,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=l.port??``,B;t[44]===l?B=t[45]:(B=e=>{let{port:t,...n}=l;u(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=l,t[45]=B);let V;t[46]!==a||t[47]!==ae||t[48]!==B?(V=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(we,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=V):V=t[49];let H;t[50]!==re||t[51]!==V?(H=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,V]}),t[50]=re,t[51]=V,t[52]=H):H=t[52];let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=oe):oe=t[53];let se;t[54]!==L||t[55]!==H?(se=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[z,H,oe]}),t[54]=L,t[55]=H,t[56]=se):se=t[56];let U=h?`Checking environments…`:p?b?`${b} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,ce;t[57]===U?ce=t[58]:(ce=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:U}),t[57]=U,t[58]=ce);let W=a||h||!v,G;t[59]!==g||t[60]!==f?(G=()=>{c(g)&&f(g.value)},t[59]=g,t[60]=f,t[61]=G):G=t[61];let K;t[62]===h?K=t[63]:(K=h?(0,Q.jsx)(le,{size:`xs`}):null,t[62]=h,t[63]=K);let ue;t[64]!==W||t[65]!==G||t[66]!==K?(ue=(0,Q.jsxs)(R,{type:`button`,size:`sm`,variant:`outline`,disabled:W,onClick:G,children:[K,` Test connection`]}),t[64]=W,t[65]=G,t[66]=K,t[67]=ue):ue=t[67];let q;t[68]!==ce||t[69]!==ue?(q=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[ce,ue]}),t[68]=ce,t[69]=ue,t[70]=q):q=t[70];let de;t[71]!==p||t[72]!==i?(de=p?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=p[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(m,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=p,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==q||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[q,de]}),t[74]=q,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==N||t[78]!==I||t[79]!==se||t[80]!==fe?(pe=(0,Q.jsxs)(ke,{children:[N,I,se,fe]}),t[77]=N,t[78]=I,t[79]=se,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(R,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=me):me=t[84];let he;t[85]!==a||t[86]!==h||t[87]!==l.label||t[88]!==v?(he=a||h||!v||!l.label.trim(),t[85]=a,t[86]=h,t[87]=l.label,t[88]=v,t[89]=he):he=t[89];let ge;t[90]===a?ge=t[91]:(ge=a?(0,Q.jsx)(le,{size:`xs`}):null,t[90]=a,t[91]=ge);let J;t[92]!==he||t[93]!==ge?(J=(0,Q.jsxs)(R,{type:`submit`,disabled:he,children:[ge,` Save host`]}),t[92]=he,t[93]=ge,t[94]=J):J=t[94];let _e;t[95]!==me||t[96]!==J?(_e=(0,Q.jsxs)(De,{children:[me,J]}),t[95]=me,t[96]=J,t[97]=_e):_e=t[97];let ve;t[98]!==A||t[99]!==pe||t[100]!==C||t[101]!==_e||t[102]!==w?(ve=(0,Q.jsxs)(je,{showCloseButton:C,render:w,children:[A,pe,_e]}),t[98]=A,t[99]=pe,t[100]=C,t[101]=_e,t[102]=w,t[103]=ve):ve=t[103];let ye;return t[104]!==x||t[105]!==ve?(ye=(0,Q.jsx)(Me,{open:!0,onOpenChange:x,children:ve}),t[104]=x,t[105]=ve,t[106]=ye):ye=t[106],ye}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:n,connectedEnvironments:i}=Xe(),a=he(e.environmentId,r),o=t.kind===`project`||t.kind===`checkout`,s=J(me.updateSettings,{reportFailure:!1}),[c,l]=(0,$.useState)(null),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(!1),h=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:g,testConnection:_}=At(h),v=async(t,r=!1,i=t)=>{if(e.environmentId&&!o){m(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ge(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return s({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?l(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{m(!1)}}};return(0,Q.jsx)(Y,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(R,{size:`sm`,variant:`outline`,disabled:!a||o||p||!e.environmentId||c!==null,onClick:()=>{f(null),l({id:O(),label:``,target:``})},children:[(0,Q.jsx)(d,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsxs)(`div`,{children:[i.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!a||o||p,checks:g,testConnection:async e=>{let t=await _(e);if(!t)return;let n=h.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${h.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{f(e),l(e)},onRemove:e=>void v(e,!0)})]},e.environmentId)),c?(0,Q.jsx)(jt,{host:c,isNew:u===null,targets:h,busy:p,onSave:e=>void v(e,!1,u??e),onClose:()=>l(null)},c.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:s,onRemove:c,checks:l,testConnection:u}=e,{state:d}=Ne(r),f=J(Pe.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Ot(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),h.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,v?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:v})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(le,{size:`xs`}),g]}):null,(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{onClick:()=>{s(e)},children:`Edit`}),(0,Q.jsx)(_,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=s,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=s,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let v;return t[25]!==h||t[26]!==g?(v=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=v):v=t[27],v}function It(e){return(0,Q.jsxs)(de,{children:[(0,Q.jsx)(ue,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Ue,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(We,{className:`size-3.5`})}),(0,Q.jsx)(q,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=O(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=zt(b,T.current,i);if(e===void 0){C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let k=D,A;t[13]===s?A=t[14]:(A=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=A);let j=A,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let R;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==k||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(R=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?k:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?k:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:k}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=k,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=R):R=t[39];let z;t[40]!==L||t[41]!==R?(z=(0,Q.jsx)(je,{className:`max-w-lg`,showCloseButton:L,children:R}),t[40]=L,t[41]=R,t[42]=z):z=t[42];let ee;return t[43]!==z||t[44]!==I?(ee=(0,Q.jsx)(Me,{open:!0,onOpenChange:I,children:z}),t[43]=z,t[44]=I,t[45]=ee):ee=t[45],ee}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Ae,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(R,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(De,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:a,onGranted:o,stillRequired:s,onCheck:c}=e,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===c?p=t[1]:(p=async()=>({fullDiskAccess:await c()}),t[0]=c,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=bt(p,m),g;t[3]!==a||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(a).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=a,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Ae,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(i,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(vt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==s?(T=h.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:s?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=h,t[22]=s,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ke,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==o||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(yt,{ready:O,busy:l,onClick:o,children:`Continue`}),t[32]=o,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(De,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,t[42]=j):j=t[42],j}function $t(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,_=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),v;t[4]===n.name?v=t[5]:(v=(0,Q.jsxs)(Ee,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=v);let y;t[6]===r?y=t[7]:(y=(0,Q.jsxs)(Ae,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=y);let b;t[8]!==v||t[9]!==y?(b=(0,Q.jsxs)(Te,{children:[v,y]}),t[8]=v,t[9]=y,t[10]=b):b=t[10];let x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=x):x=t[11];let S;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(en,{selected:o===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],S=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=S}else S=t[15];let C;t[19]===S?C=t[20]:(C=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[x,S]}),t[19]=S,t[20]=C);let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(g,{className:`size-4 sm:hidden`}),(0,Q.jsx)(P,{className:`hidden size-4 sm:block`})]}),t[21]=w):w=t[21];let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=T):T=t[22];let E;t[23]!==a||t[24]!==u||t[25]!==c.kind?(E=a?(0,Q.jsx)(en,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=E):E=t[26];let D;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(en,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],D=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=D}else D=t[31];let O;t[36]!==E||t[37]!==D?(O=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[T,E,D]}),t[36]=E,t[37]=D,t[38]=O):O=t[38];let k;t[39]!==O||t[40]!==C?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[C,w,O]}),t[39]=O,t[40]=C,t[41]=k):k=t[41];let A;t[42]===_?A=t[43]:(A=_?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:_}):null,t[42]=_,t[43]=A);let j;t[44]!==k||t[45]!==A?(j=(0,Q.jsxs)(ke,{children:[k,A]}),t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]===d?M=t[48]:(M=(0,Q.jsx)(R,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=M);let N=o===``||m||h,F;t[49]!==f||t[50]!==N?(F=(0,Q.jsx)(R,{disabled:N,onClick:f,children:`Import`}),t[49]=f,t[50]=N,t[51]=F):F=t[51];let I;t[52]!==M||t[53]!==F?(I=(0,Q.jsxs)(De,{children:[M,F]}),t[52]=M,t[53]=F,t[54]=I):I=t[54];let L;return t[55]!==j||t[56]!==I||t[57]!==b?(L=(0,Q.jsxs)(Q.Fragment,{children:[b,j,I]}),t[55]=j,t[56]=I,t[57]=b,t[58]=L):L=t[58],L}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=z(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=z(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(D,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ee,{children:`Importing cookies`}),(0,Q.jsx)(Ae,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(le,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ee,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Ae,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Te,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(le,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Ee,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(Ae,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Te,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(ke,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(R,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(De,{children:(0,Q.jsx)(Oe,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Ee,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=v[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Ae,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Te,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(R,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(R,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(De,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return f.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&dt.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:dt.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=xe(Sn),i=Se(),a=r._tag===`fill`?null:r,o=a?.width??un.width,s=a?.height??un.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===on){i({browserDefaultViewport:x});return}if(e===sn){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??un.width,height:a?.height??un.height}});return}let t=dt.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=X(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==I._tag?(0,Q.jsx)(nt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:I})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=gn(r),t[16]=r,t[17]=g);let _;t[18]===r?_=t[19]:(_=_n(r),t[18]=r,t[19]=_);let v;t[20]===_?v=t[21]:(v=(0,Q.jsx)(W,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(oe,{children:_})}),t[20]=_,t[21]=v);let y,b;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(H,{value:on,children:`Fill panel`}),b=(0,Q.jsx)(H,{value:sn,children:`Responsive`}),t[22]=y,t[23]=b):(y=t[22],b=t[23]);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(U,{align:`end`,alignItemWithTrigger:!1,children:[y,b,(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(se,{children:`Standard`}),dt.map(xn)]})]}),t[24]=S):S=t[24];let C;t[25]!==n||t[26]!==d||t[27]!==v||t[28]!==g?(C=(0,Q.jsxs)(G,{value:g,onValueChange:d,disabled:n,children:[v,S]}),t[25]=n,t[26]=d,t[27]=v,t[28]=g,t[29]=C):C=t[29];let w;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(w=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(V,{value:l.width,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(V,{value:l.height,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(de,{children:[(0,Q.jsx)(ue,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:yn(a)}),children:(0,Q.jsx)(pt,{})})}),(0,Q.jsx)(q,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=w):w=t[35];let E;t[36]!==C||t[37]!==w?(E=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[C,w]}),t[36]=C,t[37]=w,t[38]=E):E=t[38];let D;return t[39]!==E||t[40]!==h?(D=(0,Q.jsx)(Y,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:E}),t[39]=E,t[40]=h,t[41]=D):D=t[41],D}function xn(e){return(0,Q.jsx)(H,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=xe(Tn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)(nt,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=A.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(oe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:A.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=xe(On),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:F})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(H,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=xe(jn),i=xe(An),a=Se(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(Y,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(st,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(Y,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(st,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=xe(Pn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)(nt,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=p.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(oe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:p.map(Nn)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Nn(e){return(0,Q.jsxs)(H,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=xe(Rn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`link target`,onClick:()=>i({browserLinkTarget:j})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=Fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(Fn),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:u.map(Ln)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function Ln(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=Xe(),r=$e(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(rt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:n}){let i=he(e,r),{state:a,loaded:o}=Ne(e),{scope:s,environments:c,connectedEnvironments:l}=Xe(),u=Qe(),d=s.kind===`project`||s.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=J(Pe.configure,{reportFailure:!1}),m=J(Pe.list,{reportFailure:!1}),[h,g]=(0,$.useState)(null),_=a.hostStatus===`installing`||a.hostStatus===`starting`,v=a.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[y,b]=(0,$.useState)(!1);y&&!t&&b(!1),t&&!y&&(a.hostStatus===`ready`||v)&&h!==`hub`&&b(!0);let x=async(t,n)=>{if(e&&ge(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(c.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ge(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=c.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{g(null)}}},[S,C]=(0,$.useState)(null),w=a.hosts.find(e=>e.kind===`local`)?.tools,T=t=>{let n=w?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.supportsToolUpdate&&r?(0,Q.jsx)(R,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&C({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>g(null)))},children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,a.supportsToolInspection?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:ze,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`hub`),kind:`hub`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`hub`?(0,Q.jsx)(Re,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!i||d||!o||!e||_||h!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(He,{children:y?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:l.length>1?`Status for ${l.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Le,{compact:!0,platform:`iOS`,status:Be(a,`ios`)}),(0,Q.jsx)(Le,{compact:!0,platform:`Android`,status:Be(a,`android`)})]}),control:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||!t||_||h!==null,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Fe,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`agent`),kind:`agent`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`agent`?(0,Q.jsx)(Ve,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!i||l.length===0||!d&&(!o||!f||_)||h!==null,"aria-label":`Agent device access`,onCheckedChange:e=>d?u({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ie,{state:{...a,hosts:a.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=xe(Hn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)(nt,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(st,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(Y,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=xe(e=>e.browserProfiles),n=xe(e=>e.browserDefaultProfileId),r=ve(),i=Se(),{environments:a,isReady:c}=fe(),l=pe(),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(null),[g,v]=(0,$.useState)(null),[x,S]=(0,$.useState)(null),[C,T]=(0,$.useState)(null),[D,k]=(0,$.useState)(!1),A=ie(),j=J(Ge.clearProfile,{reportFailure:!1}),P={environmentIds:a.map(e=>e.environmentId).filter(e=>A.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await j({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw re(n)}},F=ln(ft!==null,c,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,ae]=(0,$.useState)(!1),B=e||!r,V=b(t).filter(e=>e.kind!==`incognito`),H=te(V,n)?.id??`default`,oe=e=>{if(!r||I.current)return;let t=be().browserProfiles;if(t.length>=24)return;let n=b(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${O()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},se=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=be().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},U=(e,t)=>{if(r&&!I.current){if(!F){K.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(ft,a.map(e=>e.environmentId),e,P).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},ce=async e=>{if(!r||I.current)return;if(!F){T(`Connect to an environment before removing this profile.`);return}T(null),k(!0);try{await cn(ft,c?a.map(e=>e.environmentId):[],e,P)}catch{T(`Profile data could not be deleted. Try again.`),k(!1);return}let t=be();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:E}:{}}),k(!1),v(null)},W=(u??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),G=(0,$.useCallback)(()=>{ft&&ft.listBrowserImportSources().then(f).catch(()=>f(e=>e??[]))},[]),le=async(e,t,n)=>{if(!ft||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!b(be().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,ae(!0);try{let r=await ft.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!b(be().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await ye(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let r=new Set(b(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(ft,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{I.current=!1,ae(!1)}},ue=async e=>{if(ft)try{let t=await ft.listBrowserImportSources();return f(t),t.find(t=>t.id===e)}catch{return}},q=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(o,{onOpenChange:e=>e&&G(),children:[(0,Q.jsxs)(M,{render:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:B||L}),children:[(0,Q.jsx)(d,{}),`Add profile`]}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||q,onClick:()=>oe(`New profile`),children:`Blank profile`}),q?(0,Q.jsx)(_,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(ee,{}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(s,{children:`Import from`}),u===null?(0,Q.jsx)(_,{disabled:!0,children:`Looking for browsers…`}):W.length===0?(0,Q.jsx)(_,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[W.map(e=>(0,Q.jsx)(_,{disabled:!r||l==null,onClick:()=>{r&&l!=null&&m({source:e,environmentId:l.environmentId,environmentName:Ze({isPrimary:!0,environmentId:l.environmentId,runtimeLabel:l.label})})},children:e.name},e.id)),l==null?(0,Q.jsx)(_,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:V.map((e,t)=>{let n=ne(e.id),a=e.id===H;return(0,Q.jsxs)(`div`,{className:z(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:z(`truncate text-sm text-foreground`,B&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:B||L,maxLength:48,value:e.name,onCommit:t=>se(e.id,t)}),a?(0,Q.jsx)(`span`,{className:z(`flex`,B&&`opacity-64`),children:(0,Q.jsx)(h,{children:`Default`})}):null]}),(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-xs`,variant:`ghost-muted`,disabled:B||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(_,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?S(e):U(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(_,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{}),(0,Q.jsx)(_,{disabled:!0,children:c?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(it,{open:g!==null,onOpenChange:e=>{!e&&!D&&(v(null),T(null))},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Remove “`,g?.name,`”?`]}),(0,Q.jsx)(ct,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),C?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:C}):null,F?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{disabled:D,render:(0,Q.jsx)(R,{variant:`outline`,disabled:D}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,disabled:D||!r||!F,onClick:()=>{g&&r&&F&&ce(g.id)},children:D?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(it,{open:x!==null,onOpenChange:e=>{e||S(null)},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Clear “`,x?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(ct,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{render:(0,Q.jsx)(R,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,onClick:()=>{x&&U(x.id,x.name),S(null)},children:`Clear data`})]})]})}),p?(0,Q.jsx)(Jt,{source:p.source,destinationEnvironmentName:p.environmentName,targetProfiles:V.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!q,onImport:e=>le(p.source,p.environmentId,e),onRefreshSource:()=>ue(p.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await _e()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>m(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!Ce,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(tt,{children:[i,(0,Q.jsx)(rt,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(et,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
|
|
2
|
-
//# sourceMappingURL=settings.integrations-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$y as n,C_ as r,Df as i,Dw as a,Gn as o,Jn as s,LT as c,NE as l,N_ as u,Pp as d,Qc as f,Qm as p,Um as m,Wn as h,Wu as g,Yn as _,Zc as v,Zn as y,bg as b,cg as x,cp as S,cr as C,dp as w,fg as T,gg as E,hd as D,l as O,lE as k,mg as A,oh as j,or as M,qn as N,qu as P,sg as F,sh as I,sp as L,sr as R,t as z,tr as ee,vg as te,yg as ne}from"./utils-BEVyjoxo.js";import{W as re}from"./runtime-C9FXEGBC.js";import{w as ie}from"./entities-B2DNkHHQ.js";import{a as ae,r as B,t as V}from"./number-field-DIYUxout.js";import{a as H,c as oe,i as se,o as U,r as ce,s as W,t as G}from"./select-B47XfaxQ.js";import{t as le}from"./spinner-CpLstN6u.js";import{i as K}from"./toast-D1xgN6T2.js";import{a as ue,n as q,t as de}from"./tooltip-Cq9yz15d.js";import{a as fe,o as pe}from"./environments-Bqz0Jaj_.js";import{f as me}from"./server-B3nCKBrK.js";import{i as he,n as ge}from"./session-DtKtS09P.js";import{t as J}from"./use-atom-command-DFVJioxM.js";import{R as _e,c as ve,o as ye,r as be,s as xe,x as Se}from"./useSettings-BVUg52H2.js";import{t as Ce}from"./env-wK1YYxA8.js";import{t as we}from"./input-RqvQJ9gh.js";import{a as Te,c as Ee,i as De,n as Oe,o as ke,r as Ae,s as je,t as Me}from"./dialog-DmneyTGi.js";import{i as Ne,t as Pe}from"./device-dy573Bzs.js";import{a as Fe,c as Ie,i as Le,n as Re,o as ze,s as Be,t as Ve}from"./DeviceSetup-B9gRys_T.js";import{t as He}from"./AnimatedHeight-CH-N3JTc.js";import{i as Ue,n as We}from"./Icons-B5JVkp3z.js";import{t as Ge}from"./preview-Czvs-xjq.js";import{a as Ke,i as qe,o as Je,t as Ye}from"./popover-DE9WCm99.js";import{B as Xe,C as Ze,L as Qe,P as $e,a as Y,c as et,i as tt,r as nt,s as rt}from"./settingsLayout-Oe2gP0HD.js";import{Ar as it,Fr as at,Ir as ot,La as st,Mr as ct,Nr as lt,Pr as ut,aa as dt,fa as ft,ia as pt,ir as X,jr as mt}from"./main-C6Kmott7.js";import{t as ht}from"./ProjectDefaultsSettings-BYtlqxeq.js";import{t as gt}from"./draft-input-DHZ1J7B_.js";import{t as _t}from"./ScopedSwitch-C7nxtEAT.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-C4aMrLLP.js";var Z=l(),Q=e(k(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(C,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Je,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(Ke,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(qe,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let w;return t[24]!==S||t[25]!==m?(w=(0,Q.jsxs)(Ye,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=w):w=t[26],w}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(de,{children:[(0,Q.jsxs)(ue,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(D,{className:`size-3`}):(0,Q.jsx)(L,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(q,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=n(u);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=J(Pe.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let o=Ot(n);if(i.current.has(o))return;i.current.add(o),r(e=>({...e,[o]:{}}));let s={};try{return await kt(e,n,async(e,n)=>{if(!ge(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(a(r.cause));return r.value},(e,t)=>{s[e]=t,r(n=>({...n,[o]:{...n[o],[e]:t}}))}),s}finally{i.current.delete(o)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[l,u]=(0,$.useState)(n),{checks:d,testConnection:f}=At(i),p=d[Ot(l)],h=Object.values(p??{}).some(Nt),g,_;t[0]===l?(g=t[1],_=t[2]):(g=Dt({...l,label:l.label.trim()||l.target}),_=c(g),t[0]=l,t[1]=g,t[2]=_);let v=_,y;t[3]===p?y=t[4]:(y=Object.values(p??{}).filter(Mt),t[3]=p,t[4]=y);let b=y.length,x;t[5]!==a||t[6]!==s?(x=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=x):x=t[7];let C=!a,w;t[8]!==a||t[9]!==h||t[10]!==l.label||t[11]!==g||t[12]!==o?(w=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),c(g)&&l.label.trim()&&!a&&!h&&o(g.value)}}),t[8]=a,t[9]=h,t[10]=l.label,t[11]=g,t[12]=o,t[13]=w):w=t[13];let T=r?`Add device host`:`Edit device host`,E;t[14]===T?E=t[15]:(E=(0,Q.jsx)(Ee,{children:T}),t[14]=T,t[15]=E);let O=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,k;t[16]===O?k=t[17]:(k=(0,Q.jsxs)(Ae,{children:[O,` `,`Hosts on the same machine are skipped.`]}),t[16]=O,t[17]=k);let A;t[18]!==E||t[19]!==k?(A=(0,Q.jsxs)(Te,{children:[E,k]}),t[18]=E,t[19]=k,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=j):j=t[21];let M;t[22]===l?M=t[23]:(M=e=>u({...l,label:e.target.value}),t[22]=l,t[23]=M);let N;t[24]!==a||t[25]!==l.label||t[26]!==M?(N=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(we,{autoFocus:!0,required:!0,value:l.label,disabled:a,onChange:M,placeholder:`Mac mini`})]}),t[24]=a,t[25]=l.label,t[26]=M,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=P):P=t[28];let F;t[29]===l?F=t[30]:(F=e=>u({...l,target:e.target.value}),t[29]=l,t[30]=F);let I;t[31]!==a||t[32]!==l.target||t[33]!==F?(I=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[P,(0,Q.jsx)(we,{required:!0,value:l.target,disabled:a,onChange:F,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=l.target,t[33]=F,t[34]=I):I=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=z):z=t[35];let ee;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=ee):ee=t[36];let te=l.identityFile??``,ne;t[37]===l?ne=t[38]:(ne=e=>{let{identityFile:t,...n}=l;u(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=l,t[38]=ne);let re;t[39]!==a||t[40]!==te||t[41]!==ne?(re=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ee,(0,Q.jsx)(we,{value:te,disabled:a,onChange:ne,placeholder:`SSH config default`})]}),t[39]=a,t[40]=te,t[41]=ne,t[42]=re):re=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=l.port??``,B;t[44]===l?B=t[45]:(B=e=>{let{port:t,...n}=l;u(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=l,t[45]=B);let V;t[46]!==a||t[47]!==ae||t[48]!==B?(V=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(we,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=V):V=t[49];let H;t[50]!==re||t[51]!==V?(H=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[re,V]}),t[50]=re,t[51]=V,t[52]=H):H=t[52];let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=oe):oe=t[53];let se;t[54]!==L||t[55]!==H?(se=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[z,H,oe]}),t[54]=L,t[55]=H,t[56]=se):se=t[56];let U=h?`Checking environments…`:p?b?`${b} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,ce;t[57]===U?ce=t[58]:(ce=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:U}),t[57]=U,t[58]=ce);let W=a||h||!v,G;t[59]!==g||t[60]!==f?(G=()=>{c(g)&&f(g.value)},t[59]=g,t[60]=f,t[61]=G):G=t[61];let K;t[62]===h?K=t[63]:(K=h?(0,Q.jsx)(le,{size:`xs`}):null,t[62]=h,t[63]=K);let ue;t[64]!==W||t[65]!==G||t[66]!==K?(ue=(0,Q.jsxs)(R,{type:`button`,size:`sm`,variant:`outline`,disabled:W,onClick:G,children:[K,` Test connection`]}),t[64]=W,t[65]=G,t[66]=K,t[67]=ue):ue=t[67];let q;t[68]!==ce||t[69]!==ue?(q=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[ce,ue]}),t[68]=ce,t[69]=ue,t[70]=q):q=t[70];let de;t[71]!==p||t[72]!==i?(de=p?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=p[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(m,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=p,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==q||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[q,de]}),t[74]=q,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==N||t[78]!==I||t[79]!==se||t[80]!==fe?(pe=(0,Q.jsxs)(ke,{children:[N,I,se,fe]}),t[77]=N,t[78]=I,t[79]=se,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(R,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=me):me=t[84];let he;t[85]!==a||t[86]!==h||t[87]!==l.label||t[88]!==v?(he=a||h||!v||!l.label.trim(),t[85]=a,t[86]=h,t[87]=l.label,t[88]=v,t[89]=he):he=t[89];let ge;t[90]===a?ge=t[91]:(ge=a?(0,Q.jsx)(le,{size:`xs`}):null,t[90]=a,t[91]=ge);let J;t[92]!==he||t[93]!==ge?(J=(0,Q.jsxs)(R,{type:`submit`,disabled:he,children:[ge,` Save host`]}),t[92]=he,t[93]=ge,t[94]=J):J=t[94];let _e;t[95]!==me||t[96]!==J?(_e=(0,Q.jsxs)(De,{children:[me,J]}),t[95]=me,t[96]=J,t[97]=_e):_e=t[97];let ve;t[98]!==A||t[99]!==pe||t[100]!==C||t[101]!==_e||t[102]!==w?(ve=(0,Q.jsxs)(je,{showCloseButton:C,render:w,children:[A,pe,_e]}),t[98]=A,t[99]=pe,t[100]=C,t[101]=_e,t[102]=w,t[103]=ve):ve=t[103];let ye;return t[104]!==x||t[105]!==ve?(ye=(0,Q.jsx)(Me,{open:!0,onOpenChange:x,children:ve}),t[104]=x,t[105]=ve,t[106]=ye):ye=t[106],ye}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:n,connectedEnvironments:i}=Xe(),a=he(e.environmentId,r),o=t.kind===`project`||t.kind===`checkout`,s=J(me.updateSettings,{reportFailure:!1}),[c,l]=(0,$.useState)(null),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(!1),h=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:g,testConnection:_}=At(h),v=async(t,r=!1,i=t)=>{if(e.environmentId&&!o){m(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ge(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return s({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?l(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{m(!1)}}};return(0,Q.jsx)(Y,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(R,{size:`sm`,variant:`outline`,disabled:!a||o||p||!e.environmentId||c!==null,onClick:()=>{f(null),l({id:O(),label:``,target:``})},children:[(0,Q.jsx)(d,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsxs)(`div`,{children:[i.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!a||o||p,checks:g,testConnection:async e=>{let t=await _(e);if(!t)return;let n=h.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${h.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{f(e),l(e)},onRemove:e=>void v(e,!0)})]},e.environmentId)),c?(0,Q.jsx)(jt,{host:c,isNew:u===null,targets:h,busy:p,onSave:e=>void v(e,!1,u??e),onClose:()=>l(null)},c.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:s,onRemove:c,checks:l,testConnection:u}=e,{state:d}=Ne(r),f=J(Pe.list),[p,m]=(0,$.useState)(null),h;t[0]===i.length?h=t[1]:(h=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=h);let g;if(t[2]!==a||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==f||t[10]!==p||t[11]!==d||t[12]!==u){let e;t[14]!==a||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Ot(e)]?.[r],h=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],g=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,v=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),h.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,v?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:v})]})}):null]}),g?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(le,{size:`xs`}),g]}):null,(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{onClick:()=>{s(e)},children:`Edit`}),(0,Q.jsx)(_,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:a||g!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=l,t[16]=r,t[17]=n,t[18]=s,t[19]=c,t[20]=f,t[21]=p,t[22]=d,t[23]=u,t[24]=e):e=t[24],g=i.map(e),t[2]=a,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=s,t[8]=c,t[9]=f,t[10]=p,t[11]=d,t[12]=u,t[13]=g}else g=t[13];let v;return t[25]!==h||t[26]!==g?(v=(0,Q.jsxs)(Q.Fragment,{children:[h,g]}),t[25]=h,t[26]=g,t[27]=v):v=t[27],v}function It(e){return(0,Q.jsxs)(de,{children:[(0,Q.jsx)(ue,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Ue,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(We,{className:`size-3.5`})}),(0,Q.jsx)(q,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[b,x]=(0,$.useState)(y),[S,C]=(0,$.useState)(),w;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(w=O(),t[7]=w):w=t[7];let T=(0,$.useRef)(`profile-${w}`),E=(0,$.useRef)(!1),D;t[8]!==o||t[9]!==_||t[10]!==b||t[11]!==i?(D=()=>{if(E.current)return;let e=zt(b,T.current,i);if(e===void 0){C(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}C(void 0),E.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{E.current=!1})},t[8]=o,t[9]=_,t[10]=b,t[11]=i,t[12]=D):D=t[12];let k=D,A;t[13]===s?A=t[14]:(A=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=A);let j=A,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let R;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==k||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==b||t[37]!==S||t[38]!==i?(R=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?k:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?k:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:b,onTargetChange:e=>{x(e),C(void 0)},targetError:S,onCancel:u,onImport:k}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=k,t[33]=d,t[34]=_,t[35]=m,t[36]=b,t[37]=S,t[38]=i,t[39]=R):R=t[39];let z;t[40]!==L||t[41]!==R?(z=(0,Q.jsx)(je,{className:`max-w-lg`,showCloseButton:L,children:R}),t[40]=L,t[41]=R,t[42]=z):z=t[42];let ee;return t[43]!==z||t[44]!==I?(ee=(0,Q.jsx)(Me,{open:!0,onOpenChange:I,children:z}),t[43]=z,t[44]=I,t[45]=ee):ee=t[45],ee}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Ae,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(R,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(De,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:a,onGranted:o,stillRequired:s,onCheck:c}=e,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===c?p=t[1]:(p=async()=>({fullDiskAccess:await c()}),t[0]=c,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=bt(p,m),g;t[3]!==a||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(a).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=a,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Ee,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Ae,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(i,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let b=`Read ${n.name}'s cookies for this import.`,x;t[9]===_?x=t[10]:(x=()=>void _(),t[9]=_,t[10]=x);let S;t[11]!==h.status.fullDiskAccess||t[12]!==b||t[13]!==x?(S=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:b,granted:h.status.fullDiskAccess,onAllow:x}],t[11]=h.status.fullDiskAccess,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==l||t[16]!==S?(C=(0,Q.jsx)(vt,{busy:l,permissions:S}),t[15]=l,t[16]=S,t[17]=C):C=t[17];let w;t[18]!==d||t[19]!==h.error?(w=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=w):w=t[20];let T;t[21]!==h||t[22]!==s?(T=h.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:s?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=h,t[22]=s,t[23]=T):T=t[23];let E;t[24]!==w||t[25]!==T||t[26]!==C?(E=(0,Q.jsxs)(ke,{children:[C,w,T]}),t[24]=w,t[25]=T,t[26]=C,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(R,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===h?O=t[31]:(O=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=O);let k;t[32]!==o||t[33]!==l||t[34]!==O?(k=(0,Q.jsx)(yt,{ready:O,busy:l,onClick:o,children:`Continue`}),t[32]=o,t[33]=l,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(De,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==v?(j=(0,Q.jsxs)(Q.Fragment,{children:[v,E,A]}),t[39]=E,t[40]=A,t[41]=v,t[42]=j):j=t[42],j}function $t(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,_=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),v;t[4]===n.name?v=t[5]:(v=(0,Q.jsxs)(Ee,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=v);let y;t[6]===r?y=t[7]:(y=(0,Q.jsxs)(Ae,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=y);let b;t[8]!==v||t[9]!==y?(b=(0,Q.jsxs)(Te,{children:[v,y]}),t[8]=v,t[9]=y,t[10]=b):b=t[10];let x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=x):x=t[11];let S;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(en,{selected:o===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],S=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=S}else S=t[15];let C;t[19]===S?C=t[20]:(C=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[x,S]}),t[19]=S,t[20]=C);let w;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(g,{className:`size-4 sm:hidden`}),(0,Q.jsx)(P,{className:`hidden size-4 sm:block`})]}),t[21]=w):w=t[21];let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=T):T=t[22];let E;t[23]!==a||t[24]!==u||t[25]!==c.kind?(E=a?(0,Q.jsx)(en,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=E):E=t[26];let D;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(en,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],D=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=D}else D=t[31];let O;t[36]!==E||t[37]!==D?(O=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[T,E,D]}),t[36]=E,t[37]=D,t[38]=O):O=t[38];let k;t[39]!==O||t[40]!==C?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[C,w,O]}),t[39]=O,t[40]=C,t[41]=k):k=t[41];let A;t[42]===_?A=t[43]:(A=_?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:_}):null,t[42]=_,t[43]=A);let j;t[44]!==k||t[45]!==A?(j=(0,Q.jsxs)(ke,{children:[k,A]}),t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]===d?M=t[48]:(M=(0,Q.jsx)(R,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=M);let N=o===``||m||h,F;t[49]!==f||t[50]!==N?(F=(0,Q.jsx)(R,{disabled:N,onClick:f,children:`Import`}),t[49]=f,t[50]=N,t[51]=F):F=t[51];let I;t[52]!==M||t[53]!==F?(I=(0,Q.jsxs)(De,{children:[M,F]}),t[52]=M,t[53]=F,t[54]=I):I=t[54];let L;return t[55]!==j||t[56]!==I||t[57]!==b?(L=(0,Q.jsxs)(Q.Fragment,{children:[b,j,I]}),t[55]=j,t[56]=I,t[57]=b,t[58]=L):L=t[58],L}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=z(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=z(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(D,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ee,{children:`Importing cookies`}),(0,Q.jsx)(Ae,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(le,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Ee,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Ae,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Te,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(le,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(ke,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(Ee,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(Ae,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Te,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(ke,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(R,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(De,{children:(0,Q.jsx)(Oe,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(Ee,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=v[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(Ae,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Te,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(R,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(R,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(De,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return f.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&dt.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:dt.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=xe(Sn),i=Se(),a=r._tag===`fill`?null:r,o=a?.width??un.width,s=a?.height??un.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===on){i({browserDefaultViewport:x});return}if(e===sn){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??un.width,height:a?.height??un.height}});return}let t=dt.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=X(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==I._tag?(0,Q.jsx)(nt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:I})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=gn(r),t[16]=r,t[17]=g);let _;t[18]===r?_=t[19]:(_=_n(r),t[18]=r,t[19]=_);let v;t[20]===_?v=t[21]:(v=(0,Q.jsx)(W,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(oe,{children:_})}),t[20]=_,t[21]=v);let y,b;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(H,{value:on,children:`Fill panel`}),b=(0,Q.jsx)(H,{value:sn,children:`Responsive`}),t[22]=y,t[23]=b):(y=t[22],b=t[23]);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(U,{align:`end`,alignItemWithTrigger:!1,children:[y,b,(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(se,{children:`Standard`}),dt.map(xn)]})]}),t[24]=S):S=t[24];let C;t[25]!==n||t[26]!==d||t[27]!==v||t[28]!==g?(C=(0,Q.jsxs)(G,{value:g,onValueChange:d,disabled:n,children:[v,S]}),t[25]=n,t[26]=d,t[27]=v,t[28]=g,t[29]=C):C=t[29];let w;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(w=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(V,{value:l.width,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(V,{value:l.height,min:240,max:T,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(B,{children:(0,Q.jsx)(ae,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(de,{children:[(0,Q.jsx)(ue,{render:(0,Q.jsx)(R,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:yn(a)}),children:(0,Q.jsx)(pt,{})})}),(0,Q.jsx)(q,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=w):w=t[35];let E;t[36]!==C||t[37]!==w?(E=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[C,w]}),t[36]=C,t[37]=w,t[38]=E):E=t[38];let D;return t[39]!==E||t[40]!==h?(D=(0,Q.jsx)(Y,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:E}),t[39]=E,t[40]=h,t[41]=D):D=t[41],D}function xn(e){return(0,Q.jsx)(H,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=xe(Tn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)(nt,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=A.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(oe,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:A.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=xe(On),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:F})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(H,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=xe(jn),i=xe(An),a=Se(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(Y,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(st,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(Y,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(st,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=xe(Pn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)(nt,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=p.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(oe,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:p.map(Nn)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Nn(e){return(0,Q.jsxs)(H,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=xe(Rn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)(nt,{label:`link target`,onClick:()=>i({browserLinkTarget:j})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=Fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(oe,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(Fn),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:u.map(Ln)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function Ln(e){return(0,Q.jsx)(H,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=Xe(),r=$e(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(rt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:n}){let i=he(e,r),{state:a,loaded:o}=Ne(e),{scope:s,environments:c,connectedEnvironments:l}=Xe(),u=Qe(),d=s.kind===`project`||s.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=J(Pe.configure,{reportFailure:!1}),m=J(Pe.list,{reportFailure:!1}),[h,g]=(0,$.useState)(null),_=a.hostStatus===`installing`||a.hostStatus===`starting`,v=a.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[y,b]=(0,$.useState)(!1);y&&!t&&b(!1),t&&!y&&(a.hostStatus===`ready`||v)&&h!==`hub`&&b(!0);let x=async(t,n)=>{if(e&&ge(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(c.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ge(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=c.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{g(null)}}},[S,C]=(0,$.useState)(null),w=a.hosts.find(e=>e.kind===`local`)?.tools,T=t=>{let n=w?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.supportsToolUpdate&&r?(0,Q.jsx)(R,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&C({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>g(null)))},children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,a.supportsToolInspection?(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:ze,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`hub`),kind:`hub`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`hub`?(0,Q.jsx)(Re,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!i||d||!o||!e||_||h!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(He,{children:y?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:l.length>1?`Status for ${l.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Le,{compact:!0,platform:`iOS`,status:Be(a,`ios`)}),(0,Q.jsx)(Le,{compact:!0,platform:`Android`,status:Be(a,`android`)})]}),control:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:!e||!t||_||h!==null,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Fe,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:T(`agent`),kind:`agent`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`agent`?(0,Q.jsx)(Ve,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!i||l.length===0||!d&&(!o||!f||_)||h!==null,"aria-label":`Agent device access`,onCheckedChange:e=>d?u({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Ie,{state:{...a,hosts:a.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=xe(Hn),i=Se(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)(nt,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(st,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(Y,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=xe(e=>e.browserProfiles),n=xe(e=>e.browserDefaultProfileId),r=ve(),i=Se(),{environments:a,isReady:c}=fe(),l=pe(),[u,f]=(0,$.useState)(null),[p,m]=(0,$.useState)(null),[g,v]=(0,$.useState)(null),[x,S]=(0,$.useState)(null),[C,T]=(0,$.useState)(null),[D,k]=(0,$.useState)(!1),A=ie(),j=J(Ge.clearProfile,{reportFailure:!1}),P={environmentIds:a.map(e=>e.environmentId).filter(e=>A.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await j({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw re(n)}},F=ln(ft!==null,c,a.length,P.environmentIds.length),I=(0,$.useRef)(!1),[L,ae]=(0,$.useState)(!1),B=e||!r,V=b(t).filter(e=>e.kind!==`incognito`),H=te(V,n)?.id??`default`,oe=e=>{if(!r||I.current)return;let t=be().browserProfiles;if(t.length>=24)return;let n=b(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${O()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},se=(e,t)=>{if(!r||I.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=be().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},U=(e,t)=>{if(r&&!I.current){if(!F){K.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(ft,a.map(e=>e.environmentId),e,P).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},ce=async e=>{if(!r||I.current)return;if(!F){T(`Connect to an environment before removing this profile.`);return}T(null),k(!0);try{await cn(ft,c?a.map(e=>e.environmentId):[],e,P)}catch{T(`Profile data could not be deleted. Try again.`),k(!1);return}let t=be();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:E}:{}}),k(!1),v(null)},W=(u??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),G=(0,$.useCallback)(()=>{ft&&ft.listBrowserImportSources().then(f).catch(()=>f(e=>e??[]))},[]),le=async(e,t,n)=>{if(!ft||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!b(be().browserProfiles).some(e=>e.id===n.target.profileId)||I.current)return{kind:`blocked`,reason:`readFailed`};I.current=!0,ae(!0);try{let r=await ft.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!b(be().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await ye(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let r=new Set(b(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(ft,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{I.current=!1,ae(!1)}},ue=async e=>{if(ft)try{let t=await ft.listBrowserImportSources();return f(t),t.find(t=>t.id===e)}catch{return}},q=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(o,{onOpenChange:e=>e&&G(),children:[(0,Q.jsxs)(M,{render:(0,Q.jsx)(R,{size:`sm`,variant:`outline`,disabled:B||L}),children:[(0,Q.jsx)(d,{}),`Add profile`]}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||q,onClick:()=>oe(`New profile`),children:`Blank profile`}),q?(0,Q.jsx)(_,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(ee,{}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(s,{children:`Import from`}),u===null?(0,Q.jsx)(_,{disabled:!0,children:`Looking for browsers…`}):W.length===0?(0,Q.jsx)(_,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[W.map(e=>(0,Q.jsx)(_,{disabled:!r||l==null,onClick:()=>{r&&l!=null&&m({source:e,environmentId:l.environmentId,environmentName:Ze({isPrimary:!0,environmentId:l.environmentId,runtimeLabel:l.label})})},children:e.name},e.id)),l==null?(0,Q.jsx)(_,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:V.map((e,t)=>{let n=ne(e.id),a=e.id===H;return(0,Q.jsxs)(`div`,{className:z(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:z(`truncate text-sm text-foreground`,B&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:B||L,maxLength:48,value:e.name,onCommit:t=>se(e.id,t)}),a?(0,Q.jsx)(`span`,{className:z(`flex`,B&&`opacity-64`),children:(0,Q.jsx)(h,{children:`Default`})}):null]}),(0,Q.jsxs)(o,{children:[(0,Q.jsx)(M,{render:(0,Q.jsx)(R,{size:`icon-xs`,variant:`ghost-muted`,disabled:B||L,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(w,{})}),(0,Q.jsxs)(y,{align:`end`,children:[(0,Q.jsx)(_,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(_,{disabled:!r||!F,onClick:()=>{P.environmentIds.length>0?S(e):U(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(_,{variant:`destructive`,disabled:!r||!F,onClick:()=>{r&&v(e)},children:`Remove profile and data`}),F?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{}),(0,Q.jsx)(_,{disabled:!0,children:c?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(it,{open:g!==null,onOpenChange:e=>{!e&&!D&&(v(null),T(null))},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Remove “`,g?.name,`”?`]}),(0,Q.jsx)(ct,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),C?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:C}):null,F?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{disabled:D,render:(0,Q.jsx)(R,{variant:`outline`,disabled:D}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,disabled:D||!r||!F,onClick:()=>{g&&r&&F&&ce(g.id)},children:D?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(it,{open:x!==null,onOpenChange:e=>{e||S(null)},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsxs)(ot,{children:[`Clear “`,x?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(ct,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(mt,{render:(0,Q.jsx)(R,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(R,{variant:`destructive`,onClick:()=>{x&&U(x.id,x.name),S(null)},children:`Clear data`})]})]})}),p?(0,Q.jsx)(Jt,{source:p.source,destinationEnvironmentName:p.environmentName,targetProfiles:V.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!q,onImport:e=>le(p.source,p.environmentId,e),onRefreshSource:()=>ue(p.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await _e()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>m(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!Ce,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(tt,{children:[i,(0,Q.jsx)(rt,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(et,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
|
|
2
|
+
//# sourceMappingURL=settings.integrations-C-uLxrlE.js.map
|
package/dist/client/assets/{settings.keybindings-CeqZWQEi.js → settings.keybindings-BGq7j4EC.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{Ac as n,Ad as r,C_ as i,Em as a,Gd as o,Gn as s,Jp as c,NE as l,Pp as u,Qd as d,Um as f,Wn as p,Yn as m,Zn as h,__ as g,gd as _,lE as v,or as y,sp as b,sr as x,t as S}from"./utils-BEVyjoxo.js";import{R as C,W as w}from"./runtime-D8mKjOP-.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-B47XfaxQ.js";import{t as A}from"./useLocation-B3ir4ben.js";import{i as j}from"./toast-DhMYg_gN.js";import{a as M,n as N,t as P}from"./tooltip-Cq9yz15d.js";import{f as F}from"./server-CaLEm3Wt.js";import{i as ee,n as I,o as te}from"./session-2CRBJwS7.js";import{t as L}from"./use-atom-command-x4GQBtio.js";import{t as ne}from"./env-wK1YYxA8.js";import{t as R}from"./toggle-BshAsXT6.js";import{t as re}from"./input-RqvQJ9gh.js";import{i as ie}from"./keybindings-BtHOXkP-.js";import{i as ae,o as oe,t as z}from"./popover-DE9WCm99.js";import{n as se,r as ce,t as B}from"./input-group-BFtrsedw.js";import{n as le,t as ue}from"./kbd-BnsXAHsc.js";import{B as de,U as fe,a as pe,i as me,s as he}from"./settingsLayout-DHc6oKfL.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-6lVDnd1N.js";import{Wa as Ee,ir as De,rr as Oe}from"./main-Bh6Hj0_-.js";var W=l(),G=e(t(),1),K=e(v(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(c,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let l;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(l=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=l):l=t[10],l}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:o}=e,s=r===void 0||r?0:void 0,c;t[0]===i?c=t[1]:(c=S(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=c);let l;t[2]!==n||t[3]!==s||t[4]!==c?(l=(0,K.jsx)(`span`,{tabIndex:s,"aria-label":n,className:c}),t[2]=n,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(a,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsx)(M,{render:l,children:u}),t[7]=l,t[8]=d);let f;t[9]===o?f=t[10]:(f=(0,K.jsx)(N,{side:`top`,children:o}),t[9]=o,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(P,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=S(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(b,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(M,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(N,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(P,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,s),onRemove:o}):null,t[21]=s,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=S(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=s+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let l=n.type===`or`?`or`:`and`,d,f,p,m;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),h=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),l);i&&a(i)},g=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},_=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},v=()=>{let t=J([...e,Y()],l);t&&a(t)},y=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},b=s>0&&`border-border/70 bg-background/55`;t[64]===b?p=t[65]:(p=S(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,b),t[64]=b,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(u,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(u,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],m=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:l,onValueChange:e=>_(e),children:[C,w]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:v,children:[A,`Condition`]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:y,children:[j,`Group`]}),M]}),d=`space-y-2`,f=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:S(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:S(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>h(t,e),onRemove:()=>g(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=d,t[61]=f,t[62]=p,t[63]=m}else d=t[60],f=t[61],p=t[62],m=t[63];let h;t[74]!==d||t[75]!==f?(h=(0,K.jsx)(`div`,{className:d,children:f}),t[74]=d,t[75]=f,t[76]=h):h=t[76];let g;return t[77]!==p||t[78]!==m||t[79]!==h?(g=(0,K.jsxs)(`div`,{className:p,children:[m,h]}),t[77]=p,t[78]=m,t[79]=h,t[80]=g):g=t[80],g}function Ve(e){let t=(0,W.c)(60),{value:n,variables:i,onChange:a,onValidityChange:o}=e,s;t[0]===n?s=t[1]:(s=U(n),t[0]=n,t[1]=s);let[c,l]=(0,G.useState)(s),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,p=f.ok?null:f.message,m;t[4]!==f.ok||t[5]!==f.value?(m=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=m):m=t[6];let h=m,g;t[7]!==a||t[8]!==o?(g=e=>{l(e);let t=Te(e);o?.(t.ok),t.ok&&a(t.value)},t[7]=a,t[8]=o,t[9]=g):g=t[9];let _=g,v;t[10]!==a||t[11]!==o?(v=e=>{l(U(e)),o?.(!0),a(e)},t[10]=a,t[11]=o,t[12]=v):v=t[12];let y=v,b;t[13]!==y||t[14]!==n?(b=()=>{if(!n){y(Y());return}y({type:`and`,left:n,right:Y()})},t[13]=y,t[14]=n,t[15]=b):b=t[15];let S=b,C;t[16]!==y||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){y(e);return}y({type:`and`,left:n,right:e})},t[16]=y,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(u,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(u,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===_?j=t[30]:(j=e=>_(e.currentTarget.value),t[29]=_,t[30]=j);let M=!!p,N;t[31]!==c||t[32]!==j||t[33]!==M?(N=(0,K.jsx)(ce,{value:c,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=c,t[32]=j,t[33]=M,t[34]=N):N=t[34];let P;t[35]===h?P=t[36]:(P=h.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:h})}):null,t[35]=h,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,K.jsxs)(B,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let ee;t[40]===p?ee=t[41]:(ee=p?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(r,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=ee);let I;t[42]!==F||t[43]!==ee?(I=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[F,ee]}),t[42]=F,t[43]=ee,t[44]=I):I=t[44];let te;t[45]!==S||t[46]!==w||t[47]!==y||t[48]!==n||t[49]!==i?(te=n?(0,K.jsx)(Z,{node:n,variables:i,onChange:y,onRemove:()=>y(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(x,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(u,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(u,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=y,t[48]=n,t[49]=i,t[50]=te):te=t[50];let L;t[51]===p?L=t[52]:(L=p?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=p,t[52]=L);let ne;t[53]!==te||t[54]!==L?(ne=(0,K.jsxs)(`div`,{className:`relative`,children:[te,L]}),t[53]=te,t[54]=L,t[55]=ne):ne=t[55];let R;return t[56]!==A||t[57]!==I||t[58]!==ne?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,I,ne]}),t[56]=A,t[57]=I,t[58]=ne,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,m;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(m=c?(0,K.jsx)(x,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=m):m=t[5];let h;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(h=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:S(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,K.jsxs)(K.Fragment,{children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(x,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,d=r||`Always`,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:d}),t[2]=d,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(_,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=p):p=t[4];let m;t[5]!==l||t[6]!==u||t[7]!==f?(m=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,p]}),t[5]=l,t[6]=u,t[7]=f,t[8]=m):m=t[8];let h;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(h=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=h):h=t[13];let g;return t[14]!==m||t[15]!==h?(g=(0,K.jsxs)(z,{children:[m,h]}),t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:i,onRemove:a}=e,c=n.source===`Custom`&&n.defaultKey!==null,l=n.source!==`Default`;if(!c&&!l)return null;let u;t[0]===n.command?u=t[1]:(u=V(n.command),t[0]=n.command,t[1]=u);let d=`Actions for ${u}`,f;t[2]!==r||t[3]!==d?(f=(0,K.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":d}),t[2]=r,t[3]=d,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(o,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===f?g=t[7]:(g=(0,K.jsx)(y,{render:f,children:p}),t[6]=f,t[7]=g);let _;t[8]!==c||t[9]!==r||t[10]!==i||t[11]!==n?(_=c?(0,K.jsx)(m,{disabled:r,onClick:()=>i(n),children:`Reset to default`}):null,t[8]=c,t[9]=r,t[10]=i,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==l||t[14]!==r||t[15]!==a||t[16]!==n?(v=l?(0,K.jsx)(m,{variant:`destructive`,disabled:r,onClick:()=>a(n),children:`Remove`}):null,t[13]=l,t[14]=r,t[15]=a,t[16]=n,t[17]=v):v=t[17];let b;t[18]!==_||t[19]!==v?(b=(0,K.jsxs)(h,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=b):b=t[20];let S;return t[21]!==g||t[22]!==b?(S=(0,K.jsxs)(s,{children:[g,b]}),t[21]=g,t[22]=b,t[23]=S):S=t[23],S}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(p,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(M,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(N,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(P,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(f,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(M,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(N,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(P,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let m;t[12]===l?m=t[13]:(m=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=m);let h=a||!l.canSave,g=a?`Saving`:`Save`,_;t[14]!==l.save||t[15]!==h||t[16]!==g?(_=(0,K.jsx)(x,{size:`sm`,disabled:h,onClick:l.save,children:g}),t[14]=l.save,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==a||t[19]!==s?(v=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=v):v=t[20];let y;t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==_||t[25]!==v?(y=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,_,v]}),t[21]=f,t[22]=p,t[23]=m,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;return t[27]!==y||t[28]!==d?(b=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:y}),t[27]=y,t[28]=d,t[29]=b):b=t[29],b}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(P,{children:[(0,K.jsx)(M,{delay:200,render:(0,K.jsx)(x,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(a,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(N,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:r}=de(),a=ee(t?.environmentId??null,g),o=te(r,i),s;e[0]!==r||e[1]!==o?(s=r.length>0&&r.every(e=>o.has(e.environmentId)),e[0]=r,e[1]=o,e[2]=s):s=e[2];let c=s,l=t?.serverConfig?.keybindings,f;e[3]===l?f=e[4]:(f=l??[],e[3]=l,e[4]=f);let p;e[5]===f?p=e[6]:(p=n(f),e[5]=f,e[6]=p);let m=p,h=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let v=_,y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y={reportFailure:!1},e[9]=y):y=e[9];let b=L(F.upsertKeybinding,y),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=L(F.removeKeybinding,S),E=Ee(t?.environmentId??null,v),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==m||e[12]!==D?(oe=Se(m,D),e[11]=m,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===m?_e=e[20]:(_e=be(m),e[19]=m,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==h||e[23]!==E||e[24]!==t?(Ce=()=>{h&&t&&I(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(h);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=h,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==r||e[27]!==t||e[28]!==b?(Te=e=>{if(!t||!r.every(dt))return;re(e.command);let n={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(r.map(e=>b({environmentId:e.environmentId,input:n})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=r,e[27]=t,e[28]=b,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==r||e[31]!==t||e[32]!==T?(ke=e=>{t&&r.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(r.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let n=t.find(ct)??t[0];if(n?._tag===`Failure`&&!C(n)){let e=w(n);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=r,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!c,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(u,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(x,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!h||!a,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(d,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(M,{render:(0,K.jsx)(x,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(N,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(P,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==c||e[62]!==r?(Ke=c?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=c,e[62]=r,e[63]=Ke):Ke=e[63];let qe=!c,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return I(e.environmentId,i)}function ut(e){return e._tag===`Failure`}function dt(e){return I(e.environmentId,i)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
|
|
2
|
-
//# sourceMappingURL=settings.keybindings-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ac as n,Ad as r,C_ as i,Em as a,Gd as o,Gn as s,Jp as c,NE as l,Pp as u,Qd as d,Um as f,Wn as p,Yn as m,Zn as h,__ as g,gd as _,lE as v,or as y,sp as b,sr as x,t as S}from"./utils-BEVyjoxo.js";import{R as C,W as w}from"./runtime-C9FXEGBC.js";import{a as T,c as E,o as D,s as O,t as k}from"./select-B47XfaxQ.js";import{t as A}from"./useLocation-B3ir4ben.js";import{i as j}from"./toast-D1xgN6T2.js";import{a as M,n as N,t as P}from"./tooltip-Cq9yz15d.js";import{f as F}from"./server-B3nCKBrK.js";import{i as ee,n as I,o as te}from"./session-DtKtS09P.js";import{t as L}from"./use-atom-command-DFVJioxM.js";import{t as ne}from"./env-wK1YYxA8.js";import{t as R}from"./toggle-BshAsXT6.js";import{t as re}from"./input-RqvQJ9gh.js";import{i as ie}from"./keybindings-BtHOXkP-.js";import{i as ae,o as oe,t as z}from"./popover-DE9WCm99.js";import{n as se,r as ce,t as B}from"./input-group-BFtrsedw.js";import{n as le,t as ue}from"./kbd-BnsXAHsc.js";import{B as de,U as fe,a as pe,i as me,s as he}from"./settingsLayout-Oe2gP0HD.js";import{a as V,c as ge,f as _e,i as ve,l as ye,m as H,n as be,o as xe,p as U,r as Se,s as Ce,t as we,u as Te}from"./KeybindingsSettings.logic-6lVDnd1N.js";import{Wa as Ee,ir as De,rr as Oe}from"./main-C6Kmott7.js";var W=l(),G=e(t(),1),K=e(v(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=le,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ue,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(se,{children:(0,K.jsx)(c,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let l;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(l=(0,K.jsxs)(B,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ce,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=l):l=t[10],l}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:we}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:o}=e,s=r===void 0||r?0:void 0,c;t[0]===i?c=t[1]:(c=S(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=c);let l;t[2]!==n||t[3]!==s||t[4]!==c?(l=(0,K.jsx)(`span`,{tabIndex:s,"aria-label":n,className:c}),t[2]=n,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(a,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,K.jsx)(M,{render:l,children:u}),t[7]=l,t[8]=d);let f;t[9]===o?f=t[10]:(f=(0,K.jsx)(N,{side:`top`,children:o}),t[9]=o,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(P,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(O,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(k,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=S(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(b,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(M,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(N,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(P,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Ce(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(R,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:H(n,s),onRemove:o}):null,t[21]=s,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=S(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(0,K.jsx)(R,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,t[39]=l,t[40]=u):u=t[40];let d,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=f):(d=t[41],f=t[42]);let p=s+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,K.jsx)(Z,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,K.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let l=n.type===`or`?`or`:`and`,d,f,p,m;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),h=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),l);i&&a(i)},g=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},_=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},v=()=>{let t=J([...e,Y()],l);t&&a(t)},y=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},b=s>0&&`border-border/70 bg-background/55`;t[64]===b?p=t[65]:(p=S(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,b),t[64]=b,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(O,{size:`compact`,className:`w-24`,children:(0,K.jsx)(E,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(T,{value:`and`,children:`and`}),(0,K.jsx)(T,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let A;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,K.jsx)(u,{className:`size-3.5`}),t[68]=A):A=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,K.jsx)(u,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:H(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],m=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(k,{value:l,onValueChange:e=>_(e),children:[C,w]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:v,children:[A,`Condition`]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:y,children:[j,`Group`]}),M]}),d=`space-y-2`,f=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:S(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:S(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>h(t,e),onRemove:()=>g(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=d,t[61]=f,t[62]=p,t[63]=m}else d=t[60],f=t[61],p=t[62],m=t[63];let h;t[74]!==d||t[75]!==f?(h=(0,K.jsx)(`div`,{className:d,children:f}),t[74]=d,t[75]=f,t[76]=h):h=t[76];let g;return t[77]!==p||t[78]!==m||t[79]!==h?(g=(0,K.jsxs)(`div`,{className:p,children:[m,h]}),t[77]=p,t[78]=m,t[79]=h,t[80]=g):g=t[80],g}function Ve(e){let t=(0,W.c)(60),{value:n,variables:i,onChange:a,onValidityChange:o}=e,s;t[0]===n?s=t[1]:(s=U(n),t[0]=n,t[1]=s);let[c,l]=(0,G.useState)(s),d;t[2]===c?d=t[3]:(d=Te(c),t[2]=c,t[3]=d);let f=d,p=f.ok?null:f.message,m;t[4]!==f.ok||t[5]!==f.value?(m=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=m):m=t[6];let h=m,g;t[7]!==a||t[8]!==o?(g=e=>{l(e);let t=Te(e);o?.(t.ok),t.ok&&a(t.value)},t[7]=a,t[8]=o,t[9]=g):g=t[9];let _=g,v;t[10]!==a||t[11]!==o?(v=e=>{l(U(e)),o?.(!0),a(e)},t[10]=a,t[11]=o,t[12]=v):v=t[12];let y=v,b;t[13]!==y||t[14]!==n?(b=()=>{if(!n){y(Y());return}y({type:`and`,left:n,right:Y()})},t[13]=y,t[14]=n,t[15]=b):b=t[15];let S=b,C;t[16]!==y||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){y(e);return}y({type:`and`,left:n,right:e})},t[16]=y,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(u,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(u,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===_?j=t[30]:(j=e=>_(e.currentTarget.value),t[29]=_,t[30]=j);let M=!!p,N;t[31]!==c||t[32]!==j||t[33]!==M?(N=(0,K.jsx)(ce,{value:c,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=c,t[32]=j,t[33]=M,t[34]=N):N=t[34];let P;t[35]===h?P=t[36]:(P=h.length>0?(0,K.jsx)(se,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:h})}):null,t[35]=h,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,K.jsxs)(B,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let ee;t[40]===p?ee=t[41]:(ee=p?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(r,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=ee);let I;t[42]!==F||t[43]!==ee?(I=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[F,ee]}),t[42]=F,t[43]=ee,t[44]=I):I=t[44];let te;t[45]!==S||t[46]!==w||t[47]!==y||t[48]!==n||t[49]!==i?(te=n?(0,K.jsx)(Z,{node:n,variables:i,onChange:y,onRemove:()=>y(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(x,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(u,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(x,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(u,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=y,t[48]=n,t[49]=i,t[50]=te):te=t[50];let L;t[51]===p?L=t[52]:(L=p?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=p,t[52]=L);let ne;t[53]!==te||t[54]!==L?(ne=(0,K.jsxs)(`div`,{className:`relative`,children:[te,L]}),t[53]=te,t[54]=L,t[55]=ne):ne=t[55];let R;return t[56]!==A||t[57]!==I||t[58]!==ne?(R=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,I,ne]}),t[56]=A,t[57]=I,t[58]=ne,t[59]=R):R=t[59],R}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=ge(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f}=r,p=!s&&o===n.key&&n.key.length>0&&!c,m;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(m=c?(0,K.jsx)(x,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=m):m=t[5];let h;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==p?(h=p?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${V(n.command)}: ${ie(n.binding.shortcut)}`,className:S(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${V(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,K.jsxs)(K.Fragment,{children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(x,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,d=r||`Always`,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:d}),t[2]=d,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(_,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=p):p=t[4];let m;t[5]!==l||t[6]!==u||t[7]!==f?(m=(0,K.jsxs)(oe,{render:l,"aria-label":u,children:[f,p]}),t[5]=l,t[6]=u,t[7]=f,t[8]=m):m=t[8];let h;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(h=(0,K.jsx)(ae,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=h):h=t[13];let g;return t[14]!==m||t[15]!==h?(g=(0,K.jsxs)(z,{children:[m,h]}),t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:r,onReset:i,onRemove:a}=e,c=n.source===`Custom`&&n.defaultKey!==null,l=n.source!==`Default`;if(!c&&!l)return null;let u;t[0]===n.command?u=t[1]:(u=V(n.command),t[0]=n.command,t[1]=u);let d=`Actions for ${u}`,f;t[2]!==r||t[3]!==d?(f=(0,K.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":d}),t[2]=r,t[3]=d,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(o,{className:`size-3.5`}),t[5]=p):p=t[5];let g;t[6]===f?g=t[7]:(g=(0,K.jsx)(y,{render:f,children:p}),t[6]=f,t[7]=g);let _;t[8]!==c||t[9]!==r||t[10]!==i||t[11]!==n?(_=c?(0,K.jsx)(m,{disabled:r,onClick:()=>i(n),children:`Reset to default`}):null,t[8]=c,t[9]=r,t[10]=i,t[11]=n,t[12]=_):_=t[12];let v;t[13]!==l||t[14]!==r||t[15]!==a||t[16]!==n?(v=l?(0,K.jsx)(m,{variant:`destructive`,disabled:r,onClick:()=>a(n),children:`Remove`}):null,t[13]=l,t[14]=r,t[15]=a,t[16]=n,t[17]=v):v=t[17];let b;t[18]!==_||t[19]!==v?(b=(0,K.jsxs)(h,{align:`end`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=b):b=t[20];let S;return t[21]!==g||t[22]!==b?(S=(0,K.jsxs)(s,{children:[g,b]}),t[21]=g,t[22]=b,t[23]=S):S=t[23],S}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(p,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=V(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(M,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(N,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(P,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=V(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(pe,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=ge(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?V(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=ye(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(O,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(D,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(k,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(T,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:V(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(re,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(x,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(f,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(M,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(N,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(P,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let m;t[12]===l?m=t[13]:(m=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=m);let h=a||!l.canSave,g=a?`Saving`:`Save`,_;t[14]!==l.save||t[15]!==h||t[16]!==g?(_=(0,K.jsx)(x,{size:`sm`,disabled:h,onClick:l.save,children:g}),t[14]=l.save,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==a||t[19]!==s?(v=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=v):v=t[20];let y;t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==_||t[25]!==v?(y=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,_,v]}),t[21]=f,t[22]=p,t[23]=m,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;return t[27]!==y||t[28]!==d?(b=(0,K.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:y}),t[27]=y,t[28]=d,t[29]=b):b=t[29],b}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(P,{children:[(0,K.jsx)(M,{delay:200,render:(0,K.jsx)(x,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(a,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(N,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:r}=de(),a=ee(t?.environmentId??null,g),o=te(r,i),s;e[0]!==r||e[1]!==o?(s=r.length>0&&r.every(e=>o.has(e.environmentId)),e[0]=r,e[1]=o,e[2]=s):s=e[2];let c=s,l=t?.serverConfig?.keybindings,f;e[3]===l?f=e[4]:(f=l??[],e[3]=l,e[4]=f);let p;e[5]===f?p=e[6]:(p=n(f),e[5]=f,e[6]=p);let m=p,h=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let v=_,y;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(y={reportFailure:!1},e[9]=y):y=e[9];let b=L(F.upsertKeybinding,y),S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S={reportFailure:!1},e[10]=S):S=e[10];let T=L(F.removeKeybinding,S),E=Ee(t?.environmentId??null,v),[D,O]=(0,G.useState)(``),k=(0,G.useRef)(null),[R,re]=(0,G.useState)(null),[ie,ae]=(0,G.useState)(!1),oe;e[11]!==m||e[12]!==D?(oe=Se(m,D),e[11]=m,e[12]=D,e[13]=oe):oe=e[13];let z=oe,se;e[14]===z?se=e[15]:(se=xe(z),e[14]=z,e[15]=se);let ce=se,B;if(e[16]!==z){B=new Map;let t=new Set;for(let e of z)t.has(e.command)||(t.add(e.command),B.set(e.id,Oe(e.command)));e[16]=z,e[17]=B}else B=e[17];let le=B,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let pe=A(ue),[V,ge]=(0,G.useState)(pe);pe!==V&&(ge(pe),pe.startsWith(`keybinding-`)&&O(``));let _e;e[19]===m?_e=e[20]:(_e=be(m),e[19]=m,e[20]=_e);let ye=_e,H;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(H=ve(),e[21]=H):H=e[21];let U=H,Ce;e[22]!==h||e[23]!==E||e[24]!==t?(Ce=()=>{h&&t&&I(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(h);if(e._tag===`Success`||C(e))return;let t=w(e);j.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=h,e[23]=E,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Te;e[26]!==r||e[27]!==t||e[28]!==b?(Te=e=>{if(!t||!r.every(dt))return;re(e.command);let n={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(r.map(e=>b({environmentId:e.environmentId,input:n})));re(null);let t=e.find(ut);if(!t){ae(!1);return}if(!C(t)){let e=w(t);j.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=r,e[27]=t,e[28]=b,e[29]=Te):Te=e[29];let q=Te,ke;e[30]!==r||e[31]!==t||e[32]!==T?(ke=e=>{t&&r.every(lt)&&(re(e.command),(async()=>{let t=await Promise.all(r.map(t=>T({environmentId:t.environmentId,input:Ue(e)})));re(null);let n=t.find(ct)??t[0];if(n?._tag===`Failure`&&!C(n)){let e=w(n);j.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=r,e[31]=t,e[32]=T,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>ae(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==z||e[40]!==q?(Y={allRows:z,variables:U,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=z,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=De(`keybindings`),Le=ne?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,K.jsx)(Ae,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ie||!c,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>ae(!0),Be=(0,K.jsx)(u,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(x,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!h||!a,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(d,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(M,{render:(0,K.jsx)(x,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(N,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(P,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(he,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==c||e[62]!==r?(Ke=c?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=c,e[62]=r,e[63]=Ke):Ke=e[63];let qe=!c,Je;e[64]!==ye||e[65]!==ie||e[66]!==z||e[67]!==q||e[68]!==R?(Je=ie?(0,K.jsx)(fe,{children:(0,K.jsx)(it,{commandOptions:ye,allRows:z,variables:U,isSaving:R!==null,onSave:q,onCancel:Pe})}):null,e[64]=ye,e[65]=ie,e[66]=z,e[67]=q,e[68]=R,e[69]=Je):Je=e[69];let Ye;e[70]!==le||e[71]!==ce||e[72]!==Fe||e[73]!==R?(Ye=ce.length>0?(0,K.jsx)(at,{groups:ce,anchorIds:le,savingCommand:R,...Fe}):(0,K.jsx)(fe,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=le,e[71]=ce,e[72]=Fe,e[73]=R,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(me,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return I(e.environmentId,i)}function ut(e){return e._tag===`Failure`}function dt(e){return I(e.environmentId,i)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
|
|
2
|
+
//# sourceMappingURL=settings.keybindings-BGq7j4EC.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{Jp as n,Kd as r,NE as i,lE as a,sr as o,vd as s}from"./utils-BEVyjoxo.js";import{a as c,n as l,t as u}from"./tooltip-Cq9yz15d.js";import{n as d,r as f,t as p}from"./input-group-BFtrsedw.js";import{i as m,s as h}from"./settingsLayout-
|
|
2
|
-
//# sourceMappingURL=settings.open-source-licenses-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Jp as n,Kd as r,NE as i,lE as a,sr as o,vd as s}from"./utils-BEVyjoxo.js";import{a as c,n as l,t as u}from"./tooltip-Cq9yz15d.js";import{n as d,r as f,t as p}from"./input-group-BFtrsedw.js";import{i as m,s as h}from"./settingsLayout-Oe2gP0HD.js";import{Fa as g,Ia as _,Pa as v}from"./main-C6Kmott7.js";var y=e(t(),1),b=i();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(a(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:i,onOpenChange:a}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(_,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(o,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(r,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==i?(S=i?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=i,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(g,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==a||t[31]!==i||t[32]!==w?(T=(0,A.jsx)(v,{open:i,onOpenChange:a,children:w}),t[30]=a,t[31]=i,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:r,onQueryChange:i,searchOpen:a,onSearchOpenChange:s,filteredCount:m,totalCount:h}=e;if(!a){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let r;t[3]===s?r=t[4]:(r=()=>s(!0),t[3]=s,t[4]=r);let i;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(n,{className:`size-3`}),t[5]=i):i=t[5];let a;t[6]===r?a=t[7]:(a=(0,A.jsx)(c,{render:(0,A.jsx)(o,{"aria-label":`Search open-source licenses`,onClick:r,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:i})}),t[6]=r,t[7]=a);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===a?f=t[10]:(f=(0,A.jsxs)(u,{children:[a,d]}),t[9]=a,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(n,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==r.length?(v=()=>{r.length===0&&s(!1)},t[18]=s,t[19]=r.length,t[20]=v):v=t[20];let y;t[21]===i?y=t[22]:(y=e=>i(e.currentTarget.value),t[21]=i,t[22]=y);let x;t[23]!==i||t[24]!==s?(x=e=>{e.key===`Escape`&&(e.preventDefault(),i(``),s(!1))},t[23]=i,t[24]=s,t[25]=x):x=t[25];let S;t[26]!==r||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:r})]}),t[26]=r,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=a);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(o,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:_.length}):null,e[11]=_,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(m,{children:(0,A.jsx)(h,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
|
|
2
|
+
//# sourceMappingURL=settings.open-source-licenses-VexlqZXJ.js.map
|