{"version":3,"sources":["../src/index.ts","../src/frame-specs.ts","../src/return-url.ts","../src/frame-view.tsx","../src/frame-component.tsx","../src/frame-engine.ts","../src/webview-transport.ts","../src/provider.tsx","../src/methods/add-card.ts","../src/methods/apple-pay.ts","../src/methods/auth.ts","../src/methods/buy.ts","../src/methods/buy-button.ts","../src/methods/challenge.ts","../src/methods/connect.ts","../src/methods/connection-check.ts","../src/methods/connection-reset.ts","../src/methods/customer-export.ts","../src/methods/google-pay.ts","../src/methods/widget.ts","../src/client.ts","../src/methods/mount-session.ts","../src/VisibleFrameSlotSheet.tsx","../src/sheet-presentation.ts","../src/components/add-card.tsx","../src/components/apple-pay-button.tsx","../src/components/auth.tsx","../src/components/buy-button.tsx","../src/components/buy-frame.tsx","../src/components/challenge.tsx","../src/components/connect.tsx","../src/components/connection-check.tsx","../src/components/connection-reset.tsx","../src/components/customer-export.tsx","../src/components/google-pay-button.tsx","../src/components/widget.tsx"],"sourcesContent":["// Re-export commonly used protocol types for convenience\n\nexport type {\n  AssetStatus,\n  Attestation,\n  GetQuoteParams,\n  ListAssetsResponse,\n  ListPaymentMethodsResponse,\n  PaginationInfo,\n  PaymentDisclosure,\n  PaymentDisclosureId,\n  PaymentMethodConfig,\n  PaymentMethodType,\n  PlatformAsset,\n  Quote,\n  SimulateBankTransferOutcome,\n  SimulateBankTransferParams,\n  SimulateSenderBankAccount,\n  StoredCardPaymentMethod,\n  StoredPaymentMethod,\n  Transaction,\n  TransactionWithStages,\n} from '@moonpay/platform-protocol/api';\nexport type { Customer } from '@moonpay/platform-protocol/api/customer';\nexport type { EnterpriseQuote } from '@moonpay/platform-protocol/api/enterprise';\n// Frame-level types used in event payloads\nexport type { CardResponse } from '@moonpay/platform-protocol/frames/add-card';\nexport type { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';\nexport type {\n  Cancellation as ChallengeCancellation,\n  CompleteResult as ChallengeCompleteResult,\n  ErrorCode as ChallengeErrorCode,\n  ResolvedResult as ChallengeResolvedResult,\n} from '@moonpay/platform-protocol/frames/challenge';\nexport type { GooglePayButtonSettings } from '@moonpay/platform-protocol/frames/google-pay';\nexport type { Connection } from '@moonpay/platform-protocol/models/connection';\nexport { ConnectionStatus, UnavailableReason } from '@moonpay/platform-protocol/models/connection';\nexport type { Result } from '@moonpay/platform-protocol/result';\n// SDK-facing event types — re-exported under their partner-facing names\nexport type {\n  Event as AddCardEvent,\n  SetupError as SetupAddCardError,\n} from '@moonpay/platform-protocol/sdks/add-card';\nexport type {\n  Event as ApplePayEvent,\n  SetupError as SetupApplePayError,\n} from '@moonpay/platform-protocol/sdks/apple-pay';\nexport type {\n  Event as AuthEvent,\n  SetupError as SetupAuthError,\n} from '@moonpay/platform-protocol/sdks/auth';\nexport type {\n  Event as BuyEvent,\n  SetupError as SetupBuyError,\n} from '@moonpay/platform-protocol/sdks/buy';\nexport type {\n  Event as BuyButtonEvent,\n  SetupError as SetupBuyButtonError,\n} from '@moonpay/platform-protocol/sdks/buy-button';\nexport type {\n  Event as ChallengeEvent,\n  SetupError as SetupChallengeError,\n} from '@moonpay/platform-protocol/sdks/challenge';\nexport type { Event as ConnectEvent } from '@moonpay/platform-protocol/sdks/connect';\nexport type {\n  Event as CustomerExportEvent,\n  SetupError as SetupCustomerExportError,\n} from '@moonpay/platform-protocol/sdks/customer-export';\nexport type {\n  Event as GooglePayEvent,\n  SetupError as SetupGooglePayError,\n} from '@moonpay/platform-protocol/sdks/google-pay';\nexport type {\n  Event as WidgetEvent,\n  SetupError as SetupWidgetError,\n} from '@moonpay/platform-protocol/sdks/widget';\nexport type {\n  Credentials,\n  CustomTheme,\n  GetCredentialsError,\n  GetPaymentMethodsParams,\n  HexColor,\n  ListAssetsParams,\n  ThemeOptions,\n} from '@moonpay/platform-sdk-core';\nexport type { RNClient, RNEnterpriseClient } from './client.js';\n// Inline frame components — render frames wherever you place them\nexport { MoonPayAddCard, type MoonPayAddCardProps } from './components/add-card.js';\nexport {\n  MoonPayApplePayButton,\n  type MoonPayApplePayButtonProps,\n} from './components/apple-pay-button.js';\nexport { MoonPayAuth, type MoonPayAuthProps } from './components/auth.js';\nexport { MoonPayBuyButton, type MoonPayBuyButtonProps } from './components/buy-button.js';\nexport { MoonPayBuyFrame, type MoonPayBuyFrameProps } from './components/buy-frame.js';\nexport { MoonPayChallenge, type MoonPayChallengeProps } from './components/challenge.js';\nexport { MoonPayConnect, type MoonPayConnectProps } from './components/connect.js';\nexport {\n  MoonPayConnectionCheck,\n  type MoonPayConnectionCheckProps,\n} from './components/connection-check.js';\nexport {\n  MoonPayConnectionReset,\n  type MoonPayConnectionResetProps,\n} from './components/connection-reset.js';\nexport {\n  MoonPayCustomerExport,\n  type MoonPayCustomerExportProps,\n} from './components/customer-export.js';\nexport {\n  MoonPayGooglePayButton,\n  type MoonPayGooglePayButtonProps,\n} from './components/google-pay-button.js';\nexport { MoonPayWidget, type MoonPayWidgetProps } from './components/widget.js';\nexport {\n  MoonPayFrame,\n  type MoonPayFrameProps,\n} from './frame-component.js';\nexport type { ConnectionCheckEvent, ConnectionResetEvent } from './frame-specs.js';\nexport type { AddCardFrame, SetupAddCardOptions } from './methods/add-card.js';\nexport type { ApplePayFrame, SetupApplePayOptions } from './methods/apple-pay.js';\nexport type { AuthFrame, SetupAuthOptions } from './methods/auth.js';\nexport type { BuyFrame, SetupBuyOptions } from './methods/buy.js';\nexport type { BuyButtonFrame, SetupBuyButtonOptions } from './methods/buy-button.js';\nexport type { ChallengeFrame, SetupChallengeOptions } from './methods/challenge.js';\nexport type { ConnectFrame, ConnectOptions } from './methods/connect.js';\nexport type { GetConnectionOptions } from './methods/connection-check.js';\nexport type {\n  CustomerExportFrame,\n  SetupCustomerExportOptions,\n} from './methods/customer-export.js';\nexport type { GooglePayFrame, SetupGooglePayOptions } from './methods/google-pay.js';\nexport type { SetupWidgetOptions, WidgetFrame } from './methods/widget.js';\nexport {\n  MoonPayEnterpriseProvider,\n  type MoonPayEnterpriseProviderProps,\n  MoonPayProvider,\n  type MoonPayProviderProps,\n  useMoonPay,\n  useMoonPayEnterprise,\n} from './provider.js';\nexport { WebViewTransport } from './webview-transport.js';\n","import type * as AddCardFrame from '@moonpay/platform-protocol/frames/add-card';\nimport type * as ApplePayFrame from '@moonpay/platform-protocol/frames/apple-pay';\nimport type * as AuthFrame from '@moonpay/platform-protocol/frames/auth';\nimport type * as BuyFrame from '@moonpay/platform-protocol/frames/buy';\nimport type * as BuyButtonFrame from '@moonpay/platform-protocol/frames/buy-button';\nimport type * as ChallengeFrame from '@moonpay/platform-protocol/frames/challenge';\nimport type * as ConnectFrame from '@moonpay/platform-protocol/frames/connect';\nimport type * as CustomerExportFrame from '@moonpay/platform-protocol/frames/customer-export';\nimport type * as GooglePayFrame from '@moonpay/platform-protocol/frames/google-pay';\nimport type * as WidgetFrame from '@moonpay/platform-protocol/frames/widget';\nimport type { Connection } from '@moonpay/platform-protocol/models/connection';\nimport {\n  ConnectionErrorCode,\n  ConnectionStatus,\n} from '@moonpay/platform-protocol/models/connection';\nimport type { FrameTransaction } from '@moonpay/platform-protocol/models/transaction';\nimport type { ProtocolMessage } from '@moonpay/platform-protocol/protocol';\nimport type * as AddCardSdk from '@moonpay/platform-protocol/sdks/add-card';\nimport type * as ApplePaySdk from '@moonpay/platform-protocol/sdks/apple-pay';\nimport type * as AuthSdk from '@moonpay/platform-protocol/sdks/auth';\nimport type * as BuySdk from '@moonpay/platform-protocol/sdks/buy';\nimport type * as BuyButtonSdk from '@moonpay/platform-protocol/sdks/buy-button';\nimport type * as ChallengeSdk from '@moonpay/platform-protocol/sdks/challenge';\nimport type * as ConnectSdk from '@moonpay/platform-protocol/sdks/connect';\nimport type * as CustomerExportSdk from '@moonpay/platform-protocol/sdks/customer-export';\nimport type * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';\nimport type * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';\nimport {\n  applyClientTokenParam,\n  applyPresentationParam,\n  applyResumeParam,\n  decryptCredentials,\n  FRAME_PATHS,\n  isAuthResult,\n  type PresentationMode,\n  presentationParams,\n  type ThemeOptions,\n  themeParams,\n} from '@moonpay/platform-sdk-core';\nimport type { EffectContext, FrameSpec, SpecContext } from './frame-engine.js';\nimport { isValidReturnUrl } from './return-url.js';\n\n// ---------------------------------------------------------------------------\n// Shared commands\n// ---------------------------------------------------------------------------\n\nexport interface QuoteCommands {\n  /** Push a fresh quote signature into the frame (e.g. after expiry). */\n  setQuote(signature: string): void;\n}\n\nexport function createQuoteCommands(\n  send: (msg: ProtocolMessage) => void,\n  channelId: string,\n): QuoteCommands {\n  return {\n    setQuote: (signature) =>\n      send({\n        version: 2,\n        meta: { channelId },\n        kind: 'setQuote',\n        payload: { quote: { signature } },\n      }),\n  };\n}\n\n// ---------------------------------------------------------------------------\n// Apple Pay button\n// ---------------------------------------------------------------------------\n\nexport interface ApplePayProps {\n  quote: string;\n  externalTransactionId?: string;\n  applePayButtonSettings?: ApplePayFrame.ApplePayButtonSettings;\n  presentation?: PresentationMode;\n}\n\nexport const applePaySpec: FrameSpec<ApplePaySdk.Event, ApplePayProps, QuoteCommands> = {\n  channelPrefix: 'applepay',\n  path: FRAME_PATHS.applePay,\n  hidden: false,\n  buildParams: (ctx, props) => ({\n    clientToken: ctx.core.context.clientToken,\n    signature: props.quote,\n    ...(props.externalTransactionId && { externalTransactionId: props.externalTransactionId }),\n    ...(props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings }),\n    ...presentationParams(props.presentation),\n  }),\n  createCommands: createQuoteCommands,\n  reactiveProps: {\n    quote: (commands, quote) => commands.setQuote(quote),\n  },\n  mapMessage: (msg, commands) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'buttonPressed':\n        return { kind: 'buttonPressed' };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as { transaction: FrameTransaction } };\n      case 'challenge':\n        return {\n          kind: 'challenge',\n          payload: msg.payload as ApplePayFrame.InboundMessageMap['challenge'],\n        };\n      case 'cancelled':\n        return {\n          kind: 'cancelled',\n          payload: msg.payload as ApplePayFrame.InboundMessageMap['cancelled'],\n        };\n      case 'error': {\n        const payload = msg.payload as ApplePayFrame.InboundMessageMap['error'];\n        if (payload.code === 'quoteExpired') {\n          return { kind: 'quoteExpired', payload: { setQuote: commands.setQuote } };\n        }\n        if (payload.code === 'applePayUnavailable') {\n          return { kind: 'unsupported' };\n        }\n        const kind = payload.code === 'generic' ? 'genericError' : payload.code;\n        return { kind: 'error', payload: { kind, message: payload.message } };\n      }\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({ kind: 'error', payload: { kind: 'genericError', message } }),\n};\n\n// ---------------------------------------------------------------------------\n// Google Pay button\n// ---------------------------------------------------------------------------\n\nexport interface GooglePayProps {\n  quote: string;\n  externalTransactionId?: string;\n  presentation?: PresentationMode;\n}\n\nexport const googlePaySpec: FrameSpec<GooglePaySdk.Event, GooglePayProps, QuoteCommands> = {\n  channelPrefix: 'googlepay',\n  path: FRAME_PATHS.googlePay,\n  hidden: false,\n  buildParams: (ctx, props) => ({\n    clientToken: ctx.core.context.clientToken,\n    signature: props.quote,\n    ...(props.externalTransactionId && { externalTransactionId: props.externalTransactionId }),\n    ...presentationParams(props.presentation),\n  }),\n  createCommands: createQuoteCommands,\n  reactiveProps: {\n    quote: (commands, quote) => commands.setQuote(quote),\n  },\n  mapMessage: (msg, commands) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'buttonPressed':\n        return { kind: 'buttonPressed' };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as { transaction: FrameTransaction } };\n      case 'challenge':\n        return {\n          kind: 'challenge',\n          payload: msg.payload as GooglePayFrame.InboundMessageMap['challenge'],\n        };\n      case 'cancelled':\n        return {\n          kind: 'cancelled',\n          payload: msg.payload as GooglePayFrame.InboundMessageMap['cancelled'],\n        };\n      case 'error': {\n        const payload = msg.payload as GooglePayFrame.InboundMessageMap['error'];\n        if (payload.code === 'quoteExpired') {\n          return { kind: 'quoteExpired', payload: { setQuote: commands.setQuote } };\n        }\n        if (payload.code === 'googlePayUnavailable') {\n          return { kind: 'unsupported' };\n        }\n        const kind = payload.code === 'generic' ? 'genericError' : payload.code;\n        return { kind: 'error', payload: { kind, message: payload.message } };\n      }\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({ kind: 'error', payload: { kind: 'genericError', message } }),\n};\n\n// ---------------------------------------------------------------------------\n// Buy button\n// ---------------------------------------------------------------------------\n\nexport interface BuyButtonProps {\n  quote: string;\n  externalTransactionId?: string;\n  applePayButtonSettings?: ApplePayFrame.ApplePayButtonSettings;\n  googlePayButtonSettings?: GooglePayFrame.GooglePayButtonSettings;\n  presentation?: PresentationMode;\n  /** The partner app's link back from another app a payment method opens. Mount-time only. */\n  linkReturnUrl?: string;\n}\n\nfunction buyButtonParams(ctx: SpecContext, props: BuyButtonProps): Record<string, unknown> {\n  if (props.linkReturnUrl !== undefined && !isValidReturnUrl(props.linkReturnUrl)) {\n    throw new Error('linkReturnUrl must be an absolute URL, for example myapp://moonpay-return');\n  }\n  return {\n    clientToken: ctx.core.context.clientToken,\n    signature: props.quote,\n    ...(props.externalTransactionId && { externalTransactionId: props.externalTransactionId }),\n    ...(props.applePayButtonSettings && { applePayButtonSettings: props.applePayButtonSettings }),\n    ...(props.googlePayButtonSettings && {\n      googlePayButtonSettings: props.googlePayButtonSettings,\n    }),\n    ...(props.linkReturnUrl && { linkReturnUrl: props.linkReturnUrl }),\n    ...presentationParams(props.presentation),\n  };\n}\n\nexport const buyButtonSpec: FrameSpec<BuyButtonSdk.Event, BuyButtonProps, QuoteCommands> = {\n  channelPrefix: 'buy-button',\n  path: FRAME_PATHS.buyButton,\n  enterprise: true,\n  hidden: false,\n  buildParams: (ctx, props) => buyButtonParams(ctx, props),\n  createCommands: createQuoteCommands,\n  reactiveProps: {\n    quote: (commands, quote) => commands.setQuote(quote),\n  },\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'buttonPressed':\n        return { kind: 'buttonPressed' };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as BuyButtonFrame.MessageMap['complete'] };\n      case 'challenge':\n        return {\n          kind: 'challenge',\n          payload: msg.payload as BuyButtonFrame.MessageMap['challenge'],\n        };\n      case 'resolved':\n        return { kind: 'resolved', payload: msg.payload as BuyButtonFrame.MessageMap['resolved'] };\n      case 'cancelled':\n        return {\n          kind: 'cancelled',\n          payload: msg.payload as BuyButtonFrame.MessageMap['cancelled'],\n        };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as BuyButtonFrame.MessageMap['error'] };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: 'generic', message } as BuyButtonFrame.MessageMap['error'],\n  }),\n};\n\n/**\n * Buy button in headless mode: a hidden frame with no button that processes\n * the quote on load. Replaces the deprecated buy frame.\n */\nexport const headlessBuyButtonSpec: FrameSpec<BuyButtonSdk.Event, BuyButtonProps, QuoteCommands> = {\n  ...buyButtonSpec,\n  hidden: true,\n  buildParams: (ctx, props) => ({\n    ...buyButtonParams(ctx, props),\n    headless: true,\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Credential side-effect (connect / auth / check-connection)\n// ---------------------------------------------------------------------------\n\n/**\n * On a credential-bearing `complete`, decrypt the delivered credentials with\n * the session's private key and store them on the shared client context.\n * Runs before event fan-out so partners see tokens already applied.\n *\n * `connectionRequired` carries encrypted anonymous tokens — storing the\n * `clientToken` is what makes `setupAuth()` / `<MoonPayAuth>` and other\n * pre-connect flows possible without a full connect flow (mirrors the web SDK).\n */\nexport function applyCredentialsOnComplete(msg: ProtocolMessage, ctx: EffectContext): void {\n  if (msg.kind !== 'complete' || !ctx.privateKey) return;\n  const connection = msg.payload as Connection;\n  if (\n    connection.status !== ConnectionStatus.active &&\n    connection.status !== ConnectionStatus.pending &&\n    connection.status !== ConnectionStatus.connectionRequired\n  ) {\n    return;\n  }\n  // The type declares `credentials` as required, but the payload arrives over\n  // postMessage — guard so a frame that omits it (e.g. anonymous tokens not\n  // issued for this partner) degrades to \"no tokens stored\" instead of a\n  // throw that would swallow the `complete` event entirely.\n  if (!connection.credentials) return;\n  const creds = decryptCredentials(connection.credentials, ctx.privateKey);\n  ctx.core.context.setAccessToken(creds.accessToken);\n  ctx.core.context.setClientToken(creds.clientToken);\n}\n\n// ---------------------------------------------------------------------------\n// Session-token guard\n// ---------------------------------------------------------------------------\n\n/**\n * Check-connection is the only frame that takes the raw `sessionToken`. When\n * the provider was mounted without one (and `initialize()` hasn't run yet),\n * fail with a clear, actionable message instead of building a frame URL with\n * `sessionToken=undefined`. Mirrors how `authSpec` guards `clientToken`.\n */\nfunction requireSessionToken(ctx: SpecContext): string {\n  if (!ctx.sessionToken) {\n    throw new Error(\n      'No session token — pass sessionToken to <MoonPayProvider> or call initialize() from useMoonPay() before starting a connection.',\n    );\n  }\n  return ctx.sessionToken;\n}\n\n// ---------------------------------------------------------------------------\n// Check-connection (hidden)\n// ---------------------------------------------------------------------------\n\nexport interface ConnectionCheckProps {\n  skipKyc?: boolean;\n}\n\nexport type ConnectionCheckEvent =\n  | { kind: 'complete'; payload: Connection }\n  | { kind: 'error'; payload: { message: string } };\n\nexport const connectionCheckSpec: FrameSpec<ConnectionCheckEvent, ConnectionCheckProps> = {\n  channelPrefix: 'check',\n  path: FRAME_PATHS.checkConnection,\n  hidden: true,\n  needsKeyPair: true,\n  handshakeTimeout: 10_000,\n  buildParams: (ctx, props, publicKey) => ({\n    sessionToken: requireSessionToken(ctx),\n    publicKey,\n    ...(props.skipKyc && { skipKyc: true }),\n  }),\n  onMessageEffect: applyCredentialsOnComplete,\n  mapMessage: (msg) => {\n    if (msg.kind === 'complete') {\n      return { kind: 'complete', payload: msg.payload as Connection };\n    }\n    if (msg.kind === 'error') {\n      return { kind: 'error', payload: msg.payload as { message: string } };\n    }\n    return null;\n  },\n  errorEvent: (message) => ({ kind: 'error', payload: { message } }),\n};\n\n// ---------------------------------------------------------------------------\n// Connect (visible)\n// ---------------------------------------------------------------------------\n\nexport interface ConnectProps {\n  theme?: ThemeOptions;\n  presentation?: PresentationMode;\n}\n\nexport const connectSpec: FrameSpec<ConnectSdk.Event, ConnectProps> = {\n  channelPrefix: 'connect',\n  path: FRAME_PATHS.connect,\n  hidden: false,\n  needsKeyPair: true,\n  buildParams: (ctx, props, publicKey) => {\n    const clientToken = ctx.core.context.clientToken;\n    if (!clientToken) {\n      throw new Error(\n        'No clientToken in context — call getConnection() first and ensure it resolved with status \"connectionRequired\".',\n      );\n    }\n    return {\n      clientToken,\n      publicKey,\n      // Per-call override; `applyThemeParam` in the engine fills the client\n      // default for connect (and every other visible frame) when this is absent.\n      ...themeParams(props.theme),\n      ...presentationParams(props.presentation),\n    };\n  },\n  onMessageEffect: applyCredentialsOnComplete,\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as ConnectFrame.MessageMap['error'] };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as ConnectFrame.MessageMap['complete'] };\n      case 'close':\n        return { kind: 'close' };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: ConnectionErrorCode.connectionFailedGeneric, message },\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Auth (visible)\n// ---------------------------------------------------------------------------\n\nexport interface AuthProps {\n  presentation?: PresentationMode;\n}\n\nexport const authSpec: FrameSpec<AuthSdk.Event, AuthProps> = {\n  channelPrefix: 'auth',\n  path: FRAME_PATHS.auth,\n  hidden: false,\n  needsKeyPair: true,\n  buildParams: (ctx, props, publicKey) => {\n    const clientToken = ctx.core.context.clientToken;\n    if (!clientToken) {\n      throw new Error(\n        'No clientToken in context — call getConnection() first and ensure it resolved with status \"connectionRequired\".',\n      );\n    }\n    return { clientToken, publicKey, ...presentationParams(props.presentation) };\n  },\n  onMessageEffect: applyCredentialsOnComplete,\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as AuthFrame.MessageMap['error'] };\n      case 'complete': {\n        const connection = msg.payload as Connection;\n        return isAuthResult(connection) ? { kind: 'complete', payload: connection } : null;\n      }\n      case 'close':\n        return { kind: 'close' };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: ConnectionErrorCode.connectionFailedGeneric, message },\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Widget (visible)\n// ---------------------------------------------------------------------------\n\nexport interface WidgetProps {\n  quote: string;\n  externalTransactionId?: string;\n  presentation?: PresentationMode;\n}\n\nexport const widgetSpec: FrameSpec<WidgetSdk.Event, WidgetProps> = {\n  channelPrefix: 'widget',\n  path: FRAME_PATHS.widget,\n  hidden: false,\n  buildParams: (ctx, props) => ({\n    flow: 'buy',\n    clientToken: ctx.core.context.clientToken,\n    quoteSignature: props.quote,\n    ...(props.externalTransactionId && { externalTransactionId: props.externalTransactionId }),\n    ...presentationParams(props.presentation),\n  }),\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'transactionCreated':\n        return {\n          kind: 'transactionCreated',\n          payload: msg.payload as WidgetFrame.MessageMap['transactionCreated'],\n        };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as { transaction: FrameTransaction } };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as WidgetFrame.MessageMap['error'] };\n      case 'close':\n        return { kind: 'close' };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: 'generic', message } as WidgetFrame.MessageMap['error'],\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Buy (hidden, headless)\n// Deprecated: use `headlessBuyButtonSpec`. Not available to enterprise clients.\n// ---------------------------------------------------------------------------\n\nexport interface BuyProps {\n  quote: string;\n  externalTransactionId?: string;\n}\n\nexport const buySpec: FrameSpec<BuySdk.Event, BuyProps, QuoteCommands> = {\n  channelPrefix: 'buy',\n  path: FRAME_PATHS.buy,\n  hidden: true,\n  buildParams: (ctx, props) => ({\n    clientToken: ctx.core.context.clientToken,\n    signature: props.quote,\n    ...(props.externalTransactionId && { externalTransactionId: props.externalTransactionId }),\n  }),\n  createCommands: createQuoteCommands,\n  reactiveProps: {\n    quote: (commands, quote) => commands.setQuote(quote),\n  },\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as BuyFrame.MessageMap['complete'] };\n      case 'challenge':\n        return { kind: 'challenge', payload: msg.payload as BuyFrame.MessageMap['challenge'] };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as BuyFrame.MessageMap['error'] };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: 'generic', message } as BuyFrame.MessageMap['error'],\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Add card (visible)\n// ---------------------------------------------------------------------------\n\nexport interface AddCardProps {\n  presentation?: PresentationMode;\n}\n\nexport const addCardSpec: FrameSpec<AddCardSdk.Event, AddCardProps> = {\n  channelPrefix: 'add-card',\n  path: FRAME_PATHS.addCard,\n  enterprise: true,\n  hidden: false,\n  buildParams: (ctx, props) => ({\n    clientToken: ctx.core.context.clientToken,\n    ...presentationParams(props.presentation),\n  }),\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'complete':\n        return {\n          kind: 'complete',\n          payload: msg.payload as { card: AddCardFrame.CardResponse },\n        };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as AddCardFrame.MessageMap['error'] };\n      case 'close':\n        return { kind: 'close' };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: 'generic', message } as AddCardFrame.MessageMap['error'],\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Customer export (visible)\n// ---------------------------------------------------------------------------\n\nexport interface CustomerExportProps {\n  presentation?: PresentationMode;\n}\n\nexport const customerExportSpec: FrameSpec<CustomerExportSdk.Event, CustomerExportProps> = {\n  channelPrefix: 'customer-export',\n  path: FRAME_PATHS.customerExport,\n  hidden: false,\n  buildParams: (ctx, props) => ({\n    clientToken: ctx.core.context.clientToken,\n    ...presentationParams(props.presentation),\n  }),\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'complete':\n        return {\n          kind: 'complete',\n          payload: msg.payload as CustomerExportFrame.MessageMap['complete'],\n        };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as CustomerExportFrame.MessageMap['error'] };\n      case 'close':\n        return { kind: 'close' };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: ConnectionErrorCode.connectionFailedGeneric, message },\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Challenge (visible; URL comes from a frame's `challenge` event, or a\n// quote's `challenge` field for guest-checkout limit upgrade)\n// ---------------------------------------------------------------------------\n\nexport interface ChallengeProps {\n  /** `clientToken` is attached automatically when the client holds one — do not add it yourself. */\n  url: string;\n  presentation?: PresentationMode;\n  /** Opt in to the Apple Pay / Google Pay hand-back (`resume=true`). */\n  resume?: boolean;\n}\n\nexport const challengeSpec: FrameSpec<ChallengeSdk.Event, ChallengeProps> = {\n  channelPrefix: 'challenge',\n  path: FRAME_PATHS.challenge, // documentation only — buildUrl below wins\n  enterprise: true,\n  hidden: false,\n  resolveChannelId: (props, generated) =>\n    new URL(props.url).searchParams.get('channelId') || generated,\n  buildUrl: (ctx, props, channelId) => {\n    const url = new URL(props.url);\n    url.searchParams.set('channelId', channelId);\n    return applyResumeParam(\n      applyClientTokenParam(\n        applyPresentationParam(url.toString(), props.presentation),\n        ctx.core.context.clientToken,\n      ),\n      props.resume,\n    );\n  },\n  mapMessage: (msg) => {\n    switch (msg.kind) {\n      case 'ready':\n        return { kind: 'ready' };\n      case 'buttonPressed':\n        return { kind: 'buttonPressed' };\n      case 'complete':\n        return { kind: 'complete', payload: msg.payload as ChallengeFrame.CompleteResult };\n      case 'resolved':\n        return { kind: 'resolved', payload: msg.payload as ChallengeFrame.ResolvedResult };\n      case 'cancelled':\n        return { kind: 'cancelled', payload: msg.payload as ChallengeFrame.Cancellation };\n      case 'error':\n        return { kind: 'error', payload: msg.payload as ChallengeFrame.MessageMap['error'] };\n      default:\n        return null;\n    }\n  },\n  errorEvent: (message) => ({\n    kind: 'error',\n    payload: { code: 'generic', message } as ChallengeFrame.MessageMap['error'],\n  }),\n};\n\n// ---------------------------------------------------------------------------\n// Reset connection (hidden, headless)\n// ---------------------------------------------------------------------------\n\nexport type ConnectionResetProps = Record<string, never>;\n\nexport type ConnectionResetEvent =\n  | { kind: 'complete' }\n  | { kind: 'error'; payload: { message: string } };\n\nexport const connectionResetSpec: FrameSpec<ConnectionResetEvent, ConnectionResetProps> = {\n  channelPrefix: 'reset',\n  path: FRAME_PATHS.reset,\n  hidden: true,\n  handshakeTimeout: 5_000,\n  // The reset frame is authorized by the connect-flow `clientToken` (or an\n  // apiKey), not the raw sessionToken — see the Reset frame reference. It\n  // carries no session of its own. Attached automatically from context; when\n  // absent the frame simply fails to load and reset resolves as a no-op.\n  buildParams: (ctx) => ({ clientToken: ctx.core.context.clientToken }),\n  mapMessage: (msg) => {\n    if (msg.kind === 'complete') return { kind: 'complete' };\n    if (msg.kind === 'error') {\n      const payload = msg.payload as { message?: string };\n      return { kind: 'error', payload: { message: payload?.message ?? 'Reset failed' } };\n    }\n    return null;\n  },\n  errorEvent: (message) => ({ kind: 'error', payload: { message } }),\n};\n","const MAX_URL_LENGTH = 2048;\nconst UNSAFE_RETURN_URL_SCHEMES = new Set(['javascript', 'data', 'file', 'vbscript', 'blob']);\n\n/**\n * True when `value` is an absolute URL with a scheme that cannot run script.\n * Partners pass their own return link, often a custom scheme (`myapp://...`).\n */\nexport function isValidReturnUrl(value: unknown): value is string {\n  if (typeof value !== 'string' || value.length > MAX_URL_LENGTH) return false;\n  const scheme = /^([a-z][a-z0-9+.-]*):\\S+$/i.exec(value)?.[1];\n  return scheme !== undefined && !UNSAFE_RETURN_URL_SCHEMES.has(scheme.toLowerCase());\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport type { WebViewProps } from 'react-native-webview';\nimport { MoonPayFrame } from './frame-component.js';\nimport {\n  createFrameSession,\n  type FrameSession,\n  type FrameSessionHandle,\n  type FrameSpec,\n} from './frame-engine.js';\nimport { useFrameHostContext } from './provider.js';\nimport type { RNFrameTransport } from './webview-transport.js';\n\nexport interface MoonPayFrameViewProps<E, P, C> {\n  spec: FrameSpec<E, P, C>;\n  /** Frame props. Keys declared in the spec's `reactiveProps` update the live frame via commands; all other keys remount the frame on change. */\n  props: P;\n  style?: ViewStyle;\n  defaultStyle: ViewStyle;\n  onEvent?: (event: E) => void;\n  /** Advanced WebView props forwarded to the underlying MoonPayFrame. */\n  webViewProps?: Partial<WebViewProps>;\n  /**\n   * Called with the underlying WebView instance once it mounts, and with `null`\n   * on unmount. Lets callers inject JS into the frame.\n   */\n  onRef?: (webView: WebView | null) => void;\n}\n\n/**\n * Push the latest value of each changed reactive prop into the live session,\n * recording what was applied so unchanged values never re-send commands.\n */\nfunction applyReactiveProps<E, P, C>(\n  spec: FrameSpec<E, P, C>,\n  keys: (keyof P)[],\n  props: P,\n  applied: Partial<P>,\n  handle: FrameSessionHandle<E, C>,\n): void {\n  for (const key of keys) {\n    const next = props[key];\n    if (next !== undefined && next !== applied[key]) {\n      spec.reactiveProps?.[key]?.(handle.commands, next as NonNullable<P[typeof key]>);\n      applied[key] = next;\n    }\n  }\n}\n\n/**\n * Shared inline mount target for frame sessions. Renders the WebView exactly\n * where the partner places this component; the engine handles everything else.\n */\nexport function MoonPayFrameView<E, P, C>({\n  spec,\n  props,\n  style,\n  defaultStyle,\n  onEvent,\n  webViewProps,\n  onRef,\n}: MoonPayFrameViewProps<E, P, C>): JSX.Element | null {\n  const frameHost = useFrameHostContext();\n  const { sessionToken, enterpriseClientToken, core, frameBaseUrl } = frameHost;\n  const [transport, setTransport] = useState<RNFrameTransport | null>(null);\n  const handleRef = useRef<FrameSessionHandle<E, C> | null>(null);\n  const onEventRef = useRef(onEvent);\n  onEventRef.current = onEvent;\n  const propsRef = useRef(props);\n  propsRef.current = props;\n\n  // Split props by the spec's reactiveProps declaration: reactive keys update\n  // the live session via commands; everything else remounts the frame.\n  const reactiveKeys = Object.keys(spec.reactiveProps ?? {}) as (keyof P)[];\n  const mountProps: Partial<P> = {};\n  const liveProps: Partial<P> = {};\n  for (const [key, value] of Object.entries(props as Record<string, unknown>)) {\n    const k = key as keyof P;\n    (reactiveKeys.includes(k) ? liveProps : mountProps)[k] = value as P[keyof P];\n  }\n  const mountKey = JSON.stringify(mountProps);\n  const liveKey = JSON.stringify(liveProps);\n\n  // Tracks the last applied reactive values, seeded at mount.\n  const appliedRef = useRef<Partial<P>>({});\n\n  // biome-ignore lint/correctness/useExhaustiveDependencies: mountKey encodes the props that should remount\n  useEffect(() => {\n    let disposed = false;\n    let session: FrameSession<E, C>;\n    // Snapshot the reactive values the session is created with.\n    const applied: Partial<P> = {};\n    for (const key of reactiveKeys) {\n      applied[key] = propsRef.current[key];\n    }\n    appliedRef.current = applied;\n\n    try {\n      session = createFrameSession(spec, frameHost, propsRef.current);\n    } catch (e) {\n      onEventRef.current?.(\n        spec.errorEvent(e instanceof Error ? e.message : 'Failed to create frame'),\n      );\n      return;\n    }\n\n    setTransport(session.transport);\n\n    session.ready\n      .then((handle) => {\n        if (disposed) {\n          handle.dispose();\n          return;\n        }\n        handleRef.current = handle;\n        handle.onEvent((event) => onEventRef.current?.(event));\n        // Apply reactive props that changed while the handshake was in flight\n        applyReactiveProps(spec, reactiveKeys, propsRef.current, appliedRef.current, handle);\n      })\n      .catch((e: unknown) => {\n        if (!disposed) {\n          onEventRef.current?.(\n            spec.errorEvent(e instanceof Error ? e.message : 'Frame handshake failed'),\n          );\n        }\n      });\n\n    return () => {\n      disposed = true;\n      handleRef.current = null;\n      session.dispose();\n      setTransport(null);\n    };\n  }, [mountKey, spec, sessionToken, enterpriseClientToken, core, frameBaseUrl]);\n\n  // Reactive props → commands (no remount). Skipped while the handshake is\n  // pending; the ready handler above applies the latest values.\n  // biome-ignore lint/correctness/useExhaustiveDependencies: liveKey encodes the reactive prop values\n  useEffect(() => {\n    const handle = handleRef.current;\n    if (!handle) return;\n    applyReactiveProps(spec, reactiveKeys, propsRef.current, appliedRef.current, handle);\n  }, [liveKey]);\n\n  if (spec.hidden) {\n    return transport ? (\n      <MoonPayFrame transport={transport} hidden webViewProps={webViewProps} onRef={onRef} />\n    ) : null;\n  }\n\n  const resolvedStyle: ViewStyle = { ...defaultStyle, ...style };\n  return (\n    <View style={resolvedStyle}>\n      {transport ? (\n        <MoonPayFrame transport={transport} webViewProps={webViewProps} onRef={onRef} />\n      ) : null}\n    </View>\n  );\n}\n","import { useEffect, useRef } from 'react';\nimport { View, type ViewStyle } from 'react-native';\nimport WebView, { type WebViewMessageEvent, type WebViewProps } from 'react-native-webview';\nimport type { RNFrameTransport } from './webview-transport.js';\n\n/**\n * Origins the frame WebView is allowed to load. Includes `about:srcdoc` because\n * MoonPay frame pages render their content in an inner `<iframe srcdoc>`; without\n * it, react-native-webview delegates that navigation to Linking and the frame\n * never renders (\"Can't open url: about:srcdoc\").\n */\nconst DEFAULT_ORIGIN_WHITELIST = ['https://*', 'http://*', 'about:srcdoc'];\n\nexport interface MoonPayFrameProps {\n  /** The transport instance managing this frame's communication. */\n  transport: RNFrameTransport;\n  /** Whether this is a hidden utility frame (zero height). */\n  hidden?: boolean;\n  /** Optional style overrides for the container view. */\n  style?: ViewStyle;\n  /**\n   * Advanced: extra props forwarded to the underlying react-native-webview.\n   * `ref`, `source`, and `onMessage` are managed by the SDK and cannot be\n   * overridden; all other props (including `originWhitelist`) may be set here.\n   */\n  webViewProps?: Partial<WebViewProps>;\n  /**\n   * Called with the underlying WebView instance once it mounts, and with `null`\n   * on unmount. Lets callers inject JS into the frame (e.g. `injectJavaScript`).\n   */\n  onRef?: (webView: WebView | null) => void;\n}\n\n/**\n * Reusable React Native component that renders a MoonPay frame as a WebView.\n * Bridges the WebViewTransport to the actual WebView instance.\n */\nexport function MoonPayFrame({\n  transport,\n  hidden,\n  style,\n  webViewProps,\n  onRef,\n}: MoonPayFrameProps): JSX.Element | null {\n  const webViewRef = useRef<WebView>(null);\n\n  useEffect(() => {\n    transport.attachWebView(webViewRef);\n    return () => {\n      // Don't dispose — the orchestrator manages lifecycle\n    };\n  }, [transport]);\n\n  useEffect(() => {\n    onRef?.(webViewRef.current);\n    return () => onRef?.(null);\n  }, [onRef]);\n\n  const url = transport.url;\n  if (!url) return null;\n\n  const handleMessage = (event: WebViewMessageEvent) => {\n    transport.handleWebViewMessage(event.nativeEvent.data);\n  };\n\n  const containerStyle: ViewStyle = hidden\n    ? { width: 0, height: 0, overflow: 'hidden' }\n    : { flex: 1, ...style };\n\n  return (\n    <View style={containerStyle}>\n      <WebView\n        originWhitelist={DEFAULT_ORIGIN_WHITELIST}\n        allowsInlineMediaPlayback\n        javaScriptEnabled\n        domStorageEnabled\n        paymentRequestEnabled\n        style={{ flex: 1 }}\n        {...webViewProps}\n        ref={webViewRef}\n        source={{ uri: url }}\n        onMessage={handleMessage}\n      />\n    </View>\n  );\n}\n","import type { ProtocolMessage } from '@moonpay/platform-protocol/protocol';\nimport {\n  applyThemeParam,\n  buildFrameUrl,\n  type CoreClient,\n  createFrameOrchestrator,\n  generateKeyPair,\n  isSecureRandomAvailable,\n  type ThemeOptions,\n} from '@moonpay/platform-sdk-core';\nimport { type RNFrameTransport, WebViewTransport } from './webview-transport.js';\n\n/**\n * Thrown before key generation when the runtime lacks Web Crypto. React Native\n * (Hermes) has no `crypto.getRandomValues`; the integrator must install a\n * polyfill at app entry. Surfaced via each frame's error event / Result.\n */\nexport const CRYPTO_UNAVAILABLE_MESSAGE =\n  'MoonPay SDK: crypto.getRandomValues is unavailable. React Native (Hermes) has no Web Crypto. ' +\n  'Install and register a Web Crypto getRandomValues polyfill on the global before using the SDK — ' +\n  'Expo: expo-crypto; bare React Native: react-native-get-random-values. ' +\n  'See https://dev.moonpay.com/platform/sdk-reference/react-native/overview.';\n\n/** Shared dependencies every frame needs to build its URL and apply effects. */\nexport interface SpecContext {\n  /**\n   * Session token from the partner's server. Optional because the provider can\n   * be mounted before one is available (see `initialize()` in the provider);\n   * only the check-connection, connect, and reset frames consume it, and they\n   * guard for its absence via `requireSessionToken`.\n   */\n  sessionToken?: string;\n  core: CoreClient;\n  frameBaseUrl?: string;\n  /** Client-level theme applied to every visible frame (provider-wide default). */\n  theme?: ThemeOptions;\n  /**\n   * Enterprise client token (set by `MoonPayEnterpriseProvider`). When set,\n   * only frames marked `enterprise` can be created.\n   */\n  enterpriseClientToken?: string;\n}\n\n/** Context passed to `onMessageEffect`; includes the session's private key when one was generated. */\nexport interface EffectContext extends SpecContext {\n  privateKey?: string;\n}\n\n/**\n * Declarative description of a frame type. Everything that differs between\n * frames lives here; `createFrameSession` provides everything that doesn't.\n */\nexport interface FrameSpec<E, P, C = undefined> {\n  /** Channel id prefix, e.g. 'applepay' → 'applepay-<timestamp>'. */\n  channelPrefix: string;\n  /** FRAME_PATHS entry. Ignored when `buildUrl` is provided. */\n  path: string;\n  /** Available to enterprise clients (`MoonPayEnterpriseProvider`). */\n  enterprise?: boolean;\n  /** Render hidden (0×0 utility frame)? */\n  hidden: boolean;\n  /** Generate an X25519 key pair for encrypted credential delivery. */\n  needsKeyPair?: boolean;\n  /** Handshake timeout override in ms (orchestrator default: 15_000). */\n  handshakeTimeout?: number;\n  /** Query params for the frame URL (channelId is added automatically). */\n  buildParams?(ctx: SpecContext, props: P, publicKey?: string): Record<string, unknown>;\n  /** Derive the channel id from props (challenge reads it from the partner URL). May throw. */\n  resolveChannelId?(props: P, generated: string): string;\n  /** Full URL override (challenge). May throw on invalid input. */\n  buildUrl?(ctx: SpecContext, props: P, channelId: string, publicKey?: string): string;\n  /** Map a protocol message to an SDK event, or null to ignore it. */\n  mapMessage(msg: ProtocolMessage, commands: C): E | null;\n  /** Side effect on incoming messages (e.g. credential decryption). Runs before event fan-out. */\n  onMessageEffect?(msg: ProtocolMessage, ctx: EffectContext): void;\n  /** Outbound commands exposed on the session handle (e.g. setQuote). */\n  createCommands?(send: (msg: ProtocolMessage) => void, channelId: string): C;\n  /** Wrap a failure (handshake timeout, invalid props) as this frame's error event. */\n  errorEvent(message: string): E;\n  /**\n   * Props that update a live session through commands instead of remounting\n   * the frame. Each entry maps a prop key to the command invocation that\n   * applies its new value. Props not listed here remount the frame on change.\n   */\n  reactiveProps?: { [K in keyof P]?: (commands: C, value: NonNullable<P[K]>) => void };\n}\n\nexport interface FrameSessionHandle<E, C = undefined> {\n  /** Subscribe to mapped SDK events. Returns an unsubscribe function. */\n  onEvent(handler: (event: E) => void): () => void;\n  /** Subscribe to raw post-handshake protocol messages. */\n  onMessage(handler: (msg: ProtocolMessage) => void): () => void;\n  /**\n   * Subscribe to session teardown. Fires exactly once, from any dispose path\n   * (the handle's own `dispose()` or the session-level one — e.g. the user\n   * dismissing an SDK-presented frame). Returns an unsubscribe function.\n   */\n  onDispose(handler: () => void): () => void;\n  sendMessage(msg: ProtocolMessage): void;\n  commands: C;\n  dispose(): void;\n}\n\nexport interface FrameSession<E, C = undefined> {\n  transport: RNFrameTransport;\n  channelId: string;\n  url: string;\n  hidden: boolean;\n  /** Resolves after the handshake; rejects on timeout. */\n  ready: Promise<FrameSessionHandle<E, C>>;\n  /** Tear down the session at any point — safe to call before the handshake completes. */\n  dispose(): void;\n}\n\nexport interface CreateFrameSessionOverrides {\n  createTransport?: () => RNFrameTransport;\n  handshakeTimeout?: number;\n}\n\n/**\n * Rejection reason for `FrameSession.ready` when the session is disposed\n * before the handshake completes (e.g. the user dismisses an SDK-presented\n * frame while it is still loading). Callers awaiting `ready` can distinguish\n * this from a handshake timeout or setup failure.\n */\nexport class FrameSessionDisposedError extends Error {\n  constructor() {\n    super('Frame session disposed');\n    this.name = 'FrameSessionDisposedError';\n  }\n}\n\n/**\n * Create a frame session: URL, transport, handshake, typed events, commands.\n * Does NOT decide where the WebView renders — the caller mounts\n * `session.transport` in a provider slot or an inline component.\n *\n * May throw synchronously if the spec's `resolveChannelId`/`buildUrl`\n * rejects the props (e.g. an invalid challenge URL).\n */\nexport function createFrameSession<E, P, C = undefined>(\n  spec: FrameSpec<E, P, C>,\n  ctx: SpecContext,\n  props: P,\n  overrides: CreateFrameSessionOverrides = {},\n): FrameSession<E, C> {\n  if (ctx.enterpriseClientToken && !spec.enterprise) {\n    throw new Error(`The ${spec.channelPrefix} frame is not available for enterprise clients`);\n  }\n  const generated = `${spec.channelPrefix}-${Date.now()}`;\n  const channelId = spec.resolveChannelId ? spec.resolveChannelId(props, generated) : generated;\n  let keyPair: ReturnType<typeof generateKeyPair> | undefined;\n  if (spec.needsKeyPair) {\n    if (!isSecureRandomAvailable()) throw new Error(CRYPTO_UNAVAILABLE_MESSAGE);\n    keyPair = generateKeyPair();\n  }\n\n  const builtUrl = spec.buildUrl\n    ? spec.buildUrl(ctx, props, channelId, keyPair?.publicKey)\n    : buildFrameUrl(\n        spec.path,\n        { ...spec.buildParams?.(ctx, props, keyPair?.publicKey), channelId },\n        { frameBaseUrl: ctx.frameBaseUrl },\n      );\n  // Inject the client-level theme into every visible frame. Hidden utility\n  // frames have no UI, so they stay param-clean; `applyThemeParam` leaves a\n  // per-frame theme (e.g. connect's own option) untouched if already present.\n  const url = spec.hidden ? builtUrl : applyThemeParam(builtUrl, ctx.theme);\n\n  const transport = (overrides.createTransport ?? (() => new WebViewTransport()))();\n\n  let resolvedHandle: FrameSessionHandle<E, C> | null = null;\n\n  // Settles `ready` immediately when the session is disposed pre-handshake —\n  // without this, callers awaiting `ready` would only learn of the teardown\n  // when the orchestrator's handshake timer fires (up to 15s later), and as\n  // the wrong error.\n  let rejectDisposed: ((error: Error) => void) | undefined;\n  const disposedBeforeReady = new Promise<never>((_, reject) => {\n    rejectDisposed = reject;\n  });\n\n  const handleReady = createFrameOrchestrator({\n    transport,\n    channelId,\n    url,\n    container: null,\n    hidden: spec.hidden,\n    handshakeTimeout: overrides.handshakeTimeout ?? spec.handshakeTimeout ?? 15_000,\n  }).then((handle): FrameSessionHandle<E, C> => {\n    const send = (msg: ProtocolMessage) => handle.sendMessage(msg);\n    const commands = spec.createCommands?.(send, channelId) as C;\n    const eventHandlers: Array<(event: E) => void> = [];\n    const disposeHandlers: Array<() => void> = [];\n    let disposeNotified = false;\n    const notifyDisposed = () => {\n      if (disposeNotified) return;\n      disposeNotified = true;\n      for (const handler of [...disposeHandlers]) {\n        handler();\n      }\n    };\n\n    handle.onMessage((msg) => {\n      let event: E | null;\n      try {\n        spec.onMessageEffect?.(msg, { ...ctx, privateKey: keyPair?.privateKey });\n        event = spec.mapMessage(msg, commands);\n      } catch (e) {\n        // A throwing effect or mapper (e.g. credential decryption on a\n        // corrupt payload) would otherwise propagate into the transport's\n        // catch-all and silently drop this message — the partner would see\n        // nothing and request/response methods would only fail by timeout.\n        // Surface it as the frame's error event instead.\n        event = spec.errorEvent(e instanceof Error ? e.message : 'Failed to process frame message');\n      }\n      if (event !== null) {\n        for (const handler of [...eventHandlers]) {\n          handler(event);\n        }\n      }\n    });\n\n    const sessionHandle: FrameSessionHandle<E, C> = {\n      onEvent(handler) {\n        eventHandlers.push(handler);\n        return () => {\n          const idx = eventHandlers.indexOf(handler);\n          if (idx >= 0) eventHandlers.splice(idx, 1);\n        };\n      },\n      onMessage: (handler) => handle.onMessage(handler),\n      onDispose(handler) {\n        disposeHandlers.push(handler);\n        return () => {\n          const idx = disposeHandlers.indexOf(handler);\n          if (idx >= 0) disposeHandlers.splice(idx, 1);\n        };\n      },\n      sendMessage: send,\n      commands,\n      dispose: () => {\n        handle.dispose();\n        notifyDisposed();\n      },\n    };\n    resolvedHandle = sessionHandle;\n    return sessionHandle;\n  });\n\n  const ready = Promise.race([handleReady, disposedBeforeReady]);\n\n  // Suppress unhandled-rejection for callers that abandon the promise (e.g. early dispose).\n  ready.catch(() => {});\n\n  return {\n    transport,\n    channelId,\n    url,\n    hidden: spec.hidden,\n    ready,\n    dispose: () => {\n      if (resolvedHandle) {\n        resolvedHandle.dispose();\n      } else {\n        // Pre-ready: reject `ready` now so awaiting callers settle immediately.\n        // The orchestrator's handshake timer still fires later, harmlessly\n        // re-disposing the transport; its rejection is already handled above.\n        transport.dispose();\n        rejectDisposed?.(new FrameSessionDisposedError());\n      }\n    },\n  };\n}\n","import type { ProtocolMessage } from '@moonpay/platform-protocol/protocol';\nimport {\n  type FrameOptions,\n  type FrameTransport,\n  isTrustedFrameUrl,\n} from '@moonpay/platform-sdk-core';\nimport type { RefObject } from 'react';\nimport type WebView from 'react-native-webview';\n\n/**\n * Transport surface the RN SDK passes around internally. `WebViewTransport`\n * is the production implementation; tests substitute fakes.\n */\nexport interface RNFrameTransport extends FrameTransport {\n  readonly url: string;\n  readonly options: FrameOptions | null;\n  attachWebView(ref: RefObject<WebView | null>): void;\n  handleWebViewMessage(data: string): void;\n}\n\n/**\n * FrameTransport implementation for React Native using react-native-webview.\n *\n * Unlike the web IframeTransport, the WebView is rendered declaratively via\n * React components. This transport bridges the imperative FrameTransport\n * interface to a WebView ref.\n */\nexport class WebViewTransport implements RNFrameTransport {\n  private webViewRef: RefObject<WebView | null> | null = null;\n  private handlers: Array<(msg: ProtocolMessage) => void> = [];\n  private _url: string = '';\n  private _options: FrameOptions | null = null;\n\n  /** Called by the frame component when it mounts the WebView. */\n  attachWebView(ref: RefObject<WebView | null>): void {\n    this.webViewRef = ref;\n  }\n\n  /** Called by the WebView's onMessage prop to route incoming messages. */\n  handleWebViewMessage(data: string): void {\n    try {\n      const msg: ProtocolMessage = JSON.parse(data);\n      if (!msg.kind) return;\n      for (const handler of this.handlers) {\n        handler(msg);\n      }\n    } catch {\n      // Ignore non-protocol messages\n    }\n  }\n\n  get url(): string {\n    return this._url;\n  }\n\n  get options(): FrameOptions | null {\n    return this._options;\n  }\n\n  // FrameTransport interface\n\n  create(url: string, options: FrameOptions): void {\n    if (!isTrustedFrameUrl(url)) {\n      throw new Error('Refusing to load frame: URL is not a trusted MoonPay origin');\n    }\n\n    this._url = url;\n    this._options = options;\n    // The actual WebView rendering is handled by React components.\n    // This method stores the URL and options for the component to read.\n  }\n\n  sendMessage(message: ProtocolMessage): void {\n    if (!this.webViewRef?.current) {\n      throw new Error('Cannot send message: WebView not attached');\n    }\n    // Use the WebView ref's `postMessage` command rather than injecting\n    // `window.postMessage`. The native command dispatches a MessageEvent with\n    // `source === null` on `document` (Android) / `window` (iOS) — exactly what\n    // the frame's receiver requires. An injected `window.postMessage` fires\n    // only on `window` with a non-null `source`, so the frame drops it (missed\n    // entirely on Android, rejected by the source guard on iOS).\n    this.webViewRef.current.postMessage(JSON.stringify(message));\n  }\n\n  onMessage(handler: (msg: ProtocolMessage) => void): () => void {\n    this.handlers.push(handler);\n    return () => {\n      const idx = this.handlers.indexOf(handler);\n      if (idx >= 0) this.handlers.splice(idx, 1);\n    };\n  }\n\n  dispose(): void {\n    this.handlers.length = 0;\n    this.webViewRef = null;\n    this._url = '';\n    this._options = null;\n  }\n}\n","import { type CoreClient, createClientCore, type ThemeOptions } from '@moonpay/platform-sdk-core';\nimport {\n  createContext,\n  type ReactNode,\n  useCallback,\n  useContext,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\nimport {\n  createRNClient,\n  createRNEnterpriseClient,\n  type RNClient,\n  type RNEnterpriseClient,\n} from './client.js';\nimport { MoonPayFrame } from './frame-component.js';\nimport type { SpecContext } from './frame-engine.js';\nimport { createMountSession, type FrameSlot } from './methods/mount-session.js';\nimport { VisibleFrameSlotSheet } from './VisibleFrameSlotSheet.js';\nimport { WebViewTransport } from './webview-transport.js';\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\n/**\n * Frame-building state shared by both providers. Consumed by the inline frame\n * components so they work under `MoonPayProvider` and `MoonPayEnterpriseProvider`.\n */\nconst FrameHostContext = createContext<SpecContext | null>(null);\n\ninterface MoonPayContextValue {\n  client: RNClient;\n  /** Set or replace the session token after mount. */\n  initialize: (sessionToken: string) => void;\n  /** True once a session token (via prop or `initialize()`) is available. */\n  isInitialized: boolean;\n}\n\nconst MoonPayContext = createContext<MoonPayContextValue | null>(null);\n\ninterface MoonPayEnterpriseContextValue {\n  client: RNEnterpriseClient;\n}\n\nconst MoonPayEnterpriseContext = createContext<MoonPayEnterpriseContextValue | null>(null);\n\n// ---------------------------------------------------------------------------\n// Frame slots — shared by both providers\n// ---------------------------------------------------------------------------\n\nfunction useFrameSlots(): {\n  frameSlots: FrameSlot[];\n  addSlot: (slot: FrameSlot) => void;\n  removeSlot: (id: string) => void;\n} {\n  const [frameSlots, setFrameSlots] = useState<FrameSlot[]>([]);\n\n  // Stable refs for addSlot/removeSlot so client methods don't re-create\n  const addSlot = useCallback((slot: FrameSlot) => {\n    setFrameSlots((prev) => [...prev, slot]);\n  }, []);\n\n  const removeSlot = useCallback((id: string) => {\n    setFrameSlots((prev) => prev.filter((s) => s.id !== id));\n  }, []);\n\n  return { frameSlots, addSlot, removeSlot };\n}\n\n/** Keep a single core client per provider instance, stable across renders. */\nfunction useCore(apiBaseUrl?: string, frameBaseUrl?: string): CoreClient {\n  const coreRef = useRef<CoreClient | null>(null);\n  if (!coreRef.current) {\n    coreRef.current = createClientCore({\n      apiBaseUrl,\n      frameBaseUrl,\n      createTransport: () => new WebViewTransport(),\n    });\n  }\n  return coreRef.current;\n}\n\nfunction FrameSlots({\n  frameSlots,\n  removeSlot,\n}: {\n  frameSlots: FrameSlot[];\n  removeSlot: (id: string) => void;\n}): JSX.Element {\n  return (\n    <>\n      {/* Hidden utility frames (check, buy, reset) — zero layout impact. */}\n      {frameSlots\n        .filter((slot) => slot.hidden)\n        .map((slot) => (\n          <MoonPayFrame key={slot.id} transport={slot.transport} hidden />\n        ))}\n      {/* SDK-presented frames take over the screen as a bottom sheet. One per\n          slot — later frames (e.g. a challenge over a widget) stack on top.\n          Dismissal (Android back, tapping the dimmed backdrop) stops the\n          method's pending events, mirroring a customer abandoning the flow. */}\n      {frameSlots\n        .filter((slot) => !slot.hidden)\n        .map((slot) => (\n          <VisibleFrameSlotSheet\n            key={slot.id}\n            slot={slot}\n            onClose={() => {\n              slot.dispose();\n              removeSlot(slot.id);\n            }}\n          />\n        ))}\n    </>\n  );\n}\n\n// ---------------------------------------------------------------------------\n// Provider\n// ---------------------------------------------------------------------------\n\nexport interface MoonPayProviderProps {\n  /**\n   * Session token from your server (via `createSession`). Optional — omit it and\n   * call `initialize(sessionToken)` from `useMoonPay()` once you've fetched it.\n   * When provided, this prop takes precedence over an imperatively-set token.\n   */\n  sessionToken?: string;\n  apiBaseUrl?: string;\n  frameBaseUrl?: string;\n  /** Theme applied to every visible MoonPay frame (connect, widget, Apple/Google Pay, …). */\n  theme?: ThemeOptions;\n  children: ReactNode;\n}\n\n/** A value-stable memo key for a theme, so inline theme objects don't churn the client. */\nfunction themeDependencyKey(theme: ThemeOptions | undefined): string | undefined {\n  return theme ? JSON.stringify(theme) : undefined;\n}\n\nexport function MoonPayProvider({\n  sessionToken: sessionTokenProp,\n  apiBaseUrl,\n  frameBaseUrl,\n  theme,\n  children,\n}: MoonPayProviderProps): JSX.Element {\n  const { frameSlots, addSlot, removeSlot } = useFrameSlots();\n\n  // Token supplied imperatively via initialize(). The prop takes precedence\n  // when set, so controlled-prop and imperative usage both work; the effective\n  // token below is the single source of truth for the client and frames.\n  const [internalToken, setInternalToken] = useState<string | undefined>(undefined);\n  const sessionToken = sessionTokenProp ?? internalToken;\n\n  const core = useCore(apiBaseUrl, frameBaseUrl);\n\n  // Set (or replace) the session token after mount. Clearing any credentials\n  // from a previous session prevents a token swap (e.g. account switch) from\n  // reusing the prior customer's accessToken/clientToken before the next\n  // getConnection() repopulates them.\n  const initialize = useCallback(\n    (token: string) => {\n      core.context.setAccessToken('');\n      core.context.setClientToken('');\n      setInternalToken(token);\n    },\n    [core],\n  );\n\n  // Depend on the theme's serialized value (not the object) so an inline\n  // `theme={{ ... }}` prop doesn't re-create the client every render.\n  const themeKey = themeDependencyKey(theme);\n  // biome-ignore lint/correctness/useExhaustiveDependencies: theme is captured via themeKey\n  const specCtx = useMemo<SpecContext>(\n    () => ({ sessionToken, core, frameBaseUrl, theme }),\n    [sessionToken, core, frameBaseUrl, themeKey],\n  );\n\n  const client = useMemo<RNClient>(\n    () =>\n      createRNClient({\n        mountSession: createMountSession(specCtx, { addSlot, removeSlot }),\n        core,\n      }),\n    [specCtx, core, addSlot, removeSlot],\n  );\n\n  const isInitialized = sessionToken !== undefined;\n\n  return (\n    <FrameHostContext.Provider value={specCtx}>\n      <MoonPayContext.Provider value={{ client, initialize, isInitialized }}>\n        {children}\n        <FrameSlots frameSlots={frameSlots} removeSlot={removeSlot} />\n      </MoonPayContext.Provider>\n    </FrameHostContext.Provider>\n  );\n}\n\nexport interface MoonPayEnterpriseProviderProps {\n  /** Client token from your server. Authorizes every enterprise frame. */\n  clientToken: string;\n  frameBaseUrl?: string;\n  /** Theme applied to every visible MoonPay frame. */\n  theme?: ThemeOptions;\n  children: ReactNode;\n}\n\n/**\n * Provider for enterprise integrations. Exposes only the payment frames —\n * `<MoonPayBuyButton>` (including `headless`), `<MoonPayAddCard>`,\n * `<MoonPayChallenge>` and their `setupX` methods via `useMoonPayEnterprise()`.\n * Other frame components emit an error event saying they're unavailable.\n */\nexport function MoonPayEnterpriseProvider({\n  clientToken,\n  frameBaseUrl,\n  theme,\n  children,\n}: MoonPayEnterpriseProviderProps): JSX.Element {\n  const { frameSlots, addSlot, removeSlot } = useFrameSlots();\n  const core = useCore(undefined, frameBaseUrl);\n\n  // Every enterprise frame reads the token from the core context. Setting it\n  // during render (idempotent) guarantees frames mounted in this commit see it.\n  core.context.setClientToken(clientToken);\n\n  const themeKey = themeDependencyKey(theme);\n  // biome-ignore lint/correctness/useExhaustiveDependencies: theme is captured via themeKey\n  const specCtx = useMemo<SpecContext>(\n    () => ({ core, frameBaseUrl, theme, enterpriseClientToken: clientToken }),\n    [clientToken, core, frameBaseUrl, themeKey],\n  );\n\n  const value = useMemo<MoonPayEnterpriseContextValue>(\n    () => ({\n      client: createRNEnterpriseClient({\n        mountSession: createMountSession(specCtx, { addSlot, removeSlot }),\n        core,\n      }),\n    }),\n    [specCtx, core, addSlot, removeSlot],\n  );\n\n  return (\n    <FrameHostContext.Provider value={specCtx}>\n      <MoonPayEnterpriseContext.Provider value={value}>\n        {children}\n        <FrameSlots frameSlots={frameSlots} removeSlot={removeSlot} />\n      </MoonPayEnterpriseContext.Provider>\n    </FrameHostContext.Provider>\n  );\n}\n\n// ---------------------------------------------------------------------------\n// Hooks\n// ---------------------------------------------------------------------------\n\n/** @internal Used by the inline frame components. Not part of the public API. */\nexport function useFrameHostContext(): SpecContext {\n  const ctx = useContext(FrameHostContext);\n  if (!ctx) {\n    throw new Error(\n      'MoonPay frame components must be used within a <MoonPayProvider> or <MoonPayEnterpriseProvider>',\n    );\n  }\n  return ctx;\n}\n\nexport function useMoonPay(): {\n  client: RNClient;\n  /** Set or replace the session token after mount. */\n  initialize: (sessionToken: string) => void;\n  /** True once a session token (via prop or `initialize()`) is available. */\n  isInitialized: boolean;\n} {\n  const ctx = useContext(MoonPayContext);\n  if (!ctx) {\n    throw new Error('useMoonPay must be used within a <MoonPayProvider>');\n  }\n  return ctx;\n}\n\nexport function useMoonPayEnterprise(): { client: RNEnterpriseClient } {\n  const ctx = useContext(MoonPayEnterpriseContext);\n  if (!ctx) {\n    throw new Error('useMoonPayEnterprise must be used within a <MoonPayEnterpriseProvider>');\n  }\n  return ctx;\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as AddCardSdk from '@moonpay/platform-protocol/sdks/add-card';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { addCardSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupAddCardOptions {\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for add-card frame lifecycle events. */\n  onEvent?: (event: AddCardSdk.Event) => void;\n}\n\nexport interface AddCardFrame {\n  dispose(): void;\n}\n\n// ------- setupAddCard -------\nexport async function setupAddCard(\n  deps: MethodDeps,\n  opts: SetupAddCardOptions,\n): Promise<Result<AddCardFrame, AddCardSdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(addCardSpec, {\n      presentation: opts.presentation,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Add card setup failed',\n    });\n  }\n}\n","import type * as ApplePayFrameTypes from '@moonpay/platform-protocol/frames/apple-pay';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as ApplePaySdk from '@moonpay/platform-protocol/sdks/apple-pay';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { applePaySpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\n/** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */\nexport interface SetupApplePayOptions {\n  /** Quote signature from getQuote(). */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. */\n  externalTransactionId?: string;\n  /** Styling for the standalone Apple Pay button. Passed through to the frame, which is authoritative. */\n  applePayButtonSettings?: ApplePayFrameTypes.ApplePayButtonSettings;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for Apple Pay lifecycle events. */\n  onEvent?: (event: ApplePaySdk.Event) => void;\n}\n\n/** @deprecated Render `<MoonPayBuyButton>` instead. The Apple Pay frame is being removed. */\nexport interface ApplePayFrame {\n  /** Update the quote (e.g., after expiry). */\n  setQuote(signature: string): void;\n  dispose(): void;\n}\n\n// ------- setupApplePay -------\nexport async function setupApplePay(\n  deps: MethodDeps,\n  opts: SetupApplePayOptions,\n): Promise<Result<ApplePayFrame, ApplePaySdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(applePaySpec, {\n      quote: opts.quote,\n      externalTransactionId: opts.externalTransactionId,\n      applePayButtonSettings: opts.applePayButtonSettings,\n      presentation: opts.presentation,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ setQuote: handle.commands.setQuote, dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Apple Pay setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as AuthSdk from '@moonpay/platform-protocol/sdks/auth';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { FrameSessionDisposedError } from '../frame-engine.js';\nimport { authSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupAuthOptions {\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for auth frame lifecycle events. */\n  onEvent?: (event: AuthSdk.Event) => void;\n}\n\nexport interface AuthFrame {\n  dispose(): void;\n}\n\n// ------- setupAuth (visible frame) -------\nexport async function setupAuth(\n  deps: MethodDeps,\n  opts: SetupAuthOptions,\n): Promise<Result<AuthFrame, AuthSdk.SetupError>> {\n  if (!deps.core.context.clientToken) {\n    return err({\n      kind: 'configurationError',\n      message:\n        'No clientToken in context — call getConnection() first and ensure it resolved with status \"connectionRequired\".',\n    });\n  }\n\n  try {\n    const { handle, dispose } = await deps.mountSession(authSpec, {\n      presentation: opts.presentation,\n    });\n\n    return await new Promise<Result<AuthFrame, AuthSdk.SetupError>>((resolve) => {\n      handle.onEvent((event) => {\n        opts.onEvent?.(event);\n        if (event.kind === 'error') {\n          // Resolve before dispose so the teardown notification below\n          // doesn't win the race with the real error result.\n          resolve(err({ kind: 'genericError', message: 'Auth frame error' }));\n          dispose();\n        } else if (event.kind === 'close') {\n          resolve(err({ kind: 'genericError', message: 'Auth flow dismissed' }));\n          dispose();\n        }\n      });\n      // The auth spec only surfaces `complete` events for terminal-success\n      // statuses; resolution must fire on ANY complete, so use raw messages.\n      handle.onMessage((msg) => {\n        if (msg.kind === 'complete') {\n          resolve(ok({ dispose }));\n        }\n      });\n      // Settle if the session is torn down before completing — e.g. the user\n      // dismissed the SDK-presented frame. No-op once already resolved.\n      handle.onDispose(() => {\n        resolve(err({ kind: 'genericError', message: 'Auth flow dismissed' }));\n      });\n    });\n  } catch (e) {\n    // Dismissed while the frame was still loading (pre-handshake teardown).\n    if (e instanceof FrameSessionDisposedError) {\n      return err({ kind: 'genericError', message: 'Auth flow dismissed' });\n    }\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Auth setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as BuySdk from '@moonpay/platform-protocol/sdks/buy';\nimport { buySpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\n/** @deprecated Use `SetupBuyButtonOptions` with `headless: true`. */\nexport interface SetupBuyOptions {\n  /** Quote signature from getQuote(). */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. */\n  externalTransactionId?: string;\n  /** Callback for buy frame lifecycle events. */\n  onEvent?: (event: BuySdk.Event) => void;\n}\n\n/** @deprecated Use `BuyButtonFrame` from `setupBuyButton({ headless: true })`. */\nexport interface BuyFrame {\n  /** Update the quote (e.g., after expiry). */\n  setQuote(signature: string): void;\n  dispose(): void;\n}\n\n// ------- setupBuy (hidden frame) -------\nexport async function setupBuy(\n  deps: MethodDeps,\n  opts: SetupBuyOptions,\n): Promise<Result<BuyFrame, BuySdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(buySpec, {\n      quote: opts.quote,\n      externalTransactionId: opts.externalTransactionId,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ setQuote: handle.commands.setQuote, dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Buy setup failed',\n    });\n  }\n}\n","import type * as ApplePayFrame from '@moonpay/platform-protocol/frames/apple-pay';\nimport type * as GooglePayFrame from '@moonpay/platform-protocol/frames/google-pay';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as BuyButtonSdk from '@moonpay/platform-protocol/sdks/buy-button';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { buyButtonSpec, headlessBuyButtonSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupBuyButtonOptions {\n  /** Quote signature from getQuote(). */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. */\n  externalTransactionId?: string;\n  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */\n  applePayButtonSettings?: ApplePayFrame.ApplePayButtonSettings;\n  /**\n   * Styling for the Google Pay button variant. Passed through to the frame, which is\n   * authoritative. Ignored when `headless` is set, since no button renders.\n   */\n  googlePayButtonSettings?: GooglePayFrame.GooglePayButtonSettings;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /**\n   * The link back to your app after the customer finishes in another app that\n   * the payment method opens (for example Cash App), such as\n   * `myapp://moonpay-return`. Without it the customer switches back to your\n   * app themselves.\n   */\n  linkReturnUrl?: string;\n  /**\n   * Run the frame hidden, with no button: it processes the quote on load, the\n   * way the deprecated `setupBuy` did.\n   */\n  headless?: boolean;\n  /** Callback for buy-button frame lifecycle events. */\n  onEvent?: (event: BuyButtonSdk.Event) => void;\n}\n\nexport interface BuyButtonFrame {\n  /** Update the quote (e.g., after expiry). */\n  setQuote(signature: string): void;\n  dispose(): void;\n}\n\n// ------- setupBuyButton -------\nexport async function setupBuyButton(\n  deps: MethodDeps,\n  opts: SetupBuyButtonOptions,\n): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(\n      opts.headless ? headlessBuyButtonSpec : buyButtonSpec,\n      {\n        quote: opts.quote,\n        externalTransactionId: opts.externalTransactionId,\n        applePayButtonSettings: opts.applePayButtonSettings,\n        googlePayButtonSettings: opts.googlePayButtonSettings,\n        presentation: opts.presentation,\n        linkReturnUrl: opts.linkReturnUrl,\n      },\n    );\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ setQuote: handle.commands.setQuote, dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Buy button setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as ChallengeSdk from '@moonpay/platform-protocol/sdks/challenge';\nimport { isTrustedFrameUrl, type PresentationMode } from '@moonpay/platform-sdk-core';\nimport { challengeSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupChallengeOptions {\n  /** Full challenge URL received from a frame's `challenge` event. */\n  url: string;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /**\n   * Finish an Apple Pay / Google Pay buy on your own buy button instead of\n   * inside the challenge frame. When the buy challenges are resolved, the\n   * frame sends `resolved` instead of `complete` and the SDK closes its sheet:\n   * show your buy button again so the customer taps it to pay. If the frame\n   * can't hand the token over, it still finishes with `complete`.\n   * Defaults to `false`.\n   */\n  resume?: boolean;\n  /** Callback for challenge frame lifecycle events. */\n  onEvent?: (event: ChallengeSdk.Event) => void;\n}\n\nexport interface ChallengeFrame {\n  dispose(): void;\n}\n\n// ------- setupChallenge -------\nexport async function setupChallenge(\n  deps: MethodDeps,\n  opts: SetupChallengeOptions,\n): Promise<Result<ChallengeFrame, ChallengeSdk.SetupError>> {\n  if (!isTrustedFrameUrl(opts.url)) {\n    return err({\n      kind: 'configurationError',\n      message: 'Challenge URL must be served from a trusted MoonPay origin',\n    });\n  }\n\n  try {\n    const { handle, dispose } = await deps.mountSession(challengeSpec, {\n      url: opts.url,\n      presentation: opts.presentation,\n      resume: opts.resume,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Challenge setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as ConnectSdk from '@moonpay/platform-protocol/sdks/connect';\nimport type { PresentationMode, ThemeOptions } from '@moonpay/platform-sdk-core';\nimport { FrameSessionDisposedError } from '../frame-engine.js';\nimport { connectSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface ConnectOptions {\n  /** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. */\n  theme?: ThemeOptions;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for connect lifecycle events. */\n  onEvent?: (event: ConnectSdk.Event) => void;\n}\n\nexport interface ConnectFrame {\n  dispose(): void;\n}\n\n// ------- connect (visible frame) -------\nexport async function connect(\n  deps: MethodDeps,\n  opts: ConnectOptions,\n): Promise<Result<ConnectFrame, ConnectSdk.ConnectError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(connectSpec, {\n      theme: opts.theme,\n      presentation: opts.presentation,\n    });\n\n    return await new Promise<Result<ConnectFrame, ConnectSdk.ConnectError>>((resolve) => {\n      handle.onEvent((event) => {\n        opts.onEvent?.(event);\n        if (event.kind === 'error') {\n          // Resolve before dispose so the teardown notification below\n          // doesn't win the race with the real error result.\n          resolve(err({ message: 'Connection error' }));\n          dispose();\n        } else if (event.kind === 'close') {\n          resolve(err({ message: 'Connect flow dismissed' }));\n          dispose();\n        } else if (event.kind === 'complete') {\n          resolve(ok({ dispose }));\n        }\n      });\n      // Settle if the session is torn down before completing — e.g. the user\n      // dismissed the SDK-presented frame. No-op once already resolved.\n      handle.onDispose(() => {\n        resolve(err({ message: 'Connect flow dismissed' }));\n      });\n    });\n  } catch (e) {\n    // Dismissed while the frame was still loading (pre-handshake teardown).\n    if (e instanceof FrameSessionDisposedError) {\n      return err({ message: 'Connect flow dismissed' });\n    }\n    return err({\n      message: e instanceof Error ? e.message : 'Connect failed',\n    });\n  }\n}\n","import type { Connection } from '@moonpay/platform-protocol/models/connection';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as ConnectSdk from '@moonpay/platform-protocol/sdks/connect';\nimport { connectionCheckSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface GetConnectionOptions {\n  /**\n   * Pass `true` for headless / Identity-API integrations so the check\n   * frame opts out of KYC-based statuses. Legal (`termsAcceptanceRequired`)\n   * is always surfaced regardless. Defaults to `false`.\n   */\n  skipKyc?: boolean;\n}\n\n// ------- getConnection (hidden frame) -------\nexport async function getConnection(\n  deps: MethodDeps,\n  options: GetConnectionOptions = {},\n): Promise<Result<Connection, ConnectSdk.GetConnectionError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(connectionCheckSpec, options);\n\n    return await new Promise<Result<Connection, ConnectSdk.GetConnectionError>>((resolve) => {\n      const timeout = setTimeout(() => {\n        dispose();\n        resolve(err({ message: 'Get connection timed out' }));\n      }, 10_000);\n\n      handle.onEvent((event) => {\n        clearTimeout(timeout);\n        dispose();\n        if (event.kind === 'error') {\n          resolve(err({ message: event.payload.message }));\n        } else {\n          resolve(ok(event.payload));\n        }\n      });\n    });\n  } catch (e) {\n    return err({\n      message: e instanceof Error ? e.message : 'Failed to check connection',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { ok } from '@moonpay/platform-protocol/result';\nimport type { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';\nimport { connectionResetSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\n// ------- resetConnection (hidden frame) -------\nexport async function resetConnection(\n  deps: MethodDeps,\n): Promise<Result<void, ResetConnectionError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(connectionResetSpec, {});\n\n    return await new Promise<Result<void, ResetConnectionError>>((resolve) => {\n      const timeout = setTimeout(() => {\n        dispose();\n        resolve(ok(undefined));\n      }, 5_000);\n\n      handle.onEvent(() => {\n        clearTimeout(timeout);\n        dispose();\n        resolve(ok(undefined));\n      });\n    });\n  } catch {\n    return ok(undefined);\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as CustomerExportSdk from '@moonpay/platform-protocol/sdks/customer-export';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { customerExportSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupCustomerExportOptions {\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for customer-export frame lifecycle events. */\n  onEvent?: (event: CustomerExportSdk.Event) => void;\n}\n\nexport interface CustomerExportFrame {\n  dispose(): void;\n}\n\n// ------- setupCustomerExport -------\nexport async function setupCustomerExport(\n  deps: MethodDeps,\n  opts: SetupCustomerExportOptions,\n): Promise<Result<CustomerExportFrame, CustomerExportSdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(customerExportSpec, {\n      presentation: opts.presentation,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Customer export setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { googlePaySpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\n/** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */\nexport interface SetupGooglePayOptions {\n  /** Quote signature from getQuote(). */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. */\n  externalTransactionId?: string;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for Google Pay lifecycle events. */\n  onEvent?: (event: GooglePaySdk.Event) => void;\n}\n\n/** @deprecated Render `<MoonPayBuyButton>` instead. The Google Pay frame is being removed. */\nexport interface GooglePayFrame {\n  /** Update the quote (e.g., after expiry). */\n  setQuote(signature: string): void;\n  dispose(): void;\n}\n\n// ------- setupGooglePay -------\nexport async function setupGooglePay(\n  deps: MethodDeps,\n  opts: SetupGooglePayOptions,\n): Promise<Result<GooglePayFrame, GooglePaySdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(googlePaySpec, {\n      quote: opts.quote,\n      externalTransactionId: opts.externalTransactionId,\n      presentation: opts.presentation,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ setQuote: handle.commands.setQuote, dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Google Pay setup failed',\n    });\n  }\n}\n","import type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\nimport type * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';\nimport type { PresentationMode } from '@moonpay/platform-sdk-core';\nimport { widgetSpec } from '../frame-specs.js';\nimport type { MethodDeps } from './mount-session.js';\n\nexport interface SetupWidgetOptions {\n  /** Quote signature from getQuote(). */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. */\n  externalTransactionId?: string;\n  /** Frame chrome. Defaults to the frame's own default (bare) when omitted. */\n  presentation?: PresentationMode;\n  /** Callback for widget lifecycle events. */\n  onEvent?: (event: WidgetSdk.Event) => void;\n}\n\nexport interface WidgetFrame {\n  dispose(): void;\n}\n\n// ------- setupWidget -------\nexport async function setupWidget(\n  deps: MethodDeps,\n  opts: SetupWidgetOptions,\n): Promise<Result<WidgetFrame, WidgetSdk.SetupError>> {\n  try {\n    const { handle, dispose } = await deps.mountSession(widgetSpec, {\n      quote: opts.quote,\n      externalTransactionId: opts.externalTransactionId,\n      presentation: opts.presentation,\n    });\n    handle.onEvent((event) => opts.onEvent?.(event));\n    return ok({ dispose });\n  } catch (e) {\n    return err({\n      kind: 'genericError',\n      message: e instanceof Error ? e.message : 'Widget setup failed',\n    });\n  }\n}\n","import type {\n  GetQuoteParams,\n  ListAssetsResponse,\n  ListPaymentMethodsResponse,\n  PaginationInfo,\n  Quote,\n  SimulateBankTransferParams,\n  Transaction,\n  TransactionWithStages,\n} from '@moonpay/platform-protocol/api';\nimport type { Customer } from '@moonpay/platform-protocol/api/customer';\nimport type {\n  CreateIdentityError,\n  DevPlatformApiError,\n  GetAssetsError,\n  GetCustomerError,\n  GetCustomerUploadUrlError,\n  GetIdentityError,\n  GetIdentityUploadUrlError,\n  GetPaymentMethodsError,\n  GetQuoteError,\n  GetTransactionsError,\n  SimulateBankTransferError,\n  SubmitCustomerFilesError,\n  SubmitCustomerKycError,\n  SubmitIdentityFilesError,\n  UpdateIdentityError,\n  VerifyIdentityError,\n} from '@moonpay/platform-protocol/api/errors';\nimport type {\n  CreateIdentityRequestBody,\n  Identity,\n  IdentityFileUploadUrl,\n  IdentityFileUploadUrlRequestBody,\n  IdentityVerificationResponse,\n  SubmitIdentityFilesRequestBody,\n  UpdateIdentityRequestBody,\n} from '@moonpay/platform-protocol/api/identity';\nimport type { Connection } from '@moonpay/platform-protocol/models/connection';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport type * as AddCardSdk from '@moonpay/platform-protocol/sdks/add-card';\nimport type * as ApplePaySdk from '@moonpay/platform-protocol/sdks/apple-pay';\nimport type * as AuthSdk from '@moonpay/platform-protocol/sdks/auth';\nimport type * as BuySdk from '@moonpay/platform-protocol/sdks/buy';\nimport type * as BuyButtonSdk from '@moonpay/platform-protocol/sdks/buy-button';\nimport type * as ChallengeSdk from '@moonpay/platform-protocol/sdks/challenge';\nimport type * as ConnectSdk from '@moonpay/platform-protocol/sdks/connect';\nimport type * as CustomerExportSdk from '@moonpay/platform-protocol/sdks/customer-export';\nimport type * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';\nimport type { ResetConnectionError } from '@moonpay/platform-protocol/sdks/reset';\nimport type * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';\nimport type {\n  Credentials,\n  GetCredentialsError,\n  GetPaymentMethodsParams,\n  ListAssetsParams,\n  ListTransactionsParams,\n} from '@moonpay/platform-sdk-core';\nimport type { AddCardFrame, SetupAddCardOptions } from './methods/add-card.js';\nimport { setupAddCard } from './methods/add-card.js';\nimport type { ApplePayFrame, SetupApplePayOptions } from './methods/apple-pay.js';\nimport { setupApplePay } from './methods/apple-pay.js';\nimport type { AuthFrame, SetupAuthOptions } from './methods/auth.js';\nimport { setupAuth } from './methods/auth.js';\nimport type { BuyFrame, SetupBuyOptions } from './methods/buy.js';\nimport { setupBuy } from './methods/buy.js';\nimport type { BuyButtonFrame, SetupBuyButtonOptions } from './methods/buy-button.js';\nimport { setupBuyButton } from './methods/buy-button.js';\nimport type { ChallengeFrame, SetupChallengeOptions } from './methods/challenge.js';\nimport { setupChallenge } from './methods/challenge.js';\nimport type { ConnectFrame, ConnectOptions } from './methods/connect.js';\nimport { connect } from './methods/connect.js';\nimport type { GetConnectionOptions } from './methods/connection-check.js';\nimport { getConnection } from './methods/connection-check.js';\nimport { resetConnection } from './methods/connection-reset.js';\nimport type { CustomerExportFrame, SetupCustomerExportOptions } from './methods/customer-export.js';\nimport { setupCustomerExport } from './methods/customer-export.js';\nimport type { GooglePayFrame, SetupGooglePayOptions } from './methods/google-pay.js';\nimport { setupGooglePay } from './methods/google-pay.js';\nimport type { MethodDeps } from './methods/mount-session.js';\nimport type { SetupWidgetOptions, WidgetFrame } from './methods/widget.js';\nimport { setupWidget } from './methods/widget.js';\n\nexport type {\n  AddCardFrame,\n  ApplePayFrame,\n  AuthFrame,\n  BuyButtonFrame,\n  BuyFrame,\n  ChallengeFrame,\n  ConnectFrame,\n  ConnectOptions,\n  CustomerExportFrame,\n  GetConnectionOptions,\n  GooglePayFrame,\n  SetupAddCardOptions,\n  SetupApplePayOptions,\n  SetupAuthOptions,\n  SetupBuyButtonOptions,\n  SetupBuyOptions,\n  SetupChallengeOptions,\n  SetupCustomerExportOptions,\n  SetupGooglePayOptions,\n  SetupWidgetOptions,\n  WidgetFrame,\n};\n\nexport interface RNClient {\n  /**\n   * Probe the customer's connection state via the headless check-connection\n   * frame. Returns the `Connection` discriminated union and populates the\n   * internal context with bootstrap `accessToken` / `clientToken` for any\n   * status that carries credentials (`active`, `connectionRequired`).\n   *\n   * A `connectionRequired` result may carry `mismatch: true` when the\n   * session's email and phone number resolve to different MoonPay\n   * customers — partners can branch on it to route the customer through\n   * Connect proactively, before rendering payment UI.\n   */\n  getConnection(\n    options?: GetConnectionOptions,\n  ): Promise<Result<Connection, ConnectSdk.GetConnectionError>>;\n  connect(options: ConnectOptions): Promise<Result<ConnectFrame, ConnectSdk.ConnectError>>;\n  /**\n   * Launch the auth frame — the lighter-weight counterpart to `connect()`\n   * for headless / Identity-API partners. Requires a `clientToken` to be\n   * present in the client's context, which is populated automatically by a\n   * prior `getConnection()` call that returned `connectionRequired`.\n   * Call `getConnection()` first; if its status is `connectionRequired`,\n   * call `setupAuth()` to drive the customer through email/OTP.\n   */\n  setupAuth(options: SetupAuthOptions): Promise<Result<AuthFrame, AuthSdk.SetupError>>;\n  /**\n   * Returns the connected customer's `{ accessToken, clientToken }` so you can\n   * forward the `accessToken` to your own backend for customer-scoped Platform\n   * API calls (e.g. server-side quote fetching).\n   *\n   * Advanced escape hatch — the SDK otherwise keeps these credentials internal.\n   * The `accessToken` is short-lived and scoped to the connected customer. Errs\n   * with `noActiveSession` until a customer session exists — call\n   * `getConnection()` (and `connect()` / `setupAuth()` where needed) first.\n   * Synchronous — returns a `Result`, not a Promise.\n   */\n  getCredentials(): Result<Credentials, GetCredentialsError>;\n  getPaymentMethods(\n    params?: GetPaymentMethodsParams,\n  ): Promise<Result<{ data: ListPaymentMethodsResponse }, GetPaymentMethodsError>>;\n  getQuote(params: GetQuoteParams): Promise<Result<{ data: Quote }, GetQuoteError>>;\n  /**\n   * Lists crypto assets (CeFi and DeFi) available for purchase. DeFi tokens are\n   * returned with `status.verified: false`; quote them by `caip19` rather than `code`.\n   */\n  getAssets(params?: ListAssetsParams): Promise<Result<ListAssetsResponse, GetAssetsError>>;\n  listTransactions(\n    params?: ListTransactionsParams,\n  ): Promise<Result<{ data: Transaction[]; pageInfo: PaginationInfo }, GetTransactionsError>>;\n  getTransaction(\n    id: string,\n  ): Promise<Result<{ data: TransactionWithStages }, GetTransactionsError>>;\n  /** Simulate bank-transfer settlement for a test-mode transaction (sandbox only). */\n  simulateBankTransfer(\n    id: string,\n    params: SimulateBankTransferParams,\n  ): Promise<Result<{ data: TransactionWithStages }, SimulateBankTransferError>>;\n  setupWidget(options: SetupWidgetOptions): Promise<Result<WidgetFrame, WidgetSdk.SetupError>>;\n  /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed. */\n  setupApplePay(\n    options: SetupApplePayOptions,\n  ): Promise<Result<ApplePayFrame, ApplePaySdk.SetupError>>;\n  /** @deprecated Use `setupBuyButton({ ...options, headless: true })` or `<MoonPayBuyButton headless>`. The buy frame is being removed. */\n  setupBuy(options: SetupBuyOptions): Promise<Result<BuyFrame, BuySdk.SetupError>>;\n  /** @deprecated Render <MoonPayBuyButton> instead — it mounts inline where you place it. */\n  setupBuyButton(\n    options: SetupBuyButtonOptions,\n  ): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>>;\n  /** @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed. */\n  setupGooglePay(\n    options: SetupGooglePayOptions,\n  ): Promise<Result<GooglePayFrame, GooglePaySdk.SetupError>>;\n  deletePaymentMethod(id: string): Promise<Result<void, DevPlatformApiError>>;\n  /**\n   * Clears the customer's MoonPay connection for this partner by running the\n   * reset frame. Resolves when the reset completes or times out (5s).\n   * Call this after clearing your own local auth state (the client reference\n   * can be captured before disposal since the session token is baked in).\n   */\n  resetConnection(): Promise<Result<void, ResetConnectionError>>;\n  setupChallenge(\n    options: SetupChallengeOptions,\n  ): Promise<Result<ChallengeFrame, ChallengeSdk.SetupError>>;\n  setupAddCard(options: SetupAddCardOptions): Promise<Result<AddCardFrame, AddCardSdk.SetupError>>;\n  setupCustomerExport(\n    options: SetupCustomerExportOptions,\n  ): Promise<Result<CustomerExportFrame, CustomerExportSdk.SetupError>>;\n\n  // Customer API\n  getCustomer(id: string): Promise<Result<{ data: Customer }, GetCustomerError>>;\n  submitCustomerKyc(\n    id: string,\n    body: UpdateIdentityRequestBody,\n  ): Promise<Result<{ data: Customer }, SubmitCustomerKycError>>;\n  getCustomerUploadUrl(\n    id: string,\n    body: IdentityFileUploadUrlRequestBody,\n  ): Promise<Result<{ data: IdentityFileUploadUrl }, GetCustomerUploadUrlError>>;\n  submitCustomerFiles(\n    id: string,\n    body: SubmitIdentityFilesRequestBody,\n  ): Promise<Result<{ data: Customer }, SubmitCustomerFilesError>>;\n\n  // Identity API — deprecated (DEVXP-1454), use the Customer API above instead\n  /** @deprecated Customers are created automatically now — call `getCustomer` directly instead. */\n  createIdentity(\n    body: CreateIdentityRequestBody,\n  ): Promise<Result<{ data: Identity | null }, CreateIdentityError>>;\n  /** @deprecated Use `getCustomer` instead. */\n  getIdentity(id: string): Promise<Result<{ data: Identity }, GetIdentityError>>;\n  /** @deprecated Use `submitCustomerKyc` instead. */\n  updateIdentity(\n    id: string,\n    body: UpdateIdentityRequestBody,\n  ): Promise<Result<{ data: Identity }, UpdateIdentityError>>;\n  /** @deprecated No longer needed — Customer API verification has no direct replacement call. */\n  verifyIdentity(\n    id: string,\n  ): Promise<Result<{ data: IdentityVerificationResponse }, VerifyIdentityError>>;\n  /** @deprecated Use `getCustomerUploadUrl` instead. */\n  getIdentityUploadUrl(\n    id: string,\n    body: IdentityFileUploadUrlRequestBody,\n  ): Promise<Result<{ data: IdentityFileUploadUrl }, GetIdentityUploadUrlError>>;\n  /** @deprecated Use `submitCustomerFiles` instead. */\n  submitIdentityFiles(\n    id: string,\n    body: SubmitIdentityFilesRequestBody,\n  ): Promise<Result<{ data: Identity }, SubmitIdentityFilesError>>;\n}\n\nexport function createRNClient(deps: MethodDeps): RNClient {\n  const { core } = deps;\n  return {\n    getConnection: (options) => getConnection(deps, options ?? {}),\n    connect: (opts) => connect(deps, opts),\n    setupAuth: (opts) => setupAuth(deps, opts),\n    getCredentials: () => core.getCredentials(),\n    getPaymentMethods: (params) => core.getPaymentMethods(params),\n    getQuote: (params) => core.getQuote(params),\n    getAssets: (params) => core.getAssets(params),\n    listTransactions: (params) => core.listTransactions(params),\n    getTransaction: (id) => core.getTransaction(id),\n    simulateBankTransfer: (id, params) => core.simulateBankTransfer(id, params),\n    setupWidget: (opts) => setupWidget(deps, opts),\n    setupApplePay: (opts) => setupApplePay(deps, opts),\n    setupBuy: (opts) => setupBuy(deps, opts),\n    setupBuyButton: (opts) => setupBuyButton(deps, opts),\n    setupGooglePay: (opts) => setupGooglePay(deps, opts),\n    deletePaymentMethod: (id) => core.deletePaymentMethod(id),\n    resetConnection: () => resetConnection(deps),\n    setupChallenge: (opts) => setupChallenge(deps, opts),\n    setupAddCard: (opts) => setupAddCard(deps, opts),\n    setupCustomerExport: (opts) => setupCustomerExport(deps, opts),\n\n    getCustomer: (id) => core.getCustomer(id),\n    submitCustomerKyc: (id, body) => core.submitCustomerKyc(id, body),\n    getCustomerUploadUrl: (id, body) => core.getCustomerUploadUrl(id, body),\n    submitCustomerFiles: (id, body) => core.submitCustomerFiles(id, body),\n\n    createIdentity: (body) => core.createIdentity(body),\n    getIdentity: (id) => core.getIdentity(id),\n    updateIdentity: (id, body) => core.updateIdentity(id, body),\n    verifyIdentity: (id) => core.verifyIdentity(id),\n    getIdentityUploadUrl: (id, body) => core.getIdentityUploadUrl(id, body),\n    submitIdentityFiles: (id, body) => core.submitIdentityFiles(id, body),\n  };\n}\n\n/**\n * The enterprise client exposes only the payment frames. Quotes, customers\n * and transactions are API-driven for enterprise — call them from your server.\n * For a buy without a visible button, use `setupBuyButton({ headless: true })`.\n */\nexport type RNEnterpriseClient = Pick<\n  RNClient,\n  'setupBuyButton' | 'setupChallenge' | 'setupAddCard'\n>;\n\nexport function createRNEnterpriseClient(deps: MethodDeps): RNEnterpriseClient {\n  return {\n    setupBuyButton: (opts) => setupBuyButton(deps, opts),\n    setupChallenge: (opts) => setupChallenge(deps, opts),\n    setupAddCard: (opts) => setupAddCard(deps, opts),\n  };\n}\n","import type { CoreClient } from '@moonpay/platform-sdk-core';\nimport {\n  createFrameSession,\n  type FrameSessionHandle,\n  type FrameSpec,\n  type SpecContext,\n} from '../frame-engine.js';\nimport type { RNFrameTransport } from '../webview-transport.js';\n\n// ---------------------------------------------------------------------------\n// Frame slot — represents a frame the provider needs to render\n// ---------------------------------------------------------------------------\n\nexport interface FrameSlot {\n  id: string;\n  transport: RNFrameTransport;\n  hidden: boolean;\n  /** Tear down the slot's frame session — safe to call before the handshake completes. */\n  dispose(): void;\n}\n\nexport interface SlotHost {\n  addSlot(slot: FrameSlot): void;\n  removeSlot(id: string): void;\n}\n\nexport type MountSession = <E, P, C>(\n  spec: FrameSpec<E, P, C>,\n  props: P,\n) => Promise<{ handle: FrameSessionHandle<E, C>; dispose: () => void }>;\n\nexport interface MethodDeps {\n  mountSession: MountSession;\n  core: CoreClient;\n}\n\nlet slotCounter = 0;\n\nexport function createMountSession(specCtx: SpecContext, host: SlotHost): MountSession {\n  return async function mountSession<E, P, C>(\n    spec: FrameSpec<E, P, C>,\n    props: P,\n  ): Promise<{ handle: FrameSessionHandle<E, C>; dispose: () => void }> {\n    const session = createFrameSession(spec, specCtx, props);\n    const slotId = `slot-${++slotCounter}`;\n    host.addSlot({\n      id: slotId,\n      transport: session.transport,\n      hidden: session.hidden,\n      dispose: () => session.dispose(),\n    });\n    try {\n      const handle = await session.ready;\n      return {\n        handle,\n        dispose: () => {\n          handle.dispose();\n          host.removeSlot(slotId);\n        },\n      };\n    } catch (e) {\n      host.removeSlot(slotId);\n      throw e;\n    }\n  };\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n  ActivityIndicator,\n  Animated,\n  Easing,\n  Modal,\n  PanResponder,\n  Platform,\n  Pressable,\n  StyleSheet,\n  useWindowDimensions,\n  View,\n} from 'react-native';\nimport { MoonPayFrame } from './frame-component.js';\nimport type { FrameSlot } from './methods/mount-session.js';\nimport {\n  presentationSignalFor,\n  resolvePresentation,\n  type SheetPhase,\n} from './sheet-presentation.js';\n\n/**\n * How long to wait for the frame's `ready` before presenting the sheet anyway\n * (with a spinner). Wide enough that a frame which finishes without UI — e.g. a\n * frictionless challenge — completes inside the window and is dismissed before\n * the sheet is ever shown, avoiding a slide-up-then-down flash.\n */\nconst PRESENT_GRACE_MS = 3000;\n\n/**\n * Drives a sheet's translateY to `toValue`, mirroring the default animation of\n * @gorhom/react-native-bottom-sheet so the feel matches without taking the\n * dependency: an overdamped spring on iOS, and a 250ms Easing.out(Easing.exp)\n * timing on Android. (Those are gorhom's exact default configs.)\n */\nfunction animateSheet(value: Animated.Value, toValue: number, onDone?: Animated.EndCallback): void {\n  const animation =\n    Platform.OS === 'android'\n      ? Animated.timing(value, {\n          toValue,\n          duration: 250,\n          easing: Easing.out(Easing.exp),\n          useNativeDriver: true,\n        })\n      : Animated.spring(value, {\n          toValue,\n          damping: 500,\n          stiffness: 1000,\n          mass: 3,\n          overshootClamping: true,\n          restDisplacementThreshold: 10,\n          restSpeedThreshold: 10,\n          useNativeDriver: true,\n        });\n  animation.start(onDone);\n}\n\n/**\n * Renders one SDK-presented frame as a dimmed bottom sheet that slides up\n * (and back down on dismiss) with a gorhom-matched animation, plus a backdrop\n * that fades in lockstep with the sheet position. Built on the Animated API\n * and a transparent <Modal> — no extra dependencies.\n *\n * NOTE: a React Native <Modal> is presented from the app-root view controller\n * and cannot appear above a react-native-screens native-stack modal. Launch\n * imperative frames from a non-modal screen (or use the declarative\n * <MoonPayConnect>/<MoonPayWidget> components, which render inline).\n */\nexport function VisibleFrameSlotSheet({\n  slot,\n  onClose,\n}: {\n  slot: FrameSlot;\n  onClose: () => void;\n}): JSX.Element {\n  const { height } = useWindowDimensions();\n  const sheetHeight = Math.round(height * 0.9);\n  // Sheet offset from its resting position: starts fully off-screen (hidden).\n  const translateY = useRef(new Animated.Value(sheetHeight)).current;\n  // The frame's WebView stays mounted (it must load to emit `ready`), but is\n  // covered by a spinner until the frame reports its UI is ready to show.\n  const [frameReady, setFrameReady] = useState(false);\n  // Drives the backdrop's pointerEvents: while hidden the (transparent) modal\n  // must not intercept taps meant for the app underneath.\n  const [presented, setPresented] = useState(false);\n  // Single source of truth for the present/dismiss decision (see sheet-presentation).\n  const phaseRef = useRef<SheetPhase>('hidden');\n  // Latest onClose, read through a ref so `close` stays referentially stable.\n  const onCloseRef = useRef(onClose);\n  onCloseRef.current = onClose;\n  const closingRef = useRef(false);\n\n  // Slide down, then tear the slot down once the exit animation settles.\n  // Guarded so a `complete` auto-dismiss and a manual dismiss can't double-fire.\n  const close = useCallback(() => {\n    if (closingRef.current) return;\n    closingRef.current = true;\n    // Mark closed so a racing `terminal` signal can't re-trigger teardown.\n    phaseRef.current = 'closed';\n    animateSheet(translateY, sheetHeight, ({ finished }) => {\n      if (finished) onCloseRef.current();\n    });\n  }, [translateY, sheetHeight]);\n\n  // Drag-to-dismiss, attached only to the handle (see `panHandlers` below) so\n  // the frame's own content stays scrollable/tappable. Drives the SAME\n  // `translateY` as the open/close animation, so there's one source of truth.\n  const panResponder = useMemo(\n    () =>\n      PanResponder.create({\n        // Claim the gesture only for a clearly downward drag — never on a tap\n        // (so the handle's onPress still fires) or a mostly-horizontal swipe.\n        onMoveShouldSetPanResponder: (_evt, { dy, dx }) => dy > 5 && dy > Math.abs(dx),\n        onPanResponderGrant: () => {\n          // The sheet may be mid open/close animation. `stopAnimation` halts it\n          // AND flushes the native-driven value back to JS; folding that into\n          // the offset means the drag is relative to where the sheet actually\n          // sits right now, so re-grabbing never makes it jump.\n          translateY.stopAnimation(() => {\n            translateY.extractOffset();\n          });\n        },\n        // Track the finger downward; clamp upward travel to the open position.\n        onPanResponderMove: (_evt, { dy }) => {\n          translateY.setValue(Math.max(0, dy));\n        },\n        onPanResponderRelease: (_evt, { dy, vy }) => {\n          // Re-flatten so `translateY` is a single absolute value again before\n          // we hand it back to the spring/timing animation.\n          translateY.flattenOffset();\n          const draggedPastThreshold = dy > sheetHeight * 0.35;\n          const flungDownFast = vy > 0.5;\n          if (draggedPastThreshold || flungDownFast) {\n            close();\n          } else {\n            animateSheet(translateY, 0);\n          }\n        },\n        // Another responder stole the gesture: settle to a known state.\n        onPanResponderTerminate: () => {\n          translateY.flattenOffset();\n          animateSheet(translateY, 0);\n        },\n      }),\n    [translateY, sheetHeight, close],\n  );\n\n  // Apply a presentation signal: slide up, lift the spinner, dismiss silently,\n  // or animate closed — per the pure decision in resolvePresentation.\n  const dispatch = useCallback(\n    (signal: 'ready' | 'grace' | 'terminal') => {\n      const result = resolvePresentation(phaseRef.current, signal);\n      phaseRef.current = result.phase;\n      if (result.present) {\n        setPresented(true);\n        animateSheet(translateY, 0);\n      }\n      if (result.liftSpinner) setFrameReady(true);\n      if (result.dismissSilent) onCloseRef.current();\n      if (result.close) close();\n    },\n    [translateY, close],\n  );\n\n  // Present anyway once the grace window elapses, so a slow-loading frame (or\n  // one that never sends `ready`) is never stranded off-screen.\n  useEffect(() => {\n    const timer = setTimeout(() => dispatch('grace'), PRESENT_GRACE_MS);\n    return () => clearTimeout(timer);\n  }, [dispatch]);\n\n  // `ready` reveals the frame; a terminal message (`complete`/`error`/`resolved`)\n  // either dismisses silently (if we never presented) or animates the sheet\n  // closed — both without the partner having to call dispose.\n  useEffect(() => {\n    const unsubscribe = slot.transport.onMessage((msg) => {\n      const signal = presentationSignalFor(msg.kind);\n      if (signal) dispatch(signal);\n    });\n    return unsubscribe;\n  }, [slot.transport, dispatch]);\n\n  // Backdrop dims in step with the sheet position.\n  const backdropOpacity = translateY.interpolate({\n    inputRange: [0, sheetHeight],\n    outputRange: [1, 0],\n    extrapolate: 'clamp',\n  });\n\n  return (\n    <Modal visible transparent animationType=\"none\" onRequestClose={close}>\n      {/* Until presented the sheet is off-screen and the backdrop transparent;\n          pass taps through so the ~grace window doesn't freeze the app. */}\n      <View style={styles.root} pointerEvents={presented ? 'auto' : 'none'}>\n        <Animated.View style={[styles.backdrop, { opacity: backdropOpacity }]}>\n          {/* Tap outside the sheet to dismiss. */}\n          <Pressable\n            style={StyleSheet.absoluteFill}\n            accessibilityRole=\"button\"\n            accessibilityLabel=\"Close\"\n            onPress={close}\n          />\n        </Animated.View>\n        <Animated.View style={[styles.sheet, { height: sheetHeight, transform: [{ translateY }] }]}>\n          <MoonPayFrame transport={slot.transport} />\n          {!frameReady && (\n            <View style={styles.loading}>\n              <ActivityIndicator size=\"large\" color=\"#000\" />\n            </View>\n          )}\n          {/* Drag bar: pull down to dismiss. PanResponder lives on this strip\n              only, so the frame below stays scrollable/tappable. A nested\n              Pressable keeps a tap-to-close (and screen-reader) affordance. */}\n          <View style={styles.handleArea} {...panResponder.panHandlers}>\n            <Pressable\n              onPress={close}\n              accessibilityRole=\"button\"\n              accessibilityLabel=\"Close\"\n              hitSlop={12}\n            >\n              <View style={styles.handleBar} />\n            </Pressable>\n          </View>\n        </Animated.View>\n      </View>\n    </Modal>\n  );\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    flex: 1,\n    justifyContent: 'flex-end',\n  },\n  // Dimmed backdrop covering the whole screen; fades with the sheet position.\n  backdrop: {\n    ...StyleSheet.absoluteFillObject,\n    backgroundColor: 'rgba(0, 0, 0, 0.5)',\n  },\n  // Bottom sheet: ~90% of the screen (height applied inline), rounded top\n  // corners. The 10% gap keeps the frame clear of the status bar / notch\n  // without depending on react-native-safe-area-context.\n  sheet: {\n    backgroundColor: '#fff',\n    borderTopLeftRadius: 24,\n    borderTopRightRadius: 24,\n    overflow: 'hidden',\n  },\n  // Opaque cover with a centered spinner, shown until the frame is ready.\n  loading: {\n    ...StyleSheet.absoluteFillObject,\n    backgroundColor: '#fff',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n  // Drag-to-dismiss strip pinned across the top of the sheet, floating over the\n  // frame. Tall enough to be an easy grab target without eating much of the UI.\n  handleArea: {\n    position: 'absolute',\n    top: 0,\n    left: 0,\n    right: 0,\n    height: 28,\n    alignItems: 'center',\n    justifyContent: 'center',\n    zIndex: 1,\n    elevation: 2,\n  },\n  // The visible pill.\n  handleBar: {\n    width: 36,\n    height: 5,\n    borderRadius: 3,\n    backgroundColor: 'rgba(0, 0, 0, 0.2)',\n  },\n});\n","/**\n * Pure decision logic for when an SDK-presented frame's bottom sheet should\n * slide up, lift its loading spinner, or tear down — kept out of the component\n * so it can be unit-tested without a render harness.\n *\n * The sheet races three signals to decide whether to present at all:\n *   - `ready`    — the frame reported its UI is painted; reveal it.\n *   - `grace`    — a fallback timer fired; present with the spinner so a frame\n *                  that loads slowly (or never sends `ready`) is never stuck\n *                  invisible.\n *   - `terminal` — the frame emitted `complete`/`error`, or the challenge\n *                  frame's `resolved` hand-back. If this arrives BEFORE\n *                  the sheet was ever presented, the flow finished without\n *                  needing UI (e.g. a frictionless challenge), so we dismiss\n *                  silently instead of flashing the sheet up and back down.\n */\nexport type SheetPhase = 'hidden' | 'presented' | 'closed';\nexport type PresentationSignal = 'ready' | 'grace' | 'terminal';\n\n/** The presentation signal a frame message drives, or `null` for messages that drive none. */\nexport function presentationSignalFor(kind: string): 'ready' | 'terminal' | null {\n  if (kind === 'ready') return 'ready';\n  if (kind === 'complete' || kind === 'error' || kind === 'resolved') return 'terminal';\n  return null;\n}\n\nexport interface PresentationResult {\n  /** Phase after applying the signal. */\n  phase: SheetPhase;\n  /** Slide the sheet up. Only set on the hidden → presented edge. */\n  present: boolean;\n  /** Hide the loading spinner cover (the frame's own UI is ready). */\n  liftSpinner: boolean;\n  /** Tear down without animation — the frame finished before it was ever shown. */\n  dismissSilent: boolean;\n  /** Animate the sheet down, then tear down. */\n  close: boolean;\n}\n\nconst NOOP = {\n  present: false,\n  liftSpinner: false,\n  dismissSilent: false,\n  close: false,\n} as const;\n\nexport function resolvePresentation(\n  phase: SheetPhase,\n  signal: PresentationSignal,\n): PresentationResult {\n  if (phase === 'closed') return { phase: 'closed', ...NOOP };\n\n  switch (signal) {\n    case 'ready':\n      // Reveal the frame; also present it if the grace timer hadn't yet.\n      return { ...NOOP, phase: 'presented', present: phase === 'hidden', liftSpinner: true };\n    case 'grace':\n      if (phase === 'presented') return { phase: 'presented', ...NOOP };\n      return { ...NOOP, phase: 'presented', present: true };\n    case 'terminal':\n      if (phase === 'hidden') return { ...NOOP, phase: 'closed', dismissSilent: true };\n      return { ...NOOP, phase: 'closed', close: true };\n  }\n}\n","import type * as AddCardSdk from '@moonpay/platform-protocol/sdks/add-card';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { addCardSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayAddCardProps {\n  /** Callback for add-card lifecycle events. */\n  onEvent?: (event: AddCardSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline add-card frame — embed card entry in your own layout/animation. */\nexport function MoonPayAddCard({ onEvent, style, webViewProps }: MoonPayAddCardProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={addCardSpec}\n      props={{}}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as ApplePayFrame from '@moonpay/platform-protocol/frames/apple-pay';\nimport type * as ApplePaySdk from '@moonpay/platform-protocol/sdks/apple-pay';\nimport type { ViewStyle } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport type { WebViewProps } from 'react-native-webview';\nimport { applePaySpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\n/** @deprecated Use `MoonPayBuyButtonProps`. The Apple Pay frame is being removed. */\nexport interface MoonPayApplePayButtonProps {\n  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. Mount-time only. */\n  externalTransactionId?: string;\n  /** Styling for the Apple Pay button. Passed through to the frame, which is authoritative. Mount-time only. */\n  applePayButtonSettings?: ApplePayFrame.ApplePayButtonSettings;\n  /** Callback for Apple Pay lifecycle events. */\n  onEvent?: (event: ApplePaySdk.Event) => void;\n  /** Container style. Defaults to height 48. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n  /**\n   * Called with the underlying WebView instance once the button mounts, and\n   * with `null` on unmount. The Apple Pay button is rendered inside this\n   * WebView; use the instance to inject JS into the frame (e.g. via\n   * `injectJavaScript`).\n   */\n  onRef?: (webView: WebView | null) => void;\n}\n\n/**\n * Inline Apple Pay button. Render it wherever it should appear in your layout.\n * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Apple Pay button for an Apple Pay quote. The Apple Pay frame is being removed.\n */\nexport function MoonPayApplePayButton({\n  quote,\n  externalTransactionId,\n  applePayButtonSettings,\n  onEvent,\n  style,\n  webViewProps,\n  onRef,\n}: MoonPayApplePayButtonProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={applePaySpec}\n      props={{ quote, externalTransactionId, applePayButtonSettings }}\n      style={style}\n      defaultStyle={{ height: 48 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n      onRef={onRef}\n    />\n  );\n}\n","import type * as AuthSdk from '@moonpay/platform-protocol/sdks/auth';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { authSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayAuthProps {\n  /** Callback for auth lifecycle events. */\n  onEvent?: (event: AuthSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/**\n * Inline auth frame for headless / Identity-API integrations. Requires a clientToken in context —\n * call getConnection() (or render <MoonPayConnectionCheck>) first; if it resolves with\n * `connectionRequired`, mount this component. Emits an error event otherwise.\n */\nexport function MoonPayAuth({ onEvent, style, webViewProps }: MoonPayAuthProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={authSpec}\n      props={{}}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as ApplePayFrame from '@moonpay/platform-protocol/frames/apple-pay';\nimport type * as GooglePayFrame from '@moonpay/platform-protocol/frames/google-pay';\nimport type * as BuyButtonSdk from '@moonpay/platform-protocol/sdks/buy-button';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { buyButtonSpec, headlessBuyButtonSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayBuyButtonProps {\n  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. Mount-time only. */\n  externalTransactionId?: string;\n  /** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. Mount-time only. */\n  applePayButtonSettings?: ApplePayFrame.ApplePayButtonSettings;\n  /** Styling for the Google Pay button variant. Passed through to the frame, which is authoritative. Ignored when `headless` is set. Mount-time only. */\n  googlePayButtonSettings?: GooglePayFrame.GooglePayButtonSettings;\n  /**\n   * The link back to your app after the customer finishes in another app that\n   * the payment method opens (for example Cash App), such as\n   * `myapp://moonpay-return`. Without it the customer switches back to your\n   * app themselves. Mount-time only.\n   */\n  linkReturnUrl?: string;\n  /**\n   * Render nothing visible and process the quote on load, the way the\n   * deprecated `<MoonPayBuyFrame>` did. Mount-time only.\n   */\n  headless?: boolean;\n  /** Callback for buy button lifecycle events. */\n  onEvent?: (event: BuyButtonSdk.Event) => void;\n  /** Container style. Defaults to height 48. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline card/buy button. Render it wherever it should appear in your layout. */\nexport function MoonPayBuyButton({\n  quote,\n  externalTransactionId,\n  applePayButtonSettings,\n  googlePayButtonSettings,\n  linkReturnUrl,\n  headless,\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayBuyButtonProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={headless ? headlessBuyButtonSpec : buyButtonSpec}\n      props={{\n        quote,\n        externalTransactionId,\n        applePayButtonSettings,\n        googlePayButtonSettings,\n        linkReturnUrl,\n      }}\n      style={style}\n      defaultStyle={{ height: 48 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as BuySdk from '@moonpay/platform-protocol/sdks/buy';\nimport type { WebViewProps } from 'react-native-webview';\nimport { buySpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayBuyFrameProps {\n  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. Mount-time only. */\n  externalTransactionId?: string;\n  /** Callback for buy frame lifecycle events. */\n  onEvent?: (event: BuySdk.Event) => void;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/**\n * Headless buy frame (renders nothing visible). The declarative alternative to client.setupBuy().\n * @deprecated Render `<MoonPayBuyButton headless>` instead. The buy frame is being removed.\n */\nexport function MoonPayBuyFrame({\n  quote,\n  externalTransactionId,\n  onEvent,\n  webViewProps,\n}: MoonPayBuyFrameProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={buySpec}\n      props={{ quote, externalTransactionId }}\n      defaultStyle={{}}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as ChallengeSdk from '@moonpay/platform-protocol/sdks/challenge';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { challengeSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayChallengeProps {\n  /** Full challenge URL received from a frame's `challenge` event. Mount-time only. */\n  url: string;\n  /**\n   * Finish an Apple Pay / Google Pay buy on your own buy button instead of\n   * inside the challenge frame. When the buy challenges are resolved, the\n   * frame sends `resolved` instead of `complete`: unmount this component and\n   * show your buy button again so the customer taps it to pay. If the frame\n   * can't hand the token over, it still finishes with `complete`.\n   * Defaults to `false`. Mount-time only.\n   */\n  resume?: boolean;\n  /** Callback for challenge lifecycle events. */\n  onEvent?: (event: ChallengeSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline 3DS/challenge frame. Mount it when a payment frame emits a `challenge` event. */\nexport function MoonPayChallenge({\n  url,\n  resume,\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayChallengeProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={challengeSpec}\n      props={{ url, resume }}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as ConnectSdk from '@moonpay/platform-protocol/sdks/connect';\nimport type { ThemeOptions } from '@moonpay/platform-sdk-core';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { connectSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayConnectProps {\n  /** Theme for this connect frame. Each option set here overrides the same option on the provider-level `theme`. Mount-time only. */\n  theme?: ThemeOptions;\n  /** Callback for connect lifecycle events. */\n  onEvent?: (event: ConnectSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline connect frame. On an active completion, credentials are applied to the shared client automatically. */\nexport function MoonPayConnect({\n  theme,\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayConnectProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={connectSpec}\n      props={{ theme }}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type { WebViewProps } from 'react-native-webview';\nimport type { ConnectionCheckEvent } from '../frame-specs.js';\nimport { connectionCheckSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayConnectionCheckProps {\n  /** Pass `true` for headless / Identity-API integrations. Mount-time only. */\n  skipKyc?: boolean;\n  /** Emits `complete` with the Connection, or `error`. */\n  onEvent?: (event: ConnectionCheckEvent) => void;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/**\n * Headless connection check (renders nothing visible). The declarative\n * alternative to client.getConnection() — on an active connection,\n * credentials are applied to the shared client automatically.\n */\nexport function MoonPayConnectionCheck({\n  skipKyc,\n  onEvent,\n  webViewProps,\n}: MoonPayConnectionCheckProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={connectionCheckSpec}\n      props={{ skipKyc }}\n      defaultStyle={{}}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type { WebViewProps } from 'react-native-webview';\nimport type { ConnectionResetEvent } from '../frame-specs.js';\nimport { connectionResetSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayConnectionResetProps {\n  /** Callback for connection reset lifecycle events. */\n  onEvent?: (event: ConnectionResetEvent) => void;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Headless reset frame (renders nothing visible). The declarative alternative to client.resetConnection(). */\nexport function MoonPayConnectionReset({\n  onEvent,\n  webViewProps,\n}: MoonPayConnectionResetProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={connectionResetSpec}\n      props={{}}\n      defaultStyle={{}}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as CustomerExportSdk from '@moonpay/platform-protocol/sdks/customer-export';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { customerExportSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayCustomerExportProps {\n  /** Callback for customer-export lifecycle events. */\n  onEvent?: (event: CustomerExportSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline customer-export consent frame — embed export consent capture in your own layout. */\nexport function MoonPayCustomerExport({\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayCustomerExportProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={customerExportSpec}\n      props={{}}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as GooglePaySdk from '@moonpay/platform-protocol/sdks/google-pay';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { googlePaySpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\n/** @deprecated Use `MoonPayBuyButtonProps`. The Google Pay frame is being removed. */\nexport interface MoonPayGooglePayButtonProps {\n  /** Quote signature from getQuote(). Reactive — updates are pushed via setQuote without remounting. */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. Mount-time only. */\n  externalTransactionId?: string;\n  /** Callback for Google Pay lifecycle events. */\n  onEvent?: (event: GooglePaySdk.Event) => void;\n  /** Container style. Defaults to height 48. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/**\n * Inline Google Pay button. Render it wherever it should appear in your layout.\n * @deprecated Render `<MoonPayBuyButton>` instead. It renders the Google Pay button for a Google Pay quote. The Google Pay frame is being removed.\n */\nexport function MoonPayGooglePayButton({\n  quote,\n  externalTransactionId,\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayGooglePayButtonProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={googlePaySpec}\n      props={{ quote, externalTransactionId }}\n      style={style}\n      defaultStyle={{ height: 48 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n","import type * as WidgetSdk from '@moonpay/platform-protocol/sdks/widget';\nimport type { ViewStyle } from 'react-native';\nimport type { WebViewProps } from 'react-native-webview';\nimport { widgetSpec } from '../frame-specs.js';\nimport { MoonPayFrameView } from '../frame-view.js';\n\nexport interface MoonPayWidgetProps {\n  /** Quote signature from getQuote(). Mount-time only — changing it reloads the widget. */\n  quote: string;\n  /** Partner-assigned identifier for this transaction attempt. Mount-time only. */\n  externalTransactionId?: string;\n  /** Callback for widget lifecycle events. */\n  onEvent?: (event: WidgetSdk.Event) => void;\n  /** Container style. Defaults to flex: 1. */\n  style?: ViewStyle;\n  /** Advanced props forwarded to the underlying react-native-webview. `ref`, `source`, and `onMessage` are SDK-managed. */\n  webViewProps?: Partial<WebViewProps>;\n}\n\n/** Inline widget frame. Render it wherever it should appear in your layout. */\nexport function MoonPayWidget({\n  quote,\n  externalTransactionId,\n  onEvent,\n  style,\n  webViewProps,\n}: MoonPayWidgetProps): JSX.Element {\n  return (\n    <MoonPayFrameView\n      spec={widgetSpec}\n      props={{ quote, externalTransactionId }}\n      style={style}\n      defaultStyle={{ flex: 1 }}\n      onEvent={onEvent}\n      webViewProps={webViewProps}\n    />\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,IAAAA,qBAAoD;;;ACzBpD,wBAGO;AAaP,+BAWO;;;ACtCP,IAAM,iBAAiB;AACvB,IAAM,4BAA4B,oBAAI,IAAI,CAAC,cAAc,QAAQ,QAAQ,YAAY,MAAM,CAAC;AAMrF,SAAS,iBAAiB,OAAiC;AAChE,MAAI,OAAO,UAAU,YAAY,MAAM,SAAS,eAAgB,QAAO;AACvE,QAAM,SAAS,6BAA6B,KAAK,KAAK,IAAI,CAAC;AAC3D,SAAO,WAAW,UAAa,CAAC,0BAA0B,IAAI,OAAO,YAAY,CAAC;AACpF;;;ADwCO,SAAS,oBACd,MACA,WACe;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A,MACC,MAAM;AAAA,MACN,OAAO,EAAE,OAAO,sBAAsB;AAAA,MACtC;AAAA,MACA,cAAc,EAAE,MAAM,EAAE;AAAA,MACxB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":["import_connection","import_react","import_react_native","WebView","import_platform_sdk_core","import_platform_sdk_core","import_platform_sdk_core","import_react","import_result","import_result","import_result","import_result","import_result","import_platform_sdk_core","import_result","import_result","import_result","import_result","import_result","import_result","import_react","import_react_native","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}