{"version":3,"file":"Stytch.mjs","sources":["../../../../../../../../../web/src/ui/react/b2b/Stytch.tsx"],"sourcesContent":["import { Callbacks, StringsOptions, StytchProjectConfigurationInput } from '@stytch/core/public';\n\nimport { PresentationConfig, StytchB2BUIConfig } from '../../../types';\nimport { AppContainer } from '../../b2b/App';\nimport { createB2BComponent } from '../bindings/createB2BComponent';\n\nexport interface StytchB2BProps<\n  TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n> extends StringsOptions {\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 error', message)\n   *   }\n   * }\n   *\n   * @example\n   * {\n   *   onEvent: ({type, data}) => {\n   *     if(type === StytchEventType.B2BMagicLinkAuthenticate) {\n   *       console.log('Logged in with', data);\n   *     }\n   *   }\n   * }\n   */\n  callbacks?: Callbacks<TProjectConfiguration>;\n  /**\n   * A {@link StytchB2BUIConfig} object. Add products and product-specific config to this object to change the login methods shown.\n   *\n   *\n   * @example\n   * {\n   *   products: [B2BProducts.emailMagicLinks],\n   *   authFlowType: \"Discovery\",\n   *   emailMagicLinksOptions: {\n   *     discoveryRedirectURL: 'https://example.com/authenticate',\n   *   },\n   *   sessionOptions: {\n   *     sessionDurationMinutes: 60,\n   *   },\n   * }\n   *\n   * @example\n   * {\n   *   products: [B2BProducts.emailMagicLinks, B2BProducts.sso],\n   *   authFlowType: \"Organization\",\n   *   emailMagicLinksOptions: {\n   *     loginRedirectURL: 'https://example.com/authenticate',\n   *     signupRedirectURL: 'https://example.com/authenticate',\n   *   },\n   *   ssoOptions: {\n   *     loginRedirectURL: 'https://example.com/authenticate',\n   *     signupRedirectURL: 'https://example.com/authenticate',\n   *   },\n   *   sessionOptions: {\n   *     sessionDurationMinutes: 60,\n   *   },\n   * }\n   */\n  config: StytchB2BUIConfig;\n}\n\n/**\n * The Stytch B2B UI component.\n * This component can only be used with a Stytch B2B UI Client\n * passed into the StytchB2BProvider.\n *\n * See the {@link https://stytch.com/docs/b2b/sdks online reference}\n *\n * @example\n * <StytchB2B\n *   config={{\n *     authFlowType: \"Organization\",\n *     emailMagicLinksOptions: {\n *       loginRedirectURL: 'https://example.com/authenticate',\n *       signupRedirectURL: 'https://example.com/authenticate',\n *     },\n *     ssoOptions: {\n *       loginRedirectURL: 'https://example.com/authenticate',\n *       signupRedirectURL: 'https://example.com/authenticate',\n *     },\n *     sessionOptions: {\n *       sessionDurationMinutes: 60,\n *     }\n *   }}\n *   presentation={{\n *     theme: { primary: '#0577CA' },\n *     options: {},\n *   }}\n *   callbacks={{\n *     onEvent: (event) => console.log(event)\n *   }}\n * />\n */\nexport const StytchB2B = /* @__PURE__ */ createB2BComponent('StytchB2B', AppContainer);\n"],"names":["StytchB2B","createB2BComponent","AppContainer"],"mappings":";;;AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BC,IACM,MAAMA,WAAAA,mBAA4BC,kBAAAA,CAAmB,aAAaC,YAAAA;;;;"}