ryco-cli 0.1.16 → 0.1.18
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/{AcpNativeLogging-OhEq3XNp.cjs → AcpNativeLogging-CUpW8y6E.cjs} +1 -1
- package/dist/{AcpNativeLogging-qZgtIa5K.mjs → AcpNativeLogging-hu4rXzHU.mjs} +1 -1
- package/dist/{AzureDevOpsSourceControlProvider-B0YsaJyI.mjs → AzureDevOpsSourceControlProvider-C7Ff-COJ.mjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-Dyu8KQ_S.cjs → AzureDevOpsSourceControlProvider-DAdboLpu.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-3VHGKSl1.cjs → BitbucketSourceControlProvider-Bg6lSYm8.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-B8IPx2Ad.mjs → BitbucketSourceControlProvider-CMPQXie7.mjs} +2 -2
- package/dist/{ClaudeDriver-CBCy0_WX.cjs → ClaudeDriver-CILJj4bi.cjs} +2 -2
- package/dist/{ClaudeDriver-DsW8yDj9.mjs → ClaudeDriver-Nc7gDoUZ.mjs} +2 -2
- package/dist/{CodexDriver-3TZPgrGk.cjs → CodexDriver-CdE1fyKF.cjs} +3 -3
- package/dist/{CodexDriver-DLwPz5sk.mjs → CodexDriver-OeWoP24r.mjs} +3 -3
- package/dist/{CodexTextGeneration-DLHSW4Mz.cjs → CodexTextGeneration-BJvCqVzm.cjs} +1 -1
- package/dist/{CodexTextGeneration-D1vV8grr.mjs → CodexTextGeneration-CKacDpkR.mjs} +1 -1
- package/dist/{CopilotDriver-C7a8IhyK.cjs → CopilotDriver-5toln6vu.cjs} +3 -3
- package/dist/{CopilotDriver-DXvGBv-s.mjs → CopilotDriver-C6IkwOg5.mjs} +3 -3
- package/dist/{CursorDriver-CeB_vMKJ.mjs → CursorDriver-BPyhSbOl.mjs} +3 -3
- package/dist/{CursorDriver-uNsDetA3.cjs → CursorDriver-otlL4axb.cjs} +3 -3
- package/dist/{ForgejoSourceControlProvider-Ds0rU_PN.mjs → ForgejoSourceControlProvider-Df0EwCPV.mjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-CJLksvL_.cjs → ForgejoSourceControlProvider-SZj0DxRM.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-CrYNFu8S.cjs → GitHubSourceControlProvider-D9v0HrDd.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-C7CJAslU.mjs → GitHubSourceControlProvider-G07yjZJS.mjs} +2 -2
- package/dist/{GitLabSourceControlProvider-jbX5M34A.cjs → GitLabSourceControlProvider-BTXml3Wh.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-u-Y-e8PV.mjs → GitLabSourceControlProvider-D7NhCVP9.mjs} +2 -2
- package/dist/{GrokDriver-BJ00ZiYg.cjs → GrokDriver-BkU6D5ZE.cjs} +3 -3
- package/dist/{GrokDriver-CFgjwnvE.mjs → GrokDriver-VxcAlypB.mjs} +3 -3
- package/dist/{OpenCodeDriver-BTxd2Q3Q.cjs → OpenCodeDriver-CXvTVYvY.cjs} +2 -2
- package/dist/{OpenCodeDriver-DNApoGdu.mjs → OpenCodeDriver-fQlgTeuI.mjs} +2 -2
- package/dist/{SourceControlProviderDiscoveryCatalog-CPO3a9_U.cjs → SourceControlProviderDiscoveryCatalog-CR-cmnC-.cjs} +1 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-hXWNwRMn.mjs → SourceControlProviderDiscoveryCatalog-dqetZQiC.mjs} +1 -1
- package/dist/bin.cjs +16 -14
- package/dist/bin.mjs +16 -14
- package/dist/client/assets/{AccountSettings-CkFq28pN.js → AccountSettings-C3YGn5s7.js} +1 -1
- package/dist/client/assets/AiFocusSettings-CNucfJ5Y.js +1 -0
- package/dist/client/assets/{AnimatedHeight-BC-qaTJY.js → AnimatedHeight-B8ZeY3LL.js} +1 -1
- package/dist/client/assets/{AppearanceSettings-B6UaU-_a.js → AppearanceSettings-D1MyfaES.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-6LRTxcuo.js → BranchToolbar.logic-CN2-yLTE.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-BSNsAFtv.js → ChatRightPanel-DhZiZCcx.js} +6 -6
- package/dist/client/assets/{ChatThreadRouteView-Daox0F74.js → ChatThreadRouteView-CR8HQgm3.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-ChB99Jee.js +1 -0
- package/dist/client/assets/{CompositeItem-97y1QiiT.js → CompositeItem-CxRCTsWt.js} +1 -1
- package/dist/client/assets/{CompositeRoot-C7Mz4Y_2.js → CompositeRoot-CDscEk_b.js} +1 -1
- package/dist/client/assets/{ConnectionsSettings-DFBNmvfL.js → ConnectionsSettings-Dsewo1mI.js} +2 -2
- package/dist/client/assets/{DiagnosticsSettings-DhuLK993.js → DiagnosticsSettings-ClUk2Ycp.js} +1 -1
- package/dist/client/assets/{DialogHandle-Cl9dQBJp.js → DialogHandle-BGW2rJq8.js} +1 -1
- package/dist/client/assets/{DialogPopup-a1M74u16.js → DialogPopup-9zEMlOyz.js} +1 -1
- package/dist/client/assets/DialogRoot-Z8JWsDCS.js +1 -0
- package/dist/client/assets/{DialogTitle-Bk-w3xLJ.js → DialogTitle-7dK2BQ85.js} +1 -1
- package/dist/client/assets/{DialogTrigger-D9nkMFu2.js → DialogTrigger-B7jdDPNa.js} +1 -1
- package/dist/client/assets/{DialogViewport-tgJz2Lwn.js → DialogViewport-BrRcGV_l.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-BmVyawpM.js → DraftChatThreadRouteView-C7HNQzJO.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-Bn1HigS9.js → ExternalIdentityWeb.logic-DS77EplU.js} +1 -1
- package/dist/client/assets/{GlassSurface-CDok2tTN.js → GlassSurface--5lIEJCy.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-BvHq5iCa.js → HostedConnectionControls-5f2EOB5t.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-CB5TRXg5.js → HostedHubRoot-tRaAruhb.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-Cb5WJuEG.js → HostedNativeAuthorizationRoute-B4SBCUZq.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-DFcgMZlL.js → HostedRelayTrustNotice-D7TIN2KZ.js} +1 -1
- package/dist/client/assets/{Icons-BEtED8P8.js → Icons-CqMTQkuR.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-BIy-rKDv.js → IntegrationsSettingsPanel-Be0RMI3X.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-u3yB7Cob.js → KeybindingsSettings-BxoOXbJf.js} +1 -1
- package/dist/client/assets/{McpServersSettings-V32mLD4v.js → McpServersSettings-D6wFULhe.js} +1 -1
- package/dist/client/assets/{MobileSheet-BDvnUC5W.js → MobileSheet-fqwVmSQY.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-B64WGjQj.js → NewWorktreeDialog-DljDMikm.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-C0MwHtMx.js → NoActiveThreadState-DvLgUR0A.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-CWlThhfV.js → NodeSecuritySettings-BYX0uV1b.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-CVzfv5nP.js → OpinionatedPluginsSettings-ZOQ0n5GP.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-CylfsDBD.js → PhoneGetAppInterstitial-DzlPIIW0.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-BA4R225F.js → PhoneGetAppInterstitialBackdrop-C_j-OVwR.js} +1 -1
- package/dist/client/assets/{PhoneHome-DBwwEeaI.js → PhoneHome-BIYOn5P7.js} +1 -1
- package/dist/client/assets/PhoneSettingsSurface-CL26SDJP.js +1 -0
- package/dist/client/assets/{ProjectFavicon-BjXJxNbQ.js → ProjectFavicon-BLFEmLYd.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-BTFj53Qv.js → ProviderModelPicker-CWALhPw5.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-CywRitn3.js → ProviderUpdateLaunchNotification.logic-DcLWligu.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-IhzMeM1F.js → ProvidersSettingsPanel-tIQSB1Ni.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-BuWSWty8.js → RedactedSensitiveText-DnYWrxD2.js} +1 -1
- package/dist/client/assets/RootAppShell-BVqIVDWT.js +6 -0
- package/dist/client/assets/{RycoLetterMark-CZYntY8t.js → RycoLetterMark-C1QHVbKN.js} +1 -1
- package/dist/client/assets/SettingsDialog-TY6l7DuD.js +1 -0
- package/dist/client/assets/SettingsPanels-_-BazuGl.js +3 -0
- package/dist/client/assets/{SettingsPanels.editor-lbLEbllb.js → SettingsPanels.editor-Bl_mOgB-.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-5w4N9XII.js → SourceControlSettings-CwRuv7T6.js} +1 -1
- package/dist/client/assets/{StatisticsPage-jRyjIh52.js → StatisticsPage-DAvOIX_d.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-CV5eFeO_.js → StatisticsPanel-BfmqkZgK.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-B7SZerf3.js → StatisticsSettingsLink-J-iBGP5I.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-C40TYVEC.js → ThreadStatusIndicators-BzpZG_IZ.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-flv5ZDel.js → ThreadTerminalDrawer-DZy0S10m.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-B-cBAWFz.js → ThreadWorkspacePanel-PRfBFuHE.js} +1 -1
- package/dist/client/assets/{ToolbarRootContext-B1g8IP6k.js → ToolbarRootContext-C48gkU4j.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-0DE4S4n0.js → WorkItemsTab-EO7aDVI8.js} +4 -4
- package/dist/client/assets/{alert-DomE7dAt.js → alert-C24pxxYz.js} +1 -1
- package/dist/client/assets/{alert-dialog-9Jyh0e8u.js → alert-dialog-iYnjheVe.js} +1 -1
- package/dist/client/assets/archive-BL1hojl3.js +1 -0
- package/dist/client/assets/authorization-BNZY2k8w.js +1 -0
- package/dist/client/assets/{badge-w43sx8eF.js → badge-tHmsB3yQ.js} +1 -1
- package/dist/client/assets/{branding-Ck4g7yv3.js → branding-hWmEaQ8d.js} +1 -1
- package/dist/client/assets/{button-DG8WqjNn.js → button-WR80VgkK.js} +1 -1
- package/dist/client/assets/{capabilities-xa5Ll0KT.js → capabilities-CXhsftU9.js} +1 -1
- package/dist/client/assets/{chatThreadActions-BZvyhfKr.js → chatThreadActions-C6tNI5Qi.js} +1 -1
- package/dist/client/assets/{collapsible-EhAEe5S9.js → collapsible-BUn1kona.js} +1 -1
- package/dist/client/assets/{command-Cyn6yIEa.js → command-CfaBUmS3.js} +1 -1
- package/dist/client/assets/composerDraftStore-DXTD6mKH.js +11 -0
- package/dist/client/assets/{data-list-DTdqWMGN.js → data-list-jNXWZwx3.js} +1 -1
- package/dist/client/assets/desktopUpdateAtoms-C6z0AhGE.js +1 -0
- package/dist/client/assets/{desktopWorkspace-hOxsGVFz.js → desktopWorkspace-BFTBEpzF.js} +1 -1
- package/dist/client/assets/{device-DIfzlguu.js → device-DB8v-PV8.js} +1 -1
- package/dist/client/assets/{dialog-BNmFD6Nh.js → dialog-CwRtKu2U.js} +1 -1
- package/dist/client/assets/{draft-input-dP7F8odz.js → draft-input-BHjWDHqU.js} +1 -1
- package/dist/client/assets/editorPreferences-BqfWlBPx.js +1 -0
- package/dist/client/assets/{empty-Ccxhyvdf.js → empty-CITbdlFs.js} +1 -1
- package/dist/client/assets/{env-Bcq9YR3B.js → env-Bcy-9P3V.js} +1 -1
- package/dist/client/assets/{getPseudoElementBounds-CO5HJT7x.js → getPseudoElementBounds-BPmVta2g.js} +1 -1
- package/dist/client/assets/{group-CzdKmc45.js → group-BpXcg5Ba.js} +1 -1
- package/dist/client/assets/{index-Dp3JRlOK.js → index-CnRziuz2.js} +2 -2
- package/dist/client/assets/{input-BZz4eLRl.js → input-Ba4jS4Ks.js} +1 -1
- package/dist/client/assets/{kbd-DbvN3zTb.js → kbd-BvgpGZEI.js} +1 -1
- package/dist/client/assets/{keybindings-BPE3eEAM.js → keybindings-QVMzXI5S.js} +1 -1
- package/dist/client/assets/{label-DZf4lbNF.js → label-2jpS7gCY.js} +1 -1
- package/dist/client/assets/{lib-DgOYoged.js → lib-CuR3OHWo.js} +1 -1
- package/dist/client/assets/{logging-81iP6Hps.js → logging-CTOc5ONT.js} +1 -1
- package/dist/client/assets/{main-B6n7O_N3.js → main-C5za36qj.js} +2 -2
- package/dist/client/assets/main-CgLLEwXi.css +2 -0
- package/dist/client/assets/{menu-B6UEFcn0.js → menu-CsEBcjDz.js} +1 -1
- package/dist/client/assets/{popover-BuYzXGwl.js → popover-BpnQc7ji.js} +1 -1
- package/dist/client/assets/primary-DiL6nRV-.js +2 -0
- package/dist/client/assets/{projectPaths-D8b4yLOe.js → projectPaths-DDcwkag5.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-sBwZhQoN.js → providerDriverMeta-DrgHrvO3.js} +1 -1
- package/dist/client/assets/{providerIconUtils-Cq0fezxt.js → providerIconUtils-VIm6bh4U.js} +1 -1
- package/dist/client/assets/providerInstances-pNPE7SuA.js +1 -0
- package/dist/client/assets/providerModels-pNPE7SuA.js +1 -0
- package/dist/client/assets/{qr-code-Ie92aZvE.js → qr-code-CXu67ChC.js} +1 -1
- package/dist/client/assets/{radio-group-BuuTEtdC.js → radio-group-B7kMeg_h.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-0FA0k4xp.js → resolveAriaLabelledBy-DoGkVnyF.js} +1 -1
- package/dist/client/assets/{rightPanelRouteSearch-BS8CkNS6.js → rightPanelRouteSearch-YV6CEBkv.js} +1 -1
- package/dist/client/assets/runtime-Cy36EhFa.js +1 -0
- package/dist/client/assets/{scroll-area-C0yF015F.js → scroll-area-BZayohht.js} +1 -1
- package/dist/client/assets/{scrollEdges-DI5Y3mtR.js → scrollEdges-BObY5qgX.js} +1 -1
- package/dist/client/assets/{select-CZukJlTn.js → select-DQIoKiCF.js} +1 -1
- package/dist/client/assets/{separator-D4ckGtPe.js → separator-DgV5UvWO.js} +1 -1
- package/dist/client/assets/{session-logic-BuGYhZKZ.js → session-logic-yjrYZ67x.js} +2 -2
- package/dist/client/assets/{settingsDialogStore-LxRFC5hh.js → settingsDialogStore-CzH3-ZEg.js} +1 -1
- package/dist/client/assets/{settingsLayout-CHJT5wtl.js → settingsLayout-BPKHc7wz.js} +1 -1
- package/dist/client/assets/{sheet-BNfImQ-7.js → sheet-BxlpAnIJ.js} +1 -1
- package/dist/client/assets/{sidebar-CFGg5Tkr.js → sidebar-CuxI1O8j.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-Dlo6McCj.js → sidebarProjectFolders-Bi8I6mH5.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-C8QBhZhZ.js → sidebarStatusText-DTXq8x3L.js} +1 -1
- package/dist/client/assets/{skeleton-DOgQaVXv.js → skeleton-C8KnJ1KQ.js} +1 -1
- package/dist/client/assets/{spinner-ClQu8SdC.js → spinner-D9HJGQ01.js} +1 -1
- package/dist/client/assets/{src-DmPIm3ie.js → src-CtanPQei.js} +1 -1
- package/dist/client/assets/storeSelectors-DMs36CMz.js +1 -0
- package/dist/client/assets/{switch-BZjA7VT9.js → switch-B50w01tf.js} +1 -1
- package/dist/client/assets/{terminal-links-CzJomeox.js → terminal-links-C5NsgIQU.js} +1 -1
- package/dist/client/assets/{textarea-DHdmRD1r.js → textarea-CJ8Vux-T.js} +1 -1
- package/dist/client/assets/{threadPinning-D2e9MEDr.js → threadPinning-B5WtT-P_.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-DbEFchoL.js → threadPriorityRefreshRuntime-BnDDqCxq.js} +1 -1
- package/dist/client/assets/{toast-C-0Ft2jD.js → toast-CV5dwFOH.js} +1 -1
- package/dist/client/assets/{toggle-DsnOFDbJ.js → toggle-DRqyFTHJ.js} +1 -1
- package/dist/client/assets/{toggle-group-Chxh9G6t.js → toggle-group-mhVkQLP2.js} +1 -1
- package/dist/client/assets/{tooltip-C_-9XEfA.js → tooltip-DZhBSkif.js} +1 -1
- package/dist/client/assets/types-DMs36CMz.js +1 -0
- package/dist/client/assets/{uiStateStore-DzUrk2GS.js → uiStateStore-OqZLiCwV.js} +1 -1
- package/dist/client/assets/{useAtlassian-Zb2Kkt0_.js → useAtlassian-zbqx4xW1.js} +0 -0
- package/dist/client/assets/{useButton-BmvYhoMC.js → useButton-DXIv8wCn.js} +1 -1
- package/dist/client/assets/{useCompositeListItem-D0PvH4nv.js → useCompositeListItem-rrdFaxXB.js} +1 -1
- package/dist/client/assets/{useDebouncedValue-s0BC8Yyp.js → useDebouncedValue-Dz3pyT5q.js} +1 -1
- package/dist/client/assets/{useFloatingRootContext-CLCaQEJk.js → useFloatingRootContext-CIRRjmkd.js} +1 -1
- package/dist/client/assets/{useHandleNewThread-ByVfL71G.js → useHandleNewThread-DRoY_cL7.js} +1 -1
- package/dist/client/assets/{useLabelableId-CB_9OReR.js → useLabelableId-nlk2LM0q.js} +1 -1
- package/dist/client/assets/{useLocation-DGJMt6gP.js → useLocation-TExTri5H.js} +1 -1
- package/dist/client/assets/{useOpenInteractionType-BSSI2GzS.js → useOpenInteractionType-Co4_pLo_.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-BhTVcLtf.js → usePhoneThreadActions-CTmdPjGg.js} +1 -1
- package/dist/client/assets/{usePopupViewport-8F-J1h5f.js → usePopupViewport-SxCh7dCg.js} +1 -1
- package/dist/client/assets/{useScrollLock-CBz-5_MX.js → useScrollLock-cFFkQSYy.js} +1 -1
- package/dist/client/assets/{useStatistics-Dbp94K5j.js → useStatistics-D8hzpDv4.js} +2 -2
- package/dist/client/assets/{useSwipeDismiss-D22_vuiH.js → useSwipeDismiss-ALyKckxx.js} +1 -1
- package/dist/client/assets/{useThreadActions-CPL4dO-X.js → useThreadActions-5hLAJAJB.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-f7afwACm.js → useTriggerFocusGuards-lOK7sLv0.js} +1 -1
- package/dist/client/assets/{useValueChanged-EkWF0C3k.js → useValueChanged-BQLjL43O.js} +1 -1
- package/dist/client/assets/{utils-CV2fJJxC.js → utils-Ct58OPtz.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-oFvWyN3_.mjs → collectUint8StreamText-Bwltp7kn.mjs} +10 -0
- package/dist/{collectUint8StreamText-Dsbmrw73.cjs → collectUint8StreamText-D0THfPrP.cjs} +10 -0
- package/dist/{makeManagedServerProvider-CANTNAsz.cjs → makeManagedServerProvider-B7rRjRgd.cjs} +1 -1
- package/dist/{makeManagedServerProvider-PLtJj7EV.mjs → makeManagedServerProvider-BMSV4Aim.mjs} +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AiFocusSettings-BI9AgQUi.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-CIZnwgK9.js +0 -1
- package/dist/client/assets/DialogRoot-C_DO1gtO.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-sDCNEVkR.js +0 -1
- package/dist/client/assets/RootAppShell-CG06ruyc.js +0 -6
- package/dist/client/assets/SettingsDialog-ByR9PwEc.js +0 -1
- package/dist/client/assets/SettingsPanels-CwsCgdds.js +0 -3
- package/dist/client/assets/authorization-D8lJzXTE.js +0 -1
- package/dist/client/assets/composerDraftStore-TYv9j3vY.js +0 -11
- package/dist/client/assets/desktopUpdateAtoms-hP0oc_If.js +0 -1
- package/dist/client/assets/editorPreferences-B54y5_sx.js +0 -1
- package/dist/client/assets/main-DlGNPwsH.css +0 -2
- package/dist/client/assets/primary-CiDY2oUi.js +0 -2
- package/dist/client/assets/providerInstances-vd2eZtHx.js +0 -1
- package/dist/client/assets/providerModels-vd2eZtHx.js +0 -1
- package/dist/client/assets/runtime-QZPKtH2P.js +0 -1
- package/dist/client/assets/storeSelectors-_h41wnN2.js +0 -1
- package/dist/client/assets/types-_h41wnN2.js +0 -1
package/dist/client/assets/{ConnectionsSettings-DFBNmvfL.js → ConnectionsSettings-Dsewo1mI.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{Ir as r,wa as i}from"./src-CtanPQei.js";import{Hn as a,Yt as o,bn as s,h as c,l,m as u,n as d,r as f,s as p,vt as m,xn as h}from"./runtime-Cy36EhFa.js";import{A as g,C as _,F as v,M as y,T as b,U as x,g as S,h as C,j as w,k as T,m as E,p as D,u as O}from"./primary-DiL6nRV-.js";import{It as k}from"./composerDraftStore-DXTD6mKH.js";import{n as A,t as j}from"./pairingUrl-rQM9kSGT.js";import{n as M,t as N}from"./visibilityPolling-BwzZdaSN.js";import{r as P,t as F}from"./hostedPairing-PogXRAb7.js";import{t as I}from"./settingsDialogStore-CzH3-ZEg.js";import{i as ee}from"./uiStateStore-OqZLiCwV.js";import{n as L,o as R,t as z}from"./desktopWorkspace-BFTBEpzF.js";import{f as B}from"./useRenderElement-DchFnsR8.js";import{t as te}from"./arrow-up-right-DGeet8e6.js";import{t as ne}from"./chevron-down-B7C6FKzM.js";import{i as V}from"./toast-CV5dwFOH.js";import{t as H}from"./plus-B2h-VEqh.js";import{t as U}from"./qr-code-ScYULAuR.js";import{t as W}from"./refresh-cw-DopCMrtR.js";import{t as re}from"./terminal-C_CyIsDD.js";import{t as ie}from"./triangle-alert-RL_T3KLo.js";import{t as G}from"./utils-Ct58OPtz.js";import{n as ae,t as oe}from"./timestampFormat-8uPXS812.js";import{i as K,n as se,t as ce}from"./tooltip-DZhBSkif.js";import{t as le}from"./switch-B50w01tf.js";import{t as ue}from"./input-Ba4jS4Ks.js";import{t as de}from"./scroll-area-BZayohht.js";import{t as q}from"./button-WR80VgkK.js";import{t as fe}from"./useCopyToClipboard-BTpWxumf.js";import{t as pe}from"./toastHelpers-CSQRKo4F.js";import{a as me,c as he,i as ge,l as _e,n as ve,o as ye,r as be,s as xe,t as Se}from"./dialog-CwRtKu2U.js";import{a as Ce,c as J,d as we,i as Te,o as Ee,p as De,s as Oe}from"./menu-CsEBcjDz.js";import{t as ke}from"./spinner-D9HJGQ01.js";import{t as Ae}from"./textarea-CJ8Vux-T.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./alert-dialog-iYnjheVe.js";import{n as Re,r as ze,t as Be}from"./popover-BpnQc7ji.js";import{a as Ve,i as He,n as Ue,r as Y}from"./settingsLayout-BPKHc7wz.js";import{n as We,t as Ge}from"./data-list-jNXWZwx3.js";import{t as Ke}from"./AnimatedHeight-B8ZeY3LL.js";import{n as qe,t as Je}from"./group-BpXcg5Ba.js";import{t as Ye}from"./qr-code-CXu67ChC.js";import{n as Xe,r as Ze,t as Qe}from"./collapsible-BUn1kona.js";var $e=B(`chevrons-left-right-ellipsis`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]),X=e(t(),1),Z=n();function et(e,t){let n=new URL(e);return n.pathname=`/pair`,A(n,t).toString()}function tt(e,t){return new URL(e).protocol===`https:`?F({host:e,token:t}):null}var nt=`/assets/relay-architecture-YeimmXuP.html`,Q=k();function $(e,t){return e===null||t===null||!e.fileSecretStoreFallbackSupported?!1:t.enrolled===`none`||t.enrolled===`unknown`&&!e.allowFileSecretStore}function rt(e,t){return e===null||t===null?`Loading local launch configuration and identity state.`:e.fileSecretStoreFallbackSupported?t.enrolled===`active`||t.enrolled===`pending`?`Locked while this machine holds Hub identity material. Leave the Hub before changing it.`:t.enrolled===`unknown`?e.allowFileSecretStore?`Identity custody is unreadable, so an enabled fallback cannot be turned off.`:`Enable this only as a recovery action when an existing file-backed identity cannot be read.`:`Ryco still prefers the system credential store. This only permits the hardened POSIX file fallback when that store is unavailable.`:`Unavailable on Windows. Ryco requires the system credential store on this host.`}function it(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KiB`}function at(e,t){if(e===null)return[{label:`Protocol`,value:`Loading`},{label:`Channels`,value:`Loading`},{label:`Relay queue`,value:`Loading`},{label:`Reconnect`,value:`Loading`}];let n=e.state===`online`&&e.protocolMajor!==void 0&&e.protocolMinor!==void 0?`${e.protocolMajor}.${e.protocolMinor}`:`Not negotiated`,r=e.nextRetryAt===void 0?e.reconnectAttempt===void 0?`Not scheduled`:`Attempt ${e.reconnectAttempt}`:`Attempt ${e.reconnectAttempt??0}, ${Math.max(0,Math.ceil((Date.parse(e.nextRetryAt)-t)/1e3))}s`;return[{label:`Protocol`,value:n},{label:`Channels`,value:String(e.activeChannels)},{label:`Relay queue`,value:it(e.queuedBytes)},{label:`Reconnect`,value:r}]}function ot(e){let t=(0,Z.c)(84),{config:n,identity:r,status:i,nowMs:a,savingFileFallback:o,configError:s,onFileFallbackChange:c,onOpenGuide:l}=e,[u,d]=(0,X.useState)(!1),f;t[0]!==n||t[1]!==r?(f=$(n,r),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p=f,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;if(t[3]!==p||t[4]!==n||t[5]!==s||t[6]!==r||t[7]!==a||t[8]!==c||t[9]!==l||t[10]!==u||t[11]!==o||t[12]!==i){let e=at(i,a);g=Qe,y=u,b=d;let f=u?`Hide advanced options`:`Show advanced options`,A;t[29]===f?A=t[30]:(A=(0,Q.jsx)(`span`,{className:`block text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:f}),t[29]=f,t[30]=A);let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground/80`,children:`Key custody, startup ownership, CLI flags, and bounded relay diagnostics.`}),t[31]=j):j=t[31];let M;t[32]===s?M=t[33]:(M=s?(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-destructive`,children:s}):null,t[32]=s,t[33]=M);let N;t[34]!==A||t[35]!==M?(N=(0,Q.jsxs)(`span`,{children:[A,j,M]}),t[34]=A,t[35]=M,t[36]=N):N=t[36];let P=`size-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${u?`rotate-180`:``}`,F;t[37]===P?F=t[38]:(F=(0,Q.jsx)(ne,{className:P,"aria-hidden":!0}),t[37]=P,t[38]=F),t[39]!==N||t[40]!==F?(x=(0,Q.jsxs)(Ze,{className:`group flex w-full items-center justify-between gap-4 border-t border-border/60 px-4 py-3.5 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:px-5`,children:[N,F]}),t[39]=N,t[40]=F,t[41]=x):x=t[41],h=Xe,v=`motion-reduce:transition-none`,D=`border-t border-border/60 bg-muted/10`;let I;t[42]!==n||t[43]!==r?(I=rt(n,r),t[42]=n,t[43]=r,t[44]=I):I=t[44];let ee=n?.allowFileSecretStore??!1,L=!p||o,R;t[45]===c?R=t[46]:(R=e=>c(!!e),t[45]=c,t[46]=R);let z;t[47]!==ee||t[48]!==L||t[49]!==R?(z=(0,Q.jsx)(le,{checked:ee,disabled:L,onCheckedChange:R,"aria-label":`Allow permissioned-file Hub key storage`}),t[47]=ee,t[48]=L,t[49]=R,t[50]=z):z=t[50],t[51]!==I||t[52]!==z?(O=(0,Q.jsx)(Y,{title:`Protected key fallback`,description:I,status:`Changing this launch setting restarts Ryco. It never moves or exports an existing key.`,control:z}),t[51]=I,t[52]=z,t[53]=O):O=t[53],t[54]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(Y,{title:`Who owns startup`,description:`The desktop app owns Hub launch values for its bundled server and restarts that server to apply them. Exported Hub environment variables do not override this panel.`,status:`The Hub address stays outside ordinary server settings, diagnostics, and support output.`}),t[54]=k):k=t[54],t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Y,{title:`CLI equivalents`,description:`Use these flags for a headless Ryco node. Explicit flags override matching environment variables.`,status:`Use RYCO_HUB_NODE_NAME instead of --hub-node-name when environment configuration is preferable. Boolean flags also support canonical --no-... forms.`,children:(0,Q.jsx)(`div`,{className:`pb-3.5 pt-3`,children:(0,Q.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border border-border/60 bg-background/70 px-3 py-2.5 font-mono text-[11px] leading-5 text-foreground`,children:(0,Q.jsx)(`code`,{children:`ryco serve \\
|
|
2
2
|
--hub-connector-enabled \\
|
|
3
3
|
--hub-origin https://app.ryco.space \\
|
|
4
4
|
--hub-node-name "Build node"
|
|
5
5
|
|
|
6
6
|
# Optional on supported POSIX hosts
|
|
7
|
-
ryco serve --hub-allow-file-secret-store`})})})}),t[55]=_):_=t[55],m=Y,w=`Relay diagnostics`,T=`Bounded local counters only. No Hub address, key, ticket, project, path, or payload is exposed here.`;let B;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(te,{className:`size-3`}),t[56]=B):B=t[56],t[57]===l?E=t[58]:(E=(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,onClick:l,children:[`Open relay guide`,B]}),t[57]=l,t[58]=E),S=`grid grid-cols-2 gap-x-6 gap-y-3 pb-3.5 pt-3 sm:grid-cols-4`,C=e.map(st),t[3]=p,t[4]=n,t[5]=s,t[6]=r,t[7]=a,t[8]=c,t[9]=l,t[10]=u,t[11]=o,t[12]=i,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28];let A;t[59]!==S||t[60]!==C?(A=(0,Q.jsx)(`dl`,{className:S,children:C}),t[59]=S,t[60]=C,t[61]=A):A=t[61];let j;t[62]!==m||t[63]!==A||t[64]!==w||t[65]!==T||t[66]!==E?(j=(0,Q.jsx)(m,{title:w,description:T,control:E,children:A}),t[62]=m,t[63]=A,t[64]=w,t[65]=T,t[66]=E,t[67]=j):j=t[67];let M;t[68]!==_||t[69]!==j||t[70]!==D||t[71]!==O||t[72]!==k?(M=(0,Q.jsxs)(`div`,{className:D,children:[O,k,_,j]}),t[68]=_,t[69]=j,t[70]=D,t[71]=O,t[72]=k,t[73]=M):M=t[73];let N;t[74]!==h||t[75]!==v||t[76]!==M?(N=(0,Q.jsx)(h,{className:v,children:M}),t[74]=h,t[75]=v,t[76]=M,t[77]=N):N=t[77];let P;return t[78]!==g||t[79]!==y||t[80]!==b||t[81]!==x||t[82]!==N?(P=(0,Q.jsxs)(g,{open:y,onOpenChange:b,children:[x,N]}),t[78]=g,t[79]=y,t[80]=b,t[81]=x,t[82]=N,t[83]=P):P=t[83],P}function st(e){return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`dt`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground/65`,children:e.label}),(0,Q.jsx)(`dd`,{className:`mt-1 truncate font-mono text-[11px] text-foreground`,children:e.value})]},e.label)}var ct={configuration_invalid:{headline:`Hub configuration is invalid`,detail:`The address this backend started with was rejected. Check it and restart.`,action:`none`},identity_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The system keychain is locked or unavailable. Unlock it, then try again.`,action:`retry`},identity_store_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The keychain was unavailable when Ryco started. Restart Ryco to try again.`,action:`restart`},identity_origin_mismatch:{headline:`Enrolled with a different Hub`,detail:`This machine's key belongs to another Hub. Leave that Hub to enrol here.`,action:`leave`},enrollment_unavailable:{headline:`Enrollment was denied`,detail:`Someone declined this request on the Hub. Check with them before trying again.`,action:`enroll`},enrollment_expired:{headline:`Enrollment expired`,detail:`The request timed out before it was approved.`,action:`enroll`},authentication_failed:{headline:`The Hub rejected this machine's key`,detail:`Check this node's status on the Hub. Leaving lets you enrol again from scratch.`,action:`open-hub`},connection_replaced:{headline:`Another process connected as this machine`,detail:`Two copies of Ryco can't share one Hub identity. Stop the other one, then retry.`,action:`retry`},protocol_invalid:{headline:`The Hub connection kept failing`,detail:`Ryco stopped retrying after repeated protocol errors. Update Ryco and the Hub.`,action:`retry`},network_unavailable:{headline:`Can't reach the Hub`,detail:null,action:`none`},tls_unavailable:{headline:`Can't reach the Hub securely`,detail:null,action:`none`},authentication_timeout:{headline:`The Hub didn't respond`,detail:null,action:`none`},server_draining:{headline:`The Hub is restarting`,detail:null,action:`none`},rate_limited:{headline:`The Hub is rate limiting`,detail:null,action:`none`},heartbeat_timeout:{headline:`The Hub stopped responding`,detail:null,action:`none`},slow_consumer:{headline:`The connection fell behind`,detail:null,action:`none`},internal_error:{headline:`The Hub connection failed`,detail:null,action:`none`}},lt=(e,t)=>{let n=new Date(e).getTime()-t;if(Number.isNaN(n))return null;if(n<=0)return`now`;let r=Math.ceil(n/1e3);return r<60?`${r}s`:`${Math.ceil(r/60)}m`};function ut(e,t,n){switch(e.state){case`disabled`:return t.enrolled===`none`?{dot:`idle`,ping:!1,headline:`Not connected`,detail:null,action:`enable`,secondaryAction:`none`,retrying:!1}:{dot:`idle`,ping:!1,headline:`Turned off`,detail:`This machine stays enrolled.`,action:`enable`,secondaryAction:`leave`,retrying:!1};case`enrolling`:return{dot:`warning`,ping:!1,headline:`Ready to enrol`,detail:`Start enrollment, then approve this machine on your Hub.`,action:`enroll`,secondaryAction:`disable`,retrying:!1};case`awaiting_approval`:return{dot:`warning`,ping:!0,headline:`Waiting for approval on the Hub`,detail:`Compare every field below before approving.`,action:`open-hub`,secondaryAction:`cancel-enrollment`,retrying:!1};case`connecting`:return{dot:`warning`,ping:!0,headline:`Connecting`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`authenticating`:return{dot:`warning`,ping:!0,headline:`Authenticating`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`online`:return{dot:`success`,ping:!0,headline:`Connected`,detail:e.activeChannels===1?`1 active session`:`${e.activeChannels} active sessions`,action:`disable`,secondaryAction:`none`,retrying:!1};case`degraded`:{if(e.degradedMode===`backing_off`){let t=e.nextRetryAt===void 0?null:lt(e.nextRetryAt,n),r=e.reconnectAttempt;return{dot:`warning`,ping:!0,headline:`Reconnecting`,detail:[t===null?null:t===`now`?`Retrying now`:`Next attempt in ${t}`,r===void 0||r===0?null:`attempt ${r}`].filter(e=>e!==null).join(` · `),action:`none`,secondaryAction:`none`,retrying:!0}}let t=ct[e.failure??`internal_error`];return{dot:`destructive`,ping:!1,headline:t.headline,detail:t.detail,action:t.action,secondaryAction:t.action===`leave`?`none`:`leave`,retrying:!1}}case`revoked`:return{dot:`destructive`,ping:!1,headline:`Revoked at the Hub`,detail:`This will not retry. Leaving erases this machine's key so you can enrol again.`,action:`leave`,secondaryAction:`open-hub`,retrying:!1};case`version_incompatible`:return{dot:`destructive`,ping:!1,headline:`Incompatible Hub version`,detail:`This will not retry. Update Ryco, or the Hub, so both speak the same protocol.`,action:`none`,secondaryAction:`none`,retrying:!1};case`stopping`:return{dot:`idle`,ping:!1,headline:`Shutting down`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1}}}function dt(e){return e.enrolled===`none`}var ft=5e3,pt=15e3,mt={enable:`Enable`,disable:`Turn off`,enroll:`Start enrollment`,"cancel-enrollment":`Cancel`,"open-hub":`Open Hub`,retry:`Retry now`,leave:`Leave this Hub`,restart:`Restart Ryco`},ht=1e4;function gt({desktopBridge:e}){let t=Ve(1e3),n=R(),[r,a]=(0,X.useState)(null),[s,c]=(0,X.useState)(null),l=(0,X.useRef)(new Map),u=I(e=>e.closeSettings),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(null),[_,y]=(0,X.useState)(``),[x,w]=(0,X.useState)(null),[D,k]=(0,X.useState)(null),[A,j]=(0,X.useState)(``),[P,F]=(0,X.useState)(null),[ee,B]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(null),[V,H]=(0,X.useState)(null),[U,W]=(0,X.useState)(null),[re,G]=(0,X.useState)(!1),[ae,oe]=(0,X.useState)(!1),[K,se]=(0,X.useState)(null),[ce,le]=(0,X.useState)(!1),[de,pe]=(0,X.useState)(null),[me,he]=(0,X.useState)(!1),[ge,_e]=(0,X.useState)(null),[ve,ye]=(0,X.useState)(!1),[be,xe]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(``),J=(0,X.useRef)(!0),we=(0,X.useRef)(null),{copyToClipboard:Te}=fe(),Ee=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;(0,X.useEffect)(()=>(J.current=!0,()=>{J.current=!1}),[]);let De=(0,X.useCallback)(async()=>{try{let[e,t]=await Promise.all([S(),C()]),n=e.state===`awaiting_approval`?await E():null;if(!J.current)return;a({status:e,identity:t,enrollment:n,readAt:Date.now()}),ne(null)}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`Unable to read Hub status.`)}},[]);(0,X.useEffect)(()=>{let e=N({lifecycle:M,run:De,resolveDelayMs:()=>ft,jitterRatio:.1});return we.current=e,()=>{we.current===e&&(we.current=null),e.stop()}},[De]);let Oe=(0,X.useCallback)(()=>we.current?.refresh()??De(),[De]);(0,X.useEffect)(()=>{e&&e.getHubLaunchConfig().then(e=>{J.current&&(g(e),y(e.origin??``),j(e.nodeName??``),H(null))}).catch(e=>{J.current&&H(e instanceof Error?e.message:`Unable to read Hub launch configuration.`)})},[e]),(0,X.useEffect)(()=>()=>{for(let e of l.current.values())e();l.current.clear()},[]),(0,X.useEffect)(()=>{e?.getHostedIdentityState&&e.getHostedIdentityState().then(e=>{J.current&&(se(e),pe(null))}).catch(()=>{J.current&&(se({status:`unavailable`}),pe(`Unable to read the native account setup state.`))})},[e]);let ke=(0,X.useCallback)(async t=>{let n=t===`connect`?e?.connectHostedIdentity:e?.disconnectHostedIdentity;if(n){le(!0),pe(null);try{let e=await n();if(!J.current)return;se(e)}catch{if(!J.current)return;se({status:`unavailable`}),pe(t===`connect`?`Automatic secure setup did not finish. Retry when the Hub is reachable.`:`Unable to clear the native account session.`)}finally{J.current&&le(!1)}}},[e]),Ae=(0,X.useCallback)(async()=>{if(e?.refreshDesktopWorkspaceCatalog){c(null);try{await e.refreshDesktopWorkspaceCatalog()}catch{c(`Unable to refresh this account's machine directory.`)}}},[e]);(0,X.useEffect)(()=>{K?.status===`ready`&&Ae()},[K?.status,Ae]);let Re=(0,X.useCallback)(e=>{l.current.has(e)||l.current.set(e,z(e))},[]),ze=(0,X.useCallback)(e=>{l.current.get(e)?.(),l.current.delete(e)},[]),Be=(0,X.useCallback)(e=>{Re(e),o.getState().setActiveEnvironmentId(e),u()},[u,Re]),Ue=(0,X.useCallback)(async()=>{if(!(!e?.verifyDesktopWorkspaceApproval||!d)){c(null);try{await e.verifyDesktopWorkspaceApproval({nodeId:d.nodeId,environmentId:i.make(d.environmentId),payload:p.trim()});let t=L(i.make(d.environmentId));globalThis.setTimeout(t,ht),await e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0),f(null),m(``)}catch{c(`That approval code does not match this Desktop client, machine, account, or current node security state.`)}}},[e,p,d]),qe=(0,X.useCallback)(async t=>{if(e?.beginDesktopWorkspaceVerification){c(null);try{d&&await e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0);let n=await e.beginDesktopWorkspaceVerification({nodeId:t.nodeId,environmentId:i.make(t.environmentId)});f({...t,handle:n.handle}),m(``)}catch{c(`Unable to introduce this Desktop client to that machine. Confirm it is online and retry.`)}}},[e,d]),Je=(0,X.useCallback)(async(t,n)=>{let r=t===`connect`?e?.connectHostedGitHub:e?.disconnectHostedGitHub;if(r){he(!0),_e(null);try{let e=await r(n?{totpCode:n}:void 0);if(!J.current)return;se(e.state),e.outcome===`step-up-required`?(xe(t),Ce(``)):(xe(null),Ce(``),ye(!1),e.outcome===`last-primary-credential`?_e(`Add another primary sign-in method before disconnecting GitHub.`):e.outcome===`unavailable`&&_e(`GitHub account access is temporarily unavailable.`))}catch{J.current&&_e(`GitHub account access is temporarily unavailable.`)}finally{J.current&&he(!1)}}},[e]),Ye=(0,X.useCallback)(async t=>{W(t),ne(null);try{switch(t){case`enroll`:await v();break;case`cancel-enrollment`:await O();break;case`retry`:await T();break;case`leave`:await b();break;case`enable`:case`disable`:await e?.setHubLaunchConfig({enabled:t===`enable`});return;case`restart`:if(!e?.restartApp)throw Error(`Desktop restart is unavailable.`);await e.restartApp();return;case`open-hub`:{let e=h?.origin;e&&window.open(e,`_blank`,`noopener,noreferrer`);return}default:return}await Oe()}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`That didn't work.`)}finally{J.current&&W(null)}},[h,e,Oe]),Xe=(0,X.useCallback)(async()=>{if(!e||_.trim()===``){w(null),k(null);return}let t=await e.validateHubOrigin(_);if(J.current){if(t.ok){y(t.origin),w(null),k(null);return}k(t.suggestion??null),w({empty:`Enter a Hub address.`,too_long:`That address is too long.`,not_a_url:`That doesn't look like an address.`,insecure_scheme:`A Hub address must use https.`,has_credentials:`Remove the username and password from the address.`,has_path:`Use the Hub's address only, without a path.`,invalid:`That address can't be used.`}[t.reason])}},[e,_]),Ze=(0,X.useCallback)(async t=>{if(e){W(`enable`);try{await e.setHubLaunchConfig({origin:t})}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`Unable to save the Hub address.`),W(null)}}},[e]),Qe=(0,X.useCallback)(e=>{j(e),F(e.trim().length>100?`Use 100 characters or fewer.`:null)},[]),$e=(0,X.useCallback)(async()=>{if(!e)return;let t=A.trim();if(t.length>100){F(`Use 100 characters or fewer.`);return}B(!0),F(null);try{await e.setHubLaunchConfig({nodeName:t===``?null:t})}catch(e){if(!J.current)return;F(e instanceof Error?e.message:`Unable to save the Hub node name.`),B(!1)}},[e,A]),Z=(0,X.useCallback)(async t=>{if(e&&!(!await e.confirm(t?`Allow permissioned-file storage when the system credential store is unavailable? Ryco will restart. Existing keys are not moved.`:`Stop allowing permissioned-file Hub key storage? Ryco will restart.`)||!J.current)){G(!0),H(null);try{await e.setHubLaunchConfig({allowFileSecretStore:t})}catch(e){if(!J.current)return;H(e instanceof Error?e.message:`Unable to save the key storage setting.`),G(!1)}}},[e]),et=(0,X.useCallback)(async()=>{if(e)try{let t=new URL(nt,window.location.href).toString();if(!await e.openExternal(t))throw Error(`The relay guide could not be opened.`);H(null)}catch(e){if(!J.current)return;H(e instanceof Error?e.message:`Unable to open the relay guide.`)}},[e]);if(!e)return null;let tt=r!==null&&t-r.readAt>pt,$=r===null?null:ut(r.status,r.identity,t),rt=r!==null&&dt(r.identity),it=_.trim()!==(h?.origin??``),at=A.trim()!==(h?.nodeName??``),st=h!==null&&h.origin!==null&&e.getHostedIdentityState!==void 0&&e.connectHostedIdentity!==void 0&&r?.identity.enrolled===`none`&&($?.action===`enable`||$?.action===`enroll`),ct=(e,t)=>e===`none`?null:(0,Q.jsx)(q,{size:`xs`,variant:t,disabled:U!==null,onClick:()=>{if(e===`leave`){oe(!0);return}Ye(e)},children:U===e?`Working…`:mt[e]});return(0,Q.jsxs)(He,{title:`Hub`,children:[(0,Q.jsx)(Y,{title:`Connection`,description:st?`Connect your Ryco account below. Ryco will register this Mac with this Hub automatically.`:$===null?`Loading…`:$.detail===null?`Reach this Mac from anywhere, including behind NAT or CGNAT, without opening a port.`:$.detail,status:(0,Q.jsxs)(Q.Fragment,{children:[$===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${tt?`bg-muted-foreground/40`:$.dot===`success`?`bg-success`:$.dot===`warning`?`bg-warning`:$.dot===`destructive`?`bg-destructive`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),tt?`${$.headline} · last checked ${Math.round((t-r.readAt)/1e3)}s ago`:st?`Ready for account setup`:$.headline]}),te?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:te}):null]}),control:$===null?null:(0,Q.jsxs)(Q.Fragment,{children:[ct(st?`none`:$.action,$.action===`leave`?`destructive-outline`:`outline`),ct(st?`none`:$.secondaryAction,$.secondaryAction===`leave`?`destructive-outline`:`outline`)]}),children:(0,Q.jsx)(Ke,{children:r?.enrollment?(0,Q.jsxs)(`div`,{className:`pb-3.5`,children:[(0,Q.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground/80`,children:`Compare every field with the Hub's approval screen before approving.`}),(0,Q.jsxs)(Ge,{className:`rounded-xl border border-border/60 bg-muted/20 p-3`,children:[(0,Q.jsx)(We,{term:`Label`,children:r.enrollment.label}),(0,Q.jsx)(We,{term:`Platform`,children:`${r.enrollment.platformOs} · ${r.enrollment.platformArch}`}),(0,Q.jsx)(We,{term:`Version`,mono:!0,children:r.enrollment.clientVersion}),(0,Q.jsx)(We,{term:`Algorithm`,children:r.enrollment.algorithm}),(0,Q.jsx)(We,{term:`Fingerprint`,mono:!0,children:r.enrollment.fingerprint}),(0,Q.jsx)(We,{term:`Expires`,children:new Date(r.enrollment.expiresAt).toLocaleString()}),(0,Q.jsx)(We,{term:`Device code`,mono:!0,action:Ee?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Te(r.enrollment.deviceCode),children:`Copy`}):null,children:r.enrollment.deviceCode})]}),(0,Q.jsx)(`p`,{className:`pt-2 text-[11px] text-muted-foreground/70`,children:`The device code only routes the request. It does not prove which machine you are approving.`}),(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-2 text-xs text-warning`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`If the fingerprint on the Hub differs by even one character, deny it there and cancel here.`]})]}):null})}),h!==null&&h.origin!==null&&e.getHostedIdentityState!==void 0?(0,Q.jsx)(Y,{title:`Ryco account`,description:K===null?`Checking this Mac's native account setup…`:st&&K.status===`ready`?`You are signed in. Finish setup to register this Mac with the Hub and verify local trust automatically.`:K.status===`ready`?`Your native account session and this Mac's automatic node claim are ready. Local trust introduction is verified.`:K.status===`signed-out`?`Sign in in your browser. Ryco will claim this Mac's node and verify its local trust automatically.`:`Automatic secure setup did not finish. Existing node and trust state are preserved while you retry.`,status:(0,Q.jsxs)(Q.Fragment,{children:[K===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${st&&K.status===`ready`?`bg-warning`:K.status===`ready`?`bg-success`:K.status===`unavailable`?`bg-warning`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),K.status===`ready`?st?`Signed in · Node setup needed`:`Secure setup complete`:K.status===`unavailable`?`Setup needs attention`:`Not signed in`]}),de?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:de}):null]}),control:K===null?null:st&&K.status===`ready`?(0,Q.jsx)(q,{size:`xs`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void ke(`connect`),children:ce?`Finishing setup…`:`Finish setup`}):K.status===`ready`?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:ce||!e.disconnectHostedIdentity,onClick:()=>void ke(`disconnect`),children:ce?`Working…`:`Sign out`}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void ke(`connect`),children:ce?`Opening browser…`:K.status===`unavailable`?`Retry secure setup`:`Connect account`})}):null,K?.status===`ready`&&e?.getDesktopWorkspaceState?(0,Q.jsxs)(Y,{title:`Workspace machines`,description:`Connect, open, and manage each machine independently. Cached lists remain read-only until connected.`,status:s??`${n.machines.filter(e=>e.online).length} online · ${n.activeConnectionCount} connected`,control:(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void Ae(),children:`Refresh`}),children:[(0,Q.jsx)(Ge,{children:n.machines.map(e=>(0,Q.jsx)(We,{term:e.label,action:(0,Q.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:e.nodeId&&e.online&&(e.nativeTrust===`unverified`||e.nativeTrust===`unknown`)?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>{qe({nodeId:e.nodeId,environmentId:e.environmentId})},children:`Verify`}):e.nativeTrust===`verified`&&e.online?e.connectionState===`connected`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Be(e.environmentId),children:`Open`}),(0,Q.jsx)(q,{size:`xs`,variant:`ghost`,onClick:()=>ze(e.environmentId),children:`Disconnect`})]}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Re(e.environmentId),children:`Connect`}):null}),children:e.nativeTrust===`verified`?e.online?`Verified · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Verified · Offline`:e.nativeTrust===`identity-conflict`?`Identity changed · Locked`:e.online?`Needs verification`:`Needs verification · Offline`},`${e.nodeId??`unknown`}:${e.environmentId}`))}),d?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 border-t border-border/60 py-3 sm:flex-row`,children:[(0,Q.jsx)(ue,{value:p,onChange:e=>m(e.target.value),placeholder:`Paste the approval code shown by this exact node`,"aria-label":`Machine approval code`}),(0,Q.jsx)(q,{size:`sm`,disabled:p.trim().length===0,onClick:()=>void Ue(),children:`Verify`}),(0,Q.jsx)(q,{size:`sm`,variant:`ghost`,onClick:()=>{e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0),f(null),m(``)},children:`Cancel`})]}):null]}):null,K?.status===`ready`&&K.github!==void 0?(0,Q.jsx)(Y,{title:K.github.identity?`GitHub · @${K.github.identity.login}`:`GitHub`,description:K.github.identity?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,status:ge?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:ge}):K.github.identity?.displayName?K.github.identity.displayName:null,control:K.github.linkAvailable?K.github.identity?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:me||!e?.disconnectHostedGitHub,onClick:()=>ye(!0),children:me?`Working…`:`Disconnect`}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:me||!e?.connectHostedGitHub,onClick:()=>void Je(`connect`),children:me?`Opening browser…`:`Connect GitHub`}):null}):null,(0,Q.jsx)(Y,{title:`Hub address`,description:rt?`The address of the Hub you or your team operate.`:`Locked while this machine is enrolled. Leave this Hub to change it.`,status:x?(0,Q.jsxs)(`span`,{className:`block text-destructive`,children:[x,D?(0,Q.jsxs)(`button`,{type:`button`,className:`ml-1 underline underline-offset-2`,onClick:()=>{y(D),w(null),k(null)},children:[`Use `,D]}):null]}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ue,{value:_,disabled:!rt||U!==null,placeholder:`https://…`,className:`w-64 font-mono text-xs`,onChange:e=>y(e.currentTarget.value),onBlur:()=>void Xe()}),rt&&it&&x===null&&_.trim()!==``?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:U!==null,onClick:()=>void Ze(_.trim()),children:`Save and restart`}):null]})}),(0,Q.jsx)(Y,{title:`Node name`,description:rt?`Choose the name proposed on the Hub approval screen. Leave it blank for a stable automatic name.`:r?.identity.enrolled===`pending`?`Locked while enrollment is pending. Cancel enrollment to change the proposed name.`:`Managed on the Hub after enrollment. An owner can rename this node from its Hub details.`,status:P?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:P}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ue,{value:A,disabled:!rt||U!==null||ee,placeholder:`Automatic: machine name · node code`,"aria-label":`Hub node name`,className:`w-64 text-xs`,onChange:e=>Qe(e.currentTarget.value)}),rt&&at&&P===null?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:U!==null||ee,onClick:()=>void $e(),children:ee?`Saving…`:`Save and restart`}):null]})}),r!==null&&r.status.state===`online`?(0,Q.jsx)(Y,{title:`Who can connect`,description:`Managed on the Hub, not here. Sessions arriving through the Hub carry a role: viewer reads, operator edits files and runs terminals, owner also changes credentials and server policy.`}):null,(0,Q.jsx)(ot,{config:h,identity:r?.identity??null,status:r?.status??null,nowMs:t,savingFileFallback:re||U!==null,configError:V,onFileFallbackChange:e=>void Z(e),onOpenGuide:()=>void et()}),(0,Q.jsx)(Le,{open:ae,onOpenChange:oe,children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Leave this Hub?`}),(0,Q.jsxs)(Fe,{children:[`This erases this machine's Hub key. You can enrol again afterwards, but it will join as a new machine and needs a new approval.`,(0,Q.jsx)(`br`,{}),(0,Q.jsx)(`br`,{}),`It does `,(0,Q.jsx)(`strong`,{children:`not`}),` revoke anything on the Hub. The old entry stays there until an owner removes it.`]})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Keep it`}),(0,Q.jsx)(q,{variant:`destructive`,disabled:U!==null,onClick:()=>{oe(!1),Ye(`leave`)},children:`Erase this machine's key`})]})]})}),(0,Q.jsx)(Le,{open:ve,onOpenChange:ye,children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Disconnect GitHub?`}),(0,Q.jsx)(Fe,{children:`GitHub stops working as a Ryco sign-in method. Ryco refuses this change when it is your only primary sign-in method. Repository access is separate.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Cancel`}),(0,Q.jsx)(q,{variant:`destructive`,disabled:me,onClick:()=>void Je(`disconnect`),children:`Disconnect GitHub`})]})]})}),(0,Q.jsx)(Le,{open:be!==null,onOpenChange:t=>{!t&&!me&&(be===`connect`&&e?.cancelHostedGitHubConnection?.(),xe(null),Ce(``))},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Confirm this account change`}),(0,Q.jsx)(Fe,{children:`Enter a current code from your authenticator app. The pending GitHub authorization is reused; Ryco does not reopen the browser.`})]}),(0,Q.jsx)(ue,{"aria-label":`Authenticator code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,value:Se,onChange:e=>Ce(e.currentTarget.value.replace(/\D/gu,``))}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Cancel`}),(0,Q.jsx)(q,{disabled:me||Se.length<6,onClick:()=>{be!==null&&Je(be,Se)},children:`Confirm`})]})]})})]})}var _t=443,vt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function yt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:vt.format(t)}function bt(e){let t=(0,Z.c)(21),{tooltipText:n,dotClassName:r,pingClassName:i}=e,a;t[0]===i?a=t[1]:(a=i?(0,Q.jsx)(`span`,{className:G(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,i)}):null,t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=G(`relative inline-flex size-2 rounded-full`,r),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,Q.jsx)(`span`,{className:o}),t[4]=o,t[5]=s);let c;t[6]!==a||t[7]!==s?(c=(0,Q.jsxs)(Q.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8];let l=c;if(!n){let e;return t[9]===l?e=t[10]:(e=(0,Q.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:l}),t[9]=l,t[10]=e),e}let u;t[11]!==l||t[12]!==n?(u=(0,Q.jsx)(`button`,{type:`button`,title:n,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:l}),t[11]=l,t[12]=n,t[13]=u):u=t[13];let d=u,f;t[14]===d?f=t[15]:(f=(0,Q.jsx)(K,{render:d}),t[14]=d,t[15]=f);let p;t[16]===n?p=t[17]:(p=(0,Q.jsx)(se,{side:`top`,className:`max-w-80 whitespace-pre-wrap leading-tight`,children:n}),t[16]=n,t[17]=p);let m;return t[18]!==f||t[19]!==p?(m=(0,Q.jsxs)(ce,{children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function xt(e,t,n){let r=e?.connectionState??`disconnected`;if(r===`connected`){let r=e?.connectedAt??t.lastConnectedAt;return r?`Connected for ${oe(r,n)}`:null}return r===`connecting`?null:r===`error`?e?.lastError??`An unknown connection error occurred.`:t.lastConnectedAt?`Last connected at ${yt(t.lastConnectedAt)}`:`Not connected yet.`}function St(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function Ct(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function wt(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=P(n);if(r)return{host:r.host,pairingCode:r.token};let i=j(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function Tt(e){let t=wt(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function Et(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var Dt=`border-t border-border/60 px-4 py-4 first:border-t-0 sm:px-5`,Ot=`border-t border-border/60 px-4 py-2.5 first:border-t-0 sm:px-5`,kt=`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`;function At(e){return Dt}function jt(e,t){return e===`endpoint-rail`?G(`relative border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,!t&&`bg-muted/20`):G(Ot,!t&&`bg-muted/24`)}function Mt(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function Nt(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function Pt(e){return{...e,createdAt:r(e.createdAt),expiresAt:r(e.expiresAt)}}function Ft(e){return{...e,issuedAt:r(e.issuedAt),expiresAt:r(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:r(e.lastConnectedAt)}}function It(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return Mt([...e,t]);let r=[...e];return r[n]=t,Mt(r)}function Lt(e,t){return e.filter(e=>e.id!==t)}function Rt(e,t){let n=e.findIndex(e=>e.sessionId===t.sessionId);if(n===-1)return Nt([...e,t]);let r=[...e];return r[n]=t,Nt(r)}function zt(e,t){return e.filter(e=>e.sessionId!==t)}function Bt(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>Ht(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function Vt(e){return e.id.startsWith(`tailscale-magicdns:`)}function Ht(e){if(e.id.startsWith(`desktop-loopback:`)||e.id.startsWith(`server-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`)||e.id.startsWith(`server-network:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(Vt(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function Ut(e){switch(e){case`mixed-content-blocked`:return`Hosted app blocked`;case`requires-configuration`:return`Setup required for hosted app`;default:return null}}function Wt(e){switch(e){case`mixed-content-blocked`:return`The hosted HTTPS app cannot connect to HTTP endpoints because browsers block mixed content.`;case`requires-configuration`:return`Configure HTTPS access before using this endpoint from the hosted app.`;default:return null}}function Gt(e,t){return e.compatibility.hostedHttpsApp===`compatible`?tt(e.httpBaseUrl,t)??et(e.httpBaseUrl,t):et(e.httpBaseUrl,t)}function Kt(e){let t=new URL(`/pair`,window.location.href);return A(t,e).toString()}function qt(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}var Jt=(0,X.memo)(function(e){let t=(0,Z.c)(146),{pairingLink:n,endpointUrl:r,endpoints:i,defaultEndpointKey:a,presentation:o,revokingPairingLinkId:s,onRevoke:c}=e,l=o===void 0?`current`:o,u=Ve(1e3),d;t[0]===n.expiresAt?d=t[1]:(d=new Date(n.expiresAt).getTime(),t[0]=n.expiresAt,t[1]=d);let f=d,[p,m]=(0,X.useState)(!1),h;t[2]===n.credential?h=t[3]:(h=Kt(n.credential),t[2]=n.credential,t[3]=h);let g=h,_;t[4]!==r||t[5]!==n.credential?(_=r!=null&&r!==``?tt(r,n.credential):null,t[4]=r,t[5]=n.credential,t[6]=_):_=t[6];let v=_,y;if(t[7]!==a||t[8]!==i||t[9]!==n.credential){let e=Bt(i,a);y=e?Gt(e,n.credential):null,t[7]=a,t[8]=i,t[9]=n.credential,t[10]=y}else y=t[10];let b=y,S;if(t[11]!==i||t[12]!==n.credential){let e;t[14]===n.credential?e=t[15]:(e=e=>{let t=Gt(e,n.credential);return{key:Ht(e),label:e.label,url:t,detail:qt(t)?`Hosted app link`:`Backend pairing URL`}},t[14]=n.credential,t[15]=e),S=i.filter(an).map(e),t[11]=i,t[12]=n.credential,t[13]=S}else S=t[13];let C=S,w;t[16]!==g||t[17]!==b||t[18]!==r||t[19]!==v||t[20]!==n.credential?(w=b??(r!=null&&r!==``?v??et(r,n.credential):x(window.location.hostname)?null:g),t[16]=g,t[17]=b,t[18]=r,t[19]=v,t[20]=n.credential,t[21]=w):w=t[21];let T=w,E=T??n.credential,D=T!==null&&qt(T),O=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k={onCopy:on,onError:(e,t)=>{m(!0),V.add(pe({type:`error`,title:O?t===`hosted-link`?`Could not copy hosted app link`:t===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:O?e.message:`Showing the full value instead.`}))}},t[22]=k):k=t[22];let{copyToClipboard:A}=fe(k),j;t[23]===A?j=t[24]:(j=(e,t)=>{A(e,t)},t[23]=A,t[24]=j);let M=j,N=sn,P;t[25]!==M||t[26]!==n.credential?(P=()=>{M(n.credential,`code`)},t[25]=M,t[26]=n.credential,t[27]=P):P=t[27];let F=P,I;t[28]!==M||t[29]!==T?(I=()=>{T&&M(T,N(T))},t[28]=M,t[29]=T,t[30]=I):I=t[30];let ee=I,L;t[31]===n.expiresAt?L=t[32]:(L=yt(n.expiresAt),t[31]=n.expiresAt,t[32]=L);let R=L,z=n.role===`owner`?`Owner`:`Client`,B=n.label??`${z} link`,te;t[33]!==a||t[34]!==C?(te=C.find(e=>e.key===a)??C[0]??null,t[33]=a,t[34]=C,t[35]=te):te=t[35];let H=te?.label??`URL`,W,re,ie,G,oe,K,se,ce,le;if(t[36]!==M||t[37]!==H||t[38]!==C||t[39]!==R||t[40]!==f||t[41]!==F||t[42]!==ee||t[43]!==p||t[44]!==u||t[45]!==n.createdAt||t[46]!==n.expiresAt||t[47]!==l||t[48]!==B||t[49]!==z||t[50]!==T){le=Symbol.for(`react.early_return_sentinel`);bb0:{let e=C.filter(cn),r=C.filter(ln),i;t[60]!==M||t[61]!==C?(i=(e,t)=>{let n=e===void 0?C:e,r=t===void 0||t;return n.map(e=>(0,Q.jsx)(Oe,{onClick:()=>M(e.url,N(e.url)),children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:e.label}),r?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.detail}):null]})},e.key))},t[60]=M,t[61]=C,t[62]=i):i=t[62];let a=i,o;t[63]===F?o=t[64]:(o=e=>(0,Q.jsx)(Oe,{onClick:F,children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:`Copy code`}),e===void 0||e?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:`Token only`}):null]})}),t[63]=F,t[64]=o);let s=o,c;t[65]===a?c=t[66]:(c=(e,t,n)=>t.length>0?(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(we,{}):null,(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:e}),a(t,!1)]})]}):null,t[65]=a,t[66]=c);let d=c,h=t=>(0,Q.jsxs)(Q.Fragment,{children:[t?.codeFirst?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:`Pairing code`}),s(!1)]}),C.length>0?(0,Q.jsx)(we,{}):null]}):null,d(`Pairing URLs`,e,!1),d(`Hosted app link`,r,e.length>0),t?.codeFirst?null:(0,Q.jsxs)(Q.Fragment,{children:[C.length>0?(0,Q.jsx)(we,{}):null,(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:`Pairing code`}),s(!1)]})]})]});if(f<=u){le=null;break bb0}t[67]===l?ce=t[68]:(ce=At(l),t[67]=l,t[68]=ce),K=kt;let g;t[69]===n.createdAt?g=t[70]:(g=yt(n.createdAt),t[69]=n.createdAt,t[70]=g);let _=`Link created at ${g}`,v;t[71]===_?v=t[72]:(v=(0,Q.jsx)(bt,{tooltipText:_,dotClassName:`bg-amber-400`}),t[71]=_,t[72]=v);let y;t[73]===B?y=t[74]:(y=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:B}),t[73]=B,t[74]=y);let b;t[75]===T?b=t[76]:(b=T?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ze,{openOnHover:!0,delay:250,closeDelay:100,render:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/50 outline-none hover:text-foreground`,"aria-label":`Show QR code`}),children:(0,Q.jsx)(U,{"aria-hidden":!0,className:`size-3`})}),(0,Q.jsx)(Re,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max`,children:(0,Q.jsx)(Ye,{value:T,size:88,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})})]}):null,t[75]=T,t[76]=b);let x;t[77]===b?x=t[78]:(x=(0,Q.jsx)(Be,{children:b}),t[77]=b,t[78]=x);let S;t[79]!==v||t[80]!==y||t[81]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[v,y,x]}),t[79]=v,t[80]=y,t[81]=x,t[82]=S):S=t[82];let w;t[83]!==u||t[84]!==n.expiresAt?(w=ae(n.expiresAt,u),t[83]=u,t[84]=n.expiresAt,t[85]=w):w=t[85];let E;t[86]!==z||t[87]!==w?(E=[z,w],t[86]=z,t[87]=w,t[88]=E):E=t[88];let D=E.join(` · `),k;t[89]!==R||t[90]!==D?(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:R,children:D}),t[89]=R,t[90]=D,t[91]=k):k=t[91];let A;t[92]===T?A=t[93]:(A=T===null?(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null,t[92]=T,t[93]=A),t[94]!==S||t[95]!==k||t[96]!==A?(se=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[S,k,A]}),t[94]=S,t[95]=k,t[96]=A,t[97]=se):se=t[97],oe=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,W=Se,re=p,ie=m,G=O?(0,Q.jsx)(Q.Fragment,{children:T?(0,Q.jsxs)(Je,{"aria-label":`Copy selected endpoint`,children:[(0,Q.jsx)(q,{size:`xs`,variant:`outline`,className:`max-w-56`,title:`Copy pairing URL for: ${H}`,onClick:ee,children:(0,Q.jsxs)(`span`,{className:`truncate`,children:[`Copy pairing URL for: `,H]})}),(0,Q.jsx)(qe,{}),(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(De,{render:(0,Q.jsx)(q,{size:`icon-xs`,variant:`outline`,"aria-label":`Choose endpoint to copy`}),children:(0,Q.jsx)(ne,{className:`size-3.5`})}),(0,Q.jsx)(J,{align:`end`,className:`min-w-60`,children:h()})]})]}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:F,children:`Copy code`})}):(0,Q.jsx)(_e,{render:(0,Q.jsx)(q,{size:`xs`,variant:`outline`}),children:T?`Show link`:`Show code`})}t[36]=M,t[37]=H,t[38]=C,t[39]=R,t[40]=f,t[41]=F,t[42]=ee,t[43]=p,t[44]=u,t[45]=n.createdAt,t[46]=n.expiresAt,t[47]=l,t[48]=B,t[49]=z,t[50]=T,t[51]=W,t[52]=re,t[53]=ie,t[54]=G,t[55]=oe,t[56]=K,t[57]=se,t[58]=ce,t[59]=le}else W=t[51],re=t[52],ie=t[53],G=t[54],oe=t[55],K=t[56],se=t[57],ce=t[58],le=t[59];if(le!==Symbol.for(`react.early_return_sentinel`))return le;let ue=T?D?`Hosted app pairing link`:`Pairing link`:`Pairing code`,de;t[98]===ue?de=t[99]:(de=(0,Q.jsx)(he,{children:ue}),t[98]=ue,t[99]=de);let ve=T?D?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,ke;t[100]===ve?ke=t[101]:(ke=(0,Q.jsx)(be,{children:ve}),t[100]=ve,t[101]=ke);let je;t[102]!==de||t[103]!==ke?(je=(0,Q.jsxs)(me,{children:[de,ke]}),t[102]=de,t[103]=ke,t[104]=je):je=t[104];let Me=T?4:3,Ne;t[105]!==E||t[106]!==Me?(Ne=(0,Q.jsx)(Ae,{readOnly:!0,value:E,rows:Me,className:`text-xs leading-relaxed`,onFocus:un,onClick:dn}),t[105]=E,t[106]=Me,t[107]=Ne):Ne=t[107];let Pe;t[108]===T?Pe=t[109]:(Pe=T?(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,Q.jsx)(Ye,{value:T,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[108]=T,t[109]=Pe);let Fe;t[110]!==Ne||t[111]!==Pe?(Fe=(0,Q.jsxs)(ye,{className:`space-y-4`,children:[Ne,Pe]}),t[110]=Ne,t[111]=Pe,t[112]=Fe):Fe=t[112];let Ie;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,Q.jsx)(q,{variant:`outline`,onClick:()=>m(!1),children:`Done`}),t[113]=Ie):Ie=t[113];let Le;t[114]===F?Le=t[115]:(Le=O?(0,Q.jsx)(q,{variant:`outline`,size:`xs`,onClick:F,children:`Copy code`}):null,t[114]=F,t[115]=Le);let He;t[116]===Le?He=t[117]:(He=(0,Q.jsxs)(ge,{variant:`bare`,children:[Ie,Le]}),t[116]=Le,t[117]=He);let Ue;t[118]!==je||t[119]!==Fe||t[120]!==He?(Ue=(0,Q.jsxs)(xe,{className:`max-w-md`,children:[je,Fe,He]}),t[118]=je,t[119]=Fe,t[120]=He,t[121]=Ue):Ue=t[121];let Y;t[122]!==W||t[123]!==re||t[124]!==ie||t[125]!==G||t[126]!==Ue?(Y=(0,Q.jsxs)(W,{open:re,onOpenChange:ie,children:[G,Ue]}),t[122]=W,t[123]=re,t[124]=ie,t[125]=G,t[126]=Ue,t[127]=Y):Y=t[127];let We=s===n.id,Ge;t[128]!==c||t[129]!==n.id?(Ge=()=>void c(n.id),t[128]=c,t[129]=n.id,t[130]=Ge):Ge=t[130];let Ke=s===n.id?`Revoking…`:`Revoke`,Xe;t[131]!==We||t[132]!==Ge||t[133]!==Ke?(Xe=(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:We,onClick:Ge,children:Ke}),t[131]=We,t[132]=Ge,t[133]=Ke,t[134]=Xe):Xe=t[134];let Ze;t[135]!==oe||t[136]!==Y||t[137]!==Xe?(Ze=(0,Q.jsxs)(`div`,{className:oe,children:[Y,Xe]}),t[135]=oe,t[136]=Y,t[137]=Xe,t[138]=Ze):Ze=t[138];let Qe;t[139]!==K||t[140]!==se||t[141]!==Ze?(Qe=(0,Q.jsxs)(`div`,{className:K,children:[se,Ze]}),t[139]=K,t[140]=se,t[141]=Ze,t[142]=Qe):Qe=t[142];let $e;return t[143]!==ce||t[144]!==Qe?($e=(0,Q.jsx)(`div`,{className:ce,children:Qe}),t[143]=ce,t[144]=Qe,t[145]=$e):$e=t[145],$e}),Yt=(0,X.memo)(function(e){let t=(0,Z.c)(50),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a}=e,o=r===void 0?`current`:r,s=Ve(1e3),c=n.current||n.connected,l=n.lastConnectedAt,u;t[0]!==c||t[1]!==l||t[2]!==s?(u=c?l?`Connected for ${oe(l,s)}`:`Connected`:l?`Last connected at ${yt(l)}`:`Not connected yet.`,t[0]=c,t[1]=l,t[2]=s,t[3]=u):u=t[3];let d=u,f=n.role===`owner`?`Owner`:`Client`,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(fn),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===o?x=t[17]:(x=At(o),t[16]=o,t[17]=x);let S=c?`bg-success`:`bg-muted-foreground/30`,C;t[18]!==d||t[19]!==S?(C=(0,Q.jsx)(bt,{tooltipText:d,dotClassName:S,pingClassName:null}),t[18]=d,t[19]=S,t[20]=C):C=t[20];let w;t[21]===b?w=t[22]:(w=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:b}),t[21]=b,t[22]=w);let T;t[23]===n.current?T=t[24]:(T=n.current?(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 rounded-md border border-border/50 bg-muted/50 px-1 py-0.5`,children:`This device`}):null,t[23]=n.current,t[24]=T);let E;t[25]!==C||t[26]!==w||t[27]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[C,w,T]}),t[25]=C,t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==v||t[30]!==f?(D=[f,...v],t[29]=v,t[30]=f,t[31]=D):D=t[31];let O=D.join(` · `),k;t[32]===O?k=t[33]:(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:O}),t[32]=O,t[33]=k);let A;t[34]!==E||t[35]!==k?(A=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,k]}),t[34]=E,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==n.current||t[38]!==n.sessionId||t[39]!==a||t[40]!==i?(j=n.current?null:(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[37]=n.current,t[38]=n.sessionId,t[39]=a,t[40]=i,t[41]=j):j=t[41];let M;t[42]===j?M=t[43]:(M=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:j}),t[42]=j,t[43]=M);let N;t[44]!==A||t[45]!==M?(N=(0,Q.jsxs)(`div`,{className:kt,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;return t[47]!==N||t[48]!==x?(P=(0,Q.jsx)(`div`,{className:x,children:N}),t[47]=N,t[48]=x,t[49]=P):P=t[49],P}),Xt=(0,X.memo)(function({clientSessions:e,isRevokingOtherClients:t,onRevokeOtherClients:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),[s,c]=(0,X.useState)(!1),l=(0,X.useCallback)(async()=>{c(!0);try{await D(a),o(``),i(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;V.add(pe({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{c(!1)}},[a]);return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:t||e.every(e=>e.current),onClick:()=>void n(),children:t?`Revoking…`:`Revoke others`}),(0,Q.jsxs)(Se,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Q.jsx)(_e,{render:(0,Q.jsxs)(q,{size:`xs`,variant:`default`,children:[(0,Q.jsx)(H,{className:`size-3`}),`Create link`]})}),(0,Q.jsxs)(xe,{className:`max-w-sm`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Create pairing link`}),(0,Q.jsx)(be,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,Q.jsx)(ye,{children:(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,Q.jsx)(ue,{value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Living room iPad`,disabled:s,autoFocus:!0})]})}),(0,Q.jsxs)(ge,{variant:`bare`,children:[(0,Q.jsx)(q,{variant:`outline`,disabled:s,onClick:()=>i(!1),children:`Cancel`}),(0,Q.jsx)(q,{disabled:s,onClick:()=>void l(),children:s?`Creating…`:`Create link`})]})]})]})]})}),Zt=(0,X.memo)(function(e){let t=(0,Z.c)(33),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,clientSessions:c,revokingPairingLinkId:l,revokingClientSessionId:u,onRevokePairingLink:d,onRevokeClientSession:f}=e,p=a===void 0?`current`:a,m;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==d||t[4]!==s||t[5]!==p||t[6]!==l){let e;t[8]!==i||t[9]!==n||t[10]!==r||t[11]!==d||t[12]!==p||t[13]!==l?(e=e=>(0,Q.jsx)(Jt,{pairingLink:e,endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:p,revokingPairingLinkId:l,onRevoke:d},e.id),t[8]=i,t[9]=n,t[10]=r,t[11]=d,t[12]=p,t[13]=l,t[14]=e):e=t[14],m=s.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=d,t[4]=s,t[5]=p,t[6]=l,t[7]=m}else m=t[7];let h;if(t[15]!==c||t[16]!==f||t[17]!==p||t[18]!==u){let e;t[20]!==f||t[21]!==p||t[22]!==u?(e=e=>(0,Q.jsx)(Yt,{clientSession:e,presentation:p,revokingClientSessionId:u,onRevokeSession:f},e.sessionId),t[20]=f,t[21]=p,t[22]=u,t[23]=e):e=t[23],h=c.map(e),t[15]=c,t[16]=f,t[17]=p,t[18]=u,t[19]=h}else h=t[19];let g;t[24]!==c.length||t[25]!==o||t[26]!==s.length||t[27]!==p?(g=s.length===0&&c.length===0&&!o?(0,Q.jsx)(`div`,{className:At(p),children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[24]=c.length,t[25]=o,t[26]=s.length,t[27]=p,t[28]=g):g=t[28];let _;return t[29]!==m||t[30]!==h||t[31]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[m,h,g]}),t[29]=m,t[30]=h,t[31]=g,t[32]=_):_=t[32],_}),Qt=(0,X.memo)(function(e){let t=(0,Z.c)(58),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=Vt(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n.compatibility.hostedHttpsApp?p=t[3]:(p=Ut(n.compatibility.hostedHttpsApp),t[2]=n.compatibility.hostedHttpsApp,t[3]=p);let m=p,h;t[4]===n.compatibility.hostedHttpsApp?h=t[5]:(h=Wt(n.compatibility.hostedHttpsApp),t[4]=n.compatibility.hostedHttpsApp,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=Vt(n)&&n.status===`available`,t[6]=n,t[7]=_);let v=_,y=!f,b=l===`endpoint-rail`,x;t[8]!==u||t[9]!==l?(x=jt(l,u),t[8]=u,t[9]=l,t[10]=x):x=t[10];let S;t[11]!==r||t[12]!==b?(S=b&&r?(0,Q.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[11]=r,t[12]=b,t[13]=S):S=t[13];let C;t[14]===n.label?C=t[15]:(C=(0,Q.jsx)(`h3`,{className:`shrink-0 text-sm leading-5 font-medium text-foreground`,children:n.label}),t[14]=n.label,t[15]=C);let w;t[16]!==n.httpBaseUrl||t[17]!==y?(w=y?(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,title:n.httpBaseUrl,children:n.httpBaseUrl}):null,t[16]=n.httpBaseUrl,t[17]=y,t[18]=w):w=t[18];let T;t[19]===u?T=t[20]:(T=u?null:(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-[10px] text-muted-foreground`,children:`Setup required`}),t[19]=u,t[20]=T);let E;t[21]!==g||t[22]!==m?(E=m?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 px-1 py-0.5 text-[10px] text-amber-700 dark:text-amber-300`,title:g??void 0,children:[(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-3`}),m]}):null,t[21]=g,t[22]=m,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==C||t[27]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[C,w,T,E]}),t[24]=T,t[25]=E,t[26]=C,t[27]=w,t[28]=D):D=t[28];let O;t[29]===r?O=t[30]:(O=r?(0,Q.jsx)(`span`,{className:`rounded-md border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] text-primary`,children:`Default`}):null,t[29]=r,t[30]=O);let k;t[31]!==n||t[32]!==c||t[33]!==f||t[34]!==o?(k=f?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[31]=n,t[32]=c,t[33]=f,t[34]=o,t[35]=k):k=t[35];let A;t[36]!==v||t[37]!==n||t[38]!==c||t[39]!==s?(A=v?(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[36]=v,t[37]=n,t[38]=c,t[39]=s,t[40]=A):A=t[40];let j;t[41]!==n||t[42]!==r||t[43]!==f||t[44]!==a?(j=!f&&!r?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[41]=n,t[42]=r,t[43]=f,t[44]=a,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==k||t[48]!==A||t[49]!==j?(M=(0,Q.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[O,k,A,j]}),t[46]=O,t[47]=k,t[48]=A,t[49]=j,t[50]=M):M=t[50];let N;t[51]!==D||t[52]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[D,M]}),t[51]=D,t[52]=M,t[53]=N):N=t[53];let P;return t[54]!==N||t[55]!==x||t[56]!==S?(P=(0,Q.jsxs)(`div`,{className:x,children:[S,N]}),t[54]=N,t[55]=x,t[56]=S,t[57]=P):P=t[57],P});function $t(e){let t=(0,Z.c)(17),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]===n.compatibility.hostedHttpsApp?c=t[3]:(c=Ut(n.compatibility.hostedHttpsApp)?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,title:Wt(n.compatibility.hostedHttpsApp)??void 0,children:[(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-3`}),Ut(n.compatibility.hostedHttpsApp)]}):null,t[2]=n.compatibility.hostedHttpsApp,t[3]=c);let l;t[4]!==i||t[5]!==r?(l=r>0?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[4]=i,t[5]=r,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==d?(p=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[f,r>0?(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:d}):(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:d})]}),t[12]=i,t[13]=r,t[14]=a,t[15]=d,t[16]=p):p=t[16],p}function en(e){let t=(0,Z.c)(57),{environmentId:n,reconnectingEnvironmentId:r,disconnectingEnvironmentId:i,removingEnvironmentId:a,onConnect:o,onDisconnect:c,onRemove:l}=e,u=Ve(1e3),d;t[0]===n?d=t[1]:(d=e=>e.byId[n]??null,t[0]=n,t[1]=d);let f=s(d),p;t[2]===n?p=t[3]:(p=e=>e.byId[n]??null,t[2]=n,t[3]=p);let g=h(p);if(!f)return null;let _=g?.connectionState??`disconnected`,v=_===`connected`,y=_===`connecting`||r===n,b=i===n,x=_===`connected`?`bg-success`:_===`connecting`?`bg-warning`:_===`error`?`bg-destructive`:`bg-muted-foreground/40`,S=g?.role?g.role===`owner`?`Owner`:`Client`:null,C=g?.descriptor?.label??null??f.label,w;t[4]!==u||t[5]!==f||t[6]!==g?(w=xt(g,f,u),t[4]=u,t[5]=f,t[6]=g,t[7]=w):w=t[7];let T=w,E=g?.serverConfig,D;t[8]===E?D=t[9]:(D=m(E),t[8]=E,t[9]=D);let O=D,k;t[10]===f.desktopSsh?k=t[11]:(k=f.desktopSsh?`SSH ${St(f.desktopSsh)}`:null,t[10]=f.desktopSsh,t[11]=k);let A;t[12]===f.lastConnectedAt?A=t[13]:(A=f.lastConnectedAt?`Last connected ${yt(f.lastConnectedAt)}`:null,t[12]=f.lastConnectedAt,t[13]=A);let j;t[14]!==S||t[15]!==k||t[16]!==A?(j=[k,S,A].filter(tn),t[14]=S,t[15]=k,t[16]=A,t[17]=j):j=t[17];let M=j,N=_===`connecting`?`bg-warning/60 duration-2000`:null,P;t[18]!==x||t[19]!==T||t[20]!==N?(P=(0,Q.jsx)(bt,{tooltipText:T,dotClassName:x,pingClassName:N}),t[18]=x,t[19]=T,t[20]=N,t[21]=P):P=t[21];let F;t[22]===C?F=t[23]:(F=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:C}),t[22]=C,t[23]=F);let I;t[24]!==P||t[25]!==F?(I=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[P,F]}),t[24]=P,t[25]=F,t[26]=I):I=t[26];let ee;t[27]===M?ee=t[28]:(ee=M.length>0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M.join(` · `)}):null,t[27]=M,t[28]=ee);let L;t[29]===O?L=t[30]:(L=O?(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-warning text-xs`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`Version drift: client `,O.clientVersion,`, server`,` `,O.serverVersion,`.`]}):null,t[29]=O,t[30]=L);let R;t[31]!==I||t[32]!==ee||t[33]!==L?(R=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[I,ee,L]}),t[31]=I,t[32]=ee,t[33]=L,t[34]=R):R=t[34];let z=v?b:y,B;t[35]!==n||t[36]!==v||t[37]!==o||t[38]!==c?(B=()=>void(v?c(n):o(n)),t[35]=n,t[36]=v,t[37]=o,t[38]=c,t[39]=B):B=t[39];let te=v?b?`Disconnecting…`:`Disconnect`:y?`Connecting…`:`Connect`,ne;t[40]!==z||t[41]!==B||t[42]!==te?(ne=(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:z,onClick:B,children:te}),t[40]=z,t[41]=B,t[42]=te,t[43]=ne):ne=t[43];let V=a===n,H;t[44]!==n||t[45]!==l?(H=()=>void l(n),t[44]=n,t[45]=l,t[46]=H):H=t[46];let U=a===n?`Removing…`:`Remove`,W;t[47]!==V||t[48]!==H||t[49]!==U?(W=(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:V,onClick:H,children:U}),t[47]=V,t[48]=H,t[49]=U,t[50]=W):W=t[50];let re;t[51]!==ne||t[52]!==W?(re=(0,Q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[ne,W]}),t[51]=ne,t[52]=W,t[53]=re):re=t[53];let G;return t[54]!==R||t[55]!==re?(G=(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsxs)(`div`,{className:kt,children:[R,re]})}),t[54]=R,t[55]=re,t[56]=G):G=t[56],G}function tn(e){return e!==null}var nn=(0,X.memo)(function(e){let t=(0,Z.c)(24),{target:n,connectingHostAlias:r,onConnect:i}=e,a;t[0]===n?a=t[1]:(a=St(n),t[0]=n,t[1]=a);let o=a,s=o!==n.alias,c=r===n.alias?`Adding…`:`Add environment`,l;t[2]===n.alias?l=t[3]:(l=(0,Q.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:n.alias}),t[2]=n.alias,t[3]=l);let u;t[4]!==o||t[5]!==s?(u=s?(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:o}):null,t[4]=o,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=r===n.alias,p;t[10]!==i||t[11]!==n?(p=()=>i(n),t[10]=i,t[11]=n,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==n.alias?(m=r===n.alias?(0,Q.jsx)(W,{className:`size-3 animate-spin`}):null,t[13]=r,t[14]=n.alias,t[15]=m):m=t[15];let h;t[16]!==c||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,disabled:f,onClick:p,children:[m,c]})}),t[16]=c,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:kt,children:[d,h]})}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g});function rn(){let e=window.desktopBridge,[t,n]=(0,X.useState)(e?`owner`:null),[r,i]=(0,X.useState)(null),o=s(e=>e.byId),h=(0,X.useMemo)(()=>Object.values(o).toSorted((e,t)=>e.label.localeCompare(t.label)).map(e=>e.environmentId),[o]),v=(0,X.useMemo)(()=>Object.values(o).reduce((e,t)=>(t.desktopSsh?.alias&&(e[t.desktopSsh.alias]=t),e),{}),[o]),b=(0,X.useMemo)(()=>{let e=new Set;for(let t of Object.values(o)){let n=t.desktopSsh;n&&(e.add(n.alias),e.add(St(n)))}return e},[o]),[x,S]=(0,X.useState)([]),[C,T]=(0,X.useState)(!1),[E,D]=(0,X.useState)(!1),[O,k]=(0,X.useState)(null),[A,j]=(0,X.useState)(null),[M,N]=(0,X.useState)(null),[P,F]=(0,X.useState)([]),[I,L]=(0,X.useState)(null),[R,z]=(0,X.useState)([]),[B,te]=(0,X.useState)([]),[ne,U]=(0,X.useState)(null),[ae,oe]=(0,X.useState)(!1),[fe,Ce]=(0,X.useState)(null),[J,we]=(0,X.useState)(null),[Te,Ee]=(0,X.useState)(!1),[De,Oe]=(0,X.useState)(!1),[Ae,Re]=(0,X.useState)(`remote`),[ze,Be]=(0,X.useState)(``),[Ve,We]=(0,X.useState)(``),[Ge,qe]=(0,X.useState)(``),[Je,Ye]=(0,X.useState)(``),[Xe,Ze]=(0,X.useState)(``),[Qe,Z]=(0,X.useState)(null),[et,tt]=(0,X.useState)(!1),nt=(0,X.useMemo)(()=>x.filter(e=>{let t=St(e);return!b.has(e.alias)&&!b.has(t)}),[x,b]),[$,rt]=(0,X.useState)(null),[it,at]=(0,X.useState)(null),[ot,st]=(0,X.useState)(null),[ct,lt]=(0,X.useState)(!1),[ut,dt]=(0,X.useState)(!1),[ft,pt]=(0,X.useState)(!1),[mt,ht]=(0,X.useState)(null),[vt,yt]=(0,X.useState)(!1),[bt,xt]=(0,X.useState)(String(_t)),[Ot,kt]=(0,X.useState)(null),jt=a(),Ut=m(jt),[Wt,Gt]=(0,X.useState)(!1),Kt=ee(e=>e.defaultAdvertisedEndpointKey),qt=ee(e=>e.setDefaultAdvertisedEndpointKey),Jt=t===`owner`,Yt=e?M?.mode===`network-accessible`:r===`remote-reachable`,tn=bt.trim(),rn=Number(tn),an=/^\d+$/u.test(tn)&&Number.isInteger(rn)&&rn>=1&&rn<=65535,on=(0,X.useMemo)(()=>{if(!mt)return null;if(!an||rn===_t)return mt.httpBaseUrl;try{let e=new URL(mt.httpBaseUrl);return e.port=String(rn),e.toString().replace(/\/$/u,``)}catch{return mt.httpBaseUrl}},[an,rn,mt]),sn=(0,X.useCallback)(async t=>{if(e){lt(!0),L(null);try{let n=await e.setServerExposureMode(t?`network-accessible`:`local-only`);N(n),dt(!1),lt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;dt(!1),L(t),V.add(pe({type:`error`,title:`Could not update network access`,description:t})),lt(!1)}}},[e]),cn=(0,X.useCallback)(()=>{Ot!==null&&sn(Ot===`network-accessible`)},[sn,Ot]),ln=(0,X.useCallback)(async()=>{if(e&&an){pt(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!0,port:rn});N(t),ht(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;L(t),V.add(pe({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,an,rn]),un=(0,X.useCallback)(e=>{xt(String(M?.tailscaleServePort??_t)),ht(e)},[M?.tailscaleServePort]),dn=(0,X.useCallback)(async()=>{if(e){pt(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!1,port:M?.tailscaleServePort??_t});N(t),yt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;L(t),V.add(pe({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,M?.tailscaleServePort]),fn=(0,X.useCallback)(e=>{yt(!0)},[]),pn=(0,X.useCallback)(async e=>{Ce(e),U(null);try{await y(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;U(t),V.add(pe({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{Ce(null)}},[]),mn=(0,X.useCallback)(async e=>{we(e),U(null);try{await w(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;U(t),V.add(pe({type:`error`,title:`Could not revoke client access`,description:t}))}finally{we(null)}},[]),hn=(0,X.useCallback)(async()=>{Ee(!0),U(null);try{let e=await g();V.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;U(t),V.add(pe({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{Ee(!1)}},[]),gn=(0,X.useCallback)(async()=>{if(Ae===`ssh`){tt(!0),Z(null);try{let e=Ct({host:Ge,username:Je,port:Xe}),t=await f(e,{label:``});Be(``),We(``),qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:`Environment connected`,description:`${t.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Et(e);Z(t)}finally{tt(!1)}return}tt(!0),Z(null);try{let e=Tt({host:ze,pairingCode:Ve}),t=await d({label:``,...e});Be(``),We(``),qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:`Backend added`,description:`${t.label} is now saved and will reconnect on app startup.`})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;Z(t),V.add(pe({type:`error`,title:`Could not add backend`,description:t}))}finally{tt(!1)}},[ze,Ae,Ve,Ge,Xe,Je]),_n=(0,X.useCallback)(async e=>{rt(e),Z(null);try{await u(e)}catch(e){let t=e instanceof Error?e.message:`Failed to connect backend.`;Z(t),V.add(pe({type:`error`,title:`Could not connect backend`,description:t}))}finally{rt(null)}},[]),vn=(0,X.useCallback)(async e=>{at(e),Z(null);try{await p(e)}catch(e){let t=e instanceof Error?e.message:`Failed to disconnect backend.`;Z(t),V.add(pe({type:`error`,title:`Could not disconnect backend`,description:t}))}finally{at(null)}},[]),yn=(0,X.useCallback)(async e=>{st(e),Z(null);try{await c(e)}catch(e){let t=e instanceof Error?e.message:`Failed to remove backend.`;Z(t),V.add(pe({type:`error`,title:`Could not remove backend`,description:t}))}finally{st(null)}},[]),bn=(0,X.useCallback)(async()=>{if(!e){S([]),T(!1),k(null);return}D(!0),k(null);try{let t=await e.discoverSshHosts();S(t),T(!0)}catch(e){let t=e instanceof Error?e.message:`Failed to discover SSH hosts.`;k(t),T(!0)}finally{D(!1)}},[e]),xn=(0,X.useCallback)(async(e,t)=>{j(e.alias),Ae===`ssh`?Z(null):k(null);try{let n=await f(e,t===void 0?void 0:{label:t});qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:v[e.alias]?`Environment reconnected`:`Environment connected`,description:`${n.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Et(e);Ae===`ssh`?Z(t):k(t)}finally{j(null)}},[Ae,v]);(0,X.useEffect)(()=>{!e||!De||Ae!==`ssh`||C||E||bn()},[De,e,C,E,bn,Ae]),(0,X.useEffect)(()=>{if(e){n(`owner`);return}let t=!1;return _().then(e=>{t||(n(e.authenticated?e.role??null:null),i(e.auth.policy))}).catch(()=>{t||(n(null),i(null))}),()=>{t=!0}},[e]),(0,X.useEffect)(()=>{if(!Jt)return;let t=!1;oe(!0);let n=l().client.server.subscribeAuthAccess(e=>{if(!t){switch(e.type){case`snapshot`:z(Mt(e.payload.pairingLinks.map(e=>Pt(e)))),te(Nt(e.payload.clientSessions.map(e=>Ft(e))));break;case`pairingLinkUpserted`:z(t=>It(t,Pt(e.payload)));break;case`pairingLinkRemoved`:z(t=>Lt(t,e.payload.id));break;case`clientUpserted`:te(t=>Rt(t,Ft(e.payload)));break;case`clientRemoved`:te(t=>zt(t,e.payload.sessionId))}U(null),oe(!1)}},{onResubscribe:()=>{t||oe(!0)}});return e?(e.getServerExposureState().then(e=>{t||N(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load network exposure state.`;L(n)}),e.getAdvertisedEndpoints().then(e=>{t||F(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})):(N(null),l().client.server.getAdvertisedEndpoints().then(e=>{t||F(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})),()=>{t=!0,n()}},[Jt,e]),(0,X.useEffect)(()=>{Jt||(oe(!1),z([]),te([]),U(null),N(null),F([]),L(null))},[Jt]);let Sn=(0,X.useMemo)(()=>R.filter(e=>e.role===`client`),[R]),Cn=(0,X.useMemo)(()=>P.find(Vt)??null,[P]),wn=(0,X.useMemo)(()=>Yt?P.filter(e=>!Vt(e)):[],[P,Yt]),Tn=(0,X.useMemo)(()=>Cn?[...wn,Cn]:wn,[Cn,wn]),En=Yt||Cn?.status===`available`,Dn=(0,X.useMemo)(()=>Bt(wn,Kt),[Kt,wn]),On=(0,X.useMemo)(()=>Dn??Bt(Cn?[Cn]:[],Kt),[Kt,Dn,Cn]),kn=On?Ht(On):null,An=(0,X.useCallback)(e=>{qt(Ht(e))},[qt]),jn=(0,X.useCallback)(e=>{let t=wt(e);if(t){Be(t.host),We(t.pairingCode);return}Be(e)},[]),Mn=e=>{let t=Ae===e.mode;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:G(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:et,onClick:()=>{Re(e.mode)},children:[e.icon?(0,Q.jsx)(`span`,{className:G(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})};return(0,Q.jsxs)(Ue,{children:[Jt?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(He,{title:`Manage local backend`,children:[Ut?(0,Q.jsx)(Y,{title:`Version drift`,description:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`Client `,Ut.clientVersion,`, server`,` `,Ut.serverVersion,`. Sync them if RPC calls or reconnects fail.`]})}):null,e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Network access`,description:Yt?(0,Q.jsx)($t,{endpoint:Dn,hiddenEndpointCount:Math.max(wn.length-1,0),expanded:Wt,onToggleExpanded:()=>Gt(e=>!e),fallback:M?.endpointUrl?`Reachable at ${M.endpointUrl}`:M?.advertisedHost?`Exposed on all interfaces. Pairing links use ${M.advertisedHost}.`:`Exposed on all interfaces.`}):M?`Limited to this machine.`:`Loading…`,status:I?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:I}):null,control:(0,Q.jsx)(le,{checked:M?.mode===`network-accessible`,disabled:!M||ct,onCheckedChange:e=>{kt(e?`network-accessible`:`local-only`),dt(!0)},"aria-label":`Enable network access`})}),(e=>Wt?wn.map(t=>{let n=Ht(t);return(0,Q.jsx)(Qt,{endpoint:t,isDefault:n===kn,presentation:e,onSetDefault:An,onSetupTailscaleServe:un,onDisableTailscaleServe:fn,isUpdatingTailscaleServe:ft},t.id)}):null)(`endpoint-rail`),(0,Q.jsx)(Y,{title:`Tailscale HTTPS`,description:Cn?Cn.status===`available`?Cn.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,control:Cn?(0,Q.jsx)(le,{checked:Cn.status===`available`,disabled:ft,onCheckedChange:e=>{if(e){un(Cn);return}fn(Cn)},"aria-label":`Enable Tailscale HTTPS`}):null})]}):(0,Q.jsx)(Y,{title:`Network access`,description:r===`remote-reachable`?`This backend is already configured for remote access. Network exposure changes must be made where the server is launched.`:`This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing.`,control:(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(K,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(le,{checked:Yt,disabled:!0,"aria-label":`Enable network access`})})}),(0,Q.jsx)(se,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]})})]}),En?(0,Q.jsx)(He,{title:`Authorized clients`,headerAction:(0,Q.jsx)(Xt,{clientSessions:B,isRevokingOtherClients:Te,onRevokeOtherClients:hn}),children:(e=>(0,Q.jsxs)(Q.Fragment,{children:[ne?(0,Q.jsx)(`div`,{className:At(e),children:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:ne})}):null,(0,Q.jsx)(Zt,{endpointUrl:M?.endpointUrl,endpoints:Tn,defaultEndpointKey:kn,presentation:e,isLoading:ae,pairingLinks:Sn,clientSessions:B,revokingPairingLinkId:fe,revokingClientSessionId:J,onRevokePairingLink:pn,onRevokeClientSession:mn})]}))(`current`)}):null,(0,Q.jsx)(Le,{open:ut,onOpenChange:e=>{ct||dt(e)},onOpenChangeComplete:e=>{e||kt(null)},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:Ot===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,Q.jsx)(Fe,{children:Ot===`network-accessible`?`Ryco will restart to expose this environment over the network.`:`Ryco will restart and limit this environment back to this machine.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{disabled:ct,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ct}),children:`Cancel`}),(0,Q.jsx)(q,{variant:Ot===`local-only`?`destructive`:`default`,onClick:cn,disabled:Ot===null||ct,children:ct?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):Ot===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})}),(0,Q.jsx)(Le,{open:vt,onOpenChange:e=>{ft||yt(e)},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Disable Tailscale HTTPS?`}),(0,Q.jsx)(Fe,{children:`Ryco will restart the local backend without Tailscale Serve.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{disabled:ft,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(q,{variant:`destructive`,onClick:()=>void dn(),disabled:ft,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,Q.jsx)(Se,{open:mt!==null,onOpenChange:e=>{ft||e||ht(null)},children:(0,Q.jsxs)(xe,{className:`max-w-md`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Set up Tailscale HTTPS?`}),(0,Q.jsx)(be,{children:`Ryco will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,Q.jsxs)(ye,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,Q.jsx)(ue,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:bt,onChange:e=>xt(e.target.value),disabled:ft})]}),an?null:(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,Q.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,title:on??void 0,children:on??`Pending MagicDNS endpoint`})]})]}),(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(ve,{disabled:ft,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(q,{onClick:()=>void ln(),disabled:ft||!an,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):`Enable`})]})]})})]}):(0,Q.jsx)(He,{title:`Local backend access`,children:(0,Q.jsx)(Y,{title:`Owner tools`,description:`Pairing links and client-session management are only available to owner sessions for this backend.`})}),e?(0,Q.jsx)(gt,{desktopBridge:e}):null,(0,Q.jsxs)(He,{title:`Remote environments`,headerAction:(0,Q.jsxs)(Se,{open:De,onOpenChange:e=>{Oe(e),e||Z(null)},children:[(0,Q.jsx)(_e,{render:(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,children:[(0,Q.jsx)(H,{className:`size-3`}),`Add environment`]})}),(0,Q.jsxs)(xe,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Add Environment`}),(0,Q.jsx)(be,{children:`Pair another environment to this client.`})]}),(0,Q.jsx)(ye,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Mn({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,Q.jsx)($e,{"aria-hidden":!0,className:`size-4`})}),e?Mn({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,Q.jsx)(re,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,Q.jsx)(Ke,{children:Ae===`ssh`?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,Q.jsx)(ue,{value:Ge,onChange:e=>qe(e.target.value),placeholder:`Search hosts or type devbox`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,Q.jsx)(ue,{value:Je,onChange:e=>Ye(e.target.value),placeholder:`root`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,Q.jsx)(ue,{value:Xe,onChange:e=>Ze(e.target.value),placeholder:`22`,inputMode:`numeric`,disabled:et,spellCheck:!1})]})]}),Qe||O?(0,Q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:Qe??O}):null,(0,Q.jsxs)(q,{variant:`outline`,className:`w-full`,disabled:et,onClick:()=>void gn(),children:[(0,Q.jsx)(H,{className:`size-3.5`}),et?`Adding…`:`Add environment`]})]}),(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/60`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/60 bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Suggested hosts`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`From SSH config and known hosts`})]}),(0,Q.jsxs)(q,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void bn(),children:[E?(0,Q.jsx)(W,{className:`size-3 animate-spin`}):(0,Q.jsx)(W,{className:`size-3`}),`Refresh`]})]}),(0,Q.jsx)(de,{scrollFade:!0,className:`max-h-56`,children:(0,Q.jsxs)(`div`,{children:[nt.map(e=>(0,Q.jsx)(nn,{target:e,connectingHostAlias:A,onConnect:e=>void xn(e)},`${e.alias}:${e.hostname}:${e.port??``}`)),C&&!E&&nt.length===0?(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No new SSH hosts were discovered.`})}):null]})})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,Q.jsx)(ue,{value:ze,onChange:e=>jn(e.target.value),placeholder:`backend.example.com`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,Q.jsx)(ue,{value:Ve,onChange:e=>We(e.target.value),placeholder:`PAIRCODE`,disabled:et,spellCheck:!1})]})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:`Paste a full pairing URL here to fill both fields automatically. The pairing code is not kept; the browser stores a bearer token for 7 days.`})})]}),Qe?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:Qe}):null,(0,Q.jsxs)(q,{variant:`outline`,className:`w-full`,disabled:et,onClick:()=>void gn(),children:[(0,Q.jsx)(H,{className:`size-3.5`}),et?`Adding…`:`Add environment`]})]})})]})})]})]}),children:[h.map(e=>(0,Q.jsx)(en,{environmentId:e,reconnectingEnvironmentId:$,disconnectingEnvironmentId:it,removingEnvironmentId:ot,onConnect:_n,onDisconnect:vn,onRemove:yn},e)),h.length===0?(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No remote environments yet. Click “Add environment” to pair another environment.`})}):null]})]})}function an(e){return e.status!==`unavailable`}function on(e){V.add({type:`success`,title:e===`hosted-link`?`Hosted app link copied`:e===`link`?`Pairing URL copied`:`Pairing code copied`,description:e===`hosted-link`?`Open it in the browser on the device you want to connect.`:e===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function sn(e){return qt(e)?`hosted-link`:`link`}function cn(e){return!qt(e.url)}function ln(e){return qt(e.url)}function un(e){return e.currentTarget.select()}function dn(e){return e.currentTarget.select()}function fn(e){return e!==null}export{rn as ConnectionsSettings};
|
|
7
|
+
ryco serve --hub-allow-file-secret-store`})})})}),t[55]=_):_=t[55],m=Y,w=`Relay diagnostics`,T=`Bounded local counters only. No Hub address, key, ticket, project, path, or payload is exposed here.`;let B;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(te,{className:`size-3`}),t[56]=B):B=t[56],t[57]===l?E=t[58]:(E=(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,onClick:l,children:[`Open relay guide`,B]}),t[57]=l,t[58]=E),S=`grid grid-cols-2 gap-x-6 gap-y-3 pb-3.5 pt-3 sm:grid-cols-4`,C=e.map(st),t[3]=p,t[4]=n,t[5]=s,t[6]=r,t[7]=a,t[8]=c,t[9]=l,t[10]=u,t[11]=o,t[12]=i,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28];let A;t[59]!==S||t[60]!==C?(A=(0,Q.jsx)(`dl`,{className:S,children:C}),t[59]=S,t[60]=C,t[61]=A):A=t[61];let j;t[62]!==m||t[63]!==A||t[64]!==w||t[65]!==T||t[66]!==E?(j=(0,Q.jsx)(m,{title:w,description:T,control:E,children:A}),t[62]=m,t[63]=A,t[64]=w,t[65]=T,t[66]=E,t[67]=j):j=t[67];let M;t[68]!==_||t[69]!==j||t[70]!==D||t[71]!==O||t[72]!==k?(M=(0,Q.jsxs)(`div`,{className:D,children:[O,k,_,j]}),t[68]=_,t[69]=j,t[70]=D,t[71]=O,t[72]=k,t[73]=M):M=t[73];let N;t[74]!==h||t[75]!==v||t[76]!==M?(N=(0,Q.jsx)(h,{className:v,children:M}),t[74]=h,t[75]=v,t[76]=M,t[77]=N):N=t[77];let P;return t[78]!==g||t[79]!==y||t[80]!==b||t[81]!==x||t[82]!==N?(P=(0,Q.jsxs)(g,{open:y,onOpenChange:b,children:[x,N]}),t[78]=g,t[79]=y,t[80]=b,t[81]=x,t[82]=N,t[83]=P):P=t[83],P}function st(e){return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`dt`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground/65`,children:e.label}),(0,Q.jsx)(`dd`,{className:`mt-1 truncate font-mono text-[11px] text-foreground`,children:e.value})]},e.label)}var ct={configuration_invalid:{headline:`Hub configuration is invalid`,detail:`The address this backend started with was rejected. Check it and restart.`,action:`none`},identity_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The system keychain is locked or unavailable. Unlock it, then try again.`,action:`retry`},identity_store_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The keychain was unavailable when Ryco started. Restart Ryco to try again.`,action:`restart`},identity_origin_mismatch:{headline:`Enrolled with a different Hub`,detail:`This machine's key belongs to another Hub. Leave that Hub to enrol here.`,action:`leave`},enrollment_unavailable:{headline:`Enrollment was denied`,detail:`Someone declined this request on the Hub. Check with them before trying again.`,action:`enroll`},enrollment_expired:{headline:`Enrollment expired`,detail:`The request timed out before it was approved.`,action:`enroll`},authentication_failed:{headline:`The Hub rejected this machine's key`,detail:`Check this node's status on the Hub. Leaving lets you enrol again from scratch.`,action:`open-hub`},connection_replaced:{headline:`Another process connected as this machine`,detail:`Two copies of Ryco can't share one Hub identity. Stop the other one, then retry.`,action:`retry`},protocol_invalid:{headline:`The Hub connection kept failing`,detail:`Ryco stopped retrying after repeated protocol errors. Update Ryco and the Hub.`,action:`retry`},network_unavailable:{headline:`Can't reach the Hub`,detail:null,action:`none`},tls_unavailable:{headline:`Can't reach the Hub securely`,detail:null,action:`none`},authentication_timeout:{headline:`The Hub didn't respond`,detail:null,action:`none`},server_draining:{headline:`The Hub is restarting`,detail:null,action:`none`},rate_limited:{headline:`The Hub is rate limiting`,detail:null,action:`none`},heartbeat_timeout:{headline:`The Hub stopped responding`,detail:null,action:`none`},slow_consumer:{headline:`The connection fell behind`,detail:null,action:`none`},internal_error:{headline:`The Hub connection failed`,detail:null,action:`none`}},lt=(e,t)=>{let n=new Date(e).getTime()-t;if(Number.isNaN(n))return null;if(n<=0)return`now`;let r=Math.ceil(n/1e3);return r<60?`${r}s`:`${Math.ceil(r/60)}m`};function ut(e,t,n){switch(e.state){case`disabled`:return t.enrolled===`none`?{dot:`idle`,ping:!1,headline:`Not connected`,detail:null,action:`enable`,secondaryAction:`none`,retrying:!1}:{dot:`idle`,ping:!1,headline:`Turned off`,detail:`This machine stays enrolled.`,action:`enable`,secondaryAction:`leave`,retrying:!1};case`enrolling`:return{dot:`warning`,ping:!1,headline:`Ready to enrol`,detail:`Start enrollment, then approve this machine on your Hub.`,action:`enroll`,secondaryAction:`disable`,retrying:!1};case`awaiting_approval`:return{dot:`warning`,ping:!0,headline:`Waiting for approval on the Hub`,detail:`Compare every field below before approving.`,action:`open-hub`,secondaryAction:`cancel-enrollment`,retrying:!1};case`connecting`:return{dot:`warning`,ping:!0,headline:`Connecting`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`authenticating`:return{dot:`warning`,ping:!0,headline:`Authenticating`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`online`:return{dot:`success`,ping:!0,headline:`Connected`,detail:e.activeChannels===1?`1 active session`:`${e.activeChannels} active sessions`,action:`disable`,secondaryAction:`none`,retrying:!1};case`degraded`:{if(e.degradedMode===`backing_off`){let t=e.nextRetryAt===void 0?null:lt(e.nextRetryAt,n),r=e.reconnectAttempt;return{dot:`warning`,ping:!0,headline:`Reconnecting`,detail:[t===null?null:t===`now`?`Retrying now`:`Next attempt in ${t}`,r===void 0||r===0?null:`attempt ${r}`].filter(e=>e!==null).join(` · `),action:`none`,secondaryAction:`none`,retrying:!0}}let t=ct[e.failure??`internal_error`];return{dot:`destructive`,ping:!1,headline:t.headline,detail:t.detail,action:t.action,secondaryAction:t.action===`leave`?`none`:`leave`,retrying:!1}}case`revoked`:return{dot:`destructive`,ping:!1,headline:`Revoked at the Hub`,detail:`This will not retry. Leaving erases this machine's key so you can enrol again.`,action:`leave`,secondaryAction:`open-hub`,retrying:!1};case`version_incompatible`:return{dot:`destructive`,ping:!1,headline:`Incompatible Hub version`,detail:`This will not retry. Update Ryco, or the Hub, so both speak the same protocol.`,action:`none`,secondaryAction:`none`,retrying:!1};case`stopping`:return{dot:`idle`,ping:!1,headline:`Shutting down`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1}}}function dt(e){return e.enrolled===`none`}var ft=5e3,pt=15e3,mt={enable:`Enable`,disable:`Turn off`,enroll:`Start enrollment`,"cancel-enrollment":`Cancel`,"open-hub":`Open Hub`,retry:`Retry now`,leave:`Leave this Hub`,restart:`Restart Ryco`},ht=1e4;function gt({desktopBridge:e}){let t=Ve(1e3),n=R(),[i,a]=(0,X.useState)(null),[s,c]=(0,X.useState)(null),l=(0,X.useRef)(new Map),u=I(e=>e.closeSettings),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(null),[_,y]=(0,X.useState)(``),[x,w]=(0,X.useState)(null),[D,k]=(0,X.useState)(null),[A,j]=(0,X.useState)(``),[P,F]=(0,X.useState)(null),[ee,B]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(null),[V,H]=(0,X.useState)(null),[U,W]=(0,X.useState)(null),[re,G]=(0,X.useState)(!1),[ae,oe]=(0,X.useState)(!1),[K,se]=(0,X.useState)(null),[ce,le]=(0,X.useState)(!1),[de,pe]=(0,X.useState)(null),[me,he]=(0,X.useState)(!1),[ge,_e]=(0,X.useState)(null),[ve,ye]=(0,X.useState)(!1),[be,xe]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(``),J=(0,X.useRef)(!0),we=(0,X.useRef)(null),{copyToClipboard:Te}=fe(),Ee=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;(0,X.useEffect)(()=>(J.current=!0,()=>{J.current=!1}),[]);let De=(0,X.useCallback)(async()=>{try{let[e,t]=await Promise.all([S(),C()]),n=e.state===`awaiting_approval`?await E():null;if(!J.current)return;a({status:e,identity:t,enrollment:n,readAt:Date.now()}),ne(null)}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`Unable to read Hub status.`)}},[]);(0,X.useEffect)(()=>{let e=N({lifecycle:M,run:De,resolveDelayMs:()=>ft,jitterRatio:.1});return we.current=e,()=>{we.current===e&&(we.current=null),e.stop()}},[De]);let Oe=(0,X.useCallback)(()=>we.current?.refresh()??De(),[De]);(0,X.useEffect)(()=>{e&&e.getHubLaunchConfig().then(e=>{J.current&&(g(e),y(e.origin??``),j(e.nodeName??``),H(null))}).catch(e=>{J.current&&H(e instanceof Error?e.message:`Unable to read Hub launch configuration.`)})},[e]),(0,X.useEffect)(()=>()=>{for(let e of l.current.values())e();l.current.clear()},[]),(0,X.useEffect)(()=>{e?.getHostedIdentityState&&e.getHostedIdentityState().then(e=>{J.current&&(se(e),pe(null))}).catch(()=>{J.current&&(se({status:`unavailable`}),pe(`Unable to read the native account setup state.`))})},[e]);let ke=(0,X.useCallback)(async t=>{let n=t===`connect`?e?.connectHostedIdentity:e?.disconnectHostedIdentity;if(n){le(!0),pe(null);try{let e=await n();if(!J.current)return;se(e)}catch{if(!J.current)return;se({status:`unavailable`}),pe(t===`connect`?`Automatic secure setup did not finish. Retry when the Hub is reachable.`:`Unable to clear the native account session.`)}finally{J.current&&le(!1)}}},[e]),Ae=(0,X.useCallback)(async()=>{if(e?.refreshDesktopWorkspaceCatalog){c(null);try{await e.refreshDesktopWorkspaceCatalog()}catch{c(`Unable to refresh this account's machine directory.`)}}},[e]);(0,X.useEffect)(()=>{K?.status===`ready`&&Ae()},[K?.status,Ae]);let Re=(0,X.useCallback)(e=>{l.current.has(e)||l.current.set(e,z(e))},[]),ze=(0,X.useCallback)(e=>{l.current.get(e)?.(),l.current.delete(e)},[]),Be=(0,X.useCallback)(e=>{Re(e),o.getState().setActiveEnvironmentId(e),u()},[u,Re]),Ue=(0,X.useCallback)(async()=>{if(!(!e?.verifyDesktopWorkspaceApproval||!d)){c(null);try{await e.verifyDesktopWorkspaceApproval({nodeId:d.nodeId,environmentId:r.make(d.environmentId),payload:p.trim()});let t=L(r.make(d.environmentId));globalThis.setTimeout(t,ht),await e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0),f(null),m(``)}catch{c(`That approval code does not match this Desktop client, machine, account, or current node security state.`)}}},[e,p,d]),qe=(0,X.useCallback)(async t=>{if(e?.beginDesktopWorkspaceVerification){c(null);try{d&&await e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0);let n=await e.beginDesktopWorkspaceVerification({nodeId:t.nodeId,environmentId:r.make(t.environmentId)});f({...t,handle:n.handle}),m(``)}catch{c(`Unable to introduce this Desktop client to that machine. Confirm it is online and retry.`)}}},[e,d]),Je=(0,X.useCallback)(async(t,n)=>{let r=t===`connect`?e?.connectHostedGitHub:e?.disconnectHostedGitHub;if(r){he(!0),_e(null);try{let e=await r(n?{totpCode:n}:void 0);if(!J.current)return;se(e.state),e.outcome===`step-up-required`?(xe(t),Ce(``)):(xe(null),Ce(``),ye(!1),e.outcome===`last-primary-credential`?_e(`Add another primary sign-in method before disconnecting GitHub.`):e.outcome===`unavailable`&&_e(`GitHub account access is temporarily unavailable.`))}catch{J.current&&_e(`GitHub account access is temporarily unavailable.`)}finally{J.current&&he(!1)}}},[e]),Ye=(0,X.useCallback)(async t=>{W(t),ne(null);try{switch(t){case`enroll`:await v();break;case`cancel-enrollment`:await O();break;case`retry`:await T();break;case`leave`:await b();break;case`enable`:case`disable`:await e?.setHubLaunchConfig({enabled:t===`enable`});return;case`restart`:if(!e?.restartApp)throw Error(`Desktop restart is unavailable.`);await e.restartApp();return;case`open-hub`:{let e=h?.origin;e&&window.open(e,`_blank`,`noopener,noreferrer`);return}default:return}await Oe()}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`That didn't work.`)}finally{J.current&&W(null)}},[h,e,Oe]),Xe=(0,X.useCallback)(async()=>{if(!e||_.trim()===``){w(null),k(null);return}let t=await e.validateHubOrigin(_);if(J.current){if(t.ok){y(t.origin),w(null),k(null);return}k(t.suggestion??null),w({empty:`Enter a Hub address.`,too_long:`That address is too long.`,not_a_url:`That doesn't look like an address.`,insecure_scheme:`A Hub address must use https.`,has_credentials:`Remove the username and password from the address.`,has_path:`Use the Hub's address only, without a path.`,invalid:`That address can't be used.`}[t.reason])}},[e,_]),Ze=(0,X.useCallback)(async t=>{if(e){W(`enable`);try{await e.setHubLaunchConfig({origin:t})}catch(e){if(!J.current)return;ne(e instanceof Error?e.message:`Unable to save the Hub address.`),W(null)}}},[e]),Qe=(0,X.useCallback)(e=>{j(e),F(e.trim().length>100?`Use 100 characters or fewer.`:null)},[]),$e=(0,X.useCallback)(async()=>{if(!e)return;let t=A.trim();if(t.length>100){F(`Use 100 characters or fewer.`);return}B(!0),F(null);try{await e.setHubLaunchConfig({nodeName:t===``?null:t})}catch(e){if(!J.current)return;F(e instanceof Error?e.message:`Unable to save the Hub node name.`),B(!1)}},[e,A]),Z=(0,X.useCallback)(async t=>{if(e&&!(!await e.confirm(t?`Allow permissioned-file storage when the system credential store is unavailable? Ryco will restart. Existing keys are not moved.`:`Stop allowing permissioned-file Hub key storage? Ryco will restart.`)||!J.current)){G(!0),H(null);try{await e.setHubLaunchConfig({allowFileSecretStore:t})}catch(e){if(!J.current)return;H(e instanceof Error?e.message:`Unable to save the key storage setting.`),G(!1)}}},[e]),et=(0,X.useCallback)(async()=>{if(e)try{let t=new URL(nt,window.location.href).toString();if(!await e.openExternal(t))throw Error(`The relay guide could not be opened.`);H(null)}catch(e){if(!J.current)return;H(e instanceof Error?e.message:`Unable to open the relay guide.`)}},[e]);if(!e)return null;let tt=i!==null&&t-i.readAt>pt,$=i===null?null:ut(i.status,i.identity,t),rt=i!==null&&dt(i.identity),it=_.trim()!==(h?.origin??``),at=A.trim()!==(h?.nodeName??``),st=h!==null&&h.origin!==null&&e.getHostedIdentityState!==void 0&&e.connectHostedIdentity!==void 0&&i?.identity.enrolled===`none`&&($?.action===`enable`||$?.action===`enroll`),ct=(e,t)=>e===`none`?null:(0,Q.jsx)(q,{size:`xs`,variant:t,disabled:U!==null,onClick:()=>{if(e===`leave`){oe(!0);return}Ye(e)},children:U===e?`Working…`:mt[e]});return(0,Q.jsxs)(He,{title:`Hub`,children:[(0,Q.jsx)(Y,{title:`Connection`,description:st?`Connect your Ryco account below. Ryco will register this Mac with this Hub automatically.`:$===null?`Loading…`:$.detail===null?`Reach this Mac from anywhere, including behind NAT or CGNAT, without opening a port.`:$.detail,status:(0,Q.jsxs)(Q.Fragment,{children:[$===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${tt?`bg-muted-foreground/40`:$.dot===`success`?`bg-success`:$.dot===`warning`?`bg-warning`:$.dot===`destructive`?`bg-destructive`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),tt?`${$.headline} · last checked ${Math.round((t-i.readAt)/1e3)}s ago`:st?`Ready for account setup`:$.headline]}),te?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:te}):null]}),control:$===null?null:(0,Q.jsxs)(Q.Fragment,{children:[ct(st?`none`:$.action,$.action===`leave`?`destructive-outline`:`outline`),ct(st?`none`:$.secondaryAction,$.secondaryAction===`leave`?`destructive-outline`:`outline`)]}),children:(0,Q.jsx)(Ke,{children:i?.enrollment?(0,Q.jsxs)(`div`,{className:`pb-3.5`,children:[(0,Q.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground/80`,children:`Compare every field with the Hub's approval screen before approving.`}),(0,Q.jsxs)(Ge,{className:`rounded-xl border border-border/60 bg-muted/20 p-3`,children:[(0,Q.jsx)(We,{term:`Label`,children:i.enrollment.label}),(0,Q.jsx)(We,{term:`Platform`,children:`${i.enrollment.platformOs} · ${i.enrollment.platformArch}`}),(0,Q.jsx)(We,{term:`Version`,mono:!0,children:i.enrollment.clientVersion}),(0,Q.jsx)(We,{term:`Algorithm`,children:i.enrollment.algorithm}),(0,Q.jsx)(We,{term:`Fingerprint`,mono:!0,children:i.enrollment.fingerprint}),(0,Q.jsx)(We,{term:`Expires`,children:new Date(i.enrollment.expiresAt).toLocaleString()}),(0,Q.jsx)(We,{term:`Device code`,mono:!0,action:Ee?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Te(i.enrollment.deviceCode),children:`Copy`}):null,children:i.enrollment.deviceCode})]}),(0,Q.jsx)(`p`,{className:`pt-2 text-[11px] text-muted-foreground/70`,children:`The device code only routes the request. It does not prove which machine you are approving.`}),(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-2 text-xs text-warning`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`If the fingerprint on the Hub differs by even one character, deny it there and cancel here.`]})]}):null})}),h!==null&&h.origin!==null&&e.getHostedIdentityState!==void 0?(0,Q.jsx)(Y,{title:`Ryco account`,description:K===null?`Checking this Mac's native account setup…`:st&&K.status===`ready`?`You are signed in. Finish setup to register this Mac with the Hub and verify local trust automatically.`:K.status===`ready`?`Your native account session and this Mac's automatic node claim are ready. Local trust introduction is verified.`:K.status===`signed-out`?`Sign in in your browser. Ryco will claim this Mac's node and verify its local trust automatically.`:`Automatic secure setup did not finish. Existing node and trust state are preserved while you retry.`,status:(0,Q.jsxs)(Q.Fragment,{children:[K===null?null:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${st&&K.status===`ready`?`bg-warning`:K.status===`ready`?`bg-success`:K.status===`unavailable`?`bg-warning`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),K.status===`ready`?st?`Signed in · Node setup needed`:`Secure setup complete`:K.status===`unavailable`?`Setup needs attention`:`Not signed in`]}),de?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:de}):null]}),control:K===null?null:st&&K.status===`ready`?(0,Q.jsx)(q,{size:`xs`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void ke(`connect`),children:ce?`Finishing setup…`:`Finish setup`}):K.status===`ready`?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:ce||!e.disconnectHostedIdentity,onClick:()=>void ke(`disconnect`),children:ce?`Working…`:`Sign out`}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:ce||!e.connectHostedIdentity,onClick:()=>void ke(`connect`),children:ce?`Opening browser…`:K.status===`unavailable`?`Retry secure setup`:`Connect account`})}):null,K?.status===`ready`&&e?.getDesktopWorkspaceState?(0,Q.jsxs)(Y,{title:`Workspace machines`,description:`Connect, open, and manage each machine independently. Cached lists remain read-only until connected.`,status:s??`${n.machines.filter(e=>e.online).length} online · ${n.activeConnectionCount} connected`,control:(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void Ae(),children:`Refresh`}),children:[(0,Q.jsx)(Ge,{children:n.machines.map(e=>(0,Q.jsx)(We,{term:e.label,action:(0,Q.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:e.nodeId&&e.online&&(e.nativeTrust===`unverified`||e.nativeTrust===`unknown`)?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>{qe({nodeId:e.nodeId,environmentId:e.environmentId})},children:`Verify`}):e.nativeTrust===`verified`&&e.online?e.connectionState===`connected`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Be(e.environmentId),children:`Open`}),(0,Q.jsx)(q,{size:`xs`,variant:`ghost`,onClick:()=>ze(e.environmentId),children:`Disconnect`})]}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>Re(e.environmentId),children:`Connect`}):null}),children:e.nativeTrust===`verified`?e.online?`Verified · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Verified · Offline`:e.nativeTrust===`identity-conflict`?`Identity changed · Locked`:e.online?`Needs verification`:`Needs verification · Offline`},`${e.nodeId??`unknown`}:${e.environmentId}`))}),d?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 border-t border-border/60 py-3 sm:flex-row`,children:[(0,Q.jsx)(ue,{value:p,onChange:e=>m(e.target.value),placeholder:`Paste the approval code shown by this exact node`,"aria-label":`Machine approval code`}),(0,Q.jsx)(q,{size:`sm`,disabled:p.trim().length===0,onClick:()=>void Ue(),children:`Verify`}),(0,Q.jsx)(q,{size:`sm`,variant:`ghost`,onClick:()=>{e.cancelDesktopWorkspaceVerification?.(d.handle).catch(()=>void 0),f(null),m(``)},children:`Cancel`})]}):null]}):null,K?.status===`ready`&&K.github!==void 0?(0,Q.jsx)(Y,{title:K.github.identity?`GitHub · @${K.github.identity.login}`:`GitHub`,description:K.github.identity?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,status:ge?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:ge}):K.github.identity?.displayName?K.github.identity.displayName:null,control:K.github.linkAvailable?K.github.identity?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:me||!e?.disconnectHostedGitHub,onClick:()=>ye(!0),children:me?`Working…`:`Disconnect`}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:me||!e?.connectHostedGitHub,onClick:()=>void Je(`connect`),children:me?`Opening browser…`:`Connect GitHub`}):null}):null,(0,Q.jsx)(Y,{title:`Hub address`,description:rt?`The address of the Hub you or your team operate.`:`Locked while this machine is enrolled. Leave this Hub to change it.`,status:x?(0,Q.jsxs)(`span`,{className:`block text-destructive`,children:[x,D?(0,Q.jsxs)(`button`,{type:`button`,className:`ml-1 underline underline-offset-2`,onClick:()=>{y(D),w(null),k(null)},children:[`Use `,D]}):null]}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ue,{value:_,disabled:!rt||U!==null,placeholder:`https://…`,className:`w-64 font-mono text-xs`,onChange:e=>y(e.currentTarget.value),onBlur:()=>void Xe()}),rt&&it&&x===null&&_.trim()!==``?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:U!==null,onClick:()=>void Ze(_.trim()),children:`Save and restart`}):null]})}),(0,Q.jsx)(Y,{title:`Node name`,description:rt?`Choose the name proposed on the Hub approval screen. Leave it blank for a stable automatic name.`:i?.identity.enrolled===`pending`?`Locked while enrollment is pending. Cancel enrollment to change the proposed name.`:`Managed on the Hub after enrollment. An owner can rename this node from its Hub details.`,status:P?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:P}):null,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ue,{value:A,disabled:!rt||U!==null||ee,placeholder:`Automatic: machine name · node code`,"aria-label":`Hub node name`,className:`w-64 text-xs`,onChange:e=>Qe(e.currentTarget.value)}),rt&&at&&P===null?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:U!==null||ee,onClick:()=>void $e(),children:ee?`Saving…`:`Save and restart`}):null]})}),i!==null&&i.status.state===`online`?(0,Q.jsx)(Y,{title:`Who can connect`,description:`Managed on the Hub, not here. Sessions arriving through the Hub carry a role: viewer reads, operator edits files and runs terminals, owner also changes credentials and server policy.`}):null,(0,Q.jsx)(ot,{config:h,identity:i?.identity??null,status:i?.status??null,nowMs:t,savingFileFallback:re||U!==null,configError:V,onFileFallbackChange:e=>void Z(e),onOpenGuide:()=>void et()}),(0,Q.jsx)(Le,{open:ae,onOpenChange:oe,children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Leave this Hub?`}),(0,Q.jsxs)(Fe,{children:[`This erases this machine's Hub key. You can enrol again afterwards, but it will join as a new machine and needs a new approval.`,(0,Q.jsx)(`br`,{}),(0,Q.jsx)(`br`,{}),`It does `,(0,Q.jsx)(`strong`,{children:`not`}),` revoke anything on the Hub. The old entry stays there until an owner removes it.`]})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Keep it`}),(0,Q.jsx)(q,{variant:`destructive`,disabled:U!==null,onClick:()=>{oe(!1),Ye(`leave`)},children:`Erase this machine's key`})]})]})}),(0,Q.jsx)(Le,{open:ve,onOpenChange:ye,children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Disconnect GitHub?`}),(0,Q.jsx)(Fe,{children:`GitHub stops working as a Ryco sign-in method. Ryco refuses this change when it is your only primary sign-in method. Repository access is separate.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Cancel`}),(0,Q.jsx)(q,{variant:`destructive`,disabled:me,onClick:()=>void Je(`disconnect`),children:`Disconnect GitHub`})]})]})}),(0,Q.jsx)(Le,{open:be!==null,onOpenChange:t=>{!t&&!me&&(be===`connect`&&e?.cancelHostedGitHubConnection?.(),xe(null),Ce(``))},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Confirm this account change`}),(0,Q.jsx)(Fe,{children:`Enter a current code from your authenticator app. The pending GitHub authorization is reused; Ryco does not reopen the browser.`})]}),(0,Q.jsx)(ue,{"aria-label":`Authenticator code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,value:Se,onChange:e=>Ce(e.currentTarget.value.replace(/\D/gu,``))}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{children:`Cancel`}),(0,Q.jsx)(q,{disabled:me||Se.length<6,onClick:()=>{be!==null&&Je(be,Se)},children:`Confirm`})]})]})})]})}var _t=443,vt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function yt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:vt.format(t)}function bt(e){let t=(0,Z.c)(21),{tooltipText:n,dotClassName:r,pingClassName:i}=e,a;t[0]===i?a=t[1]:(a=i?(0,Q.jsx)(`span`,{className:G(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,i)}):null,t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=G(`relative inline-flex size-2 rounded-full`,r),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,Q.jsx)(`span`,{className:o}),t[4]=o,t[5]=s);let c;t[6]!==a||t[7]!==s?(c=(0,Q.jsxs)(Q.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8];let l=c;if(!n){let e;return t[9]===l?e=t[10]:(e=(0,Q.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:l}),t[9]=l,t[10]=e),e}let u;t[11]!==l||t[12]!==n?(u=(0,Q.jsx)(`button`,{type:`button`,title:n,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:l}),t[11]=l,t[12]=n,t[13]=u):u=t[13];let d=u,f;t[14]===d?f=t[15]:(f=(0,Q.jsx)(K,{render:d}),t[14]=d,t[15]=f);let p;t[16]===n?p=t[17]:(p=(0,Q.jsx)(se,{side:`top`,className:`max-w-80 whitespace-pre-wrap leading-tight`,children:n}),t[16]=n,t[17]=p);let m;return t[18]!==f||t[19]!==p?(m=(0,Q.jsxs)(ce,{children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function xt(e,t,n){let r=e?.connectionState??`disconnected`;if(r===`connected`){let r=e?.connectedAt??t.lastConnectedAt;return r?`Connected for ${oe(r,n)}`:null}return r===`connecting`?null:r===`error`?e?.lastError??`An unknown connection error occurred.`:t.lastConnectedAt?`Last connected at ${yt(t.lastConnectedAt)}`:`Not connected yet.`}function St(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function Ct(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function wt(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=P(n);if(r)return{host:r.host,pairingCode:r.token};let i=j(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function Tt(e){let t=wt(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function Et(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var Dt=`border-t border-border/60 px-4 py-4 first:border-t-0 sm:px-5`,Ot=`border-t border-border/60 px-4 py-2.5 first:border-t-0 sm:px-5`,kt=`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`;function At(e){return Dt}function jt(e,t){return e===`endpoint-rail`?G(`relative border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,!t&&`bg-muted/20`):G(Ot,!t&&`bg-muted/24`)}function Mt(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function Nt(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function Pt(e){return{...e,createdAt:i(e.createdAt),expiresAt:i(e.expiresAt)}}function Ft(e){return{...e,issuedAt:i(e.issuedAt),expiresAt:i(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:i(e.lastConnectedAt)}}function It(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return Mt([...e,t]);let r=[...e];return r[n]=t,Mt(r)}function Lt(e,t){return e.filter(e=>e.id!==t)}function Rt(e,t){let n=e.findIndex(e=>e.sessionId===t.sessionId);if(n===-1)return Nt([...e,t]);let r=[...e];return r[n]=t,Nt(r)}function zt(e,t){return e.filter(e=>e.sessionId!==t)}function Bt(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>Ht(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function Vt(e){return e.id.startsWith(`tailscale-magicdns:`)}function Ht(e){if(e.id.startsWith(`desktop-loopback:`)||e.id.startsWith(`server-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`)||e.id.startsWith(`server-network:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(Vt(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function Ut(e){switch(e){case`mixed-content-blocked`:return`Hosted app blocked`;case`requires-configuration`:return`Setup required for hosted app`;default:return null}}function Wt(e){switch(e){case`mixed-content-blocked`:return`The hosted HTTPS app cannot connect to HTTP endpoints because browsers block mixed content.`;case`requires-configuration`:return`Configure HTTPS access before using this endpoint from the hosted app.`;default:return null}}function Gt(e,t){return e.compatibility.hostedHttpsApp===`compatible`?tt(e.httpBaseUrl,t)??et(e.httpBaseUrl,t):et(e.httpBaseUrl,t)}function Kt(e){let t=new URL(`/pair`,window.location.href);return A(t,e).toString()}function qt(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}var Jt=(0,X.memo)(function(e){let t=(0,Z.c)(146),{pairingLink:n,endpointUrl:r,endpoints:i,defaultEndpointKey:a,presentation:o,revokingPairingLinkId:s,onRevoke:c}=e,l=o===void 0?`current`:o,u=Ve(1e3),d;t[0]===n.expiresAt?d=t[1]:(d=new Date(n.expiresAt).getTime(),t[0]=n.expiresAt,t[1]=d);let f=d,[p,m]=(0,X.useState)(!1),h;t[2]===n.credential?h=t[3]:(h=Kt(n.credential),t[2]=n.credential,t[3]=h);let g=h,_;t[4]!==r||t[5]!==n.credential?(_=r!=null&&r!==``?tt(r,n.credential):null,t[4]=r,t[5]=n.credential,t[6]=_):_=t[6];let v=_,y;if(t[7]!==a||t[8]!==i||t[9]!==n.credential){let e=Bt(i,a);y=e?Gt(e,n.credential):null,t[7]=a,t[8]=i,t[9]=n.credential,t[10]=y}else y=t[10];let b=y,S;if(t[11]!==i||t[12]!==n.credential){let e;t[14]===n.credential?e=t[15]:(e=e=>{let t=Gt(e,n.credential);return{key:Ht(e),label:e.label,url:t,detail:qt(t)?`Hosted app link`:`Backend pairing URL`}},t[14]=n.credential,t[15]=e),S=i.filter(an).map(e),t[11]=i,t[12]=n.credential,t[13]=S}else S=t[13];let C=S,w;t[16]!==g||t[17]!==b||t[18]!==r||t[19]!==v||t[20]!==n.credential?(w=b??(r!=null&&r!==``?v??et(r,n.credential):x(window.location.hostname)?null:g),t[16]=g,t[17]=b,t[18]=r,t[19]=v,t[20]=n.credential,t[21]=w):w=t[21];let T=w,E=T??n.credential,D=T!==null&&qt(T),O=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k={onCopy:on,onError:(e,t)=>{m(!0),V.add(pe({type:`error`,title:O?t===`hosted-link`?`Could not copy hosted app link`:t===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:O?e.message:`Showing the full value instead.`}))}},t[22]=k):k=t[22];let{copyToClipboard:A}=fe(k),j;t[23]===A?j=t[24]:(j=(e,t)=>{A(e,t)},t[23]=A,t[24]=j);let M=j,N=sn,P;t[25]!==M||t[26]!==n.credential?(P=()=>{M(n.credential,`code`)},t[25]=M,t[26]=n.credential,t[27]=P):P=t[27];let F=P,I;t[28]!==M||t[29]!==T?(I=()=>{T&&M(T,N(T))},t[28]=M,t[29]=T,t[30]=I):I=t[30];let ee=I,L;t[31]===n.expiresAt?L=t[32]:(L=yt(n.expiresAt),t[31]=n.expiresAt,t[32]=L);let R=L,z=n.role===`owner`?`Owner`:`Client`,B=n.label??`${z} link`,te;t[33]!==a||t[34]!==C?(te=C.find(e=>e.key===a)??C[0]??null,t[33]=a,t[34]=C,t[35]=te):te=t[35];let H=te?.label??`URL`,W,re,ie,G,oe,K,se,ce,le;if(t[36]!==M||t[37]!==H||t[38]!==C||t[39]!==R||t[40]!==f||t[41]!==F||t[42]!==ee||t[43]!==p||t[44]!==u||t[45]!==n.createdAt||t[46]!==n.expiresAt||t[47]!==l||t[48]!==B||t[49]!==z||t[50]!==T){le=Symbol.for(`react.early_return_sentinel`);bb0:{let e=C.filter(cn),r=C.filter(ln),i;t[60]!==M||t[61]!==C?(i=(e,t)=>{let n=e===void 0?C:e,r=t===void 0||t;return n.map(e=>(0,Q.jsx)(Oe,{onClick:()=>M(e.url,N(e.url)),children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:e.label}),r?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.detail}):null]})},e.key))},t[60]=M,t[61]=C,t[62]=i):i=t[62];let a=i,o;t[63]===F?o=t[64]:(o=e=>(0,Q.jsx)(Oe,{onClick:F,children:(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate`,children:`Copy code`}),e===void 0||e?(0,Q.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:`Token only`}):null]})}),t[63]=F,t[64]=o);let s=o,c;t[65]===a?c=t[66]:(c=(e,t,n)=>t.length>0?(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(we,{}):null,(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:e}),a(t,!1)]})]}):null,t[65]=a,t[66]=c);let d=c,h=t=>(0,Q.jsxs)(Q.Fragment,{children:[t?.codeFirst?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:`Pairing code`}),s(!1)]}),C.length>0?(0,Q.jsx)(we,{}):null]}):null,d(`Pairing URLs`,e,!1),d(`Hosted app link`,r,e.length>0),t?.codeFirst?null:(0,Q.jsxs)(Q.Fragment,{children:[C.length>0?(0,Q.jsx)(we,{}):null,(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:`Pairing code`}),s(!1)]})]})]});if(f<=u){le=null;break bb0}t[67]===l?ce=t[68]:(ce=At(l),t[67]=l,t[68]=ce),K=kt;let g;t[69]===n.createdAt?g=t[70]:(g=yt(n.createdAt),t[69]=n.createdAt,t[70]=g);let _=`Link created at ${g}`,v;t[71]===_?v=t[72]:(v=(0,Q.jsx)(bt,{tooltipText:_,dotClassName:`bg-amber-400`}),t[71]=_,t[72]=v);let y;t[73]===B?y=t[74]:(y=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:B}),t[73]=B,t[74]=y);let b;t[75]===T?b=t[76]:(b=T?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ze,{openOnHover:!0,delay:250,closeDelay:100,render:(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/50 outline-none hover:text-foreground`,"aria-label":`Show QR code`}),children:(0,Q.jsx)(U,{"aria-hidden":!0,className:`size-3`})}),(0,Q.jsx)(Re,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max`,children:(0,Q.jsx)(Ye,{value:T,size:88,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})})]}):null,t[75]=T,t[76]=b);let x;t[77]===b?x=t[78]:(x=(0,Q.jsx)(Be,{children:b}),t[77]=b,t[78]=x);let S;t[79]!==v||t[80]!==y||t[81]!==x?(S=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[v,y,x]}),t[79]=v,t[80]=y,t[81]=x,t[82]=S):S=t[82];let w;t[83]!==u||t[84]!==n.expiresAt?(w=ae(n.expiresAt,u),t[83]=u,t[84]=n.expiresAt,t[85]=w):w=t[85];let E;t[86]!==z||t[87]!==w?(E=[z,w],t[86]=z,t[87]=w,t[88]=E):E=t[88];let D=E.join(` · `),k;t[89]!==R||t[90]!==D?(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:R,children:D}),t[89]=R,t[90]=D,t[91]=k):k=t[91];let A;t[92]===T?A=t[93]:(A=T===null?(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null,t[92]=T,t[93]=A),t[94]!==S||t[95]!==k||t[96]!==A?(se=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[S,k,A]}),t[94]=S,t[95]=k,t[96]=A,t[97]=se):se=t[97],oe=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,W=Se,re=p,ie=m,G=O?(0,Q.jsx)(Q.Fragment,{children:T?(0,Q.jsxs)(Je,{"aria-label":`Copy selected endpoint`,children:[(0,Q.jsx)(q,{size:`xs`,variant:`outline`,className:`max-w-56`,title:`Copy pairing URL for: ${H}`,onClick:ee,children:(0,Q.jsxs)(`span`,{className:`truncate`,children:[`Copy pairing URL for: `,H]})}),(0,Q.jsx)(qe,{}),(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(De,{render:(0,Q.jsx)(q,{size:`icon-xs`,variant:`outline`,"aria-label":`Choose endpoint to copy`}),children:(0,Q.jsx)(ne,{className:`size-3.5`})}),(0,Q.jsx)(J,{align:`end`,className:`min-w-60`,children:h()})]})]}):(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:F,children:`Copy code`})}):(0,Q.jsx)(_e,{render:(0,Q.jsx)(q,{size:`xs`,variant:`outline`}),children:T?`Show link`:`Show code`})}t[36]=M,t[37]=H,t[38]=C,t[39]=R,t[40]=f,t[41]=F,t[42]=ee,t[43]=p,t[44]=u,t[45]=n.createdAt,t[46]=n.expiresAt,t[47]=l,t[48]=B,t[49]=z,t[50]=T,t[51]=W,t[52]=re,t[53]=ie,t[54]=G,t[55]=oe,t[56]=K,t[57]=se,t[58]=ce,t[59]=le}else W=t[51],re=t[52],ie=t[53],G=t[54],oe=t[55],K=t[56],se=t[57],ce=t[58],le=t[59];if(le!==Symbol.for(`react.early_return_sentinel`))return le;let ue=T?D?`Hosted app pairing link`:`Pairing link`:`Pairing code`,de;t[98]===ue?de=t[99]:(de=(0,Q.jsx)(he,{children:ue}),t[98]=ue,t[99]=de);let ve=T?D?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,ke;t[100]===ve?ke=t[101]:(ke=(0,Q.jsx)(be,{children:ve}),t[100]=ve,t[101]=ke);let je;t[102]!==de||t[103]!==ke?(je=(0,Q.jsxs)(me,{children:[de,ke]}),t[102]=de,t[103]=ke,t[104]=je):je=t[104];let Me=T?4:3,Ne;t[105]!==E||t[106]!==Me?(Ne=(0,Q.jsx)(Ae,{readOnly:!0,value:E,rows:Me,className:`text-xs leading-relaxed`,onFocus:un,onClick:dn}),t[105]=E,t[106]=Me,t[107]=Ne):Ne=t[107];let Pe;t[108]===T?Pe=t[109]:(Pe=T?(0,Q.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,Q.jsx)(Ye,{value:T,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[108]=T,t[109]=Pe);let Fe;t[110]!==Ne||t[111]!==Pe?(Fe=(0,Q.jsxs)(ye,{className:`space-y-4`,children:[Ne,Pe]}),t[110]=Ne,t[111]=Pe,t[112]=Fe):Fe=t[112];let Ie;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,Q.jsx)(q,{variant:`outline`,onClick:()=>m(!1),children:`Done`}),t[113]=Ie):Ie=t[113];let Le;t[114]===F?Le=t[115]:(Le=O?(0,Q.jsx)(q,{variant:`outline`,size:`xs`,onClick:F,children:`Copy code`}):null,t[114]=F,t[115]=Le);let He;t[116]===Le?He=t[117]:(He=(0,Q.jsxs)(ge,{variant:`bare`,children:[Ie,Le]}),t[116]=Le,t[117]=He);let Ue;t[118]!==je||t[119]!==Fe||t[120]!==He?(Ue=(0,Q.jsxs)(xe,{className:`max-w-md`,children:[je,Fe,He]}),t[118]=je,t[119]=Fe,t[120]=He,t[121]=Ue):Ue=t[121];let Y;t[122]!==W||t[123]!==re||t[124]!==ie||t[125]!==G||t[126]!==Ue?(Y=(0,Q.jsxs)(W,{open:re,onOpenChange:ie,children:[G,Ue]}),t[122]=W,t[123]=re,t[124]=ie,t[125]=G,t[126]=Ue,t[127]=Y):Y=t[127];let We=s===n.id,Ge;t[128]!==c||t[129]!==n.id?(Ge=()=>void c(n.id),t[128]=c,t[129]=n.id,t[130]=Ge):Ge=t[130];let Ke=s===n.id?`Revoking…`:`Revoke`,Xe;t[131]!==We||t[132]!==Ge||t[133]!==Ke?(Xe=(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:We,onClick:Ge,children:Ke}),t[131]=We,t[132]=Ge,t[133]=Ke,t[134]=Xe):Xe=t[134];let Ze;t[135]!==oe||t[136]!==Y||t[137]!==Xe?(Ze=(0,Q.jsxs)(`div`,{className:oe,children:[Y,Xe]}),t[135]=oe,t[136]=Y,t[137]=Xe,t[138]=Ze):Ze=t[138];let Qe;t[139]!==K||t[140]!==se||t[141]!==Ze?(Qe=(0,Q.jsxs)(`div`,{className:K,children:[se,Ze]}),t[139]=K,t[140]=se,t[141]=Ze,t[142]=Qe):Qe=t[142];let $e;return t[143]!==ce||t[144]!==Qe?($e=(0,Q.jsx)(`div`,{className:ce,children:Qe}),t[143]=ce,t[144]=Qe,t[145]=$e):$e=t[145],$e}),Yt=(0,X.memo)(function(e){let t=(0,Z.c)(50),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a}=e,o=r===void 0?`current`:r,s=Ve(1e3),c=n.current||n.connected,l=n.lastConnectedAt,u;t[0]!==c||t[1]!==l||t[2]!==s?(u=c?l?`Connected for ${oe(l,s)}`:`Connected`:l?`Last connected at ${yt(l)}`:`Not connected yet.`,t[0]=c,t[1]=l,t[2]=s,t[3]=u):u=t[3];let d=u,f=n.role===`owner`?`Owner`:`Client`,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(fn),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===o?x=t[17]:(x=At(o),t[16]=o,t[17]=x);let S=c?`bg-success`:`bg-muted-foreground/30`,C;t[18]!==d||t[19]!==S?(C=(0,Q.jsx)(bt,{tooltipText:d,dotClassName:S,pingClassName:null}),t[18]=d,t[19]=S,t[20]=C):C=t[20];let w;t[21]===b?w=t[22]:(w=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:b}),t[21]=b,t[22]=w);let T;t[23]===n.current?T=t[24]:(T=n.current?(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 rounded-md border border-border/50 bg-muted/50 px-1 py-0.5`,children:`This device`}):null,t[23]=n.current,t[24]=T);let E;t[25]!==C||t[26]!==w||t[27]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[C,w,T]}),t[25]=C,t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==v||t[30]!==f?(D=[f,...v],t[29]=v,t[30]=f,t[31]=D):D=t[31];let O=D.join(` · `),k;t[32]===O?k=t[33]:(k=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:O}),t[32]=O,t[33]=k);let A;t[34]!==E||t[35]!==k?(A=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,k]}),t[34]=E,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==n.current||t[38]!==n.sessionId||t[39]!==a||t[40]!==i?(j=n.current?null:(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[37]=n.current,t[38]=n.sessionId,t[39]=a,t[40]=i,t[41]=j):j=t[41];let M;t[42]===j?M=t[43]:(M=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:j}),t[42]=j,t[43]=M);let N;t[44]!==A||t[45]!==M?(N=(0,Q.jsxs)(`div`,{className:kt,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;return t[47]!==N||t[48]!==x?(P=(0,Q.jsx)(`div`,{className:x,children:N}),t[47]=N,t[48]=x,t[49]=P):P=t[49],P}),Xt=(0,X.memo)(function({clientSessions:e,isRevokingOtherClients:t,onRevokeOtherClients:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),[s,c]=(0,X.useState)(!1),l=(0,X.useCallback)(async()=>{c(!0);try{await D(a),o(``),i(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;V.add(pe({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{c(!1)}},[a]);return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:t||e.every(e=>e.current),onClick:()=>void n(),children:t?`Revoking…`:`Revoke others`}),(0,Q.jsxs)(Se,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Q.jsx)(_e,{render:(0,Q.jsxs)(q,{size:`xs`,variant:`default`,children:[(0,Q.jsx)(H,{className:`size-3`}),`Create link`]})}),(0,Q.jsxs)(xe,{className:`max-w-sm`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Create pairing link`}),(0,Q.jsx)(be,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,Q.jsx)(ye,{children:(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,Q.jsx)(ue,{value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Living room iPad`,disabled:s,autoFocus:!0})]})}),(0,Q.jsxs)(ge,{variant:`bare`,children:[(0,Q.jsx)(q,{variant:`outline`,disabled:s,onClick:()=>i(!1),children:`Cancel`}),(0,Q.jsx)(q,{disabled:s,onClick:()=>void l(),children:s?`Creating…`:`Create link`})]})]})]})]})}),Zt=(0,X.memo)(function(e){let t=(0,Z.c)(33),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,clientSessions:c,revokingPairingLinkId:l,revokingClientSessionId:u,onRevokePairingLink:d,onRevokeClientSession:f}=e,p=a===void 0?`current`:a,m;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==d||t[4]!==s||t[5]!==p||t[6]!==l){let e;t[8]!==i||t[9]!==n||t[10]!==r||t[11]!==d||t[12]!==p||t[13]!==l?(e=e=>(0,Q.jsx)(Jt,{pairingLink:e,endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:p,revokingPairingLinkId:l,onRevoke:d},e.id),t[8]=i,t[9]=n,t[10]=r,t[11]=d,t[12]=p,t[13]=l,t[14]=e):e=t[14],m=s.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=d,t[4]=s,t[5]=p,t[6]=l,t[7]=m}else m=t[7];let h;if(t[15]!==c||t[16]!==f||t[17]!==p||t[18]!==u){let e;t[20]!==f||t[21]!==p||t[22]!==u?(e=e=>(0,Q.jsx)(Yt,{clientSession:e,presentation:p,revokingClientSessionId:u,onRevokeSession:f},e.sessionId),t[20]=f,t[21]=p,t[22]=u,t[23]=e):e=t[23],h=c.map(e),t[15]=c,t[16]=f,t[17]=p,t[18]=u,t[19]=h}else h=t[19];let g;t[24]!==c.length||t[25]!==o||t[26]!==s.length||t[27]!==p?(g=s.length===0&&c.length===0&&!o?(0,Q.jsx)(`div`,{className:At(p),children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[24]=c.length,t[25]=o,t[26]=s.length,t[27]=p,t[28]=g):g=t[28];let _;return t[29]!==m||t[30]!==h||t[31]!==g?(_=(0,Q.jsxs)(Q.Fragment,{children:[m,h,g]}),t[29]=m,t[30]=h,t[31]=g,t[32]=_):_=t[32],_}),Qt=(0,X.memo)(function(e){let t=(0,Z.c)(58),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=Vt(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n.compatibility.hostedHttpsApp?p=t[3]:(p=Ut(n.compatibility.hostedHttpsApp),t[2]=n.compatibility.hostedHttpsApp,t[3]=p);let m=p,h;t[4]===n.compatibility.hostedHttpsApp?h=t[5]:(h=Wt(n.compatibility.hostedHttpsApp),t[4]=n.compatibility.hostedHttpsApp,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=Vt(n)&&n.status===`available`,t[6]=n,t[7]=_);let v=_,y=!f,b=l===`endpoint-rail`,x;t[8]!==u||t[9]!==l?(x=jt(l,u),t[8]=u,t[9]=l,t[10]=x):x=t[10];let S;t[11]!==r||t[12]!==b?(S=b&&r?(0,Q.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[11]=r,t[12]=b,t[13]=S):S=t[13];let C;t[14]===n.label?C=t[15]:(C=(0,Q.jsx)(`h3`,{className:`shrink-0 text-sm leading-5 font-medium text-foreground`,children:n.label}),t[14]=n.label,t[15]=C);let w;t[16]!==n.httpBaseUrl||t[17]!==y?(w=y?(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,title:n.httpBaseUrl,children:n.httpBaseUrl}):null,t[16]=n.httpBaseUrl,t[17]=y,t[18]=w):w=t[18];let T;t[19]===u?T=t[20]:(T=u?null:(0,Q.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-[10px] text-muted-foreground`,children:`Setup required`}),t[19]=u,t[20]=T);let E;t[21]!==g||t[22]!==m?(E=m?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 px-1 py-0.5 text-[10px] text-amber-700 dark:text-amber-300`,title:g??void 0,children:[(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-3`}),m]}):null,t[21]=g,t[22]=m,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==C||t[27]!==w?(D=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[C,w,T,E]}),t[24]=T,t[25]=E,t[26]=C,t[27]=w,t[28]=D):D=t[28];let O;t[29]===r?O=t[30]:(O=r?(0,Q.jsx)(`span`,{className:`rounded-md border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] text-primary`,children:`Default`}):null,t[29]=r,t[30]=O);let k;t[31]!==n||t[32]!==c||t[33]!==f||t[34]!==o?(k=f?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[31]=n,t[32]=c,t[33]=f,t[34]=o,t[35]=k):k=t[35];let A;t[36]!==v||t[37]!==n||t[38]!==c||t[39]!==s?(A=v?(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[36]=v,t[37]=n,t[38]=c,t[39]=s,t[40]=A):A=t[40];let j;t[41]!==n||t[42]!==r||t[43]!==f||t[44]!==a?(j=!f&&!r?(0,Q.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[41]=n,t[42]=r,t[43]=f,t[44]=a,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==k||t[48]!==A||t[49]!==j?(M=(0,Q.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[O,k,A,j]}),t[46]=O,t[47]=k,t[48]=A,t[49]=j,t[50]=M):M=t[50];let N;t[51]!==D||t[52]!==M?(N=(0,Q.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[D,M]}),t[51]=D,t[52]=M,t[53]=N):N=t[53];let P;return t[54]!==N||t[55]!==x||t[56]!==S?(P=(0,Q.jsxs)(`div`,{className:x,children:[S,N]}),t[54]=N,t[55]=x,t[56]=S,t[57]=P):P=t[57],P});function $t(e){let t=(0,Z.c)(17),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]===n.compatibility.hostedHttpsApp?c=t[3]:(c=Ut(n.compatibility.hostedHttpsApp)?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,title:Wt(n.compatibility.hostedHttpsApp)??void 0,children:[(0,Q.jsx)(ie,{"aria-hidden":!0,className:`size-3`}),Ut(n.compatibility.hostedHttpsApp)]}):null,t[2]=n.compatibility.hostedHttpsApp,t[3]=c);let l;t[4]!==i||t[5]!==r?(l=r>0?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[4]=i,t[5]=r,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==d?(p=(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[f,r>0?(0,Q.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:d}):(0,Q.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:d})]}),t[12]=i,t[13]=r,t[14]=a,t[15]=d,t[16]=p):p=t[16],p}function en(e){let t=(0,Z.c)(57),{environmentId:n,reconnectingEnvironmentId:r,disconnectingEnvironmentId:i,removingEnvironmentId:a,onConnect:o,onDisconnect:c,onRemove:l}=e,u=Ve(1e3),d;t[0]===n?d=t[1]:(d=e=>e.byId[n]??null,t[0]=n,t[1]=d);let f=s(d),p;t[2]===n?p=t[3]:(p=e=>e.byId[n]??null,t[2]=n,t[3]=p);let g=h(p);if(!f)return null;let _=g?.connectionState??`disconnected`,v=_===`connected`,y=_===`connecting`||r===n,b=i===n,x=_===`connected`?`bg-success`:_===`connecting`?`bg-warning`:_===`error`?`bg-destructive`:`bg-muted-foreground/40`,S=g?.role?g.role===`owner`?`Owner`:`Client`:null,C=g?.descriptor?.label??null??f.label,w;t[4]!==u||t[5]!==f||t[6]!==g?(w=xt(g,f,u),t[4]=u,t[5]=f,t[6]=g,t[7]=w):w=t[7];let T=w,E=g?.serverConfig,D;t[8]===E?D=t[9]:(D=m(E),t[8]=E,t[9]=D);let O=D,k;t[10]===f.desktopSsh?k=t[11]:(k=f.desktopSsh?`SSH ${St(f.desktopSsh)}`:null,t[10]=f.desktopSsh,t[11]=k);let A;t[12]===f.lastConnectedAt?A=t[13]:(A=f.lastConnectedAt?`Last connected ${yt(f.lastConnectedAt)}`:null,t[12]=f.lastConnectedAt,t[13]=A);let j;t[14]!==S||t[15]!==k||t[16]!==A?(j=[k,S,A].filter(tn),t[14]=S,t[15]=k,t[16]=A,t[17]=j):j=t[17];let M=j,N=_===`connecting`?`bg-warning/60 duration-2000`:null,P;t[18]!==x||t[19]!==T||t[20]!==N?(P=(0,Q.jsx)(bt,{tooltipText:T,dotClassName:x,pingClassName:N}),t[18]=x,t[19]=T,t[20]=N,t[21]=P):P=t[21];let F;t[22]===C?F=t[23]:(F=(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:C}),t[22]=C,t[23]=F);let I;t[24]!==P||t[25]!==F?(I=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[P,F]}),t[24]=P,t[25]=F,t[26]=I):I=t[26];let ee;t[27]===M?ee=t[28]:(ee=M.length>0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M.join(` · `)}):null,t[27]=M,t[28]=ee);let L;t[29]===O?L=t[30]:(L=O?(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-warning text-xs`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`Version drift: client `,O.clientVersion,`, server`,` `,O.serverVersion,`.`]}):null,t[29]=O,t[30]=L);let R;t[31]!==I||t[32]!==ee||t[33]!==L?(R=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[I,ee,L]}),t[31]=I,t[32]=ee,t[33]=L,t[34]=R):R=t[34];let z=v?b:y,B;t[35]!==n||t[36]!==v||t[37]!==o||t[38]!==c?(B=()=>void(v?c(n):o(n)),t[35]=n,t[36]=v,t[37]=o,t[38]=c,t[39]=B):B=t[39];let te=v?b?`Disconnecting…`:`Disconnect`:y?`Connecting…`:`Connect`,ne;t[40]!==z||t[41]!==B||t[42]!==te?(ne=(0,Q.jsx)(q,{size:`xs`,variant:`outline`,disabled:z,onClick:B,children:te}),t[40]=z,t[41]=B,t[42]=te,t[43]=ne):ne=t[43];let V=a===n,H;t[44]!==n||t[45]!==l?(H=()=>void l(n),t[44]=n,t[45]=l,t[46]=H):H=t[46];let U=a===n?`Removing…`:`Remove`,W;t[47]!==V||t[48]!==H||t[49]!==U?(W=(0,Q.jsx)(q,{size:`xs`,variant:`destructive-outline`,disabled:V,onClick:H,children:U}),t[47]=V,t[48]=H,t[49]=U,t[50]=W):W=t[50];let re;t[51]!==ne||t[52]!==W?(re=(0,Q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[ne,W]}),t[51]=ne,t[52]=W,t[53]=re):re=t[53];let G;return t[54]!==R||t[55]!==re?(G=(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsxs)(`div`,{className:kt,children:[R,re]})}),t[54]=R,t[55]=re,t[56]=G):G=t[56],G}function tn(e){return e!==null}var nn=(0,X.memo)(function(e){let t=(0,Z.c)(24),{target:n,connectingHostAlias:r,onConnect:i}=e,a;t[0]===n?a=t[1]:(a=St(n),t[0]=n,t[1]=a);let o=a,s=o!==n.alias,c=r===n.alias?`Adding…`:`Add environment`,l;t[2]===n.alias?l=t[3]:(l=(0,Q.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:n.alias}),t[2]=n.alias,t[3]=l);let u;t[4]!==o||t[5]!==s?(u=s?(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:o}):null,t[4]=o,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==l||t[8]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=r===n.alias,p;t[10]!==i||t[11]!==n?(p=()=>i(n),t[10]=i,t[11]=n,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==n.alias?(m=r===n.alias?(0,Q.jsx)(W,{className:`size-3 animate-spin`}):null,t[13]=r,t[14]=n.alias,t[15]=m):m=t[15];let h;t[16]!==c||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,Q.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,disabled:f,onClick:p,children:[m,c]})}),t[16]=c,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,Q.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,children:(0,Q.jsxs)(`div`,{className:kt,children:[d,h]})}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g});function rn(){let e=window.desktopBridge,[t,n]=(0,X.useState)(e?`owner`:null),[r,i]=(0,X.useState)(null),o=s(e=>e.byId),h=(0,X.useMemo)(()=>Object.values(o).toSorted((e,t)=>e.label.localeCompare(t.label)).map(e=>e.environmentId),[o]),v=(0,X.useMemo)(()=>Object.values(o).reduce((e,t)=>(t.desktopSsh?.alias&&(e[t.desktopSsh.alias]=t),e),{}),[o]),b=(0,X.useMemo)(()=>{let e=new Set;for(let t of Object.values(o)){let n=t.desktopSsh;n&&(e.add(n.alias),e.add(St(n)))}return e},[o]),[x,S]=(0,X.useState)([]),[C,T]=(0,X.useState)(!1),[E,D]=(0,X.useState)(!1),[O,k]=(0,X.useState)(null),[A,j]=(0,X.useState)(null),[M,N]=(0,X.useState)(null),[P,F]=(0,X.useState)([]),[I,L]=(0,X.useState)(null),[R,z]=(0,X.useState)([]),[B,te]=(0,X.useState)([]),[ne,U]=(0,X.useState)(null),[ae,oe]=(0,X.useState)(!1),[fe,Ce]=(0,X.useState)(null),[J,we]=(0,X.useState)(null),[Te,Ee]=(0,X.useState)(!1),[De,Oe]=(0,X.useState)(!1),[Ae,Re]=(0,X.useState)(`remote`),[ze,Be]=(0,X.useState)(``),[Ve,We]=(0,X.useState)(``),[Ge,qe]=(0,X.useState)(``),[Je,Ye]=(0,X.useState)(``),[Xe,Ze]=(0,X.useState)(``),[Qe,Z]=(0,X.useState)(null),[et,tt]=(0,X.useState)(!1),nt=(0,X.useMemo)(()=>x.filter(e=>{let t=St(e);return!b.has(e.alias)&&!b.has(t)}),[x,b]),[$,rt]=(0,X.useState)(null),[it,at]=(0,X.useState)(null),[ot,st]=(0,X.useState)(null),[ct,lt]=(0,X.useState)(!1),[ut,dt]=(0,X.useState)(!1),[ft,pt]=(0,X.useState)(!1),[mt,ht]=(0,X.useState)(null),[vt,yt]=(0,X.useState)(!1),[bt,xt]=(0,X.useState)(String(_t)),[Ot,kt]=(0,X.useState)(null),jt=a(),Ut=m(jt),[Wt,Gt]=(0,X.useState)(!1),Kt=ee(e=>e.defaultAdvertisedEndpointKey),qt=ee(e=>e.setDefaultAdvertisedEndpointKey),Jt=t===`owner`,Yt=e?M?.mode===`network-accessible`:r===`remote-reachable`,tn=bt.trim(),rn=Number(tn),an=/^\d+$/u.test(tn)&&Number.isInteger(rn)&&rn>=1&&rn<=65535,on=(0,X.useMemo)(()=>{if(!mt)return null;if(!an||rn===_t)return mt.httpBaseUrl;try{let e=new URL(mt.httpBaseUrl);return e.port=String(rn),e.toString().replace(/\/$/u,``)}catch{return mt.httpBaseUrl}},[an,rn,mt]),sn=(0,X.useCallback)(async t=>{if(e){lt(!0),L(null);try{let n=await e.setServerExposureMode(t?`network-accessible`:`local-only`);N(n),dt(!1),lt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;dt(!1),L(t),V.add(pe({type:`error`,title:`Could not update network access`,description:t})),lt(!1)}}},[e]),cn=(0,X.useCallback)(()=>{Ot!==null&&sn(Ot===`network-accessible`)},[sn,Ot]),ln=(0,X.useCallback)(async()=>{if(e&&an){pt(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!0,port:rn});N(t),ht(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;L(t),V.add(pe({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,an,rn]),un=(0,X.useCallback)(e=>{xt(String(M?.tailscaleServePort??_t)),ht(e)},[M?.tailscaleServePort]),dn=(0,X.useCallback)(async()=>{if(e){pt(!0),L(null);try{let t=await e.setTailscaleServeEnabled({enabled:!1,port:M?.tailscaleServePort??_t});N(t),yt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;L(t),V.add(pe({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,M?.tailscaleServePort]),fn=(0,X.useCallback)(e=>{yt(!0)},[]),pn=(0,X.useCallback)(async e=>{Ce(e),U(null);try{await y(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;U(t),V.add(pe({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{Ce(null)}},[]),mn=(0,X.useCallback)(async e=>{we(e),U(null);try{await w(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;U(t),V.add(pe({type:`error`,title:`Could not revoke client access`,description:t}))}finally{we(null)}},[]),hn=(0,X.useCallback)(async()=>{Ee(!0),U(null);try{let e=await g();V.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;U(t),V.add(pe({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{Ee(!1)}},[]),gn=(0,X.useCallback)(async()=>{if(Ae===`ssh`){tt(!0),Z(null);try{let e=Ct({host:Ge,username:Je,port:Xe}),t=await f(e,{label:``});Be(``),We(``),qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:`Environment connected`,description:`${t.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Et(e);Z(t)}finally{tt(!1)}return}tt(!0),Z(null);try{let e=Tt({host:ze,pairingCode:Ve}),t=await d({label:``,...e});Be(``),We(``),qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:`Backend added`,description:`${t.label} is now saved and will reconnect on app startup.`})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;Z(t),V.add(pe({type:`error`,title:`Could not add backend`,description:t}))}finally{tt(!1)}},[ze,Ae,Ve,Ge,Xe,Je]),_n=(0,X.useCallback)(async e=>{rt(e),Z(null);try{await u(e)}catch(e){let t=e instanceof Error?e.message:`Failed to connect backend.`;Z(t),V.add(pe({type:`error`,title:`Could not connect backend`,description:t}))}finally{rt(null)}},[]),vn=(0,X.useCallback)(async e=>{at(e),Z(null);try{await p(e)}catch(e){let t=e instanceof Error?e.message:`Failed to disconnect backend.`;Z(t),V.add(pe({type:`error`,title:`Could not disconnect backend`,description:t}))}finally{at(null)}},[]),yn=(0,X.useCallback)(async e=>{st(e),Z(null);try{await c(e)}catch(e){let t=e instanceof Error?e.message:`Failed to remove backend.`;Z(t),V.add(pe({type:`error`,title:`Could not remove backend`,description:t}))}finally{st(null)}},[]),bn=(0,X.useCallback)(async()=>{if(!e){S([]),T(!1),k(null);return}D(!0),k(null);try{let t=await e.discoverSshHosts();S(t),T(!0)}catch(e){let t=e instanceof Error?e.message:`Failed to discover SSH hosts.`;k(t),T(!0)}finally{D(!1)}},[e]),xn=(0,X.useCallback)(async(e,t)=>{j(e.alias),Ae===`ssh`?Z(null):k(null);try{let n=await f(e,t===void 0?void 0:{label:t});qe(``),Ye(``),Ze(``),Oe(!1),V.add({type:`success`,title:v[e.alias]?`Environment reconnected`:`Environment connected`,description:`${n.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Et(e);Ae===`ssh`?Z(t):k(t)}finally{j(null)}},[Ae,v]);(0,X.useEffect)(()=>{!e||!De||Ae!==`ssh`||C||E||bn()},[De,e,C,E,bn,Ae]),(0,X.useEffect)(()=>{if(e){n(`owner`);return}let t=!1;return _().then(e=>{t||(n(e.authenticated?e.role??null:null),i(e.auth.policy))}).catch(()=>{t||(n(null),i(null))}),()=>{t=!0}},[e]),(0,X.useEffect)(()=>{if(!Jt)return;let t=!1;oe(!0);let n=l().client.server.subscribeAuthAccess(e=>{if(!t){switch(e.type){case`snapshot`:z(Mt(e.payload.pairingLinks.map(e=>Pt(e)))),te(Nt(e.payload.clientSessions.map(e=>Ft(e))));break;case`pairingLinkUpserted`:z(t=>It(t,Pt(e.payload)));break;case`pairingLinkRemoved`:z(t=>Lt(t,e.payload.id));break;case`clientUpserted`:te(t=>Rt(t,Ft(e.payload)));break;case`clientRemoved`:te(t=>zt(t,e.payload.sessionId))}U(null),oe(!1)}},{onResubscribe:()=>{t||oe(!0)}});return e?(e.getServerExposureState().then(e=>{t||N(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load network exposure state.`;L(n)}),e.getAdvertisedEndpoints().then(e=>{t||F(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})):(N(null),l().client.server.getAdvertisedEndpoints().then(e=>{t||F(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;L(n)})),()=>{t=!0,n()}},[Jt,e]),(0,X.useEffect)(()=>{Jt||(oe(!1),z([]),te([]),U(null),N(null),F([]),L(null))},[Jt]);let Sn=(0,X.useMemo)(()=>R.filter(e=>e.role===`client`),[R]),Cn=(0,X.useMemo)(()=>P.find(Vt)??null,[P]),wn=(0,X.useMemo)(()=>Yt?P.filter(e=>!Vt(e)):[],[P,Yt]),Tn=(0,X.useMemo)(()=>Cn?[...wn,Cn]:wn,[Cn,wn]),En=Yt||Cn?.status===`available`,Dn=(0,X.useMemo)(()=>Bt(wn,Kt),[Kt,wn]),On=(0,X.useMemo)(()=>Dn??Bt(Cn?[Cn]:[],Kt),[Kt,Dn,Cn]),kn=On?Ht(On):null,An=(0,X.useCallback)(e=>{qt(Ht(e))},[qt]),jn=(0,X.useCallback)(e=>{let t=wt(e);if(t){Be(t.host),We(t.pairingCode);return}Be(e)},[]),Mn=e=>{let t=Ae===e.mode;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:G(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:et,onClick:()=>{Re(e.mode)},children:[e.icon?(0,Q.jsx)(`span`,{className:G(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})};return(0,Q.jsxs)(Ue,{children:[Jt?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(He,{title:`Manage local backend`,children:[Ut?(0,Q.jsx)(Y,{title:`Version drift`,description:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,Q.jsx)(ie,{className:`size-3.5 shrink-0`}),`Client `,Ut.clientVersion,`, server`,` `,Ut.serverVersion,`. Sync them if RPC calls or reconnects fail.`]})}):null,e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Network access`,description:Yt?(0,Q.jsx)($t,{endpoint:Dn,hiddenEndpointCount:Math.max(wn.length-1,0),expanded:Wt,onToggleExpanded:()=>Gt(e=>!e),fallback:M?.endpointUrl?`Reachable at ${M.endpointUrl}`:M?.advertisedHost?`Exposed on all interfaces. Pairing links use ${M.advertisedHost}.`:`Exposed on all interfaces.`}):M?`Limited to this machine.`:`Loading…`,status:I?(0,Q.jsx)(`span`,{className:`block text-destructive`,children:I}):null,control:(0,Q.jsx)(le,{checked:M?.mode===`network-accessible`,disabled:!M||ct,onCheckedChange:e=>{kt(e?`network-accessible`:`local-only`),dt(!0)},"aria-label":`Enable network access`})}),(e=>Wt?wn.map(t=>{let n=Ht(t);return(0,Q.jsx)(Qt,{endpoint:t,isDefault:n===kn,presentation:e,onSetDefault:An,onSetupTailscaleServe:un,onDisableTailscaleServe:fn,isUpdatingTailscaleServe:ft},t.id)}):null)(`endpoint-rail`),(0,Q.jsx)(Y,{title:`Tailscale HTTPS`,description:Cn?Cn.status===`available`?Cn.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,control:Cn?(0,Q.jsx)(le,{checked:Cn.status===`available`,disabled:ft,onCheckedChange:e=>{if(e){un(Cn);return}fn(Cn)},"aria-label":`Enable Tailscale HTTPS`}):null})]}):(0,Q.jsx)(Y,{title:`Network access`,description:r===`remote-reachable`?`This backend is already configured for remote access. Network exposure changes must be made where the server is launched.`:`This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing.`,control:(0,Q.jsxs)(ce,{children:[(0,Q.jsx)(K,{render:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(le,{checked:Yt,disabled:!0,"aria-label":`Enable network access`})})}),(0,Q.jsx)(se,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]})})]}),En?(0,Q.jsx)(He,{title:`Authorized clients`,headerAction:(0,Q.jsx)(Xt,{clientSessions:B,isRevokingOtherClients:Te,onRevokeOtherClients:hn}),children:(e=>(0,Q.jsxs)(Q.Fragment,{children:[ne?(0,Q.jsx)(`div`,{className:At(e),children:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:ne})}):null,(0,Q.jsx)(Zt,{endpointUrl:M?.endpointUrl,endpoints:Tn,defaultEndpointKey:kn,presentation:e,isLoading:ae,pairingLinks:Sn,clientSessions:B,revokingPairingLinkId:fe,revokingClientSessionId:J,onRevokePairingLink:pn,onRevokeClientSession:mn})]}))(`current`)}):null,(0,Q.jsx)(Le,{open:ut,onOpenChange:e=>{ct||dt(e)},onOpenChangeComplete:e=>{e||kt(null)},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:Ot===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,Q.jsx)(Fe,{children:Ot===`network-accessible`?`Ryco will restart to expose this environment over the network.`:`Ryco will restart and limit this environment back to this machine.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{disabled:ct,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ct}),children:`Cancel`}),(0,Q.jsx)(q,{variant:Ot===`local-only`?`destructive`:`default`,onClick:cn,disabled:Ot===null||ct,children:ct?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):Ot===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})}),(0,Q.jsx)(Le,{open:vt,onOpenChange:e=>{ft||yt(e)},children:(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Ie,{children:`Disable Tailscale HTTPS?`}),(0,Q.jsx)(Fe,{children:`Ryco will restart the local backend without Tailscale Serve.`})]}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ne,{disabled:ft,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(q,{variant:`destructive`,onClick:()=>void dn(),disabled:ft,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,Q.jsx)(Se,{open:mt!==null,onOpenChange:e=>{ft||e||ht(null)},children:(0,Q.jsxs)(xe,{className:`max-w-md`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Set up Tailscale HTTPS?`}),(0,Q.jsx)(be,{children:`Ryco will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,Q.jsxs)(ye,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,Q.jsx)(ue,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:bt,onChange:e=>xt(e.target.value),disabled:ft})]}),an?null:(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,Q.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,title:on??void 0,children:on??`Pending MagicDNS endpoint`})]})]}),(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(ve,{disabled:ft,render:(0,Q.jsx)(q,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,Q.jsx)(q,{onClick:()=>void ln(),disabled:ft||!an,children:ft?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ke,{className:`size-3.5`}),`Restarting…`]}):`Enable`})]})]})})]}):(0,Q.jsx)(He,{title:`Local backend access`,children:(0,Q.jsx)(Y,{title:`Owner tools`,description:`Pairing links and client-session management are only available to owner sessions for this backend.`})}),e?(0,Q.jsx)(gt,{desktopBridge:e}):null,(0,Q.jsxs)(He,{title:`Remote environments`,headerAction:(0,Q.jsxs)(Se,{open:De,onOpenChange:e=>{Oe(e),e||Z(null)},children:[(0,Q.jsx)(_e,{render:(0,Q.jsxs)(q,{size:`xs`,variant:`outline`,children:[(0,Q.jsx)(H,{className:`size-3`}),`Add environment`]})}),(0,Q.jsxs)(xe,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,Q.jsxs)(me,{children:[(0,Q.jsx)(he,{children:`Add Environment`}),(0,Q.jsx)(be,{children:`Pair another environment to this client.`})]}),(0,Q.jsx)(ye,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Mn({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,Q.jsx)($e,{"aria-hidden":!0,className:`size-4`})}),e?Mn({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,Q.jsx)(re,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,Q.jsx)(Ke,{children:Ae===`ssh`?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,Q.jsx)(ue,{value:Ge,onChange:e=>qe(e.target.value),placeholder:`Search hosts or type devbox`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,Q.jsx)(ue,{value:Je,onChange:e=>Ye(e.target.value),placeholder:`root`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,Q.jsx)(ue,{value:Xe,onChange:e=>Ze(e.target.value),placeholder:`22`,inputMode:`numeric`,disabled:et,spellCheck:!1})]})]}),Qe||O?(0,Q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:Qe??O}):null,(0,Q.jsxs)(q,{variant:`outline`,className:`w-full`,disabled:et,onClick:()=>void gn(),children:[(0,Q.jsx)(H,{className:`size-3.5`}),et?`Adding…`:`Add environment`]})]}),(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/60`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/60 bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Suggested hosts`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`From SSH config and known hosts`})]}),(0,Q.jsxs)(q,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void bn(),children:[E?(0,Q.jsx)(W,{className:`size-3 animate-spin`}):(0,Q.jsx)(W,{className:`size-3`}),`Refresh`]})]}),(0,Q.jsx)(de,{scrollFade:!0,className:`max-h-56`,children:(0,Q.jsxs)(`div`,{children:[nt.map(e=>(0,Q.jsx)(nn,{target:e,connectingHostAlias:A,onConnect:e=>void xn(e)},`${e.alias}:${e.hostname}:${e.port??``}`)),C&&!E&&nt.length===0?(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No new SSH hosts were discovered.`})}):null]})})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,Q.jsx)(ue,{value:ze,onChange:e=>jn(e.target.value),placeholder:`backend.example.com`,disabled:et,spellCheck:!1})]}),(0,Q.jsxs)(`label`,{className:`block`,children:[(0,Q.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,Q.jsx)(ue,{value:Ve,onChange:e=>We(e.target.value),placeholder:`PAIRCODE`,disabled:et,spellCheck:!1})]})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:`Paste a full pairing URL here to fill both fields automatically. The pairing code is not kept; the browser stores a bearer token for 7 days.`})})]}),Qe?(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:Qe}):null,(0,Q.jsxs)(q,{variant:`outline`,className:`w-full`,disabled:et,onClick:()=>void gn(),children:[(0,Q.jsx)(H,{className:`size-3.5`}),et?`Adding…`:`Add environment`]})]})})]})})]})]}),children:[h.map(e=>(0,Q.jsx)(en,{environmentId:e,reconnectingEnvironmentId:$,disconnectingEnvironmentId:it,removingEnvironmentId:ot,onConnect:_n,onDisconnect:vn,onRemove:yn},e)),h.length===0?(0,Q.jsx)(`div`,{className:Dt,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No remote environments yet. Click “Add environment” to pair another environment.`})}):null]})]})}function an(e){return e.status!==`unavailable`}function on(e){V.add({type:`success`,title:e===`hosted-link`?`Hosted app link copied`:e===`link`?`Pairing URL copied`:`Pairing code copied`,description:e===`hosted-link`?`Open it in the browser on the device you want to connect.`:e===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function sn(e){return qt(e)?`hosted-link`:`link`}function cn(e){return!qt(e.url)}function ln(e){return qt(e.url)}function un(e){return e.currentTarget.select()}function dn(e){return e.currentTarget.select()}function fn(e){return e!==null}export{rn as ConnectionsSettings};
|
package/dist/client/assets/{DiagnosticsSettings-DhuLK993.js → DiagnosticsSettings-ClUk2Ycp.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{t as r}from"./env-Bcq9YR3B.js";import{Kn as i,Mn as a,Sn as o,Vn as s,Zn as c,Zt as l,bn as u,gn as d,qn as f,xn as p}from"./runtime-QZPKtH2P.js";import{It as m}from"./composerDraftStore-TYv9j3vY.js";import{i as h,r as g}from"./branding-Ck4g7yv3.js";import{t as _}from"./settingsDialogStore-LxRFC5hh.js";import{f as v}from"./useRenderElement-DchFnsR8.js";import{t as y}from"./chevron-down-B7C6FKzM.js";import{i as b}from"./toast-C-0Ft2jD.js";import{t as x}from"./clipboard-copy-C4VV20QR.js";import{n as ee,t as S}from"./play-DYDxlTKo.js";import{t as C}from"./refresh-cw-DopCMrtR.js";import{t as w}from"./triangle-alert-RL_T3KLo.js";import{t as T}from"./utils-CV2fJJxC.js";import{t as E}from"./button-DG8WqjNn.js";import{t as D}from"./useCopyToClipboard-BTpWxumf.js";import{t as O}from"./toastHelpers-CSQRKo4F.js";import"./usePresentationTier-B_SCFvN7.js";import{i as k,r as te,t as ne}from"./alert-DomE7dAt.js";import{a as A,i as re,o as ie,s as j,t as M}from"./select-CZukJlTn.js";import{r as ae}from"./editorPreferences-B54y5_sx.js";import{t as N}from"./badge-w43sx8eF.js";import{i as P,n as F,r as I}from"./settingsLayout-CHJT5wtl.js";var oe=v(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),L=e(t(),1),R=n(),z=`[redacted]`,B=/(token|secret|password|passwd|credential|authorization|bearer|api[-_]?key|apikey|cookie|session[-_]?id|private[-_]?key|pairing[-_]?code|access[-_]?key|signature|email)/i;function se(e){let t;try{t=new URL(e)}catch{return e}(t.username||t.password)&&(t.username=``,t.password=``);for(let e of t.searchParams.keys())B.test(e)&&t.searchParams.set(e,z);return t.toString()}function ce(e){return le(e,!1)}function le(e,t){if(t)return e==null?e:z;if(typeof e==`string`)return se(e);if(Array.isArray(e))return e.map(e=>le(e,!1));if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=le(r,B.test(n));return t}return e}function ue(e){return ce({generatedAt:e.generatedAt,app:e.app,environments:e.environments.map(e=>({environmentId:e.environmentId,label:e.record?.label??null,connectionState:e.runtime?.connectionState??null,authState:e.runtime?.authState??null,role:e.runtime?.role??null,lastError:e.runtime?.lastError??null,lastErrorAt:e.runtime?.lastErrorAt??null,connectedAt:e.runtime?.connectedAt??null,disconnectedAt:e.runtime?.disconnectedAt??null,pushSequence:e.pushSequence})),providers:e.providers.map(e=>({instanceId:e.instanceId,driver:e.driver,enabled:e.enabled,installed:e.installed,version:e.version,status:e.status,availability:e.availability??`available`,authStatus:e.auth.status,authType:e.auth.type??null,message:e.message??null,unavailableReason:e.unavailableReason??null,checkedAt:e.checkedAt})),observability:e.observability?{logsDirectoryConfigured:e.observability.logsDirectoryPath.length>0,localTracingEnabled:e.observability.localTracingEnabled,otlpTracesEnabled:e.observability.otlpTracesEnabled,otlpMetricsEnabled:e.observability.otlpMetricsEnabled,localMetrics:e.observability.localMetrics?{turnQuiescenceAvgMs:e.observability.localMetrics.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.observability.localMetrics.checkpointDurationP95Ms,wsReconnectCount:e.observability.localMetrics.wsReconnectCount,capturedAt:e.observability.localMetrics.capturedAt}:null}:null,performance:e.performance?{local:{turnQuiescenceAvgMs:e.performance.local.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.performance.local.checkpointDurationP95Ms,latestThreadSnapshotDurationMs:e.performance.local.latestThreadSnapshotDurationMs,threadSnapshotDurationP95Ms:e.performance.local.threadSnapshotDurationP95Ms,wsReconnectCount:e.performance.local.wsReconnectCount,windowSampleCounts:{...e.performance.local.windowSampleCounts},capturedAt:e.performance.local.capturedAt},queues:{...e.performance.queues},traceSink:e.performance.traceSink?{...e.performance.traceSink}:null,snapshotCollectionDurationMs:e.performance.snapshotCollectionDurationMs}:null})}function de(e){return JSON.stringify(e,null,2)}function fe(e){return(e?.gapCount??0)>0}var V=m(),H={connected:`bg-success`,connecting:`bg-warning`,error:`bg-destructive`,disconnected:`bg-muted-foreground/40`},U={ready:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,disabled:`bg-muted-foreground/40`};function W(e){let t=(0,R.c)(4),{className:n}=e,r;t[0]===n?r=t[1]:(r=T(`inline-block size-2 shrink-0 rounded-full`,n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,V.jsx)(`span`,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=i),i}function G(e){if(!e)return`No push events observed yet.`;let t=[`last #${e.highestSequence??`—`}`,`${e.eventCount} events`,`${e.snapshotCount} snapshots`];return e.gapCount>0?t.push(`${e.gapCount} gap${e.gapCount===1?``:`s`}`):t.push(`no gaps`),t.join(` · `)}function pe(e){let t=(0,R.c)(25),{environmentId:n,record:r,runtime:i,pushSequence:a}=e,o=i?.connectionState??`disconnected`,s=r?.label??n,c=fe(a),l=H[o]??`bg-muted-foreground/40`,u;t[0]===l?u=t[1]:(u=(0,V.jsx)(W,{className:l}),t[0]=l,t[1]=u);let d;t[2]!==s||t[3]!==u?(d=(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u,s]}),t[2]=s,t[3]=u,t[4]=d):d=t[4];let f=i?.authState?` · auth ${i.authState}`:``,p=i?.role?` · ${i.role}`:``,m;t[5]!==o||t[6]!==f||t[7]!==p?(m=(0,V.jsxs)(`span`,{className:`block`,children:[`WS `,o,f,p]}),t[5]=o,t[6]=f,t[7]=p,t[8]=m):m=t[8];let h=c?`text-warning`:`text-muted-foreground/70`,g;t[9]===h?g=t[10]:(g=T(`block`,h),t[9]=h,t[10]=g);let _;t[11]===a?_=t[12]:(_=G(a),t[11]=a,t[12]=_);let v;t[13]!==g||t[14]!==_?(v=(0,V.jsx)(`span`,{className:g,children:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]===i?y=t[17]:(y=i?.lastError?(0,V.jsx)(`span`,{className:`block break-all text-destructive`,children:i.lastError}):null,t[16]=i,t[17]=y);let b;t[18]!==v||t[19]!==y||t[20]!==m?(b=(0,V.jsxs)(`span`,{className:`space-y-0.5`,children:[m,v,y]}),t[18]=v,t[19]=y,t[20]=m,t[21]=b):b=t[21];let x;return t[22]!==b||t[23]!==d?(x=(0,V.jsx)(I,{title:d,description:b}),t[22]=b,t[23]=d,t[24]=x):x=t[24],x}function K(e){let t=(0,R.c)(52),{snapshot:n}=e,a=u(be),c=p(ye),d=l(ve),m=f(),_=i(),v=s(),y=n?.performance?.local??null,[ee,S]=(0,L.useState)(!1),C;t[0]!==y||t[1]!==_?(C=_?{..._,...y?{localMetrics:y}:{}}:null,t[0]=y,t[1]=_,t[2]=C):C=t[2];let w=C,T;t[3]!==d||t[4]!==a||t[5]!==c?(T=[...new Set([...Object.keys(a),...Object.keys(c),...Object.keys(d)])].toSorted(),t[3]=d,t[4]=a,t[5]=c,t[6]=T):T=t[6];let k=T,te;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(te={onCopy:_e,onError:ge},t[7]=te):te=t[7];let{copyToClipboard:ne,isCopied:A}=D(te),re;t[8]!==ne||t[9]!==k||t[10]!==w||t[11]!==m||t[12]!==d||t[13]!==a||t[14]!==c||t[15]!==n?.performance?(re=()=>{let e=ue({generatedAt:new Date().toISOString(),app:{version:h,stage:g,isElectron:r,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:k.map(e=>({environmentId:e,record:a[e]??null,runtime:c[e]??null,pushSequence:d[e]??null})),providers:m,observability:w,performance:n?.performance??null});ne(de(e),void 0)},t[8]=ne,t[9]=k,t[10]=w,t[11]=m,t[12]=d,t[13]=a,t[14]=c,t[15]=n?.performance,t[16]=re):re=t[16],n?.performance;let ie=re,j=_?.logsDirectoryPath??null,M;t[17]!==v||t[18]!==j?(M=()=>{if(!j)return;S(!0);let e=ae(v??[]);if(!e){S(!1),b.add(O({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}o().shell.openInEditor(j,e).catch(he).finally(()=>{S(!1)})},t[17]=v,t[18]=j,t[19]=M):M=t[19];let N=M,F;t[20]===A?F=t[21]:(F=A?(0,V.jsx)(oe,{className:`size-3.5`}):(0,V.jsx)(x,{className:`size-3.5`}),t[20]=A,t[21]=F);let z=A?`Copied`:`Copy debug bundle`,B;t[22]!==ie||t[23]!==F||t[24]!==z?(B=(0,V.jsxs)(E,{size:`xs`,variant:`outline`,onClick:ie,children:[F,z]}),t[22]=ie,t[23]=F,t[24]=z,t[25]=B):B=t[25];let se;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,V.jsx)(I,{title:`Application`,description:`Version ${h} · ${g}${r?` · Desktop`:` · Browser`}`}),t[26]=se):se=t[26];let ce=j??`Resolving logs directory…`,le=!j||ee,fe=ee?`Opening…`:`Open logs folder`,H;t[27]!==N||t[28]!==le||t[29]!==fe?(H=(0,V.jsx)(E,{size:`xs`,variant:`outline`,disabled:le,onClick:N,children:fe}),t[27]=N,t[28]=le,t[29]=fe,t[30]=H):H=t[30];let U;t[31]!==ce||t[32]!==H?(U=(0,V.jsx)(I,{title:`Logs`,description:ce,control:H}),t[31]=ce,t[32]=H,t[33]=U):U=t[33];let W;t[34]!==U||t[35]!==B?(W=(0,V.jsxs)(P,{title:`Diagnostics`,headerAction:B,children:[se,U]}),t[34]=U,t[35]=B,t[36]=W):W=t[36];let G;t[37]!==k||t[38]!==d||t[39]!==a||t[40]!==c?(G=k.length===0?(0,V.jsx)(I,{title:`No environments`,description:`No environment connections are tracked yet.`}):k.map(e=>(0,V.jsx)(pe,{environmentId:e,record:a[e]??null,runtime:c[e]??null,pushSequence:d[e]??null},e)),t[37]=k,t[38]=d,t[39]=a,t[40]=c,t[41]=G):G=t[41];let K;t[42]===G?K=t[43]:(K=(0,V.jsx)(P,{title:`Environments`,children:G}),t[42]=G,t[43]=K);let q;t[44]===m?q=t[45]:(q=m.length===0?(0,V.jsx)(I,{title:`No providers`,description:`No provider instances are configured.`}):m.map(me),t[44]=m,t[45]=q);let J;t[46]===q?J=t[47]:(J=(0,V.jsx)(P,{title:`Providers`,children:q}),t[46]=q,t[47]=J);let Y;return t[48]!==W||t[49]!==K||t[50]!==J?(Y=(0,V.jsxs)(V.Fragment,{children:[W,K,J]}),t[48]=W,t[49]=K,t[50]=J,t[51]=Y):Y=t[51],Y}function me(e){let t=e.unavailableReason??e.message??null;return(0,V.jsx)(I,{title:(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(W,{className:U[e.status]??`bg-muted-foreground/40`}),e.displayName??e.instanceId]}),description:(0,V.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,V.jsxs)(`span`,{className:`block`,children:[e.status,` · auth `,e.auth.status,e.version?` · v${e.version}`:``]}),t?(0,V.jsx)(`span`,{className:`block break-all text-muted-foreground/70`,children:t}):null]})},e.instanceId)}function he(e){b.add(O({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function ge(e){b.add(O({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function _e(){b.add({type:`success`,title:`Debug bundle copied`,description:`Secrets are redacted before export.`})}function ve(e){return e.byEnvironment}function ye(e){return e.byId}function be(e){return e.byId}var q=[{method:`thread/snapshot`,requestId:`req_9f2c81d4a6`,startedAt:`12s ago`},{method:`git/status`,requestId:`req_c07b3e51fd`,startedAt:`9s ago`}];function J(e){b.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{b.update(e,{type:`success`,title:`Provider updated`,description:`New sessions will use the updated provider.`,timeout:0,data:{hideCopyButton:!0,dismissAfterVisibleMs:3e3}})},1800)}var Y=[{value:`provider-update`,label:`Provider update available`,fire:()=>{let e=b.add(O({type:`warning`,title:`Update Available: Claude Code v2.1.4`,description:`Install the update now or review provider settings.`,timeout:0,actionProps:{children:`Update`,onClick:()=>J(e)},actionVariant:`default`,data:{hideCopyButton:!0,secondaryActionProps:{children:`Settings`,onClick:()=>_.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{b.add({type:`success`,title:`Checks passed for PR #316`,description:`Redesign the notification toasts · 3273af68e412`,timeout:6e3,actionProps:{children:`Open PR`,onClick:()=>void 0},data:{actionVariant:`outline`}})}},{value:`git-push`,label:`Git push with follow-up action`,fire:()=>{b.add(O({type:`success`,title:`Pushed`,description:`3 commits pushed to origin/feat/notifications-toasts.`,timeout:0,actionProps:{children:`Open PR`,onClick:()=>void 0},actionVariant:`outline`,data:{dismissAfterVisibleMs:1e4}}))}},{value:`git-failed`,label:`Git action failed`,fire:()=>{b.add(O({type:`error`,title:`Action failed`,description:`remote: Permission to sak0a/ryco.git denied to deploy-bot.
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{t as r}from"./env-Bcy-9P3V.js";import{Kn as i,Mn as a,Sn as o,Vn as s,Zn as c,Zt as l,bn as u,gn as d,qn as f,xn as p}from"./runtime-Cy36EhFa.js";import{It as m}from"./composerDraftStore-DXTD6mKH.js";import{i as h,r as g}from"./branding-hWmEaQ8d.js";import{t as _}from"./settingsDialogStore-CzH3-ZEg.js";import{f as v}from"./useRenderElement-DchFnsR8.js";import{t as y}from"./chevron-down-B7C6FKzM.js";import{i as b}from"./toast-CV5dwFOH.js";import{t as x}from"./clipboard-copy-C4VV20QR.js";import{n as ee,t as S}from"./play-DYDxlTKo.js";import{t as C}from"./refresh-cw-DopCMrtR.js";import{t as w}from"./triangle-alert-RL_T3KLo.js";import{t as T}from"./utils-Ct58OPtz.js";import{t as E}from"./button-WR80VgkK.js";import{t as D}from"./useCopyToClipboard-BTpWxumf.js";import{t as O}from"./toastHelpers-CSQRKo4F.js";import"./usePresentationTier-B_SCFvN7.js";import{i as k,r as te,t as ne}from"./alert-C24pxxYz.js";import{a as A,i as re,o as ie,s as j,t as M}from"./select-DQIoKiCF.js";import{r as ae}from"./editorPreferences-BqfWlBPx.js";import{t as N}from"./badge-tHmsB3yQ.js";import{i as P,n as F,r as I}from"./settingsLayout-BPKHc7wz.js";var oe=v(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),L=e(t(),1),R=n(),z=`[redacted]`,B=/(token|secret|password|passwd|credential|authorization|bearer|api[-_]?key|apikey|cookie|session[-_]?id|private[-_]?key|pairing[-_]?code|access[-_]?key|signature|email)/i;function se(e){let t;try{t=new URL(e)}catch{return e}(t.username||t.password)&&(t.username=``,t.password=``);for(let e of t.searchParams.keys())B.test(e)&&t.searchParams.set(e,z);return t.toString()}function ce(e){return le(e,!1)}function le(e,t){if(t)return e==null?e:z;if(typeof e==`string`)return se(e);if(Array.isArray(e))return e.map(e=>le(e,!1));if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=le(r,B.test(n));return t}return e}function ue(e){return ce({generatedAt:e.generatedAt,app:e.app,environments:e.environments.map(e=>({environmentId:e.environmentId,label:e.record?.label??null,connectionState:e.runtime?.connectionState??null,authState:e.runtime?.authState??null,role:e.runtime?.role??null,lastError:e.runtime?.lastError??null,lastErrorAt:e.runtime?.lastErrorAt??null,connectedAt:e.runtime?.connectedAt??null,disconnectedAt:e.runtime?.disconnectedAt??null,pushSequence:e.pushSequence})),providers:e.providers.map(e=>({instanceId:e.instanceId,driver:e.driver,enabled:e.enabled,installed:e.installed,version:e.version,status:e.status,availability:e.availability??`available`,authStatus:e.auth.status,authType:e.auth.type??null,message:e.message??null,unavailableReason:e.unavailableReason??null,checkedAt:e.checkedAt})),observability:e.observability?{logsDirectoryConfigured:e.observability.logsDirectoryPath.length>0,localTracingEnabled:e.observability.localTracingEnabled,otlpTracesEnabled:e.observability.otlpTracesEnabled,otlpMetricsEnabled:e.observability.otlpMetricsEnabled,localMetrics:e.observability.localMetrics?{turnQuiescenceAvgMs:e.observability.localMetrics.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.observability.localMetrics.checkpointDurationP95Ms,wsReconnectCount:e.observability.localMetrics.wsReconnectCount,capturedAt:e.observability.localMetrics.capturedAt}:null}:null,performance:e.performance?{local:{turnQuiescenceAvgMs:e.performance.local.turnQuiescenceAvgMs,checkpointDurationP95Ms:e.performance.local.checkpointDurationP95Ms,latestThreadSnapshotDurationMs:e.performance.local.latestThreadSnapshotDurationMs,threadSnapshotDurationP95Ms:e.performance.local.threadSnapshotDurationP95Ms,wsReconnectCount:e.performance.local.wsReconnectCount,windowSampleCounts:{...e.performance.local.windowSampleCounts},capturedAt:e.performance.local.capturedAt},queues:{...e.performance.queues},traceSink:e.performance.traceSink?{...e.performance.traceSink}:null,snapshotCollectionDurationMs:e.performance.snapshotCollectionDurationMs}:null})}function de(e){return JSON.stringify(e,null,2)}function fe(e){return(e?.gapCount??0)>0}var V=m(),H={connected:`bg-success`,connecting:`bg-warning`,error:`bg-destructive`,disconnected:`bg-muted-foreground/40`},U={ready:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,disabled:`bg-muted-foreground/40`};function W(e){let t=(0,R.c)(4),{className:n}=e,r;t[0]===n?r=t[1]:(r=T(`inline-block size-2 shrink-0 rounded-full`,n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,V.jsx)(`span`,{className:r,"aria-hidden":!0}),t[2]=r,t[3]=i),i}function G(e){if(!e)return`No push events observed yet.`;let t=[`last #${e.highestSequence??`—`}`,`${e.eventCount} events`,`${e.snapshotCount} snapshots`];return e.gapCount>0?t.push(`${e.gapCount} gap${e.gapCount===1?``:`s`}`):t.push(`no gaps`),t.join(` · `)}function pe(e){let t=(0,R.c)(25),{environmentId:n,record:r,runtime:i,pushSequence:a}=e,o=i?.connectionState??`disconnected`,s=r?.label??n,c=fe(a),l=H[o]??`bg-muted-foreground/40`,u;t[0]===l?u=t[1]:(u=(0,V.jsx)(W,{className:l}),t[0]=l,t[1]=u);let d;t[2]!==s||t[3]!==u?(d=(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[u,s]}),t[2]=s,t[3]=u,t[4]=d):d=t[4];let f=i?.authState?` · auth ${i.authState}`:``,p=i?.role?` · ${i.role}`:``,m;t[5]!==o||t[6]!==f||t[7]!==p?(m=(0,V.jsxs)(`span`,{className:`block`,children:[`WS `,o,f,p]}),t[5]=o,t[6]=f,t[7]=p,t[8]=m):m=t[8];let h=c?`text-warning`:`text-muted-foreground/70`,g;t[9]===h?g=t[10]:(g=T(`block`,h),t[9]=h,t[10]=g);let _;t[11]===a?_=t[12]:(_=G(a),t[11]=a,t[12]=_);let v;t[13]!==g||t[14]!==_?(v=(0,V.jsx)(`span`,{className:g,children:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]===i?y=t[17]:(y=i?.lastError?(0,V.jsx)(`span`,{className:`block break-all text-destructive`,children:i.lastError}):null,t[16]=i,t[17]=y);let b;t[18]!==v||t[19]!==y||t[20]!==m?(b=(0,V.jsxs)(`span`,{className:`space-y-0.5`,children:[m,v,y]}),t[18]=v,t[19]=y,t[20]=m,t[21]=b):b=t[21];let x;return t[22]!==b||t[23]!==d?(x=(0,V.jsx)(I,{title:d,description:b}),t[22]=b,t[23]=d,t[24]=x):x=t[24],x}function K(e){let t=(0,R.c)(52),{snapshot:n}=e,a=u(be),c=p(ye),d=l(ve),m=f(),_=i(),v=s(),y=n?.performance?.local??null,[ee,S]=(0,L.useState)(!1),C;t[0]!==y||t[1]!==_?(C=_?{..._,...y?{localMetrics:y}:{}}:null,t[0]=y,t[1]=_,t[2]=C):C=t[2];let w=C,T;t[3]!==d||t[4]!==a||t[5]!==c?(T=[...new Set([...Object.keys(a),...Object.keys(c),...Object.keys(d)])].toSorted(),t[3]=d,t[4]=a,t[5]=c,t[6]=T):T=t[6];let k=T,te;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(te={onCopy:_e,onError:ge},t[7]=te):te=t[7];let{copyToClipboard:ne,isCopied:A}=D(te),re;t[8]!==ne||t[9]!==k||t[10]!==w||t[11]!==m||t[12]!==d||t[13]!==a||t[14]!==c||t[15]!==n?.performance?(re=()=>{let e=ue({generatedAt:new Date().toISOString(),app:{version:h,stage:g,isElectron:r,userAgent:typeof navigator>`u`?null:navigator.userAgent},environments:k.map(e=>({environmentId:e,record:a[e]??null,runtime:c[e]??null,pushSequence:d[e]??null})),providers:m,observability:w,performance:n?.performance??null});ne(de(e),void 0)},t[8]=ne,t[9]=k,t[10]=w,t[11]=m,t[12]=d,t[13]=a,t[14]=c,t[15]=n?.performance,t[16]=re):re=t[16],n?.performance;let ie=re,j=_?.logsDirectoryPath??null,M;t[17]!==v||t[18]!==j?(M=()=>{if(!j)return;S(!0);let e=ae(v??[]);if(!e){S(!1),b.add(O({type:`error`,title:`Could not open logs folder`,description:`No available editors found.`}));return}o().shell.openInEditor(j,e).catch(he).finally(()=>{S(!1)})},t[17]=v,t[18]=j,t[19]=M):M=t[19];let N=M,F;t[20]===A?F=t[21]:(F=A?(0,V.jsx)(oe,{className:`size-3.5`}):(0,V.jsx)(x,{className:`size-3.5`}),t[20]=A,t[21]=F);let z=A?`Copied`:`Copy debug bundle`,B;t[22]!==ie||t[23]!==F||t[24]!==z?(B=(0,V.jsxs)(E,{size:`xs`,variant:`outline`,onClick:ie,children:[F,z]}),t[22]=ie,t[23]=F,t[24]=z,t[25]=B):B=t[25];let se;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,V.jsx)(I,{title:`Application`,description:`Version ${h} · ${g}${r?` · Desktop`:` · Browser`}`}),t[26]=se):se=t[26];let ce=j??`Resolving logs directory…`,le=!j||ee,fe=ee?`Opening…`:`Open logs folder`,H;t[27]!==N||t[28]!==le||t[29]!==fe?(H=(0,V.jsx)(E,{size:`xs`,variant:`outline`,disabled:le,onClick:N,children:fe}),t[27]=N,t[28]=le,t[29]=fe,t[30]=H):H=t[30];let U;t[31]!==ce||t[32]!==H?(U=(0,V.jsx)(I,{title:`Logs`,description:ce,control:H}),t[31]=ce,t[32]=H,t[33]=U):U=t[33];let W;t[34]!==U||t[35]!==B?(W=(0,V.jsxs)(P,{title:`Diagnostics`,headerAction:B,children:[se,U]}),t[34]=U,t[35]=B,t[36]=W):W=t[36];let G;t[37]!==k||t[38]!==d||t[39]!==a||t[40]!==c?(G=k.length===0?(0,V.jsx)(I,{title:`No environments`,description:`No environment connections are tracked yet.`}):k.map(e=>(0,V.jsx)(pe,{environmentId:e,record:a[e]??null,runtime:c[e]??null,pushSequence:d[e]??null},e)),t[37]=k,t[38]=d,t[39]=a,t[40]=c,t[41]=G):G=t[41];let K;t[42]===G?K=t[43]:(K=(0,V.jsx)(P,{title:`Environments`,children:G}),t[42]=G,t[43]=K);let q;t[44]===m?q=t[45]:(q=m.length===0?(0,V.jsx)(I,{title:`No providers`,description:`No provider instances are configured.`}):m.map(me),t[44]=m,t[45]=q);let J;t[46]===q?J=t[47]:(J=(0,V.jsx)(P,{title:`Providers`,children:q}),t[46]=q,t[47]=J);let Y;return t[48]!==W||t[49]!==K||t[50]!==J?(Y=(0,V.jsxs)(V.Fragment,{children:[W,K,J]}),t[48]=W,t[49]=K,t[50]=J,t[51]=Y):Y=t[51],Y}function me(e){let t=e.unavailableReason??e.message??null;return(0,V.jsx)(I,{title:(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(W,{className:U[e.status]??`bg-muted-foreground/40`}),e.displayName??e.instanceId]}),description:(0,V.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,V.jsxs)(`span`,{className:`block`,children:[e.status,` · auth `,e.auth.status,e.version?` · v${e.version}`:``]}),t?(0,V.jsx)(`span`,{className:`block break-all text-muted-foreground/70`,children:t}):null]})},e.instanceId)}function he(e){b.add(O({type:`error`,title:`Could not open logs folder`,description:e instanceof Error?e.message:`Failed to open logs folder.`}))}function ge(e){b.add(O({type:`error`,title:`Could not copy debug bundle`,description:e.message}))}function _e(){b.add({type:`success`,title:`Debug bundle copied`,description:`Secrets are redacted before export.`})}function ve(e){return e.byEnvironment}function ye(e){return e.byId}function be(e){return e.byId}var q=[{method:`thread/snapshot`,requestId:`req_9f2c81d4a6`,startedAt:`12s ago`},{method:`git/status`,requestId:`req_c07b3e51fd`,startedAt:`9s ago`}];function J(e){b.update(e,{type:`loading`,title:`Updating Claude Code`,description:`Running provider update command.`,timeout:0,actionProps:void 0,data:{hideCopyButton:!0}}),window.setTimeout(()=>{b.update(e,{type:`success`,title:`Provider updated`,description:`New sessions will use the updated provider.`,timeout:0,data:{hideCopyButton:!0,dismissAfterVisibleMs:3e3}})},1800)}var Y=[{value:`provider-update`,label:`Provider update available`,fire:()=>{let e=b.add(O({type:`warning`,title:`Update Available: Claude Code v2.1.4`,description:`Install the update now or review provider settings.`,timeout:0,actionProps:{children:`Update`,onClick:()=>J(e)},actionVariant:`default`,data:{hideCopyButton:!0,secondaryActionProps:{children:`Settings`,onClick:()=>_.getState().openSettings(`providers`)},secondaryActionVariant:`outline`}}))}},{value:`pr-checks-passed`,label:`PR checks passed`,fire:()=>{b.add({type:`success`,title:`Checks passed for PR #316`,description:`Redesign the notification toasts · 3273af68e412`,timeout:6e3,actionProps:{children:`Open PR`,onClick:()=>void 0},data:{actionVariant:`outline`}})}},{value:`git-push`,label:`Git push with follow-up action`,fire:()=>{b.add(O({type:`success`,title:`Pushed`,description:`3 commits pushed to origin/feat/notifications-toasts.`,timeout:0,actionProps:{children:`Open PR`,onClick:()=>void 0},actionVariant:`outline`,data:{dismissAfterVisibleMs:1e4}}))}},{value:`git-failed`,label:`Git action failed`,fire:()=>{b.add(O({type:`error`,title:`Action failed`,description:`remote: Permission to sak0a/ryco.git denied to deploy-bot.
|
|
2
2
|
fatal: unable to access 'https://github.com/sak0a/ryco.git/': The requested URL returned error: 403`,timeout:0}))}},{value:`git-pull`,label:`Git pull (loading → result)`,fire:()=>{b.promise(new Promise(e=>{window.setTimeout(e,2400)}),{loading:{title:`Pulling...`},success:{title:`Pulled`,description:`Updated main from origin/main.`},error:{title:`Pull failed`,description:`Could not fast-forward.`}})}},{value:`slow-requests`,label:`Slow requests (expandable)`,fire:()=>{b.add({type:`warning`,title:`Some requests are slow`,description:`2 requests waiting longer than 5s.`,timeout:0,data:{expandableDescriptionTrigger:!0,expandableLabels:{expand:`Show requests`,collapse:`Hide requests`},expandableContent:(0,V.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:q.map(e=>(0,V.jsxs)(`li`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,V.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1 py-0.5 font-mono text-[10px]`,children:e.method}),(0,V.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.requestId}),(0,V.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,children:e.startedAt})]},e.requestId))})}})}},{value:`reconnected`,label:`Connection restored`,fire:()=>{b.add({type:`success`,title:`Reconnected to Ryco Server`,description:`Connection restored at ${new Date().toLocaleTimeString()}.`,timeout:0,data:{dismissAfterVisibleMs:8e3,hideCopyButton:!0}})}},{value:`long-error`,label:`Error with long details`,fire:()=>{b.add({type:`error`,title:`Provider session crashed`,description:`The provider session exited unexpectedly with code 137 while processing the turn. Last stderr output: FATAL ERROR: Reached heap limit — allocation failed, JavaScript heap out of memory. Restart the session or reduce the attached context, then try again.`,timeout:0})}}],xe=[`pr-checks-passed`,`provider-update`,`git-failed`];function Se(){xe.forEach((e,t)=>{let n=Y.find(t=>t.value===e);n&&window.setTimeout(()=>n.fire(),t*350)})}function Ce(){let e=(0,R.c)(17),[t,n]=(0,L.useState)(Y[0]?.value??``),r;e[0]===t?r=e[1]:(r=Y.find(e=>e.value===t)??Y[0],e[0]=t,e[1]=r);let i=r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{typeof e==`string`&&n(e)},e[2]=a):a=e[2];let o=i?.label,s;e[3]===o?s=e[4]:(s=(0,V.jsx)(ie,{className:`w-full sm:w-56`,"aria-label":`Notification sample`,children:(0,V.jsx)(j,{children:o})}),e[3]=o,e[4]=s);let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,V.jsx)(A,{align:`end`,alignItemWithTrigger:!1,children:Y.map(we)}),e[5]=c):c=e[5];let l;e[6]!==t||e[7]!==s?(l=(0,V.jsxs)(M,{value:t,onValueChange:a,children:[s,c]}),e[6]=t,e[7]=s,e[8]=l):l=e[8];let u;e[9]===i?u=e[10]:(u=(0,V.jsx)(E,{"aria-label":`Show test notification`,size:`xs`,onClick:()=>i?.fire(),children:`Show`}),e[9]=i,e[10]=u);let d;e[11]!==l||e[12]!==u?(d=(0,V.jsx)(I,{title:`Test notification`,description:`Preview the notification design with realistic samples. Nothing is sent or changed.`,control:(0,V.jsxs)(`div`,{className:`flex w-full items-center gap-2 sm:w-auto`,children:[l,u]})}),e[11]=l,e[12]=u,e[13]=d):d=e[13];let f;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(I,{title:`Notification stack`,description:`Fire a short burst to preview stacking, peeking, and hover expansion.`,control:(0,V.jsx)(E,{size:`xs`,variant:`outline`,onClick:Se,children:`Show stack`})}),e[14]=f):f=e[14];let p;return e[15]===d?p=e[16]:(p=(0,V.jsxs)(P,{title:`Notifications`,children:[d,f]}),e[15]=d,e[16]=p),p}function we(e){return(0,V.jsx)(re,{hideIndicator:!0,value:e.value,children:e.label},e.value)}function Te(e){return e===`failure`||e===`error`}function X(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function Z(e){return!Number.isFinite(e)||e<=0?`0 ms`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(+(e<1e4))} s`:`${(e/6e4).toFixed(1)} min`}function Ee(e){return e===void 0||!Number.isFinite(e)?`n/a`:`${Math.max(0,Math.min(100,e)).toFixed(1)}%`}function Q(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return e;let r=Math.max(0,t-n);return r<1e3?`just now`:r<6e4?`${Math.floor(r/1e3)}s ago`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:`${Math.floor(r/864e5)}d ago`}function De(e){return e.map(e=>({label:e.sampledAt,value:e.memory.rssBytes}))}function Oe(e){return e.map(e=>({label:e.sampledAt,value:e.cpu.utilizationPercent??0}))}function ke(e){return e.map(e=>({label:e.label,value:e.count}))}function Ae(e){return e.slice(0,8).map(e=>({label:e.name,value:e.count}))}function je(e){let t=e.failures.latest[0];return t?t.message:`No failures`}var Me=5e3;function Ne(e){let t=(0,R.c)(33),{points:n,formatValue:r}=e,i;bb0:{if(n.length===0){i=``;break bb0}let e;t[0]===n?e=t[1]:(e=Math.max(...n.map(Pe),1),t[0]=n,t[1]=e);let r=e,a;if(t[2]!==r||t[3]!==n){let e;t[5]!==r||t[6]!==n.length?(e=(e,t)=>{let i=n.length===1?320:t/(n.length-1)*320,a=96-e.value/r*84-6;return`${t===0?`M`:`L`}${i.toFixed(2)},${a.toFixed(2)}`},t[5]=r,t[6]=n.length,t[7]=e):e=t[7],a=n.map(e).join(` `),t[2]=r,t[3]=n,t[4]=a}else a=t[4];i=a}let a=i,o,s,c,l,u;if(t[8]!==r||t[9]!==n){let e=n.at(-1)?.value??0;u=`min-w-0`,c=`mb-2 flex items-baseline justify-between gap-3`,t[15]===n.length?l=t[16]:(l=(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:[n.length,` samples`]}),t[15]=n.length,t[16]=l),o=`font-mono text-xs text-foreground`,s=r(e),t[8]=r,t[9]=n,t[10]=o,t[11]=s,t[12]=c,t[13]=l,t[14]=u}else o=t[10],s=t[11],c=t[12],l=t[13],u=t[14];let d;t[17]!==o||t[18]!==s?(d=(0,V.jsx)(`span`,{className:o,children:s}),t[17]=o,t[18]=s,t[19]=d):d=t[19];let f;t[20]!==c||t[21]!==l||t[22]!==d?(f=(0,V.jsxs)(`div`,{className:c,children:[l,d]}),t[20]=c,t[21]=l,t[22]=d,t[23]=f):f=t[23];let p;t[24]===a?p=t[25]:(p=(0,V.jsx)(`path`,{d:a,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,vectorEffect:`non-scaling-stroke`}),t[24]=a,t[25]=p);let m;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,V.jsx)(`line`,{x1:`0`,y1:95,x2:320,y2:95,className:`stroke-border`}),t[26]=m):m=t[26];let h;t[27]===p?h=t[28]:(h=(0,V.jsxs)(`svg`,{viewBox:`0 0 320 96`,className:`h-24 w-full overflow-visible text-info`,role:`img`,"aria-label":`Diagnostics history chart`,children:[p,m]}),t[27]=p,t[28]=h);let g;return t[29]!==h||t[30]!==u||t[31]!==f?(g=(0,V.jsxs)(`div`,{className:u,children:[f,h]}),t[29]=h,t[30]=u,t[31]=f,t[32]=g):g=t[32],g}function Pe(e){return e.value}function Fe(e){let t=(0,R.c)(12),{points:n,formatValue:r}=e,i=r===void 0?String:r,a;t[0]===n?a=t[1]:(a=Math.max(...n.map(Ie),1),t[0]=n,t[1]=a);let o=a;if(n.length===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No data yet.`}),t[2]=e):e=t[2],e}let s;if(t[3]!==i||t[4]!==o||t[5]!==n){let e;t[7]!==i||t[8]!==o?(e=e=>(0,V.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_5rem] items-center gap-3 px-4 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`mb-1 truncate text-[12px] font-medium`,children:e.label}),(0,V.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,V.jsx)(`div`,{className:`h-full rounded-full bg-info`,style:{width:`${Math.max(4,e.value/o*100)}%`}})})]}),(0,V.jsx)(`div`,{className:`text-right font-mono text-[11px] text-muted-foreground`,children:i(e.value)})]},e.label),t[7]=i,t[8]=o,t[9]=e):e=t[9],s=n.map(e),t[3]=i,t[4]=o,t[5]=n,t[6]=s}else s=t[6];let c;return t[10]===s?c=t[11]:(c=(0,V.jsx)(`div`,{className:`divide-y divide-border/60`,children:s}),t[10]=s,t[11]=c),c}function Ie(e){return e.value}function $(e){let t=(0,R.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,V.jsx)(`div`,{className:`truncate text-[11px] font-medium text-muted-foreground uppercase tracking-[0.08em]`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,V.jsx)(`div`,{className:`mt-1 truncate text-[15px] font-semibold text-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] text-muted-foreground`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,V.jsxs)(`div`,{className:`min-w-0 border-border/60 border-t px-4 py-3 first:border-t-0 sm:px-5`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Le(e){let t=(0,R.c)(12),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,V.jsx)(`div`,{className:`text-[12px] font-medium text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,V.jsx)(`div`,{className:`font-mono text-[12px] text-foreground`,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,V.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:i}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,V.jsxs)(`div`,{className:`grid gap-1 border-border/60 border-t px-4 py-3 first:border-t-0 sm:grid-cols-[11rem_minmax(0,1fr)] sm:px-5`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Re(e){let t=(0,R.c)(5),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(`summary`,{className:`cursor-pointer select-none text-[11px] text-muted-foreground hover:text-foreground`,children:`raw`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=JSON.stringify(n,null,2),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,V.jsxs)(`details`,{className:`group`,children:[r,(0,V.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto rounded-md bg-muted/60 p-3 text-[11px] leading-relaxed`,children:i})]}),t[3]=i,t[4]=a),a}function ze(e){let t=(0,R.c)(5),{spans:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No spans retained yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.slice(0,10).map(Be),t[1]=n,t[2]=r);let i;return t[3]===r?i=t[4]:(i=(0,V.jsx)(`div`,{className:`divide-y divide-border/60`,children:r}),t[3]=r,t[4]=i),i}function Be(e){return(0,V.jsxs)(`div`,{className:`grid gap-2 px-4 py-3 sm:grid-cols-[minmax(0,1fr)_6rem_5rem] sm:items-start`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.name}),(0,V.jsx)(N,{size:`sm`,variant:Te(e.status)?`error`:`outline`,children:e.status})]}),(0,V.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[e.source,` / `,e.kind,` / `,e.spanId]}),e.failureMessage&&Te(e.status)?(0,V.jsx)(`div`,{className:`mt-1 line-clamp-2 text-[11px] text-destructive`,children:e.failureMessage}):null,(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Re,{value:e})})]}),(0,V.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Z(e.durationMs)}),(0,V.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Q(e.endTime)})]},e.id)}function Ve(e){let t=(0,R.c)(9),{memorySeries:n,cpuSeries:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(`div`,{className:`mb-1 text-[12px] font-semibold`,children:`RSS memory`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,V.jsxs)(`div`,{className:`min-w-0 p-4`,children:[i,(0,V.jsx)(Ne,{points:n,formatValue:X})]}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(`div`,{className:`mb-1 text-[12px] font-semibold`,children:`CPU utilization`}),t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,V.jsxs)(`div`,{className:`min-w-0 p-4`,children:[o,(0,V.jsx)(Ne,{points:r,formatValue:He})]}),t[4]=r,t[5]=s);let c;return t[6]!==a||t[7]!==s?(c=(0,V.jsx)(P,{title:`Resource history`,children:(0,V.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[a,s]})}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c}function He(e){return`${e.toFixed(1)}%`}function Ue(e){let t=(0,R.c)(25),{snapshot:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,V.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Top span names`}),t[0]=r):r=t[0];let i;t[1]===n?.tracing.topSpanNames?i=t[2]:(i=n?.tracing.topSpanNames??[],t[1]=n?.tracing.topSpanNames,t[2]=i);let a;t[3]===i?a=t[4]:(a=Ae(i),t[3]=i,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,V.jsx)(Fe,{points:a})]}),t[5]=a,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Duration buckets`}),t[7]=s):s=t[7];let c;t[8]===n?.tracing.durationBuckets?c=t[9]:(c=n?.tracing.durationBuckets??[],t[8]=n?.tracing.durationBuckets,t[9]=c);let l;t[10]===c?l=t[11]:(l=ke(c),t[10]=c,t[11]=l);let u;t[12]===l?u=t[13]:(u=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[s,(0,V.jsx)(Fe,{points:l})]}),t[12]=l,t[13]=u);let d;t[14]!==o||t[15]!==u?(d=(0,V.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[o,u]}),t[14]=o,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,V.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Slowest spans`}),t[17]=f):f=t[17];let p;t[18]===n?.tracing.slowestSpans?p=t[19]:(p=n?.tracing.slowestSpans??[],t[18]=n?.tracing.slowestSpans,t[19]=p);let m;t[20]===p?m=t[21]:(m=(0,V.jsxs)(`div`,{className:`border-border/60 border-t`,children:[f,(0,V.jsx)(ze,{spans:p})]}),t[20]=p,t[21]=m);let h;return t[22]!==m||t[23]!==d?(h=(0,V.jsxs)(P,{title:`Tracing diagnostics`,children:[d,m]}),t[22]=m,t[23]=d,t[24]=h):h=t[24],h}function We(e){let t=(0,R.c)(10),{snapshot:n,nowMs:r}=e,i;if(t[0]!==r||t[1]!==n?.failures.latest){let e;t[3]===r?e=t[4]:(e=e=>(0,V.jsxs)(`div`,{className:`grid gap-2 px-4 py-3 sm:grid-cols-[minmax(0,1fr)_6rem]`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(N,{size:`sm`,variant:`error`,children:e.category}),(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.message})]}),(0,V.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[e.source,` / `,e.signature]}),(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Re,{value:e.raw??e})})]}),(0,V.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground sm:text-right`,children:Q(e.occurredAt,r)})]},e.id),t[3]=r,t[4]=e),i=(n?.failures.latest??[]).slice(0,8).map(e),t[0]=r,t[1]=n?.failures.latest,t[2]=i}else i=t[2];let a;t[5]===n?a=t[6]:(a=n&&n.failures.latest.length===0?(0,V.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No failures retained.`}):null,t[5]=n,t[6]=a);let o;return t[7]!==i||t[8]!==a?(o=(0,V.jsx)(P,{title:`Failures`,children:(0,V.jsxs)(`div`,{className:`divide-y divide-border/60`,children:[i,a]})}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Ge(e){let t=(0,R.c)(27),{snapshot:n,slowRpcAcks:r,nowMs:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Providers`}),t[0]=a):a=t[0];let o;t[1]===n?.liveProcesses.providers?o=t[2]:(o=n?.liveProcesses.providers??[],t[1]=n?.liveProcesses.providers,t[2]=o);let s;t[3]===o?s=t[4]:(s=o.map(qe),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,V.jsx)(`div`,{className:`divide-y divide-border/60`,children:s})]}),t[5]=s,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(`div`,{className:`border-border/60 border-b px-4 py-2 text-[12px] font-semibold`,children:`Terminals and slow RPCs`}),t[7]=l):l=t[7];let u;t[8]===n?.liveProcesses.terminals?u=t[9]:(u=n?.liveProcesses.terminals??[],t[8]=n?.liveProcesses.terminals,t[9]=u);let d;t[10]===u?d=t[11]:(d=u.map(Ke),t[10]=u,t[11]=d);let f;if(t[12]!==i||t[13]!==r){let e;t[15]===i?e=t[16]:(e=e=>(0,V.jsxs)(`div`,{className:`px-4 py-2.5`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13px] font-medium`,children:e.tag}),(0,V.jsxs)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:[`slow ack / `,Q(e.startedAt,i)]})]},e.requestId),t[15]=i,t[16]=e),f=r.map(e),t[12]=i,t[13]=r,t[14]=f}else f=t[14];let p;t[17]!==r.length||t[18]!==n?.liveProcesses.terminals.length?(p=(n?.liveProcesses.terminals.length??0)===0&&r.length===0?(0,V.jsx)(`p`,{className:`px-4 py-4 text-muted-foreground text-sm`,children:`No live terminal or slow RPC activity.`}):null,t[17]=r.length,t[18]=n?.liveProcesses.terminals.length,t[19]=p):p=t[19];let m;t[20]!==d||t[21]!==f||t[22]!==p?(m=(0,V.jsxs)(`div`,{className:`min-w-0`,children:[l,(0,V.jsxs)(`div`,{className:`divide-y divide-border/60`,children:[d,f,p]})]}),t[20]=d,t[21]=f,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==m||t[25]!==c?(h=(0,V.jsx)(P,{title:`Live activity`,children:(0,V.jsxs)(`div`,{className:`grid gap-0 divide-y divide-border/60 lg:grid-cols-2 lg:divide-x lg:divide-y-0`,children:[c,m]})}),t[24]=m,t[25]=c,t[26]=h):h=t[26],h}function Ke(e){return(0,V.jsxs)(`div`,{className:`px-4 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.terminalId}),(0,V.jsx)(N,{size:`sm`,variant:e.status===`error`?`error`:`outline`,children:e.status})]}),(0,V.jsxs)(`div`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:[`pid `,e.pid??`n/a`,` / subprocess`,` `,e.hasRunningSubprocess?`yes`:`no`]})]},`${e.threadId}:${e.terminalId}`)}function qe(e){return(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13px] font-medium`,children:e.displayName??e.instanceId}),(0,V.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.driver})]}),(0,V.jsx)(N,{size:`sm`,variant:e.status===`error`?`error`:e.status===`warning`?`warning`:`outline`,children:e.status})]},e.instanceId)}function Je(e){let t=(0,R.c)(57),{snapshot:n,memorySeries:r,cpuSeries:i,slowRpcAcks:a,latestFailure:o,nowMs:s}=e,c;t[0]===n?c=t[1]:(c=n?Z(n.uptimeMs):`n/a`,t[0]=n,t[1]=c);let l;t[2]!==s||t[3]!==n?(l=n?`Started ${Q(n.serverStartedAt,s)}`:void 0,t[2]=s,t[3]=n,t[4]=l):l=t[4];let u;t[5]!==c||t[6]!==l?(u=(0,V.jsx)($,{label:`Uptime`,value:c,detail:l}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===n?d=t[9]:(d=n?X(n.resources.current.memory.rssBytes):`n/a`,t[8]=n,t[9]=d);let f;t[10]===n?f=t[11]:(f=n?`${X(n.resources.current.memory.heapUsedBytes)} heap used`:void 0,t[10]=n,t[11]=f);let p;t[12]!==d||t[13]!==f?(p=(0,V.jsx)($,{label:`Memory`,value:d,detail:f}),t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===n?m=t[16]:(m=n?Ee(n.resources.current.cpu.utilizationPercent):`n/a`,t[15]=n,t[16]=m);let h;t[17]===n?h=t[18]:(h=n?.resources.current.eventLoopDelayMs===void 0?void 0:`${Z(n.resources.current.eventLoopDelayMs)} event loop delay`,t[17]=n,t[18]=h);let g;t[19]!==m||t[20]!==h?(g=(0,V.jsx)($,{label:`CPU`,value:m,detail:h}),t[19]=m,t[20]=h,t[21]=g):g=t[21];let _;t[22]===n?.liveProcesses.providers?_=t[23]:(_=n?.liveProcesses.providers.filter(Ye).length??0,t[22]=n?.liveProcesses.providers,t[23]=_);let v=`${_} providers`,y=`${n?.liveProcesses.terminals.length??0} terminal sessions`,b;t[24]!==v||t[25]!==y?(b=(0,V.jsx)($,{label:`Activity`,value:v,detail:y}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x=`${n?.tracing.retainedSpanCount??0} spans`,ee=n?`${n.limits.fileTailBytes/1024} KB file tail`:void 0,S;t[27]!==x||t[28]!==ee?(S=(0,V.jsx)($,{label:`Tracing`,value:x,detail:ee}),t[27]=x,t[28]=ee,t[29]=S):S=t[29];let C;t[30]===o?C=t[31]:(C=(0,V.jsx)($,{label:`Latest failure`,value:o}),t[30]=o,t[31]=C);let w;t[32]!==b||t[33]!==S||t[34]!==C||t[35]!==u||t[36]!==p||t[37]!==g?(w=(0,V.jsx)(P,{title:`Overview`,children:(0,V.jsxs)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-3`,children:[u,p,g,b,S,C]})}),t[32]=b,t[33]=S,t[34]=C,t[35]=u,t[36]=p,t[37]=g,t[38]=w):w=t[38];let T;t[39]!==i||t[40]!==r?(T=(0,V.jsx)(Ve,{memorySeries:r,cpuSeries:i}),t[39]=i,t[40]=r,t[41]=T):T=t[41];let E;t[42]===n?E=t[43]:(E=(0,V.jsx)(Ue,{snapshot:n}),t[42]=n,t[43]=E);let D;t[44]!==s||t[45]!==n?(D=(0,V.jsx)(We,{snapshot:n,nowMs:s}),t[44]=s,t[45]=n,t[46]=D):D=t[46];let O;t[47]!==s||t[48]!==a||t[49]!==n?(O=(0,V.jsx)(Ge,{snapshot:n,slowRpcAcks:a,nowMs:s}),t[47]=s,t[48]=a,t[49]=n,t[50]=O):O=t[50];let k;return t[51]!==w||t[52]!==T||t[53]!==E||t[54]!==D||t[55]!==O?(k=(0,V.jsxs)(V.Fragment,{children:[w,T,E,D,O]}),t[51]=w,t[52]=T,t[53]=E,t[54]=D,t[55]=O,t[56]=k):k=t[56],k}function Ye(e){return e.enabled}function Xe(e){let t=(0,R.c)(14),{snapshot:n,error:r}=e;if(!r&&(!n||n.warnings.length===0))return null;let i=r?`error`:`warning`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,V.jsx)(w,{}),t[0]=a):a=t[0];let o=r?`Diagnostics refresh failed`:`Diagnostics warnings`,s;t[1]===o?s=t[2]:(s=(0,V.jsx)(k,{children:o}),t[1]=o,t[2]=s);let c;t[3]===r?c=t[4]:(c=r?(0,V.jsx)(`span`,{children:r}):null,t[3]=r,t[4]=c);let l;t[5]===n?.warnings?l=t[6]:(l=n?.warnings.slice(0,4).map(Ze),t[5]=n?.warnings,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,V.jsxs)(te,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==i||t[11]!==s||t[12]!==u?(d=(0,V.jsxs)(ne,{variant:i,children:[a,s,u]}),t[10]=i,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function Ze(e){return(0,V.jsxs)(`span`,{children:[e.message,e.count?` (${e.count})`:``]},`${e.code}:${e.source??``}`)}function Qe({presentation:e=`performance`}){let t=c(),[n,r]=(0,L.useState)(null),[i,s]=(0,L.useState)(null),[l,u]=(0,L.useState)(!0),[f,m]=(0,L.useState)(!1),h=(0,L.useRef)(!1),g=(0,L.useRef)(!1),_=(0,L.useRef)(!1),v=a(),b=p(e=>e.byId),x=Date.now(),w=(0,L.useCallback)(async(e=!1)=>{if(!(!e&&document.visibilityState!==`visible`)&&!h.current){h.current=!0,u(e=>e&&!g.current);try{let e=t?d(t.environmentId)?.server:o().server;if(!e)throw Error(`Diagnostics are unavailable on ${t?.nodeLabel}.`);let n=await e.getDiagnosticsSnapshot();if(_.current)return;r(n),s(null),g.current=!0}catch(e){if(_.current)return;s(e instanceof Error?e.message:`Unable to refresh diagnostics.`)}finally{h.current=!1,_.current||u(!1)}}},[t]);(0,L.useEffect)(()=>{if(_.current=!1,w(),f)return()=>{_.current=!0};let e=null,t=()=>{e!==null&&(window.clearInterval(e),e=null)},n=()=>{document.visibilityState===`visible`&&e===null&&(e=window.setInterval(()=>void w(),Me))};n();let r=()=>{if(document.visibilityState===`visible`){w(),n();return}t()};return document.addEventListener(`visibilitychange`,r),()=>{_.current=!0,t(),document.removeEventListener(`visibilitychange`,r)}},[f,w]);let D=(0,L.useMemo)(()=>De(n?.resources.history??[]),[n]),O=(0,L.useMemo)(()=>Oe(n?.resources.history??[]),[n]),k=n?je(n):`No snapshot`,te=n?.liveProcesses.providers.filter(e=>e.enabled).length??0,ne=n?.liveProcesses.terminals.filter(e=>e.status===`starting`||e.status===`running`).length??0,A=Object.values(b),re=A.filter(e=>e.connectionState===`connected`).length,ie=A.filter(e=>e.connectionState===`connecting`).length,j=A.length===0?`No tracked clients`:`${re} connected${ie>0?` · ${ie} connecting`:``}`,M=n?.tracing.slowestSpans.find(e=>e.source===`server`)??null,ae=v[0]??null,N=n?.performance??null,I=N?.local.turnQuiescenceAvgMs??null,oe=N?.local.checkpointDurationP95Ms??null,R=N?.local.latestThreadSnapshotDurationMs??null,z=N?.local.threadSnapshotDurationP95Ms??null;return(0,V.jsxs)(F,{children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`text-base font-semibold`,children:`Diagnostics`}),(0,V.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:n?`Updated ${Q(n.generatedAt,x)}`:`Waiting for snapshot`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(E,{size:`xs`,variant:`outline`,onClick:()=>m(e=>!e),children:[f?(0,V.jsx)(S,{className:`size-3.5`}):(0,V.jsx)(ee,{className:`size-3.5`}),f?`Resume`:`Pause`]}),(0,V.jsxs)(E,{size:`xs`,variant:`outline`,onClick:()=>void w(!0),disabled:l,children:[(0,V.jsx)(C,{className:T(`size-3.5`,l&&`animate-spin`)}),`Refresh`]})]})]}),(0,V.jsx)(Xe,{snapshot:n,error:i}),null,e===`phone-legacy`?null:(0,V.jsx)(Ce,{}),e===`phone-legacy`?(0,V.jsx)(Je,{snapshot:n,memorySeries:D,cpuSeries:O,slowRpcAcks:v,latestFailure:k,nowMs:x}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(P,{title:`Performance now`,children:(0,V.jsxs)(`div`,{className:`grid sm:grid-cols-2 lg:grid-cols-3`,children:[(0,V.jsx)($,{label:`Backend CPU`,value:n?Ee(n.resources.current.cpu.utilizationPercent):`n/a`,detail:n?`Process uptime ${Z(n.uptimeMs)}`:void 0}),(0,V.jsx)($,{label:`RSS / heap`,value:n?X(n.resources.current.memory.rssBytes):`n/a`,detail:n?`${X(n.resources.current.memory.heapUsedBytes)} heap used`:void 0}),(0,V.jsx)($,{label:`Event-loop delay`,value:n?.resources.current.eventLoopDelayMs===void 0?`n/a`:Z(n.resources.current.eventLoopDelayMs),detail:`Measured once for this requested snapshot`}),(0,V.jsx)($,{label:`Providers / terminals`,value:`${te} enabled providers`,detail:`${ne} active terminals`}),(0,V.jsx)($,{label:`Turn quiescence`,value:I===null?`No samples`:Z(I),detail:`Rolling average`}),(0,V.jsx)($,{label:`Checkpoint duration`,value:oe===null?`No samples`:Z(oe),detail:`Rolling p95`}),(0,V.jsx)($,{label:`WebSocket state`,value:j,detail:`${N?.local.wsReconnectCount??0} reconnects in this server process`}),(0,V.jsx)($,{label:`Thread snapshot`,value:R===null?`No samples`:Z(R),detail:z===null?`Latest successful subscription snapshot`:`${Z(z)} rolling p95`}),(0,V.jsx)($,{label:`Latest failure`,value:k})]})}),(0,V.jsxs)(P,{title:`Why was this slow?`,children:[(0,V.jsx)(Le,{label:`Thread snapshot`,value:R===null?`No thread snapshot timing yet`:`${Z(R)} latest`,detail:z===null?`Replay duration and payload bytes are not collected because the current transport has no zero-copy attribution hook.`:`${Z(z)} rolling p95. Replay duration and payload bytes are not collected because the current transport has no zero-copy attribution hook.`}),(0,V.jsx)(Le,{label:`Queue pressure`,value:N?`${N.queues.runtimeDepthTotal+N.queues.liveBufferDepthTotal} queued now`:`No snapshot`,detail:N?`Largest runtime high-water ${N.queues.runtimeHighWaterMax}; live-buffer high-water ${N.queues.liveBufferHighWaterMax}; ${N.queues.liveBufferOverflowCount} overflows; replay depth ${N.queues.replayDepthMax}; replay lag ${N.queues.replayLagMax}; ${N.queues.providerLogDroppedRecords} provider log records dropped.`:`Runtime and replay queue evidence will appear after the first snapshot.`}),(0,V.jsx)(Le,{label:`Slowest server stage`,value:M?`${M.name} · ${Z(M.durationMs)}`:`No retained spans`,detail:M?`Server span completed ${Q(M.endTime,x)}.`:`Tracing has not retained a server stage yet.`}),(0,V.jsx)(Le,{label:`Current slow client RPC`,value:ae?.tag??`No slow RPC acknowledgement in progress`,detail:ae?`Exceeded its ${Z(ae.thresholdMs)} acknowledgement threshold; started ${Q(ae.startedAt,x)}.`:`Only RPCs that cross the existing client acknowledgement threshold appear here.`}),(0,V.jsx)(Le,{label:`Reconnect / resume`,value:j,detail:`${N?.local.wsReconnectCount??0} server-side reconnects. Per-environment push gaps and recovery state are in Advanced diagnostics.`}),(0,V.jsx)(Le,{label:`Recent failure`,value:n?.failures.latest[0]?.message??`No retained failures`,detail:n?.failures.latest[0]?`${n.failures.latest[0].source} · ${Q(n.failures.latest[0].occurredAt,x)}`:`No failure evidence is available for the current server process.`}),(0,V.jsx)(Le,{label:`Trace persistence`,value:N?.traceSink?`${X(N.traceSink.bufferedBytes)} buffered`:`Health unavailable`,detail:N?.traceSink?`${X(N.traceSink.maxBufferedBytes)} cap; ${N.traceSink.droppedRecords} dropped records; ${N.traceSink.writeFailures} write failures; retry delay ${Z(N.traceSink.retryDelayMs)}.`:`This diagnostics service is not attached to the local trace-file sink.`})]}),(0,V.jsxs)(`details`,{className:`group/diagnostics`,children:[(0,V.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between rounded-xl border bg-card px-4 py-3 text-sm font-medium text-foreground shadow-sm/4 marker:hidden hover:bg-accent/30`,children:[`Advanced diagnostics`,(0,V.jsx)(y,{className:`size-4 text-muted-foreground transition-transform group-open/diagnostics:rotate-180 motion-reduce:transition-none`})]}),(0,V.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[(0,V.jsx)(Ve,{memorySeries:D,cpuSeries:O}),(0,V.jsx)(Ue,{snapshot:n}),(0,V.jsx)(We,{snapshot:n,nowMs:x}),(0,V.jsx)(Ge,{snapshot:n,slowRpcAcks:v,nowMs:x}),(0,V.jsx)(K,{snapshot:n})]})]})]})]})}export{Qe as DiagnosticsSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as e,hn as t,on as n}from"./usePopupViewport-
|
|
1
|
+
import{V as e,hn as t,on as n}from"./usePopupViewport-SxCh7dCg.js";import{r}from"./DialogViewport-BrRcGV_l.js";var i=class extends e{constructor(){super(r(),`Dialog`,!1)}open(e){this.openByTrigger(e)}openWithPayload(e){let r=this.attachedStore;r!==null&&(r.set(`payload`,e),r.setOpen(!0,n(t)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select(`open`)??!1}};function a(){return new i}export{a as n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./composerDraftStore-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./composerDraftStore-DXTD6mKH.js";import{C as r,Kn as i,j as a,y as o}from"./usePopupViewport-SxCh7dCg.js";import{t as s}from"./useRenderElement-DchFnsR8.js";import{a as c,o as l,s as u}from"./DialogViewport-BrRcGV_l.js";import{p as d,s as f}from"./useScrollLock-cFFkQSYy.js";var p=e(t(),1),m=p.forwardRef(function(e,t){let{render:n,className:r,style:a,forceRender:o=!1,...c}=e,l=u(),d=l.useState(`open`),f=l.useState(`nested`),p=l.useState(`mounted`),m={open:d,transitionStatus:l.useState(`transitionStatus`)};return s(`div`,e,{state:m,ref:[l.context.backdropRef,t],stateAttributesMapping:i,props:[{role:`presentation`,hidden:!p,style:{userSelect:`none`,WebkitUserSelect:`none`}},c],enabled:o||!f})}),h=n(),g=p.forwardRef(function(e,t){let{render:n,className:i,style:p,finalFocus:m,initialFocus:g,..._}=e,v=u(),y=v.useState(`descriptionElementId`),b=v.useState(`disablePointerDismissal`),x=v.useState(`floatingRootContext`),S=v.useState(`popupProps`),C=v.useState(`modal`),w=v.useState(`mounted`),T=v.useState(`nested`),E=v.useState(`nestedOpenDialogCount`),D=v.useState(`open`),O=v.useState(`openMethod`),k=v.useState(`titleElementId`),A=v.useState(`transitionStatus`),j=v.useState(`role`),M=x.useState(`floatingId`);l(),a({open:D,ref:v.context.popupRef,onComplete(){D&&v.context.onOpenChangeComplete?.(!0)}});let N=g===void 0?r(v.context.popupRef):g,P=E>0,F=v.useStateSetter(`popupElement`),I=s(`div`,e,{state:{open:D,nested:T,transitionStatus:A,nestedDialogOpen:P},props:[S,{id:M,"aria-labelledby":k,"aria-describedby":y,role:j,...o,hidden:!w,onKeyDown(e){f.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":E}},_],ref:[t,v.context.popupRef,F],stateAttributesMapping:c});return(0,h.jsx)(d,{context:x,openInteractionType:O,disabled:!w,closeOnFocusOut:!b,initialFocus:N,returnFocus:m,modal:C!==!1,restoreFocus:`popup`,children:I})});export{m as n,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./DialogViewport-BrRcGV_l.js";function t(t){return e(`dialog`,t)}export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{in as n,on as r,un as i}from"./usePopupViewport-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{in as n,on as r,un as i}from"./usePopupViewport-SxCh7dCg.js";import{t as a}from"./useRenderElement-DchFnsR8.js";import{s as o}from"./DialogViewport-BrRcGV_l.js";import{t as s}from"./useButton-DXIv8wCn.js";var c=e(t(),1),l=c.forwardRef(function(e,t){let{render:n,className:c,style:l,disabled:u=!1,nativeButton:d=!0,...f}=e,p=o(),m=p.useState(`open`),{getButtonProps:h,buttonRef:g}=s({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,r(i,e.nativeEvent))}return a(`button`,e,{state:_,ref:[t,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,t){let{render:r,className:i,style:s,id:c,...l}=e,u=o(),d=n(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),a(`p`,e,{ref:t,props:[{id:d},l]})}),d=c.forwardRef(function(e,t){let{render:r,className:i,style:s,id:c,...l}=e,u=o(),d=n(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),a(`h2`,e,{ref:t,props:[{id:d},l]})});export{u as n,l as r,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{A as n,Jn as r,in as i,m as a,tt as o}from"./usePopupViewport-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{A as n,Jn as r,in as i,m as a,tt as o}from"./usePopupViewport-SxCh7dCg.js";import{d as s,t as c}from"./useRenderElement-DchFnsR8.js";import{s as l}from"./DialogViewport-BrRcGV_l.js";import{t as u}from"./useButton-DXIv8wCn.js";import{n as d,r as f}from"./useOpenInteractionType-Co4_pLo_.js";var p=e(t(),1),m=p.forwardRef(function(e,t){let{render:m,className:h,style:g,disabled:_=!1,nativeButton:v=!0,id:y,payload:b,handle:x,...S}=e,C=l(!0),w=a(x)??C;if(!w)throw Error(s(79));let T=i(y),E=w.useState(`floatingRootContext`),D=w.useState(`isOpenedByTrigger`,T),O=w.useState(`triggerPopupId`,T),k=p.useRef(null),{registerTrigger:A,isMountedByThisTrigger:j}=n(T,k,w,{payload:b}),{getButtonProps:M,buttonRef:N}=u({disabled:_,native:v}),P=f(E),F=d(()=>w.select(`open`),e=>{w.set(`openMethod`,e)}),I={disabled:_,open:D},L=w.useState(`triggerProps`,j);return c(`button`,e,{state:I,ref:[N,t,A,k],props:[P.reference,L,F,{[o]:``,id:T,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},S,M],stateAttributesMapping:r})});export{m as t};
|