{"version":3,"file":"ui.mjs","sources":["../../../../../../../../core/src/public/b2b/ui.ts"],"sourcesContent":["import { Values } from '../../utils';\n\n/**\n * The authentication methods we support through our UI.\n * Currently we support `emailMagicLinks`, `emailOtp`, `sso`, `passwords`, and `oauth`.\n */\n\nexport const AuthFlowType = {\n  Discovery: 'Discovery',\n  Organization: 'Organization',\n  PasswordReset: 'PasswordReset',\n} as const;\n\nexport type AuthFlowType = Values<typeof AuthFlowType>;\n\nexport const RedirectURLType = {\n  ResetPassword: 'reset_password',\n} as const;\n\nexport type RedirectURLType = Values<typeof RedirectURLType>;\n\n/**\n * The OAuth providers we support in our B2B OAuth product.\n */\nexport const B2BOAuthProviders = {\n  Google: 'google',\n  Microsoft: 'microsoft',\n  HubSpot: 'hubspot',\n  Slack: 'slack',\n  GitHub: 'github',\n} as const;\nexport type B2BOAuthProviders = Values<typeof B2BOAuthProviders>;\n\n/**\n * The options for email magic links. This is used if you've enabled the `emailMagicLinks` product\n * in your configuration.\n */\n\nexport type B2BEmailMagicLinksOptions = {\n  loginRedirectURL?: string;\n  signupRedirectURL?: string;\n  discoveryRedirectURL?: string;\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  /**\n   * @param domainHint - An optional hint indicating what domain the email will be sent from.\n   * This field is only required if your project uses more than one custom domain to send emails.\n   */\n  domainHint?: string;\n  locale?: string;\n  /**\n   * The number of minutes a login Magic Link is valid for. Min: 5, Max: 10080.\n   * @default 60\n   */\n  loginExpirationMinutes?: number;\n  /**\n   * The number of minutes a signup Magic Link is valid for. Min: 5, Max: 10080.\n   * @default 60\n   */\n  signupExpirationMinutes?: number;\n  /**\n   * The number of minutes a Discovery Magic Link is valid for. Min: 5, Max: 10080.\n   * @default 60\n   */\n  discoveryExpirationMinutes?: number;\n};\n\n/**\n * The options for SSO. This is used if you've enabled the `sso` product\n * in your configuration.\n */\n\nexport type B2BSSOOptions = {\n  loginRedirectURL?: string;\n  signupRedirectURL?: string;\n  /**\n   * An optional mapping of provider specific values to pass through as query params to the SSO provider.\n   * Currently supported in OIDC SSO flows only.\n   */\n  providerParams?: Record<string, string>;\n};\n\n/**\n * The options for OAuth. This is required if you've enabled the `oauth` product\n * in your configuration.\n */\n\nexport type B2BOAuthOptions = {\n  loginRedirectURL?: string;\n  signupRedirectURL?: string;\n  discoveryRedirectURL?: string;\n  /** @deprecated Use customScopes in B2BOAuthProviderConfig instead */\n  customScopes?: string[];\n  providers: B2BOAuthProviderConfig[];\n  /** @deprecated Use providerParams in B2BOAuthProviderConfig instead */\n  providerParams?: Record<string, string>;\n  locale?: string;\n};\n\n/**\n * Details about the OAuth provider you wish to use. Each B2BOAuthProviderConfig object can be either a plain\n * B2BOAuthProviders string (e.g. 'google'), or  an object with a type key that determines the type of provider. For\n * Google OAuth, you can optionally specify the one_tap property to display Google One Tap.\n */\nexport type B2BOAuthProviderConfig =\n  | B2BOAuthProviders\n  | {\n      type: typeof B2BOAuthProviders.Google;\n      customScopes?: string[];\n      providerParams?: Record<string, string>;\n\n      one_tap?: boolean;\n      /**\n       * Whether to cancel the One Tap prompt when the user taps outside of it.\n       * This is only applicable if one_tap is true.\n       */\n      cancel_on_tap_outside?: boolean;\n    }\n  | {\n      type: Exclude<B2BOAuthProviders, typeof B2BOAuthProviders.Google>;\n      customScopes?: string[];\n      providerParams?: Record<string, string>;\n    };\n\n/**\n * The options for Passwords. This is used if you've enabled the `passwords` product\n * in your configuration.\n */\n\nexport type B2BPasswordOptions = {\n  loginRedirectURL?: string;\n  resetPasswordRedirectURL?: string;\n  resetPasswordExpirationMinutes?: number;\n  resetPasswordTemplateId?: string;\n  discoveryRedirectURL?: string;\n  verifyEmailTemplateId?: string;\n  locale?: string;\n};\n\nexport type B2BEmailOTPOptions = {\n  loginTemplateId?: string;\n  signupTemplateId?: string;\n  locale?: string;\n};\n\nexport type B2BSMSOTPOptions = {\n  locale?: string;\n};\n\nexport type DirectLoginForSingleMembershipConfig = {\n  /**\n   * Whether or not direct login for single membership is enabled.\n   */\n  status: boolean;\n  /**\n   * If enabled, logs user in directly even if they have pending invite to a different organization\n   */\n  ignoreInvites: boolean;\n  /**\n   * If enabled, logs user in directly even if they have organizations they could join via JIT provisioning\n   */\n  ignoreJitProvisioning: boolean;\n};\n\nexport const B2BMFAProducts = {\n  smsOtp: 'smsOtp',\n  totp: 'totp',\n} as const;\nexport type B2BMFAProducts = Values<typeof B2BMFAProducts>;\n"],"names":["AuthFlowType","Discovery","Organization","PasswordReset","RedirectURLType","ResetPassword","B2BOAuthProviders","Google","Microsoft","HubSpot","Slack","GitHub","B2BMFAProducts","smsOtp","totp"],"mappings":"AAEA;;;UAKaA,YAAAA,GAAe;IAC1BC,SAAAA,EAAW,WAAA;IACXC,YAAAA,EAAc,cAAA;IACdC,aAAAA,EAAe;AACjB;MAIaC,eAAAA,GAAkB;IAC7BC,aAAAA,EAAe;AACjB;AAIA;;UAGaC,iBAAAA,GAAoB;IAC/BC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,WAAA;IACXC,OAAAA,EAAS,SAAA;IACTC,KAAAA,EAAO,OAAA;IACPC,MAAAA,EAAQ;AACV;MAsIaC,cAAAA,GAAiB;IAC5BC,MAAAA,EAAQ,QAAA;IACRC,IAAAA,EAAM;AACR;;;;"}