{
  "version": 3,
  "sources": ["../../src/index.ts", "../../src/types.ts", "../../../../@magic-sdk/types/src/core/exception-types.ts", "../../../../@magic-sdk/types/src/core/json-rpc-types.ts", "../../../../@magic-sdk/types/src/core/message-types.ts", "../../../../@magic-sdk/types/src/core/deep-link-pages.ts", "../../../../@magic-sdk/types/src/modules/auth-types.ts", "../../../../@magic-sdk/types/src/modules/rpc-provider-types.ts", "../../../../@magic-sdk/types/src/modules/user-types.ts", "../../../../@magic-sdk/types/src/modules/nft-types.ts", "../../../../@magic-sdk/types/src/modules/wallet-types.ts", "../../../../@magic-sdk/types/src/modules/common-types.ts", "../../../../@magic-sdk/types/src/modules/oauth-types.ts", "../../src/crypto.ts"],
  "sourcesContent": ["import { createPromiEvent, Extension } from '@magic-sdk/provider';\nimport {\n  OAuthErrorData,\n  OAuthRedirectError,\n  OAuthRedirectResult,\n  OAuthRedirectConfiguration,\n  OAuthPayloadMethods,\n  OAuthRedirectStartResult,\n  OAuthPopupConfiguration,\n  OAuthVerificationConfiguration,\n} from './types';\nimport {\n  OAuthMFAEventEmit,\n  OAuthMFAEventOnReceived,\n  OAuthPopupEventEmit,\n  OAuthPopupEventHandlers,\n  OAuthPopupEventOnReceived,\n  OAuthGetResultEventHandlers,\n} from '@magic-sdk/types';\nimport { createCryptoChallenge } from './crypto';\n\nconst PKCE_STORAGE_KEY = 'magic_oauth_pkce_verifier';\n\ndeclare global {\n  interface Window {\n    Telegram?: {\n      WebApp: {\n        initData: string;\n      };\n    };\n  }\n}\n\nexport class OAuthExtension extends Extension.Internal<'oauth2'> {\n  name = 'oauth2' as const;\n  config = {};\n  compat = {\n    'magic-sdk': '>=2.4.6',\n    '@magic-sdk/react-native': false,\n    '@magic-sdk/react-native-bare': false,\n    '@magic-sdk/react-native-expo': false,\n  };\n\n  constructor() {\n    super();\n    this.seamlessTelegramLogin();\n  }\n\n  public loginWithRedirect(configuration: OAuthRedirectConfiguration) {\n    return this.utils.createPromiEvent<null | string>(async (resolve, reject) => {\n      const { codeVerifier, codeChallenge, cryptoChallengeState } = createCryptoChallenge();\n\n      const parseRedirectResult = this.utils.createJsonRpcRequestPayload(OAuthPayloadMethods.Start, [\n        {\n          ...configuration,\n          apiKey: this.sdk.apiKey,\n          platform: 'web',\n          codeChallenge,\n          cryptoChallengeState,\n          // codeVerifier is intentionally NOT sent here \u2014 it stays in the SDK.\n        },\n      ]);\n\n      const result = await this.request<OAuthRedirectStartResult | OAuthRedirectError>(parseRedirectResult);\n      const successResult = result as OAuthRedirectStartResult;\n      const errorResult = result as OAuthRedirectError;\n\n      if (errorResult.error) {\n        reject(\n          this.createError<OAuthErrorData>(errorResult.error, errorResult.error_description ?? 'An error occurred.', {\n            errorURI: errorResult.error_uri,\n            provider: errorResult.provider,\n          }),\n        );\n      }\n\n      if (successResult?.pkceMetadata) {\n        // New path: store codeVerifier + all OAuth metadata at the SDK (parent page) level.\n        // sessionStorage persists across same-tab redirects but never enters the iframe.\n        sessionStorage.setItem(PKCE_STORAGE_KEY, JSON.stringify({ codeVerifier, ...successResult.pkceMetadata }));\n        localStorage.setItem(PKCE_STORAGE_KEY, JSON.stringify({ codeVerifier, ...successResult.pkceMetadata }));\n      }\n\n      if (successResult?.oauthAuthoriationURI) {\n        const redirectURI = successResult.useMagicServerCallback\n          ? // @ts-ignore - this.sdk.endpoint is marked protected but we need to access it.\n            new URL(successResult.oauthAuthoriationURI, this.sdk.endpoint).href\n          : successResult.oauthAuthoriationURI;\n\n        if (successResult?.shouldReturnURI) {\n          resolve(redirectURI);\n        } else {\n          window.location.href = redirectURI;\n        }\n      }\n      resolve(null);\n    });\n  }\n\n  public getRedirectResult(configuration: OAuthVerificationConfiguration = {}) {\n    const queryString = configuration?.optionalQueryString || window.location.search;\n\n    // Remove the query from the redirect callback as a precaution to prevent\n    // malicious parties from parsing it before we have a chance to use it.\n    const urlWithoutQuery = window.location.origin + window.location.pathname;\n    window.history.replaceState(null, '', urlWithoutQuery);\n\n    return this.getResult(configuration, queryString);\n  }\n\n  public loginWithPopup(configuration: OAuthPopupConfiguration) {\n    const { showMfaModal } = configuration;\n    const requestPayload = this.utils.createJsonRpcRequestPayload(OAuthPayloadMethods.Popup, [\n      {\n        ...configuration,\n        showUI: showMfaModal,\n        returnTo: window.location.href,\n        apiKey: this.sdk.apiKey,\n        platform: 'web',\n      },\n    ]);\n\n    const promiEvent = createPromiEvent<OAuthRedirectResult, OAuthPopupEventHandlers>(async (resolve, reject) => {\n      try {\n        const oauthPopupRequest = this.request<OAuthRedirectResult | OAuthRedirectError, OAuthPopupEventHandlers>(\n          requestPayload,\n        );\n\n        /**\n         * Attach Event listeners\n         */\n        const redirectEvent = (event: MessageEvent) => {\n          this.createIntermediaryEvent(OAuthPopupEventEmit.PopupEvent, requestPayload.id as string)(event.data);\n        };\n\n        if (configuration.shouldReturnURI && oauthPopupRequest) {\n          oauthPopupRequest.on(OAuthPopupEventOnReceived.PopupUrl, popupUrl => {\n            window.addEventListener('message', redirectEvent);\n            promiEvent.emit(OAuthPopupEventOnReceived.PopupUrl, popupUrl);\n          });\n        }\n\n        if (!showMfaModal) {\n          oauthPopupRequest.on(OAuthMFAEventOnReceived.MfaSentHandle, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.MfaSentHandle);\n          });\n          oauthPopupRequest.on(OAuthMFAEventOnReceived.InvalidMfaOtp, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.InvalidMfaOtp);\n          });\n          oauthPopupRequest.on(OAuthMFAEventOnReceived.RecoveryCodeSentHandle, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.RecoveryCodeSentHandle);\n          });\n          oauthPopupRequest.on(OAuthMFAEventOnReceived.InvalidRecoveryCode, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.InvalidRecoveryCode);\n          });\n          oauthPopupRequest.on(OAuthMFAEventOnReceived.RecoveryCodeSuccess, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.RecoveryCodeSuccess);\n          });\n        }\n\n        const result = await oauthPopupRequest;\n        window.removeEventListener('message', redirectEvent);\n\n        const maybeResult = result as OAuthRedirectResult;\n        const maybeError = result as OAuthRedirectError;\n\n        if (maybeError.error) {\n          reject(\n            this.createError<OAuthErrorData>(maybeError.error, maybeError.error_description ?? 'An error occurred.', {\n              errorURI: maybeError.error_uri,\n              provider: maybeError.provider,\n            }),\n          );\n        } else {\n          resolve(maybeResult);\n        }\n      } catch (error) {\n        reject(error);\n      }\n    });\n\n    if (!showMfaModal && promiEvent) {\n      promiEvent.on(OAuthMFAEventEmit.VerifyMFACode, (mfa: string) => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.VerifyMFACode, requestPayload.id as string)(mfa);\n      });\n      promiEvent.on(OAuthMFAEventEmit.LostDevice, () => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.LostDevice, requestPayload.id as string)();\n      });\n      promiEvent.on(OAuthMFAEventEmit.VerifyRecoveryCode, (recoveryCode: string) => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.VerifyRecoveryCode, requestPayload.id as string)(recoveryCode);\n      });\n      promiEvent.on(OAuthMFAEventEmit.Cancel, () => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.Cancel, requestPayload.id as string)();\n      });\n    }\n\n    return promiEvent;\n  }\n\n  private getResult(configuration: OAuthVerificationConfiguration, queryString: string) {\n    const { showMfaModal } = configuration;\n    const { hasStateMismatch, clientMetadata } = this.retrievePKCEMetadata(queryString);\n\n    const requestPayload = this.utils.createJsonRpcRequestPayload(OAuthPayloadMethods.Verify, [\n      {\n        authorizationResponseParams: queryString,\n        magicApiKey: this.sdk.apiKey,\n        platform: 'web',\n        showUI: showMfaModal,\n        ...configuration,\n        ...(clientMetadata ? { clientMetadata } : {}),\n      },\n    ]);\n\n    const promiEvent = this.utils.createPromiEvent<OAuthRedirectResult, OAuthGetResultEventHandlers>(\n      async (resolve, reject) => {\n        if (!clientMetadata) {\n          return reject(\n            this.createError<object>(\n              'MISSING_PKCE_METADATA',\n              'OAuth session metadata not found \u2014 the session may have expired or storage was cleared',\n              {},\n            ),\n          );\n        }\n\n        if (hasStateMismatch) {\n          return reject(\n            this.createError<object>(\n              'STATE_MISMATCH',\n              'OAuth state parameter mismatch \u2014 request may have been tampered with',\n              {},\n            ),\n          );\n        }\n\n        const getResultRequest = this.request<OAuthRedirectResult | OAuthRedirectError, OAuthGetResultEventHandlers>(\n          requestPayload,\n        );\n\n        if (!showMfaModal) {\n          getResultRequest.on(OAuthMFAEventOnReceived.MfaSentHandle, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.MfaSentHandle);\n          });\n          getResultRequest.on(OAuthMFAEventOnReceived.InvalidMfaOtp, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.InvalidMfaOtp);\n          });\n          getResultRequest.on(OAuthMFAEventOnReceived.RecoveryCodeSentHandle, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.RecoveryCodeSentHandle);\n          });\n          getResultRequest.on(OAuthMFAEventOnReceived.InvalidRecoveryCode, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.InvalidRecoveryCode);\n          });\n          getResultRequest.on(OAuthMFAEventOnReceived.RecoveryCodeSuccess, () => {\n            promiEvent.emit(OAuthMFAEventOnReceived.RecoveryCodeSuccess);\n          });\n        }\n\n        // Parse the result, which may contain an OAuth-formatted error.\n        const resultOrError = await getResultRequest;\n        const maybeResult = resultOrError as OAuthRedirectResult;\n        const maybeError = resultOrError as OAuthRedirectError;\n\n        if (maybeError.error) {\n          reject(\n            this.createError<OAuthErrorData>(maybeError.error, maybeError.error_description ?? 'An error occurred.', {\n              errorURI: maybeError.error_uri,\n              provider: maybeError.provider,\n            }),\n          );\n        }\n\n        resolve(maybeResult);\n      },\n    );\n\n    if (!showMfaModal && promiEvent) {\n      promiEvent.on(OAuthMFAEventEmit.VerifyMFACode, (mfa: string) => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.VerifyMFACode, requestPayload.id as string)(mfa);\n      });\n      promiEvent.on(OAuthMFAEventEmit.LostDevice, () => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.LostDevice, requestPayload.id as string)();\n      });\n      promiEvent.on(OAuthMFAEventEmit.VerifyRecoveryCode, (recoveryCode: string) => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.VerifyRecoveryCode, requestPayload.id as string)(recoveryCode);\n      });\n      promiEvent.on(OAuthMFAEventEmit.Cancel, () => {\n        this.createIntermediaryEvent(OAuthMFAEventEmit.Cancel, requestPayload.id as string)();\n      });\n    }\n\n    return promiEvent;\n  }\n\n  protected seamlessTelegramLogin() {\n    try {\n      const hash = window.location.hash.toString();\n      if (!hash.includes('#tgWebAppData')) return;\n\n      const script = document.createElement('script');\n      script.src = 'https://telegram.org/js/telegram-web-app.js';\n      document.head.prepend(script);\n\n      script.onload = async () => {\n        try {\n          const userData = window.Telegram?.WebApp.initData;\n          const requestPayload = this.utils.createJsonRpcRequestPayload(OAuthPayloadMethods.VerifyTelegramData, [\n            { userData, isMiniApp: true },\n          ]);\n\n          await this.request<string | null>(requestPayload);\n        } catch (verificationError) {\n          console.log('Error while verifying telegram data', verificationError);\n        }\n      };\n    } catch (seamlessLoginError) {\n      console.log('Error while loading telegram-web-app script', seamlessLoginError);\n    }\n  }\n\n  private retrievePKCEMetadata(queryString: string): {\n    clientMetadata?: Record<string, string>;\n    hasStateMismatch: boolean;\n  } {\n    let hasStateMismatch = false;\n    // Retrieve and immediately clear the full PKCE metadata stored at SDK level.\n    const storedInSession = sessionStorage.getItem(PKCE_STORAGE_KEY);\n    const storedInLocal = localStorage.getItem(PKCE_STORAGE_KEY);\n    sessionStorage.removeItem(PKCE_STORAGE_KEY);\n    localStorage.removeItem(PKCE_STORAGE_KEY);\n\n    // clientMetadata contains { codeVerifier, state, redirectUri, appID, provider }.\n    // Forwarding it lets the embedded-wallet verify handler skip its iframe storage entirely.\n    // When absent (old embedded-wallet path), the handler falls back to its stored metadata.\n    const clientMetadata = storedInSession\n      ? (JSON.parse(storedInSession) as Record<string, string>)\n      : storedInLocal\n        ? (JSON.parse(storedInLocal) as Record<string, string>)\n        : undefined;\n\n    // State verification for the new PKCE path.\n    // The extension generated the state, so it verifies it here \u2014 before any RPC call \u2014 as CSRF protection.\n    // In the legacy path (no clientMetadata), embedded-wallet handles state verification itself.\n    if (clientMetadata) {\n      const returnedState = new URLSearchParams(queryString).get('state');\n      if (!returnedState || returnedState !== clientMetadata.state) {\n        hasStateMismatch = true;\n      }\n    }\n\n    return { clientMetadata, hasStateMismatch };\n  }\n}\n\nexport * from './types';\n", "import { MagicUserMetadata } from '@magic-sdk/types';\n\nexport enum OAuthPayloadMethods {\n  Start = 'magic_oauth_login_with_redirect_start',\n  Verify = 'magic_oauth_login_with_redirect_verify',\n  Popup = 'magic_oauth_login_with_popup',\n  VerifyTelegramData = 'magic_oauth_verify_telegram_data',\n}\n\nexport type OAuthProvider =\n  | 'google'\n  | 'facebook'\n  | 'apple'\n  | 'github'\n  | 'bitbucket'\n  | 'gitlab'\n  | 'linkedin'\n  | 'twitter'\n  | 'discord'\n  | 'twitch'\n  | 'microsoft';\n\ntype OAuthPopupProvider = OAuthProvider | 'telegram';\n\nexport interface OAuthErrorData {\n  provider: OAuthProvider;\n  errorURI?: string;\n}\n\nexport interface OpenIDConnectProfile {\n  name?: string;\n  familyName?: string;\n  givenName?: string;\n  middleName?: string;\n  nickname?: string;\n  preferredUsername?: string;\n  profile?: string;\n  picture?: string;\n  website?: string;\n  gender?: string;\n  birthdate?: string;\n  zoneinfo?: string;\n  locale?: string;\n  updatedAt?: number;\n}\n\nexport interface OpenIDConnectEmail {\n  email?: string;\n  emailVerified?: boolean;\n}\n\nexport interface OpenIDConnectPhone {\n  phoneNumber?: string;\n  phoneNumberVerified?: boolean;\n}\n\nexport interface OpenIDConnectAddress {\n  address?: {\n    formatted?: string;\n    streetAddress?: string;\n    locality?: string;\n    region?: string;\n    postalCode?: string;\n    country?: string;\n  };\n}\n\nexport type OpenIDConnectUserInfo = OpenIDConnectProfile &\n  OpenIDConnectEmail &\n  OpenIDConnectPhone &\n  OpenIDConnectAddress & { sub?: string; sources?: Record<string, any> } & Record<string, any>;\n\nexport interface OAuthRedirectStartResult {\n  oauthAuthoriationURI?: string;\n  useMagicServerCallback?: boolean;\n  shouldReturnURI?: boolean;\n  /**\n   * Present in the new client-PKCE path. The extension stores this alongside\n   * codeVerifier at the SDK level and forwards it in the verify call.\n   */\n  pkceMetadata?: {\n    state: string;\n    redirectUri: string;\n    appID: string;\n    provider: string;\n  };\n}\n\nexport interface OAuthRedirectResult {\n  oauth: {\n    provider: OAuthProvider;\n    scope: string[];\n    userHandle: string;\n    userInfo: OpenIDConnectUserInfo;\n  };\n  magic: {\n    idToken: string;\n    userMetadata: MagicUserMetadata;\n  };\n}\n\nexport interface OAuthRedirectError {\n  provider: OAuthProvider;\n  error: string;\n  error_description?: string;\n  error_uri?: string;\n}\n\nexport interface OAuthRedirectConfiguration {\n  provider: OAuthProvider;\n  redirectURI: string;\n  scope?: string[];\n  customData?: string;\n  providerParams?: Record<string, string | number | boolean>;\n  loginHint?: string;\n}\n\nexport interface OAuthVerificationConfiguration {\n  lifespan?: number;\n  optionalQueryString?: string;\n  skipDIDToken?: boolean;\n  showMfaModal?: boolean;\n}\n\nexport interface OAuthPopupConfiguration {\n  provider: OAuthPopupProvider;\n  scope?: string[];\n  loginHint?: string;\n  providerParams?: Record<string, string | number | boolean>;\n  shouldReturnURI?: boolean;\n  showMfaModal?: boolean;\n}\n\nexport enum OAuthErrorCode {\n  InvalidRequest = 'invalid_request',\n  InvalidClient = 'invalid_client',\n  InvalidScope = 'invalid_scope',\n  InvalidGrant = 'invalid_grant',\n  UnauthorizedClient = 'unauthorized_client',\n  UnsupportedResponseType = 'unsupported_response_type',\n  UnsupportedGrantType = 'unsupported_grant_type',\n  UnsupportedTokenType = 'unsupported_token_type',\n  AccessDenied = 'access_denied',\n  ServerError = 'server_error',\n  TemporarilyUnavailable = 'temporarily_unavailable',\n}\n", "export enum SDKErrorCode {\n  MissingApiKey = 'MISSING_API_KEY',\n  ModalNotReady = 'MODAL_NOT_READY',\n  ConnectionLost = 'CONNECTION_WAS_LOST',\n  MalformedResponse = 'MALFORMED_RESPONSE',\n  InvalidArgument = 'INVALID_ARGUMENT',\n  ExtensionNotInitialized = 'EXTENSION_NOT_INITIALIZED',\n  IncompatibleExtensions = 'INCOMPATIBLE_EXTENSIONS',\n}\n\nexport enum SDKWarningCode {\n  SyncWeb3Method = 'SYNC_WEB3_METHOD',\n  DuplicateIframe = 'DUPLICATE_IFRAME',\n  ReactNativeEndpointConfiguration = 'REACT_NATIVE_ENDPOINT_CONFIGURATION',\n  DeprecationNotice = 'DEPRECATION_NOTICE',\n  ProductAnnouncement = 'ANNOUNCEMENT',\n}\n\nexport enum RPCErrorCode {\n  // Standard JSON RPC 2.0 Error Codes\n  ParseError = -32700,\n  InvalidRequest = -32600,\n  MethodNotFound = -32601,\n  InvalidParams = -32602,\n  InternalError = -32603,\n\n  // Custom RPC Error Codes\n  MagicLinkFailedVerification = -10000,\n  MagicLinkExpired = -10001,\n  MagicLinkRateLimited = -10002,\n  MagicLinkInvalidRedirectURL = -10006,\n  UserAlreadyLoggedIn = -10003,\n  UpdateEmailFailed = -10004,\n  UserRequestEditEmail = -10005,\n  InactiveRecipient = -10010,\n  AccessDeniedToUser = -10011,\n  RedirectLoginComplete = -10015,\n  DpopInvalidated = -10019,\n}\n\nexport type ErrorCode = SDKErrorCode | RPCErrorCode;\nexport type WarningCode = SDKWarningCode;\n", "import { RPCErrorCode } from './exception-types';\n\n// --- Request interfaces\n\nexport interface JsonRpcRequestPayload<TParams = any> {\n  jsonrpc: string;\n  id: string | number | null;\n  method: string;\n  params?: TParams;\n}\n\nexport interface JsonRpcRequestCallback {\n  /** Callback executed upon JSON RPC response. */\n  (err: JsonRpcError | null, result?: JsonRpcResponsePayload | null): void;\n}\n\nexport interface JsonRpcBatchRequestCallback {\n  /** Callback executed upon JSON RPC response. */\n  (err: JsonRpcError | null, result?: (JsonRpcResponsePayload | null)[] | null): void;\n}\n\n// --- Response interfaces\n\nexport interface JsonRpcError {\n  message: string;\n  code: RPCErrorCode;\n  data?: any;\n}\n\nexport interface JsonRpcResponsePayload<ResultType = any> {\n  jsonrpc: string;\n  id: string | number | null;\n  result?: ResultType | null;\n  error?: JsonRpcError | null;\n}\n\nexport interface UserInfo {\n  email?: string;\n}\n\nexport type ShowUIPromiEvents = {\n  disconnect: () => void;\n};\n\nexport interface RequestUserInfoScope {\n  scope?: {\n    email?: 'required' | 'optional';\n  };\n}\n\nexport enum LocalStorageKeys {\n  PROVIDER = 'magic_3pw_provider',\n  ADDRESS = 'magic_3pw_address',\n  CHAIN_ID = 'magic_3pw_chainId',\n}\n\nexport enum ThirdPartyWalletEvents {\n  WalletConnected = 'wallet_connected',\n  WalletRejected = 'wallet_rejected',\n  Web3ModalSelected = 'web3modal_selected',\n}\n\nexport interface ConnectWithUIOptions {\n  autoPromptThirdPartyWallets?: boolean;\n}\n\nexport type ConnectWithUiEvents = {\n  'id-token-created': (params: { idToken: string }) => void;\n} & { [key in ThirdPartyWalletEvents]: () => void };\n\n// --- Payload methods\n\n/**\n * Enum of JSON RPC methods for interacting with the Magic SDK authentication\n * relayer.\n */\nexport enum MagicPayloadMethod {\n  LoginWithSms = 'magic_auth_login_with_sms',\n  LoginWithEmailOTP = 'magic_auth_login_with_email_otp',\n  LoginWithMagicLink = 'magic_auth_login_with_magic_link',\n  LoginWithCredential = 'magic_auth_login_with_credential',\n  SetAuthorizationToken = 'magic_auth_set_authorization_token',\n  GetIdToken = 'magic_auth_get_id_token',\n  GenerateIdToken = 'magic_auth_generate_id_token',\n  GetMetadata = 'magic_auth_get_metadata',\n  IsLoggedIn = 'magic_is_logged_in',\n  Logout = 'magic_auth_logout',\n  UpdateEmail = 'magic_auth_update_email',\n  UserSettings = 'magic_auth_settings',\n  UserSettingsTestMode = 'magic_auth_settings_testing_mode',\n  LoginWithSmsTestMode = 'magic_auth_login_with_sms_testing_mode',\n  LoginWithEmailOTPTestMode = 'magic_auth_login_with_email_otp_testing_mode',\n  LoginWithMagicLinkTestMode = 'magic_login_with_magic_link_testing_mode',\n  LoginWithCredentialTestMode = 'magic_auth_login_with_credential_testing_mode',\n  GetIdTokenTestMode = 'magic_auth_get_id_token_testing_mode',\n  GenerateIdTokenTestMode = 'magic_auth_generate_id_token_testing_mode',\n  GetMetadataTestMode = 'magic_auth_get_metadata_testing_mode',\n  IsLoggedInTestMode = 'magic_auth_is_logged_in_testing_mode',\n  LogoutTestMode = 'magic_auth_logout_testing_mode',\n  UpdateEmailTestMode = 'magic_auth_update_email_testing_mode',\n  IntermediaryEvent = 'magic_intermediary_event',\n  RequestAccounts = 'eth_requestAccounts',\n  GetInfo = 'magic_get_info',\n  ShowUI = 'magic_wallet',\n  NFTPurchase = 'magic_nft_purchase',\n  NFTCheckout = 'magic_nft_checkout',\n  NFTTransfer = 'magic_nft_transfer',\n  RequestUserInfoWithUI = 'mc_request_user_info',\n  Disconnect = 'mc_disconnect',\n  // UpdatePhoneNumber = 'magic_auth_update_phone_number',\n  // UpdatePhoneNumberTestMode = 'magic_auth_update_phone_number_testing_mode',\n  RecoverAccount = 'magic_auth_recover_account',\n  RecoverAccountTestMode = 'magic_auth_recover_account_testing_mode',\n  MagicBoxHeartBeat = 'magic_box_heart_beat',\n  AutoConnect = 'mc_auto_connect',\n  Login = 'mc_login',\n  EncryptV1 = 'magic_auth_encrypt_v1',\n  DecryptV1 = 'magic_auth_decrypt_v1',\n  ShowNFTs = 'magic_show_nfts',\n  ShowOnRamp = 'magic_show_fiat_onramp',\n  ShowSendTokensUI = 'magic_show_send_tokens_ui',\n  ShowAddress = 'magic_show_address',\n  ShowBalances = 'magic_show_balances',\n  RevealPK = 'magic_reveal_key',\n  EnableMFA = 'magic_auth_enable_mfa_flow',\n  DisableMFA = 'magic_auth_disable_mfa_flow',\n  GetMultichainPublicAddress = 'magic_get_multichain_public_address',\n  Sign7702Authorization = 'magic_wallet_sign_7702_authorization',\n  Send7702Transaction = 'eth_send7702Transaction',\n}\n\n// Methods to not route if connected to third party wallet\nexport const routeToMagicMethods = [\n  MagicPayloadMethod.IntermediaryEvent,\n  MagicPayloadMethod.NFTCheckout,\n  MagicPayloadMethod.Login,\n];\n", "import { JsonRpcResponsePayload, JsonRpcError, JsonRpcRequestPayload } from './json-rpc-types';\n\nexport enum MagicIncomingWindowMessage {\n  MAGIC_HANDLE_RESPONSE = 'MAGIC_HANDLE_RESPONSE',\n  MAGIC_OVERLAY_READY = 'MAGIC_OVERLAY_READY',\n  MAGIC_SHOW_OVERLAY = 'MAGIC_SHOW_OVERLAY',\n  MAGIC_HIDE_OVERLAY = 'MAGIC_HIDE_OVERLAY',\n  MAGIC_HANDLE_EVENT = 'MAGIC_HANDLE_EVENT',\n  MAGIC_MG_BOX_SEND_RECEIPT = 'MAGIC_MG_BOX_SEND_RECEIPT',\n  MAGIC_SEND_PRODUCT_ANNOUNCEMENT = 'MAGIC_SEND_PRODUCT_ANNOUNCEMENT',\n  MAGIC_PONG = 'MAGIC_PONG',\n  MAGIC_POPUP_RESPONSE = 'MAGIC_POPUP_RESPONSE',\n  MAGIC_POPUP_OAUTH_VERIFY_RESPONSE = 'MAGIC_POPUP_OAUTH_VERIFY_RESPONSE',\n  MAGIC_THIRD_PARTY_WALLET_REQUEST = 'MAGIC_THIRD_PARTY_WALLET_REQUEST',\n  MAGIC_OPEN_MOBILE_URL = 'MAGIC_OPEN_MOBILE_URL',\n}\n\nexport enum MagicOutgoingWindowMessage {\n  MAGIC_HANDLE_REQUEST = 'MAGIC_HANDLE_REQUEST',\n  MAGIC_THIRD_PARTY_WALLET_RESPONSE = 'MAGIC_THIRD_PARTY_WALLET_RESPONSE',\n  MAGIC_THIRD_PARTY_WALLET_UPDATE = 'MAGIC_THIRD_PARTY_WALLET_EVENT',\n  MAGIC_PING = 'MAGIC_PING',\n}\n\n/** The shape of responding window message data from the Magic iframe context. */\nexport interface MagicMessageRequest {\n  msgType: string;\n  payload: JsonRpcRequestPayload | JsonRpcRequestPayload[];\n  rt?: string;\n  jwt?: string;\n  deviceShare?: string;\n}\n\n/** The shape of responding window message data from the Magic iframe context. */\nexport interface MagicMessageResponse<ResultType = any> {\n  msgType: string;\n  response: Partial<JsonRpcError> & Partial<JsonRpcResponsePayload<ResultType>>;\n  rt?: string;\n  deviceShare?: string;\n}\n\n/** The expected message event returned by the Magic iframe context. */\nexport interface MagicMessageEvent extends Partial<MessageEvent> {\n  data: MagicMessageResponse;\n}\n\nexport interface MagicThirdPartyWalletRequest {\n  msgType: MagicIncomingWindowMessage.MAGIC_THIRD_PARTY_WALLET_REQUEST;\n  payload: JsonRpcRequestPayload;\n}\n\nexport interface MagicThirdPartyWalletResponse {\n  msgType: `${MagicOutgoingWindowMessage.MAGIC_THIRD_PARTY_WALLET_RESPONSE}-${string}`;\n  response: JsonRpcResponsePayload;\n}\n\nexport interface MagicThirdPartyWalletUpdate {\n  msgType: `${MagicOutgoingWindowMessage.MAGIC_THIRD_PARTY_WALLET_UPDATE}-${string}`;\n  details: {\n    address: `0x${string}` | undefined;\n    addresses: readonly `0x${string}`[] | undefined;\n    chain: { id: number; name: string; [key: string]: unknown } | undefined;\n    updatedField: 'chain' | 'address';\n  };\n}\n\nexport type MagicThirdPartyWalletEventPayload = MagicThirdPartyWalletResponse | MagicThirdPartyWalletUpdate;\n", "export enum DeepLinkPage {\n  UpdateEmail = 'update-email',\n  MFA = 'mfa',\n  Recovery = 'recovery',\n}\n", "import { WalletEventOnReceived } from './wallet-types';\n\nexport interface LoginWithMagicLinkConfiguration {\n  /**\n   * The email address of the user attempting to login.\n   */\n  email: string;\n\n  /**\n   * When `true`, a pre-built modal interface will show to the user, directing\n   * them to check their email for the \"magic link\" to complete their\n   * authentication.\n   */\n  showUI?: boolean;\n\n  /**\n   * You can optionally provide a redirect URI that will be followed at the end\n   * of the magic link flow. Don't forget to invoke\n   * `magic.auth.loginWithCredential()` to complete the login from the route you\n   * configure here.\n   */\n  redirectURI?: string;\n\n  /**\n   * Enterprise users with a custom SMTP can create custom email templates\n   * from their dashboard. The default Magic loginWithMagicLink email will be\n   * overridden when a variation is passed here.\n   */\n  overrides?: {\n    variation?: string;\n  };\n\n  /**\n   * The number of seconds until the generated Decentralized ID token will expire.\n   */\n  lifespan?: number;\n}\n\nexport interface LoginWithSmsConfiguration {\n  /**\n   * Specify the phone number of the user attempting to login.\n   */\n  phoneNumber: string;\n\n  /**\n   * When `true`, a pre-built modal interface will show to the user, directing\n   * them to check their SMS for the one time passcode (OTP) to complete their\n   * authentication.\n   *\n   * When `false`, developers will be able to implement their own custom UI to\n   * continue the SMS OTP flow.\n   */\n  showUI?: boolean;\n\n  /*\n   * The number of seconds until the generated Decentralized ID token will expire.\n   */\n  lifespan?: number;\n}\nexport interface LoginWithEmailOTPConfiguration {\n  /**\n   * Specify the email address of the user attempting to login.\n   */\n  email: string;\n\n  /**\n   * When `true`, a pre-built modal interface will show to the user, directing\n   * them to check their email for the one time passcode (OTP) to complete their\n   * authentication.\n   *\n   * When `false`, developers will be able to implement their own custom UI to\n   * continue the email OTP flow.\n   */\n  showUI?: boolean;\n\n  /**\n   * Device Unrecognized UI will enforce showing up to secure user's login\n   *\n   * When set to true (default), an improved device recognition UI will be displayed to the user,\n   * prompting them to verify their login by checking their email for device approval. This feature\n   * enhances authentication security.\n   *\n   * This param will only be affected if showUI is false. When set to false,\n   * developers have the flexibility to implement their own customized UI to\n   * handle device check events, providing a more tailored user experience.\n   */\n  deviceCheckUI?: boolean;\n\n  /**\n   * Enterprise users with a custom SMTP can create custom email templates\n   * from their dashboard. The default Magic loginWithOTP email will be\n   * overridden when a variation is passed here.\n   */\n  overrides?: {\n    variation?: string;\n    appName?: string;\n    assetUrl?: string;\n  };\n\n  /**\n   * The number of seconds until the generated Decentralized ID token will expire.\n   */\n  lifespan?: number;\n}\n\nexport interface LoginWithCredentialConfiguration {\n  /**\n   * A credential token or a valid query string (prefixed with ? or #)\n   */\n  credentialOrQueryString?: string;\n\n  /**\n   * The number of seconds until the generated Decentralized ID token will expire.\n   */\n  lifespan?: number;\n}\n\nexport interface EnableMFAConfiguration {\n  /**\n   * When `true`, a pre-built modal interface will show to the user, directing\n   * them to enable MFA using Google Authenticator app.\n   *\n   * When `false`, developers will be able to implement their own custom UI to\n   * continue the enable MFA flow.\n   */\n  showUI?: boolean;\n}\n\nexport interface DisableMFAConfiguration {\n  /**\n   * When `true`, a pre-built modal interface will show to the user, directing\n   * them to disable MFA.\n   *\n   * When `false`, developers will be able to implement their own custom UI to\n   * continue the disable MFA flow.\n   */\n  showUI?: boolean;\n}\n\n/**\n * Auth Events Enum\n */\nexport enum LoginWithMagicLinkEventEmit {\n  Retry = 'retry',\n}\n\nexport enum LoginWithMagicLinkEventOnReceived {\n  EmailSent = 'email-sent',\n  EmailNotDeliverable = 'email-not-deliverable',\n}\n\nexport enum LoginWithEmailOTPEventEmit {\n  VerifyEmailOtp = 'verify-email-otp',\n  VerifyMFACode = 'verify-mfa-code',\n  LostDevice = 'lost-device',\n  VerifyRecoveryCode = 'verify-recovery-code',\n  Cancel = 'cancel',\n}\n\nexport enum LoginWithSmsOTPEventEmit {\n  VerifySmsOtp = 'verify-sms-otp',\n  VerifyMFACode = 'verify-mfa-code',\n  LostDevice = 'lost-device',\n  VerifyRecoveryCode = 'verify-recovery-code',\n  Cancel = 'cancel',\n  Retry = 'retry',\n}\n\nexport enum LoginWithSmsOTPEventOnReceived {\n  SmsOTPSent = 'sms-otp-sent',\n  InvalidSmsOtp = 'invalid-sms-otp',\n  ExpiredSmsOtp = 'expired-sms-otp',\n  MfaSentHandle = 'mfa-sent-handle',\n  InvalidMfaOtp = 'invalid-mfa-otp',\n  LoginThrottled = 'login-throttled',\n  RecoveryCodeSentHandle = 'recovery-code-sent-handle',\n  InvalidRecoveryCode = 'invalid-recovery-code',\n  RecoveryCodeSuccess = 'recovery-code-success',\n}\n\nexport enum LoginWithEmailOTPEventOnReceived {\n  EmailOTPSent = 'email-otp-sent',\n  InvalidEmailOtp = 'invalid-email-otp',\n  InvalidMfaOtp = 'invalid-mfa-otp',\n  ExpiredEmailOtp = 'expired-email-otp',\n  MfaSentHandle = 'mfa-sent-handle',\n  RecoveryCodeSentHandle = 'recovery-code-sent-handle',\n  InvalidRecoveryCode = 'invalid-recovery-code',\n  RecoveryCodeSuccess = 'recovery-code-success',\n  LoginThrottled = 'login-throttled',\n  MaxAttemptsReached = 'max-attempts-reached',\n}\n\nexport enum DeviceVerificationEventEmit {\n  Retry = 'device-retry',\n}\n\nexport enum DeviceVerificationEventOnReceived {\n  DeviceApproved = 'device-approved',\n  DeviceNeedsApproval = 'device-needs-approval',\n  DeviceVerificationLinkExpired = 'device-verification-link-expired',\n  DeviceVerificationEmailSent = 'device-verification-email-sent',\n}\n\nexport enum RecencyCheckEventEmit {\n  Retry = 'Recency/auth-factor-retry',\n  Cancel = 'Recency/auth-factor-verification-cancel',\n  VerifyEmailOtp = 'Recency/auth-factor-verify-email-otp',\n  VerifyMFACode = 'Recency/verify-mfa-code',\n}\n\nexport enum RecencyCheckEventOnReceived {\n  PrimaryAuthFactorNeedsVerification = 'Recency/auth-factor-needs-verification',\n  PrimaryAuthFactorVerified = 'Recency/auth-factor-verified',\n  InvalidEmailOtp = 'Recency/auth-factor-invalid-email-otp',\n  EmailExpired = 'Recency/auth-factor-verification-email-expired',\n  EmailSent = 'Recency/auth-factor-verification-email-sent',\n  EmailNotDeliverable = 'Recency/auth-factor-verification-email-not-deliverable',\n}\n\nexport enum UpdateEmailEventEmit {\n  RetryWithNewEmail = 'UpdateEmail/retry-with-new-email',\n  Cancel = 'UpdateEmail/new-email-verification-cancel',\n  VerifyEmailOtp = 'UpdateEmail/new-email-verify-otp',\n}\n\nexport enum UpdateEmailEventOnReceived {\n  NewAuthFactorNeedsVerification = 'UpdateEmail/new-email-needs-verification',\n  EmailUpdated = 'UpdateEmail/email-updated',\n  InvalidEmailOtp = 'UpdateEmail/new-email-invalid-email-otp',\n  EmailExpired = 'UpdateEmail/new-email-verification-email-expired',\n  EmailSent = 'UpdateEmail/new-email-verification-email-sent',\n  EmailNotDeliverable = 'UpdateEmail/new-email-verification-email-not-deliverable',\n  InvalidEmail = 'UpdateEmail/new-email-invalid',\n  EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',\n}\n\nexport enum AuthEventOnReceived {\n  IDTokenCreated = 'Auth/id-token-created',\n}\n\nexport enum FarcasterLoginEventEmit {\n  Cancel = 'Farcaster/cancel',\n}\n\nexport enum EnableMFAEventOnReceived {\n  MFASecretGenerated = 'mfa-secret-generated',\n  InvalidMFAOtp = 'invalid-mfa-otp',\n  MFARecoveryCodes = 'mfa-recovery-codes',\n}\nexport enum EnableMFAEventEmit {\n  VerifyMFACode = 'verify-mfa-code',\n  Cancel = 'cancel-mfa-setup',\n}\n\nexport enum DisableMFAEventOnReceived {\n  MFACodeRequested = 'mfa-code-requested',\n  InvalidMFAOtp = 'invalid-mfa-otp',\n  InvalidRecoveryCode = 'invalid-recovery-code',\n}\n\nexport enum DisableMFAEventEmit {\n  VerifyMFACode = 'verify-mfa-code',\n  LostDevice = 'lost-device',\n  Cancel = 'cancel-mfa-disable',\n}\n\n/**\n * EventHandlers\n */\nexport type LoginWithMagicLinkEventHandlers = {\n  // Event Received\n  [LoginWithMagicLinkEventOnReceived.EmailSent]: () => void;\n  [LoginWithMagicLinkEventOnReceived.EmailNotDeliverable]: () => void;\n\n  // Event sent\n  [LoginWithMagicLinkEventEmit.Retry]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithSmsOTPEventHandlers = {\n  // Event sent\n  [LoginWithSmsOTPEventEmit.VerifySmsOtp]: (otp: string) => void;\n  [LoginWithSmsOTPEventEmit.VerifyMFACode]: (mfa: string) => void;\n  [LoginWithSmsOTPEventEmit.LostDevice]: () => void;\n  [LoginWithSmsOTPEventEmit.VerifyRecoveryCode]: (recoveryCode: string) => void;\n  [LoginWithSmsOTPEventEmit.Cancel]: () => void;\n  [LoginWithSmsOTPEventEmit.Retry]: () => void;\n\n  // Event received\n  [LoginWithSmsOTPEventOnReceived.SmsOTPSent]: () => void;\n  [LoginWithSmsOTPEventOnReceived.InvalidSmsOtp]: () => void;\n  [LoginWithSmsOTPEventOnReceived.ExpiredSmsOtp]: () => void;\n  [LoginWithSmsOTPEventOnReceived.MfaSentHandle]: () => void;\n  [LoginWithSmsOTPEventOnReceived.InvalidMfaOtp]: () => void;\n  [LoginWithSmsOTPEventOnReceived.LoginThrottled]: () => void;\n  [LoginWithSmsOTPEventOnReceived.RecoveryCodeSentHandle]: () => void;\n  [LoginWithSmsOTPEventOnReceived.InvalidRecoveryCode]: () => void;\n  [LoginWithSmsOTPEventOnReceived.RecoveryCodeSuccess]: () => void;\n} & DeviceVerificationEventHandlers;\n\nexport type LoginWithEmailOTPEventHandlers = {\n  // Event Received\n  [LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;\n  [LoginWithEmailOTPEventOnReceived.LoginThrottled]: () => void;\n  [LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;\n  [LoginWithEmailOTPEventOnReceived.InvalidMfaOtp]: () => void;\n  [LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;\n  [LoginWithEmailOTPEventOnReceived.MfaSentHandle]: () => void;\n  [LoginWithEmailOTPEventOnReceived.RecoveryCodeSentHandle]: () => void;\n  [LoginWithEmailOTPEventOnReceived.InvalidRecoveryCode]: () => void;\n  [LoginWithEmailOTPEventOnReceived.RecoveryCodeSuccess]: () => void;\n  [LoginWithEmailOTPEventOnReceived.MaxAttemptsReached]: () => void;\n  [AuthEventOnReceived.IDTokenCreated]: (idToken: string) => void;\n  [WalletEventOnReceived.WalletInfoFetched]: () => void;\n\n  // Event sent\n  [LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;\n  [LoginWithEmailOTPEventEmit.VerifyMFACode]: (mfa: string) => void;\n  [LoginWithEmailOTPEventEmit.LostDevice]: () => void;\n  [LoginWithEmailOTPEventEmit.VerifyRecoveryCode]: (recoveryCode: string) => void;\n  [LoginWithEmailOTPEventEmit.Cancel]: () => void;\n} & DeviceVerificationEventHandlers;\n\ntype DeviceVerificationEventHandlers = {\n  // Event Received\n  [DeviceVerificationEventOnReceived.DeviceNeedsApproval]: () => void;\n  [DeviceVerificationEventOnReceived.DeviceVerificationEmailSent]: () => void;\n  [DeviceVerificationEventOnReceived.DeviceVerificationLinkExpired]: () => void;\n  [DeviceVerificationEventOnReceived.DeviceApproved]: () => void;\n\n  // Event sent\n  [DeviceVerificationEventEmit.Retry]: () => void;\n};\n\n/**\n * Update Email\n */\n\nexport type RecencyCheckEventHandlers = {\n  [RecencyCheckEventOnReceived.PrimaryAuthFactorNeedsVerification]: () => void;\n  [RecencyCheckEventOnReceived.PrimaryAuthFactorVerified]: () => void;\n  [RecencyCheckEventOnReceived.InvalidEmailOtp]: () => void;\n  [RecencyCheckEventOnReceived.EmailNotDeliverable]: () => void;\n  [RecencyCheckEventOnReceived.EmailExpired]: () => void;\n  [RecencyCheckEventOnReceived.EmailSent]: () => void;\n\n  [RecencyCheckEventEmit.Cancel]: () => void;\n  [RecencyCheckEventEmit.Retry]: () => void;\n  [RecencyCheckEventEmit.VerifyEmailOtp]: (otp: string) => void;\n  [RecencyCheckEventEmit.VerifyMFACode]: (mfa: string) => void;\n};\n\nexport type UpdateEmailEventHandlers = {\n  [UpdateEmailEventOnReceived.NewAuthFactorNeedsVerification]: () => void;\n  [UpdateEmailEventOnReceived.EmailUpdated]: () => void;\n  [UpdateEmailEventOnReceived.InvalidEmailOtp]: () => void;\n  [UpdateEmailEventOnReceived.EmailNotDeliverable]: () => void;\n  [UpdateEmailEventOnReceived.EmailExpired]: () => void;\n  [UpdateEmailEventOnReceived.EmailSent]: () => void;\n  [UpdateEmailEventOnReceived.InvalidEmail]: () => void;\n  [UpdateEmailEventOnReceived.EmailAlreadyExists]: () => void;\n\n  [UpdateEmailEventEmit.Cancel]: () => void;\n  [UpdateEmailEventEmit.RetryWithNewEmail]: (email?: string) => void;\n  [UpdateEmailEventEmit.VerifyEmailOtp]: (otp: string) => void;\n} & RecencyCheckEventHandlers;\n\n/**\n * Enable MFA\n */\n\nexport type EnableMFAEventHandlers = {\n  // Event Received\n  [EnableMFAEventOnReceived.MFASecretGenerated]: ({ QRCode, key }: { QRCode: string; key: string }) => void;\n  [EnableMFAEventOnReceived.InvalidMFAOtp]: ({ errorCode }: { errorCode: string }) => void;\n  [EnableMFAEventOnReceived.MFARecoveryCodes]: ({ recoveryCode }: { recoveryCode: string }) => void;\n\n  // Event sent\n  [EnableMFAEventEmit.VerifyMFACode]: (totp: string) => void;\n  [EnableMFAEventEmit.Cancel]: () => void;\n};\n\n/**\n * Disable MFA\n */\n\nexport type DisableMFAEventHandlers = {\n  // Event Received\n  [DisableMFAEventOnReceived.MFACodeRequested]: () => void;\n  [DisableMFAEventOnReceived.InvalidMFAOtp]: ({ errorCode }: { errorCode: string }) => void;\n  [DisableMFAEventOnReceived.InvalidRecoveryCode]: () => void;\n\n  // Event sent\n  [DisableMFAEventEmit.VerifyMFACode]: (totp: string) => void;\n  [DisableMFAEventEmit.LostDevice]: (recoveryCode: string) => void;\n  [DisableMFAEventEmit.Cancel]: () => void;\n};\n", "export type EthNetworkName = 'mainnet' | 'goerli' | 'sepolia';\n\nexport enum EthChainType {\n  Harmony = 'HARMONY',\n}\n\nexport interface CustomNodeConfiguration {\n  rpcUrl: string;\n  chainId?: number;\n  chainType?: EthChainType;\n}\n\nexport type EthNetworkConfiguration = EthNetworkName | CustomNodeConfiguration;\n\nexport type ProviderEnableEvents = {\n  'id-token-created': (params: { idToken: string }) => void;\n};\n", "import { RecencyCheckEventHandlers } from './auth-types';\nimport { DeepLinkPage } from '../core/deep-link-pages';\n\nexport interface GetIdTokenConfiguration {\n  /**\n   * The number of seconds until the generated ID token will expire.\n   */\n  lifespan?: number;\n}\n\nexport interface GenerateIdTokenConfiguration extends GetIdTokenConfiguration {\n  /**\n   * An optional piece of data to sign with the token. Note, however, that the\n   * unsigned data _will not_ be encoded in the token, only an encrypted\n   * signature of the data.\n   */\n  attachment?: string;\n}\n\nexport enum UserEventsEmit {\n  ClosedByUser = 'closed-by-user',\n}\n\nexport enum UserEventsOnReceived {\n  ClosedByUser = 'closed-by-user-on-received',\n}\n\nexport interface ChainWalletInfo {\n  publicAddress: string | null;\n  subAccounts: Array<{ name: string; publicAddress: string }>;\n}\n\nexport interface MagicUserMetadata {\n  issuer: string | null;\n  email: string | null;\n  phoneNumber: string | null;\n  isMfaEnabled: boolean;\n  recoveryFactors: [RecoveryFactor] | [];\n  firstLoginAt: string | null;\n  wallets: {\n    ethereum?: ChainWalletInfo;\n    algorand?: ChainWalletInfo;\n    aptos?: ChainWalletInfo;\n    avalancheX?: ChainWalletInfo;\n    bitcoin?: ChainWalletInfo;\n    conflux?: ChainWalletInfo;\n    cosmos?: ChainWalletInfo;\n    flow?: ChainWalletInfo;\n    harmony?: ChainWalletInfo;\n    hedera?: ChainWalletInfo;\n    icon?: ChainWalletInfo;\n    kadena?: ChainWalletInfo;\n    near?: ChainWalletInfo;\n    polkadot?: ChainWalletInfo;\n    solana?: ChainWalletInfo;\n    sui?: ChainWalletInfo;\n    taquito?: ChainWalletInfo;\n    terra?: ChainWalletInfo;\n    tezos?: ChainWalletInfo;\n    zilliqa?: ChainWalletInfo;\n    [chain: string]: ChainWalletInfo | undefined;\n  };\n}\n\nexport enum RecoveryFactorEventOnReceived {\n  EnterNewPhoneNumber = 'enter-new-phone-number',\n  EnterOtpCode = 'enter-otp-code',\n  RecoveryFactorAlreadyExists = 'recovery-factor-already-exists',\n  MalformedPhoneNumber = 'malformed-phone-number',\n  InvalidOtpCode = 'invalid-otp-code',\n  RecoveryFactorUpdated = 'recovery-factor-updated',\n  RecoveryFactorDeleted = 'recovery-factor-deleted',\n}\n\nexport enum RecoveryFactorEventEmit {\n  SendNewPhoneNumber = 'send-new-phone-number',\n  SendOtpCode = 'send-otp-code',\n  Cancel = 'cancel',\n  StartEditPhoneNumber = 'start-edit-phone-number',\n}\n\ntype RecoveryFactor = {\n  type: RecoveryMethodType;\n  value: string;\n};\n\nexport type RecoveryFactorEventHandlers = {\n  // Event Received\n  [RecoveryFactorEventEmit.SendNewPhoneNumber]: (phone_number: string) => void;\n  [RecoveryFactorEventEmit.SendOtpCode]: (otp: string) => void;\n  [RecoveryFactorEventEmit.StartEditPhoneNumber]: () => void;\n  [RecoveryFactorEventEmit.Cancel]: () => void;\n\n  // Event sent\n  [RecoveryFactorEventOnReceived.EnterNewPhoneNumber]: () => void;\n  [RecoveryFactorEventOnReceived.EnterOtpCode]: () => void;\n  [RecoveryFactorEventOnReceived.RecoveryFactorAlreadyExists]: () => void;\n  [RecoveryFactorEventOnReceived.MalformedPhoneNumber]: () => void;\n  [RecoveryFactorEventOnReceived.InvalidOtpCode]: () => void;\n  [RecoveryFactorEventOnReceived.RecoveryFactorUpdated]: (updatedFactor: { type: string; value: string }) => void;\n  [RecoveryFactorEventOnReceived.RecoveryFactorDeleted]: () => void;\n} & RecencyCheckEventHandlers;\n\nexport enum RecoveryMethodType {\n  PhoneNumber = 'phone_number',\n}\n\nexport interface UpdateEmailConfiguration {\n  /**\n   * The new email address to update to\n   */\n  email: string;\n\n  /**\n   * When `true`, a pre-built pending modal interface will\n   * guide the user to check their new, followed by old emails\n   * for confirmation emails.\n   */\n  showUI?: boolean;\n}\n\nexport interface UpdateWebAuthnInfoConfiguration {\n  /**\n   *  WebAuthn info id\n   */\n  id: string;\n\n  /**\n   *  nickname that user attempts to update to the webauth device associate to the id.\n   */\n  nickname: string;\n}\n\nexport interface RecoverAccountConfiguration {\n  /**\n   * The email to recover\n   */\n  email: string;\n  showUI: boolean;\n}\n\nexport interface ShowSettingsConfiguration {\n  /**\n   * deep linking destination\n   */\n  page: DeepLinkPage;\n  showUI?: boolean;\n}\n\nexport enum RecoverAccountEventOnReceived {\n  SmsOtpSent = 'sms-otp-sent',\n  LoginThrottled = 'login-throttled',\n  InvalidSmsOtp = 'invalid-sms-otp',\n  SmsVerified = 'sms-verified',\n  AccountRecovered = 'account-recovered',\n  UpdateEmailRequired = 'update-email-required',\n}\n\nexport enum RecoverAccountEventEmit {\n  Cancel = 'cancel',\n  VerifyOtp = 'verify-otp-code',\n  ResendSms = 'resend-sms-otp',\n  UpdateEmail = 'update-email',\n}\n\nexport type RecoverAccountEventHandlers = {\n  // Event Received\n  [RecoverAccountEventEmit.Cancel]: () => void;\n  [RecoverAccountEventEmit.VerifyOtp]: (otp: string) => void;\n  [RecoverAccountEventEmit.ResendSms]: () => void;\n  [RecoverAccountEventEmit.UpdateEmail]: (email: string) => void;\n\n  // Event sent\n  [RecoverAccountEventOnReceived.SmsOtpSent]: ({ phoneNumber }: { phoneNumber: string }) => void;\n  [RecoverAccountEventOnReceived.LoginThrottled]: (error: string) => void;\n  [RecoverAccountEventOnReceived.InvalidSmsOtp]: ({\n    errorMessage,\n    errorCode,\n  }: {\n    errorMessage: string;\n    errorCode: string;\n  }) => void;\n  [RecoverAccountEventOnReceived.SmsVerified]: () => void;\n  [RecoverAccountEventOnReceived.AccountRecovered]: () => void;\n  [RecoverAccountEventOnReceived.UpdateEmailRequired]: () => void;\n};\n", "export type NFTResponseStatus = 'cancelled' | 'pending' | 'processed' | 'declined' | 'expired';\n\nexport type NFTResponse = {\n  status: NFTResponseStatus;\n};\n\nexport interface NFTPurchaseRequest {\n  nft: {\n    name: string;\n    imageUrl: string;\n    blockchainNftId: string;\n    contractAddress: string;\n    network: string;\n    platform: string;\n    type: string;\n  };\n  identityPrefill: {\n    firstName: string;\n    lastName: string;\n    dateOfBirth: string; // YYYY-MM-DD\n    emailAddress: string;\n    phone: string;\n    address: {\n      street1: string;\n      street2: string;\n      city: string;\n      regionCode: string;\n      postalCode: string;\n      countryCode: string;\n    };\n  };\n}\n\nexport type NFTPurchaseResponse = NFTResponse & {\n  errorMessage?: string;\n};\n\nexport interface NFTCheckoutRequest {\n  // given by magic / found in the developer dashboard in future\n  contractId: string;\n  // in contract, if ERC1155\u2026 for ERC721, use token ID = 0\n  tokenId: string;\n  name: string;\n  imageUrl: string;\n  quantity?: number; // default is 1\n  walletAddress?: string; // default is user's wallet address\n  // If enabled, the user will be able to pay with crypto. the default is false\n  isCryptoCheckoutEnabled?: boolean;\n  walletProvider?: 'magic' | 'web3modal';\n}\n\nexport type NFTCheckoutResponse = NFTResponse;\n\nexport type NFTCheckoutEvents = {\n  disconnect: () => void;\n  'nft-checkout-initiated': (rawTransaction: string) => void;\n};\n\nexport interface NFTTransferRequest {\n  tokenId: string;\n  contractAddress: string;\n  quantity?: number;\n  recipient?: string;\n}\n\nexport type NFTTransferResponse = NFTResponse;\n\nexport enum NftCheckoutIntermediaryEvents {\n  Success = 'nft-checkout-success',\n  Failure = 'nft-checkout-failure',\n  Initiated = 'nft-checkout-initiated',\n  Disconnect = 'disconnect',\n}\n\nexport type NftCheckoutEventHandler = {\n  [NftCheckoutIntermediaryEvents.Initiated]: (rawTransaction: string) => void;\n  [NftCheckoutIntermediaryEvents.Success]: (signedTransaction: string) => void;\n  [NftCheckoutIntermediaryEvents.Failure]: () => void;\n};\n", "export type AccessListEntry = { address: string; storageKeys: Array<string> };\n\n/**\n *  An ordered collection of [[AccessList]] entries.\n */\nexport type AccessList = Array<AccessListEntry>;\n\nexport enum WalletEventOnReceived {\n  WalletInfoFetched = 'Wallet/wallet-info-fetched',\n}\n\n/**\n * Request parameters for EIP-7702 authorization signing\n */\nexport interface Sign7702AuthorizationRequest {\n  /**\n   * The smart contract implementation address the EOA delegates to\n   */\n  contractAddress: string;\n\n  /**\n   * The chain ID for the network (use 0 for universal cross-chain authorization)\n   */\n  chainId: number;\n\n  /**\n   * The nonce for the EOA account (transaction count)\n   */\n  nonce?: number;\n}\n\n/**\n * Response from EIP-7702 authorization signing\n */\nexport interface Sign7702AuthorizationResponse {\n  /**\n   * The contract address that was authorized\n   */\n  contractAddress: string;\n\n  /**\n   * The chain ID for the authorization\n   */\n  chainId: number;\n\n  /**\n   * The nonce used in the authorization\n   */\n  nonce: number;\n\n  /**\n   * The v component of the signature (recovery id)\n   */\n  v: number;\n\n  /**\n   * The r component of the signature\n   */\n  r: string;\n\n  /**\n   * The s component of the signature\n   */\n  s: string;\n\n  /**\n   * Optional: Full signature as hex string\n   */\n  signature?: string;\n}\n\n/**\n * Request parameters for sending an EIP-7702 transaction with authorization list\n */\nexport interface Send7702TransactionRequest {\n  /**\n   * The recipient address\n   */\n  to: string;\n\n  /**\n   * The value to send in wei (as hex string)\n   */\n  value?: string;\n\n  /**\n   * The transaction data (calldata)\n   */\n  data?: string;\n\n  /**\n   * Gas limit for the transaction (as hex string)\n   */\n  gas?: string;\n\n  /**\n   * Gas limit for the transaction (alias for gas)\n   */\n  gasLimit?: string;\n\n  /**\n   * Maximum fee per gas for EIP-1559 transactions (as hex string)\n   */\n  maxFeePerGas?: string;\n\n  /**\n   * Maximum priority fee per gas for EIP-1559 transactions (as hex string)\n   */\n  maxPriorityFeePerGas?: string;\n\n  /**\n   * Transaction nonce (if not provided, will be fetched from network)\n   */\n  nonce?: number;\n\n  /**\n   * The list of signed EIP-7702 authorizations to include in the transaction\n   */\n  authorizationList: Sign7702AuthorizationResponse[];\n}\n\n/**\n * Response from sending an EIP-7702 transaction\n */\nexport interface Send7702TransactionResponse {\n  /**\n   * The transaction hash\n   */\n  transactionHash: string;\n}\n", "export enum UiEventsEmit {\n  CloseMagicWindow = 'close-magic-window',\n}\n", "// Shared MFA events reused by both popup and redirect flows\nexport enum OAuthMFAEventEmit {\n  Cancel = 'cancel',\n  VerifyMFACode = 'verify-mfa-code',\n  LostDevice = 'lost-device',\n  VerifyRecoveryCode = 'verify-recovery-code',\n}\n\nexport enum OAuthMFAEventOnReceived {\n  MfaSentHandle = 'mfa-sent-handle',\n  InvalidMfaOtp = 'invalid-mfa-otp',\n  RecoveryCodeSentHandle = 'recovery-code-sent-handle',\n  InvalidRecoveryCode = 'invalid-recovery-code',\n  RecoveryCodeSuccess = 'recovery-code-success',\n}\n\ntype OAuthMFAEventHandlers = {\n  // Event sent\n  [OAuthMFAEventEmit.Cancel]: () => void;\n  [OAuthMFAEventEmit.VerifyMFACode]: (mfa: string) => void;\n  [OAuthMFAEventEmit.LostDevice]: () => void;\n  [OAuthMFAEventEmit.VerifyRecoveryCode]: (recoveryCode: string) => void;\n  // Event Received\n  [OAuthMFAEventOnReceived.MfaSentHandle]: () => void;\n  [OAuthMFAEventOnReceived.InvalidMfaOtp]: () => void;\n  [OAuthMFAEventOnReceived.RecoveryCodeSentHandle]: () => void;\n  [OAuthMFAEventOnReceived.InvalidRecoveryCode]: () => void;\n  [OAuthMFAEventOnReceived.RecoveryCodeSuccess]: () => void;\n};\n\n// Popup-specific events\nexport enum OAuthPopupEventOnReceived {\n  PopupUrl = 'popup-url',\n}\n\nexport enum OAuthPopupEventEmit {\n  PopupEvent = 'popup-event',\n}\n\nexport type OAuthPopupEventHandlers = {\n  [OAuthPopupEventEmit.PopupEvent]: (eventData: unknown) => void;\n  [OAuthPopupEventOnReceived.PopupUrl]: (event: { popupUrl: string; provider: string }) => void;\n} & OAuthMFAEventHandlers;\n\n// Redirect-specific handler type\nexport type OAuthGetResultEventHandlers = OAuthMFAEventHandlers;\n", "import CryptoJS from 'crypto-js';\n\nconst HAS_BUILT_IN_CRYPTO = typeof window !== 'undefined' && !!window.crypto;\n\nfunction bytesToOAuth2CompatibleString(bytes: Uint8Array): string {\n  const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n  return Array.from(bytes)\n    .map((value) => charset[value % charset.length])\n    .join('');\n}\n\nfunction createRandomString(size: number): string {\n  if (!HAS_BUILT_IN_CRYPTO) {\n    throw new Error('Secure random number generation is not available in this environment. PKCE requires crypto.getRandomValues.');\n  }\n  const bytes = new Uint8Array(size);\n  window.crypto.getRandomValues(bytes);\n  return bytesToOAuth2CompatibleString(bytes);\n}\n\nfunction verifierToBase64URL(input: CryptoJS.lib.WordArray): string {\n  return input.toString(CryptoJS.enc.Base64).replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\nexport function createCryptoChallenge(): { codeVerifier: string; codeChallenge: string; cryptoChallengeState: string } {\n  const cryptoChallengeState = createRandomString(128);\n  const codeVerifier = createRandomString(128);\n  const codeChallenge = verifierToBase64URL(CryptoJS.SHA256(codeVerifier));\n  return { codeVerifier, codeChallenge, cryptoChallengeState };\n}\n"],
  "mappings": "AAAA,OAAS,oBAAAA,GAAkB,aAAAC,OAAiB,sBCErC,IAAKC,OACVA,EAAA,MAAQ,wCACRA,EAAA,OAAS,yCACTA,EAAA,MAAQ,+BACRA,EAAA,mBAAqB,mCAJXA,OAAA,IAmIAC,OACVA,EAAA,eAAiB,kBACjBA,EAAA,cAAgB,iBAChBA,EAAA,aAAe,gBACfA,EAAA,aAAe,gBACfA,EAAA,mBAAqB,sBACrBA,EAAA,wBAA0B,4BAC1BA,EAAA,qBAAuB,yBACvBA,EAAA,qBAAuB,yBACvBA,EAAA,aAAe,gBACfA,EAAA,YAAc,eACdA,EAAA,uBAAyB,0BAXfA,OAAA,ICrIL,IAAKC,GAAAA,IACVA,EAAA,cAAgB,kBAChBA,EAAA,cAAgB,kBAChBA,EAAA,eAAiB,sBACjBA,EAAA,kBAAoB,qBACpBA,EAAA,gBAAkB,mBAClBA,EAAA,wBAA0B,4BAC1BA,EAAA,uBAAyB,0BAPfA,IAAAA,GAAA,CAAA,CAAA,EAUAC,GAAAA,IACVA,EAAA,eAAiB,mBACjBA,EAAA,gBAAkB,mBAClBA,EAAA,iCAAmC,sCACnCA,EAAA,kBAAoB,qBACpBA,EAAA,oBAAsB,eALZA,IAAAA,GAAA,CAAA,CAAA,EAQAC,GAAAA,IAEVA,EAAAA,EAAA,WAAa,MAAA,EAAb,aACAA,EAAAA,EAAA,eAAiB,MAAA,EAAjB,iBACAA,EAAAA,EAAA,eAAiB,MAAA,EAAjB,iBACAA,EAAAA,EAAA,cAAgB,MAAA,EAAhB,gBACAA,EAAAA,EAAA,cAAgB,MAAA,EAAhB,gBA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c,CAClD,OAASsB,EAAmB,CAC1B,QAAQ,IAAI,sCAAuCA,CAAiB,CACtE,CACF,CACF,OAASC,EAAoB,CAC3B,QAAQ,IAAI,8CAA+CA,CAAkB,CAC/E,CACF,CAEQ,qBAAqB1B,EAG3B,CACA,IAAImB,EAAmB,GAEjBQ,EAAkB,eAAe,QAAQ1C,CAAgB,EACzD2C,EAAgB,aAAa,QAAQ3C,CAAgB,EAC3D,eAAe,WAAWA,CAAgB,EAC1C,aAAa,WAAWA,CAAgB,EAKxC,IAAMmC,EAAiBO,EAClB,KAAK,MAAMA,CAAe,EAC3BC,EACG,KAAK,MAAMA,CAAa,EACzB,OAKN,GAAIR,EAAgB,CAClB,IAAMS,EAAgB,IAAI,gBAAgB7B,CAAW,EAAE,IAAI,OAAO,GAC9D,CAAC6B,GAAiBA,IAAkBT,EAAe,SACrDD,EAAmB,GAEvB,CAEA,MAAO,CAAE,eAAAC,EAAgB,iBAAAD,CAAiB,CAC5C,CACF",
  "names": ["createPromiEvent", "Extension", "OAuthPayloadMethods", "OAuthErrorCode", "SDKErrorCode", "SDKWarningCode", "RPCErrorCode", "LocalStorageKeys", "ThirdPartyWalletEvents", "MagicPayloadMethod", "MagicIncomingWindowMessage", "MagicOutgoingWindowMessage", "DeepLinkPage", "LoginWithMagicLinkEventEmit", "LoginWithMagicLinkEventOnReceived", "LoginWithEmailOTPEventEmit", "LoginWithSmsOTPEventEmit", "LoginWithSmsOTPEventOnReceived", "LoginWithEmailOTPEventOnReceived", "DeviceVerificationEventEmit", "DeviceVerificationEventOnReceived", "RecencyCheckEventEmit", "RecencyCheckEventOnReceived", "UpdateEmailEventEmit", "UpdateEmailEventOnReceived", "AuthEventOnReceived", "FarcasterLoginEventEmit", "EnableMFAEventOnReceived", "EnableMFAEventEmit", "DisableMFAEventOnReceived", "DisableMFAEventEmit", "EthChainType", "UserEventsEmit", "UserEventsOnReceived", "RecoveryFactorEventOnReceived", "RecoveryFactorEventEmit", "RecoveryMethodType", "RecoverAccountEventOnReceived", "RecoverAccountEventEmit", "NftCheckoutIntermediaryEvents", "WalletEventOnReceived", "UiEventsEmit", "OAuthMFAEventEmit", "OAuthMFAEventOnReceived", "OAuthPopupEventOnReceived", "OAuthPopupEventEmit", "CryptoJS", "HAS_BUILT_IN_CRYPTO", "bytesToOAuth2CompatibleString", "bytes", "charset", "value", "createRandomString", "size", "verifierToBase64URL", "input", "createCryptoChallenge", "cryptoChallengeState", "codeVerifier", "codeChallenge", "PKCE_STORAGE_KEY", "OAuthExtension", "Extension", "configuration", "resolve", "reject", "codeVerifier", "codeChallenge", "cryptoChallengeState", "createCryptoChallenge", "parseRedirectResult", "result", "successResult", "errorResult", "redirectURI", "queryString", "urlWithoutQuery", "showMfaModal", "requestPayload", "promiEvent", "createPromiEvent", "oauthPopupRequest", "redirectEvent", "event", "ee", "K", "popupUrl", "Z", "maybeResult", "maybeError", "error", "X", "mfa", "recoveryCode", "hasStateMismatch", "clientMetadata", "getResultRequest", "resultOrError", "script", "userData", "verificationError", "seamlessLoginError", "storedInSession", "storedInLocal", "returnedState"]
}
