{"version":3,"file":"StytchLogin.mjs","sources":["../../../../../../../../../web/src/ui/react/b2c/StytchLogin.tsx"],"sourcesContent":["import { Callbacks, StringsOptions, StytchProjectConfigurationInput } from '@stytch/core/public';\n\nimport { PresentationConfig, StytchLoginConfig } from '../../../types';\nimport { AppContainer } from '../../b2c/AppContainer';\nimport { createB2CComponent } from '../bindings/createB2CComponent';\n\nexport interface StytchProps<\n  TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n> extends StringsOptions {\n  /**\n   * A {@link StytchLoginConfig} object. Add products and product-specific config to this object to change the login methods shown.\n   *\n   * @example\n   * {\n   *   products: [Products.crypto, Products.otp]\n   * }\n   *\n   * @example\n   * {\n   *   products: [Products.emailMagicLinks]\n   *   emailMagicLinksOptions: {\n   *     loginRedirectURL: 'https://example.com/authenticate',\n   *     signupRedirectURL: 'https://example.com/authenticate',\n   *   }\n   * }\n   *\n   * @example\n   * {\n   *   products: [Products.oauth]\n   *   oauthOptions: {\n   *   providers: [\n   *       { type: 'google', one_tap: true, position: 'embedded' },\n   *       { type: 'microsoft' },\n   *       { type: 'apple' },\n   *       { type: 'facebook' },\n   *     ],\n   *   }\n   * }\n   */\n  config: StytchLoginConfig;\n  /**\n   * An optional {@link PresentationConfig} to customize the UI presentation.\n   */\n  presentation?: PresentationConfig;\n  /**\n   * An optional {@link Callbacks} object.\n   *\n   * @example\n   * {\n   *   onError: ({message}) => {\n   *      console.error('Stytch login screen error', message)\n   *   }\n   * }\n   *\n   * @example\n   * {\n   *   onEvent: ({type, data}) => {\n   *     if(type === StytchEventType.CryptoWalletAuthenticate) {\n   *       console.log('Logged in with crypto wallet', data);\n   *     }\n   *   }\n   * }\n   */\n  callbacks?: Callbacks<TProjectConfiguration>;\n}\n\n/**\n * The Stytch Login Screen component.\n * This component can only be used with a Stytch UI Client\n * passed into the StytchProvider.\n *\n * See the {@link https://stytch.com/docs/sdks online reference}\n *\n * @example\n * <StytchLogin\n *   config={{\n *     products: [Products.emailMagicLinks, Products.oauth],\n *     emailMagicLinksOptions: {\n *       loginRedirectURL: 'https://example.com/authenticate',\n *       signupRedirectURL: 'https://example.com/authenticate',\n *     },\n *     oauthOptions: {\n *      providers: [{ type: OAuthProviders.Google }, { type: OAuthProviders.Microsoft }],\n *    },\n *   }}\n *   presentation={{\n *     theme: { primary: '#0577CA' },\n *     options: {},\n *   }}\n *   callbacks={{\n *     onEvent: (event) => console.log(event)\n *   }}\n * />\n */\nexport const StytchLogin = /* @__PURE__ */ createB2CComponent('StytchLogin', AppContainer);\n"],"names":["StytchLogin","createB2CComponent","AppContainer"],"mappings":";;;AAkEA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BC,IACM,MAAMA,aAAAA,mBAA8BC,kBAAAA,CAAmB,eAAeC,YAAAA;;;;"}