@harsh132/crew-ai 0.1.0
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/README.md +42 -0
- package/bin/crew.mjs +49 -0
- package/dist/assets/AccountNotFoundScreen-mrDHRRtZ-CNwZwgdA.js +1 -0
- package/dist/assets/AddFundsSelectionScreen-D76JlRA1-Dx0vImHm.js +24 -0
- package/dist/assets/Address-9aHCoAYt-Ca6TQh8z.js +17 -0
- package/dist/assets/AffirmativeConsentScreen-Cva7mCde-BpKZB2xK.js +6 -0
- package/dist/assets/AllowlistRejectionScreen-CJlenrjE-a-xZa8sX.js +1 -0
- package/dist/assets/ApiController-Dm_aZs5q.js +5 -0
- package/dist/assets/ArrowsRightLeftIcon-Cpc9sQGG.js +1 -0
- package/dist/assets/AuthenticateWithWalletScreen-C_zdZyDa-BP8lHEUi.js +1 -0
- package/dist/assets/AwaitingEvmToSolBridgingScreen-Ch3fh4A4-B1BDspph.js +1 -0
- package/dist/assets/AwaitingExternalEthereumTransferScreen-C9yfbYim-BN1YAQmx.js +1 -0
- package/dist/assets/AwaitingPasswordlessCodeScreen-DkpWm3cl-DB6yuR1m.js +103 -0
- package/dist/assets/AwaitingSolToEvmBridgingScreen-D-2h-r2V-DDx-QToS.js +1 -0
- package/dist/assets/BridgeNetworkSelectionView-DPw4O-jL-DLiXJ_7u.js +68 -0
- package/dist/assets/CaptchaScreen-DTWKq3oC-DStoNOyV.js +1 -0
- package/dist/assets/CheckCircleIcon-DTHMHp70.js +1 -0
- package/dist/assets/CheckCircleIcon-jhB7zp8X.js +1 -0
- package/dist/assets/Checkbox-D1EDeo41-B4iShCep.js +52 -0
- package/dist/assets/ChevronDownIcon-cvBdBC_R.js +1 -0
- package/dist/assets/Chip-CZKIKt9K-DGpuw9Pi.js +26 -0
- package/dist/assets/CoinbaseOnrampStatusScreen-yM8i1dq5-nwvQM-i-.js +16 -0
- package/dist/assets/ConnectEmailForm-CvtooZ8i-CVf2LNEF.js +3 -0
- package/dist/assets/ConnectLedgerScreen-COys-OjJ-CAsBrjgm.js +10 -0
- package/dist/assets/ConnectOnlyLandingScreen-C3myVsvL-CcdSW7Hi.js +1 -0
- package/dist/assets/ConnectOnlyStatusScreen-B-uqGIbz-Dre9H6bQ.js +1 -0
- package/dist/assets/ConnectOrCreateScreen-DD7cB8dy-CxI8fTvv.js +1 -0
- package/dist/assets/ConnectPhoneForm-BClRnco--CqcBfBZV.js +95 -0
- package/dist/assets/ConnectWalletView-D37hqEee-C1VppGRt.js +74 -0
- package/dist/assets/ConnectionStatusScreen-gJeQDnkD-Cv2Xchgs.js +7 -0
- package/dist/assets/ConnectorUtil-BS3XprR9.js +21 -0
- package/dist/assets/ConstantsUtil-DmLsRHAl.js +198 -0
- package/dist/assets/CopyToClipboard-i_OQSBJr-DWOP52LO.js +39 -0
- package/dist/assets/CopyableText-CQapvaMr-jG_q6v_s.js +28 -0
- package/dist/assets/CrossAppAuthScreen-DO1JO_KV-BpsT4WQL.js +1 -0
- package/dist/assets/CustomLandingScreenView-mjmDHGwr-CMorV_Ld.js +22 -0
- package/dist/assets/DelegatedActionsConsentScreen-BCgARvf7-CSJZU-up.js +1 -0
- package/dist/assets/DelegatedActionsRevokeScreen-BcwL74R--SCAuQ-OG.js +1 -0
- package/dist/assets/DepositAddressScreen-CDAmKcTm-C9_lhGWr.js +194 -0
- package/dist/assets/EmailInputForm-Cqo1mda8-C2y9xKLb.js +124 -0
- package/dist/assets/EmbeddedWalletConnectingScreen-CM-Kfv91-Dcp-OR3s.js +1 -0
- package/dist/assets/EmbeddedWalletCreatedScreen-Zscvn5zZ-B0V78kud.js +1 -0
- package/dist/assets/EmbeddedWalletKeyExportScreen-CP5NN-uM-D_2C420x.js +23 -0
- package/dist/assets/EmbeddedWalletOnAccountCreateScreen-Cc3IEizD-DfNQs_i3.js +1 -0
- package/dist/assets/EmbeddedWalletPasswordUpdateScreen-vT10Bm2m-o80m8UEV.js +1 -0
- package/dist/assets/EmbeddedWalletPasswordUpdateSplashScreen-BuBFHC6o-BpBfi_F9.js +1 -0
- package/dist/assets/EnrollTotp-C2nNwn93-ByQ2HtBV.js +66 -0
- package/dist/assets/EnvelopeIcon-D-QmesNq.js +1 -0
- package/dist/assets/ErrorBanner-BcpGRt0h-CNeXqIfc.js +21 -0
- package/dist/assets/ErrorMessage-D8VaAP5m-BpdhHW8B.js +8 -0
- package/dist/assets/ErrorScreen-CudzJvQF-Cj9CtRmk.js +4 -0
- package/dist/assets/ExclamationCircleIcon-kT4sJAq0.js +1 -0
- package/dist/assets/ExclamationTriangleIcon-BhYaWuCF.js +1 -0
- package/dist/assets/FarcasterConnectStatusScreen-AJge1G0j-C8K2lc0Q.js +75 -0
- package/dist/assets/FarcasterSignerStatusScreen-Cjd-9_IN-LdgPyHZj.js +28 -0
- package/dist/assets/FiatOnrampScreen-D-ijGLq9-BEItduae.js +488 -0
- package/dist/assets/FingerPrintIcon-DtmKp0tV.js +1 -0
- package/dist/assets/FundSolWalletWithExternalSolanaWallet-Bu7nN8uS-BJ53Vh4u.js +1 -0
- package/dist/assets/FundWalletMethodHeader-CkyJhN9p-BHOErvVi.js +1 -0
- package/dist/assets/FundWithBankDepositScreen-CbY8cUX1-BeX7F-2Q.js +58 -0
- package/dist/assets/FundingEditAmountScreen-DTonST2j-CP-yThbV.js +1 -0
- package/dist/assets/FundingMethodSelectionScreen-CebSau1c-BBhI5kL1.js +1 -0
- package/dist/assets/GlobeAltIcon-CP8HEwal.js +1 -0
- package/dist/assets/GooglePay-B53WnudL-TJc_nnUf.js +1 -0
- package/dist/assets/HCaptchaWrapper-CUi9LJsp-DWJGs0TK.js +4 -0
- package/dist/assets/InAppBrowserLoginNotPossible-BsOHoSJE-D5QraLs1.js +1 -0
- package/dist/assets/InfoBanner-Cb3p1z12-scQ-B3pk.js +22 -0
- package/dist/assets/InjectedWalletIcon-DLcYOGDj-wWhqDdys.js +1 -0
- package/dist/assets/InstallWalletScreen-BTkuwBNN-De-8so3x.js +1 -0
- package/dist/assets/JsonTree-BHzNC-ic-D9-xP7_V.js +34 -0
- package/dist/assets/LabelXs-oqZNqbm_-nENvK4Q2.js +6 -0
- package/dist/assets/LandingScreen-DA4XFqxS-BxIJeNon.js +1 -0
- package/dist/assets/Layouts-BMRfo5hw-DR1mfDO_.js +77 -0
- package/dist/assets/Link-DTncR-24-tWodMdTl.js +40 -0
- package/dist/assets/LinkConflictScreen-CZztICqG-Dz0I_qBv.js +77 -0
- package/dist/assets/LinkEmailScreen-DGPysBCv-Cudkz47L.js +1 -0
- package/dist/assets/LinkPasskeyScreen-CxW7ka3t-Dx8PYJsw.js +117 -0
- package/dist/assets/LinkPhoneScreen-CJcpCkxo-BTbUhvx9.js +1 -0
- package/dist/assets/Loader-UAZqxsnw-CoDoKvWJ.js +62 -0
- package/dist/assets/LoadingSkeleton-BMsgO5PV-DSh5kFAG.js +17 -0
- package/dist/assets/LockClosedIcon-RucwJCR_.js +1 -0
- package/dist/assets/LoginFailedScreen-Dze4SI3Y-BVBzu7sL.js +1 -0
- package/dist/assets/ManualTransferScreen-Drt1Mp6E-CbK48hbd.js +1 -0
- package/dist/assets/MfaAuthEnrollmentFlowScreen-5IWp37BG-B0sW1OVK.js +1 -0
- package/dist/assets/MfaAuthVerifyFlowScreen-W132fIHD-D8DNNteP.js +1 -0
- package/dist/assets/MfaEnrollmentFlowScreen-B2ZcSeBE-DE3DvN-Z.js +1 -0
- package/dist/assets/MfaVerifyFlowScreen-CzNn41ji-0FnJaanM.js +1 -0
- package/dist/assets/ModalFooter-DKyozrEX-DWQrl9hN.js +403 -0
- package/dist/assets/MoonpayStatusScreen-Bey2zhxF-CbNJA_gu.js +16 -0
- package/dist/assets/OAuthStatusScreen-D8EiVa2Y-BxfKVL_9.js +1 -0
- package/dist/assets/OpenLink-CUpJ1mOr-Bzr_f0Wd.js +39 -0
- package/dist/assets/PasskeySelectSignupOrLogin-CwjunGne-VKReUS32.js +1 -0
- package/dist/assets/PasskeyStatusScreen-D0GgmiKb-BZ1fwR-4.js +6 -0
- package/dist/assets/PasswordRecoveryScreen-Q5SHSGfd-C44CmHs6.js +20 -0
- package/dist/assets/PhArrowCircleDown-D97G-BOA.js +14 -0
- package/dist/assets/PhArrowClockwise-DVgyFuez.js +14 -0
- package/dist/assets/PhArrowDown-87b1BizM.js +14 -0
- package/dist/assets/PhArrowLeft-Da0MfnbK.js +14 -0
- package/dist/assets/PhArrowRight-AdrIL4DW.js +14 -0
- package/dist/assets/PhArrowSquareOut-Bk2CMG3I.js +14 -0
- package/dist/assets/PhArrowUp-4sgyKPGx.js +14 -0
- package/dist/assets/PhArrowUpRight-BNghD2zq.js +14 -0
- package/dist/assets/PhArrowsClockwise-BXRn1GEl.js +14 -0
- package/dist/assets/PhArrowsDownUp-DM09Jo_3.js +14 -0
- package/dist/assets/PhArrowsLeftRight-MuKBLUoF.js +14 -0
- package/dist/assets/PhBank-fHbgCqqZ.js +14 -0
- package/dist/assets/PhBrowser-2-9m-AkM.js +14 -0
- package/dist/assets/PhCaretDown-BDNabFuL.js +14 -0
- package/dist/assets/PhCaretLeft-CI460R-A.js +14 -0
- package/dist/assets/PhCaretRight-D7ZS3Ls8.js +14 -0
- package/dist/assets/PhCaretUp-C-iIfyvO.js +14 -0
- package/dist/assets/PhCheck-DxQXn57r.js +14 -0
- package/dist/assets/PhCircleHalf-MJZeRBGF.js +14 -0
- package/dist/assets/PhClock-x3MS3Mwi.js +14 -0
- package/dist/assets/PhCompass-hYn3HhGN.js +14 -0
- package/dist/assets/PhCopy-CWNYcABI.js +14 -0
- package/dist/assets/PhCreditCard-Fy4pzwtt.js +14 -0
- package/dist/assets/PhCurrencyDollar-BgiaenCi.js +14 -0
- package/dist/assets/PhDesktop-CxrzCSv5.js +14 -0
- package/dist/assets/PhDeviceMobile-CsyA5Goi.js +14 -0
- package/dist/assets/PhDotsThree-D-k1BiYg.js +14 -0
- package/dist/assets/PhEnvelope-D8kzeNox.js +14 -0
- package/dist/assets/PhFunnelSimple-CfQs5DAW.js +14 -0
- package/dist/assets/PhGlobe-DvmSc9_A.js +14 -0
- package/dist/assets/PhIdentificationCard-CfkZm-5K.js +14 -0
- package/dist/assets/PhImage-Cf0J2ZfJ.js +14 -0
- package/dist/assets/PhInfo-Bwi51-2X.js +14 -0
- package/dist/assets/PhLightbulb-C4FZV7Es.js +14 -0
- package/dist/assets/PhMagnifyingGlass-C9u8jSCJ.js +14 -0
- package/dist/assets/PhPaperPlaneRight-zxQVvPLX.js +14 -0
- package/dist/assets/PhPlus-C4UoW-2n.js +14 -0
- package/dist/assets/PhPower-CFyWDmgD.js +14 -0
- package/dist/assets/PhPuzzlePiece-BjoNVfST.js +14 -0
- package/dist/assets/PhQrCode-CP3tFauY.js +14 -0
- package/dist/assets/PhQuestion-wOWJBd3G.js +14 -0
- package/dist/assets/PhQuestionMark-CV0k9C0Y.js +14 -0
- package/dist/assets/PhSealCheck-vIKzREuN.js +14 -0
- package/dist/assets/PhSignOut-CxELV-i0.js +14 -0
- package/dist/assets/PhSpinner-CGDmbzUd.js +14 -0
- package/dist/assets/PhTrash-C9PD0SAt.js +14 -0
- package/dist/assets/PhUser-0sWNXQeZ.js +14 -0
- package/dist/assets/PhVault-6JTskUcC.js +14 -0
- package/dist/assets/PhWarning-CoKs3gz6.js +14 -0
- package/dist/assets/PhWarningCircle-BXHw1fCt.js +14 -0
- package/dist/assets/PhX-DX0SFIqC.js +14 -0
- package/dist/assets/PhoneIcon-mqxUi40U.js +1 -0
- package/dist/assets/PinInput-DbZ0b1i1-CkvWEG0R.js +247 -0
- package/dist/assets/PrivyPluginContext-DA-yS5vO-CDgvyHSu.js +1 -0
- package/dist/assets/QrCode-CpGkVlXb-BvtkZ_GW.js +22 -0
- package/dist/assets/RecoveryOAuthStatusScreen-CGpbUHkL-DauzUqQs.js +1 -0
- package/dist/assets/RecoveryPasswordCreateScreen-Dr_WQf6A-BFoYHPOa.js +1 -0
- package/dist/assets/RecoverySelectionScreen-CagonGs_-D1LLtufh.js +7 -0
- package/dist/assets/SIWXUtil-CB3piUiD.js +12 -0
- package/dist/assets/Screen-DMmH56yL-BONUk9MS.js +175 -0
- package/dist/assets/ScreenHeader-CHmc4-Lu-Cwialz2C.js +31 -0
- package/dist/assets/ScreenLayout-DTsWfKKs-gf6mEESm.js +1 -0
- package/dist/assets/SelectSourceAsset-CXcAyH34-CrQc2CvF.js +140 -0
- package/dist/assets/SetAutomaticRecoveryScreen-Dz6S1LST-DxxI7aBI.js +14 -0
- package/dist/assets/SetWalletPasswordForm-B3EVuPZv-8w0PfIqr.js +11 -0
- package/dist/assets/ShieldCheckIcon-B5byLL0q.js +1 -0
- package/dist/assets/SignRequestScreen-ipPnPIlP-DjlwqB37.js +26 -0
- package/dist/assets/StackedContainer-B2vaEl56-CSWVo6_P.js +24 -0
- package/dist/assets/StandardSignAndSendTransactionScreen-DPcArlC7-uI27tguH.js +20 -0
- package/dist/assets/Subtitle-CV-2yKE4-BaRxbHL7.js +13 -0
- package/dist/assets/TelegramAuthScreen-Bb_tyqBP-BSuvScW6.js +1 -0
- package/dist/assets/Title-BnzYV3Is-ByrLkU4J.js +7 -0
- package/dist/assets/TodoList-DnyULl18-DcjnXpJH.js +36 -0
- package/dist/assets/TransactionDetails-BkfhYtAg-DtmWhXP3.js +109 -0
- package/dist/assets/TransactionErrorView-DLbrU4bp-DYe09cVy.js +178 -0
- package/dist/assets/TransferFromWalletScreen-DTZSqDtC-CXT4q9D4.js +31 -0
- package/dist/assets/TransferOrBridgeLoadingScreen-DUbPtRQe-BweKnV9Z.js +6 -0
- package/dist/assets/TurnstileWrapper-BmL4TDJu-C1ZljqAH.js +1 -0
- package/dist/assets/UpdateEmailScreen-LL6semse-BygwSi8c.js +1 -0
- package/dist/assets/UpdatePhoneScreen-CS7n7kwA-DN4yaYoN.js +1 -0
- package/dist/assets/UserLimitReachedScreen-Cq4YnJkA-BrSxSBdW.js +1 -0
- package/dist/assets/Value-DTgR824E-B7IXbyVg.js +27 -0
- package/dist/assets/WalletCards-DH1rqayz-CT6JT__W.js +1 -0
- package/dist/assets/WalletIcon-XKzVUAjE.js +1 -0
- package/dist/assets/WalletInfoCard-BpO3gP5Y-IumlKDdQ.js +29 -0
- package/dist/assets/WalletInterstitialScreen-CZboB6Va-DJlEjs_V.js +1 -0
- package/dist/assets/WalletLink-7Vc0Y1tZ-TJACjVN6.js +20 -0
- package/dist/assets/WalletOverflowButton-BsG-fdaJ-CfA-DNtB.js +1 -0
- package/dist/assets/WarningBanner-ZZqCEtZK-DZXanQlM.js +21 -0
- package/dist/assets/_esm-Diwx42KJ.js +8 -0
- package/dist/assets/analytics-mkkvFRju-BRBcadka.js +1 -0
- package/dist/assets/basic-CodwVTu4.js +1575 -0
- package/dist/assets/capitalizeFirstLetter-DmLYqXsO-DtOXx-2n.js +1 -0
- package/dist/assets/ccip-C3Vjk59S.js +32 -0
- package/dist/assets/ccip-D33NgLUV.js +1 -0
- package/dist/assets/check-BM01T5vi.js +1 -0
- package/dist/assets/chevron-down-C6zww19L.js +1 -0
- package/dist/assets/circle-alert-CU29J06e.js +1 -0
- package/dist/assets/circle-check-big-BR2wXS_n.js +1 -0
- package/dist/assets/circle-x-DUmAAGJw.js +1 -0
- package/dist/assets/context-xV99-GKt-D_PAQTXr.js +1 -0
- package/dist/assets/copy-BkA8KqAF.js +1 -0
- package/dist/assets/core-DJhku8Ql.js +2 -0
- package/dist/assets/createLucideIcon-DmNNZQFn.js +1 -0
- package/dist/assets/credit-card-Dc2lSkjL.js +1 -0
- package/dist/assets/dijkstra-BsSV2JU0.js +1 -0
- package/dist/assets/dist-Cm7pNAtL.js +1 -0
- package/dist/assets/dist-CoS6E-3x.js +1 -0
- package/dist/assets/dist-D03ChgcR.js +16 -0
- package/dist/assets/dist-Dl07uGq1.js +1 -0
- package/dist/assets/errors-DRgCdgfK-CJpKdU03.js +1 -0
- package/dist/assets/esm-C3DslVJx.js +1 -0
- package/dist/assets/esm-CY8oIzLS.js +36 -0
- package/dist/assets/esm-Ci1ogKuK.js +1 -0
- package/dist/assets/esm-DJNUAQDg.js +1 -0
- package/dist/assets/ethers-DKNnmkib-BCpmt8uR.js +1 -0
- package/dist/assets/eventemitter3-BB9OE-nf.js +1 -0
- package/dist/assets/events-context-BJ75xIIf-CYNYb_Ky.js +1 -0
- package/dist/assets/external-link-CX89hR89.js +1 -0
- package/dist/assets/farcaster-DPlSjvF5-fDPVMv4F.js +1 -0
- package/dist/assets/features-BLHkjJUy.js +2 -0
- package/dist/assets/fingerprint-pattern-Cp7j1QKS.js +1 -0
- package/dist/assets/floating-ui.react-Cw-d0Rmp.js +1 -0
- package/dist/assets/floating-ui.react-dom-CvVHChFs.js +1 -0
- package/dist/assets/formatErc20TokenAmount-BuPk9xcy-BVqOKQif.js +1 -0
- package/dist/assets/get-entropy-details-for-user-Bq7nAeEf-BxiiqenT.js +1 -0
- package/dist/assets/getChainName-DjpPdUSc-DUyKDrnp.js +1 -0
- package/dist/assets/getErc20Balance-DHgWH7_1-D498CggM.js +1 -0
- package/dist/assets/getErc20TokenInfo-DluFoVaC-BT8pxO6f.js +1 -0
- package/dist/assets/getFormattedUsdFromLamports-De3U9GlO-Gx4_wxON.js +1 -0
- package/dist/assets/getUsdcMintAddress-BVgm9GRo-r2UnDeEy.js +1 -0
- package/dist/assets/hmac-D_yamlhz.js +1 -0
- package/dist/assets/hooks.module-QanQLMCy.js +1 -0
- package/dist/assets/hourglass-Cg3o4_cb.js +1 -0
- package/dist/assets/id-UqEwL2BI-DBaJPjJB.js +1 -0
- package/dist/assets/index-BCRY02zL.js +77 -0
- package/dist/assets/index-BKK46WdR-CIT1mGom.js +12 -0
- package/dist/assets/index-CNRa7QGv.css +2 -0
- package/dist/assets/index-CWARkn2w-Bfi1vKEt.js +61 -0
- package/dist/assets/index-DkRtfMoa-7oM5LZg8.js +438 -0
- package/dist/assets/index-DmwSQBu2-DJjTbL_B.js +1 -0
- package/dist/assets/index-wHxkX697-DiHUiKHG.js +1 -0
- package/dist/assets/index.es-CwXtBCnD.js +4 -0
- package/dist/assets/isAddress-C6_gPDNS.js +2 -0
- package/dist/assets/jsx-runtime-CMaQg7dW.js +1 -0
- package/dist/assets/lib-bp6F03Um.js +1 -0
- package/dist/assets/localBatchGatewayRequest-yR_7m5UB.js +32 -0
- package/dist/assets/lock-Dbw4M4hN.js +1 -0
- package/dist/assets/mail-BCVv02Hb.js +1 -0
- package/dist/assets/modal-context-2Nf1WTbJ-CkR760DI.js +1 -0
- package/dist/assets/ofetch.CWycOUEr-CHp-crOQ.js +1 -0
- package/dist/assets/p256-B1d5Y6sM.js +1 -0
- package/dist/assets/parseEther-D_FKLPQO.js +1 -0
- package/dist/assets/pkce-B0PpK2pd-CkbNVGiy.js +1 -0
- package/dist/assets/preload-helper-QurRbaCr.js +2 -0
- package/dist/assets/prepareAuthorization-hDX99ycX.js +1 -0
- package/dist/assets/privy-context-i6NfqAl1-BONGHL94.js +1 -0
- package/dist/assets/property-DuZ9DLP4.js +3 -0
- package/dist/assets/react-DLzuq_tL.js +1 -0
- package/dist/assets/react-auth-sHnipzbS.js +1 -0
- package/dist/assets/react-dom-ChmAq1X2.js +1 -0
- package/dist/assets/reservoir-B7XIq5qj-j-r1ULqP.js +1 -0
- package/dist/assets/rolldown-runtime-C_s2cVnS.js +1 -0
- package/dist/assets/safe-url-D7SRPu33-CkMedGro.js +1 -0
- package/dist/assets/secp256k1-C8Ph-XiD.js +1 -0
- package/dist/assets/secp256k1-DZXeCH9F.js +1 -0
- package/dist/assets/sha256-fChkrcNS.js +1 -0
- package/dist/assets/sha3-D7MpjpcL.js +1 -0
- package/dist/assets/shared-DEkT-Gv3-DoqdOiYl.js +193 -0
- package/dist/assets/shared-FM0rljBt-B2Y0CoZ4.js +21 -0
- package/dist/assets/shouldProceedtoEmbeddedWalletCreationFlow-DDzHjOUJ-D78LT0Ws.js +1 -0
- package/dist/assets/simulateTransaction-BM0su-14-DKYYx4Yu.js +1 -0
- package/dist/assets/smartphone-BYDnV9zT.js +1 -0
- package/dist/assets/src-Dxu8F9ei.js +1 -0
- package/dist/assets/storage-j7ai9Sne-D8mWN3Z2.js +9 -0
- package/dist/assets/stripe.esm-BCW9KcRF.js +2 -0
- package/dist/assets/styles-BsotlekN-of63S6Pp.js +9 -0
- package/dist/assets/styles-C9oLwuTf-BrU3WqQp.js +92 -0
- package/dist/assets/styles-DVyDvTdj-BRvzvs97.js +74 -0
- package/dist/assets/styles-tjTwTW2h-9GCNH_Dh.js +164 -0
- package/dist/assets/telegram-B-JqnkqZ-BVmFrRSR.js +1 -0
- package/dist/assets/to-ui-error-CD8Q_l7P-BW6keC5U.js +4 -0
- package/dist/assets/toViemAccount-BE0ZbZYx-BqW9Bqj8.js +14 -0
- package/dist/assets/transaction-BNTP-bFm-M5tJx8vY.js +1 -0
- package/dist/assets/transfer-6YztDh-t-BVQkTvG-.js +1 -0
- package/dist/assets/triangle-alert-BjGbSItA.js +1 -0
- package/dist/assets/twitch-5IOe4sIQ--IPFzphL.js +1 -0
- package/dist/assets/use-deposit-address-za6ZBYoS-z0C8GF90.js +1 -0
- package/dist/assets/useActiveWallet-D3PAxAaJ-BVwosGzn.js +123 -0
- package/dist/assets/useGetSolPrice-x7gfUIHJ-CChrTtVQ.js +1 -0
- package/dist/assets/useGetTokenPrice-B9Z2p9XG-Bu19_6lM.js +1 -0
- package/dist/assets/useI18n-C0rfdPEH-DoMbAOal.js +1 -0
- package/dist/assets/usePrivy-DXAqHE25-CdUu2aK0.js +1 -0
- package/dist/assets/useWalletBalance-D47dI-xh-DKp-JCOX.js +1 -0
- package/dist/assets/utils-De7E53Fk.js +1 -0
- package/dist/assets/utils-oVEYY1QK.js +1 -0
- package/dist/assets/w3m-modal-CI7dmrlk.js +1174 -0
- package/dist/assets/wallet-BbJaOyCZ.js +1 -0
- package/dist/assets/wallet-connect-MWSDFRmF-tGAmUa5S.js +1 -0
- package/dist/assets/wui-ux-by-reown-Bl01NIb8.js +1147 -0
- package/dist/assets/x-DgidrGFV.js +1 -0
- package/dist/crewai-banner.png +0 -0
- package/dist/crewai-logo.svg +11 -0
- package/dist/crewai-mark.png +0 -0
- package/dist/crewai-mark.svg +10 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +85 -0
- package/package.json +43 -0
- package/server/main.mjs +153334 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import{o as e,t}from"./rolldown-runtime-C_s2cVnS.js";import{n,t as r}from"./jsx-runtime-CMaQg7dW.js";import{t as i}from"./react-dom-ChmAq1X2.js";import{A as a,C as o,D as s,E as c,O as l,T as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,j as b,k as x,l as S,m as C,n as w,o as T,p as E,s as D,v as ee,w as te,x as O,y as k}from"./floating-ui.react-dom-CvVHChFs.js";import{S as A,at as j,dt as ne,lt as M,mt as N,ot as P,r as F,rt as re,st as ie,ut as ae}from"./esm-CY8oIzLS.js";import{k as oe}from"./context-xV99-GKt-D_PAQTXr.js";import"./eventemitter3-BB9OE-nf.js";import{t as se}from"./preload-helper-QurRbaCr.js";import{p as ce}from"./storage-j7ai9Sne-D8mWN3Z2.js";import{c as I}from"./Loader-UAZqxsnw-CoDoKvWJ.js";import{d as L,s as le}from"./errors-DRgCdgfK-CJpKdU03.js";import{t as R}from"./lib-bp6F03Um.js";import{E as ue,N as de,P as z,R as fe,T as B,V as pe,b as me,f as he,n as ge,z as _e}from"./index-DkRtfMoa-7oM5LZg8.js";import{t as ve}from"./modal-context-2Nf1WTbJ-CkR760DI.js";import{s as ye}from"./usePrivy-DXAqHE25-CdUu2aK0.js";import{t as be}from"./createLucideIcon-DmNNZQFn.js";import{t as xe}from"./check-BM01T5vi.js";import{t as Se}from"./circle-x-DUmAAGJw.js";import{t as Ce}from"./credit-card-Dc2lSkjL.js";import{t as we}from"./lock-Dbw4M4hN.js";import{t as Te}from"./smartphone-BYDnV9zT.js";import{t as Ee}from"./wallet-BbJaOyCZ.js";import{t as De}from"./x-DgidrGFV.js";import{s as Oe}from"./ModalFooter-DKyozrEX-DWQrl9hN.js";import{t as ke}from"./ScreenLayout-DTsWfKKs-gf6mEESm.js";import{t as Ae}from"./InfoBanner-Cb3p1z12-scQ-B3pk.js";import{n as je}from"./CopyableText-CQapvaMr-jG_q6v_s.js";import{t as Me}from"./ConnectPhoneForm-BClRnco--CqcBfBZV.js";import{t as Ne}from"./WarningBanner-ZZqCEtZK-DZXanQlM.js";import{n as Pe,r as Fe,t as Ie}from"./SelectSourceAsset-CXcAyH34-CrQc2CvF.js";import{n as Le,t as Re}from"./GooglePay-B53WnudL-TJc_nnUf.js";var ze=be(`building`,[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]),Be=be(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Ve=be(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),He=be(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Ue=be(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),We=be(`landmark`,[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z`,key:`1m329m`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]),Ge=be(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Ke=be(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),qe=be(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=be(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]);function Ye(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Xe=Ye(`https://base-ui.com/production-error`,`Base UI`),V=e(n(),1);function Ze({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i&&e!==void 0?e:a,V.useCallback(e=>{i||o(e)},[])]}var H=typeof document<`u`?V.useLayoutEffect:()=>{};function Qe(e){let t=V.useRef(!0);t.current&&(t.current=!1,e())}var $e={...V},U={};function et(e,t){let n=V.useRef(U);return n.current===U&&(n.current=e(t)),n}var tt=$e.useInsertionEffect,nt=tt&&tt!==$e.useLayoutEffect?tt:e=>e();function W(e){let t=et(rt).current;return t.next=e,nt(t.effect),t.trampoline}function rt(){let e={next:void 0,callback:it,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function it(){}function at(e,t,n,r){let i=et(st).current;return ct(i,e,t,n,r)&&ut(i,[e,t,n,r]),i.callback}function ot(e){let t=et(st).current;return lt(t,e)&&ut(t,e),t.callback}function st(){return{callback:null,cleanup:null,refs:[]}}function ct(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function lt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ut(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function dt(e){let t=et(ft,e).current;return t.next=e,H(t.effect),t}function ft(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var pt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},mt={...pt,position:`fixed`,top:0,left:0},ht={...pt,position:`absolute`},gt=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),_t=t(((e,t)=>{t.exports=gt()})),vt=t((e=>{var t=n(),r=_t();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),yt=t(((e,t)=>{t.exports=vt()})),bt=19;function G(e){return bt>=e}var xt=[],St=void 0;function Ct(){return St}function wt(e){xt.push(e)}var Tt=_t(),Et=yt(),Dt=G(19)?At:jt;function Ot(e,t,n,r,i){return Dt(e,t,n,r,i)}function kt(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tt.useSyncExternalStore)(e.subscribe,a,a)}wt({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tt.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function At(e,t,n,r,i){let a=Ct();if(!a)return kt(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jt(e,t,n,r,i){return(0,Et.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mt=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ot(this,e,t,n,r)}};function Nt(){}var Pt=Object.freeze([]),Ft=Object.freeze({}),It=class extends Mt{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;H(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;H(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;H(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;H(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Ot(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=W(t??Nt);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Lt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Rt(e){return e?.ownerDocument||document}function K(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zt(e){V.useEffect(e,Pt)}var Bt=null;globalThis.requestAnimationFrame;var Vt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Ht=class e{static create(){return new e}static request(e){return Vt.request(e)}static cancel(e){return Vt.cancel(e)}currentId=Bt;request(e){this.cancel(),this.currentId=Vt.request(()=>{this.currentId=Bt,e()})}cancel=()=>{this.currentId!==Bt&&(Vt.cancel(this.currentId),this.currentId=Bt)};disposeEffect=()=>this.cancel};function Ut(){let e=et(Ht.create).current;return zt(e.disposeEffect),e}var Wt=0,Gt=class e{static create(){return new e}currentId=Wt;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Wt,t()},e)}isStarted(){return this.currentId!==Wt}clear=()=>{this.currentId!==Wt&&(clearTimeout(this.currentId),this.currentId=Wt)};disposeEffect=()=>this.clear};function Kt(){let e=et(Gt.create).current;return zt(e.disposeEffect),e}function qt(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Jt,platform:Yt,maxTouchPoints:Xt}=qt(),Zt=Jt.toLowerCase(),Qt=Yt.toLowerCase(),$t=/^i(os$|p)/.test(Qt)||Qt===`macintel`&&Xt>1,en=`android`,tn=Qt===en||Zt.includes(en),nn=!$t&&Qt.startsWith(`mac`);Qt.startsWith(`win`),!tn&&/^(linux|chrome os)/.test(Qt);var rn=nn||$t,an=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),on=!an&&Zt.includes(`firefox`);!an&&Zt.includes(`chrom`);var sn=rn,cn=/jsdom|happydom/.test(Zt);function ln(e){e.preventDefault(),e.stopPropagation()}function un(e){return`nativeEvent`in e}function dn(e){return e.pointerType===``&&e.isTrusted?!0:tn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function fn(e){return cn?!1:!tn&&e.width===0&&e.height===0||tn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function pn(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function mn(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function hn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&O(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function gn(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var _n=`data-base-ui-focusable`,vn=`ArrowLeft`,yn=`ArrowRight`,bn=`ArrowUp`,xn=`ArrowDown`,Sn=`data-starting-style`,Cn=`data-ending-style`,wn={[Sn]:``},Tn={[Cn]:``},En={transitionStatus(e){return e===`starting`?wn:e===`ending`?Tn:null}},Dn=`data-open`,On=`data-closed`,kn=`data-anchor-hidden`,An=`data-popup-open`,jn=`data-pressed`,Mn={[An]:``,[jn]:``},Nn={[Dn]:``},Pn={[On]:``},Fn={[kn]:``},In={open(e){return e?Mn:null}},Ln={open(e){return e?Nn:Pn},anchorHidden(e){return e?Fn:null}};({...Ln,...En});function Rn(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function zn(e){return e.matches(`html,body`)}function Bn(e){return d(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Vn(e){return e?e.getAttribute(`role`)===`combobox`&&Bn(e):!1}function Hn(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var Un=`none`,Wn=`trigger-press`,Gn=`outside-press`,Kn=`item-press`,qn=`close-press`,Jn=`input-change`,Yn=`input-clear`,Xn=`input-press`,Zn=`focus-out`,Qn=`escape-key`,$n=`list-navigation`,er=`keyboard`,tr=`pointer`;function J(e,t,n,r){let i=!1,a=!1,o=r??Ft;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function nr(e,t,n){let r=n??Ft;return{reason:e,event:t??new Event(`base-ui`),...r}}var Y=r(),rr=V.forwardRef(function(e,t){let[n,r]=V.useState();H(()=>{sn&&an&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:mt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function ir(e,t,n){return Math.floor(e/t)!==n}function ar(e,t){return t<0||t>=e.length}function or(e,t){return cr(e.current,{disabledIndices:t})}function sr(e,t){return cr(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ur(e,a,r));return a}function lr(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:d,stopEvent:f=!1}){let p=d,m;if(t.key===`ArrowUp`?m=`up`:t.key===`ArrowDown`&&(m=`down`),m){let n=[],a=[],h=!1,g=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;g+=1;let o=e.closest(`[role="row"]`);o&&(h=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let _=!1,v=0;if(h)for(let e of n){let t=e.length;t>v&&(v=t),t!==o&&(_=!0)}let y=_&&g<e.length,b=v||o,x=o=>{if(!_||d===-1)return;let c=a[d];if(c==null)return;let l=n[c].indexOf(d),u=o===`up`?-1:1;for(let o=c+u,f=0;f<n.length;f+=1,o+=u){if(o<0||o>=n.length){if(!r||y)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,d,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!ur(e,n,s))return n}}},S=t=>{if(!y||d===-1)return;let n=d%b,i=t===`up`?-b:b,a=l-l%b,o=u(l/b)+1;for(let t=d-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+b-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!ur(e,r,s))return r}};f&&ln(t);let C=x(m)??S(m);if(C!==void 0)p=C;else if(d===-1)p=m===`up`?l:c;else if(p=cr(e,{startingIndex:d,amount:b,decrement:m===`up`,disabledIndices:s}),r){if(m===`up`&&(d-b<c||p<0)){let e=d%b,n=l%b,r=l-(n-e);p=n===e?l:n>e?r:r-b,i&&(p=i(t,d,p))}m===`down`&&d+b>l&&(p=cr(e,{startingIndex:d%b-b,amount:b,disabledIndices:s}),i&&(p=i(t,d,p)))}ar(e,p)&&(p=d)}if(n===`both`){let n=u(d/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(f&&ln(t),d%o===o-1?r&&(p=cr(e,{startingIndex:d-d%o-1,disabledIndices:s}),i&&(p=i(t,d,p))):(p=cr(e,{startingIndex:d,disabledIndices:s}),r&&ir(p,o,n)&&(p=cr(e,{startingIndex:d-d%o-1,disabledIndices:s}),i&&(p=i(t,d,p)))),ir(p,o,n)&&(p=d)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(f&&ln(t),d%o===0?r&&(p=cr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}),i&&(p=i(t,d,p))):(p=cr(e,{startingIndex:d,decrement:!0,disabledIndices:s}),r&&ir(p,o,n)&&(p=cr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}),i&&(p=i(t,d,p)))),ir(p,o,n)&&(p=d));let c=u(l/o)===n;ar(e,p)&&(r&&c?(p=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:cr(e,{startingIndex:d-d%o-1,disabledIndices:s}),i&&(p=i(t,d,p))):p=d)}return p}function ur(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!fr(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function dr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function fr(e,t=e?h(e):null){return!e||!e.isConnected||!t||dr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var pr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function mr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return O(n)?n.host:null}function hr(e){for(let t of Array.from(e.children))if(g(t)===`summary`)return t;return null}function gr(e,t){let n=hr(t);return!!n&&(e===n||q(n,e))}function _r(e){let t=e?g(e):``;return e!=null&&e.matches(pr)&&(t!==`summary`||e.parentElement!=null&&g(e.parentElement)===`details`&&hr(e.parentElement)===e)&&(t!==`details`||hr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function vr(e){if(!_r(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=mr(t)){let n=t!==e,r=g(t)===`slot`;if(t.hasAttribute(`inert`)||n&&g(t)===`details`&&!t.open&&!gr(e,t)||t.hasAttribute(`hidden`)||!r&&!yr(t,n))return!1}return!0}function yr(e,t){let n=h(e);return t?n.display!==`none`:fr(e,n)}function br(e){let t=e.tabIndex;if(t<0){let t=g(e);if(t===`details`||t===`audio`||t===`video`||d(e)&&e.isContentEditable)return 0}return t}function xr(e){if(g(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Sr(e,t){let n=xr(e);if(!n)return!0;let r=t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=xr(e);return t?.name===n.name&&t.form===n.form})===n}function Cr(e){if(d(e)&&g(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return d(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function wr(e,t){Cr(e).forEach(e=>{_r(e)&&t.push(e),wr(e,t)})}function Tr(e,t,n){Cr(e).forEach(e=>{d(e)&&e.matches(t)&&n.push(e),Tr(e,t,n)})}function Er(e){return vr(e)&&br(e)>=0}function Dr(e){let t=[];return wr(e,t),t.filter(vr)}function Or(e){let t=Dr(e);return t.filter(e=>br(e)>=0&&Sr(e,t))}function kr(e,t){let n=Or(e),r=n.length;if(r===0)return;let i=hn(Rt(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ar(e){return kr(Rt(e).body,1)||e}function jr(e){return kr(Rt(e).body,-1)||e}function Mr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!q(n,r)}function Nr(e){Or(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Pr(e){let t=[];Tr(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Fr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Fr(e,t.id,n)])}function Ir(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Lr(e){return`data-base-ui-${e}`}var Rr=0;function zr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Rr);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Nt;let o=requestAnimationFrame(a);return Rr=o,()=>{Rr===o&&(cancelAnimationFrame(o),Rr=0)}}var Br={inert:new WeakMap,"aria-hidden":new WeakMap},Vr=`data-base-ui-inert`,Hr={inert:new WeakSet,"aria-hidden":new WeakSet},Ur=new WeakMap,Wr=0;function Gr(e){return Hr[e]}function Kr(e){return e?O(e)?e.host:Kr(e.parentNode):null}var qr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Kr(t);return e.contains(n)?n:null}).filter(e=>e!=null),Jr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Yr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{g(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Xr(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=qr(t,e),l=i?Yr(t,Jr(c),new Set(c)):[],u=[],d=[];if(a){let e=Br[a],n=Gr(a);s=n,o=e;let r=qr(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Yr(t,Jr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Ur.get(e)||0)+1;Ur.set(e,t),d.push(e),t===1&&e.setAttribute(Vr,``)}),Wr+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Ur.get(e)||0)-1;Ur.set(e,t),t||e.removeAttribute(Vr)}),--Wr,Wr||(Br.inert=new WeakMap,Br[`aria-hidden`]=new WeakMap,Hr.inert=new WeakSet,Hr[`aria-hidden`]=new WeakSet,Ur=new WeakMap)}}function Zr(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Rt(e[0]).body;return Xr(e,a,n,r,{mark:i})}var Qr=0;function $r(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(Qr+=1,r(`${t}-${Qr}`))},[n,t]),i}var ei=$e.useId;function ti(e,t){if(ei!==void 0){let n=ei();return e??(t?`${t}-${n}`:n)}return $r(e,t)}function ni(e){if(!V.isValidElement(e))return null;let t=e,n=t.props;return(G(19)?n?.ref:t.ref)??null}function ri(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ii(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ai(e,t){return typeof e==`function`?e(t):e}function oi(e,t){return typeof e==`function`?e(t):e}var si={};function ci(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ui(t);let a=ui(e);return t&&(a=di(a,t)),n&&(a=di(a,n)),r&&(a=di(a,r)),i&&(a=di(a,i)),a}function li(e){if(e.length===0)return si;if(e.length===1)return ui(e[0]);let t=ui(e[0]);for(let n=1;n<e.length;n+=1)t=di(t,e[n]);return t}function ui(e){return hi(e)?{...gi(e,si)}:fi(e)}function di(e,t){return hi(t)?gi(t,e):pi(e,t)}function fi(e){let t={...e};for(let e in t){let n=t[e];mi(e,n)&&(t[e]=vi(n))}return t}function pi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ri(e.style,r);break;case`className`:e[n]=bi(e.className,r);break;default:e[n]=mi(n,r)?_i(e[n],r):r}}return e}function mi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function hi(e){return typeof e==`function`}function gi(e,t){return hi(e)?e(t):e??si}function _i(e,t){return t?e?(...n)=>{let r=n[0];if(xi(r)){let i=r;yi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:vi(t):e}function vi(e){return e&&((...t)=>{let n=t[0];return xi(n)&&yi(n),e(...t)})}function yi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function bi(e,t){return t?e?t+` `+e:t:e}function xi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Si(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ei(r));let i=Ci(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ft;return Di(e,r,i,a)}function Ci(e,t,n){let{className:r,style:i}=e,{state:a=Ft,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ai(r,a):void 0,d=l?oi(i,a):void 0,f=l?ii(a,c):Ft,p=l&&s?wi(s):void 0,m=l?ri(f,p)??{}:Ft;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?ot([m.ref,ni(n),...o]):at(m.ref,ni(n),o):at(null,null)),l?(u!==void 0&&(m.className=bi(m.className,u)),d!==void 0&&(m.style=ri(m.style,d)),m):Ft}function wi(e){return Array.isArray(e)?li(e):ci(void 0,e)}var Ti=Symbol.for(`react.lazy`);function Ei(e){if(e?.$$typeof!==Ti)return e;let t=V.Children.toArray(e)[0];return V.isValidElement(t)?t:e}function Di(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ci(n,t.props);return e.ref=n.ref,V.cloneElement(t,e)}if(e&&typeof e==`string`)return Oi(e,n);throw Error(Xe(8))}function Oi(e,t){return e===`button`?(0,V.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,V.createElement)(`img`,{alt:``,...t,key:t.key}):V.createElement(e,t)}var ki={style:{transition:`none`}},Ai={fallbackAxisSide:`none`},ji={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Mi=e(i(),1),Ni=V.createContext(null),Pi=()=>V.useContext(Ni),Fi=Lr(`portal`);function Ii(e={}){let{ref:t,container:n,componentProps:r=Ft,elementProps:i}=e,a=ti(),o=Pi()?.portalNode,[s,c]=V.useState(null),[l,u]=V.useState(null),d=W(e=>{e!==null&&u(e)}),f=V.useRef(null);H(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(k(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Si(`div`,r,{ref:[t,d],props:[{id:a,[Fi]:``},i]}),m=s&&p?Mi.createPortal(p,s):null;return{node:l,nodeId:V.isValidElement(p)?p.props.id:void 0,subtree:m}}var Li=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Ii({container:o,ref:t,componentProps:e,elementProps:c}),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),h=V.useRef(null),[g,_]=V.useState(null),v=V.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;V.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Mr(e)&&(e.type===`focusin`?v.current&&=(Pr(l),!1):(Nr(l),v.current=!0))}return Lt(K(l,`focusin`,e,!0),K(l,`focusout`,e,!0))},[l,y]),H(()=>{l&&b===!0&&v.current&&(Pr(l),v.current=!1)},[b,l]);let S=V.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(V.Fragment,{children:[d,(0,Y.jsxs)(Ni.Provider,{value:S,children:[x&&l&&(0,Y.jsx)(rr,{"data-type":`outside`,ref:f,onFocus:e=>{Mr(e,l)?m.current?.focus():jr(g?g.domReference:null)?.focus()}}),x&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:ji}),l&&Mi.createPortal(a,l),x&&l&&(0,Y.jsx)(rr,{"data-type":`outside`,ref:p,onFocus:e=>{Mr(e,l)?h.current?.focus():(Ar(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});function Ri(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var zi=V.createContext(null),Bi=V.createContext(null),Vi=()=>V.useContext(zi)?.id||null,Hi=e=>{let t=V.useContext(Bi);return e??t};function Ui(e){return e==null?e:`current`in e?e.current:e}function Wi(e,t){let n=v(gn(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Gi=20,Ki=[];function qi(){Ki=Ki.filter(e=>e.deref()?.isConnected)}function Ji(e){qi(),e&&g(e)!==`body`&&(Ki.push(new WeakRef(e)),Ki.length>Gi&&(Ki=Ki.slice(-20)))}function Yi(){return qi(),Ki[Ki.length-1]?.deref()}function Xi(e){return e?Er(e)?e:Or(e)[0]||e:null}function Zi(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Dr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Er(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Qi(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,_=`rootStore`in t?t.rootStore:t,v=_.useState(`open`),y=_.useState(`domReferenceElement`),b=_.useState(`floatingElement`),{events:x,dataRef:S}=_.context,C=W(()=>S.current.floatingContext?.nodeId),w=i===!1,T=Vn(y)&&w,E=dt(i),D=dt(a),ee=dt(l),te=dt(v),O=Hi(m),k=Pi(),A=V.useRef(!1),j=V.useRef(!1),ne=V.useRef(!1),M=V.useRef(null),N=V.useRef(``),P=V.useRef(``),F=V.useRef(null),re=V.useRef(null),ie=at(F,p,k?.beforeInsideRef),ae=at(re,k?.afterInsideRef),oe=Kt(),se=Kt(),ce=Ut(),I=k!=null,L=Hn(b),le=W((e=L)=>e?Or(e):[]),R=W(()=>h?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&q(L,hn(Rt(L)))&&le().length===0&&!T&&ln(e)}return K(Rt(L),`keydown`,e)},[r,L,s,T,le]),V.useEffect(()=>{if(r||!v)return;let e=Rt(L);function t(){ne.current=!1}function n(e){let t=gn(e),n=R(),r=q(b,t)||q(y,t)||q(k?.portalNode,t)||n.some(e=>e===t||q(e,t));ne.current=!r,P.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,se.start(0,()=>{j.current=!1}))}function i(){P.current=`keyboard`}return Lt(K(e,`pointerdown`,n,!0),K(e,`pointerup`,t,!0),K(e,`pointercancel`,t,!0),K(e,`keydown`,i,!0),t)},[r,b,y,L,v,k,se,R]),V.useEffect(()=>{if(r||!c)return;let e=Rt(L);function t(){j.current=!0,se.start(0,()=>{j.current=!1})}function n(e){let t=gn(e);Er(t)&&(M.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=gn(t);s&&n==null&&i!=null&&q(b,i)&&Ji(i),queueMicrotask(()=>{let a=C(),c=_.context.triggerElements,l=R(),p=n?.hasAttribute(Lr(`focus-guard`))&&[F.current,re.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,Ui(f),Ui(u)].includes(n),m=!(q(y,n)||q(b,n)||q(n,b)||q(k?.portalNode,n)||l.some(e=>e===n||q(e,n))||c.hasMatchingElement(e=>q(e,n))||p||O&&(Fr(O.nodesRef.current,a).find(e=>q(e.context?.elements.floating,n)||q(e.context?.elements.domReference,n))||Ir(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Hn(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&L&&Zi(L),o&&r!==y&&!fr(i)&&hn(e)===e.body){if(d(L)&&(L.focus(),o===`popup`)){ce.request(()=>{L.focus()});return}let e=le(),t=M.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||L;d(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(T||!s)&&n&&m&&!j.current&&(T||n!==Yi())&&(A.current=!0,_.setOpen(!1,J(Zn,t)))})}function a(){ne.current||(S.current.insideReactTree=!0,oe.start(0,()=>{S.current.insideReactTree=!1}))}let l=d(y)?y:null;if(b||l)return Lt(l&&K(l,`focusout`,i),l&&K(l,`pointerdown`,t),b&&K(b,`focusin`,n),b&&K(b,`focusout`,i),b&&k&&K(b,`focusout`,a,!0))},[r,y,b,L,s,O,k,_,c,o,le,T,C,S,oe,se,ce,u,f,R]),V.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Lr(`portal`)}]`)||[]),t=(O?Ir(O.nodesRef.current,C()):[]).find(e=>Vn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Zr([b,...e,F.current,re.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...R(),t,Ui(f),Ui(u),T?y:null].filter(e=>e!=null),{ariaHidden:s||T,mark:!1}),i=Zr([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,s,k,T,O,C,u,f,R]),H(()=>{if(!v||r||!d(L))return;N.current=``,P.current=``;let e=Rt(L),t=hn(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1||q(L,t))return;let i=null,a=()=>(i??=le(L),i[0]||L),o;o=r===!0||r===null?a():Ui(r),o||=a();let s=q(L,hn(e));zr(o,{preventScroll:o===L,shouldFocus(){if(!te.current)return!1;if(s)return!0;let t=hn(e);return!(t!==o&&q(L,t))}})})},[r,v,L,le,E,ee,te]),H(()=>{if(r||!L)return;let e=Rt(L),t=hn(e),n=ee.current==null;Ji(t);function i(e){if(e.open||(N.current=Wi(e.nativeEvent,P.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(dn(e.nativeEvent)||fn(e.nativeEvent))A.current=!1;else{let e=!1;Rt(L).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&g(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Yi()||null,typeof i==`boolean`?s:Ui(i)||s||null}return()=>{x.off(`openchange`,i);let t=hn(e),n=R(),r=q(b,t)||n.some(e=>e===t||q(e,t))||O&&Fr(O.nodesRef.current,C(),!1).some(e=>q(e.context?.elements.floating,t)),o=D.current,s=N.current,c=a(s);queueMicrotask(()=>{let n=Xi(c),i=typeof o!=`boolean`;if(o&&!A.current&&d(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,b,L,D,ee,x,O,y,C,R]),H(()=>{if(!an||v||!b)return;let e=hn(Rt(b));d(e)&&Bn(e)&&q(b,e)&&e.blur()},[v,b]),H(()=>{if(!r&&k)return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:v,onOpenChange:_.setOpen,domReference:y}),()=>{k.setFocusManagerState(null)}},[r,k,s,v,_,c,y]),H(()=>{if(!r&&L)return Zi(L),()=>{queueMicrotask(qi)}},[r,L]);let ue=!r&&(!s||!T)&&(I||s);return(0,Y.jsxs)(V.Fragment,{children:[ue&&(0,Y.jsx)(rr,{"data-type":`inside`,ref:ie,onFocus:e=>{if(s){let e=le();zr(e[e.length-1])}else k?.portalNode&&(A.current=!1,Mr(e,k.portalNode)?Ar(y)?.focus():Ui(f??k.beforeOutsideRef)?.focus())}}),n,ue&&(0,Y.jsx)(rr,{"data-type":`inside`,ref:ae,onFocus:e=>{s?zr(le()[0]):k?.portalNode&&(c&&(A.current=!0),Mr(e,k.portalNode)?jr(y)?.focus():Ui(u??k.afterOutsideRef)?.focus())}})]})}function $i(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Wn}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=V.useRef(void 0),f=Ut(),p=Kt(),m=V.useMemo(()=>{function e(e,t,n,r){let i=J(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=pn(e.pointerType,!0)&&fn(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||pn(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=gn(o);if(Bn(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}pn(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return V.useMemo(()=>n?{reference:m}:Ft,[n,m])}function ea(){return!1}function ta(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function na(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ea,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),f=l.useState(`floatingElement`),{dataRef:p,events:m}=l.context,g=Hi(c),v=W(typeof i==`function`?i:()=>!1),y=typeof i==`function`?v:i,b=y!==!1,x=W(()=>a),{escapeKey:S,outsidePress:w}=ta(s),T=V.useRef(!1),E=V.useRef(!1),D=V.useRef(!1),te=V.useRef(!1),k=V.useRef(!1),A=V.useRef(``),j=V.useRef(null),ne=Kt(),M=Kt(),N=W(()=>{M.clear(),p.current.insideReactTree=!1}),P=W(e=>{let t=p.current.floatingContext?.nodeId;return(g?Fr(g.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),F=W(e=>Rn(e,l.select(`floatingElement`))||Rn(e,l.select(`domReferenceElement`))),re=W(e=>{o()&&l.setOpen(!1,J(Wn,e.nativeEvent))}),ie=W(e=>{if(!u||!n||!r||e.key!==`Escape`||k.current||!S&&P(`__escapeKeyBubbles`))return;let t=J(Qn,un(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!S&&!t.isPropagationAllowed&&e.stopPropagation()}),ae=W(()=>{p.current.insideReactTree=!0,M.start(0,N)}),oe=W(e=>{if(!u||!n||e.button!==0)return;let t=gn(e.nativeEvent);q(l.select(`floatingElement`),t)&&(T.current||(T.current=!0,E.current=!1))}),se=W(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&T.current&&(E.current=!0)});V.useEffect(()=>{function e(e){e.open||(te.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),V.useEffect(()=>{if(!u||!n)return u||(te.current=!1),N;p.current.__escapeKeyBubbles=S,p.current.__outsidePressBubbles=w;let e=new Gt,t=new Gt,i=Rt(f);function a(){e.clear(),k.current=!0}function o(){e.start(an?5:0,()=>{k.current=!1})}function s(){D.current=!0,t.start(0,()=>{D.current=!1})}function c(){T.current=!1,E.current=!1}function m(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=x(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function v(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function M(e){let t=p.current.floatingContext?.nodeId,n=g&&Fr(g.nodesRef.current,t).some(t=>Rn(e,t.context?.elements.floating));return F(e)||n}function re(e){if(v(e)){e.type!==`click`&&!F(e)&&(t.clear(),D.current=!1),N();return}if(p.current.insideReactTree){N();return}let n=gn(e),r=`[${Lr(`inert`)}]`,i=_(n)?n.getRootNode():null,a=Array.from((O(i)?i:Rt(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>q(e,n))))return;let s=_(n)?n:null;for(;s&&!ee(s);){let e=C(s);if(ee(e)||!_(e))break;s=e}if(!(a.length&&_(n)&&!zn(n)&&!q(n,l.select(`floatingElement`))&&a.every(e=>!q(s,e)))){if(d(n)&&!(`touches`in e)){let t=ee(n),r=h(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!M(e)){if(m()===`intentional`){if(e.detail!==0&&!dn(e)&&!te.current)return;if(D.current){t.clear(),D.current=!1;return}}(typeof y!=`function`||y(e))&&(P(`__outsidePressBubbles`)||(l.setOpen(!1,J(Gn,e)),N()))}}}function ae(e){m()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!F(e)&&re(e)}function oe(e){if(m()!==`sloppy`||!l.select(`open`)||!n||F(e))return;let t=e.touches[0];t&&(j.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ne.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function se(e,t){let n=gn(e);if(!n)return;let r=K(n,e.type,()=>{t(e),r()})}function ce(e){A.current=`touch`,se(e,oe)}function I(e){ne.clear(),e.type===`pointerdown`&&(e.button===0&&(te.current=!0),A.current=e.pointerType),(e.type!==`mousedown`||!j.current||j.current.dismissOnMouseDown)&&se(e,e=>{e.type===`pointerdown`?ae(e):re(e)})}function L(e){if(e.type===`pointercancel`&&(te.current=!1),!T.current)return;let n=E.current;if(c(),m()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!M(e)){if(n){s();return}(typeof y!=`function`||y(e))&&(t.clear(),D.current=!0,N())}}}function le(e){if(m()!==`sloppy`||!j.current||F(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-j.current.startX),r=Math.abs(t.clientY-j.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(j.current.dismissOnTouchEnd=!0),i>10&&(re(e),ne.clear(),j.current=null)}function R(e){se(e,le)}function ue(e){m()===`sloppy`&&j.current&&!F(e)&&(j.current.dismissOnTouchEnd&&re(e),ne.clear(),j.current=null)}function de(e){se(e,ue)}let z=Lt(r&&Lt(K(i,`keydown`,ie),K(i,`compositionstart`,a),K(i,`compositionend`,o)),b&&Lt(K(i,`click`,I,!0),K(i,`pointerdown`,I,!0),K(i,`pointerup`,L,!0),K(i,`pointercancel`,L,!0),K(i,`mousedown`,I,!0),K(i,`mouseup`,L,!0),K(i,`touchstart`,ce,{capture:!0,passive:!0}),K(i,`touchmove`,R,{capture:!0,passive:!0}),K(i,`touchend`,de,{capture:!0,passive:!0})));return()=>{z(),e.clear(),t.clear(),c(),D.current=!1,N()}},[p,f,r,b,y,u,n,S,w,ie,N,x,P,F,g,l,ne]);let ce=V.useMemo(()=>({onKeyDown:ie,onPointerDown:re,onClick:re}),[ie,re]),I=V.useMemo(()=>({onKeyDown:ie,onPointerDown:se,onMouseDown:se,onClickCapture:ae,onMouseDownCapture(e){ae(),oe(e)},onPointerDownCapture(e){ae(),oe(e)},onMouseUpCapture:ae,onTouchEndCapture:ae,onTouchMoveCapture:ae}),[ie,ae,oe,se]);return V.useMemo(()=>n?{reference:ce,floating:I,trigger:ce}:{},[n,ce,I])}var ra={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},ia=class extends It{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ri(),nested:n,triggerElements:i},ra),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&mn(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function aa(e,t=!1,n=!1,r=!1){let[i,a]=V.useState(e&&t?`idle`:void 0),[o,s]=V.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),H(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ht.request(()=>{a(`ending`)});return()=>{Ht.cancel(e)}}},[e,o,i,n]),H(()=>{if(!e||t)return;let n=Ht.request(()=>{a(void 0)});return()=>{Ht.cancel(n)}},[t,e]),H(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ht.request(()=>{a(`idle`)});return()=>{Ht.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var oa=null;function sa(e){if(!oa){let e=[];oa=e,queueMicrotask(()=>{oa=null,Mi.flushSync(()=>{for(let t of e)t()})})}oa.push(e)}function ca(e,t=!1,n=!1){let r=Ut();return W((i,a=null)=>{r.cancel();let o=Ui(e);if(o==null)return;let s=o,c=()=>{if(!n){Mi.flushSync(i);return}sa(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Sn;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function la(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=W(a),s=ca(r,n,i);V.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var ua={tabIndex:-1,[_n]:``},da=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function fa(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ti(),a=Vi()!=null,o=et(()=>new ia({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new da,floatingId:i,syncOnly:!1,nested:a})).current;return H(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=_(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function pa(e){return ma(e,e.rootContext)}function ma(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=V.useState(null),[d,f]=V.useState(void 0),[p,h]=V.useState(void 0),g=V.useRef(null),v=Hi(r),y=V.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),b=m({...e,elements:{...y,...l&&{reference:l}}}),x=_(d)?d:null,S=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:x),t.useSyncedValue(`floatingElement`,S);let C=V.useCallback(e=>{let t=_(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),b.refs.setReference(t)},[b.refs]),w=V.useCallback(e=>{(_(e)||e===null)&&(g.current=e,f(e)),(_(b.refs.reference.current)||b.refs.reference.current===null||e!==null&&!_(e))&&b.refs.setReference(e)},[b.refs,f]),T=V.useCallback(e=>{h(e),b.refs.setFloating(e)},[b.refs]),E=V.useMemo(()=>({...b.refs,setReference:w,setFloating:T,setPositionReference:C,domReference:g}),[b.refs,w,T,C]),D=V.useMemo(()=>({...b.elements,domReference:o}),[b.elements,o]),ee=V.useMemo(()=>({...b,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:D,nodeId:n,rootStore:t}),[b,E,D,n,t,s,c]);return H(()=>{o&&(g.current=o)},[o]),H(()=>{t.context.dataRef.current.floatingContext=ee;let e=v?.nodesRef.current.find(e=>e.id===n);e&&(e.context=ee)}),V.useMemo(()=>({...b,context:ee,refs:E,elements:D,rootStore:t}),[b,E,D,ee,t])}var ha=`Escape`;function ga(e){return an&&e.movementX===0&&e.movementY===0}function _a(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function va(e,t){return _a(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ya(e,t,n){return _a(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function ba(e,t,n){return _a(t,n?e===vn:e===yn,e===xn)}function xa(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===ha:_a(t,n?e===yn:e===vn,e===bn)}function Sa(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),ee=w.context.dataRef,te=Hn(E),O=Vn(D),k=dt(te),A=Vi(),j=Hi(x),ne=V.useRef(p),M=V.useRef(o??-1),N=V.useRef(null),P=V.useRef(!0),F=W(e=>{i(M.current===-1?null:M.current,e)}),re=V.useRef(!!E),ie=V.useRef(T),ae=V.useRef(!1),oe=V.useRef(!1),se=V.useRef(null),ce=dt(g),I=dt(T),L=dt(o),le=dt(b),R=Ut(),ue=Ut(),de=W(()=>{function e(e){f?j?.events.emit(`virtualfocus`,e):se.current=zr(e,{sync:ae.current,preventScroll:!0})}let t=n.current[M.current],r=oe.current;t&&e(t),(ae.current?e=>e():e=>R.request(e))(()=>{let i=n.current[M.current]||t;i&&(t||e(i),he&&(r||!P.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});H(()=>{ee.current.orientation=_},[ee,_]),H(()=>{a&&(T&&E?(M.current=o??-1,ne.current&&o!=null&&(oe.current=!0,F())):re.current&&(M.current=-1,F()))},[a,T,E,o,F]),H(()=>{if(a){if(!T){ae.current=!1;return}if(E){if(r==null){if(ae.current=!1,L.current!=null)return;if(re.current&&(M.current=-1,de()),(!ie.current||!re.current)&&ne.current&&(N.current!=null||ne.current===!0&&N.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ue.request(e):queueMicrotask)(t),e+=1):(M.current=N.current==null||ya(N.current,_,u)||l?or(n):sr(n),N.current=null,F())};t()}}else ar(n.current,r)||(M.current=r,de(),oe.current=!1)}}},[a,T,E,r,L,l,n,_,u,F,de,ue]),H(()=>{if(!a||E||!j||f||!re.current)return;let e=j.nodesRef.current,t=e.find(e=>e.id===A)?.context?.elements.floating,n=hn(Rt(D??t??null)),r=e.some(e=>e.context&&q(e.context.elements.floating,n));t&&!r&&P.current&&t.focus({preventScroll:!0})},[a,E,D,j,A,f]),H(()=>{ie.current=T,re.current=!!E}),H(()=>{T||(N.current=null,ne.current=p)},[T,p]);let z=r!=null,fe=W(e=>{if(!I.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(M.current!==t||r!==t)&&(M.current=t,F(e))}),B=W(()=>v??j?.nodesRef.current.find(e=>e.id===A)?.context?.dataRef?.current.orientation),pe=W(()=>or(n,ce.current)),me=W(e=>{if(P.current=!1,ae.current=!0,e.which===229||!I.current&&e.currentTarget===k.current)return;if(l&&xa(e.key,_,u,C)){va(e.key,B())||ln(e),w.setOpen(!1,J($n,e.nativeEvent)),d(D)&&(f?j?.events.emit(`virtualfocus`,D):D.focus());return}let t=M.current,r=or(n,g),i=sr(n,g);if(O||(e.key===`Home`&&(ln(e),M.current=r,F(e)),e.key===`End`&&(ln(e),M.current=i,F(e))),S!=null){let t=S(e,M.current,n,_,c,u,g,r,i);if(t!=null&&(M.current=t,F(e)),_===`both`)return}if(va(e.key,_)){if(ln(e),T&&!f&&hn(e.currentTarget.ownerDocument)===e.currentTarget){M.current=ya(e.key,_,u)?r:i,F(e);return}ya(e.key,_,u)?c?t>=i?s&&t!==n.current.length?M.current=-1:(ae.current=!1,M.current=r):M.current=cr(n.current,{startingIndex:t,disabledIndices:g}):M.current=Math.min(i,cr(n.current,{startingIndex:t,disabledIndices:g})):c?t<=r?s&&t!==-1?M.current=n.current.length:(ae.current=!1,M.current=i):M.current=cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:g}):M.current=Math.max(r,cr(n.current,{startingIndex:t,decrement:!0,disabledIndices:g})),ar(n.current,M.current)&&(M.current=-1),F(e)}}),he=V.useMemo(()=>({onFocus(e){ae.current=!0,fe(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ga(e)||(ae.current=!0,oe.current=!1,m&&fe(e))},onPointerLeave(e){if(!I.current||!P.current||e.pointerType===`touch`)return;ae.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&le.current&&(se.current?.(),se.current=null,M.current=-1,F(e),!f)){let e=k.current,t=hn(Rt(e));e&&q(e,t)&&e.focus({preventScroll:!0})}}}),[fe,I,k,m,n,F,le,f]),ge=V.useMemo(()=>f&&T&&z&&{"aria-activedescendant":`${y}-${r}`},[f,T,z,y,r]),_e=V.useMemo(()=>({...O?{}:ge,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!f){let t=gn(e.nativeEvent);if(t&&!q(k.current,t))return;ln(e),w.setOpen(!1,J(Zn,e.nativeEvent)),d(D)&&D.focus();return}me(e)},onPointerMove(e){ga(e)||(P.current=!0)}}),[ge,me,k,O,w,T,f,D]),ve=V.useMemo(()=>{function e(e){w.setOpen(!0,J($n,e.nativeEvent,e.currentTarget))}function t(e){p===`auto`&&dn(e.nativeEvent)&&(ne.current=!f)}function n(e){ne.current=p,p===`auto`&&fn(e.nativeEvent)&&(ne.current=!0)}return{onKeyDown(t){let n=w.select(`open`);P.current=!1;let r=t.key.startsWith(`Arrow`),i=ba(t.key,B(),u),a=va(t.key,_),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(f&&n)return me(t);if(n||h||!r){if(o){let e=va(t.key,B());N.current=l&&e?null:t.key}if(l){i&&(ln(t),n?(M.current=pe(),F(t)):e(t));return}a&&(L.current!=null&&(M.current=L.current),ln(t),!n&&h?e(t):me(t),n&&F(t))}},onFocus(e){w.select(`open`)&&!f&&(M.current=-1,F(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[me,p,pe,l,F,w,h,_,B,u,L,f]),ye=V.useMemo(()=>({...ge,...ve}),[ge,ve]);return V.useMemo(()=>a?{reference:ye,floating:_e,item:he,trigger:ve}:{},[a,ye,_e,ve,he])}function Ca(e,t,n,r,i,a,o,s,c,l=2){let u=lr(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return ar(n.current,u)?void 0:u}var wa=V.createContext(void 0),Ta=V.createContext(void 0),Ea=V.createContext(void 0),Da=V.createContext(!1),Oa=V.createContext(``);function ka(){let e=V.useContext(wa);if(!e)throw Error(Xe(22));return e}function Aa(){let e=V.useContext(Ta);if(!e)throw Error(Xe(23));return e}function ja(){let e=V.useContext(Ea);if(!e)throw Error(Xe(24));return e}function Ma(){return V.useContext(Oa)}function Na(){return V.useContext(Da)}function Pa(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Fa=(e,t)=>Object.is(e,t);function Ia(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function La(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Pa(e,t,(e,t)=>Ia(e,t,n)):e!==t}function Ra(e,t,n){return e?e.some(e=>e!==void 0&&Ia(t,e,n)):!1}function za(e,t,n){return e?e.findIndex(e=>e!==void 0&&Ia(e,t,n)):-1}function Ba(e,t){if(t!==Fa)return n=>Ra(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function Va(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Ba(t,n)):za(e,t,n);return i===-1?null:i}function Ha(e,t,n,r,i,a){return Ra(r,t,i)?a!=null&&e>a&&Ra(r,n[a],i)?a:e:e===a?Va(n,r,i,!0):a}function Ua(e,t,n){return e.filter(e=>!Ia(t,e,n))}function Wa(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ga(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Ka(e){return Ga(e?.[0])}function qa(e){return Ka(e)?e.flatMap(e=>e.items):e}function Ja(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Ka(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Ya(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Wa(e)}function Xa(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Wa(e.value):Wa(e)}var Za={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?Ja(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Ia(t,e,n)):Ia(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},Qa=`data-valid`,$a=`data-invalid`,eo={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},to={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},no={disabled:!1,...to},ro={valid(e){return e===null?null:e?{[Qa]:``}:{[$a]:``}}},io={invalid:void 0,name:void 0,validityData:{state:eo,errors:[],error:``,value:``,initialValue:null},setValidityData:Nt,disabled:void 0,setTouched:Nt,setDirty:Nt,setFilled:Nt,setFocused:Nt,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:no,registerFieldControl:Nt,validation:{getValidationProps:(e,t=Ft)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Nt,getInputControl:()=>null,commit:async()=>{},change:Nt}},ao=V.createContext(io);function oo(e=!0){let t=V.useContext(ao);if(t.setValidityData===Nt&&!e)throw Error(Xe(28));return t}function so(e,t,n,r,i=!0,a){let{registerFieldControl:o}=oo(),s=et(()=>Symbol());H(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),H(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var co=V.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Nt,validationMode:`onSubmit`,submitCountRef:{current:0}});function lo(){return V.useContext(co)}function uo(e){return ti(e,`base-ui`)}var fo=V.createContext({controlId:void 0,registerControlId:Nt,resetControlId:Nt,labelId:void 0,setLabelId:Nt,messageIds:[],setMessageIds:Nt,getDescriptionProps:e=>e});function po(){return V.useContext(fo)}function mo(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=po(),o=uo(),s=et(()=>Symbol()),c=V.useRef(!1),l=V.useRef(!1),u=W(()=>{c.current&&i!==Nt&&(c.current=!1,i(s.current,void 0))});return H(()=>{if(!n||i===Nt){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),H(()=>u,[u]),(n?r:void 0)??t??o}function ho(e){return e==null?void 0:`${e}-popup`}function go(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function _o(e){return Array.isArray(e)?e.map(e=>_o(e)).join(`,`):e==null?``:String(e)}var vo=new Map;function yo(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${_o(e.locale)}|${JSON.stringify(t)}`,r=vo.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=Ya(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=Ya(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=Ya(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return vo.set(n,a),a}var bo=yo;function xo(e){let t=V.useRef(``),n=V.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:V.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function So(e,t){let n=V.useRef(e),r=W(t);H(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Co(e,t){let{onClick:n,onPointerDown:r}=xo(W((n,r)=>{(typeof e==`function`?e():e)||t(r||($t?`touch`:``))}));return V.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function wo(e){let[t,n]=V.useState(null),r=Co(e,n);return So(e,t=>{t&&!e&&n(null)}),V.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function To(e,t=!1){let{overflowY:n}=h(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var Eo=Symbol(`none`),Do={value:Eo,index:-1},Oo=V.createContext(void 0);function ko(){return V.useContext(Oo)?.direction??`ltr`}function Ao(e,t,n){let r=e.get(t);if(r!==void 0||n===Fa)return r;for(let[r,i]of e)if(Ia(r,t,n))return i}function jo(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:f,name:p,form:m,disabled:h=!1,readOnly:g=!1,required:_=!1,inputRef:v,grid:y=!1,items:b,filteredItems:x,filter:S,filterQuery:C,openOnInputClick:w=!0,autoHighlight:T=!1,keepHighlight:D=!1,highlightItemOnHover:ee=!0,loopFocus:te=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=Fa,virtualized:j=!1,inline:ne=!1,fillInputOnItemPress:M=!0,modal:N=!1,limit:P=-1,autoComplete:F=`list`,formAutoComplete:re,locale:ie,submitOnItemClick:ae=!1}=e,{clearErrors:oe}=lo(),{setDirty:se,validityData:ce,setFilled:I,name:L,disabled:le,setTouched:R,setFocused:ue,validationMode:de,validation:z}=oo(),fe=ko(),B=mo({id:t}),pe=bo({locale:ie}),me=Array.isArray(b)?null:b;if(me&&typeof me.label!=`function`)throw Error(Xe(100));let he=me?me.data:b,ge=me?.value,_e=ge?void 0:he,ve=V.useMemo(()=>{if(!x||!ge)return;let e=qa(x),t=e.map(ge),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Ao(n,r,i)}}},[x,ge]),ye=V.useMemo(()=>me?e=>me.label(e,A,e=>{let t=ve?.findItem(e,A);return t==null?Ya(e,O):me.itemLabel(t)}):O,[me,O,ve,A]),be=V.useMemo(()=>me?Object.assign(e=>me.itemLabel(e),{selected:e=>Ya(e,ye)}):O,[me,ye,O]);function xe(e){return Ya(e,ye)}let[Se,Ce]=V.useState(!1),[we,Te]=V.useState(null),Ee=V.useRef(we),De=V.useRef([]),Oe=V.useRef([]),ke=V.useRef(null),Ae=V.useRef(null),je=V.useRef(null),Me=V.useRef(null),Ne=V.useRef(null),Pe=V.useRef(!0),Fe=V.useRef(!1),Ie=V.useRef(null),Le=V.useRef(null),Re=V.useRef(null),ze=V.useRef(Do),Be=V.useRef(null),Ve=V.useRef([]),He=V.useRef(null),Ue=le||h,We=L??p,Ge=u===`multiple`,Ke=u===`single`,qe=s!==void 0||o!==void 0,Je=he!==void 0,Ye=x!==void 0,$e;$e=T===`always`?`always`:T?`input-change`:!1;let[U,tt]=Ze({controlled:i,default:Ge?r??Pt:r,name:`Combobox`,state:`selectedValue`}),nt=V.useMemo(()=>S===null?()=>!0:S===void 0?go(pe,be):S,[S,pe,be]),rt=et(()=>qe?o??``:Ke?xe(U):``).current,[it,ot]=Ze({controlled:s,default:rt,name:`Combobox`,state:`inputValue`}),[st,ct]=Ze({controlled:c,default:l,name:`Combobox`,state:`open`}),lt=Ka(he),ut=!st&&we!==null?we:String(it).trim(),ft=Ke?xe(U):``,pt=Ke&&!Se&&ut!==``&&ft.length===ut.length&&pe.contains(ft,ut),gt=pt?``:C??ut,_t=Je&&Ye&&pt&&(!me||me.hasValue(U,A)),vt=V.useMemo(()=>he?qa(he):Pt,[he]),yt=V.useMemo(()=>{if(x&&!_t)return x;if(!he)return Pt;if(lt){let e=he,t=[],n=0;for(let r of e){if(P>-1&&n>=P)break;let e=P>-1?P-n:1/0,i=gt===``?r.items.slice(0,e):[];if(gt!==``)for(let t of r.items){if(i.length>=e)break;nt(t,gt,be)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(gt===``)return P>-1?vt.slice(0,P):vt;let e=[];for(let t of vt){if(P>-1&&e.length>=P)break;nt(t,gt,be)&&e.push(t)}return e},[x,_t,he,lt,gt,P,nt,be,vt]),bt=V.useMemo(()=>{if(ve&&yt===x)return ve.values;let e=qa(yt);return ge?e.map(e=>ge(e)):e},[yt,x,ve,ge]),G=et(()=>{let e=null;return ne&&st&&Je&&u!==`none`&&(e=Va(bt,U,A,Ge)),new It({id:B,labelId:void 0,selectedValue:U,open:st,items:_e,selectionMode:u,name:We,form:m,disabled:Ue,readOnly:g,required:_,grid:y,virtualized:j,openOnInputClick:w,itemToStringLabel:ye,isItemEqualToValue:A,modal:N,autoHighlight:$e,submitOnItemClick:ae,hasInputValue:qe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:ne,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:Ft,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:Nt,setOpen:Nt,setInputValue:Nt,setSelectedValue:Nt,setIndices:Nt,handleSelection:Nt,forceMount:Nt,requestSubmit:Nt,listRef:De,labelsRef:Oe,popupRef:ke,emptyRef:Ne,inputRef:Ae,startDismissRef:je,endDismissRef:Me,keyboardActiveRef:Pe,chipsContainerRef:Ie,clearRef:Le,valuesRef:Ve,pointerDownItemRef:He,selectionEventRef:Re},Za)}).current,xt=u===`none`?it:U,St=V.useMemo(()=>u===`none`?xt:Array.isArray(U)?U.map(e=>Xa(e,k)):Xa(U,k),[xt,k,u,U]),Ct=W(f),wt=W(n),Tt=G.useState(`activeIndex`),Et=G.useState(`selectedIndex`),Dt=G.useState(`positionerElement`),Ot=G.useState(`listElement`),kt=G.useState(`triggerElement`),At=G.useState(`inputElement`),jt=G.useState(`inputGroupElement`),Mt=G.useState(`inline`),Lt=G.useState(`inputInsidePopup`),Rt=G.useState(`inputOwnsFormValue`),K=Ke&&!Lt&&it===ft,zt=dt(kt),{mounted:Bt,setMounted:Vt,transitionStatus:Ht}=aa(st),{openMethod:Ut,triggerProps:Wt}=wo(st),Gt=W(()=>St);so(Lt?zt:Ae,B,xt,Gt,!Ue,p);let Kt=W(()=>{he?Oe.current=bt.map(xe):G.set(`forceMounted`,!0)}),qt=W((e,t,n)=>{if(t===-1){if(ze.current===Do)return;ze.current=Do}else ze.current={value:e,index:t};Ct(e,nr(n,void 0,{index:t}))}),Jt=W(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),G.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?qt(void 0,-1,r):qt(Ve.current[n],n,r)}),Yt=W((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Fe.current=n.reason===Yn,n.reason===`input-change`){st&&we!==null&&Te(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&Ce(!0),Be.current={hasQuery:e};let n=G.state.listElement;if(!G.state.virtualized&&n){let e=ke.current;for(let t of E(n.firstElementChild??n)){if(!d(t)||(e?!q(e,t):t.getAttribute(`role`)===`dialog`))break;if(To(t)){t.scrollTop=0;break}}}e&&$e&&G.state.activeIndex==null&&(st||Mt)&&G.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&G.state.inputInsidePopup&&(Be.current={hasQuery:!1,selection:!0});ot(t)}}),Xt=W(e=>{let t=!e&&Lt&&!Mt&&it!==``&&(String(it).trim()===we||it===ft);!e&&(t||it===``||K)&&Ce(!1),Te(null),t&&Yt(``,J(Yn))}),Zt=W((t,n)=>{if(st!==t&&(n.reason===`escape-key`&&Je&&bt.length===0&&!Ne.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&we!==null&&Xt(n.reason===Jn),!t&&Se&&(Ke?(Mt||Te(ut),ut===``&&Ce(!1)):Ge&&(Mt||Te(ut),Lt&&Jt({activeIndex:null}),(!Lt||Mt)&&Yt(``,J(Yn,n.event,void 0,{isItemPress:n.reason===Kn})))),ct(t),!t&&Lt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(R(!0),ue(!1),de===`onBlur`)))){let e=u===`none`?it:U;z.commit(e)}}),Qt=W((e,t)=>{a?.(e,t),!t.isCanceled&&(tt(e),(u===`none`&&ke.current&&M||Ke&&!G.state.inputInsidePopup)&&Yt(xe(e),J(t.reason,t.event)))}),$t=W((e,t)=>{let n=gn(e),r=Re.current??e;Re.current=null;let i=J(Kn,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Zt(!1,i);return}if(Ge){let e=Array.isArray(U)?U:[],n=Ra(e,t,A),r=n?Ua(e,t,A):[...e,t];if(Qt(r,i),i.isCanceled||!(Ae.current&&Ae.current.value.trim()!==``))return;if(G.state.inputInsidePopup){Yt(``,J(Yn,i.event,void 0,{isItemPress:!0}));let e=Be.current;e&&!n&&(e.toggledValue=t)}else Zt(!1,i)}else{if(Qt(t,i),i.isCanceled)return;Zt(!1,i)}}),en=W(()=>{let e=z.inputRef.current?.form??G.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),tn=W(()=>{if(Vt(!1),wt?.(!1),Ce(!1),Te(null),Jt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ge&&Ae.current&&Ae.current.value!==``&&!Fe.current&&Yt(``,J(Yn)),Ke){if(G.state.inputInsidePopup)Ae.current&&Ae.current.value!==``&&Yt(``,J(Yn));else{let e=xe(U);Ae.current&&Ae.current.value!==e&&Yt(e,J(e===``?Yn:Un))}}}),nn=V.useMemo(()=>Mt&&Dt?{current:Dt.closest(`[role="dialog"]`)}:ke,[Mt,Dt]);la({enabled:!e.actionsRef,open:st,ref:nn,onComplete(){st||tn()}}),V.useImperativeHandle(e.actionsRef,()=>({unmount:tn}),[tn]),H(function(){let e=Ee.current!==null&&we===null;if(Ee.current=we,st&&(!e||!Je)||(st||(He.current=null),u===`none`))return;let t=Je?bt:Ve.current;Jt({selectedIndex:Va(t,U,A,Ge)})},[st,we,U,u,Ge,Je,bt,A,Jt]),H(()=>{he&&(Ve.current=bt,De.current.length=bt.length)},[he,bt]),H(()=>{let e=Be.current;if(e){let t=st||Mt||G.state.positionerElement?.hidden===!1;if(e.hasQuery)$e&&t&&G.set(`activeIndex`,0),Be.current=null;else if(String(it).trim()===``&&(Be.current=null,t)){let t=e.selection;$e===`always`&&!t&&G.state.selectionMode===`none`&&G.set(`activeIndex`,0),queueMicrotask(()=>{if(!G.state.open&&!G.state.inline||Ae.current&&Ae.current.value.trim()!==``)return;let n=G.state.selectedValue,r=G.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:G.state.selectionMode!==`none`&&n!=null){let t=Je||Ye?bt:Ve.current,i=za(t,e.toggledValue,G.state.isItemEqualToValue);G.set(`activeIndex`,i===-1?Va(t,n,G.state.isItemEqualToValue,r):i)}else t?G.set(`activeIndex`,null):$e===`always`&&G.set(`activeIndex`,0)})}}if(!st&&!Mt)return;let t=Je||Ye?bt:Ve.current,n=G.state.activeIndex;if(n==null){if($e===`always`&&t.length>0){G.set(`activeIndex`,0);return}qt(void 0,-1,Un);return}if(n>=t.length){qt(void 0,-1,Un),G.set(`activeIndex`,null);return}let r=t[n],i=ze.current.value,a=i!==Eo&&Ia(r,i,G.state.isItemEqualToValue);(ze.current.index!==n||!a)&&qt(r,n,Un)},[Tt,$e,qt,Ye,Je,bt,Mt,st,G,it]),H(()=>{if(u===`none`){I(String(it)!==``);return}I(Ge?Array.isArray(U)&&U.length>0:U!=null)},[I,u,it,U,Ge]),V.useEffect(()=>{Je&&$e&&bt.length===0&&Jt({activeIndex:null})},[Je,$e,bt.length,Jt]);function rn(){st&&ut!==``&&ut!==String(rt)&&!K&&Ce(!0)}function an(){st&&we!==null&&Xt(!1)}let on=!1;function sn(){!on&&it!==ft&&(on=!0,Yt(ft,J(Un)))}function cn(){u!==`none`&&(oe(We),se(La(U,ce.initialValue,A)),z.change(U),Ke&&!qe&&!Lt&&sn())}function ln(){Ke&&!qe&&!Lt&&!Se&&sn()}function un(){u===`none`&&(oe(We),se(it!==ce.initialValue),z.change(it))}So(ut,rn),So(st,an),So(U,cn),So(ft,ln),So(he,ln),So(it,un);let dn=fa({open:Mt?!0:st,onOpenChange:Zt,elements:{reference:Lt?kt:At,floating:Dt}}),fn=y?`grid`:`listbox`,pn=st||Mt,mn=pn?`true`:`false`,hn=V.useMemo(()=>{let e=At?.tagName===`INPUT`,t=At==null||e,n=t||pn,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=mn,r[`aria-haspopup`]=fn,r[`aria-controls`]=pn?Ot?.id:void 0,r[`aria-autocomplete`]=g?`none`:F),{reference:r,floating:{role:`presentation`}}},[At,pn,mn,fn,Ot?.id,F,g]),_n=$i(dn,{enabled:!Ue&&w,event:`mousedown-only`,toggle:!1,touchOpenDelay:Lt?0:100,reason:Xn}),vn=na(dn,{enabled:!Ue&&!Mt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:Mt?!0:void 0,outsidePress(e){let t=gn(e);return!q(kt,t)&&!q(Le.current,t)&&!q(Ie.current,t)&&!q(jt,t)}}),yn=Sa(dn,{enabled:!Ue,id:B,listRef:De,activeIndex:Tt,selectedIndex:Et,virtual:!0,loopFocus:te,allowEscape:te&&!$e,focusItemOnOpen:Se||u===`none`&&!$e?!1:`auto`,focusItemOnHover:ee,resetOnPointerLeave:!D,orientation:y?`horizontal`:void 0,rtl:fe===`rtl`,disabledIndices:Pt,grid:y?Ca:void 0,onNavigate(e,t){(t||st)&&Ht!==`ending`&&Jt(t?{activeIndex:e,type:Pe.current?er:tr}:{activeIndex:e})}}),bn=V.useMemo(()=>ci(yn.reference,{onKeyDown(e){y&&G.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},vn.reference,_n.reference,hn.reference),[yn.reference,vn.reference,_n.reference,hn.reference,y,G]),xn=V.useMemo(()=>ci(ua,vn.floating),[vn.floating]),Sn=V.useMemo(()=>ci(yn.floating,hn.floating),[yn.floating,hn.floating]),Cn=V.useMemo(()=>{let e=yn.item;return e?{...e,onFocus:void 0}:Ft},[yn.item]);G.useContextCallback(`setOpen`,Zt),G.useContextCallback(`setInputValue`,Yt),G.useContextCallback(`setSelectedValue`,Qt),G.useContextCallback(`setIndices`,Jt),G.useContextCallback(`handleSelection`,$t),G.useContextCallback(`forceMount`,Kt),G.useContextCallback(`requestSubmit`,en),G.useContextCallback(`onOpenChangeComplete`,n),Qe(()=>{G.update({inline:ne,popupProps:xn,listProps:Sn,inputProps:bn,triggerProps:Wt,itemProps:Cn})});let wn={id:B,selectedValue:U,open:st,mounted:Bt,transitionStatus:Ht,items:_e,inline:ne,popupProps:xn,listProps:Sn,inputProps:bn,triggerProps:Wt,itemProps:Cn,openMethod:Ut,selectionMode:u,name:We,form:m,disabled:Ue,readOnly:g,required:_,grid:y,virtualized:j,openOnInputClick:w,itemToStringLabel:ye,modal:N,autoHighlight:$e,isItemEqualToValue:A,submitOnItemClick:ae,hasInputValue:qe};H(()=>{G.update({...wn,inputOwnsFormValue:u===`none`&&(ne||!G.state.inputInsidePopup)})},[G,...Object.values(wn)]);let Tn=at(v,z.inputRef),En=V.useMemo(()=>({query:ut,hasItems:Je,filteredItems:yt,flatFilteredValues:bt}),[ut,Je,yt,bt]),Dn=V.useMemo(()=>Array.isArray(xt)?``:Xa(xt,k),[xt,k]),On=Ge&&Array.isArray(U)&&U.length>0,kn=Ge||u===`none`&&Rt?void 0:We,An=V.useMemo(()=>!Ge||!Array.isArray(U)||!We?null:U.map(e=>{let t=Xa(e,k);return(0,Y.jsx)(`input`,{type:`hidden`,form:m,name:We,value:t,disabled:Ue},t)}),[Ge,U,m,We,k,Ue]),jn=(0,Y.jsxs)(V.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...z.getValidationProps(Ue,{onFocus(){if(Lt){kt?.focus();return}(Ae.current||kt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ue||g)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=J(Un,e.nativeEvent),i=()=>Ve.current.findIndex(e=>Xa(e,k).toLowerCase()===n||xe(e).toLowerCase()===n);function a(){if(Ge)return;if(u===`none`){Yt(t,r);return}let e=i();e===-1&&(e=Ve.current.findIndex((e,t)=>{let r=Oe.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Ve.current[e];a!=null&&Qt?.(a,r)}Ke&&(Kt(),he&&i()===-1&&G.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:B&&kn==null?`${B}-hidden-input`:void 0,form:m,name:kn,autoComplete:re,disabled:Ue,required:_&&!On,readOnly:g,value:Dn,ref:Tn,style:kn?ht:mt,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),An]});return(0,Y.jsx)(wa.Provider,{value:G,children:(0,Y.jsx)(Ta.Provider,{value:dn,children:(0,Y.jsx)(Da.Provider,{value:Je,children:(0,Y.jsx)(Ea.Provider,{value:En,children:(0,Y.jsx)(Oa.Provider,{value:it,children:jn})})})})})}function Mo(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,Y.jsx)(jo,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var No=`data-popup-side`,Po=`data-list-empty`,Fo={...In,...ro,popupSide:e=>e?{[No]:e}:null,listEmpty:e=>e?{[Po]:``}:null},Io=V.createContext(void 0);function Lo(){return V.useContext(Io)}var Ro=V.createContext(void 0);function zo(e){let t=V.useContext(Ro);if(t===void 0&&!e)throw Error(Xe(21));return t}var Bo=V.createContext(void 0);function Vo(e=!1){let t=V.useContext(Bo);if(t===void 0&&!e)throw Error(Xe(16));return t}function Ho(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Uo(e,t,{detail:n=0}={}){e.dispatchEvent(new(v(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Wo(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=V.useRef(null),s=Vo(!0),c=a??s!==void 0,{props:l}=Ho({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=V.useCallback(()=>{let e=o.current;Go(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return H(u,[u]),{getButtonProps:V.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ci({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(yi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Go(r),s=!i&&Ko(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Uo(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Uo(r,e)))},onKeyUp(e){if(!t){if(yi(e),a?.(e),e.target===e.currentTarget&&i&&c&&Go(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Uo(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:W(e=>{o.current=e,u()})}}function Go(e){return d(e)&&e.tagName===`BUTTON`}function Ko(e){return d(e)&&e.tagName===`A`&&!!e.href}var qo=V.forwardRef(function(e,t){let n=ka(),{buttonRef:r,getButtonProps:i}=Wo({native:!1}),a=at(t,r);function o(e){n.context.setOpen(!1,J(qn,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:ht})});function Jo(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function Yo(){return ja().filteredItems.length===0}function Xo(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Zo(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function Qo(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var $o=V.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=oo(),{labelId:m}=po(),h=Lo(),g=!!zo(!0),_=ka(),v=Ma(),y=ko(),b=_.useState(`required`),x=_.useState(`disabled`),S=_.useState(`readOnly`),C=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),D=_.useState(`inputProps`),ee=_.useState(`triggerProps`),te=_.useState(`open`),O=_.useState(`mounted`),k=_.useState(`selectedValue`),A=_.useState(`id`),j=_.useState(`inline`),ne=_.useState(`modal`),M=!!E,N=Jo(_),P=l||x||i,F=Yo(),re=g||j,ie=!re||ne,ae=uo(a??(re?void 0:A)),oe=g?to:c,[se,ce]=V.useState(null),I=V.useRef(!1),L=V.useRef(null),le=V.useRef(!1),R=T===`none`&&!g,ue=W(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,J(Un)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:R})}),de=g?s:p.getValidationProps(P,s);function z(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?er:tr})}function fe(){_.context.keyboardActiveRef.current=!1}let B={...oe,open:te,disabled:P,readOnly:S,popupSide:N,listEmpty:F};function pe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=Xo(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&k.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=Zo(n,k.length),z()),t)}let me=Si(`input`,e,{state:B,ref:[t,_.context.inputRef,ue],props:[D,ee,{value:se??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:P,readOnly:S,required:T===`none`?b:void 0,form:w,...R&&C&&{name:C},id:ae,onFocus(){if(d(!0),!j||!le.current)return;le.current=!1;let e=L.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(j&&e!==null&&E!==`always`&&(L.current=e,le.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:k;p.commit(e)}},onCompositionStart(e){tn||(I.current=!0,ce(e.currentTarget.value))},onCompositionEnd(e){I.current=!1;let t=e.currentTarget.value;ce(null),_.context.setInputValue(t,J(Jn,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=I.current||!r;function a(e){!S&&!P&&e&&i&&(_.context.setOpen(!0,J(Jn,t)),M||z())}if(I.current){let n=e.currentTarget.value;ce(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,J(Yn,t));let r=n.trim(),i=M&&r!==``;a(r),te&&_.state.activeIndex!==null&&!i&&z();return}let o=J(Jn,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=J(Yn,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),te&&_.state.activeIndex!==null&&!M&&z()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,P||S){S&&e.key===`Enter`&&te&&_.state.activeIndex!==null&&ln(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){ln(e);let n=on&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){ln(e);let i=on&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!O&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(k)?k.length===0:k===null,n=J(Qn,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(k)&&k.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:k.length-1,r=k.filter((e,t)=>t!==n);z(),_.context.setSelectedValue(r,J(Un,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=pe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&te){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(j)return;_.context.setOpen(!1,J(Un,n));return}ln(e),Qo(_,t,n)}},onPointerMove:fe,onPointerDown:fe},de],stateAttributesMapping:Fo}),he=g?(0,Y.jsx)(ao.Provider,{value:io,children:me}):me;return(0,Y.jsxs)(V.Fragment,{children:[te&&ie&&(0,Y.jsx)(qo,{ref:_.context.startDismissRef}),he]})}),es=V.createContext(null);function ts(){return V.useContext(es)}function ns(e){let{children:t}=e,{filteredItems:n}=ja(),r=ts(),i=r?r.items:n;return(0,Y.jsx)(V.Fragment,{children:i.map(t)})}var rs=V.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function is(){return V.useContext(rs)}function as(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=W(i),[,o]=V.useState(!1),s=et(ss).current,c=et(os).current,l=V.useRef(0),u=V.useRef(!0),d=V.useRef(null),f=V.useRef(null),p=W(()=>{u.current||(u.current=!0,o(e=>!e))}),m=W((e,t)=>{c.set(e,t),p()}),h=W(e=>{c.delete(e),p()}),g=W(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!us(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&ds(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ls(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=W(()=>{let[e,t]=cs(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});H(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),H(()=>{u.current&&v()}),H(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=W(e=>(s.add(e),()=>{s.delete(e)})),b=V.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(rs.Provider,{value:b,children:t})}function os(){return new Map}function ss(){return new Set}function cs(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>ds(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function ls(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function us(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function ds(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var fs=V.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=ka(),l=Aa(),u=!!zo(!0),{filteredItems:d,hasItems:f}=ja(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=W(e=>{c.set(`positionerElement`,e)}),S=W(e=>{c.set(`listElement`,e)}),C=V.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(ns,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=Si(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;ln(e),Qo(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,Y.jsx)(as,{elementsRef:c.context.listRef,labelsRef:D,children:E})}),ps=V.createContext(void 0);function ms(){let e=V.useContext(ps);if(e===void 0)throw Error(Xe(20));return e}var hs=V.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=ka(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Y.jsx)(ps.Provider,{value:n,children:(0,Y.jsx)(Li,{ref:t,...r})}):null});function gs(e){return G(19)?e:e?`true`:void 0}var _s=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:u,elements:d,middlewareData:f}=t,{element:p,padding:m=0,offsetParent:h=`real`}=te(e,t)||{};if(p==null)return{};let g=x(m),_={x:n,y:r},v=s(i),y=l(v),b=await u.getDimensions(p),S=v===`y`,C=S?`top`:`left`,w=S?`bottom`:`right`,T=S?`clientHeight`:`clientWidth`,E=a.reference[y]+a.reference[v]-_[v]-a.floating[y],D=_[v]-a.reference[v],ee=h===`real`?await u.getOffsetParent?.(p):d.floating,O=d.floating[T]||a.floating[y];(!O||!await u.isElement?.(ee))&&(O=d.floating[T]||a.floating[y]);let k=E/2-D/2,A=O/2-b[y]/2-1,j=Math.min(g[C],A),ne=Math.min(g[w],A),M=j,N=O-b[y]-ne,P=O/2-b[y]/2+k,F=o(M,P,N),re=!f.arrow&&c(i)!=null&&P!==F&&a.reference[y]/2-(P<M?j:ne)-b[y]/2<0,ie=re?P<M?P-M:P-N:0;return{[v]:_[v]+ie,data:{[v]:F,centerOffset:P-F-ie,...re&&{alignmentOffset:ie}},reset:re}}}),vs=(e,t)=>{let{name:n,fn:r}=_s(e);return{name:n,fn:r,options:[e,t]}},ys={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},bs={sideX:`left`,sideY:`top`},xs=`--available-width`,Ss=`--available-height`,Cs=`--anchor-width`,ws=`--anchor-height`,Ts=`--transform-origin`,Es=xs,Ds=Ss;function Os(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function ks(e,t,n){let{rects:r,placement:i}=e;return{side:Os(t,a(i),n),align:c(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function As(e){return js(e,pa)}function js(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:p=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,inline:g,keepMounted:_=!1,floatingRootContext:x,mounted:C,collisionAvoidance:E,shift:ee,nodeId:te,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:A}=e,[j,ne]=V.useState(null);!C&&j!==null&&ne(null);let M=E.side||`flip`,N=E.align||`flip`,P=E.fallbackAxisSide||`end`,F=ee?.crossAxis??!1,re=ee?.rootBoundary,ie=typeof n==`function`?n:void 0,ae=W(ie),oe=ie?ae:n,se=dt(n),ce=dt(C),I=ko()===`rtl`,L=j||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],le=s===`center`?L:`${L}-${s}`,R=d;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let ue=+(i===`bottom`),de=+(i===`top`),z=+(i===`right`),fe=+(i===`left`),B={boundary:u===`clipping-ancestors`?`clippingAncestors`:u,padding:R},pe=V.useRef(null),me=dt(o),he=dt(l),ge=typeof o==`function`?0:o,_e=typeof l==`function`?0:l,ve=[];g&&ve.push(g),ve.push(f(e=>{let t=ks(e,i,I),n=typeof me.current==`function`?me.current(t):me.current,r=typeof he.current==`function`?he.current(t):he.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ge,_e,I,i]));let ye=N===`none`&&M!==`shift`,be=!ye&&(p||F||M===`shift`),xe=M===`none`?null:w({...B,padding:{top:R.top+1+ue,right:R.right+1+fe,bottom:R.bottom+1+de,left:R.left+1+z},mainAxis:!F&&M===`flip`,crossAxis:N===`flip`&&`alignment`,fallbackAxisSideDirection:P}),Se=ye?null:T({...B,rootBoundary:re,mainAxis:N!==`none`,crossAxis:be,limiter:p||F?void 0:y(e=>{if(!pe.current)return{};let{width:t,height:n}=pe.current.getBoundingClientRect(),r=b(a(e.placement)),i=r===`y`?t:n,o=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+o/2}})},[B,p,F,re,R,N]);M===`shift`||N===`shift`||s===`center`?ve.push(Se,xe):ve.push(xe,Se),ve.push(D({...B,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ce.current)return;let i=e.style;i.setProperty(Es,`${t}px`),i.setProperty(Ds,`${n}px`);let a=v(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Cs,`${u}px`),i.setProperty(ws,`${d}px`)}}),vs(e=>({element:pe.current||Rt(e.elements.floating).createElement(`div`),padding:pe.current?m:0,offsetParent:`floating`}),[m]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:s,rects:l,y:u}=e,d=a(r),f=c(r),p=b(d)===`y`,m=pe.current,h=typeof o==`function`?o(ks(e,i,I)):o,g;g=!m&&f&&Math.abs(p?n.shift?.x||0:n.shift?.y||0)<=1?f===`start`===(p&&s.isRTL?.(t)===!0)?`100%`:`0%`:`${(p?n.arrow?.x||0:n.arrow?.y||0)+(p?m?.clientWidth||0:m?.clientHeight||0)/2}px`;let _=d===`top`||d===`left`?`calc(100% + ${h}px)`:`${-h}px`;return be&&p&&Math.abs(n.shift?.y||0)>h&&(_=`${l.reference.y+l.reference.height/2-u}px`),t.style.setProperty(Ts,p?`${g} ${_}`:`${_} ${g}`),{}}},ys,O),H(()=>{!C&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[C,x]);let Ce=V.useMemo(()=>({ancestorScroll:!h,elementResize:!h&&typeof ResizeObserver<`u`,layoutShift:!h&&typeof IntersectionObserver<`u`}),[h]),{refs:we,elements:Te,x:Ee,y:De,middlewareData:Oe,update:ke,placement:Ae,context:je,isPositioned:Me,floatingStyles:Ne}=t({rootContext:x,open:_?C:void 0,placement:le,middleware:ve,strategy:r,whileElementsMounted:_?void 0:(...e)=>S(...e,Ce),nodeId:te,externalTree:A}),{sideX:Pe,sideY:Fe}=Oe.adaptiveOrigin||bs,Ie=Me?r:`fixed`,Le=V.useMemo(()=>{let e;return e=Me?O?{position:Ie,[Pe]:Ee,[Fe]:De}:{...Ne,position:Ie}:{position:Ie,top:0,left:0},e[Es]=`100vw`,e[Ds]=`100vh`,Me||(e.opacity=0),e},[O,Ie,Pe,Ee,Fe,De,Ne,Me]),Re=V.useRef(null);H(()=>{if(!C)return;let e=se.current,t=typeof e==`function`?e():e,n=(Ms(t)?t.current:t)||null;n!==Re.current&&(we.setPositionReference(n),Re.current=n)},[C,we,oe,se]),V.useEffect(()=>{if(!C)return;let e=se.current;typeof e!=`function`&&Ms(e)&&e.current!==Re.current&&(we.setPositionReference(e.current),Re.current=e.current)},[C,we,oe,se]),V.useEffect(()=>{if(_&&C&&Te.reference&&Te.floating)return S(Te.reference,Te.floating,ke,Ce)},[_,C,Te,ke,Ce]);let ze=a(Ae),Be=Os(i,ze,I),Ve=c(Ae)||`center`,He=!!Oe.hide?.referenceHidden;H(()=>{k&&C&&Me&&ze!==L&&ne(ze)},[k,C,Me,ze,L]);let Ue=V.useMemo(()=>({position:`absolute`,top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),We=Oe.arrow?.centerOffset!==0;return V.useMemo(()=>({positionerStyles:Le,arrowStyles:Ue,arrowRef:pe,arrowUncentered:We,side:Be,align:Ve,physicalSide:ze,anchorHidden:He,refs:we,context:je,isPositioned:Me,update:ke}),[Le,Ue,pe,We,Be,Ve,ze,He,we,je,Me,ke])}function Ms(e){return e!=null&&`current`in e}var Ns=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Ps(e){return e===`starting`?ki:Ft}function Fs(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Si(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ps(r),i],stateAttributesMapping:Ln})}var Is={},Ls={},Rs=``;function zs(e,t){return p(e)?e:t}function Bs(e,t,n){return/hidden|clip/.test(e.getComputedStyle(zs(t,n)).overflowY)}function Vs(e){if(typeof document>`u`)return!1;let t=Rt(e);return v(t).innerWidth-t.documentElement.clientWidth>0}function Hs(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Rt(e),n=t.documentElement,r=t.body,i=zs(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Us(e){let t=Rt(e),n=t.documentElement,r=t.body,i=zs(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ws(e){let t=Rt(e),n=t.documentElement,r=t.body,i=v(n),a=0,o=0,s=!1,c=Ht.create();if(an&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Is={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Rs=n.style.scrollBehavior,Ls={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=zs(n,r);if(s=Hs(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Is),Object.assign(r.style,Ls),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Rs)}function d(){u(),c.request(l)}l();let f=K(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Gs=new class{lockCount=0;restore=null;timeoutLock=Gt.create();timeoutUnlock=Gt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Rt(e),n=t.documentElement,r=t.body,i=v(n);if(Bs(i,n,r)){let t=new i.MutationObserver(()=>{Bs(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=$t||!Vs(e);this.restore=a?Us(e):Ws(e)}};function Ks(e=!0,t=null){H(()=>{if(e)return Gs.acquire(t)},[e,t])}var qs=20;function Js(e,t,n,r){let[i,a]=V.useState(!1);H(()=>{if(!e||!t||n==null){a(!1);return}let r=Rt(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-qs)},[e,t,n]),Ks(e&&(!t||i),r)}var Ys=V.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Ai,style:g,..._}=e,v=ka(),y=Aa(),b=ms(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),ee=v.useState(`inputGroupElement`),te=v.useState(`inputInsidePopup`),O=v.useState(`transitionStatus`),k=Yo(),A=As({anchor:i??(te?E:ee??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Js(S&&x,w===`touch`,T,E);let j={open:S,side:A.side,align:A.align,anchorHidden:A.anchorHidden,empty:k};H(()=>{v.set(`popupSide`,A.side)},[v,A.side]);let ne=W(e=>{v.set(`positionerElement`,e)}),M=Fs(e,j,{styles:A.positionerStyles,transitionStatus:O,props:_,refs:[t,ne],hidden:!C,inert:!S});return(0,Y.jsxs)(Ro.Provider,{value:A,children:[C&&x&&(0,Y.jsx)(Ns,{inert:gs(!S),cutout:ee??D??E}),M]})}),Xs={...Ln,...En},Zs=V.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=ka(),l=zo(),u=Aa(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=Yo(),x=s.id??(g?ho(y):void 0);H(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),la({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S=Si(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=gn(e.nativeEvent);p!==`touch`&&(q(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Ps(h),s],stateAttributesMapping:Xs}),C=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return(0,Y.jsx)(Qi,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Y.jsxs)(V.Fragment,{children:[S,T&&(0,Y.jsx)(qo,{ref:c.context.endDismissRef})]})})});function Qs(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=is(),u=V.useRef(-1),[d,f]=V.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=V.useRef(null),h=V.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return H(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var $s=V.createContext(void 0),ec=V.createContext(!1);function tc(){return V.useContext(ec)}function nc(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=V.useRef(null),m=Qs({guess:!0,index:l,textRef:p}),h=ka(),g=tc(),_=Na(),v=h.useState(`selectionMode`),y=h.useState(`disabled`),b=h.useState(`readOnly`),x=h.useState(`isItemEqualToValue`),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=h.useState(`id`),D=h.useState(`isActive`,w),ee=h.useState(`isSelected`,c),te=h.useState(`itemProps`),O=V.useRef(null),k=E!=null&&T?`${E}-${w}`:void 0,A=ee&&C;H(()=>{if(!T||!r&&l==null)return;let e=h.context.listRef.current;return e[w]=O.current,()=>{delete e[w]}},[T,r,w,l,h]),H(()=>{if(!T||_)return;let e=h.context.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),H(()=>{if(!T||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=Ha(w,c,h.context.valuesRef.current,e,x,t):Ia(c,e,x)&&(t=w),h.set(`selectedIndex`,t)},[T,_,h,w,c,x]);let{getButtonProps:j,buttonRef:ne}=Wo({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),M={disabled:S,selected:A,highlighted:D};function N(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(Mi.flushSync(t),h.context.requestSubmit()):t()}let P={id:k,role:g?`gridcell`:`option`,"aria-selected":C?A:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||N(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&N(e.nativeEvent)}},F=Si(`div`,t,{ref:[ne,n,m.ref,O],state:M,props:[te,P,f,j]}),re=V.useMemo(()=>({selected:A,textRef:p}),[A,p]);return(0,Y.jsx)($s.Provider,{value:re,children:F})}function rc(e){let{componentProps:t,forwardedRef:n}=e,r=ka().useState(`isItemEqualToValue`),{flatFilteredValues:i}=ja(),a=za(i,t.value??null,r);return(0,Y.jsx)(nc,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var ic=V.memo(V.forwardRef(function(e,t){let n=ka().useState(`virtualized`);return n&&e.index==null?(0,Y.jsx)(rc,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(nc,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}));R();var ac=e=>{B({amount:e,localQuotes:[],localSelectedQuote:null,quotesWarning:null,quotesErrors:null,isLoading:!0});let{opts:t}=z();fe(e,t)},oc=async()=>{let{error:e,state:t,isLoading:n,onFailure:r,onSuccess:i}=z();ge(),me();let a=(({state:e,error:t,isLoading:n})=>t?{type:`failure`,error:t}:e.status===`provider-success`?{type:`success`,value:{status:`confirmed`}}:e.status===`provider-confirming`||((e,t)=>e.status===`stripe-flow`&&e.step===`confirm-checkout`&&t)(e,n)?{type:`success`,value:{status:`submitted`}}:{type:`failure`,error:Error(`User exited flow`)})({state:t,error:e,isLoading:n});a.type===`success`?await i(a.value):r(a.error)},sc=async(e,{environment:t})=>(await e.fetchPrivyRoute(re,{query:{environment:t}})).data,cc=(e,t,n=`us`,r)=>{if(n===`eu`)return lc(t,r);let i=e=>t.includes(e),a=i(`first_name`)&&i(`last_name`),o=i(`address_line_1`)&&i(`address_city`)&&i(`address_state`)&&i(`address_postal_code`),s=i(`dob`),c=i(`id_number`);return e===`l0`?a?o?null:`collect-address`:`collect-name`:a?s?c?o?null:`collect-address`:`collect-ssn`:`collect-dob`:`collect-name`},lc=(e,t)=>{let n=t=>e.includes(t);if(t!==`pending`&&t!==`verified`&&t!==`rejected`){if(!n(`first_name`)||!n(`last_name`))return`collect-name`;if(!n(`dob`))return`collect-dob`;if(!n(`nationalities`))return`collect-nationality`;if(!n(`birth_city`)||!n(`birth_country`))return`collect-birth-location`;if(!n(`address_line_1`))return`collect-address`}return n(`identifiers`)?n(`attestation`)?t===`verified`?null:`verify-documents`:`eu-attestation`:`collect-identifiers`},uc=e=>{let t=[`collect-name`,`collect-dob`,`collect-nationality`,`collect-birth-location`,`collect-address`,`collect-identifiers`,`eu-attestation`,`verify-documents`,`select-payment`],n=t.indexOf(e);return n===-1?`select-payment`:t[n+1]??`select-payment`},dc=e=>e?.find((e=>e.tier===`l2`))?.verification_status,fc=e=>e?.find((e=>e.tier===`l2`&&e.verification_status===`rejected`))?.verification_errors?.includes(`user_has_reached_max_verification_attempts`)??!1,X=e=>e.replace(/[\s/-]/g,``).toUpperCase(),pc=e=>X(e).split(``).map(Number),Z=(e,t,n)=>Number(e.slice(t,n)),mc=(e,t,n)=>e>=t&&e<=n,hc=e=>mc(e,1,12),gc=e=>mc(e,1,31),_c=e=>Math.floor(e/10)+e%10,vc=(e,t,n)=>{let r=pc(e);return n(t.reduce(((e,t,n)=>e+r[n]*t),0))===r[t.length]},yc=e=>{let t=pc(e),n=[1,2,3,4,5,6,7,8,9,1].reduce(((e,n,r)=>e+t[r]*n),0),r=n%11;return r===10&&(r=(n=[3,4,5,6,7,8,9,1,2,3].reduce(((e,n,r)=>e+t[r]*n),0))%11)==10&&(r=0),r===t[10]},bc=(e,t)=>{let n=pc(e);return(10-t.reduce(((e,t,r)=>e+_c(n[r]*t)),0)%10)%10===n[t.length]},xc={at_stn:e=>{let t=X(e);return/^\d{9}$/.test(t)&&bc(t,[1,2,1,2,1,2,1,2])},be_nrn:e=>{let t=X(e);if(!/^\d{11}$/.test(t)||!hc(Z(t,2,4))||!gc(Z(t,4,6)))return!1;let n=Number(t.slice(0,9)),r=Z(t,9,11);return 97-n%97===r||97-Number(`2${t.slice(0,9)}`)%97===r},bg_ucn:e=>{let t=X(e),n=Z(t,2,4);return/^\d{10}$/.test(t)&&(mc(n,1,12)||mc(n,21,32)||mc(n,41,52))&&gc(Z(t,4,6))&&vc(t,[2,4,8,5,10,9,7,3,6],(e=>e%11==10?0:e%11))},hr_oib:e=>/^\d{11}$/.test(X(e))&&(e=>{let t=pc(e),n=10;for(let e=0;e<10;e++){let r=(t[e]+n)%10;r===0&&(r=10),n=2*r%11}let r=11-n;return r===10&&(r=0),r===t[10]})(X(e)),cy_tic:e=>{let t=X(e);if(!/^[069]\d{7}[A-Z]$/.test(t))return!1;let n={0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21};return String.fromCharCode(65+([0,2,4,6].reduce(((e,r)=>e+n[t[r]]),0)+[1,3,5,7].reduce(((e,n)=>e+Number(t[n])),0))%26)===t[8]},cz_rc:e=>{let t=X(e),n=Z(t,2,4);return/^\d{9,10}$/.test(t)&&(mc(n,1,12)||mc(n,51,62)||t.length===10&&(mc(n,21,32)||mc(n,71,82)))&&gc(Z(t,4,6))},dk_cpr:e=>{let t=X(e);return/^\d{10}$/.test(t)&&gc(Z(t,0,2))&&hc(Z(t,2,4))&&vc(t,[4,3,2,7,6,5,4,3,2],(e=>{let t=e%11;return t===1?-1:t===0?0:11-t}))},ee_ik:e=>{let t=X(e);return/^\d{11}$/.test(t)&&mc(Z(t,0,1),1,6)&&hc(Z(t,3,5))&&gc(Z(t,5,7))&&mc(Z(t,7,10),1,710)&&yc(t)},es_nif:e=>{let t=X(e);return!!/^([KLMXYZ]?\d{7}[A-Z]|\d{8}[A-Z])$/.test(t)&&`TRWAGMYFPDXBNJZSQVHLCKE`[Number(/^\d/.test(t)?t.slice(0,8):`${{X:`0`,Y:`1`,Z:`2`,K:`0`,L:`0`,M:`0`}[t[0]]}${t.slice(1,8)}`)%23]===t[8]},fi_hetu:e=>{let t=e.replace(/\s/g,``).toUpperCase();return!!/^(0[1-9]|[12]\d|3[01])(0[1-9]|1[0-2])\d{2}[+\-A-FU-Y]\d{3}[A-Z0-9]$/.test(t)&&`0123456789ABCDEFHJKLMNPRSTUVWXY`[Number(`${t.slice(0,6)}${t.slice(7,10)}`)%31]===t[10]},fr_nir:e=>{let t=X(e);return/^[0-3]\d{12}$/.test(t)&&String(Number(t.slice(0,10))%511).padStart(3,`0`)===t.slice(10)},fr_spi:e=>{let t=X(e);return/^[0-3]\d{12}$/.test(t)&&String(Number(t.slice(0,10))%511).padStart(3,`0`)===t.slice(10)},de_stn:e=>{let t=X(e);if(/^\d{13}$/.test(t))return t[4]===`0`;if(!/^\d{11}$/.test(t)||t[0]===`0`||/(\d)\1\1/.test(t)||![...new Set(t.slice(0,10))].map((e=>t.slice(0,10).split(e).length-1)).some((e=>e===2||e===3)))return!1;let n=pc(t),r=10;for(let e=0;e<10;e++){let t=(n[e]+r)%10;t===0&&(t=10),r=2*t%11}return(11-r==10?0:11-r)===n[10]},gr_afm:e=>/^\d{9}$/.test(X(e)),hu_ad:e=>/^8\d{9}$/.test(X(e))&&vc(X(e),[1,2,3,4,5,6,7,8,9],(e=>e%11)),ie_ppsn:e=>{let t=X(e);if(!/^\d{7}[A-W][A-IW]?$/.test(t))return!1;let n=(9*(t.length===9?t[8]===`W`?0:t.charCodeAt(8)-64:0)+[8,7,6,5,4,3,2].reduce(((e,n,r)=>e+Number(t[r])*n),0))%23;return(n===0?`W`:String.fromCharCode(64+n))===t[7]},is_kt:e=>{let t=X(e);return/^\d{10}$/.test(t)&&gc(Z(t,0,2))&&hc(Z(t,2,4))&&(t[9]===`9`||t[9]===`0`)},it_cf:e=>{let t=X(e);if(!/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/.test(t)||!`ABCDEHLMPRST`.includes(t[8])||![...Array(31).keys()].some((e=>Z(t,9,11)===e+1||Z(t,9,11)===e+41)))return!1;let n={0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21,A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23},r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``).reduce(((e,t,n)=>({...e,[t]:n<10?n:n-10})),{});return String.fromCharCode(65+t.slice(0,15).split(``).reduce(((e,t,i)=>e+((i+1)%2?n[t]:r[t])),0)%26)===t[15]},lv_pk:e=>{let t=X(e);return/^(0[1-9]|[12]\d|3[01])(0[0-9]|1[0-2])\d{7}$|^32\d{9}$/.test(t)&&(t.startsWith(`32`)||[`0`,`1`,`2`].includes(t[6]))},lt_ak:e=>{let t=X(e);return/^\d{11}$/.test(t)&&mc(Z(t,0,1),1,6)&&hc(Z(t,3,5))&&gc(Z(t,5,7))&&yc(t)},lu_nif:e=>{let t=X(e);return!!(/^\d{13}$/.test(t)&&mc(Z(t,0,4),1800,2100)&&hc(Z(t,4,6))&&gc(Z(t,6,8)))&&[2,1,2,1,2,1,2,1,2,1,2,1].reduce(((e,n,r)=>e+_c(Number(t[r])*n)),0)%10==0&&(e=>{let t=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],n=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],r=0,i=pc(e).reverse();for(let e=0;e<i.length;e++)r=t[r][n[e%8][i[e]]];return r===0})(`${t.slice(0,11)}${t[12]}`)},mt_nic:e=>{let t=X(e);return/^\d{7}[MGAPLHBZ]$/.test(t)||/^\d{9}$/.test(t)&&[`11`,`22`,`33`,`44`,`55`,`66`,`77`,`88`].includes(t.slice(0,2))},mt_pp:e=>/^\d{7}$/.test(X(e)),nl_bsn:e=>/^\d{9}$/.test(X(e))&&vc(X(e),[9,8,7,6,5,4,3,2],(e=>e%11==10?-1:e%11)),pl_nip:e=>/^\d{10}$/.test(X(e))&&vc(X(e),[6,5,7,2,3,4,5,6,7],(e=>e%11==10?-1:e%11)),pl_pesel:e=>{let t=X(e),n=Z(t,2,4);return/^\d{11}$/.test(t)&&(hc(n)||mc(n,21,32)||mc(n,41,52)||mc(n,61,72)||mc(n,81,92))&&gc(Z(t,4,6))&&vc(t,[1,3,7,9,1,3,7,9,1,3],(e=>(10-e%10)%10))},pt_nif:e=>/^\d{9}$/.test(X(e))&&vc(X(e),[9,8,7,6,5,4,3,2],(e=>{let t=11-e%11;return t>=10?0:t})),ro_cnp:e=>{let t=X(e),n=Z(t,7,9),r=t[0]===`9`&&t.slice(1,4)===`000`;return/^\d{13}$/.test(t)&&mc(Z(t,0,1),1,9)&&(r||hc(Z(t,3,5))&&gc(Z(t,5,7)))&&(mc(n,1,47)||n===51||n===52)&&vc(t,[2,7,9,1,4,6,3,5,8,2,7,9],(e=>e%11==10?1:e%11))},sk_rc:e=>{let t=X(e),n=Z(t,2,4);return/^\d{9,10}$/.test(t)&&(hc(n)||mc(n,51,62))&&gc(Z(t,4,6))},si_pin:e=>{let t=X(e);return/^\d{8}$/.test(t)&&mc(Z(t,0,7),1e6,9999999)&&vc(t,[8,7,6,5,4,3,2],(e=>{let t=11-e%11;return t===10?0:t===11?-1:t}))},se_pin:e=>{let t=X(e);if(!/^\d{10}$|^\d{12}$/.test(t))return!1;if(t.length===12){if(![`18`,`19`,`20`].includes(t.slice(0,2)))return!1;t=t.slice(2)}let n=Z(t,4,6);return hc(Z(t,2,4))&&(gc(n)||mc(n,61,91))&&bc(t,[2,1,2,1,2,1,2,1,2])}},Sc={ee_ik:`39901011231`,es_nif:`00000000T`,is_kt:`0101000000`,it_cf:`AAAAAA00A01A000H`,mt_nic:`0000000M`,mt_pp:`0000000`,pl_pesel:`44051401458`,pl_nip:`8567346215`},Cc={at_stn:`Steuernummer (Austria)`,be_nrn:`National Registration Number (Belgium)`,bg_ucn:`Unified Civil Number (Bulgaria)`,hr_oib:`OIB (Croatia)`,cy_tic:`Tax Identification Code (Cyprus)`,cz_rc:`Rodné číslo (Czech Republic)`,dk_cpr:`CPR (Denmark)`,ee_ik:`Isikukood (Estonia)`,es_nif:`NIF (Spain)`,fi_hetu:`HETU (Finland)`,fr_spi:`Numéro fiscal (France)`,fr_nir:`NIR (France)`,de_stn:`Steuer-ID (Germany)`,gr_afm:`AFM (Greece)`,hu_ad:`Adóazonosító (Hungary)`,ie_ppsn:`PPSN (Ireland)`,is_kt:`Kennitala (Iceland)`,it_cf:`Codice fiscale (Italy)`,lv_pk:`Personas kods (Latvia)`,lt_ak:`Asmens kodas (Lithuania)`,lu_nif:`NIF (Luxembourg)`,mt_nic:`National Identity Card (Malta)`,mt_pp:`Passport (Malta)`,nl_bsn:`BSN (Netherlands)`,pl_pesel:`PESEL (Poland)`,pl_nip:`NIP (Poland)`,pt_nif:`NIF (Portugal)`,ro_cnp:`CNP (Romania)`,sk_rc:`Rodné číslo (Slovakia)`,si_pin:`EMŠO (Slovenia)`,se_pin:`Personnummer (Sweden)`},Q=()=>{let e=z().stripeSession;if(!e)throw Error(`No active Stripe onramp session`);return e},$=()=>{let{stripeSession:e,controller:t}=z();return e!==null&&!(t.current?.signal.aborted??1)},wc=()=>{let{controller:e}=z();if(!e.current)throw Error(`No active abort controller`);return e.current.signal},Tc=async()=>{let e=Q().onramp;if(!e.getMissingIdentifiers)throw Error(`Stripe onramp getMissingIdentifiers is unavailable`);let t=await e.getMissingIdentifiers();if(!$())return!1;let n=Q();return B({stripeSession:{...n,context:{...n.context,kycMissingIdentifiers:t.identifiers,kycMissingAlternatives:t.alternatives}}}),(({identifiers:e})=>e.length>0)(t)},Ec=({stripeKycRegion:e,sourceCurrency:t})=>{if(e===`eu`||e===`us`)return e;let n=t.toUpperCase();if(n===`EUR`)return`eu`;if(n===`USD`)return`us`;throw Error(`Unsupported source currency for Stripe onramp: ${n}`)},Dc=e=>({providedFields:e.status===`active`?e.provided_fields:[],kycTiers:e.status===`active`?e.kyc_tiers:void 0}),Oc=({customer:e,region:t})=>e.status===`active`&&(t===`eu`?((e,t)=>t===`verified`&&e.includes(`identifiers`)&&e.includes(`attestation`))(e.provided_fields,dc(e.kyc_tiers)):e.verifications.some((e=>e.status===`verified`))),kc=async({customer:e,region:t,tier:n=`l0`})=>{let{providedFields:r,kycTiers:i}=Dc(e);if(t!==`eu`)return cc(n,r,t);if(fc(i))throw Error(`Document verification was rejected. Contact Stripe support for help.`);let a=(({kycTiers:e,providedFields:t})=>lc(t,dc(e)))({kycTiers:i,providedFields:r});return a!==`collect-identifiers`||await Tc()||(a=uc(`collect-identifiers`)),a},Ac=e=>e?`privyErrorCode`in e&&typeof e.privyErrorCode==`string`?e.privyErrorCode:`code`in e&&typeof e.code==`string`?e.code:null:null,jc=({eventType:e,error:t,errorCode:n,attempt:r,context:i,stripeSessionId:a})=>{let o=_e.getState();if(!o)return;let s=o.stripeSession,c=i??s?.context.config;c&&o.privy.track({name:`stripe_onramp_client_operation`,properties:{event_type:e,error_code:n??Ac(t instanceof Error?t:null),privy_session_id:c.sessionId,stripe_session_id:a??s?.context.stripeSessionId,source_currency:o.opts.source.selectedAsset.toLowerCase(),destination_currency:o.opts.destination.asset.toLowerCase(),destination_network:c.network,environment:c.environment,...r===void 0?{}:{attempt:r}}})},Mc=e=>(e instanceof Error?e.message:String(e)).toLowerCase().includes(`user is not authenticated`),Nc=(e,t=`flow_failed`)=>{let n=e instanceof Error?e:Error(String(e));if(console.error(`[FiatOnramp:Stripe]`,n),Mc(n))return jc({eventType:`link_auth_error`,error:n}),void B({state:{status:`stripe-flow`,step:`choose-email`},error:null,stripeElement:null,isLoading:!1});jc({eventType:t,error:n}),B({state:{status:`provider-error`},error:n,isLoading:!1})},Pc={path:`/api/v1/onramp/stripe/transaction_limits`,method:`GET`},Fc=async()=>{let e=Q(),{opts:t,amount:n}=z(),r=Ic(n);try{let n=Lc({limits:await(async(e,t)=>await e.fetchPrivyRoute(Pc,{query:{environment:t.environment,destination_chain:t.destinationChain,wallet_address:t.walletAddress}}))(e.privy,{environment:e.context.config.environment,destinationChain:t.destination.chain,walletAddress:t.destination.address}),sourceCurrency:t.source.selectedAsset});return n===null||r<=n}catch{return!0}},Ic=e=>{let t=e.trim();if(!/^\d+(?:\.\d*)?$/.test(t))throw Error(`Enter a valid amount and try again.`);let n=Number.parseFloat(t);if(!Number.isFinite(n))throw Error(`Enter a valid amount and try again.`);return n},Lc=({limits:e,sourceCurrency:t})=>{let n=Object.values(e.limits[`${t.toLowerCase()}.fiat`]??{}).flat();return n.length?Math.max(...n.map((e=>e.limit))):null},Rc=async({customer:e,loader:t,tier:n})=>{if(!$())return;let{providedFields:r}=Dc(e),i=Q(),a=i.context.kycRegion??`us`,o=n??(({customer:e,region:t})=>{if(e.status!==`active`)return null;if(t===`eu`)return Oc({customer:e,region:t})?null:`l2`;let n=t=>e.kyc_tiers?.some((e=>e.tier===t&&e.verification_status===`verified`));return n(`l2`)?null:n(`l1`)?`l2`:n(`l0`)?`l1`:`l0`})({customer:e,region:a});if(!o)throw new L(`Checkout failed: transaction_limit_reached`,void 0,le.ONRAMP_TRANSACTION_LIMIT_REACHED);if(a===`eu`){let n=await kc({customer:e,region:a});if(!$())return;if(!n)throw Error(`Stripe could not continue identity verification. Try again.`);B({stripeSession:{...i=Q(),context:{...i.context,...t?{documentVerificationAction:{type:`retry-payment`,loader:t}}:{},kycTier:o,kycProvidedFields:r}},state:{status:`stripe-flow`,step:n},isLoading:!1});return}let s=await kc({customer:e,region:a,tier:o});if(!$())return;let c={...(i=Q()).context,...o===`l2`&&t?{documentVerificationAction:{type:`retry-payment`,loader:t}}:{},kycTier:o,kycProvidedFields:r};if(s)B({stripeSession:{...i,context:c},state:{status:`stripe-flow`,step:s},isLoading:!1});else{if(o!==`l2`)throw Error(`Stripe could not continue identity verification. Try again.`);B({stripeSession:{...i,context:c},state:{status:`stripe-flow`,step:`verify-documents`},isLoading:!1})}},zc=async(e,{environment:t})=>(await e.fetchPrivyRoute(N,{query:{environment:t}})).data,Bc=[`aptos`,`avalanche`,`arbitrum`,`base`,`bitcoin`,`ethereum`,`optimism`,`polygon`,`solana`,`stellar`,`sui`,`tempo`,`worldchain`,`xrpl`],Vc=2e3,Hc=e=>{if((e=>Bc.some((t=>t===e)))(e))return e;throw Error(`Unsupported Stripe onramp network: ${e}`)},Uc=async(e,t)=>await e.fetchPrivyRoute(j,{body:{session_id:t.sessionId,environment:t.environment,session:t.session}}),Wc=e=>{let t=Gc(e?.source_currency?.toLowerCase());return{currencySymbol:t,paymentMethodLabel:null,fee:e?.fee&&t?`${t}${e.fee}`:null,destinationAmount:Kc(e?.destination_amount),destinationToken:e?.destination_currency?.toUpperCase()??null,destinationNetwork:qc(e?.destination_network),sourceAmount:e?.source_total_amount??null,quoteExpiresAt:e?.quote_expiration??null}},Gc=e=>e===`usd`?`$`:e===`eur`?`€`:e===`gbp`?`£`:null,Kc=e=>e?e.replace(/\.0+$/,``).replace(/(\.\d*?)0+$/,`$1`):null,qc=e=>e?e.split(/[-_]/).map((e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`)).join(` `):null,Jc=e=>{let t=Xc(e);if(t===le.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED)return`l0`;if(t===le.ONRAMP_IDENTITY_VERIFICATION_REQUIRED)return`l1`;if(t===le.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED)return`l2`;if(t===`crypto_onramp_missing_minimum_identity_verification`)return`l0`;if(t===`crypto_onramp_missing_identity_verification`)return`l1`;if(t===`crypto_onramp_missing_document_verification`)return`l2`;let n=Zc(e);return n.includes(`crypto_onramp_missing_minimum_identity_verification`)?`l0`:n.includes(`crypto_onramp_missing_identity_verification`)?`l1`:n.includes(`crypto_onramp_missing_document_verification`)?`l2`:n.toLowerCase().includes(`minimum identity verification`)?`l0`:n.toLowerCase().includes(`identity verification`)?`l1`:n.toLowerCase().includes(`document verification`)?`l2`:null},Yc=e=>{let t=Xc(e);return t===le.ONRAMP_TRANSACTION_LIMIT_REACHED||t===`transaction_limit_reached`||t===`crypto_onramp_transaction_limit_reached`},Xc=e=>{if(!e||typeof e!=`object`)return null;if(`code`in e&&typeof e.code==`string`)return e.code;if(`error`in e){let t=e.error;if(t&&typeof t==`object`&&`code`in t&&typeof t.code==`string`)return t.code}return null},Zc=e=>{if(!e)return``;let t=[];if(e instanceof Error?t.push(e.name,e.message):t.push(String(e)),typeof e==`object`&&(`code`in e&&t.push(String(e.code)),`type`in e&&t.push(String(e.type)),`error`in e)){let n=e.error;typeof n==`object`&&n&&`message`in n&&t.push(String(n.message)),typeof n==`object`&&n&&`code`in n&&t.push(String(n.code))}return t.join(` `)},Qc=(e,t)=>{let n=e.find((e=>e.id===t));if(!n?.card)return null;let r=n.card.brand?`${n.card.brand.charAt(0).toUpperCase()}${n.card.brand.slice(1)}`:`Card`;return n.card.last4?`${r} •••• ${n.card.last4}`:r},$c=async({paymentToken:e,loader:t})=>{let n=Q();try{let r,i,{opts:a,amount:o}=z(),{config:s,cryptoCustomerId:c}=n.context;if(!c)throw Error(`Missing cryptoCustomerId`);t===`inline`?B({stripeSession:{...n,context:{...n.context,paymentToken:e}},isLoading:!0}):t===`screen`&&B({stripeSession:{...n,context:{...n.context,paymentToken:e}},state:{status:`stripe-flow`,step:`checkout`},isLoading:!1});let l={crypto_customer_id:c,payment_token:e,source_amount:o||`0`,source_currency:a.source.selectedAsset.toUpperCase(),destination_currency:a.destination.asset,destination_network:s.network,wallet_address:a.destination.address};try{let e=await Uc(n.privy,{sessionId:s.sessionId,environment:s.environment,session:l});r=e.id,i=e.transaction_details}catch(e){let r=Jc(e);if(!r&&!Yc(e))throw e;return $()?await Rc({customer:await sc(n.privy,{environment:s.environment}),loader:t,tier:r}):void 0}if(!$())return;let u=Q().context.paymentMethodLabel??null;if(!u)try{u=Qc(await zc(n.privy,{environment:s.environment}),e)}catch{}let d={...Wc(i),paymentMethodLabel:u},f=Q();B({stripeSession:{...f,context:{...f.context,stripeSessionId:r,checkoutDetails:d}},stripeConfirmCheckoutDetails:d,state:{status:`stripe-flow`,step:`confirm-checkout`},isLoading:!1})}catch(e){Nc(e)}},el=async e=>{let t=Q();try{let{opts:n}=z(),r=t.context.config.network,i=await(async(e,{environment:t})=>(await e.fetchPrivyRoute(P,{query:{environment:t}})).data)(t.privy,{environment:t.context.config.environment});if(!$())return;if(!i.some((e=>e.wallet_address===n.destination.address&&e.network===r))){try{await t.onramp.registerWalletAddress(n.destination.address,Hc(r))}catch(e){if(console.warn(`[FiatOnramp:Stripe] registerWalletAddress failed:`,e),Mc(e))return void Nc(e);jc({eventType:`wallet_registration_error`,error:e})}if(!$())return}if(!e?.skipTokenCheck){let e=[];try{e=await zc(t.privy,{environment:t.context.config.environment})}catch{}if(!$())return;if(e.length>0){let t=new Set,n=e.filter((e=>{let n=`${e.type}:${e.card?.brand??``}:${e.card?.last4??``}`;return!t.has(n)&&(t.add(n),!0)})),r=Q();B({stripeSession:{...r,context:{...r.context,savedPaymentTokens:n}},state:{status:`stripe-flow`,step:`select-payment`},isLoading:!1});return}}B({stripeElement:null,state:{status:`stripe-flow`,step:`payment`},isLoading:!1});let a=t.context.kycRegion??`us`,o=await de(t.onramp.collectPaymentMethod({payment_method_types:a===`eu`?[`card`]:[`card`,`us_bank_account`],wallets:{applePay:`auto`,googlePay:`auto`}},(e=>{if($()){if(!e.cryptoPaymentToken)return void Nc(Error(`Payment method selection was cancelled`),`flow_cancelled`);$c({paymentToken:e.cryptoPaymentToken,loader:`screen`})}})).catch((e=>(Nc(e),null))),3e4,wc());$()&&o&&B({stripeElement:o})}catch(e){Nc(e)}},tl=async()=>{let e,t=he();if(!t)return;let n=t.provider;if(n===`stripe`||n===`stripe-sandbox`){B({isLoading:!0});let{opts:e,amount:r,getProviderUrl:i,email:a,phone:o,privy:s}=z();try{let c=nl(await i({source:{asset:e.source.selectedAsset.toUpperCase(),amount:r||`0`},destination:{asset:e.destination.asset,chain:e.destination.chain,address:e.destination.address},provider:t.provider,sub_provider:t.sub_provider??void 0,payment_method:t.payment_method})),l=n===`stripe`?`production`:`sandbox`,u={publishableKey:c.publishable_key,network:c.network,sessionId:c.session_id,userEmail:a??``,userPhone:o,environment:l};try{await(async(e,t)=>{let n;me();try{({loadCryptoOnrampAndInitialize:n}=await se(()=>import(`./stripe.esm-BCW9KcRF.js`),[]))}catch{throw Error(`@stripe/crypto is required for Stripe onramp but could not be loaded. Ensure the package is installed.`)}let{controller:r}=z();r.current=new AbortController;let i=await de(Promise.resolve(n(t.publishableKey,{theme:`stripe`})),15e3,r.current.signal);if(!i)throw Error(`Stripe crypto SDK unavailable`);let a=crypto.randomUUID();B({stripeSession:{id:a,onramp:i,privy:e,context:{sessionId:a,config:t}}})})(s,u)}catch(e){throw jc({eventType:`sdk_init_error`,error:e,context:u}),e}let d=Q();if(!d)return;let f=await sc(d.privy,{environment:l});if(!$())return;if(f.status===`active`){let t=Q(),n=Ec({stripeKycRegion:f.kyc_region,sourceCurrency:e.source.selectedAsset});B({stripeSession:{...t,context:{...t.context,cryptoCustomerId:f.crypto_customer_id,kycRegion:n,kycProvidedFields:f.provided_fields}},isLoading:!0}),await(async({authIntentId:e,onReady:t})=>{let n=Q(),r=!1,i=async()=>{if(!r){r=!0;try{await t()}catch(e){if(!$())return;Nc(e)}}};if(!e)return void await i();let a=null;try{a=await de(n.onramp.authenticate(e,(e=>{$()&&(e.result===`success`?i():Nc(Error(`Link authentication ${e.result}`)))})),3e4,wc())}catch(e){if(!$())return;jc({eventType:`link_auth_error`,error:e}),B({state:{status:`stripe-flow`,step:`choose-email`},isLoading:!1});return}$()&&(a?B({state:{status:`stripe-flow`,step:`authenticating`},stripeElement:a,isLoading:!1}):await i())})({authIntentId:f.link_auth_intent_id,onReady:async()=>{if($()){if(n===`eu`){if(Oc({customer:f,region:n})){let e=await Fc();if($()){if(!e)return await Rc({customer:f});await el()}}else{let e=await kc({customer:f,region:n})??`collect-name`;if(!$())return;B({state:{status:`stripe-flow`,step:e},isLoading:!1})}}else if(Oc({customer:f,region:n})){let e=await Fc();if(!$())return;if(!e)return await Rc({customer:f});await el()}else B({state:{status:`stripe-flow`,step:`collect-name`},isLoading:!1})}}})}else B({state:{status:`stripe-flow`,step:`choose-email`},isLoading:!1})}catch(e){console.error(`[FiatOnramp:Stripe] Init failed:`,e),B({state:{status:`provider-error`},isLoading:!1,error:Error(`Something went wrong setting up checkout. Please try again.`)})}return}let r=ye();if(!r)return void B({state:{status:`provider-error`},error:Error(`Unable to open payment window`)});B({isLoading:!0});let{opts:i,amount:a,getProviderUrl:o,getStatus:s,controller:c}=z(),l=()=>{try{r.closed||r.close()}catch{}};c.current=new AbortController;try{let n=await o({source:{asset:i.source.selectedAsset.toUpperCase(),amount:a||`0`},destination:{asset:i.destination.asset,chain:i.destination.chain,address:i.destination.address},provider:t.provider,sub_provider:t.sub_provider??void 0,payment_method:t.payment_method,redirect_url:window.location.origin});if(n.type!==`url`)throw Error(`Expected URL response for popup-based provider`);r.location.href=n.url,e=n.session_id}catch{l(),B({state:{status:`provider-error`},isLoading:!1,error:Error(`Unable to start payment session`)});return}B({isLoading:!1}),B({state:{status:`provider-confirming`}});let u=await F({operation:()=>s({session_id:e,provider:t.provider}),until:e=>e.status===`completed`||e.status===`failed`||e.status===`cancelled`,delay:0,interval:2e3,attempts:210,signal:c.current.signal});if(u.status!==`aborted`){if(u.status===`max_attempts`)return l(),u.error?(console.error(u.error),void B({state:{status:`select-amount`},isLoading:!1,error:Error(`Unable to check payment status. Please try again.`)})):void B({state:{status:`provider-error`},error:Error(`Could not confirm payment status yet.`)});u.result?.status===`completed`?(l(),B({state:{status:`provider-success`}})):(l(),B({state:{status:`provider-error`},error:Error(`Transaction ${u.result?.status??`failed`}`)}))}},nl=e=>{if(e&&typeof e==`object`&&`publishable_key`in e&&`network`in e&&`session_id`in e)return e;throw Error(`Unexpected response shape from provider_session_url for Stripe`)},rl=()=>{let e=ue();e&&e.length>0&&B({state:{status:`select-payment-method`,quotes:e}})},il=()=>{B({state:{status:`select-source-asset`},localQuotes:[],localSelectedQuote:null,quotesWarning:null,quotesErrors:null})},al=()=>{B({error:null,state:{status:`select-amount`}})},ol=e=>{B({localSelectedQuote:e,state:{status:`select-amount`}})},sl=e=>{let{opts:t,amount:n}=z(),r={...t,source:{...t.source,selectedAsset:e}};B({opts:r,state:{status:`select-amount`},localQuotes:[],localSelectedQuote:null,quotesWarning:null,quotesErrors:null,isLoading:!0}),fe(n,r)},cl=({element:e,minHeight:t,bleed:n=!1})=>{let r=(0,V.useRef)(null);return(0,V.useEffect)((()=>(r.current&&e&&r.current.replaceChildren(e),()=>{r.current&&r.current.replaceChildren()})),[e]),(0,Y.jsx)(`div`,{ref:r,style:{minHeight:t,margin:n?`0 -1rem`:void 0}})},ll=(e,t)=>e!==`collect-address`||t.kycRegion!==`eu`||t.kycAddress?.country?e:`collect-country`,ul=e=>{$()&&B({state:{status:`stripe-flow`,step:ll(e,Q().context)}})},dl=({city:e,country:t})=>{let n=Q(),r=n.context,i=[...r.kycProvidedFields??[],`birth_city`,`birth_country`];B({stripeSession:{...n,context:{...r,kycBirthCity:e,kycBirthCountry:t,kycProvidedFields:i}}}),ul(uc(`collect-birth-location`))},fl=async(e,t)=>(await e.fetchPrivyRoute(ae,{params:{session_id:t}})).client_secret,pl=async(e,t)=>{let n=await e.fetchPrivyRoute(ne,{params:{session_id:t}});return{quoteExpiresAt:n.quote_expiration,sourceTotalAmount:n.source_total_amount,fee:n.fee,destinationAmount:n.destination_amount}},ml=e=>!e||typeof e!=`object`?null:e.transaction_details?.last_error??null,hl=new Set([`transaction_limit_reached`,`location_not_supported`,`transaction_failed`]),gl=e=>e===`transaction_limit_reached`?new L(`Checkout failed: transaction_limit_reached`,void 0,le.ONRAMP_TRANSACTION_LIMIT_REACHED):Error(`Checkout failed: ${e??`unknown error`}`),_l=e=>!!(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`&&e.message.toLowerCase().includes(`quote expired`)),vl=async()=>{let e=Q();try{let{stripeSessionId:t}=e.context;if(!t)throw Error(`Missing stripeSessionId`);B({isLoading:!0});for(let n=0;n<3;n++){let r;if(!$())return;try{r=await e.onramp.performCheckout(t,(async t=>await fl(e.privy,t)))}catch(r){if(!_l(r))throw r;jc({eventType:`checkout_error`,error:r,errorCode:`quote_expired`,attempt:n+1,stripeSessionId:t}),await pl(e.privy,t);continue}if(r.successful){if(!$())return;B({state:{status:`provider-success`},isLoading:!1});return}let i=ml(r);if(jc({eventType:`checkout_error`,errorCode:i,attempt:n+1,stripeSessionId:t}),!i||hl.has(i))throw gl(i);if(!$())return;if(i===`charged_with_expired_quote`)await pl(e.privy,t);else if(i===`quote_rate_drifted`){let{opts:n,amount:r}=z(),{config:i,cryptoCustomerId:a,paymentToken:o}=e.context;if(!a||!o)throw Error(`Cannot recreate session: missing customer or payment token`);t=(await Uc(e.privy,{sessionId:i.sessionId,environment:i.environment,session:{crypto_customer_id:a,payment_token:o,source_amount:r||`0`,source_currency:n.source.selectedAsset.toUpperCase(),destination_currency:n.destination.asset,destination_network:i.network,wallet_address:n.destination.address}})).id;let s=Q();B({stripeSession:{...s,context:{...s.context,stripeSessionId:t}}})}else{if(i===`missing_kyc`){let t=await sc(e.privy,{environment:e.context.config.environment});if(!$())return;let{providedFields:n}=Dc(t),r=Q(),i=await kc({customer:t,region:r.context.kycRegion??`us`,tier:`l0`});if(!$())return;if(r=Q(),!i)throw Error(`Checkout failed: missing_kyc but all fields already provided`);B({stripeSession:{...r,context:{...r.context,documentVerificationAction:{type:`retry-checkout`},kycTier:`l0`,kycProvidedFields:n}},state:{status:`stripe-flow`,step:i}});return}if(i===`missing_document_verification`){let t=await sc(e.privy,{environment:e.context.config.environment});if(!$())return;let{providedFields:n}=Dc(t),r=Q(),i=await kc({customer:t,region:r.context.kycRegion??`us`,tier:`l2`});if(!$())return;let a={...(r=Q()).context,documentVerificationAction:{type:`retry-checkout`},kycTier:`l2`,kycProvidedFields:n};B(i?{stripeSession:{...r,context:a},state:{status:`stripe-flow`,step:i},isLoading:!1}:{stripeSession:{...r,context:a},state:{status:`stripe-flow`,step:`verify-documents`},isLoading:!1});return}if(i!==`missing_consumer_wallet`)throw Error(`Checkout failed: ${i}`);{let{opts:t}=z();await e.onramp.registerWalletAddress(t.destination.address,Hc(e.context.config.network))}}}throw Error(`Checkout failed after maximum retry attempts`)}catch(e){Nc(e)}},yl=[{code:`AT`,name:`Austria`},{code:`BE`,name:`Belgium`},{code:`BG`,name:`Bulgaria`},{code:`HR`,name:`Croatia`},{code:`CY`,name:`Cyprus`},{code:`CZ`,name:`Czech Republic`},{code:`DK`,name:`Denmark`},{code:`EE`,name:`Estonia`},{code:`FI`,name:`Finland`},{code:`FR`,name:`France`},{code:`DE`,name:`Germany`},{code:`GR`,name:`Greece`},{code:`HU`,name:`Hungary`},{code:`IS`,name:`Iceland`},{code:`IE`,name:`Ireland`},{code:`IT`,name:`Italy`},{code:`LV`,name:`Latvia`},{code:`LT`,name:`Lithuania`},{code:`LU`,name:`Luxembourg`},{code:`MT`,name:`Malta`},{code:`NL`,name:`Netherlands`},{code:`PL`,name:`Poland`},{code:`PT`,name:`Portugal`},{code:`RO`,name:`Romania`},{code:`SK`,name:`Slovakia`},{code:`SI`,name:`Slovenia`},{code:`ES`,name:`Spain`},{code:`SE`,name:`Sweden`}],bl=new Set(yl.map((e=>e.code))),xl=e=>{if(!bl.has(e))return void Nc(Error(`Stripe EU onramp is not available in this country`));let t=Q(),n=t.context,r=n.cryptoCustomerId?`collect-address`:`create-link-account`;B({stripeSession:{...t,context:{...n,kycRegion:`eu`,kycAddress:{...n.kycAddress??{addressLine1:``,city:``,state:``,postalCode:``},country:e}}},state:{status:`stripe-flow`,step:r}})},Sl=async(e,{email:t,environment:n})=>(await e.fetchPrivyRoute(ie,{body:{email:t,environment:n}})).data,Cl=e=>{let t=Q();B({stripeSession:{...t,context:{...t.context,...e}}})},wl=async(e,t)=>{let n=Q();try{if(await(async(e,{authIntentId:t,cryptoCustomerId:n,environment:r})=>{await e.fetchPrivyRoute(M,{body:{auth_intent_id:t,crypto_customer_id:n,environment:r}})})(n.privy,{authIntentId:t,cryptoCustomerId:e,environment:n.context.config.environment}),!$())return;Cl({cryptoCustomerId:e});let r=await sc(n.privy,{environment:n.context.config.environment});if(!$())return;if(r.status!==`active`)throw Error(`Session unexpectedly inactive after authentication`);let{opts:i}=z(),a=Ec({stripeKycRegion:r.kyc_region,sourceCurrency:i.source.selectedAsset});if(Cl({kycRegion:a,kycProvidedFields:r.provided_fields}),a===`eu`){if(Oc({customer:r,region:a})){let e=await Fc();if(!$())return;if(!e)return await Rc({customer:r});await el()}else{let e=await kc({customer:r,region:a})??`collect-name`;if(!$())return;ul(e)}}else if(Oc({customer:r,region:a})){let e=await Fc();if(!$())return;if(!e)return await Rc({customer:r});await el()}else ul(`collect-name`)}catch(e){Nc(e)}},Tl=async e=>{let t=Q();try{B({isLoading:!0});let n=await Sl(t.privy,{email:e,environment:t.context.config.environment});if(!$())return;if(B({isLoading:!1}),n.status===`no_account`){let{opts:n}=z(),r=n.source.selectedAsset.toUpperCase()===`EUR`;B({stripeSession:{...t,context:{...t.context,pendingEmail:e}},state:{status:`stripe-flow`,step:r?`collect-country`:`create-link-account`},email:e})}else{B({stripeSession:{...t,context:{...t.context,authIntentId:n.id,pendingEmail:e}},state:{status:`stripe-flow`,step:`authenticating`},email:e});let r=await de(t.onramp.authenticate(n.id,(e=>{$()&&(e.result===`success`&&e.crypto_customer_id?wl(e.crypto_customer_id,n.id):Nc(Error(`Link authentication ${e.result}`)))})),3e4,wc());$()&&r&&B({stripeElement:r})}}catch(e){Nc(e)}},El=async e=>{let t=Q(),n=t.context,r=await t.onramp.updateKycInfo(e).catch((e=>(Nc(e),null)));if(!r)return;let i=[...n.kycProvidedFields??[]];r.completed&&i.push(`identifiers`),B({stripeSession:{...t,context:{...n,kycProvidedFields:i,kycMissingIdentifiers:r.identifiers??[],kycMissingAlternatives:r.alternatives??[],kycInvalidIdentifiers:r.invalid_identifiers??[]}}}),r.completed&&ul(uc(`collect-identifiers`))},Dl=async()=>{let e=Q();try{let{kycSsn:t,kycTier:n,kycRegion:r,config:i}=e.context,a={...Ol(e.context),...kl(e.context),...Al(e.context),...jl(e.context),...Ml(e.context)};if(ul(`kyc`),await e.onramp.submitKycInfo(a),t){let e=Q();B({stripeSession:{...e,context:{...e.context,kycSsn:void 0}}})}if(!$())return;let o=r===`eu`?`l2`:n===`l2`?`l1`:n??`l0`,s=await F({operation:()=>sc(e.privy,{environment:i.environment}),until:e=>{if(e.status!==`active`)return!1;if(r===`eu`){let t=e.kyc_tiers?.find((e=>e.tier===`l2`));return t?.verification_status===`pending`||t?.verification_status===`verified`}if(e.kyc_tiers?.length){let t=e.kyc_tiers.find((e=>e.tier===o));if(t)return t.verification_status===`verified`}return e.verifications.some((e=>e.status===`verified`))},delay:0,interval:Vc,attempts:30,signal:wc()});if(!$()||s.status===`aborted`)return;if(s.status===`max_attempts`)throw Error(`KYC verification timed out`);let c=await Fc();if(!$())return;if(!c)return await Rc({customer:s.result});if(n===`l2`){let e=Q(),t=e.context.documentVerificationAction??{type:`retry-payment`,loader:`screen`};B({stripeSession:{...e,context:{...e.context,documentVerificationAction:t}},state:{status:`stripe-flow`,step:`verify-documents`},isLoading:!1});return}await el()}catch(e){Nc(e)}},Ol=({kycName:e})=>e?{given_name:e.firstName,surname:e.lastName}:{},kl=({kycDob:e})=>e?{date_of_birth:{day:e.day,month:e.month,year:e.year}}:{},Al=({kycRegion:e,kycSsn:t})=>e!==`eu`&&t?{id_number:{type:`us_ssn`,value:t}}:{},jl=({kycAddress:e})=>e?{address:{line1:e.addressLine1,city:e.city,...e.state?{state:e.state}:{},postal_code:e.postalCode,country:e.country}}:{},Ml=({kycRegion:e,kycNationalities:t,kycBirthCity:n,kycBirthCountry:r})=>e===`eu`?{...t?.length?{nationalities:t}:{},...n?{birth_city:n}:{},...r?{birth_country:r}:{}}:{},Nl=async e=>{let t=Q(),n=t.context,r=n.kycAddress?.country;if(!(n.kycRegion!==`eu`||r&&bl.has(r)))return void Nc(Error(`Stripe EU onramp is not available in this country`));let i=n.kycRegion===`eu`&&r?{...e,country:r}:e;B({stripeSession:{...t,context:{...n,kycAddress:i,kycProvidedFields:[...n.kycProvidedFields??[],`address_line_1`,`address_city`,...i.state?[`address_state`]:[],`address_postal_code`]}}}),n.kycRegion===`eu`?await(async()=>{let e=Q();try{let{kycName:t,kycDob:n,kycAddress:r,kycNationalities:i,kycBirthCity:a,kycBirthCountry:o}=e.context,s={...t?{given_name:t.firstName,surname:t.lastName}:{},...n?{date_of_birth:{day:n.day,month:n.month,year:n.year}}:{},...r?{address:{line1:r.addressLine1,city:r.city,...r.state?{state:r.state}:{},postal_code:r.postalCode,country:r.country}}:{},...i?.length?{nationalities:i}:{},...a?{birth_city:a}:{},...o?{birth_country:o}:{}};if(ul(`kyc`),await e.onramp.submitKycInfo(s),!$())return;let c=await Tc();if(!$())return;ul(c?`collect-identifiers`:uc(`collect-identifiers`))}catch(e){Nc(e)}})():await Dl()},Pl=({day:e,month:t,year:n})=>{let r=Q(),i=r.context,a=i.kycTier??`l1`,o=i.kycRegion??`us`,s=[...i.kycProvidedFields??[],`dob`],c=cc(a,s,o),l={...i,kycDob:{day:e,month:t,year:n},kycProvidedFields:s},u=c?{status:`stripe-flow`,step:ll(c,l)}:void 0;B({stripeSession:{...r,context:l},...u?{state:u}:{}}),c||Dl()},Fl=({firstName:e,lastName:t})=>{let n=Q(),r=n.context,i=r.kycTier??`l0`,a=r.kycRegion??`us`,o=[...r.kycProvidedFields??[],`first_name`,`last_name`],s=cc(i,o,a),c={...r,kycName:{firstName:e,lastName:t},kycProvidedFields:o},l=s?{status:`stripe-flow`,step:ll(s,c)}:void 0;B({stripeSession:{...n,context:c},...l?{state:l}:{}}),s||Dl()},Il=e=>{let t=Q(),n=t.context,r=n.kycTier??`l1`,i=[...n.kycProvidedFields??[],`id_number`],a=cc(r,i);B({stripeSession:{...t,context:{...n,kycSsn:e,kycProvidedFields:i}},...a?{state:{status:`stripe-flow`,step:a}}:{}}),a||Dl()},Ll=e=>e.kycAddress?.country?e.kycAddress.country:`US`,Rl=async e=>{let t=Q();try{let n=t.context.pendingEmail;if(!n)throw Error(`No email in session context`);if(e===`create`){let e=t.context.config.userPhone;if(!e)return void ul(`collect-contact`);let r=Ll(t.context),i=await t.onramp.registerLinkUser(n,e,r);if(!$())return;if(!i.created)throw Error(`Failed to register Stripe Link account`)}let r=await Sl(t.privy,{email:n,environment:t.context.config.environment});if(!$())return;if(r.status!==`created`)throw Error(`Failed to create Link auth intent after registration`);B({stripeSession:{...t,context:{...t.context,authIntentId:r.id}},state:{status:`stripe-flow`,step:`authenticating`}});let i=await de(t.onramp.authenticate(r.id,(e=>{$()&&(e.result===`success`&&e.crypto_customer_id?wl(e.crypto_customer_id,r.id):Nc(Error(`Link authentication ${e.result}`)))})),3e4,wc());$()&&i&&B({stripeElement:i})}catch(e){Nc(e)}},zl=e=>{let t=Q(),n=t.context,r=[...n.kycProvidedFields??[],`nationalities`];B({stripeSession:{...t,context:{...n,kycNationalities:e,kycProvidedFields:r}}}),ul(uc(`collect-nationality`))},Bl=e=>{let t=Q(),n=Qc([e],e.id);B({stripeSession:{...t,context:{...t.context,paymentToken:e.id,paymentMethodLabel:n}}}),$c({paymentToken:e.id,loader:`inline`})},Vl=async e=>{let t=Q();try{let n=t.context.pendingEmail;if(!n)throw Error(`No email in session context`);let r=Ll(t.context),i=await t.onramp.registerLinkUser(n,e,r);if(!$())return;if(!i.created)throw Error(`Failed to register Stripe Link account`);await Rl(`connect`)}catch(e){Nc(e)}},Hl=async()=>{try{if(!$())return;let e=Q(),t=e.context.stripeSessionId;if(!t)return;let n=await pl(e.privy,t);if(!$())return;let r=e.context.checkoutDetails;if(r){let e=r.currencySymbol,t={...r,quoteExpiresAt:n.quoteExpiresAt,sourceAmount:n.sourceTotalAmount??r.sourceAmount,destinationAmount:n.destinationAmount??r.destinationAmount,fee:n.fee&&e?`${e}${n.fee}`:r.fee};B({stripeConfirmCheckoutDetails:t})}}catch(e){Nc(e)}},Ul=({height:e=24,...t})=>(0,Y.jsxs)(`svg`,{height:e,viewBox:`120 0 72 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M132.258 24C138.856 24 144.205 18.6274 144.205 12C144.205 5.37257 138.856 0 132.258 0C125.66 0 120.312 5.37257 120.312 12C120.312 18.6274 125.66 24 132.258 24Z`,fill:`#00D66F`}),(0,Y.jsx)(`path`,{d:`M156.317 3.81824C156.317 2.69024 157.263 1.77344 158.377 1.77344C159.49 1.77344 160.436 2.69504 160.436 3.81824C160.436 4.94144 159.524 5.88704 158.377 5.88704C157.23 5.88704 156.317 4.97024 156.317 3.81824Z`,fill:`#011E0F`}),(0,Y.jsx)(`path`,{d:`M150.205 2.06143H153.789V22.2214H150.205V2.06143Z`,fill:`#011E0F`}),(0,Y.jsx)(`path`,{d:`M160.188 7.82143H156.575V22.2214H160.188V7.82143Z`,fill:`#011E0F`}),(0,Y.jsx)(`path`,{d:`M186.16 14.5319C188.879 12.8519 190.728 10.3511 191.459 7.81665H187.847C186.905 10.2359 184.745 12.0551 182.37 12.8279V2.05665H178.758V22.2167H182.37V16.2214C185.128 16.9126 187.307 19.3079 188.052 22.2167H191.689C191.134 19.1639 189.056 16.3079 186.16 14.5319Z`,fill:`#011E0F`}),(0,Y.jsx)(`path`,{d:`M166.591 9.43425C167.537 8.17185 169.382 7.43744 170.878 7.43744C173.668 7.43744 175.976 9.48705 175.981 12.5831V22.2167H172.369V13.3846C172.369 12.1126 171.805 10.6438 169.974 10.6438C167.824 10.6438 166.586 12.5591 166.586 14.8007V22.2262H162.974V7.83104H166.591V9.43425Z`,fill:`#011E0F`}),(0,Y.jsx)(`path`,{d:`M131.61 4.7998H127.958C128.668 7.80941 130.743 10.3822 133.339 11.9998C130.738 13.6174 128.668 16.1902 127.958 19.1998H131.61C132.515 16.4158 135.021 13.9966 138.1 13.5022V10.4926C135.016 10.003 132.51 7.58381 131.61 4.7998Z`,fill:`#011E0F`})]});function Wl({children:e}){return(0,Y.jsx)(Gl,{theme:oe()?.appearance.palette.colorScheme??`light`,children:e??`You're in a sandbox environment`})}var Gl=I(Ne)`
|
|
2
|
+
margin: 1rem 0;
|
|
3
|
+
`,Kl=({isSandbox:e,children:t,...n})=>{let r=_e((e=>e?.opts?.environment===`sandbox`));return e??r?(0,Y.jsxs)(ke,{...n,children:[(0,Y.jsx)(Wl,{}),t]}):(0,Y.jsx)(ke,{...n,children:t})},ql=I.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Jl=I.input`
|
|
9
|
+
&& {
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 0.625rem 0.75rem;
|
|
12
|
+
font-family: inherit;
|
|
13
|
+
font-size: 1rem;
|
|
14
|
+
line-height: 1.5rem;
|
|
15
|
+
color: ${e=>e.$hasError?`var(--privy-color-error-dark)`:`var(--privy-color-foreground)`};
|
|
16
|
+
background: var(--privy-color-background);
|
|
17
|
+
border: 1px solid
|
|
18
|
+
${e=>e.$hasError?`var(--privy-color-border-error)`:`var(--privy-color-foreground-4)`};
|
|
19
|
+
border-radius: var(--privy-border-radius-sm, 0.5rem);
|
|
20
|
+
outline: none;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
transition: border-color 0.15s ease;
|
|
23
|
+
|
|
24
|
+
&:focus {
|
|
25
|
+
border-color: ${e=>e.$hasError?`var(--privy-color-border-error)`:`var(--privy-color-accent)`};
|
|
26
|
+
box-shadow: ${e=>e.$hasError?`none`:`0 0 0 1px var(--privy-color-accent-light)`};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&::placeholder {
|
|
30
|
+
color: ${e=>e.$hasError?`var(--privy-color-error-dark)`:`var(--privy-color-foreground-3)`};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 441px) {
|
|
34
|
+
font-size: 0.875rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`,Yl=I.p`
|
|
38
|
+
&& {
|
|
39
|
+
color: var(--privy-color-error-dark);
|
|
40
|
+
font-size: 0.8125rem;
|
|
41
|
+
}
|
|
42
|
+
`,Xl=I.select`
|
|
43
|
+
&& {
|
|
44
|
+
width: 100%;
|
|
45
|
+
padding: 0.75rem 1rem;
|
|
46
|
+
font-size: 1rem;
|
|
47
|
+
line-height: 1.5rem;
|
|
48
|
+
color: var(--privy-color-foreground);
|
|
49
|
+
background: var(--privy-color-background);
|
|
50
|
+
border: 1px solid
|
|
51
|
+
${e=>e.$hasError?`var(--privy-color-error)`:`var(--privy-color-foreground-4)`};
|
|
52
|
+
border-radius: var(--privy-border-radius-md, 0.5rem);
|
|
53
|
+
outline: none;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
transition: border-color 0.15s ease;
|
|
56
|
+
appearance: none;
|
|
57
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
|
|
58
|
+
background-repeat: no-repeat;
|
|
59
|
+
background-position: right 0.75rem center;
|
|
60
|
+
padding-right: 2rem;
|
|
61
|
+
|
|
62
|
+
&:focus {
|
|
63
|
+
border-color: var(--privy-color-accent);
|
|
64
|
+
box-shadow: 0 0 0 1px var(--privy-color-accent-light);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media (min-width: 441px) {
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`,Zl=I.div`
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
`,Ql=I(Mo)`
|
|
75
|
+
width: 100%;
|
|
76
|
+
`,$l=I.div`
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
`,eu=I($o)`
|
|
80
|
+
&& {
|
|
81
|
+
width: 100%;
|
|
82
|
+
padding: 0.75rem 2.5rem 0.75rem 1rem;
|
|
83
|
+
font-family: inherit;
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
line-height: 1.5rem;
|
|
86
|
+
color: var(--privy-color-foreground);
|
|
87
|
+
background: var(--privy-color-background);
|
|
88
|
+
border: 1px solid
|
|
89
|
+
${e=>e.$hasError?`var(--privy-color-error)`:`var(--privy-color-foreground-4)`};
|
|
90
|
+
border-radius: 0.5rem;
|
|
91
|
+
outline: none;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
transition:
|
|
94
|
+
border-color 0.15s ease,
|
|
95
|
+
box-shadow 0.15s ease,
|
|
96
|
+
background-color 0.15s ease;
|
|
97
|
+
|
|
98
|
+
&:hover:not(:disabled) {
|
|
99
|
+
border-color: var(--privy-color-foreground-3);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:focus {
|
|
103
|
+
border-color: var(--privy-color-accent);
|
|
104
|
+
box-shadow: 0 0 0 2px var(--privy-color-accent-light);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&::placeholder {
|
|
108
|
+
color: var(--privy-color-foreground-3);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:disabled {
|
|
112
|
+
color: var(--privy-color-foreground-3);
|
|
113
|
+
background: var(--privy-color-background-2);
|
|
114
|
+
cursor: not-allowed;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (min-width: 441px) {
|
|
118
|
+
font-size: 0.875rem;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,tu=I.span`
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 50%;
|
|
124
|
+
right: 0.75rem;
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
width: 1.25rem;
|
|
129
|
+
height: 1.25rem;
|
|
130
|
+
color: var(--privy-color-foreground-2);
|
|
131
|
+
pointer-events: none;
|
|
132
|
+
transform: translateY(-50%);
|
|
133
|
+
|
|
134
|
+
${eu}:focus + & {
|
|
135
|
+
color: var(--privy-color-accent);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
${eu}:disabled + & {
|
|
139
|
+
color: var(--privy-color-foreground-3);
|
|
140
|
+
}
|
|
141
|
+
`,nu=hs,ru=I(Ys)`
|
|
142
|
+
z-index: 2147483647;
|
|
143
|
+
`,iu=I(Zs)`
|
|
144
|
+
width: var(--anchor-width);
|
|
145
|
+
max-height: min(16rem, var(--available-height));
|
|
146
|
+
overflow: auto;
|
|
147
|
+
padding: 0.25rem 0;
|
|
148
|
+
font-family: inherit;
|
|
149
|
+
background: var(--privy-color-background);
|
|
150
|
+
border: 1px solid var(--privy-color-foreground-4);
|
|
151
|
+
border-radius: 0.5rem;
|
|
152
|
+
box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 8%);
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
`,au=I(fs)`
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
gap: 0;
|
|
158
|
+
`,ou=I.span`
|
|
159
|
+
display: flex;
|
|
160
|
+
flex: 0 0 auto;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
min-width: 1.25rem;
|
|
164
|
+
color: var(--privy-color-foreground-2);
|
|
165
|
+
font-size: 0.75rem;
|
|
166
|
+
line-height: 1rem;
|
|
167
|
+
`,su=I(ic)`
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: space-between;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: 0.75rem;
|
|
172
|
+
min-height: 2.125rem;
|
|
173
|
+
padding: 0 0.75rem;
|
|
174
|
+
font-family: inherit;
|
|
175
|
+
color: var(--privy-color-foreground);
|
|
176
|
+
background: transparent;
|
|
177
|
+
border: 0;
|
|
178
|
+
border-radius: 0;
|
|
179
|
+
font-size: 0.875rem;
|
|
180
|
+
font-weight: 400;
|
|
181
|
+
line-height: 1.25rem;
|
|
182
|
+
text-align: left;
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
outline: none;
|
|
185
|
+
transition:
|
|
186
|
+
background-color 0.15s ease,
|
|
187
|
+
color 0.15s ease;
|
|
188
|
+
|
|
189
|
+
span {
|
|
190
|
+
font-family: inherit;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&:hover,
|
|
194
|
+
&[data-highlighted] {
|
|
195
|
+
background: var(--privy-color-background-2);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&[data-focus-visible] {
|
|
199
|
+
background: var(--privy-color-background-2);
|
|
200
|
+
box-shadow: inset 0 0 0 1px var(--privy-color-accent-light);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&[data-selected] {
|
|
204
|
+
background: transparent;
|
|
205
|
+
color: var(--privy-color-foreground);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&[data-disabled] {
|
|
209
|
+
color: var(--privy-color-foreground-3);
|
|
210
|
+
cursor: not-allowed;
|
|
211
|
+
}
|
|
212
|
+
`,cu=I.ul`
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-wrap: wrap;
|
|
215
|
+
gap: 0.375rem;
|
|
216
|
+
padding: 0;
|
|
217
|
+
margin: 0.25rem 0 0;
|
|
218
|
+
list-style: none;
|
|
219
|
+
`,lu=I.li`
|
|
220
|
+
display: block;
|
|
221
|
+
`,uu=I(Oe)`
|
|
222
|
+
&& {
|
|
223
|
+
gap: 0.375rem;
|
|
224
|
+
width: auto;
|
|
225
|
+
height: 2rem;
|
|
226
|
+
padding: 0 0.625rem;
|
|
227
|
+
color: var(--privy-color-foreground);
|
|
228
|
+
font-size: 0.75rem;
|
|
229
|
+
line-height: 1rem;
|
|
230
|
+
}
|
|
231
|
+
`;I.div`
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
gap: 0.75rem;
|
|
235
|
+
width: 100%;
|
|
236
|
+
padding: 1rem;
|
|
237
|
+
background: var(--privy-color-background-2);
|
|
238
|
+
border-radius: var(--privy-border-radius-md, 0.5rem);
|
|
239
|
+
`,I.div`
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: space-between;
|
|
242
|
+
align-items: center;
|
|
243
|
+
`,I.span`
|
|
244
|
+
font-size: 0.875rem;
|
|
245
|
+
color: var(--privy-color-foreground-3);
|
|
246
|
+
`,I.span`
|
|
247
|
+
font-size: 0.875rem;
|
|
248
|
+
font-weight: 500;
|
|
249
|
+
color: var(--privy-color-foreground);
|
|
250
|
+
`;var du=I.div`
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: column;
|
|
253
|
+
gap: 1rem;
|
|
254
|
+
width: 100%;
|
|
255
|
+
padding: 1rem 1rem 0.75rem;
|
|
256
|
+
border: 1px solid var(--privy-color-foreground-4);
|
|
257
|
+
border-radius: 0.75rem;
|
|
258
|
+
`,fu=I.div`
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
gap: 0.75rem;
|
|
262
|
+
`,pu=I.span`
|
|
263
|
+
position: relative;
|
|
264
|
+
width: 2rem;
|
|
265
|
+
height: 2rem;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
`,mu=I.img`
|
|
268
|
+
width: 2rem;
|
|
269
|
+
height: 2rem;
|
|
270
|
+
border-radius: 100px;
|
|
271
|
+
`,hu=I.img`
|
|
272
|
+
position: absolute;
|
|
273
|
+
top: -2px;
|
|
274
|
+
right: -2px;
|
|
275
|
+
width: 0.875rem;
|
|
276
|
+
height: 0.875rem;
|
|
277
|
+
border-radius: 100px;
|
|
278
|
+
border: 1.5px solid var(--privy-color-background);
|
|
279
|
+
background-color: var(--privy-color-background);
|
|
280
|
+
`,gu=I.div`
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-direction: column;
|
|
283
|
+
text-align: left;
|
|
284
|
+
`,_u=I.span`
|
|
285
|
+
font-size: 0.75rem;
|
|
286
|
+
font-weight: 400;
|
|
287
|
+
line-height: 1.125rem;
|
|
288
|
+
color: var(--privy-color-foreground-3);
|
|
289
|
+
`,vu=I.span`
|
|
290
|
+
font-size: 0.875rem;
|
|
291
|
+
font-weight: 500;
|
|
292
|
+
line-height: 1.375rem;
|
|
293
|
+
color: var(--privy-color-foreground);
|
|
294
|
+
`,yu=I.div`
|
|
295
|
+
display: flex;
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
`,bu=I.div`
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: space-between;
|
|
301
|
+
padding: 0.625rem 0;
|
|
302
|
+
border-bottom: 1px solid var(--privy-color-foreground-4);
|
|
303
|
+
font-size: 0.75rem;
|
|
304
|
+
line-height: 1.125rem;
|
|
305
|
+
|
|
306
|
+
&:last-child {
|
|
307
|
+
border-bottom: none;
|
|
308
|
+
}
|
|
309
|
+
`,xu=I.span`
|
|
310
|
+
color: var(--privy-color-foreground);
|
|
311
|
+
font-weight: 400;
|
|
312
|
+
`,Su=I.span`
|
|
313
|
+
color: var(--privy-color-foreground);
|
|
314
|
+
font-weight: 500;
|
|
315
|
+
text-align: right;
|
|
316
|
+
white-space: nowrap;
|
|
317
|
+
`,Cu=I.div`
|
|
318
|
+
display: inline-flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
align-self: center;
|
|
321
|
+
padding: 0.75rem 1rem;
|
|
322
|
+
border: 1px solid var(--privy-color-foreground-4);
|
|
323
|
+
border-radius: 999px;
|
|
324
|
+
color: var(--privy-color-foreground);
|
|
325
|
+
background: var(--privy-color-background);
|
|
326
|
+
font-size: 0.875rem;
|
|
327
|
+
font-weight: 500;
|
|
328
|
+
line-height: 1.25rem;
|
|
329
|
+
`,wu=({onClose:e,onEmailChosen:t,onEmailBack:n,userEmail:r})=>{let[i,a]=(0,V.useState)(r??``),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(!1),u=async()=>{let e=i.trim();if(e){if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)){l(!0);try{await t?.(e)}catch{l(!1)}}else s(`Enter a valid email address`)}else s(`Email is required`)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,showBack:!!n,onBack:n??void 0,icon:(0,Y.jsx)(Ul,{height:24}),iconVariant:`logo`,title:`Add email`,subtitle:`Enter your email address to continue with\xA0Link.`,primaryCta:{label:`Submit`,onClick:u,loading:c},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{type:`email`,placeholder:`email@example.com`,value:i,onChange:e=>{a(e.target.value),s(null)},onKeyDown:e=>e.key===`Enter`&&u(),$hasError:!!o,autoFocus:!0}),o&&(0,Y.jsx)(Yl,{children:o})]})})},Tu={addressPlaceholder:`Street and house number`,addressAriaLabel:`Street and house number`,cityPlaceholder:`City`,cityAriaLabel:`City`,postalPlaceholder:`Postal code`,postalAriaLabel:`Postal code`,postalInputMode:`text`,postalMaxWidth:`7rem`,postalFirst:!0,missingAddressError:`Street and house number, city, and postal code are required`},Eu={addressPlaceholder:`Street address`,addressAriaLabel:`Street address`,cityPlaceholder:`City`,cityAriaLabel:`City`,postalPlaceholder:`ZIP`,postalAriaLabel:`ZIP code`,postalInputMode:`numeric`,postalMaxWidth:`6.25rem`,postalFirst:!1,missingAddressError:`Street address, city, and ZIP are required`,adminPlaceholder:`State`,adminAriaLabel:`State`,adminRequiredError:`State is required`,adminMaxWidth:`5.5rem`,adminOptions:`AL.AK.AZ.AR.CA.CO.CT.DE.FL.GA.HI.ID.IL.IN.IA.KS.KY.LA.ME.MD.MA.MI.MN.MS.MO.MT.NE.NV.NH.NJ.NM.NY.NC.ND.OH.OK.OR.PA.RI.SC.SD.TN.TX.UT.VT.VA.WA.WV.WI.WY.DC`.split(`.`)},Du={US:Eu,IE:{...Tu,addressPlaceholder:`Street address`,addressAriaLabel:`Street address`,cityPlaceholder:`Town or city`,cityAriaLabel:`Town or city`,postalPlaceholder:`Eircode`,postalAriaLabel:`Eircode`,missingAddressError:`Street address, town or city, and Eircode are required`,adminPlaceholder:`County`,adminAriaLabel:`County`,adminRequiredError:`County is required`}},Ou=e=>e===`US`?`United States`:yl.find((t=>t.code===e))?.name??e,ku=({onClose:e,onAddressSubmitted:t,onBack:n})=>{let r=_e((e=>e?.stripeSession?.context.kycRegion??`us`)),i=_e((e=>e?.stripeSession?.context.kycAddress?.country??``));return(0,Y.jsx)(Au,{onClose:e,onAddressSubmitted:t,onBack:n,region:r,country:r===`eu`?i:`US`})},Au=({onClose:e,onAddressSubmitted:t,onBack:n,region:r,country:i})=>{let a=r===`eu`,[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(``),[m,h]=(0,V.useState)(null),[g,_]=(0,V.useState)(!1),v=((e,t)=>e===`eu`?(t?Du[t]:null)??Tu:Eu)(r,i),y=!!v.adminPlaceholder,b=()=>{o.trim()&&c.trim()&&f.trim()?i?!y||u.trim()?(_(!0),t?.({addressLine1:o.trim(),city:c.trim(),state:u.trim(),postalCode:f.trim(),country:i})):h(v.adminRequiredError??`State is required`):h(`Country is required`):h(v.missingAddressError)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,showBack:!!n,onBack:n??void 0,icon:Ge,title:`Add address`,subtitle:`Enter your residential address as it appears on your government-issued ID.`,primaryCta:{label:`Continue`,onClick:b,loading:g},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{placeholder:v.addressPlaceholder,value:o,onChange:e=>{s(e.target.value),h(null)},onKeyDown:e=>e.key===`Enter`&&b(),$hasError:!!m&&!o.trim(),autoFocus:!0,"aria-label":v.addressAriaLabel,autoComplete:`address-line1`}),a?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(Zl,{children:[v.postalFirst&&(0,Y.jsx)(Jl,{placeholder:v.postalPlaceholder,value:f,onChange:e=>{p(e.target.value),h(null)},onKeyDown:e=>e.key===`Enter`&&b(),$hasError:!!m&&!f.trim(),style:{maxWidth:v.postalMaxWidth},"aria-label":v.postalAriaLabel,autoComplete:`postal-code`,inputMode:v.postalInputMode}),(0,Y.jsx)(Jl,{placeholder:v.cityPlaceholder,value:c,onChange:e=>{l(e.target.value),h(null)},$hasError:!!m&&!c.trim(),"aria-label":v.cityAriaLabel,autoComplete:`address-level2`}),!v.postalFirst&&(0,Y.jsx)(Jl,{placeholder:v.postalPlaceholder,value:f,onChange:e=>{p(e.target.value),h(null)},onKeyDown:e=>e.key===`Enter`&&b(),$hasError:!!m&&!f.trim(),style:{maxWidth:v.postalMaxWidth},"aria-label":v.postalAriaLabel,autoComplete:`postal-code`,inputMode:v.postalInputMode})]}),(0,Y.jsxs)(Zl,{children:[v.adminPlaceholder&&(0,Y.jsx)(Jl,{placeholder:v.adminPlaceholder,value:u,onChange:e=>{d(e.target.value),h(null)},$hasError:!!m&&!u.trim(),"aria-label":v.adminAriaLabel??v.adminPlaceholder,autoComplete:`address-level1`}),(0,Y.jsx)(Jl,{value:Ou(i),readOnly:!0,$hasError:!1,style:{opacity:.7},"aria-label":`Country`,autoComplete:`country-name`,tabIndex:-1})]})]}):(0,Y.jsxs)(Zl,{children:[(0,Y.jsx)(Jl,{placeholder:v.cityPlaceholder,value:c,onChange:e=>{l(e.target.value),h(null)},$hasError:!!m&&!c.trim(),"aria-label":v.cityAriaLabel,autoComplete:`address-level2`}),(0,Y.jsxs)(Xl,{value:u,onChange:e=>{d(e.target.value),h(null)},$hasError:!!m&&!u,style:{maxWidth:v.adminMaxWidth},"aria-label":v.adminAriaLabel,autoComplete:`address-level1`,children:[(0,Y.jsx)(`option`,{value:``,disabled:!0,children:v.adminPlaceholder}),v.adminOptions?.map((e=>(0,Y.jsx)(`option`,{value:e,children:e},e)))]}),(0,Y.jsx)(Jl,{placeholder:v.postalPlaceholder,value:f,onChange:e=>{p(e.target.value),h(null)},onKeyDown:e=>e.key===`Enter`&&b(),$hasError:!!m&&!f.trim(),style:{maxWidth:v.postalMaxWidth},"aria-label":v.postalAriaLabel,autoComplete:`postal-code`,inputMode:v.postalInputMode})]}),m&&(0,Y.jsx)(Yl,{children:m})]})})},ju=({onClose:e,onSubmit:t})=>{let[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(null),c=()=>{n.trim()?i?t({city:n.trim(),country:i}):s(`Birth country is required`):s(`Birth city is required`)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:Ge,title:`Place of birth`,subtitle:`Enter your city and country of birth.`,primaryCta:{label:`Continue`,onClick:c},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{placeholder:`City of birth`,value:n,onChange:e=>{r(e.target.value),s(null)},onKeyDown:e=>e.key===`Enter`&&c(),$hasError:!!o&&!n.trim(),autoFocus:!0,"aria-label":`City of birth`,autoComplete:`off`}),(0,Y.jsxs)(Xl,{value:i,onChange:e=>{a(e.target.value),s(null)},$hasError:!!o&&!i,"aria-label":`Country of birth`,autoComplete:`country`,children:[(0,Y.jsx)(`option`,{value:``,disabled:!0,children:`Select birth country`}),yl.map((e=>(0,Y.jsx)(`option`,{value:e.code,children:e.name},e.code)))]}),o&&(0,Y.jsx)(Yl,{children:o})]})})},Mu=({onClose:e,onSubmit:t})=>{let[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(null);return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:Ue,title:`Country of residence`,subtitle:`Select your country of residence. This determines your verification requirements.`,primaryCta:{label:`Continue`,onClick:()=>{n?t(n):a(`Please select your country of residence`)}},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsxs)(Xl,{value:n,onChange:e=>{r(e.target.value),a(null)},$hasError:!!i,"aria-label":`Country of residence`,autoComplete:`country`,children:[(0,Y.jsx)(`option`,{value:``,disabled:!0,children:`Select country`}),yl.map((e=>(0,Y.jsx)(`option`,{value:e.code,children:e.name},e.code)))]}),i&&(0,Y.jsx)(Yl,{children:i})]})})},Nu=({onClose:e,onDobSubmitted:t,region:n=`us`})=>{let[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(null),s=n===`eu`,c=()=>{let e=r.replace(/\D/g,``),n=Number.parseInt(e.slice(0,2),10),i=Number.parseInt(e.slice(2,4),10),a=Number.parseInt(e.slice(4,8),10),c=s?n:i,l=s?i:n,u=new Date(a,l-1,c),d=new Date,f=new Date(d.getFullYear()-18,d.getMonth(),d.getDate());e.length!==8||u.getFullYear()!==a||u.getMonth()!==l-1||u.getDate()!==c||a<1900||u>f?o(`Enter a valid date of birth`):t?.({day:c,month:l,year:a})};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:Be,title:`Add date of birth`,subtitle:`You must be at least 18 years old.`,primaryCta:{label:`Continue`,onClick:c},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{placeholder:s?`DD/MM/YYYY`:`MM/DD/YYYY`,value:r,onChange:e=>{i((e=>{let t=e.replace(/\D/g,``).slice(0,8);return[t.slice(0,2),t.slice(2,4),t.slice(4,8)].filter(Boolean).join(`/`)})(e.target.value)),o(null)},onKeyDown:e=>e.key===`Enter`&&c(),$hasError:!!a,inputMode:`numeric`,maxLength:10,autoFocus:!0}),a&&(0,Y.jsx)(Yl,{children:a})]})})},Pu=({onClose:e,onSubmit:t,isSandbox:n})=>{let r=_e((e=>e?.stripeSession?.context.kycMissingIdentifiers)),i=_e((e=>e?.stripeSession?.context.kycMissingAlternatives)),a=_e((e=>e?.stripeSession?.context.kycInvalidIdentifiers));return(0,Y.jsx)(Fu,{onClose:e,onSubmit:t,isSandbox:n,missingMica:r,alternatives:i,invalidIdentifiers:a})},Fu=({onClose:e,onSubmit:t,isSandbox:n,missingMica:r,alternatives:i,invalidIdentifiers:a})=>{let[o,s]=(0,V.useState)({}),[c,l]=(0,V.useState)({}),[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(null),[m,h]=(0,V.useState)(null),g=e=>(n?Sc[e]:void 0)??o[e]??``,_=e=>{let t=g(e);return n||m===e?t:t.replace(/[^\s/-]/g,`•`)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:He,title:`Identity verification`,subtitle:`Provide your national identity numbers.`,primaryCta:{label:`Continue`,onClick:()=>{let e=[];for(let t of r??[]){let n=(i??[]).find((e=>e.original_missing_identifiers.includes(t.type)))&&c[t.type]||t.type,r=g(n).trim();if(!r)return p(n),void d(`Please provide your ${Cc[n]??n}`);e.push({type:n,value:r})}let n=e.find((e=>!(({type:e,value:t})=>{let n=xc[e];return!n||n(t)})(e)));if(n)return p(n.type),void d(`Enter a valid ${Cc[n.type]??n.type}`);t(e)}},watermark:!0,isSandbox:n,children:(0,Y.jsxs)(ql,{children:[(r??[]).map((e=>{let t=(i??[]).find((t=>t.original_missing_identifiers.includes(e.type)));if(t){let r=c[e.type]||e.type;return(0,Y.jsxs)(Zl,{children:[(0,Y.jsx)(`select`,{value:r,onChange:t=>{l((n=>({...n,[e.type]:t.target.value}))),h(null),d(null),p(null)},style:{flex:`0 0 auto`,padding:`6px`},children:[e.type,...t.alternative_missing_identifiers].map((e=>(0,Y.jsx)(`option`,{value:e,children:Cc[e]??e},e)))}),(0,Y.jsx)(Jl,{placeholder:Cc[r]??r,value:_(r),onChange:e=>{s((t=>({...t,[r]:e.target.value}))),d(null),p(null)},onFocus:()=>h(r),onBlur:()=>h(null),readOnly:n&&!!Sc[r],$hasError:f===r||(a?.includes(r)??!1)})]},e.type)}return(0,Y.jsx)(Jl,{placeholder:Cc[e.type]??e.type,value:_(e.type),onChange:t=>{s((n=>({...n,[e.type]:t.target.value}))),d(null),p(null)},onFocus:()=>h(e.type),onBlur:()=>h(null),readOnly:n&&!!Sc[e.type],$hasError:f===e.type||(a?.includes(e.type)??!1)},e.type)})),u&&(0,Y.jsx)(Yl,{children:u}),a&&a.length>0&&(0,Y.jsxs)(Yl,{children:[`Invalid format for:`,` `,a.map((e=>Cc[e]??e)).join(`, `)]})]})})},Iu=({onClose:e,onNameSubmitted:t,isSandbox:n})=>{let[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(n?`Verified`:``),[s,c]=(0,V.useState)(null),l=()=>{r.trim()&&a.trim()?t?.({firstName:r.trim(),lastName:a.trim()}):c(`First and last name are required`)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:Je,title:`Add name`,subtitle:`Please enter your full legal name as it appears on your government-issued ID.`,primaryCta:{label:`Continue`,onClick:l},watermark:!0,isSandbox:n,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{placeholder:`First name`,value:r,onChange:e=>{i(e.target.value),c(null)},onKeyDown:e=>e.key===`Enter`&&l(),$hasError:!!s&&!r.trim(),autoFocus:!0}),(0,Y.jsx)(Jl,{placeholder:`Last name`,value:a,onChange:e=>{o(e.target.value),c(null)},onKeyDown:e=>e.key===`Enter`&&l(),$hasError:!!s&&!a.trim(),readOnly:n}),s&&(0,Y.jsx)(Yl,{children:s})]})})},Lu=({onClose:e,onSubmit:t})=>{let[n,r]=(0,V.useState)([]),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(null),c=(0,V.useRef)(!1),l=yl.filter((e=>!n.includes(e.code))),u=n.map((e=>yl.find((t=>t.code===e)))).filter((e=>!!e)),d=e=>{let t=e.trim().toLowerCase();return yl.find((e=>e.code.toLowerCase()===t||e.name.toLowerCase()===t))},f=e=>{let t=e.trim().toLowerCase();return t?yl.filter((e=>e.code.toLowerCase().includes(t)||e.name.toLowerCase().includes(t))):yl},p=f(i),m=p.map((e=>e.name)),h=e=>{let t=f(e),n=d(e)??(t.length===1?t[0]:void 0);n&&(r((e=>e.includes(n.code)?e:[...e,n.code])),a(``),s(null))};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:Ue,title:`Nationality`,subtitle:`Select your nationality or nationalities.`,primaryCta:{label:`Continue`,onClick:()=>{let e=d(i),r=e&&!n.includes(e.code)?[...n,e.code]:n;r.length?t(r):s(`Please select at least one nationality`)}},watermark:!0,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsxs)(Ql,{items:m,value:null,inputValue:i,onInputValueChange:e=>{c.current&&(c.current=!1,d(e))||a(e)},onValueChange:e=>(e=>{e&&(c.current=!0,h(e))})(typeof e==`string`?e:null),children:[(0,Y.jsxs)($l,{children:[(0,Y.jsx)(eu,{$hasError:!!o,"aria-label":`Nationality`,autoComplete:`country`,disabled:!l.length,placeholder:n.length?`Add another nationality`:`Search nationality`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),h(e.currentTarget.value))}}),(0,Y.jsx)(tu,{"aria-hidden":`true`,children:(0,Y.jsx)(qe,{size:18})})]}),(0,Y.jsx)(nu,{children:(0,Y.jsx)(ru,{side:`bottom`,sideOffset:4,collisionAvoidance:{side:`none`,align:`shift`,fallbackAxisSide:`none`},children:(0,Y.jsx)(iu,{children:(0,Y.jsx)(au,{children:e=>{let t=p.find((t=>t.name===e));return t?(0,Y.jsxs)(su,{value:t.name,children:[(0,Y.jsx)(`span`,{children:t.name}),(0,Y.jsx)(ou,{children:n.includes(t.code)?(0,Y.jsx)(xe,{size:16}):t.code})]},t.code):null}})})})})]}),!!u.length&&(0,Y.jsx)(cu,{"aria-label":`Selected nationalities`,children:u.map((e=>(0,Y.jsx)(lu,{children:(0,Y.jsxs)(uu,{type:`button`,onClick:()=>(e=>{r((t=>t.filter((t=>t!==e)))),s(null)})(e.code),"aria-label":`Remove ${e.name}`,size:`sm`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(De,{size:14})]})},e.code)))}),o&&(0,Y.jsx)(Yl,{children:o})]})})},Ru=({onClose:e,onPhoneSubmitted:t,onPhoneBack:n,defaultCountry:r})=>{let i=(0,V.useRef)(null),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1);return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,showBack:!!n,onBack:n??void 0,icon:(0,Y.jsx)(Ul,{height:24}),iconVariant:`logo`,title:`Add phone number`,subtitle:`Enter your phone number to continue with Link.`,primaryCta:{label:`Submit`,onClick:()=>{i.current?.isValid&&(c(!0),t?.(A(i.current.qualifiedPhoneNumber)))},disabled:!a,loading:s},watermark:!0,children:(0,Y.jsx)(Me,{stacked:!0,noIncludeSubmitButton:!0,hideRecent:!0,defaultCountry:r,onChange:e=>{i.current=e,o(e.isValid)},onSubmit:async e=>{c(!0),t?.(A(e.qualifiedPhoneNumber))}})})},zu=({onClose:e,onSsnSubmitted:t,appName:n,isSandbox:r})=>{let[i,a]=(0,V.useState)(r?`000-00-0000`:``),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(!0),u=()=>{let e=i.replace(/\D/g,``);e.length===9?t?.(e):s(`Enter your full 9-digit SSN`)};return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:we,title:`Add social security number`,subtitle:`Required to verify your identity. ${n} will not store your SSN.`,primaryCta:{label:`Continue`,onClick:u},watermark:!0,isSandbox:r,children:(0,Y.jsxs)(ql,{children:[(0,Y.jsx)(Jl,{placeholder:`XXX-XX-XXXX`,value:r||c?i:i.replace(/\d/g,`•`),onChange:e=>{a((e=>{let t=e.replace(/\D/g,``).slice(0,9);return[t.slice(0,3),t.slice(3,5),t.slice(5,9)].filter(Boolean).join(`-`)})(e.target.value)),s(null)},onFocus:()=>l(!0),onBlur:()=>l(!1),onKeyDown:e=>e.key===`Enter`&&u(),$hasError:!!o,type:`text`,inputMode:`numeric`,autoComplete:`off`,maxLength:11,readOnly:r,autoFocus:!0}),o&&(0,Y.jsx)(Yl,{children:o})]})})},Bu=({onClose:e,amount:t,appName:n,currencySymbol:r,paymentMethodLabel:i,fee:a,destinationAmount:o,destinationToken:s,destinationNetwork:c,tokenIconUrl:l,networkIconUrl:u,opts:d,onConfirmCheckout:f,quoteExpiresAt:p,onRefreshQuote:m,initialLoading:h=!1})=>{let[g,_]=(0,V.useState)(h),[v,y]=(0,V.useState)(!1),b=(0,V.useRef)(null);(0,V.useEffect)((()=>{if(!p||!m)return;let e=Math.max(p-Date.now()-1e4,0);return b.current=setTimeout((()=>{y(!0),m().finally((()=>y(!1)))}),e),()=>{b.current&&clearTimeout(b.current)}}),[p,m]);let x=d?.destination.address??``,S=ce(x,4,4);return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,title:`Approve transaction`,subtitle:`${n} wants your permission for this transaction.`,primaryCta:{label:`Approve`,onClick:()=>{b.current&&clearTimeout(b.current),_(!0),f?.()},loading:g,disabled:v},watermark:!0,isSandbox:d?.environment===`sandbox`,children:(0,Y.jsxs)(du,{children:[l||u?(0,Y.jsxs)(fu,{children:[(0,Y.jsxs)(pu,{children:[l&&(0,Y.jsx)(mu,{src:l,alt:s}),u&&(0,Y.jsx)(hu,{src:u,alt:c})]}),(0,Y.jsxs)(gu,{children:[(0,Y.jsx)(_u,{children:`You receive`}),(0,Y.jsxs)(vu,{children:[o,` `,s,` on `,c]})]})]}):(0,Y.jsxs)(gu,{children:[(0,Y.jsx)(_u,{children:`You receive`}),(0,Y.jsxs)(vu,{children:[o,` `,s,` on `,c]})]}),(0,Y.jsxs)(yu,{children:[(0,Y.jsxs)(bu,{children:[(0,Y.jsx)(xu,{children:`Total amount`}),(0,Y.jsxs)(Su,{children:[r,t]})]}),i&&(0,Y.jsxs)(bu,{children:[(0,Y.jsx)(xu,{children:`From`}),(0,Y.jsx)(Su,{children:i})]}),(0,Y.jsxs)(bu,{children:[(0,Y.jsx)(xu,{children:`To`}),(0,Y.jsx)(je,{iconOnly:!0,value:x,iconSize:16,children:S})]}),(0,Y.jsxs)(bu,{children:[(0,Y.jsx)(xu,{children:`Estimated fee`}),(0,Y.jsx)(Su,{children:a})]}),(0,Y.jsxs)(bu,{children:[(0,Y.jsx)(xu,{children:`Processing time`}),(0,Y.jsx)(Su,{children:`Instant`})]})]})]})})},Vu=({onClose:e})=>{let t=(0,V.useRef)(!1),[n,r]=(0,V.useState)(null),i=_e((e=>e?.opts?.environment===`sandbox`));return(0,V.useEffect)((()=>{t.current||(t.current=!0,(async()=>{let e=Q().onramp;try{if(!e.promptUserAttestation)throw Error(`Stripe onramp promptUserAttestation is unavailable`);return await e.promptUserAttestation(`eu_carf`,(({result:e})=>{if($()&&e===`confirmed`){let e=Q(),t=[...e.context.kycProvidedFields??[],`attestation`];B({stripeSession:{...e,context:{...e.context,kycProvidedFields:t}}}),ul(uc(`eu-attestation`))}}))}catch(e){return Nc(e),null}})().then((e=>{e&&r(e)})))}),[]),n?(0,Y.jsxs)(Y.Fragment,{children:[i?(0,Y.jsx)(Wl,{}):null,(0,Y.jsx)(cl,{element:n,minHeight:480})]}):(0,Y.jsx)(Kl,{showClose:!0,onClose:e,iconVariant:`loading`,title:`Loading attestation...`,watermark:!0})},Hu=({size:e=64,...t})=>(0,Y.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 64 64`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M32 64C49.6731 64 64 49.6731 64 32C64 14.3269 49.6731 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z`,fill:`#00D66F`}),(0,Y.jsx)(`path`,{d:`M30.5274 12.8003H20.6587C22.5787 20.8259 28.1851 27.6867 35.1995 32.0003C28.1723 36.3139 22.5787 43.1747 20.6587 51.2003H30.5274C32.9722 43.7763 39.7435 37.3251 48.0634 36.0067V27.9811C39.7307 26.6755 32.9594 20.2243 30.5274 12.8003Z`,fill:`#011E0F`})]}),Uu=({mode:e,onClose:t,onLinkAccountConfirmed:n,onLinkAccountBack:r,userEmail:i})=>{let a=oe()?.name??`This app`,o=e===`connect`?{title:`Connect to Link`,subtitle:`${a} uses Link for quicker and easier checkout.`,description:`${a} will be able to view your Link account details, identity information, and saved payments.`,cta:`Continue`}:{title:`Create a Link account`,subtitle:`With Link, you can securely save your information for faster checkout.`,description:null,cta:`Continue`};return(0,Y.jsx)(Kl,{showClose:!0,onClose:t,showBack:!!r,onBack:r??void 0,icon:(0,Y.jsx)(Hu,{size:64}),iconVariant:`logo`,title:o.title,subtitle:o.subtitle,primaryCta:{label:o.cta,onClick:()=>n?.()},helpText:o.description??void 0,watermark:!0,children:e===`create`&&i&&(0,Y.jsx)(Cu,{children:i})})},Wu=({onClose:e,tokens:t,onSelectToken:n,onAddNew:r,isLoading:i})=>{let[a,o]=(0,V.useState)(t[0]?.id??null);return(0,Y.jsx)(Kl,{showClose:!0,onClose:e,icon:(0,Y.jsx)(Ul,{height:24}),iconVariant:`logo`,title:`Select payment method`,subtitle:`Choose from your saved cards. Debit cards typically have higher success rates than credit cards.`,primaryCta:{label:`Continue`,onClick:()=>{let e=t.find((e=>e.id===a));e&&n(e)},loading:i,disabled:!a},watermark:!0,children:(0,Y.jsx)(Ku,{children:(0,Y.jsxs)(qu,{children:[t.map((e=>(0,Y.jsxs)(Ju,{$selected:a===e.id,onClick:()=>o(e.id),disabled:i,children:[(0,Y.jsx)(Yu,{children:(0,Y.jsx)(Ce,{size:16})}),(0,Y.jsxs)(Xu,{children:[(0,Y.jsx)(Zu,{children:Gu(e.card?.brand,e.card?.funding)}),(0,Y.jsxs)(Qu,{children:[(0,Y.jsx)($u,{children:`••••`}),` `,e.card?.last4??``]})]})]},e.id))),(0,Y.jsxs)(ed,{onClick:r,disabled:i,children:[(0,Y.jsx)(Ke,{size:14}),(0,Y.jsx)(`span`,{children:`Add new card`})]})]})})})},Gu=(e,t)=>{if(!e)return`Card`;let n=e.charAt(0).toUpperCase()+e.slice(1);return t?`${n} ${t.charAt(0).toUpperCase()}${t.slice(1)}`:n},Ku=I.div`
|
|
330
|
+
display: flex;
|
|
331
|
+
flex-direction: column;
|
|
332
|
+
gap: 1.5rem;
|
|
333
|
+
width: 100%;
|
|
334
|
+
`,qu=I.div`
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-direction: column;
|
|
337
|
+
gap: 0.5rem;
|
|
338
|
+
width: 100%;
|
|
339
|
+
`,Ju=I.button`
|
|
340
|
+
&& {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
gap: 0.75rem;
|
|
344
|
+
width: 100%;
|
|
345
|
+
padding: 0.75rem;
|
|
346
|
+
background: ${e=>e.$selected?`var(--privy-color-background-2)`:`transparent`};
|
|
347
|
+
border: ${e=>e.$selected?`1.5px solid var(--privy-color-accent)`:`1px solid var(--privy-color-foreground-4)`};
|
|
348
|
+
border-radius: var(--privy-border-radius-md, 0.5rem);
|
|
349
|
+
cursor: pointer;
|
|
350
|
+
transition: border-color 0.15s ease;
|
|
351
|
+
box-shadow: ${e=>e.$selected?`0px 2px 6px rgba(50, 50, 93, 0.06), 0px 1px 1.5px rgba(0, 0, 0, 0.06)`:`none`};
|
|
352
|
+
outline: none;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
&:disabled {
|
|
356
|
+
opacity: 0.6;
|
|
357
|
+
cursor: not-allowed;
|
|
358
|
+
}
|
|
359
|
+
`,Yu=I.div`
|
|
360
|
+
display: flex;
|
|
361
|
+
align-items: center;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
width: 1.5rem;
|
|
364
|
+
height: 1rem;
|
|
365
|
+
flex-shrink: 0;
|
|
366
|
+
color: var(--privy-color-foreground-3);
|
|
367
|
+
`,Xu=I.div`
|
|
368
|
+
display: flex;
|
|
369
|
+
flex-direction: column;
|
|
370
|
+
align-items: flex-start;
|
|
371
|
+
flex: 1;
|
|
372
|
+
min-width: 0;
|
|
373
|
+
`,Zu=I.span`
|
|
374
|
+
font-size: 0.875rem;
|
|
375
|
+
font-weight: 400;
|
|
376
|
+
line-height: 1.125rem;
|
|
377
|
+
color: var(--privy-color-foreground);
|
|
378
|
+
letter-spacing: -0.15px;
|
|
379
|
+
`,Qu=I.span`
|
|
380
|
+
font-size: 0.75rem;
|
|
381
|
+
font-weight: 400;
|
|
382
|
+
line-height: 1rem;
|
|
383
|
+
color: var(--privy-color-foreground-3);
|
|
384
|
+
`,$u=I.span`
|
|
385
|
+
font-weight: 500;
|
|
386
|
+
`,ed=I.button`
|
|
387
|
+
&& {
|
|
388
|
+
display: flex;
|
|
389
|
+
align-items: center;
|
|
390
|
+
justify-content: center;
|
|
391
|
+
gap: 0.5rem;
|
|
392
|
+
width: 100%;
|
|
393
|
+
padding: 1rem;
|
|
394
|
+
background: none;
|
|
395
|
+
border: none;
|
|
396
|
+
font-size: 0.875rem;
|
|
397
|
+
font-weight: 500;
|
|
398
|
+
line-height: 1.25rem;
|
|
399
|
+
color: var(--privy-color-accent);
|
|
400
|
+
cursor: pointer;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
&:focus,
|
|
404
|
+
&:focus-visible {
|
|
405
|
+
outline: none;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
&:hover:not(:disabled) {
|
|
409
|
+
opacity: 0.8;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&:disabled {
|
|
413
|
+
opacity: 0.5;
|
|
414
|
+
cursor: not-allowed;
|
|
415
|
+
}
|
|
416
|
+
`,td=({element:e,isSandbox:t})=>(0,Y.jsxs)(Y.Fragment,{children:[t&&(0,Y.jsx)(Wl,{children:`You're in a sandbox environment. Use 000-000 as the Link verification code.`}),(0,Y.jsx)(cl,{element:e,minHeight:300,bleed:!0})]}),nd=({onClose:e,onVerified:t})=>{let n=(0,V.useRef)(!1),[r,i]=(0,V.useState)(!1),a=(0,V.useCallback)((async()=>{i(!1);let e=await(async(e={})=>{let t=Q();try{let n=await t.onramp.verifyDocuments();if(!$())return`inactive`;if(n?.result===`abandoned`)return`abandoned`;ul(`kyc`);let r=await F({operation:()=>sc(t.privy,{environment:t.context.config.environment}),until:e=>e.status===`active`&&e.kyc_tiers?.find((e=>e.tier===`l2`))?.verification_status===`verified`,delay:0,interval:Vc,attempts:30,signal:wc()});if(!$()||r.status===`aborted`)return`inactive`;if(r.status===`max_attempts`){let e=await sc(t.privy,{environment:t.context.config.environment});if(e.status===`active`&&e.kyc_tiers?.find((e=>e.tier===`l2`))?.verification_status===`rejected`)throw fc(e.kyc_tiers)?Error(`Document verification was rejected. Contact Stripe support for help.`):Error(`Document verification was rejected. Try again.`)}return(e.proceedToPayment??!0)&&await el(),`done`}catch(e){return Nc(e),`error`}})({proceedToPayment:!t});e===`abandoned`&&i(!0),e===`done`&&t?.()}),[t]);return(0,V.useEffect)((()=>{n.current||(n.current=!0,a())}),[a]),(0,Y.jsx)(Kl,r?{showClose:!0,onClose:e,icon:Se,iconVariant:`error`,title:`Verification canceled`,subtitle:`Try again to finish identity verification.`,primaryCta:{label:`Try again`,onClick:a},watermark:!0}:{showClose:!0,onClose:e,iconVariant:`loading`,title:`Verifying identity`,subtitle:`Please complete document and selfie verification...`,watermark:!0})},rd=[],id=({step:e,element:t,onClose:n,isLoading:r})=>{let i=oe()?.name??`This app`,a=_e((e=>e?.email??null)),o=_e((e=>e?.amount??``)),s=_e((e=>e?.opts??null)),c=_e((e=>e?.stripeConfirmCheckoutDetails??null)),l=_e((e=>e?.destinationCurrencyIconUrl??null)),u=_e((e=>e?.destinationNetworkIconUrl??null)),d=_e((e=>e?.destinationCurrencySymbol??null)),f=_e((e=>e?.stripeSession?.context.kycAddress?.country)),p=_e((e=>e?.stripeSession?.context.savedPaymentTokens))??rd,m=_e((e=>e?.stripeSession?.context.documentVerificationAction)),h=_e((e=>e?.stripeSession?.context.kycRegion??`us`)),g=()=>{me(),B({state:{status:`select-amount`},isLoading:!1})},_=m?()=>{let e=Q();if((()=>{let e=Q(),{documentVerificationAction:t,...n}=e.context;B({stripeSession:{...e,context:n}})})(),m.type===`retry-checkout`)return void vl();let t=e.context.paymentToken;t&&$c({paymentToken:t,loader:m.loader})}:void 0;switch(e){case`choose-email`:return(0,Y.jsx)(wu,{onClose:n,onEmailChosen:Tl,onEmailBack:g,userEmail:a});case`connect-link`:return(0,Y.jsx)(Uu,{mode:`connect`,onClose:n,onLinkAccountConfirmed:()=>{Rl(`connect`)},onLinkAccountBack:g,userEmail:a});case`create-link-account`:return(0,Y.jsx)(Uu,{mode:`create`,onClose:n,onLinkAccountConfirmed:()=>{Rl(`create`)},onLinkAccountBack:g,userEmail:a});case`collect-country`:return(0,Y.jsx)(Mu,{onClose:n,onSubmit:xl});case`collect-contact`:return(0,Y.jsx)(Ru,{onClose:n,onPhoneSubmitted:Vl,onPhoneBack:g,defaultCountry:f});case`collect-name`:return(0,Y.jsx)(Iu,{onClose:n,onNameSubmitted:Fl,isSandbox:s?.environment===`sandbox`});case`collect-dob`:return(0,Y.jsx)(Nu,{onClose:n,onDobSubmitted:Pl,region:h});case`collect-ssn`:return(0,Y.jsx)(zu,{onClose:n,onSsnSubmitted:Il,appName:i,isSandbox:s?.environment===`sandbox`});case`collect-address`:return(0,Y.jsx)(ku,{onClose:n,onAddressSubmitted:Nl,onBack:g});case`collect-nationality`:return(0,Y.jsx)(Lu,{onClose:n,onSubmit:zl});case`collect-birth-location`:return(0,Y.jsx)(ju,{onClose:n,onSubmit:dl});case`collect-identifiers`:return(0,Y.jsx)(Pu,{onClose:n,onSubmit:El,isSandbox:s?.environment===`sandbox`});case`eu-attestation`:return(0,Y.jsx)(Vu,{onClose:n});case`verify-documents`:return(0,Y.jsx)(nd,{onClose:n,onVerified:_});case`authenticating`:return(0,Y.jsx)(td,{element:t,isSandbox:s?.environment===`sandbox`});case`kyc`:return(0,Y.jsx)(Kl,{showClose:!0,onClose:n,iconVariant:`loading`,title:`Verifying identity`,subtitle:`This may take a moment...`,watermark:!0,isSandbox:s?.environment===`sandbox`});case`select-payment`:return(0,Y.jsx)(Wu,{onClose:n,tokens:p,onSelectToken:Bl,onAddNew:()=>{el({skipTokenCheck:!0})},isLoading:r});case`payment`:return(0,Y.jsx)(Kl,{showClose:!0,onClose:n,showBack:!0,onBack:g,headerTitle:`Add payment method`,subtitle:`Use a Visa or Mastercard. American Express and Discover are not supported.`,watermark:!0,isSandbox:s?.environment===`sandbox`,children:(0,Y.jsx)(cl,{element:t,minHeight:300})});case`confirm-checkout`:return(0,Y.jsx)(Bu,{onClose:n,amount:c?.sourceAmount??o,appName:i,currencySymbol:c?.currencySymbol??`$`,paymentMethodLabel:c?.paymentMethodLabel??null,fee:c?.fee??`Included`,destinationAmount:c?.destinationAmount??o,destinationToken:c?.destinationToken??d??s?.destination.asset?.toUpperCase()??``,destinationNetwork:c?.destinationNetwork??``,tokenIconUrl:l,networkIconUrl:u,opts:s,onConfirmCheckout:vl,quoteExpiresAt:c?.quoteExpiresAt??null,onRefreshQuote:Hl});case`checkout`:return(0,Y.jsx)(Kl,{showClose:!0,onClose:n,iconVariant:`loading`,watermark:!0,isSandbox:s?.environment===`sandbox`});default:return null}},ad=({onClose:e})=>(0,Y.jsx)(ke,{showClose:!0,onClose:e,iconVariant:`loading`,title:`Processing transaction`,subtitle:`Your purchase is in progress. You can leave this screen — we’ll notify you when it’s complete.`,primaryCta:{label:`Done`,onClick:e},watermark:!0}),od={title:`Something went wrong`,subtitle:`We couldn't complete your transaction. Please try again.`,primaryCtaLabel:`Try again`},sd={[le.ONRAMP_UNSUPPORTED_INFORMATION]:{...od,subtitle:`This payment method is not available in your region. Try another payment method.`},[le.ONRAMP_TRANSACTION_LIMIT_REACHED]:{title:`Purchase limit reached`,subtitle:`This purchase is above the current limit. Try a smaller amount.`,primaryCtaLabel:`Edit amount`}},cd=e=>{let t=Ac(e);return t&&sd[t]?sd[t]:e?.message?{...od,subtitle:e.message}:od},ld=({onClose:e,onRetry:t,error:n})=>{let r=cd(n);return(0,Y.jsx)(ke,{showClose:!0,onClose:e,icon:Se,iconVariant:`error`,title:r.title,subtitle:r.subtitle,primaryCta:{label:r.primaryCtaLabel,onClick:t},secondaryCta:{label:`Close`,onClick:e},watermark:!0})},ud=({onClose:e})=>(0,Y.jsx)(ke,{showClose:!0,onClose:e,icon:xe,iconVariant:`success`,title:`Transaction confirmed`,subtitle:`Your purchase is processing. Funds should arrive in your wallet within a few minutes.`,primaryCta:{label:`Done`,onClick:e},watermark:!0}),dd={CREDIT_DEBIT_CARD:`card`,APPLE_PAY:`Apple Pay`,GOOGLE_PAY:`Google Pay`,BANK:`bank deposit`,BANK_TRANSFER:`bank deposit`,SEPA:`bank deposit`,PIX:`PIX`,STRIPE_LINK:`Link`},fd=e=>dd[e]??e.replace(/_/g,` `).toLowerCase().replace(/^\w/,(e=>e.toUpperCase())),pd={CREDIT_DEBIT_CARD:(0,Y.jsx)(Ce,{size:14}),APPLE_PAY:(0,Y.jsx)(Te,{size:14}),GOOGLE_PAY:(0,Y.jsx)(Te,{size:14}),BANK:(0,Y.jsx)(ze,{size:14}),BANK_TRANSFER:(0,Y.jsx)(ze,{size:14}),SEPA:(0,Y.jsx)(ze,{size:14}),PIX:(0,Y.jsx)(Ee,{size:14}),STRIPE_LINK:(0,Y.jsx)(Hu,{size:14})},md=({opts:e,onClose:t,onBack:n,onEditSourceAsset:r,onEditPaymentMethod:i,onContinue:a,onAmountChange:o,amount:s,selectedQuote:c,quotesWarning:l,quotesErrors:u,quotesCount:d,isLoading:f,destinationCurrencySymbol:p})=>{let m=oe().appearance.palette.colorScheme,h=(({destinationCurrencySymbol:e})=>e??`crypto`)({destinationCurrencySymbol:p});return(0,Y.jsxs)(ke,{showClose:!0,onClose:t,showBack:!!n,onBack:n,headerTitle:`Buy ${h}`,primaryCta:{label:`Continue`,onClick:a,loading:f,disabled:!c},helpText:l?(0,Y.jsx)(Ne,{theme:m,children:(0,Y.jsx)(gd,{children:(0,Y.jsxs)(Y.Fragment,l===`amount_too_low`?{children:[(0,Y.jsx)(_d,{children:`Amount too low`}),(0,Y.jsx)(vd,{children:`Please choose a higher amount to continue.`})]}:{children:[(0,Y.jsx)(_d,{children:`Unable to get quotes`}),(0,Y.jsx)(vd,{children:u?.[0]?.error??`Something went wrong. Please try again.`})]})})}):c&&d>1?(0,Y.jsxs)(yd,{onClick:i,children:[(g=c.payment_method_category??c.payment_method,pd[g]??(0,Y.jsx)(Ce,{size:14})),(0,Y.jsxs)(`span`,{children:[`Pay with`,` `,fd(c.payment_method_category??c.payment_method)]}),(0,Y.jsx)(Ve,{size:14})]}):null,watermark:!0,children:[c?.warning&&(0,Y.jsx)(hd,{theme:m,children:(0,Y.jsx)(gd,{children:(0,Y.jsx)(vd,{children:c.warning})})}),(0,Y.jsx)(Ie,{currency:e.source.selectedAsset,value:s,onChange:o,inputMode:`decimal`,autoFocus:!0}),(0,Y.jsx)(Pe,{selectedAsset:e.source.selectedAsset,onEditSourceAsset:r})]});var g},hd=I(Ae)`
|
|
417
|
+
margin-bottom: 0.75rem;
|
|
418
|
+
`,gd=I.div`
|
|
419
|
+
display: flex;
|
|
420
|
+
flex-direction: column;
|
|
421
|
+
gap: 0.125rem;
|
|
422
|
+
flex: 1;
|
|
423
|
+
min-width: 0;
|
|
424
|
+
font-size: 0.75rem;
|
|
425
|
+
line-height: 1.125rem;
|
|
426
|
+
color: var(--privy-color-foreground);
|
|
427
|
+
font-feature-settings:
|
|
428
|
+
'calt' 0,
|
|
429
|
+
'kern' 0;
|
|
430
|
+
text-align: left;
|
|
431
|
+
`,_d=I.span`
|
|
432
|
+
font-weight: 600;
|
|
433
|
+
`,vd=I.span`
|
|
434
|
+
font-weight: 400;
|
|
435
|
+
`,yd=I.button`
|
|
436
|
+
display: inline-flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
gap: 0.25rem;
|
|
439
|
+
background: none;
|
|
440
|
+
border: none;
|
|
441
|
+
cursor: pointer;
|
|
442
|
+
|
|
443
|
+
&& {
|
|
444
|
+
padding: 0;
|
|
445
|
+
color: var(--privy-color-accent);
|
|
446
|
+
font-size: 0.875rem;
|
|
447
|
+
font-style: normal;
|
|
448
|
+
font-weight: 500;
|
|
449
|
+
line-height: 1.375rem;
|
|
450
|
+
}
|
|
451
|
+
`,bd={CREDIT_DEBIT_CARD:`Credit / debit card`,APPLE_PAY:`Apple Pay`,GOOGLE_PAY:`Google Pay`,BANK:`Bank transfer`,BANK_TRANSFER:`Bank transfer`,SEPA:`SEPA`,PIX:`PIX`,STRIPE_LINK:`Link`},xd=e=>bd[e]??e.replace(/_/g,` `).toLowerCase().replace(/^\w/,(e=>e.toUpperCase())),Sd={CREDIT_DEBIT_CARD:(0,Y.jsx)(Ce,{size:20}),APPLE_PAY:(0,Y.jsx)(Le,{width:20,height:20}),GOOGLE_PAY:(0,Y.jsx)(Re,{width:20,height:20}),BANK:(0,Y.jsx)(We,{size:20}),BANK_TRANSFER:(0,Y.jsx)(We,{size:20}),SEPA:(0,Y.jsx)(We,{size:20}),PIX:(0,Y.jsx)(We,{size:20}),STRIPE_LINK:(0,Y.jsx)(Hu,{size:20})},Cd=e=>Sd[e]??(0,Y.jsx)(Ce,{size:20}),wd=({onClose:e,onSelectPaymentMethod:t,quotes:n,isLoading:r})=>(0,Y.jsx)(ke,{showClose:!0,onClose:e,title:`Select payment method`,subtitle:`Choose how you'd like to pay`,watermark:!0,children:(0,Y.jsx)(Td,{children:n.map(((e,n)=>{let i=e.payment_method_category??e.payment_method;return(0,Y.jsx)(Ed,{onClick:()=>t(e),disabled:r,children:(0,Y.jsxs)(Dd,{children:[(0,Y.jsx)(Od,{children:Cd(i)}),(0,Y.jsx)(kd,{children:(0,Y.jsx)(Ad,{children:xd(i)})})]})},`${e.provider}-${e.payment_method}-${n}`)}))})}),Td=I.div`
|
|
452
|
+
display: flex;
|
|
453
|
+
flex-direction: column;
|
|
454
|
+
gap: 0.75rem;
|
|
455
|
+
width: 100%;
|
|
456
|
+
`,Ed=I.button`
|
|
457
|
+
border-color: var(--privy-color-border-default);
|
|
458
|
+
border-width: 1px;
|
|
459
|
+
border-radius: var(--privy-border-radius-md);
|
|
460
|
+
border-style: solid;
|
|
461
|
+
display: flex;
|
|
462
|
+
|
|
463
|
+
&& {
|
|
464
|
+
padding: 1rem;
|
|
465
|
+
}
|
|
466
|
+
`,Dd=I.div`
|
|
467
|
+
display: flex;
|
|
468
|
+
align-items: center;
|
|
469
|
+
gap: 1rem;
|
|
470
|
+
width: 100%;
|
|
471
|
+
`,Od=I.div`
|
|
472
|
+
color: var(--privy-color-foreground-3);
|
|
473
|
+
display: flex;
|
|
474
|
+
align-items: center;
|
|
475
|
+
justify-content: center;
|
|
476
|
+
flex-shrink: 0;
|
|
477
|
+
`,kd=I.div`
|
|
478
|
+
display: flex;
|
|
479
|
+
flex-direction: column;
|
|
480
|
+
align-items: flex-start;
|
|
481
|
+
gap: 0.125rem;
|
|
482
|
+
flex: 1;
|
|
483
|
+
`,Ad=I.span`
|
|
484
|
+
color: var(--privy-color-foreground);
|
|
485
|
+
font-size: 0.875rem;
|
|
486
|
+
font-weight: 400;
|
|
487
|
+
line-height: 1.25rem;
|
|
488
|
+
`,jd=({onClose:e,onBack:t,onContinue:n,onAmountChange:r,onSelectSource:i,onEditSourceAsset:a,onEditPaymentMethod:o,onSelectPaymentMethod:s,onRetry:c,opts:l,state:u,amount:d,error:f,selectedQuote:p,quotesWarning:m,quotesErrors:h,destinationCurrencySymbol:g,quotesCount:_,isLoading:v,isInitialQuoteLoading:y,stripeElement:b})=>u.status===`select-amount`?y?(0,Y.jsx)(ke,{showClose:!0,onClose:e,iconVariant:`loading`}):(0,Y.jsx)(md,{onClose:e,onBack:t,onContinue:n,onAmountChange:r,onEditSourceAsset:a,onEditPaymentMethod:o,opts:l,amount:d,selectedQuote:p,quotesWarning:m,quotesErrors:h,quotesCount:_,destinationCurrencySymbol:g,isLoading:v}):u.status===`select-source-asset`?(0,Y.jsx)(Fe,{onSelectSource:i,opts:l,isLoading:v}):u.status===`select-payment-method`?(0,Y.jsx)(wd,{onClose:e,onSelectPaymentMethod:s,quotes:u.quotes,isLoading:v}):u.status===`stripe-flow`?(0,Y.jsx)(id,{step:u.step,element:b,onClose:e,isLoading:v}):u.status===`provider-confirming`?(0,Y.jsx)(ad,{onClose:e}):u.status===`provider-error`?(0,Y.jsx)(ld,{onClose:e,onRetry:c,error:f}):u.status===`provider-success`?(0,Y.jsx)(ud,{onClose:e}):null,Md={component:()=>{let{onUserCloseViaDialogOrKeybindRef:e}=ve(),t=_e();if(!t)return null;let{opts:n,state:r,error:i,isLoading:a,amount:o,quotesWarning:s,quotesErrors:c,localQuotes:l,localSelectedQuote:u,initialQuotes:d,initialSelectedQuote:f,destinationCurrencySymbol:p,stripeElement:m,onBack:h}=t;return e.current=oc,(0,Y.jsx)(jd,{onClose:oc,onBack:h,opts:n,state:r,error:i,isLoading:a,isInitialQuoteLoading:d==null,amount:o,selectedQuote:pe({localQuotes:l,localSelectedQuote:u,initialSelectedQuote:f}),quotesWarning:s,quotesErrors:c,quotesCount:(l??d)?.length??0,destinationCurrencySymbol:p,onAmountChange:ac,onContinue:tl,onSelectSource:sl,onEditSourceAsset:il,onEditPaymentMethod:rl,onSelectPaymentMethod:ol,onRetry:al,stripeElement:m})}};export{Md as FiatOnrampScreen,Md as default};
|