ryco-cli 0.1.17 → 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-F4ZOTHid.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-B2jdtYEs.js → BranchToolbar.logic-CN2-yLTE.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-CxA4EQ1O.js → ChatRightPanel-DhZiZCcx.js} +6 -6
- package/dist/client/assets/{ChatThreadRouteView-BJ6OSbWZ.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-B8t9Z17K.js → ConnectionsSettings-Dsewo1mI.js} +2 -2
- package/dist/client/assets/{DiagnosticsSettings-Bt7j-SXg.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-BzcBT-YW.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-DLrwfgKF.js → HostedConnectionControls-5f2EOB5t.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-eqwMpBq5.js → HostedHubRoot-tRaAruhb.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-C11yMgF7.js → HostedNativeAuthorizationRoute-B4SBCUZq.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-CMrrvMuJ.js → HostedRelayTrustNotice-D7TIN2KZ.js} +1 -1
- package/dist/client/assets/{Icons-BEtED8P8.js → Icons-CqMTQkuR.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-rkW9RyYH.js → IntegrationsSettingsPanel-Be0RMI3X.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-CjU5J7hU.js → KeybindingsSettings-BxoOXbJf.js} +1 -1
- package/dist/client/assets/{McpServersSettings-D-Gq3vgy.js → McpServersSettings-D6wFULhe.js} +1 -1
- package/dist/client/assets/{MobileSheet-BDvnUC5W.js → MobileSheet-fqwVmSQY.js} +1 -1
- package/dist/client/assets/{NewWorktreeDialog-C4D-dD0C.js → NewWorktreeDialog-DljDMikm.js} +1 -1
- package/dist/client/assets/{NoActiveThreadState-z_FeP4Al.js → NoActiveThreadState-DvLgUR0A.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-CMjnKY0w.js → NodeSecuritySettings-BYX0uV1b.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-D9INVQf7.js → OpinionatedPluginsSettings-ZOQ0n5GP.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-B8iVzT22.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-BonZTgK7.js → PhoneHome-BIYOn5P7.js} +1 -1
- package/dist/client/assets/PhoneSettingsSurface-CL26SDJP.js +1 -0
- package/dist/client/assets/{ProjectFavicon-CxXx07Sa.js → ProjectFavicon-BLFEmLYd.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-M_Ezjlmq.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-CtTyCMP0.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-C_GMp7qk.js → SourceControlSettings-CwRuv7T6.js} +1 -1
- package/dist/client/assets/{StatisticsPage-CDukahZF.js → StatisticsPage-DAvOIX_d.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-BTdaxoVf.js → StatisticsPanel-BfmqkZgK.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-B7SZerf3.js → StatisticsSettingsLink-J-iBGP5I.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-D_6jI6us.js → ThreadStatusIndicators-BzpZG_IZ.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-C2B3Ry66.js → ThreadTerminalDrawer-DZy0S10m.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-D8gR7mQC.js → ThreadWorkspacePanel-PRfBFuHE.js} +1 -1
- package/dist/client/assets/{ToolbarRootContext-B1g8IP6k.js → ToolbarRootContext-C48gkU4j.js} +1 -1
- package/dist/client/assets/{WorkItemsTab-QQXGM1BH.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-BS9Iv2ln.js → branding-hWmEaQ8d.js} +1 -1
- package/dist/client/assets/{button-DG8WqjNn.js → button-WR80VgkK.js} +1 -1
- package/dist/client/assets/{capabilities-tpmeGBtr.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-CIvAIvMt.js → desktopWorkspace-BFTBEpzF.js} +1 -1
- package/dist/client/assets/{device-B3lHunk1.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-C536LXZ6.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-BjfqengQ.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-3WDk4ziK.js → projectPaths-DDcwkag5.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-sBwZhQoN.js → providerDriverMeta-DrgHrvO3.js} +1 -1
- package/dist/client/assets/{providerIconUtils-DLRASbiu.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-DfaSS3p9.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-DKxZsoOv.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-UKIVw0OX.js → threadPinning-B5WtT-P_.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-BbiIUPfh.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-BTWMzLgJ.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-9FAjhuhK.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-B7yDFO2l.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-C9g3i7bQ.js → useStatistics-D8hzpDv4.js} +2 -2
- package/dist/client/assets/{useSwipeDismiss-D22_vuiH.js → useSwipeDismiss-ALyKckxx.js} +1 -1
- package/dist/client/assets/{useThreadActions-CouKkjbt.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-DwIYKKIc.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-DywhkOKa.js +0 -1
- package/dist/client/assets/DialogRoot-C_DO1gtO.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-B-6LoBMV.js +0 -1
- package/dist/client/assets/RootAppShell-DJfVW8Xa.js +0 -6
- package/dist/client/assets/SettingsDialog-ClIbtJ2y.js +0 -1
- package/dist/client/assets/SettingsPanels-DshjYQGk.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-BpN7gP0v.js +0 -1
- package/dist/client/assets/editorPreferences-DiUypD3L.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-CYtynKGT.js +0 -1
- package/dist/client/assets/storeSelectors-BeLJe5C1.js +0 -1
- package/dist/client/assets/types-BeLJe5C1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-DXTD6mKH.js";import{t as n,u as r}from"./utils-Ct58OPtz.js";var i=e(),a=t(),o=r(`relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground`,error:`border-destructive/32 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/32 bg-info/4 [&>svg]:text-info`,success:`border-success/32 bg-success/4 [&>svg]:text-success`,warning:`border-warning/32 bg-warning/4 [&>svg]:text-warning`}}});function s(e){let t=(0,i.c)(10),r,s,c;t[0]===e?(r=t[1],s=t[2],c=t[3]):({className:r,variant:c,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=c);let l;t[4]!==r||t[5]!==c?(l=n(o({variant:c}),r),t[4]=r,t[5]=c,t[6]=l):l=t[6];let u;return t[7]!==s||t[8]!==l?(u=(0,a.jsx)(`div`,{className:l,"data-slot":`alert`,role:`alert`,...s}),t[7]=s,t[8]=l,t[9]=u):u=t[9],u}function c(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`font-medium [svg~&]:col-start-2`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-title`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function l(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-description`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function u(e){let t=(0,i.c)(8),r,o;t[0]===e?(r=t[1],o=t[2]):({className:r,...o}=e,t[0]=e,t[1]=r,t[2]=o);let s;t[3]===r?s=t[4]:(s=n(`flex gap-1 max-sm:col-start-2 max-sm:mt-2 sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-description]~&]:col-start-2 sm:[[data-slot=alert-title]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-description]~&]:col-start-3 sm:[svg~[data-slot=alert-title]~&]:col-start-3`,r),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`div`,{className:s,"data-slot":`alert-action`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{c as i,u as n,l as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{It as t}from"./composerDraftStore-DXTD6mKH.js";import{t as n}from"./utils-Ct58OPtz.js";import{i as r,n as i,t as a}from"./DialogViewport-BrRcGV_l.js";import{n as o,t as s}from"./DialogPopup-9zEMlOyz.js";import{n as c,r as l,t as u}from"./DialogTitle-7dK2BQ85.js";import"./DialogHandle-BGW2rJq8.js";function d(e){return i(`alert-dialog`,e)}var f=e(),p=t(),m=d,h=r;function g(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`fixed inset-0 z-50 transition-all duration-[240ms] data-ending-style:opacity-0 data-starting-style:opacity-0`,r),t[3]=r,t[4]=a);let s;return t[5]!==i||t[6]!==a?(s=(0,p.jsx)(o,{className:a,"data-slot":`alert-dialog-backdrop`,...i}),t[5]=i,t[6]=a,t[7]=s):s=t[7],s}function _(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(`app-dialog-viewport-scrim pointer-events-auto fixed inset-0 z-50 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4 pb-[calc(--spacing(4)+var(--app-keyboard-inset,0px))] backdrop-blur-[2px]`,r),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=(0,p.jsx)(a,{className:o,"data-slot":`alert-dialog-viewport`,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s}function v(e){let t=(0,f.c)(20),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({className:r,onKeyDown:i,bottomStickOnMobile:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let c=o===void 0||o,l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,p.jsx)(g,{}),t[5]=l):l=t[5];let u=c&&`phone:grid-rows-[1fr_auto] phone:p-0 phone:pt-12 phone:pb-[var(--app-keyboard-inset,0px)]`,d;t[6]===u?d=t[7]:(d=n(u),t[6]=u,t[7]=d);let m=c&&`phone:max-w-none phone:rounded-none phone:border-x-0 phone:border-t phone:border-b-0 phone:opacity-[calc(1-min(var(--nested-dialogs),1))] phone:data-ending-style:translate-y-4 phone:data-starting-style:translate-y-4 phone:before:hidden phone:before:rounded-none`,v;t[8]!==r||t[9]!==m?(v=n(`app-surface pointer-events-auto -translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-[240ms] ease-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:translate-y-2 data-starting-style:translate-y-3 data-ending-style:scale-97 data-starting-style:scale-96 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,m,r),t[8]=r,t[9]=m,t[10]=v):v=t[10];let y;t[11]===i?y=t[12]:(y=e=>{i?.(e),e.stopPropagation()},t[11]=i,t[12]=y);let b;t[13]!==a||t[14]!==v||t[15]!==y?(b=(0,p.jsx)(s,{className:v,"data-slot":`alert-dialog-popup`,onKeyDown:y,...a}),t[13]=a,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;return t[17]!==d||t[18]!==b?(x=(0,p.jsxs)(h,{children:[l,(0,p.jsx)(_,{className:d,children:b})]}),t[17]=d,t[18]=b,t[19]=x):x=t[19],x}function y(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`flex flex-col gap-2 p-6 text-center max-sm:pb-4 sm:text-left`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(`div`,{className:a,"data-slot":`alert-dialog-header`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function b(e){let t=(0,f.c)(11),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,variant:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o=a===void 0?`default`:a,s=o==="default"&&`app-muted-surface border-t py-4`,c=o===`bare`&&`pb-6`,l;t[4]!==r||t[5]!==s||t[6]!==c?(l=n(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,s,c,r),t[4]=r,t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;return t[8]!==i||t[9]!==l?(u=(0,p.jsx)(`div`,{className:l,"data-slot":`alert-dialog-footer`,...i}),t[8]=i,t[9]=l,t[10]=u):u=t[10],u}function x(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`font-heading font-semibold text-xl leading-none`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(u,{className:a,"data-slot":`alert-dialog-title`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function S(e){let t=(0,f.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=n(`text-muted-foreground text-sm`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,p.jsx)(c,{className:a,"data-slot":`alert-dialog-description`,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function C(e){let t=(0,f.c)(2),n;return t[0]===e?n=t[1]:(n=(0,p.jsx)(l,{"data-slot":`alert-dialog-close`,...e}),t[0]=e,t[1]=n),n}export{y as a,b as i,C as n,v as o,S as r,x as s,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./useRenderElement-DchFnsR8.js";var t=e(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,$t as t,An as n,Ar as r,At as i,Bn as a,Bt as o,Cn as s,Ct as c,Di as l,Dn as u,Dt as d,En as f,Er as p,Et as m,Fn as h,Ft as g,Gn as _,Gs as v,Gt as y,H as b,Hn as x,Ht as S,In as C,Ir as w,It as T,Jn as E,Jt as ee,Kn as D,Kt as te,L as O,Ln as ne,Lt as re,Mn as ie,Mr as ae,Mt as oe,Nn as se,Nt as ce,On as le,Or as ue,Ot as de,Pn as fe,Pt as pe,Qn as me,Qt as he,Rn as ge,Rt as _e,Sn as ve,St as ye,Tn as be,Tt as xe,Un as Se,Ut as Ce,Vn as we,Vt as Te,Wn as Ee,Wt as De,Xn as Oe,Xt as ke,Yn as Ae,Yt as je,Zn as Me,Zt as Ne,_n as Pe,_r as Fe,_t as Ie,an as Le,ar as Re,bn as ze,bt as Be,cn as Ve,cr as He,dn as Ue,dr as We,en as Ge,er as Ke,fn as qe,fr as Je,gn as Ye,gr as Xe,gt as Ze,h as Qe,hn as $e,hr as et,ht as tt,in as nt,ir as rt,jn as it,jt as at,ki as ot,kn as st,kr as ct,kt as lt,ln as ut,lr as dt,mn as ft,mr as pt,mt,nn as ht,nr as gt,on as _t,or as vt,p as k,pn as yt,pr as bt,pt as xt,qn as St,qt as Ct,rn as wt,rr as Tt,sn as Et,sr as Dt,t as A,tn as Ot,tr as kt,un as At,ur as jt,vn as Mt,vr as Nt,vt as Pt,wn as Ft,wt as It,xn as Lt,xt as Rt,yn as zt,zn as Bt,zt as Vt}from"./src-CtanPQei.js";function Ht(e){if(!/^[A-Za-z0-9_-]+$/u.test(e))throw Error(`Invalid encoded material.`);let t=e.replace(/-/gu,`+`).replace(/_/gu,`/`).padEnd(Math.ceil(e.length/4)*4,`=`),n;try{n=atob(t)}catch{throw Error(`Invalid encoded material.`)}let r=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)r[e]=n.charCodeAt(e);return r}function Ut(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/gu,`-`).replace(/\//gu,`_`).replace(/=+$/gu,``)}var Wt=Uint8Array.from([32,9,13,10,32,9,13,10]);function Gt(e){return e.byteLength>=8&&e[0]===0}function Kt(e){if(e.byteLength<Wt.byteLength)return!1;for(let t=0;t<Wt.byteLength;t+=1)if(e[t]!==Wt[t])return!1;return!0}function qt(e){return Kt(e)?{advertised:!0,message:e.subarray(Wt.byteLength)}:{advertised:!1,message:e}}function Jt(e,t,n){e[0]=0,e[1]=1,e[2]=+!!n,e[3]=0,e[4]=t>>>24&255,e[5]=t>>>16&255,e[6]=t>>>8&255,e[7]=t&255}function Yt(e){return(e[4]<<24>>>0)+(e[5]<<16>>>0)+(e[6]<<8>>>0)+e[7]}function Xt(e,t){if(e.byteLength<=t)return[e];let n=t-8;if(n<=0)throw Error(`Relay chunk limit is too small to carry a chunk header.`);let r=[];for(let t=0;t<e.byteLength;t+=n){let i=e.subarray(t,Math.min(t+n,e.byteLength)),a=new Uint8Array(8+i.byteLength);Jt(a,e.byteLength,t+i.byteLength>=e.byteLength),a.set(i,8),r.push(a)}return r}function Zt(e,t){if(!Number.isSafeInteger(t.maxChunkBytes)||t.maxChunkBytes<=0||!Number.isSafeInteger(t.maxMessageBytes)||t.maxMessageBytes<0||!Number.isSafeInteger(e)||e<0)throw TypeError(`Relay chunk limits must be positive and message limits non-negative safe integers.`);if(e>t.maxMessageBytes)return{kind:`error`,reason:`message_too_large`};if(e<=t.maxChunkBytes){let n=e+Wt.byteLength<=t.maxChunkBytes;return{kind:`ready`,advertised:n,chunked:!1,payloadBytes:[n?Wt.byteLength+e:e]}}if(!t.peerSupportsChunking)return{kind:`error`,reason:`peer_unsupported`};let n=t.maxChunkBytes-8;if(n<=0)throw Error(`Relay chunk limit is too small to carry a chunk header.`);let r=[];for(let t=0;t<e;t+=n)r.push(8+Math.min(n,e-t));return{kind:`ready`,advertised:!1,chunked:!0,payloadBytes:r}}function Qt(e,t){let n=Zt(e.byteLength,t);if(n.kind===`error`)return n;if(n.chunked)return{kind:`ready`,payloads:Xt(e,t.maxChunkBytes)};if(!n.advertised)return{kind:`ready`,payloads:[e]};let r=new Uint8Array(Wt.byteLength+e.byteLength);return r.set(Wt),r.set(e,Wt.byteLength),{kind:`ready`,payloads:[r]}}var $t=class{#e=[];#t=0;#n=0;#r=!1;get heldBytes(){return this.#t}get incompleteMessage(){return this.#n!==0}get peerSupportsChunking(){return this.#r}push(e){if(!Gt(e)){if(this.#n!==0)return this.reset(),{kind:`error`,reason:`interleaved_legacy`};let t=qt(e);return t.advertised&&(this.#r=!0),{kind:`done`,message:t.message}}if(e[1]!==1||e[2]&-2||e[3]!==0)return this.reset(),{kind:`error`,reason:`bad_header`};let t=Yt(e),n=e.subarray(8),r=!!(e[2]&1);if(n.byteLength===0)return this.reset(),{kind:`error`,reason:`bad_header`};if(this.#n===0){if(t>4194304||t===0)return{kind:`error`,reason:`message_too_large`};this.#n=t,this.#t=0}else if(t!==this.#n)return this.reset(),{kind:`error`,reason:`total_mismatch`};if(this.#t+n.byteLength>this.#n)return this.reset(),{kind:`error`,reason:`overflow`};this.#r=!0;let i=Uint8Array.from(n);if(n.fill(0),this.#e.push(i),this.#t+=n.byteLength,!r)return{kind:`pending`};if(this.#t!==this.#n)return this.reset(),{kind:`error`,reason:`truncated`};let a=new Uint8Array(this.#n),o=0;for(let e of this.#e)a.set(e,o),o+=e.byteLength,e.fill(0);return this.#e=[],this.#t=0,this.#n=0,{kind:`done`,message:a}}reset(){for(let e of this.#e)e.fill(0);this.#e=[],this.#t=0,this.#n=0,this.#r=!1}},en=4096,tn=8192;function nn(e){return e.maxQueuedBytes-e.maxControlFrameBytes}function rn(e){let t=Math.min(p,e.maxQueuedBytes-e.maxControlFrameBytes),n=t-32;return{effectiveMessageCeiling:t,plaintextCeiling:n,establishable:n>0}}var an=1500,on=3e3,sn=3e3,cn=1500,ln=1e3,un=6e5,dn=3e5,fn=2592e6,pn=65536,mn=268435456,hn=4294967295n,gn=18446744073709551615n,_n={digits:60,groups:12,digitsPerGroup:5,separator:` `},vn={chars:8,groups:2,charsPerGroup:4,separator:`-`},yn=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`;Wt.byteLength;var bn=8e3,xn=BigInt(2**32-1),Sn=BigInt(32);function Cn(e,t=!1){return t?{h:Number(e&xn),l:Number(e>>Sn&xn)}:{h:Number(e>>Sn&xn)|0,l:Number(e&xn)|0}}function wn(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Cn(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var Tn=e=>e/2**32|0,En=e=>e>>>0;function Dn(e,t,n,r){let i=Tn(n),a=En(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}var On=(e,t,n)=>e>>>n,kn=(e,t,n)=>e<<32-n|t>>>n,An=(e,t,n)=>e>>>n|t<<32-n,jn=(e,t,n)=>e<<32-n|t>>>n,Mn=(e,t,n)=>e<<64-n|t>>>n-32,Nn=(e,t,n)=>e>>>n-32|t<<64-n;function Pn(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Fn=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),In=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Ln=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Rn=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,zn=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Bn=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function Vn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}var Hn=e=>e?`"${e}" `:``;function Un(e,t=``){if(typeof e!=`number`)throw TypeError(Hn(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(Hn(t)+`expected integer >= 0, got `+e);return e}function Wn(e,t,n=``){if(Vn(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Un(t,`length`);let r=Vn(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=Hn(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function Gn(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(Un(e.outputLen),Un(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}var Kn=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)};function qn(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function Jn(e,t){Wn(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function Yn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Xn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Zn(e,t){return e<<32-t|e>>>t}var Qn=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,$n=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function er(e){if(Wn(e),Qn)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=$n[e[n]];return t}function tr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function nr(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(Qn)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=tr(e.charCodeAt(i)),a=tr(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function rr(e){if(typeof e!=`string`)throw TypeError(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function ir(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];Wn(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function ar(e,t,n=`opts`){return Kn(e,`defaults`),t!==void 0&&Kn(t,n),Object.assign(e,t)}function or(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=ar({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function sr(e=32){Un(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var cr=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function lr(e,t,n){return e&t^~e&n}function ur(e,t,n){return e&t^e&n^t&n}var dr=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Xn(this.buffer)}update(e){qn(this),Wn(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=Xn(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0;continue}n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){qn(this),Jn(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),Dn(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:Xn(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}},fr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),mr=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hr=new Uint32Array(64),gr=class extends dr{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)hr[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=hr[e-15],n=hr[e-2],r=Zn(t,7)^Zn(t,18)^t>>>3,i=Zn(n,17)^Zn(n,19)^n>>>10;hr[e]=i+hr[e-7]+r+hr[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Zn(o,6)^Zn(o,11)^Zn(o,25),u=l+t+lr(o,s,c)+mr[e]+hr[e]|0,d=(Zn(n,2)^Zn(n,13)^Zn(n,22))+ur(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Yn(hr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Yn(this.buffer)}},_r=class extends gr{constructor(){super(32,fr)}},vr=wn(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),yr=vr[0],br=vr[1],xr=new Uint32Array(80),Sr=new Uint32Array(80),Cr=class extends dr{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,t){super(128,e,16,!1),this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)xr[n]=e.getUint32(t),Sr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=xr[e-15]|0,n=Sr[e-15]|0,r=An(t,n,1)^An(t,n,8)^On(t,n,7),i=jn(t,n,1)^jn(t,n,8)^kn(t,n,7),a=xr[e-2]|0,o=Sr[e-2]|0,s=An(a,o,19)^Mn(a,o,61)^On(a,o,6),c=Ln(i,jn(a,o,19)^Nn(a,o,61)^kn(a,o,6),Sr[e-7],Sr[e-16]),l=Rn(c,r,s,xr[e-7],xr[e-16]);xr[e]=l|0,Sr[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=An(u,d,14)^An(u,d,18)^Mn(u,d,41),v=jn(u,d,14)^jn(u,d,18)^Nn(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=zn(_,v,b,br[e],Sr[e]),S=Bn(x,g,t,y,yr[e],xr[e]),C=x|0,w=An(n,r,28)^Mn(n,r,34)^Mn(n,r,39),T=jn(n,r,28)^Nn(n,r,34)^Nn(n,r,39),E=n&i^n&o^i&o,ee=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Pn(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let D=Fn(C,T,ee);n=In(D,S,w,E),r=D|0}({h:n,l:r}=Pn(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Pn(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Pn(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Pn(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Pn(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Pn(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Pn(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Pn(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){Yn(xr,Sr)}destroy(){this.destroyed=!0,Yn(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},wr=class extends Cr{constructor(){super(64,pr)}},Tr=or(()=>new _r,cr(1)),Er=or(()=>new wr,cr(3)),Dr=[`Object`,`RegExp`,`Date`,`Error`,`Map`,`Set`,`WeakMap`,`WeakSet`,`ArrayBuffer`,`SharedArrayBuffer`,`DataView`,`Promise`,`URL`,`HTMLElement`,`Int8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`,`Tagged`];function Or(e){if(e===null)return`null`;if(e===void 0)return`undefined`;if(e===!0||e===!1)return`boolean`;let t=typeof e;return t===`string`||t===`number`||t===`bigint`||t===`symbol`?t:t===`function`?`Function`:Array.isArray(e)?`Array`:e instanceof Uint8Array?`Uint8Array`:e.constructor===Object?`Object`:kr(e)||`Object`}function kr(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Dr.includes(t))return t}var j=class{constructor(e,t,n){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:+(this.major>e.major)}static equals(e,t){return e===t||e.major===t.major&&e.name===t.name}};j.uint=new j(0,`uint`,!0),j.negint=new j(1,`negint`,!0),j.bytes=new j(2,`bytes`,!0),j.string=new j(3,`string`,!0),j.array=new j(4,`array`,!1),j.map=new j(5,`map`,!1),j.tag=new j(6,`tag`,!1),j.float=new j(7,`float`,!0),j.false=new j(7,`false`,!0),j.true=new j(7,`true`,!0),j.null=new j(7,`null`,!0),j.undefined=new j(7,`undefined`,!0),j.break=new j(7,`break`,!0);var M=class{constructor(e,t,n){this.type=e,this.value=t,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},Ar=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer==`function`,jr=new TextEncoder;function Mr(e){return Ar&&globalThis.Buffer.isBuffer(e)}function Nr(e){return e instanceof Uint8Array?Mr(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var Pr=24,Fr=200,Ir=Ar?e=>e.length>=Pr?globalThis.Buffer.from(e):Hr(e):e=>e.length>=Fr?jr.encode(e):Hr(e),Lr=e=>Uint8Array.from(e),Rr=Ar?(e,t,n)=>Mr(e)?new Uint8Array(e.subarray(t,n)):e.slice(t,n):(e,t,n)=>e.slice(t,n),zr=Ar?(e,t)=>(e=e.map(e=>e instanceof Uint8Array?e:globalThis.Buffer.from(e)),Nr(globalThis.Buffer.concat(e,t))):(e,t)=>{let n=new Uint8Array(t),r=0;for(let t of e)r+t.length>n.length&&(t=t.subarray(0,n.length-r)),n.set(t,r),r+=t.length;return n},Br=Ar?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Vr(e,t){if(Mr(e)&&Mr(t))return e.compare(t);for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return 0}function Hr(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(i>=55296&&i<=57343&&(i=65533),t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}var Ur=256,Wr=class{constructor(e=Ur){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}pushByte(e){let t=this.chunks[this.chunks.length-1];this.cursor>this.maxCursor&&(t=Br(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t));let n=t.length-(this.maxCursor-this.cursor)-1;t[n]=e,this.cursor++}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let e=t.length-(this.maxCursor-this.cursor)-1;e<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,e),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Br(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(t=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=Rr(n,0,this.cursor)}else t=zr(this.chunks,this.cursor);return e&&this.reset(),t}},Gr=class{constructor(e){this.dest=e,this.cursor=0,this.chunks=[e]}reset(){this.cursor=0}pushByte(e){if(this.cursor>=this.dest.length)throw Error(`write out of bounds, destination buffer is too small`);this.dest[this.cursor++]=e}push(e){if(this.cursor+e.length>this.dest.length)throw Error(`write out of bounds, destination buffer is too small`);this.dest.set(e,this.cursor),this.cursor+=e.length}toBytes(e=!1){let t=this.dest.subarray(0,this.cursor);return e&&this.reset(),t}},N=`CBOR decode error:`,Kr=`CBOR encode error:`;function qr(e,t,n){if(e.length-t<n)throw Error(`${N} not enough data for type`)}var P=[24,256,65536,4294967296,BigInt(`18446744073709551616`)];function Jr(e,t,n){qr(e,t,1);let r=e[t];if(n.strict===!0&&r<P[0])throw Error(`${N} integer encoded in more bytes than necessary (strict decode)`);return r}function Yr(e,t,n){qr(e,t,2);let r=e[t]<<8|e[t+1];if(n.strict===!0&&r<P[1])throw Error(`${N} integer encoded in more bytes than necessary (strict decode)`);return r}function Xr(e,t,n){qr(e,t,4);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(n.strict===!0&&r<P[2])throw Error(`${N} integer encoded in more bytes than necessary (strict decode)`);return r}function Zr(e,t,n){qr(e,t,8);let r=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],a=(BigInt(r)<<BigInt(32))+BigInt(i);if(n.strict===!0&&a<P[3])throw Error(`${N} integer encoded in more bytes than necessary (strict decode)`);if(a<=2**53-1)return Number(a);if(n.allowBigInt===!0)return a;throw Error(`${N} integers outside of the safe integer range are not supported`)}function Qr(e,t,n,r){return new M(j.uint,Jr(e,t+1,r),2)}function $r(e,t,n,r){return new M(j.uint,Yr(e,t+1,r),3)}function ei(e,t,n,r){return new M(j.uint,Xr(e,t+1,r),5)}function ti(e,t,n,r){return new M(j.uint,Zr(e,t+1,r),9)}function ni(e,t){return F(e,0,t.value)}function F(e,t,n){if(n<P[0]){let r=Number(n);e.pushByte(t|r)}else if(n<P[1]){let r=Number(n);e.push([t|24,r])}else if(n<P[2]){let r=Number(n);e.push([t|25,r>>>8,r&255])}else if(n<P[3]){let r=Number(n);e.push([t|26,r>>>24&255,r>>>16&255,r>>>8&255,r&255])}else{let r=BigInt(n);if(r<P[4]){let n=[t|27,0,0,0,0,0,0,0],i=Number(r&BigInt(4294967295)),a=Number(r>>BigInt(32)&BigInt(4294967295));n[8]=i&255,i>>=8,n[7]=i&255,i>>=8,n[6]=i&255,i>>=8,n[5]=i&255,n[4]=a&255,a>>=8,n[3]=a&255,a>>=8,n[2]=a&255,a>>=8,n[1]=a&255,e.push(n)}else throw Error(`${N} encountered BigInt larger than allowable range`)}}ni.encodedSize=function(e){return F.encodedSize(e.value)},F.encodedSize=function(e){return e<P[0]?1:e<P[1]?2:e<P[2]?3:e<P[3]?5:9},ni.compareTokens=function(e,t){return e.value<t.value?-1:+(e.value>t.value)};function ri(e,t,n,r){return new M(j.negint,-1-Jr(e,t+1,r),2)}function ii(e,t,n,r){return new M(j.negint,-1-Yr(e,t+1,r),3)}function ai(e,t,n,r){return new M(j.negint,-1-Xr(e,t+1,r),5)}var oi=BigInt(-1),si=BigInt(1);function ci(e,t,n,r){let i=Zr(e,t+1,r);if(typeof i!=`bigint`){let e=-1-i;if(e>=-(2**53-1))return new M(j.negint,e,9)}if(r.allowBigInt!==!0)throw Error(`${N} integers outside of the safe integer range are not supported`);return new M(j.negint,oi-BigInt(i),9)}function li(e,t){let n=t.value,r=typeof n==`bigint`?n*oi-si:n*-1-1;F(e,t.type.majorEncoded,r)}li.encodedSize=function(e){let t=e.value,n=typeof t==`bigint`?t*oi-si:t*-1-1;return n<P[0]?1:n<P[1]?2:n<P[2]?3:n<P[3]?5:9},li.compareTokens=function(e,t){return e.value<t.value?1:e.value>t.value?-1:0};function ui(e,t,n,r){qr(e,t,n+r);let i=e.slice(t+n,t+n+r);return new M(j.bytes,i,n+r)}function di(e,t,n,r){return ui(e,t,1,n)}function fi(e,t,n,r){return ui(e,t,2,Jr(e,t+1,r))}function pi(e,t,n,r){return ui(e,t,3,Yr(e,t+1,r))}function mi(e,t,n,r){return ui(e,t,5,Xr(e,t+1,r))}function hi(e,t,n,r){let i=Zr(e,t+1,r);if(typeof i==`bigint`)throw Error(`${N} 64-bit integer bytes lengths not supported`);return ui(e,t,9,i)}function gi(e){return e.encodedBytes===void 0&&(e.encodedBytes=j.equals(e.type,j.string)?Ir(e.value):e.value),e.encodedBytes}function _i(e,t){let n=gi(t);F(e,t.type.majorEncoded,n.length),e.push(n)}_i.encodedSize=function(e){let t=gi(e);return F.encodedSize(t.length)+t.length},_i.compareTokens=function(e,t){return vi(gi(e),gi(t))};function vi(e,t){return e.length<t.length?-1:e.length>t.length?1:Vr(e,t)}var yi=new TextDecoder,bi=32;function xi(e,t,n){if(n-t<bi){let r=``;for(let i=t;i<n;i++){let a=e[i];if(a&128)return yi.decode(e.subarray(t,n));r+=String.fromCharCode(a)}return r}return yi.decode(e.subarray(t,n))}function Si(e,t,n,r,i){let a=n+r;qr(e,t,a);let o=new M(j.string,xi(e,t+n,t+a),a);return i.retainStringBytes===!0&&(o.byteValue=e.slice(t+n,t+a)),o}function Ci(e,t,n,r){return Si(e,t,1,n,r)}function wi(e,t,n,r){return Si(e,t,2,Jr(e,t+1,r),r)}function Ti(e,t,n,r){return Si(e,t,3,Yr(e,t+1,r),r)}function Ei(e,t,n,r){return Si(e,t,5,Xr(e,t+1,r),r)}function Di(e,t,n,r){let i=Zr(e,t+1,r);if(typeof i==`bigint`)throw Error(`${N} 64-bit integer string lengths not supported`);return Si(e,t,9,i,r)}var Oi=_i;function ki(e,t,n,r){return new M(j.array,r,n)}function Ai(e,t,n,r){return ki(e,t,1,n)}function ji(e,t,n,r){return ki(e,t,2,Jr(e,t+1,r))}function Mi(e,t,n,r){return ki(e,t,3,Yr(e,t+1,r))}function Ni(e,t,n,r){return ki(e,t,5,Xr(e,t+1,r))}function Pi(e,t,n,r){let i=Zr(e,t+1,r);if(typeof i==`bigint`)throw Error(`${N} 64-bit integer array lengths not supported`);return ki(e,t,9,i)}function Fi(e,t,n,r){if(r.allowIndefinite===!1)throw Error(`${N} indefinite length items not allowed`);return ki(e,t,1,1/0)}function Ii(e,t){F(e,j.array.majorEncoded,t.value)}Ii.compareTokens=ni.compareTokens,Ii.encodedSize=function(e){return F.encodedSize(e.value)};function Li(e,t,n,r){return new M(j.map,r,n)}function Ri(e,t,n,r){return Li(e,t,1,n)}function zi(e,t,n,r){return Li(e,t,2,Jr(e,t+1,r))}function Bi(e,t,n,r){return Li(e,t,3,Yr(e,t+1,r))}function Vi(e,t,n,r){return Li(e,t,5,Xr(e,t+1,r))}function Hi(e,t,n,r){let i=Zr(e,t+1,r);if(typeof i==`bigint`)throw Error(`${N} 64-bit integer map lengths not supported`);return Li(e,t,9,i)}function Ui(e,t,n,r){if(r.allowIndefinite===!1)throw Error(`${N} indefinite length items not allowed`);return Li(e,t,1,1/0)}function Wi(e,t){F(e,j.map.majorEncoded,t.value)}Wi.compareTokens=ni.compareTokens,Wi.encodedSize=function(e){return F.encodedSize(e.value)};function Gi(e,t,n,r){return new M(j.tag,n,1)}function Ki(e,t,n,r){return new M(j.tag,Jr(e,t+1,r),2)}function qi(e,t,n,r){return new M(j.tag,Yr(e,t+1,r),3)}function Ji(e,t,n,r){return new M(j.tag,Xr(e,t+1,r),5)}function Yi(e,t,n,r){return new M(j.tag,Zr(e,t+1,r),9)}function Xi(e,t){F(e,j.tag.majorEncoded,t.value)}Xi.compareTokens=ni.compareTokens,Xi.encodedSize=function(e){return F.encodedSize(e.value)};function Zi(e,t,n,r){if(r.allowUndefined===!1)throw Error(`${N} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new M(j.null,null,1):new M(j.undefined,void 0,1)}function Qi(e,t,n,r){if(r.allowIndefinite===!1)throw Error(`${N} indefinite length items not allowed`);return new M(j.break,void 0,1)}function $i(e,t,n){if(n){if(n.allowNaN===!1&&Number.isNaN(e))throw Error(`${N} NaN values are not supported`);if(n.allowInfinity===!1&&(e===1/0||e===-1/0))throw Error(`${N} Infinity values are not supported`)}return new M(j.float,e,t)}function ea(e,t,n,r){return $i(sa(e,t+1),3,r)}function ta(e,t,n,r){return $i(la(e,t+1),5,r)}function na(e,t,n,r){return $i(da(e,t+1),9,r)}function ra(e,t,n){let r=t.value;if(r===!1)e.pushByte(j.float.majorEncoded|20);else if(r===!0)e.pushByte(j.float.majorEncoded|21);else if(r===null)e.pushByte(j.float.majorEncoded|22);else if(r===void 0)e.pushByte(j.float.majorEncoded|23);else{let t,i=!1;(!n||n.float64!==!0)&&(oa(r),t=sa(I,1),r===t||Number.isNaN(r)?(I[0]=249,e.push(I.slice(0,3)),i=!0):(ca(r),t=la(I,1),r===t&&(I[0]=250,e.push(I.slice(0,5)),i=!0))),i||(ua(r),t=da(I,1),I[0]=251,e.push(I.slice(0,9)))}}ra.encodedSize=function(e,t){let n=e.value;if(n===!1||n===!0||n==null)return 1;if(!t||t.float64!==!0){oa(n);let e=sa(I,1);if(n===e||Number.isNaN(n))return 3;if(ca(n),e=la(I,1),n===e)return 5}return 9};var ia=new ArrayBuffer(9),aa=new DataView(ia,1),I=new Uint8Array(ia,0);function oa(e){if(e===1/0)aa.setUint16(0,31744,!1);else if(e===-1/0)aa.setUint16(0,64512,!1);else if(Number.isNaN(e))aa.setUint16(0,32256,!1);else{aa.setFloat32(0,e);let t=aa.getUint32(0),n=(t&2139095040)>>23,r=t&8388607;if(n===255)aa.setUint16(0,31744,!1);else if(n===0)aa.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{let e=n-127;e<-24?aa.setUint16(0,0):e<-14?aa.setUint16(0,(t&2147483648)>>16|1<<24+e,!1):aa.setUint16(0,(t&2147483648)>>16|e+15<<10|r>>13,!1)}}}function sa(e,t){if(e.length-t<2)throw Error(`${N} not enough data for float16`);let n=(e[t]<<8)+e[t+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;let r=n>>10&31,i=n&1023,a;return a=r===0?i*2**-24:r===31?i===0?1/0:NaN:(i+1024)*2**(r-25),n&32768?-a:a}function ca(e){aa.setFloat32(0,e,!1)}function la(e,t){if(e.length-t<4)throw Error(`${N} not enough data for float32`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,4).getFloat32(0,!1)}function ua(e){aa.setFloat64(0,e,!1)}function da(e,t){if(e.length-t<8)throw Error(`${N} not enough data for float64`);let n=(e.byteOffset||0)+t;return new DataView(e.buffer,n,8).getFloat64(0,!1)}function fa(e,t){let n=e.value;if(n===!1)return Uint8Array.of(j.float.majorEncoded|20);if(n===!0)return Uint8Array.of(j.float.majorEncoded|21);if(n===null)return Uint8Array.of(j.float.majorEncoded|22);if(n===void 0)return Uint8Array.of(j.float.majorEncoded|23);if(!t){if(oa(n),n===sa(I,1)||Number.isNaN(n))return I[0]=249,I.slice(0,3);if(ca(n),n===la(I,1))return I[0]=250,I.slice(0,5)}return ua(n),I[0]=251,I.slice(0,9)}function pa(e,t){let n=e,r=t?.float64===!0,i=r?n._keyBytesFloat64:n._keyBytes;if(i!==void 0)return i;let a=fa(e,r);return r?n._keyBytesFloat64=a:n._keyBytes=a,a}ra.compareTokens=function(e,t,n){let r=pa(e,n),i=pa(t,n);return r.length===i.length?Vr(r,i):r.length<i.length?-1:1};function L(e,t,n){throw Error(`${N} encountered invalid minor (${n}) for major ${e[t]>>>5}`)}function ma(e){return()=>{throw Error(`${N} ${e}`)}}var R=[];for(let e=0;e<=23;e++)R[e]=L;R[24]=Qr,R[25]=$r,R[26]=ei,R[27]=ti,R[28]=L,R[29]=L,R[30]=L,R[31]=L;for(let e=32;e<=55;e++)R[e]=L;R[56]=ri,R[57]=ii,R[58]=ai,R[59]=ci,R[60]=L,R[61]=L,R[62]=L,R[63]=L;for(let e=64;e<=87;e++)R[e]=di;R[88]=fi,R[89]=pi,R[90]=mi,R[91]=hi,R[92]=L,R[93]=L,R[94]=L,R[95]=ma(`indefinite length bytes/strings are not supported`);for(let e=96;e<=119;e++)R[e]=Ci;R[120]=wi,R[121]=Ti,R[122]=Ei,R[123]=Di,R[124]=L,R[125]=L,R[126]=L,R[127]=ma(`indefinite length bytes/strings are not supported`);for(let e=128;e<=151;e++)R[e]=Ai;R[152]=ji,R[153]=Mi,R[154]=Ni,R[155]=Pi,R[156]=L,R[157]=L,R[158]=L,R[159]=Fi;for(let e=160;e<=183;e++)R[e]=Ri;R[184]=zi,R[185]=Bi,R[186]=Vi,R[187]=Hi,R[188]=L,R[189]=L,R[190]=L,R[191]=Ui;for(let e=192;e<=215;e++)R[e]=Gi;R[216]=Ki,R[217]=qi,R[218]=Ji,R[219]=Yi,R[220]=L,R[221]=L,R[222]=L,R[223]=L;for(let e=224;e<=243;e++)R[e]=ma(`simple values are not supported`);R[244]=L,R[245]=L,R[246]=L,R[247]=Zi,R[248]=ma(`simple values are not supported`),R[249]=ea,R[250]=ta,R[251]=na,R[252]=L,R[253]=L,R[254]=L,R[255]=Qi;var ha=[];for(let e=0;e<24;e++)ha[e]=new M(j.uint,e,1);for(let e=-1;e>=-24;e--)ha[31-e]=new M(j.negint,e,1);ha[64]=new M(j.bytes,new Uint8Array,1),ha[96]=new M(j.string,``,1),ha[128]=new M(j.array,0,1),ha[160]=new M(j.map,0,1),ha[244]=new M(j.false,!1,1),ha[245]=new M(j.true,!0,1),ha[246]=new M(j.null,null,1);function ga(e){switch(e.type){case j.false:return Lr([244]);case j.true:return Lr([245]);case j.null:return Lr([246]);case j.bytes:return e.value.length?void 0:Lr([64]);case j.string:return e.value===``?Lr([96]):void 0;case j.array:return e.value===0?Lr([128]):void 0;case j.map:return e.value===0?Lr([160]):void 0;case j.uint:return e.value<24?Lr([Number(e.value)]):void 0;case j.negint:if(e.value>=-24)return Lr([31-Number(e.value)])}}var _a={float64:!1,mapSorter:Da,quickEncodeToken:ga},va=Object.freeze({mapSorter:Oa,quickEncodeToken:ga});function ya(){let e=[];return e[j.uint.major]=ni,e[j.negint.major]=li,e[j.bytes.major]=_i,e[j.string.major]=Oi,e[j.array.major]=Ii,e[j.map.major]=Wi,e[j.tag.major]=Xi,e[j.float.major]=ra,e}var ba=ya(),xa=new Wr,Sa=class e{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(t,n){if(t&&t.includes(n))throw Error(`${Kr} object contains circular references`);return new e(n,t)}},Ca={null:new M(j.null,null),undefined:new M(j.undefined,void 0),true:new M(j.true,!0),false:new M(j.false,!1),emptyArray:new M(j.array,0),emptyMap:new M(j.map,0)},wa={number(e,t,n,r){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new M(j.float,e):e>=0?new M(j.uint,e):new M(j.negint,e)},bigint(e,t,n,r){return e>=BigInt(0)?new M(j.uint,e):new M(j.negint,e)},Uint8Array(e,t,n,r){return new M(j.bytes,e)},string(e,t,n,r){return new M(j.string,e)},boolean(e,t,n,r){return e?Ca.true:Ca.false},null(e,t,n,r){return Ca.null},undefined(e,t,n,r){return Ca.undefined},ArrayBuffer(e,t,n,r){return new M(j.bytes,new Uint8Array(e))},DataView(e,t,n,r){return new M(j.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,n,r){if(!e.length)return n.addBreakTokens===!0?[Ca.emptyArray,new M(j.break)]:Ca.emptyArray;r=Sa.createCheck(r,e);let i=[],a=0;for(let t of e)i[a++]=Ta(t,n,r);return n.addBreakTokens?[new M(j.array,e.length),i,new M(j.break)]:[new M(j.array,e.length),i]},Object(e,t,n,r){let i=t!==`Object`,a=i?e.keys():Object.keys(e),o=i?e.size:a.length,s;if(o){s=Array(o),r=Sa.createCheck(r,e);let t=!i&&n.ignoreUndefinedProperties,c=0;for(let o of a){let a=i?e.get(o):e[o];t&&a===void 0||(s[c++]=[Ta(o,n,r),Ta(a,n,r)])}c<o&&(s.length=c)}return s?.length?(Ea(s,n),n.addBreakTokens?[new M(j.map,s.length),s,new M(j.break)]:[new M(j.map,s.length),s]):n.addBreakTokens===!0?[Ca.emptyMap,new M(j.break)]:Ca.emptyMap},Tagged(e,t,n,r){return[new M(j.tag,e.tag),Ta(e.value,n,r)]}};wa.Map=wa.Object,wa.Buffer=wa.Uint8Array;for(let e of`Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64`.split(` `))wa[`${e}Array`]=wa.DataView;function Ta(e,t={},n){let r=Or(e),i=t&&t.typeEncoders&&t.typeEncoders[r]||wa[r];if(typeof i==`function`){let a=i(e,r,t,n);if(a!=null)return a}let a=wa[r];if(!a)throw Error(`${Kr} unsupported type: ${r}`);return a(e,r,t,n)}function Ea(e,t){let n=t.mapSorter;n&&e.sort((e,r)=>n(e,r,t))}function Da(e,t,n){let r=Array.isArray(e[0])?e[0][0]:e[0],i=Array.isArray(t[0])?t[0][0]:t[0];if(r.type.major!==i.type.major)return r.type.compare(i.type);let a=ba[r.type.major].compareTokens(r,i,n);return a===0&&console.warn(`WARNING: complex key types used, CBOR key sorting guarantees are gone`),a}function Oa(e,t){if(e[0]instanceof M&&t[0]instanceof M){let n=e[0],r=t[0];return n._keyBytes||=ka(n.value),r._keyBytes||=ka(r.value),Vr(n._keyBytes,r._keyBytes)}throw Error(`rfc8949MapSorter: complex key types are not supported yet`)}function ka(e){return qa(e,ba,va)}function Aa(e,t,n,r){if(Array.isArray(t))for(let i of t)Aa(e,i,n,r);else n[t.type.major](e,t,r)}var ja=j.uint.majorEncoded,Ma=j.negint.majorEncoded,Na=j.bytes.majorEncoded,Pa=j.string.majorEncoded,Fa=j.array.majorEncoded,Ia=j.map.majorEncoded,La=j.float.majorEncoded|20,Ra=j.float.majorEncoded|21,za=j.float.majorEncoded|22,Ba=j.float.majorEncoded|23,Va=BigInt(-1),Ha=BigInt(1);function Ua(e,t,n){n<24?e.pushByte(t|Number(n)):F(e,t,n)}function Wa(e){return e.addBreakTokens!==!0}function Ga(e,t,n,r,i){let a=n===`Map`,o=a?t.keys():Object.keys(t),s=a?t.size:o.length;if(!s){e.pushByte(Ia);return}i=Sa.createCheck(i,t);let c=!a&&r.ignoreUndefinedProperties,l=Array(s),u=0;for(let e of o){let n=a?t.get(e):t[e];c&&n===void 0||(l[u++]=[Ta(e,r,i),n])}if(u===0){e.pushByte(Ia);return}u<s&&(l.length=u),l.sort((e,t)=>Da(e,t,r)),Ua(e,Ia,u);for(let[t,n]of l)Aa(e,t,ba,r),Ka(e,n,r,i)}function Ka(e,t,n,r){let i=Or(t),a=n.typeEncoders&&n.typeEncoders[i];if(a){let o=a(t,i,n,r);if(o!=null){Aa(e,o,ba,n);return}}switch(i){case`null`:e.pushByte(za);return;case`undefined`:e.pushByte(Ba);return;case`boolean`:e.pushByte(t?Ra:La);return;case`number`:!Number.isInteger(t)||!Number.isSafeInteger(t)?ra(e,new M(j.float,t),n):t>=0?Ua(e,ja,t):Ua(e,Ma,t*-1-1);return;case`bigint`:t>=BigInt(0)?Ua(e,ja,t):Ua(e,Ma,t*Va-Ha);return;case`string`:{let n=Ir(t);Ua(e,Pa,n.length),e.push(n);return}case`Uint8Array`:Ua(e,Na,t.length),e.push(t);return;case`Array`:if(!t.length){e.pushByte(Fa);return}r=Sa.createCheck(r,t),Ua(e,Fa,t.length);for(let i of t)Ka(e,i,n,r);return;case`Object`:case`Map`:n.mapSorter===Da?Ga(e,t,i,n,r):Aa(e,wa.Object(t,i,n,r),ba,n);return;default:{let a=wa[i];if(!a)throw Error(`${Kr} unsupported type: ${i}`);Aa(e,a(t,i,n,r),ba,n)}}}function qa(e,t,n,r){let i=r instanceof Uint8Array,a=i?new Gr(r):xa,o=Ta(e,n);if(!Array.isArray(o)&&n.quickEncodeToken){let e=n.quickEncodeToken(o);if(e)return i?(a.push(e),a.toBytes()):e;let r=t[o.type.major];if(r.encodedSize){let e=r.encodedSize(o,n);if(i||(a=new Wr(e)),r(a,o,n),a.chunks.length!==1)throw Error(`Unexpected error: pre-calculated length for ${o} was wrong`);return i?a.toBytes():Nr(a.chunks[0])}}return a.reset(),Aa(a,o,t,n),a.toBytes(!0)}function Ja(e,t){return t=Object.assign({},_a,t),Wa(t)?(xa.reset(),Ka(xa,e,t,void 0),xa.toBytes(!0)):qa(e,ba,t)}var Ya={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Xa=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=ha[e];if(t===void 0){let n=R[e];if(!n)throw Error(`${N} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,`0`)})`);let r=e&31;t=n(this.data,this._pos,r,this.options)}return this._pos+=t.encodedLength,t}},Za=Symbol.for(`DONE`),Qa=Symbol.for(`BREAK`);function $a(e,t,n){let r=[];for(let i=0;i<e.value;i++){let a=ro(t,n);if(a===Qa){if(e.value===1/0)break;throw Error(`${N} got unexpected break to lengthed array`)}if(a===Za)throw Error(`${N} found array but not enough entries (got ${i}, expected ${e.value})`);r[i]=a}return r}function eo(e,t,n){let r=n.useMaps===!0,i=n.rejectDuplicateMapKeys===!0,a=r?void 0:{},o=r?new Map:void 0;for(let s=0;s<e.value;s++){let c=ro(t,n);if(c===Qa){if(e.value===1/0)break;throw Error(`${N} got unexpected break to lengthed map`)}if(c===Za)throw Error(`${N} found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(!r&&typeof c!=`string`)throw Error(`${N} non-string keys not supported (got ${typeof c})`);if(i&&(r&&o.has(c)||!r&&Object.hasOwn(a,c)))throw Error(`${N} found repeat map key "${c}"`);let l=ro(t,n);if(l===Za)throw Error(`${N} found map but not enough entries (got ${s} [no value], expected ${e.value})`);r?o.set(c,l):a[c]=l}return r?o:a}function*to(e,t,n){for(let r=0;r<e.value;r++){let i=ro(t,n);if(i===Qa){if(e.value===1/0)break;throw Error(`${N} got unexpected break to lengthed map`)}if(i===Za)throw Error(`${N} found map but not enough entries (got ${r} [no key], expected ${e.value})`);let a=ro(t,n);if(a===Za)throw Error(`${N} found map but not enough entries (got ${r} [no value], expected ${e.value})`);yield[i,a]}}function no(e,t){let n=function(){if(n._called)throw Error(`${N} tag decode() may only be called once`);n._called=!0;let r=ro(e,t);if(r===Za)throw Error(`${N} tag content missing`);if(r===Qa)throw Error(`${N} got unexpected break in tag content`);return r};return n.entries=function(){if(n._called)throw Error(`${N} tag decode() may only be called once`);n._called=!0;let r=e.next();if(!j.equals(r.type,j.map))throw Error(`${N} entries() requires map content, got ${r.type.name}`);let i=[];for(let n of to(r,e,t))i.push(n);return i},n._called=!1,n}function ro(e,t){if(e.done())return Za;let n=e.next();if(j.equals(n.type,j.break))return Qa;if(n.type.terminal)return n.value;if(j.equals(n.type,j.array))return $a(n,e,t);if(j.equals(n.type,j.map))return eo(n,e,t);if(j.equals(n.type,j.tag)){if(t.tags&&typeof t.tags[n.value]==`function`){let r=no(e,t),i=t.tags[n.value](r);if(!r._called)throw Error(`${N} tag decoder must call decode() or entries()`);return i}throw Error(`${N} tag not supported (${n.value})`)}throw Error(`unsupported`)}function io(e,t){if(!(e instanceof Uint8Array))throw Error(`${N} data to decode must be a Uint8Array`);t=Object.assign({},Ya,t);let n=Nr(e),r=t.tokenizer||new Xa(n,t),i=ro(r,t);if(i===Za)throw Error(`${N} did not find any content to decode`);if(i===Qa)throw Error(`${N} got unexpected break`);return[i,e.subarray(r.pos())]}function ao(e,t){let[n,r]=io(e,t);if(r.length>0)throw Error(`${N} too many terminals, data makes no sense`);return n}Object.defineProperty(class e{constructor(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<0)throw TypeError(`Tagged: tag must be a non-negative integer`);this.tag=e,this.value=t}static decoder(t){return n=>new e(t,n())}static preserve(...t){let n={};for(let r of t)n[r]=e.decoder(r);return n}}.prototype,Symbol.toStringTag,{value:`Tagged`});function oo(e,t,n=()=>{}){if(!Array.isArray(e))throw TypeError(`"${t}" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)n(e[r],`${t}[${r}]`);return e}var z=(e,t,n)=>Wn(e,t,n),so=Un;function co(e,t=``){if(typeof e!=`string`){let n=t&&`"${t}" `;throw TypeError(n+`expected string, got type=`+typeof e)}return e}function lo(e,t=`object`){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(t===`object`?`expected valid options object`:`"${t}" expected object, got type=${typeof e}`);return e}function uo(e,t){if(typeof e!=`function`)throw TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}var fo=er,po=(...e)=>ir(...e),mo=e=>nr(e),ho=Vn,go=e=>sr(e),_o=BigInt(0),vo=BigInt(1),yo=e=>e?`"${e}" `:``;function bo(e,t=``){if(typeof e!=`boolean`)throw TypeError(yo(t)+`expected boolean, got type=`+typeof e);return e}function xo(e){if(typeof e==`bigint`){if(!Ao(e))throw RangeError(`positive bigint expected, got `+e)}else so(e);return e}function So(e,t=``){if(typeof e!=`number`){let n=t&&`"${t}" `;throw TypeError(n+`expected number, got type=`+typeof e)}if(!Number.isSafeInteger(e)){let n=t&&`"${t}" `;throw RangeError(n+`expected safe integer, got `+e)}}function Co(e){let t=xo(e).toString(16);return t.length&1?`0`+t:t}function wo(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);return e===``?_o:BigInt(`0x`+e)}function To(e){return wo(er(e))}function Eo(e){return wo(er(ko(Wn(e)).reverse()))}function Do(e,t){if(Un(t),t===0)throw Error(`zero output length is invalid`);e=xo(e);let n=t*2,r=e.toString(16);if(r.length>n)throw RangeError(`number is too large`);return nr(r.padStart(n,`0`))}function Oo(e,t){return Do(e,t).reverse()}function ko(e){return Uint8Array.from(z(e))}function Ao(e){return typeof e==`bigint`&&_o<=e}function jo(e,t,n){return Ao(e)&&Ao(t)&&Ao(n)&&t<=e&&e<n}function Mo(e,t,n,r){if(!jo(t,n,r))throw RangeError(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function No(e){if(e<_o)throw Error(`expected non-negative bigint, got `+e);return e===_o?0:e.toString(2).length}var Po=e=>(So(e,`n`),(vo<<BigInt(e))-vo);function Fo(e,t,n){if(Un(e,`hashLen`),Un(t,`qByteLen`),typeof n!=`function`)throw TypeError(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=Uint8Array.of(),a=Uint8Array.of(0),o=Uint8Array.of(1),s=r(e),c=r(e),l=0,u=()=>{s.fill(1),c.fill(0),l=0},d=(...e)=>n(c,po(s,...e)),f=(e=i)=>{c=d(a,e),s=d(),e.length!==0&&(c=d(o,e),s=d())},p=()=>{if(l++>=1e3)throw Error(`drbg: tried max amount of iterations`);let e=0,n=[];for(;e<t;){s=d();let t=s.slice();n.push(t),e+=s.length}return po(...n)};return(e,t)=>{u(),f(e);let n;for(;(n=t(p()))===void 0;)f();return u(),n}}function Io(e,t={},n={},r=`object`){lo(e,r),lo(t,`fields`),lo(n,`optFields`);function i(t,n,i){let a=r===`object`?`param "${String(t)}"`:`"${r}.${String(t)}"`,o=e[t];if(!Object.hasOwn(e,t)&&(i?o!==void 0:n!==`function`))throw TypeError(`${a} is invalid: expected own property`);if(i&&o===void 0)return;let s=typeof o;if(s!==n||o===null)throw TypeError(`${a} is invalid: expected ${n}, got ${s}`)}let a=(e,t)=>Object.entries(e).forEach(([e,n])=>i(e,n,t));a(t,!1),a(n,!0)}var B=BigInt(0),V=BigInt(1),Lo=BigInt(2),Ro=BigInt(3),zo=BigInt(4),Bo=BigInt(5),Vo=BigInt(7),Ho=BigInt(8),Uo=BigInt(9),Wo=BigInt(15),Go=BigInt(16),Ko=BigInt(`0x10000000000000000`);function H(e,t){if(t<=B)throw Error(`mod: expected positive modulus, got `+t);let n=e%t;return n>=B?n:t+n}function qo(e,t,n){if(n<=V)throw Error(`pow: expected modulus > 1, got `+n);if(typeof t!=`bigint`)throw TypeError(`invalid exponent: expected bigint, got `+typeof t);if(t<B)throw Error(`invalid exponent, negatives unsupported`);if(t===B)return V;if(t===V)return e;let r=e%n;if(r<B&&(r+=n),t<Ko){let e=V;for(;t>B;)t&V&&(e=e*r%n),r=r*r%n,t>>=V;return e}let i=[];for(;t>B;)i.push(Number(t&Wo)),t>>=zo;let a=Array(16);a[0]=V,a[1]=r;for(let e=2;e<16;e++)a[e]=a[e-1]*r%n;let o=a[i[i.length-1]];for(let e=i.length-2;e>=0;e--){o=o*o%n,o=o*o%n,o=o*o%n,o=o*o%n;let t=i[e];t!==0&&(o=o*a[t]%n)}return o}function Jo(e,t,n){if(n<=V)throw Error(`pow2: expected modulus > 1, got `+n);if(t<B)throw Error(`pow2: expected non-negative exponent, got `+t);let r=e;for(;t-->B;)r*=r,r%=n;return r}function Yo(e,t){if(e===B)throw Error(`invert: expected non-zero number`);if(t<=V)throw Error(`invert: expected modulus > 1, got `+t);let n=H(e,t),r=t,i=B,a=V;for(;n!==B;){let e=r/n,t=r-n*e,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==V)throw Error(`invert: does not exist`);return H(i,t)}function Xo(e,t){if(t<=V)throw Error(`invertCt: expected prime modulus > 1, got `+t);let n=H(e,t);if(n===B)throw Error(`invertCt: expected non-zero number`);let r=qo(n,t-Lo,t);if(H(n*r,t)!==V)throw Error(`invertCt: does not exist`);return r}function Zo(e,t,n){let r=e;if(!r.eql(r.sqr(t),n))throw Error(`Cannot find square root`)}function Qo(e,t){if((e&V)===B)throw Error(t+`: expected odd modulus, got `+e)}function $o(e,t){let n=e,r=(n.ORDER+V)/zo,i=n.pow(t,r);return Zo(n,i,t),i}function es(e,t){let n=e,r=(n.ORDER-Bo)/Ho,i=n.mul(t,Lo),a=n.pow(i,r),o=n.mul(t,a),s=n.mul(n.mul(o,Lo),a),c=n.mul(o,n.sub(s,n.ONE));return Zo(n,c,t),c}function ts(e){let t=fs(e),n=ns(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Vo)/Go;return((e,t)=>{let n=e,s=n.pow(t,o),c=n.mul(s,r),l=n.mul(s,i),u=n.mul(s,a),d=n.eql(n.sqr(c),t),f=n.eql(n.sqr(l),t);s=n.cmov(s,c,d),c=n.cmov(u,l,f);let p=n.eql(n.sqr(c),t),m=n.cmov(s,c,p);return Zo(n,m,t),m})}function ns(e){if(e<Ro)throw Error(`sqrt is not defined for small field`);Qo(e,`tonelliShanks`);let t=e-V,n=0;for(;t%Lo===B;)t/=Lo,n++;let r=Lo,i=fs(e);for(;cs(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return $o;let a=i.pow(r,t),o=(t+V)/Lo;return function(e,r){let i=e;if(i.is0(r))return r;if(cs(i,r)!==1)throw Error(`Cannot find square root`);let s=n,c=i.mul(i.ONE,a),l=i.pow(r,t),u=i.pow(r,o);for(;!i.eql(l,i.ONE);){if(i.is0(l))throw Error(`Cannot find square root: probably non-prime P`);let e=1,t=i.sqr(l);for(;!i.eql(t,i.ONE);)if(e++,t=i.sqr(t),e===s)throw Error(`Cannot find square root`);let n=V<<BigInt(s-e-1),r=i.pow(c,n);s=e,c=i.sqr(r),l=i.mul(l,c),u=i.mul(u,r)}return u}}function rs(e){return Qo(e,`Fp.sqrt`),e%zo===Ro?$o:e%Ho===Bo?es:e%Go===Uo?ts(e):ns(e)}var is=(e,t)=>(H(e,t)&V)===V,as=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function os(e){if(lo(e,`field`),typeof e.ORDER!=`bigint`)throw TypeError(`param "ORDER" is invalid: expected bigint, got `+typeof e.ORDER);So(e.BYTES,`BYTES`),So(e.BITS,`BITS`);for(let t of as)uo(e[t],`field.`+t);if(e.BYTES<1||e.BITS<1)throw Error(`invalid field: expected BYTES/BITS > 0`);if(e.ORDER<=V)throw Error(`invalid field: expected ORDER > 1, got `+e.ORDER);return e}function ss(e,t,n=!1){os(e),oo(t,`nums`),bo(n,`passZero`);let r=e,i=Array(t.length).fill(n?r.ZERO:void 0),a=t.reduce((e,t,n)=>r.is0(t)?e:(i[n]=e,r.mul(e,t)),r.ONE),o=r.inv(a);return t.reduceRight((e,t,n)=>r.is0(t)?e:(i[n]=r.mul(e,i[n]),r.mul(e,t)),o),i}function cs(e,t){os(e);let n=e;Qo(n.ORDER,`FpLegendre`);let r=(n.ORDER-V)/Lo,i=n.pow(t,r),a=n.eql(i,n.ONE),o=n.eql(i,n.ZERO),s=n.eql(i,n.neg(n.ONE));if(!a&&!o&&!s)throw Error(`invalid Legendre symbol result`);return a?1:o?0:-1}function ls(e,t){if(t!==void 0&&so(t),e<=B)throw Error(`invalid n length: expected positive n, got `+e);if(t!==void 0&&t<1)throw Error(`invalid n length: expected positive bit length, got `+t);let n=No(e);if(t!==void 0&&t<n)throw Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);let r=t===void 0?n:t;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}var us=new WeakMap,ds=class{ORDER;BITS;BYTES;isLE;ZERO=B;ONE=V;_lengths;_mod;constructor(e,t={}){if(e<=V)throw Error(`invalid field: expected ORDER > 1, got `+e);let n;this.isLE=!1,typeof t==`object`&&t&&(typeof t.BITS==`number`&&(n=t.BITS),typeof t.sqrt==`function`&&Object.defineProperty(this,"sqrt",{value:t.sqrt,enumerable:!0}),typeof t.isLE==`boolean`&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),typeof t.modFromBytes==`boolean`&&(this._mod=t.modFromBytes));let{nBitLength:r,nByteLength:i}=ls(e,n);if(i>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);this.ORDER=e,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(e){return H(e,this.ORDER)}isValid(e){if(typeof e!=`bigint`)throw TypeError(`invalid field element: expected bigint, got `+typeof e);return B<=e&&e<this.ORDER}is0(e){return e===B}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&V)===V}neg(e){return H(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return H(e*e,this.ORDER)}add(e,t){return H(e+t,this.ORDER)}sub(e,t){return H(e-t,this.ORDER)}mul(e,t){return H(e*t,this.ORDER)}pow(e,t){return qo(e,t,this.ORDER)}div(e,t){return H(e*Yo(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return Yo(e,this.ORDER)}sqrt(e){let t=us.get(this);return t||us.set(this,t=rs(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?Oo(e,this.BYTES):Do(e,this.BYTES)}fromBytes(e,t=!1){z(e);let{_lengths:n,BYTES:r,isLE:i,ORDER:a,_mod:o}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>r)throw Error(`Field.fromBytes: expected `+n+` bytes, got `+e.length);let t=new Uint8Array(r);t.set(e,i?0:t.length-e.length),e=t}if(e.length!==r)throw Error(`Field.fromBytes: expected `+r+` bytes, got `+e.length);let s=i?Eo(e):To(e);if(o&&(s=H(s,a)),!t&&!this.isValid(s))throw Error(`invalid field element: outside of range 0..ORDER`);return s}invertBatch(e){return ss(this,e,!0)}cmov(e,t,n){return bo(n,`condition`),n?t:e}};function fs(e,t={}){return Object.freeze(ds.prototype),new ds(e,t)}function ps(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);if(e<=V)throw Error(`field order must be greater than 1`);let t=No(e-V);return Math.ceil(t/8)}function ms(e){let t=ps(e);return t+Math.ceil(t/2)}function hs(e,t,n=!1){z(e);let r=e.length,i=ps(t),a=Math.max(ms(t),16);if(r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=H(n?Eo(e):To(e),t-V)+V;return n?Oo(o,i):Do(o,i)}var gs=BigInt(0),_s=BigInt(1),vs=BigInt(4),ys=16,bs=128,xs=5,Ss=2**31;function Cs(e){let t=e;if(typeof t!=`function`)throw TypeError(`"Point" expected constructor, got type=`+typeof e);uo(t.fromAffine,`Point.fromAffine`),uo(t.fromBytes,`Point.fromBytes`),uo(t.fromHex,`Point.fromHex`),lo(t.BASE,`Point.BASE`),lo(t.ZERO,`Point.ZERO`),os(t.Fp),os(t.Fn)}function ws(e,t){Cs(e),Os(t,e);let n=ss(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function Ts(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw Error(`invalid window size, expected [`+n+`..`+t+`], got W=`+e)}function Es(e,t){let n=e*(4*t+128);if(n>Ss)throw Error(`invalid window size: table would need ~`+Math.ceil(n/2**20)+` MiB, max `+Ss/2**20+` MiB`)}function Ds(e,t){if(e!==void 0){uo(e,`randomBytes`);try{let n=e(t);if(!ho(n)||n.length!==t)return}catch{return}return e}}function Os(e,t){oo(e,`points`),e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function ks(e,t,n){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,r)=>{if(!(n===void 0?t.isValid(e):Ao(e)&&e<n))throw Error(`invalid scalar at index `+r)})}var As=new WeakMap;function js(e){return As.get(e)||1}function Ms(e,t){let n=e.double(),r=[e];for(let e=1;e<t;e++)r.push(r[e-1].add(n));return r}function Ns(e,t){let n=2**t,r=n/2,i=BigInt(n-1),a=[];for(;e>gs;){let t=0;e&_s&&(t=Number(e&i),t>=r&&(t-=n),e-=BigInt(t)),a.push(t),e>>=_s}return a}function Ps(e,t,n){let r=2**t,i=r/2,a=BigInt(r-1),o=BigInt(t),s=[];for(let t=0;t<n;t++){let t=Number(e&a);e>>=o,t>i&&(t-=r,e+=_s),s.push(t)}if(e!==gs)throw Error(`invalid wnaf`);return s}function Fs(e,t,n){let r=0;for(let e of n)r=Math.max(r,e.length);let i=e;for(let e=r-1;e>=0;e--){e!==r-1&&(i=i.double());for(let r=0;r<n.length;r++){let a=n[r][e];if(a){let e=t[r][Math.abs(a)-1>>1];i=i.add(a<0?e.negate():e)}}}return i}var Is=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,t){Cs(e),this.randomBytes=Ds(t,ys),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,t,n){let r=Math.ceil(n/t)+1,i=2**(t-1),a=[],o=e;for(let e=0;e<r;e++){let e=o;for(let t=0;t<i;t++)a.push(e),e=e.add(o);o=a[a.length-1].double()}return{W:t,bits:n,windows:r,comp:a}}wnafCachedCT(e,t){let{W:n,windows:r,comp:i}=e,a=2**(n-1),o=Ps(t,n,r),s=this.ZERO,c=this.BASE;for(let e=0;e<r;e++){let t=o[e],n=e*a,r=Math.abs(t)-1,l=i[n];for(let e=1;e<a;e++)l=e===r?i[n+e]:l;let u=l.negate();t===0?c=c.add(i[n]):s=s.add(t<0?u:l)}return{p:s,f:c}}getWnafPrecomputes(e,t,n,r){let i=this.wnafPrecomputes.get(t),a=i?.find(t=>t.W===e&&t.bits===n);return a||(a=this.buildWnafTable(t,e,n),typeof r==`function`&&(a={...a,comp:r(a.comp)}),i||(i=[],this.wnafPrecomputes.set(t,i)),i.push(a)),a}assertPoint(e){if(!(e instanceof this.Point))throw TypeError(`"point" expected Point instance, got type=`+typeof e)}validateMulInput(e,t){if(this.assertPoint(e),!jo(t,_s,this.Point.Fn.ORDER))throw Error(`invalid scalar`)}runCT(e,t,n,r){let i=js(e);return i===1?this.fixedWindowCT(e,t,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,r),t)}mulCT(e,t,n){return this.validateMulInput(e,t),this.runCT(e,t,this.bits,n)}mulCTBlinded(e,t,n){if(this.validateMulInput(e,t),this.randomBytes===void 0)throw Error(`randomBytes is required for scalar blinding`);let r=this.Point.Fn.BITS+bs,i=this.randomBytes(ys);if(!ho(i)||i.length!==ys)throw Error(`randomBytes returned invalid byte array`);i[0]=i[0]&63|128;let a=t+To(i)*this.Point.Fn.ORDER;return this.runCT(e,a,r,n)}fixedWindowCT(e,t,n){let r=xs,i=Po(r),a=Array(32);a[0]=this.ZERO;for(let t=1;t<32;t++)a[t]=a[t-1].add(e);let o=Math.ceil(n/r),s=this.ZERO;for(let e=o-1;e>=0;e--){if(e!==o-1)for(let e=0;e<r;e++)s=s.double();let n=Number(t>>BigInt(e*r)&i),c=a[0];for(let e=1;e<32;e++)c=e===n?a[e]:c;s=s.add(c)}return{p:s,f:s}}shouldBlind(e,t){return this.randomBytes===void 0?!1:t===_s||e===this.BASE&&(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(e,t,n,r){return this.shouldBlind(e,n)?this.mulCTBlinded(e,t,r):this.mulCT(e,t,r)}mulUnsafe(e,t,n){if(this.assertPoint(e),!Ao(t))throw Error(`invalid scalar`);let r=js(e);if(r===1||t>=this.Point.Fn.ORDER)return Ls(this.Point,[e],[t],!0);let i=this.getWnafPrecomputes(r,e,this.bits,n);return this.wnafCachedCT(i,t).p}setWindowSize(e,t){this.assertPoint(e),Ts(t,this.bits),Es((Math.ceil((this.bits+bs)/t)+1)*2**(t-1),this.Point.Fp.BYTES),As.set(e,t),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return js(e)!==1}};function Ls(e,t,n,r=!1){if(Cs(e),Os(t,e),bo(r,`allowOversized`),ks(n,e.Fn,r?e.Fn.ORDER**vs:void 0),t.length!==n.length)throw Error(`arrays of points and scalars must have equal length`);let i=t.map(e=>Ms(e,4)),a=n.map(e=>Ns(e,4));return Fs(e.ZERO,i,a)}function Rs(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return os(t),t}return fs(e,{isLE:n})}function zs(e,t,n={},r){if(e!==`weierstrass`&&e!==`edwards`)throw Error(`expected curve type "weierstrass" or "edwards"`);if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);Io(n);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(Ao(n)&&n!==gs))throw Error(`CURVE.${e} must be positive bigint`)}let i=Rs(t.p,n.Fp,r),a=Rs(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}function Bs(e,t){return function(n){let r=e(n);return{secretKey:r,publicKey:t(r)}}}var Vs=BigInt(0),Hs=BigInt(1),Us=BigInt(2),Ws=BigInt(4),Gs=BigInt(8);function Ks(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function qs(e,t={}){Io(t,{},{},`extraOpts`);let n=t,r=zs(`edwards`,e,n,n.FpFnLE),{Fp:i,Fn:a}=r,o=r.CURVE,{h:s}=o;if(cs(i,o.a)!==1)throw Error(`edwards: CURVE.a must be a square in Fp for complete addition formulas`);if(cs(i,o.d)!==-1)throw Error(`edwards: CURVE.d must be a non-square in Fp for complete addition formulas`);Io(n,{},{uvRatio:`function`,randomBytes:`function`});let c=n.randomBytes===void 0?go:n.randomBytes,l=Us<<BigInt(i.BYTES*8)-Hs;function u(e){if(!i.isOdd)throw Error(`Field does not have .isOdd()`);return i.isOdd(e)}let d=n.uvRatio===void 0?(e,t)=>{try{return{isValid:!0,value:i.sqrt(i.div(e,t))}}catch{return{isValid:!1,value:Vs}}}:n.uvRatio;if(!Ks(i,o,o.Gx,o.Gy))throw Error(`bad curve params: generator point`);let f=i.eql(o.a,i.neg(i.ONE))?e=>i.neg(e):i.eql(o.a,i.ONE)?e=>e:e=>i.mul(o.a,e);function p(e,t,n=!1){let r=n?Hs:Vs;return Mo(`coordinate `+e,t,r,l),t}function m(e){if(!(e instanceof h))throw Error(`EdwardsPoint expected`)}class h{static BASE=new h(o.Gx,o.Gy,i.ONE,i.mul(o.Gx,o.Gy));static ZERO=new h(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=a;X;Y;Z;T;constructor(e,t,n,r){this.X=p(`x`,e),this.Y=p(`y`,t),this.Z=p(`z`,n,!0),this.T=p(`t`,r),Object.freeze(this)}static CURVE(){return o}static fromAffine(e){if(e instanceof h)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return p(`x`,t),p(`y`,n),new h(t,n,i.ONE,i.mul(t,n))}static fromBytes(e,t=!1){let n=i.BYTES,{a:r,d:a}=o;e=ko(z(e,n,`point`)),bo(t,`zip215`);let s=ko(e),c=e[n-1];s[n-1]=c&-129;let f=Eo(s);Mo(`point.y`,f,Vs,t?l:i.ORDER);let p=i.sqr(f),m=i.sub(p,i.ONE),g=i.sub(i.mulN(a,p),r),{isValid:_,value:v}=d(m,g);if(!_)throw Error(`bad point: invalid y coordinate`);let y=u(v),b=!!(c&128);if(!t&&i.is0(v)&&b)throw Error(`bad point: x=0 and x_0=1`);return b!==y&&(v=i.neg(v)),h.fromAffine({x:v,y:f})}static fromHex(e,t=!1){return h.fromBytes(mo(e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=6,t=!0){return _.setWindowSize(this,e),t||this.multiply(Us),this}assertValidity(){let e=this,{a:t,d:n}=o;if(e.is0())throw Error(`bad point: ZERO`);let{X:r,Y:a,Z:s,T:c}=e,l=i.sqr(r),u=i.sqr(a),d=i.sqr(s),f=i.sqr(d),p=i.mul(l,t),m=i.mul(i.add(p,u),d),h=i.add(f,i.mul(n,i.mul(l,u)));if(!i.eql(m,h))throw Error(`bad point: equation left != right (1)`);let g=i.mul(r,a),_=i.mul(s,c);if(!i.eql(g,_))throw Error(`bad point: equation left != right (2)`)}equals(e){m(e);let{X:t,Y:n,Z:r}=this,{X:a,Y:o,Z:s}=e,c=i.mul(t,s),l=i.mul(a,r),u=i.mul(n,s),d=i.mul(o,r);return i.eql(c,l)&&i.eql(u,d)}is0(){return this.equals(h.ZERO)}negate(){return new h(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){let{X:e,Y:t,Z:n}=this,r=i.sqr(e),a=i.sqr(t),o=i.mul(i.sqr(n),Us),s=f(r),c=i.addN(e,t),l=i.sub(i.subN(i.sqr(c),r),a),u=i.addN(s,a),d=i.subN(u,o),p=i.subN(s,a),m=i.mul(l,d),g=i.mul(u,p),_=i.mul(l,p),v=i.mul(d,u);return new h(m,g,v,_)}add(e){m(e);let{d:t}=o,{X:n,Y:r,Z:a,T:s}=this,{X:c,Y:l,Z:u,T:d}=e,p=i.mul(n,c),g=i.mul(r,l),_=i.mul(i.mulN(s,t),d),v=i.mul(a,u),y=i.sub(i.subN(i.mulN(i.addN(n,r),i.addN(c,l)),p),g),b=i.subN(v,_),x=i.addN(v,_),S=i.sub(g,f(p)),C=i.mul(y,b),w=i.mul(x,S),T=i.mul(y,S),E=i.mul(b,x);return new h(C,w,E,T)}subtract(e){return m(e),this.add(e.negate())}multiply(e){if(!a.isValidNot0(e))throw RangeError(`invalid scalar: expected 1 <= sc < curve.n`);let{p:t,f:n}=_.mulSecret(this,e,s,g);return g([t,n])[0]}multiplyUnsafe(e){if(!a.isValid(e))throw RangeError(`invalid scalar: expected 0 <= sc < curve.n`);return e===Vs?h.ZERO:this.is0()||e===Hs?this:_.mulUnsafe(this,e,g)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return _.mulUnsafe(this,o.n).is0()}toAffine(e){let t=this,n=e;if(n!=null&&typeof n!=`bigint`)throw TypeError(`"invertedZ" expected bigint, got type=`+typeof n);let{X:r,Y:a,Z:o}=t,s=t.is0();n??=s?i.create(Gs):i.inv(o);let c=i.mul(r,n),l=i.mul(a,n),u=i.mul(o,n);if(s)return{x:i.ZERO,y:i.ONE};if(!i.eql(u,i.ONE))throw Error(`invZ was invalid`);return{x:c,y:l}}clearCofactor(){return s===Hs?this:s===Us?this.double():s===Ws?this.double().double():s===Gs?this.double().double().double():this.multiplyUnsafe(s)}toBytes(){let{x:e,y:t}=this.toAffine(),n=i.toBytes(t);return n[n.length-1]|=u(e)?128:0,n}toHex(){return fo(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}let g=e=>ws(h,e),_=new Is(h,c);return _.bits>=6&&h.BASE.precompute(6),Object.freeze(h.prototype),Object.freeze(h),h}function Js(e,t,n={}){if(Cs(e),typeof t!=`function`)throw Error(`"hash" function param is required`);let r=t,i=n;Io(i,{},{adjustScalarBytes:`function`,randomBytes:`function`,domain:`function`,prehash:`function`,zip215:`boolean`,mapToCurve:`function`,toMontgomery:`function`,toMontgomerySecret:`function`});let{prehash:a}=i,{BASE:o,Fp:s,Fn:c}=e,l=r.outputLen,u=2*s.BYTES;if(l!==void 0&&(So(l,`hash.outputLen`),l!==u))throw Error(`hash.outputLen must be ${u}, got ${l}`);let d=i.randomBytes===void 0?go:i.randomBytes,f=i.toMontgomery,p=i.toMontgomerySecret,m=i.adjustScalarBytes===void 0?e=>e:i.adjustScalarBytes,h=i.domain===void 0?(e,t,n)=>{if(bo(n,`phflag`),t.length||n)throw Error(`Contexts/pre-hash are not supported`);return e}:i.domain;function g(e){return c.create(Eo(e))}function _(e){let t=T.secretKey;z(e,T.secretKey,`secretKey`);let n=z(r(e),2*t,`hashedSecretKey`),i=m(n.slice(0,t));return{head:i,prefix:n.slice(t,2*t),scalar:g(i)}}function v(e){let{head:t,prefix:n,scalar:r}=_(e),i=o.multiply(r);return{head:t,prefix:n,scalar:r,point:i,pointBytes:i.toBytes()}}function y(e){return v(e).pointBytes}function b(e=Uint8Array.of(),...t){let n=po(...t);return g(r(h(n,z(e,void 0,`context`),!!a)))}function x(e,t,n={}){Io(n,{},{},`options`),e=z(e,void 0,`message`),a&&(e=a(e));let{prefix:r,scalar:i,pointBytes:s}=v(t),l=b(n.context,r,e),u=o.multiply(l).toBytes(),d=b(n.context,u,s,e),f=c.create(l+d*i);if(!c.isValid(f))throw Error(`sign failed: invalid s`);return z(po(u,c.toBytes(f)),T.signature,`result`)}let S={zip215:i.zip215};function C(t,n,r,i=S){Io(i);let{context:s}=i,c=i.zip215===void 0?!!S.zip215:i.zip215,l=T.signature;t=z(t,l,`signature`),n=z(n,void 0,`message`),r=z(r,T.publicKey,`publicKey`),c!==void 0&&bo(c,`zip215`),a&&(n=a(n));let u=l/2,d=t.subarray(0,u),f=Eo(t.subarray(u,l)),p,m,h;try{p=e.fromBytes(r,c),m=e.fromBytes(d,c),h=o.multiplyUnsafe(f)}catch{return!1}if(!c&&p.isSmallOrder())return!1;let g=b(s,d,r,n);return m.add(p.multiplyUnsafe(g)).subtract(h).clearCofactor().is0()}let w=s.BYTES,T={secretKey:w,publicKey:w,signature:2*w,seed:w};function E(e){return e=e===void 0?d(T.seed):e,z(e,T.seed,`seed`)}function ee(e){return ho(e)&&e.length===T.secretKey}function D(t,n){try{return!!e.fromBytes(t,n===void 0?S.zip215:n)}catch{return!1}}let te={getExtendedPublicKey:v,randomSecretKey:E,isValidSecretKey:ee,isValidPublicKey:D,toMontgomery(t){if(f===void 0)throw Error(`Montgomery conversion is not supported for this curve`);return f(e.fromBytes(t))},toMontgomerySecret(e){if(p===void 0)throw Error(`Montgomery conversion is not supported for this curve`);return p(e)}};return Object.freeze(T),Object.freeze(te),Object.freeze({keygen:Bs(E,y),getPublicKey:y,sign:x,verify:C,utils:te,Point:e,lengths:T})}var Ys=BigInt(0),Xs=BigInt(1),Zs=BigInt(2);function Qs(e,t){return e+t-(t>>Xs<<Xs)}function $s(e){let t=BigInt(6)*e;return(n,r,i)=>{let a=r+i,o=((t+i-r)*n+r)%e;return{x_2:o,x_3:a-o}}}function ec(e){return Io(e,{P:`bigint`,type:`string`,adjustScalarBytes:`function`,powPminus2:`function`},{randomBytes:`function`,scalarMultBase:`function`}),Object.freeze({...e})}function tc(e){let t=ec(e),{P:n,type:r,adjustScalarBytes:i,powPminus2:a,randomBytes:o}=t,s=t.scalarMultBase,c=r===`x25519`;if(!c&&r!==`x448`)throw Error(`invalid type`);let l=o===void 0?go:o,u=c?255:448,d=$s(n),f=c?32:56,p=BigInt(c?9:5),m=BigInt(c?121665:39081),h=c?Zs**BigInt(254):Zs**BigInt(447),g=h+(c?BigInt(8)*(Zs**BigInt(251)-Xs):BigInt(4)*(Zs**BigInt(445)-Xs))+Xs,_=e=>H(e,n),v=y(p);function y(e){return Oo(_(e),f)}function b(e){let t=ko(z(e,f,`uCoordinate`));return c&&(t[31]&=127),_(Eo(t))}function x(e){return Eo(i(ko(z(e,f,`scalar`))))}let S=new Set(c?[Ys,Xs,n-Xs,BigInt(`325606250916557431795983626356110631294008115727848805560023387167927233504`),BigInt(`39382357235489614581723060781553021112529911719440698176882885853963445705823`)]:[Ys,Xs,n-Xs]);function C(e,t){let n=b(t);if(S.has(n))throw Error(`invalid private or public key received`);let r=ee(n,x(e));if(r===Ys)throw Error(`invalid private or public key received`);return y(r)}function w(e){if(s===void 0)return C(e,v);let t=x(e);Mo(`scalar`,t,h,g);let n=_(s(t));if(n===Ys)throw Error(`invalid private or public key received`);return y(n)}let T=w,E=C;function ee(e,t){Mo(`u`,e,Ys,n),Mo(`scalar`,t,h,g);let r=t,i=e,o=Xs,s=Ys,c=e,l=Xs,f=r^r>>Xs;for(let e=BigInt(u-1);e>=Ys;e--){let t=Qs(n,f>>e);({x_2:o,x_3:c}=d(t,o,c)),{x_2:s,x_3:l}=d(t,s,l);let r=o+s,a=_(r*r),u=o-s,p=_(u*u),h=a-p,g=c+l,v=c-l,y=_(v*r),b=_(g*u),x=y+b,S=y-b;c=_(x*x),l=_(i*_(S*S)),o=_(a*p),s=_(h*(a+_(m*h)))}let p=Qs(n,r);({x_2:o,x_3:c}=d(p,o,c)),{x_2:s,x_3:l}=d(p,s,l);let v=a(s);return _(o*v)}let D={secretKey:f,publicKey:f,seed:f},te=e=>(e=e===void 0?l(f):e,z(e,D.seed,`seed`),e),O={randomSecretKey:te};return Object.freeze(D),Object.freeze(O),Object.freeze({keygen:Bs(te,T),getSharedSecret:E,getPublicKey:T,scalarMult:C,scalarMultBase:w,utils:O,GuBytes:v.slice(),lengths:D})}var nc=BigInt(0),rc=BigInt(1),ic=BigInt(2),ac=BigInt(3),oc=BigInt(5),sc=BigInt(8),cc=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),lc={p:cc,n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:sc,a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)};function uc(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=cc,o=e*e%a*e%a,s=Jo(Jo(o,ic,a)*o%a,rc,a)*e%a,c=Jo(s,oc,a)*s%a,l=Jo(c,t,a)*c%a,u=Jo(l,n,a)*l%a,d=Jo(u,r,a)*u%a;return{pow_p_5_8:Jo(Jo(Jo(Jo(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,ic,a)*e%a,b2:o}}function dc(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}var fc=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`);function pc(e,t){let n=cc,r=H(t*t*t,n),i=uc(e*H(r*r*t,n)).pow_p_5_8,a=H(e*r*i,n),o=H(t*a*a,n),s=a,c=H(a*fc,n),l=o===e,u=o===H(-e,n),d=o===H(-e*fc,n);return l&&(a=s),(u||d)&&(a=c),is(a,n)&&(a=H(-a,n)),{isValid:l||u,value:a}}var mc=qs(lc,{uvRatio:pc}),hc=mc.Fp;function gc(e){let{y:t}=e;return hc.toBytes(hc.div(rc+t,rc-t))}function _c(e){let t=mc.Fp.BYTES;return Wn(e,t),dc(Er(e.subarray(0,t))).subarray(0,t)}function vc(e){return Js(mc,Er,Object.assign({adjustScalarBytes:dc,toMontgomery:gc,toMontgomerySecret:_c,zip215:!0},e))}var yc=vc({}),bc=(()=>{let e=cc,t=t=>{let{pow_p_5_8:n,b2:r}=uc(t);return H(Jo(n,ac,e)*r,e)};return tc({P:e,type:`x25519`,powPminus2:t,adjustScalarBytes:dc,scalarMultBase:n=>{let r=H(n,mc.Fn.ORDER);if(r===nc)return nc;let i=mc.BASE.multiply(r);return H((i.Z+i.Y)*t(H(i.Z-i.Y,e)),e)}})})(),xc=class{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if(Gn(e),Wn(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`expected Hash instance`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),Yn(r)}update(e){return qn(this),this.iHash.update(e),this}digestInto(e){qn(this),Jn(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o,canXOF:s}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.canXOF=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Sc=(()=>{let e=((e,t,n)=>new xc(e,t).update(n).digest());return e.create=(e,t)=>new xc(e,t),e})(),Cc=BigInt(0),wc={Err:class extends Error{constructor(e=``){super(e)}},_tlv:{encode:(e,t)=>{let{Err:n}=wc;if(So(e,`tag`),e<0||e>255)throw new n(`tlv.encode: wrong tag`);if(co(t,`data`),t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=Co(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?Co(i.length/2|128):``;return Co(e)+a+i+t},decode(e,t){let{Err:n}=wc;t=z(t,void 0,`DER data`);let r=0;if(e<0||e>255)throw new n(`tlv.decode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=wc;if(xo(e),e<Cc)throw new t(`integer: negative integers are not allowed`);let n=Co(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=wc;if(e.length<1)throw new t(`invalid signature integer: empty`);if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return To(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=wc,i=z(e,void 0,`signature`),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=wc;Io(e,{r:`bigint`,s:`bigint`},{},`sig`);let r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Tc=(Object.freeze(wc._tlv),Object.freeze(wc._int),Object.freeze(wc)),Ec=(e,t)=>(e+(e>=0?t:-t)/Mc)/t;function Dc(e,t,n){Mo(`scalar`,e,Ac,n);let[[r,i],[a,o]]=t,s=Ec(o*e,n),c=Ec(-i*e,n),l=e-s*r-c*a,u=-s*i-c*o,d=l<Ac,f=u<Ac;d&&(l=-l),f&&(u=-u);let p=Po(Math.ceil(No(n)/2))+jc;if(l<Ac||l>=p||u<Ac||u>=p)throw Error(`splitScalar (endomorphism): failed for k`);return{k1neg:d,k1:l,k2neg:f,k2:u}}function Oc(e){if(![`compact`,`recovered`,`der`].includes(e))throw Error(`Signature format must be "compact", "recovered", or "der"`);return e}function kc(e,t){Io(e);let n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return bo(n.lowS,`lowS`),bo(n.prehash,`prehash`),n.format!==void 0&&Oc(n.format),n}var Ac=BigInt(0),jc=BigInt(1),Mc=BigInt(2),Nc=BigInt(3),Pc=BigInt(4);function Fc(e,t={}){let n=zs(`weierstrass`,e,t),r=n.Fp,i=n.Fn,a=n.CURVE,{h:o,n:s}=a;Io(t,{},{allowInfinityPoint:`boolean`,clearCofactor:`function`,isTorsionFree:`function`,fromBytes:`function`,toBytes:`function`,endo:`object`,randomBytes:`function`});let{endo:c,allowInfinityPoint:l}=t,u=t.randomBytes===void 0?go:t.randomBytes;if(c&&(!r.is0(a.a)||typeof c.beta!=`bigint`||!Array.isArray(c.basises)))throw Error(`invalid endo: expected "beta": bigint and "basises": array`);let d=Lc(r,i);function f(){if(!r.isOdd)throw Error(`compression is not supported: Field does not have .isOdd()`)}function p(e,t,n){if(l&&t.is0())return Uint8Array.of(0);let{x:i,y:a}=t.toAffine(),o=r.toBytes(i);return bo(n,`isCompressed`),n?(f(),po(Ic(!r.isOdd(a)),o)):po(Uint8Array.of(4),o,r.toBytes(a))}function m(e){z(e,void 0,`Point`);let{publicKey:t,publicKeyUncompressed:n}=d,i=e.length,a=e[0],o=e.subarray(1);if(l&&i===1&&a===0)return{x:r.ZERO,y:r.ZERO};if(i===t&&(a===2||a===3)){let e=r.fromBytes(o);if(!r.isValid(e))throw Error(`bad point: is not on curve, wrong x`);let t=y(e),n;try{n=r.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`bad point: is not on curve, sqrt error`+t)}f();let i=r.isOdd(n);return(a&1)==1!==i&&(n=r.neg(n)),{x:e,y:n}}if(i===n&&a===4){let e=r.BYTES,t=r.fromBytes(o.subarray(0,e)),n=r.fromBytes(o.subarray(e,e*2));if(!b(t,n))throw Error(`bad point: is not on curve`);return{x:t,y:n}}throw Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${n}`)}let h=t.toBytes===void 0?p:t.toBytes,g=t.fromBytes===void 0?m:t.fromBytes,_=r.mul(a.b,Nc),v=r.is0(a.a)?e=>r.ZERO:e=>r.mul(a.a,e);function y(e){let t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function b(e,t){let n=r.sqr(t),i=y(e);return r.eql(n,i)}if(!b(a.Gx,a.Gy))throw Error(`bad curve params: generator point`);let x=r.mul(r.pow(a.a,Nc),Pc),S=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(x,S)))throw Error(`bad curve params: a or b`);function C(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function w(e){if(!(e instanceof D))throw Error(`Weierstrass Point expected`)}function T(e){if(!c||!c.basises)throw Error(`no endo`);return Dc(e,c.basises,i.ORDER)}function E(e,t,n,a){if(!i.isValid(a))throw RangeError(`invalid scalar: out of range`);if(c){let{k1neg:i,k1:o,k2neg:s,k2:l}=T(a),u=new D(r.mul(n.X,c.beta),n.Y,n.Z);e.push(i?n.negate():n,s?u.negate():u),t.push(o,l)}else e.push(n),t.push(a)}let ee=new WeakSet;class D{static BASE=new D(a.Gx,a.Gy,r.ONE);static ZERO=new D(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(e,t,n){this.X=C(`x`,e),this.Y=C(`y`,t,!0),this.Z=C(`z`,n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error(`invalid affine point`);if(e instanceof D)throw Error(`projective point not allowed`);return r.is0(t)&&r.is0(n)?D.ZERO:new D(t,n,r.ONE)}static fromBytes(e){let t=D.fromAffine(g(z(e,void 0,`point`)));return t.assertValidity(),t}static fromHex(e){return D.fromBytes(mo(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=6,t=!0){return O.setWindowSize(this,e),t||this.multiply(Nc),this}assertValidity(){let e=this;if(e.is0()){if(t.allowInfinityPoint&&r.is0(e.X)&&r.eql(e.Y,r.ONE)&&r.is0(e.Z))return;throw Error(`bad point: ZERO`)}if(ee.has(e))return;let{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error(`bad point: x or y not field elements`);if(!b(n,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);ee.add(e)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error(`Field doesn't support isOdd`);return!r.isOdd(e)}equals(e){w(e);let{X:t,Y:n,Z:i}=this,{X:a,Y:o,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(a,i)),l=r.eql(r.mul(n,s),r.mul(o,i));return c&&l}negate(){return new D(this.X,r.neg(this.Y),this.Z)}double(){let{X:e,Y:t,Z:n}=this,i=r.ZERO,a=r.ZERO,o=r.ZERO,s=r.mul(e,e),c=r.mul(t,t),l=r.mul(n,n),u=r.mul(e,t);return u=r.add(u,u),o=r.mul(e,n),o=r.add(o,o),i=v(o),a=r.mul(_,l),a=r.add(i,a),i=r.sub(c,a),a=r.add(c,a),a=r.mul(i,a),i=r.mul(u,i),o=r.mul(_,o),l=v(l),u=r.sub(s,l),u=v(u),u=r.add(u,o),o=r.add(s,s),s=r.add(o,s),s=r.add(s,l),s=r.mul(s,u),a=r.add(a,s),l=r.mul(t,n),l=r.add(l,l),s=r.mul(l,u),i=r.sub(i,s),o=r.mul(l,c),o=r.add(o,o),o=r.add(o,o),new D(i,a,o)}add(e){w(e);let{X:t,Y:n,Z:i}=this,{X:a,Y:o,Z:s}=e,c=r.ZERO,l=r.ZERO,u=r.ZERO,d=r.mul(t,a),f=r.mul(n,o),p=r.mul(i,s),m=r.add(t,n),h=r.add(a,o);m=r.mul(m,h),h=r.add(d,f),m=r.sub(m,h),h=r.add(t,i);let g=r.add(a,s);return h=r.mul(h,g),g=r.add(d,p),h=r.sub(h,g),g=r.add(n,i),c=r.add(o,s),g=r.mul(g,c),c=r.add(f,p),g=r.sub(g,c),u=v(h),c=r.mul(_,p),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),l=r.mul(c,u),f=r.add(d,d),f=r.add(f,d),p=v(p),h=r.mul(_,h),f=r.add(f,p),p=r.sub(d,p),p=v(p),h=r.add(h,p),d=r.mul(f,h),l=r.add(l,d),d=r.mul(g,h),c=r.mul(m,c),c=r.sub(c,d),d=r.mul(m,f),u=r.mul(g,u),u=r.add(u,d),new D(c,l,u)}subtract(e){return w(e),this.add(e.negate())}is0(){return this.equals(D.ZERO)}multiply(e){if(!i.isValidNot0(e))throw RangeError(`invalid scalar: out of range`);let{p:t,f:n}=O.mulSecret(this,e,o,te);return te([t,n])[0]}multiplyUnsafe(e){let t=this,n=e;if(!i.isValid(n))throw RangeError(`invalid scalar: out of range`);if(n===Ac||t.is0())return D.ZERO;if(n===jc)return t;if(O.hasWindowSize(this))return O.mulUnsafe(t,n,te);let r=[],a=[];return E(r,a,t,n),Ls(D,r,a)}mulAddUnsafe(e,t,n){w(t);let r=[],i=[];return E(r,i,this,e),E(r,i,t,n),Ls(D,r,i)}toAffine(e){let t=this,n=e;if(n!=null&&!r.isValid(n))throw RangeError(`"invertedZ" expected valid field element`);let{X:i,Y:a,Z:o}=t;if(r.eql(o,r.ONE))return{x:i,y:a};let s=t.is0();n??=s?r.ONE:r.inv(o);let c=r.mul(i,n),l=r.mul(a,n),u=r.mul(o,n);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw Error(`invZ was invalid`);return{x:c,y:l}}isTorsionFree(){let{isTorsionFree:e}=t;return o===jc?!0:e?e(D,this):O.mulUnsafe(this,s).is0()}clearCofactor(){let{clearCofactor:e}=t;return o===jc?this:e?e(D,this):this.multiplyUnsafe(o)}isSmallOrder(){return o===jc?this.is0():this.clearCofactor().is0()}toBytes(e=!0){return bo(e,`isCompressed`),this.assertValidity(),h(D,this,e)}toHex(e=!0){return fo(this.toBytes(e))}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}let te=e=>ws(D,e),O=new Is(D,u);return O.bits>=6&&D.BASE.precompute(6),Object.freeze(D.prototype),Object.freeze(D),D}function Ic(e){return Uint8Array.of(e?2:3)}function Lc(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Rc(e,t={}){Cs(e);let{Fn:n}=e,r=t.randomBytes===void 0?go:t.randomBytes,i=Object.assign(Lc(e.Fp,n),{seed:Math.max(ms(n.ORDER),16)});function a(e){try{let t=n.fromBytes(e);return n.isValidNot0(t)}catch{return!1}}function o(t,n){let{publicKey:r,publicKeyUncompressed:a}=i;try{let i=t.length;return n===!0&&i!==r||n===!1&&i!==a?!1:!!e.fromBytes(t)}catch{return!1}}function s(e){return e=e===void 0?r(i.seed):e,hs(z(e,i.seed,`seed`),n.ORDER)}function c(t,r=!0){return e.BASE.multiply(n.fromBytes(t)).toBytes(r)}function l(e){let{secretKey:t,publicKey:r,publicKeyUncompressed:a}=i,o=n._lengths;if(!ho(e))return;let s=z(e,void 0,`key`).length,c=s===r||s===a,l=s===t||!!o?.includes(s);if(!(c&&l))return c}function u(t,r,i=!0){if(l(t)===!0)throw Error(`first arg must be private key`);if(l(r)===!1)throw Error(`second arg must be public key`);let a=n.fromBytes(t);return e.fromBytes(r).multiply(a).toBytes(i)}let d={isValidSecretKey:a,isValidPublicKey:o,randomSecretKey:s},f=Bs(s,c);return Object.freeze(d),Object.freeze(i),Object.freeze({getPublicKey:c,getSharedSecret:u,keygen:f,Point:e,utils:d,lengths:i})}function zc(e,t,n={}){Cs(e);let r=t;Gn(r),Io(n,{},{hmac:`function`,lowS:`boolean`,randomBytes:`function`,bits2int:`function`,bits2int_modN:`function`});let i=Object.assign({},n),a=i.randomBytes===void 0?go:i.randomBytes,o=i.hmac===void 0?(e,t)=>Sc(r,e,t):i.hmac,{Fp:s,Fn:c}=e,{ORDER:l,BITS:u}=c,d=ms(l),f=Ds(a,d),{keygen:p,getPublicKey:m,getSharedSecret:h,utils:g,lengths:_}=Rc(e,i),v={prehash:!0,lowS:typeof i.lowS!=`boolean`||i.lowS,format:`compact`,extraEntropy:!1},y=l*Mc+jc<s.ORDER;function b(e){return e>l>>jc}function x(e,t){if(!c.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function S(){if(!s.isOdd)throw Error(`Field doesn't support isOdd`)}function C(e,t,n){return S(),(e===n?0:2)|Number(s.isOdd(t))}function w(){if(y)throw Error(`"recovered" sig type is not supported for cofactor >2 curves`)}function T(e,t){Oc(t);let n=_.signature;return z(e,t===`compact`?n:t===`recovered`?n+1:void 0)}class E{r;s;recovery;constructor(e,t,n){if(this.r=x(`r`,e),this.s=x(`s`,t),n!=null){if(w(),![0,1,2,3].includes(n))throw Error(`invalid recovery id`);this.recovery=n}Object.freeze(this)}static fromBytes(e,t=v.format){T(e,t);let n;if(t===`der`){let{r:t,s:n}=Tc.toSig(z(e));return new E(t,n)}t===`recovered`&&(n=e[0],t=`compact`,e=e.subarray(1));let r=_.signature/2,i=e.subarray(0,r),a=e.subarray(r,r*2);return new E(c.fromBytes(i),c.fromBytes(a),n)}static fromHex(e,t){return this.fromBytes(mo(e),t)}assertRecovery(){let{recovery:e}=this;if(e==null)throw Error(`invalid recovery id: must be present`);return e}addRecoveryBit(e){return new E(this.r,this.s,e)}recoverPublicKey(t){let{r:n,s:r}=this,i=this.assertRecovery(),a=i===2||i===3?n+l:n;if(!s.isValid(a))throw Error(`invalid recovery id: sig.r+curve.n != R.x`);let o=s.toBytes(a),u=e.fromBytes(po(Ic(!(i&1)),o)),d=c.inv(a),f=D(z(t,void 0,`msgHash`)),p=c.create(-f*d),m=c.create(r*d),h=e.BASE.mulAddUnsafe(p,u,m);if(h.is0())throw Error(`invalid recovery: point at infinify`);return h.assertValidity(),h}hasHighS(){return b(this.s)}toBytes(e=v.format){if(Oc(e),e===`der`)return mo(Tc.hexFromSig(this));let{r:t,s:n}=this,r=c.toBytes(t),i=c.toBytes(n);return e===`recovered`?(w(),po(Uint8Array.of(this.assertRecovery()),r,i)):po(r,i)}toHex(e){return fo(this.toBytes(e))}}Object.freeze(E.prototype),Object.freeze(E);let ee=i.bits2int===void 0?function(e){if(e.length>8192)throw Error(`input is too large`);let t=To(e),n=e.length*8-u;return n>0?t>>BigInt(n):t}:i.bits2int,D=i.bits2int_modN===void 0?function(e){return c.create(ee(e))}:i.bits2int_modN,te=Po(u);function O(e){return Mo(`num < 2^`+u,e,Ac,te),c.toBytes(e)}function ne(e,t){return z(e,void 0,`message`),t?z(r(e),void 0,`prehashed message`):e}function re(t,n,r){let{lowS:i,prehash:o,extraEntropy:s}=kc(r,v);t=ne(t,o);let u=D(t),p=c.fromBytes(n);if(!c.isValidNot0(p))throw Error(`invalid private key`);let m=[O(p),O(u)];if(s!=null&&s!==!1){let e=s===!0?a(_.secretKey):s;m.push(z(e,void 0,`extraEntropy`))}let h=po(...m),g=u;function x(t){let n=ee(t);if(!c.isValidNot0(n))return;let r=e.BASE.multiply(n).toAffine(),a=c.create(r.x);if(a===Ac)return;let o;if(f!==void 0){let e=To(hs(f(d),l)),t=c.inv(c.mul(e,n)),r=c.mul(e,g),i=c.mul(e,p);o=c.create(t*c.create(r+i*a))}else{let e=Xo(n,l);o=c.create(e*c.create(g+a*p))}if(o===Ac)return;let s=C(r.x,r.y,a),u=o;return i&&b(o)&&(u=c.neg(o),s^=1),new E(a,u,y?void 0:s)}return{seed:h,k2sig:x}}function ie(e,t,n={}){let{seed:i,k2sig:a}=re(e,t,n);return Fo(r.outputLen,c.BYTES,o)(i,a).toBytes(n.format)}function ae(t,n,r,i={}){let{lowS:a,prehash:o,format:s}=kc(i,v);if(r=z(r,void 0,`publicKey`),n=ne(n,o),!ho(t)){let e=t instanceof E?`, use sig.toBytes()`:``;throw Error(`verify expects Uint8Array signature`+e)}T(t,s);try{let i=E.fromBytes(t,s),o=e.fromBytes(r);if(a&&i.hasHighS())return!1;let{r:l,s:u}=i,d=D(n),f=c.inv(u),p=c.create(d*f),m=c.create(l*f),h=e.BASE.mulAddUnsafe(p,o,m);if(h.is0())return!1;let g=h.toAffine();return!(c.create(g.x)!==l||s===`recovered`&&i.recovery!==C(g.x,g.y,l))}catch{return!1}}function oe(e,t,n={}){let{prehash:r}=kc(n,v);return t=ne(t,r),E.fromBytes(e,`recovered`).recoverPublicKey(t).toBytes()}return Object.freeze({keygen:p,getPublicKey:m,getSharedSecret:h,utils:g,lengths:_,Point:e,sign:ie,verify:ae,recoverPublicKey:oe,Signature:E,hash:r})}var Bc=zc(Fc({p:BigInt(`0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff`),n:BigInt(`0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551`),h:BigInt(1),a:BigInt(`0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc`),b:BigInt(`0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b`),Gx:BigInt(`0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296`),Gy:BigInt(`0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5`)}),Tr),Vc=class extends Error{code=`invalid_relay_e2ee_input`;constructor(){super(`Relay E2EE input is invalid.`),this.name=`RelayE2eeValidationError`}};function U(){throw new Vc}var Hc=`ryco.node-key.v1`,Uc=`ryco.client-key.v1`,Wc=`ryco.e2ee-agreement-key.v1`,Gc=`ed25519`,Kc=`p256`,qc=`x25519`,Jc={"node-identity":Hc,"client-identity":Uc,agreement:Wc},Yc={"node-identity":Gc,"client-identity":Kc,agreement:qc};function Xc(e,t){return(!(e instanceof Uint8Array)||e.byteLength!==t)&&U(),Uint8Array.from(e)}function Zc(e){let t=0n;for(let n=0;n<e.byteLength;n+=1)t=t<<8n|BigInt(e[n]);return t}function Qc(e){let t=Xc(e,32);return yc.utils.isValidPublicKey(t,!1)||U(),t}function $c(e){let t=Xc(e,65);t[0]!==4&&U();let n=Bc.Point.Fp.ORDER,r=Zc(t.subarray(1,33)),i=Zc(t.subarray(33));(r>=n||i>=n)&&U();try{Bc.Point.fromBytes(t).is0()&&U()}catch{return U()}return t}function el(e){return Xc(e,32)}function tl(e,t){switch(e){case`node-identity`:return Qc(t);case`client-identity`:return $c(t);case`agreement`:return el(t);default:return U()}}function nl(e){return Xc(e,64)}function rl(e){let t=Xc(e,64),n=Bc.Point.Fn.ORDER,r=Zc(t.subarray(0,32)),i=Zc(t.subarray(32));return(r<1n||r>=n||i<1n||i>=n)&&U(),t}function il(e,t){let n=tl(e,t);return Tr(Ja([Jc[e],Yc[e],n],va))}function al(e,t){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}function ol(e){try{if(e.algorithm===`ed25519`){let t=Qc(e.publicKey),n=nl(e.signature);return yc.verify(n,e.message,t,{zip215:!1})}if(e.algorithm===`p256`){let t=$c(e.publicKey),n=rl(e.signature);return Bc.verify(n,Tr(e.message),t,{prehash:!1,lowS:!1,format:`compact`})}return!1}catch{return!1}}function sl(e){return e===1}function cl(e){return e===`c2n`||e===`n2c`}function ll(e){return e===1||e===2||e===3||e===4}function ul(e){return e===1||e===2||e===3}function dl(e){switch(e){case 1:return{maxBytes:en,exact:!1};case 2:return{maxBytes:tn,exact:!1};case 3:return{maxBytes:64,exact:!0}}}var fl=123,pl=91,ml=Object.freeze({kind:`envelope`}),hl=Object.freeze({kind:`negotiation`}),gl=Object.freeze({kind:`legacy-json`}),_l=Object.freeze({kind:`other`,reason:`empty`}),vl=Object.freeze({kind:`other`,reason:`unknown_discriminator`});function yl(e){if(e.byteLength===0)return _l;let t=e[0];return t===1?ml:t===2?hl:t===fl||t===pl?gl:vl}var bl=1,xl=2,Sl=3,Cl=7,wl=17;function Tl(e,t){if(typeof e!=`bigint`||e<0n||e>4294967295n)throw TypeError(`E2EE envelope epoch must be a bigint within the uint32 field range.`);if(typeof t!=`bigint`||t<0n||t>18446744073709551615n)throw TypeError(`E2EE envelope counter must be a bigint within the uint64 field range.`)}function El(e,t,n,r){let i=r;for(let r=n-1;r>=0;--r)e[t+r]=Number(i&255n),i>>=8n}function Dl(e,t,n){let r=0n;for(let i=0;i<n;i+=1)r=r<<8n|BigInt(e[t+i]);return r}function Ol(e,t){if(!sl(t.suite))throw TypeError(`E2EE envelope suite must be a registered suite id.`);Tl(t.epoch,t.counter),e[0]=1,e[bl]=1,e[xl]=t.suite,El(e,Sl,4,t.epoch),El(e,Cl,8,t.counter)}function kl(e){let t=new Uint8Array(15);return Ol(t,e),t}function Al(e){if(e.ciphertext.byteLength<wl)throw TypeError(`E2EE envelope ciphertext must cover the inner type byte and the tag.`);let t=new Uint8Array(15+e.ciphertext.byteLength);return Ol(t,e),t.set(e.ciphertext,15),t}function jl(e){if(e.byteLength===0||e[0]!==1)return{kind:`error`,reason:`bad_discriminator`};if(e.byteLength<32)return{kind:`error`,reason:`truncated`};if(e[bl]!==1)return{kind:`error`,reason:`unsupported_version`};let t=e[xl];return sl(t)?{kind:`ok`,value:{version:1,suite:t,epoch:Dl(e,Sl,4),counter:Dl(e,Cl,8),header:e.subarray(0,15),ciphertext:e.subarray(15)}}:{kind:`error`,reason:`unsupported_suite`}}function Ml(e,t){Tl(e,t);let n=new Uint8Array(12);return El(n,0,4,e),El(n,4,8,t),n}function Nl(e){if(e.byteLength!==15)throw TypeError(`E2EE AEAD nonce requires the exact envelope header.`);return e.subarray(Sl,15)}function Pl(e){if(e.header.byteLength!==15)throw TypeError(`E2EE AAD requires the exact envelope header.`);if(e.sessionBindingHash.byteLength!==32)throw TypeError(`E2EE AAD requires a full-length session binding hash.`);let t=new Uint8Array(50);return t.set(e.header),t.set(e.sessionBindingHash,15),t.set(Fl(e.direction),47),t}function Fl(e){if(!cl(e))throw TypeError(`E2EE direction must be a registered direction label.`);let t=new Uint8Array(3);for(let n=0;n<3;n+=1)t[n]=e.charCodeAt(n);return t}function Il(e,t){if(!ll(e))throw TypeError(`E2EE inner record type must be a registered type.`);let n=new Uint8Array(1+t.byteLength);return n[0]=e,n.set(t,1),n}function Ll(e){if(e.byteLength<1)return{kind:`error`,reason:`truncated`};let t=e[0];return ll(t)?{kind:`ok`,value:{innerType:t,body:e.subarray(1)}}:{kind:`error`,reason:`reserved_inner_type`}}var Rl=2,zl=Ja(new Uint8Array(60),va);function Bl(e,t){if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}function Vl(e,t){if(!ul(e))throw TypeError(`E2EE negotiation record type must be a registered type.`);let n=Rl+t.byteLength,r=dl(e);if(r.exact?n!==r.maxBytes:n>r.maxBytes)throw RangeError(`E2EE negotiation record exceeds the bound its type fixes.`);if(e===3&&!Bl(t,zl))throw TypeError(`E2EE handshake reject records are byte-identical; this body is not.`);let i=new Uint8Array(n);return i[0]=2,i[1]=e,i.set(t,Rl),i}function Hl(e){if(e.byteLength===0||e[0]!==2)return{kind:`error`,reason:`bad_discriminator`};if(e.byteLength<Rl)return{kind:`error`,reason:`truncated`};let t=e[1];if(!ul(t))return{kind:`error`,reason:`reserved_record_type`};let n=dl(t);if(e.byteLength>n.maxBytes)return{kind:`error`,reason:`too_large`};if(n.exact&&e.byteLength!==n.maxBytes)return{kind:`error`,reason:`length_mismatch`};let r=e.subarray(Rl);return t===3&&!Bl(r,zl)?{kind:`error`,reason:`non_canonical_reject`}:{kind:`ok`,value:{recordType:t,body:r}}}var Ul=[`_tag`,`statement`],Wl=new TextDecoder,Gl=new TextEncoder;function Kl(e){if(e.byteLength===0||e[0]!==fl)return{kind:`error`,reason:`not_carrier`};let t;try{t=JSON.parse(Wl.decode(e))}catch{return{kind:`error`,reason:`not_carrier`}}if(typeof t!=`object`||!t||Array.isArray(t))return{kind:`error`,reason:`not_carrier`};let n=t;if(n._tag!==`ryco.e2ee.capability.v1`)return{kind:`error`,reason:`not_carrier`};if(e.byteLength>6969)return{kind:`error`,reason:`malformed`};let r=Object.keys(n);if(r.length!==Ul.length||Ul.some((e,t)=>r[t]!==e))return{kind:`error`,reason:`malformed`};let i=n.statement;if(typeof i!=`string`||i.length===0||!Bl(Gl.encode(JSON.stringify({_tag:`ryco.e2ee.capability.v1`,statement:i})),e))return{kind:`error`,reason:`malformed`};let a=Jl(i);return a===void 0?{kind:`error`,reason:`malformed`}:{kind:`ok`,value:a}}var ql=new Map([...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`].map((e,t)=>[e,t]));function Jl(e){if(e.length%4==1)return;let t=new Uint8Array(Math.floor(e.length*3/4)),n=0,r=0,i=0;for(let a of e){let e=ql.get(a);if(e===void 0)return;n=n<<6|e,r+=6,r>=8&&(r-=8,t[i]=n>>r&255,n&=(1<<r)-1,i+=1)}if(!(r>0&&n&(1<<r)-1))return t}var Yl=`ryco.node-e2ee-prekey.v1`,Xl=`ryco.node-e2ee-capability-digest.v1`,Zl=`ryco.relay-e2ee.context.v1`,Ql=`ryco.relay-e2ee.prologue.v1`,$l=`25519`,eu=`SHA256`;function tu(e){return e===`native`?`IK`:`NX`}function nu(e){return e?[`IK`]:[`IK`,`NX`]}var ru={allowIndefinite:!1,allowUndefined:!1,allowInfinity:!1,allowNaN:!1,allowBigInt:!1,strict:!0,useMaps:!0,rejectDuplicateMapKeys:!0,tags:{}};function iu(e){let t=new Xa(e,ru);for(;!t.done();)if(j.equals(t.next().type,j.float))return!0;return!1}function au(e){if(!(e instanceof Uint8Array)||e.byteLength===0)return{kind:`error`,reason:`malformed`};let t;try{t=ao(e,ru)}catch{return{kind:`error`,reason:`malformed`}}if(iu(e))return{kind:`error`,reason:`float_forbidden`};let n;try{n=Ja(t,va)}catch{return{kind:`error`,reason:`non_canonical`}}return al(n,e)?{kind:`ok`,value:t}:{kind:`error`,reason:`non_canonical`}}function ou(e){return Uint8Array.from(Ja(e,va))}var su=`[A-Za-z0-9_-]{22}`,cu=RegExp(`^node_${su}$`),lu=RegExp(`^nkey_${su}$`),uu=RegExp(`^epk_${su}$`),du=RegExp(`^nct_${su}$`),fu=new Set([`localhost`,`127.0.0.1`,`[::1]`]),pu=new TextEncoder,mu=l(ue),hu=l(r),gu=l(ct);function _u(e,t){return(typeof e!=`string`||!t.test(e))&&U(),e}function vu(e){return(!Number.isSafeInteger(e)||e<0)&&U(),e}function yu(e){return(!Number.isSafeInteger(e)||e<0||e>65535)&&U(),e}function bu(e){(typeof e!=`string`||e.length===0||e.length>512)&&U();let t;try{t=new URL(e)}catch{return U()}let n=t.protocol===`http:`&&fu.has(t.hostname);return(t.protocol!==`https:`&&!n||t.username!==``||t.password!==``||t.pathname!==`/`||t.search!==``||t.hash!==``||e!==t.origin)&&U(),pu.encode(t.origin).byteLength>128&&U(),t.origin}function xu(e){(typeof e!=`string`||e.length===0)&&U();let t=pu.encode(e).byteLength;return(t===0||t>256)&&U(),e}function Su(e){return v(mu(e))&&U(),e}function Cu(e){return v(hu(e))&&U(),e}function wu(e){return v(gu(e))&&U(),e}function Tu(e){return sl(e)||U(),e}function Eu(e){return(!(e instanceof Uint8Array)||e.byteLength!==32)&&U(),Uint8Array.from(e)}function Du(e){return e.byteLength>1024&&U(),e}function Ou(e,t){let n=bu(e.hubOrigin),r=_u(e.nodeId,cu),i=_u(e.identityKeyId,lu),a=_u(e.prekeyId,uu),o=Qc(e.identityPublicKey);return Du(ou([Yl,n,r,Gc,i,a,o,t===void 0?il(`node-identity`,o):Eu(t),el(e.agreementPublicKey),$l,eu,vu(e.createdAt),vu(e.expiresAt)]))}var ku=13;function Au(e){return typeof e==`string`}function ju(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Mu(e,t){return e instanceof Uint8Array&&e.byteLength===t}function Nu(e){let t=au(e);if(t.kind===`error`)return t;let n=t.value;if(!Array.isArray(n)||n.length!==ku)return{kind:`error`,reason:`malformed`};let[r,i,a,o,s,c,l,u,d,f,p,m,h]=n;if(r!==`ryco.node-identity-continuity.v1`||s!==`ed25519`||d!==`ed25519`||!Au(i)||!Au(a)||!ju(o)||!Au(c)||!Au(f)||!Mu(l,32)||!Mu(u,32)||!Mu(p,32)||!Mu(m,32)||!ju(h)||!lu.test(c)||!lu.test(f)||!du.test(a)||o<1)return{kind:`error`,reason:`malformed`};let g,_;try{g=il(`node-identity`,l),_=il(`node-identity`,p)}catch{return{kind:`error`,reason:`malformed`}}return!al(g,u)||!al(_,m)?{kind:`error`,reason:`malformed`}:{kind:`ok`,value:{hubOrigin:i,continuityId:a,generation:o,oldKeyId:c,oldPublicKey:l,oldFingerprint:u,newKeyId:f,newPublicKey:p,newFingerprint:m,createdAt:h}}}function Pu(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.transcript instanceof Uint8Array&&t.signature instanceof Uint8Array&&t.signature.byteLength===64}function Fu(e){if(!Array.isArray(e.chain))return{kind:`error`,failure:`malformed_entry`};if(e.chain.length>8)return{kind:`error`,failure:`chain_too_long`};let t,n;try{t=Qc(e.identityPublicKey),n=il(`node-identity`,t)}catch{return{kind:`error`,failure:`invalid_identity_key`}}let r=[],i;for(let t of e.chain){if(!Pu(t))return{kind:`error`,failure:`malformed_entry`};let n=Nu(t.transcript);if(n.kind===`error`)return{kind:`error`,failure:`malformed_entry`};let a=n.value;if(a.hubOrigin!==e.hubOrigin)return{kind:`error`,failure:`hub_origin_mismatch`};if(a.continuityId!==e.continuityId)return{kind:`error`,failure:`continuity_id_mismatch`};if(i!==void 0){if(a.generation!==i.generation+1)return{kind:`error`,failure:`generation_not_consecutive`};if(!al(a.oldPublicKey,i.newPublicKey)||!al(a.oldFingerprint,i.newFingerprint))return{kind:`error`,failure:`link_mismatch`}}if(!ol({algorithm:`ed25519`,publicKey:a.oldPublicKey,message:t.transcript,signature:t.signature}))return{kind:`error`,failure:`invalid_signature`};r.push(a),i=a}if(i!==void 0&&!al(i.newPublicKey,t))return{kind:`error`,failure:`identity_key_mismatch`};let a=e.pinnedIdentityFingerprint;return a===void 0?{kind:`ok`,certificates:r}:al(a,n)?{kind:`ok`,certificates:r,pinnedFingerprintUnchanged:!0}:r.some(e=>al(e.oldFingerprint,a))?{kind:`ok`,certificates:r,pinnedFingerprintUnchanged:!1}:{kind:`error`,failure:`pin_not_reached`}}var Iu=2,Lu=19,Ru=6,zu=2,Bu=255;function Vu(e){return e===`non_canonical`?`statement_non_canonical`:e===`float_forbidden`?`statement_float_forbidden`:`statement_malformed`}function Hu(e){return e===`non_canonical`?`transcript_non_canonical`:e===`float_forbidden`?`transcript_float_forbidden`:`transcript_malformed`}function W(e){return{kind:`error`,failure:e}}function Uu(e){return ju(e)&&e<=65535}function Wu(e){if(!Array.isArray(e)||e.length!==Ru)return;let[t,n,r,i,a,o]=e;if(!(!Au(t)||!uu.test(t)||!Mu(n,32)||!Mu(r,64)||!Mu(i,32)||!ju(a)||!ju(o)))return{prekeyId:t,agreementPublicKey:n,crossSignature:r,agreementFingerprint:i,createdAt:a,expiresAt:o}}function Gu(e){if(!Array.isArray(e)||e.length!==zu)return;let[t,n]=e;if(!(!(t instanceof Uint8Array)||t.byteLength===0||t.byteLength>1024||!Mu(n,64)))return{transcript:t,signature:n}}function Ku(e){if(!(e instanceof Uint8Array))return W(`statement_malformed`);if(e.byteLength>5190)return W(`statement_too_large`);let t=au(e);if(t.kind===`error`)return W(Vu(t.reason));if(!Array.isArray(t.value)||t.value.length!==Iu)return W(`statement_malformed`);let[n,r]=t.value;if(!(n instanceof Uint8Array)||n.byteLength===0)return W(`statement_malformed`);if(n.byteLength>5120)return W(`transcript_too_large`);if(!Mu(r,64))return W(`statement_malformed`);let i=au(n);if(i.kind===`error`)return W(Hu(i.reason));if(!Array.isArray(i.value)||i.value.length!==Lu)return W(`transcript_malformed`);let[a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C]=i.value;if(a!==`ryco.node-e2ee-capability.v1`||c!==`ed25519`||!Au(o)||!Au(s)||!cu.test(s)||!Au(l)||!lu.test(l)||!Mu(u,32)||!Mu(d,32)||!Uu(f)||!Uu(p)||typeof _!=`boolean`||typeof v!=`boolean`||!ju(b)||!ju(x)||!ju(S)||!Au(C)||!du.test(C))return W(`transcript_malformed`);if(pu.encode(o).byteLength>128)return W(`hub_origin_too_long`);try{bu(o)}catch{return W(`transcript_malformed`)}if(!Array.isArray(m)||m.length===0)return W(`transcript_malformed`);if(m.length>8)return W(`suite_registry_too_large`);if(!m.every(e=>ju(e)&&e<=Bu)||!Array.isArray(g))return W(`transcript_malformed`);if(g.length>8)return W(`continuity_chain_too_long`);let w=[];for(let e of g){let t=Gu(e);if(t===void 0)return W(`transcript_malformed`);w.push(t)}let T=Wu(h);if(T===void 0)return W(`transcript_malformed`);let E=nu(v);return!Array.isArray(y)||y.length!==E.length||!E.every((e,t)=>y[t]===e)?W(`transcript_malformed`):{kind:`ok`,value:{transcript:n,signature:r,hubOrigin:o,nodeId:s,identityKeyId:l,identityPublicKey:u,identityFingerprint:d,e2eeVersionMin:f,e2eeVersionMax:p,suiteRegistry:m,prekeyCertificate:T,continuityChain:w,requireE2EE:_,requireApprovedClientE2EE:v,admittedPatterns:E,policyGeneration:b,issuedAt:x,expiresAt:S,continuityId:C}}}function qu(e){(!(e instanceof Uint8Array)||e.byteLength===0||e.byteLength>5120)&&U();let t=Tr(e);t.byteLength!==32&&U();let n=ou([Xl,t]);return n.byteLength!==72&&U(),n}function Ju(e){let t=bu(e.hubOrigin),n=wu(e.channelId),r=yu(e.relayProtocolMajor),i=yu(e.relayProtocolMinor);e.e2eeVersion!==1&&U();let a=Tu(e.suiteId),o=_u(e.nodeId,cu),s=Eu(e.nodeIdentityFingerprint),c=Su(e.clientIntendedCapability),l=Cu(e.clientIntendedRole),u=Su(e.channelOpenCapability),d=Cu(e.channelOpenEffectiveRole),f=_u(e.nodeContinuityId,du);(!Array.isArray(e.nodeContinuityChainTranscripts)||e.nodeContinuityChainTranscripts.length>8)&&U();let p=[Eu(e.nodeAgreementFingerprint)];for(let t of e.nodeContinuityChainTranscripts)(!(t instanceof Uint8Array)||t.byteLength===0)&&U(),p.push(Tr(t));return ou([Zl,t,n,r,i,1,a,o,Gc,s,e.client.tier===`native`?xu(e.client.accountId):``,c,l,u,d,p,e.client.tier===`native`?[Eu(e.client.identityFingerprint),Eu(e.client.agreementFingerprint)]:[],f])}function Yu(e){(!(e instanceof Uint8Array)||e.byteLength===0)&&U();let t=Tr(e);return t.byteLength!==32&&U(),t}function Xu(e){let t=bu(e.hubOrigin),n=wu(e.channelId),r=yu(e.relayProtocolMajor),i=yu(e.relayProtocolMinor);e.e2eeVersion!==1&&U();let a=Tu(e.suiteId),o=_u(e.nodeId,cu);return(!(e.contextCommitment instanceof Uint8Array)||e.contextCommitment.byteLength!==32)&&U(),ou([Ql,t,n,r,i,1,a,o,Uint8Array.from(e.contextCommitment)])}function Zu(e){let t;try{if(t=Ou({hubOrigin:e.hubOrigin,nodeId:e.nodeId,identityKeyId:e.identityKeyId,prekeyId:e.prekeyCertificate.prekeyId,identityPublicKey:e.identityPublicKey,agreementPublicKey:e.prekeyCertificate.agreementPublicKey,createdAt:e.prekeyCertificate.createdAt,expiresAt:e.prekeyCertificate.expiresAt},e.identityFingerprint),!al(il(`node-identity`,e.identityPublicKey),e.identityFingerprint)||!al(il(`agreement`,e.prekeyCertificate.agreementPublicKey),e.prekeyCertificate.agreementFingerprint))return!1}catch{return!1}return ol({algorithm:Gc,publicKey:e.identityPublicKey,message:t,signature:e.prekeyCertificate.crossSignature})}var Qu={[Qe.read]:`viewer`,[Qe.subscribeEvents]:`viewer`,[Qe.lifecycle]:`owner`,[Qe.input]:`owner`,[Qe.app]:`owner`,[Qe.recording]:`owner`,[k.acceptProposal]:`owner`,[k.getProposal]:`owner`,[k.listProposals]:`owner`,[k.rejectProposal]:`owner`,[k.subscribeProposals]:`owner`,[k.listIntegrations]:`owner`,[k.createIntegration]:`owner`,[k.updateIntegration]:`owner`,[k.resumeIntegrationPairing]:`owner`,[k.revokeIntegration]:`owner`,[k.deleteIntegration]:`owner`,[k.listMcpInstallations]:`owner`,[k.connectMcpInstallation]:`owner`,[k.repairMcpInstallation]:`owner`,[k.disconnectMcpInstallation]:`owner`,[A.atlassianDisconnect]:`owner`,[A.atlassianGetProjectLink]:`owner`,[A.atlassianListConnections]:`owner`,[A.atlassianListResources]:`owner`,[A.atlassianRefresh]:`owner`,[A.atlassianSaveManualBitbucketToken]:`owner`,[A.atlassianSaveManualJiraToken]:`owner`,[A.atlassianSaveProjectLink]:`owner`,[A.atlassianStartOAuth]:`owner`,[A.filesystemBrowse]:`operator`,[A.gitArchiveWorktree]:`operator`,[A.gitCreateWorktreeForProject]:`operator`,[A.gitDeleteWorktree]:`operator`,[A.gitFindWorktreeForOrigin]:`operator`,[A.gitPreparePullRequestThread]:`operator`,[A.gitResolvePullRequest]:`operator`,[A.gitRestoreWorktree]:`operator`,[A.gitRunStackedAction]:`operator`,[A.keybindingsReplaceCustom]:`owner`,[A.mcpListServers]:`owner`,[A.mcpListWorkspaces]:`owner`,[A.mcpReloadServers]:`owner`,[A.mcpRemoveServer]:`owner`,[A.mcpSetServerEnabled]:`owner`,[A.mcpStartOauthLogin]:`owner`,[A.mcpUpsertServer]:`owner`,[b.dispatchCommand]:`operator`,[b.getFullThreadDiff]:`viewer`,[b.getTurnDiff]:`viewer`,[b.getTaskOutput]:`operator`,[b.getThreadHistoryPage]:`viewer`,[b.getThreadWindow]:`viewer`,[b.getWorkflowScript]:`operator`,[b.stopBackgroundTask]:`operator`,[b.replayEvents]:`viewer`,[b.replayEventsPage]:`viewer`,[b.searchThreadMessages]:`viewer`,[b.subscribeShell]:`viewer`,[b.subscribeThread]:`viewer`,[b.subscribeThreadWindow]:`viewer`,[O.getInspectionSummary]:`viewer`,[O.listInspectionEntries]:`viewer`,[O.readRawPayloadChunk]:`viewer`,[O.readExportChunk]:`viewer`,[A.projectsAdd]:`operator`,[A.projectsInitializeGit]:`operator`,[A.projectsList]:`viewer`,[A.projectsListEntries]:`operator`,[A.projectsReadFile]:`operator`,[A.projectsReadFileBinary]:`operator`,[A.projectsRemove]:`operator`,[A.projectsSearchEntries]:`operator`,[A.projectsStageFileReference]:`operator`,[A.projectsWriteFile]:`operator`,[A.serverCheckOpinionatedPlugins]:`owner`,[A.serverDiscoverSourceControl]:`owner`,[A.serverGetAdvertisedEndpoints]:`viewer`,[A.serverGetConfig]:`viewer`,[A.serverGetDiagnosticsMetrics]:`owner`,[A.serverGetDiagnosticsSnapshot]:`owner`,[A.serverGetSettings]:`viewer`,[A.serverGetStatistics]:`owner`,[A.serverGetUsageSummary]:`owner`,[A.serverInstallOpinionatedPlugin]:`owner`,[A.serverListOpinionatedPlugins]:`owner`,[A.serverRefreshProviders]:`owner`,[A.serverUpdateProvider]:`owner`,[A.serverUpdateSettings]:`owner`,[A.serverUpsertKeybinding]:`owner`,[A.shellOpenInEditor]:`operator`,[A.sourceControlAddChangeRequestComment]:`operator`,[A.sourceControlAddChangeRequestCommentReaction]:`operator`,[A.sourceControlAddIssueComment]:`operator`,[A.sourceControlAddIssueCommentReaction]:`operator`,[A.sourceControlCloneRepository]:`operator`,[A.sourceControlCreateIssue]:`operator`,[A.sourceControlGetChangeRequestDetail]:`operator`,[A.sourceControlGetChangeRequestDiff]:`operator`,[A.sourceControlGetIssue]:`operator`,[A.sourceControlGetWorkflowJobLog]:`operator`,[A.sourceControlGetWorkflowRunJobs]:`operator`,[A.sourceControlListChangeRequests]:`operator`,[A.sourceControlListIssueAssignees]:`operator`,[A.sourceControlListIssueLabels]:`operator`,[A.sourceControlListIssues]:`operator`,[A.sourceControlListWorkflowRuns]:`operator`,[A.sourceControlLookupRepository]:`operator`,[A.sourceControlMergeChangeRequest]:`operator`,[A.sourceControlPublishRepository]:`operator`,[A.sourceControlRerunWorkflow]:`operator`,[A.sourceControlSearchChangeRequests]:`operator`,[A.sourceControlSearchIssues]:`operator`,[A.sourceControlSearchRepositories]:`operator`,[A.subscribeAuthAccess]:`direct_owner`,[A.subscribeServerConfig]:`viewer`,[A.subscribeServerLifecycle]:`viewer`,[A.subscribeTerminalEvents]:`operator`,[A.subscribeVcsStatus]:`operator`,[A.terminalClear]:`operator`,[A.terminalClose]:`operator`,[A.terminalOpen]:`operator`,[A.terminalResize]:`operator`,[A.terminalRestart]:`operator`,[A.terminalWrite]:`operator`,[A.textGenerationGenerateBranchName]:`operator`,[A.textGenerationGenerateIssueContent]:`operator`,[A.threadPriorityEnsureCurrent]:`operator`,[A.searchThreadMessages]:`owner`,[A.threadsSetManualBucket]:`operator`,[A.threadsSetManualPosition]:`operator`,[A.vcsCreateRef]:`operator`,[A.vcsCreateWorktree]:`operator`,[A.vcsInit]:`operator`,[A.vcsListRefs]:`operator`,[A.vcsPull]:`operator`,[A.vcsRefreshStatus]:`operator`,[A.vcsRemoveWorktree]:`operator`,[A.vcsSwitchRef]:`operator`,[A.workItemsAddComment]:`operator`,[A.workItemsEditComment]:`operator`,[A.workItemsGet]:`viewer`,[A.workItemsList]:`viewer`,[A.workItemsListProjects]:`viewer`,[A.workItemsListTransitions]:`viewer`,[A.workItemsSearch]:`viewer`,[A.workItemsTransition]:`operator`,[A.workItemsUpdate]:`operator`,[A.worktreesSetManualPosition]:`operator`};function $u(e){if(!Object.hasOwn(Qu,e))throw Error(`RPC method has no explicit access classification.`);return Qu[e]}var ed={viewer:1,operator:2,owner:3};function td(e,t,n=!0){if(!e||!n)return!1;let r=$u(t);return r===`authenticated`||r===`direct_owner`?!1:ed[e]>=ed[r]}var nd=new Set([`ble`,`cable`,`hybrid`,`internal`,`nfc`,`smart-card`,`usb`]);function G(){throw Error(`Invalid passkey options.`)}function rd(e){return(typeof e!=`object`||!e||Array.isArray(e))&&G(),e}function id(e){return(typeof e!=`string`||e.length===0)&&G(),e}function ad(e){if(e!==void 0)return(typeof e!=`number`||!Number.isSafeInteger(e)||e<0)&&G(),e}function od(e){try{return Ht(id(e))}catch{return G()}}function sd(e){if(e!==void 0)return Array.isArray(e)||G(),e.map(e=>{let t=rd(e);t.type!==`public-key`&&G();let n=t.transports;return n!==void 0&&!Array.isArray(n)&&G(),Array.isArray(n)&&n.some(e=>typeof e!=`string`||!nd.has(e))&&G(),{id:od(t.id),type:`public-key`,...Array.isArray(n)?{transports:n}:{}}})}function cd(e){if(e!==void 0)return e===`discouraged`||e===`preferred`||e===`required`?e:G()}function ld(e){if(e!==void 0)return rd(e)}function ud(e){let t=rd(e),n={challenge:od(t.challenge)},r=ad(t.timeout),i=t.rpId===void 0?void 0:id(t.rpId),a=sd(t.allowCredentials),o=cd(t.userVerification),s=ld(t.extensions);return r!==void 0&&(n.timeout=r),i!==void 0&&(n.rpId=i),a!==void 0&&(n.allowCredentials=a),o!==void 0&&(n.userVerification=o),s!==void 0&&(n.extensions=s),n}function dd(e){let t=rd(e),n=rd(t.rp),r=rd(t.user);(!Array.isArray(t.pubKeyCredParams)||t.pubKeyCredParams.length===0)&&G();let i=t.pubKeyCredParams.map(e=>{let t=rd(e);return(t.type!==`public-key`||typeof t.alg!=`number`||!Number.isSafeInteger(t.alg))&&G(),{type:`public-key`,alg:t.alg}}),a={challenge:od(t.challenge),rp:{name:id(n.name),...n.id===void 0?{}:{id:id(n.id)}},user:{id:od(r.id),name:id(r.name),displayName:id(r.displayName)},pubKeyCredParams:i},o=ad(t.timeout),s=sd(t.excludeCredentials),c=md(t.authenticatorSelection),l=hd(t.attestation),u=ld(t.extensions);return o!==void 0&&(a.timeout=o),s!==void 0&&(a.excludeCredentials=s),c!==void 0&&(a.authenticatorSelection=c),l!==void 0&&(a.attestation=l),u!==void 0&&(a.extensions=u),a}function fd(e){return ud(e)}function pd(e){return dd(e)}function md(e){if(e===void 0)return;let t=rd(e),n=t.authenticatorAttachment,r=t.residentKey,i=t.requireResidentKey,a=cd(t.userVerification);return n!==void 0&&n!==`platform`&&n!==`cross-platform`&&G(),r!==void 0&&r!==`discouraged`&&r!==`preferred`&&r!==`required`&&G(),i!==void 0&&typeof i!=`boolean`&&G(),{...n===void 0?{}:{authenticatorAttachment:n},...r===void 0?{}:{residentKey:r},...i===void 0?{}:{requireResidentKey:i},...a===void 0?{}:{userVerification:a}}}function hd(e){if(e!==void 0)return e===`none`||e===`indirect`||e===`direct`||e===`enterprise`?e:G()}var gd={authorization_rejected:`The Hub authorization request could not be verified.`,callback_rejected:`The browser response could not be verified.`,cancelled:`Authorization was cancelled.`,expired:`The authorization request expired. Try again.`,platform_invalid:`Secure browser authorization is unavailable on this device.`,superseded:`A newer authorization request replaced this one.`},_d=6e4,K=class extends Error{code;constructor(e){super(gd[e]),this.name=e===`cancelled`||e===`superseded`?`AbortError`:`NativeHandoffError`,this.code=e}},vd=new Map;function yd(e,t){return ot(e)(t,{onExcessProperty:`error`})}function bd(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t}async function xd(e){let t=await e.randomBytes(32);if(!(t instanceof Uint8Array)||t.byteLength!==32)throw new K(`platform_invalid`);return Uint8Array.from(t)}function Sd(e,t){let n=Math.max(e.length,t.length),r=e.length^t.length;for(let i=0;i<n;i+=1)r|=(e.charCodeAt(i)||0)^(t.charCodeAt(i)||0);return r===0}function Cd(e,t){let n=vd.get(e);n&&(n.superseded=!0),n?.controller.abort();let r={generation:(n?.generation??0)+1,controller:new AbortController,superseded:!1};vd.set(e,r);let i=()=>r.controller.abort();return t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0}),{active:r,isCurrent:()=>vd.get(e)===r&&!r.controller.signal.aborted,cleanup:()=>{t?.removeEventListener(`abort`,i),vd.get(e)===r&&vd.delete(e)}}}function wd(e,t){if(!t())throw new K(e.superseded?`superseded`:`cancelled`)}function Td(e,t){let n=e-t;if(n<-6e4)throw new K(`expired`);if(n>3e5+_d)throw new K(`authorization_rejected`)}function Ed(e,t){if(t-e>_d)throw new K(`expired`)}function Dd(e,t){let n;try{n=new URL(e)}catch{throw new K(`callback_rejected`)}if(n.searchParams.has(`error`)){try{yd(ye,{redirectUri:e})}catch{throw new K(`callback_rejected`)}let r=n.searchParams.get(`state`)??``,i=n.searchParams.get(`handoff_id`)??``;throw!Sd(r,t.state)||!Sd(i,t.handoffId)?new K(`callback_rejected`):new K(`cancelled`)}try{yd(Be,{redirectUri:e})}catch{throw new K(`callback_rejected`)}let r=`${n.protocol}//${n.host}${n.pathname}`,i=n.searchParams.get(`state`)??``,a=n.searchParams.get(`handoff_id`)??``;if(r!==t.callbackUri||!Sd(i,t.state)||!Sd(a,t.handoffId))throw new K(`callback_rejected`);return{code:n.searchParams.get(`code`)}}async function Od(e){let t;try{t=yd(Rt,e.callbackUri())}catch{throw new K(`callback_rejected`)}let n=e.deviceLabel().trim();if(n.length===0||Array.from(n).length>64)throw new K(`platform_invalid`);let r=Ut(await xd(e)),i=Ut(await xd(e)),a=await e.sha256(bd(i));if(!(a instanceof Uint8Array)||a.byteLength!==32)throw new K(`platform_invalid`);let o={callbackUri:t,codeChallenge:Ut(a),codeVerifier:i,deviceLabel:n,state:r};try{yd(lt,{redirectUri:o.callbackUri,codeChallenge:o.codeChallenge,codeChallengeMethod:`S256`,state:o.state,deviceLabel:o.deviceLabel})}catch{throw new K(`platform_invalid`)}return o}async function kd(e){let{active:t,isCurrent:n,cleanup:r}=Cd(e.coordinatorKey??e.origin,e.signal),a=e.now??Date.now;try{wd(t,n);let r=await Od(e.platform);wd(t,n);let o=yd(lt,{redirectUri:r.callbackUri,codeChallenge:r.codeChallenge,codeChallengeMethod:`S256`,state:r.state,deviceLabel:r.deviceLabel,...e.purpose?{purpose:e.purpose}:{}}),s;try{s=yd(i,await e.start(o,t.controller.signal))}catch(e){throw n()||wd(t,n),e instanceof K?e:new K(`authorization_rejected`)}let c=a(),l;try{l=new URL(s.authorizationUrl)}catch{throw new K(`authorization_rejected`)}if(l.origin!==new URL(e.origin).origin)throw new K(`authorization_rejected`);Td(s.expiresAt,c);let u=await e.platform.openSystemBrowser(s.authorizationUrl,r.callbackUri,t.controller.signal);if(wd(t,n),u.type!==`success`)throw new K(u.type===`locked`?`authorization_rejected`:`cancelled`);Ed(s.expiresAt,a());let{code:f}=Dd(u.url,{callbackUri:r.callbackUri,state:r.state,handoffId:s.handoffId});wd(t,n);let p;try{p=yd(e.redeemResponseSchema,await e.redeem(yd(e.redeemRequestSchema,e.buildRedeemRequest(yd(d,{handoffId:s.handoffId,code:f,codeVerifier:r.codeVerifier}))),t.controller.signal))}catch(e){throw n()||wd(t,n),e}return wd(t,n),p}finally{r()}}async function Ad(e){return kd({...e,redeemRequestSchema:d,redeemResponseSchema:de,buildRedeemRequest:e=>e})}var jd={accept:`application/json`,"content-type":`application/json`},Md=4096,Nd=256,Pd=256,Fd=100,Id=/^node_[A-Za-z0-9_-]{22,43}$/,Ld=/^[a-z0-9._-]{1,64}$/,Rd=256,zd=512,Bd=/^[A-Za-z0-9_-]{1,512}$/,Vd=/^pkey_[A-Za-z0-9_-]{22}$/,Hd=256,Ud=256,Wd=2048,Gd=254,Kd=256,qd=16,Jd=128,Yd=/^[A-Za-z0-9_-]{43}$/,Xd=`otpauth://`,Zd=3e4,Qd=[`/api/auth/native/bootstrap/registration/`,`/api/auth/native/invitations/registration/`];function $d(e){let t=e.toLowerCase();return Qd.some(e=>t.startsWith(e))}var ef=new Set([`set-password`,`remove-password`,`revoke-totp`,`request-email-verification`,`add-passkey`,`regenerate-recovery-codes`,`connect-external-identity`,`disconnect-external-identity`]),tf=new Set([`begin-totp-enrollment`,`confirm-totp-enrollment`]),nf=`step_up_required`,rf=`passkey_session_required`;function af(e,t,n){let r={code:e,wire:e,inferred:!1};return!n||e!==`forbidden`||t===void 0?r:ef.has(t)?{code:nf,wire:e,inferred:!0}:tf.has(t)?{code:rf,wire:e,inferred:!0}:r}var q=class extends Error{code;status;retryAfterMs;intent;wireCode;inferred;reason;constructor(e,t,n,r,i,a){super(a?sf(a).message:lf(e,r)),this.name=`HostedHubApiError`,this.code=e,this.status=t,this.retryAfterMs=n,this.intent=r,this.wireCode=i??e,this.inferred=i!==void 0&&i!==e,this.reason=a??null}},of={"missing-signer":{reason:`missing-signer`,title:`Secure session unavailable`,message:`Secure session signing is unavailable on this device. Restart the app, then try again.`,recovery:`restart-app`},"missing-token":{reason:`missing-token`,title:`Sign in again`,message:`This device no longer has its secure Hub session. Sign in again to continue.`,recovery:`sign-in`},"proof-signing-failed":{reason:`proof-signing-failed`,title:`Secure session could not be verified`,message:`This device could not verify its secure Hub session. Unlock the device and try again; if it continues, sign in again.`,recovery:`retry`},"token-invalidated":{reason:`token-invalidated`,title:`Session no longer valid`,message:`Your secure Hub session is no longer valid. Sign in again to continue.`,recovery:`sign-in`},"request-timeout":{reason:`request-timeout`,title:`Hub did not respond`,message:`The Hub did not respond in time. Check your connection and try again.`,recovery:`retry`},"transport-unavailable":{reason:`transport-unavailable`,title:`Hub could not be reached`,message:`Ryco could not reach the Hub. Check your connection and try again.`,recovery:`retry`}};function sf(e){return of[e]}function cf(e,t){if(e===`conflict`)switch(t){case`set-password`:return`That password has appeared in a known breach. Choose a different one.`;case`revoke-passkey`:return`That is the only passkey left on this account. Add another before removing it.`;case`begin-totp-enrollment`:return`Two-factor authentication is already set up on this account.`;case`confirm-totp-enrollment`:return`This setup is no longer in progress. Start again.`;case`request-email-verification`:return`That email address is already in use.`;case`disconnect-external-identity`:return`GitHub is the only sign-in method on this account. Add another before disconnecting it.`;default:return null}return e===`authentication_failed`&&t===`confirm-totp-enrollment`||e===`authentication_failed`&&(t===`connect-external-identity`||t===`disconnect-external-identity`)?`That code is not correct. Check your authenticator app and try again.`:e===`not_found`&&t===`revoke-passkey`?`That passkey is no longer on this account.`:null}function lf(e,t){let n=t===void 0?null:cf(e,t);if(n!==null)return n;switch(e){case nf:return`Enter a current code from your authenticator app to confirm this change.`;case rf:return`Sign in with a passkey on this device to change two-factor settings.`;case`invalid_credential_id`:return`That passkey could not be identified.`;case`external_provider_unavailable`:return`GitHub sign-in is temporarily unavailable.`;case`external_authorization_cancelled`:return`GitHub authorization was cancelled.`;case`external_authorization_expired`:return`GitHub authorization expired. Try again.`;case`external_authorization_rejected`:return`GitHub could not authorize this request.`;case`external_identity_already_linked`:return`That GitHub account is already connected.`;case`external_identity_email_conflict`:return`Sign in another way, then connect GitHub from account settings.`;case`external_identity_verified_email_required`:return`GitHub must have a verified primary email to create an account.`;case`signup_disabled`:return`New account signup is currently closed.`;case`username_unavailable`:return`That username is unavailable.`;case`last_primary_credential`:return`Add another sign-in method before disconnecting GitHub.`;case`native_authorization_unavailable`:return`Secure browser authorization is unavailable on this device.`;case`timeout`:return`The request took too long. Check your connection and try again.`;case`authentication_failed`:return`The passkey could not be verified.`;case`registration_unavailable`:return`The invitation or registration challenge is unavailable or expired.`;case`session_invalid`:case`unauthorized`:return`Your Hub session has expired.`;case`csrf_rejected`:return`The request could not be verified. Refresh and try again.`;case`forbidden`:case`authorization_failed`:return`You are not authorized to perform this action.`;case`not_found`:return`The requested item is no longer available.`;case`conflict`:case`ticket_consumed`:return`The request has already been used.`;case`rate_limited`:case`node_rate_limited`:return`Too many attempts. Wait briefly and try again.`;case`enrollment_unavailable`:return`The node enrollment is unavailable or expired.`;case`node_offline`:return`The selected node is offline.`;case`server_draining`:return`Hub is temporarily draining relay connections.`;case`unsupported_version`:return`The selected node or Hub uses an incompatible relay version.`;case`invalid_request`:return`The response was malformed or expired.`;case`browser_only_transport`:return`This action is only available in a browser.`;case`native_only_transport`:return`This action is only available in the native app.`;default:return`Hub is temporarily unavailable.`}}function uf(e){if(typeof e!=`object`||!e||Array.isArray(e))throw new q(`invalid_response`,502);return e}function J(e,t,n){try{return ot(e)(t,{onExcessProperty:`error`})}catch{throw new q(n,n===`invalid_request`?400:502)}}function df(e){if(typeof e!=`string`)throw new q(`invalid_response`,502);try{return xu(e)}catch{throw new q(`invalid_response`,502)}}function ff(e){return e===null||typeof e==`number`&&Number.isSafeInteger(e)}function pf(e){return e===`viewer`||e===`operator`||e===`owner`}function mf(e){return e===`darwin`||e===`linux`||e===`windows`||e===`unknown`}function hf(e){return e===`arm64`||e===`x64`||e===`other`}function gf(e){return typeof e==`string`&&e.length>0&&e.length<=Md?e:null}function _f(e){return!Array.isArray(e)||e.some(e=>typeof e!=`string`)?null:e}function vf(e){let t=_f(e);return!t||t.length===0||t.length>Rd||t.some(e=>e.length===0||e.length>zd)?null:t}function yf(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;return typeof t.id!=`string`||!Bd.test(t.id)?null:{id:t.id,label:typeof t.label==`string`&&t.label.length<=Nd?t.label:null,createdAt:ff(t.createdAt)?t.createdAt:null,lastUsedAt:ff(t.lastUsedAt)?t.lastUsedAt:null,backupEligible:typeof t.backupEligible==`boolean`?t.backupEligible:null,backupState:typeof t.backupState==`boolean`?t.backupState:null,revokedAt:ff(t.revokedAt)?t.revokedAt:null,revocationReasonCode:typeof t.revocationReasonCode==`string`&&t.revocationReasonCode.length>0&&t.revocationReasonCode.length<=Hd?t.revocationReasonCode:null}}function bf(e){try{return ot(Ne)(e,{onExcessProperty:`error`})}catch{return null}}function xf(e){let t=e?.totpCode;return typeof t==`string`&&t.trim().length>0?{totpCode:t}:{}}function Sf(e,t){if(typeof e!=`string`||e.length===0||e.length>t)throw new q(`invalid_request`,400);return e}function Cf(e){return e==null||e===``?{}:{totpCode:Sf(e,qd)}}function wf(e){let t=Sf(e,64);if(!Yd.test(t))throw new q(`invalid_request`,400);return t}function Tf(e){return typeof e==`string`&&e.length>0&&e.length<=Ud?e:null}function Ef(e){return typeof e==`string`&&e.length<=Wd&&e.toLowerCase().startsWith(Xd)?e:null}var Df=/^[a-z][a-z0-9_]{0,63}$/;function Of(e){return typeof e==`string`&&Df.test(e)?e:`unavailable`}async function kf(e,t,n){let r;try{r=await e.json()}catch{throw new q(`invalid_response`,e.status,void 0,t)}let i=uf(r);if(!e.ok){let r=typeof i.retryAfterMs==`number`&&Number.isSafeInteger(i.retryAfterMs)&&i.retryAfterMs>=0&&i.retryAfterMs<=3e5?i.retryAfterMs:void 0,a=af(Of(i.error),t,n);throw new q(a.code,e.status,r,t,a.wire)}return i}var Af=class{#e;#t;#n;#r;#i;#a;#o=null;constructor(e){if(this.#e=e.endpoint,this.#t=e.httpClient,this.#n=e.passkeyCeremony,this.#r=e.sessionCredentials,this.#i=e.dpopSigner,this.#a=e.nativeAuthorization,this.#r.mode===`bearer`){if(!this.#i)throw new q(`native_session_unavailable`,0,void 0,void 0,void 0,`missing-signer`);if(!this.#r.readBearerToken||!this.#r.writeBearerToken)throw new q(`native_session_unavailable`,0,void 0,void 0,void 0,`missing-token`)}}get#s(){return this.#r.mode===`bearer`}#c(){return this.#r.readBearerToken?.()??null}#l(e){this.#r.writeBearerToken?.(e)}get hasSessionMaterial(){return this.#s?this.#c()!==null:this.#r.readCsrfToken()!==null}clearSessionMaterial(){this.#o=null,this.#s?this.#l(null):this.#r.writeCsrfToken(null)}async getBootstrapAvailability(e){let t=await this.#E(`/api/auth/bootstrap-status`,{dpop:`mint`,...e?{signal:e}:{}});if(Object.keys(t).length!==1||typeof t.available!=`boolean`)throw new q(`invalid_response`,502);return t.available}async getPublicSignupConfiguration(e){return this.#m(),J(dt,await this.#E(E,e?{signal:e}:{}),`invalid_response`)}async getExternalIdentityConfiguration(e){return J(S,await this.#E(T,{...this.#s?{dpop:`mint`}:{},...e?{signal:e}:{}}),`invalid_response`)}async startExternalIdentityAuthorization(e,t){this.#m();let n=J(o,e,`invalid_request`);return J(Te,await this.#E(Vt,{method:`POST`,body:n,...n.intent===`link`?{csrf:!0,intent:`connect-external-identity`}:{},...t?{signal:t}:{}}),`invalid_response`)}async getPendingExternalIdentity(e){return this.#m(),J(y,await this.#E(re,e?{signal:e}:{}),`invalid_response`)}async finishExternalIdentitySignup(e,t){this.#m();let n=J(Ct,e,`invalid_request`),r=J(ee,await this.#E(_e,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`);return this.#r.writeCsrfToken(r.identity.csrfToken),r}async restoreSession(e){let t=await this.#E(`/api/auth/session`,e?{signal:e}:{});if(this.#s)return this.#b(t);let n=this.#w(t);return this.#r.writeCsrfToken(n.csrfToken),n}async signIn(e){if(this.#s&&this.#a){let t=await Ad({origin:this.#e.origin(),platform:this.#a,...e?{signal:e}:{},start:(e,t)=>this.#u(e,t),redeem:(e,t)=>this.#d(e,t)}),n=this.#C(t);return this.#l(t.token),n}let t=this.#s?`/api/auth/native/passkey`:`/api/auth/passkey`,n=await this.#E(`${t}/options`,{method:`POST`,body:{},dpop:`mint`,...e?{signal:e}:{}}),r=await this.#n.authenticate(fd(n.options),e);return this.#y(await this.#E(`${t}/verify`,{method:`POST`,body:{response:r},dpop:`mint`,...e?{signal:e}:{}}))}async signInWithExternalProvider(e,t){this.#h();let n=J(te,e,`invalid_request`),r=this.#a;if(!r)throw new q(`native_authorization_unavailable`,400);let i=await kd({origin:this.#e.origin(),platform:r,purpose:{kind:`sign_in`,providerHint:n},redeemRequestSchema:d,redeemResponseSchema:de,buildRedeemRequest:e=>e,...t?{signal:t}:{},start:(e,t)=>this.#u(e,t),redeem:(e,t)=>this.#d(e,t)}),a=this.#C(i);return this.#l(i.token),a}async connectExternalIdentity(e,t,n){this.#h();let r=J(te,e,`invalid_request`),i=this.#a;if(!i)throw new q(`native_authorization_unavailable`,400);let a=this.#o;if(a&&a.expiresAt<Date.now())this.#o=null;else if(a?.provider===r){let e=J(c,{...a.request,...xf(t)},`invalid_request`);try{let t=await this.#f(e,n);return this.#o=null,t.externalIdentity}catch(e){throw this.#p(e)||(this.#o=null),e}}let o=null;try{return(await kd({origin:this.#e.origin(),coordinatorKey:`${this.#e.origin()}:connect:${r}`,platform:i,purpose:{kind:`connect_external_identity`,provider:r},redeemRequestSchema:c,redeemResponseSchema:It,buildRedeemRequest:e=>({...e,purpose:{kind:`connect_external_identity`,provider:r},...xf(t)}),...n?{signal:n}:{},start:(e,t)=>this.#u(e,t),redeem:(e,t)=>(o=e,this.#f(e,t))})).externalIdentity}catch(e){throw o&&this.#p(e)&&(this.#o={provider:r,request:o,expiresAt:Date.now()+tt}),e}}cancelExternalIdentityConnection(e){let t=J(te,e,`invalid_request`);this.#o?.provider===t&&(this.#o=null)}async signInWithNativePasskey(e){this.#h();let t=`/api/auth/native/passkey`,n=await this.#E(`${t}/options`,{method:`POST`,body:{},dpop:`mint`,...e?{signal:e}:{}}),r=await this.#n.authenticate(fd(n.options),e),i=await this.#E(`${t}/verify`,{method:`POST`,body:{response:r},dpop:`mint`,...e?{signal:e}:{}}),a=this.#T(i);return{session:a.response,token:a.token}}async startPublicSignup(e,t){this.#m();let n=J(et,e,`invalid_request`);return J(Xe,await this.#E(me,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`)}async verifyPublicSignup(t,n){this.#m();let r=J(Fe,t,`invalid_request`);return J(Nt,await this.#E(e,{method:`POST`,body:r,...n?{signal:n}:{}}),`invalid_response`)}async finishPublicSignupWithPasskey(e,t){this.#m();let n=J(We,{...e,response:{}},`invalid_request`),r=J(Je,{attemptId:n.attemptId,activationSecret:n.activationSecret},`invalid_request`),i=J(bt,await this.#E(Oe,{method:`POST`,body:r,...t?{signal:t}:{}}),`invalid_response`),a=await this.#n.register(pd(i.options),t),o=J(We,{...n,response:a},`invalid_request`),s=J(jt,await this.#E(Ae,{method:`POST`,body:o,...t?{signal:t}:{}}),`invalid_response`);return this.#r.writeCsrfToken(s.identity.csrfToken),s}async finishPublicSignupWithPassword(e,t){this.#m();let n=J(pt,e,`invalid_request`),r=J(jt,await this.#E(Me,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`);return this.#r.writeCsrfToken(r.identity.csrfToken),r}async startPasswordLogin(e,t){this.#m();let n=J(kt,e,`invalid_request`);return J(gt,await this.#E(Ee,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`)}async finishPasswordLogin(e,t){this.#m();let n=J(Ke,e,`invalid_request`),r=J(he,await this.#E(Se,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`);return this.#r.writeCsrfToken(r.csrfToken),r}async requestPasswordReset(e,t){this.#m();let n=J(Re,e,`invalid_request`);return J(vt,await this.#E(D,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`)}async verifyPasswordReset(e,t){this.#m();let n=J(Dt,e,`invalid_request`);return J(He,await this.#E(St,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`)}async finishPasswordReset(e,t){this.#m();let n=J(Tt,e,`invalid_request`),r=J(rt,await this.#E(_,{method:`POST`,body:n,...t?{signal:t}:{}}),`invalid_response`);return this.clearSessionMaterial(),r}async startNativeIdentityEmail(e,t){return this.#g(Ge,Ye,Pe,e,t)}async verifyNativeIdentityEmail(e,t){return this.#g(Ot,Mt,zt,e,t)}async claimNativeIdentityUsername(e,t){return this.#g(Ue,ne,ge,e,t)}async finishNativeIdentitySignupWithPasskey(e,t){this.#h();let n=J(se,{...e,response:{}},`invalid_request`),r=J(fe,{attemptId:n.attemptId,activationSecret:n.activationSecret},`invalid_request`),i=await this.#g(ut,fe,h,r,t),a=await this.#n.register(pd(i.options),t);return this.#g(Ve,se,ie,{...n,response:a},t)}async finishNativeIdentitySignupWithPassword(e,t){return this.#g(At,C,ie,e,t)}async startNativeIdentityPasswordLogin(e,t){return this.#g(_t,u,le,e,t)}async finishNativeIdentityPasswordLogin(e,t){return this.#g(ht,ze,it,e,t)}async signInNativeIdentityWithRecoveryCode(e,t){return this.#g(Et,st,n,e,t)}async requestNativeIdentityPasswordReset(e,t){return this.#g(nt,s,Ft,e,t)}async verifyNativeIdentityPasswordReset(e,t){return this.#g(Le,be,f,e,t)}async finishNativeIdentityPasswordReset(e,t){return this.#g(wt,Lt,ve,e,t)}async cancelNativeIdentityAttempt(e,n){return this.#g(t,ft,$e,e,n)}async switchActiveSpace(e,t){let n=J(oe,e,`invalid_request`);return J(ce,await this.#E(at,{method:`POST`,body:n,csrf:!0,dpop:`session`,...t?{signal:t}:{}}),`invalid_response`)}async startNativeNodeClaim(e,t){this.#h();let n=J(we,e,`invalid_request`);return J(x,await this.#E(yt,{method:`POST`,body:n,dpop:`session`,...t?{signal:t}:{}}),`invalid_response`)}async finishNativeNodeClaim(e,t){this.#h();let n=J(Bt,e,`invalid_request`);return J(a,await this.#E(qe,{method:`POST`,body:n,dpop:`session`,...t?{signal:t}:{}}),`invalid_response`)}async signInWithPassword(e,t){return this.#m(),this.#y(await this.#E(`/api/auth/password`,{method:`POST`,body:{email:Sf(e.email,Gd),password:Sf(e.password,Kd),...Cf(e.totpCode)},...t?{signal:t}:{}}))}async signInWithRecoveryCode(e,t){return this.#m(),this.#y(await this.#E(`/api/auth/recovery`,{method:`POST`,body:{code:Sf(e,Jd)},...t?{signal:t}:{}}))}async requestEmailRecovery(e,t){this.#m();let n=await this.#E(`/api/auth/recovery/email/request`,{method:`POST`,body:{email:Sf(e,Gd)},...t?{signal:t}:{}});if(Object.keys(n).length!==1||n.ok!==!0)throw new q(`invalid_response`,502)}async confirmEmailRecovery(e,t){return this.#m(),this.#y(await this.#E(`/api/auth/recovery/email/confirm`,{method:`POST`,body:{token:wf(e.token),...Cf(e.totpCode)},...t?{signal:t}:{}}))}async confirmEmailVerification(e,t){this.#m();let n=await this.#E(`/api/auth/email/verify`,{method:`POST`,body:{token:wf(e)},...t?{signal:t}:{}});if(Object.keys(n).length!==1||n.ok!==!0)throw new q(`invalid_response`,502)}async startNativeHandoff(e,t){return this.#u(e,t)}async#u(e,t){if(!this.#s)throw new q(`browser_only_transport`,400);let n=J(lt,e,`invalid_request`),r=n.purpose?.kind===`connect_external_identity`;return J(i,await this.#E(Pt,{method:`POST`,body:n,dpop:r?`session`:`mint`,...r?{intent:`connect-external-identity`}:{},...t?{signal:t}:{}}),`invalid_response`)}async redeemNativeHandoff(e,t){let n=await this.#d(e,t),r=this.#C(n);return this.#l(n.token),r}async#d(e,t){if(!this.#s)throw new q(`browser_only_transport`,400);let n=J(d,e,`invalid_request`);return J(de,await this.#E(Ie,{method:`POST`,body:n,dpop:`mint`,...t?{signal:t}:{}}),`invalid_response`)}async#f(e,t){this.#h();let n=J(c,e,`invalid_request`);return J(It,await this.#E(Ie,{method:`POST`,body:n,dpop:`session`,intent:`connect-external-identity`,...t?{signal:t}:{}}),`invalid_response`)}#p(e){return e instanceof q&&(e.code===`step_up_required`||e.code===`authentication_failed`||e.code===`forbidden`)}async getNativeHandoffPresentation(e,t){this.#m();let n=J(xe,e,`invalid_request`);return J(m,await this.#E(`${Ze}${n}`,t?{signal:t}:{}),`invalid_response`)}async approveNativeHandoff(e,t){this.#m();let n=J(xe,e,`invalid_request`);return J(Be,await this.#E(`${Ze}${n}${xt}`,{method:`POST`,body:{},csrf:!0,...t?{signal:t}:{}}),`invalid_response`)}async cancelNativeHandoff(e,t){this.#m();let n=J(xe,e,`invalid_request`);return J(ye,await this.#E(`${Ze}${n}${mt}`,{method:`POST`,body:{},csrf:!0,...t?{signal:t}:{}}),`invalid_response`)}#m(){if(this.#s)throw new q(`browser_only_transport`,400)}#h(){if(!this.#s)throw new q(`native_only_transport`,400)}async#g(e,t,n,r,i){this.#h();let a=J(t,r,`invalid_request`);return J(n,await this.#E(e,{method:`POST`,body:a,dpop:`mint`,...i?{signal:i}:{}}),`invalid_response`)}async redeemInvitation(e,t){let n=this.#s?`/api/auth/native/invitations/registration`:`/api/auth/invitations/registration`;return this.#v(`${n}/options`,`${n}/verify`,e,{authenticated:!1,...t?{signal:t}:{},finish:e=>this.#y(e)})}async bootstrapOwner(e,t){let n=this.#s?`/api/auth/native/bootstrap/registration`:`/api/auth/bootstrap/registration`;return this.#v(`${n}/options`,`${n}/verify`,e,{authenticated:!1,...t?{signal:t}:{},finish:e=>this.#y(e)})}async listPasskeys(e){let t=await this.#E(`/api/account/passkeys`,e?{signal:e}:{});if(!Array.isArray(t.passkeys)||t.passkeys.length>Pd)throw new q(`invalid_response`,502);return t.passkeys.map(e=>{let t=yf(e);if(!t)throw new q(`invalid_response`,502);return t})}async getAccountSecurity(e){let t=bf(await this.#E(`/api/account/security`,e?{signal:e}:{}));if(!t)throw new q(`invalid_response`,502);return t}async finishBrowserExternalIdentityConnection(e,t,n){this.#m(),J(te,e,`invalid_request`);let r=J(pe,xf(t),`invalid_request`);return J(g,await this.#E(je,{method:`POST`,body:r,csrf:!0,intent:`connect-external-identity`,...n?{signal:n}:{}}),`invalid_response`)}async disconnectExternalIdentity(e,t,n){J(te,e,`invalid_request`);let r=J(Ce,xf(t),`invalid_request`),i=J(De,await this.#E(ke,{method:`POST`,body:r,csrf:!0,intent:`disconnect-external-identity`,...n?{signal:n}:{}}),`invalid_response`);return i.signedOut&&this.clearSessionMaterial(),i}async addPasskey(e,t){let n=typeof e.passkeyLabel==`string`?e.passkeyLabel.trim():null;return this.#v(`/api/account/passkeys/registration/options`,`/api/account/passkeys/registration/verify`,{label:n===null||n.length===0?null:n},{authenticated:!0,intent:`add-passkey`,verifyExtra:xf(e),...t?{signal:t}:{},finish:e=>this.#S(e)})}async regenerateRecoveryCodes(e,t){let n=await this.#E(`/api/account/recovery-codes`,{method:`POST`,body:xf(e),csrf:!0,intent:`regenerate-recovery-codes`,...t?{signal:t}:{}}),r=vf(n.recoveryCodes);if(!r)throw new q(`invalid_response`,502);return this.#x(n),r}async setPassword(e,t){await this.#_(`/api/account/password`,{password:e.password,...xf(e)},t,`set-password`)}async removePassword(e,t){await this.#_(`/api/account/password/remove`,xf(e),t,`remove-password`)}async beginTotpEnrollment(e){let t=await this.#E(`/api/account/totp/enrollment/options`,{method:`POST`,body:{},csrf:!0,intent:`begin-totp-enrollment`,...e?{signal:e}:{}}),n=Tf(t.secretBase32),r=Ef(t.provisioningUri);if(!n||!r)throw new q(`invalid_response`,502);return{secretBase32:n,provisioningUri:r}}async confirmTotpEnrollment(e,t){await this.#_(`/api/account/totp/enrollment/verify`,{code:e.code},t,`confirm-totp-enrollment`)}async revokeTotp(e,t){await this.#_(`/api/account/totp/revoke`,xf(e),t,`revoke-totp`)}async requestEmailVerification(e,t){await this.#_(`/api/account/email/verification`,{email:e.email,...xf(e)},t,`request-email-verification`)}async revokePasskey(e,t){if(!Vd.test(e))throw new q(`invalid_credential_id`,400);await this.#_(`/api/account/passkeys/${e}/revoke`,{},t,`revoke-passkey`)}async#_(e,t,n,r){let i=await this.#E(e,{method:`POST`,body:t,csrf:!0,intent:r,...n?{signal:n}:{}});if(Object.keys(i).length!==1||i.ok!==!0)throw new q(`invalid_response`,502,void 0,r)}async#v(e,t,n,r){let i={csrf:r.authenticated,...r.authenticated?{}:{dpop:`mint`},...r.intent?{intent:r.intent}:{},...r.signal?{signal:r.signal}:{}},a=await this.#E(e,{method:`POST`,body:n,...i,narrowForbidden:!1}),o=await this.#n.register(pd(a.options),r.signal);return r.finish(await this.#E(t,{method:`POST`,body:{response:o,...r.verifyExtra},...i}))}#y(e){if(this.#s){let{response:t,token:n}=this.#T(e);return this.#l(n),t}let t=this.#w(e);return this.#r.writeCsrfToken(t.csrfToken),t}#b(e){let t=this.#C(e),n=gf(e.token);return n&&this.#l(n),t}#x(e){if(this.#s){let{token:t}=this.#T(e);this.#l(t);return}this.#r.writeCsrfToken(this.#w(e).csrfToken)}#S(e){this.#x(e);let t=yf(e.passkey);return{passkey:t,confirmed:t!==null}}async signOut(e){await this.#E(`/api/auth/logout`,{method:`POST`,body:{},csrf:!0,...e?{signal:e}:{}}),this.clearSessionMaterial()}async listNodes(e){let t=await this.#E(`/api/nodes`,e?{signal:e}:{});if(!Array.isArray(t.nodes))throw new q(`invalid_response`,502);return t.nodes.map(e=>{let t=uf(e),n=uf(t.grant),r=uf(t.presence),i=t.capabilities===void 0?null:uf(t.capabilities),a=J(ae,t.id,`invalid_response`);if(typeof t.environmentId!=`string`||typeof t.label!=`string`||!mf(t.platformOs)||!hf(t.platformArch)||typeof t.clientVersion!=`string`||!ff(t.createdAt)||t.createdAt===null||!ff(t.updatedAt)||t.updatedAt===null||!ff(t.lastAuthenticatedAt)||!ff(t.revokedAt)||t.revocationReasonCode!==null&&typeof t.revocationReasonCode!=`string`||typeof n.id!=`string`||!pf(n.role)||!pf(t.effectiveRole)||typeof r.online!=`boolean`||!ff(r.lastHeartbeatAt)||i!==null&&(typeof i.repositoryIdentity!=`boolean`||typeof i.nativeClientRequired!=`boolean`||i.threadSettlement!==void 0&&typeof i.threadSettlement!=`boolean`))throw new q(`invalid_response`,502);let o={id:a,environmentId:w.make(t.environmentId),label:t.label,platformOs:t.platformOs,platformArch:t.platformArch,clientVersion:t.clientVersion,createdAt:t.createdAt,updatedAt:t.updatedAt,lastAuthenticatedAt:t.lastAuthenticatedAt,revokedAt:t.revokedAt,revocationReasonCode:t.revocationReasonCode,grant:{id:n.id,role:n.role},effectiveRole:t.effectiveRole,presence:{online:r.online,lastHeartbeatAt:r.lastHeartbeatAt}};return i?Object.assign(o,{capabilities:{repositoryIdentity:i.repositoryIdentity,nativeClientRequired:i.nativeClientRequired,...typeof i.threadSettlement==`boolean`?{threadSettlement:i.threadSettlement}:{}}}):o})}async renameNode(e,t,n){let r=t.trim();if(!Id.test(e)||r.length===0||r.length>Fd)throw new q(`invalid_request`,400);let i=await this.#E(`/api/admin/nodes/${encodeURIComponent(e)}/rename`,{method:`POST`,body:{label:r},csrf:!0,...n?{signal:n}:{}});if(Object.keys(i).length!==1||i.ok!==!0)throw new q(`invalid_response`,502)}async revokeNode(e,t,n){if(!Id.test(e)||!Ld.test(t))throw new q(`invalid_request`,400);let r=await this.#E(`/api/admin/nodes/${encodeURIComponent(e)}/revoke`,{method:`POST`,body:{reasonCode:t},csrf:!0,...n?{signal:n}:{}});if(Object.keys(r).length!==1||r.ok!==!0)throw new q(`invalid_response`,502)}async lookupNodeEnrollment(e,t){let n=uf((await this.#E(`/api/admin/node-enrollments/lookup`,{method:`POST`,body:{deviceCode:e},csrf:!0,...t?{signal:t}:{}})).enrollment);if(typeof n.id!=`string`||!/^enr_[A-Za-z0-9_-]{22}$/.test(n.id)||typeof n.label!=`string`||n.label.length<1||n.label.length>100||!mf(n.platformOs)||!hf(n.platformArch)||typeof n.clientVersion!=`string`||n.clientVersion.length<1||n.clientVersion.length>64||n.algorithm!==`ed25519`||typeof n.fingerprint!=`string`||!/^SHA256:[A-Za-z0-9_-]{43}$/.test(n.fingerprint)||!Number.isSafeInteger(n.createdAt)||!Number.isSafeInteger(n.expiresAt)||Number(n.expiresAt)<=Number(n.createdAt))throw new q(`invalid_response`,502);return{id:n.id,label:n.label,platformOs:n.platformOs,platformArch:n.platformArch,clientVersion:n.clientVersion,algorithm:n.algorithm,fingerprint:n.fingerprint,createdAt:n.createdAt,expiresAt:n.expiresAt}}async approveNodeEnrollment(e,t){let n=await this.#E(`/api/admin/node-enrollments/approve`,{method:`POST`,body:{deviceCode:e},csrf:!0,...t?{signal:t}:{}}),r=uf(n.node),i=uf(n.grant);if(typeof r.id!=`string`||!Id.test(r.id)||typeof r.environmentId!=`string`||!/^env_[A-Za-z0-9_-]{22}$/.test(r.environmentId)||typeof i.id!=`string`||!/^grant_[A-Za-z0-9_-]{22}$/.test(i.id)||i.role!==`owner`)throw new q(`invalid_response`,502)}async denyNodeEnrollment(e,t){let n=await this.#E(`/api/admin/node-enrollments/deny`,{method:`POST`,body:{deviceCode:e},csrf:!0,...t?{signal:t}:{}});if(Object.keys(n).length!==1||n.ok!==!0)throw new q(`invalid_response`,502)}async issueRelayTicket(e,t){let n=J(ae,e,`invalid_request`),r=await this.#E(`/api/relay/tickets`,{method:`POST`,body:{nodeId:n,capability:`ryco.rpc`,protocolMajor:1,protocolMinor:2},csrf:!0,...t?{signal:t}:{}});if(typeof r.ticket!=`string`||!Number.isSafeInteger(r.expiresAt)||r.protocolMajor!==1||r.protocolMinor!==2)throw new q(`invalid_response`,502);return{ticket:r.ticket,expiresAt:r.expiresAt,protocolMajor:1,protocolMinor:2}}#C(e){let t=uf(e.account),n=uf(e.session),r=df(t.id),i=df(n.accountId),a=e.recoveryCodes===void 0?void 0:_f(e.recoveryCodes);if(typeof t.displayName!=`string`||!pf(t.role)||!Number.isSafeInteger(t.createdAt)||!ff(t.disabledAt)||typeof n.id!=`string`||!Number.isSafeInteger(n.createdAt)||!Number.isSafeInteger(n.expiresAt)||!Number.isSafeInteger(n.lastSeenAt)||!ff(n.revokedAt)||n.revocationReasonCode!==null&&typeof n.revocationReasonCode!=`string`||a===null)throw new q(`invalid_response`,502);if(t.disabledAt!==null||n.revokedAt!==null||i!==r)throw new q(`session_invalid`,401);return{account:{id:r,displayName:t.displayName,role:t.role,createdAt:t.createdAt,disabledAt:t.disabledAt},session:{id:n.id,accountId:i,createdAt:n.createdAt,expiresAt:n.expiresAt,lastSeenAt:n.lastSeenAt,revokedAt:n.revokedAt,revocationReasonCode:n.revocationReasonCode},...a===void 0?{}:{recoveryCodes:a}}}#w(e){if(typeof e.csrfToken!=`string`||e.csrfToken.length===0)throw new q(`invalid_response`,502);return{...this.#C(e),csrfToken:e.csrfToken}}#T(e){let t=gf(e.token);if(!t)throw new q(`invalid_response`,502);return{response:this.#C(e),token:t}}async#E(e,t){let n=new URL(e,this.#e.origin());if(n.origin!==this.#e.origin()||n.search||n.hash||n.pathname.includes(`%`))throw new q(`invalid_request`,400,void 0,t.intent);if(this.#s&&$d(n.pathname))throw new q(`browser_only_transport`,400,void 0,t.intent);let r=t.method??`GET`,i={...jd},a,o;if(this.#s){let e=this.#i;if(!e)throw new q(`native_session_unavailable`,0,void 0,t.intent,void 0,`missing-signer`);let s=n.toString(),c;if(t.dpop!==`mint`&&(c=this.#c()??void 0,!c))throw new q(`session_invalid`,401,void 0,t.intent,void 0,`missing-token`);try{i.DPoP=await e.sign({method:r,url:s,...c?{token:c}:{}})}catch{throw new q(`native_session_unavailable`,0,void 0,t.intent,void 0,`proof-signing-failed`)}c&&(i.Authorization=`DPoP ${c}`),a=s,o=`omit`}else{if(t.csrf){let e=this.#r.readCsrfToken();if(!e)throw new q(`session_invalid`,401,void 0,t.intent);i[`X-Ryco-CSRF`]=e}a=n.pathname,o=`same-origin`}let s=new AbortController,c=!1,l=setTimeout(()=>{c=!0,s.abort()},Zd),u=t.signal,d=()=>s.abort();u?.aborted?s.abort():u?.addEventListener(`abort`,d);let f;try{f=await this.#t.fetch(a,{method:r,credentials:o,cache:`no-store`,headers:i,...t.body===void 0?{}:{body:JSON.stringify(t.body)},signal:s.signal})}catch(e){throw c?new q(`timeout`,0,void 0,t.intent,void 0,`request-timeout`):typeof e==`object`&&e&&`name`in e&&e.name===`AbortError`?e:new q(`unavailable`,0,void 0,t.intent,void 0,`transport-unavailable`)}finally{clearTimeout(l),u?.removeEventListener(`abort`,d)}try{return await kf(f,t.intent,t.narrowForbidden!==!1)}catch(e){throw this.#s&&t.dpop!==`mint`&&e instanceof q&&e.code===`session_invalid`?new q(e.code,e.status,e.retryAfterMs,e.intent,e.wireCode,`token-invalidated`):e}}},jf=null,Mf=null,Nf=null;function Pf(e){Nf=e}function Ff(){if(jf||!Nf)return;let e=Nf;Nf=null,e()}function If(e,t){Nf=null,jf=e,Mf=t??new Af(e)}function Y(){if(Ff(),!jf)throw Error(`Hosted runtime has not been configured.`);return jf}function X(){if(Ff(),!Mf)throw Error(`Hosted runtime has not been configured.`);return Mf}function Lf(e){return{environmentId:e.environmentId,label:e.label,platform:{os:e.platformOs,arch:e.platformArch},serverVersion:e.clientVersion,capabilities:{repositoryIdentity:!1,threadSettlement:!1,threadPriorityRanking:!1}}}function Rf(e){Y().nodeLifecycle.clearNodeScopedState(e)}var zf=null,Bf=!1,Vf=Promise.resolve();function Hf(e){let t=Vf.catch(()=>void 0).then(e);return Vf=t.catch(()=>void 0),t}async function Uf(e){let t=Y().nodeLifecycle;Y().resetRelayAttemptFactory(),await t.disconnectPrimaryEnvironment(),Rf(e),t.writePrimaryEnvironmentDescriptor(null),zf===e&&(zf=null),Bf=!1}async function Wf(e){await Hf(async()=>{await Uf(zf??e)})}async function Gf(e){await Hf(async()=>{(zf??e)!==e||Bf||(Bf=!0,Y().resetRelayAttemptFactory(),await Y().nodeLifecycle.disconnectPrimaryEnvironment())})}async function Kf(e,t,n){await Hf(async()=>{if(n?.aborted)return;let r=zf??t;if(r===e.environmentId){if(Bf||(Y().resetRelayAttemptFactory(),await Y().nodeLifecycle.disconnectPrimaryEnvironment()),n?.aborted)return}else if(r&&(await Uf(r),n?.aborted))return;let i=Y().nodeLifecycle;i.writePrimaryEnvironmentDescriptor(Lf(e)),i.setActiveEnvironmentId(e.environmentId),zf=e.environmentId,Bf=!1,i.connectPrimaryEnvironment()})}var qf={bootstrapAvailable:!1,accountStatus:`signed-out`,account:null,session:null,directoryStatus:`idle`,nodes:[],selectedNode:null,selectionStatus:`none`,effectiveRole:null,transportStatus:`idle`,sessionStatus:`closed`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1,browserStatus:`current`,recoveryCodes:[],totpEnrollment:null,errorMessage:null,errorReason:null,generation:0},Jf={externalIdentityConfiguration:null,externalIdentityConfigurationStatus:`idle`,passkeys:[],passkeysStatus:`idle`,security:null,securityStatus:`idle`,actionStatus:`idle`,errorMessage:null,errorCode:null,errorCodeInferred:!1};function Yf(e){let t=e,n=new Set,r=()=>n.forEach(e=>e());return{getState:()=>t,getInitialState:()=>e,setState:(e,n=!1)=>{t=n?e:{...t,...e},r()},subscribe:e=>(n.add(e),()=>n.delete(e))}}var Z=Yf(qf),Xf=Yf(Jf),Zf=Yf({leased:!1});function Q(e){let t=Object.prototype.hasOwnProperty.call(e,`errorMessage`)&&!Object.prototype.hasOwnProperty.call(e,`errorReason`);Z.setState(t?{...e,errorReason:null}:e)}function $(e){Xf.setState(e)}function Qf(e){return e instanceof q?e.message:e instanceof K?e.code===`cancelled`||e.code===`superseded`?``:e.message:typeof e==`object`&&e&&`name`in e&&e.name===`NotAllowedError`?`The passkey request was cancelled or denied.`:typeof e==`object`&&e&&`name`in e&&e.name===`AbortError`?``:`Hub is temporarily unavailable.`}function $f(e){return{errorMessage:Qf(e)||null,errorReason:e instanceof q?e.reason:null}}function ep(e){let t=Qf(e)||null;return e instanceof q?{errorMessage:t,errorCode:e.code,errorCodeInferred:e.inferred}:{errorMessage:t,errorCode:null,errorCodeInferred:!1}}function tp(e){return{errorMessage:e,errorCode:null,errorCodeInferred:!1}}var np={errorMessage:null,errorCode:null,errorCodeInferred:!1};function rp(e,t){return t instanceof q?{status:`refused`,reason:e,errorCode:t.code,wireErrorCode:t.wireCode,inferredErrorCode:t.inferred,errorMessage:t.message||null}:{status:`refused`,reason:e,errorCode:null,wireErrorCode:null,inferredErrorCode:!1,errorMessage:t===void 0?null:Qf(t)||null}}function ip(e,t){return{status:`refused`,reason:e,errorCode:null,wireErrorCode:null,inferredErrorCode:!1,errorMessage:t}}function ap(e){return e instanceof q&&(e.status===401||e.code===`session_invalid`)}function op(){let e=0;return{bump:()=>{e+=1},issue:()=>{let t=e;return()=>t===e}}}var sp=2e4,cp=6e4,lp=3e4,up=`Ryco state could not be synchronized.`,dp=`Another account change is still in progress.`,fp=`Sign in to change your account settings.`,pp=`The passkey could not be confirmed. Check your passkeys before relying on it.`,mp=`Your recovery codes were replaced but could not be shown. Your previous codes no longer work — generate a new set and save them.`,hp=`Two-factor setup started but its key could not be shown. Remove two-factor authentication and set it up again.`,gp=class{#e=null;#t=null;#n=0;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=null;#f=0;#p=op();#m=op();#h=new Set;#g=!1;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=0;#w=null;bootstrap(){if(this.#a)return this.#a;let e=this.#V(),t=X().restoreSession(e.signal).then(async e=>{Q({accountStatus:`authenticated`,account:e.account,session:e.session,errorMessage:null}),await this.refreshDirectory()}).catch(t=>{if(!e.signal.aborted){if(X().clearSessionMaterial(),ap(t))return X().getBootstrapAvailability(e.signal).catch(()=>!1).then(t=>{e.signal.aborted||Q({...qf,bootstrapAvailable:t})});Q({...qf,accountStatus:`unavailable`,...$f(t)})}}).finally(()=>{this.#e===e&&(this.#e=null),this.#a===t&&(this.#a=null)});return this.#a=t,t}async signIn(){let e=this.#V();Q({accountStatus:`authenticating`,errorMessage:null,recoveryCodes:[],totpEnrollment:null});try{let t=await X().signIn(e.signal);Q({accountStatus:`authenticated`,account:t.account,session:t.session}),await this.refreshDirectory()}catch(t){if(e.signal.aborted)return;Q({accountStatus:`signed-out`,...$f(t)})}finally{this.#e===e&&(this.#e=null)}}async signInWithExternalProvider(e){let t=this.#V();Q({accountStatus:`authenticating`,errorMessage:null,recoveryCodes:[],totpEnrollment:null});try{let n=await X().signInWithExternalProvider(e,t.signal);Q({accountStatus:`authenticated`,account:n.account,session:n.session}),await this.refreshDirectory()}catch(e){if(t.signal.aborted)return;Q({accountStatus:`signed-out`,...$f(e)})}finally{this.#e===t&&(this.#e=null)}}async redeemInvitation(e){return this.#T(t=>X().redeemInvitation(e,t))}async bootstrapOwner(e){return this.#T(t=>X().bootstrapOwner(e,t))}async adoptPublicBrowserIdentity(e,t=[]){this.#e?.abort(),this.#e=null,this.#p.bump(),this.#m.bump(),Q({accountStatus:`authenticated`,account:{id:e.account.id,displayName:e.account.displayName,role:e.activeSpace.role,createdAt:e.account.createdAt,disabledAt:e.account.disabledAt},session:{id:e.session.id,accountId:e.session.accountId,createdAt:e.session.createdAt,expiresAt:e.session.expiresAt,lastSeenAt:e.session.lastSeenAt,revokedAt:e.session.revokedAt,revocationReasonCode:e.session.revocationReasonCode},recoveryCodes:[...t],totpEnrollment:null,bootstrapAvailable:!1,errorMessage:null}),await this.refreshDirectory()}async#T(e){let t=this.#V();Q({accountStatus:`authenticating`,errorMessage:null,recoveryCodes:[],totpEnrollment:null});try{let n=await e(t.signal);Q({accountStatus:`authenticated`,account:n.account,session:n.session,recoveryCodes:n.recoveryCodes??[],bootstrapAvailable:!1}),await this.refreshDirectory()}catch(e){if(t.signal.aborted)return;Q({accountStatus:`signed-out`,...$f(e)})}finally{this.#e===t&&(this.#e=null)}}cancelAuthentication(){this.#e?.abort(),this.#e=null,this.#p.bump(),this.#m.bump(),Q({accountStatus:`signed-out`,errorMessage:null,recoveryCodes:[],totpEnrollment:null})}leaseRecoveryCodeDisplay(){let e=Symbol(`hosted-recovery-code-display-lease`);return this.#h.add(e),this.#E(),()=>{this.#h.delete(e)&&this.#D()}}#E(){let e=this.#h.size>0;Zf.getState().leased!==e&&Zf.setState({leased:e})}#D(){this.#g||(this.#g=!0,Promise.resolve().then(()=>{this.#g=!1,this.#E()}))}dismissRecoveryCodes(){Q({recoveryCodes:[]})}dismissTotpEnrollment(){this.#p.bump(),Q({totpEnrollment:null})}refreshPasskeys(e){let t=e?.force===!0;if(this.#v&&!t)return this.#v;let n=Z.getState();if(n.accountStatus!==`authenticated`)return Promise.resolve();t&&(this.#_?.abort(),this.#v=null);let r=new AbortController;this.#_=r;let i=this.#O(r,n.session?.id??null).finally(()=>{this.#_===r&&(this.#_=null),this.#v===i&&(this.#v=null)});return this.#v=i,Xf.getState().passkeys.length===0&&$({passkeysStatus:`loading`}),i}async#O(e,t){try{let n=await X().listPasskeys(e.signal);if(e.signal.aborted)return;if(!this.#F(e.signal,t)){this.#A();return}$({passkeys:n,passkeysStatus:`ready`,...np})}catch(n){if(e.signal.aborted)return;if(ap(n)){await this.#k(n);return}if(!this.#F(e.signal,t)){this.#A();return}$({passkeysStatus:`stale`,...ep(n)})}}async#k(e){await this.expireSession(e).catch(()=>void 0)}#A(){$({passkeys:[],passkeysStatus:`idle`})}refreshExternalIdentityConfiguration(e){let t=e?.force===!0;if(this.#S&&!t)return this.#S;t&&(this.#x?.abort(),this.#S=null);let n=this.#C,r=new AbortController;this.#x=r,Xf.getState().externalIdentityConfiguration===null&&$({externalIdentityConfigurationStatus:`loading`});let i=X().getExternalIdentityConfiguration(r.signal).then(e=>{r.signal.aborted||n!==this.#C||$({externalIdentityConfiguration:e,externalIdentityConfigurationStatus:`ready`})}).catch(()=>{r.signal.aborted||n!==this.#C||$({externalIdentityConfigurationStatus:`stale`})}).finally(()=>{this.#x===r&&(this.#x=null),this.#S===i&&(this.#S=null)});return this.#S=i,i}refreshAccountSecurity(e){let t=e?.force===!0;if(this.#b&&!t)return this.#b;let n=Z.getState();if(n.accountStatus!==`authenticated`)return Promise.resolve();t&&(this.#y?.abort(),this.#b=null);let r=new AbortController;this.#y=r;let i=this.#j(r,n.session?.id??null).finally(()=>{this.#y===r&&(this.#y=null),this.#b===i&&(this.#b=null)});return this.#b=i,Xf.getState().security===null&&$({securityStatus:`loading`}),i}async#j(e,t){try{let n=await X().getAccountSecurity(e.signal);if(e.signal.aborted)return;if(!this.#F(e.signal,t)){this.#M();return}$({security:n,securityStatus:`ready`})}catch(n){if(e.signal.aborted)return;if(ap(n)){await this.#k(n);return}if(!this.#F(e.signal,t)){this.#M();return}$({securityStatus:`stale`})}}#M(){$({security:null,securityStatus:`idle`})}async addPasskey(e){let t={result:null},n=Xf.getState().passkeys.length,r=await this.#P(`adding-passkey`,async n=>{let r=await X().addPasskey(e,n);return()=>{t.result=r}});if(r.status!==`committed`)return r;let i=t.result?.passkey??null;await this.refreshPasskeys({force:!0});let a=Xf.getState();return a.passkeysStatus===`ready`?(i?a.passkeys.some(e=>e.id===i.id):a.passkeys.length>n)?{status:`committed`,confirmation:`confirmed`,passkey:i}:($(tp(pp)),{status:`committed`,confirmation:`missing`,passkey:i}):{status:`committed`,confirmation:`unverified`,passkey:i}}async regenerateRecoveryCodes(e){let t=this.#m.issue(),n=this.#h.size>0,r=!1,i=!1,a=await this.#P(`regenerating-recovery-codes`,async a=>{let o=await X().regenerateRecoveryCodes(e,a);return r=!0,()=>{!n||!t()||(i=!0,Q({recoveryCodes:o}))}},`account`);return r&&!i&&this.#N(mp),a.status===`committed`?{status:`committed`,displayed:i}:a}#N(e){Z.getState().accountStatus===`authenticated`&&$(tp(e))}async revokePasskey(e){let t=await this.#P(`revoking-passkey`,async t=>(await X().revokePasskey(e,t),()=>void 0));return t.status===`committed`&&await this.refreshPasskeys({force:!0}),t}async setPassword(e){let t=await this.#P(`setting-password`,async t=>(await X().setPassword(e,t),()=>void 0));return t.status===`committed`&&await this.refreshAccountSecurity({force:!0}),t}async removePassword(e){let t=await this.#P(`removing-password`,async t=>(await X().removePassword(e,t),()=>void 0));return t.status===`committed`&&await this.refreshAccountSecurity({force:!0}),t}async beginTotpEnrollment(){let e=this.#p.issue(),t=!1,n=!1,r=await this.#P(`enrolling-totp`,async r=>{let i=await X().beginTotpEnrollment(r);return t=!0,()=>{e()&&(n=!0,Q({totpEnrollment:i}))}},`account`);return t&&!n&&this.#N(hp),r.status===`committed`?{status:`committed`,displayed:n}:r}async confirmTotpEnrollment(e){let t=await this.#P(`confirming-totp`,async t=>(await X().confirmTotpEnrollment(e,t),()=>{this.#p.bump(),Q({totpEnrollment:null})}));return t.status===`committed`&&await this.refreshAccountSecurity({force:!0}),t}async revokeTotp(e){let t=await this.#P(`revoking-totp`,async t=>(await X().revokeTotp(e,t),()=>{this.#p.bump(),Q({totpEnrollment:null})}));return t.status===`committed`&&await this.refreshAccountSecurity({force:!0}),t}async requestEmailVerification(e){let t=await this.#P(`requesting-email-verification`,async t=>(await X().requestEmailVerification(e,t),()=>void 0));return t.status===`committed`&&await this.refreshAccountSecurity({force:!0}),t}async connectExternalIdentity(e,t){let n=await this.#P(`connecting-external-identity`,async n=>(await X().connectExternalIdentity(e,t,n),()=>void 0));return n.status===`committed`&&await this.refreshAccountSecurity({force:!0}),n}cancelExternalIdentityConnection(e){this.cancelAccountAction(),X().cancelExternalIdentityConnection(e)}async finishBrowserExternalIdentityConnection(e,t){let n=await this.#P(`connecting-external-identity`,async n=>(await X().finishBrowserExternalIdentityConnection(e,t,n),()=>void 0));return n.status===`committed`&&await this.refreshAccountSecurity({force:!0}),n}async disconnectExternalIdentity(e,t){let n=!1,r=await this.#P(`disconnecting-external-identity`,async r=>{let i=await X().disconnectExternalIdentity(e,t,r);return()=>{n=i.signedOut}});return r.status===`committed`&&(n?await this.clearAccount(`signed-out`):await this.refreshAccountSecurity({force:!0})),r}cancelAccountAction(){this.#w&&(this.#w.abort(),this.#w=null,$({actionStatus:`idle`,...np}))}async#P(e,t,n=`session`){if(Xf.getState().actionStatus!==`idle`)return $(tp(dp)),ip(`busy`,dp);let r=Z.getState();if(r.accountStatus!==`authenticated`)return $(tp(fp)),ip(`signed-out`,fp);let i=r.session?.id??null,a=r.account?.id??null,o=new AbortController;this.#w=o,$({actionStatus:e,...np});try{let e=await t(o.signal);return(n===`account`?this.#I(o.signal,a):this.#F(o.signal,i))?(e(),$(np),{status:`committed`}):ip(o.signal.aborted?`cancelled`:`superseded`,null)}catch(e){return o.signal.aborted?ip(`cancelled`,null):ap(e)?(await this.#k(e),rp(`session-expired`,e)):this.#F(o.signal,i)?($(ep(e)),rp(`request-failed`,e)):rp(`superseded`,e)}finally{this.#w===o&&(this.#w=null,Xf.getState().actionStatus===e&&$({actionStatus:`idle`}))}}#F(e,t){let n=Z.getState();return!e.aborted&&n.accountStatus===`authenticated`&&(n.session?.id??null)===t}#I(e,t){let n=Z.getState();return!e.aborted&&n.accountStatus===`authenticated`&&(n.account?.id??null)===t}#L(){this.#C+=1,this.#x?.abort(),this.#x=null,this.#S=null,this.#p.bump(),this.#m.bump(),this.#_?.abort(),this.#_=null,this.#v=null,this.#y?.abort(),this.#y=null,this.#b=null,this.#w?.abort(),this.#w=null,Xf.setState(Jf,!0)}resetForTests(){this.#e?.abort(),this.#e=null,this.#U(),this.#n=0,this.#r?.abort(),this.#r=null,this.#i=null,this.#a=null,this.#G(),this.#s?.abort(),this.#s=null,this.#c=null,this.#l?.abort(),this.#l=null,this.#u=null,this.#d=null,this.#f+=1,this.#L(),this.#h.clear(),this.#E(),X().clearSessionMaterial(),Z.setState(qf,!0)}async signOut(){let e=this.#V();Q({accountStatus:`signing-out`,errorMessage:null});try{await X().signOut(e.signal)}catch{if(e.signal.aborted)return;X().clearSessionMaterial()}finally{this.#e===e&&(this.#e=null)}await this.clearAccount(`signed-out`)}async expireSession(e){X().clearSessionMaterial(),await this.clearAccount(`session-expired`),e instanceof q&&e.reason!==null&&Q($f(e))}suspendBrowser(e){let t=Z.getState();if(t.accountStatus===`authenticated`&&(this.#f+=1,this.#l?.abort(),this.#l=null,this.#u=null,this.#s?.abort(),this.#G(),this.#U(),this.#r?.abort(),this.#r=null,this.#i=null,Q({browserStatus:e===`offline`?`offline`:`suspended`,sessionStatus:t.sessionStatus===`delivery-unknown`?`delivery-unknown`:`stale`,sessionRecoveredAfterUnknown:!1,generation:t.generation+1}),t.selectedNode&&!this.#d)){let e=t.selectedNode.environmentId,n=Gf(e).catch(()=>void 0).finally(()=>{this.#d===n&&(this.#d=null)});this.#d=n}}resumeBrowser(){if(this.#u)return this.#u;let e=new AbortController;this.#l=e;let t=this.#R(e).finally(()=>{this.#u===t&&(this.#u=null),this.#l===e&&(this.#l=null)});return this.#u=t,t}async#R(e){let t=Z.getState();if(t.accountStatus!==`authenticated`)return;let n=this.#f+1;this.#f=n;let r=t.account?.id??null;Q({browserStatus:`checking-access`,errorMessage:null});try{let t=await X().restoreSession(e.signal);if(e.signal.aborted||this.#f!==n)return;if(Z.getState().accountStatus!==`authenticated`||t.account.id!==r){await this.expireSession();return}if(Q({account:t.account,session:t.session}),await this.refreshDirectory(),this.#f!==n)return;let i=Z.getState();if(i.accountStatus!==`authenticated`)return;if(i.directoryStatus!==`ready`){Q({browserStatus:`stale`});return}if(!i.selectedNode){Q({browserStatus:`current`});return}Q({browserStatus:`synchronizing`}),await this.#B(e.signal)}catch(t){if(e.signal.aborted||this.#f!==n)return;if(ap(t)){await this.expireSession(t);return}Q({browserStatus:`stale`,...$f(t)})}}async clearAccount(e){this.#f+=1,this.#l?.abort(),this.#l=null,this.#u=null,this.#s?.abort(),this.#s=null,this.#c=null,this.#U(),this.#G(),this.#r?.abort(),this.#r=null,this.#i=null,this.#e?.abort(),this.#e=null,this.#L();let t=Z.getState().selectedNode?.environmentId??null;Q({...qf,accountStatus:e,generation:Z.getState().generation+1}),t&&await Wf(t)}refreshDirectory(){if(this.#i)return this.#i;let e=new AbortController;this.#r=e;let t=this.#z(e).finally(()=>{this.#r===e&&(this.#r=null),this.#i===t&&(this.#i=null)});return this.#i=t,t}async#z(e){let t=Z.getState();if(t.accountStatus!==`authenticated`)return;let n=t.session?.id??null;this.#U(),Q({directoryStatus:t.nodes.length===0?`loading`:t.directoryStatus});try{let t=await X().listNodes(e.signal),r=Z.getState();if(e.signal.aborted||r.accountStatus!==`authenticated`||r.session?.id!==n)return;this.#n=0;let i=Z.getState(),a=i.browserStatus===`stale`,o=i.selectedNode,s=o?t.find(e=>e.id===o.id&&e.environmentId===o.environmentId)??null:null;if(o&&(!s||s.revokedAt!==null)){let e=i.generation+1;Q({nodes:t,directoryStatus:`ready`,selectionStatus:s&&s.revokedAt!==null?`revoked`:`authorization-removed`,effectiveRole:null,generation:e}),await this.#q(o.environmentId,e)}else Q({nodes:t,directoryStatus:`ready`,...s?{selectedNode:s,selectionStatus:s.presence.online?`online`:`offline`,effectiveRole:s.effectiveRole}:{}});this.#H(sp),a&&Y().timers.queueMicrotask(()=>{let e=Z.getState();e.accountStatus===`authenticated`&&e.directoryStatus===`ready`&&e.browserStatus===`stale`&&this.resumeBrowser()})}catch(t){if(e.signal.aborted)return;if(ap(t)){await this.expireSession(t);return}this.#n+=1,Q({directoryStatus:`stale`,effectiveRole:null,...$f(t)});let n=Math.min(cp,1e3*2**Math.min(this.#n,6));this.#H(n)}}async selectNode(e){let t=Z.getState();if(t.directoryStatus!==`ready`||t.browserStatus!==`current`)return;let n=t.nodes.find(t=>t.id===e);if(!n||n.revokedAt||t.selectedNode?.id===n.id&&t.selectedNode.environmentId===n.environmentId)return;let r=t.generation+1;Q({selectedNode:n,selectionStatus:n.presence.online?`online`:`offline`,effectiveRole:n.effectiveRole,transportStatus:`idle`,sessionStatus:`synchronizing`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1,errorMessage:null,generation:r}),this.#W(r);try{await Kf(n,t.selectedNode?.environmentId??null)}catch{this.#K(r)}}async returnToDirectory(e){let t=Z.getState(),n=t.selectedNode;if(!n)return;let r=e?.preserveTerminalSelection===!0;this.#f+=1,this.#l?.abort(),this.#l=null,this.#u=null,this.#s?.abort(),this.#s=null,this.#c=null,this.#G(),Q({selectedNode:null,selectionStatus:r?t.selectionStatus:`none`,effectiveRole:null,transportStatus:`idle`,sessionStatus:`closed`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1,browserStatus:t.browserStatus===`synchronizing`||t.browserStatus===`checking-access`?`current`:t.browserStatus,errorMessage:r?t.errorMessage:null,errorReason:r?t.errorReason??null:null,generation:t.generation+1}),await Wf(n.environmentId)}retrySelectedNode(){if(this.#c)return this.#c;let e=new AbortController;this.#s=e;let t=this.#B(e.signal).finally(()=>{this.#s===e&&(this.#s=null),this.#c===t&&(this.#c=null)});return this.#c=t,t}async#B(e){if(e.aborted||(await this.#d,e.aborted))return;let t=Z.getState(),n=t.selectedNode;if(!n||n.revokedAt!==null||t.accountStatus!==`authenticated`||t.directoryStatus!==`ready`||(t=Z.getState(),e.aborted||t.selectedNode?.id!==n.id||t.selectedNode.environmentId!==n.environmentId||t.selectedNode.revokedAt!==null||t.accountStatus!==`authenticated`||t.directoryStatus!==`ready`))return;let r=t.sessionStatus===`delivery-unknown`||Y().hasPendingRelayRequests(),i=t.generation+1;this.#G(),Q({selectionStatus:n.presence.online?`online`:`offline`,effectiveRole:n.effectiveRole,transportStatus:`idle`,sessionStatus:r?`delivery-unknown`:`synchronizing`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1,errorMessage:null,generation:i}),this.#W(i);try{await Kf(n,n.environmentId,e)}catch{if(e.aborted)return;this.#K(i)}}transportStatus(e,t){Z.getState().generation===e&&Q({transportStatus:t})}sessionStatus(e,t){let n=Z.getState();if(n.generation===e){if(n.sessionStatus===`delivery-unknown`&&t!==`closed`){Q({sessionRecoveredAfterUnknown:!1});return}Q({sessionStatus:t,sessionRecoveredAfterUnknown:!1})}}role(e,t){let n=Z.getState();n.generation===e&&Q({effectiveRole:n.directoryStatus===`ready`?t:null})}failure(e,t){let n=Z.getState();if(n.generation!==e)return;let r=t.kind===`revoked`?`revoked`:t.kind===`authorization-removed`?`authorization-removed`:t.kind===`incompatible`?`incompatible`:n.selectedNode?.presence.online?n.selectionStatus:`offline`;t.retryable||this.#G(),Q({selectionStatus:r,effectiveRole:t.retryable?n.effectiveRole:null,transportStatus:t.retryable?`reconnecting`:`terminal-failure`,sessionStatus:n.sessionStatus===`delivery-unknown`?`delivery-unknown`:`stale`,browserStatus:!t.retryable&&n.browserStatus===`synchronizing`?`current`:n.browserStatus,errorMessage:_p(t)})}markDeliveryUnknown(e){Z.getState().generation===e&&Q({sessionStatus:`delivery-unknown`,sessionRecoveredAfterUnknown:!1})}connectionClosed(e){let t=Z.getState();t.generation===e&&t.transportStatus!==`terminal-failure`&&Q({transportStatus:`reconnecting`,sessionStatus:t.sessionStatus===`delivery-unknown`?`delivery-unknown`:`stale`,sessionRecoveredAfterUnknown:!1})}markSessionReady(e){let t=Z.getState();if(t.selectedNode?.environmentId===e){if(this.#G(),t.sessionStatus===`delivery-unknown`){Q({sessionEstablished:!0,sessionRecoveredAfterUnknown:!0,browserStatus:t.browserStatus===`synchronizing`?`current`:t.browserStatus});return}Q({sessionStatus:`ready`,sessionEstablished:!0,sessionRecoveredAfterUnknown:!1,browserStatus:t.browserStatus===`synchronizing`?`current`:t.browserStatus})}}markSessionReplaying(e){let t=Z.getState();if(t.selectedNode?.environmentId===e){if(t.sessionStatus===`delivery-unknown`){Q({sessionRecoveredAfterUnknown:!1});return}Q({sessionStatus:`replaying`,browserStatus:t.browserStatus===`current`||t.browserStatus===`synchronizing`?`synchronizing`:t.browserStatus})}}reportShellSnapshotFailure(e){let t=Z.getState();if(t.selectedNode?.environmentId===e){if(t.sessionEstablished){console.warn(`hosted_snapshot_reconciliation_failed`);return}this.#K(t.generation)}}acknowledgeDeliveryUnknown(){let e=Z.getState();e.sessionStatus!==`delivery-unknown`||!e.sessionRecoveredAfterUnknown||Q({sessionStatus:`ready`,sessionRecoveredAfterUnknown:!1})}#V(){this.#e?.abort();let e=new AbortController;return this.#e=e,e}#H(e){this.#U();let t=Y();if(!t.isForeground()){t.subscribeForeground(()=>{t.isForeground()&&(this.#U(),this.refreshDirectory())});return}this.#t=t.timers.setTimeout(()=>void this.refreshDirectory(),e)}#U(){this.#t&&Y().timers.clearTimeout(this.#t),this.#t=null}#W(e){this.#G();let t=Z.getState();t.generation!==e||t.sessionEstablished||(this.#o=Y().timers.setTimeout(()=>this.#K(e),lp))}#G(){this.#o&&Y().timers.clearTimeout(this.#o),this.#o=null}#K(e){let t=Z.getState();t.generation!==e||t.sessionEstablished||(this.#G(),Q({transportStatus:`terminal-failure`,sessionStatus:t.sessionStatus===`delivery-unknown`?`delivery-unknown`:`stale`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1,browserStatus:t.browserStatus===`synchronizing`?`current`:t.browserStatus,errorMessage:up}))}async#q(e,t){this.#G(),await Wf(e),Z.getState().generation===t&&Q({selectedNode:null,transportStatus:`idle`,sessionStatus:`closed`,sessionEstablished:!1,sessionRecoveredAfterUnknown:!1})}};function _p(e){switch(e.kind){case`offline`:return`The selected node is offline. Ryco will reconnect when it becomes available.`;case`revoked`:return`Access to the selected node was revoked.`;case`authorization-removed`:return`Your authorization for the selected node was removed.`;case`incompatible`:return`The selected node uses an incompatible relay protocol version.`;case`draining`:return`Hub is draining connections. Ryco will retry shortly.`;case`slow-consumer`:return`The relay closed a slow connection. Ryco will reconnect.`;case`authentication`:return`The relay authentication attempt expired or was rejected.`;case`rate-limited`:return`Relay attempts are temporarily rate limited.`;default:return e.retryable?`The relay connection was interrupted. Ryco is reconnecting.`:`The relay connection could not be established.`}}var vp=new gp;function yp(e,t){Z.getState().generation===t&&vp.markSessionReady(e)}function bp(e,t){Z.getState().generation===t&&vp.markSessionReplaying(e)}function xp(e,t){Z.getState().generation===t&&vp.reportShellSnapshotFailure(e)}var Sp={idle:`idle`,"requesting-ticket":`requesting ticket`,connecting:`connecting`,authenticating:`authenticating`,"opening-channel":`opening channel`,online:`online`,reconnecting:`Reconnecting`,draining:`draining`,"terminal-failure":`terminal failure`},Cp={unavailable:`Online`,negotiating:`Securing`,verified:`Encrypted`,unverified:`Not verified`,"web-unsigned":`Browser encrypted`,legacy:`Legacy`};function wp(e){let{browserStatus:t,sessionStatus:n,selectionStatus:r,transportStatus:i}=e,a=e.e2eeStatus??`unavailable`;return t===`offline`?`Offline`:t===`checking-access`?`Checking access`:t===`synchronizing`?`Synchronizing`:t===`suspended`||t===`stale`?`Stale`:n===`delivery-unknown`?`Delivery unknown`:r===`authorization-removed`?`Authorization removed`:r===`revoked`?`Revoked`:r===`incompatible`?`Incompatible`:i===`online`&&n===`ready`?Cp[a]:i===`reconnecting`?`Reconnecting`:r===`offline`?`Offline`:Sp[i]}var Tp={Offline:{shortLabel:`Offline`,connected:!1,guarantee:`none`},"Checking access":{shortLabel:`Checking`,connected:!1,guarantee:`none`},Synchronizing:{shortLabel:`Syncing`,connected:!1,guarantee:`none`},Stale:{shortLabel:`Stale`,connected:!1,guarantee:`none`},"Delivery unknown":{shortLabel:`Unconfirmed`,connected:!1,guarantee:`none`},"Authorization removed":{shortLabel:`No access`,connected:!1,guarantee:`none`},Revoked:{shortLabel:`Revoked`,connected:!1,guarantee:`none`},Incompatible:{shortLabel:`Incompatible`,connected:!1,guarantee:`none`},Online:{shortLabel:`Online`,connected:!0,guarantee:`none`},Encrypted:{shortLabel:`Encrypted`,connected:!0,guarantee:`e2ee`},"Browser encrypted":{shortLabel:`Unsigned web`,connected:!0,guarantee:`web`},Legacy:{shortLabel:`Legacy`,connected:!0,guarantee:`legacy`},"Not verified":{shortLabel:`Not verified`,connected:!1,guarantee:`none`},Securing:{shortLabel:`Securing`,connected:!1,guarantee:`none`},Reconnecting:{shortLabel:`Reconnecting`,connected:!1,guarantee:`none`},idle:{shortLabel:`Idle`,connected:!1,guarantee:`none`},"requesting ticket":{shortLabel:`Preparing`,connected:!1,guarantee:`none`},connecting:{shortLabel:`Connecting`,connected:!1,guarantee:`none`},authenticating:{shortLabel:`Verifying`,connected:!1,guarantee:`none`},"opening channel":{shortLabel:`Opening`,connected:!1,guarantee:`none`},online:{shortLabel:`Not ready`,connected:!1,guarantee:`none`},draining:{shortLabel:`Closing`,connected:!1,guarantee:`none`},"terminal failure":{shortLabel:`Failed`,connected:!1,guarantee:`none`}};Object.keys(Tp);function Ep(e){return Tp[wp(e)]}function Dp(e){return e.hosted?!e.fresh||e.browserCurrent===!1||e.sessionReady===!1?{hosted:!0,allowed:!1,reason:`This action is unavailable while Hub authorization or the relay is stale.`}:td(e.role,e.method,!0)?{hosted:!0,allowed:!0,reason:null}:{hosted:!0,allowed:!1,reason:`This action is unavailable for your role on the selected node.`}:{hosted:!1,allowed:!0,reason:null}}export{sl as $,Ku as A,pn as At,jl as B,nn as Bt,pd as C,en as Ct,Cu as D,dn as Dt,Su as E,hn as Et,qu as F,cn as Ft,Pl as G,Ht as Gt,Hl as H,$t as Ht,Fu as I,ln as It,kl as J,Fl as K,Ut as Kt,Zu as L,sn as Lt,tu as M,vn as Mt,Ju as N,bn as Nt,bu as O,fn as Ot,Xu as P,an as Pt,ll as Q,yl as R,on as Rt,fd as S,un as St,xu as T,yn as Tt,Ml as U,Zt as Ut,Ll as V,Wt as Vt,Nl as W,Qt as Wt,Vl as X,Il as Y,cl as Z,q as _,Un as _t,Xf as a,el as at,sf as b,sr as bt,Zf as c,ol as ct,xp as d,ao as dt,qc as et,If as f,Ja as ft,Af as g,Gn as gt,Pf as h,Wn as ht,up as i,U as it,Yu as j,_n as jt,au as k,mn as kt,yp as l,Sc as lt,Y as m,Tr as mt,Ep as n,al as nt,vp as o,rl as ot,X as p,va as pt,Al as q,wp as r,il as rt,Z as s,Qc as st,Dp as t,Gc as tt,bp as u,bc as ut,rf as v,Yn as vt,td as w,gn as wt,nd as x,rr as xt,nf as y,ir as yt,Kl as z,rn as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{r as t}from"./useRenderElement-DchFnsR8.js";import{t as n,u as r}from"./utils-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{r as t}from"./useRenderElement-DchFnsR8.js";import{t as n,u as r}from"./utils-Ct58OPtz.js";import{r as i}from"./button-WR80VgkK.js";var a=e(),o=r(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-sm px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button&,a&]:hover:bg-destructive/90`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,outline:`border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`}}});function s(e){let r=(0,a.c)(9),s,c,l,u;if(r[0]!==e){let{className:a,variant:d,size:f,render:p,...m}=e;s=p;let h={className:n(o({className:a,size:f,variant:d})),"data-slot":`badge`};u=i,c=`span`,l=t(h,m),r[0]=e,r[1]=s,r[2]=c,r[3]=l,r[4]=u}else s=r[1],c=r[2],l=r[3],u=r[4];let d;return r[5]!==s||r[6]!==c||r[7]!==l?(d={defaultTagName:c,props:l,render:s},r[5]=s,r[6]=c,r[7]=l,r[8]=d):d=r[8],u(d)}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(){return typeof window>`u`?null:window.desktopBridge?.getAppBranding?.()??null}var t=e(),n=t?.baseName??`Ryco`,r=t?.stageLabel??`Beta`,i=t?.displayName??`${n} (${r})`,a=`0.1.
|
|
1
|
+
function e(){return typeof window>`u`?null:window.desktopBridge?.getAppBranding?.()??null}var t=e(),n=t?.baseName??`Ryco`,r=t?.stageLabel??`Beta`,i=t?.displayName??`${n} (${r})`,a=`0.1.18`;export{a as i,i as n,r,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{r as t,t as n}from"./useRenderElement-DchFnsR8.js";import{t as r,u as i}from"./utils-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{r as t,t as n}from"./useRenderElement-DchFnsR8.js";import{t as r,u as i}from"./utils-Ct58OPtz.js";function a(e){return n(e.defaultTagName??`div`,e,e)}var o=e(),s=i(`[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:top-1/2 pointer-coarse:after:left-1/2 pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 pointer-coarse:after:-translate-x-1/2 pointer-coarse:after:-translate-y-1/2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{cta:`h-auto min-h-11 whitespace-normal px-[calc(--spacing(4)-1px)] py-2 text-base [&_svg:not([class*='size-'])]:size-5`,default:`h-9 px-[calc(--spacing(3)-1px)] sm:h-8`,icon:`size-9 sm:size-8`,"icon-lg":`size-10 sm:size-9`,"icon-sm":`size-8 sm:size-7`,"icon-xl":`size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,"icon-xs":`size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5`,lg:`h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9`,sm:`h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7`,xl:`h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5`,xs:`h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5`},variant:{default:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-primary/90`,destructive:`not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-destructive/90`,"destructive-outline":`border-input bg-popover not-dark:bg-clip-padding text-destructive-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/32 [:hover,[data-pressed]]:bg-destructive/4`,ghost:`border-transparent text-foreground data-pressed:bg-accent [:hover,[data-pressed]]:bg-accent`,link:`border-transparent underline-offset-4 [:hover,[data-pressed]]:underline`,outline:`border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64`,secondary:`border-transparent bg-secondary text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80 [:hover,[data-pressed]]:bg-secondary/90`}}});function c(e){let n=(0,o.c)(9),i,c,l,u;if(n[0]!==e){let{className:o,variant:d,size:f,render:p,...m}=e;i=p;let h=i?void 0:`button`,g={className:r(s({className:o,size:f,variant:d})),"data-slot":`button`,type:h};u=a,c=`button`,l=t(g,m),n[0]=e,n[1]=i,n[2]=c,n[3]=l,n[4]=u}else i=n[1],c=n[2],l=n[3],u=n[4];let d;return n[5]!==i||n[6]!==c||n[7]!==l?(d={defaultTagName:c,props:l,render:i},n[5]=i,n[6]=c,n[7]=l,n[8]=d):d=n[8],u(d)}export{s as n,a as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{n as t}from"./env-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qmuS0Svy.js";import{n as t}from"./env-Bcy-9P3V.js";import{P as n}from"./runtime-Cy36EhFa.js";import{t as r}from"./authorization-BNZY2k8w.js";var i=e();function a(e){let a=(0,i.c)(7),s=n(o),c;return a[0]!==e||a[1]!==s.browserStatus||a[2]!==s.directoryStatus||a[3]!==s.effectiveRole||a[4]!==s.sessionStatus||a[5]!==s.transportStatus?(c=r({hosted:t(),role:s.effectiveRole,fresh:s.directoryStatus===`ready`&&s.transportStatus===`online`,browserCurrent:s.browserStatus===`current`,sessionReady:s.sessionStatus===`ready`,method:e}),a[0]=e,a[1]=s.browserStatus,a[2]=s.directoryStatus,a[3]=s.effectiveRole,a[4]=s.sessionStatus,a[5]=s.transportStatus,a[6]=c):c=a[6],c}function o(e){return e}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./env-
|
|
1
|
+
import{g as e}from"./env-Bcy-9P3V.js";import{f as t}from"./useRenderElement-DchFnsR8.js";var n=t(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]);function r(t){return t.activeThread?e(t.activeThread.environmentId,t.activeThread.projectId):t.activeDraftThread?e(t.activeDraftThread.environmentId,t.activeDraftThread.projectId):t.defaultProjectRef}function i(e){return{branch:e.activeThread?.branch??e.activeDraftThread?.branch??null,worktreePath:e.activeThread?.worktreePath??e.activeDraftThread?.worktreePath??null,envMode:e.activeDraftThread?.envMode??(e.activeThread?.worktreePath?`worktree`:`local`)}}function a(e){return{envMode:e.defaultThreadEnvMode}}async function o(e,t){await e.handleNewThread(t,i(e))}async function s(e){let t=r(e);return t?(await o(e,t),!0):!1}async function c(e){let t=r(e);return t?(await e.handleNewThread(t,a(e)),!0):!1}export{n as i,s as n,o as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-DXTD6mKH.js";import{Dt as i,M as a,Mn as o,N as s,Nn as c,Rn as l,Sn as u,Xn as d,Yn as f,in as p,j as m,jt as h,kn as g,kt as _,on as v}from"./usePopupViewport-SxCh7dCg.js";import{d as y,i as b,l as x,t as S}from"./useRenderElement-DchFnsR8.js";import{t as C}from"./utils-Ct58OPtz.js";import{t as w}from"./useButton-DXIv8wCn.js";import{n as T}from"./clamp-CgH0Dl6R.js";var E=e(t(),1);function D(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=T({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:l,setMounted:u,transitionStatus:d}=s(a,!0,!0),f=p(),[m,h]=E.useState(),_=m===null?void 0:m??f,y=c(e=>{let t=!a,n=v(g,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return E.useMemo(()=>({defaultPanelId:f,disabled:i,handleTrigger:y,mounted:l,open:a,panelId:_,setMounted:u,setOpen:o,setPanelIdState:h,transitionStatus:d}),[f,i,y,l,a,_,u,o,h,d])}var O=E.createContext(void 0);function k(){let e=E.useContext(O);if(e===void 0)throw Error(y(15));return e}var A=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=f.startingStyle]=`startingStyle`,e[e.endingStyle=f.endingStyle]=`endingStyle`,e}({}),j=function(e){return e.panelOpen=`data-panel-open`,e}({}),M={[A.open]:``},N={[A.closed]:``},P={open(e){return e?{[j.panelOpen]:``}:null}},F={open(e){return e?M:N},...d},I=r(),L=E.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:l,...u}=e,d=c(o),f=D({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),p=E.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=E.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),h=S(`div`,e,{state:p,ref:t,props:u,stateAttributesMapping:F});return(0,I.jsx)(O.Provider,{value:m,children:h})}),R={...P,...d},z=E.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=k(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=w({disabled:c,focusableWhenDisabled:!0,native:u});return S(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:R})}),B={height:void 0,width:void 0};function V(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:s,mounted:l,onOpenChange:d,open:f,setMounted:p,setOpen:g,transitionStatus:y}=e,b=E.useRef(null),S=E.useRef(null),[C,w]=E.useState(B),T=E.useRef(B),D=E.useRef(!1),O=E.useRef(f),k=E.useRef(!1),[j,M]=E.useState(!1),N=E.useRef(null),P=x(t,b),F=_(f),I=a(b),L=!f&&!l,R=j?`idle`:y,z=f&&(O.current||k.current),V=!f&&l&&S.current===`css-animation`&&C.height===void 0&&C.width===void 0?T.current:C,W=n&&L&&S.current!==`css-animation`,q=c((e,t=!0)=>{t&&(T.current=e),w(e)}),J=c(()=>{N.current?.(),N.current=null}),Y=c(e=>{J(),N.current=()=>{N.current=null,e()}}),X=c(()=>{f&&l&&S.current===`css-animation`&&(k.current=!0)});o(()=>{!j||y===`starting`||M(!1)},[j,y]),E.useEffect(()=>()=>{X(),J()},[X,J]),o(()=>{let e=b.current;if(!e)return;!f&&N.current&&J();let t=U(e,z);if(S.current=t,f&&y===`idle`&&O.current&&t===`css-animation`){T.current=H(e);return}if(f&&y===`starting`){let n=D.current;if(D.current=!1,t===`none`){q(H(e)),M(!0);return}if(t===`css-transition`){let t=K(e);if(q(H(e)),!n)return t;let r=G(e,`transition-duration`,`0s`);return Y(r),M(!0),t}q(H(e));let r=G(e,`animation-name`,`none`);if(!n){r();return}let i=G(e,`animation-duration`,`0s`);r(),Y(i),M(!0);return}if(!f&&l&&(y===`idle`||y===`starting`)){if(O.current=!1,k.current=!1,t===`none`){q(B,!1),p(!1);return}q(H(e));return}if(y!==`ending`)return;if(t===`none`){p(!1);return}let n=H(e);if(!(n.height>0||n.width>0)){p(!1);return}q(n),t===`css-animation`&&G(e,`animation-name`,`none`)()},[l,f,J,q,p,Y,z,y]),m({enabled:f&&l&&R===`idle`,open:!0,ref:b,onComplete(){f&&q(B,!1)}}),E.useEffect(()=>{if(f||!l||R!==`ending`||!b.current)return;let e=new AbortController,t=-1;function n(){F.current||(p(!1),q(B,!1))}return t=i.request(()=>{I(n,e.signal)}),()=>{i.cancel(t),e.abort()}},[F,l,f,R,I,q,p]),o(()=>{let e=b.current;!e||!n||!L||e.setAttribute(`hidden`,`until-found`)},[L,n]),E.useEffect(function(){let e=b.current;if(!e)return;function t(e){let t=v(u,e);d(!0,t),!t.isCanceled&&(D.current=!0,g(!0))}return h(e,`beforematch`,t)},[d,g]);let Z=s||n||l||f;return{height:V.height,props:{...W?{[A.startingStyle]:``}:void 0,hidden:L,id:r},ref:P,shouldPreventOpenAnimation:z,shouldRender:Z,transitionStatus:R,width:V.width}}function H(e){return{height:e.scrollHeight,width:e.scrollWidth}}function U(e,t){let n=l(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&W(n.animationDuration),i=W(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function W(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function G(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function K(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=i.request(n);return()=>{i.cancel(r),n()}}var q=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),J=E.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:s,style:c,...l}=e,{defaultPanelId:u,mounted:d,onOpenChange:f,open:p,setMounted:m,setPanelIdState:h,setOpen:g,state:_,transitionStatus:v}=k(),y=r??!1,x=i??!1,C=s||void 0,w=C??u;o(()=>(h(e=>C??(e===null?void 0:e)),()=>{h(e=>e===C?null:e)}),[C,h]);let{height:T,props:E,ref:D,shouldPreventOpenAnimation:O,shouldRender:A,transitionStatus:j,width:M}=V({externalRef:t,hiddenUntilFound:y,id:w,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:m,setOpen:g,transitionStatus:v}),N={..._,transitionStatus:j},P=b(c,N),I=S(`div`,{...e,style:void 0},{state:N,ref:D,props:[E,{style:{[q.collapsiblePanelHeight]:T===void 0?`auto`:`${T}px`,[q.collapsiblePanelWidth]:M===void 0?`auto`:`${M}px`}},l,P?{style:P}:void 0,O?{style:{animationName:`none`}}:void 0],stateAttributesMapping:F});return A?I:null}),Y=n();function X(e){let t=(0,Y.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(L,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function Z(e){let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=C(`cursor-pointer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,I.jsx)(z,{className:i,"data-slot":`collapsible-trigger`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Q(e){let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=C(`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0 data-open:data-ending-style:[height:var(--collapsible-panel-height)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,I.jsx)(J,{className:i,"data-slot":`collapsible-panel`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{Q as n,Z as r,X as t};
|