@p4code/cli 0.9.20 → 0.9.21
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/{TraceDiagnostics-BYrlvKdA.mjs → TraceDiagnostics-DEAfnZGb.mjs} +2 -2
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-DReuiGmk.mjs → binCli-IfUU-uWs.mjs} +5 -5
- package/dist/client/.vite/manifest.json +1107 -1107
- package/dist/client/assets/{2NI2N5EU-DjM2qwkD.js → 2NI2N5EU-qP3PpVDC.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-BJdq41GZ.js → 4UO7MD6I-Da5jHHfF.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-D21CBy6j.js → 5B3SVYGG-BGHUtemY.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-DOIdqlC8.js → 5GK6JWQ2-DwbHk3MV.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-Bckll9rH.js → 5N7A7DKN-B-2quXAp.js} +2 -2
- package/dist/client/assets/{5OC2THR4-skJPz5iO.js → 5OC2THR4-DSQWJ0ZQ.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-CRwXaSb1.js → 5S6HY5KT-CAwEcA6I.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-sJYhkmUL.js → 6IMQ5BUJ-BABYtiev.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-DY2aNKk1.js → 6OLKWJ4F-CwQRt55E.js} +2 -2
- package/dist/client/assets/{74OO7NKP-DpZyVE6P.js → 74OO7NKP-DZoL_aBI.js} +2 -2
- package/dist/client/assets/{75O6YZUN-8DIThGtQ.js → 75O6YZUN-CoqdPLhF.js} +2 -2
- package/dist/client/assets/{77XECAW3-BE-MTjvu.js → 77XECAW3-DM5Itfvk.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-DB_eiHX6.js → ABYRPUBD-C2IaQicJ.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-BM3c1qJe.js → AuthSurfaceShell-Dfcdz_aG.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-BhRNS6b8.js → BB2UYUI2-DQkTEBDf.js} +2 -2
- package/dist/client/assets/{BUM34MOA-RvYWUXux.js → BUM34MOA-DuY83HEN.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-byct14yE.js → CEQABKGZ-CNAynrzB.js} +2 -2
- package/dist/client/assets/{CXAC5362-YcQsQFwj.js → CXAC5362-B_mhvA6r.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-BQOZ260S.js → ChatGptUsageButton-DT3CRIhB.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-BdoTEVpd.js → ChatMarkdown-_SLyl8Hk.js} +5 -5
- package/dist/client/assets/{CodexSetupSection.logic-CseyxFgK.js → CodexSetupSection.logic-CqdvWoE6.js} +2 -2
- package/dist/client/assets/{CommandBlock-Cg8P2GXg.js → CommandBlock-DnTIHX5l.js} +2 -2
- package/dist/client/assets/{ConnectAgentSurface-D9MYjA6g.js → ConnectAgentSurface-D-Z7Gl3G.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-BZ7eTlHc.js → DRLTVNUE-Bp-Mh_TD.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-DIWnFjlV.js → DYY6UVD2-Dwh9ZkXt.js} +2 -2
- package/dist/client/assets/{DevicePanel-CpWnw2HZ.js → DevicePanel-MMC7u5qJ.js} +2 -2
- package/dist/client/assets/{DeviceSetup-C02U1yvN.js → DeviceSetup-BCrBVLkf.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-CHYeyesq.js → DiffCommentAnnotation-D7iLWjnP.js} +2 -2
- package/dist/client/assets/{DiffFileTree-zq0G5Jq3.js → DiffFileTree-PCGZGqlB.js} +2 -2
- package/dist/client/assets/{DiffPanel-ghqOrQdi.js → DiffPanel-OOedo4tu.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-QbRiMHeR.js → DiffWorkerPoolProvider-CmorWW2H.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-ExUecHKZ.js → EmbeddedDesign-CeUGLwuZ.js} +4 -4
- package/dist/client/assets/{FNOVOB4O-Cch7VyQQ.js → FNOVOB4O-BJscBtWY.js} +2 -2
- package/dist/client/assets/{FileDiff-C1_8HZ7T.js → FileDiff-BMtpmo0v.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-DERxofVe.js → FilePreviewPanel-DUqI7pF3.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-okCu3zVD.js → FoldedSettingsSection-BTMENmDo.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-CJ_9BjZ0.js → HDGCDEEZ-BA3H_tu4.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-BvfNYUiJ.js → HSJLKHB7-BojHXJG0.js} +2 -2
- package/dist/client/assets/{IntervalSecondsField-S7jLIub2.js → IntervalSecondsField-Cpc7UePr.js} +2 -2
- package/dist/client/assets/JZOYTAAL-Bw2-11fa.js +1 -0
- package/dist/client/assets/{K3MD6TGW-C513S1_s.js → K3MD6TGW-hwfRTJ3N.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-zhgZmSWl.js → K7RP3OMA-4mJh9KrG.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-BmjYN5gQ.js → LHDIQX7Q-LIdvhN0m.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-B0Kwi43W.js → LUXOKEGN-B1aHy25-.js} +2 -2
- package/dist/client/assets/{LinkMachineSelect-GyKAeGYQ.js → LinkMachineSelect-CM7JZDuM.js} +2 -2
- package/dist/client/assets/{MathTypeset-DfU_zRMI.js → MathTypeset-CA2nw_Ej.js} +2 -2
- package/dist/client/assets/{ModelLiveLayer-DjtYQpVe.js → ModelLiveLayer-CPk6oSLz.js} +3 -3
- package/dist/client/assets/{N3JZAHOW-BXB2c-Us.js → N3JZAHOW-Dz6QAj1L.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-BkehuL9A.js → NUIALGQ3-W9kPoZrb.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-C-VNr8Ui.js → NoProjectsHero-DrTDAhjM.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-CPn-XJue.js → O65XPQGZ-CPx16bPB.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-DAQPVVnq.js → O7XIQ6OM-CAdGDrqF.js} +2 -2
- package/dist/client/assets/{OFQON5FD-BKoNBxEK.js → OFQON5FD-DOxYOpsO.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-C_7SfUQ2.js → P4ConnectAccountPages-D0qqCxCf.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-B6e-wkqI.js → P4ConnectSidebarSignIn-CtO1hqIS.js} +2 -2
- package/dist/client/assets/{PJQHF43J-Byb4NdRa.js → PJQHF43J-CEic-zJ0.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-BpjspxNc.js → PanelLayoutControls-CPevLAhG.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-h4qT502J.js → PierreEntryIcon-oOiSTYpG.js} +2 -2
- package/dist/client/assets/{PreviewPanel-lT6UT8SC.js → PreviewPanel-BSwObBjW.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-nqWOPUBM.js → ProjectDefaultsSettings-BkxL8Xjx.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-wwkvNTYJ.js → ProjectFavicon-DYcNXMDQ.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-CAEx0HQF.js → ProjectIconPickerDialog-CnlPMGQj.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Seln-0IQ.js → ProviderAuthTerminal-B1NeqFZE.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-p5oWTfTD.js → ProviderModelPicker-CLwSFV6Q.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-DP5cO9tc.js → ProviderSettingsForm-D9GJtzdb.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-BhWK4Zqq.js → PullRequestCodeTab-CajEWSe5.js} +2 -2
- package/dist/client/assets/{RHNBAITX-ZKmIoa8f.js → RHNBAITX-D5lTu0BB.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-C8hhN481.js → ReadOnlySourcePreview-LxG8Br9J.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-CYWiIuBa.js → RenderErrorBoundary-CcI-4Zo3.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-BW_1--rc.js → SLD4V6NK-CG_xQFi-.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-D6cHBUhW.js → ScheduledTasksSettings-CSygG_5X.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BzU8Hn6s.js → ScopedSwitch-LzARRHas.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection--Dcxxm73.js → SelfImproveSettingsSection-DjuOvf_q.js} +2 -2
- package/dist/client/assets/{SettingsPanels-C79826rW.js → SettingsPanels-Ci2h30Aw.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-DPfiTtgf.js → SettingsPanels.logic-BkjrmwrI.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-C9OAfACb.js → SettingsScopeNotice-96p-bg8p.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-syJ1VaYP.js → SidebarStageBackdrop-B8YG-M-e.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-Bc51hYDo.js → T3PCR2KE-DyNYo7Zy.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-mV-gJkJw.js → TKWO2OVW-5eCjJCfz.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-Bs_azRDw.js → TSHNXIZL-CjI9VTqp.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-DvlDdC-r.js → ThemeEditorPanel-BdfXdTV6.js} +2 -2
- package/dist/client/assets/{ThreadDetailsItemsMenu-DFAwPwtf.js → ThreadDetailsItemsMenu-Cgj2yuzU.js} +4 -4
- package/dist/client/assets/{ThreadTerminalDrawer-CBRpijGu.js → ThreadTerminalDrawer-DBG1eHBS.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-DL8IPyLr.js → UQJE5E4I-CY9HwTsw.js} +2 -2
- package/dist/client/assets/{USNYFO5S-CxX5m2eb.js → USNYFO5S-BW0HcjRg.js} +2 -2
- package/dist/client/assets/{Virtualizer-hL0IrPqB.js → Virtualizer-NI9bqlwX.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-CCg7BLOe.js → WEVWDWVA-BF8z-yRH.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-CoEhAoaG.js → X5RFHQXM-pdor6bX7.js} +2 -2
- package/dist/client/assets/{X62E3GBT-v3am3MF5.js → X62E3GBT-C6b2WsLT.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-CNH8QiJb.js → XBNEOJTC-BxqaKoJL.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-BAtBSLld.js → YHV2MVVZ-DO-ICZOV.js} +2 -2
- package/dist/client/assets/{YURCZMG2-B0qIfRPW.js → YURCZMG2-BxKVNupW.js} +2 -2
- package/dist/client/assets/{YVG2LODB-7yKJRNqu.js → YVG2LODB-BwiP1iS0.js} +2 -2
- package/dist/client/assets/{_chat-CPyEKO_k.js → _chat-DDScEBKF.js} +5 -5
- package/dist/client/assets/{_chat.design-BkPz6B_R.js → _chat.design-360SdjDb.js} +2 -2
- package/dist/client/assets/{_chat.index-DGRldHwy.js → _chat.index-DsRV2lh0.js} +2 -2
- package/dist/client/assets/{_chat.new-Be-FWv3w.js → _chat.new-B_AL_NJ2.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-Csb_f8e_.js → _chat.pull-requests-DlL4gjh7.js} +2 -2
- package/dist/client/assets/{assetUrls-CsEDCYyh.js → assetUrls-gAudvjhV.js} +2 -2
- package/dist/client/assets/{assets-CA-ZYmQr.js → assets-DaZ46ybf.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-BVGoot2u.js → browserHistoryStore-CIeLvEnV.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-zjhG9Lyg.js → browserLinkTarget-MQvtO-01.js} +2 -2
- package/dist/client/assets/{connect-BdyG6QZP.js → connect-DkCGs4oR.js} +2 -2
- package/dist/client/assets/connect-agent-C4n-OyN3.js +2 -0
- package/dist/client/assets/{design-9PZeJvkV.js → design-Djc1_eDF.js} +2 -2
- package/dist/client/assets/{device-B_zaE4OU.js → device-P8L_QiVD.js} +2 -2
- package/dist/client/assets/{diffRendering-aGA2PUMV.js → diffRendering-Cb9qJUqp.js} +2 -2
- package/dist/client/assets/{dist-DQanjDEK.js → dist-BocOAtMa.js} +2 -2
- package/dist/client/assets/{duoViewer-WUHHsw83.js → duoViewer-Domn2baW.js} +2 -2
- package/dist/client/assets/{dynamic-BrZIqKQ1.js → dynamic-CjS-lEY3.js} +2 -2
- package/dist/client/assets/{embeddedScripts-Bjon5VEq.js → embeddedScripts-AO2vzovy.js} +2 -2
- package/dist/client/assets/{entities-iVR9hStG.js → entities-s42SFcbu.js} +2 -2
- package/dist/client/assets/{fileLinks-ZsyrXe-F.js → fileLinks-BY6FjK66.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-CZA6X0sP.js → fileTreeExpansion-B--IBStv.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-C973oCCO.js → getDiffFileInput-B7pCnCeh.js} +2 -2
- package/dist/client/assets/{index-ColdECgE.js → index-C5VbGbq-.js} +3 -3
- package/dist/client/assets/{lazy-BWBxhQ9c.js → lazy-Bpm7QNt6.js} +4 -4
- package/dist/client/assets/{linkedPrompt-CN5vzMKu.js → linkedPrompt-DqEOywCR.js} +2 -2
- package/dist/client/assets/{main-xeaL6Ue7.js → main-BYwnnJ9E.js} +7 -7
- package/dist/client/assets/{mediaReference-D4xASAKr.js → mediaReference-CW0q8-nM.js} +2 -2
- package/dist/client/assets/{mediaSource-DJf0a3Hm.js → mediaSource-BgP2sq1w.js} +2 -2
- package/dist/client/assets/{modelScene-Dg2T9WKU.js → modelScene-OONljnCt.js} +2 -2
- package/dist/client/assets/{onboarding-7dyWHc7v.js → onboarding-DLaBhCVN.js} +2 -2
- package/dist/client/assets/{openFileInPreview-l71la8rp.js → openFileInPreview-Dpge7x7S.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-CC8L8IBq.js → p4ProjectFile-Fd0NSHmZ.js} +2 -2
- package/dist/client/assets/{pair-CjGF7d0N.js → pair-BUkFlR8l.js} +2 -2
- package/dist/client/assets/{phoneViewer-CpRP0Ylg.js → phoneViewer-BJj_96At.js} +2 -2
- package/dist/client/assets/{pierre-icons-CX8MNnZC.js → pierre-icons-BptmNFMW.js} +2 -2
- package/dist/client/assets/{preview-DX0t2QY_.js → preview-BBssbPEj.js} +2 -2
- package/dist/client/assets/{primary-BvBZk3BL.js → primary-TNEEuOuT.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-CHXPTqr2.js → primaryCloudLinkState-DbUZbjy4.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-D1KYNZXm.js → projectFilesQueryState-CVSEDHhW.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-Dy8U6TBl.js → projectScriptEditor-D2C0qPZA.js} +2 -2
- package/dist/client/assets/{providerSkills-CpjiWlTj.js → providerSkills-5OBbbZq-.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-CHJRE71s.js → pullRequestDetail.logic-D5hhGj8d.js} +2 -2
- package/dist/client/assets/{pullRequests-DjzqqdNY.js → pullRequests-R7416J6H.js} +2 -2
- package/dist/client/assets/{queries-D2fZuj-t.js → queries-Bp7Rbzrz.js} +2 -2
- package/dist/client/assets/{relay-aZlRxOWS.js → relay-V_5ApBIP.js} +2 -2
- package/dist/client/assets/{renderScheduler-BLaTctiX.js → renderScheduler-T1-hnpvd.js} +2 -2
- package/dist/client/assets/{runtime-D5AfNyNA.js → runtime-B92ivG9b.js} +3 -3
- package/dist/client/assets/{scheduledTasksSettings.logic-BjvsiCPJ.js → scheduledTasksSettings.logic-DOegPD4_.js} +2 -2
- package/dist/client/assets/{server-B2y_yoz_.js → server-GB5fRm03.js} +2 -2
- package/dist/client/assets/{session-Dt_Dt-Og.js → session-CFzb2gMH.js} +2 -2
- package/dist/client/assets/{session-logic-CPQJM-gL.js → session-logic-Cx9524Pd.js} +2 -2
- package/dist/client/assets/{settings-BIR_Igib.js → settings-DuV3USCX.js} +2 -2
- package/dist/client/assets/{settings.appearance-D0uNLG6m.js → settings.appearance-DtON2De5.js} +2 -2
- package/dist/client/assets/settings.archived-CxxKM6i3.js +2 -0
- package/dist/client/assets/{settings.computer-use-CNVg4Kl5.js → settings.computer-use-BuiCBgaZ.js} +2 -2
- package/dist/client/assets/{settings.connections-Bt5upKXR.js → settings.connections-CTuywqD3.js} +2 -2
- package/dist/client/assets/{settings.data-controls-Bu-fCPHf.js → settings.data-controls-BTvw7hwA.js} +2 -2
- package/dist/client/assets/{settings.decisions-B9lckxtw.js → settings.decisions-DjyXWkGE.js} +2 -2
- package/dist/client/assets/{settings.designs-CLLnQttY.js → settings.designs-B7y3Iz_g.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-Bl2X85nQ.js → settings.diagnostics-muot_u8V.js} +2 -2
- package/dist/client/assets/{settings.general-CJSdSR2k.js → settings.general-CejKrS3r.js} +2 -2
- package/dist/client/assets/{settings.integrations-DRpNV9D5.js → settings.integrations-3B64nKur.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BPtpYe84.js → settings.keybindings-DhvXS2QI.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-DYpshDh1.js → settings.open-source-licenses-nDTYUclU.js} +2 -2
- package/dist/client/assets/{settings.plugins-C9ZOoiar.js → settings.plugins-DJQxiL8Y.js} +2 -2
- package/dist/client/assets/{settings.projects-CMHQJUvG.js → settings.projects-Cf31zLX1.js} +3 -3
- package/dist/client/assets/{settings.providers-Bfr9fIiF.js → settings.providers-BenYwp5l.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-BEYOe2xs.js → settings.scheduled-tasks-B0BJtx2Y.js} +2 -2
- package/dist/client/assets/{settings.secrets-DIyDPOQx.js → settings.secrets-CugtPHky.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-DmjWtA3x.js → settings.snap-shot-9uuaPZ8d.js} +2 -2
- package/dist/client/assets/{settings.source-control-DvaOZ7kM.js → settings.source-control-DECPD9xY.js} +2 -2
- package/dist/client/assets/{settings.storage-B4XbjYVO.js → settings.storage-uPkJDu8D.js} +2 -2
- package/dist/client/assets/{settingsLayout-Ds1fJJk7.js → settingsLayout-BoWaVHvV.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-RQlsFe56.js → sidebarProjectGrouping-MU2UfzY1.js} +2 -2
- package/dist/client/assets/{sourceControl-BhvxhaEx.js → sourceControl-BU6NXFEv.js} +2 -2
- package/dist/client/assets/{sourceControlClients-Bs5R87fg.js → sourceControlClients-DBozOkI3.js} +2 -2
- package/dist/client/assets/{terminal-links-BohHFDfc.js → terminal-links-B5f_yaZ1.js} +2 -2
- package/dist/client/assets/{terminalSessions-Cnj30QDx.js → terminalSessions-Cg0AQjBU.js} +2 -2
- package/dist/client/assets/{uiStateStore-BZ4RuLIL.js → uiStateStore-u_PaGpa6.js} +2 -2
- package/dist/client/assets/{usage-GID8Ml88.js → usage-BzExgBit.js} +2 -2
- package/dist/client/assets/{use-atom-command-QDd_NqJQ.js → use-atom-command-Bd7vZxeH.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-ClgC6Lcw.js → useHandleNewThread-CA9pnWuC.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-DMl-0U53.js → useP4ConnectAuthPrompt-czmNhUqV.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-CJvtylIq.js → usePullRequestActions-BIPl_xE4.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-DGPFTMHL.js → useScopedModelAvailability-UuZvj6HE.js} +2 -2
- package/dist/client/assets/{useSettings-BJR7Rf97.js → useSettings-Dp9RSL-0.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-Bnup-5J0.js → vcsRefInvalidation-CoBKCEWS.js} +2 -2
- package/dist/client/assets/{welcome-CMuTnFAm.js → welcome-CJjj0VVp.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{preview-DcFC_OYY.mjs → preview-JlPVV2bV.mjs} +2 -2
- package/dist/{runtimeLayer-D4LpzNmS.mjs → runtimeLayer-B9K2BVKV.mjs} +4 -4
- package/dist/{runtimeLayer-B6H9jZgZ.mjs → runtimeLayer-ZFdf4c6R.mjs} +1 -1
- package/dist/{server-4nWc1d6L.mjs → server-BnHhGuOc.mjs} +4 -4
- package/package.json +1 -1
- package/dist/client/assets/JZOYTAAL-RUIcMwMn.js +0 -1
- package/dist/client/assets/connect-agent-BZgF1WVU.js +0 -2
- package/dist/client/assets/settings.archived-DHE_0aGh.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,Dl as a,Jo as o,au as s,l as c,mr as l,t as u}from"./utils-DkKLB01I.js";import{Ic as d,Sn as f,da as p,fa as m,ka as h,mh as g,wn as _}from"./src-R7EkrVcv.js";import{Dr as v,Sr as y}from"./runtime-D5AfNyNA.js";import{C as b,S as x,f as ee,k as te,q as S}from"./useSettings-BJR7Rf97.js";import{f as C}from"./server-B2y_yoz_.js";import{i as w,n as ne}from"./session-Dt_Dt-Og.js";import{n as re}from"./query-CeIgbVxh.js";import{t as T}from"./use-atom-command-QDd_NqJQ.js";import{n as E,t as D}from"./radio-group-C14CASyG.js";import{t as ie}from"./input-CiPGmOLv.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-5OaxRXCC.js";import{S as N}from"./Icons-DmQwwfAN.js";import{t as P}from"./preview-DnCP9Q0k.js";import{S as F,t as I}from"./ChatGptUsageButton-BQOZ260S.js";import{t as L}from"./RedactedSensitiveText-BMXImj30.js";import{a as oe}from"./settingsLayout-Ds1fJJk7.js";import{Ao as se,Do as R,Eo as ce,Ia as le,La as ue,To as de,ko as fe,wo as z}from"./main-xeaL6Ue7.js";var B=e(t(),1),V=n(),H=e(r(),1);function pe(e){let t=(0,V.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,H.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,H.jsxs)(l,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function me(e){let t=(0,V.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(ge),[s,c]=(0,B.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,H.jsxs)(O,{children:[(0,H.jsx)(k,{children:`Reconnect ChatGPT`}),(0,H.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(he),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,H.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,H.jsx)(D,{value:`chatgpt-change-account`}),(0,H.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,H.jsx)(`div`,{className:`px-6 pb-6`,children:(0,H.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,H.jsx)(A,{children:(0,H.jsx)(pe,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,H.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,H.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function he(e){return(0,H.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,H.jsx)(D,{value:e.id}),(0,H.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function ge(e){return e.id.startsWith(`chatgpt-profile:`)}function _e(e){let t=(0,V.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=w(n,h),u=ee(n),d;t[0]===n?d=t[1]:(d=C.providersValueAtom(n),t[0]=n,t[1]=d);let f=o(d),g=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,B.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,B.useState)(null),[S,re]=(0,B.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==f||t[12]!==i||t[13]!==u||t[14]!==g){let e=f?.find(e=>e.instanceId===x),o=F(e),s;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==u||t[31]!==g?(s=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=m.make(`codex_${c()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...u.providerInstances,[e]:{driver:p.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=u,t[31]=g,t[32]=s):s=t[32];let l=s;O=ae,M=!o,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&o&&r()},D=R,A=`wide`;let d=x?b:`Add ChatGPT account`;t[35]===d?j=t[36]:(j=(0,H.jsx)(de,{title:d,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=d,t[36]=j),E=ce,k=x?e?.setup?i(x,e):(0,H.jsx)(oe,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,H.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),l()},children:(0,H.jsx)(oe,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,H.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=f,t[12]=i,t[13]=u,t[14]=g,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let I;t[37]!==E||t[38]!==k?(I=(0,H.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=I):I=t[39];let L;t[40]!==s||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(L=(0,H.jsx)(z,{children:x?(0,H.jsx)(l,{variant:`outline`,onClick:r,children:`Finish later`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,H.jsx)(l,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!s,children:S?`Adding account…`:`Continue`})]})}),t[40]=s,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=L):L=t[45];let se;t[46]!==D||t[47]!==L||t[48]!==A||t[49]!==j||t[50]!==I?(se=(0,H.jsxs)(D,{size:A,children:[j,I,L]}),t[46]=D,t[47]=L,t[48]=A,t[49]=j,t[50]=I,t[51]=se):se=t[51];let le;return t[52]!==O||t[53]!==se||t[54]!==M||t[55]!==N||t[56]!==P?(le=(0,H.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:se}),t[52]=O,t[53]=se,t[54]=M,t[55]=N,t[56]=P,t[57]=le):le=t[57],le}var ve=d(f),ye=d(_),be=/^[A-Za-z0-9_./:\\-]+$/;function xe(e,t,n){return be.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Se(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var U={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function Ce(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||U[Se(n)]>U[Se(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ve(r?.config??{});return`${xe(g(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=ye(r?.config??{});return`${xe(g(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,V.c)(11),[n,r]=(0,B.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Se(e.provider),t[0]=e.provider,t[1]=i);let o=i,s=e.enabled&&o===`ready`,c=e.provider?.auth.status===`authenticated`,u=o===`checking`,d;t[2]===e.provider?d=t[3]:(d=W(e.provider),t[2]=e.provider,t[3]=d);let f=d,p;return t[4]!==c||t[5]!==u||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,H.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:u?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,H.jsx)(a,{className:`size-3.5`}),`Ready`]}):u?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,H.jsx)(pe,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!u?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,H.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,H.jsx)(Fe,{}),control:(0,H.jsx)(l,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,H.jsx)(oe,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,H.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=u,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,V.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,h),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,H.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,H.jsx)(_e,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:o,autoStart:c,onAutoStartConsumed:d,allowExistingCli:f=!0,presentation:p,displayName:m,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(g)),ee=re(C.providerInstallState(g)),[w,ne]=(0,B.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,B.useState)(!1),[A,j]=(0,B.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,R=ee.data,ce=b(e),de=ce!==null&&P(new URL(ce).hostname),z={reportFailure:!1,reportDefect:!1},V=T(C.startProviderAuth,z),he=T(C.refreshProviders,z),ge=T(C.completeProviderAuth,z),_e=T(C.cancelProviderAuth,z),ve=T(C.logoutProviderAuth,z),ye=T(C.startProviderInstall,z),be=T(C.cancelProviderInstall,z),xe=T(C.chatGptReconnectProfile,z),Se=T(C.chatGptImportProfile,z),U=!w&&(!de||window.desktopBridge?.receiveProviderAuthCallback!==void 0),Ce=U&&!window.desktopBridge?.receiveProviderAuthCallback,we=te(),Te=x(we),Ee=b(we),De=!de&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=Ce,ke=(0,B.useId)(),[Ae,je]=(0,B.useState)(!1),[Me,Ne]=(0,B.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,B.useState)(!1),[Re,ze]=(0,B.useState)(null),Be=(0,B.useRef)(!1),[Ve,He]=(0,B.useState)(null),K=(0,B.useRef)(null),Ue=(0,B.useRef)(!1),We=(0,B.useRef)(null),[Ge,Ke]=(0,B.useState)(!1),q=R?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&R?.source!==`local`&&R?.version!=null&&R.version!==R.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,B.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,B.useEffect)(()=>{Re&&D?.phase===`succeeded`&&he({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,he,e,t]);let Ye=c&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=R?.phase===`downloading`||R?.phase===`extracting`||R?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,B.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!y(r)){let e=v(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,B.useId)(),$e=(0,B.useRef)(0),et=(0,B.useRef)(null),[tt,nt]=(0,B.useState)(!1),rt=(0,B.useCallback)(async n=>{let r=await $(()=>Se({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Se,e,t]);(0,B.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,B.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,B.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>_e({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,_e,e,t,D]),at=(0,B.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>xe({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>V({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:U?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,V,U,De,xe,Qe]),ot=(0,B.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>ye({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,ye,e,t]);(0,B.useEffect)(()=>{!c||Ge||Z||Q||R===null||!n?.setup?.canInstall||(Ke(!0),d(),ot())},[c,Ge,Z,Q,R,n?.setup?.canInstall,d,ot]),(0,B.useEffect)(()=>{if(!(!K.current||G||Y)){if(R?.phase===`failed`||R?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,R?.phase,q,at]);let st=(0,B.useRef)(null),ct=D?.flowId,lt=(0,B.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&U&&ct){if(st.current===n){await S().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>ge({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await S().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[U,ct,$,ge,e,t]);(0,B.useEffect)(()=>{if(U&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[U,F]),(0,B.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,Ce||lt(F))},[D?.phase,D?.flowId,F,lt,Ce]);let ut=R?.phase===`downloading`?`Downloading ${(R.downloadedBytes/1e6).toFixed(1)}${R.totalBytes===null?``:` of ${(R.totalBytes/1e6).toFixed(1)}`} MB.`:R?.phase===`extracting`?`Installing Codex.`:R?.phase===`verifying`?`Checking Codex.`:q?`${R?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${R?.installedVersion?` · v${R.installedVersion}`:``}.`:R?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&ue(W.toString())?le({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,H.jsx)(l,{size:`sm`,variant:Ce?`default`:`outline`,className:p===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&<(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?Ce?`Open ChatGPT sign-in`:`Open sign-in page`:p===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,H.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>ge({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,H.jsx)(l,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),Ce?null:(0,H.jsx)(`div`,{children:(0,H.jsxs)(l,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,H.jsx)(s,{className:`size-3.5`})]})}),ft?(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,H.jsx)(l,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,H.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,H.jsx)(fe,{open:Ae,children:(0,H.jsx)(se,{children:(0,H.jsx)(`div`,{id:ke,className:u(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,H.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,H.jsx)(me,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(p===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:R?.phase===`failed`?R.message:null);return(0,H.jsxs)(H.Fragment,{children:[_t,(0,H.jsxs)(Ie,{title:m||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,H.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,H.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,H.jsx)(a,{className:`size-3.5`}),`Ready`]}):X?pt:(0,H.jsx)(pe,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():R?.operationId&&$(()=>be({environmentId:e,input:{instanceId:t,operationId:R.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&f?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,H.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,H.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,H.jsx)(oe,{title:`ChatGPT account`,description:dt,control:(0,H.jsx)(`div`,{className:`flex max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,H.jsxs)(H.Fragment,{children:[pt,!Je&&(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{R?.operationId&&(K.current=null,$(()=>be({environmentId:e,input:{instanceId:t,operationId:R.operationId}})))},children:`Cancel`}):J?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ve(g)),children:`Disconnect`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pe,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,f?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null]})})}),J?(0,H.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,H.jsx)(I,{})}):null,vt?(0,H.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,H.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||R?.phase===`failed`?(0,H.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(R?.phase===`failed`?R.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,V.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,H.jsx)(oe,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,H.jsx)(oe,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,H.jsx)(oe,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,H.jsxs)(H.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,V.c)(10),{label:n,expanded:r,controls:a,onToggle:o}=e,s=n===void 0?`Complete sign-in in your browser.`:n,c=r!==void 0&&r;if(!o){let e;return t[0]===s?e=t[1]:(e=(0,H.jsx)(`div`,{className:`leading-relaxed`,children:s}),t[0]=s,t[1]=e),e}let l=`size-3 shrink-0 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,H.jsx)(i,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==o||t[8]!==u?(d=(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":c,"aria-controls":a,onClick:o,children:[s,u]}),t[4]=a,t[5]=c,t[6]=s,t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Ie(e){let t=(0,V.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=B.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,H.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,H.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,H.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,H.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,Ce as f,Me as i,Se as l,Ne as n,W as o,pe as p,G as r,Ae as s,Le as t,Te as u};
|
|
2
|
-
//# sourceMappingURL=CodexSetupSection.logic-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,Dl as a,Jo as o,au as s,l as c,mr as l,t as u}from"./utils-DkKLB01I.js";import{Ic as d,Sn as f,da as p,fa as m,ka as h,mh as g,wn as _}from"./src-R7EkrVcv.js";import{Dr as v,Sr as y}from"./runtime-B92ivG9b.js";import{C as b,S as x,f as ee,k as te,q as S}from"./useSettings-Dp9RSL-0.js";import{f as C}from"./server-GB5fRm03.js";import{i as w,n as ne}from"./session-CFzb2gMH.js";import{n as re}from"./query-CeIgbVxh.js";import{t as T}from"./use-atom-command-Bd7vZxeH.js";import{n as E,t as D}from"./radio-group-C14CASyG.js";import{t as ie}from"./input-CiPGmOLv.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-5OaxRXCC.js";import{S as N}from"./Icons-DmQwwfAN.js";import{t as P}from"./preview-DnCP9Q0k.js";import{S as F,t as I}from"./ChatGptUsageButton-DT3CRIhB.js";import{t as L}from"./RedactedSensitiveText-BMXImj30.js";import{a as oe}from"./settingsLayout-BoWaVHvV.js";import{Ao as se,Do as R,Eo as ce,Ia as le,La as ue,To as de,ko as fe,wo as z}from"./main-BYwnnJ9E.js";var B=e(t(),1),V=n(),H=e(r(),1);function pe(e){let t=(0,V.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,H.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,H.jsxs)(l,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function me(e){let t=(0,V.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(ge),[s,c]=(0,B.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,H.jsxs)(O,{children:[(0,H.jsx)(k,{children:`Reconnect ChatGPT`}),(0,H.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(he),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,H.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,H.jsx)(D,{value:`chatgpt-change-account`}),(0,H.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,H.jsx)(`div`,{className:`px-6 pb-6`,children:(0,H.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,H.jsx)(A,{children:(0,H.jsx)(pe,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,H.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,H.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function he(e){return(0,H.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,H.jsx)(D,{value:e.id}),(0,H.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function ge(e){return e.id.startsWith(`chatgpt-profile:`)}function _e(e){let t=(0,V.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=w(n,h),u=ee(n),d;t[0]===n?d=t[1]:(d=C.providersValueAtom(n),t[0]=n,t[1]=d);let f=o(d),g=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,B.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,B.useState)(null),[S,re]=(0,B.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==f||t[12]!==i||t[13]!==u||t[14]!==g){let e=f?.find(e=>e.instanceId===x),o=F(e),s;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==u||t[31]!==g?(s=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=m.make(`codex_${c()}`);(await g({environmentId:n,input:{patch:{providerInstances:{...u.providerInstances,[e]:{driver:p.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=u,t[31]=g,t[32]=s):s=t[32];let l=s;O=ae,M=!o,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&o&&r()},D=R,A=`wide`;let d=x?b:`Add ChatGPT account`;t[35]===d?j=t[36]:(j=(0,H.jsx)(de,{title:d,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=d,t[36]=j),E=ce,k=x?e?.setup?i(x,e):(0,H.jsx)(oe,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,H.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),l()},children:(0,H.jsx)(oe,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,H.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=f,t[12]=i,t[13]=u,t[14]=g,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let I;t[37]!==E||t[38]!==k?(I=(0,H.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=I):I=t[39];let L;t[40]!==s||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(L=(0,H.jsx)(z,{children:x?(0,H.jsx)(l,{variant:`outline`,onClick:r,children:`Finish later`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,H.jsx)(l,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!s,children:S?`Adding account…`:`Continue`})]})}),t[40]=s,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=L):L=t[45];let se;t[46]!==D||t[47]!==L||t[48]!==A||t[49]!==j||t[50]!==I?(se=(0,H.jsxs)(D,{size:A,children:[j,I,L]}),t[46]=D,t[47]=L,t[48]=A,t[49]=j,t[50]=I,t[51]=se):se=t[51];let le;return t[52]!==O||t[53]!==se||t[54]!==M||t[55]!==N||t[56]!==P?(le=(0,H.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:se}),t[52]=O,t[53]=se,t[54]=M,t[55]=N,t[56]=P,t[57]=le):le=t[57],le}var ve=d(f),ye=d(_),be=/^[A-Za-z0-9_./:\\-]+$/;function xe(e,t,n){return be.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Se(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var U={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function Ce(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||U[Se(n)]>U[Se(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ve(r?.config??{});return`${xe(g(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=ye(r?.config??{});return`${xe(g(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,V.c)(11),[n,r]=(0,B.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Se(e.provider),t[0]=e.provider,t[1]=i);let o=i,s=e.enabled&&o===`ready`,c=e.provider?.auth.status===`authenticated`,u=o===`checking`,d;t[2]===e.provider?d=t[3]:(d=W(e.provider),t[2]=e.provider,t[3]=d);let f=d,p;return t[4]!==c||t[5]!==u||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,H.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:u?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,H.jsx)(a,{className:`size-3.5`}),`Ready`]}):u?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,H.jsx)(pe,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!u?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,H.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,H.jsx)(Fe,{}),control:(0,H.jsx)(l,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,H.jsx)(oe,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,H.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=u,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,V.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,h),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,H.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,H.jsx)(_e,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:o,autoStart:c,onAutoStartConsumed:d,allowExistingCli:f=!0,presentation:p,displayName:m,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(g)),ee=re(C.providerInstallState(g)),[w,ne]=(0,B.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,B.useState)(!1),[A,j]=(0,B.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,R=ee.data,ce=b(e),de=ce!==null&&P(new URL(ce).hostname),z={reportFailure:!1,reportDefect:!1},V=T(C.startProviderAuth,z),he=T(C.refreshProviders,z),ge=T(C.completeProviderAuth,z),_e=T(C.cancelProviderAuth,z),ve=T(C.logoutProviderAuth,z),ye=T(C.startProviderInstall,z),be=T(C.cancelProviderInstall,z),xe=T(C.chatGptReconnectProfile,z),Se=T(C.chatGptImportProfile,z),U=!w&&(!de||window.desktopBridge?.receiveProviderAuthCallback!==void 0),Ce=U&&!window.desktopBridge?.receiveProviderAuthCallback,we=te(),Te=x(we),Ee=b(we),De=!de&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=Ce,ke=(0,B.useId)(),[Ae,je]=(0,B.useState)(!1),[Me,Ne]=(0,B.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,B.useState)(!1),[Re,ze]=(0,B.useState)(null),Be=(0,B.useRef)(!1),[Ve,He]=(0,B.useState)(null),K=(0,B.useRef)(null),Ue=(0,B.useRef)(!1),We=(0,B.useRef)(null),[Ge,Ke]=(0,B.useState)(!1),q=R?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&R?.source!==`local`&&R?.version!=null&&R.version!==R.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,B.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,B.useEffect)(()=>{Re&&D?.phase===`succeeded`&&he({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,he,e,t]);let Ye=c&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=R?.phase===`downloading`||R?.phase===`extracting`||R?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,B.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!y(r)){let e=v(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,B.useId)(),$e=(0,B.useRef)(0),et=(0,B.useRef)(null),[tt,nt]=(0,B.useState)(!1),rt=(0,B.useCallback)(async n=>{let r=await $(()=>Se({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Se,e,t]);(0,B.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,B.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,B.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>_e({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,_e,e,t,D]),at=(0,B.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>xe({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>V({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:U?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,V,U,De,xe,Qe]),ot=(0,B.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>ye({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,ye,e,t]);(0,B.useEffect)(()=>{!c||Ge||Z||Q||R===null||!n?.setup?.canInstall||(Ke(!0),d(),ot())},[c,Ge,Z,Q,R,n?.setup?.canInstall,d,ot]),(0,B.useEffect)(()=>{if(!(!K.current||G||Y)){if(R?.phase===`failed`||R?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,R?.phase,q,at]);let st=(0,B.useRef)(null),ct=D?.flowId,lt=(0,B.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&U&&ct){if(st.current===n){await S().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>ge({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await S().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[U,ct,$,ge,e,t]);(0,B.useEffect)(()=>{if(U&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[U,F]),(0,B.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,Ce||lt(F))},[D?.phase,D?.flowId,F,lt,Ce]);let ut=R?.phase===`downloading`?`Downloading ${(R.downloadedBytes/1e6).toFixed(1)}${R.totalBytes===null?``:` of ${(R.totalBytes/1e6).toFixed(1)}`} MB.`:R?.phase===`extracting`?`Installing Codex.`:R?.phase===`verifying`?`Checking Codex.`:q?`${R?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${R?.installedVersion?` · v${R.installedVersion}`:``}.`:R?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&ue(W.toString())?le({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,H.jsx)(l,{size:`sm`,variant:Ce?`default`:`outline`,className:p===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&<(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?Ce?`Open ChatGPT sign-in`:`Open sign-in page`:p===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,H.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>ge({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,H.jsx)(l,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),Ce?null:(0,H.jsx)(`div`,{children:(0,H.jsxs)(l,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,H.jsx)(s,{className:`size-3.5`})]})}),ft?(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,H.jsx)(l,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,H.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,H.jsx)(fe,{open:Ae,children:(0,H.jsx)(se,{children:(0,H.jsx)(`div`,{id:ke,className:u(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,H.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,H.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,H.jsx)(me,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(p===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:R?.phase===`failed`?R.message:null);return(0,H.jsxs)(H.Fragment,{children:[_t,(0,H.jsxs)(Ie,{title:m||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,H.jsxs)(H.Fragment,{children:[`Signed in as`,` `,(0,H.jsx)(L,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,H.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,H.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,H.jsx)(a,{className:`size-3.5`}),`Ready`]}):X?pt:(0,H.jsx)(pe,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():R?.operationId&&$(()=>be({environmentId:e,input:{instanceId:t,operationId:R.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&f?(0,H.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,H.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,H.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,H.jsx)(oe,{title:`ChatGPT account`,description:dt,control:(0,H.jsx)(`div`,{className:`flex max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,H.jsxs)(H.Fragment,{children:[pt,!Je&&(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{R?.operationId&&(K.current=null,$(()=>be({environmentId:e,input:{instanceId:t,operationId:R.operationId}})))},children:`Cancel`}):J?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(l,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ve(g)),children:`Disconnect`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(pe,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,f?(0,H.jsx)(l,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null]})})}),J?(0,H.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,H.jsx)(I,{})}):null,vt?(0,H.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,H.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||R?.phase===`failed`?(0,H.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(R?.phase===`failed`?R.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,V.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,H.jsx)(oe,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,H.jsx)(oe,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,H.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,H.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,H.jsx)(oe,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,H.jsxs)(H.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,V.c)(10),{label:n,expanded:r,controls:a,onToggle:o}=e,s=n===void 0?`Complete sign-in in your browser.`:n,c=r!==void 0&&r;if(!o){let e;return t[0]===s?e=t[1]:(e=(0,H.jsx)(`div`,{className:`leading-relaxed`,children:s}),t[0]=s,t[1]=e),e}let l=`size-3 shrink-0 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,H.jsx)(i,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==o||t[8]!==u?(d=(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":c,"aria-controls":a,onClick:o,children:[s,u]}),t[4]=a,t[5]=c,t[6]=s,t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Ie(e){let t=(0,V.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=B.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,H.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,H.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,H.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,H.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,Ce as f,Me as i,Se as l,Ne as n,W as o,pe as p,G as r,Ae as s,Le as t,Te as u};
|
|
2
|
+
//# sourceMappingURL=CodexSetupSection.logic-CqdvWoE6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{mr as r,t as i}from"./utils-DkKLB01I.js";import{C as a,f as o,u as s}from"./TooltipProvider-DiV5KdTq.js";import{m as c}from"./relay-
|
|
2
|
-
//# sourceMappingURL=CommandBlock-
|
|
1
|
+
import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{mr as r,t as i}from"./utils-DkKLB01I.js";import{C as a,f as o,u as s}from"./TooltipProvider-DiV5KdTq.js";import{m as c}from"./relay-V_5ApBIP.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=c(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?o:a,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(s,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
|
|
2
|
+
//# sourceMappingURL=CommandBlock-DnTIHX5l.js.map
|
package/dist/client/assets/{ConnectAgentSurface-D9MYjA6g.js → ConnectAgentSurface-D-Z7Gl3G.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{mr as i,ou as a,t as o}from"./utils-DkKLB01I.js";import{Ta as s,Uc as c,Wd as l,gu as u,ju as d,nd as f,wa as p}from"./src-R7EkrVcv.js";import{B as m,nt as h}from"./runtime-
|
|
2
|
-
//# sourceMappingURL=ConnectAgentSurface-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{mr as i,ou as a,t as o}from"./utils-DkKLB01I.js";import{Ta as s,Uc as c,Wd as l,gu as u,ju as d,nd as f,wa as p}from"./src-R7EkrVcv.js";import{B as m,nt as h}from"./runtime-B92ivG9b.js";import{t as g}from"./spinner-C-qDE4WQ.js";import{i as _,n as ee}from"./radio-group-C14CASyG.js";import{t as te}from"./input-CiPGmOLv.js";import{t as v}from"./preview-DnCP9Q0k.js";import{r as ne,t as re}from"./alert-D6WJ0q4-.js";import{t as y}from"./runtimeModeConfig-DymGoV55.js";import{t as b}from"./AuthSurfaceShell-Dfcdz_aG.js";var x=n(),S=e(t(),1),C=e(r(),1),w={"read-only":{label:`Read only`,description:`Read projects and threads. Cannot start, message or change anything.`,icon:a},...y};function ie(e){return v(new URL(`http://${e}`).hostname)}var T=`Could not reach this environment. Try again.`,E=c(p);function ae(e){return m(h.pipe(d(e),f(e=>typeof e==`object`&&e&&`redirectTo`in e?{kind:`redirect`,url:e.redirectTo}:{kind:`ok`,value:e}),u(e=>l({kind:`error`,message:E(e)?e.message:T})))).catch(()=>({kind:`error`,message:T}))}function oe(){return Object.fromEntries(new URL(window.location.href).searchParams)}function D(e,t){return e.csrfToken!==void 0&&(e.oneClickAccess??[]).includes(t)}function O(){let e=(0,x.c)(71),[t]=(0,S.useState)(oe),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`loading`},e[0]=n):n=e[0];let[r,a]=(0,S.useState)(n),[o,c]=(0,S.useState)(`read-only`),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(null),h,_;e[1]===t?(h=e[2],_=e[3]):(h=()=>{let e=!1;return ae(e=>e.mcpOAuth.approval({payload:t})).then(t=>{e||(t.kind===`redirect`?window.location.replace(t.url):a(t.kind===`error`?{status:`invalid`,message:t.message}:{status:`ready`,details:t.value}))}),()=>{e=!0}},_=[t],e[1]=t,e[2]=h,e[3]=_),(0,S.useEffect)(h,_);let v;e[4]!==o||e[5]!==t||e[6]!==r.details||e[7]!==r.status||e[8]!==l?(v=async e=>{if(r.status!==`ready`)return;m(e),f(``);let{csrfToken:n}=r.details,i=e===`deny`?{_tag:`deny`}:n!==void 0&&D(r.details,o)?{_tag:`browser-session`,access:o,csrfToken:n}:{_tag:`pairing-code`,access:o,code:l.trim()},a=await ae(e=>e.mcpOAuth.decision({payload:{authorization:t,decision:i}}));a.kind===`redirect`?window.location.replace(a.url):(m(null),f(a.kind===`error`?a.message:`The sign-in could not continue.`))},e[4]=o,e[5]=t,e[6]=r.details,e[7]=r.status,e[8]=l,e[9]=v):v=e[9];let y=v;if(r.status===`loading`){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(b,{children:[(0,C.jsx)(k,{title:`Checking the sign-in request`,description:`One moment while this environment verifies the agent's request.`}),(0,C.jsx)(g,{className:`mt-6`,size:`lg`,tone:`muted`})]}),e[10]=t):t=e[10],t}if(r.status===`invalid`){let t;e[11]===r.message?t=e[12]:(t=(0,C.jsx)(k,{title:`This sign-in cannot continue`,description:r.message}),e[11]=r.message,e[12]=t);let n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,C.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Close this page and start the sign-in again from your agent.`}),e[13]=n):n=e[13];let i;return e[14]===t?i=e[15]:(i=(0,C.jsxs)(b,{children:[t,n]}),e[14]=t,e[15]=i),i}let{details:w}=r,T;e[16]!==o||e[17]!==w?(T=D(w,o),e[16]=o,e[17]=w,e[18]=T):T=e[18];let E=T,O;e[19]!==E||e[20]!==l||e[21]!==p?(O=p===null&&(E||l.trim().length>0),e[19]=E,e[20]=l,e[21]=p,e[22]=O):O=e[22];let A=O,j=`Connect ${w.clientName}`,M;e[23]===w.environmentHost?M=e[24]:(M=(0,C.jsxs)(C.Fragment,{children:[`This agent wants to use the threads in every project on`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.environmentHost}),`.`]}),e[23]=w.environmentHost,e[24]=M);let N;e[25]!==j||e[26]!==M?(N=(0,C.jsx)(k,{title:j,description:M}),e[25]=j,e[26]=M,e[27]=N):N=e[27];let P;e[28]===w.redirectHost?P=e[29]:(P=(0,C.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ie(w.redirectHost)?(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval returns to `,w.redirectHost,` on the computer that opened this page. Only approve a sign-in you just started.`]}):(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval gives access to whoever runs`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.redirectHost}),`. Only approve a sign-in you just started there.`]})}),e[28]=w.redirectHost,e[29]=P);let F;e[30]!==A||e[31]!==y?(F=e=>{e.preventDefault(),A&&y(`approve`)},e[30]=A,e[31]=y,e[32]=F):F=e[32];let I;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,C.jsx)(`span`,{id:`connect-agent-access-label`,className:`text-sm font-medium`,children:`What it may do`}),e[33]=I):I=e[33];let L;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>c(e),e[34]=L):L=e[34];let R;e[35]===o?R=e[36]:(R=s.literals.map(e=>(0,C.jsx)(se,{access:e,selected:e===o},e)),e[35]=o,e[36]=R);let z;e[37]!==o||e[38]!==R?(z=(0,C.jsx)(ee,{"aria-labelledby":`connect-agent-access-label`,value:o,onValueChange:L,children:R}),e[37]=o,e[38]=R,e[39]=z):z=e[39];let B;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Beyond read only, it can start, message and stop threads, and none of them can run with more than the mode you pick.`}),e[40]=B):B=e[40];let V;e[41]===z?V=e[42]:(V=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[I,z,B]}),e[41]=z,e[42]=V);let H;e[43]!==E||e[44]!==l||e[45]!==p?(H=E?null:(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`connect-agent-pairing-code`,children:`Pairing code`}),(0,C.jsx)(te,{id:`connect-agent-pairing-code`,autoCapitalize:`none`,autoComplete:`one-time-code`,autoCorrect:`off`,disabled:p!==null,nativeInput:!0,onChange:e=>u(e.currentTarget.value),placeholder:`Paste a one-time pairing code`,spellCheck:!1,value:l}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Create one in Settings → Connections, or run `,(0,C.jsx)(`code`,{children:`p4c auth pairing create`}),` on this machine.`]})]}),e[43]=E,e[44]=l,e[45]=p,e[46]=H):H=e[46];let U;e[47]===d?U=e[48]:(U=d?(0,C.jsx)(re,{variant:`error`,children:(0,C.jsx)(ne,{children:d})}):null,e[47]=d,e[48]=U);let W=!A,G=p===`approve`?`Approving…`:`Approve`,K;e[49]!==W||e[50]!==G?(K=(0,C.jsx)(i,{disabled:W,type:`submit`,children:G}),e[49]=W,e[50]=G,e[51]=K):K=e[51];let q=p!==null,J;e[52]===y?J=e[53]:(J=()=>void y(`deny`),e[52]=y,e[53]=J);let Y=p===`deny`?`Denying…`:`Deny`,X;e[54]!==q||e[55]!==J||e[56]!==Y?(X=(0,C.jsx)(i,{disabled:q,onClick:J,type:`button`,variant:`outline`,children:Y}),e[54]=q,e[55]=J,e[56]=Y,e[57]=X):X=e[57];let Z;e[58]!==K||e[59]!==X?(Z=(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[K,X]}),e[58]=K,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==F||e[62]!==V||e[63]!==H||e[64]!==U||e[65]!==Z?(Q=(0,C.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:F,children:[V,H,U,Z]}),e[61]=F,e[62]=V,e[63]=H,e[64]=U,e[65]=Z,e[66]=Q):Q=e[66];let $;return e[67]!==Q||e[68]!==N||e[69]!==P?($=(0,C.jsxs)(b,{children:[N,P,Q]}),e[67]=Q,e[68]=N,e[69]=P,e[70]=$):$=e[70],$}function k(e){let t=(0,x.c)(8),{title:n,description:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,C.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:`Agent sign-in`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,C.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:n}),t[1]=n,t[2]=a);let o;t[3]===r?o=t[4]:(o=(0,C.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,C.jsxs)(C.Fragment,{children:[i,a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function se(e){let t=(0,x.c)(19),{access:n,selected:r}=e,{label:i,description:a,icon:s}=w[n],c=r?`border-primary bg-background ring-2 ring-inset ring-primary/25 dark:border-transparent dark:bg-primary/10 dark:ring-1 dark:ring-primary/30`:`border-border bg-background hover:bg-muted/50 dark:border-transparent dark:bg-white/[0.035] dark:hover:bg-accent`,l;t[0]===c?l=t[1]:(l=o(`flex cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,c),t[0]=c,t[1]=l);let u=r?`text-primary`:`text-muted-foreground`,d;t[2]===u?d=t[3]:(d=o(`mt-0.5 size-4 shrink-0`,u),t[2]=u,t[3]=d);let f;t[4]!==s||t[5]!==d?(f=(0,C.jsx)(s,{"aria-hidden":!0,className:d}),t[4]=s,t[5]=d,t[6]=f):f=t[6];let p;t[7]===i?p=t[8]:(p=(0,C.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:i}),t[7]=i,t[8]=p);let m;t[9]===a?m=t[10]:(m=(0,C.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a}),t[9]=a,t[10]=m);let h;t[11]!==p||t[12]!==m?(h=(0,C.jsxs)(`span`,{className:`min-w-0`,children:[p,m]}),t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==n||t[15]!==l||t[16]!==f||t[17]!==h?(g=(0,C.jsxs)(_,{value:n,className:l,children:[f,h]}),t[14]=n,t[15]=l,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}export{w as n,O as t};
|
|
2
|
+
//# sourceMappingURL=ConnectAgentSurface-D-Z7Gl3G.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-
|
|
1
|
+
import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-CwQRt55E.js";import{f as l,g as u,m as d,r as f,s as p,t as m,u as ee,y as h}from"./77XECAW3-DM5Itfvk.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-Bpm7QNt6.js";function v(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function y(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&v(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var b=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,x={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},S={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},C={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:y};function w(e,t){return{name:e,pattern:e,longer:t}}function T(e,t){return{...i(e),longer:[t]}}function E(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:b+`_`}}function D(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function O(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
|
|
2
2
|
`},{...s,name:e+`_YAML`,first:`-`},{...o,name:e+`_DIRECTIVE`,first:` %`},{...c,name:e+`_SINGLE_LINE_COMMENT`,first:` %`}]}function k(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=e.length-1,n=``;for(let r=1;r<t;r++){let i=e[r];i===`\\`&&r+1<t?(i=e[++r],n+=i===`n`?`
|
|
3
3
|
`:i===`r`?`\r`:i===`t`?` `:i):n+=i}return n}function A(i,o,s,c,l,u){let d=new r(a(i,o,`railroad`),o,`railroad`),f={$type:s,rules:[]};for(d.expect(0);;){let r=d.kind;if(r===c){let e=t(d.take()),n=e[0];f.title=(n===`"`||n===`'`)&&e.endsWith(n)?l(e):e}else if(r===c+1)f.accTitle=n(d.take());else if(r===c+2)f.accDescr=e(d.take());else break}for(;d.kind!==-1;)f.rules.push(u(d));return f}var ie=[];function j(e){let t=e,n=t.element??t.primary??t.suffix,r=t.alternatives??t.elements??(n?[n]:ie);if(t.base){r=[t.base];for(let e of t.postfixes)e.except&&r.push(e.except)}return r}var M=e=>({type:`terminal`,value:e}),N=e=>({type:`nonterminal`,name:e}),P=e=>({type:`special`,text:e}),F=e=>({type:`optional`,element:e}),I=(e,t,n=1/0)=>({type:`repetition`,element:e,min:t,max:n});function L(e){return e.length===1?e[0]:{type:`sequence`,elements:e}}function R(e){return e.length===1?e[0]:{type:`choice`,alternatives:e}}function z(e,t){return e.rules.map(e=>({name:e.name,definition:B(e.definition,j,t)}))}function B(e,t,n){let r=[e],i=[t(e)],a=[[]];for(;;){let e=r.length-1,o=a[e];if(o.length<i[e].length){let n=i[e][o.length];r.push(n),i.push(t(n)),a.push([])}else{let t=n(r[e],o);if(e===0)return t;r.pop(),i.pop(),a.pop(),a[e-1].push(t)}}}var V=`0123456789`,H={name:`ABNF_RULENAME`,pattern:/[A-Za-z][A-Za-z0-9-]*/y,first:b},U={name:`ABNF_COMMENT`,pattern:/;[^\n\r]*/y,hidden:!0,first:`;`},W=[T(`railroad-abnf-beta`,H),w(`=`),w(`;`,[U]),w(`/`),w(`(`),w(`)`),w(`[`),w(`]`),x,S,C,H,{name:`ABNF_STRING`,pattern:/"[^"]*"/y,first:`"`},{name:`ABNF_NUMVAL`,pattern:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/y,first:`%`},{name:`ABNF_REPEAT`,pattern:/[0-9]*\*[0-9]*/y,first:V+`*`},{name:`ABNF_EXACT_REPEAT`,pattern:/[0-9]+/y,first:V},...O(`ABNF`),U];function G(e,t,n,r){let i={$type:`AbnfConcatenation`,elements:[]};return t.alternatives.push(i),{alternation:t,concatenation:i,node:e,close:n,repeat:r}}function ae(e){let t=[],n=G(void 0,{$type:`AbnfAlternation`,alternatives:[]},-2,void 0);for(;;){let r=e.kind===14||e.kind===15?e.take():void 0,i,a=e.kind;switch(a){case 12:i={$type:`AbnfStringLiteral`,value:e.take().slice(1,-1)};break;case 13:i={$type:`AbnfNumVal`,value:e.take()};break;case 11:i={$type:`AbnfRuleName`,name:e.take()};break;case 4:case 6:{e.i++;let i={$type:`AbnfAlternation`,alternatives:[]};t.push(n),n=G({$type:a===4?`AbnfGroup`:`AbnfOptionalGroup`,element:i},i,a+1,r);continue}default:e.fail(`a string, a number, a name, or an opening bracket`)}for(;;){n.concatenation.elements.push(r===void 0?{$type:`AbnfElement`,primary:i}:{$type:`AbnfElement`,repeat:r,primary:i});let a=e.kind;if(a===n.close)e.i++,i=n.node,r=n.repeat,n=t.pop();else{if(a===3)e.i++,n.concatenation={$type:`AbnfConcatenation`,elements:[]},n.alternation.alternatives.push(n.concatenation);else if(a!==12&&a!==13&&a!==11&&a!==4&&a!==6&&a!==14&&a!==15){if(t.length===0)return n.alternation;e.fail(`token of type '${W[n.close].name}'`)}break}}}}function oe(e){return A(e,W,`RailroadAbnf`,8,e=>e.slice(1,-1),e=>{let t=e.expect(11);e.expect(1);let n=ae(e);return e.expect(2),{$type:`AbnfRule`,name:t,definition:n}})}function se(e,t){switch(e.$type){case`AbnfAlternation`:return R(t);case`AbnfConcatenation`:return L(t);case`AbnfElement`:{let n=e.repeat;if(!n)return t[0];let r=n.indexOf(`*`),i=r===-1,a=r>0||i?parseInt(n,10):0,o=i?a:r<n.length-1?parseInt(n.slice(r+1),10):1/0;return a===0&&o===1?F(t[0]):I(t[0],a,o)}case`AbnfStringLiteral`:case`AbnfNumVal`:return M(e.value);case`AbnfRuleName`:return N(e.name);case`AbnfGroup`:return t[0];case`AbnfOptionalGroup`:return F(t[0])}}var ce=e=>z(e,se);function le(e,t){if(e.charCodeAt(t)!==63)return-1;let n=!1;for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===63)return n?r+1:-1;if(t===59)return-1;n||=!v(t)}return-1}var ue=E(`EBNF_ID`),de={name:`EBNF_SPECIAL_SEQUENCE`,pattern:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/y,first:`?`,scanner:()=>le},fe=O(`EBNF`),pe={name:`EBNF_ISO_COMMENT`,pattern:/\(\*[\s\S]*?\*\)/y,hidden:!0,first:`(`,opener:/\(\*/y},me=[T(`railroad-ebnf-beta`,ue),w(`::=`),w(`=`),w(`;`),w(`|`),w(`,`),w(`(`,[pe]),w(`)`),w(`[`),w(`]`),w(`{`),w(`}`),w(`?`,[de]),w(`*`),w(`+`),w(`-`,[fe[1]]),x,S,C,ue,D(`EBNF_STRING`),de,...fe,{name:`EBNF_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y},pe];function he(e,t,n,r){let i={$type:`EbnfSequence`,elements:[]};return t.alternatives.push(i),{choice:t,sequence:i,term:void 0,node:e,close:n,except:r}}var ge=[`EbnfGroup`,`EbnfOptional`,`EbnfRepetition`];function _e(e){let t=[],n=he(void 0,{$type:`EbnfChoice`,alternatives:[]},-2,!1),r=!1;for(;;){let i,a=e.kind;switch(a){case 20:i={$type:`EbnfTerminal`,value:k(e.take())};break;case 19:i={$type:`EbnfNonTerminal`,name:e.take()};break;case 21:i={$type:`EbnfSpecial`,text:e.take().slice(1,-1).trim()};break;case 6:case 8:case 10:{e.i++;let i={$type:`EbnfChoice`,alternatives:[]};t.push(n),n=he({$type:ge[a-6>>1],element:i},i,a+1,r),r=!1;continue}default:e.fail(`a terminal, a name, or an opening bracket`)}for(;;){r?(n.term.postfixes.push({$type:`EbnfExceptionPostfix`,except:i}),r=!1):(n.term={$type:`EbnfTerm`,base:i,postfixes:[]},n.sequence.elements.push(n.term));let a=n.term.postfixes;for(;;){let t=e.kind;if(t===12)a.push({$type:`EbnfOptionalPostfix`,operator:e.take()});else if(t===13)a.push({$type:`EbnfZeroOrMorePostfix`,operator:e.take()});else if(t===14)a.push({$type:`EbnfOneOrMorePostfix`,operator:e.take()});else break}let o=e.kind;if(o===n.close)e.i++,i=n.node,r=n.except,n=t.pop();else{if(o===15)e.i++,r=!0;else if(o===5)e.i++;else if(o===4)e.i++,n.sequence={$type:`EbnfSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==20&&o!==19&&o!==21&&o!==6&&o!==8&&o!==10){if(t.length===0)return n.choice;e.fail(`token of type '${me[n.close].name}'`)}break}}}}function ve(e){return A(e,me,`RailroadEbnf`,16,k,e=>{let t=e.expect(19);e.accept(2)||e.expect(1);let n={$type:`EbnfRule`,name:t,definition:_e(e)};return e.expect(3),n})}function ye(e,t){switch(e.$type){case`EbnfChoice`:return R(t);case`EbnfSequence`:return L(t);case`EbnfTerm`:{let n=t[0],r=1;for(let i of e.postfixes)n=i.$type===`EbnfOptionalPostfix`?F(n):i.$type===`EbnfExceptionPostfix`?{type:`sequence`,elements:[n,M(`-`),t[r++]]}:I(n,+(i.$type===`EbnfOneOrMorePostfix`));return n}case`EbnfTerminal`:return M(e.value);case`EbnfNonTerminal`:return N(e.name);case`EbnfSpecial`:return P(e.text);case`EbnfGroup`:return t[0];case`EbnfOptional`:return F(t[0]);case`EbnfRepetition`:return I(t[0],0)}}var be=e=>z(e,ye),K=E(`RR_ID`),q=e=>w(e,[K]),xe=[T(`railroad-beta`,K),q(`nonterminal`),q(`zeroOrMore`),q(`oneOrMore`),q(`sequence`),q(`optional`),q(`terminal`),q(`special`),q(`choice`),w(`=`),w(`;`),w(`(`),w(`,`),w(`)`),x,S,C,K,D(`RR_STRING`),...O(`RR`),{name:`RR_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y}];function J(e){e.i++,e.expect(11);let t=k(e.expect(18));return e.expect(13),t}function Se(e){return{$type:e,element:void 0}}function Ce(e){let t=[];for(;;){let n;switch(e.kind){case 6:n={$type:`RailroadTerminalExpr`,value:J(e)};break;case 1:n={$type:`RailroadNonTerminalExpr`,name:J(e)};break;case 7:n={$type:`RailroadSpecialExpr`,text:J(e)};break;case 4:n={$type:`RailroadSequenceExpr`,elements:[]};break;case 8:n={$type:`RailroadChoiceExpr`,alternatives:[]};break;case 5:n=Se(`RailroadOptionalExpr`);break;case 3:n=Se(`RailroadOneOrMoreExpr`);break;case 2:n=Se(`RailroadZeroOrMoreExpr`);break;default:e.fail(`an expression`)}if(`elements`in n||`alternatives`in n||`element`in n)e.i++,e.expect(11),t.push(n);else for(;;){let r=t[t.length-1];if(r===void 0)return n;if(`element`in r)r.element=n;else if((`elements`in r?r.elements:r.alternatives).push(n),e.accept(12))break;e.expect(13),t.pop(),n=r}}}function we(e){return A(e,xe,`Railroad`,14,k,e=>{let t=e.expect(17);e.expect(9);let n=Ce(e);return e.expect(10),{$type:`RailroadRule`,name:t,definition:n}})}function Te(e,t){switch(e.$type){case`RailroadTerminalExpr`:return M(e.value);case`RailroadNonTerminalExpr`:return N(e.name);case`RailroadSpecialExpr`:return P(e.text);case`RailroadSequenceExpr`:return L(t);case`RailroadChoiceExpr`:return R(t);case`RailroadOptionalExpr`:return F(t[0]);default:return I(t[0],+(e.$type===`RailroadOneOrMoreExpr`))}}var Ee=e=>z(e,Te),De=E(`PEG_ID`),Oe=[T(`railroad-peg-beta`,De),w(`<-`),w(`;`),w(`/`),w(`&`),w(`!`),w(`?`),w(`*`),w(`+`),w(`(`),w(`)`),w(`.`),x,S,C,De,D(`PEG_STRING`),...O(`PEG`),{name:`PEG_LINE_COMMENT`,pattern:/#[^\n\r]*/y,hidden:!0,first:`#`}];function ke(e,t,n){let r={$type:`PegSequence`,elements:[]};return t.alternatives.push(r),{choice:t,sequence:r,node:e,operator:n}}function Ae(e){let t=[],n=ke(void 0,{$type:`PegOrderedChoice`,alternatives:[]},void 0);for(;;){let r=e.kind===4||e.kind===5?e.take():void 0,i;switch(e.kind){case 16:i={$type:`PegLiteral`,value:k(e.take())};break;case 15:i={$type:`PegIdentifier`,name:e.take()};break;case 11:i={$type:`PegAny`,dot:e.take()};break;case 9:{e.i++;let i={$type:`PegOrderedChoice`,alternatives:[]};t.push(n),n=ke({$type:`PegGroup`,element:i},i,r);continue}default:e.fail(`a literal, a name, a dot, or an opening parenthesis`)}for(;;){let a={$type:`PegSuffix`,primary:i};(e.kind===6||e.kind===7||e.kind===8)&&(a.operator=e.take()),n.sequence.elements.push(r===void 0?{$type:`PegPrefix`,suffix:a}:{$type:`PegPrefix`,operator:r,suffix:a});let o=e.kind;if(o===10&&t.length>0)e.i++,i=n.node,r=n.operator,n=t.pop();else{if(o===3)e.i++,n.sequence={$type:`PegSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==4&&o!==5&&o!==16&&o!==15&&o!==11&&o!==9){if(t.length===0)return n.choice;e.fail(`token of type ')'`)}break}}}}function je(e){return A(e,Oe,`RailroadPeg`,12,k,e=>{let t=e.expect(15);e.expect(1);let n={$type:`PegRule`,name:t,definition:Ae(e)};return e.expect(2),n})}function Me(e){switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}}function Ne(e,t){let n=t[0];switch(e.$type){case`PegOrderedChoice`:return R(t);case`PegSequence`:return L(t);case`PegPrefix`:return e.operator?P(e.operator+Me(n)):n;case`PegSuffix`:return e.operator?e.operator===`?`?F(n):I(n,+(e.operator===`+`)):n;case`PegLiteral`:return M(e.value);case`PegIdentifier`:return N(e.name);case`PegAny`:return P(e.dot);case`PegGroup`:return n}}var Pe=e=>z(e,Ne),Fe=class{type=`railroad`;notation=`railroad`;title;accTitle;accDescr;rules=[];byName=new Map;setTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
4
4
|
`)}addRule(e){this.rules.push(e),this.byName.set(e.name,e)}getRule(e){return this.byName.get(e)}},Ie=/^\s*railroad-(ebnf-|abnf-|peg-)?beta/i;function Le(e){let t=Ie.exec(e);if(t===null)return;let n=t[1]?.toLowerCase();return n===`ebnf-`?`ebnf`:n===`abnf-`?`abnf`:n===`peg-`?`peg`:`railroad`}function Re(e,t){switch(t){case`ebnf`:{let t=ve(e);return[t,be(t)]}case`abnf`:{let t=oe(e);return[t,ce(t)]}case`peg`:{let t=je(e);return[t,Pe(t)]}default:{let t=we(e);return[t,Ee(t)]}}}function ze(e,t,n){let[r,i]=Re(t,n);e.notation=n,r.accDescr&&e.setAccDescription(r.accDescr),r.accTitle&&e.setAccTitle(r.accTitle),r.title&&e.setTitle(r.title);for(let t of i)e.addRule(t)}function Be(e,t){let n=Le(e);if(n===void 0)throw new g(`No railroad diagram keyword found.`,`syntax`,{type:`railroad`});let r=new Fe;return t&&(r.title=t),ze(r,e,n),r}var Ve=12,He=6,Ue=18,Y=12,X=7;function Z(e,t,n,r){let i=e.railroad?.[t];return typeof i==`number`&&i>=0?Math.min(i,r):n}var We=/[\n\r\t]/g;function Q(e){return(e.includes(`¶ß`)?_(e.replace(/&/g,`&`)):e).replace(We,e=>e===`
|
|
5
5
|
`?`\\n`:e===`\r`?`\\r`:`\\t`)}function $(e,t){for(let n=t,r=e.length-1;n<r;n++,r--){let t=e[n];e[n]=e[r],e[r]=t}}function Ge(e){return Math.ceil(e/2)*2}function Ke(e,t,n,r,i){let a=i.height/2;return{kind:e,width:Math.max(Ge(i.measurer.width(t,i.size,r)+2*i.padding),i.height),up:a,down:a,kids:ie,text:t,id:n,reach:0}}function qe(e,t){if(t===1/0&&e<=1)return``;let n=e=>Number.isFinite(e)?String(e):`∞`;return e===t?n(e)+`×`:t===1/0?`≥`+n(e)+`×`:e===0?`≤`+n(t)+`×`:n(e)+`–`+n(t)+`×`}function Je(e,t,n,r){return Math.max(e+t.down+r.sep+n.up,2*r.arc)}function Ye(e,t){let n=Math.max(e.up+t.sep,2*t.arc);return{kind:5,width:e.width+4*t.arc,up:n,down:e.down,kids:[e],text:``,id:``,reach:n}}function Xe(e,t,n=1/0){let r=new Map,i=[[e,n]];for(let e=0;n!==1/0&&e<i.length;e++){let[n,a]=i[e];r.set(n,a);let o=n.type===`choice`||n.type===`optional`?4*t.arc:n.type===`repetition`?(n.min===0?6:2)*t.arc:n.type===`sequence`?6*t.arc:0;for(let e of j(n))i.push([e,Math.max(40,a-o)])}return B(e,j,(e,n)=>{let i=r.get(e)??1/0;switch(e.type){case`terminal`:{let n=Q(e.value);return Ke(0,/^ +$/.test(n)?`␣`.repeat(n.length):n,``,4,t)}case`nonterminal`:return Ke(1,Q(e.name),e.name,0,t);case`special`:return Ke(2,`? `+Q(e.text)+` ?`,``,2,t);case`sequence`:{let e=Math.max(0,n.length-1)*t.gap,r=0,a=0;for(let t of n)e+=t.width,r=Math.max(r,t.up),a=Math.max(a,t.down);let o={kind:3,width:e,up:r,down:a,kids:n,text:``,id:``,reach:0};if(e<=i||n.length<2)return o;let s=[],c=[],l=0,u=()=>{let e=0,t=0;for(let n of c)e=Math.max(e,n.up),t=Math.max(t,n.down);s.push({kind:3,width:l,up:e,down:t,kids:c,text:``,id:``,reach:0}),c=[],l=0};for(let e of n)c.length&&l+t.gap+e.width>Math.max(40,i-6*t.arc)&&u(),l+=(c.length?t.gap:0)+e.width,c.push(e);if(u(),s.length<2)return o;let d=0,f=0;for(let e=0;e<s.length;e++)d=Math.max(d,s[e].width),e&&(f+=s[e-1].down+Math.max(t.sep,2*t.arc)+s[e].up);return{kind:7,width:d+6*t.arc,up:s[0].up,down:f+s[s.length-1].down,kids:s,text:``,id:``,reach:0}}case`choice`:{let e=0,r=0;for(let i=0;i<n.length;i++)e=Math.max(e,n[i].width),i>0&&(r=Je(r,n[i-1],n[i],t));let i=n[n.length-1];return{kind:4,width:e+4*t.arc,up:n.length>0?n[0].up:0,down:i?r+i.down:0,kids:n,text:``,id:``,reach:0}}case`optional`:return Ye(n[0],t);case`repetition`:{let{min:r,max:i}=e,a=n[0];if(r===1&&i===1)return a;let o=qe(r,i),s=Math.max(a.down+t.sep,2*t.arc),c=o===``?0:Ge(t.measurer.width(o,Y,0)),l={kind:6,width:Math.max(a.width,c)+2*t.arc,up:a.up,down:s+(o===``?X/2+1:Y+6),kids:[a],text:o,id:``,reach:s};return r===0?Ye(l,t):l}}})}function Ze(e,t,n){return te(n,r=>Qe(e,t,n,r))}function Qe(e,t,n,r){let i=n.fontSize??16,a=Z(t,`fontSize`,0,200),o=a||Math.round(i*.875),s=a||i,c=Z(t,`padding`,-1,200),te=Math.round(o*1.5),g={measurer:n.measurer??re(n.fontFamily,n.fontFamilyMono),size:o,padding:c<0?12:c,height:Ge(te+(c<0?9:2*c)),gap:Math.min(Z(t,`horizontalSeparation`,16,500),r?12:1/0),sep:Z(t,`verticalSeparation`,10,500),arc:Math.min(Z(t,`arcRadius`,10,200),r?6:1/0)},_=t.railroad?.showMarkers===!1?0:Z(t,`markerRadius`,4,50),v=Z(t,`strokeWidth`,0,20),y=v>0?` stroke-width="${l(v)}"`:``,b=n.padding??8,{arc:x}=g,S=l(x),C=(e,t,n)=>`a${S},${S} 0 0 ${e} ${t}${S},${n}${S}`,w=C(1,``,``),T=C(0,``,``),E=C(0,``,`-`),D=C(1,``,`-`),O=C(0,`-`,``),k=C(0,`-`,`-`),A=p(e.title,!1,g.measurer,i,r?ne(n):4e3,1),ie=A.height>0?A.height+16:0,j=Math.round(s*1.5),M=o*.35,N=g.height/2,P=``,F=``,I=``,L=(e,t,n)=>{n>e&&(P+=`M${l(e)},${l(t)}H${l(n)}`)},R=(e,t,n)=>{let r=[e],i=[t,n];for(;r.length>0;){let e=r.pop(),t=i.pop(),n=i.pop(),a=e.kids,o=n+e.width;switch(e.kind){case 3:{let e=o;for(let n=a.length-1;n>=0;n--)e-=a[n].width,r.push(a[n]),i.push(e,t),n>0&&L(e-g.gap,t,e),e-=g.gap;break}case 7:{let e=n+2*x,s=r.length,c=0;L(n,t,e);for(let s=0;s<a.length;s++){let u=a[s],d=t+c;if(r.push(u),i.push(d,e),s+1<a.length){let r=a[s+1],i=c+u.down+Math.max(g.sep,2*x)+r.up,f=t+c+u.down+Math.max(g.sep,2*x)/2;P+=`M${l(e+u.width)},${l(d)}H${l(o-2*x)}V${l(f)}H${l(n+x)}V${l(t+i)}H${l(e)}`,F+=`M${l(e-X)},${l(t+i-X/2)}l${X},${X/2}l${-X},${X/2}z`,c=i}else P+=`M${l(e+u.width)},${l(d)}H${l(o-x)}V${l(t)}H${l(o)}`}$(r,s),$(i,2*s);break}case 4:{let s=e.width-4*x,c=n+x,u=o-x,d=r.length,f=0;for(let e=0;e<a.length;e++){let d=a[e];e>0&&(f=Je(f,a[e-1],d,g));let p=t+f,m=n+2*x+(s-d.width)/2,ee=e===a.length-1;e===0?(L(n,t,m),L(m+d.width,t,o)):P+=(ee?`M${l(n)},${l(t)}${w}V${l(p-x)}`:`M${l(c)},${l(p-x)}`)+T+(m>c+x?`H${l(m)}`:``)+`M${l(m+d.width)},${l(p)}`+(m>c+x?`H${l(u-x)}`:``)+E+(ee?`V${l(t+x)}${D}`:``),r.push(d),i.push(p,m)}$(r,d),$(i,2*d);break}case 5:{let s=a[0],c=n+2*x;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n)},${l(t)}${E}V${l(t-e.reach+x)}${D}H${l(o-2*x)}${w}V${l(t-x)}${T}`,r.push(s),i.push(c,t);break}case 6:{let s=a[0],c=n+(e.width-s.width)/2,u=t+e.reach,d=n+e.width/2;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n+x)},${l(t)}${O}V${l(u-x)}${T}H${l(o-x)}${E}V${l(t+x)}${k}`,F+=`M${l(d-X/2)},${l(u)}l${X},${-X/2}v${X}z`,e.text!==``&&(I+=`<text class="pele-edge-label pele-count" x="${l(d)}" y="${l(u+Y+3)}" font-size="${Y}" fill="var(--_m)">${h(e.text)}</text>`),r.push(s),i.push(c,t);break}default:{let r=e.text,i=r.startsWith(` `)||r.endsWith(` `)||r.includes(` `)?` xml:space="preserve"`:``,a=`<rect x="${l(n)}" y="${l(t-N)}" width="${l(e.width)}" height="${l(g.height)}"`,o=`<text x="${l(n+e.width/2)}" y="${l(t+M)}"${i}`;e.kind===0?I+=`<g class="pele-node pele-terminal">${a} rx="${l(N)}" fill="var(--_s)" stroke="var(--_b)"${y}/>${o} font-family="${ee}">${h(r)}</text></g>`:e.kind===1?I+=`<g class="pele-node pele-nonterminal" data-id="${f(e.id)}">${a} fill="var(--_bg)" stroke="var(--_b)"${y}${d}/>${o}>${h(r)}</text></g>`:I+=`<g class="pele-node pele-special">${a} fill="var(--_bg)" stroke="var(--_b)" stroke-dasharray="4 3"${y}${d}/>${o} font-style="italic"><tspan fill="var(--_m)">? </tspan>${h(r.slice(2,-2))}<tspan fill="var(--_m)"> ?</tspan></text></g>`}}}},z=``,B=A.width,V=b+ie,H=b+A.height;for(let t of e.rules){let e=Xe(t.definition,g,r?Math.max(80,(n.maxWidth??320)-2*b-4*_-2*Ve-1):1/0),i=Q(t.name),a=V+j+He+e.up,o=b+2*_,c=o+Ve,u=c+e.width+Ve;P=``,F=``,I=``,L(o,a,c),L(c+e.width,a,u),R(e,c,a);let d=_>0?`<circle class="pele-marker pele-start" cx="${l(b+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/><circle class="pele-marker pele-end" cx="${l(u+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/>`:``;z+=`<g class="pele-rule" data-id="${f(t.name)}"><text class="pele-rule-name" x="${l(b)}" y="${l(V+j/2+s*.35)}" font-size="${l(s)}" font-weight="var(--_hw)" text-anchor="start">${h(i)}</text><path class="pele-edge pele-track" d="${P}" fill="none" stroke="var(--_l)"${y}/>`+(F?`<path class="pele-marker" d="${F}" fill="var(--_l)"/>`:``)+d+I+`</g>`,B=Math.max(B,u+2*_-b,g.measurer.width(i,s,1)),H=a+e.down,V=H+g.sep+Ue}let U=Math.ceil(B+2*b),W=Math.ceil(H+b),G=m(A,U/2,b+A.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(z?`<g class="pele-rules" transform="translate(0.5,0.5)" font-size="${l(o)}" text-anchor="middle">${z}</g>`:``);return{svg:u(`railroad`,U,W,i,n,e,G),width:U,height:W,links:[]}}var $e={type:`railroad`,parse:(e,t,n)=>Be(e,n),render:Ze};export{$e as railroad};
|
|
6
|
-
//# sourceMappingURL=DRLTVNUE-
|
|
6
|
+
//# sourceMappingURL=DRLTVNUE-Bp-Mh_TD.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-
|
|
1
|
+
import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-DM5Itfvk.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-CjI9VTqp.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-B-2quXAp.js";import{n as ne,r as g,t as _}from"./CXAC5362-B_mhvA6r.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-Bpm7QNt6.js";var x=class{type=`kanban`;title;sections=[];getType=_;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
|
|
2
2
|
`)?i+`
|
|
3
3
|
`:`{
|
|
4
4
|
`+i+`
|
|
5
5
|
}`,t;try{t=b(e)}catch(e){throw new v(`Metadata of "${a.id}" is not valid YAML. ${e.message}`,`syntax`,{type:`kanban`})}if(typeof t==`object`&&t&&!Array.isArray(t)){let e=t.shape?String(t.shape):``;if(e!==e.toLowerCase()||e.includes(`_`))throw new v(`No such shape: ${e}. Shape names should be lowercase.`,`semantic`,{type:`kanban`});t.label&&(a.label=String(t.label)),t.icon&&(a.icon=String(t.icon)),t.assigned&&(a.assigned=String(t.assigned)),t.ticket&&(a.ticket=String(t.ticket)),t.priority&&(a.priority=String(t.priority))}}if(this.misplaced)throw new v(`Items without section detected, found section ("${this.misplaced.label}")`,`semantic`,{type:`kanban`});let o=this.sections;if(o.length===0&&(this.sectionLevel=e),this.last=a,e===this.sectionLevel){let e=a;e.items=[],o.push(e)}else o[o.length-1].items.push(a),e<this.sectionLevel&&(this.misplaced=a)}decorateNode(e){let t=this.last;!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.cssClasses=e.class))}};function S(e,t){g(e,t,!0)}var C=12,w=8,T=10,E=8,ie=4,D=6,ae=new Map([[`very high`,`stroke="${t}"`],[`high`,`stroke="${t}" opacity="0.5"`],[`low`,`stroke="var(--_m)" opacity="0.5"`],[`very low`,`stroke="var(--_m)"`]]);function O(e,t,n,r,i,o=0){let s=l(e,t,n,r,i,o);if(s.width<=i)return s;let c=[],u=[],d=0,f=[],p=0,m=()=>{c.push(f),u.push(p),d=Math.max(d,p),f=[],p=0};for(let e=0;e<s.lines.length;e++)if(s.widths[e]<=i)f=s.lines[e],p=s.widths[e],m();else{for(let t of s.lines[e]){if(t.icon!==void 0||t.math){p>0&&p+t.width>i&&m(),f.push(t),p+=t.width;continue}let e=``,a=p;for(let o of t.text){let s=n.width(o,r,t.style);p>0&&p+s>i&&(e&&f.push({text:e,style:t.style,width:p-a}),m(),e=``,a=0),e+=o,p+=s}e&&f.push({text:e,style:t.style,width:p-a})}m()}let h={...s,lines:c,widths:u,width:d,height:c.length*s.lineHeight};return s.heights?a(h):h}function k(e,t,r,a,o,c=!1){let l=``;for(let p=0;p<e.lines.length;p++){let m=e.lines[p],h=r+i(e,p);if(m.length===1&&m[0].icon===void 0&&m[0].math===void 0)l+=`<text${d(a,m[0].style)} x="${n(t)}" y="${n(h+e.size*.35)}"${c?` text-anchor="end"`:``}>${f(m[0].text)}</text>`;else{let n=e.widths[p];l+=u(s(e,p),t+(c?-n:n)/2,h,a,o)}}return l}var A=e=>!!e&&y(e)!==``;function j(t,i,a){let s=a.fontSize??16,d=Math.round(s*.875),g=Math.round(s*1.5),_=Math.round(d*1.5),v=a.measurer??re(a.fontFamily),y=a.padding??8,b=a.icons,x=i.kanban??{},S=x.sectionWidth,j=d*1.25,M=0,N=(e,t,n)=>{if(e&&e.includes(`$$`))for(let r of l(e,!0,v,t,1/0).lines)for(let e of r)e.math&&(M=Math.max(M,e.math.width+n))};for(let e of t.sections){let t=v.width(String(e.items.length),d,0);N(e.label,s,2*w+8+t+12+(A(e.icon)?j+D:0));for(let t of e.items){let e=2*(w+T);N(t.label,d,e+(A(t.icon)?j+D:0)),N(t.ticket,d,e),N(t.assigned,d,e)}}let P=Math.max(typeof S==`number`&&S>0?Math.min(Math.max(S,80),2e3):200,Math.ceil(M)),F=a.maxWidth!==void 0&&a.maxWidth>0?a.maxWidth-2*y:1/0,I=t.sections.length,L=I*(P+C)-C<=F,R=L?Math.max(I,1):Math.max(1,Math.floor((F+C)/(P+C))),z=L?P:Math.max(Math.min(P,F),Math.min(Math.floor((F+C)/R)-C,P*2),Math.ceil(M)),oe=typeof x.ticketBaseUrl==`string`?x.ticketBaseUrl:``,B=z-2*w,V=B-2*T,H=[],U=t.sections,W=[],G=[],K=[],q=g,J=[];for(let e of U){let t=v.width(String(e.items.length),d,0),n=t+12+(A(e.icon)?j+D:0),r=O(e.label,!0,v,s,B-8-n,1);q=Math.max(q,r.height),G.push(t),W.push(r);let i=[],a=0;for(let t of e.items){let e=O(t.label,!0,v,d,V-(A(t.icon)?j+D:0)),n=O(t.ticket,!1,v,d,V),r=O(t.assigned,!1,v,d,V),o=n.width+r.width+8>V?n.height+r.height:Math.max(n.height,r.height),s=2*T+Math.max(e.height,_)+(o?ie+o:0);i.push({item:t,label:e,ticket:n,assigned:r,meta:o,height:s}),a+=s+E}K.push(i),J.push(a)}q+=2*w;let Y=[],X=[];for(let e=0,t=0;e<U.length;e+=R){let n=E;for(let t=e;t<Math.min(e+R,U.length);t++)n=Math.max(n,J[t]);X.push(t),Y.push(q+n),t+=q+n+C}let se=Y.length>0?X[X.length-1]+Y[Y.length-1]:0,Z=m(t.title,v,s,p(a)),ce=Z.height>0?Z.height+16:0,le=Math.max(Math.min(U.length,R)*(z+C)-C,0),Q=Math.max(le,Z.width),ue=y+(Q-le)/2,de=z-w-4,fe=``;for(let t=0;t<U.length;t++){let r=U[t],i=Math.floor(t/R),s=`<rect width="${z}" height="${n(Y[i])}" fill="var(--_s)"${o}/>`+k(W[t],w+4,w,` class="pele-cluster-label" font-weight="var(--_hw)"`,b)+`<text class="pele-count" x="${de}" y="${n(w+g/2+d*.35)}" text-anchor="end" font-size="${d}" fill="var(--_m)">${r.items.length}</text>`;A(r.icon)&&(s+=ne(r.icon,de-G[t]-D-j,w+(g-j)/2,j,b));let l=q;for(let r of K[t]){let t=r.item,i=(t.priority??``).trim().toLowerCase(),u=ae.get(i),p=`<rect width="${B}" height="${n(r.height)}" fill="var(--_bg)" stroke="var(--_b)"${o}/>`;u!==void 0&&(p+=`<path class="pele-priority" d="M2.5,5V${n(r.height-5)}" fill="none" ${u} stroke-width="3" stroke-linecap="round"/>`),p+=k(r.label,T,T,` class="pele-label"`,b),A(t.icon)&&(p+=ne(t.icon,B-T-j,T+(_-j)/2,j,b));let m=r.height-T;if(t.ticket){let e=m-r.meta,n=oe?h(te(oe.replace(`#TICKET#`,()=>t.ticket)),a):void 0;n===void 0?p+=k(r.ticket,T,e,` class="pele-ticket" fill="var(--_m)"`,b):(p+=`<a href="${f(n)}" target="_blank"${ee(a)}>`+k(r.ticket,T,e,` class="pele-ticket" fill="var(--_c)"`,b)+`</a>`,H.push({id:t.id,href:n,internal:!1}))}t.assigned&&(p+=k(r.assigned,B-T,m-r.assigned.height,` class="pele-assigned" fill="var(--_m)"`,b,!0)),s+=`<g class="pele-node pele-card${u===void 0?``:` pele-priority-`+i.replace(` `,`-`)}${e(t.cssClasses??``)}" data-id="${c(t.id)}" transform="translate(${w},${n(l)})" font-size="${d}">${p}</g>`,l+=r.height+E}fe+=`<g class="pele-cluster pele-column${e(r.cssClasses??``)}" data-id="${c(r.id)}" transform="translate(${n(ue+t%R*(z+C))},${n(y+ce+X[i])})">${s}</g>`}let $=Math.ceil(Q+2*y),pe=Math.ceil(se+ce+2*y),me=u(Z,$/2,y+Z.height/2,` class="pele-title" font-weight="var(--_tw)"`)+fe;return{svg:r(`kanban`,$,pe,s,a,{},me),width:$,height:pe,links:H}}var M={type:`kanban`,math:!0,parse(e,t,n){let r=new x;return r.title=n,S(e,r),r},render:j};export{M as kanban};
|
|
6
|
-
//# sourceMappingURL=DYY6UVD2-
|
|
6
|
+
//# sourceMappingURL=DYY6UVD2-Dwh9ZkXt.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Cf as i,Ed as a,Fl as o,Hf as s,Ol as c,Tl as l,Wd as u,Wu as d,Yu as f,Zd as p,Zn as m,af as h,ap as g,ar as _,fd as v,fl as y,fr as b,ir as x,kl as S,mr as C,or as w,qd as T,rr as E,sr as D,t as O,tr as k,vf as A,yf as j,yl as M}from"./utils-DkKLB01I.js";import{R as ee,U as te,u as N}from"./TooltipProvider-DiV5KdTq.js";import{a as P,c as F,o as I,s as ne,t as L}from"./select-CE2f-g-3.js";import{t as re}from"./spinner-C-qDE4WQ.js";import{t as R}from"./query-CeIgbVxh.js";import{t as z}from"./use-atom-command-QDd_NqJQ.js";import{u as ie}from"./rightPanelStore-Bt0unAo8.js";import{N as ae}from"./PanelLayoutControls-BpjspxNc.js";import{a as B,n as V,t as H}from"./tooltip-CCYU8XGM.js";import{n as oe,t as se}from"./toggle-group-B1WN0Pgy.js";import{t as U}from"./input-CiPGmOLv.js";import{t as ce}from"./dialog-5OaxRXCC.js";import{i as W,n as G,r as le,t as K}from"./device-B_zaE4OU.js";import{t as ue}from"./hubAccess-CsZ8CNmg.js";import{c as de,r as fe,s as q,u as J}from"./DeviceSetup-C02U1yvN.js";import{i as Y}from"./previewMiniPlayerStore-DByen2Nk.js";import{t as X}from"./discovery-list-VELXPQtS.js";import{Ao as pe,Do as me,Mo as he,jo as ge,ko as _e}from"./main-xeaL6Ue7.js";import{_ as ve,g as ye,h as be,x as xe}from"./_chat-CPyEKO_k.js";var Z=e(t(),1),Q=n(),Se=class extends Error{status;constructor(e){super(`Screenshot capture failed (${e}). Try again.`),this.status=e}};async function Ce(e,t){let n=e.platform===`ios`?`serve-sim`:`serve-emu`,r=ue(`${e.access.httpBase}/vendor/${n}/api/screenshot?device=${encodeURIComponent(e.deviceId)}`,e.access),i=await fetch(r,{method:`POST`,credentials:e.access.credentials?`include`:`omit`,signal:AbortSignal.any([t,AbortSignal.timeout(2e4)])});if(!i.ok)throw new Se(i.status);let a=await i.blob();if(!a.size)throw Error(`The device returned an empty screenshot. Try again.`);return a}var $=e(r(),1);function we(e){let t=(0,Q.c)(71),{view:n,handle:r,controls:o}=e,c=o.detail?.settings,_=!r?.inputConnected,y=e.hostKind===`local`||e.hostKind===`ssh`,w=c?.appearance===`dark`?`light`:`dark`,T;t[0]===r?T=t[1]:(T=()=>r?.pressButton(`home`),t[0]=r,t[1]=T);let O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(d,{}),t[2]=O):O=t[2];let P;t[3]!==_||t[4]!==T?(P=(0,$.jsx)(De,{tooltipSide:`left`,label:`Home`,disabled:_,onClick:T,children:O}),t[3]=_,t[4]=T,t[5]=P):P=t[5];let F;t[6]!==o||t[7]!==r||t[8]!==_||t[9]!==e.platform||t[10]!==y||t[11]!==n.keyboard?.attached?(F=e.platform===`android`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(De,{tooltipSide:`left`,label:`Back`,disabled:_,onClick:()=>r?.pressButton(`back`),children:(0,$.jsx)(S,{})}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Recents`,disabled:_,onClick:()=>r?.pressButton(`recents`),children:(0,$.jsx)(i,{})}),y?(0,$.jsxs)(m,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Rotate device`,disabled:o.disabled}),children:(0,$.jsx)(h,{})}),(0,$.jsxs)(E,{side:`left`,children:[(0,$.jsx)(k,{onClick:()=>void o.act({type:`setOrientation`,value:`portrait`}),children:`Portrait`}),(0,$.jsx)(k,{onClick:()=>void o.act({type:`setOrientation`,value:`landscape_left`}),children:`Landscape`})]})]}):null]}):(0,$.jsx)(De,{tooltipSide:`left`,label:`Rotate device`,disabled:_||!!n.keyboard?.attached,onClick:()=>r?.rotate(),children:(0,$.jsx)(h,{})}),t[6]=o,t[7]=r,t[8]=_,t[9]=e.platform,t[10]=y,t[11]=n.keyboard?.attached,t[12]=F):F=t[12];let I;t[13]!==o||t[14]!==w||t[15]!==e.onTools||t[16]!==e.toolsOpen||t[17]!==y||t[18]!==c?.appearance||t[19]!==c?.textSize?(I=y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Switch device to ${w} mode`,disabled:o.disabled||!c?.appearance,onClick:()=>void o.act({type:`setAppearance`,value:w}),children:(0,$.jsx)(N,{icon:c?.appearance===`dark`?te:ee})}),(0,$.jsxs)(m,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Device text size`,title:`Device text size`,disabled:o.disabled||!c?.textSize}),children:(0,$.jsx)(s,{})}),(0,$.jsx)(E,{side:`left`,className:`min-w-40`,children:(0,$.jsx)(x,{value:c?.textSize??``,onValueChange:e=>{(e===`small`||e==="default"||e===`large`||e===`extra-large`)&&o.act({type:`setTextSize`,value:e})},children:[[`small`,`Small`],[`default`,`Default`],[`large`,`Large`],[`extra-large`,`Extra large`]].map(Te)})})]}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Device tools`,pressed:e.toolsOpen,onClick:e.onTools,children:(0,$.jsx)(A,{})})]}):null,t[13]=o,t[14]=w,t[15]=e.onTools,t[16]=e.toolsOpen,t[17]=y,t[18]=c?.appearance,t[19]=c?.textSize,t[20]=I):I=t[20];let ne=e.screenshotPending?`Capturing screenshot`:`Save screenshot`,L=!n.streaming||e.screenshotPending,re;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(l,{}),t[21]=re):re=t[21];let R;t[22]!==e.onScreenshot||t[23]!==ne||t[24]!==L?(R=(0,$.jsx)(De,{tooltipSide:`left`,label:ne,disabled:L,onClick:e.onScreenshot,children:re}),t[22]=e.onScreenshot,t[23]=ne,t[24]=L,t[25]=R):R=t[25];let z;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`More device actions`,title:`More device actions`}),children:(0,$.jsx)(a,{})}),t[26]=z):z=t[26];let ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(u,{}),t[27]=ie):ie=t[27];let ae;t[28]===e.onFloat?ae=t[29]:(ae=(0,$.jsxs)(k,{onClick:e.onFloat,children:[ie,`Float device over chat`]}),t[28]=e.onFloat,t[29]=ae);let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(g,{}),t[30]=B):B=t[30];let V;t[31]===e.onClose?V=t[32]:(V=(0,$.jsxs)(k,{onClick:e.onClose,children:[B,`Close device panel`]}),t[31]=e.onClose,t[32]=V);let H;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(D,{}),t[33]=H):H=t[33];let oe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(p,{}),t[34]=oe):oe=t[34];let se;t[35]===e.onPowerOff?se=t[36]:(se=(0,$.jsxs)(k,{variant:`destructive`,onClick:e.onPowerOff,children:[oe,`Power off device`]}),t[35]=e.onPowerOff,t[36]=se);let U;t[37]!==ae||t[38]!==V||t[39]!==se?(U=(0,$.jsxs)(m,{children:[z,(0,$.jsxs)(E,{side:`left`,align:`end`,children:[ae,V,H,se]})]}),t[37]=ae,t[38]=V,t[39]=se,t[40]=U):U=t[40];let ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Ee,{}),t[41]=ce):ce=t[41];let W=!n.streaming||!!n.phoneUnavailableReason,G=n.phoneUnavailableReason??void 0,le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(M,{}),t[42]=le):le=t[42];let K;t[43]!==W||t[44]!==G||t[45]!==n.phone||t[46]!==n.showPhone?(K=(0,$.jsx)(De,{tooltipSide:`left`,label:`3D view`,pressed:n.phone,disabled:W,description:G,onClick:n.showPhone,children:le}),t[43]=W,t[44]=G,t[45]=n.phone,t[46]=n.showPhone,t[47]=K):K=t[47];let ue=!n.phone,de=!n.streaming,fe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(j,{}),t[48]=fe):fe=t[48];let q;t[49]!==ue||t[50]!==de||t[51]!==n.showFlat?(q=(0,$.jsx)(De,{tooltipSide:`left`,label:`Flat view`,pressed:ue,disabled:de,onClick:n.showFlat,children:fe}),t[49]=ue,t[50]=de,t[51]=n.showFlat,t[52]=q):q=t[52];let J;t[53]===n.keyboard?J=t[54]:(J=n.keyboard?(0,$.jsx)(De,{tooltipSide:`left`,label:n.keyboard.attached?`Detach Magic Keyboard`:`Attach Magic Keyboard`,pressed:n.keyboard.attached,onClick:n.keyboard.toggle,children:(0,$.jsx)(f,{})}):null,t[53]=n.keyboard,t[54]=J);let Y;t[55]!==n.phone||t[56]!==n.resetView?(Y=n.phone?(0,$.jsx)(De,{tooltipSide:`left`,label:`Restore 3D view`,onClick:n.resetView,children:(0,$.jsx)(v,{})}):null,t[55]=n.phone,t[56]=n.resetView,t[57]=Y):Y=t[57];let X;t[58]!==U||t[59]!==P||t[60]!==K||t[61]!==q||t[62]!==J||t[63]!==Y||t[64]!==F||t[65]!==I||t[66]!==R?(X=(0,$.jsxs)(`div`,{className:`pointer-events-auto flex shrink-0 flex-col items-center gap-1 overflow-y-auto rounded-full border border-border/50 bg-background/80 p-2 shadow-sm [scrollbar-width:none]`,children:[P,F,I,R,U,ce,K,q,J,Y]}),t[58]=U,t[59]=P,t[60]=K,t[61]=q,t[62]=J,t[63]=Y,t[64]=F,t[65]=I,t[66]=R,t[67]=X):X=t[67];let pe;return t[68]!==X||t[69]!==n.foldingControls?(pe=(0,$.jsxs)(`aside`,{"aria-label":`Device controls`,"data-layout":`rail`,className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex w-14 flex-col items-center gap-2 overflow-y-auto [justify-content:safe_center] py-3 pr-2 [scrollbar-width:none]`,children:[X,n.foldingControls]}),t[68]=X,t[69]=n.foldingControls,t[70]=pe):pe=t[70],pe}function Te(e){let[t,n]=e;return(0,$.jsx)(_,{value:t,children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`flex-1`,children:n}),(0,$.jsx)(w,{})]})},t)}function Ee(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`my-1 h-px w-5 shrink-0 bg-border/70`}),e[0]=t):t=e[0],t}function De(e){let t=(0,Q.c)(18),n=e.pressed?`secondary`:`ghost`,r;t[0]!==e.children||t[1]!==e.disabled||t[2]!==e.label||t[3]!==e.onClick||t[4]!==e.pressed||t[5]!==n?(r=(0,$.jsx)(C,{size:`icon-sm`,variant:n,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled,onClick:e.onClick,children:e.children}),t[0]=e.children,t[1]=e.disabled,t[2]=e.label,t[3]=e.onClick,t[4]=e.pressed,t[5]=n,t[6]=r):r=t[6];let i=r,a;t[7]!==i||t[8]!==e.description||t[9]!==e.disabled||t[10]!==e.label?(a=e.disabled&&e.description?(0,$.jsx)(B,{render:(0,$.jsx)(`span`,{className:`inline-flex`,tabIndex:0,role:`group`,"aria-label":e.label}),children:i}):(0,$.jsx)(B,{render:i}),t[7]=i,t[8]=e.description,t[9]=e.disabled,t[10]=e.label,t[11]=a):a=t[11];let o=e.description??e.label,s;t[12]!==e.tooltipSide||t[13]!==o?(s=(0,$.jsx)(V,{side:e.tooltipSide,children:o}),t[12]=e.tooltipSide,t[13]=o,t[14]=s):s=t[14];let c;return t[15]!==a||t[16]!==s?(c=(0,$.jsxs)(H,{children:[a,s]}),t[15]=a,t[16]=s,t[17]=c):c=t[17],c}var Oe=[{value:`small`,label:`Small`},{value:`default`,label:`Default`},{value:`large`,label:`Large`},{value:`extra-large`,label:`Extra large`}],ke=[{value:`none`,label:`None`},{value:`grayscale`,label:`Grayscale`},{value:`red-green`,label:`Red / green (protanopia)`},{value:`green-red`,label:`Green / red (deuteranopia)`},{value:`blue-yellow`,label:`Blue / yellow (tritanopia)`}],Ae=[{value:`portrait`,label:`Portrait`},{value:`landscape_left`,label:`Landscape left`},{value:`portrait_upside_down`,label:`Upside down`},{value:`landscape_right`,label:`Landscape right`}],je=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`reminders`,label:`Reminders`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Motion`},{value:`media-library`,label:`Media library`},{value:`faceid`,label:`Face ID`}],Me=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Physical activity`}],Ne=[{label:`San Francisco`,latitude:37.7749,longitude:-122.4194},{label:`New York`,latitude:40.7128,longitude:-74.006},{label:`London`,latitude:51.5074,longitude:-.1278},{label:`Stockholm`,latitude:59.3293,longitude:18.0686},{label:`Tokyo`,latitude:35.6762,longitude:139.6503}];function Pe(e){let t=(0,Q.c)(129),{device:n,controls:r}=e,{detail:i,pending:a,error:o,foregroundApp:s,disabled:c,act:l}=r,u=i?.settings,d=n.platform===`ios`,f;t[0]===e.className?f=t[1]:(f=O(`flex min-h-0 flex-col border-border bg-background text-sm`,e.className),t[0]=e.className,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`font-medium`,children:`Tools`}),t[2]=p):p=t[2];let m;t[3]===a?m=t[4]:(m=a?(0,$.jsx)(re,{size:`sm`}):null,t[3]=a,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{}),t[5]=h):h=t[5];let _;t[6]===e.onClose?_=t[7]:(_=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Close tools`,className:`ml-auto`,onClick:e.onClose,children:h}),t[6]=e.onClose,t[7]=_);let v;t[8]!==m||t[9]!==_?(v=(0,$.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-3`,children:[p,m,_]}),t[8]=m,t[9]=_,t[10]=v):v=t[10];let y;t[11]===o?y=t[12]:(y=o?(0,$.jsx)(`p`,{className:`border-b bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:o}):null,t[11]=o,t[12]=y);let b;t[13]!==i||t[14]!==o?(b=i===null&&!o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(re,{size:`sm`}),` Reading device settings…`]}):null,t[13]=i,t[14]=o,t[15]=b):b=t[15];let x;t[16]===e.hostDiagnostics?x=t[17]:(x=e.hostDiagnostics?(0,$.jsx)(Fe,{title:`Host diagnostics`,children:(0,$.jsx)(`p`,{className:`whitespace-pre-line text-xs text-muted-foreground`,children:e.hostDiagnostics})}):null,t[16]=e.hostDiagnostics,t[17]=x);let S=s?.id??`—`,w;t[18]===S?w=t[19]:(w=(0,$.jsx)(Ie,{label:`Foreground`,children:(0,$.jsx)(`span`,{className:`truncate font-mono text-xs`,children:S})}),t[18]=S,t[19]=w);let T;t[20]!==l||t[21]!==c||t[22]!==s?(T=s?(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`terminateApp`,appId:s.id}),children:`Terminate`}),(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`launchApp`,appId:s.id}),children:`Relaunch`})]}):null,t[20]=l,t[21]=c,t[22]=s,t[23]=T):T=t[23];let E;t[24]===l?E=t[25]:(E=e=>l({type:`openUrl`,url:e}),t[24]=l,t[25]=E);let D;t[26]!==c||t[27]!==E?(D=(0,$.jsx)(Be,{placeholder:`https://… or myapp://`,action:`Open`,disabled:c,onSubmit:E}),t[26]=c,t[27]=E,t[28]=D):D=t[28];let k=d?`Bundle ID to launch`:`Package name to launch`,A;t[29]===l?A=t[30]:(A=e=>l({type:`launchApp`,appId:e}),t[29]=l,t[30]=A);let j;t[31]!==c||t[32]!==k||t[33]!==A?(j=(0,$.jsx)(Be,{placeholder:k,action:`Launch`,disabled:c,onSubmit:A}),t[31]=c,t[32]=k,t[33]=A,t[34]=j):j=t[34];let M;t[35]!==w||t[36]!==T||t[37]!==D||t[38]!==j?(M=(0,$.jsxs)(Fe,{title:`App`,children:[w,T,D,j]}),t[35]=w,t[36]=T,t[37]=D,t[38]=j,t[39]=M):M=t[39];let ee=d?`Simulator`:`Emulator`,te;t[40]===u?te=t[41]:(te=u?.appearance?[u.appearance]:[],t[40]=u,t[41]=te);let N;t[42]===l?N=t[43]:(N=e=>{let t=e[0];(t===`light`||t===`dark`)&&l({type:`setAppearance`,value:t})},t[42]=l,t[43]=N);let P,F;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(se,{value:`light`,children:`Light`}),F=(0,$.jsx)(se,{value:`dark`,children:`Dark`}),t[44]=P,t[45]=F):(P=t[44],F=t[45]);let I;t[46]!==c||t[47]!==te||t[48]!==N?(I=(0,$.jsx)(Ie,{label:`Appearance`,children:(0,$.jsxs)(oe,{"aria-label":`Appearance`,value:te,disabled:c,onValueChange:N,children:[P,F]})}),t[46]=c,t[47]=te,t[48]=N,t[49]=I):I=t[49];let ne=u?.textSize??null,L;t[50]===l?L=t[51]:(L=e=>l({type:`setTextSize`,value:e}),t[50]=l,t[51]=L);let R;t[52]!==c||t[53]!==ne||t[54]!==L?(R=(0,$.jsx)(Ie,{label:`Text size`,children:(0,$.jsx)(Re,{ariaLabel:`Text size`,value:ne,options:Oe,disabled:c,onChange:L})}),t[52]=c,t[53]=ne,t[54]=L,t[55]=R):R=t[55];let z;t[56]!==l||t[57]!==c||t[58]!==d||t[59]!==u?(z=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ie,{label:`Liquid Glass`,children:(0,$.jsxs)(oe,{"aria-label":`Liquid Glass`,value:u?.liquidGlass?[u.liquidGlass]:[],disabled:c||u?.liquidGlass===void 0,onValueChange:e=>{let t=e[0];(t===`clear`||t===`tinted`)&&l({type:`setLiquidGlass`,value:t})},children:[(0,$.jsx)(se,{value:`clear`,children:`Clear`}),(0,$.jsx)(se,{value:`tinted`,children:`Tinted`})]})}),(0,$.jsx)(Ie,{label:`Color filter`,children:(0,$.jsx)(Re,{ariaLabel:`Color filter`,value:u?.colorFilter??null,options:ke,disabled:c,onChange:e=>l({type:`setColorFilter`,value:e})})})]}):(0,$.jsx)(Ie,{label:`Orientation`,children:(0,$.jsx)(Re,{ariaLabel:`Orientation`,value:null,placeholder:`Rotate to…`,options:Ae,disabled:c,onChange:e=>l({type:`setOrientation`,value:e})})}),t[56]=l,t[57]=c,t[58]=d,t[59]=u,t[60]=z):z=t[60];let ie=u?.reduceMotion,ae;t[61]===l?ae=t[62]:(ae=e=>l({type:`setToggle`,setting:`reduceMotion`,value:e}),t[61]=l,t[62]=ae);let B;t[63]!==c||t[64]!==ie||t[65]!==ae?(B=(0,$.jsx)(Le,{label:`Reduce Motion`,checked:ie,disabled:c,onChange:ae}),t[63]=c,t[64]=ie,t[65]=ae,t[66]=B):B=t[66];let V;t[67]!==l||t[68]!==c||t[69]!==d||t[70]!==u?.increaseContrast||t[71]!==u?.networkEnabled||t[72]!==u?.reduceTransparency||t[73]!==u?.showBorders||t[74]!==u?.voiceOver?(V=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{label:`Increase Contrast`,checked:u?.increaseContrast,disabled:c,onChange:e=>l({type:`setToggle`,setting:`increaseContrast`,value:e})}),(0,$.jsx)(Le,{label:`Reduce Transparency`,checked:u?.reduceTransparency,disabled:c,onChange:e=>l({type:`setToggle`,setting:`reduceTransparency`,value:e})}),(0,$.jsx)(Le,{label:`Show Borders`,checked:u?.showBorders,disabled:c,onChange:e=>l({type:`setToggle`,setting:`showBorders`,value:e})}),(0,$.jsx)(Le,{label:`VoiceOver`,checked:u?.voiceOver,disabled:c,onChange:e=>l({type:`setToggle`,setting:`voiceOver`,value:e})})]}):(0,$.jsx)(Le,{label:`Network`,checked:u?.networkEnabled,disabled:c,onChange:e=>l({type:`setToggle`,setting:`networkEnabled`,value:e})}),t[67]=l,t[68]=c,t[69]=d,t[70]=u?.increaseContrast,t[71]=u?.networkEnabled,t[72]=u?.reduceTransparency,t[73]=u?.showBorders,t[74]=u?.voiceOver,t[75]=V):V=t[75];let H;t[76]!==ee||t[77]!==I||t[78]!==R||t[79]!==z||t[80]!==B||t[81]!==V?(H=(0,$.jsxs)(Fe,{title:ee,children:[I,R,z,B,V]}),t[76]=ee,t[77]=I,t[78]=R,t[79]=z,t[80]=B,t[81]=V,t[82]=H):H=t[82];let U=e.access===null,ce;t[83]===e?ce=t[84]:(ce=t=>(e.onAxOverlayChange(t),Promise.resolve()),t[83]=e,t[84]=ce);let W;t[85]!==e.axOverlay||t[86]!==U||t[87]!==ce?(W=(0,$.jsx)(Fe,{title:`Accessibility`,children:(0,$.jsx)(Le,{label:`Overlay element frames`,checked:e.axOverlay,disabled:U,onChange:ce})}),t[85]=e.axOverlay,t[86]=U,t[87]=ce,t[88]=W):W=t[88];let G,le;t[89]===l?(G=t[90],le=t[91]):(G=(e,t)=>l({type:`setLocation`,latitude:e,longitude:t}),le=()=>l({type:`clearLocation`}),t[89]=l,t[90]=G,t[91]=le);let K;t[92]!==c||t[93]!==d||t[94]!==G||t[95]!==le?(K=(0,$.jsx)(Ve,{disabled:c,canClear:d,onSet:G,onClear:le}),t[92]=c,t[93]=d,t[94]=G,t[95]=le,t[96]=K):K=t[96];let ue=d?je:Me,de=s?.id??``,fe;t[97]===l?fe=t[98]:(fe=(e,t,n)=>l({type:`setPermission`,appId:e,permission:t,decision:n}),t[97]=l,t[98]=fe);let q;t[99]!==c||t[100]!==d||t[101]!==ue||t[102]!==de||t[103]!==fe?(q=(0,$.jsx)(Ue,{permissions:ue,canReset:d,defaultAppId:de,disabled:c,onDecide:fe}),t[99]=c,t[100]=d,t[101]=ue,t[102]=de,t[103]=fe,t[104]=q):q=t[104];let J;t[105]!==l||t[106]!==c||t[107]!==s||t[108]!==d?(J=d?(0,$.jsxs)(Fe,{title:`Push notification`,children:[(0,$.jsx)(Be,{placeholder:`Alert text`,action:`Send`,disabled:c||!s,onSubmit:e=>s?l({type:`sendPush`,appId:s.id,payload:e}):Promise.resolve(!1)}),s?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open an app first.`})]}):null,t[105]=l,t[106]=c,t[107]=s,t[108]=d,t[109]=J):J=t[109];let Y;t[110]!==n||t[111]!==d||t[112]!==e.access?(Y=d&&e.access?(0,$.jsx)(Ge,{access:e.access,device:n}):null,t[110]=n,t[111]=d,t[112]=e.access,t[113]=Y):Y=t[113];let X;t[114]!==M||t[115]!==H||t[116]!==W||t[117]!==K||t[118]!==q||t[119]!==J||t[120]!==Y||t[121]!==y||t[122]!==b||t[123]!==x?(X=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[y,b,x,M,H,W,K,q,J,Y]}),t[114]=M,t[115]=H,t[116]=W,t[117]=K,t[118]=q,t[119]=J,t[120]=Y,t[121]=y,t[122]=b,t[123]=x,t[124]=X):X=t[124];let pe;return t[125]!==f||t[126]!==X||t[127]!==v?(pe=(0,$.jsxs)(`div`,{className:f,children:[v,X]}),t[125]=f,t[126]=X,t[127]=v,t[128]=pe):pe=t[128],pe}function Fe(e){let t=(0,Q.c)(5),n;t[0]===e.title?n=t[1]:(n=(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:e.title}),t[0]=e.title,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2 border-b px-3 py-2.5 last:border-b-0`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ie(e){let t=(0,Q.c)(7),n;t[0]===e.label?n=t[1]:(n=(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.label}),t[0]=e.label,t[1]=n);let r;t[2]===e.children?r=t[3]:(r=(0,$.jsx)(`div`,{className:`flex min-w-0 items-center justify-end`,children:e.children}),t[2]=e.children,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Le(e){let t=(0,Q.c)(10),n=e.checked??!1,r=e.disabled||e.checked===void 0,i;t[0]===e?i=t[1]:(i=t=>void e.onChange(t),t[0]=e,t[1]=i);let a;t[2]!==e.label||t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,$.jsx)(he,{size:`sm`,"aria-label":e.label,checked:n,disabled:r,onCheckedChange:i}),t[2]=e.label,t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==e.label||t[8]!==a?(o=(0,$.jsx)(Ie,{label:e.label,children:a}),t[7]=e.label,t[8]=a,t[9]=o):o=t[9],o}function Re(e){let t=(0,Q.c)(25),n;if(t[0]!==e.options||t[1]!==e.value){let r;t[3]===e.value?r=t[4]:(r=t=>t.value===e.value,t[3]=e.value,t[4]=r),n=e.options.find(r),t[0]=e.options,t[1]=e.value,t[2]=n}else n=t[2];let r=n,i=e.value,a=e.disabled,o;t[5]===e?o=t[6]:(o=t=>{t!==null&&t!==e.value&&e.onChange(t)},t[5]=e,t[6]=o);let s;t[7]!==r||t[8]!==e.placeholder?(s=r?r.label:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.placeholder??`Unknown`}),t[7]=r,t[8]=e.placeholder,t[9]=s):s=t[9];let c;t[10]===s?c=t[11]:(c=(0,$.jsx)(F,{children:s}),t[10]=s,t[11]=c);let l;t[12]!==e.ariaLabel||t[13]!==c?(l=(0,$.jsx)(ne,{size:`xs`,className:`w-40`,"aria-label":e.ariaLabel,children:c}),t[12]=e.ariaLabel,t[13]=c,t[14]=l):l=t[14];let u;t[15]===e.options?u=t[16]:(u=e.options.map(ze),t[15]=e.options,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,$.jsx)(I,{align:`end`,alignItemWithTrigger:!1,children:u}),t[17]=u,t[18]=d);let f;return t[19]!==e.disabled||t[20]!==e.value||t[21]!==o||t[22]!==l||t[23]!==d?(f=(0,$.jsxs)(L,{value:i,disabled:a,onValueChange:o,children:[l,d]}),t[19]=e.disabled,t[20]=e.value,t[21]=o,t[22]=l,t[23]=d,t[24]=f):f=t[24],f}function ze(e){return(0,$.jsx)(P,{value:e.value,children:e.label},e.value)}function Be(e){let t=(0,Q.c)(20),[n,r]=(0,Z.useState)(``),i;t[0]!==e||t[1]!==n?(i=()=>{let t=n.trim();t&&e.onSubmit(t).then(e=>{e&&r(``)})},t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a?o=t[4]:(o=e=>{e.preventDefault(),a()},t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>r(e.target.value),t[5]=s):s=t[5];let c;t[6]!==e.disabled||t[7]!==e.placeholder||t[8]!==n?(c=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:e.placeholder,value:n,disabled:e.disabled,onChange:s}),t[6]=e.disabled,t[7]=e.placeholder,t[8]=n,t[9]=c):c=t[9];let l;t[10]!==e.disabled||t[11]!==n?(l=e.disabled||n.trim().length===0,t[10]=e.disabled,t[11]=n,t[12]=l):l=t[12];let u;t[13]!==e.action||t[14]!==l?(u=(0,$.jsx)(C,{type:`submit`,size:`xs`,variant:`outline`,disabled:l,children:e.action}),t[13]=e.action,t[14]=l,t[15]=u):u=t[15];let d;return t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,$.jsxs)(`form`,{className:`flex gap-1.5`,onSubmit:o,children:[c,u]}),t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function Ve(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),o=Number(n),s=Number(i),c,l;t[0]!==n||t[1]!==i||t[2]!==o||t[3]!==s?(c={latitude:o,longitude:s},l=n.trim()!==``&&i.trim()!==``&&Math.abs(c.latitude)<=90&&Math.abs(c.longitude)<=180,t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l):(c=t[4],l=t[5]);let u=l,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==e.disabled?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Latitude`,inputMode:`decimal`,value:n,disabled:e.disabled,onChange:d}),t[7]=n,t[8]=e.disabled,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==e.disabled?(m=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Longitude`,inputMode:`decimal`,value:i,disabled:e.disabled,onChange:p}),t[11]=i,t[12]=e.disabled,t[13]=m):m=t[13];let h;t[14]!==f||t[15]!==m?(h=(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16];let g;t[17]===e?g=t[18]:(g=t=>{let n=Ne.find(e=>e.label===t);n&&(r(String(n.latitude)),a(String(n.longitude)),e.onSet(n.latitude,n.longitude))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(ne,{size:`xs`,className:`w-32`,"aria-label":`Location preset`,children:(0,$.jsx)(F,{children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Preset…`})})}),t[19]=_):_=t[19];let v;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(I,{align:`start`,alignItemWithTrigger:!1,children:Ne.map(He)}),t[20]=v):v=t[20];let y;t[21]!==e.disabled||t[22]!==g?(y=(0,$.jsxs)(L,{value:null,disabled:e.disabled,onValueChange:g,children:[_,v]}),t[21]=e.disabled,t[22]=g,t[23]=y):y=t[23];let b=e.disabled||!u,x;t[24]!==c.latitude||t[25]!==c.longitude||t[26]!==e?(x=()=>void e.onSet(c.latitude,c.longitude),t[24]=c.latitude,t[25]=c.longitude,t[26]=e,t[27]=x):x=t[27];let S;t[28]!==b||t[29]!==x?(S=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:b,onClick:x,children:`Set`}),t[28]=b,t[29]=x,t[30]=S):S=t[30];let w;t[31]===e?w=t[32]:(w=e.canClear?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled,onClick:()=>{r(``),a(``),e.onClear()},children:`Clear`}):null,t[31]=e,t[32]=w);let T;t[33]!==y||t[34]!==S||t[35]!==w?(T=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[y,S,w]}),t[33]=y,t[34]=S,t[35]=w,t[36]=T):T=t[36];let E;return t[37]!==T||t[38]!==h?(E=(0,$.jsxs)(Fe,{title:`Location`,children:[h,T]}),t[37]=T,t[38]=h,t[39]=E):E=t[39],E}function He(e){return(0,$.jsx)(P,{value:e.label,children:e.label},e.label)}function Ue(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(`camera`),o;t[0]!==n||t[1]!==e.defaultAppId?(o=n.trim()||e.defaultAppId,t[0]=n,t[1]=e.defaultAppId,t[2]=o):o=t[2];let s=o,c;t[3]!==i||t[4]!==e||t[5]!==s?(c=t=>void e.onDecide(s,i,t),t[3]=i,t[4]=e,t[5]=s,t[6]=c):c=t[6];let l=c,u=e.defaultAppId||`App ID`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==e.disabled||t[10]!==u?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,placeholder:u,value:n,disabled:e.disabled,onChange:d}),t[8]=n,t[9]=e.disabled,t[10]=u,t[11]=f):f=t[11];let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(a(e),Promise.resolve()),t[12]=p):p=t[12];let m;t[13]!==i||t[14]!==e.disabled||t[15]!==e.permissions?(m=(0,$.jsx)(Re,{ariaLabel:`Permission`,value:i,options:e.permissions,disabled:e.disabled,onChange:p}),t[13]=i,t[14]=e.disabled,t[15]=e.permissions,t[16]=m):m=t[16];let h=e.disabled||!s,g;t[17]===l?g=t[18]:(g=()=>l(`grant`),t[17]=l,t[18]=g);let _;t[19]!==h||t[20]!==g?(_=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:h,onClick:g,children:`Grant`}),t[19]=h,t[20]=g,t[21]=_):_=t[21];let v=e.disabled||!s,y;t[22]===l?y=t[23]:(y=()=>l(`revoke`),t[22]=l,t[23]=y);let b;t[24]!==v||t[25]!==y?(b=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:v,onClick:y,children:`Revoke`}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==l||t[28]!==e.canReset||t[29]!==e.disabled||t[30]!==s?(x=e.canReset?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled||!s,onClick:()=>l(`reset`),children:`Reset`}):null,t[27]=l,t[28]=e.canReset,t[29]=e.disabled,t[30]=s,t[31]=x):x=t[31];let S;t[32]!==b||t[33]!==x||t[34]!==m||t[35]!==_?(S=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[m,_,b,x]}),t[32]=b,t[33]=x,t[34]=m,t[35]=_,t[36]=S):S=t[36];let w;return t[37]!==S||t[38]!==f?(w=(0,$.jsxs)(Fe,{title:`Permissions`,children:[f,S]}),t[37]=S,t[38]=f,t[39]=w):w=t[39],w}var We=100;function Ge(e){let t=(0,Q.c)(19),[n,r]=(0,Z.useState)(!1),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Z.useState)(i),s,l;t[1]!==n||t[2]!==e.access||t[3]!==e.device.id||t[4]!==e.device.platform?(s=()=>{if(!n)return;let t=ye({access:e.access,platform:e.device.platform,deviceId:e.device.id},(e,t)=>{o(n=>{let r=t?[...e]:[...n,...e];return r.length>We?r.slice(-100):r})});return()=>{t(),o([])}},l=[n,e.access,e.device.id,e.device.platform],t[1]=n,t[2]=e.access,t[3]=e.device.id,t[4]=e.device.platform,t[5]=s,t[6]=l):(s=t[5],l=t[6]),(0,Z.useEffect)(s,l);let u=n&&`rotate-180`,d;t[7]===u?d=t[8]:(d=O(`ml-auto size-3.5 transition-transform`,u),t[7]=u,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,$.jsxs)(ge,{className:`flex w-full items-center gap-1.5 border-b px-3 py-2.5 text-left text-xs font-medium text-muted-foreground`,children:[`Event log`,(0,$.jsx)(c,{className:d})]}),t[9]=d,t[10]=f);let p;t[11]===a?p=t[12]:(p=a.length===0?(0,$.jsx)(`li`,{className:`text-muted-foreground`,children:`No events yet.`}):a.map(Ke),t[11]=a,t[12]=p);let m;t[13]===p?m=t[14]:(m=(0,$.jsx)(pe,{children:(0,$.jsx)(`ol`,{className:`max-h-64 overflow-y-auto px-3 py-2 font-mono text-2xs leading-relaxed`,children:p})}),t[13]=p,t[14]=m);let h;return t[15]!==n||t[16]!==f||t[17]!==m?(h=(0,$.jsxs)(_e,{open:n,onOpenChange:r,children:[f,m]}),t[15]=n,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}function Ke(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.timestamp.slice(11,19)}),(0,$.jsx)(`span`,{className:`truncate`,children:e.summary})]},e.id)}function qe(e){let t=(0,Q.c)(30),{environmentId:n,device:r,access:i,visible:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=z(K.detail,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[1]=c):c=t[1];let l=z(K.action,c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(0),b=(0,Z.useRef)(null),x;t[2]!==r.hostId||t[3]!==r.id?(x={hostId:r.hostId,deviceId:r.id},t[2]=r.hostId,t[3]=r.id,t[4]=x):x=t[4];let S=x,C,w;t[5]!==n||t[6]!==s||t[7]!==S||t[8]!==a?(C=()=>{let e=y.current+=1;if(!a)return;let t={environmentId:n,input:S};return b.current=t,s(t).then(t=>{y.current===e&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause))))}),()=>{b.current=null,y.current+=1}},w=[n,s,S,a],t[5]=n,t[6]=s,t[7]=S,t[8]=a,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,Z.useEffect)(C,w);let T,E;t[11]!==i||t[12]!==r.id||t[13]!==r.platform||t[14]!==a?(T=()=>{if(!i||!a)return;let e=!0,t=ve({access:i,platform:r.platform,deviceId:r.id},t=>{e&&_(t)});return()=>{e=!1,t(),_(void 0)}},E=[i,r.id,r.platform,a],t[11]=i,t[12]=r.id,t[13]=r.platform,t[14]=a,t[15]=T,t[16]=E):(T=t[15],E=t[16]),(0,Z.useEffect)(T,E);let D=u!==null&&a,O;t[17]!==D||t[18]!==n||t[19]!==s||t[20]!==l||t[21]!==S?(O=async e=>{if(v.current||!D)return!1;v.current=!0;let t=y.current+=1;return p(!0),h(null),l({environmentId:n,input:{...S,...e}}).then(e=>{if(y.current!==t){let t=b.current;if(!t)return e._tag===`Success`;let n=y.current+=1;return s(t).then(t=>(y.current===n&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause)))),e._tag===`Success`))}return e._tag===`Success`?d(e.value):h(R(e.cause)),e._tag===`Success`}).finally(()=>{v.current=!1,p(!1)})},t[17]=D,t[18]=n,t[19]=s,t[20]=l,t[21]=S,t[22]=O):O=t[22];let k=O,A=f||!u||!a,j=g===void 0?u?.foregroundApp??null:g,M;return t[23]!==k||t[24]!==u||t[25]!==m||t[26]!==f||t[27]!==A||t[28]!==j?(M={detail:u,pending:f,error:m,act:k,disabled:A,foregroundApp:j},t[23]=k,t[24]=u,t[25]=m,t[26]=f,t[27]=A,t[28]=j,t[29]=M):M=t[29],M}function Je(e){let t=(0,Q.c)(53),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(null),p=(0,Z.useRef)(null),m=le(e.environmentId,e.device.hostId),h=e.hostKind===`local`||e.hostKind===`ssh`,g=e.visible&&h,_;t[0]!==m||t[1]!==e||t[2]!==g?(_={...e,access:m,visible:g},t[0]=m,t[1]=e,t[2]=g,t[3]=_):_=t[3];let v=qe(_),y,b;t[4]!==m||t[5]!==e.visible?(y=()=>(m&&e.visible||f.current?.abort(),()=>{f.current?.abort(),p.current&&URL.revokeObjectURL(p.current),p.current=null}),b=[m,e.visible],t[4]=m,t[5]=e.visible,t[6]=y,t[7]=b):(y=t[6],b=t[7]),(0,Z.useEffect)(y,b);let x;t[8]!==m||t[9]!==e.device.id||t[10]!==e.device.name||t[11]!==e.device.platform||t[12]!==e.environmentId||t[13]!==e.visible?(x=()=>{if(!m||f.current||!e.visible)return;let t=new AbortController;return f.current=t,l(!0),d(null),Ce({access:m,platform:e.device.platform,deviceId:e.device.id},t.signal).then(n=>{if(t.signal.aborted)return;p.current&&URL.revokeObjectURL(p.current);let r=URL.createObjectURL(n);p.current=r;let i=document.createElement(`a`);i.href=r,i.download=`${e.device.name.replace(/[^a-z0-9-]/gi,`-`)}-${Date.now()}.png`,document.body.append(i),i.click(),i.remove()}).catch(n=>{t.signal.aborted||(n instanceof Se&&n.status===401&&G(e.environmentId),d(n instanceof Error?n.message:`Screenshot capture failed. Try again.`))}).finally(()=>{f.current===t&&(f.current=null,l(!1))})},t[8]=m,t[9]=e.device.id,t[10]=e.device.name,t[11]=e.device.platform,t[12]=e.environmentId,t[13]=e.visible,t[14]=x):x=t[14];let S=x,C;t[15]!==v||t[16]!==u||t[17]!==i?(C=u||v.error&&!i?(0,$.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:u??v.error}):null,t[15]=v,t[16]=u,t[17]=i,t[18]=C):C=t[18];let w=`${e.hostLabel} · ${e.device.version}`,T;t[19]!==v||t[20]!==n||t[21]!==e.device.platform||t[22]!==e.hostKind||t[23]!==e.onClose||t[24]!==e.onFloat||t[25]!==e.onPowerOff||t[26]!==S||t[27]!==c||t[28]!==i?(T=t=>(0,$.jsx)(we,{platform:e.device.platform,hostKind:e.hostKind,handle:n,view:t,controls:v,screenshotPending:c,onScreenshot:()=>void S(),toolsOpen:i,onTools:()=>a(!i),onFloat:e.onFloat,onClose:e.onClose,onPowerOff:e.onPowerOff}),t[19]=v,t[20]=n,t[21]=e.device.platform,t[22]=e.hostKind,t[23]=e.onClose,t[24]=e.onFloat,t[25]=e.onPowerOff,t[26]=S,t[27]=c,t[28]=i,t[29]=T):T=t[29];let E;t[30]!==o||t[31]!==e.device.hostId||t[32]!==e.device.id||t[33]!==e.device.name||t[34]!==e.device.platform||t[35]!==e.environmentId||t[36]!==e.visible||t[37]!==w||t[38]!==T?(E=(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(be,{environmentId:e.environmentId,platform:e.device.platform,deviceName:e.device.name,deviceDescription:w,deviceId:e.device.id,hostId:e.device.hostId,visible:e.visible,axOverlay:o,allowPhoneView:!0,onHandle:r,renderControls:T})}),t[30]=o,t[31]=e.device.hostId,t[32]=e.device.id,t[33]=e.device.name,t[34]=e.device.platform,t[35]=e.environmentId,t[36]=e.visible,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==C||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[C,E]}),t[40]=C,t[41]=E,t[42]=D):D=t[42];let O;t[43]!==m||t[44]!==o||t[45]!==v||t[46]!==e.device||t[47]!==e.hostDiagnostics||t[48]!==i?(O=i?(0,$.jsx)(Pe,{device:e.device,controls:v,hostDiagnostics:e.hostDiagnostics,access:m,axOverlay:o,onAxOverlayChange:s,onClose:()=>a(!1),className:`absolute inset-y-0 right-0 z-10 w-full max-w-72 border-l shadow-lg @[700px]:static @[700px]:w-72 @[700px]:shrink-0 @[700px]:shadow-none`}):null,t[43]=m,t[44]=o,t[45]=v,t[46]=e.device,t[47]=e.hostDiagnostics,t[48]=i,t[49]=O):O=t[49];let k;return t[50]!==O||t[51]!==D?(k=(0,$.jsxs)($.Fragment,{children:[D,O]}),t[50]=O,t[51]=D,t[52]=k):k=t[52],k}var Ye=e=>e===`ios`?`iOS Simulators`:`Android Emulators`,Xe=e=>`${e.hostId}\u0000${e.id}`;function Ze(e){let t=(0,Q.c)(87),{environmentId:n,threadId:r}=e.threadRef,{state:i,loaded:a,error:o,refresh:s}=W(n),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=z(K.list,c),u=z(K.open),d=z(K.close),f=`${n}\u0000${r}`,[p,m]=(0,Z.useState)(null),h=p?.scope===f?p.pending:null,g=p?.scope===f?p.error:null,_;t[1]===h?_=t[2]:(_=h?Xe(h):null,t[1]=h,t[2]=_);let v=_,b=i.hostStatus===`disabled`,x,S;t[3]!==n||t[4]!==b||t[5]!==l||t[6]!==a||t[7]!==e.visible?(x=()=>{e.visible&&a&&!b&&l({environmentId:n,input:{}})},S=[n,l,a,e.visible,b],t[3]=n,t[4]=b,t[5]=l,t[6]=a,t[7]=e.visible,t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Z.useEffect)(x,S);let w;if(t[10]!==e.surface.target||t[11]!==i.sessions||t[12]!==r){let n;t[14]===r?n=t[15]:(n=e=>e.threadId===r,t[14]=r,t[15]=n);let a=i.sessions.filter(n);w=e.surface.target?a.find(t=>t.deviceId===e.surface.target?.deviceId&&t.hostId===e.surface.target.hostId):void 0,t[10]=e.surface.target,t[11]=i.sessions,t[12]=r,t[13]=w}else w=t[13];let E=w,D,k,A,M,ee,te,N;if(t[16]!==E||t[17]!==d||t[18]!==n||t[19]!==b||t[20]!==l||t[21]!==a||t[22]!==u||t[23]!==g||t[24]!==h||t[25]!==v||t[26]!==e||t[27]!==s||t[28]!==f||t[29]!==i||t[30]!==o||t[31]!==r){k=Symbol.for(`react.early_return_sentinel`);bb0:{let c=E?i.devices.find(e=>e.hostId===E.hostId&&e.id===E.deviceId):void 0,p=at(i),_;t[39]===f?_=t[40]:(_=e=>{let t={scope:f,pending:e,error:null};return m(t),e=>m(n=>n===t?{...t,pending:null,error:e}:n)},t[39]=f,t[40]=_);let x=_,S;t[41]!==n||t[42]!==u||t[43]!==e.threadRef||t[44]!==x||t[45]!==i.devices||t[46]!==r?(S=async t=>{let a=i.devices.find(e=>Xe(e)===t);if(!a)return;let o=x(a),s=await u({environmentId:n,input:{threadId:r,hostId:a.hostId,deviceId:a.id,platform:a.platform}});s._tag===`Failure`?o(R(s.cause)):(ie.getState().openDevice(e.threadRef,{hostId:s.value.hostId,deviceId:s.value.deviceId,platform:a.platform,name:a.name}),o(null))},t[41]=n,t[42]=u,t[43]=e.threadRef,t[44]=x,t[45]=i.devices,t[46]=r,t[47]=S):S=t[47];let w=S,P=()=>{c&&(Y.getState().open(e.threadRef,{kind:`device`,hostId:c.hostId,deviceId:c.id,platform:c.platform,name:c.name}),ie.getState().close(e.threadRef))},F;t[48]!==E||t[49]!==d||t[50]!==n||t[51]!==e.surface.id||t[52]!==e.threadRef||t[53]!==x||t[54]!==r?(F=t=>{if(!t){ie.getState().closeSurface(e.threadRef,e.surface.id);return}if(!E)return;let i=x(null);d({environmentId:n,input:{threadId:r,hostId:E.hostId,deviceId:E.deviceId,shutdown:t}}).then(t=>{t._tag===`Failure`?i(R(t.cause)):ie.getState().closeSurface(e.threadRef,e.surface.id)})},t[48]=E,t[49]=d,t[50]=n,t[51]=e.surface.id,t[52]=e.threadRef,t[53]=x,t[54]=r,t[55]=F):F=t[55];let I=F,ne=i.bootingDevices?.filter(e=>e.threadId===r)??[],{ready:L,busy:z}=q(i),B=!c&&(h!==null||z||!a),V=a?null:o,H;t[56]!==i.hostStatus||t[57]!==i.hostStatusDetail||t[58]!==i.hostStatuses?(H=e=>{let t=i.hostStatuses[e.id],n=t?.detail??(e.kind===`local`?i.hostStatusDetail:void 0);return n&&(t?.status??i.hostStatus)===`ready`?[{hostId:e.id,label:e.label,detail:n}]:[]},t[56]=i.hostStatus,t[57]=i.hostStatusDetail,t[58]=i.hostStatuses,t[59]=H):H=t[59];let oe=i.hosts.flatMap(H),se=i.hosts.flatMap(tt);if(a&&(!i.onboardingCompleted||b)){let r;t[60]===e?r=t[61]:(r=t=>{t||e.onDismissSetup()},t[60]=e,t[61]=r);let a;t[62]!==n||t[63]!==i?(a=(0,$.jsx)(me,{children:(0,$.jsx)(fe,{environmentId:n,state:i})}),t[62]=n,t[63]=i,t[64]=a):a=t[64];let o;t[65]!==e.visible||t[66]!==r||t[67]!==a?(o=(0,$.jsx)(ce,{open:e.visible,onOpenChange:r,children:a}),t[65]=e.visible,t[66]=r,t[67]=a,t[68]=o):o=t[68],k=o;break bb0}D=ae,N=e.mode,ee=`relative flex min-h-0 flex-1 flex-col`;let U;t[69]===n?U=t[70]:(U=e=>(0,$.jsx)(it,{label:e.label,detail:e.detail},`${n}\u0000${e.hostId}\u0000${e.detail}`),t[69]=n,t[70]=U);let W;t[71]!==n||t[72]!==i?(W=(0,$.jsx)(J,{state:i,environmentId:n}),t[71]=n,t[72]=i,t[73]=W):W=t[73];let G;t[74]===g?G=t[75]:(G=g?(0,$.jsx)(rt,{tone:`error`,onDismiss:()=>m(null),children:g}):null,t[74]=g,t[75]=G),te=(0,$.jsxs)(`div`,{className:O(`shrink-0 bg-background`,B&&`absolute inset-x-0 top-0 z-10 max-h-[40%] overflow-y-auto`),children:[(0,$.jsx)(`div`,{hidden:!!c,children:oe.map(U)}),W,ne.length>0?(0,$.jsxs)(`div`,{role:`status`,className:`border-b px-3 py-2 text-xs text-muted-foreground`,children:[`Starting `,ne.map(et).join(`, `),`… This can take a minute.`]}):null,G]}),A=`@container relative flex min-h-0 flex-1`,M=c&&E?(0,$.jsx)(Je,{environmentId:n,device:c,hostLabel:i.hosts.find(e=>e.id===c.hostId)?.label??`Device host`,hostKind:i.hosts.find(e=>e.id===c.hostId)?.kind,hostDiagnostics:oe.find(e=>{let{hostId:t}=e;return t===c.hostId})?.detail,visible:e.visible,onFloat:P,onClose:()=>I(!1),onPowerOff:()=>I(!0)},`${n}\u0000${Xe(c)}`):B?(0,$.jsx)(xe,{name:h?.name??`Devices`,description:h?`${i.hosts.find(e=>e.id===h.hostId)?.label??`Device host`} · ${h.version}`:``,stage:`opening`,message:V??(h?h.booted?`Opening device…`:`Starting device…`:i.hostStatus===`installing`?i.hostStatusDetail??`Installing device support…`:`Finding devices…`),error:V!==null,children:V===null?null:(0,$.jsx)(C,{size:`sm`,variant:`outline`,onClick:s,children:`Retry`})}):(0,$.jsx)(`div`,{className:`scrollbar-gutter-both flex size-full flex-col overflow-y-auto px-5 py-8 text-sm text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:O(`mx-auto flex w-full max-w-xl flex-col gap-6`,p.length===0&&`my-auto items-center text-center`),children:[p.length===0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{className:`size-6 opacity-60`}),(0,$.jsx)(`p`,{className:`max-h-32 w-full max-w-sm overflow-y-auto whitespace-pre-line break-words`,tabIndex:i.hostStatus===`failed`?0:void 0,children:i.hostStatus===`failed`?i.hostStatusDetail??`The device hub failed to start.`:`No simulators or emulators were found on this environment.`})]}):null,L&&p.length>0?(0,$.jsx)(`div`,{className:`w-full space-y-6 text-left`,children:p.map(e=>(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(j,{className:`size-4 shrink-0`}),(0,$.jsx)(`h3`,{className:`font-medium`,children:Ye(e.platform)})]}),(0,$.jsx)(X,{children:e.devices.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-3`,children:[(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md border border-border/60`,children:(0,$.jsx)(j,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:`${i.hosts.find(t=>t.id===e.hostId)?.label} · ${e.version} · ${e.booted?`Running`:`Stopped`}`})]}),(0,$.jsxs)(C,{variant:`outline`,size:`sm`,disabled:v!==null,"aria-label":`${e.booted?`Open`:`Start`} ${e.name}`,onClick:()=>void w(Xe(e)),children:[v===Xe(e)?(0,$.jsx)(re,{size:`xs`}):e.booted?(0,$.jsx)(y,{}):(0,$.jsx)(T,{}),e.booted?`Open`:`Start`]})]},Xe(e)))})]},e.platform))}):null,L&&!de(i)&&!i.devices.some($e)&&!se.some(Qe)?(0,$.jsx)(`p`,{className:`max-w-sm text-xs`,children:`No Android virtual devices found. Create one in Android Studio's Device Manager, then refresh.`}):null,a&&!z?(0,$.jsx)(C,{className:p.length>0?`self-start`:`self-center`,variant:`outline`,size:`sm`,onClick:()=>void l({environmentId:n,input:{}}),children:`Refresh devices`}):null]})})}t[16]=E,t[17]=d,t[18]=n,t[19]=b,t[20]=l,t[21]=a,t[22]=u,t[23]=g,t[24]=h,t[25]=v,t[26]=e,t[27]=s,t[28]=f,t[29]=i,t[30]=o,t[31]=r,t[32]=D,t[33]=k,t[34]=A,t[35]=M,t[36]=ee,t[37]=te,t[38]=N}else D=t[32],k=t[33],A=t[34],M=t[35],ee=t[36],te=t[37],N=t[38];if(k!==Symbol.for(`react.early_return_sentinel`))return k;let P;t[76]!==A||t[77]!==M?(P=(0,$.jsx)(`div`,{className:A,children:M}),t[76]=A,t[77]=M,t[78]=P):P=t[78];let F;t[79]!==P||t[80]!==ee||t[81]!==te?(F=(0,$.jsxs)(`div`,{className:ee,children:[te,P]}),t[79]=P,t[80]=ee,t[81]=te,t[82]=F):F=t[82];let I;return t[83]!==D||t[84]!==F||t[85]!==N?(I=(0,$.jsx)(D,{mode:N,children:F}),t[83]=D,t[84]=F,t[85]=N,t[86]=I):I=t[86],I}function Qe(e){return e.platform===`android`}function $e(e){return e.platform===`android`}function et(e){return e.name}function tt(e){return e.platforms.filter(nt).map(t=>({...t,hostId:e.id,hostLabel:e.label}))}function nt(e){return!e.available}function rt(e){let t=(0,Q.c)(13),n=e.tone===`warning`?`bg-warning-surface text-warning-foreground`:`bg-destructive/5 text-destructive`,r;t[0]===n?r=t[1]:(r=O(`flex items-start gap-2 border-b px-3 py-2 text-xs`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(o,{className:`mt-1 size-3.5 shrink-0`}),t[2]=i):i=t[2];let a;t[3]===e.children?a=t[4]:(a=(0,$.jsx)(`div`,{className:`max-h-32 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,tabIndex:0,children:e.children}),t[3]=e.children,t[4]=a);let s=e.tone===`warning`?`Dismiss device warning`:`Dismiss device error`,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(g,{}),t[5]=c):c=t[5];let l;t[6]!==e.onDismiss||t[7]!==s?(l=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost`,"aria-label":s,onClick:e.onDismiss,children:c}),t[6]=e.onDismiss,t[7]=s,t[8]=l):l=t[8];let u;return t[9]!==r||t[10]!==a||t[11]!==l?(u=(0,$.jsxs)(`div`,{role:`alert`,className:r,children:[i,a,l]}),t[9]=r,t[10]=a,t[11]=l,t[12]=u):u=t[12],u}function it(e){let t=(0,Q.c)(6),[n,r]=(0,Z.useState)(!1);if(n)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>r(!0),t[0]=i):i=t[0];let a;t[1]===e.label?a=t[2]:(a=(0,$.jsxs)(`p`,{className:`font-medium`,children:[`Device discovery warning · `,e.label]}),t[1]=e.label,t[2]=a);let o;return t[3]!==e.detail||t[4]!==a?(o=(0,$.jsxs)(rt,{tone:`warning`,onDismiss:i,children:[a,e.detail]}),t[3]=e.detail,t[4]=a,t[5]=o):o=t[5],o}function at(e){let t=[];for(let n of[`ios`,`android`]){let r=e.devices.filter(e=>e.platform===n).toSorted((e,t)=>Number(t.booted)-Number(e.booted)||e.name.localeCompare(t.name));r.length>0&&t.push({platform:n,devices:r})}return t}export{Ze as DevicePanel};
|
|
2
|
-
//# sourceMappingURL=DevicePanel-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Cf as i,Ed as a,Fl as o,Hf as s,Ol as c,Tl as l,Wd as u,Wu as d,Yu as f,Zd as p,Zn as m,af as h,ap as g,ar as _,fd as v,fl as y,fr as b,ir as x,kl as S,mr as C,or as w,qd as T,rr as E,sr as D,t as O,tr as k,vf as A,yf as j,yl as M}from"./utils-DkKLB01I.js";import{R as ee,U as te,u as N}from"./TooltipProvider-DiV5KdTq.js";import{a as P,c as F,o as I,s as ne,t as L}from"./select-CE2f-g-3.js";import{t as re}from"./spinner-C-qDE4WQ.js";import{t as R}from"./query-CeIgbVxh.js";import{t as z}from"./use-atom-command-Bd7vZxeH.js";import{u as ie}from"./rightPanelStore-Bt0unAo8.js";import{N as ae}from"./PanelLayoutControls-CPevLAhG.js";import{a as B,n as V,t as H}from"./tooltip-CCYU8XGM.js";import{n as oe,t as se}from"./toggle-group-B1WN0Pgy.js";import{t as U}from"./input-CiPGmOLv.js";import{t as ce}from"./dialog-5OaxRXCC.js";import{i as W,n as G,r as le,t as K}from"./device-P8L_QiVD.js";import{t as ue}from"./hubAccess-CsZ8CNmg.js";import{c as de,r as fe,s as q,u as J}from"./DeviceSetup-BCrBVLkf.js";import{i as Y}from"./previewMiniPlayerStore-DByen2Nk.js";import{t as X}from"./discovery-list-VELXPQtS.js";import{Ao as pe,Do as me,Mo as he,jo as ge,ko as _e}from"./main-BYwnnJ9E.js";import{_ as ve,g as ye,h as be,x as xe}from"./_chat-DDScEBKF.js";var Z=e(t(),1),Q=n(),Se=class extends Error{status;constructor(e){super(`Screenshot capture failed (${e}). Try again.`),this.status=e}};async function Ce(e,t){let n=e.platform===`ios`?`serve-sim`:`serve-emu`,r=ue(`${e.access.httpBase}/vendor/${n}/api/screenshot?device=${encodeURIComponent(e.deviceId)}`,e.access),i=await fetch(r,{method:`POST`,credentials:e.access.credentials?`include`:`omit`,signal:AbortSignal.any([t,AbortSignal.timeout(2e4)])});if(!i.ok)throw new Se(i.status);let a=await i.blob();if(!a.size)throw Error(`The device returned an empty screenshot. Try again.`);return a}var $=e(r(),1);function we(e){let t=(0,Q.c)(71),{view:n,handle:r,controls:o}=e,c=o.detail?.settings,_=!r?.inputConnected,y=e.hostKind===`local`||e.hostKind===`ssh`,w=c?.appearance===`dark`?`light`:`dark`,T;t[0]===r?T=t[1]:(T=()=>r?.pressButton(`home`),t[0]=r,t[1]=T);let O;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(d,{}),t[2]=O):O=t[2];let P;t[3]!==_||t[4]!==T?(P=(0,$.jsx)(De,{tooltipSide:`left`,label:`Home`,disabled:_,onClick:T,children:O}),t[3]=_,t[4]=T,t[5]=P):P=t[5];let F;t[6]!==o||t[7]!==r||t[8]!==_||t[9]!==e.platform||t[10]!==y||t[11]!==n.keyboard?.attached?(F=e.platform===`android`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(De,{tooltipSide:`left`,label:`Back`,disabled:_,onClick:()=>r?.pressButton(`back`),children:(0,$.jsx)(S,{})}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Recents`,disabled:_,onClick:()=>r?.pressButton(`recents`),children:(0,$.jsx)(i,{})}),y?(0,$.jsxs)(m,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Rotate device`,disabled:o.disabled}),children:(0,$.jsx)(h,{})}),(0,$.jsxs)(E,{side:`left`,children:[(0,$.jsx)(k,{onClick:()=>void o.act({type:`setOrientation`,value:`portrait`}),children:`Portrait`}),(0,$.jsx)(k,{onClick:()=>void o.act({type:`setOrientation`,value:`landscape_left`}),children:`Landscape`})]})]}):null]}):(0,$.jsx)(De,{tooltipSide:`left`,label:`Rotate device`,disabled:_||!!n.keyboard?.attached,onClick:()=>r?.rotate(),children:(0,$.jsx)(h,{})}),t[6]=o,t[7]=r,t[8]=_,t[9]=e.platform,t[10]=y,t[11]=n.keyboard?.attached,t[12]=F):F=t[12];let I;t[13]!==o||t[14]!==w||t[15]!==e.onTools||t[16]!==e.toolsOpen||t[17]!==y||t[18]!==c?.appearance||t[19]!==c?.textSize?(I=y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Switch device to ${w} mode`,disabled:o.disabled||!c?.appearance,onClick:()=>void o.act({type:`setAppearance`,value:w}),children:(0,$.jsx)(N,{icon:c?.appearance===`dark`?te:ee})}),(0,$.jsxs)(m,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`Device text size`,title:`Device text size`,disabled:o.disabled||!c?.textSize}),children:(0,$.jsx)(s,{})}),(0,$.jsx)(E,{side:`left`,className:`min-w-40`,children:(0,$.jsx)(x,{value:c?.textSize??``,onValueChange:e=>{(e===`small`||e==="default"||e===`large`||e===`extra-large`)&&o.act({type:`setTextSize`,value:e})},children:[[`small`,`Small`],[`default`,`Default`],[`large`,`Large`],[`extra-large`,`Extra large`]].map(Te)})})]}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Device tools`,pressed:e.toolsOpen,onClick:e.onTools,children:(0,$.jsx)(A,{})})]}):null,t[13]=o,t[14]=w,t[15]=e.onTools,t[16]=e.toolsOpen,t[17]=y,t[18]=c?.appearance,t[19]=c?.textSize,t[20]=I):I=t[20];let ne=e.screenshotPending?`Capturing screenshot`:`Save screenshot`,L=!n.streaming||e.screenshotPending,re;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(l,{}),t[21]=re):re=t[21];let R;t[22]!==e.onScreenshot||t[23]!==ne||t[24]!==L?(R=(0,$.jsx)(De,{tooltipSide:`left`,label:ne,disabled:L,onClick:e.onScreenshot,children:re}),t[22]=e.onScreenshot,t[23]=ne,t[24]=L,t[25]=R):R=t[25];let z;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(b,{render:(0,$.jsx)(C,{size:`icon-sm`,variant:`ghost`,"aria-label":`More device actions`,title:`More device actions`}),children:(0,$.jsx)(a,{})}),t[26]=z):z=t[26];let ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(u,{}),t[27]=ie):ie=t[27];let ae;t[28]===e.onFloat?ae=t[29]:(ae=(0,$.jsxs)(k,{onClick:e.onFloat,children:[ie,`Float device over chat`]}),t[28]=e.onFloat,t[29]=ae);let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(g,{}),t[30]=B):B=t[30];let V;t[31]===e.onClose?V=t[32]:(V=(0,$.jsxs)(k,{onClick:e.onClose,children:[B,`Close device panel`]}),t[31]=e.onClose,t[32]=V);let H;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(D,{}),t[33]=H):H=t[33];let oe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(p,{}),t[34]=oe):oe=t[34];let se;t[35]===e.onPowerOff?se=t[36]:(se=(0,$.jsxs)(k,{variant:`destructive`,onClick:e.onPowerOff,children:[oe,`Power off device`]}),t[35]=e.onPowerOff,t[36]=se);let U;t[37]!==ae||t[38]!==V||t[39]!==se?(U=(0,$.jsxs)(m,{children:[z,(0,$.jsxs)(E,{side:`left`,align:`end`,children:[ae,V,H,se]})]}),t[37]=ae,t[38]=V,t[39]=se,t[40]=U):U=t[40];let ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Ee,{}),t[41]=ce):ce=t[41];let W=!n.streaming||!!n.phoneUnavailableReason,G=n.phoneUnavailableReason??void 0,le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(M,{}),t[42]=le):le=t[42];let K;t[43]!==W||t[44]!==G||t[45]!==n.phone||t[46]!==n.showPhone?(K=(0,$.jsx)(De,{tooltipSide:`left`,label:`3D view`,pressed:n.phone,disabled:W,description:G,onClick:n.showPhone,children:le}),t[43]=W,t[44]=G,t[45]=n.phone,t[46]=n.showPhone,t[47]=K):K=t[47];let ue=!n.phone,de=!n.streaming,fe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(j,{}),t[48]=fe):fe=t[48];let q;t[49]!==ue||t[50]!==de||t[51]!==n.showFlat?(q=(0,$.jsx)(De,{tooltipSide:`left`,label:`Flat view`,pressed:ue,disabled:de,onClick:n.showFlat,children:fe}),t[49]=ue,t[50]=de,t[51]=n.showFlat,t[52]=q):q=t[52];let J;t[53]===n.keyboard?J=t[54]:(J=n.keyboard?(0,$.jsx)(De,{tooltipSide:`left`,label:n.keyboard.attached?`Detach Magic Keyboard`:`Attach Magic Keyboard`,pressed:n.keyboard.attached,onClick:n.keyboard.toggle,children:(0,$.jsx)(f,{})}):null,t[53]=n.keyboard,t[54]=J);let Y;t[55]!==n.phone||t[56]!==n.resetView?(Y=n.phone?(0,$.jsx)(De,{tooltipSide:`left`,label:`Restore 3D view`,onClick:n.resetView,children:(0,$.jsx)(v,{})}):null,t[55]=n.phone,t[56]=n.resetView,t[57]=Y):Y=t[57];let X;t[58]!==U||t[59]!==P||t[60]!==K||t[61]!==q||t[62]!==J||t[63]!==Y||t[64]!==F||t[65]!==I||t[66]!==R?(X=(0,$.jsxs)(`div`,{className:`pointer-events-auto flex shrink-0 flex-col items-center gap-1 overflow-y-auto rounded-full border border-border/50 bg-background/80 p-2 shadow-sm [scrollbar-width:none]`,children:[P,F,I,R,U,ce,K,q,J,Y]}),t[58]=U,t[59]=P,t[60]=K,t[61]=q,t[62]=J,t[63]=Y,t[64]=F,t[65]=I,t[66]=R,t[67]=X):X=t[67];let pe;return t[68]!==X||t[69]!==n.foldingControls?(pe=(0,$.jsxs)(`aside`,{"aria-label":`Device controls`,"data-layout":`rail`,className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex w-14 flex-col items-center gap-2 overflow-y-auto [justify-content:safe_center] py-3 pr-2 [scrollbar-width:none]`,children:[X,n.foldingControls]}),t[68]=X,t[69]=n.foldingControls,t[70]=pe):pe=t[70],pe}function Te(e){let[t,n]=e;return(0,$.jsx)(_,{value:t,children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`flex-1`,children:n}),(0,$.jsx)(w,{})]})},t)}function Ee(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`my-1 h-px w-5 shrink-0 bg-border/70`}),e[0]=t):t=e[0],t}function De(e){let t=(0,Q.c)(18),n=e.pressed?`secondary`:`ghost`,r;t[0]!==e.children||t[1]!==e.disabled||t[2]!==e.label||t[3]!==e.onClick||t[4]!==e.pressed||t[5]!==n?(r=(0,$.jsx)(C,{size:`icon-sm`,variant:n,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled,onClick:e.onClick,children:e.children}),t[0]=e.children,t[1]=e.disabled,t[2]=e.label,t[3]=e.onClick,t[4]=e.pressed,t[5]=n,t[6]=r):r=t[6];let i=r,a;t[7]!==i||t[8]!==e.description||t[9]!==e.disabled||t[10]!==e.label?(a=e.disabled&&e.description?(0,$.jsx)(B,{render:(0,$.jsx)(`span`,{className:`inline-flex`,tabIndex:0,role:`group`,"aria-label":e.label}),children:i}):(0,$.jsx)(B,{render:i}),t[7]=i,t[8]=e.description,t[9]=e.disabled,t[10]=e.label,t[11]=a):a=t[11];let o=e.description??e.label,s;t[12]!==e.tooltipSide||t[13]!==o?(s=(0,$.jsx)(V,{side:e.tooltipSide,children:o}),t[12]=e.tooltipSide,t[13]=o,t[14]=s):s=t[14];let c;return t[15]!==a||t[16]!==s?(c=(0,$.jsxs)(H,{children:[a,s]}),t[15]=a,t[16]=s,t[17]=c):c=t[17],c}var Oe=[{value:`small`,label:`Small`},{value:`default`,label:`Default`},{value:`large`,label:`Large`},{value:`extra-large`,label:`Extra large`}],ke=[{value:`none`,label:`None`},{value:`grayscale`,label:`Grayscale`},{value:`red-green`,label:`Red / green (protanopia)`},{value:`green-red`,label:`Green / red (deuteranopia)`},{value:`blue-yellow`,label:`Blue / yellow (tritanopia)`}],Ae=[{value:`portrait`,label:`Portrait`},{value:`landscape_left`,label:`Landscape left`},{value:`portrait_upside_down`,label:`Upside down`},{value:`landscape_right`,label:`Landscape right`}],je=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`reminders`,label:`Reminders`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Motion`},{value:`media-library`,label:`Media library`},{value:`faceid`,label:`Face ID`}],Me=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Physical activity`}],Ne=[{label:`San Francisco`,latitude:37.7749,longitude:-122.4194},{label:`New York`,latitude:40.7128,longitude:-74.006},{label:`London`,latitude:51.5074,longitude:-.1278},{label:`Stockholm`,latitude:59.3293,longitude:18.0686},{label:`Tokyo`,latitude:35.6762,longitude:139.6503}];function Pe(e){let t=(0,Q.c)(129),{device:n,controls:r}=e,{detail:i,pending:a,error:o,foregroundApp:s,disabled:c,act:l}=r,u=i?.settings,d=n.platform===`ios`,f;t[0]===e.className?f=t[1]:(f=O(`flex min-h-0 flex-col border-border bg-background text-sm`,e.className),t[0]=e.className,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`font-medium`,children:`Tools`}),t[2]=p):p=t[2];let m;t[3]===a?m=t[4]:(m=a?(0,$.jsx)(re,{size:`sm`}):null,t[3]=a,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(g,{}),t[5]=h):h=t[5];let _;t[6]===e.onClose?_=t[7]:(_=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Close tools`,className:`ml-auto`,onClick:e.onClose,children:h}),t[6]=e.onClose,t[7]=_);let v;t[8]!==m||t[9]!==_?(v=(0,$.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-3`,children:[p,m,_]}),t[8]=m,t[9]=_,t[10]=v):v=t[10];let y;t[11]===o?y=t[12]:(y=o?(0,$.jsx)(`p`,{className:`border-b bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:o}):null,t[11]=o,t[12]=y);let b;t[13]!==i||t[14]!==o?(b=i===null&&!o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(re,{size:`sm`}),` Reading device settings…`]}):null,t[13]=i,t[14]=o,t[15]=b):b=t[15];let x;t[16]===e.hostDiagnostics?x=t[17]:(x=e.hostDiagnostics?(0,$.jsx)(Fe,{title:`Host diagnostics`,children:(0,$.jsx)(`p`,{className:`whitespace-pre-line text-xs text-muted-foreground`,children:e.hostDiagnostics})}):null,t[16]=e.hostDiagnostics,t[17]=x);let S=s?.id??`—`,w;t[18]===S?w=t[19]:(w=(0,$.jsx)(Ie,{label:`Foreground`,children:(0,$.jsx)(`span`,{className:`truncate font-mono text-xs`,children:S})}),t[18]=S,t[19]=w);let T;t[20]!==l||t[21]!==c||t[22]!==s?(T=s?(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`terminateApp`,appId:s.id}),children:`Terminate`}),(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`launchApp`,appId:s.id}),children:`Relaunch`})]}):null,t[20]=l,t[21]=c,t[22]=s,t[23]=T):T=t[23];let E;t[24]===l?E=t[25]:(E=e=>l({type:`openUrl`,url:e}),t[24]=l,t[25]=E);let D;t[26]!==c||t[27]!==E?(D=(0,$.jsx)(Be,{placeholder:`https://… or myapp://`,action:`Open`,disabled:c,onSubmit:E}),t[26]=c,t[27]=E,t[28]=D):D=t[28];let k=d?`Bundle ID to launch`:`Package name to launch`,A;t[29]===l?A=t[30]:(A=e=>l({type:`launchApp`,appId:e}),t[29]=l,t[30]=A);let j;t[31]!==c||t[32]!==k||t[33]!==A?(j=(0,$.jsx)(Be,{placeholder:k,action:`Launch`,disabled:c,onSubmit:A}),t[31]=c,t[32]=k,t[33]=A,t[34]=j):j=t[34];let M;t[35]!==w||t[36]!==T||t[37]!==D||t[38]!==j?(M=(0,$.jsxs)(Fe,{title:`App`,children:[w,T,D,j]}),t[35]=w,t[36]=T,t[37]=D,t[38]=j,t[39]=M):M=t[39];let ee=d?`Simulator`:`Emulator`,te;t[40]===u?te=t[41]:(te=u?.appearance?[u.appearance]:[],t[40]=u,t[41]=te);let N;t[42]===l?N=t[43]:(N=e=>{let t=e[0];(t===`light`||t===`dark`)&&l({type:`setAppearance`,value:t})},t[42]=l,t[43]=N);let P,F;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(se,{value:`light`,children:`Light`}),F=(0,$.jsx)(se,{value:`dark`,children:`Dark`}),t[44]=P,t[45]=F):(P=t[44],F=t[45]);let I;t[46]!==c||t[47]!==te||t[48]!==N?(I=(0,$.jsx)(Ie,{label:`Appearance`,children:(0,$.jsxs)(oe,{"aria-label":`Appearance`,value:te,disabled:c,onValueChange:N,children:[P,F]})}),t[46]=c,t[47]=te,t[48]=N,t[49]=I):I=t[49];let ne=u?.textSize??null,L;t[50]===l?L=t[51]:(L=e=>l({type:`setTextSize`,value:e}),t[50]=l,t[51]=L);let R;t[52]!==c||t[53]!==ne||t[54]!==L?(R=(0,$.jsx)(Ie,{label:`Text size`,children:(0,$.jsx)(Re,{ariaLabel:`Text size`,value:ne,options:Oe,disabled:c,onChange:L})}),t[52]=c,t[53]=ne,t[54]=L,t[55]=R):R=t[55];let z;t[56]!==l||t[57]!==c||t[58]!==d||t[59]!==u?(z=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ie,{label:`Liquid Glass`,children:(0,$.jsxs)(oe,{"aria-label":`Liquid Glass`,value:u?.liquidGlass?[u.liquidGlass]:[],disabled:c||u?.liquidGlass===void 0,onValueChange:e=>{let t=e[0];(t===`clear`||t===`tinted`)&&l({type:`setLiquidGlass`,value:t})},children:[(0,$.jsx)(se,{value:`clear`,children:`Clear`}),(0,$.jsx)(se,{value:`tinted`,children:`Tinted`})]})}),(0,$.jsx)(Ie,{label:`Color filter`,children:(0,$.jsx)(Re,{ariaLabel:`Color filter`,value:u?.colorFilter??null,options:ke,disabled:c,onChange:e=>l({type:`setColorFilter`,value:e})})})]}):(0,$.jsx)(Ie,{label:`Orientation`,children:(0,$.jsx)(Re,{ariaLabel:`Orientation`,value:null,placeholder:`Rotate to…`,options:Ae,disabled:c,onChange:e=>l({type:`setOrientation`,value:e})})}),t[56]=l,t[57]=c,t[58]=d,t[59]=u,t[60]=z):z=t[60];let ie=u?.reduceMotion,ae;t[61]===l?ae=t[62]:(ae=e=>l({type:`setToggle`,setting:`reduceMotion`,value:e}),t[61]=l,t[62]=ae);let B;t[63]!==c||t[64]!==ie||t[65]!==ae?(B=(0,$.jsx)(Le,{label:`Reduce Motion`,checked:ie,disabled:c,onChange:ae}),t[63]=c,t[64]=ie,t[65]=ae,t[66]=B):B=t[66];let V;t[67]!==l||t[68]!==c||t[69]!==d||t[70]!==u?.increaseContrast||t[71]!==u?.networkEnabled||t[72]!==u?.reduceTransparency||t[73]!==u?.showBorders||t[74]!==u?.voiceOver?(V=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{label:`Increase Contrast`,checked:u?.increaseContrast,disabled:c,onChange:e=>l({type:`setToggle`,setting:`increaseContrast`,value:e})}),(0,$.jsx)(Le,{label:`Reduce Transparency`,checked:u?.reduceTransparency,disabled:c,onChange:e=>l({type:`setToggle`,setting:`reduceTransparency`,value:e})}),(0,$.jsx)(Le,{label:`Show Borders`,checked:u?.showBorders,disabled:c,onChange:e=>l({type:`setToggle`,setting:`showBorders`,value:e})}),(0,$.jsx)(Le,{label:`VoiceOver`,checked:u?.voiceOver,disabled:c,onChange:e=>l({type:`setToggle`,setting:`voiceOver`,value:e})})]}):(0,$.jsx)(Le,{label:`Network`,checked:u?.networkEnabled,disabled:c,onChange:e=>l({type:`setToggle`,setting:`networkEnabled`,value:e})}),t[67]=l,t[68]=c,t[69]=d,t[70]=u?.increaseContrast,t[71]=u?.networkEnabled,t[72]=u?.reduceTransparency,t[73]=u?.showBorders,t[74]=u?.voiceOver,t[75]=V):V=t[75];let H;t[76]!==ee||t[77]!==I||t[78]!==R||t[79]!==z||t[80]!==B||t[81]!==V?(H=(0,$.jsxs)(Fe,{title:ee,children:[I,R,z,B,V]}),t[76]=ee,t[77]=I,t[78]=R,t[79]=z,t[80]=B,t[81]=V,t[82]=H):H=t[82];let U=e.access===null,ce;t[83]===e?ce=t[84]:(ce=t=>(e.onAxOverlayChange(t),Promise.resolve()),t[83]=e,t[84]=ce);let W;t[85]!==e.axOverlay||t[86]!==U||t[87]!==ce?(W=(0,$.jsx)(Fe,{title:`Accessibility`,children:(0,$.jsx)(Le,{label:`Overlay element frames`,checked:e.axOverlay,disabled:U,onChange:ce})}),t[85]=e.axOverlay,t[86]=U,t[87]=ce,t[88]=W):W=t[88];let G,le;t[89]===l?(G=t[90],le=t[91]):(G=(e,t)=>l({type:`setLocation`,latitude:e,longitude:t}),le=()=>l({type:`clearLocation`}),t[89]=l,t[90]=G,t[91]=le);let K;t[92]!==c||t[93]!==d||t[94]!==G||t[95]!==le?(K=(0,$.jsx)(Ve,{disabled:c,canClear:d,onSet:G,onClear:le}),t[92]=c,t[93]=d,t[94]=G,t[95]=le,t[96]=K):K=t[96];let ue=d?je:Me,de=s?.id??``,fe;t[97]===l?fe=t[98]:(fe=(e,t,n)=>l({type:`setPermission`,appId:e,permission:t,decision:n}),t[97]=l,t[98]=fe);let q;t[99]!==c||t[100]!==d||t[101]!==ue||t[102]!==de||t[103]!==fe?(q=(0,$.jsx)(Ue,{permissions:ue,canReset:d,defaultAppId:de,disabled:c,onDecide:fe}),t[99]=c,t[100]=d,t[101]=ue,t[102]=de,t[103]=fe,t[104]=q):q=t[104];let J;t[105]!==l||t[106]!==c||t[107]!==s||t[108]!==d?(J=d?(0,$.jsxs)(Fe,{title:`Push notification`,children:[(0,$.jsx)(Be,{placeholder:`Alert text`,action:`Send`,disabled:c||!s,onSubmit:e=>s?l({type:`sendPush`,appId:s.id,payload:e}):Promise.resolve(!1)}),s?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open an app first.`})]}):null,t[105]=l,t[106]=c,t[107]=s,t[108]=d,t[109]=J):J=t[109];let Y;t[110]!==n||t[111]!==d||t[112]!==e.access?(Y=d&&e.access?(0,$.jsx)(Ge,{access:e.access,device:n}):null,t[110]=n,t[111]=d,t[112]=e.access,t[113]=Y):Y=t[113];let X;t[114]!==M||t[115]!==H||t[116]!==W||t[117]!==K||t[118]!==q||t[119]!==J||t[120]!==Y||t[121]!==y||t[122]!==b||t[123]!==x?(X=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[y,b,x,M,H,W,K,q,J,Y]}),t[114]=M,t[115]=H,t[116]=W,t[117]=K,t[118]=q,t[119]=J,t[120]=Y,t[121]=y,t[122]=b,t[123]=x,t[124]=X):X=t[124];let pe;return t[125]!==f||t[126]!==X||t[127]!==v?(pe=(0,$.jsxs)(`div`,{className:f,children:[v,X]}),t[125]=f,t[126]=X,t[127]=v,t[128]=pe):pe=t[128],pe}function Fe(e){let t=(0,Q.c)(5),n;t[0]===e.title?n=t[1]:(n=(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:e.title}),t[0]=e.title,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2 border-b px-3 py-2.5 last:border-b-0`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ie(e){let t=(0,Q.c)(7),n;t[0]===e.label?n=t[1]:(n=(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.label}),t[0]=e.label,t[1]=n);let r;t[2]===e.children?r=t[3]:(r=(0,$.jsx)(`div`,{className:`flex min-w-0 items-center justify-end`,children:e.children}),t[2]=e.children,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Le(e){let t=(0,Q.c)(10),n=e.checked??!1,r=e.disabled||e.checked===void 0,i;t[0]===e?i=t[1]:(i=t=>void e.onChange(t),t[0]=e,t[1]=i);let a;t[2]!==e.label||t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,$.jsx)(he,{size:`sm`,"aria-label":e.label,checked:n,disabled:r,onCheckedChange:i}),t[2]=e.label,t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==e.label||t[8]!==a?(o=(0,$.jsx)(Ie,{label:e.label,children:a}),t[7]=e.label,t[8]=a,t[9]=o):o=t[9],o}function Re(e){let t=(0,Q.c)(25),n;if(t[0]!==e.options||t[1]!==e.value){let r;t[3]===e.value?r=t[4]:(r=t=>t.value===e.value,t[3]=e.value,t[4]=r),n=e.options.find(r),t[0]=e.options,t[1]=e.value,t[2]=n}else n=t[2];let r=n,i=e.value,a=e.disabled,o;t[5]===e?o=t[6]:(o=t=>{t!==null&&t!==e.value&&e.onChange(t)},t[5]=e,t[6]=o);let s;t[7]!==r||t[8]!==e.placeholder?(s=r?r.label:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.placeholder??`Unknown`}),t[7]=r,t[8]=e.placeholder,t[9]=s):s=t[9];let c;t[10]===s?c=t[11]:(c=(0,$.jsx)(F,{children:s}),t[10]=s,t[11]=c);let l;t[12]!==e.ariaLabel||t[13]!==c?(l=(0,$.jsx)(ne,{size:`xs`,className:`w-40`,"aria-label":e.ariaLabel,children:c}),t[12]=e.ariaLabel,t[13]=c,t[14]=l):l=t[14];let u;t[15]===e.options?u=t[16]:(u=e.options.map(ze),t[15]=e.options,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,$.jsx)(I,{align:`end`,alignItemWithTrigger:!1,children:u}),t[17]=u,t[18]=d);let f;return t[19]!==e.disabled||t[20]!==e.value||t[21]!==o||t[22]!==l||t[23]!==d?(f=(0,$.jsxs)(L,{value:i,disabled:a,onValueChange:o,children:[l,d]}),t[19]=e.disabled,t[20]=e.value,t[21]=o,t[22]=l,t[23]=d,t[24]=f):f=t[24],f}function ze(e){return(0,$.jsx)(P,{value:e.value,children:e.label},e.value)}function Be(e){let t=(0,Q.c)(20),[n,r]=(0,Z.useState)(``),i;t[0]!==e||t[1]!==n?(i=()=>{let t=n.trim();t&&e.onSubmit(t).then(e=>{e&&r(``)})},t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a?o=t[4]:(o=e=>{e.preventDefault(),a()},t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>r(e.target.value),t[5]=s):s=t[5];let c;t[6]!==e.disabled||t[7]!==e.placeholder||t[8]!==n?(c=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:e.placeholder,value:n,disabled:e.disabled,onChange:s}),t[6]=e.disabled,t[7]=e.placeholder,t[8]=n,t[9]=c):c=t[9];let l;t[10]!==e.disabled||t[11]!==n?(l=e.disabled||n.trim().length===0,t[10]=e.disabled,t[11]=n,t[12]=l):l=t[12];let u;t[13]!==e.action||t[14]!==l?(u=(0,$.jsx)(C,{type:`submit`,size:`xs`,variant:`outline`,disabled:l,children:e.action}),t[13]=e.action,t[14]=l,t[15]=u):u=t[15];let d;return t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,$.jsxs)(`form`,{className:`flex gap-1.5`,onSubmit:o,children:[c,u]}),t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function Ve(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),o=Number(n),s=Number(i),c,l;t[0]!==n||t[1]!==i||t[2]!==o||t[3]!==s?(c={latitude:o,longitude:s},l=n.trim()!==``&&i.trim()!==``&&Math.abs(c.latitude)<=90&&Math.abs(c.longitude)<=180,t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l):(c=t[4],l=t[5]);let u=l,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==e.disabled?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Latitude`,inputMode:`decimal`,value:n,disabled:e.disabled,onChange:d}),t[7]=n,t[8]=e.disabled,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==e.disabled?(m=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Longitude`,inputMode:`decimal`,value:i,disabled:e.disabled,onChange:p}),t[11]=i,t[12]=e.disabled,t[13]=m):m=t[13];let h;t[14]!==f||t[15]!==m?(h=(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16];let g;t[17]===e?g=t[18]:(g=t=>{let n=Ne.find(e=>e.label===t);n&&(r(String(n.latitude)),a(String(n.longitude)),e.onSet(n.latitude,n.longitude))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(ne,{size:`xs`,className:`w-32`,"aria-label":`Location preset`,children:(0,$.jsx)(F,{children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Preset…`})})}),t[19]=_):_=t[19];let v;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(I,{align:`start`,alignItemWithTrigger:!1,children:Ne.map(He)}),t[20]=v):v=t[20];let y;t[21]!==e.disabled||t[22]!==g?(y=(0,$.jsxs)(L,{value:null,disabled:e.disabled,onValueChange:g,children:[_,v]}),t[21]=e.disabled,t[22]=g,t[23]=y):y=t[23];let b=e.disabled||!u,x;t[24]!==c.latitude||t[25]!==c.longitude||t[26]!==e?(x=()=>void e.onSet(c.latitude,c.longitude),t[24]=c.latitude,t[25]=c.longitude,t[26]=e,t[27]=x):x=t[27];let S;t[28]!==b||t[29]!==x?(S=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:b,onClick:x,children:`Set`}),t[28]=b,t[29]=x,t[30]=S):S=t[30];let w;t[31]===e?w=t[32]:(w=e.canClear?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled,onClick:()=>{r(``),a(``),e.onClear()},children:`Clear`}):null,t[31]=e,t[32]=w);let T;t[33]!==y||t[34]!==S||t[35]!==w?(T=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[y,S,w]}),t[33]=y,t[34]=S,t[35]=w,t[36]=T):T=t[36];let E;return t[37]!==T||t[38]!==h?(E=(0,$.jsxs)(Fe,{title:`Location`,children:[h,T]}),t[37]=T,t[38]=h,t[39]=E):E=t[39],E}function He(e){return(0,$.jsx)(P,{value:e.label,children:e.label},e.label)}function Ue(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(`camera`),o;t[0]!==n||t[1]!==e.defaultAppId?(o=n.trim()||e.defaultAppId,t[0]=n,t[1]=e.defaultAppId,t[2]=o):o=t[2];let s=o,c;t[3]!==i||t[4]!==e||t[5]!==s?(c=t=>void e.onDecide(s,i,t),t[3]=i,t[4]=e,t[5]=s,t[6]=c):c=t[6];let l=c,u=e.defaultAppId||`App ID`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==e.disabled||t[10]!==u?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,placeholder:u,value:n,disabled:e.disabled,onChange:d}),t[8]=n,t[9]=e.disabled,t[10]=u,t[11]=f):f=t[11];let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(a(e),Promise.resolve()),t[12]=p):p=t[12];let m;t[13]!==i||t[14]!==e.disabled||t[15]!==e.permissions?(m=(0,$.jsx)(Re,{ariaLabel:`Permission`,value:i,options:e.permissions,disabled:e.disabled,onChange:p}),t[13]=i,t[14]=e.disabled,t[15]=e.permissions,t[16]=m):m=t[16];let h=e.disabled||!s,g;t[17]===l?g=t[18]:(g=()=>l(`grant`),t[17]=l,t[18]=g);let _;t[19]!==h||t[20]!==g?(_=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:h,onClick:g,children:`Grant`}),t[19]=h,t[20]=g,t[21]=_):_=t[21];let v=e.disabled||!s,y;t[22]===l?y=t[23]:(y=()=>l(`revoke`),t[22]=l,t[23]=y);let b;t[24]!==v||t[25]!==y?(b=(0,$.jsx)(C,{size:`xs`,variant:`outline`,disabled:v,onClick:y,children:`Revoke`}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==l||t[28]!==e.canReset||t[29]!==e.disabled||t[30]!==s?(x=e.canReset?(0,$.jsx)(C,{size:`xs`,variant:`ghost`,disabled:e.disabled||!s,onClick:()=>l(`reset`),children:`Reset`}):null,t[27]=l,t[28]=e.canReset,t[29]=e.disabled,t[30]=s,t[31]=x):x=t[31];let S;t[32]!==b||t[33]!==x||t[34]!==m||t[35]!==_?(S=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[m,_,b,x]}),t[32]=b,t[33]=x,t[34]=m,t[35]=_,t[36]=S):S=t[36];let w;return t[37]!==S||t[38]!==f?(w=(0,$.jsxs)(Fe,{title:`Permissions`,children:[f,S]}),t[37]=S,t[38]=f,t[39]=w):w=t[39],w}var We=100;function Ge(e){let t=(0,Q.c)(19),[n,r]=(0,Z.useState)(!1),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Z.useState)(i),s,l;t[1]!==n||t[2]!==e.access||t[3]!==e.device.id||t[4]!==e.device.platform?(s=()=>{if(!n)return;let t=ye({access:e.access,platform:e.device.platform,deviceId:e.device.id},(e,t)=>{o(n=>{let r=t?[...e]:[...n,...e];return r.length>We?r.slice(-100):r})});return()=>{t(),o([])}},l=[n,e.access,e.device.id,e.device.platform],t[1]=n,t[2]=e.access,t[3]=e.device.id,t[4]=e.device.platform,t[5]=s,t[6]=l):(s=t[5],l=t[6]),(0,Z.useEffect)(s,l);let u=n&&`rotate-180`,d;t[7]===u?d=t[8]:(d=O(`ml-auto size-3.5 transition-transform`,u),t[7]=u,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,$.jsxs)(ge,{className:`flex w-full items-center gap-1.5 border-b px-3 py-2.5 text-left text-xs font-medium text-muted-foreground`,children:[`Event log`,(0,$.jsx)(c,{className:d})]}),t[9]=d,t[10]=f);let p;t[11]===a?p=t[12]:(p=a.length===0?(0,$.jsx)(`li`,{className:`text-muted-foreground`,children:`No events yet.`}):a.map(Ke),t[11]=a,t[12]=p);let m;t[13]===p?m=t[14]:(m=(0,$.jsx)(pe,{children:(0,$.jsx)(`ol`,{className:`max-h-64 overflow-y-auto px-3 py-2 font-mono text-2xs leading-relaxed`,children:p})}),t[13]=p,t[14]=m);let h;return t[15]!==n||t[16]!==f||t[17]!==m?(h=(0,$.jsxs)(_e,{open:n,onOpenChange:r,children:[f,m]}),t[15]=n,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}function Ke(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.timestamp.slice(11,19)}),(0,$.jsx)(`span`,{className:`truncate`,children:e.summary})]},e.id)}function qe(e){let t=(0,Q.c)(30),{environmentId:n,device:r,access:i,visible:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=z(K.detail,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[1]=c):c=t[1];let l=z(K.action,c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(0),b=(0,Z.useRef)(null),x;t[2]!==r.hostId||t[3]!==r.id?(x={hostId:r.hostId,deviceId:r.id},t[2]=r.hostId,t[3]=r.id,t[4]=x):x=t[4];let S=x,C,w;t[5]!==n||t[6]!==s||t[7]!==S||t[8]!==a?(C=()=>{let e=y.current+=1;if(!a)return;let t={environmentId:n,input:S};return b.current=t,s(t).then(t=>{y.current===e&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause))))}),()=>{b.current=null,y.current+=1}},w=[n,s,S,a],t[5]=n,t[6]=s,t[7]=S,t[8]=a,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,Z.useEffect)(C,w);let T,E;t[11]!==i||t[12]!==r.id||t[13]!==r.platform||t[14]!==a?(T=()=>{if(!i||!a)return;let e=!0,t=ve({access:i,platform:r.platform,deviceId:r.id},t=>{e&&_(t)});return()=>{e=!1,t(),_(void 0)}},E=[i,r.id,r.platform,a],t[11]=i,t[12]=r.id,t[13]=r.platform,t[14]=a,t[15]=T,t[16]=E):(T=t[15],E=t[16]),(0,Z.useEffect)(T,E);let D=u!==null&&a,O;t[17]!==D||t[18]!==n||t[19]!==s||t[20]!==l||t[21]!==S?(O=async e=>{if(v.current||!D)return!1;v.current=!0;let t=y.current+=1;return p(!0),h(null),l({environmentId:n,input:{...S,...e}}).then(e=>{if(y.current!==t){let t=b.current;if(!t)return e._tag===`Success`;let n=y.current+=1;return s(t).then(t=>(y.current===n&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause)))),e._tag===`Success`))}return e._tag===`Success`?d(e.value):h(R(e.cause)),e._tag===`Success`}).finally(()=>{v.current=!1,p(!1)})},t[17]=D,t[18]=n,t[19]=s,t[20]=l,t[21]=S,t[22]=O):O=t[22];let k=O,A=f||!u||!a,j=g===void 0?u?.foregroundApp??null:g,M;return t[23]!==k||t[24]!==u||t[25]!==m||t[26]!==f||t[27]!==A||t[28]!==j?(M={detail:u,pending:f,error:m,act:k,disabled:A,foregroundApp:j},t[23]=k,t[24]=u,t[25]=m,t[26]=f,t[27]=A,t[28]=j,t[29]=M):M=t[29],M}function Je(e){let t=(0,Q.c)(53),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(null),p=(0,Z.useRef)(null),m=le(e.environmentId,e.device.hostId),h=e.hostKind===`local`||e.hostKind===`ssh`,g=e.visible&&h,_;t[0]!==m||t[1]!==e||t[2]!==g?(_={...e,access:m,visible:g},t[0]=m,t[1]=e,t[2]=g,t[3]=_):_=t[3];let v=qe(_),y,b;t[4]!==m||t[5]!==e.visible?(y=()=>(m&&e.visible||f.current?.abort(),()=>{f.current?.abort(),p.current&&URL.revokeObjectURL(p.current),p.current=null}),b=[m,e.visible],t[4]=m,t[5]=e.visible,t[6]=y,t[7]=b):(y=t[6],b=t[7]),(0,Z.useEffect)(y,b);let x;t[8]!==m||t[9]!==e.device.id||t[10]!==e.device.name||t[11]!==e.device.platform||t[12]!==e.environmentId||t[13]!==e.visible?(x=()=>{if(!m||f.current||!e.visible)return;let t=new AbortController;return f.current=t,l(!0),d(null),Ce({access:m,platform:e.device.platform,deviceId:e.device.id},t.signal).then(n=>{if(t.signal.aborted)return;p.current&&URL.revokeObjectURL(p.current);let r=URL.createObjectURL(n);p.current=r;let i=document.createElement(`a`);i.href=r,i.download=`${e.device.name.replace(/[^a-z0-9-]/gi,`-`)}-${Date.now()}.png`,document.body.append(i),i.click(),i.remove()}).catch(n=>{t.signal.aborted||(n instanceof Se&&n.status===401&&G(e.environmentId),d(n instanceof Error?n.message:`Screenshot capture failed. Try again.`))}).finally(()=>{f.current===t&&(f.current=null,l(!1))})},t[8]=m,t[9]=e.device.id,t[10]=e.device.name,t[11]=e.device.platform,t[12]=e.environmentId,t[13]=e.visible,t[14]=x):x=t[14];let S=x,C;t[15]!==v||t[16]!==u||t[17]!==i?(C=u||v.error&&!i?(0,$.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:u??v.error}):null,t[15]=v,t[16]=u,t[17]=i,t[18]=C):C=t[18];let w=`${e.hostLabel} · ${e.device.version}`,T;t[19]!==v||t[20]!==n||t[21]!==e.device.platform||t[22]!==e.hostKind||t[23]!==e.onClose||t[24]!==e.onFloat||t[25]!==e.onPowerOff||t[26]!==S||t[27]!==c||t[28]!==i?(T=t=>(0,$.jsx)(we,{platform:e.device.platform,hostKind:e.hostKind,handle:n,view:t,controls:v,screenshotPending:c,onScreenshot:()=>void S(),toolsOpen:i,onTools:()=>a(!i),onFloat:e.onFloat,onClose:e.onClose,onPowerOff:e.onPowerOff}),t[19]=v,t[20]=n,t[21]=e.device.platform,t[22]=e.hostKind,t[23]=e.onClose,t[24]=e.onFloat,t[25]=e.onPowerOff,t[26]=S,t[27]=c,t[28]=i,t[29]=T):T=t[29];let E;t[30]!==o||t[31]!==e.device.hostId||t[32]!==e.device.id||t[33]!==e.device.name||t[34]!==e.device.platform||t[35]!==e.environmentId||t[36]!==e.visible||t[37]!==w||t[38]!==T?(E=(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(be,{environmentId:e.environmentId,platform:e.device.platform,deviceName:e.device.name,deviceDescription:w,deviceId:e.device.id,hostId:e.device.hostId,visible:e.visible,axOverlay:o,allowPhoneView:!0,onHandle:r,renderControls:T})}),t[30]=o,t[31]=e.device.hostId,t[32]=e.device.id,t[33]=e.device.name,t[34]=e.device.platform,t[35]=e.environmentId,t[36]=e.visible,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==C||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[C,E]}),t[40]=C,t[41]=E,t[42]=D):D=t[42];let O;t[43]!==m||t[44]!==o||t[45]!==v||t[46]!==e.device||t[47]!==e.hostDiagnostics||t[48]!==i?(O=i?(0,$.jsx)(Pe,{device:e.device,controls:v,hostDiagnostics:e.hostDiagnostics,access:m,axOverlay:o,onAxOverlayChange:s,onClose:()=>a(!1),className:`absolute inset-y-0 right-0 z-10 w-full max-w-72 border-l shadow-lg @[700px]:static @[700px]:w-72 @[700px]:shrink-0 @[700px]:shadow-none`}):null,t[43]=m,t[44]=o,t[45]=v,t[46]=e.device,t[47]=e.hostDiagnostics,t[48]=i,t[49]=O):O=t[49];let k;return t[50]!==O||t[51]!==D?(k=(0,$.jsxs)($.Fragment,{children:[D,O]}),t[50]=O,t[51]=D,t[52]=k):k=t[52],k}var Ye=e=>e===`ios`?`iOS Simulators`:`Android Emulators`,Xe=e=>`${e.hostId}\u0000${e.id}`;function Ze(e){let t=(0,Q.c)(87),{environmentId:n,threadId:r}=e.threadRef,{state:i,loaded:a,error:o,refresh:s}=W(n),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=z(K.list,c),u=z(K.open),d=z(K.close),f=`${n}\u0000${r}`,[p,m]=(0,Z.useState)(null),h=p?.scope===f?p.pending:null,g=p?.scope===f?p.error:null,_;t[1]===h?_=t[2]:(_=h?Xe(h):null,t[1]=h,t[2]=_);let v=_,b=i.hostStatus===`disabled`,x,S;t[3]!==n||t[4]!==b||t[5]!==l||t[6]!==a||t[7]!==e.visible?(x=()=>{e.visible&&a&&!b&&l({environmentId:n,input:{}})},S=[n,l,a,e.visible,b],t[3]=n,t[4]=b,t[5]=l,t[6]=a,t[7]=e.visible,t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Z.useEffect)(x,S);let w;if(t[10]!==e.surface.target||t[11]!==i.sessions||t[12]!==r){let n;t[14]===r?n=t[15]:(n=e=>e.threadId===r,t[14]=r,t[15]=n);let a=i.sessions.filter(n);w=e.surface.target?a.find(t=>t.deviceId===e.surface.target?.deviceId&&t.hostId===e.surface.target.hostId):void 0,t[10]=e.surface.target,t[11]=i.sessions,t[12]=r,t[13]=w}else w=t[13];let E=w,D,k,A,M,ee,te,N;if(t[16]!==E||t[17]!==d||t[18]!==n||t[19]!==b||t[20]!==l||t[21]!==a||t[22]!==u||t[23]!==g||t[24]!==h||t[25]!==v||t[26]!==e||t[27]!==s||t[28]!==f||t[29]!==i||t[30]!==o||t[31]!==r){k=Symbol.for(`react.early_return_sentinel`);bb0:{let c=E?i.devices.find(e=>e.hostId===E.hostId&&e.id===E.deviceId):void 0,p=at(i),_;t[39]===f?_=t[40]:(_=e=>{let t={scope:f,pending:e,error:null};return m(t),e=>m(n=>n===t?{...t,pending:null,error:e}:n)},t[39]=f,t[40]=_);let x=_,S;t[41]!==n||t[42]!==u||t[43]!==e.threadRef||t[44]!==x||t[45]!==i.devices||t[46]!==r?(S=async t=>{let a=i.devices.find(e=>Xe(e)===t);if(!a)return;let o=x(a),s=await u({environmentId:n,input:{threadId:r,hostId:a.hostId,deviceId:a.id,platform:a.platform}});s._tag===`Failure`?o(R(s.cause)):(ie.getState().openDevice(e.threadRef,{hostId:s.value.hostId,deviceId:s.value.deviceId,platform:a.platform,name:a.name}),o(null))},t[41]=n,t[42]=u,t[43]=e.threadRef,t[44]=x,t[45]=i.devices,t[46]=r,t[47]=S):S=t[47];let w=S,P=()=>{c&&(Y.getState().open(e.threadRef,{kind:`device`,hostId:c.hostId,deviceId:c.id,platform:c.platform,name:c.name}),ie.getState().close(e.threadRef))},F;t[48]!==E||t[49]!==d||t[50]!==n||t[51]!==e.surface.id||t[52]!==e.threadRef||t[53]!==x||t[54]!==r?(F=t=>{if(!t){ie.getState().closeSurface(e.threadRef,e.surface.id);return}if(!E)return;let i=x(null);d({environmentId:n,input:{threadId:r,hostId:E.hostId,deviceId:E.deviceId,shutdown:t}}).then(t=>{t._tag===`Failure`?i(R(t.cause)):ie.getState().closeSurface(e.threadRef,e.surface.id)})},t[48]=E,t[49]=d,t[50]=n,t[51]=e.surface.id,t[52]=e.threadRef,t[53]=x,t[54]=r,t[55]=F):F=t[55];let I=F,ne=i.bootingDevices?.filter(e=>e.threadId===r)??[],{ready:L,busy:z}=q(i),B=!c&&(h!==null||z||!a),V=a?null:o,H;t[56]!==i.hostStatus||t[57]!==i.hostStatusDetail||t[58]!==i.hostStatuses?(H=e=>{let t=i.hostStatuses[e.id],n=t?.detail??(e.kind===`local`?i.hostStatusDetail:void 0);return n&&(t?.status??i.hostStatus)===`ready`?[{hostId:e.id,label:e.label,detail:n}]:[]},t[56]=i.hostStatus,t[57]=i.hostStatusDetail,t[58]=i.hostStatuses,t[59]=H):H=t[59];let oe=i.hosts.flatMap(H),se=i.hosts.flatMap(tt);if(a&&(!i.onboardingCompleted||b)){let r;t[60]===e?r=t[61]:(r=t=>{t||e.onDismissSetup()},t[60]=e,t[61]=r);let a;t[62]!==n||t[63]!==i?(a=(0,$.jsx)(me,{children:(0,$.jsx)(fe,{environmentId:n,state:i})}),t[62]=n,t[63]=i,t[64]=a):a=t[64];let o;t[65]!==e.visible||t[66]!==r||t[67]!==a?(o=(0,$.jsx)(ce,{open:e.visible,onOpenChange:r,children:a}),t[65]=e.visible,t[66]=r,t[67]=a,t[68]=o):o=t[68],k=o;break bb0}D=ae,N=e.mode,ee=`relative flex min-h-0 flex-1 flex-col`;let U;t[69]===n?U=t[70]:(U=e=>(0,$.jsx)(it,{label:e.label,detail:e.detail},`${n}\u0000${e.hostId}\u0000${e.detail}`),t[69]=n,t[70]=U);let W;t[71]!==n||t[72]!==i?(W=(0,$.jsx)(J,{state:i,environmentId:n}),t[71]=n,t[72]=i,t[73]=W):W=t[73];let G;t[74]===g?G=t[75]:(G=g?(0,$.jsx)(rt,{tone:`error`,onDismiss:()=>m(null),children:g}):null,t[74]=g,t[75]=G),te=(0,$.jsxs)(`div`,{className:O(`shrink-0 bg-background`,B&&`absolute inset-x-0 top-0 z-10 max-h-[40%] overflow-y-auto`),children:[(0,$.jsx)(`div`,{hidden:!!c,children:oe.map(U)}),W,ne.length>0?(0,$.jsxs)(`div`,{role:`status`,className:`border-b px-3 py-2 text-xs text-muted-foreground`,children:[`Starting `,ne.map(et).join(`, `),`… This can take a minute.`]}):null,G]}),A=`@container relative flex min-h-0 flex-1`,M=c&&E?(0,$.jsx)(Je,{environmentId:n,device:c,hostLabel:i.hosts.find(e=>e.id===c.hostId)?.label??`Device host`,hostKind:i.hosts.find(e=>e.id===c.hostId)?.kind,hostDiagnostics:oe.find(e=>{let{hostId:t}=e;return t===c.hostId})?.detail,visible:e.visible,onFloat:P,onClose:()=>I(!1),onPowerOff:()=>I(!0)},`${n}\u0000${Xe(c)}`):B?(0,$.jsx)(xe,{name:h?.name??`Devices`,description:h?`${i.hosts.find(e=>e.id===h.hostId)?.label??`Device host`} · ${h.version}`:``,stage:`opening`,message:V??(h?h.booted?`Opening device…`:`Starting device…`:i.hostStatus===`installing`?i.hostStatusDetail??`Installing device support…`:`Finding devices…`),error:V!==null,children:V===null?null:(0,$.jsx)(C,{size:`sm`,variant:`outline`,onClick:s,children:`Retry`})}):(0,$.jsx)(`div`,{className:`scrollbar-gutter-both flex size-full flex-col overflow-y-auto px-5 py-8 text-sm text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:O(`mx-auto flex w-full max-w-xl flex-col gap-6`,p.length===0&&`my-auto items-center text-center`),children:[p.length===0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{className:`size-6 opacity-60`}),(0,$.jsx)(`p`,{className:`max-h-32 w-full max-w-sm overflow-y-auto whitespace-pre-line break-words`,tabIndex:i.hostStatus===`failed`?0:void 0,children:i.hostStatus===`failed`?i.hostStatusDetail??`The device hub failed to start.`:`No simulators or emulators were found on this environment.`})]}):null,L&&p.length>0?(0,$.jsx)(`div`,{className:`w-full space-y-6 text-left`,children:p.map(e=>(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(j,{className:`size-4 shrink-0`}),(0,$.jsx)(`h3`,{className:`font-medium`,children:Ye(e.platform)})]}),(0,$.jsx)(X,{children:e.devices.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-3`,children:[(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md border border-border/60`,children:(0,$.jsx)(j,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:`${i.hosts.find(t=>t.id===e.hostId)?.label} · ${e.version} · ${e.booted?`Running`:`Stopped`}`})]}),(0,$.jsxs)(C,{variant:`outline`,size:`sm`,disabled:v!==null,"aria-label":`${e.booted?`Open`:`Start`} ${e.name}`,onClick:()=>void w(Xe(e)),children:[v===Xe(e)?(0,$.jsx)(re,{size:`xs`}):e.booted?(0,$.jsx)(y,{}):(0,$.jsx)(T,{}),e.booted?`Open`:`Start`]})]},Xe(e)))})]},e.platform))}):null,L&&!de(i)&&!i.devices.some($e)&&!se.some(Qe)?(0,$.jsx)(`p`,{className:`max-w-sm text-xs`,children:`No Android virtual devices found. Create one in Android Studio's Device Manager, then refresh.`}):null,a&&!z?(0,$.jsx)(C,{className:p.length>0?`self-start`:`self-center`,variant:`outline`,size:`sm`,onClick:()=>void l({environmentId:n,input:{}}),children:`Refresh devices`}):null]})})}t[16]=E,t[17]=d,t[18]=n,t[19]=b,t[20]=l,t[21]=a,t[22]=u,t[23]=g,t[24]=h,t[25]=v,t[26]=e,t[27]=s,t[28]=f,t[29]=i,t[30]=o,t[31]=r,t[32]=D,t[33]=k,t[34]=A,t[35]=M,t[36]=ee,t[37]=te,t[38]=N}else D=t[32],k=t[33],A=t[34],M=t[35],ee=t[36],te=t[37],N=t[38];if(k!==Symbol.for(`react.early_return_sentinel`))return k;let P;t[76]!==A||t[77]!==M?(P=(0,$.jsx)(`div`,{className:A,children:M}),t[76]=A,t[77]=M,t[78]=P):P=t[78];let F;t[79]!==P||t[80]!==ee||t[81]!==te?(F=(0,$.jsxs)(`div`,{className:ee,children:[te,P]}),t[79]=P,t[80]=ee,t[81]=te,t[82]=F):F=t[82];let I;return t[83]!==D||t[84]!==F||t[85]!==N?(I=(0,$.jsx)(D,{mode:N,children:F}),t[83]=D,t[84]=F,t[85]=N,t[86]=I):I=t[86],I}function Qe(e){return e.platform===`android`}function $e(e){return e.platform===`android`}function et(e){return e.name}function tt(e){return e.platforms.filter(nt).map(t=>({...t,hostId:e.id,hostLabel:e.label}))}function nt(e){return!e.available}function rt(e){let t=(0,Q.c)(13),n=e.tone===`warning`?`bg-warning-surface text-warning-foreground`:`bg-destructive/5 text-destructive`,r;t[0]===n?r=t[1]:(r=O(`flex items-start gap-2 border-b px-3 py-2 text-xs`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(o,{className:`mt-1 size-3.5 shrink-0`}),t[2]=i):i=t[2];let a;t[3]===e.children?a=t[4]:(a=(0,$.jsx)(`div`,{className:`max-h-32 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,tabIndex:0,children:e.children}),t[3]=e.children,t[4]=a);let s=e.tone===`warning`?`Dismiss device warning`:`Dismiss device error`,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(g,{}),t[5]=c):c=t[5];let l;t[6]!==e.onDismiss||t[7]!==s?(l=(0,$.jsx)(C,{size:`icon-xs`,variant:`ghost`,"aria-label":s,onClick:e.onDismiss,children:c}),t[6]=e.onDismiss,t[7]=s,t[8]=l):l=t[8];let u;return t[9]!==r||t[10]!==a||t[11]!==l?(u=(0,$.jsxs)(`div`,{role:`alert`,className:r,children:[i,a,l]}),t[9]=r,t[10]=a,t[11]=l,t[12]=u):u=t[12],u}function it(e){let t=(0,Q.c)(6),[n,r]=(0,Z.useState)(!1);if(n)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>r(!0),t[0]=i):i=t[0];let a;t[1]===e.label?a=t[2]:(a=(0,$.jsxs)(`p`,{className:`font-medium`,children:[`Device discovery warning · `,e.label]}),t[1]=e.label,t[2]=a);let o;return t[3]!==e.detail||t[4]!==a?(o=(0,$.jsxs)(rt,{tone:`warning`,onDismiss:i,children:[a,e.detail]}),t[3]=e.detail,t[4]=a,t[5]=o):o=t[5],o}function at(e){let t=[];for(let n of[`ios`,`android`]){let r=e.devices.filter(e=>e.platform===n).toSorted((e,t)=>Number(t.booted)-Number(e.booted)||e.name.localeCompare(t.name));r.length>0&&t.push({platform:n,devices:r})}return t}export{Ze as DevicePanel};
|
|
2
|
+
//# sourceMappingURL=DevicePanel-MMC7u5qJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Dl as i,mr as a,t as o}from"./utils-DkKLB01I.js";import{Ma as s}from"./src-R7EkrVcv.js";import{f as c,u as l,y as u}from"./TooltipProvider-DiV5KdTq.js";import{t as d}from"./spinner-C-qDE4WQ.js";import{i as f,n as p}from"./session-Dt_Dt-Og.js";import{t as m}from"./use-atom-command-QDd_NqJQ.js";import{n as h}from"./dialog-5OaxRXCC.js";import{t as g}from"./device-B_zaE4OU.js";import{Eo as _,Mo as v,Oo as y,To as ee,wo as b}from"./main-xeaL6Ue7.js";var x=n(),S=e(t(),1),C=e(r(),1);function w(e){let t=(0,x.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,S.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,C.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,C.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,C.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,C.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,C.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var T=e=>e===`ios`?`iOS`:`Android`,E=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,D=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,O=e=>Object.values(e.hostStatuses).some(e=>e.status===`ready`&&e.androidDiscoveryIncomplete);function k(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function A(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&O(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${T(t)} support was not detected.`};if(i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`).length>0&&!n)return{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let a=i.every(e=>e.kind!==`local`)?i[0]:void 0,o=a?` on ${a.label}`:``;return{ready:!0,message:a?.kind===`eas`?`${a.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${o}.`:`The Android SDK and Emulator are available${o}.`}}function j(e){let t=(0,x.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,S.useState)(null),[d,T]=(0,S.useState)(0),O=e.state.hostStatus!==`disabled`,A;t[1]===e.state?A=t[2]:(A=k(e.state),t[1]=e.state,t[2]=A);let{ready:j,busy:M}=A,F;t[3]===e.state.hosts?F=t[4]:(F=e.state.hosts.some(te),t[3]=e.state.hosts,t[4]=F);let I=F,L,R;t[5]!==O||t[6]!==c||t[7]!==e.environmentId?(L=()=>{O&&c({environmentId:e.environmentId,input:{}})},R=[O,c,e.environmentId],t[5]=O,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,S.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==M||t[15]!==l||t[16]!==d?(H=e=>M||l!==null||e>d,t[14]=M,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,C.jsx)(ee,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,C.jsx)(y,{steps:V,currentStep:d,onStepChange:T,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,C.jsx)(w,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==M||t[25]!==n||t[26]!==O||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,C.jsx)(v,{checked:O,disabled:!n||M||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,C.jsx)(N,{state:e.state,pending:l===`hub`||M&&l!==`agent`})]}):null,t[24]=M,t[25]=n,t[26]=O,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==M||t[33]!==O||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&O&&I?(0,C.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,C.jsx)(ne,{state:e.state,checking:l===`check`,disabled:!O||M||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=M,t[33]=O,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==M||t[42]!==n||t[43]!==O||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,C.jsx)(v,{checked:e.state.agentAccessEnabled,disabled:!n||!O||M||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,C.jsx)(P,{state:e.state,pending:l===`agent`}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=M,t[42]=n,t[43]=O,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,C.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,C.jsxs)(_,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==M||t[59]!==l||t[60]!==d?(X=d===0?(0,C.jsx)(h,{render:(0,C.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,C.jsx)(a,{variant:`outline`,disabled:M||l!==null,onClick:()=>T(d-1),children:`Back`}),t[58]=M,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==j||t[65]!==d||t[66]!==B?(Z=d<2?(0,C.jsx)(a,{disabled:!j||l!==null,onClick:()=>T(d+1),children:`Continue`}):(0,C.jsx)(a,{disabled:!n||!j||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=j,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,C.jsxs)(b,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,C.jsxs)(C.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function te(e){return e.kind===`local`&&!e.platforms.some(M)}function M(e){return e.available}function N(e){let t=(0,x.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!k(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,C.jsx)(d,{size:`xs`}):(0,C.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function ne(e){let t=(0,x.c)(20),n;t[0]===e.state?n=t[1]:(n=A(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,C.jsx)(I,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=A(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,C.jsx)(I,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,C.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,C.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function P(e){let t=(0,x.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,C.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&k(e.state).ready&&e.state.hosts.some(F)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,C.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function F(e){return e.agentDeviceInstalled}function I(e){let t=(0,x.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,C.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,C.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,C.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,C.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{D as a,O as c,I as i,A as l,N as n,E as o,j as r,k as s,P as t,w as u};
|
|
2
|
-
//# sourceMappingURL=DeviceSetup-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Dl as i,mr as a,t as o}from"./utils-DkKLB01I.js";import{Ma as s}from"./src-R7EkrVcv.js";import{f as c,u as l,y as u}from"./TooltipProvider-DiV5KdTq.js";import{t as d}from"./spinner-C-qDE4WQ.js";import{i as f,n as p}from"./session-CFzb2gMH.js";import{t as m}from"./use-atom-command-Bd7vZxeH.js";import{n as h}from"./dialog-5OaxRXCC.js";import{t as g}from"./device-P8L_QiVD.js";import{Eo as _,Mo as v,Oo as y,To as ee,wo as b}from"./main-BYwnnJ9E.js";var x=n(),S=e(t(),1),C=e(r(),1);function w(e){let t=(0,x.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,S.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,C.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,C.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,C.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,C.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,C.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var T=e=>e===`ios`?`iOS`:`Android`,E=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,D=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,O=e=>Object.values(e.hostStatuses).some(e=>e.status===`ready`&&e.androidDiscoveryIncomplete);function k(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function A(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&O(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${T(t)} support was not detected.`};if(i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`).length>0&&!n)return{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let a=i.every(e=>e.kind!==`local`)?i[0]:void 0,o=a?` on ${a.label}`:``;return{ready:!0,message:a?.kind===`eas`?`${a.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${o}.`:`The Android SDK and Emulator are available${o}.`}}function j(e){let t=(0,x.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,S.useState)(null),[d,T]=(0,S.useState)(0),O=e.state.hostStatus!==`disabled`,A;t[1]===e.state?A=t[2]:(A=k(e.state),t[1]=e.state,t[2]=A);let{ready:j,busy:M}=A,F;t[3]===e.state.hosts?F=t[4]:(F=e.state.hosts.some(te),t[3]=e.state.hosts,t[4]=F);let I=F,L,R;t[5]!==O||t[6]!==c||t[7]!==e.environmentId?(L=()=>{O&&c({environmentId:e.environmentId,input:{}})},R=[O,c,e.environmentId],t[5]=O,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,S.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==M||t[15]!==l||t[16]!==d?(H=e=>M||l!==null||e>d,t[14]=M,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,C.jsx)(ee,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,C.jsx)(y,{steps:V,currentStep:d,onStepChange:T,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,C.jsx)(w,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==M||t[25]!==n||t[26]!==O||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,C.jsx)(v,{checked:O,disabled:!n||M||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,C.jsx)(N,{state:e.state,pending:l===`hub`||M&&l!==`agent`})]}):null,t[24]=M,t[25]=n,t[26]=O,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==M||t[33]!==O||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&O&&I?(0,C.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,C.jsx)(ne,{state:e.state,checking:l===`check`,disabled:!O||M||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=M,t[33]=O,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==M||t[42]!==n||t[43]!==O||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,C.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,C.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,C.jsx)(`p`,{className:`text-muted-foreground`,children:D}),(0,C.jsx)(v,{checked:e.state.agentAccessEnabled,disabled:!n||!O||M||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,C.jsx)(P,{state:e.state,pending:l===`agent`}),(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=M,t[42]=n,t[43]=O,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,C.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,C.jsxs)(_,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==M||t[59]!==l||t[60]!==d?(X=d===0?(0,C.jsx)(h,{render:(0,C.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,C.jsx)(a,{variant:`outline`,disabled:M||l!==null,onClick:()=>T(d-1),children:`Back`}),t[58]=M,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==j||t[65]!==d||t[66]!==B?(Z=d<2?(0,C.jsx)(a,{disabled:!j||l!==null,onClick:()=>T(d+1),children:`Continue`}):(0,C.jsx)(a,{disabled:!n||!j||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=j,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,C.jsxs)(b,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,C.jsxs)(C.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function te(e){return e.kind===`local`&&!e.platforms.some(M)}function M(e){return e.available}function N(e){let t=(0,x.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!k(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,C.jsx)(d,{size:`xs`}):(0,C.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function ne(e){let t=(0,x.c)(20),n;t[0]===e.state?n=t[1]:(n=A(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,C.jsx)(I,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=A(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,C.jsx)(I,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,C.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,C.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,C.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function P(e){let t=(0,x.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,C.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&k(e.state).ready&&e.state.hosts.some(F)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,C.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,C.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function F(e){return e.agentDeviceInstalled}function I(e){let t=(0,x.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,C.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,C.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,C.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,C.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{D as a,O as c,I as i,A as l,N as n,E as o,j as r,k as s,P as t,w as u};
|
|
2
|
+
//# sourceMappingURL=DeviceSetup-BCrBVLkf.js.map
|