@stytch/vanilla-js 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +23 -14
  2. package/dist/cjs/adminPortal/index.cjs +4 -2
  3. package/dist/cjs/adminPortal/index.cjs.map +1 -1
  4. package/dist/cjs/b2b/index.cjs +21 -29
  5. package/dist/cjs/b2b/index.cjs.map +1 -1
  6. package/dist/cjs/index.cjs +1 -1
  7. package/dist/cjs/{shadcn-CyIAo-yO.js → shadcn-BmPw6Q7O.js} +6 -37
  8. package/dist/cjs/shadcn-BmPw6Q7O.js.map +1 -0
  9. package/dist/cjs-dev/adminPortal/index.cjs +4 -2
  10. package/dist/cjs-dev/adminPortal/index.cjs.map +1 -1
  11. package/dist/cjs-dev/b2b/index.cjs +21 -29
  12. package/dist/cjs-dev/b2b/index.cjs.map +1 -1
  13. package/dist/cjs-dev/index.cjs +1 -1
  14. package/dist/cjs-dev/{shadcn-Bzbol4Ww.js → shadcn-Dqlb9O22.js} +6 -37
  15. package/dist/cjs-dev/shadcn-Dqlb9O22.js.map +1 -0
  16. package/dist/esm/_virtual/index3.mjs +3 -5
  17. package/dist/esm/_virtual/index3.mjs.map +1 -1
  18. package/dist/esm/_virtual/index4.mjs +5 -3
  19. package/dist/esm/_virtual/index4.mjs.map +1 -1
  20. package/dist/esm/packages/web/src/adminPortal/components/Autocomplete.mjs +4 -2
  21. package/dist/esm/packages/web/src/adminPortal/components/Autocomplete.mjs.map +1 -1
  22. package/dist/esm/packages/web/src/adminPortal/utils/theme.mjs +1 -1
  23. package/dist/esm/packages/web/src/ui/b2b/MfaState.mjs +0 -2
  24. package/dist/esm/packages/web/src/ui/b2b/MfaState.mjs.map +1 -1
  25. package/dist/esm/packages/web/src/ui/b2b/reducer/mfa.mjs +0 -29
  26. package/dist/esm/packages/web/src/ui/b2b/reducer/mfa.mjs.map +1 -1
  27. package/dist/esm/packages/web/src/ui/b2b/screens/Discovery.mjs +1 -0
  28. package/dist/esm/packages/web/src/ui/b2b/screens/Discovery.mjs.map +1 -1
  29. package/dist/esm/packages/web/src/ui/b2b/screens/TOTPEnrollQRScreen.mjs +22 -31
  30. package/dist/esm/packages/web/src/ui/b2b/screens/TOTPEnrollQRScreen.mjs.map +1 -1
  31. package/dist/esm/packages/web/src/ui/components/atoms/Watermark.mjs +1 -1
  32. package/dist/esm/packages/web/src/ui/components/atoms/Watermark.mjs.map +1 -1
  33. package/dist/esm/packages/web/src/ui/components/atoms/Watermark.module.css.mjs +2 -2
  34. package/dist/esm/packages/web/src/ui/components/mixins/Root.module.css.mjs +1 -1
  35. package/dist/esm/packages/web/src/ui/components/molecules/MainContainer.module.css.mjs +1 -1
  36. package/dist/esm/packages/web/src/utils/crypto.mjs +1 -1
  37. package/dist/esm-dev/packages/web/src/adminPortal/components/Autocomplete.mjs +4 -2
  38. package/dist/esm-dev/packages/web/src/adminPortal/components/Autocomplete.mjs.map +1 -1
  39. package/dist/esm-dev/packages/web/src/ui/b2b/MfaState.mjs +0 -2
  40. package/dist/esm-dev/packages/web/src/ui/b2b/MfaState.mjs.map +1 -1
  41. package/dist/esm-dev/packages/web/src/ui/b2b/reducer/mfa.mjs +0 -29
  42. package/dist/esm-dev/packages/web/src/ui/b2b/reducer/mfa.mjs.map +1 -1
  43. package/dist/esm-dev/packages/web/src/ui/b2b/screens/Discovery.mjs +1 -0
  44. package/dist/esm-dev/packages/web/src/ui/b2b/screens/Discovery.mjs.map +1 -1
  45. package/dist/esm-dev/packages/web/src/ui/b2b/screens/TOTPEnrollQRScreen.mjs +22 -31
  46. package/dist/esm-dev/packages/web/src/ui/b2b/screens/TOTPEnrollQRScreen.mjs.map +1 -1
  47. package/dist/esm-dev/packages/web/src/ui/components/atoms/Watermark.mjs +1 -1
  48. package/dist/esm-dev/packages/web/src/ui/components/atoms/Watermark.mjs.map +1 -1
  49. package/dist/esm-dev/packages/web/src/ui/components/atoms/Watermark.module.css.mjs +2 -2
  50. package/dist/esm-dev/packages/web/src/ui/components/mixins/Root.module.css.mjs +1 -1
  51. package/dist/esm-dev/packages/web/src/ui/components/molecules/MainContainer.module.css.mjs +1 -1
  52. package/dist/iife/adminPortal/index.js.map +1 -1
  53. package/dist/iife/b2b/index.js +5 -5
  54. package/dist/iife/b2b/index.js.map +1 -1
  55. package/dist/iife/index.js +1 -1
  56. package/dist/iife/index.js.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/cjs/shadcn-CyIAo-yO.js.map +0 -1
  59. package/dist/cjs-dev/shadcn-Bzbol4Ww.js.map +0 -1
@@ -11,8 +11,8 @@ ${n}
11
11
  See ${a} for more information.
12
12
  `+(o?`request_id: ${o}
13
13
  `:"")+(i?`Details:
14
- `+JSON.stringify(i)+"\n":"")),this.error_type=r,this.error_message=n,this.error_url=a,this.request_id=o,this.status_code=t,this.error_details=i}static from(e){return e instanceof v?e:e&&"object"==typeof e&&"number"==typeof e.status_code&&"string"==typeof e.error_type&&"string"==typeof e.error_message&&"string"==typeof e.error_url?new v({status_code:e.status_code,error_type:e.error_type,error_message:e.error_message,error_url:e.error_url,request_id:"string"==typeof e.request_id?e.request_id:void 0,error_details:"object"==typeof e.error_details?e.error_details:void 0}):new v({status_code:400,error_type:"unknown_error",error_message:e instanceof Error?e.message:"Unknown error: "+String(e),error_url:"",request_id:void 0,error_details:void 0})}}class b extends g{options;constructor(e,t,r){super(e,t),this.options=r}}class w extends b{constructor(){super("NoCurrentSessionError","There is no session currently available. Make sure the user is authenticated with a valid session.")}}class k extends b{nativeStack;constructor(e){super(e.name?e.name:"Internal Error",e.message?e.message:"An internal error has occurred. Please contact Stytch if this occurs."),this.nativeStack=e.nativeStackAndroid||e.nativeStackIOS}}class S extends b{constructor(){super("NoBiometricsRegistrationError","There is no biometric registration available. Authenticate with another method and add a new biometric registration first.")}}class E extends b{constructor(){super("BiometricsUnavailableError","Biometrics is not available on the device.")}}class C extends b{constructor(){super("KeyInvalidatedError","The biometrics enrollment on the device has changed.")}}class P extends b{constructor(){super("KeystoreUnavailableError","The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.")}}class T extends b{constructor(){super("NoBiometricsEnrolledError","There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.")}}class O extends b{constructor(){super("UserCancellationError","The user canceled the prompt. Ask the user to try again.")}}class A extends b{constructor(){super("UserLockedOutError","The user has been locked out due to too many failed attempts. Ask the user to try again later.")}}class x extends b{constructor(){super("DeviceCredentialsNotAllowedError","The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.")}}class D extends b{constructor(){super("MissingAuthorizationCredentialIDTokenError","The authorization credential is missing an ID token.")}}class z extends b{constructor(){super("InvalidAuthorizationCredentialError","The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.")}}class M extends b{constructor(){super("NoCredentialsPresentError","The user did not provide credentials for a Google OneTap attempt")}}class I extends b{constructor(){super("MissingPublicKeyError","Failed to retrieve the public key. Add a new biometric registration.")}}class R extends b{constructor(){super("ChallengeSigningFailedError","Failed to sign the challenge with the key.")}}class L extends b{constructor(){super("SDKNotConfiguredError","Stytch client is not confiured. You must call the configure method before using the SDK")}}class B extends b{constructor(){super("FailedCodeChallengeError","Failed to create a code challenge")}}class N extends b{constructor(){super("PasskeysUnsupportedError","Passkeys are not supported on this device")}}class U extends b{constructor(){super("FailedToDecryptDataError","Failed to decrypt user data")}}class F extends b{constructor(){super("BiometricsFailedError","Biometric authentication failed")}}class q extends b{constructor(){super("InvalidStartUrlError","The start URL was invalid or improperly formatted.")}}class H extends b{constructor(){super("InvalidRedirectSchemeError","The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.")}}class K extends b{constructor(){super("MissingUrlError","The underlying web authentication service failed to return a URL.")}}class j extends b{constructor(){super("InvalidCredentialTypeError","The public key credential type was not of the expected type.")}}class $ extends b{constructor(){super("MissingAttestationObjectError","The public key credential is missing the attestation object.")}}class V extends b{constructor(){super("JSONDataNotConvertibleToStringError","JSON data unable to be converted to String type.")}}class W extends b{constructor(){super("RandomNumberGenerationFailed","Random number generation failed")}}class G extends b{constructor(){super("PasskeysInvalidEncoding","Invalid passkey encoding")}}class Y extends b{constructor(){super("PasskeysMisconfigured","Passkeys are misconfigured. Verify that you have added the correct associated domain for your application, and that the signing information is correct.")}}class Z extends b{constructor(){super("SignInWithAppleMisconfigured","Sign In With Apple is misconfigured. Verify that you have correctly configured Apple OAuth in the Stytch Dashboard and added the Sign In With Apple capability to your project.")}}class J extends b{constructor(){super("MissingCipherIv","The expected cipher Iv was not found when attempting to decrypt an existing biometric key.")}}class Q extends b{constructor(){super("InvalidPrivateKeyLength","The private key was of an incorrect length.")}}class X extends b{constructor(){super("BiometricRegistrationIdIsNullOrBlank","Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.")}}class ee extends b{constructor(){super("DFPNotConfigured","You have attempted to retrieve a telemetry ID before the DFP client has been configured.")}}class et extends b{constructor(e){super("IDPOAuthFlowMissingParamError",e)}}let er={embedded:"embedded",floating:"floating",embeddedOnly:"embeddedOnly",floatingOrEmbedded:"floatingOrEmbedded",forceLegacyEmbedded:"forceLegacyEmbedded"};var en,ea,eo,ei,es,el,ec,ed,eu=((ea={}).MagicLinkLoginOrCreateEvent="MAGIC_LINK_LOGIN_OR_CREATE",ea.OTPsLoginOrCreateEvent="OTP_LOGIN_OR_CREATE",ea.OTPsAuthenticate="OTP_AUTHENTICATE",ea.CryptoWalletAuthenticateStart="CRYPTO_WALLET_AUTHENTICATE_START",ea.CryptoWalletAuthenticate="CRYPTO_WALLET_AUTHENTICATE",ea.PasswordCreate="PASSWORD_CREATE",ea.PasswordAuthenticate="PASSWORD_AUTHENTICATE",ea.PasswordResetByEmailStart="PASSWORD_RESET_BY_EMAIL_START",ea.PasswordResetByEmail="PASSWORD_RESET_BY_EMAIL",ea.PasskeyRegister="PASSKEY_REGISTER",ea.PasskeyAuthenticate="PASSKEY_AUTHENTICATE",ea.PasskeySkip="PASSKEY_SKIP",ea.PasskeyDone="PASSKEY_DONE",ea.AuthenticateFlowComplete="AUTHENTICATE_FLOW_COMPLETE",ea.OAuthAuthorizeFlowStart="OAUTH_AUTHORIZE_FLOW_START",ea.OAuthAuthorizeFlowComplete="OAUTH_AUTHORIZE_FLOW_COMPLETE",ea.OAuthAuthorizeFlowConsentDenied="OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED",ea.B2BMagicLinkEmailLoginOrSignup="B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP",ea.B2BMagicLinkAuthenticate="B2B_MAGIC_LINK_AUTHENTICATE",ea.B2BMagicLinkEmailDiscoverySend="B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND",ea.B2BMagicLinkDiscoveryAuthenticate="B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE",ea.B2BSSOStart="B2B_SSO_START",ea.B2BSSOAuthenticate="B2B_SSO_AUTHENTICATE",ea.B2BSSODiscoverConnections="B2B_SSO_DISCOVER_CONNECTIONS",ea.B2BOAuthAuthenticate="B2B_OAUTH_AUTHENTICATE",ea.B2BOAuthDiscoveryAuthenticate="B2B_OAUTH_DISCOVERY_AUTHENTICATE",ea.B2BDiscoveryOrganizationsCreate="B2B_DISCOVERY_ORGANIZATIONS_CREATE",ea.B2BDiscoveryIntermediateSessionExchange="B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE",ea.B2BPasswordAuthenticate="B2B_PASSWORD_AUTHENTICATE",ea.B2BPasswordDiscoveryAuthenticate="B2B_PASSWORD_DISCOVERY_AUTHENTICATE",ea.B2BPasswordResetByEmailStart="B2B_PASSWORD_RESET_BY_EMAIL_START",ea.B2BPasswordResetByEmail="B2B_PASSWORD_RESET_BY_EMAIL",ea.B2BPasswordResetBySession="B2B_PASSWORD_RESET_BY_SESSION",ea.B2BSMSOTPSend="B2B_SMS_OTP_SEND",ea.B2BSMSOTPAuthenticate="B2B_SMS_OTP_AUTHENTICATE",ea.B2BTOTPCreate="B2B_TOTP_CREATE",ea.B2BTOTPAuthenticate="B2B_TOTP_AUTHENTICATE",ea.B2BRecoveryCodesRecover="B2B_RECOVERY_CODES_RECOVER",ea.B2BPasswordDiscoveryResetStart="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START",ea.B2BDiscoveryPasswordReset="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL",ea.B2BImpersonationAuthenticate="B2B_IMPERSONATION_AUTHENTICATE",ea.B2BOTPsEmailAuthenticate="B2B_OTPS_EMAIL_AUTHENTICATE",ea.B2BOTPsEmailDiscoveryAuthenticate="B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE",ea.B2BOTPsEmailDiscoverySend="B2B_OTPS_EMAIL_DISCOVERY_SEND",ea.B2BOTPsEmailLoginOrSignup="B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP",ea.B2BOrganizationsGetBySlug="B2B_ORGANIZATIONS_GET_BY_SLUG",ea),eh=((e8={})[e8.emailMagicLinks=0]="emailMagicLinks",e8[e8.oauth=1]="oauth",e8[e8.otp=2]="otp",e8[e8.passwords=3]="passwords",e8),em=((e6={}).RequiredCaptcha="CAPTCHA required",e6);class ep extends Error{type;constructor(e){super(e),this.type=e}}async function e_({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o,retryCallback:i}){let s={method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o};try{return await eg(s)}catch(e){if(e instanceof ep)return s=await i(e,s),await eg(s);throw e}}async function eg({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o}){let i,s,l={Authorization:r,"Content-Type":"application/json","X-SDK-Client":n};a&&(l["X-SDK-Parent-Host"]=a);let c={method:e,headers:l,body:o&&JSON.stringify(o),credentials:"include"};try{i=await fetch(t,c)}catch(e){if("Failed to fetch"===e.message)throw new f("Unable to contact our servers.");throw e}if(i.status<=299)try{return(await i.json()).data}catch{throw new f("Invalid JSON response from our servers.")}if(200!==i.status&&i.headers.get("content-type")?.includes("application/json")){let e;try{e=await i.json()}catch{throw new f("Invalid or no response from server")}if("body"in e||"params"in e||"query"in e)throw new y(e);throw new v(e)}try{s=await i.text()}catch{throw new f("Invalid response from our servers.")}if(s.includes("Captcha required"))throw new ep("CAPTCHA required");throw new f("Invalid response from our servers.")}async function ef({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o}){let i={...o||{},__Authorization:r,"__X-SDK-Client":n};a&&(i["__X-SDK-Parent-Host"]=a);let s=Object.entries(i).map(([e,t])=>{let r=document.createElement("input");return r.type="hidden",r.name=e,r.value=t,r}),l=document.createElement("form");l.method=e,l.action=t,l.append(...s),document.body.appendChild(l),l.submit()}for(var ey=new Uint8Array(16),ev=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,eb=[],ew=0;ew<256;++ew)eb.push((ew+256).toString(16).substr(1));function ek(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(!e9&&!(e9="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e9(ey)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(eb[e[t+0]]+eb[e[t+1]]+eb[e[t+2]]+eb[e[t+3]]+"-"+eb[e[t+4]]+eb[e[t+5]]+"-"+eb[e[t+6]]+eb[e[t+7]]+"-"+eb[e[t+8]]+eb[e[t+9]]+"-"+eb[e[t+10]]+eb[e[t+11]]+eb[e[t+12]]+eb[e[t+13]]+eb[e[t+14]]+eb[e[t+15]]).toLowerCase();if(!("string"==typeof r&&ev.test(r)))throw TypeError("Stringified UUID is invalid");return r}(n)}let eS=e=>{try{let t=new URL(e);return`https://${t.hostname}`}catch{}try{let t=new URL(`https://${e}`);return`https://${t.hostname}`}catch{}},eE=["%c[Stytch]%c","background: #19303d; color: #13E5C0; padding: 2px;border-radius: 4px",""],eC=(...e)=>console.warn(...eE,...e),eP=(...e)=>console.error(...eE,...e),eT=function(e,t){if(e.length<=1)return[e,!1];let r=e.findIndex(t);if(-1===r)return[e,!1];let n=[...e];return n.unshift(...n.splice(r,1)),[n,!0]},eO=`
15
- You can find your public token at https://stytch.com/dashboard/api-keys.`,eA={US:"1",AX:"358",AS:"1684",AG:"1268",AI:"1264",AR:"54",AT:"43",AU:"61",BE:"32",BJ:"229",BO:"591",BR:"55",IO:"246",BN:"673",BG:"359",BF:"226",CM:"237",CA:"1",BQ:"599",CF:"236",CL:"56",CX:"61",CC:"61",CO:"57",CD:"243",CK:"682",CR:"506",HR:"385",CZ:"420",DK:"45",DO:"1829",EC:"593",SV:"503",EE:"372",SZ:"268",FK:"500",FI:"358",FR:"33",GF:"594",DE:"49",GH:"233",GR:"30",GD:"1473",GT:"502",GG:"44",GW:"245",GY:"592",HU:"36",IS:"354",IN:"91",IE:"353",IM:"44",IT:"39",JM:"1876",JP:"81",KZ:"7",KE:"254",KI:"686",KR:"82",LV:"371",LT:"370",LU:"352",MO:"853",MT:"356",MH:"692",MR:"222",MU:"230",YT:"262",MX:"52",MC:"377",ME:"382",NR:"674",NL:"31",NZ:"64",NI:"505",NF:"672",NO:"47",PA:"507",PY:"595",PE:"51",PN:"870",PL:"48",PT:"351",PR:"1",RO:"40",BL:"590",SH:"290",KN:"1869",LC:"1758",MF:"590",PM:"508",SM:"378",ST:"239",SC:"248",SX:"599",SK:"421",SI:"386",ZA:"27",SS:"211",ES:"34",SR:"597",SJ:"47",SE:"46",CH:"41",TW:"886",TZ:"255",TK:"690",TO:"676",TT:"1868",TR:"90",UA:"380",GB:"44",UM:"1",UY:"598",VA:"379",EH:"212"},ex={};async function eD(e,t){var r,n;return void 0!==ex[e]||(ex[e]=(r=e,n=t,new Promise((e,t)=>{var a;let o,i=function(e){let t=document.querySelectorAll(`script[src="${e}"]`);if(t[0])return t[0]}(r);if(i&&"true"===i.dataset.loaded)try{e(n())}catch(e){return t(Error(`${r} already loaded, but module was not found in global scope: ${e}`))}let s=(a=r,(o=document.createElement("script")).setAttribute("src",a),o.setAttribute("async","true"),o.setAttribute("defer","true"),document.head.appendChild(o),o);s.addEventListener("load",()=>{s.dataset.loaded="true";try{e(n())}catch(e){t(Error(`${r} was loaded, but module was not found in global scope: ${e}`))}}),s.addEventListener("error",e=>{t(Error(`${r} could not be loaded: ${e}`))})}))),ex[e]}class ez{bootstrapPromise;state;constructor(e,t,r,n,a=()=>Promise.resolve(void 0)){this.bootstrapPromise=n,this.state=n.then(async n=>n.runDFPProtectedAuth?(await eD(`${r}/telemetry.js`,()=>window.GetTelemetryID),{publicToken:e,dfpBackendURL:t,enabled:!0,mode:n.dfpProtectedAuthMode||"OBSERVATION",loaded:!0,executeRecaptcha:a}):{publicToken:e,dfpBackendURL:t,enabled:!1,loaded:!1,executeRecaptcha:a})}isEnabled=async()=>this.state.then(e=>e.enabled);getTelemetryID=async()=>{let{publicToken:e,enabled:t,dfpBackendURL:r}=await this.state;if(t)return await window.GetTelemetryID(e,`${r}/submit`)};getDFPTelemetryIDAndCaptcha=async()=>{let e,t,{enabled:r,executeRecaptcha:n,mode:a}=await this.state;return r||(t=await n()),"DECISIONING"===a?e=await this.getTelemetryID():"OBSERVATION"===a&&(e=await this.getTelemetryID(),t=await n()),{dfp_telemetry_id:e,captcha_token:t}};retryWithCaptchaAndDFP=async(e,t)=>{let{enabled:r,executeRecaptcha:n}=await this.state;if(e.type===em.RequiredCaptcha&&r)return t.body&&(t.body.dfp_telemetry_id=await this.getTelemetryID(),t.body.captcha_token=await n()),t;throw Error("Unable to query captcha and/or dfp telemetry ID")}}let eM=()=>({isEnabled:async()=>!1,getTelemetryID:async()=>void 0,getDFPTelemetryIDAndCaptcha:async()=>({dfp_telemetry_id:void 0,captcha_token:void 0}),retryWithCaptchaAndDFP:async()=>{throw Error("DFP protected auth is disabled")}});class eI{static inflate(e,t){let r=new e(t);return Object.assign(r,t),Object.setPrototypeOf(r,e.prototype),r}static unmarshall(e){if("name"in e)switch(e.name){case"SDKAPIUnreachableError":return eI.inflate(u,e);case"StytchSDKSchemaError":return eI.inflate(m,e);case"StytchAPIUnreachableError":return eI.inflate(f,e);case"StytchAPISchemaError":return eI.inflate(y,e);case"StytchSDKAPIError":return eI.inflate(p,e);case"StytchAPIError":return eI.inflate(v,e);case"TypeError":return eI.inflate(TypeError,e);case"SyntaxError":return eI.inflate(SyntaxError,e);case"ReferenceError":return eI.inflate(ReferenceError,e);case"RangeError":return eI.inflate(RangeError,e);case"EvalError":return eI.inflate(EvalError,e);case"URIError":return eI.inflate(URIError,e)}return eI.inflate(Error,e)}}class eR{maxBatchSize;logEventURL;batch;constructor(e){this.maxBatchSize=e.maxBatchSize,this.logEventURL=e.logEventURL,setInterval(this.flush.bind(this),e.intervalDurationMs),this.batch=[]}logEvent(e,t){this.batch.push({telemetry:e,event:t}),this.batch.length>=this.maxBatchSize&&this.flush()}async flush(){if(!this.batch.length)return;let e=this.batch;this.batch=[];try{await fetch(this.logEventURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}}let eL=(e,t,r)=>{let n=[];for(let[a,o]of Object.entries(r)){if(null==o)continue;let r=t[a];if(!o.startsWith("optional")||null!=r)switch(o){case"object":case"optionalObject":("object"!=typeof r||Array.isArray(r)||null===r)&&n.push(new h(e,`${a} must be an object.`));break;case"string":case"optionalString":"string"!=typeof r&&n.push(new h(e,`${a} must be a string.`));break;case"number":case"optionalNumber":"number"!=typeof r&&n.push(new h(e,`${a} must be a number.`));break;case"stringArray":case"optionalStringArray":Array.isArray(r)&&r.every(e=>"string"==typeof e)||n.push(new h(e,`${a} must be an array of strings.`));break;case"boolean":case"optionalBoolean":"boolean"!=typeof r&&n.push(new h(e,`${a} must be a boolean.`))}}if(n.length>0)if(1===n.length)throw n[0];else throw AggregateError(n)};class eB{_networkClient;_subscriptionService;organizations;intermediateSessions;constructor(e,t){this._networkClient=e,this._subscriptionService=t,this.organizations={list:async()=>this._networkClient.fetchSDK({url:"/b2b/discovery/organizations",body:{intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST"}),create:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.discovery.organizations.create",e,{session_duration_minutes:"number",organization_name:"optionalString",organization_slug:"optionalString",organization_logo_url:"optionalString",sso_jit_provisioning:"optionalString",email_allowed_domains:"optionalStringArray",email_invites:"optionalString",auth_methods:"optionalString",allowed_auth_methods:"optionalStringArray",mfa_policy:"optionalString"});let t={...e,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.fetchSDK({url:"/b2b/discovery/organizations/create",body:t,method:"POST"})})},this.intermediateSessions={exchange:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.discovery.intermediateSessions.exchange",e,{organization_id:"string",session_duration_minutes:"number",locale:"optionalString"});let t={...e,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.fetchSDK({url:"/b2b/discovery/intermediate_sessions/exchange",body:t,method:"POST"})})}}}class eN{_networkClient;constructor(e){this._networkClient=e}oauthAuthorizeStart=async e=>this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/start",method:"POST",body:e});oauthAuthorizeSubmit=async e=>this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/submit",method:"POST",body:e});oauthLogoutStart=async e=>this._networkClient.fetchSDK({url:"/b2b/oauth/logout/start",method:"POST",body:e})}class eU{_networkClient;_subscriptionService;dfpProtectedAuth;authenticate;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.impersonation.authenticate",e,{impersonation_token:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/impersonation/authenticate",body:{...e,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}}let eF=Promise.resolve({pkceRequiredForEmailMagicLinks:!1});class eq{_networkClient;_subscriptionService;_pkceManager;_passwordResetPKCEManager;_config;dfpProtectedAuth;email;authenticate;discovery;constructor(e,t,r,n,a=eF,o=eM()){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._passwordResetPKCEManager=n,this._config=a,this.dfpProtectedAuth=o,this.email={invite:async e=>(eL("stytch.magicLinks.email.invite",e,{email_address:"string",invite_redirect_url:"optionalString",invite_template_id:"optionalString",name:"optionalString",locale:"optionalString",roles:"optionalStringArray",invite_expiration_minutes:"optionalNumber"}),this._networkClient.fetchSDK({url:"/b2b/magic_links/email/invite",body:e,method:"POST"})),loginOrSignup:async e=>{eL("stytch.magicLinks.email.loginOrSignup",e,{email_address:"string",organization_id:"string",login_redirect_url:"optionalString",login_template_id:"optionalString",signup_redirect_url:"optionalString",signup_template_id:"optionalString",locale:"optionalString",login_expiration_minutes:"optionalNumber",signup_expiration_minutes:"optionalNumber"});let t=await this.getCodeChallenge(),r={...e,pkce_code_challenge:t};return this._networkClient.fetchSDK({url:"/b2b/magic_links/email/login_or_signup",body:r,method:"POST"})},discovery:{send:async e=>{eL("stytch.magicLinks.email.discovery.send",e,{email_address:"string",discovery_redirect_url:"optionalString",login_template_id:"optionalString",locale:"optionalString",discovery_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this.getCodeChallenge(),a={...e,pkce_code_challenge:n,dfp_telemetry_id:t,captcha_token:r};return this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/email/discovery/send",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}}},this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.magicLinks.authenticate",e,{magic_links_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._passwordResetPKCEManager.getPKPair(),r=null;if(t?.code_verifier)try{r=await this.handlePKCEForAuthenticate(this._passwordResetPKCEManager,e)}catch(e){if(e.message.includes("pkce"))console.log("Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace.");else throw e}return r||(r=await this.handlePKCEForAuthenticate(this._pkceManager,e)),r}),this.discovery={authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.magicLinks.discovery.authenticate",e,{discovery_magic_links_token:"string"});let t=await this._pkceManager.getPKPair(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a={pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,...e},o=await this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/discovery/authenticate",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o})}}async getCodeChallenge(){let{pkceRequiredForEmailMagicLinks:e}=await this._config;if(!e)return;let t=await this._pkceManager.getPKPair();return t?t.code_challenge:(t=await this._pkceManager.startPKCETransaction()).code_challenge}async handlePKCEForAuthenticate(e,t){let r=await e.getPKPair(),{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),o={pkce_code_verifier:r?.code_verifier,dfp_telemetry_id:n,captcha_token:a,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0,...t},i=await this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/authenticate",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return e.clearPKPair(),i}}let eH=class{_networkClient;_subscriptionService;_pkceManager;_dynamicConfig;_config;dfpProtectedAuth;authenticate;discovery;google;microsoft;hubspot;slack;github;constructor(e,t,r,n,a,o){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._dynamicConfig=n,this._config=a,this.dfpProtectedAuth=o,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.oauth.authenticate",e,{oauth_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair();t||eC("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information.");let{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a=await this._networkClient.retriableFetchSDK({url:"/b2b/oauth/authenticate",method:"POST",body:{pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0,...e},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),a}),this.discovery={authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.oauth.discovery.authenticate",e,{discovery_oauth_token:"string"});let t=await this._pkceManager.getPKPair(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a={pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,...e},o=await this._networkClient.retriableFetchSDK({url:"/b2b/oauth/discovery/authenticate",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o})},this.google={start:this.startOAuthFlow(c.Google),discovery:{start:this.startDiscoveryOAuthFlow(c.Google)}},this.microsoft={start:this.startOAuthFlow(c.Microsoft),discovery:{start:this.startDiscoveryOAuthFlow(c.Microsoft)}},this.hubspot={start:this.startOAuthFlow(c.HubSpot),discovery:{start:this.startDiscoveryOAuthFlow(c.HubSpot)}},this.slack={start:this.startOAuthFlow(c.Slack),discovery:{start:this.startDiscoveryOAuthFlow(c.Slack)}},this.github={start:this.startOAuthFlow(c.GitHub),discovery:{start:this.startDiscoveryOAuthFlow(c.GitHub)}}}async getBaseApiUrl(){let{cnameDomain:e}=await this._dynamicConfig;return e?`https://${e}`:this._config.publicToken.includes("public-token-test")?this._config.testAPIURL:this._config.liveAPIURL}startOAuthFlow(e){return async t=>{let{organization_id:r,organization_slug:n,login_redirect_url:a,signup_redirect_url:o,custom_scopes:i,provider_params:s}=t,{pkceRequiredForOAuth:l}=await this._dynamicConfig,c=await this.getBaseApiUrl(),d=new URL(`${c}/v1/b2b/public/oauth/${e}/start`);if(d.searchParams.set("public_token",this._config.publicToken),r&&""!=r&&d.searchParams.set("organization_id",r),n&&""!=n&&d.searchParams.set("slug",n),i&&(eL("startOAuthFlow",{custom_scopes:i},{custom_scopes:"stringArray"}),d.searchParams.set("custom_scopes",i.join(" "))),s)for(let e in eL("startOAuthFlow",{provider_params:s},{provider_params:"optionalObject"}),s)d.searchParams.set("provider_"+e,s[e]);if(l){let e=await this._pkceManager.startPKCETransaction();d.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();a&&d.searchParams.set("login_redirect_url",a),o&&d.searchParams.set("signup_redirect_url",o),this.navigate(d)}}startDiscoveryOAuthFlow(e){return async t=>{let{discovery_redirect_url:r,custom_scopes:n,provider_params:a}=t,{pkceRequiredForOAuth:o}=await this._dynamicConfig,i=await this.getBaseApiUrl(),s=new URL(`${i}/v1/b2b/public/oauth/${e}/discovery/start`);if(s.searchParams.set("public_token",this._config.publicToken),n&&(eL("startOAuthFlow",{custom_scopes:n},{custom_scopes:"stringArray"}),s.searchParams.set("custom_scopes",n.join(" "))),a)for(let e in eL("startOAuthFlow",{provider_params:a},{provider_params:"optionalObject"}),a)s.searchParams.set("provider_"+e,a[e]);if(o){let e=await this._pkceManager.startPKCETransaction();s.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();r&&s.searchParams.set("discovery_redirect_url",r),this.navigate(s)}}navigate(e){window.location.href=e.toString()}};class eK{_networkClient;_apiNetworkClient;_subscriptionService;constructor(e,t,r){this._networkClient=e,this._apiNetworkClient=t,this._subscriptionService=r}get=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"GET"});return this._subscriptionService.updateOrganization(e.organization),e.organization};getSync=()=>this._subscriptionService.getOrganization();getInfo=()=>({organization:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.organization??null));update=async e=>{let t=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"PUT",body:e});return this._subscriptionService.updateOrganization(t.organization),t};delete=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"DELETE"});return this._subscriptionService.destroyState(),e};getBySlug=async e=>(eL("stytch.organization.getBySlug",e,{organization_slug:"string"}),this._networkClient.fetchSDK({url:"/b2b/organizations/search",method:"POST",body:e}));getConnectedApps=async()=>this._networkClient.fetchSDK({url:"/b2b/organizations/connected_apps",method:"GET"});getConnectedApp=async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/connected_apps/${e.connected_app_id}`,method:"GET"});members={create:async e=>this._networkClient.fetchSDK({url:"/b2b/organizations/members",method:"POST",body:e}),search:async e=>this._networkClient.fetchSDK({url:"/b2b/organizations/me/members/search",method:"POST",body:e}),update:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e.member_id}`,method:"PUT",body:e});return this.updateMemberIfSelf(t),t},deletePassword:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/passwords/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},deleteMFAPhoneNumber:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/mfa_phone_numbers/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},deleteMFATOTP:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/totp/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},delete:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e}`,method:"DELETE"});return e===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.destroyState(),t},reactivate:async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e}/reactivate`,method:"PUT"}),unlinkRetiredEmail:async e=>{let{member_id:t,...r}=e,n=await this._apiNetworkClient.fetchSDK({url:`/b2b/organizations/members/${t}/unlink_retired_email`,method:"POST",body:r});return this.updateMemberIfSelf(n),n},startEmailUpdate:async e=>{let{member_id:t,...r}=e,n=await this._apiNetworkClient.fetchSDK({url:`/b2b/organizations/members/${t}/start_email_update`,method:"POST",body:r});return this.updateMemberIfSelf(n),n},getConnectedApps:async e=>this._networkClient.fetchSDK({url:`b2b/organizations/members/${e.member_id}/connected_apps`,method:"GET"}),revokeConnectedApp:async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e.member_id}/connected_apps/${e.connected_app_id}/revoke`,method:"POST"})};updateMemberIfSelf=e=>{e.member_id===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.updateMember(e.member)}}class ej{_networkClient;_subscriptionService;dfpProtectedAuth;sms;email;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.sms={send:async e=>{eL("stytch.otps.sms.send",e,{organization_id:"string",member_id:"string",mfa_phone_number:"optionalString",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/sms/send",body:{...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.sms.authenticate",e,{session_duration_minutes:"number",organization_id:"string",member_id:"string",code:"string",set_mfa_enrollment:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/sms/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})},this.email={loginOrSignup:async e=>{eL("stytch.otps.email.loginOrSignup",e,{organization_id:"string",email_address:"string",login_template_id:"optionalString",signup_template_id:"optionalString",locale:"optionalString",login_expiration_minutes:"optionalNumber",signup_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/login_or_signup",body:{...e,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.email.authenticate",e,{code:"string",email_address:"string",organization_id:"string",session_duration_minutes:"number",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/authenticate",body:{...e,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),discovery:{send:async e=>{eL("stytch.otps.email.discovery.send",e,{email_address:"string",login_template_id:"optionalString",locale:"optionalString",discovery_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/send",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.email.discovery.authenticate",e,{code:"string",email_address:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={dfp_telemetry_id:t,captcha_token:r,...e};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}}}}let e$=Promise.resolve({pkceRequiredForPasswordResets:!1});class eV{_networkClient;_subscriptionService;_pkceManager;_config;dfpProtectedAuth;authenticate;discovery;resetByEmail;resetByExistingPassword;resetBySession;constructor(e,t,r,n=e$,a){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._config=n,this.dfpProtectedAuth=a,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.authenticate",e,{organization_id:"string",password:"string",email_address:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair(),r=t?.code_verifier,{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/authenticate",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,password:e.password,session_duration_minutes:e.session_duration_minutes,locale:e.locale,captcha_token:a,dfp_telemetry_id:n,code_verifier:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),this.discovery={resetByEmailStart:async e=>{eL("stytch.passwords.discovery.resetByEmailStart",e,{email_address:"string",discovery_redirect_url:"optionalString",reset_password_redirect_url:"optionalString",reset_password_template_id:"optionalString",reset_password_expiration_minutes:"optionalNumber",verify_email_template_id:"optionalString",locale:"optionalString"});let t=await this.getCodeChallenge(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/reset/start",method:"POST",body:{email_address:e.email_address,discovery_redirect_url:e.discovery_redirect_url,reset_password_redirect_url:e.reset_password_redirect_url,reset_password_expiration_minutes:e.reset_password_expiration_minutes,reset_password_template_id:e.reset_password_template_id,verify_email_template_id:e.verify_email_template_id,locale:e.locale,pkce_code_challenge:t,captcha_token:n,dfp_telemetry_id:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},resetByEmail:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.discovery.resetByEmail",e,{password_reset_token:"string",password:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._pkceManager.getPKPair(),a=n?.code_verifier,o=await this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/reset",method:"POST",body:{password_reset_token:e.password_reset_token,password:e.password,captcha_token:r,dfp_telemetry_id:t,pkce_code_verifier:a,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o}),authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.discovery.authenticate",e,{password:"string",email_address:"string"});let t=await this._pkceManager.getPKPair(),r=t?.code_verifier,{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/authenticate",method:"POST",body:{email_address:e.email_address,password:e.password,captcha_token:a,dfp_telemetry_id:n,code_verifier:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})},this.resetByEmail=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetByEmail",e,{password_reset_token:"string",password:"string",session_duration_minutes:"number",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._pkceManager.getPKPair(),a=n?.code_verifier,o=await this._networkClient.retriableFetchSDK({url:"/b2b/passwords/email/reset",method:"POST",body:{password_reset_token:e.password_reset_token,password:e.password,session_duration_minutes:e.session_duration_minutes,locale:e.locale,captcha_token:r,dfp_telemetry_id:t,code_verifier:a,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o}),this.resetByExistingPassword=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetByExistingPassword",e,{email_address:"string",existing_password:"string",new_password:"string",locale:"optionalString",session_duration_minutes:"number"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/existing_password/reset",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,existing_password:e.existing_password,new_password:e.new_password,locale:e.locale,session_duration_minutes:e.session_duration_minutes,captcha_token:r,dfp_telemetry_id:t},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),this.resetBySession=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetBySession",e,{password:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/session/reset",method:"POST",body:{password:e.password,captcha_token:r,dfp_telemetry_id:t},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async getCodeChallenge(){let{pkceRequiredForPasswordResets:e}=await this._config;if(!e)return;let t=await this._pkceManager.getPKPair();return t?t.code_challenge:(t=await this._pkceManager.startPKCETransaction()).code_challenge}async resetByEmailStart(e){eL("stytch.passwords.resetByEmailStart",e,{email_address:"string",login_redirect_url:"optionalString",reset_password_redirect_url:"optionalString",reset_password_template_id:"optionalString",reset_password_expiration_minutes:"optionalNumber",verify_email_template_id:"optionalString",locale:"optionalString"});let t=await this.getCodeChallenge(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/email/reset/start",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,login_redirect_url:e.login_redirect_url,reset_password_redirect_url:e.reset_password_redirect_url,reset_password_expiration_minutes:e.reset_password_expiration_minutes,reset_password_template_id:e.reset_password_template_id,verify_email_template_id:e.verify_email_template_id,locale:e.locale,code_challenge:t,captcha_token:n,dfp_telemetry_id:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}async strengthCheck(e){return eL("stytch.passwords.strengthCheck",e,{email_address:"optionalString",password:"string"}),this._networkClient.fetchSDK({url:"/b2b/passwords/strength_check",method:"POST",body:{email_address:e.email_address,password:e.password}})}}class eW{roles;resources;rolesByID;constructor(e,t){this.roles=e,this.resources=t,this.rolesByID={},e.forEach(e=>this.rolesByID[e.role_id]=e)}static fromJSON(e){return new eW(e.roles,e.resources)}mergeWithCustomRoles(e){return new eW([...this.roles,...e],this.resources)}callerIsAuthorized(e,t,r){return!!e.map(e=>this.rolesByID[e]).filter(e=>e).flatMap(e=>e.permissions).filter(e=>e.resource_id===t).find(e=>e.actions.includes(r)||e.actions.includes("*"))}allPermissionsForCaller(e){let t=Object.create(null);return this.resources.forEach(r=>{t[r.resource_id]={},r.actions.forEach(n=>{t[r.resource_id][n]=this.callerIsAuthorized(e,r.resource_id,n)})}),t}}class eG{_subscriptionService;cachedPolicy;policyPromise;constructor(e,t,r){this._subscriptionService=r,this.cachedPolicy=e.rbacPolicy?eW.fromJSON(e.rbacPolicy):null,this.policyPromise=t.then(e=>e.rbacPolicy?(this.cachedPolicy=eW.fromJSON(e.rbacPolicy),this.cachedPolicy):(eP("Unable to retrieve RBAC policy from servers. Assuming caller has no permissions."),new eW([],[])))}async getEffectivePolicy(){let e=await this.policyPromise,t=this._subscriptionService.getOrganization();return t?.custom_roles?.length?e.mergeWithCustomRoles(t.custom_roles):e}getEffectivePolicySync(){if(!this.cachedPolicy)return null;let e=this._subscriptionService.getOrganization();return e?.custom_roles?.length?this.cachedPolicy.mergeWithCustomRoles(e.custom_roles):this.cachedPolicy}allPermissions(){return this.getEffectivePolicy().then(e=>e.allPermissionsForCaller(this.roleIds()))}isAuthorizedSync=(e,t)=>{let r=this.getEffectivePolicySync();return!!r?.callerIsAuthorized(this.roleIds(),e,t)};isAuthorized=(e,t)=>this.getEffectivePolicy().then(r=>r.callerIsAuthorized(this.roleIds(),e,t));roleIds(){let e=this._subscriptionService.getSession();return e?e.roles??[]:[]}}class eY{_networkClient;_subscriptionService;dfpProtectedAuth;recover;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.recover=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.recoveryCodes.recover",e,{organization_id:"string",member_id:"string",recovery_code:"string",session_duration_minutes:"number"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/recover",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async rotate(){let{dfp_telemetry_id:e,captcha_token:t}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/rotate",body:{dfp_telemetry_id:e,captcha_token:t},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}async get(){return this._networkClient.fetchSDK({url:"/b2b/recovery_codes",method:"GET"})}}class eZ{_networkClient;_subscriptionService;constructor(e,t){this._networkClient=e,this._subscriptionService=t}async createConnection(e){return eL("stytch.scim.createConnection",e,{display_name:"optionalString",identity_provider:"optionalString"}),await this._networkClient.fetchSDK({url:"/b2b/scim",method:"POST",body:e})}async updateConnection(e){return eL("stytch.scim.updateConnection",e,{connection_id:"string",display_name:"optionalString",identity_provider:"optionalString"}),await this._networkClient.fetchSDK({url:`/b2b/scim/${e.connection_id}`,method:"PUT",body:e})}async deleteConnection(e){return eL("stytch.scim.deleteConnection",{connection_id:e},{connection_id:"string"}),await this._networkClient.fetchSDK({url:`/b2b/scim/${e}`,method:"DELETE"})}async getConnection(){return await this._networkClient.fetchSDK({url:"/b2b/scim",method:"GET"})}async getConnectionGroups(e){return eL("stytch.scim.getConnectionGroups",e,{limit:"optionalNumber",cursor:"optionalString"}),await this._networkClient.fetchSDK({url:"/b2b/scim/groups",method:"POST",body:e})}async rotateStart(e){return eL("stytch.scim.rotateStart",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/start",method:"POST",body:{connection_id:e}})}async rotateComplete(e){return eL("stytch.scim.rotateComplete",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/complete",method:"POST",body:{connection_id:e}})}async rotateCancel(e){return eL("stytch.scim.rotateCancel",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/cancel",method:"POST",body:{connection_id:e}})}}class eJ{_networkClient;_apiNetworkClient;_subscriptionService;constructor(e,t,r){this._networkClient=e,this._apiNetworkClient=t,this._subscriptionService=r}get=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/me",method:"GET"});return this._subscriptionService.updateMember(e.member),e.member};getSync=()=>this._subscriptionService.getMember();getInfo=()=>({member:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.member??null));update=async e=>{eL("stytch.self.update",e,{name:"optionalString",untrusted_metadata:"optionalObject",mfa_enrolled:"optionalBoolean",mfa_phone_number:"optionalString",default_mfa_method:"optionalString"});let t=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/update",body:e,method:"PUT"});return this._subscriptionService.updateMember(t.member),t};deleteMFAPhoneNumber=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/deletePhoneNumber",method:"DELETE"});return this._subscriptionService.updateMember(e.member),e};deleteMFATOTP=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/deleteTOTP",method:"DELETE"});return this._subscriptionService.updateMember(e.member),e};deletePassword=async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/passwords/${e}`,method:"DELETE"});return this._subscriptionService.updateMember(t.member),t};unlinkRetiredEmail=async e=>{let t=await this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/unlink_retired_email",method:"POST",body:e});return this._subscriptionService.updateMember(t.member),t};startEmailUpdate=async e=>{let t=await this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/start_email_update",method:"POST",body:e});return this._subscriptionService.updateMember(t.member),t};getConnectedApps=async()=>this._networkClient.fetchSDK({url:"/b2b/organizations/members/connected_apps",method:"GET"});revokeConnectedApp=async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/connected_apps/${e.connected_app_id}/revoke`,method:"POST"})}class eQ{_networkClient;_subscriptionService;getSync=()=>this._subscriptionService.getSession();getInfo=()=>({session:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.session??null));revoke=async e=>{try{let e=await this._networkClient.fetchSDK({url:"/b2b/sessions/revoke",method:"POST"});return this._subscriptionService.destroyState(),e}catch(t){throw e?.forceClear?this._subscriptionService.destroyState():_.includes(t.error_type)&&this._subscriptionService.destroyState(),t}};revokeForMember=async e=>(eL("stytch.session.revokeForMember",e,{member_id:"string"}),await this._networkClient.fetchSDK({url:`/b2b/sessions/revoke/${e.member_id}`,method:"POST"}));_authenticate=async e=>{let t=this._subscriptionService.getSession(),r=()=>t?.member_session_id!==this._subscriptionService.getSession()?.member_session_id;try{let t={session_duration_minutes:e?.session_duration_minutes},n=await this._networkClient.fetchSDK({url:"/b2b/sessions/authenticate",body:t,method:"POST"});if(r())return this._authenticate(e);return n}catch(t){if(r())return this._authenticate(e);throw _.includes(t.error_type)&&this._subscriptionService.destroySession(),t}};authenticate;exchange;exchangeAccessToken;attest;constructor(e,t){this._networkClient=e,this._subscriptionService=t,this.authenticate=this._subscriptionService.withUpdateSession(this._authenticate),this.exchange=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.exchange",e,{organization_id:"string",session_duration_minutes:"number",locale:"optionalString"}),this._networkClient.fetchSDK({url:"/b2b/sessions/exchange",body:e,method:"POST"}))),this.exchangeAccessToken=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.exchange",e,{access_token:"string",session_duration_minutes:"number"}),this._networkClient.fetchSDK({url:"/b2b/sessions/exchange_access_token",body:e,method:"POST"}))),this.attest=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.attest",e,{organization_id:"optionalString",profile_id:"string",token:"string",session_duration_minutes:"optionalNumber"}),this._networkClient.fetchSDK({url:"/b2b/sessions/attest",body:e,method:"POST"})))}getTokens(){return this._subscriptionService.getTokens()}updateSession(e){eL("stytch.session.updateSession",e,{session_token:"string",session_jwt:"optionalString"}),this._subscriptionService.updateTokens(e)}}class eX{_networkClient;_subscriptionService;_pkceManager;_dynamicConfig;_config;dfpProtectedAuth;authenticate;constructor(e,t,r,n,a,o){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._dynamicConfig=n,this._config=a,this.dfpProtectedAuth=o,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.sso.authenticate",e,{sso_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair();t||eC("No code verifier found in local storage for SSO flow.\nConsider using stytch.sso.start() to add PKCE to your SSO flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information.");let{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a=await this._networkClient.retriableFetchSDK({url:"/b2b/sso/authenticate",method:"POST",body:{pkce_code_verifier:t?.code_verifier,...e,dfp_telemetry_id:r,captcha_token:n,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),a})}async getBaseApiUrl(){return this._config.publicToken.includes("public-token-test")?this._config.testAPIURL:this._config.liveAPIURL}async start({connection_id:e,login_redirect_url:t,signup_redirect_url:r}){let{pkceRequiredForSso:n}=await this._dynamicConfig,a=await this.getBaseApiUrl(),o=new URL(`${a}/v1/public/sso/start`);if(o.searchParams.set("public_token",this._config.publicToken),o.searchParams.set("connection_id",e),n){let e=await this._pkceManager.startPKCETransaction();o.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();t&&o.searchParams.set("login_redirect_url",t),r&&o.searchParams.set("signup_redirect_url",r),this.navigate(o)}navigate(e){window.location.href=e.toString()}async getConnections(){return await this._networkClient.fetchSDK({url:"/b2b/sso",method:"GET"})}async discoverConnections(e){return await this._networkClient.fetchSDK({url:`/b2b/sso/discovery/connections?email_address=${encodeURIComponent(e)}`,method:"GET"})}async deleteConnection(e){return this._networkClient.fetchSDK({url:`/b2b/sso/${e}`,method:"DELETE"})}saml={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/saml",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}`,method:"PUT",body:e}),updateConnectionByURL:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/url`,method:"PUT",body:e}),deleteVerificationCertificate:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/verification_certificates/${e.certificate_id}`,method:"DELETE"}),deleteEncryptionPrivateKey:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/encryption_private_key/${e.private_key_id}`,method:"DELETE"})};oidc={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/oidc",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/oidc/${e.connection_id}`,method:"PUT",body:e})};external={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/external",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/external/${e.connection_id}`,method:"PUT",body:e})}}class e1{_networkClient;_subscriptionService;dfpProtectedAuth;authenticate;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.totp.authenticate",e,{organization_id:"string",member_id:"string",code:"string",session_duration_minutes:"number",set_mfa_enrollment:"optionalString",set_default_mfa:"optionalBoolean"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/totp/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async create(e){eL("stytch.totp.create",e,{organization_id:"string",member_id:"string",expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._networkClient.retriableFetchSDK({url:"/b2b/totp",body:{...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return n.member_id===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.updateMember(n.member),n}}Promise.resolve({siweRequiredForCryptoWallets:!1}),Promise.resolve({pkceRequiredForEmailMagicLinks:!1}),Promise.resolve({pkceRequiredForPasswordResets:!1});class e0{iframeURL;frame;constructor(e){this.iframeURL=e,this.createIframe()}createIframe(){let e=document.querySelector(`[src~="${this.iframeURL}"]`);if(e?eC(i):((e=document.createElement("iframe")).src=this.iframeURL,e.style.position="absolute",e.style.width="0",e.style.height="0",e.style.border="0",e.role="none",document.body.appendChild(e)),"true"===e.dataset.loaded){this.frame=Promise.resolve(e);return}this.frame=new Promise(t=>{e.addEventListener("load",()=>{e.dataset.loaded="true",t(e)},{once:!0})})}async call(e,t){let r=await this.frame,n=new MessageChannel;return new Promise((a,o)=>{n.port1.onmessage=e=>{let t=e.data;n.port1.close(),t.success?a(t.payload):o(eI.unmarshall(t.error))},r.contentWindow?.postMessage({method:e,args:t},this.iframeURL,[n.port2])})}}class e2{_networkClient;dfpProtectedAuth;constructor(e,t){this._networkClient=e,this.dfpProtectedAuth=t}searchUser(e){return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(({dfp_telemetry_id:t,captcha_token:r})=>this._networkClient.fetchSDK({url:"/users/search",method:"POST",body:{email:e,dfp_telemetry_id:t,captcha_token:r}}))}searchMember(e,t){return this._networkClient.fetchSDK({url:"/b2b/organizations/members/search",method:"POST",body:{email_address:e,organization_id:t}})}}class e3{hasWarned=!1;registry=new Map;register(e,t){let r=this.registry.get(e);r&&r!==t&&(this.hasWarned||(eC(i),this.hasWarned=!0),r.cancelBackgroundRefresh()),this.registry.set(e,t)}unregister(e,t){let r=this.registry.get(e);r&&r===t&&this.registry.delete(e)}}class e4{_subscriptionService;_headlessSessionClient;_publicToken;_options;static REFRESH_INTERVAL_MS=18e4;timeout=null;lastAuthenticationSessionDuration;static registry=new e3;register(){e4.registry.register(this._publicToken,this)}unregister(){e4.registry.unregister(this._publicToken,this)}constructor(e,t,r,n){this._subscriptionService=e,this._headlessSessionClient=t,this._publicToken=r,this._options=n,this._subscriptionService.subscribeToState(this._onDataChange)}performBackgroundRefresh(){this._reauthenticateWithBackoff().then(()=>{this.scheduleBackgroundRefresh()}).catch(e=>{eC("Session background refresh failed. Signalling to app that user is logged out.",{error:e}),this._subscriptionService.destroySession()})}scheduleBackgroundRefresh(){this.cancelBackgroundRefresh(),this.register(),this.timeout=setTimeout(()=>{this.performBackgroundRefresh()},e4.REFRESH_INTERVAL_MS)}cancelBackgroundRefresh(){null!==this.timeout&&(this.unregister(),clearTimeout(this.timeout),this.timeout=null)}_onDataChange=e=>{null!=e&&e.sessionDurationMinutes&&(this.lastAuthenticationSessionDuration=e.sessionDurationMinutes),e?.session?this.scheduleBackgroundRefresh():this.cancelBackgroundRefresh()};_reauthenticateWithBackoff=async()=>{let e=0;for(;;)try{let e={session_duration_minutes:this._options.keepSessionAlive?this.lastAuthenticationSessionDuration:void 0};return await this._headlessSessionClient.authenticate(e)}catch(t){if(e4.isUnrecoverableError(t))return Promise.reject(t);e++,await new Promise(t=>setTimeout(t,e4.timeoutForAttempt(e)))}};static timeoutForAttempt(e){return e=Math.min(e,7),Math.floor(350*Math.random())-175+2e3*2**e}static isUnrecoverableError(e){return _.includes(e.error_type)}}class e5{_subscriptionService;emptyState;constructor(e,t){this._subscriptionService=e,this.emptyState=t}onStateChange=e=>this._subscriptionService.subscribeToState(t=>{e(t??this.emptyState)})}var e8,e6,e9,e7,te,tt,tr,tn,ta,to,ti,ts={},tl=[],tc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,td=Array.isArray;function tu(e,t){for(var r in t)e[r]=t[r];return e}function th(e){var t=e.parentNode;t&&t.removeChild(e)}function tm(e,t,r){var n,a,o,i={};for(o in t)"key"==o?n=t[o]:"ref"==o?a=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?e7.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===i[o]&&(i[o]=e.defaultProps[o]);return tp(e,i,n,a,null)}function tp(e,t,r,n,a){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++tt:a,__i:-1,__u:0};return null==a&&null!=te.vnode&&te.vnode(o),o}function t_(){return{current:null}}function tg(e){return e.children}function tf(e,t){this.props=e,this.context=t}function ty(e,t){if(null==t)return e.__?ty(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?ty(e):null}function tv(e){(!e.__d&&(e.__d=!0)&&tr.push(e)&&!tb.__r++||tn!==te.debounceRendering)&&((tn=te.debounceRendering)||ta)(tb)}function tb(){var e,t,r,n,a,o,i,s,l;for(tr.sort(to);e=tr.shift();)e.__d&&(t=tr.length,n=void 0,o=(a=(r=e).__v).__e,s=[],l=[],(i=r.__P)&&((n=tu({},a)).__v=a.__v+1,te.vnode&&te.vnode(n),tT(i,n,a,r.__n,void 0!==i.ownerSVGElement,32&a.__u?[o]:null,s,null==o?ty(a):o,!!(32&a.__u),l),n.__.__k[n.__i]=n,tO(s,n,l),n.__e!=o&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),tr.length>t&&tr.sort(to));tb.__r=0}function tw(e,t,r,n,a,o,i,s,l,c,d){var u,h,m,p,_,g=n&&n.__k||tl,f=t.length;for(r.__d=l,function(e,t,r){var n,a,o,i,s,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)null!=(a=e.__k[n]=null==(a=t[n])||"boolean"==typeof a||"function"==typeof a?null:"string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?tp(null,a,null,null,a):td(a)?tp(tg,{children:a},null,null,null):a.__b>0?tp(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)?(a.__=e,a.__b=e.__b+1,s=function(e,t,r,n){var a=e.key,o=e.type,i=r-1,s=r+1,l=t[r];if(null===l||l&&a==l.key&&o===l.type)return r;if(n>+(null!=l&&0==(131072&l.__u)))for(;i>=0||s<t.length;){if(i>=0){if((l=t[i])&&0==(131072&l.__u)&&a==l.key&&o===l.type)return i;i--}if(s<t.length){if((l=t[s])&&0==(131072&l.__u)&&a==l.key&&o===l.type)return s;s++}}return -1}(a,r,i=n+u,d),a.__i=s,o=null,-1!==s&&(d--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof a.type&&(a.__u|=65536)):s!==i&&(s===i+1?u++:s>i?d>l-i?u+=s-i:u--:u=s<i&&s==i-1?s-i:0,s!==n+u&&(a.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=ty(o)),tx(o,o,!1),r[n]=null,d--);if(d)for(n=0;n<c;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=ty(o)),tx(o,o))}(r,t,g),l=r.__d,u=0;u<f;u++)null!=(m=r.__k[u])&&"boolean"!=typeof m&&"function"!=typeof m&&(h=-1===m.__i?ts:g[m.__i]||ts,m.__i=u,tT(e,m,h,a,o,i,s,l,c,d),p=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&tA(h.ref,null,m),d.push(m.ref,m.__c||p,m)),null==_&&null!=p&&(_=p),65536&m.__u||h.__k===m.__k?l=function e(t,r,n){var a,o;if("function"==typeof t.type){for(a=t.__k,o=0;a&&o<a.length;o++)a[o]&&(a[o].__=t,r=e(a[o],r,n));return r}return t.__e!=r&&(n.insertBefore(t.__e,r||null),r=t.__e),r&&r.nextSibling}(m,l,e):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:p&&(l=p.nextSibling),m.__d=void 0,m.__u&=-196609);r.__d=l,r.__e=_}function tk(e,t){return t=t||[],null==e||"boolean"==typeof e||(td(e)?e.some(function(e){tk(e,t)}):t.push(e)),t}function tS(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||tc.test(t)?r:r+"px"}function tE(e,t,r,n,a){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||tS(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||tS(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?tP:tC,o)):e.removeEventListener(t,o?tP:tC,o);else{if(a)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function tC(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(te.event?te.event(e):e)}function tP(e){return this.l[e.type+!0](te.event?te.event(e):e)}function tT(e,t,r,n,a,o,i,s,l,c){var d,u,h,m,p,_,g,f,y,v,b,w,k,S,E,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(d=te.__b)&&d(t);e:if("function"==typeof C)try{if(f=t.props,y=(d=C.contextType)&&n[d.__c],v=d?y?y.props.value:d.__:n,r.__c?g=(u=t.__c=r.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(f,v):(t.__c=u=new tf(f,v),u.constructor=C,u.render=tD),y&&y.sub(u),u.props=f,u.state||(u.state={}),u.context=v,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=tu({},u.__s)),tu(u.__s,C.getDerivedStateFromProps(f,u.__s))),m=u.props,p=u.state,u.__v=t,h)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&f!==m&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(f,v),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(f,u.__s,v)||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=f,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&i.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(f,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(m,p,_)})}if(u.context=v,u.props=f,u.__P=e,u.__e=!1,w=te.__r,k=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++k<25);u.state=u.__s,null!=u.getChildContext&&(n=tu(tu({},n),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(_=u.getSnapshotBeforeUpdate(m,p)),tw(e,td(E=null!=d&&d.type===tg&&null==d.key?d.props.children:d)?E:[E],t,r,n,a,o,i,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),g&&(u.__E=u.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=s,t.__u|=l?160:32,o[o.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),te.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,a,o,i,s,l){var c,d,u,h,m,p,_,g=r.props,f=t.props,y=t.type;if("svg"===y&&(a=!0),null!=o){for(c=0;c<o.length;c++)if((m=o[c])&&"setAttribute"in m==!!y&&(y?m.localName===y:3===m.nodeType)){e=m,o[c]=null;break}}if(null==e){if(null===y)return document.createTextNode(f);e=a?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,f.is&&f),o=null,s=!1}if(null===y)g===f||s&&e.data===f||(e.data=f);else{if(o=o&&e7.call(e.childNodes),g=r.props||ts,!s&&null!=o)for(g={},c=0;c<e.attributes.length;c++)g[(m=e.attributes[c]).name]=m.value;for(c in g)m=g[c],"children"==c||("dangerouslySetInnerHTML"==c?u=m:"key"===c||c in f||tE(e,c,null,m,a));for(c in f)m=f[c],"children"==c?h=m:"dangerouslySetInnerHTML"==c?d=m:"value"==c?p=m:"checked"==c?_=m:"key"===c||s&&"function"!=typeof m||g[c]===m||tE(e,c,m,g[c],a);if(d)s||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),tw(e,td(h)?h:[h],t,r,n,a&&"foreignObject"!==y,o,i,o?o[0]:r.__k&&ty(r,0),s,l),null!=o)for(c=o.length;c--;)null!=o[c]&&th(o[c]);s||(c="value",void 0===p||p===e[c]&&("progress"!==y||p)&&("option"!==y||p===g[c])||tE(e,c,p,g[c],!1),c="checked",void 0!==_&&_!==e[c]&&tE(e,c,_,g[c],!1))}return e}(r.__e,t,r,n,a,o,i,l,c);(d=te.diffed)&&d(t)}function tO(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)tA(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){te.__e(e,t.__v)}})}function tA(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){te.__e(e,r)}}function tx(e,t,r){var n,a;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||tA(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){te.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&tx(n[a],t,r||"function"!=typeof e.type);r||null==e.__e||th(e.__e),e.__=e.__e=e.__d=void 0}function tD(e,t,r){return this.constructor(e,r)}function tz(e,t,r){var n,a,o,i;te.__&&te.__(e,t),a=(n="function"==typeof r)?null:r&&r.__k||t.__k,o=[],i=[],tT(t,e=(!n&&r||t).__k=tm(tg,null,[e]),a||ts,ts,void 0!==t.ownerSVGElement,!n&&r?[r]:a?null:t.firstChild?e7.call(t.childNodes):null,o,!n&&r?r:a?a.__e:t.firstChild,n,i),tO(o,e,i)}function tM(e,t,r){var n,a,o,i,s=tu({},e.props);for(o in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?a=t[o]:s[o]=void 0===t[o]&&void 0!==i?i[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?e7.call(arguments,2):r),tp(e.type,s,n||e.key,a||e.ref,null)}function tI(e,t){var r={__c:t="__cC"+ti++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(function(e){e.__e=!0,tv(e)})},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}e7=tl.slice,te={__e:function(e,t,r,n){for(var a,o,i;t=t.__;)if((a=t.__c)&&!a.__)try{if((o=a.constructor)&&null!=o.getDerivedStateFromError&&(a.setState(o.getDerivedStateFromError(e)),i=a.__d),null!=a.componentDidCatch&&(a.componentDidCatch(e,n||{}),i=a.__d),i)return a.__E=a}catch(t){e=t}throw e}},tt=0,tf.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=tu({},this.state),"function"==typeof e&&(e=e(tu({},r),this.props)),e&&tu(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),tv(this))},tf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tv(this))},tf.prototype.render=tg,tr=[],ta="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,to=function(e,t){return e.__v.__b-t.__v.__b},tb.__r=0,ti=0;var tR,tL,tB,tN,tU=0,tF=[],tq=[],tH=te.__b,tK=te.__r,tj=te.diffed,t$=te.__c,tV=te.unmount;function tW(e,t){te.__h&&te.__h(tL,e,tU||t),tU=0;var r=tL.__H||(tL.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:tq}),r.__[e]}function tG(e){return tU=1,tY(re,e)}function tY(e,t,r){var n=tW(tR++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):re(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=tL,!tL.u)){var a=function(e,t,r){if(!n.__c.__H)return!0;var a=n.__c.__H.__.filter(function(e){return e.__c});if(a.every(function(e){return!e.__N}))return!o||o.call(this,e,t,r);var i=!1;return a.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};tL.u=!0;var o=tL.shouldComponentUpdate,i=tL.componentWillUpdate;tL.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,a(e,t,r),o=n}i&&i.call(this,e,t,r)},tL.shouldComponentUpdate=a}return n.__N||n.__}function tZ(e,t){var r=tW(tR++,3);!te.__s&&t7(r.__H,t)&&(r.__=e,r.i=t,tL.__H.__h.push(r))}function tJ(e,t){var r=tW(tR++,4);!te.__s&&t7(r.__H,t)&&(r.__=e,r.i=t,tL.__h.push(r))}function tQ(e){return tU=5,t1(function(){return{current:e}},[])}function tX(e,t,r){tU=6,tJ(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==r?r:r.concat(e))}function t1(e,t){var r=tW(tR++,7);return t7(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function t0(e,t){return tU=8,t1(function(){return e},t)}function t2(e){var t=tL.context[e.__c],r=tW(tR++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(tL)),t.props.value):e.__}function t3(e,t){te.useDebugValue&&te.useDebugValue(t?t(e):e)}function t4(){var e=tW(tR++,11);if(!e.__){for(var t=tL.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function t5(){for(var e;e=tF.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(t6),e.__H.__h.forEach(t9),e.__H.__h=[]}catch(t){e.__H.__h=[],te.__e(t,e.__v)}}te.__b=function(e){tL=null,tH&&tH(e)},te.__r=function(e){tK&&tK(e),tR=0;var t=(tL=e.__c).__H;t&&(tB===tL?(t.__h=[],tL.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=tq,e.__N=e.i=void 0})):(t.__h.forEach(t6),t.__h.forEach(t9),t.__h=[],tR=0)),tB=tL},te.diffed=function(e){tj&&tj(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==tF.push(t)&&tN===te.requestAnimationFrame||((tN=te.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),t8&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);t8&&(t=requestAnimationFrame(r))})(t5)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==tq&&(e.__=e.__V),e.i=void 0,e.__V=tq})),tB=tL=null},te.__c=function(e,t){t.some(function(e){try{e.__h.forEach(t6),e.__h=e.__h.filter(function(e){return!e.__||t9(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],te.__e(r,e.__v)}}),t$&&t$(e,t)},te.unmount=function(e){tV&&tV(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{t6(e)}catch(e){t=e}}),r.__H=void 0,t&&te.__e(t,r.__v))};var t8="function"==typeof requestAnimationFrame;function t6(e){var t=tL,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),tL=t}function t9(e){var t=tL;e.__c=e.__(),tL=t}function t7(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function re(e,t){return"function"==typeof t?t(e):t}function rt(e,t){for(var r in t)e[r]=t[r];return e}function rr(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function rn(e){this.props=e}function ra(e,t){function r(e){var r=this.props.ref,n=r==e.ref;return!n&&r&&(r.call?r(null):r.current=null),t?!t(this.props,e)||!n:rr(this.props,e)}function n(t){return this.shouldComponentUpdate=r,tm(e,t)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(rn.prototype=new tf).isPureReactComponent=!0,rn.prototype.shouldComponentUpdate=function(e,t){return rr(this.props,e)||rr(this.state,t)};var ro=te.__b;te.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ro&&ro(e)};var ri="u">typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function rs(e){function t(t){var r=rt({},t);return delete r.ref,e(r,t.ref||null)}return t.$$typeof=ri,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var rl=function(e,t){return null==e?null:tk(tk(e).map(t))},rc={map:rl,forEach:rl,count:function(e){return e?tk(e).length:0},only:function(e){var t=tk(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:tk},rd=te.__e;te.__e=function(e,t,r,n){if(e.then){for(var a,o=t;o=o.__;)if((a=o.__c)&&a.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),a.__c(e,t)}rd(e,t,r,n)};var ru=te.unmount;function rh(){this.__u=0,this.t=null,this.__b=null}function rm(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function rp(e){var t,r,n;function a(a){if(t||(t=e()).then(function(e){r=e.default||e},function(e){n=e}),n)throw n;if(!r)throw t;return tm(r,a)}return a.displayName="Lazy",a.__f=!0,a}function r_(){this.u=null,this.o=null}te.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ru&&ru(e)},(rh.prototype=new tf).__c=function(e,t){var r=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(r);var a=rm(n.__v),o=!1,i=function(){o||(o=!0,r.__R=null,a?a(s):s())};r.__R=i;var s=function(){if(!--n.__u){if(n.state.__a){var e,t=n.state.__a;n.__v.__k[0]=function e(t,r,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)}),t.__c&&t.__c.__P===r&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}(t,t.__c.__P,t.__c.__O)}for(n.setState({__a:n.__b=null});e=n.t.pop();)e.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(i,i)},rh.prototype.componentWillUnmount=function(){this.t=[]},rh.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,r,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=rt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=r),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)})),t}(this.__b,r,n.__O=n.__P)}this.__b=null}var a=t.__a&&tm(tg,null,e.fallback);return a&&(a.__u&=-33),[tm(tg,null,t.__a?null:e.children),a]};var rg=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function rf(e){return this.getChildContext=function(){return e.context},e.children}function ry(e){var t=this,r=e.i;t.componentWillUnmount=function(){tz(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,r){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),tz(tm(rf,{context:t.context},e.__v),t.l)}function rv(e,t){var r=tm(ry,{__v:e,i:t});return r.containerInfo=t,r}(r_.prototype=new tf).__a=function(e){var t=this,r=rm(t.__v),n=t.o.get(e);return n[0]++,function(a){var o=function(){t.props.revealOrder?(n.push(a),rg(t,e,n)):a()};r?r(o):o()}},r_.prototype.render=function(e){this.u=null,this.o=new Map;var t=tk(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},r_.prototype.componentDidUpdate=r_.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){rg(e,r,t)})};var rb="u">typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,rw=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rk=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,rS=/[A-Z0-9]/g,rE="u">typeof document;function rC(e,t,r){return null==t.__k&&(t.textContent=""),tz(e,t),"function"==typeof r&&r(),e?e.__c:null}function rP(e,t,r){return function e(t,r){tz(t,r,e)}(e,t),"function"==typeof r&&r(),e?e.__c:null}tf.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(tf.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var rT=te.event;function rO(){}function rA(){return this.cancelBubble}function rx(){return this.defaultPrevented}te.event=function(e){return rT&&(e=rT(e)),e.persist=rO,e.isPropagationStopped=rA,e.isDefaultPrevented=rx,e.nativeEvent=e};var rD,rz={enumerable:!1,configurable:!0,get:function(){return this.class}},rM=te.vnode;te.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={};for(var a in t){var o=t[a];if(!("value"===a&&"defaultValue"in t&&null==o||rE&&"children"===a&&"noscript"===r||"class"===a||"className"===a)){var i,s=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===o?o="":"ondoubleclick"===s?a="ondblclick":"onchange"!==s||"input"!==r&&"textarea"!==r||(i=t.type,("u">typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(i))?"onfocus"===s?a="onfocusin":"onblur"===s?a="onfocusout":rk.test(a)?a=s:-1===r.indexOf("-")&&rw.test(a)?a=a.replace(rS,"-$&").toLowerCase():null===o&&(o=void 0):s=a="oninput","oninput"===s&&n[a=s]&&(a="oninputCapture"),n[a]=o}}"select"==r&&n.multiple&&Array.isArray(n.value)&&(n.value=tk(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),"select"==r&&null!=n.defaultValue&&(n.value=tk(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",rz)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=rb,rM&&rM(e)};var rI=te.__r;te.__r=function(e){rI&&rI(e),rD=e.__c};var rR=te.diffed;te.diffed=function(e){rR&&rR(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value),rD=null};var rL={ReactCurrentDispatcher:{current:{readContext:function(e){return rD.__n[e.__c].props.value}}}};function rB(e){return tm.bind(null,e)}function rN(e){return!!e&&e.$$typeof===rb}function rU(e){return rN(e)&&e.type===tg}function rF(e){return rN(e)?tM.apply(null,arguments):e}function rq(e){return!!e.__k&&(tz(null,e),!0)}function rH(e){return e&&(e.base||1===e.nodeType&&e)||null}var rK=function(e,t){return e(t)},rj=function(e,t){return e(t)};function r$(e){e()}function rV(e){return e}function rW(){return[!1,r$]}function rG(e,t){var r=t(),n=tG({h:{__:r,v:t}}),a=n[0].h,o=n[1];return tJ(function(){a.__=r,a.v=t,rY(a)&&o({h:a})},[e,r,t]),tZ(function(){return rY(a)&&o({h:a}),e(function(){rY(a)&&o({h:a})})},[e]),r}function rY(e){var t=e.v,r=e.__;try{var n=t();return(r!==n||0===r&&1/r!=1/n)&&(r==r||n==n)}catch(e){return!0}}var rZ={useState:tG,useId:t4,useReducer:tY,useEffect:tZ,useLayoutEffect:tJ,useInsertionEffect:tJ,useTransition:rW,useDeferredValue:rV,useSyncExternalStore:rG,startTransition:r$,useRef:tQ,useImperativeHandle:tX,useMemo:t1,useCallback:t0,useContext:t2,useDebugValue:t3,version:"17.0.2",Children:rc,render:rC,hydrate:rP,unmountComponentAtNode:rq,createPortal:rv,createElement:tm,createContext:tI,createFactory:rB,cloneElement:rF,createRef:t_,Fragment:tg,isValidElement:rN,isElement:rN,isFragment:rU,findDOMNode:rH,Component:tf,PureComponent:rn,memo:ra,forwardRef:rs,flushSync:rj,unstable_batchedUpdates:rK,StrictMode:tg,Suspense:rh,SuspenseList:r_,lazy:rp,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rL},rJ=Object.freeze({__proto__:null,Children:rc,Component:tf,Fragment:tg,PureComponent:rn,StrictMode:tg,Suspense:rh,SuspenseList:r_,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rL,cloneElement:rF,createContext:tI,createElement:tm,createFactory:rB,createPortal:rv,createRef:t_,default:rZ,findDOMNode:rH,flushSync:rj,forwardRef:rs,hydrate:rP,isElement:rN,isFragment:rU,isValidElement:rN,lazy:rp,memo:ra,render:rC,startTransition:r$,unmountComponentAtNode:rq,unstable_batchedUpdates:rK,useCallback:t0,useContext:t2,useDebugValue:t3,useDeferredValue:rV,useEffect:tZ,useErrorBoundary:function(e){var t=tW(tR++,10),r=tG();return t.__=e,tL.componentDidCatch||(tL.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]},useId:t4,useImperativeHandle:tX,useInsertionEffect:tJ,useLayoutEffect:tJ,useMemo:t1,useReducer:tY,useRef:tQ,useState:tG,useSyncExternalStore:rG,useTransition:rW,version:"17.0.2"});let rQ={"button.continue":["Continue"],"button.continueWithEmail":["Continue with email"],"button.createAnOrganization":["Create an organization"],"button.emailCode":["Email me a code"],"button.emailLink":["Email me a link"],"button.emailResent":["Email resent! Try again in ",["timeRemaining"],"s"],"button.goBack":["Go back"],"button.hidePassword":["Hide"],"button.loginWithoutPassword":["Log in without a password"],"button.resendEmail":["Resend email"],"button.retry":["Try again"],"button.showPassword":["Show"],"button.totpQrManual":["Having trouble scanning?"],"button.totpQrRetry":["Try to scan the QR code again"],"button.tryDifferentEmailAddress":["Try a different email address"],"button.usePassword":["Use a password instead"],"emailConfirmation.content":["An email was sent to <bold>",["email"],"</bold>."],"emailConfirmation.emailSent":["Email sent! Try again in ",["timeRemaining"],"s"],"emailConfirmation.title":["Check your email"],"emailMethodSelection.code":["Email me a login code"],"emailMethodSelection.link":["Email me a login link"],"emailMethodSelection.title":["Select how you’d like to continue"],"emailVerification.content":["Confirm your email address with one of the following:"],"emailVerification.title":["Verify your email"],"error.adBlockerDetected":["The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."],"error.authPolicyNoOrg":["Unable to join due to the organization's authentication policy. Please contact your admin for more information."],"error.authPolicyWithOrg":["Unable to join due to ",["organizationName"],"'s authentication policy. Please contact your admin for more information."],"error.breachedPassword":["Password appears in the list of breached passwords and must be reset."],"error.claimedDomain":["Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."],"error.default":["Something went wrong. Try again later or contact your admin for help."],"error.duplicatePhoneNumber":["A member with the specified phone number already exists for this organization."],"error.emailNoAccessToOrg":[["email"]," does not have access to ",["organizationName"],". If you think this is a mistake, contact your admin."],"error.emailNotFound":["Email not found."],"error.eml":["Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."],"error.inactiveEmail":["The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."],"error.invalidCode":["Code format is invalid, please try again."],"error.invalidEmail":["Email format is invalid."],"error.invalidEmailAddress":["Invalid email address"],"error.invalidPhoneNumber":["Phone number format is invalid. Ensure the phone number is in the E.164 format."],"error.invalidPhoneNumberCountryCode":["The phone number's country code is invalid, unsupported, or disabled."],"error.invalidSessionToken":["Invalid session token."],"error.jitIneligible":[["email"]," does not have access to ",["organizationName"],". If you think this is a mistake, contact your admin"],"error.memberPasswordNotFound":["Member password not found."],"error.noUserPassword":["Password not found for this user. Please try again."],"error.oauthFlowCallbackError":["An error was encountered in the callback of the OAuth flow. Please try again."],"error.oauthTokenNotFound":["OAuth Token could not be found."],"error.organization":["The organization you are looking for could not be found. If you think this is a mistake, contact your admin."],"error.otpCodeNotFound":["Invalid passcode, please try again."],"error.passcodeInvalid":["Invalid passcode, please try again."],"error.resetPassword":["Password must be reset."],"error.sessionNotFound":["Session not found."],"error.title":["Looks like there was an error!"],"error.unableToAuthMagicLink":["The magic link could not be authenticated because it was either already used or expired. Please try again."],"error.unauthorizedAction":["Unauthorized action."],"error.unauthorizedCredentials":["Unauthorized credentials."],"error.unsubscribedPhoneNumber":["Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."],"error.userLockLimitReached":["Too many failed authentication attempts. Please try again later."],"error.userUnauthenticated":["Must have an active session to call this method. Have you logged in yet?"],"formField.backupCode.ariaLabel":["Backup code"],"formField.backupCode.placeholder":["Enter backup code"],"formField.countryCode.label":["Country code"],"formField.email.label":["Email"],"formField.email.placeholder":["example@email.com"],"formField.orgSlug.label":["Organization slug"],"formField.otp.ariaLabel":["One-time passcode"],"formField.passcode.status.verifying":["Verifying passcode..."],"formField.password.label":["Password"],"formField.phone.label":["Phone number"],"idpConsent.allowClientTo":["Allow ",["clientName"]," to:"],"idpConsent.button.allow":["Allow"],"idpConsent.button.deny":["Deny"],"idpConsent.customScopes.title":[["clientName"]," wants to access your ",["projectName"]," account"],"idpConsent.defaultClientName":["The App"],"idpConsent.denied":["Access to the application was denied."],"idpConsent.noActiveSession":["No active session detected. Please log in to continue."],"idpConsent.noPermissionsToGrant":["You do not have permissions to grant ",["clientName"]," access to some of the requested scopes."],"idpConsent.signIn.title":["Sign in to ",["clientName"]," with ",["projectName"]],"idpLogout.confirmMessage":["Are you sure you want to log out of your ",["projectName"]," account?"],"idpLogout.no":["No"],"idpLogout.notLoggedOut":["You have not been logged out. You may close this page."],"idpLogout.title":["Log out?"],"idpLogout.yes":["Yes"],"link.openInGmail":["Open in Gmail"],"link.openInOutlook":["Open in Outlook"],"link.openInYahoo":["Open in Yahoo"],"link.signupResetPassword":["Sign up or reset password"],"loading.label":["Loading"],"login.loading":["Logging in..."],"login.success.content":["You have successfully logged in."],"login.title":["Sign up or log in"],"methodDivider.text":["or"],"mfa.enrollment.content":["Your organization requires an additional form of verification to make your account more secure."],"mfa.enrollment.option.sms":["Text me a code"],"mfa.enrollment.option.totp":["Use an authenticator app"],"mfa.enrollment.title":["Set up Multi-Factor Authentication"],"mfa.methods.authenticatorApp":["Use an authenticator app"],"mfa.smsEnrollment.content":["Your organization requires an additional form of verification to make your account more secure."],"mfa.smsEnrollment.title":["Enter your phone number to set up Multi-Factor Authentication"],"mfa.totpEnrollment.content":["Click to copy the code below. Enter into your authenticator app to link your account."],"mfa.totpEnrollment.copyCode.codeCopied":["Copied!"],"mfa.totpEnrollment.copyCode.label":["Copy to clipboard"],"mfa.totpEnrollment.title":["Having trouble scanning the QR code?"],"mfa.totpEnrollment.toast.copyFailed":["Couldn't copy code to clipboard"],"mfa.totpEntry.getNewCode":["If the verification code doesn’t work, go back to your authenticator app to get a new code."],"mfa.totpEntry.switchToSms":["Text me a code instead"],"mfa.totpEntry.useBackupCode":["Use a backup code"],"mfaTotpEnrollment.qrAltText":["QR code for TOTP enrollment"],"oauth.continueWithGitHub":["Continue with GitHub"],"oauth.continueWithGoogle":["Continue with Google"],"oauth.continueWithHubSpot":["Continue with HubSpot"],"oauth.continueWithMicrosoft":["Continue with Microsoft"],"oauth.continueWithSlack":["Continue with Slack"],"organizationDiscovery.acceptInvite":["Accept Invite"],"organizationDiscovery.join":["Join"],"organizationDiscovery.noOrgs.content":["Make sure your email address is correct. Otherwise, you might need to be invited by your admin."],"organizationDiscovery.noOrgs.create.content":[["email"]," does not have an account. Think this is a mistake? Try a different email address, or contact your admin."],"organizationDiscovery.noOrgs.create.title":["Create an organization to get started"],"organizationDiscovery.noOrgs.title":[["email"]," does not belong to any organizations."],"organizationDiscovery.title":["Select an organization to continue"],"organizationLogin.title":["Continue to ",["organizationName"]],"organizationLogin.titleUnknown":["Continue to ..."],"passcode.codeSent":["Code sent! Try again in ",["timeRemaining"],"s"],"passcode.expirationCountdown":["Your code expires in ",["timeRemaining"],"."],"passcode.expired":["Your code has expired."],"passcode.resendCode":["Resend code"],"passcode.sentConfirmation":["A 6-digit passcode was sent to you at <bold>",["destination"],"</bold>."],"passcode.title":["Enter passcode"],"password.forgot.content.discovery":["We'll email you a verification link to sign up for an account or reset your password if you have one."],"password.forgot.content.organization":["We'll email you a login link to sign in to your account directly or reset your password if you have one."],"password.forgot.title":["Check your email for help signing in"],"password.login.title":["Log in with email and password"],"password.requirement.fulfilled":["Fulfilled"],"password.requirement.notFulfilled":["Not fulfilled"],"password.requirement.suggestion":["Suggestion"],"password.requirement.warning":["Warning"],"password.reset.emailSent.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.reset.emailSent.title":["Check your email"],"password.setNew.title":["Set a new password"],"password.strength":["Password strength: ",["score"]," out of 4."],"password.strength.accepted":["Password accepted."],"password.strength.notAccepted":["Password not accepted."],"password.strength.requirementsNotMet":["Your password must meet all requirements."],"password.strengthError.breached":["This password may have been used on a different site that experienced a security issue. Please choose another password."],"password.strengthError.complexity":[["complexity","plural",{one:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"],other:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"]}]],"password.strengthError.minimumLength":[["characterLength","plural",{one:["Must be at least ","#"," character long"],other:["Must be at least ","#"," characters long"]}]],"password.verification.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.verification.title":["Verify your email first."],"password.zxcvbn.suggestion.addWords":["Add another word or two. Uncommon words are better."],"password.zxcvbn.suggestion.allUppercase":["All-uppercase is almost as easy to guess as all-lowercase."],"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou":["Avoid dates and years that are associated with you."],"password.zxcvbn.suggestion.avoidRecentYears":["Avoid recent years."],"password.zxcvbn.suggestion.avoidRepeats":["Avoid repeated words and characters."],"password.zxcvbn.suggestion.avoidSequences":["Avoid sequences."],"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou":["Avoid years that are associated with you."],"password.zxcvbn.suggestion.capitalization":["Capitalization doesn't help very much."],"password.zxcvbn.suggestion.longerKeyboardPattern":["Use a longer keyboard pattern with more turns."],"password.zxcvbn.suggestion.noSymbolsDigitsUppercase":["No need for symbols, digits, or uppercase letters."],"password.zxcvbn.suggestion.predictableSubstitutions":["Predictable substitutions like '@' instead of 'a' don't help very much."],"password.zxcvbn.suggestion.reversed":["Reversed words aren't much harder to guess."],"password.zxcvbn.suggestion.useAFewWords":["Use a few words, avoid common phrases."],"password.zxcvbn.warning.commonNames":["Common names and surnames are easy to guess."],"password.zxcvbn.warning.dates":["Dates are often easy to guess."],"password.zxcvbn.warning.longerRepeats":['Repeats like "abcabcabc" are only slightly harder to guess than "abc".'],"password.zxcvbn.warning.names":["Names and surnames by themselves are easy to guess."],"password.zxcvbn.warning.recentYears":["Recent years are easy to guess."],"password.zxcvbn.warning.repeats":['Repeats like "aaa" are easy to guess.'],"password.zxcvbn.warning.sequences":['Sequences like "abc" or "6543" are easy to guess.'],"password.zxcvbn.warning.shortKeyboardPatterns":["Short keyboard patterns are easy to guess."],"password.zxcvbn.warning.similarToCommonPassword":["This is similar to a commonly used password."],"password.zxcvbn.warning.straightRows":["Straight rows of keys are easy to guess."],"password.zxcvbn.warning.top100CommonPassword":["This is a top-100 common password."],"password.zxcvbn.warning.top10CommonPassword":["This is a top-10 common password."],"password.zxcvbn.warning.veryCommonPassword":["This is a very common password."],"password.zxcvbn.warning.wordByItself":["A word by itself is easy to guess."],"provider.continueWith":["Continue with ",["display_name"]],"provider.continueWithSSO":["Use single sign-on"],"provider.lastUsed":["Last used"],"recoveryCodes.entry.content":["Enter one of the backup codes you saved when setting up your authenticator app."],"recoveryCodes.entry.error.invalidCode":["Invalid backup code, please try again."],"recoveryCodes.entry.title":["Enter backup code"],"recoveryCodes.filename.noOrganizationName":["backup-codes"],"recoveryCodes.filename.withOrganizationName":[["organizationName"],"-backup-codes"],"recoveryCodes.save.button.copied":["Copied!"],"recoveryCodes.save.button.copyAll":["Copy all to clipboard"],"recoveryCodes.save.button.done":["Done"],"recoveryCodes.save.button.download":["Download .txt file"],"recoveryCodes.save.content":["This is the only time you will be able to access and save your backup codes."],"recoveryCodes.save.title":["Save your backup codes!"],"recoveryCodes.save.toast.copyFailed":["Couldn't copy codes to clipboard"],"ssoDiscovery.email.error.unknown":["Something went wrong. Try again later or contact your admin for help."],"ssoDiscovery.email.title":["Enter your email to continue"],"ssoDiscovery.fallback.button.reset":["Try another method"],"ssoDiscovery.fallback.content":["Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."],"ssoDiscovery.fallback.error.orgNotFound":["Organization not found. Please try again."],"ssoDiscovery.fallback.error.unknown":["An error occurred. Please try again."],"ssoDiscovery.fallback.title":["Sorry, we couldn't find any connections"],"ssoDiscovery.title":["Select a connection to continue"],"success.title":["Success!"],"totp.content":["Enter the 6-digit code from your authenticator app."],"totp.setupQr.content":["Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."],"totp.setupQr.title":["Scan the QR code to link your authenticator app"],"totp.title":["Enter verification code"],"watermark.altText":["Stytch by Twilio"],"watermark.poweredBy":["Powered by"]},rX=Symbol.for("stytch__internal_b2b"),r1=e=>{if(!e[rX])throw Error("Internals not found!");return e[rX]};var r0={},r2={},r3={exports:{}},r4=r3.exports,r5=function(){if(es)return r0;es=1,Object.defineProperty(r0,"__esModule",{value:!0}),r0.ParseError=void 0,r0.parse=function(e,t={}){return new i(e,t).parse()};let e=function(){var e;let t;return ei?r2:(ei=1,e=r2&&r2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(r2,"__esModule",{value:!0}),r2.lexer=r2.states=void 0,t=e(function(){var e;return eo?r3.exports:(eo=1,e=function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof RegExp().sticky;function n(e){return e&&"[object RegExp]"===t.call(e)}function a(e){return e&&"object"==typeof e&&!n(e)&&!Array.isArray(e)}function o(e){return e.length?"(?:"+e.map(function(e){return"(?:"+e+")"}).join("|")+")":"(?!)"}function i(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(n(e)){if(e.ignoreCase)throw Error("RegExp /i flag not allowed");if(e.global)throw Error("RegExp /g flag is implied");if(e.sticky)throw Error("RegExp /y flag is implied");if(e.multiline)throw Error("RegExp /m flag is implied");return e.source}throw Error("Not a pattern: "+e)}function s(e,t){return e.length>t?e:Array(t-e.length+1).join(" ")+e}function l(t,r){if(a(r)||(r={match:r}),r.include)throw Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var i in r)e.call(r,i)&&(o[i]=r[i]);if("string"==typeof o.type&&t!==o.type)throw Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort(function(e,t){return n(e)&&n(t)?0:n(t)?-1:n(e)?1:t.length-e.length}),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n.include){for(var a=[].concat(n.include),o=0;o<a.length;o++)t.push({include:a[o]});continue}if(!n.type)throw Error("Rule has no type: "+JSON.stringify(n));t.push(l(n.type,n))}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),r=[],n=0;n<t.length;n++){var o=t[n],i=[].concat(e[o]);if("include"===o){for(var s=0;s<i.length;s++)r.push({include:i[s]});continue}var c=[];i.forEach(function(e){a(e)?(c.length&&r.push(l(o,c)),r.push(l(o,e)),c=[]):c.push(e)}),c.length&&r.push(l(o,c))}return r}(e)}var d=l("error",{lineBreaks:!0,shouldThrow:!0});function u(e,t){for(var a=null,s=Object.create(null),l=!0,c=null,u=[],h=[],m=0;m<e.length;m++)e[m].fallback&&(l=!1);for(var m=0;m<e.length;m++){var p=e[m];if(p.include)throw Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(a)if(!p.fallback==!a.fallback)throw Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')");else throw Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");a=p}var _=p.match.slice();if(l)for(;_.length&&"string"==typeof _[0]&&1===_[0].length;)s[_.shift().charCodeAt(0)]=p;if(p.pop||p.push||p.next){if(!t)throw Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(0!==_.length){l=!1,u.push(p);for(var g=0;g<_.length;g++){var f=_[g];if(n(f)){if(null===c)c=f.unicode;else if(c!==f.unicode&&!1===p.fallback)throw Error("If one rule is /u then all must be")}}var y=o(_.map(i)),v=new RegExp(y);if(v.test(""))throw Error("RegExp matches empty string: "+v);if(RegExp("|"+y).exec("").length-1>0)throw Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!p.lineBreaks&&v.test("\n"))throw Error("Rule should declare lineBreaks: "+v);h.push("("+y+")")}}var b=a&&a.fallback,w=r&&!b?"ym":"gm";return!0===c&&(w+="u"),{regexp:new RegExp(o(h)+(r||b?"":"|"),w),groups:u,fast:s,error:a||d}}function h(e,t,r){var n=e&&(e.push||e.next);if(n&&!r[n])throw Error("Missing state '"+n+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var m=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};m.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedText=t?t.queuedText:"",this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},m.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},m.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},m.prototype.popState=function(){this.setState(this.stack.pop())},m.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var p=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function _(){return this.value}if(m.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r<t;r++)if(void 0!==e[r+1])return this.groups[r];throw Error("Cannot find token type for matched text")},m.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var r=this.buffer;if(e!==r.length){var n=this.fast[r.charCodeAt(e)];if(n)return this._token(n,r.charAt(e),e);var a=this.re;a.lastIndex=e;var o=p(a,r),i=this.error;if(null==o)return this._token(i,r.slice(e,r.length),e);var n=this._getGroup(o),s=o[0];return i.fallback&&o.index!==e?(this.queuedGroup=n,this.queuedText=s,this._token(i,r.slice(e,o.index),e)):this._token(n,s,e)}},m.prototype._token=function(e,t,r){var n=0;if(e.lineBreaks){var a=/\n/g,o=1;if("\n"===t)n=1;else for(;a.exec(t);)n++,o=a.lastIndex}var i={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:_,offset:r,lineBreaks:n,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=n,0!==n?this.col=s-o+1:this.col+=s,e.shouldThrow)throw Error(this.formatError(i,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),i},"u">typeof Symbol&&Symbol.iterator){var g=function(e){this.lexer=e};g.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},g.prototype[Symbol.iterator]=function(){return this},m.prototype[Symbol.iterator]=function(){return new g(this)}}return m.prototype.formatError=function(e,t){if(null==e)var r=this.buffer.slice(this.index),e={text:r,offset:this.index,lineBreaks:+(-1!==r.indexOf("\n")),line:this.line,col:this.col};var n=Math.max(e.line-2,1),a=String(e.line+2).length,o=(function(e,t){for(var r=e.length,n=0;;){var a=e.lastIndexOf("\n",r-1);if(-1===a)break;if(n++,r=a,n===t||0===r)break}var o=n<t?0:r+1;return e.substring(o).split("\n")})(this.buffer,this.line-e.line+2+1).slice(0,5),i=[];i.push(t+" at line "+e.line+" col "+e.col+":"),i.push("");for(var l=0;l<o.length;l++){var c=o[l],d=n+l;i.push(s(String(d),a)+" "+c),d===e.line&&i.push(s("",a+e.col+1)+"^")}return i.join("\n")},m.prototype.clone=function(){return new m(this.states,this.state)},m.prototype.has=function(e){return!0},{compile:function(e){return new m({start:u(c(e))},"start")},states:function(e,t){var r=e.$all?c(e.$all):[];delete e.$all;var n=Object.getOwnPropertyNames(e);t||(t=n[0]);for(var a=Object.create(null),o=0;o<n.length;o++){var i=n[o];a[i]=c(e[i]).concat(r)}for(var o=0;o<n.length;o++)for(var i=n[o],s=a[i],l=Object.create(null),d=0;d<s.length;d++){var p=s[d];if(p.include){var _=[d,1];if(p.include!==i&&!l[p.include]){l[p.include]=!0;var g=a[p.include];if(!g)throw Error("Cannot include nonexistent state '"+p.include+"' (in state '"+i+"')");for(var f=0;f<g.length;f++){var y=g[f];-1===s.indexOf(y)&&_.push(y)}}s.splice.apply(s,_),d--}}for(var v=Object.create(null),o=0;o<n.length;o++){var i=n[o];v[i]=u(a[i],!0)}for(var o=0;o<n.length;o++){for(var b=n[o],w=v[b],k=w.groups,d=0;d<k.length;d++)h(k[d],b,v);for(var S=Object.getOwnPropertyNames(w.fast),d=0;d<S.length;d++)h(w.fast[S[d]],b,v)}return new m(v,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t="u">typeof Map,r=t?new Map:Object.create(null),n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var o=n[a],i=e[o];(Array.isArray(i)?i:[i]).forEach(function(e){if("string"!=typeof e)throw Error("keyword must be string (in keyword '"+o+"')");t?r.set(e,o):r[e]=o})}return function(e){return t?r.get(e):r[e]}}}},r3.exports?r3.exports=e():r4.moo=e(),r3.exports)}()),r2.states={body:{doubleapos:{match:"''",value:()=>"'"},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:e=>e.slice(1,-1).replace(/''/g,"'")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:e=>e.substring(1).trim()},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:e=>e.split(",")[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:e=>e.split(",")[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:e=>e.substring(1).trim()},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:e=>e.split(":")[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:e=>e.substring(0,e.indexOf("{")).trim()},end:{match:/\s*\}/u,pop:1}}},r2.lexer=t.default.states(r2.states),r2)}(),t=e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),r=e=>"plural"===e||"select"===e||"selectordinal"===e,n=["number","date","time","spellout","ordinal","duration"],a=["zero","one","two","few","many","other"];class o extends Error{constructor(t,r){super(e.lexer.formatError(t,r))}}r0.ParseError=o;class i{constructor(t,r){var n,o,i,s;this.lexer=e.lexer.reset(t),this.cardinalKeys=null!=(n=null==r?void 0:r.cardinal)?n:a,this.ordinalKeys=null!=(o=null==r?void 0:r.ordinal)?o:a,this.strict=null!=(i=null==r?void 0:r.strict)&&i,this.strictPluralKeys=null==(s=null==r?void 0:r.strictPluralKeys)||s}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,t,r){if("="===r[0]){if("select"===t)throw new o(e,`The case ${r} is not valid with select`)}else if("select"!==t){let n="plural"===t?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&n.length>0&&!n.includes(r))throw new o(e,`The ${t} case ${r} is not valid in this locale`)}}parseSelect({value:e},r,n,a){let i={type:a,arg:e,cases:[],ctx:n};for(let e of("plural"===a||"selectordinal"===a?r=!0:this.strict&&(r=!1),this.lexer))switch(e.type){case"offset":if("select"===a)throw new o(e,"Unexpected plural offset for select");if(i.cases.length>0)throw new o(e,"Plural offset must be set before cases");i.pluralOffset=Number(e.value),n.text+=e.text,n.lineBreaks+=e.lineBreaks;break;case"case":this.checkSelectKey(e,a,e.value),i.cases.push({key:e.value,tokens:this.parseBody(r),ctx:t(e)});break;case"end":return i;default:throw new o(e,`Unexpected lexer token: ${e.type}`)}throw new o(null,"Unexpected message end")}parseArgToken(e,a){let i=t(e),s=this.lexer.next();if(!s)throw new o(null,"Unexpected message end");if(i.text+=s.text,i.lineBreaks+=s.lineBreaks,this.strict&&("func-simple"===s.type||"func-args"===s.type)&&!n.includes(s.value))throw new o(e,`Invalid strict mode function arg type: ${s.value}`);switch(s.type){case"end":return{type:"argument",arg:e.value,ctx:i};case"func-simple":{let t=this.lexer.next();if(!t)throw new o(null,"Unexpected message end");if("end"!==t.type)throw new o(t,`Unexpected lexer token: ${t.type}`);if(i.text+=t.text,r(s.value.toLowerCase()))throw new o(s,`Invalid type identifier: ${s.value}`);return{type:"function",arg:e.value,key:s.value,ctx:i}}case"func-args":{if(r(s.value.toLowerCase())){let e=`Invalid type identifier: ${s.value}`;throw new o(s,e)}let t=this.parseBody(!this.strict&&a);return this.strict&&t.length>0&&(t=function(e,t){let r="",n="";for(let a of t){let t=a.ctx.text;switch(n+=t,a.type){case"content":r+=a.value;break;case"argument":case"function":case"octothorpe":r+=t;break;default:throw new o(e,`Unsupported part in strict mode function arg style: ${t}`)}}return[{type:"content",value:r.trim(),ctx:Object.assign({},t[0].ctx,{text:n})}]}(e,t)),{type:"function",arg:e.value,key:s.value,param:t,ctx:i}}case"select":if(r(s.value))return this.parseSelect(e,a,i,s.value);throw new o(s,`Unexpected select type ${s.value}`);default:throw new o(s,`Unexpected lexer token: ${s.type}`)}}parseBody(e,r){let n=[],a=null;for(let i of this.lexer)if("argument"===i.type)a&&(a=null),n.push(this.parseArgToken(i,e));else if("octothorpe"===i.type&&e)a&&(a=null),n.push({type:"octothorpe",ctx:t(i)});else{if("end"===i.type&&!r)return n;let s=i.value;if(!e&&"quoted"===i.type&&"#"===s[0]){if(s.includes("{"))throw new o(i,`Unsupported escape pattern: ${s}`);s=i.text}a?(a.value+=s,a.ctx.text+=i.text,a.ctx.lineBreaks+=i.lineBreaks):(a={type:"content",value:s,ctx:t(i)},n.push(a))}if(r)return n;throw new o(null,"Unexpected message end")}}return r0}();class r8 extends Error{constructor(e,t,r){super(e),this.token=t,this.type=r||"error"}}let r6=e=>e<4?"short":4===e?"long":"narrow",r9=e=>e%2==0?"2-digit":"numeric",r7={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},ne=e=>e>="A"&&e<="Z"||e>="a"&&e<="z";function nt(e,t=e=>e){try{return function(e,t=e=>e){return function e(t,r){return t.filter(e=>"content"!==e.type).length?t.map(t=>{if("content"===t.type)return r(t.value);if("octothorpe"===t.type)return"#";if("argument"===t.type)return[t.arg];if("function"===t.type){let e=t?.param?.[0];if("date"===t.key&&e){var n,a;let r=(n=e.value.trim(),a=e=>{throw Error(`Unable to compile date expression: ${e.message}`)},/^::/.test(n)?function(e,t,r=e=>{throw e}){let n={timeZone:t},a=[];for(let t of e){let{error:e,field:o,str:i}=t;if(e){let n=new r8(e.message,t);n.stack=e.stack,r(n)}i&&r(new r8(`Ignoring string part: ${i}`,t,r8.WARNING)),o&&(-1===a.indexOf(o)?a.push(o):r(new r8(`Duplicate ${o} token`,t)));let s=function(e,t){switch(e.field){case"era":return{era:r6(e.width)};case"year":switch(e.char){case"y":return{year:r9(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return t(`${e.desc} is not supported; falling back to year:numeric`,r8.WARNING),{year:"numeric"}}case"month":return{month:function(e,t){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:t(`${e.desc} is not supported with width ${e.width}`);return}}(e,t)};case"day":return{day:function(e,t){let{char:r,desc:n,width:a}=e;return"d"===r?r9(a):void t(`${n} is not supported`)}(e,t)};case"weekday":return{weekday:function(e,t){let{char:r,desc:n,width:a}=e;return("c"===r||"e"===r)&&a<3&&t(`Numeric value is not supported for ${n}; falling back to weekday:short`,r8.WARNING),r6(a)}(e,t)};case"period":break;case"hour":let r,n=r9(e.width);switch(e.char){case"h":r="h12";break;case"H":r="h23";break;case"k":r="h24";break;case"K":r="h11"}return r?{hour:n,hourCycle:r}:{hour:n};case"min":return{minute:r9(e.width)};case"sec":return{second:r9(e.width)};case"tz":return{timeZoneName:function(e,t){let{char:r,desc:n,width:a}=e;switch(r){case"v":case"z":return 4===a?"long":"short";case"V":if(4===a)return"long";t(`${n} is not supported with width ${a}`);return;case"X":t(`${n} is not supported`);return}return"short"}(e,t)};case"quarter":case"week":case"sec-frac":case"ms":t(`${e.desc} is not supported`)}}(t,(e,n)=>r(new r8(e,t,n)));s&&Object.assign(n,s)}return n}(function(e){let t=[],r=0;for(;;){let n=function(e,t){let r=e[t];if(!r)return null;if(ne(r)){var n=t;let r=e[n],a=1;for(;e[++n]===r;)++a;let o=r7[r];if(!o){let e=`The letter ${r} is not a valid field identifier`;return{char:r,error:Error(e),width:a}}return{char:r,field:o.field,desc:o.desc,width:a}}if("'"===r){var a=t;let r=e[++a],n=2;if("'"===r)return{char:"'",str:r,width:n};for(;;){let t=e[++a];if(++n,void 0===t)return{char:"'",error:Error(`Unterminated quoted literal in pattern: ${r||e}`),str:r,width:n};if("'"===t)if("'"!==e[++a])return{char:"'",str:r,width:n};else++n;r+=t}return}let o=r,i=1;for(;;){let n=e[++t];if(!n||ne(n)||"'"===n)return{char:r,str:o,width:i};o+=n,i+=1}}(e,r);if(!n)return t;t.push(n),r+=n.width}}(n.substring(2)),void 0,a):n);return[t.arg,t.key,r]}return e?[t.arg,t.key,e.value.trim()]:[t.arg,t.key]}let o=t.pluralOffset,i={};return t.cases.forEach(({key:t,tokens:n})=>{i["="===t[0]?t.slice(1):t]=e(n,r)}),[t.arg,t.type,{offset:o,...i}]}):t.map(e=>r(e.value))}(r5.parse(e),t)}(e,t)}catch(t){return console.error(`${t.message}
14
+ `+JSON.stringify(i)+"\n":"")),this.error_type=r,this.error_message=n,this.error_url=a,this.request_id=o,this.status_code=t,this.error_details=i}static from(e){return e instanceof v?e:e&&"object"==typeof e&&"number"==typeof e.status_code&&"string"==typeof e.error_type&&"string"==typeof e.error_message&&"string"==typeof e.error_url?new v({status_code:e.status_code,error_type:e.error_type,error_message:e.error_message,error_url:e.error_url,request_id:"string"==typeof e.request_id?e.request_id:void 0,error_details:"object"==typeof e.error_details?e.error_details:void 0}):new v({status_code:400,error_type:"unknown_error",error_message:e instanceof Error?e.message:"Unknown error: "+String(e),error_url:"",request_id:void 0,error_details:void 0})}}class b extends g{options;constructor(e,t,r){super(e,t),this.options=r}}class w extends b{constructor(){super("NoCurrentSessionError","There is no session currently available. Make sure the user is authenticated with a valid session.")}}class k extends b{nativeStack;constructor(e){super(e.name?e.name:"Internal Error",e.message?e.message:"An internal error has occurred. Please contact Stytch if this occurs."),this.nativeStack=e.nativeStackAndroid||e.nativeStackIOS}}class S extends b{constructor(){super("NoBiometricsRegistrationError","There is no biometric registration available. Authenticate with another method and add a new biometric registration first.")}}class E extends b{constructor(){super("BiometricsUnavailableError","Biometrics is not available on the device.")}}class C extends b{constructor(){super("KeyInvalidatedError","The biometrics enrollment on the device has changed.")}}class P extends b{constructor(){super("KeystoreUnavailableError","The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.")}}class T extends b{constructor(){super("NoBiometricsEnrolledError","There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.")}}class O extends b{constructor(){super("UserCancellationError","The user canceled the prompt. Ask the user to try again.")}}class A extends b{constructor(){super("UserLockedOutError","The user has been locked out due to too many failed attempts. Ask the user to try again later.")}}class x extends b{constructor(){super("DeviceCredentialsNotAllowedError","The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.")}}class D extends b{constructor(){super("MissingAuthorizationCredentialIDTokenError","The authorization credential is missing an ID token.")}}class z extends b{constructor(){super("InvalidAuthorizationCredentialError","The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.")}}class M extends b{constructor(){super("NoCredentialsPresentError","The user did not provide credentials for a Google OneTap attempt")}}class I extends b{constructor(){super("MissingPublicKeyError","Failed to retrieve the public key. Add a new biometric registration.")}}class R extends b{constructor(){super("ChallengeSigningFailedError","Failed to sign the challenge with the key.")}}class L extends b{constructor(){super("SDKNotConfiguredError","Stytch client is not confiured. You must call the configure method before using the SDK")}}class B extends b{constructor(){super("FailedCodeChallengeError","Failed to create a code challenge")}}class N extends b{constructor(){super("PasskeysUnsupportedError","Passkeys are not supported on this device")}}class U extends b{constructor(){super("FailedToDecryptDataError","Failed to decrypt user data")}}class F extends b{constructor(){super("BiometricsFailedError","Biometric authentication failed")}}class q extends b{constructor(){super("InvalidStartUrlError","The start URL was invalid or improperly formatted.")}}class H extends b{constructor(){super("InvalidRedirectSchemeError","The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.")}}class K extends b{constructor(){super("MissingUrlError","The underlying web authentication service failed to return a URL.")}}class j extends b{constructor(){super("InvalidCredentialTypeError","The public key credential type was not of the expected type.")}}class $ extends b{constructor(){super("MissingAttestationObjectError","The public key credential is missing the attestation object.")}}class V extends b{constructor(){super("JSONDataNotConvertibleToStringError","JSON data unable to be converted to String type.")}}class W extends b{constructor(){super("RandomNumberGenerationFailed","Random number generation failed")}}class G extends b{constructor(){super("PasskeysInvalidEncoding","Invalid passkey encoding")}}class Y extends b{constructor(){super("PasskeysMisconfigured","Passkeys are misconfigured. Verify that you have added the correct associated domain for your application, and that the signing information is correct.")}}class Z extends b{constructor(){super("SignInWithAppleMisconfigured","Sign In With Apple is misconfigured. Verify that you have correctly configured Apple OAuth in the Stytch Dashboard and added the Sign In With Apple capability to your project.")}}class J extends b{constructor(){super("MissingCipherIv","The expected cipher Iv was not found when attempting to decrypt an existing biometric key.")}}class Q extends b{constructor(){super("InvalidPrivateKeyLength","The private key was of an incorrect length.")}}class X extends b{constructor(){super("BiometricRegistrationIdIsNullOrBlank","Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.")}}class ee extends b{constructor(){super("DFPNotConfigured","You have attempted to retrieve a telemetry ID before the DFP client has been configured.")}}class et extends b{constructor(e){super("IDPOAuthFlowMissingParamError",e)}}let er={embedded:"embedded",floating:"floating",embeddedOnly:"embeddedOnly",floatingOrEmbedded:"floatingOrEmbedded",forceLegacyEmbedded:"forceLegacyEmbedded"};var en,ea,eo,ei,es,el,ec,ed,eu=((ea={}).MagicLinkLoginOrCreateEvent="MAGIC_LINK_LOGIN_OR_CREATE",ea.OTPsLoginOrCreateEvent="OTP_LOGIN_OR_CREATE",ea.OTPsAuthenticate="OTP_AUTHENTICATE",ea.CryptoWalletAuthenticateStart="CRYPTO_WALLET_AUTHENTICATE_START",ea.CryptoWalletAuthenticate="CRYPTO_WALLET_AUTHENTICATE",ea.PasswordCreate="PASSWORD_CREATE",ea.PasswordAuthenticate="PASSWORD_AUTHENTICATE",ea.PasswordResetByEmailStart="PASSWORD_RESET_BY_EMAIL_START",ea.PasswordResetByEmail="PASSWORD_RESET_BY_EMAIL",ea.PasskeyRegister="PASSKEY_REGISTER",ea.PasskeyAuthenticate="PASSKEY_AUTHENTICATE",ea.PasskeySkip="PASSKEY_SKIP",ea.PasskeyDone="PASSKEY_DONE",ea.AuthenticateFlowComplete="AUTHENTICATE_FLOW_COMPLETE",ea.OAuthAuthorizeFlowStart="OAUTH_AUTHORIZE_FLOW_START",ea.OAuthAuthorizeFlowComplete="OAUTH_AUTHORIZE_FLOW_COMPLETE",ea.OAuthAuthorizeFlowConsentDenied="OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED",ea.B2BMagicLinkEmailLoginOrSignup="B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP",ea.B2BMagicLinkAuthenticate="B2B_MAGIC_LINK_AUTHENTICATE",ea.B2BMagicLinkEmailDiscoverySend="B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND",ea.B2BMagicLinkDiscoveryAuthenticate="B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE",ea.B2BSSOStart="B2B_SSO_START",ea.B2BSSOAuthenticate="B2B_SSO_AUTHENTICATE",ea.B2BSSODiscoverConnections="B2B_SSO_DISCOVER_CONNECTIONS",ea.B2BOAuthAuthenticate="B2B_OAUTH_AUTHENTICATE",ea.B2BOAuthDiscoveryAuthenticate="B2B_OAUTH_DISCOVERY_AUTHENTICATE",ea.B2BDiscoveryOrganizationsCreate="B2B_DISCOVERY_ORGANIZATIONS_CREATE",ea.B2BDiscoveryIntermediateSessionExchange="B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE",ea.B2BPasswordAuthenticate="B2B_PASSWORD_AUTHENTICATE",ea.B2BPasswordDiscoveryAuthenticate="B2B_PASSWORD_DISCOVERY_AUTHENTICATE",ea.B2BPasswordResetByEmailStart="B2B_PASSWORD_RESET_BY_EMAIL_START",ea.B2BPasswordResetByEmail="B2B_PASSWORD_RESET_BY_EMAIL",ea.B2BPasswordResetBySession="B2B_PASSWORD_RESET_BY_SESSION",ea.B2BSMSOTPSend="B2B_SMS_OTP_SEND",ea.B2BSMSOTPAuthenticate="B2B_SMS_OTP_AUTHENTICATE",ea.B2BTOTPCreate="B2B_TOTP_CREATE",ea.B2BTOTPAuthenticate="B2B_TOTP_AUTHENTICATE",ea.B2BRecoveryCodesRecover="B2B_RECOVERY_CODES_RECOVER",ea.B2BPasswordDiscoveryResetStart="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START",ea.B2BDiscoveryPasswordReset="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL",ea.B2BImpersonationAuthenticate="B2B_IMPERSONATION_AUTHENTICATE",ea.B2BOTPsEmailAuthenticate="B2B_OTPS_EMAIL_AUTHENTICATE",ea.B2BOTPsEmailDiscoveryAuthenticate="B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE",ea.B2BOTPsEmailDiscoverySend="B2B_OTPS_EMAIL_DISCOVERY_SEND",ea.B2BOTPsEmailLoginOrSignup="B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP",ea.B2BOrganizationsGetBySlug="B2B_ORGANIZATIONS_GET_BY_SLUG",ea),eh=((e8={})[e8.emailMagicLinks=0]="emailMagicLinks",e8[e8.oauth=1]="oauth",e8[e8.otp=2]="otp",e8[e8.passwords=3]="passwords",e8),em=((e6={}).RequiredCaptcha="CAPTCHA required",e6);class ep extends Error{type;constructor(e){super(e),this.type=e}}async function e_({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o,retryCallback:i}){let s={method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o};try{return await eg(s)}catch(e){if(e instanceof ep)return s=await i(e,s),await eg(s);throw e}}async function eg({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o}){let i,s,l={Authorization:r,"Content-Type":"application/json","X-SDK-Client":n};a&&(l["X-SDK-Parent-Host"]=a);let c={method:e,headers:l,body:o&&JSON.stringify(o),credentials:"include"};try{i=await fetch(t,c)}catch(e){if("Failed to fetch"===e.message)throw new f("Unable to contact our servers.");throw e}if(i.status<=299)try{return(await i.json()).data}catch{throw new f("Invalid JSON response from our servers.")}if(200!==i.status&&i.headers.get("content-type")?.includes("application/json")){let e;try{e=await i.json()}catch{throw new f("Invalid or no response from server")}if("body"in e||"params"in e||"query"in e)throw new y(e);throw new v(e)}try{s=await i.text()}catch{throw new f("Invalid response from our servers.")}if(s.includes("Captcha required"))throw new ep("CAPTCHA required");throw new f("Invalid response from our servers.")}async function ef({method:e,finalURL:t,basicAuthHeader:r,xSDKClientHeader:n,xSDKParentHostHeader:a,body:o}){let i={...o||{},__Authorization:r,"__X-SDK-Client":n};a&&(i["__X-SDK-Parent-Host"]=a);let s=Object.entries(i).map(([e,t])=>{let r=document.createElement("input");return r.type="hidden",r.name=e,r.value=t,r}),l=document.createElement("form");l.method=e,l.action=t,l.append(...s),document.body.appendChild(l),l.submit()}for(var ey=new Uint8Array(16),ev=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,eb=[],ew=0;ew<256;++ew)eb.push((ew+256).toString(16).substr(1));function ek(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(!e7&&!(e7="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e7(ey)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(eb[e[t+0]]+eb[e[t+1]]+eb[e[t+2]]+eb[e[t+3]]+"-"+eb[e[t+4]]+eb[e[t+5]]+"-"+eb[e[t+6]]+eb[e[t+7]]+"-"+eb[e[t+8]]+eb[e[t+9]]+"-"+eb[e[t+10]]+eb[e[t+11]]+eb[e[t+12]]+eb[e[t+13]]+eb[e[t+14]]+eb[e[t+15]]).toLowerCase();if(!("string"==typeof r&&ev.test(r)))throw TypeError("Stringified UUID is invalid");return r}(n)}let eS=e=>{try{let t=new URL(e);return`https://${t.hostname}`}catch{}try{let t=new URL(`https://${e}`);return`https://${t.hostname}`}catch{}},eE=["%c[Stytch]%c","background: #19303d; color: #13E5C0; padding: 2px;border-radius: 4px",""],eC=(...e)=>console.warn(...eE,...e),eP=(...e)=>console.error(...eE,...e),eT=function(e,t){if(e.length<=1)return[e,!1];let r=e.findIndex(t);if(-1===r)return[e,!1];let n=[...e];return n.unshift(...n.splice(r,1)),[n,!0]},eO=`
15
+ You can find your public token at https://stytch.com/dashboard/api-keys.`,eA={US:"1",AX:"358",AS:"1684",AG:"1268",AI:"1264",AR:"54",AT:"43",AU:"61",BE:"32",BJ:"229",BO:"591",BR:"55",IO:"246",BN:"673",BG:"359",BF:"226",CM:"237",CA:"1",BQ:"599",CF:"236",CL:"56",CX:"61",CC:"61",CO:"57",CD:"243",CK:"682",CR:"506",HR:"385",CZ:"420",DK:"45",DO:"1829",EC:"593",SV:"503",EE:"372",SZ:"268",FK:"500",FI:"358",FR:"33",GF:"594",DE:"49",GH:"233",GR:"30",GD:"1473",GT:"502",GG:"44",GW:"245",GY:"592",HU:"36",IS:"354",IN:"91",IE:"353",IM:"44",IT:"39",JM:"1876",JP:"81",KZ:"7",KE:"254",KI:"686",KR:"82",LV:"371",LT:"370",LU:"352",MO:"853",MT:"356",MH:"692",MR:"222",MU:"230",YT:"262",MX:"52",MC:"377",ME:"382",NR:"674",NL:"31",NZ:"64",NI:"505",NF:"672",NO:"47",PA:"507",PY:"595",PE:"51",PN:"870",PL:"48",PT:"351",PR:"1",RO:"40",BL:"590",SH:"290",KN:"1869",LC:"1758",MF:"590",PM:"508",SM:"378",ST:"239",SC:"248",SX:"599",SK:"421",SI:"386",ZA:"27",SS:"211",ES:"34",SR:"597",SJ:"47",SE:"46",CH:"41",TW:"886",TZ:"255",TK:"690",TO:"676",TT:"1868",TR:"90",UA:"380",GB:"44",UM:"1",UY:"598",VA:"379",EH:"212"},ex={};async function eD(e,t){var r,n;return void 0!==ex[e]||(ex[e]=(r=e,n=t,new Promise((e,t)=>{var a;let o,i=function(e){let t=document.querySelectorAll(`script[src="${e}"]`);if(t[0])return t[0]}(r);if(i&&"true"===i.dataset.loaded)try{e(n())}catch(e){return t(Error(`${r} already loaded, but module was not found in global scope: ${e}`))}let s=(a=r,(o=document.createElement("script")).setAttribute("src",a),o.setAttribute("async","true"),o.setAttribute("defer","true"),document.head.appendChild(o),o);s.addEventListener("load",()=>{s.dataset.loaded="true";try{e(n())}catch(e){t(Error(`${r} was loaded, but module was not found in global scope: ${e}`))}}),s.addEventListener("error",e=>{t(Error(`${r} could not be loaded: ${e}`))})}))),ex[e]}class ez{bootstrapPromise;state;constructor(e,t,r,n,a=()=>Promise.resolve(void 0)){this.bootstrapPromise=n,this.state=n.then(async n=>n.runDFPProtectedAuth?(await eD(`${r}/telemetry.js`,()=>window.GetTelemetryID),{publicToken:e,dfpBackendURL:t,enabled:!0,mode:n.dfpProtectedAuthMode||"OBSERVATION",loaded:!0,executeRecaptcha:a}):{publicToken:e,dfpBackendURL:t,enabled:!1,loaded:!1,executeRecaptcha:a})}isEnabled=async()=>this.state.then(e=>e.enabled);getTelemetryID=async()=>{let{publicToken:e,enabled:t,dfpBackendURL:r}=await this.state;if(t)return await window.GetTelemetryID(e,`${r}/submit`)};getDFPTelemetryIDAndCaptcha=async()=>{let e,t,{enabled:r,executeRecaptcha:n,mode:a}=await this.state;return r||(t=await n()),"DECISIONING"===a?e=await this.getTelemetryID():"OBSERVATION"===a&&(e=await this.getTelemetryID(),t=await n()),{dfp_telemetry_id:e,captcha_token:t}};retryWithCaptchaAndDFP=async(e,t)=>{let{enabled:r,executeRecaptcha:n}=await this.state;if(e.type===em.RequiredCaptcha&&r)return t.body&&(t.body.dfp_telemetry_id=await this.getTelemetryID(),t.body.captcha_token=await n()),t;throw Error("Unable to query captcha and/or dfp telemetry ID")}}let eM=()=>({isEnabled:async()=>!1,getTelemetryID:async()=>void 0,getDFPTelemetryIDAndCaptcha:async()=>({dfp_telemetry_id:void 0,captcha_token:void 0}),retryWithCaptchaAndDFP:async()=>{throw Error("DFP protected auth is disabled")}});class eI{static inflate(e,t){let r=new e(t);return Object.assign(r,t),Object.setPrototypeOf(r,e.prototype),r}static unmarshall(e){if("name"in e)switch(e.name){case"SDKAPIUnreachableError":return eI.inflate(u,e);case"StytchSDKSchemaError":return eI.inflate(m,e);case"StytchAPIUnreachableError":return eI.inflate(f,e);case"StytchAPISchemaError":return eI.inflate(y,e);case"StytchSDKAPIError":return eI.inflate(p,e);case"StytchAPIError":return eI.inflate(v,e);case"TypeError":return eI.inflate(TypeError,e);case"SyntaxError":return eI.inflate(SyntaxError,e);case"ReferenceError":return eI.inflate(ReferenceError,e);case"RangeError":return eI.inflate(RangeError,e);case"EvalError":return eI.inflate(EvalError,e);case"URIError":return eI.inflate(URIError,e)}return eI.inflate(Error,e)}}class eR{maxBatchSize;logEventURL;batch;constructor(e){this.maxBatchSize=e.maxBatchSize,this.logEventURL=e.logEventURL,setInterval(this.flush.bind(this),e.intervalDurationMs),this.batch=[]}logEvent(e,t){this.batch.push({telemetry:e,event:t}),this.batch.length>=this.maxBatchSize&&this.flush()}async flush(){if(!this.batch.length)return;let e=this.batch;this.batch=[];try{await fetch(this.logEventURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}}let eL=(e,t,r)=>{let n=[];for(let[a,o]of Object.entries(r)){if(null==o)continue;let r=t[a];if(!o.startsWith("optional")||null!=r)switch(o){case"object":case"optionalObject":("object"!=typeof r||Array.isArray(r)||null===r)&&n.push(new h(e,`${a} must be an object.`));break;case"string":case"optionalString":"string"!=typeof r&&n.push(new h(e,`${a} must be a string.`));break;case"number":case"optionalNumber":"number"!=typeof r&&n.push(new h(e,`${a} must be a number.`));break;case"stringArray":case"optionalStringArray":Array.isArray(r)&&r.every(e=>"string"==typeof e)||n.push(new h(e,`${a} must be an array of strings.`));break;case"boolean":case"optionalBoolean":"boolean"!=typeof r&&n.push(new h(e,`${a} must be a boolean.`))}}if(n.length>0)if(1===n.length)throw n[0];else throw AggregateError(n)};class eB{_networkClient;_subscriptionService;organizations;intermediateSessions;constructor(e,t){this._networkClient=e,this._subscriptionService=t,this.organizations={list:async()=>this._networkClient.fetchSDK({url:"/b2b/discovery/organizations",body:{intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST"}),create:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.discovery.organizations.create",e,{session_duration_minutes:"number",organization_name:"optionalString",organization_slug:"optionalString",organization_logo_url:"optionalString",sso_jit_provisioning:"optionalString",email_allowed_domains:"optionalStringArray",email_invites:"optionalString",auth_methods:"optionalString",allowed_auth_methods:"optionalStringArray",mfa_policy:"optionalString"});let t={...e,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.fetchSDK({url:"/b2b/discovery/organizations/create",body:t,method:"POST"})})},this.intermediateSessions={exchange:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.discovery.intermediateSessions.exchange",e,{organization_id:"string",session_duration_minutes:"number",locale:"optionalString"});let t={...e,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.fetchSDK({url:"/b2b/discovery/intermediate_sessions/exchange",body:t,method:"POST"})})}}}class eN{_networkClient;constructor(e){this._networkClient=e}oauthAuthorizeStart=async e=>this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/start",method:"POST",body:e});oauthAuthorizeSubmit=async e=>this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/submit",method:"POST",body:e});oauthLogoutStart=async e=>this._networkClient.fetchSDK({url:"/b2b/oauth/logout/start",method:"POST",body:e})}class eU{_networkClient;_subscriptionService;dfpProtectedAuth;authenticate;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.impersonation.authenticate",e,{impersonation_token:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/impersonation/authenticate",body:{...e,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}}let eF=Promise.resolve({pkceRequiredForEmailMagicLinks:!1});class eq{_networkClient;_subscriptionService;_pkceManager;_passwordResetPKCEManager;_config;dfpProtectedAuth;email;authenticate;discovery;constructor(e,t,r,n,a=eF,o=eM()){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._passwordResetPKCEManager=n,this._config=a,this.dfpProtectedAuth=o,this.email={invite:async e=>(eL("stytch.magicLinks.email.invite",e,{email_address:"string",invite_redirect_url:"optionalString",invite_template_id:"optionalString",name:"optionalString",locale:"optionalString",roles:"optionalStringArray",invite_expiration_minutes:"optionalNumber"}),this._networkClient.fetchSDK({url:"/b2b/magic_links/email/invite",body:e,method:"POST"})),loginOrSignup:async e=>{eL("stytch.magicLinks.email.loginOrSignup",e,{email_address:"string",organization_id:"string",login_redirect_url:"optionalString",login_template_id:"optionalString",signup_redirect_url:"optionalString",signup_template_id:"optionalString",locale:"optionalString",login_expiration_minutes:"optionalNumber",signup_expiration_minutes:"optionalNumber"});let t=await this.getCodeChallenge(),r={...e,pkce_code_challenge:t};return this._networkClient.fetchSDK({url:"/b2b/magic_links/email/login_or_signup",body:r,method:"POST"})},discovery:{send:async e=>{eL("stytch.magicLinks.email.discovery.send",e,{email_address:"string",discovery_redirect_url:"optionalString",login_template_id:"optionalString",locale:"optionalString",discovery_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this.getCodeChallenge(),a={...e,pkce_code_challenge:n,dfp_telemetry_id:t,captcha_token:r};return this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/email/discovery/send",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}}},this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.magicLinks.authenticate",e,{magic_links_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._passwordResetPKCEManager.getPKPair(),r=null;if(t?.code_verifier)try{r=await this.handlePKCEForAuthenticate(this._passwordResetPKCEManager,e)}catch(e){if(e.message.includes("pkce"))console.log("Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace.");else throw e}return r||(r=await this.handlePKCEForAuthenticate(this._pkceManager,e)),r}),this.discovery={authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.magicLinks.discovery.authenticate",e,{discovery_magic_links_token:"string"});let t=await this._pkceManager.getPKPair(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a={pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,...e},o=await this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/discovery/authenticate",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o})}}async getCodeChallenge(){let{pkceRequiredForEmailMagicLinks:e}=await this._config;if(!e)return;let t=await this._pkceManager.getPKPair();return t?t.code_challenge:(t=await this._pkceManager.startPKCETransaction()).code_challenge}async handlePKCEForAuthenticate(e,t){let r=await e.getPKPair(),{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),o={pkce_code_verifier:r?.code_verifier,dfp_telemetry_id:n,captcha_token:a,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0,...t},i=await this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/authenticate",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return e.clearPKPair(),i}}let eH=class{_networkClient;_subscriptionService;_pkceManager;_dynamicConfig;_config;dfpProtectedAuth;authenticate;discovery;google;microsoft;hubspot;slack;github;constructor(e,t,r,n,a,o){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._dynamicConfig=n,this._config=a,this.dfpProtectedAuth=o,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.oauth.authenticate",e,{oauth_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair();t||eC("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information.");let{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a=await this._networkClient.retriableFetchSDK({url:"/b2b/oauth/authenticate",method:"POST",body:{pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0,...e},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),a}),this.discovery={authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.oauth.discovery.authenticate",e,{discovery_oauth_token:"string"});let t=await this._pkceManager.getPKPair(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a={pkce_code_verifier:t?.code_verifier,dfp_telemetry_id:r,captcha_token:n,...e},o=await this._networkClient.retriableFetchSDK({url:"/b2b/oauth/discovery/authenticate",body:a,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o})},this.google={start:this.startOAuthFlow(c.Google),discovery:{start:this.startDiscoveryOAuthFlow(c.Google)}},this.microsoft={start:this.startOAuthFlow(c.Microsoft),discovery:{start:this.startDiscoveryOAuthFlow(c.Microsoft)}},this.hubspot={start:this.startOAuthFlow(c.HubSpot),discovery:{start:this.startDiscoveryOAuthFlow(c.HubSpot)}},this.slack={start:this.startOAuthFlow(c.Slack),discovery:{start:this.startDiscoveryOAuthFlow(c.Slack)}},this.github={start:this.startOAuthFlow(c.GitHub),discovery:{start:this.startDiscoveryOAuthFlow(c.GitHub)}}}async getBaseApiUrl(){let{cnameDomain:e}=await this._dynamicConfig;return e?`https://${e}`:this._config.publicToken.includes("public-token-test")?this._config.testAPIURL:this._config.liveAPIURL}startOAuthFlow(e){return async t=>{let{organization_id:r,organization_slug:n,login_redirect_url:a,signup_redirect_url:o,custom_scopes:i,provider_params:s}=t,{pkceRequiredForOAuth:l}=await this._dynamicConfig,c=await this.getBaseApiUrl(),d=new URL(`${c}/v1/b2b/public/oauth/${e}/start`);if(d.searchParams.set("public_token",this._config.publicToken),r&&""!=r&&d.searchParams.set("organization_id",r),n&&""!=n&&d.searchParams.set("slug",n),i&&(eL("startOAuthFlow",{custom_scopes:i},{custom_scopes:"stringArray"}),d.searchParams.set("custom_scopes",i.join(" "))),s)for(let e in eL("startOAuthFlow",{provider_params:s},{provider_params:"optionalObject"}),s)d.searchParams.set("provider_"+e,s[e]);if(l){let e=await this._pkceManager.startPKCETransaction();d.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();a&&d.searchParams.set("login_redirect_url",a),o&&d.searchParams.set("signup_redirect_url",o),this.navigate(d)}}startDiscoveryOAuthFlow(e){return async t=>{let{discovery_redirect_url:r,custom_scopes:n,provider_params:a}=t,{pkceRequiredForOAuth:o}=await this._dynamicConfig,i=await this.getBaseApiUrl(),s=new URL(`${i}/v1/b2b/public/oauth/${e}/discovery/start`);if(s.searchParams.set("public_token",this._config.publicToken),n&&(eL("startOAuthFlow",{custom_scopes:n},{custom_scopes:"stringArray"}),s.searchParams.set("custom_scopes",n.join(" "))),a)for(let e in eL("startOAuthFlow",{provider_params:a},{provider_params:"optionalObject"}),a)s.searchParams.set("provider_"+e,a[e]);if(o){let e=await this._pkceManager.startPKCETransaction();s.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();r&&s.searchParams.set("discovery_redirect_url",r),this.navigate(s)}}navigate(e){window.location.href=e.toString()}};class eK{_networkClient;_apiNetworkClient;_subscriptionService;constructor(e,t,r){this._networkClient=e,this._apiNetworkClient=t,this._subscriptionService=r}get=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"GET"});return this._subscriptionService.updateOrganization(e.organization),e.organization};getSync=()=>this._subscriptionService.getOrganization();getInfo=()=>({organization:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.organization??null));update=async e=>{let t=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"PUT",body:e});return this._subscriptionService.updateOrganization(t.organization),t};delete=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"DELETE"});return this._subscriptionService.destroyState(),e};getBySlug=async e=>(eL("stytch.organization.getBySlug",e,{organization_slug:"string"}),this._networkClient.fetchSDK({url:"/b2b/organizations/search",method:"POST",body:e}));getConnectedApps=async()=>this._networkClient.fetchSDK({url:"/b2b/organizations/connected_apps",method:"GET"});getConnectedApp=async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/connected_apps/${e.connected_app_id}`,method:"GET"});members={create:async e=>this._networkClient.fetchSDK({url:"/b2b/organizations/members",method:"POST",body:e}),search:async e=>this._networkClient.fetchSDK({url:"/b2b/organizations/me/members/search",method:"POST",body:e}),update:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e.member_id}`,method:"PUT",body:e});return this.updateMemberIfSelf(t),t},deletePassword:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/passwords/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},deleteMFAPhoneNumber:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/mfa_phone_numbers/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},deleteMFATOTP:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/totp/${e}`,method:"DELETE"});return this.updateMemberIfSelf(t),t},delete:async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e}`,method:"DELETE"});return e===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.destroyState(),t},reactivate:async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e}/reactivate`,method:"PUT"}),unlinkRetiredEmail:async e=>{let{member_id:t,...r}=e,n=await this._apiNetworkClient.fetchSDK({url:`/b2b/organizations/members/${t}/unlink_retired_email`,method:"POST",body:r});return this.updateMemberIfSelf(n),n},startEmailUpdate:async e=>{let{member_id:t,...r}=e,n=await this._apiNetworkClient.fetchSDK({url:`/b2b/organizations/members/${t}/start_email_update`,method:"POST",body:r});return this.updateMemberIfSelf(n),n},getConnectedApps:async e=>this._networkClient.fetchSDK({url:`b2b/organizations/members/${e.member_id}/connected_apps`,method:"GET"}),revokeConnectedApp:async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/${e.member_id}/connected_apps/${e.connected_app_id}/revoke`,method:"POST"})};updateMemberIfSelf=e=>{e.member_id===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.updateMember(e.member)}}class ej{_networkClient;_subscriptionService;dfpProtectedAuth;sms;email;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.sms={send:async e=>{eL("stytch.otps.sms.send",e,{organization_id:"string",member_id:"string",mfa_phone_number:"optionalString",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/sms/send",body:{...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.sms.authenticate",e,{session_duration_minutes:"number",organization_id:"string",member_id:"string",code:"string",set_mfa_enrollment:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/sms/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})},this.email={loginOrSignup:async e=>{eL("stytch.otps.email.loginOrSignup",e,{organization_id:"string",email_address:"string",login_template_id:"optionalString",signup_template_id:"optionalString",locale:"optionalString",login_expiration_minutes:"optionalNumber",signup_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/login_or_signup",body:{...e,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.email.authenticate",e,{code:"string",email_address:"string",organization_id:"string",session_duration_minutes:"number",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/authenticate",body:{...e,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0,dfp_telemetry_id:t,captcha_token:r},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),discovery:{send:async e=>{eL("stytch.otps.email.discovery.send",e,{email_address:"string",login_template_id:"optionalString",locale:"optionalString",discovery_expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/send",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.otps.email.discovery.authenticate",e,{code:"string",email_address:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={dfp_telemetry_id:t,captcha_token:r,...e};return this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}}}}let e$=Promise.resolve({pkceRequiredForPasswordResets:!1});class eV{_networkClient;_subscriptionService;_pkceManager;_config;dfpProtectedAuth;authenticate;discovery;resetByEmail;resetByExistingPassword;resetBySession;constructor(e,t,r,n=e$,a){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._config=n,this.dfpProtectedAuth=a,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.authenticate",e,{organization_id:"string",password:"string",email_address:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair(),r=t?.code_verifier,{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/authenticate",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,password:e.password,session_duration_minutes:e.session_duration_minutes,locale:e.locale,captcha_token:a,dfp_telemetry_id:n,code_verifier:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),this.discovery={resetByEmailStart:async e=>{eL("stytch.passwords.discovery.resetByEmailStart",e,{email_address:"string",discovery_redirect_url:"optionalString",reset_password_redirect_url:"optionalString",reset_password_template_id:"optionalString",reset_password_expiration_minutes:"optionalNumber",verify_email_template_id:"optionalString",locale:"optionalString"});let t=await this.getCodeChallenge(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/reset/start",method:"POST",body:{email_address:e.email_address,discovery_redirect_url:e.discovery_redirect_url,reset_password_redirect_url:e.reset_password_redirect_url,reset_password_expiration_minutes:e.reset_password_expiration_minutes,reset_password_template_id:e.reset_password_template_id,verify_email_template_id:e.verify_email_template_id,locale:e.locale,pkce_code_challenge:t,captcha_token:n,dfp_telemetry_id:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})},resetByEmail:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.discovery.resetByEmail",e,{password_reset_token:"string",password:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._pkceManager.getPKPair(),a=n?.code_verifier,o=await this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/reset",method:"POST",body:{password_reset_token:e.password_reset_token,password:e.password,captcha_token:r,dfp_telemetry_id:t,pkce_code_verifier:a,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o}),authenticate:this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.discovery.authenticate",e,{password:"string",email_address:"string"});let t=await this._pkceManager.getPKPair(),r=t?.code_verifier,{dfp_telemetry_id:n,captcha_token:a}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/authenticate",method:"POST",body:{email_address:e.email_address,password:e.password,captcha_token:a,dfp_telemetry_id:n,code_verifier:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})},this.resetByEmail=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetByEmail",e,{password_reset_token:"string",password:"string",session_duration_minutes:"number",locale:"optionalString"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._pkceManager.getPKPair(),a=n?.code_verifier,o=await this._networkClient.retriableFetchSDK({url:"/b2b/passwords/email/reset",method:"POST",body:{password_reset_token:e.password_reset_token,password:e.password,session_duration_minutes:e.session_duration_minutes,locale:e.locale,captcha_token:r,dfp_telemetry_id:t,code_verifier:a,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),o}),this.resetByExistingPassword=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetByExistingPassword",e,{email_address:"string",existing_password:"string",new_password:"string",locale:"optionalString",session_duration_minutes:"number"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/existing_password/reset",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,existing_password:e.existing_password,new_password:e.new_password,locale:e.locale,session_duration_minutes:e.session_duration_minutes,captcha_token:r,dfp_telemetry_id:t},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}),this.resetBySession=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.passwords.resetBySession",e,{password:"string"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/session/reset",method:"POST",body:{password:e.password,captcha_token:r,dfp_telemetry_id:t},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async getCodeChallenge(){let{pkceRequiredForPasswordResets:e}=await this._config;if(!e)return;let t=await this._pkceManager.getPKPair();return t?t.code_challenge:(t=await this._pkceManager.startPKCETransaction()).code_challenge}async resetByEmailStart(e){eL("stytch.passwords.resetByEmailStart",e,{email_address:"string",login_redirect_url:"optionalString",reset_password_redirect_url:"optionalString",reset_password_template_id:"optionalString",reset_password_expiration_minutes:"optionalNumber",verify_email_template_id:"optionalString",locale:"optionalString"});let t=await this.getCodeChallenge(),{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/passwords/email/reset/start",method:"POST",body:{organization_id:e.organization_id,email_address:e.email_address,login_redirect_url:e.login_redirect_url,reset_password_redirect_url:e.reset_password_redirect_url,reset_password_expiration_minutes:e.reset_password_expiration_minutes,reset_password_template_id:e.reset_password_template_id,verify_email_template_id:e.verify_email_template_id,locale:e.locale,code_challenge:t,captcha_token:n,dfp_telemetry_id:r},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}async strengthCheck(e){return eL("stytch.passwords.strengthCheck",e,{email_address:"optionalString",password:"string"}),this._networkClient.fetchSDK({url:"/b2b/passwords/strength_check",method:"POST",body:{email_address:e.email_address,password:e.password}})}}class eW{roles;resources;rolesByID;constructor(e,t){this.roles=e,this.resources=t,this.rolesByID={},e.forEach(e=>this.rolesByID[e.role_id]=e)}static fromJSON(e){return new eW(e.roles,e.resources)}mergeWithCustomRoles(e){return new eW([...this.roles,...e],this.resources)}callerIsAuthorized(e,t,r){return!!e.map(e=>this.rolesByID[e]).filter(e=>e).flatMap(e=>e.permissions).filter(e=>e.resource_id===t).find(e=>e.actions.includes(r)||e.actions.includes("*"))}allPermissionsForCaller(e){let t=Object.create(null);return this.resources.forEach(r=>{t[r.resource_id]={},r.actions.forEach(n=>{t[r.resource_id][n]=this.callerIsAuthorized(e,r.resource_id,n)})}),t}}class eG{_subscriptionService;cachedPolicy;policyPromise;constructor(e,t,r){this._subscriptionService=r,this.cachedPolicy=e.rbacPolicy?eW.fromJSON(e.rbacPolicy):null,this.policyPromise=t.then(e=>e.rbacPolicy?(this.cachedPolicy=eW.fromJSON(e.rbacPolicy),this.cachedPolicy):(eP("Unable to retrieve RBAC policy from servers. Assuming caller has no permissions."),new eW([],[])))}async getEffectivePolicy(){let e=await this.policyPromise,t=this._subscriptionService.getOrganization();return t?.custom_roles?.length?e.mergeWithCustomRoles(t.custom_roles):e}getEffectivePolicySync(){if(!this.cachedPolicy)return null;let e=this._subscriptionService.getOrganization();return e?.custom_roles?.length?this.cachedPolicy.mergeWithCustomRoles(e.custom_roles):this.cachedPolicy}allPermissions(){return this.getEffectivePolicy().then(e=>e.allPermissionsForCaller(this.roleIds()))}isAuthorizedSync=(e,t)=>{let r=this.getEffectivePolicySync();return!!r?.callerIsAuthorized(this.roleIds(),e,t)};isAuthorized=(e,t)=>this.getEffectivePolicy().then(r=>r.callerIsAuthorized(this.roleIds(),e,t));roleIds(){let e=this._subscriptionService.getSession();return e?e.roles??[]:[]}}class eY{_networkClient;_subscriptionService;dfpProtectedAuth;recover;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.recover=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.recoveryCodes.recover",e,{organization_id:"string",member_id:"string",recovery_code:"string",session_duration_minutes:"number"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/recover",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async rotate(){let{dfp_telemetry_id:e,captcha_token:t}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();return this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/rotate",body:{dfp_telemetry_id:e,captcha_token:t},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})}async get(){return this._networkClient.fetchSDK({url:"/b2b/recovery_codes",method:"GET"})}}class eZ{_networkClient;_subscriptionService;constructor(e,t){this._networkClient=e,this._subscriptionService=t}async createConnection(e){return eL("stytch.scim.createConnection",e,{display_name:"optionalString",identity_provider:"optionalString"}),await this._networkClient.fetchSDK({url:"/b2b/scim",method:"POST",body:e})}async updateConnection(e){return eL("stytch.scim.updateConnection",e,{connection_id:"string",display_name:"optionalString",identity_provider:"optionalString"}),await this._networkClient.fetchSDK({url:`/b2b/scim/${e.connection_id}`,method:"PUT",body:e})}async deleteConnection(e){return eL("stytch.scim.deleteConnection",{connection_id:e},{connection_id:"string"}),await this._networkClient.fetchSDK({url:`/b2b/scim/${e}`,method:"DELETE"})}async getConnection(){return await this._networkClient.fetchSDK({url:"/b2b/scim",method:"GET"})}async getConnectionGroups(e){return eL("stytch.scim.getConnectionGroups",e,{limit:"optionalNumber",cursor:"optionalString"}),await this._networkClient.fetchSDK({url:"/b2b/scim/groups",method:"POST",body:e})}async rotateStart(e){return eL("stytch.scim.rotateStart",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/start",method:"POST",body:{connection_id:e}})}async rotateComplete(e){return eL("stytch.scim.rotateComplete",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/complete",method:"POST",body:{connection_id:e}})}async rotateCancel(e){return eL("stytch.scim.rotateCancel",{connectionId:e},{connectionId:"string"}),await this._networkClient.fetchSDK({url:"/b2b/scim/rotate/cancel",method:"POST",body:{connection_id:e}})}}class eJ{_networkClient;_apiNetworkClient;_subscriptionService;constructor(e,t,r){this._networkClient=e,this._apiNetworkClient=t,this._subscriptionService=r}get=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/me",method:"GET"});return this._subscriptionService.updateMember(e.member),e.member};getSync=()=>this._subscriptionService.getMember();getInfo=()=>({member:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.member??null));update=async e=>{eL("stytch.self.update",e,{name:"optionalString",untrusted_metadata:"optionalObject",mfa_enrolled:"optionalBoolean",mfa_phone_number:"optionalString",default_mfa_method:"optionalString"});let t=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/update",body:e,method:"PUT"});return this._subscriptionService.updateMember(t.member),t};deleteMFAPhoneNumber=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/deletePhoneNumber",method:"DELETE"});return this._subscriptionService.updateMember(e.member),e};deleteMFATOTP=async()=>{let e=await this._networkClient.fetchSDK({url:"/b2b/organizations/members/deleteTOTP",method:"DELETE"});return this._subscriptionService.updateMember(e.member),e};deletePassword=async e=>{let t=await this._networkClient.fetchSDK({url:`/b2b/organizations/members/passwords/${e}`,method:"DELETE"});return this._subscriptionService.updateMember(t.member),t};unlinkRetiredEmail=async e=>{let t=await this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/unlink_retired_email",method:"POST",body:e});return this._subscriptionService.updateMember(t.member),t};startEmailUpdate=async e=>{let t=await this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/start_email_update",method:"POST",body:e});return this._subscriptionService.updateMember(t.member),t};getConnectedApps=async()=>this._networkClient.fetchSDK({url:"/b2b/organizations/members/connected_apps",method:"GET"});revokeConnectedApp=async e=>this._networkClient.fetchSDK({url:`/b2b/organizations/members/connected_apps/${e.connected_app_id}/revoke`,method:"POST"})}class eQ{_networkClient;_subscriptionService;getSync=()=>this._subscriptionService.getSession();getInfo=()=>({session:this.getSync(),fromCache:this._subscriptionService.getFromCache()});onChange=e=>this._subscriptionService.subscribeToState(t=>e(t?.session??null));revoke=async e=>{try{let e=await this._networkClient.fetchSDK({url:"/b2b/sessions/revoke",method:"POST"});return this._subscriptionService.destroyState(),e}catch(t){throw e?.forceClear?this._subscriptionService.destroyState():_.includes(t.error_type)&&this._subscriptionService.destroyState(),t}};revokeForMember=async e=>(eL("stytch.session.revokeForMember",e,{member_id:"string"}),await this._networkClient.fetchSDK({url:`/b2b/sessions/revoke/${e.member_id}`,method:"POST"}));_authenticate=async e=>{let t=this._subscriptionService.getSession(),r=()=>t?.member_session_id!==this._subscriptionService.getSession()?.member_session_id;try{let t={session_duration_minutes:e?.session_duration_minutes},n=await this._networkClient.fetchSDK({url:"/b2b/sessions/authenticate",body:t,method:"POST"});if(r())return this._authenticate(e);return n}catch(t){if(r())return this._authenticate(e);throw _.includes(t.error_type)&&this._subscriptionService.destroySession(),t}};authenticate;exchange;exchangeAccessToken;attest;constructor(e,t){this._networkClient=e,this._subscriptionService=t,this.authenticate=this._subscriptionService.withUpdateSession(this._authenticate),this.exchange=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.exchange",e,{organization_id:"string",session_duration_minutes:"number",locale:"optionalString"}),this._networkClient.fetchSDK({url:"/b2b/sessions/exchange",body:e,method:"POST"}))),this.exchangeAccessToken=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.exchange",e,{access_token:"string",session_duration_minutes:"number"}),this._networkClient.fetchSDK({url:"/b2b/sessions/exchange_access_token",body:e,method:"POST"}))),this.attest=this._subscriptionService.withUpdateSession(async e=>(eL("stytch.session.attest",e,{organization_id:"optionalString",profile_id:"string",token:"string",session_duration_minutes:"optionalNumber"}),this._networkClient.fetchSDK({url:"/b2b/sessions/attest",body:e,method:"POST"})))}getTokens(){return this._subscriptionService.getTokens()}updateSession(e){eL("stytch.session.updateSession",e,{session_token:"string",session_jwt:"optionalString"}),this._subscriptionService.updateTokens(e)}}class eX{_networkClient;_subscriptionService;_pkceManager;_dynamicConfig;_config;dfpProtectedAuth;authenticate;constructor(e,t,r,n,a,o){this._networkClient=e,this._subscriptionService=t,this._pkceManager=r,this._dynamicConfig=n,this._config=a,this.dfpProtectedAuth=o,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.sso.authenticate",e,{sso_token:"string",session_duration_minutes:"number",locale:"optionalString"});let t=await this._pkceManager.getPKPair();t||eC("No code verifier found in local storage for SSO flow.\nConsider using stytch.sso.start() to add PKCE to your SSO flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information.");let{dfp_telemetry_id:r,captcha_token:n}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),a=await this._networkClient.retriableFetchSDK({url:"/b2b/sso/authenticate",method:"POST",body:{pkce_code_verifier:t?.code_verifier,...e,dfp_telemetry_id:r,captcha_token:n,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return this._pkceManager.clearPKPair(),a})}async getBaseApiUrl(){return this._config.publicToken.includes("public-token-test")?this._config.testAPIURL:this._config.liveAPIURL}async start({connection_id:e,login_redirect_url:t,signup_redirect_url:r}){let{pkceRequiredForSso:n}=await this._dynamicConfig,a=await this.getBaseApiUrl(),o=new URL(`${a}/v1/public/sso/start`);if(o.searchParams.set("public_token",this._config.publicToken),o.searchParams.set("connection_id",e),n){let e=await this._pkceManager.startPKCETransaction();o.searchParams.set("pkce_code_challenge",e.code_challenge)}else this._pkceManager.clearPKPair();t&&o.searchParams.set("login_redirect_url",t),r&&o.searchParams.set("signup_redirect_url",r),this.navigate(o)}navigate(e){window.location.href=e.toString()}async getConnections(){return await this._networkClient.fetchSDK({url:"/b2b/sso",method:"GET"})}async discoverConnections(e){return await this._networkClient.fetchSDK({url:`/b2b/sso/discovery/connections?email_address=${encodeURIComponent(e)}`,method:"GET"})}async deleteConnection(e){return this._networkClient.fetchSDK({url:`/b2b/sso/${e}`,method:"DELETE"})}saml={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/saml",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}`,method:"PUT",body:e}),updateConnectionByURL:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/url`,method:"PUT",body:e}),deleteVerificationCertificate:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/verification_certificates/${e.certificate_id}`,method:"DELETE"}),deleteEncryptionPrivateKey:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/saml/${e.connection_id}/encryption_private_key/${e.private_key_id}`,method:"DELETE"})};oidc={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/oidc",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/oidc/${e.connection_id}`,method:"PUT",body:e})};external={createConnection:async e=>await this._networkClient.fetchSDK({url:"/b2b/sso/external",method:"POST",body:e}),updateConnection:async e=>await this._networkClient.fetchSDK({url:`/b2b/sso/external/${e.connection_id}`,method:"PUT",body:e})}}class e1{_networkClient;_subscriptionService;dfpProtectedAuth;authenticate;constructor(e,t,r){this._networkClient=e,this._subscriptionService=t,this.dfpProtectedAuth=r,this.authenticate=this._subscriptionService.withUpdateSession(async e=>{eL("stytch.totp.authenticate",e,{organization_id:"string",member_id:"string",code:"string",session_duration_minutes:"number",set_mfa_enrollment:"optionalString",set_default_mfa:"optionalBoolean"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n={...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:this._subscriptionService.getIntermediateSessionToken()||void 0};return this._networkClient.retriableFetchSDK({url:"/b2b/totp/authenticate",body:n,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP})})}async create(e){eL("stytch.totp.create",e,{organization_id:"string",member_id:"string",expiration_minutes:"optionalNumber"});let{dfp_telemetry_id:t,captcha_token:r}=await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha(),n=await this._networkClient.retriableFetchSDK({url:"/b2b/totp",body:{...e,dfp_telemetry_id:t,captcha_token:r,intermediate_session_token:await this._subscriptionService.getIntermediateSessionToken()||void 0},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});return n.member_id===this._subscriptionService.getMember()?.member_id&&this._subscriptionService.updateMember(n.member),n}}Promise.resolve({siweRequiredForCryptoWallets:!1}),Promise.resolve({pkceRequiredForEmailMagicLinks:!1}),Promise.resolve({pkceRequiredForPasswordResets:!1});class e0{iframeURL;frame;constructor(e){this.iframeURL=e,this.createIframe()}createIframe(){let e=document.querySelector(`[src~="${this.iframeURL}"]`);if(e?eC(i):((e=document.createElement("iframe")).src=this.iframeURL,e.style.position="absolute",e.style.width="0",e.style.height="0",e.style.border="0",e.role="none",document.body.appendChild(e)),"true"===e.dataset.loaded){this.frame=Promise.resolve(e);return}this.frame=new Promise(t=>{e.addEventListener("load",()=>{e.dataset.loaded="true",t(e)},{once:!0})})}async call(e,t){let r=await this.frame,n=new MessageChannel;return new Promise((a,o)=>{n.port1.onmessage=e=>{let t=e.data;n.port1.close(),t.success?a(t.payload):o(eI.unmarshall(t.error))},r.contentWindow?.postMessage({method:e,args:t},this.iframeURL,[n.port2])})}}class e2{_networkClient;dfpProtectedAuth;constructor(e,t){this._networkClient=e,this.dfpProtectedAuth=t}searchUser(e){return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(({dfp_telemetry_id:t,captcha_token:r})=>this._networkClient.fetchSDK({url:"/users/search",method:"POST",body:{email:e,dfp_telemetry_id:t,captcha_token:r}}))}searchMember(e,t){return this._networkClient.fetchSDK({url:"/b2b/organizations/members/search",method:"POST",body:{email_address:e,organization_id:t}})}}class e3{hasWarned=!1;registry=new Map;register(e,t){let r=this.registry.get(e);r&&r!==t&&(this.hasWarned||(eC(i),this.hasWarned=!0),r.cancelBackgroundRefresh()),this.registry.set(e,t)}unregister(e,t){let r=this.registry.get(e);r&&r===t&&this.registry.delete(e)}}class e4{_subscriptionService;_headlessSessionClient;_publicToken;_options;static REFRESH_INTERVAL_MS=18e4;timeout=null;lastAuthenticationSessionDuration;static registry=new e3;register(){e4.registry.register(this._publicToken,this)}unregister(){e4.registry.unregister(this._publicToken,this)}constructor(e,t,r,n){this._subscriptionService=e,this._headlessSessionClient=t,this._publicToken=r,this._options=n,this._subscriptionService.subscribeToState(this._onDataChange)}performBackgroundRefresh(){this._reauthenticateWithBackoff().then(()=>{this.scheduleBackgroundRefresh()}).catch(e=>{eC("Session background refresh failed. Signalling to app that user is logged out.",{error:e}),this._subscriptionService.destroySession()})}scheduleBackgroundRefresh(){this.cancelBackgroundRefresh(),this.register(),this.timeout=setTimeout(()=>{this.performBackgroundRefresh()},e4.REFRESH_INTERVAL_MS)}cancelBackgroundRefresh(){null!==this.timeout&&(this.unregister(),clearTimeout(this.timeout),this.timeout=null)}_onDataChange=e=>{null!=e&&e.sessionDurationMinutes&&(this.lastAuthenticationSessionDuration=e.sessionDurationMinutes),e?.session?this.scheduleBackgroundRefresh():this.cancelBackgroundRefresh()};_reauthenticateWithBackoff=async()=>{let e=0;for(;;)try{let e={session_duration_minutes:this._options.keepSessionAlive?this.lastAuthenticationSessionDuration:void 0};return await this._headlessSessionClient.authenticate(e)}catch(t){if(e4.isUnrecoverableError(t))return Promise.reject(t);e++,await new Promise(t=>setTimeout(t,e4.timeoutForAttempt(e)))}};static timeoutForAttempt(e){return e=Math.min(e,7),Math.floor(350*Math.random())-175+2e3*2**e}static isUnrecoverableError(e){return _.includes(e.error_type)}}class e5{_subscriptionService;emptyState;constructor(e,t){this._subscriptionService=e,this.emptyState=t}onStateChange=e=>this._subscriptionService.subscribeToState(t=>{e(t??this.emptyState)})}var e8,e6,e7,e9,te,tt,tr,tn,ta,to,ti,ts={},tl=[],tc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,td=Array.isArray;function tu(e,t){for(var r in t)e[r]=t[r];return e}function th(e){var t=e.parentNode;t&&t.removeChild(e)}function tm(e,t,r){var n,a,o,i={};for(o in t)"key"==o?n=t[o]:"ref"==o?a=t[o]:i[o]=t[o];if(arguments.length>2&&(i.children=arguments.length>3?e9.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===i[o]&&(i[o]=e.defaultProps[o]);return tp(e,i,n,a,null)}function tp(e,t,r,n,a){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++tt:a,__i:-1,__u:0};return null==a&&null!=te.vnode&&te.vnode(o),o}function t_(){return{current:null}}function tg(e){return e.children}function tf(e,t){this.props=e,this.context=t}function ty(e,t){if(null==t)return e.__?ty(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?ty(e):null}function tv(e){(!e.__d&&(e.__d=!0)&&tr.push(e)&&!tb.__r++||tn!==te.debounceRendering)&&((tn=te.debounceRendering)||ta)(tb)}function tb(){var e,t,r,n,a,o,i,s,l;for(tr.sort(to);e=tr.shift();)e.__d&&(t=tr.length,n=void 0,o=(a=(r=e).__v).__e,s=[],l=[],(i=r.__P)&&((n=tu({},a)).__v=a.__v+1,te.vnode&&te.vnode(n),tT(i,n,a,r.__n,void 0!==i.ownerSVGElement,32&a.__u?[o]:null,s,null==o?ty(a):o,!!(32&a.__u),l),n.__.__k[n.__i]=n,tO(s,n,l),n.__e!=o&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(n)),tr.length>t&&tr.sort(to));tb.__r=0}function tw(e,t,r,n,a,o,i,s,l,c,d){var u,h,m,p,_,g=n&&n.__k||tl,f=t.length;for(r.__d=l,function(e,t,r){var n,a,o,i,s,l=t.length,c=r.length,d=c,u=0;for(e.__k=[],n=0;n<l;n++)null!=(a=e.__k[n]=null==(a=t[n])||"boolean"==typeof a||"function"==typeof a?null:"string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?tp(null,a,null,null,a):td(a)?tp(tg,{children:a},null,null,null):a.__b>0?tp(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)?(a.__=e,a.__b=e.__b+1,s=function(e,t,r,n){var a=e.key,o=e.type,i=r-1,s=r+1,l=t[r];if(null===l||l&&a==l.key&&o===l.type)return r;if(n>+(null!=l&&0==(131072&l.__u)))for(;i>=0||s<t.length;){if(i>=0){if((l=t[i])&&0==(131072&l.__u)&&a==l.key&&o===l.type)return i;i--}if(s<t.length){if((l=t[s])&&0==(131072&l.__u)&&a==l.key&&o===l.type)return s;s++}}return -1}(a,r,i=n+u,d),a.__i=s,o=null,-1!==s&&(d--,(o=r[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&u--,"function"!=typeof a.type&&(a.__u|=65536)):s!==i&&(s===i+1?u++:s>i?d>l-i?u+=s-i:u--:u=s<i&&s==i-1?s-i:0,s!==n+u&&(a.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=ty(o)),tx(o,o,!1),r[n]=null,d--);if(d)for(n=0;n<c;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=ty(o)),tx(o,o))}(r,t,g),l=r.__d,u=0;u<f;u++)null!=(m=r.__k[u])&&"boolean"!=typeof m&&"function"!=typeof m&&(h=-1===m.__i?ts:g[m.__i]||ts,m.__i=u,tT(e,m,h,a,o,i,s,l,c,d),p=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&tA(h.ref,null,m),d.push(m.ref,m.__c||p,m)),null==_&&null!=p&&(_=p),65536&m.__u||h.__k===m.__k?l=function e(t,r,n){var a,o;if("function"==typeof t.type){for(a=t.__k,o=0;a&&o<a.length;o++)a[o]&&(a[o].__=t,r=e(a[o],r,n));return r}return t.__e!=r&&(n.insertBefore(t.__e,r||null),r=t.__e),r&&r.nextSibling}(m,l,e):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:p&&(l=p.nextSibling),m.__d=void 0,m.__u&=-196609);r.__d=l,r.__e=_}function tk(e,t){return t=t||[],null==e||"boolean"==typeof e||(td(e)?e.some(function(e){tk(e,t)}):t.push(e)),t}function tS(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||tc.test(t)?r:r+"px"}function tE(e,t,r,n,a){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||tS(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||tS(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?tP:tC,o)):e.removeEventListener(t,o?tP:tC,o);else{if(a)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function tC(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(te.event?te.event(e):e)}function tP(e){return this.l[e.type+!0](te.event?te.event(e):e)}function tT(e,t,r,n,a,o,i,s,l,c){var d,u,h,m,p,_,g,f,y,v,b,w,k,S,E,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(d=te.__b)&&d(t);e:if("function"==typeof C)try{if(f=t.props,y=(d=C.contextType)&&n[d.__c],v=d?y?y.props.value:d.__:n,r.__c?g=(u=t.__c=r.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(f,v):(t.__c=u=new tf(f,v),u.constructor=C,u.render=tD),y&&y.sub(u),u.props=f,u.state||(u.state={}),u.context=v,u.__n=n,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=tu({},u.__s)),tu(u.__s,C.getDerivedStateFromProps(f,u.__s))),m=u.props,p=u.state,u.__v=t,h)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&f!==m&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(f,v),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(f,u.__s,v)||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=f,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&i.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(f,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(m,p,_)})}if(u.context=v,u.props=f,u.__P=e,u.__e=!1,w=te.__r,k=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++k<25);u.state=u.__s,null!=u.getChildContext&&(n=tu(tu({},n),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(_=u.getSnapshotBeforeUpdate(m,p)),tw(e,td(E=null!=d&&d.type===tg&&null==d.key?d.props.children:d)?E:[E],t,r,n,a,o,i,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),g&&(u.__E=u.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=s,t.__u|=l?160:32,o[o.indexOf(s)]=null):(t.__e=r.__e,t.__k=r.__k),te.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,a,o,i,s,l){var c,d,u,h,m,p,_,g=r.props,f=t.props,y=t.type;if("svg"===y&&(a=!0),null!=o){for(c=0;c<o.length;c++)if((m=o[c])&&"setAttribute"in m==!!y&&(y?m.localName===y:3===m.nodeType)){e=m,o[c]=null;break}}if(null==e){if(null===y)return document.createTextNode(f);e=a?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,f.is&&f),o=null,s=!1}if(null===y)g===f||s&&e.data===f||(e.data=f);else{if(o=o&&e9.call(e.childNodes),g=r.props||ts,!s&&null!=o)for(g={},c=0;c<e.attributes.length;c++)g[(m=e.attributes[c]).name]=m.value;for(c in g)m=g[c],"children"==c||("dangerouslySetInnerHTML"==c?u=m:"key"===c||c in f||tE(e,c,null,m,a));for(c in f)m=f[c],"children"==c?h=m:"dangerouslySetInnerHTML"==c?d=m:"value"==c?p=m:"checked"==c?_=m:"key"===c||s&&"function"!=typeof m||g[c]===m||tE(e,c,m,g[c],a);if(d)s||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),tw(e,td(h)?h:[h],t,r,n,a&&"foreignObject"!==y,o,i,o?o[0]:r.__k&&ty(r,0),s,l),null!=o)for(c=o.length;c--;)null!=o[c]&&th(o[c]);s||(c="value",void 0===p||p===e[c]&&("progress"!==y||p)&&("option"!==y||p===g[c])||tE(e,c,p,g[c],!1),c="checked",void 0!==_&&_!==e[c]&&tE(e,c,_,g[c],!1))}return e}(r.__e,t,r,n,a,o,i,l,c);(d=te.diffed)&&d(t)}function tO(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)tA(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){te.__e(e,t.__v)}})}function tA(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){te.__e(e,r)}}function tx(e,t,r){var n,a;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||tA(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){te.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&tx(n[a],t,r||"function"!=typeof e.type);r||null==e.__e||th(e.__e),e.__=e.__e=e.__d=void 0}function tD(e,t,r){return this.constructor(e,r)}function tz(e,t,r){var n,a,o,i;te.__&&te.__(e,t),a=(n="function"==typeof r)?null:r&&r.__k||t.__k,o=[],i=[],tT(t,e=(!n&&r||t).__k=tm(tg,null,[e]),a||ts,ts,void 0!==t.ownerSVGElement,!n&&r?[r]:a?null:t.firstChild?e9.call(t.childNodes):null,o,!n&&r?r:a?a.__e:t.firstChild,n,i),tO(o,e,i)}function tM(e,t,r){var n,a,o,i,s=tu({},e.props);for(o in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?a=t[o]:s[o]=void 0===t[o]&&void 0!==i?i[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?e9.call(arguments,2):r),tp(e.type,s,n||e.key,a||e.ref,null)}function tI(e,t){var r={__c:t="__cC"+ti++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(function(e){e.__e=!0,tv(e)})},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}e9=tl.slice,te={__e:function(e,t,r,n){for(var a,o,i;t=t.__;)if((a=t.__c)&&!a.__)try{if((o=a.constructor)&&null!=o.getDerivedStateFromError&&(a.setState(o.getDerivedStateFromError(e)),i=a.__d),null!=a.componentDidCatch&&(a.componentDidCatch(e,n||{}),i=a.__d),i)return a.__E=a}catch(t){e=t}throw e}},tt=0,tf.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=tu({},this.state),"function"==typeof e&&(e=e(tu({},r),this.props)),e&&tu(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),tv(this))},tf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tv(this))},tf.prototype.render=tg,tr=[],ta="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,to=function(e,t){return e.__v.__b-t.__v.__b},tb.__r=0,ti=0;var tR,tL,tB,tN,tU=0,tF=[],tq=[],tH=te.__b,tK=te.__r,tj=te.diffed,t$=te.__c,tV=te.unmount;function tW(e,t){te.__h&&te.__h(tL,e,tU||t),tU=0;var r=tL.__H||(tL.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:tq}),r.__[e]}function tG(e){return tU=1,tY(re,e)}function tY(e,t,r){var n=tW(tR++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):re(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=tL,!tL.u)){var a=function(e,t,r){if(!n.__c.__H)return!0;var a=n.__c.__H.__.filter(function(e){return e.__c});if(a.every(function(e){return!e.__N}))return!o||o.call(this,e,t,r);var i=!1;return a.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};tL.u=!0;var o=tL.shouldComponentUpdate,i=tL.componentWillUpdate;tL.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,a(e,t,r),o=n}i&&i.call(this,e,t,r)},tL.shouldComponentUpdate=a}return n.__N||n.__}function tZ(e,t){var r=tW(tR++,3);!te.__s&&t9(r.__H,t)&&(r.__=e,r.i=t,tL.__H.__h.push(r))}function tJ(e,t){var r=tW(tR++,4);!te.__s&&t9(r.__H,t)&&(r.__=e,r.i=t,tL.__h.push(r))}function tQ(e){return tU=5,t1(function(){return{current:e}},[])}function tX(e,t,r){tU=6,tJ(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==r?r:r.concat(e))}function t1(e,t){var r=tW(tR++,7);return t9(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function t0(e,t){return tU=8,t1(function(){return e},t)}function t2(e){var t=tL.context[e.__c],r=tW(tR++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(tL)),t.props.value):e.__}function t3(e,t){te.useDebugValue&&te.useDebugValue(t?t(e):e)}function t4(){var e=tW(tR++,11);if(!e.__){for(var t=tL.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function t5(){for(var e;e=tF.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(t6),e.__H.__h.forEach(t7),e.__H.__h=[]}catch(t){e.__H.__h=[],te.__e(t,e.__v)}}te.__b=function(e){tL=null,tH&&tH(e)},te.__r=function(e){tK&&tK(e),tR=0;var t=(tL=e.__c).__H;t&&(tB===tL?(t.__h=[],tL.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=tq,e.__N=e.i=void 0})):(t.__h.forEach(t6),t.__h.forEach(t7),t.__h=[],tR=0)),tB=tL},te.diffed=function(e){tj&&tj(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==tF.push(t)&&tN===te.requestAnimationFrame||((tN=te.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),t8&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);t8&&(t=requestAnimationFrame(r))})(t5)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==tq&&(e.__=e.__V),e.i=void 0,e.__V=tq})),tB=tL=null},te.__c=function(e,t){t.some(function(e){try{e.__h.forEach(t6),e.__h=e.__h.filter(function(e){return!e.__||t7(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],te.__e(r,e.__v)}}),t$&&t$(e,t)},te.unmount=function(e){tV&&tV(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{t6(e)}catch(e){t=e}}),r.__H=void 0,t&&te.__e(t,r.__v))};var t8="function"==typeof requestAnimationFrame;function t6(e){var t=tL,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),tL=t}function t7(e){var t=tL;e.__c=e.__(),tL=t}function t9(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function re(e,t){return"function"==typeof t?t(e):t}function rt(e,t){for(var r in t)e[r]=t[r];return e}function rr(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function rn(e){this.props=e}function ra(e,t){function r(e){var r=this.props.ref,n=r==e.ref;return!n&&r&&(r.call?r(null):r.current=null),t?!t(this.props,e)||!n:rr(this.props,e)}function n(t){return this.shouldComponentUpdate=r,tm(e,t)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(rn.prototype=new tf).isPureReactComponent=!0,rn.prototype.shouldComponentUpdate=function(e,t){return rr(this.props,e)||rr(this.state,t)};var ro=te.__b;te.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ro&&ro(e)};var ri="u">typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function rs(e){function t(t){var r=rt({},t);return delete r.ref,e(r,t.ref||null)}return t.$$typeof=ri,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var rl=function(e,t){return null==e?null:tk(tk(e).map(t))},rc={map:rl,forEach:rl,count:function(e){return e?tk(e).length:0},only:function(e){var t=tk(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:tk},rd=te.__e;te.__e=function(e,t,r,n){if(e.then){for(var a,o=t;o=o.__;)if((a=o.__c)&&a.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),a.__c(e,t)}rd(e,t,r,n)};var ru=te.unmount;function rh(){this.__u=0,this.t=null,this.__b=null}function rm(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function rp(e){var t,r,n;function a(a){if(t||(t=e()).then(function(e){r=e.default||e},function(e){n=e}),n)throw n;if(!r)throw t;return tm(r,a)}return a.displayName="Lazy",a.__f=!0,a}function r_(){this.u=null,this.o=null}te.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ru&&ru(e)},(rh.prototype=new tf).__c=function(e,t){var r=t.__c,n=this;null==n.t&&(n.t=[]),n.t.push(r);var a=rm(n.__v),o=!1,i=function(){o||(o=!0,r.__R=null,a?a(s):s())};r.__R=i;var s=function(){if(!--n.__u){if(n.state.__a){var e,t=n.state.__a;n.__v.__k[0]=function e(t,r,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)}),t.__c&&t.__c.__P===r&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}(t,t.__c.__P,t.__c.__O)}for(n.setState({__a:n.__b=null});e=n.t.pop();)e.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(i,i)},rh.prototype.componentWillUnmount=function(){this.t=[]},rh.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,r,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=rt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=r),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,r,n)})),t}(this.__b,r,n.__O=n.__P)}this.__b=null}var a=t.__a&&tm(tg,null,e.fallback);return a&&(a.__u&=-33),[tm(tg,null,t.__a?null:e.children),a]};var rg=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function rf(e){return this.getChildContext=function(){return e.context},e.children}function ry(e){var t=this,r=e.i;t.componentWillUnmount=function(){tz(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,r){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),tz(tm(rf,{context:t.context},e.__v),t.l)}function rv(e,t){var r=tm(ry,{__v:e,i:t});return r.containerInfo=t,r}(r_.prototype=new tf).__a=function(e){var t=this,r=rm(t.__v),n=t.o.get(e);return n[0]++,function(a){var o=function(){t.props.revealOrder?(n.push(a),rg(t,e,n)):a()};r?r(o):o()}},r_.prototype.render=function(e){this.u=null,this.o=new Map;var t=tk(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},r_.prototype.componentDidUpdate=r_.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){rg(e,r,t)})};var rb="u">typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,rw=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rk=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,rS=/[A-Z0-9]/g,rE="u">typeof document;function rC(e,t,r){return null==t.__k&&(t.textContent=""),tz(e,t),"function"==typeof r&&r(),e?e.__c:null}function rP(e,t,r){return function e(t,r){tz(t,r,e)}(e,t),"function"==typeof r&&r(),e?e.__c:null}tf.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(tf.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var rT=te.event;function rO(){}function rA(){return this.cancelBubble}function rx(){return this.defaultPrevented}te.event=function(e){return rT&&(e=rT(e)),e.persist=rO,e.isPropagationStopped=rA,e.isDefaultPrevented=rx,e.nativeEvent=e};var rD,rz={enumerable:!1,configurable:!0,get:function(){return this.class}},rM=te.vnode;te.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={};for(var a in t){var o=t[a];if(!("value"===a&&"defaultValue"in t&&null==o||rE&&"children"===a&&"noscript"===r||"class"===a||"className"===a)){var i,s=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===o?o="":"ondoubleclick"===s?a="ondblclick":"onchange"!==s||"input"!==r&&"textarea"!==r||(i=t.type,("u">typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(i))?"onfocus"===s?a="onfocusin":"onblur"===s?a="onfocusout":rk.test(a)?a=s:-1===r.indexOf("-")&&rw.test(a)?a=a.replace(rS,"-$&").toLowerCase():null===o&&(o=void 0):s=a="oninput","oninput"===s&&n[a=s]&&(a="oninputCapture"),n[a]=o}}"select"==r&&n.multiple&&Array.isArray(n.value)&&(n.value=tk(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),"select"==r&&null!=n.defaultValue&&(n.value=tk(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",rz)):(t.className&&!t.class||t.class&&t.className)&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=rb,rM&&rM(e)};var rI=te.__r;te.__r=function(e){rI&&rI(e),rD=e.__c};var rR=te.diffed;te.diffed=function(e){rR&&rR(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value),rD=null};var rL={ReactCurrentDispatcher:{current:{readContext:function(e){return rD.__n[e.__c].props.value}}}};function rB(e){return tm.bind(null,e)}function rN(e){return!!e&&e.$$typeof===rb}function rU(e){return rN(e)&&e.type===tg}function rF(e){return rN(e)?tM.apply(null,arguments):e}function rq(e){return!!e.__k&&(tz(null,e),!0)}function rH(e){return e&&(e.base||1===e.nodeType&&e)||null}var rK=function(e,t){return e(t)},rj=function(e,t){return e(t)};function r$(e){e()}function rV(e){return e}function rW(){return[!1,r$]}function rG(e,t){var r=t(),n=tG({h:{__:r,v:t}}),a=n[0].h,o=n[1];return tJ(function(){a.__=r,a.v=t,rY(a)&&o({h:a})},[e,r,t]),tZ(function(){return rY(a)&&o({h:a}),e(function(){rY(a)&&o({h:a})})},[e]),r}function rY(e){var t=e.v,r=e.__;try{var n=t();return(r!==n||0===r&&1/r!=1/n)&&(r==r||n==n)}catch(e){return!0}}var rZ={useState:tG,useId:t4,useReducer:tY,useEffect:tZ,useLayoutEffect:tJ,useInsertionEffect:tJ,useTransition:rW,useDeferredValue:rV,useSyncExternalStore:rG,startTransition:r$,useRef:tQ,useImperativeHandle:tX,useMemo:t1,useCallback:t0,useContext:t2,useDebugValue:t3,version:"17.0.2",Children:rc,render:rC,hydrate:rP,unmountComponentAtNode:rq,createPortal:rv,createElement:tm,createContext:tI,createFactory:rB,cloneElement:rF,createRef:t_,Fragment:tg,isValidElement:rN,isElement:rN,isFragment:rU,findDOMNode:rH,Component:tf,PureComponent:rn,memo:ra,forwardRef:rs,flushSync:rj,unstable_batchedUpdates:rK,StrictMode:tg,Suspense:rh,SuspenseList:r_,lazy:rp,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rL},rJ=Object.freeze({__proto__:null,Children:rc,Component:tf,Fragment:tg,PureComponent:rn,StrictMode:tg,Suspense:rh,SuspenseList:r_,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rL,cloneElement:rF,createContext:tI,createElement:tm,createFactory:rB,createPortal:rv,createRef:t_,default:rZ,findDOMNode:rH,flushSync:rj,forwardRef:rs,hydrate:rP,isElement:rN,isFragment:rU,isValidElement:rN,lazy:rp,memo:ra,render:rC,startTransition:r$,unmountComponentAtNode:rq,unstable_batchedUpdates:rK,useCallback:t0,useContext:t2,useDebugValue:t3,useDeferredValue:rV,useEffect:tZ,useErrorBoundary:function(e){var t=tW(tR++,10),r=tG();return t.__=e,tL.componentDidCatch||(tL.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]},useId:t4,useImperativeHandle:tX,useInsertionEffect:tJ,useLayoutEffect:tJ,useMemo:t1,useReducer:tY,useRef:tQ,useState:tG,useSyncExternalStore:rG,useTransition:rW,version:"17.0.2"});let rQ={"button.continue":["Continue"],"button.continueWithEmail":["Continue with email"],"button.createAnOrganization":["Create an organization"],"button.emailCode":["Email me a code"],"button.emailLink":["Email me a link"],"button.emailResent":["Email resent! Try again in ",["timeRemaining"],"s"],"button.goBack":["Go back"],"button.hidePassword":["Hide"],"button.loginWithoutPassword":["Log in without a password"],"button.resendEmail":["Resend email"],"button.retry":["Try again"],"button.showPassword":["Show"],"button.totpQrManual":["Having trouble scanning?"],"button.totpQrRetry":["Try to scan the QR code again"],"button.tryDifferentEmailAddress":["Try a different email address"],"button.usePassword":["Use a password instead"],"emailConfirmation.content":["An email was sent to <bold>",["email"],"</bold>."],"emailConfirmation.emailSent":["Email sent! Try again in ",["timeRemaining"],"s"],"emailConfirmation.title":["Check your email"],"emailMethodSelection.code":["Email me a login code"],"emailMethodSelection.link":["Email me a login link"],"emailMethodSelection.title":["Select how you’d like to continue"],"emailVerification.content":["Confirm your email address with one of the following:"],"emailVerification.title":["Verify your email"],"error.adBlockerDetected":["The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."],"error.authPolicyNoOrg":["Unable to join due to the organization's authentication policy. Please contact your admin for more information."],"error.authPolicyWithOrg":["Unable to join due to ",["organizationName"],"'s authentication policy. Please contact your admin for more information."],"error.breachedPassword":["Password appears in the list of breached passwords and must be reset."],"error.claimedDomain":["Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."],"error.default":["Something went wrong. Try again later or contact your admin for help."],"error.duplicatePhoneNumber":["A member with the specified phone number already exists for this organization."],"error.emailNoAccessToOrg":[["email"]," does not have access to ",["organizationName"],". If you think this is a mistake, contact your admin."],"error.emailNotFound":["Email not found."],"error.eml":["Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."],"error.inactiveEmail":["The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."],"error.invalidCode":["Code format is invalid, please try again."],"error.invalidEmail":["Email format is invalid."],"error.invalidEmailAddress":["Invalid email address"],"error.invalidPhoneNumber":["Phone number format is invalid. Ensure the phone number is in the E.164 format."],"error.invalidPhoneNumberCountryCode":["The phone number's country code is invalid, unsupported, or disabled."],"error.invalidSessionToken":["Invalid session token."],"error.jitIneligible":[["email"]," does not have access to ",["organizationName"],". If you think this is a mistake, contact your admin"],"error.memberPasswordNotFound":["Member password not found."],"error.noUserPassword":["Password not found for this user. Please try again."],"error.oauthFlowCallbackError":["An error was encountered in the callback of the OAuth flow. Please try again."],"error.oauthTokenNotFound":["OAuth Token could not be found."],"error.organization":["The organization you are looking for could not be found. If you think this is a mistake, contact your admin."],"error.otpCodeNotFound":["Invalid passcode, please try again."],"error.passcodeInvalid":["Invalid passcode, please try again."],"error.resetPassword":["Password must be reset."],"error.sessionNotFound":["Session not found."],"error.title":["Looks like there was an error!"],"error.unableToAuthMagicLink":["The magic link could not be authenticated because it was either already used or expired. Please try again."],"error.unauthorizedAction":["Unauthorized action."],"error.unauthorizedCredentials":["Unauthorized credentials."],"error.unsubscribedPhoneNumber":["Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."],"error.userLockLimitReached":["Too many failed authentication attempts. Please try again later."],"error.userUnauthenticated":["Must have an active session to call this method. Have you logged in yet?"],"formField.backupCode.ariaLabel":["Backup code"],"formField.backupCode.placeholder":["Enter backup code"],"formField.countryCode.label":["Country code"],"formField.email.label":["Email"],"formField.email.placeholder":["example@email.com"],"formField.orgSlug.label":["Organization slug"],"formField.otp.ariaLabel":["One-time passcode"],"formField.passcode.status.verifying":["Verifying passcode..."],"formField.password.label":["Password"],"formField.phone.label":["Phone number"],"idpConsent.allowClientTo":["Allow ",["clientName"]," to:"],"idpConsent.button.allow":["Allow"],"idpConsent.button.deny":["Deny"],"idpConsent.customScopes.title":[["clientName"]," wants to access your ",["projectName"]," account"],"idpConsent.defaultClientName":["The App"],"idpConsent.denied":["Access to the application was denied."],"idpConsent.noActiveSession":["No active session detected. Please log in to continue."],"idpConsent.noPermissionsToGrant":["You do not have permissions to grant ",["clientName"]," access to some of the requested scopes."],"idpConsent.signIn.title":["Sign in to ",["clientName"]," with ",["projectName"]],"idpLogout.confirmMessage":["Are you sure you want to log out of your ",["projectName"]," account?"],"idpLogout.no":["No"],"idpLogout.notLoggedOut":["You have not been logged out. You may close this page."],"idpLogout.title":["Log out?"],"idpLogout.yes":["Yes"],"link.openInGmail":["Open in Gmail"],"link.openInOutlook":["Open in Outlook"],"link.openInYahoo":["Open in Yahoo"],"link.signupResetPassword":["Sign up or reset password"],"loading.label":["Loading"],"login.loading":["Logging in..."],"login.success.content":["You have successfully logged in."],"login.title":["Sign up or log in"],"methodDivider.text":["or"],"mfa.enrollment.content":["Your organization requires an additional form of verification to make your account more secure."],"mfa.enrollment.option.sms":["Text me a code"],"mfa.enrollment.option.totp":["Use an authenticator app"],"mfa.enrollment.title":["Set up Multi-Factor Authentication"],"mfa.methods.authenticatorApp":["Use an authenticator app"],"mfa.smsEnrollment.content":["Your organization requires an additional form of verification to make your account more secure."],"mfa.smsEnrollment.title":["Enter your phone number to set up Multi-Factor Authentication"],"mfa.totpEnrollment.content":["Click to copy the code below. Enter into your authenticator app to link your account."],"mfa.totpEnrollment.copyCode.codeCopied":["Copied!"],"mfa.totpEnrollment.copyCode.label":["Copy to clipboard"],"mfa.totpEnrollment.title":["Having trouble scanning the QR code?"],"mfa.totpEnrollment.toast.copyFailed":["Couldn't copy code to clipboard"],"mfa.totpEntry.getNewCode":["If the verification code doesn’t work, go back to your authenticator app to get a new code."],"mfa.totpEntry.switchToSms":["Text me a code instead"],"mfa.totpEntry.useBackupCode":["Use a backup code"],"mfaTotpEnrollment.qrAltText":["QR code for TOTP enrollment"],"oauth.continueWithGitHub":["Continue with GitHub"],"oauth.continueWithGoogle":["Continue with Google"],"oauth.continueWithHubSpot":["Continue with HubSpot"],"oauth.continueWithMicrosoft":["Continue with Microsoft"],"oauth.continueWithSlack":["Continue with Slack"],"organizationDiscovery.acceptInvite":["Accept Invite"],"organizationDiscovery.join":["Join"],"organizationDiscovery.noOrgs.content":["Make sure your email address is correct. Otherwise, you might need to be invited by your admin."],"organizationDiscovery.noOrgs.create.content":[["email"]," does not have an account. Think this is a mistake? Try a different email address, or contact your admin."],"organizationDiscovery.noOrgs.create.title":["Create an organization to get started"],"organizationDiscovery.noOrgs.title":[["email"]," does not belong to any organizations."],"organizationDiscovery.title":["Select an organization to continue"],"organizationLogin.title":["Continue to ",["organizationName"]],"organizationLogin.titleUnknown":["Continue to ..."],"passcode.codeSent":["Code sent! Try again in ",["timeRemaining"],"s"],"passcode.expirationCountdown":["Your code expires in ",["timeRemaining"],"."],"passcode.expired":["Your code has expired."],"passcode.resendCode":["Resend code"],"passcode.sentConfirmation":["A 6-digit passcode was sent to you at <bold>",["destination"],"</bold>."],"passcode.title":["Enter passcode"],"password.forgot.content.discovery":["We'll email you a verification link to sign up for an account or reset your password if you have one."],"password.forgot.content.organization":["We'll email you a login link to sign in to your account directly or reset your password if you have one."],"password.forgot.title":["Check your email for help signing in"],"password.login.title":["Log in with email and password"],"password.requirement.fulfilled":["Fulfilled"],"password.requirement.notFulfilled":["Not fulfilled"],"password.requirement.suggestion":["Suggestion"],"password.requirement.warning":["Warning"],"password.reset.emailSent.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.reset.emailSent.title":["Check your email"],"password.setNew.title":["Set a new password"],"password.strength":["Password strength: ",["score"]," out of 4."],"password.strength.accepted":["Password accepted."],"password.strength.notAccepted":["Password not accepted."],"password.strength.requirementsNotMet":["Your password must meet all requirements."],"password.strengthError.breached":["This password may have been used on a different site that experienced a security issue. Please choose another password."],"password.strengthError.complexity":[["complexity","plural",{one:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"],other:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"]}]],"password.strengthError.minimumLength":[["characterLength","plural",{one:["Must be at least ","#"," character long"],other:["Must be at least ","#"," characters long"]}]],"password.verification.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.verification.title":["Verify your email first."],"password.zxcvbn.suggestion.addWords":["Add another word or two. Uncommon words are better."],"password.zxcvbn.suggestion.allUppercase":["All-uppercase is almost as easy to guess as all-lowercase."],"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou":["Avoid dates and years that are associated with you."],"password.zxcvbn.suggestion.avoidRecentYears":["Avoid recent years."],"password.zxcvbn.suggestion.avoidRepeats":["Avoid repeated words and characters."],"password.zxcvbn.suggestion.avoidSequences":["Avoid sequences."],"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou":["Avoid years that are associated with you."],"password.zxcvbn.suggestion.capitalization":["Capitalization doesn't help very much."],"password.zxcvbn.suggestion.longerKeyboardPattern":["Use a longer keyboard pattern with more turns."],"password.zxcvbn.suggestion.noSymbolsDigitsUppercase":["No need for symbols, digits, or uppercase letters."],"password.zxcvbn.suggestion.predictableSubstitutions":["Predictable substitutions like '@' instead of 'a' don't help very much."],"password.zxcvbn.suggestion.reversed":["Reversed words aren't much harder to guess."],"password.zxcvbn.suggestion.useAFewWords":["Use a few words, avoid common phrases."],"password.zxcvbn.warning.commonNames":["Common names and surnames are easy to guess."],"password.zxcvbn.warning.dates":["Dates are often easy to guess."],"password.zxcvbn.warning.longerRepeats":['Repeats like "abcabcabc" are only slightly harder to guess than "abc".'],"password.zxcvbn.warning.names":["Names and surnames by themselves are easy to guess."],"password.zxcvbn.warning.recentYears":["Recent years are easy to guess."],"password.zxcvbn.warning.repeats":['Repeats like "aaa" are easy to guess.'],"password.zxcvbn.warning.sequences":['Sequences like "abc" or "6543" are easy to guess.'],"password.zxcvbn.warning.shortKeyboardPatterns":["Short keyboard patterns are easy to guess."],"password.zxcvbn.warning.similarToCommonPassword":["This is similar to a commonly used password."],"password.zxcvbn.warning.straightRows":["Straight rows of keys are easy to guess."],"password.zxcvbn.warning.top100CommonPassword":["This is a top-100 common password."],"password.zxcvbn.warning.top10CommonPassword":["This is a top-10 common password."],"password.zxcvbn.warning.veryCommonPassword":["This is a very common password."],"password.zxcvbn.warning.wordByItself":["A word by itself is easy to guess."],"provider.continueWith":["Continue with ",["display_name"]],"provider.continueWithSSO":["Use single sign-on"],"provider.lastUsed":["Last used"],"recoveryCodes.entry.content":["Enter one of the backup codes you saved when setting up your authenticator app."],"recoveryCodes.entry.error.invalidCode":["Invalid backup code, please try again."],"recoveryCodes.entry.title":["Enter backup code"],"recoveryCodes.filename.noOrganizationName":["backup-codes"],"recoveryCodes.filename.withOrganizationName":[["organizationName"],"-backup-codes"],"recoveryCodes.save.button.copied":["Copied!"],"recoveryCodes.save.button.copyAll":["Copy all to clipboard"],"recoveryCodes.save.button.done":["Done"],"recoveryCodes.save.button.download":["Download .txt file"],"recoveryCodes.save.content":["This is the only time you will be able to access and save your backup codes."],"recoveryCodes.save.title":["Save your backup codes!"],"recoveryCodes.save.toast.copyFailed":["Couldn't copy codes to clipboard"],"ssoDiscovery.email.error.unknown":["Something went wrong. Try again later or contact your admin for help."],"ssoDiscovery.email.title":["Enter your email to continue"],"ssoDiscovery.fallback.button.reset":["Try another method"],"ssoDiscovery.fallback.content":["Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."],"ssoDiscovery.fallback.error.orgNotFound":["Organization not found. Please try again."],"ssoDiscovery.fallback.error.unknown":["An error occurred. Please try again."],"ssoDiscovery.fallback.title":["Sorry, we couldn't find any connections"],"ssoDiscovery.title":["Select a connection to continue"],"success.title":["Success!"],"totp.content":["Enter the 6-digit code from your authenticator app."],"totp.setupQr.content":["Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."],"totp.setupQr.title":["Scan the QR code to link your authenticator app"],"totp.title":["Enter verification code"],"watermark.altText":["Stytch by Twilio"],"watermark.poweredBy":["Powered by"]},rX=Symbol.for("stytch__internal_b2b"),r1=e=>{if(!e[rX])throw Error("Internals not found!");return e[rX]};var r0={},r2={},r3={exports:{}},r4=r3.exports,r5=function(){if(es)return r0;es=1,Object.defineProperty(r0,"__esModule",{value:!0}),r0.ParseError=void 0,r0.parse=function(e,t={}){return new i(e,t).parse()};let e=function(){var e;let t;return ei?r2:(ei=1,e=r2&&r2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(r2,"__esModule",{value:!0}),r2.lexer=r2.states=void 0,t=e(function(){var e;return eo?r3.exports:(eo=1,e=function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof RegExp().sticky;function n(e){return e&&"[object RegExp]"===t.call(e)}function a(e){return e&&"object"==typeof e&&!n(e)&&!Array.isArray(e)}function o(e){return e.length?"(?:"+e.map(function(e){return"(?:"+e+")"}).join("|")+")":"(?!)"}function i(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(n(e)){if(e.ignoreCase)throw Error("RegExp /i flag not allowed");if(e.global)throw Error("RegExp /g flag is implied");if(e.sticky)throw Error("RegExp /y flag is implied");if(e.multiline)throw Error("RegExp /m flag is implied");return e.source}throw Error("Not a pattern: "+e)}function s(e,t){return e.length>t?e:Array(t-e.length+1).join(" ")+e}function l(t,r){if(a(r)||(r={match:r}),r.include)throw Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var i in r)e.call(r,i)&&(o[i]=r[i]);if("string"==typeof o.type&&t!==o.type)throw Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort(function(e,t){return n(e)&&n(t)?0:n(t)?-1:n(e)?1:t.length-e.length}),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n.include){for(var a=[].concat(n.include),o=0;o<a.length;o++)t.push({include:a[o]});continue}if(!n.type)throw Error("Rule has no type: "+JSON.stringify(n));t.push(l(n.type,n))}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),r=[],n=0;n<t.length;n++){var o=t[n],i=[].concat(e[o]);if("include"===o){for(var s=0;s<i.length;s++)r.push({include:i[s]});continue}var c=[];i.forEach(function(e){a(e)?(c.length&&r.push(l(o,c)),r.push(l(o,e)),c=[]):c.push(e)}),c.length&&r.push(l(o,c))}return r}(e)}var d=l("error",{lineBreaks:!0,shouldThrow:!0});function u(e,t){for(var a=null,s=Object.create(null),l=!0,c=null,u=[],h=[],m=0;m<e.length;m++)e[m].fallback&&(l=!1);for(var m=0;m<e.length;m++){var p=e[m];if(p.include)throw Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(a)if(!p.fallback==!a.fallback)throw Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')");else throw Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");a=p}var _=p.match.slice();if(l)for(;_.length&&"string"==typeof _[0]&&1===_[0].length;)s[_.shift().charCodeAt(0)]=p;if(p.pop||p.push||p.next){if(!t)throw Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(0!==_.length){l=!1,u.push(p);for(var g=0;g<_.length;g++){var f=_[g];if(n(f)){if(null===c)c=f.unicode;else if(c!==f.unicode&&!1===p.fallback)throw Error("If one rule is /u then all must be")}}var y=o(_.map(i)),v=new RegExp(y);if(v.test(""))throw Error("RegExp matches empty string: "+v);if(RegExp("|"+y).exec("").length-1>0)throw Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!p.lineBreaks&&v.test("\n"))throw Error("Rule should declare lineBreaks: "+v);h.push("("+y+")")}}var b=a&&a.fallback,w=r&&!b?"ym":"gm";return!0===c&&(w+="u"),{regexp:new RegExp(o(h)+(r||b?"":"|"),w),groups:u,fast:s,error:a||d}}function h(e,t,r){var n=e&&(e.push||e.next);if(n&&!r[n])throw Error("Missing state '"+n+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var m=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};m.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedText=t?t.queuedText:"",this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},m.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},m.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},m.prototype.popState=function(){this.setState(this.stack.pop())},m.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var p=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function _(){return this.value}if(m.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r<t;r++)if(void 0!==e[r+1])return this.groups[r];throw Error("Cannot find token type for matched text")},m.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var r=this.buffer;if(e!==r.length){var n=this.fast[r.charCodeAt(e)];if(n)return this._token(n,r.charAt(e),e);var a=this.re;a.lastIndex=e;var o=p(a,r),i=this.error;if(null==o)return this._token(i,r.slice(e,r.length),e);var n=this._getGroup(o),s=o[0];return i.fallback&&o.index!==e?(this.queuedGroup=n,this.queuedText=s,this._token(i,r.slice(e,o.index),e)):this._token(n,s,e)}},m.prototype._token=function(e,t,r){var n=0;if(e.lineBreaks){var a=/\n/g,o=1;if("\n"===t)n=1;else for(;a.exec(t);)n++,o=a.lastIndex}var i={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:_,offset:r,lineBreaks:n,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=n,0!==n?this.col=s-o+1:this.col+=s,e.shouldThrow)throw Error(this.formatError(i,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),i},"u">typeof Symbol&&Symbol.iterator){var g=function(e){this.lexer=e};g.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},g.prototype[Symbol.iterator]=function(){return this},m.prototype[Symbol.iterator]=function(){return new g(this)}}return m.prototype.formatError=function(e,t){if(null==e)var r=this.buffer.slice(this.index),e={text:r,offset:this.index,lineBreaks:+(-1!==r.indexOf("\n")),line:this.line,col:this.col};var n=Math.max(e.line-2,1),a=String(e.line+2).length,o=(function(e,t){for(var r=e.length,n=0;;){var a=e.lastIndexOf("\n",r-1);if(-1===a)break;if(n++,r=a,n===t||0===r)break}var o=n<t?0:r+1;return e.substring(o).split("\n")})(this.buffer,this.line-e.line+2+1).slice(0,5),i=[];i.push(t+" at line "+e.line+" col "+e.col+":"),i.push("");for(var l=0;l<o.length;l++){var c=o[l],d=n+l;i.push(s(String(d),a)+" "+c),d===e.line&&i.push(s("",a+e.col+1)+"^")}return i.join("\n")},m.prototype.clone=function(){return new m(this.states,this.state)},m.prototype.has=function(e){return!0},{compile:function(e){return new m({start:u(c(e))},"start")},states:function(e,t){var r=e.$all?c(e.$all):[];delete e.$all;var n=Object.getOwnPropertyNames(e);t||(t=n[0]);for(var a=Object.create(null),o=0;o<n.length;o++){var i=n[o];a[i]=c(e[i]).concat(r)}for(var o=0;o<n.length;o++)for(var i=n[o],s=a[i],l=Object.create(null),d=0;d<s.length;d++){var p=s[d];if(p.include){var _=[d,1];if(p.include!==i&&!l[p.include]){l[p.include]=!0;var g=a[p.include];if(!g)throw Error("Cannot include nonexistent state '"+p.include+"' (in state '"+i+"')");for(var f=0;f<g.length;f++){var y=g[f];-1===s.indexOf(y)&&_.push(y)}}s.splice.apply(s,_),d--}}for(var v=Object.create(null),o=0;o<n.length;o++){var i=n[o];v[i]=u(a[i],!0)}for(var o=0;o<n.length;o++){for(var b=n[o],w=v[b],k=w.groups,d=0;d<k.length;d++)h(k[d],b,v);for(var S=Object.getOwnPropertyNames(w.fast),d=0;d<S.length;d++)h(w.fast[S[d]],b,v)}return new m(v,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t="u">typeof Map,r=t?new Map:Object.create(null),n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var o=n[a],i=e[o];(Array.isArray(i)?i:[i]).forEach(function(e){if("string"!=typeof e)throw Error("keyword must be string (in keyword '"+o+"')");t?r.set(e,o):r[e]=o})}return function(e){return t?r.get(e):r[e]}}}},r3.exports?r3.exports=e():r4.moo=e(),r3.exports)}()),r2.states={body:{doubleapos:{match:"''",value:()=>"'"},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:e=>e.slice(1,-1).replace(/''/g,"'")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:e=>e.substring(1).trim()},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:e=>e.split(",")[1].trim()},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:e=>e.split(",")[1].trim()},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:e=>e.substring(1).trim()},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:e=>e.split(":")[1].trim()},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:e=>e.substring(0,e.indexOf("{")).trim()},end:{match:/\s*\}/u,pop:1}}},r2.lexer=t.default.states(r2.states),r2)}(),t=e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),r=e=>"plural"===e||"select"===e||"selectordinal"===e,n=["number","date","time","spellout","ordinal","duration"],a=["zero","one","two","few","many","other"];class o extends Error{constructor(t,r){super(e.lexer.formatError(t,r))}}r0.ParseError=o;class i{constructor(t,r){var n,o,i,s;this.lexer=e.lexer.reset(t),this.cardinalKeys=null!=(n=null==r?void 0:r.cardinal)?n:a,this.ordinalKeys=null!=(o=null==r?void 0:r.ordinal)?o:a,this.strict=null!=(i=null==r?void 0:r.strict)&&i,this.strictPluralKeys=null==(s=null==r?void 0:r.strictPluralKeys)||s}parse(){return this.parseBody(!1,!0)}checkSelectKey(e,t,r){if("="===r[0]){if("select"===t)throw new o(e,`The case ${r} is not valid with select`)}else if("select"!==t){let n="plural"===t?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&n.length>0&&!n.includes(r))throw new o(e,`The ${t} case ${r} is not valid in this locale`)}}parseSelect({value:e},r,n,a){let i={type:a,arg:e,cases:[],ctx:n};for(let e of("plural"===a||"selectordinal"===a?r=!0:this.strict&&(r=!1),this.lexer))switch(e.type){case"offset":if("select"===a)throw new o(e,"Unexpected plural offset for select");if(i.cases.length>0)throw new o(e,"Plural offset must be set before cases");i.pluralOffset=Number(e.value),n.text+=e.text,n.lineBreaks+=e.lineBreaks;break;case"case":this.checkSelectKey(e,a,e.value),i.cases.push({key:e.value,tokens:this.parseBody(r),ctx:t(e)});break;case"end":return i;default:throw new o(e,`Unexpected lexer token: ${e.type}`)}throw new o(null,"Unexpected message end")}parseArgToken(e,a){let i=t(e),s=this.lexer.next();if(!s)throw new o(null,"Unexpected message end");if(i.text+=s.text,i.lineBreaks+=s.lineBreaks,this.strict&&("func-simple"===s.type||"func-args"===s.type)&&!n.includes(s.value))throw new o(e,`Invalid strict mode function arg type: ${s.value}`);switch(s.type){case"end":return{type:"argument",arg:e.value,ctx:i};case"func-simple":{let t=this.lexer.next();if(!t)throw new o(null,"Unexpected message end");if("end"!==t.type)throw new o(t,`Unexpected lexer token: ${t.type}`);if(i.text+=t.text,r(s.value.toLowerCase()))throw new o(s,`Invalid type identifier: ${s.value}`);return{type:"function",arg:e.value,key:s.value,ctx:i}}case"func-args":{if(r(s.value.toLowerCase())){let e=`Invalid type identifier: ${s.value}`;throw new o(s,e)}let t=this.parseBody(!this.strict&&a);return this.strict&&t.length>0&&(t=function(e,t){let r="",n="";for(let a of t){let t=a.ctx.text;switch(n+=t,a.type){case"content":r+=a.value;break;case"argument":case"function":case"octothorpe":r+=t;break;default:throw new o(e,`Unsupported part in strict mode function arg style: ${t}`)}}return[{type:"content",value:r.trim(),ctx:Object.assign({},t[0].ctx,{text:n})}]}(e,t)),{type:"function",arg:e.value,key:s.value,param:t,ctx:i}}case"select":if(r(s.value))return this.parseSelect(e,a,i,s.value);throw new o(s,`Unexpected select type ${s.value}`);default:throw new o(s,`Unexpected lexer token: ${s.type}`)}}parseBody(e,r){let n=[],a=null;for(let i of this.lexer)if("argument"===i.type)a&&(a=null),n.push(this.parseArgToken(i,e));else if("octothorpe"===i.type&&e)a&&(a=null),n.push({type:"octothorpe",ctx:t(i)});else{if("end"===i.type&&!r)return n;let s=i.value;if(!e&&"quoted"===i.type&&"#"===s[0]){if(s.includes("{"))throw new o(i,`Unsupported escape pattern: ${s}`);s=i.text}a?(a.value+=s,a.ctx.text+=i.text,a.ctx.lineBreaks+=i.lineBreaks):(a={type:"content",value:s,ctx:t(i)},n.push(a))}if(r)return n;throw new o(null,"Unexpected message end")}}return r0}();class r8 extends Error{constructor(e,t,r){super(e),this.token=t,this.type=r||"error"}}let r6=e=>e<4?"short":4===e?"long":"narrow",r7=e=>e%2==0?"2-digit":"numeric",r9={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},ne=e=>e>="A"&&e<="Z"||e>="a"&&e<="z";function nt(e,t=e=>e){try{return function(e,t=e=>e){return function e(t,r){return t.filter(e=>"content"!==e.type).length?t.map(t=>{if("content"===t.type)return r(t.value);if("octothorpe"===t.type)return"#";if("argument"===t.type)return[t.arg];if("function"===t.type){let e=t?.param?.[0];if("date"===t.key&&e){var n,a;let r=(n=e.value.trim(),a=e=>{throw Error(`Unable to compile date expression: ${e.message}`)},/^::/.test(n)?function(e,t,r=e=>{throw e}){let n={timeZone:t},a=[];for(let t of e){let{error:e,field:o,str:i}=t;if(e){let n=new r8(e.message,t);n.stack=e.stack,r(n)}i&&r(new r8(`Ignoring string part: ${i}`,t,r8.WARNING)),o&&(-1===a.indexOf(o)?a.push(o):r(new r8(`Duplicate ${o} token`,t)));let s=function(e,t){switch(e.field){case"era":return{era:r6(e.width)};case"year":switch(e.char){case"y":return{year:r7(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return t(`${e.desc} is not supported; falling back to year:numeric`,r8.WARNING),{year:"numeric"}}case"month":return{month:function(e,t){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:t(`${e.desc} is not supported with width ${e.width}`);return}}(e,t)};case"day":return{day:function(e,t){let{char:r,desc:n,width:a}=e;return"d"===r?r7(a):void t(`${n} is not supported`)}(e,t)};case"weekday":return{weekday:function(e,t){let{char:r,desc:n,width:a}=e;return("c"===r||"e"===r)&&a<3&&t(`Numeric value is not supported for ${n}; falling back to weekday:short`,r8.WARNING),r6(a)}(e,t)};case"period":break;case"hour":let r,n=r7(e.width);switch(e.char){case"h":r="h12";break;case"H":r="h23";break;case"k":r="h24";break;case"K":r="h11"}return r?{hour:n,hourCycle:r}:{hour:n};case"min":return{minute:r7(e.width)};case"sec":return{second:r7(e.width)};case"tz":return{timeZoneName:function(e,t){let{char:r,desc:n,width:a}=e;switch(r){case"v":case"z":return 4===a?"long":"short";case"V":if(4===a)return"long";t(`${n} is not supported with width ${a}`);return;case"X":t(`${n} is not supported`);return}return"short"}(e,t)};case"quarter":case"week":case"sec-frac":case"ms":t(`${e.desc} is not supported`)}}(t,(e,n)=>r(new r8(e,t,n)));s&&Object.assign(n,s)}return n}(function(e){let t=[],r=0;for(;;){let n=function(e,t){let r=e[t];if(!r)return null;if(ne(r)){var n=t;let r=e[n],a=1;for(;e[++n]===r;)++a;let o=r9[r];if(!o){let e=`The letter ${r} is not a valid field identifier`;return{char:r,error:Error(e),width:a}}return{char:r,field:o.field,desc:o.desc,width:a}}if("'"===r){var a=t;let r=e[++a],n=2;if("'"===r)return{char:"'",str:r,width:n};for(;;){let t=e[++a];if(++n,void 0===t)return{char:"'",error:Error(`Unterminated quoted literal in pattern: ${r||e}`),str:r,width:n};if("'"===t)if("'"!==e[++a])return{char:"'",str:r,width:n};else++n;r+=t}return}let o=r,i=1;for(;;){let n=e[++t];if(!n||ne(n)||"'"===n)return{char:r,str:o,width:i};o+=n,i+=1}}(e,r);if(!n)return t;t.push(n),r+=n.width}}(n.substring(2)),void 0,a):n);return[t.arg,t.key,r]}return e?[t.arg,t.key,e.value.trim()]:[t.arg,t.key]}let o=t.pluralOffset,i={};return t.cases.forEach(({key:t,tokens:n})=>{i["="===t[0]?t.slice(1):t]=e(n,r)}),[t.arg,t.type,{offset:o,...i}]}):t.map(e=>r(e.value))}(r5.parse(e),t)}(e,t)}catch(t){return console.error(`${t.message}
16
16
 
17
17
  Message: ${e}`),[e]}}let nr=new Map;function nn(e){return[...Array.isArray(e)?e:[e],"en"]}function na(e,t,r){let n,a=nn(e);if(r||(r="default"),"string"==typeof r)switch(n={day:"numeric",month:"short",year:"numeric"},r){case"full":n.weekday="long";case"long":n.month="long";break;case"short":n.month="numeric"}else n=r;return ns(()=>nl("date",a,r),()=>new Intl.DateTimeFormat(a,n)).format("string"==typeof t?new Date(t):t)}function no(e,t,r){let n=nn(e);return ns(()=>nl("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function ni(e,t,r,{offset:n=0,...a}){let o=nn(e),i=t?ns(()=>nl("plural-ordinal",o),()=>new Intl.PluralRules(o,{type:"ordinal"})):ns(()=>nl("plural-cardinal",o),()=>new Intl.PluralRules(o,{type:"cardinal"}));return a[r]??a[i.select(r-n)]??a.other}function ns(e,t){let r=e(),n=nr.get(r);return n||(n=t(),nr.set(r,n)),n}function nl(e,t,r){let n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}let nc=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,nd=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,r)=>t?String.fromCharCode(parseInt(t,16)):String.fromCharCode(parseInt(r,16))),nu="%__lingui_octothorpe__%",nh=(e,t)=>t[e]??t.other;var nm=Object.defineProperty;class np{constructor(){((e,t,r)=>{let n;return(n=t+"")in e?nm(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r})(this,"_events",{})}on(e,t){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){let r=this._getListeners(e);if(!r)return;let n=r.indexOf(t);~n&&r.splice(n,1)}emit(e,...t){let r=this._getListeners(e);r&&r.map(e=>e.apply(this,t))}_getListeners(e){let t=this._events[e];return!!Array.isArray(t)&&t}}var n_=Object.defineProperty,ng=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?n_(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};class nf extends np{constructor(e){super(),ng(this,"_locale",""),ng(this,"_locales"),ng(this,"_localeData",{}),ng(this,"_messages",{}),ng(this,"_missing"),ng(this,"_messageCompiler"),ng(this,"t",this._.bind(this)),this.setMessagesCompiler(nt),null!=e.missing&&(this._missing=e.missing),null!=e.messages&&this.load(e.messages),null!=e.localeData&&this.loadLocaleData(e.localeData),("string"==typeof e.locale||e.locales)&&this.activate(e.locale??"en",e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,t){let r=this._localeData[e];r?Object.assign(r,t):this._localeData[e]=t}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,t){"string"==typeof e?this._loadLocaleData(e,t):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,t){let r=this._messages[e];r?Object.assign(r,t):this._messages[e]=t}load(e,t){"string"==typeof e&&"object"==typeof t?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit("change")}loadAndActivate({locale:e,locales:t,messages:r}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=r,this.emit("change")}activate(e,t){this._messages[e]||console.warn(`Messages for locale "${e}" not loaded.`),this._locale=e,this._locales=t,this.emit("change")}_(e,t,r){var n,a,o;if(!this.locale)throw Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let i=r?.message;e||(e=""),"string"!=typeof e&&(t=e.values||t,i=e.message,e=e.id);let s=this.messages[e],l=void 0===s,c=this._missing;if(c&&l)return"function"==typeof c?c(this._locale,e):c;l&&this.emit("missing",{id:e,locale:this._locale});let d=s||i||e;return("string"==typeof d&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
18
18
 
@@ -24,7 +24,7 @@ ICU features such as interpolation and plurals will not work properly for that m
24
24
  Please compile your catalog first.
25
25
  `)),"string"==typeof d&&nc.test(d))?nd(d):"string"==typeof d?d:(n=d,a=this._locale,o=this._locales,(e={},t)=>{let r=((e,t,r={})=>{let n=t||e,a=e=>"object"==typeof e?e:r[e],o=(e,t)=>{let o=no(n,e,Object.keys(r).length?a("number"):void 0);return t.replace(RegExp(nu,"g"),o)};return{plural:(e,t)=>{let{offset:r=0}=t,a=ni(n,!1,e,t);return o(e-r,a)},selectordinal:(e,t)=>{let{offset:r=0}=t,a=ni(n,!0,e,t);return o(e-r,a)},select:nh,number:(e,t)=>no(n,e,a(t)||{style:t}),date:(e,t)=>na(n,e,a(t)||t),time:(e,t)=>(function(e,t,r){let n;if(r||(r="default"),"string"==typeof r)switch(n={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":n.timeZoneName="short";break;case"short":delete n.second}else n=r;return na(e,t,n)})(n,e,a(t)||t)}})(a,o,t),i=(t,n=!1)=>Array.isArray(t)?t.reduce((t,a)=>{let o;if("#"===a&&n)return t+nu;if("string"==typeof a)return t+a;let[s,l,c]=a,d={};return("plural"===l||"selectordinal"===l||"select"===l?Object.entries(c).forEach(([e,t])=>{d[e]=i(t,"plural"===l||"selectordinal"===l)}):d=c,null==(o=l?(0,r[l])(e[s],d):e[s]))?t:t+o},""):t,s=i(n);return"string"==typeof s&&nc.test(s)?nd(s):"string"==typeof s?s:s?String(s):""})(t,r?.formats)}date(e,t){return na(this._locales||this._locale,e,t)}number(e,t){return no(this._locales||this._locale,e,t)}}function ny(e={}){return new nf(e)}ny();var nv=0;function nb(e,t,r,n,a,o){var i,s,l={};for(s in t)"ref"==s?i=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--nv,__i:-1,__u:0,__source:a,__self:o};if("function"==typeof e&&(i=e.defaultProps))for(s in i)void 0===l[s]&&(l[s]=i[s]);return te.vnode&&te.vnode(c),c}let nw=/<([a-zA-Z0-9]+)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9]+)\/>/,nk={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0};function nS(e){let{render:t,component:r,id:n,message:a,formats:o,lingui:{i18n:i,defaultComponent:s}}=e,{values:l,components:c}=nC(e),d=i&&"function"==typeof i._?i._(n,l,{message:a,formats:o}):n,u=d?function e(t,r={}){let n=t.split(nw);if(1===n.length)return t;let a=((e=0,t="")=>()=>`${t}_${e++}`)(0,"$lingui$"),o=[],i=n.shift();for(let[t,s,l]of(i&&o.push(i),function e(t){if(!t.length)return[];let[r,n,a,o]=t.slice(0,4);return[[r||a,n||"",o]].concat(e(t.slice(4,t.length)))}(n))){let n=void 0!==t?r[t]:void 0;(!n||nk[n.type]&&s)&&(n?console.error(`${n.type} is a void element tag therefore it must have no children`):console.error(`Can't use element at index '${t}' as it is not declared in the original translation`),n=nb(tg,{})),Array.isArray(n)&&(n=nb(tg,{children:n})),o.push(rF(n,{key:a()},s?e(s,r):n.props.children)),l&&o.push(l)}return 1===o.length?o[0]:o}(d,c):null;if(null===t||null===r)return u;let h=s||nE,m={id:n,message:a,translation:u,children:u};if(t&&r)console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");else if(t&&"function"!=typeof t)console.error(`Invalid value supplied to prop \`render\`. It must be a function, provided ${t}`);else if(r&&"function"!=typeof r)return console.error(`Invalid value supplied to prop \`component\`. It must be a React component, provided ${r}`),nb(h,{...m,children:u});return"function"==typeof t?t(m):nb(r||h,{...m,children:u})}let nE=({children:e})=>e,nC=e=>{if(!e.values)return{values:void 0,components:e.components};let t={...e.values},r={...e.components};return Object.entries(e.values).forEach(([e,n])=>{if("string"==typeof n||"number"==typeof n)return;let a=Object.keys(r).length;r[a]=nb(tg,{children:n}),t[e]=`<${a}/>`}),{values:t,components:r}},nP=tI(null),nT=e=>{let t=t2(nP);if(null==t)throw Error(e??"useLingui hook was used without I18nProvider.");return t};function nO(){return nT()}let nA=({i18n:e,defaultComponent:t,children:r})=>{let n=tQ(e.locale),a=t0(()=>({i18n:e,defaultComponent:t,_:e.t.bind(e)}),[e,t]),[o,i]=tG(a());return(tZ(()=>{let t=()=>{n.current=e.locale,i(a())},r=e.on("change",t);return n.current!==e.locale&&t(),r},[e,a]),n.current)?nb(nP.Provider,{value:o,children:r}):(console.log("I18nProvider rendered `null`. A call to `i18n.activate` needs to happen in order for translations to be activated and for the I18nProvider to render.This is not an error but an informational message logged only in development."),null)};function nx(e){let t=nT(`Trans component was rendered without I18nProvider.
26
26
  Attempted to render message: ${e.message} id: ${e.id}. Make sure this component is rendered inside a I18nProvider.`);return nb(nS,{...e,lingui:t})}let nD=({children:e,messages:t,overrides:r})=>{let n=t1(()=>({...t,...r}),[t,r]),[a]=tG(()=>{let e=ny({locale:"en",messages:{en:n}});return e.setMessagesCompiler(nt),e});return tZ(()=>{a.load({en:n})},[a,n]),rZ.createElement(nA,{i18n:a},e)},nz=tI(void 0),nM=tI(void 0),nI=({children:e,consentManifestGenerator:t,authTokenParams:r})=>rZ.createElement(nz.Provider,{value:t},rZ.createElement(nM.Provider,{value:r},e));function nR(e){let t=t1(()=>e?matchMedia(e):void 0,[e]),[r,n]=tG(()=>t?.matches??!1);return tZ(()=>{if(!t)return void n(!1);let e=new AbortController;return t.addEventListener("change",e=>n(e.matches),{signal:e.signal}),()=>e.abort()},[t]),r}let nL={"font-family":"system-ui, sans-serif","font-family-mono":"ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace",spacing:"4px","rounded-base":"4px","text-base":"1rem","container-width":"400px","mobile-breakpoint":"768px","transition-duration":"0.15s","destructive-foreground":"#fff"},nB={...nL,"color-scheme":"light",background:"oklch(1 0 0)",foreground:"oklch(0.14 0 0)",primary:"oklch(0.2 0 0)","primary-foreground":"oklch(0.99 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.2 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.52 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.2 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.92 0 0)",ring:"oklch(0.72 0 0)",destructive:"oklch(0.577 0.245 27.325)",warning:"oklch(0.67 0.16 58)",success:"oklch(0.6 0.13 163)"},nN={...nL,"color-scheme":"dark",background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",primary:"oklch(0.922 0 0)","primary-foreground":"oklch(0.205 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)",destructive:"oklch(0.704 0.191 22.216)",warning:"oklch(0.754 0.16 58)",success:"oklch(0.704 0.13 163)"},nU={hideHeaderText:!1};function nF(e,t,{products:r,enableShadowDOM:n},a){let o,{theme:i,options:s}=e??{};if(r.filter(e=>"string"==typeof e).length>0)throw eP(`Please add an import for ${a} and update config.products to
27
- products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error("'config.products' should not include strings anymore");let l=Array.isArray(i),c=nR(l?"(prefers-color-scheme: dark)":void 0);o=l?c?i[1]:i[0]:i;let d=t1(()=>{let e={};for(let t of r)Object.assign(e,t.icons);return Object.assign(e,s?.icons),e},[r,s]);return{theme:{...nB,...o},options:{enableShadowDOM:n,...nU,...s},displayWatermark:t,iconRegistry:d}}let nq=tI(void 0);function nH(e,t){if(null!=t.buttonId&&!1!==t.buttonId)return"string"==typeof t.buttonId?e+t.buttonId:e}var nK={exports:{}},nj=(en=function(){if(el)return nK.exports;el=1;var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,function(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}(o)))}return n}function r(e,t){return t?e?e+" "+t:e+t:e}return nK.exports?(t.default=t,nK.exports=t):window.classNames=t,nK.exports}())&&en.__esModule&&Object.prototype.hasOwnProperty.call(en,"default")?en.default:en;let n$=[],nV=new Set;function nW(e){n$.push(e),nV.forEach(t=>t(e))}function nG(){var e;let t=document.createElement("style"),r=!0,n=((e=e=>{r||document.contains(t)?(t.textContent+=e,r=!1):n()})(n$.join("\n")),nV.add(e),()=>nV.delete(e));return t}nW(".Typography_module_typography__74817c74{font-family:var(--st-font-family)}.Typography_module_header__74817c74{color:var(--st-foreground);font-family:var(--st-header-font);font-size:var(--st-text-2xl);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-2xl)}.Typography_module_body__74817c74{color:var(--st-foreground);font-size:var(--st-text-base)}.Typography_module_body__74817c74,.Typography_module_helper__74817c74{font-weight:var(--st-font-weight-normal);line-height:var(--st-line-height-base)}.Typography_module_helper__74817c74{color:var(--st-muted-foreground);font-size:var(--st-text-xs)}.Typography_module_start__74817c74{text-align:start}.Typography_module_center__74817c74{text-align:center}.Typography_module_end__74817c74{text-align:end}.Typography_module_foreground__74817c74{color:var(--st-foreground)}.Typography_module_muted__74817c74{color:var(--st-muted-foreground)}.Typography_module_destructive__74817c74{color:var(--st-destructive)}.Typography_module_warning__74817c74{color:var(--st-warning)}.Typography_module_success__74817c74{color:var(--st-success)}.Typography_module_regular__74817c74{font-weight:var(--st-font-weight-normal)}.Typography_module_medium__74817c74{font-weight:var(--st-font-weight-medium)}.Typography_module_semibold__74817c74{font-weight:var(--st-font-weight-semibold)}.Typography_module_bold__74817c74{font-weight:var(--st-font-weight-bold)}.Typography_module_defaultFont__74817c74{font-family:var(--st-font-family)}.Typography_module_monoFont__74817c74{font-family:var(--st-font-family-mono)}");var nY={typography:"Typography_module_typography__74817c74",header:"Typography_module_header__74817c74",body:"Typography_module_body__74817c74",helper:"Typography_module_helper__74817c74",start:"Typography_module_start__74817c74",center:"Typography_module_center__74817c74",end:"Typography_module_end__74817c74",foreground:"Typography_module_foreground__74817c74",muted:"Typography_module_muted__74817c74",destructive:"Typography_module_destructive__74817c74",warning:"Typography_module_warning__74817c74",success:"Typography_module_success__74817c74",regular:"Typography_module_regular__74817c74",medium:"Typography_module_medium__74817c74",semibold:"Typography_module_semibold__74817c74",bold:"Typography_module_bold__74817c74",defaultFont:"Typography_module_defaultFont__74817c74",monoFont:"Typography_module_monoFont__74817c74"};let nZ=rs(({variant:e="body",as:t="div",weight:r,font:n,color:a,align:o,className:i,...s},l)=>rZ.createElement(t,{...s,ref:l,className:nj(i,nY.typography,nY[e],n&&nY[n+"Font"],r&&nY[r],a&&nY[a],o&&nY[o])}));nW(".Badge_module_badge__c44e2b28{background-color:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-base);cursor:default;padding:var(--st-spacing-0_5) var(--st-spacing);width:fit-content}");let nJ=({className:e,children:t})=>rZ.createElement("div",{className:nj("Badge_module_badge__c44e2b28",e)},rZ.createElement(nZ,{variant:"helper"},t));nW(".LastUsed_module_container__4e54ed99{position:relative}.LastUsed_module_badge__4e54ed99{position:absolute;right:var(--st-spacing-3);top:0;translate:0 -60%}[dir=rtl] .LastUsed_module_badge__4e54ed99{left:var(--st-spacing-3);right:auto}.LastUsed_module_badge__4e54ed99:dir(rtl){left:var(--st-spacing-3);right:auto}");let nQ=({children:e})=>{let{i18n:t,_:r}=nO();return rZ.createElement("div",{className:"LastUsed_module_container__4e54ed99"},e,rZ.createElement(nJ,{className:"LastUsed_module_badge__4e54ed99"},t._({id:"provider.lastUsed",message:"Last used"})))},nX=({niceName:e,variableName:t})=>rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because there are no ",e," set for this project so we are unable to verify the"," ",rZ.createElement("code",null,t),"\xa0 provided in the configuration. To set ",e,"for this project please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xa0 For more information on why this validation is necessary please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation.")),n1="origin_not_allowed_for_client",n0="invalid_client",n2="oauth_config_not_found",n3="default_provider_not_allowed",n4=({error:e})=>{switch(e){case n1:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the current host\xa0",rZ.createElement("code",null,window.location.host),"is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xa0 ",rZ.createElement("code",null,"http://localhost"),"and\xa0",rZ.createElement("code",null,"http://localhost:<port_number>"),"\xa0 to the Authorized JavaScript origins box. You can learn more\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));case n0:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xa0 Please check that the client ID saved in"," ",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xa0 matches the client ID in your Google Cloud Console.");case n2:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));case"no_login_redirect_urls_set":return rZ.createElement(nX,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});case"no_signup_redirect_urls_set":return rZ.createElement(nX,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});case n3:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."))}},n5=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,n8=e=>(document.cookie?document.cookie.split("; "):[]).filter(t=>{let[r]=t.split("=");return e===r}).length>1,n6=()=>{},n9="u">typeof window?tJ:tZ,n7=e=>{let t=tQ(e);return n9(()=>{t.current=e},[e]),t0((...e)=>(0,t.current)(...e),[])},ae={primaryInfo:null,isEnrolling:!1,smsOtp:{isSending:!1,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{isCreating:!1,createError:null,enrollment:null}},at="Main",ar="Email Confirmation",an="Logged In",aa="Discovery",ao="Error",ai="Password Authenticate",as="Password Reset Form",al="Password Reset Verify Confirmation",ac="Password Forgot Form",ad="Password Set New Confirmation",au="MFA Enrollment Selection",ah="Recovery Code Entry",am="Recovery Code Save",ap="SMS OTP Enrollment",a_="SMS OTP Entry",ag="TOTP Enrollment Manual",af="TOTP Enrollment QR Code",ay="TOTP Entry",av="Email Method Selection",ab="Email OTP Entry",aw="SSO Discovery Email",ak="SSO Discovery Fallback",aS="SSO Discovery Menu",aE="EmailForm",aC="EmailDiscoveryForm",aP="OAuthButtons",aT="SSOButtons",aO="PasswordsEmailForm",aA="PasswordEmailCombined",ax="PasswordEmailCombinedDiscovery",aD="Divider",az="Default",aM="EmailMagicLink",aI="Organization",aR="CannotJoinOrgDueToAuthPolicy",aL="AdBlockerDetected",aB="OrganizationDiscoveryClaimedDomain",aN=e=>!!e,aU=({allMethods:e,orgSupportedMethods:t,uiIncludedMethods:r})=>new Set(t?.length?t:r?.length?r:e);function aF(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[...t.screenHistory,t.screen]}}function aq(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[]}}function aH(e){switch(e){case"totp":return d.totp;case"sms_otp":return d.smsOtp;default:return}}let aK=()=>new Date(Date.now()+12e4),aj=[d.totp,d.smsOtp],a$=(e,t)=>{switch(t.type){case"transition":return"push"===t.history?aF(t.screen,e):aq(t.screen,e);case"navigate_back":{let t=e.screenHistory.at(-1);if(!t)return e;let r=e.screenHistory.slice(0,-1);return{...e,screen:t,screenHistory:r}}case"set_error_message_and_transition":return{...e,screen:ao,error:{type:t.errorType,canGoBack:t.canGoBack}};case"set_user_supplied_email":return{...e,formState:{...e.formState,emailState:{userSuppliedEmail:t.email},passwordState:{email:t.email}}};case"set_organization":return{...e,flowState:{type:s.Organization,organization:t.organization}};case"set_discovery_state":{let r=t.discoveredOrganizations;return{...e,formState:{...e.formState,discoveryState:{email:t.email,discoveredOrganizations:r}},screen:aa}}case"select_discovered_organization":{let{membership:r,organization:n,primary_required:a}=t.discoveredOrganization,o=r.member?.email_address??e.formState.discoveryState.email,i=a?a.allowed_auth_methods:void 0,l={...e,flowState:{type:s.Organization,organization:n},formState:{...e.formState,passwordState:{email:o}},primary:{primaryAuthMethods:i,email:o,emailVerified:r.member?.email_address_verified},screen:at};if(i?.length===0)return{...l,screen:ao,error:{type:aR,canGoBack:!0}};return l}case"set_password_state":return{...e,formState:{...e.formState,passwordState:{email:t.email}}};case"send_email_otp":return aF(ab,{...e,formState:{...e.formState,otpState:{codeExpiration:t.codeExpiration}}});case"set_sso_discovery_state":if(!t.connections.length)return aF(ak,e);return aF(aS,{...e,formState:{...e.formState,ssoDiscoveryState:{connections:t.connections}}});case"use_password_auth":return aF(ai,{...e,formState:{...e.formState,passwordState:{email:t.email}}});default:return((e,t)=>{switch(t.type){case"primary_authenticate_success":{let r=!!t.response.member_session,n="multi_tenant_magic_links"===t.resetTokenType?as:an;if(r)return aq(n,{...e,mfa:ae,primary:{}});if(t.response.primary_required){let r=t.response.primary_required.allowed_auth_methods,{email_address:n,email_address_verified:a}=t.response.member,o={...e,flowState:{type:s.Organization,organization:t.response.organization},formState:{...e.formState,passwordState:{email:n}},primary:{primaryAuthMethods:r,email:n,emailVerified:a}};if(r?.length===0)return aq(ao,{...o,error:{type:aR,canGoBack:!1}});return aq(at,o)}let a=t.response.member.mfa_phone_number_verified,o={enrolledMfaMethods:[!!t.response.member.totp_registration_id&&d.totp,a&&d.smsOtp].filter(aN),memberId:t.response.member_id,memberPhoneNumber:t.response.member.mfa_phone_number,organizationId:t.response.organization.organization_id,organizationMfaOptionsSupported:"RESTRICTED"===t.response.organization.mfa_methods?t.response.organization.allowed_mfa_methods?.map(aH).filter(aN)??[]:[],postAuthScreen:n},i=e=>0===o.organizationMfaOptionsSupported.length||o.organizationMfaOptionsSupported.includes(e),l=t.response.mfa_required?.secondary_auth_initiated==="sms_otp",c=l?d.smsOtp:(()=>{let e=aH(t.response.member.default_mfa_method);if(e&&i(e)&&o.enrolledMfaMethods.includes(e))return e})()??o.enrolledMfaMethods.find(i);if(c){let t={...ae,primaryInfo:o};switch(c){case d.totp:return aq(ay,{...e,mfa:t,primary:{}});case d.smsOtp:{let r={...e,mfa:{...t,smsOtp:{...t.smsOtp,codeExpiration:l?aK():null}},primary:{}};if(a)return aq(a_,r);return{...r,screen:a_,screenHistory:[ap]}}}}return aq(function(e){if(1===e.size){if(e.has(d.totp))return af;if(e.has(d.smsOtp))return ap}return au}(aU({allMethods:aj,orgSupportedMethods:o.organizationMfaOptionsSupported,uiIncludedMethods:t.includedMfaMethods})),{...e,mfa:{...ae,primaryInfo:o,isEnrolling:!0},primary:{}})}case"sms_otp/send":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!0,sendError:null}}};case"sms_otp/send_success":return aF(a_,{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:null,codeExpiration:aK(),formattedDestination:t.formattedPhoneNumber??e.mfa.smsOtp.formattedDestination,enrolledNumber:t.phoneNumber?{phoneNumber:t.phoneNumber,countryCode:t.countryCode}:null}}});case"sms_otp/send_error":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:t.error,codeExpiration:e.mfa.smsOtp.codeExpiration??new Date(Date.now()-1e3)}}};case"sms_otp/format_destination":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,formattedDestination:t.formattedPhoneNumber}}};case"sms_otp/authenticate_success":case"recovery_code/authenticate_success":case"recovery_code/save_acknowledge":return aq(e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:ae});case"totp/authenticate_success":return aq(e.mfa.isEnrolling?am:e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:e.mfa.isEnrolling?e.mfa:ae});case"totp/create":if(e.mfa.totp.isCreating)return e;return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,isCreating:!0,createError:null}}};case"totp/create_success":if(!e.mfa.isEnrolling||e.mfa.primaryInfo?.memberId!==t.memberId||e.mfa.primaryInfo?.organizationId!==t.organizationId)return e;return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,createError:null,isCreating:!1,enrollment:{secret:t.response.secret,qrCode:t.response.qr_code,recoveryCodes:t.response.recovery_codes,method:e.mfa.totp.enrollment?.method??"qr"}}}};case"totp/create_error":return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,isCreating:!1,createError:t.error}}};case"totp/show_code":{if(!e.mfa.isEnrolling||!e.mfa.totp.enrollment)return e;let r=t.method??e.mfa.totp.enrollment.method??"qr";return aF("manual"===r?ag:af,{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{...e.mfa.totp.enrollment,method:r}}}})}default:return e}})(e,t)}},aV={screen:at,screenHistory:[],formState:{emailState:{userSuppliedEmail:""},otpState:{codeExpiration:null},discoveryState:{email:"",discoveredOrganizations:[]},passwordState:{email:""},ssoDiscoveryState:{connections:[]}},flowState:{type:s.Organization,organization:null},mfa:ae,primary:{},error:{type:az,canGoBack:!1}},aW=rZ.createContext({client:{},config:{},state:[aV,()=>null]}),aG=({children:e,client:t,config:r,callbacks:n,initialState:a})=>{let o=rZ.useReducer(a$,a??aV);return rZ.createElement(aW.Provider,{value:{client:t,state:o,config:r,callbacks:n}},e)},aY=()=>n7(t2(aW).callbacks?.onError??n6),aZ=()=>n7(t2(aW).callbacks?.onEvent??n6),aJ=e=>{let t,r,n=!1,a=[],o={};return"string"==typeof e?r=e:(r=e.type,e.type===c.Google&&e.one_tap&&(n=e.one_tap,t=e.cancel_on_tap_outside),a=e.customScopes||[],o=e.providerParams||{}),{type:r,one_tap:n,customScopes:a,providerParams:o,cancel_on_tap_outside:t}};var aQ={exports:{}},aX={},a1=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(rJ),a0=(ed||(ed=1,ec||(ec=1,!function(){function e(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=a1.useState,n=a1.useEffect,a=a1.useLayoutEffect,o=a1.useDebugValue,i=!1,s=!1,l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(l,c){i||void 0===a1.startTransition||(i=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=c();if(!s){var u=c();t(d,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var h=(u=r({inst:{value:d,getSnapshot:c}}))[0].inst,m=u[1];return a(function(){h.value=d,h.getSnapshot=c,e(h)&&m({inst:h})},[l,d,c]),n(function(){return e(h)&&m({inst:h}),l(function(){e(h)&&m({inst:h})})},[l]),o(d),d};aX.useSyncExternalStore=void 0!==a1.useSyncExternalStore?a1.useSyncExternalStore:l,"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),aQ.exports=aX),aQ.exports);let a2=new WeakMap,a3={},a4={},a5=()=>{},a8=a5(),a6=Object,a9=e=>e===a8,a7=(e,t)=>({...e,...t}),oe="undefined",ot=typeof window!=oe,or=typeof document!=oe,on=(e,t)=>{let r=a2.get(e);return[()=>e.get(t)||a3,n=>{if(!a9(t)){let a=e.get(t);t in a4||(a4[t]=a),r[5](t,a7(a,n),a||a3)}},r[6],()=>!a9(t)&&t in a4?a4[t]:e.get(t)||a3]},oa=new WeakMap,oo=0,oi=e=>{let t,r,n=typeof e,a=e&&e.constructor,o=a==Date;if(a6(e)!==e||o||a==RegExp)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=oa.get(e))return t;if(t=++oo+"~",oa.set(e,t),a==Array){for(r=0,t="@";r<e.length;r++)t+=oi(e[r])+",";oa.set(e,t)}if(a==a6){t="#";let n=a6.keys(e).sort();for(;!a9(r=n.pop());)a9(e[r])||(t+=r+":"+oi(e[r])+",");oa.set(e,t)}}return t},os=!0,[ol,oc]=ot&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[a5,a5],od={initFocus:e=>(or&&document.addEventListener("visibilitychange",e),ol("focus",e),()=>{or&&document.removeEventListener("visibilitychange",e),oc("focus",e)}),initReconnect:e=>{let t=()=>{os=!0,e()},r=()=>{os=!1};return ol("online",t),ol("offline",r),()=>{oc("online",t),oc("offline",r)}}},ou=!rZ.useId,oh=!ot||"Deno"in window,om=oh?tZ:tJ,op="u">typeof navigator&&navigator.connection,o_=!oh&&op&&(["slow-2g","2g"].includes(op.effectiveType)||op.saveData),og=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?oi(e):"",t]},of=0,oy=()=>++of;async function ov(...e){let[t,r,n,a]=e,o=a7({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),i=o.populateCache,s=o.rollbackOnError,l=o.optimisticData,c=!1!==o.revalidate,d=o.throwOnError;if("function"==typeof r){let e=[],n=t.keys();for(let a=n.next();!a.done;a=n.next()){let n=a.value;!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n)}return Promise.all(e.map(u))}return u(r);async function u(r){let a,[o]=og(r);if(!o)return;let[u,h]=on(t,o),[m,p,_]=a2.get(t),g=m[o],f=()=>c&&(delete _[o],g&&g[0])?g[0](2).then(()=>u().data):u().data;if(e.length<3)return f();let y=n,v=oy();p[o]=[v,0];let b=!a9(l),w=u(),k=w.data,S=w._c,E=a9(S)?k:S;if(b&&h({data:l="function"==typeof l?l(E):l,_c:E}),"function"==typeof y)try{y=y(E)}catch(e){a=e}if(y&&"function"==typeof y.then){let e;if(y=await y.catch(e=>{a=e}),v!==p[o][0]){if(a)throw a;return y}a&&b&&(e=a,"function"==typeof s?s(e):!1!==s)&&(i=!0,h({data:y=E,_c:a8}))}i&&!a&&("function"==typeof i&&(y=i(y,E)),h({data:y,_c:a8})),p[o][1]=oy();let C=await f();if(h({_c:a8}),a){if(d)throw a;return}return i?C:y}}let ob=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},[ow,ok]=((e,t)=>{if(!a2.has(e)){let r=a7(od,t),n={},a=ov.bind(a8,e),o=a5,i={},s=(e,t)=>{let r=i[e]||[];return i[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let a=i[t];if(a)for(let e of a)e(r,n)},c=()=>{if(!a2.has(e)&&(a2.set(e,[n,{},{},{},a,l,s]),!oh)){let t=r.initFocus(setTimeout.bind(a8,ob.bind(a8,n,0))),a=r.initReconnect(setTimeout.bind(a8,ob.bind(a8,n,1)));o=()=>{t&&t(),a&&a(),a2.delete(e)}}};return c(),[e,a,c,o]}return[e,a2.get(e)[4]]})(new Map),oS=a7({onLoadingSlow:a5,onSuccess:a5,onError:a5,onErrorRetry:(e,t,r,n,a)=>{let o=r.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(a9(o)||!(i>o))&&setTimeout(n,s,a)},onDiscarded:a5,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:o_?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:o_?5e3:3e3,compare:(e,t)=>oi(e)==oi(t),isPaused:()=>!1,cache:ow,mutate:ok,fallback:{}},{isOnline:()=>os,isVisible:()=>{let e=or&&document.visibilityState;return a9(e)||"hidden"!==e}}),oE=tI({}),oC=ot&&window.__SWR_DEVTOOLS_USE__,oP=oC?window.__SWR_DEVTOOLS_USE__:[],oT=e=>"function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],oO=oP.concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let n=og(t)[0],[,,,a]=a2.get(ow),o=a[n];return o?(delete a[n],o):r(...e)});return e(t,a,n)});oC&&(window.__SWR_DEVTOOLS_REACT__=rZ);let oA={dedupe:!0};var ox=(r=(e,t,r)=>{let{cache:n,compare:a,suspense:o,fallbackData:i,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:h}=r,[m,p,_]=a2.get(n),[g,f]=og(e),y=tQ(!1),v=tQ(!1),b=tQ(g),w=tQ(t),k=tQ(r),S=()=>k.current.isVisible()&&k.current.isOnline(),[E,C,P,T]=on(n,g),O=tQ({}).current,A=a9(i)?r.fallback[g]:i,x=(e,t)=>{let r=!0;for(let n in O)"data"===n?!a(t[n],e[n])&&(a9(e[n])&&a(t[n],U)||(r=!1)):t[n]!==e[n]&&(r=!1);return r},D=t1(()=>{let e=!!g&&!!t&&(a9(s)?!k.current.isPaused()&&!o&&(!!a9(l)||l):s),r=t=>{let r=a7(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=E(),a=T(),i=r(n),c=n===a?i:r(a),d=i;return[()=>{let e=r(E());return x(e,d)?d:d=e},()=>c]},[n,g]),z=a0.useSyncExternalStore(t0(e=>P(g,(t,r)=>{x(r,t)||e()}),[n,g]),D[0],D[1]),M=!y.current,I=m[g]&&m[g].length>0,R=z.data,L=a9(R)?A:R,B=z.error,N=tQ(L),U=h?a9(R)?N.current:R:L,F=(!I||!!a9(B))&&(M&&!a9(s)?s:!k.current.isPaused()&&(o?!a9(L)&&l:a9(L)||l)),q=!!(g&&t&&M&&F),H=a9(z.isValidating)?q:z.isValidating,K=a9(z.isLoading)?q:z.isLoading,j=t0(async e=>{let t,n,o=w.current;if(!g||!o||v.current||k.current.isPaused())return!1;let i=!0,s=e||{},l=!_[g]||!s.dedupe,c=()=>ou?!v.current&&g===b.current&&y.current:g===b.current,d={isValidating:!1,isLoading:!1},u=()=>{C(d)},h=()=>{let e=_[g];e&&e[1]===n&&delete _[g]},P={isValidating:!0};a9(E().data)&&(P.isLoading=!0);try{if(l&&(C(P),r.loadingTimeout&&a9(E().data)&&setTimeout(()=>{i&&c()&&k.current.onLoadingSlow(g,r)},r.loadingTimeout),_[g]=[o(f),oy()]),[t,n]=_[g],t=await t,l&&setTimeout(h,r.dedupingInterval),!_[g]||_[g][1]!==n)return l&&c()&&k.current.onDiscarded(g),!1;d.error=a8;let e=p[g];if(!a9(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return u(),l&&c()&&k.current.onDiscarded(g),!1;let s=E().data;d.data=a(s,t)?s:t,l&&c()&&k.current.onSuccess(t,g,r)}catch(r){h();let e=k.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&c())&&(e.onError(r,g,e),(!0===t||"function"==typeof t&&t(r))&&S()&&e.onErrorRetry(r,g,e,e=>{let t=m[g];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))}return i=!1,u(),!0},[g,n]),$=t0((...e)=>ov(n,b.current,...e),[]);if(om(()=>{w.current=t,k.current=r,a9(R)||(N.current=R)}),om(()=>{var e;let t;if(!g)return;let r=j.bind(a8,oA),n=0,a=(e=(e,t={})=>{if(0==e){let e=Date.now();k.current.revalidateOnFocus&&e>n&&S()&&(n=e+k.current.focusThrottleInterval,r())}else if(1==e)k.current.revalidateOnReconnect&&S()&&r();else if(2==e)return j();else if(3==e)return j(t)},(t=m[g]||(m[g]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(v.current=!1,b.current=g,y.current=!0,C({_k:f}),F)if(a9(L)||oh)r();else ot&&typeof window.requestAnimationFrame!=oe?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{v.current=!0,a()}},[g]),om(()=>{let e;function t(){let t="function"==typeof c?c(L):c;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!E().error&&(d||k.current.isVisible())&&(u||k.current.isOnline())?j(oA).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[c,d,u,g]),t3(U),o&&a9(L)&&g){if(!ou&&oh)throw Error("Fallback data is required when using suspense in SSR.");throw w.current=t,k.current=r,v.current=!1,a9(B)?j(oA):B}return{mutate:$,get data(){return O.data=!0,U},get error(){return O.error=!0,B},get isValidating(){return O.isValidating=!0,H},get isLoading(){return O.isLoading=!0,K}}},function(...e){let t=a7(oS,t2(oE)),[n,a,o]=oT(e),i=((e,t)=>{let r=a7(e,t);if(t){let{use:n,fallback:a}=e,{use:o,fallback:i}=t;n&&o&&(r.use=n.concat(o)),a&&i&&(r.fallback=a7(a,i))}return r})(t,o),s=r,{use:l}=i,c=(l||[]).concat(oO);for(let e=c.length;e--;)s=c[e](s);return s(n,a||i.fetcher||null,i)}),oD=(n=()=>(e,t,r={})=>{var n;let a,o,i,s,l,{mutate:c}=a7(oS,t2(oE)),d=tQ(e),u=tQ(t),h=tQ(r),m=tQ(0),[p,_,g]=(n={data:a8,error:a8,isMutating:!1},a=tG({})[1],o=tQ(!1),i=tQ(n),s=tQ({data:!1,error:!1,isValidating:!1}),l=t0(e=>{let t=!1,r=i.current;for(let n in e)r[n]!==e[n]&&(r[n]=e[n],s.current[n]&&(t=!0));t&&!o.current&&(ou?a({}):rZ.startTransition(()=>a({})))},[]),om(()=>(o.current=!1,()=>{o.current=!0})),[i,s.current,l]),f=p.current,y=t0(async(e,t)=>{let[r,n]=og(d.current);if(!u.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!r)throw Error("Can’t trigger the mutation: missing key.");let a=a7(a7({populateCache:!1,throwOnError:!0},h.current),t),o=oy();m.current=o,g({isMutating:!0});try{let t=await c(r,u.current(n,{arg:e}),a7(a,{throwOnError:!0}));return m.current<=o&&(g({data:t,isMutating:!1,error:void 0}),null==a.onSuccess||a.onSuccess(t,r,a)),t}catch(e){if(m.current<=o&&(g({error:e,isMutating:!1}),null==a.onError||a.onError(e,r,a),a.throwOnError))throw e}},[]),v=t0(()=>{m.current=oy(),g({data:a8,error:a8,isMutating:!1})},[]);return om(()=>{d.current=e,u.current=t,h.current=r}),{trigger:y,reset:v,get data(){return _.data=!0,f.data},get error(){return _.error=!0,f.error},get isMutating(){return _.isMutating=!0,f.isMutating}}},(...e)=>{let[t,r,a]=oT(e),o=(a.use||[]).concat(n);return ox(t,r,{...a,use:o})});let oz={"stytch.magicLinks.authenticate":eu.B2BMagicLinkAuthenticate,"stytch.sso.authenticate":eu.B2BSSOAuthenticate,"stytch.sso.discoverConnections":eu.B2BSSODiscoverConnections,"stytch.magicLinks.discovery.authenticate":eu.B2BMagicLinkDiscoveryAuthenticate,"stytch.discovery.organizations.create":eu.B2BDiscoveryOrganizationsCreate,"stytch.discovery.intermediateSessions.exchange":eu.B2BDiscoveryIntermediateSessionExchange,"stytch.magicLinks.email.loginOrSignup":eu.B2BMagicLinkEmailLoginOrSignup,"stytch.magicLinks.email.discovery.send":eu.B2BMagicLinkEmailDiscoverySend,"stytch.oauth.authenticate":eu.B2BOAuthAuthenticate,"stytch.oauth.discovery.authenticate":eu.B2BOAuthDiscoveryAuthenticate,"stytch.otps.sms.send":eu.B2BSMSOTPSend,"stytch.otps.sms.authenticate":eu.B2BSMSOTPAuthenticate,"stytch.totp.create":eu.B2BTOTPCreate,"stytch.totp.authenticate":eu.B2BTOTPAuthenticate,"stytch.recoveryCodes.recover":eu.B2BRecoveryCodesRecover,"stytch.impersonation.authenticate":eu.B2BImpersonationAuthenticate,"stytch.otps.email.authenticate":eu.B2BOTPsEmailAuthenticate,"stytch.otps.email.discovery.authenticate":eu.B2BOTPsEmailDiscoveryAuthenticate,"stytch.otps.email.discovery.send":eu.B2BOTPsEmailDiscoverySend,"stytch.otps.email.loginOrSignup":eu.B2BOTPsEmailLoginOrSignup,"stytch.organization.getBySlug":eu.B2BOrganizationsGetBySlug},oM=(e,t,r={})=>{let n=aZ(),a=aY(),o=oD(e,t,{throwOnError:!1,...r,onSuccess:(e,t,a)=>{let o=oz[t];o&&n({type:o,data:e}),r.onSuccess?.(e,t,a)},onError:(e,t,n)=>{a(e),r.onError?.(e,t,n)}});return o.isMutating?{...o,error:void 0}:o},oI=()=>{let e=t2(aW).client,[t,r]=tG(r1(e).bootstrap.getSync());return tZ(()=>{r1(e).bootstrap.getAsync().then(e=>{r(e)})},[e]),t},oR=(e,t,r)=>{t({type:"primary_authenticate_success",response:e,includedMfaMethods:r.mfaProductInclude})},oL=(e,t)=>{t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})};function oB(e,t){return e.some(e=>e.id===t)}function oN({products:e,organizationProducts:t},r){return t1(()=>{let n={};for(let a of[...e,...t])a[r]&&Object.assign(n,a[r]);return n},[e,t,r])}let oU=()=>{let e=t2(aW).config;return t1(()=>{let t=e.oauthOptions?aJ(e.oauthOptions?.providers[0]):void 0,r=t?.type===c.Google&&t?.one_tap===!0;return 1===e.products.length&&oB(e.products,"oauth")&&e.oauthOptions?.providers.length===1&&r},[e])},oF=(e,t)=>`stytch_sdk_state_${e}${t?`::${t}`:""}`;function oq(e){return null==e?{getItem:()=>null,removeItem(){},setItem(){}}:{getItem(t,r){let n=oF(t,r);try{return e.getItem(n)}catch{return null}},setItem(t,r,n){let a=oF(t,r);try{n&&e.setItem(a,n)}catch{}},removeItem(t,r){let n=oF(t,r);try{e.removeItem(n)}catch{}}}}let oH=oq(globalThis.localStorage),oK=oq(globalThis.sessionStorage);function oj(e,t){return{getItem:r=>e.getItem(t,r),setItem(r,n){e.setItem(t,r,n)},removeItem(r){e.removeItem(t,r)}}}function o$(){let{publicToken:e}=r1(t2(aW).client);return[t1(()=>oH.getItem(e,"b2b_last_used_method"),[e]),t=>{oH.setItem(e,"b2b_last_used_method",t)}]}nW(".Button_module_button__fba1165e{align-items:center;border:1px solid;border-radius:var(--st-button-radius);box-shadow:var(--st-shadow-button);display:flex;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);gap:var(--st-spacing-2);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);transition:background-color var(--st-transition-duration) ease-in-out,border-color var(--st-transition-duration) ease-in-out}.-st-mobile .Button_module_button__fba1165e{padding:var(--st-spacing-3)}.Button_module_button__fba1165e:focus-visible{box-shadow:var(--st-shadow-button),var(--st-focus-ring-shadow)}.Button_module_button__fba1165e:not(:disabled){cursor:pointer}.Button_module_button__fba1165e:disabled{opacity:.5}.Button_module_block__fba1165e{justify-content:center;width:100%}.Button_module_primary__fba1165e{background-color:var(--st-primary);border-color:var(--st-primary);color:var(--st-primary-foreground)}.Button_module_primary__fba1165e:not(:disabled):hover{background-color:var(--st-primary-button-hover);border-color:var(--st-primary-button-hover)}.Button_module_secondary__fba1165e{background-color:var(--st-secondary);border-color:var(--st-secondary);color:var(--st-secondary-foreground)}.Button_module_secondary__fba1165e:not(:disabled):hover{background-color:var(--st-secondary-button-hover);border-color:var(--st-secondary-button-hover)}.Button_module_outline__fba1165e{background-color:var(--st-background);border:1px solid var(--st-border);color:var(--st-foreground)}.Button_module_outline__fba1165e:not(:disabled):hover{background-color:var(--st-accent);color:var(--st-accent-foreground)}.Button_module_outline__fba1165e:focus-visible{border-color:var(--st-ring)}.Button_module_ghost__fba1165e{background-color:var(--st-background);border:1px solid var(--st-background);box-shadow:none;color:var(--st-foreground)}.Button_module_ghost__fba1165e:not(:disabled):hover{background-color:var(--st-accent);border-color:var(--st-background);color:var(--st-accent-foreground)}.Button_module_ghost__fba1165e:focus-visible{box-shadow:var(--st-focus-ring-shadow)}.Button_module_destructive__fba1165e{background-color:var(--st-destructive);border-color:var(--st-destructive);color:var(--st-destructive-foreground)}.Button_module_destructive__fba1165e:not(:disabled):hover{background-color:var(--st-destructive-button-hover);border-color:var(--st-destructive-button-hover)}");var oV={button:"Button_module_button__fba1165e inputBase_module_focusRing__06c14ae4",block:"Button_module_block__fba1165e",primary:"Button_module_primary__fba1165e",secondary:"Button_module_secondary__fba1165e",outline:"Button_module_outline__fba1165e",ghost:"Button_module_ghost__fba1165e",destructive:"Button_module_destructive__fba1165e"};nW("@keyframes CircularProgress_module_circularRotate__c4a435cb{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes CircularProgress_module_circularDash__c4a435cb{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:1px,200px;stroke-dashoffset:-126px}}.CircularProgress_module_root__c4a435cb{animation:CircularProgress_module_circularRotate__c4a435cb 1.4s linear infinite}.CircularProgress_module_svg__c4a435cb{display:block}.CircularProgress_module_animatedCircle__c4a435cb{animation:CircularProgress_module_circularDash__c4a435cb 1.4s ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px,200px;stroke-dashoffset:0}");let oW=({size:e,label:t,thickness:r=3.6})=>{let{i18n:n,_:a}=nO();return rZ.createElement("div",{className:"CircularProgress_module_root__c4a435cb",style:{width:e,height:e}},rZ.createElement("svg",{className:"CircularProgress_module_svg__c4a435cb",viewBox:"22 22 44 44","aria-label":t??n._({id:"loading.label",message:"Loading"})},rZ.createElement("circle",{className:"CircularProgress_module_animatedCircle__c4a435cb",cx:44,cy:44,r:(44-r)/2,fill:"none",strokeWidth:r})))};function oG({variant:e,block:t=!0}){return nj(oV.button,oV[e],{[oV.block]:t})}let oY=e=>{let{as:t,children:r,icon:n,onClick:a,loading:o,disabled:i=o,block:s,variant:l,...c}=e,d=rZ.createElement(rZ.Fragment,null,n,rZ.createElement("span",null,r));return o&&(d=rZ.createElement(oW,{size:20})),rZ.createElement(t,{className:oG(e),onClick:a,disabled:i,...c},d)},oZ=e=>oY({type:"button",as:"button",...e}),oJ=e=>oY({...e,onKeyDown:t=>{e.onKeyDown?.(t),t.defaultPrevented||" "===t.key&&t.currentTarget.click()},as:"a"}),oQ={[c.Google]:{messageDescriptor:{id:"oauth.continueWithGoogle",message:"Continue with Google"}},[c.Microsoft]:{messageDescriptor:{id:"oauth.continueWithMicrosoft",message:"Continue with Microsoft"}},[c.HubSpot]:{messageDescriptor:{id:"oauth.continueWithHubSpot",message:"Continue with HubSpot"}},[c.Slack]:{messageDescriptor:{id:"oauth.continueWithSlack",message:"Continue with Slack"}},[c.GitHub]:{messageDescriptor:{id:"oauth.continueWithGitHub",message:"Continue with GitHub"}}},oX=({providerType:e,loginRedirectUrl:t,signupRedirectUrl:r,discoveryRedirectUrl:n,customScopes:a,providerParams:o,onSuccess:i})=>{let{i18n:s,_:l}=nO(),c=t2(aW).client,[d]=t2(aW).state,u=t2(nq),h=u.iconRegistry,m=nH(`oauth-${e}`,u.options),p=oQ[e],_=e,g=null;if(p){let{messageDescriptor:t}=p,r=h[e];_=s._(t),g=rZ.createElement(r,null)}let f=async()=>{let s=c.oauth[e];d.flowState.organization?await s.start({login_redirect_url:t,signup_redirect_url:r,custom_scopes:a,organization_id:d.flowState.organization.organization_id,provider_params:o}):await s.discovery.start({discovery_redirect_url:n,custom_scopes:a,provider_params:o}),i?.()};return rZ.createElement(oZ,{onClick:f,variant:"outline",icon:g,id:m},_)},o1=({customScopes:e,providerParams:t,cancelOnTapOutside:r})=>{let n,a=t2(aW).client,o=t2(aW).config,i=oU(),[s,l]=tG(),d=(n=tQ(!1),tZ(()=>(n.current=!0,()=>{n.current=!1}),[]),n),[u,h]=t2(aW).state,[m,p]=o$(),_=t0(async()=>{let e,{oneTap:t}=r1(a),n=await t.createOneTapClient();if(!n.success)return void("oauth_config_not_found"===n.reason?l(n2):"default_provider_not_allowed"===n.reason?l(n3):eP("Unable to load One Tap settings for project",n));let{client:i}=n;if(!d.current)return;e=u.flowState.organization?t.createOnSuccessHandler({organizationId:u.flowState.organization.organization_id,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})}):t.createOnDiscoverySuccessHandler({discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})});let s=await i.render({callback:e,style:{position:er.floating},cancelOnTapOutside:r});return d.current?(s.success||("unregistered_origin"===s.reason&&l(n1),"invalid_client"===s.reason&&l(n0),eP("Unable to render One Tap prompt",s)),i):void i.cancel()},[a,d,u.flowState.organization,o.oauthOptions?.signupRedirectURL,o.oauthOptions?.loginRedirectURL,o.oauthOptions?.discoveryRedirectURL,h,r]);if(tZ(()=>{let e;return _().then(t=>e=t).catch(e=>{eP("Unable to render One Tap prompt",e)}),()=>e?.cancel()},[_]),i)return null;let g=rZ.createElement(oX,{providerType:c.Google,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,customScopes:e,providerParams:t,onSuccess:()=>p(c.Google)}),f=m===c.Google?rZ.createElement(nQ,null,g):g;return s?rZ.createElement(rZ.Fragment,null,rZ.createElement(n4,{error:s}),f):f};nW(".logo_module_darkInvert__4ffe6ba9{filter:invert(var(--st-dark-mode,0))}");var o0="logo_module_darkInvert__4ffe6ba9";let o2=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#4285F4",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#34A853",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#FBBC05",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#EA4335",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),o3=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#F35325",d:"M1 1h8.57v8.57H1z"}),tm("path",{fill:"#81BC06",d:"M10.43 1H19v8.57h-8.57z"}),tm("path",{fill:"#05A6F0",d:"M1 10.43h8.57V19H1z"}),tm("path",{fill:"#FFBA08",d:"M10.43 10.43H19V19h-8.57z"})),o4={gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#C5221F",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09"}),tm("path",{fill:"#FBBC04",d:"m14.9 4.48-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#4285F4",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22"}),tm("path",{fill:"#34A853",d:"M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8z"}),tm("path",{fill:"#EA4335",d:"M10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{clipPath:"url(#a)"},tm("path",{fill:"#158FDA",d:"M6.58 17.2h10.25c1.2 0 2.17-.97 2.17-2.17V7.7c0-.64-.32-1.22-.87-1.54L12.77 3.1c-.72-.4-1.6-.4-2.3 0L4.39 6.6V15c0 1.21.98 2.2 2.2 2.2"}),tm("path",{fill:"url(#b)",d:"M8.61 15.82c.06-.66.48-1.24 1.09-1.5 0 0 5.55-3.11 8.3-4.73.85-.5 1-1.5 1-1.5V15a2.2 2.2 0 0 1-2.2 2.2h-6.65c-.8 0-1.46-.6-1.54-1.4"}),tm("path",{fill:"#01459B",d:"m17.83 5.96-9.55 5.27 1.9 1.16c.71.42 1.74.66 2.46.25l5.08-2.85A2.3 2.3 0 0 0 19 7.69c0-1.1-.76-1.47-1.17-1.73"}),tm("path",{fill:"#26AEE9",d:"M11.67 2.81q-.63 0-1.21.32L2.4 7.68l3.06 1.85 9.37-5.28-1.95-1.11q-.57-.33-1.2-.33"}),tm("path",{fill:"#0078D3",d:"M14.83 4.25 5.46 9.53l3.06 1.86 9.56-5.27-.25-.16z"}),tm("path",{fill:"url(#c)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"}),tm("g",{filter:"url(#d)"},tm("path",{fill:"url(#e)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"})),tm("path",{fill:"#fff",d:"M3.46 8.58q.28-.6.84-.94.64-.36 1.36-.36.69-.02 1.27.3.56.3.85.87.32.6.32 1.3.02.7-.28 1.36a2.2 2.2 0 0 1-1.1 1.06q-.52.21-1.05.21-.7.03-1.3-.3-.57-.3-.86-.87-.32-.6-.32-1.28-.02-.7.27-1.35m.95 2.15q.16.37.5.6t.75.21q.45 0 .8-.24.33-.24.47-.62.15-.41.13-.85 0-.44-.15-.85a1.4 1.4 0 0 0-.47-.63 1.3 1.3 0 0 0-.8-.23 1.3 1.3 0 0 0-1.25.86c-.22.57-.2 1.2.02 1.75"})),tm("defs",null,tm("linearGradient",{id:"b",x1:12.02,x2:19,y1:15.58,y2:12.64,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#4DE2FB"}),tm("stop",{offset:1,stopColor:"#28AEE8"})),tm("linearGradient",{id:"c",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("linearGradient",{id:"e",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M0 0h20v20H0z"})),tm("filter",{id:"d",width:53.58,height:53.4,x:-15.16,y:-10.87,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},tm("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),tm("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),tm("feOffset",{dx:6,dy:6}),tm("feGaussianBlur",{stdDeviation:11.14}),tm("feComposite",{in2:"hardAlpha",operator:"out"}),tm("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.38 0"}),tm("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_893_1954"}),tm("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_893_1954",result:"shape"})))),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#5F01D2",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"}))},o5=20,o8=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("path",{d:"M9.09 7.91L13.67 12.5L9.09 17.09L10.5 18.5L16.5 12.5L10.5 6.5L9.09 7.91Z",fill:"currentColor"})),o6=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("g",{clipPath:"url(#clip0_221_1596)"},rZ.createElement("path",{d:"M17.5125 10.53C17.0025 7.9425 14.73 6 12 6C9.8325 6 7.95 7.23 7.0125 9.03C4.755 9.27 3 11.1825 3 13.5C3 15.9825 5.0175 18 7.5 18H17.25C19.32 18 21 16.32 21 14.25C21 12.27 19.4625 10.665 17.5125 10.53Z",fill:"currentColor"})),rZ.createElement("g",{clipPath:"url(#clip1_221_1596)"},rZ.createElement("path",{d:"M15.9684 13.1139L14.9987 14.0933L14.5152 13.6098L14.2501 13.3446L13.9849 13.6098L13.5001 14.0946L13.0152 13.6098L12.9054 13.4999H12.7501H12.6188H12.3532L12.2651 13.7504C12.0087 14.4788 11.3147 14.9999 10.5001 14.9999C9.46592 14.9999 8.62506 14.1591 8.62506 13.1249C8.62506 12.0908 9.46592 11.2499 10.5001 11.2499C11.3147 11.2499 12.0087 11.7711 12.2651 12.4994L12.3532 12.7499H12.6188H15.5969L15.9684 13.1139ZM9.00006 13.1249C9.00006 13.9508 9.6742 14.6249 10.5001 14.6249C11.3259 14.6249 12.0001 13.9508 12.0001 13.1249C12.0001 12.2991 11.3259 11.6249 10.5001 11.6249C9.6742 11.6249 9.00006 12.2991 9.00006 13.1249Z",fill:"var(--st-background)",stroke:"var(--st-background)",strokeWidth:"0.75"})),rZ.createElement("defs",null,rZ.createElement("clipPath",{id:"clip0_221_1596"},rZ.createElement("rect",{width:"18",height:"18",transform:"translate(3 3)"})),rZ.createElement("clipPath",{id:"clip1_221_1596"},rZ.createElement("rect",{width:"8.25",height:"6",transform:"translate(8.25006 10.1251)"})))),o9={"google-workspace":"google","microsoft-entra":"microsoft",okta:"okta"},o7=({connection:e,onStart:t})=>{let{i18n:r,_:n}=nO(),a=t2(aW).client,{ssoOptions:o}=t2(aW).config,{iconRegistry:i,options:s}=t2(nq),{connection_id:l,display_name:c,identity_provider:d}=e,u=nH(`sso-${c}`,s),h=i[o9[d]]??o6;return rZ.createElement(oZ,{variant:"outline",onClick:()=>a.sso.start({connection_id:l,signup_redirect_url:o?.signupRedirectURL,login_redirect_url:o?.loginRedirectURL}).then(()=>{t?.(e)}),icon:rZ.createElement(h,null),id:u},r._({id:"provider.continueWith",message:"Continue with {display_name}",values:{display_name:c}}))};function ie(){let[e,t]=tG(0);return{expiration:e,start:e=>{t(Date.now()+1e3*e)},clear:()=>{t(0)}}}let it=e=>Math.max(0,Math.ceil((e-Date.now())/1e3)),ir=e=>{let[t,r]=tG(()=>it(e)),n=t<=0;return tZ(()=>{let t=()=>r(it(e));if(t(),Date.now()>=e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[n,e]),[t,!n]},ia=()=>{let e;return(e="u">typeof window&&window)&&(/Chromatic/.test(e.navigator.userAgent)||/chromatic=true/.test(e.location.href))?"chromatic-ignore":void 0};nW(".VerticalTransition_module_container__9366f503{display:grid;overflow:clip;width:fit-content}.VerticalTransition_module_primary__9366f503,.VerticalTransition_module_secondary__9366f503{grid-area:1/1/2/2;transition:translate var(--st-transition-duration) ease-in-out}.VerticalTransition_module_secondary__9366f503{translate:0 100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_primary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_primary__9366f503{translate:0 -100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_secondary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_secondary__9366f503{translate:0 0}");function io(e){let[t,r]=tG(!1);return tZ(()=>{if(!t||!e)return;let n=setTimeout(()=>r(!1),1e3*e);return()=>clearTimeout(n)},[t,e]),[t,r]}let ii=({primary:e,secondary:t,rootClassName:r,className:n,trigger:a="manual",triggered:o})=>rZ.createElement("div",{className:nj(r,"VerticalTransition_module_container__9366f503",{VerticalTransition_module_triggered__9366f503:o,VerticalTransition_module_canTriggerByHover__9366f503:"hover"===a}),"aria-live":"manual"===a?"polite":void 0},rZ.createElement("div",{className:nj(n,"VerticalTransition_module_primary__9366f503"),"aria-hidden":"manual"===a?o:void 0},e),rZ.createElement("div",{className:nj(n,"VerticalTransition_module_secondary__9366f503"),"aria-hidden":"manual"===a?!o:void 0},t)),is=e=>{if(e&&"object"==typeof e&&"error_type"in e&&"string"==typeof e.error_type)return e.error_type},il={invalid_email:{id:"error.invalidEmail",message:"Email format is invalid."},invalid_phone_number:{id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:"error.unsubscribedPhoneNumber",message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:"error.inactiveEmail",message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:"error.unauthorizedCredentials",message:"Unauthorized credentials."},user_unauthenticated:{id:"error.userUnauthenticated",message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:"error.emailNotFound",message:"Email not found."},unable_to_auth_magic_link:{id:"error.unableToAuthMagicLink",message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:"error.noUserPassword",message:"Password not found for this user. Please try again."},breached_password:{id:"error.breachedPassword",message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:"error.resetPassword",message:"Password must be reset."},oauth_token_not_found:{id:"error.oauthTokenNotFound",message:"OAuth Token could not be found."},invalid_code:{id:"error.invalidCode",message:"Code format is invalid, please try again."},member_password_not_found:{id:"error.memberPasswordNotFound",message:"Member password not found."},oauth_flow_callback_error:{id:"error.oauthFlowCallbackError",message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:"error.unauthorizedAction",message:"Unauthorized action."},user_lock_limit_reached:{id:"error.userLockLimitReached",message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:"error.invalidSessionToken",message:"Invalid session token."},session_not_found:{id:"error.sessionNotFound",message:"Session not found."},invalid_phone_number_country_code:{id:"error.invalidPhoneNumberCountryCode",message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:"error.otpCodeNotFound",message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:"error.duplicatePhoneNumber",message:"A member with the specified phone number already exists for this organization."}},ic=(e,t)=>{let r=il[is(e)];return r?t(r):e.error_message};nW(".Column_module_column__efe9ce44{display:flex;flex-direction:column}");let id=rs(({as:e="div",gap:t,className:r,style:n,...a},o)=>{let i={...n};return null!=t&&(i.gap=1===t?"var(--st-spacing)":`var(--st-spacing-${t})`),rZ.createElement(e,{ref:o,className:nj(r,"Column_module_column__efe9ce44"),style:i,...a})});function iu(e){var t;let r;return Number.isNaN(r=parseFloat(t=window.getComputedStyle(e).getPropertyValue("--st-transition-duration")))?0:t.endsWith("ms")?r:1e3*r}nW(".Toast_module_container__ac93617f{bottom:10vh;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0}.Toast_module_toast__ac93617f{background:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-md);box-shadow:0 2px 4px rgba(0,0,0,.05);color:var(--st-destructive);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);pointer-events:auto;position:absolute;top:0;white-space:pre}");let ih=[];function im(e){for(let t of ih)t(e)}let ip={opacity:0,translate:"0 var(--st-spacing-2)"},i_={opacity:1,translate:"0"};function ig(e,t){e.animate([i_,ip],{duration:t,easing:"ease-in-out"}).addEventListener("finish",()=>e.remove())}let iy=()=>{let e=tQ(null),t=tQ(),r=tQ();return tZ(()=>{let n=n=>{if(!e.current)return;let a=2*iu(e.current),o=document.createElement("div");o.textContent=n.message,o.className="Toast_module_toast__ac93617f",t.current&&ig(t.current,a),e.current.appendChild(o),t.current=o,o.animate([ip,i_],{duration:a,easing:"ease-in-out"}),r.current=window.setTimeout(()=>{t.current&&(ig(t.current,a),t.current=void 0)},n.durationMs??1e4)};return ih.push(n),()=>{clearTimeout(r.current);let e=ih.indexOf(n);-1!==e&&ih.splice(e,1)}},[]),rZ.createElement("div",{className:"Toast_module_container__ac93617f",ref:e,"aria-live":"polite"})};nW(".Divider_module_container__1fb7194e{align-items:center;display:flex;gap:var(--st-spacing-2);line-height:var(--st-line-height-xs)}.Divider_module_bar__1fb7194e{border-bottom:1px solid var(--st-divider-color);flex:1 1 auto}");var iv="Divider_module_bar__1fb7194e";let ib=()=>{let{i18n:e,_:t}=nO();return rZ.createElement("div",{role:"separator",className:"Divider_module_container__1fb7194e"},rZ.createElement("div",{className:iv}),rZ.createElement(nZ,{variant:"helper"},e._({id:"methodDivider.text",message:"or"})),rZ.createElement("div",{className:iv}))},iw=e=>"children"in e?rZ.createElement(id,{gap:2},e.children):rZ.createElement(id,{gap:4},e.top&&rZ.createElement(iw,null,e.top),rZ.createElement(ib,null),rZ.createElement(iw,null,e.bottom)),ik=({header:e,description:t,children:r,additionalActions:n,resend:a,sendMagicLink:o,goBack:i})=>{let{i18n:s,_:l}=nO(),[c,d]=tG(!1),[u,h]=tG(!1),m=ie(),[p,_]=ir(m.expiration),g=a&&rZ.createElement(oZ,{variant:"outline",onClick:async()=>{d(!0);try{await a(),m.start(15)}catch(e){im({message:ic(e,l)}),m.clear()}finally{d(!1)}},loading:c,disabled:c||_},rZ.createElement(ii,{className:ia(),triggered:_,primary:s._({id:"button.resendEmail",message:"Resend email"}),secondary:s._({id:"button.emailResent",message:"Email resent! Try again in {timeRemaining}s",values:{timeRemaining:p}})})),f=i&&rZ.createElement(oZ,{variant:"ghost",onClick:i},s._({id:"button.goBack",message:"Go back"})),y=o?rZ.createElement(iw,{top:rZ.createElement(rZ.Fragment,null,n,g),bottom:rZ.createElement(rZ.Fragment,null,rZ.createElement(oZ,{variant:"outline",onClick:()=>{h(!0),o().catch(()=>h(!1))},loading:u},s._({id:"button.loginWithoutPassword",message:"Log in without a password"})),f)}):rZ.createElement(iw,null,n,g,f);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e),rZ.createElement(nZ,null,t),r,y)},iS={messageDescriptor:{id:"link.openInGmail",message:"Open in Gmail"},icon:"gmail",getUrl:e=>{let t=encodeURIComponent(e?`from:@${e} in:anywhere`:"in:anywhere");return`https://mail.google.com/mail/u/0/#search/${t}`}},iE={messageDescriptor:{id:"link.openInYahoo",message:"Open in Yahoo"},icon:"yahoo",getUrl:e=>e?`https://mail.yahoo.com/d/search/keyword=${e}`:"https://mail.yahoo.com/d/search/referrer=unread"},iC={messageDescriptor:{id:"link.openInOutlook",message:"Open in Outlook"},icon:"outlook",getUrl:()=>"https://outlook.office.com/mail/0/inbox"},iP=({providerInfo:{icon:e,messageDescriptor:t,getUrl:r},emailDomain:n})=>{let{i18n:a,_:o}=nO(),i=r(n),{iconRegistry:s}=t2(nq),l=s[e];return rZ.createElement(oJ,{variant:"outline",href:i,target:"_blank",rel:"noopener noreferrer",icon:rZ.createElement(l,null)},a._(t))},iT=({emailDomain:e,email:t,goBack:r,resend:n,countdown:a,isSubmitting:o})=>{let{i18n:i,_:s}=nO(),[l,c]=ir(a?.expiration??0);return rZ.createElement(ik,{header:i._({id:"emailConfirmation.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:t}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:e,providerInfo:iS}),rZ.createElement(iP,{emailDomain:e,providerInfo:iE}),rZ.createElement(iP,{emailDomain:e,providerInfo:iC}),n&&a&&rZ.createElement(oZ,{variant:"outline",disabled:o||c,onClick:()=>{a.start(15),n().catch(()=>a.clear())}},rZ.createElement(ii,{className:ia(),primary:i._({id:"button.resendEmail",message:"Resend email"}),secondary:i._({id:"emailConfirmation.emailSent",message:"Email sent! Try again in {timeRemaining}s",values:{timeRemaining:l}}),triggered:c})),r&&rZ.createElement(oZ,{variant:"ghost",onClick:r},i._({id:"button.goBack",message:"Go back"})))})},iO=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.discovery.send",(e,{arg:{email:n}})=>t.magicLinks.email.discovery.send({email_address:n,discovery_redirect_url:r.emailMagicLinksOptions?.discoveryRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})}})},iA=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.loginOrSignup",(e,{arg:{email:n,organization_id:a}})=>t.magicLinks.email.loginOrSignup({email_address:n,organization_id:a,login_redirect_url:r.emailMagicLinksOptions?.loginRedirectURL,signup_redirect_url:r.emailMagicLinksOptions?.signupRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})},onError:e=>{eP(e)}})},ix=()=>{let e=t2(aW).client,t=t2(aW).config,[r,n]=tG(()=>{let{emailDomains:t}=r1(e).bootstrap.getSync();return t});return(tZ(()=>{r1(e).bootstrap.getAsync().then(({emailDomains:e})=>{n(e)})},[e]),t.emailMagicLinksOptions?.domainHint)?t.emailMagicLinksOptions?.domainHint:1===r.length?r[0]:null},iD=()=>{let[e,t]=t2(aW).state,r=ix(),n=ie(),{trigger:a,isMutating:o}=iA(),{trigger:i,isMutating:l}=iO(),c=e.formState.emailState.userSuppliedEmail,d=async()=>{e.flowState.type===s.Discovery?await i({email:c}):e.flowState.type===s.Organization&&e.flowState.organization&&await a({email:c,organization_id:e.flowState.organization.organization_id})};return rZ.createElement(iT,{emailDomain:r,email:c,goBack:()=>{t({type:"set_user_supplied_email",email:""}),t({type:"transition",screen:at})},resend:d,countdown:n,isSubmitting:o||l})},iz={"data-1p-ignore":!0},iM=(e="s")=>e+tQ(((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""))()).current;nW(".VisuallyHidden_module_hidden__c5a4c7ad,:not(:focus):not(:focus-within) .VisuallyHidden_module_focusable__c5a4c7ad{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap;word-wrap:normal}");let iI=({children:e,focusable:t})=>rZ.createElement("div",{className:nj(t?"VisuallyHidden_module_focusable__c5a4c7ad":"VisuallyHidden_module_hidden__c5a4c7ad")},e),iR=e=>{let t=tQ(e);tZ(()=>t.current(),[])},iL=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g,iB=({children:e,...t})=>{let r=t1(()=>(e=>{let t=e.split(iL),r=Array.from(e.matchAll(iL)).map(e=>e[0]),n=[];for(;t.length||r.length;)if(t.length&&n.push(t.shift()),r.length){let e=r.shift();n.push(rZ.createElement("a",{key:e+"__"+String(r.length),href:e,target:"_blank",rel:"noreferrer"},e))}return n})(e),[e]),[n,a]=tG(!1);return iR(()=>a(!0)),rZ.createElement("div",{"aria-live":"polite"},n&&rZ.createElement(nZ,{...t,variant:"helper",color:"destructive",key:e},r))};nW(".Input_module_label__a0aad2f4{color:var(--st-foreground);display:block;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-sm);margin-bottom:var(--st-spacing-0_5);width:fit-content}.Input_module_input__a0aad2f4{padding:var(--st-spacing-2) var(--st-spacing-3);width:100%}.-st-mobile .Input_module_input__a0aad2f4{padding:var(--st-spacing-3)}.Input_module_input__a0aad2f4:disabled{color:var(--st-muted-foreground)}.Input_module_input__a0aad2f4::placeholder{color:var(--st-muted-foreground)}.Input_module_inputWrapper__a0aad2f4{display:flex;position:relative}.Input_module_action__a0aad2f4{inset-inline-end:var(--st-spacing-2);position:absolute;scale:.75;transform-origin:center right}[dir=rtl] .Input_module_action__a0aad2f4{transform-origin:center left}.Input_module_action__a0aad2f4:dir(rtl){transform-origin:center left}.Input_module_error__a0aad2f4{margin-top:var(--st-spacing-2)}");let iN=rs(({className:e,label:t,hideLabel:r,action:n,id:a,containerClassName:o,error:i,...s},l)=>{let c=t2(nq),d=a+(c.options?.inputIdSuffix??""),u=iM(),h=tQ(null),[m,p]=tG();tJ(()=>{h.current&&p(h.current.getBoundingClientRect().width)},[n]);let _=rZ.createElement("label",{className:"Input_module_label__a0aad2f4",htmlFor:d},t);return i&&(s["aria-invalid"]=!0,s["aria-errormessage"]=u),rZ.createElement("div",{className:nj(o,"Input_module_container__a0aad2f4")},r?rZ.createElement(iI,null,_):_,rZ.createElement("div",{className:"Input_module_inputWrapper__a0aad2f4"},rZ.createElement("input",{ref:l,id:d,className:nj(e,"Input_module_input__a0aad2f4 inputBase_module_inputBase__06c14ae4 inputBase_module_focusRing__06c14ae4"),style:m?{paddingInlineEnd:`calc(${m}px + var(--st-spacing-4))`}:void 0,...s}),n&&rZ.createElement("div",{ref:h,className:"Input_module_action__a0aad2f4"},n)),i&&rZ.createElement(iB,{id:u,className:"Input_module_error__a0aad2f4","aria-live":"polite"},i))}),iU=({email:e,setEmail:t,hasPasskeys:r=!1,...n})=>{let{i18n:a,_:o}=nO();return rZ.createElement(iN,{id:"email-input",label:a._({id:"formField.email.label",message:"Email"}),placeholder:a._({id:"formField.email.placeholder",message:"example@email.com"}),type:"email",autoComplete:r?"username webauthn":"email",value:e,onChange:e=>t(e.target.value),required:!0,...r?iz:{},...n})},iF=({email:e})=>{let[,t]=t2(aW).state,{i18n:r,_:n}=nO();return rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"use_password_auth",email:e})}},r._({id:"button.usePassword",message:"Use a password instead"}))},iq={oauth:void 0,sso:"sso",emailMagicLinks:"magic_link",emailOtp:"email_otp",passwords:"password"},iH={[c.Google]:"google_oauth",[c.Microsoft]:"microsoft_oauth",[c.HubSpot]:"hubspot_oauth",[c.Slack]:"slack_oauth",[c.GitHub]:"github_oauth"},iK=Object.fromEntries(Object.entries(iq).map(([e,t])=>[t,e])),ij=Object.fromEntries(Object.entries(iH).map(([e,t])=>[t,e])),i$=e=>e in ij?"oauth":iK[e],iV=Object.values(c),iW=(e,t)=>e.flatMap(e=>{if("oauth"===e.id)return t.map(e=>{let t=iH["string"==typeof e?e:e.type];if(t)return t});{let t=iq[e.id];if(t)return t}}).filter(aN),iG=()=>{let e,[t]=t2(aW).state,r=t2(aW).config,{restrictedAuthMethods:n,hasPrimaryAuthMethods:a}=(()=>{let[e]=t2(aW).state,{primaryAuthMethods:t}=e.primary;return{restrictedAuthMethods:t1(()=>e.primary.primaryAuthMethods?new Set(e.primary.primaryAuthMethods):e.flowState.organization?.auth_methods==="RESTRICTED"?new Set(e.flowState.organization?.allowed_auth_methods??[]):void 0,[e.flowState.organization?.allowed_auth_methods,e.flowState.organization?.auth_methods,e.primary.primaryAuthMethods]),hasPrimaryAuthMethods:!!t}})(),o=(e=t2(aW).config,t1(()=>e.oauthOptions?.providers?e.oauthOptions.providers.map(aJ):[],[e.oauthOptions?.providers])),i=t1(()=>iW(r.products,o),[r.products,o]),s=t1(()=>{if(!n)return i;let e=i.filter(e=>n.has(e));return e.length>0||!a?e:t.flowState.organization?.auth_methods==="RESTRICTED"?iW(r.organizationProducts,iV).filter(e=>n.has(e)):["magic_link"]},[r.organizationProducts,i,a,n,t.flowState.organization?.auth_methods]);return{products:t1(()=>[...new Set(s.map(i$).filter(aN))].map(e=>r.organizationProducts.find(t=>t.id===e)).filter(aN),[s,r.organizationProducts]),oauthProviderSettings:t1(()=>s.map(e=>{let t=ij[e];if(t)return o.find(e=>e.type===t)??aJ(t)}).filter(aN),[s,o])}},iY=()=>new Date(Date.now()+6e5),iZ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.discovery.send",(e,{arg:{email:t}})=>r.otps.email.discovery.send({email_address:t,login_template_id:n.emailOtpOptions?.loginTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iJ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.loginOrSignup",(e,{arg:{email:t,organization_id:a}})=>r.otps.email.loginOrSignup({email_address:t,organization_id:a,login_template_id:n.emailOtpOptions?.loginTemplateId,signup_template_id:n.emailOtpOptions?.signupTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iQ=["email_jit_provisioning_not_allowed","invalid_email_for_jit_provisioning"],iX=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),o=(()=>{let{i18n:e,_:t}=nO();return(r,{email:n,org:a})=>iQ.includes(r.error_type)?e._({id:"error.jitIneligible",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin",values:{email:n,organizationName:a}}):ic(r,t)})(),{i18n:i,_:s}=nO(),{products:l}=iG(),c=oB(l,"emailMagicLinks"),d=oB(l,"emailOtp"),u=t.primary.email,h=u||n,{trigger:m,error:p,isMutating:_}=iA(),{trigger:g,error:f,isMutating:y}=iJ(),v=_||y,b=p||f,w=t.flowState.organization;if(!w)return rZ.createElement(rZ.Fragment,null);let k=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:h}),c&&d?r({type:"transition",screen:av,history:"push"}):c?m({email:h,organization_id:w.organization_id}):d&&g({email:h,organization_id:w.organization_id})};return u?rZ.createElement(id,{gap:2},l.filter(e=>"emailMagicLinks"===e.id||"emailOtp"===e.id).map(e=>{switch(e.id){case"emailMagicLinks":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),m({email:h,organization_id:w.organization_id})},loading:_,disabled:v,variant:"outline"},i._({id:"button.emailLink",message:"Email me a link"}));case"emailOtp":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),g({email:h,organization_id:w.organization_id})},loading:y,disabled:v,variant:"outline"},i._({id:"button.emailCode",message:"Email me a code"}))}}),e&&rZ.createElement(iF,{email:h})):rZ.createElement(id,{as:"form",onSubmit:k,gap:2},rZ.createElement(iU,{email:h,setEmail:a,hideLabel:!0,error:b?o(b,{email:h,org:w.organization_name}):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:v},i._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:h}))},i1=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),{i18n:o,_:i}=nO(),{products:s}=iG(),l=s.some(e=>"emailMagicLinks"===e.id),c=s.some(e=>"emailOtp"===e.id),{trigger:d,error:u,isMutating:h}=iO(),{trigger:m,error:p,isMutating:_}=iZ(),g=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:n}),l&&c?r({type:"transition",screen:av,history:"push"}):l?d({email:n}):c&&m({email:n})},f=u||p;return rZ.createElement(id,{as:"form",onSubmit:g,gap:2},rZ.createElement(iU,{email:n,setEmail:a,hideLabel:!0,error:f?ic(f,i):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:h||_},o._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:n}))},i0={emailMagicLinks:{messageDescriptor:{id:"emailMethodSelection.link",message:"Email me a login link"}},emailOtp:{messageDescriptor:{id:"emailMethodSelection.code",message:"Email me a login code"}}},i2=()=>{let{products:e}=iG(),{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{trigger:o,isMutating:i,error:l,reset:c}=iO(),{trigger:d,isMutating:u,error:h,reset:m}=iZ(),{trigger:p,isMutating:_,error:g,reset:f}=iA(),{trigger:y,isMutating:v,error:b,reset:w}=iJ(),k=i||u||_||v,S=l||h||g||b,E=t1(()=>e.map(e=>{let t=i0[e.id];if(t)return{option:e.id,messageDescriptor:t.messageDescriptor}}).filter(aN),[e]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"emailMethodSelection.title",message:"Select how you’d like to continue"})),rZ.createElement(iw,null,E.map(({option:e,messageDescriptor:r})=>rZ.createElement(oZ,{key:e,variant:"outline",disabled:k,onClick:()=>{switch(c(),m(),f(),w(),e){case"emailMagicLinks":n.flowState.type===s.Discovery?o({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&p({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id});break;case"emailOtp":n.flowState.type===s.Discovery?d({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&y({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id})}}},t._(r))),S&&rZ.createElement(iB,null,ic(S,r)),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{a({type:"navigate_back"})}},t._({id:"button.goBack",message:"Go back"}))))};nW(".Loading_module_loadingScreen__1c53715a{display:flex;justify-content:center}");let i3=()=>{let{i18n:e,_:t}=nO();return tm(nZ,{variant:"header",align:"center"},e._({id:"login.loading",message:"Logging in..."}))},i4=()=>tm("div",{className:"Loading_module_loadingScreen__1c53715a"},tm(oW,{size:32})),i5=({isSubmitting:e,resendOTP:t,countdown:r})=>{let{i18n:n,_:a}=nO(),[o,i]=ir(r.expiration);return rZ.createElement(oZ,{variant:"outline",disabled:e||i,onClick:()=>{r.start(15),t().catch(()=>r.clear())}},rZ.createElement(ii,{className:ia(),primary:n._({id:"passcode.resendCode",message:"Resend code"}),secondary:n._({id:"passcode.codeSent",message:"Code sent! Try again in {timeRemaining}s",values:{timeRemaining:o}}),triggered:i}))};nW(".AnimatedContainer_module_container__fb438508{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--st-transition-duration) ease-out}.AnimatedContainer_module_open__fb438508{grid-template-rows:1fr}.AnimatedContainer_module_inner__fb438508{min-height:0;overflow:clip}");let i8=({isOpen:e,children:t})=>rZ.createElement("div",{className:nj("AnimatedContainer_module_container__fb438508",{AnimatedContainer_module_open__fb438508:e}),"aria-live":"polite"},rZ.createElement("div",{className:"AnimatedContainer_module_inner__fb438508","aria-hidden":!e},t));nW(".LoadingBar_module_container__3a991498{background-color:var(--st-muted);border-radius:var(--st-rounded-full);height:var(--st-spacing);overflow:clip}.LoadingBar_module_progress__3a991498{animation:LoadingBar_module_loading__3a991498 10s cubic-bezier(.22,1,.36,1);background-color:var(--st-primary);height:100%;width:100%}@keyframes LoadingBar_module_loading__3a991498{0%{transform:translateX(-100%)}to{transform:translateX(-1%)}}");let i6=({isLoading:e})=>rZ.createElement("div",{role:"progressbar",className:"LoadingBar_module_container__3a991498"},e&&rZ.createElement("div",{className:"LoadingBar_module_progress__3a991498"}));nW(".OTPEntry_module_progressInner__6b10f31d{padding-top:var(--st-spacing-2)}");var i9=Object.defineProperty,i7=Object.defineProperties,se=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,sa=(e,t,r)=>t in e?i9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,so=tI({}),si=rs((e,t)=>{let r;var n,a,o,i,s,{value:l,onChange:c,maxLength:d,textAlign:u="left",pattern:h,placeholder:m,inputMode:p="numeric",onComplete:_,pushPasswordManagerStrategy:g="increase-width",pasteTransformer:f,containerClassName:y,noScriptCSSFallback:v=sl,render:b,children:w}=e,k=((e,t)=>{var r={};for(var n in e)sr.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&st)for(var n of st(e))0>t.indexOf(n)&&sn.call(e,n)&&(r[n]=e[n]);return r})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[S,E]=tG("string"==typeof k.defaultValue?k.defaultValue:""),C=null!=l?l:S,P=(r=tQ(),tZ(()=>{r.current=C}),r.current),T=t0(e=>{null==c||c(e),E(e)},[c]),O=t1(()=>h?"string"==typeof h?new RegExp(h):h:null,[h]),A=tQ(null),x=tQ(null),D=tQ({value:C,onChange:T,isIOS:"u">typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),z=tQ({prev:[null==(o=A.current)?void 0:o.selectionStart,null==(i=A.current)?void 0:i.selectionEnd,null==(s=A.current)?void 0:s.selectionDirection]});tX(t,()=>A.current,[]),tZ(()=>{let e=A.current,t=x.current;if(!e||!t)return;function r(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,r=e.selectionEnd,n=e.selectionDirection,a=e.maxLength,o=e.value,i=z.current.prev,s=-1,l=-1,c;if(0!==o.length&&null!==t&&null!==r){let e=t===r,n=t===o.length&&o.length<a;if(e&&!n){if(0===t)s=0,l=1,c="forward";else if(t===a)s=t-1,l=t,c="backward";else if(a>1&&o.length>1){let e=0;if(null!==i[0]&&null!==i[1]){c=t<i[1]?"backward":"forward";let r=i[0]===i[1]&&i[0]<a;"backward"!==c||r||(e=-1)}s=e+t,l=e+t+1}}-1!==s&&-1!==l&&s!==l&&A.current.setSelectionRange(s,l,c)}let d=-1!==s?s:t,u=-1!==l?l:r,h=null!=c?c:n;N(d),F(u),z.current.prev=[d,u,h]}if(D.current.value!==e.value&&D.current.onChange(e.value),z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",r,{capture:!0}),r(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";ss(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),ss(e.sheet,`[data-input-otp]:autofill { ${t} }`),ss(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),ss(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),ss(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let a=new ResizeObserver(n);return a.observe(e),()=>{document.removeEventListener("selectionchange",r,{capture:!0}),a.disconnect()}},[]);let[M,I]=tG(!1),[R,L]=tG(!1),[B,N]=tG(null),[U,F]=tG(null);tZ(()=>{var e;setTimeout(e=()=>{var e,t,r,n;null==(e=A.current)||e.dispatchEvent(new Event("input"));let a=null==(t=A.current)?void 0:t.selectionStart,o=null==(r=A.current)?void 0:r.selectionEnd,i=null==(n=A.current)?void 0:n.selectionDirection;null!==a&&null!==o&&(N(a),F(o),z.current.prev=[a,o,i])},0),setTimeout(e,10),setTimeout(e,50)},[C,R]),tZ(()=>{void 0!==P&&C!==P&&P.length<d&&C.length===d&&(null==_||_(C))},[d,_,P,C]);let q=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,o]=tG(!1),[i,s]=tG(!1),[l,c]=tG(!1),d=t1(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&i,[a,i,r]),u=t0(()=>{let n=e.current,a=t.current;if(!n||!a||l||"none"===r)return;let i=n.getBoundingClientRect().left+n.offsetWidth,s=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,s)===n||(o(!0),c(!0))},[e,t,l,r]);return tZ(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let a=setInterval(n,1e3);return()=>{clearInterval(a)}},[e,r]),tZ(()=>{let e=n||document.activeElement===t.current;if("none"===r||!e)return;let a=setTimeout(u,0),o=setTimeout(u,2e3),i=setTimeout(u,5e3),s=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(o),clearTimeout(i),clearTimeout(s)}},[t,n,r,u]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:x,inputRef:A,pushPasswordManagerStrategy:g,isFocused:R}),H=t0(e=>{let t=e.currentTarget.value.slice(0,d);t.length>0&&O&&!O.test(t)?e.preventDefault():("string"==typeof P&&t.length<P.length&&document.dispatchEvent(new Event("selectionchange")),T(t))},[d,T,P,O]),K=t0(()=>{var e;if(A.current){let t=Math.min(A.current.value.length,d-1),r=A.current.value.length;null==(e=A.current)||e.setSelectionRange(t,r),N(t),F(r)}L(!0)},[d]),j=t0(e=>{var t,r;let n=A.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!n))return;let a=e.clipboardData.getData("text/plain"),o=f?f(a):a;e.preventDefault();let i=null==(t=A.current)?void 0:t.selectionStart,s=null==(r=A.current)?void 0:r.selectionEnd,l=(i!==s?C.slice(0,i)+o+C.slice(s):C.slice(0,i)+o+C.slice(i)).slice(0,d);if(l.length>0&&O&&!O.test(l))return;n.value=l,T(l);let c=Math.min(l.length,d-1),u=l.length;n.setSelectionRange(c,u),N(c),F(u)},[d,T,O,C]),$=t1(()=>({position:"relative",cursor:k.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[k.disabled]),V=t1(()=>({position:"absolute",inset:0,width:q.willPushPWMBadge?`calc(100% + ${q.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:q.willPushPWMBadge?`inset(0 ${q.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:u,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[q.PWM_BADGE_SPACE_WIDTH,q.willPushPWMBadge,u]),W=t1(()=>tm("input",i7(((e,t)=>{for(var r in t||(t={}))sr.call(t,r)&&sa(e,r,t[r]);if(st)for(var r of st(t))sn.call(t,r)&&sa(e,r,t[r]);return e})({autoComplete:k.autoComplete||"one-time-code"},k),se({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===C.length||void 0,"data-input-otp-mss":B,"data-input-otp-mse":U,inputMode:p,pattern:null==O?void 0:O.source,"aria-placeholder":m,style:V,maxLength:d,value:C,ref:A,onPaste:e=>{var t;j(e),null==(t=k.onPaste)||t.call(k,e)},onChange:H,onMouseOver:e=>{var t;I(!0),null==(t=k.onMouseOver)||t.call(k,e)},onMouseLeave:e=>{var t;I(!1),null==(t=k.onMouseLeave)||t.call(k,e)},onFocus:e=>{var t;K(),null==(t=k.onFocus)||t.call(k,e)},onBlur:e=>{var t;L(!1),null==(t=k.onBlur)||t.call(k,e)}}))),[H,K,j,p,V,d,U,B,k,null==O?void 0:O.source,C]),G=t1(()=>({slots:Array.from({length:d}).map((e,t)=>{var r;let n=R&&null!==B&&null!==U&&(B===U&&t===B||t>=B&&t<U),a=void 0!==C[t]?C[t]:null;return{char:a,placeholderChar:void 0!==C[0]?null:null!=(r=null==m?void 0:m[t])?r:null,isActive:n,hasFakeCaret:n&&null===a}}),isFocused:R,isHovering:!k.disabled&&M}),[R,M,d,U,B,k.disabled,C]),Y=t1(()=>b?b(G):tm(so.Provider,{value:G},w),[w,G,b]);return tm(tg,null,null!==v&&tm("noscript",null,tm("style",null,v)),tm("div",{ref:x,"data-input-otp-container":!0,style:$,className:y},Y,tm("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))});function ss(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}si.displayName="Input";var sl=`
27
+ products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error("'config.products' should not include strings anymore");let l=Array.isArray(i),c=nR(l?"(prefers-color-scheme: dark)":void 0);o=l?c?i[1]:i[0]:i;let d=t1(()=>{let e={};for(let t of r)Object.assign(e,t.icons);return Object.assign(e,s?.icons),e},[r,s]);return{theme:{...nB,...o},options:{enableShadowDOM:n,...nU,...s},displayWatermark:t,iconRegistry:d}}let nq=tI(void 0);function nH(e,t){if(null!=t.buttonId&&!1!==t.buttonId)return"string"==typeof t.buttonId?e+t.buttonId:e}var nK={exports:{}},nj=(en=function(){if(el)return nK.exports;el=1;var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,function(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}(o)))}return n}function r(e,t){return t?e?e+" "+t:e+t:e}return nK.exports?(t.default=t,nK.exports=t):window.classNames=t,nK.exports}())&&en.__esModule&&Object.prototype.hasOwnProperty.call(en,"default")?en.default:en;let n$=[],nV=new Set;function nW(e){n$.push(e),nV.forEach(t=>t(e))}function nG(){var e;let t=document.createElement("style"),r=!0,n=((e=e=>{r||document.contains(t)?(t.textContent+=e,r=!1):n()})(n$.join("\n")),nV.add(e),()=>nV.delete(e));return t}nW(".Typography_module_typography__74817c74{font-family:var(--st-font-family)}.Typography_module_header__74817c74{color:var(--st-foreground);font-family:var(--st-header-font);font-size:var(--st-text-2xl);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-2xl)}.Typography_module_body__74817c74{color:var(--st-foreground);font-size:var(--st-text-base)}.Typography_module_body__74817c74,.Typography_module_helper__74817c74{font-weight:var(--st-font-weight-normal);line-height:var(--st-line-height-base)}.Typography_module_helper__74817c74{color:var(--st-muted-foreground);font-size:var(--st-text-xs)}.Typography_module_start__74817c74{text-align:start}.Typography_module_center__74817c74{text-align:center}.Typography_module_end__74817c74{text-align:end}.Typography_module_foreground__74817c74{color:var(--st-foreground)}.Typography_module_muted__74817c74{color:var(--st-muted-foreground)}.Typography_module_destructive__74817c74{color:var(--st-destructive)}.Typography_module_warning__74817c74{color:var(--st-warning)}.Typography_module_success__74817c74{color:var(--st-success)}.Typography_module_regular__74817c74{font-weight:var(--st-font-weight-normal)}.Typography_module_medium__74817c74{font-weight:var(--st-font-weight-medium)}.Typography_module_semibold__74817c74{font-weight:var(--st-font-weight-semibold)}.Typography_module_bold__74817c74{font-weight:var(--st-font-weight-bold)}.Typography_module_defaultFont__74817c74{font-family:var(--st-font-family)}.Typography_module_monoFont__74817c74{font-family:var(--st-font-family-mono)}");var nY={typography:"Typography_module_typography__74817c74",header:"Typography_module_header__74817c74",body:"Typography_module_body__74817c74",helper:"Typography_module_helper__74817c74",start:"Typography_module_start__74817c74",center:"Typography_module_center__74817c74",end:"Typography_module_end__74817c74",foreground:"Typography_module_foreground__74817c74",muted:"Typography_module_muted__74817c74",destructive:"Typography_module_destructive__74817c74",warning:"Typography_module_warning__74817c74",success:"Typography_module_success__74817c74",regular:"Typography_module_regular__74817c74",medium:"Typography_module_medium__74817c74",semibold:"Typography_module_semibold__74817c74",bold:"Typography_module_bold__74817c74",defaultFont:"Typography_module_defaultFont__74817c74",monoFont:"Typography_module_monoFont__74817c74"};let nZ=rs(({variant:e="body",as:t="div",weight:r,font:n,color:a,align:o,className:i,...s},l)=>rZ.createElement(t,{...s,ref:l,className:nj(i,nY.typography,nY[e],n&&nY[n+"Font"],r&&nY[r],a&&nY[a],o&&nY[o])}));nW(".Badge_module_badge__c44e2b28{background-color:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-base);cursor:default;padding:var(--st-spacing-0_5) var(--st-spacing);width:fit-content}");let nJ=({className:e,children:t})=>rZ.createElement("div",{className:nj("Badge_module_badge__c44e2b28",e)},rZ.createElement(nZ,{variant:"helper"},t));nW(".LastUsed_module_container__4e54ed99{position:relative}.LastUsed_module_badge__4e54ed99{position:absolute;right:var(--st-spacing-3);top:0;translate:0 -60%}[dir=rtl] .LastUsed_module_badge__4e54ed99{left:var(--st-spacing-3);right:auto}.LastUsed_module_badge__4e54ed99:dir(rtl){left:var(--st-spacing-3);right:auto}");let nQ=({children:e})=>{let{i18n:t,_:r}=nO();return rZ.createElement("div",{className:"LastUsed_module_container__4e54ed99"},e,rZ.createElement(nJ,{className:"LastUsed_module_badge__4e54ed99"},t._({id:"provider.lastUsed",message:"Last used"})))},nX=({niceName:e,variableName:t})=>rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because there are no ",e," set for this project so we are unable to verify the"," ",rZ.createElement("code",null,t),"\xa0 provided in the configuration. To set ",e,"for this project please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xa0 For more information on why this validation is necessary please visit\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation.")),n1="origin_not_allowed_for_client",n0="invalid_client",n2="oauth_config_not_found",n3="default_provider_not_allowed",n4=({error:e})=>{switch(e){case n1:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the current host\xa0",rZ.createElement("code",null,window.location.host),"is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xa0 ",rZ.createElement("code",null,"http://localhost"),"and\xa0",rZ.createElement("code",null,"http://localhost:<port_number>"),"\xa0 to the Authorized JavaScript origins box. You can learn more\xa0",rZ.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));case n0:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xa0 Please check that the client ID saved in"," ",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xa0 matches the client ID in your Google Cloud Console.");case n2:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));case"no_login_redirect_urls_set":return rZ.createElement(nX,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});case"no_signup_redirect_urls_set":return rZ.createElement(nX,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});case n3:return rZ.createElement(nZ,{variant:"body",color:"destructive"},"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xa0",rZ.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."))}},n5=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,n8=e=>(document.cookie?document.cookie.split("; "):[]).filter(t=>{let[r]=t.split("=");return e===r}).length>1,n6=()=>{},n7="u">typeof window?tJ:tZ,n9=e=>{let t=tQ(e);return n7(()=>{t.current=e},[e]),t0((...e)=>(0,t.current)(...e),[])},ae={primaryInfo:null,isEnrolling:!1,smsOtp:{isSending:!1,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{enrollment:null}},at="Main",ar="Email Confirmation",an="Logged In",aa="Discovery",ao="Error",ai="Password Authenticate",as="Password Reset Form",al="Password Reset Verify Confirmation",ac="Password Forgot Form",ad="Password Set New Confirmation",au="MFA Enrollment Selection",ah="Recovery Code Entry",am="Recovery Code Save",ap="SMS OTP Enrollment",a_="SMS OTP Entry",ag="TOTP Enrollment Manual",af="TOTP Enrollment QR Code",ay="TOTP Entry",av="Email Method Selection",ab="Email OTP Entry",aw="SSO Discovery Email",ak="SSO Discovery Fallback",aS="SSO Discovery Menu",aE="EmailForm",aC="EmailDiscoveryForm",aP="OAuthButtons",aT="SSOButtons",aO="PasswordsEmailForm",aA="PasswordEmailCombined",ax="PasswordEmailCombinedDiscovery",aD="Divider",az="Default",aM="EmailMagicLink",aI="Organization",aR="CannotJoinOrgDueToAuthPolicy",aL="AdBlockerDetected",aB="OrganizationDiscoveryClaimedDomain",aN=e=>!!e,aU=({allMethods:e,orgSupportedMethods:t,uiIncludedMethods:r})=>new Set(t?.length?t:r?.length?r:e);function aF(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[...t.screenHistory,t.screen]}}function aq(e,t){return t.screen===e?t:{...t,screen:e,screenHistory:[]}}function aH(e){switch(e){case"totp":return d.totp;case"sms_otp":return d.smsOtp;default:return}}let aK=()=>new Date(Date.now()+12e4),aj=[d.totp,d.smsOtp],a$=(e,t)=>{switch(t.type){case"transition":return"push"===t.history?aF(t.screen,e):aq(t.screen,e);case"navigate_back":{let t=e.screenHistory.at(-1);if(!t)return e;let r=e.screenHistory.slice(0,-1);return{...e,screen:t,screenHistory:r}}case"set_error_message_and_transition":return{...e,screen:ao,error:{type:t.errorType,canGoBack:t.canGoBack}};case"set_user_supplied_email":return{...e,formState:{...e.formState,emailState:{userSuppliedEmail:t.email},passwordState:{email:t.email}}};case"set_organization":return{...e,flowState:{type:s.Organization,organization:t.organization}};case"set_discovery_state":{let r=t.discoveredOrganizations;return{...e,formState:{...e.formState,discoveryState:{email:t.email,discoveredOrganizations:r}},screen:aa}}case"select_discovered_organization":{let{membership:r,organization:n,primary_required:a}=t.discoveredOrganization,o=r.member?.email_address??e.formState.discoveryState.email,i=a?a.allowed_auth_methods:void 0,l={...e,flowState:{type:s.Organization,organization:n},formState:{...e.formState,passwordState:{email:o}},primary:{primaryAuthMethods:i,email:o,emailVerified:r.member?.email_address_verified},screen:at};if(i?.length===0)return{...l,screen:ao,error:{type:aR,canGoBack:!0}};return l}case"set_password_state":return{...e,formState:{...e.formState,passwordState:{email:t.email}}};case"send_email_otp":return aF(ab,{...e,formState:{...e.formState,otpState:{codeExpiration:t.codeExpiration}}});case"set_sso_discovery_state":if(!t.connections.length)return aF(ak,e);return aF(aS,{...e,formState:{...e.formState,ssoDiscoveryState:{connections:t.connections}}});case"use_password_auth":return aF(ai,{...e,formState:{...e.formState,passwordState:{email:t.email}}});default:return((e,t)=>{switch(t.type){case"primary_authenticate_success":{let r=!!t.response.member_session,n="multi_tenant_magic_links"===t.resetTokenType?as:an;if(r)return aq(n,{...e,mfa:ae,primary:{}});if(t.response.primary_required){let r=t.response.primary_required.allowed_auth_methods,{email_address:n,email_address_verified:a}=t.response.member,o={...e,flowState:{type:s.Organization,organization:t.response.organization},formState:{...e.formState,passwordState:{email:n}},primary:{primaryAuthMethods:r,email:n,emailVerified:a}};if(r?.length===0)return aq(ao,{...o,error:{type:aR,canGoBack:!1}});return aq(at,o)}let a=t.response.member.mfa_phone_number_verified,o={enrolledMfaMethods:[!!t.response.member.totp_registration_id&&d.totp,a&&d.smsOtp].filter(aN),memberId:t.response.member_id,memberPhoneNumber:t.response.member.mfa_phone_number,organizationId:t.response.organization.organization_id,organizationMfaOptionsSupported:"RESTRICTED"===t.response.organization.mfa_methods?t.response.organization.allowed_mfa_methods?.map(aH).filter(aN)??[]:[],postAuthScreen:n},i=e=>0===o.organizationMfaOptionsSupported.length||o.organizationMfaOptionsSupported.includes(e),l=t.response.mfa_required?.secondary_auth_initiated==="sms_otp",c=l?d.smsOtp:(()=>{let e=aH(t.response.member.default_mfa_method);if(e&&i(e)&&o.enrolledMfaMethods.includes(e))return e})()??o.enrolledMfaMethods.find(i);if(c){let t={...ae,primaryInfo:o};switch(c){case d.totp:return aq(ay,{...e,mfa:t,primary:{}});case d.smsOtp:{let r={...e,mfa:{...t,smsOtp:{...t.smsOtp,codeExpiration:l?aK():null}},primary:{}};if(a)return aq(a_,r);return{...r,screen:a_,screenHistory:[ap]}}}}return aq(function(e){if(1===e.size){if(e.has(d.totp))return af;if(e.has(d.smsOtp))return ap}return au}(aU({allMethods:aj,orgSupportedMethods:o.organizationMfaOptionsSupported,uiIncludedMethods:t.includedMfaMethods})),{...e,mfa:{...ae,primaryInfo:o,isEnrolling:!0},primary:{}})}case"sms_otp/send":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!0,sendError:null}}};case"sms_otp/send_success":return aF(a_,{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:null,codeExpiration:aK(),formattedDestination:t.formattedPhoneNumber??e.mfa.smsOtp.formattedDestination,enrolledNumber:t.phoneNumber?{phoneNumber:t.phoneNumber,countryCode:t.countryCode}:null}}});case"sms_otp/send_error":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,isSending:!1,sendError:t.error,codeExpiration:e.mfa.smsOtp.codeExpiration??new Date(Date.now()-1e3)}}};case"sms_otp/format_destination":return{...e,mfa:{...e.mfa,smsOtp:{...e.mfa.smsOtp,formattedDestination:t.formattedPhoneNumber}}};case"sms_otp/authenticate_success":case"recovery_code/authenticate_success":case"recovery_code/save_acknowledge":return aq(e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:ae});case"totp/authenticate_success":return aq(e.mfa.isEnrolling?am:e.mfa.primaryInfo?.postAuthScreen??an,{...e,mfa:e.mfa.isEnrolling?e.mfa:ae});case"totp/create_success":if(!e.mfa.isEnrolling||e.mfa.primaryInfo?.memberId!==t.memberId||e.mfa.primaryInfo?.organizationId!==t.organizationId)return e;return{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{secret:t.response.secret,qrCode:t.response.qr_code,recoveryCodes:t.response.recovery_codes,method:e.mfa.totp.enrollment?.method??"qr"}}}};case"totp/show_code":{if(!e.mfa.isEnrolling||!e.mfa.totp.enrollment)return e;let r=t.method??e.mfa.totp.enrollment.method??"qr";return aF("manual"===r?ag:af,{...e,mfa:{...e.mfa,totp:{...e.mfa.totp,enrollment:{...e.mfa.totp.enrollment,method:r}}}})}default:return e}})(e,t)}},aV={screen:at,screenHistory:[],formState:{emailState:{userSuppliedEmail:""},otpState:{codeExpiration:null},discoveryState:{email:"",discoveredOrganizations:[]},passwordState:{email:""},ssoDiscoveryState:{connections:[]}},flowState:{type:s.Organization,organization:null},mfa:ae,primary:{},error:{type:az,canGoBack:!1}},aW=rZ.createContext({client:{},config:{},state:[aV,()=>null]}),aG=({children:e,client:t,config:r,callbacks:n,initialState:a})=>{let o=rZ.useReducer(a$,a??aV);return rZ.createElement(aW.Provider,{value:{client:t,state:o,config:r,callbacks:n}},e)},aY=()=>n9(t2(aW).callbacks?.onError??n6),aZ=()=>n9(t2(aW).callbacks?.onEvent??n6),aJ=e=>{let t,r,n=!1,a=[],o={};return"string"==typeof e?r=e:(r=e.type,e.type===c.Google&&e.one_tap&&(n=e.one_tap,t=e.cancel_on_tap_outside),a=e.customScopes||[],o=e.providerParams||{}),{type:r,one_tap:n,customScopes:a,providerParams:o,cancel_on_tap_outside:t}};var aQ={exports:{}},aX={},a1=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(rJ),a0=(ed||(ed=1,ec||(ec=1,!function(){function e(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=a1.useState,n=a1.useEffect,a=a1.useLayoutEffect,o=a1.useDebugValue,i=!1,s=!1,l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(l,c){i||void 0===a1.startTransition||(i=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=c();if(!s){var u=c();t(d,u)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),s=!0)}var h=(u=r({inst:{value:d,getSnapshot:c}}))[0].inst,m=u[1];return a(function(){h.value=d,h.getSnapshot=c,e(h)&&m({inst:h})},[l,d,c]),n(function(){return e(h)&&m({inst:h}),l(function(){e(h)&&m({inst:h})})},[l]),o(d),d};aX.useSyncExternalStore=void 0!==a1.useSyncExternalStore?a1.useSyncExternalStore:l,"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),aQ.exports=aX),aQ.exports);let a2=new WeakMap,a3={},a4={},a5=()=>{},a8=a5(),a6=Object,a7=e=>e===a8,a9=(e,t)=>({...e,...t}),oe="undefined",ot=typeof window!=oe,or=typeof document!=oe,on=(e,t)=>{let r=a2.get(e);return[()=>e.get(t)||a3,n=>{if(!a7(t)){let a=e.get(t);t in a4||(a4[t]=a),r[5](t,a9(a,n),a||a3)}},r[6],()=>!a7(t)&&t in a4?a4[t]:e.get(t)||a3]},oa=new WeakMap,oo=0,oi=e=>{let t,r,n=typeof e,a=e&&e.constructor,o=a==Date;if(a6(e)!==e||o||a==RegExp)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=oa.get(e))return t;if(t=++oo+"~",oa.set(e,t),a==Array){for(r=0,t="@";r<e.length;r++)t+=oi(e[r])+",";oa.set(e,t)}if(a==a6){t="#";let n=a6.keys(e).sort();for(;!a7(r=n.pop());)a7(e[r])||(t+=r+":"+oi(e[r])+",");oa.set(e,t)}}return t},os=!0,[ol,oc]=ot&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[a5,a5],od={initFocus:e=>(or&&document.addEventListener("visibilitychange",e),ol("focus",e),()=>{or&&document.removeEventListener("visibilitychange",e),oc("focus",e)}),initReconnect:e=>{let t=()=>{os=!0,e()},r=()=>{os=!1};return ol("online",t),ol("offline",r),()=>{oc("online",t),oc("offline",r)}}},ou=!rZ.useId,oh=!ot||"Deno"in window,om=oh?tZ:tJ,op="u">typeof navigator&&navigator.connection,o_=!oh&&op&&(["slow-2g","2g"].includes(op.effectiveType)||op.saveData),og=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?oi(e):"",t]},of=0,oy=()=>++of;async function ov(...e){let[t,r,n,a]=e,o=a9({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),i=o.populateCache,s=o.rollbackOnError,l=o.optimisticData,c=!1!==o.revalidate,d=o.throwOnError;if("function"==typeof r){let e=[],n=t.keys();for(let a=n.next();!a.done;a=n.next()){let n=a.value;!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n)}return Promise.all(e.map(u))}return u(r);async function u(r){let a,[o]=og(r);if(!o)return;let[u,h]=on(t,o),[m,p,_]=a2.get(t),g=m[o],f=()=>c&&(delete _[o],g&&g[0])?g[0](2).then(()=>u().data):u().data;if(e.length<3)return f();let y=n,v=oy();p[o]=[v,0];let b=!a7(l),w=u(),k=w.data,S=w._c,E=a7(S)?k:S;if(b&&h({data:l="function"==typeof l?l(E):l,_c:E}),"function"==typeof y)try{y=y(E)}catch(e){a=e}if(y&&"function"==typeof y.then){let e;if(y=await y.catch(e=>{a=e}),v!==p[o][0]){if(a)throw a;return y}a&&b&&(e=a,"function"==typeof s?s(e):!1!==s)&&(i=!0,h({data:y=E,_c:a8}))}i&&!a&&("function"==typeof i&&(y=i(y,E)),h({data:y,_c:a8})),p[o][1]=oy();let C=await f();if(h({_c:a8}),a){if(d)throw a;return}return i?C:y}}let ob=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},[ow,ok]=((e,t)=>{if(!a2.has(e)){let r=a9(od,t),n={},a=ov.bind(a8,e),o=a5,i={},s=(e,t)=>{let r=i[e]||[];return i[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let a=i[t];if(a)for(let e of a)e(r,n)},c=()=>{if(!a2.has(e)&&(a2.set(e,[n,{},{},{},a,l,s]),!oh)){let t=r.initFocus(setTimeout.bind(a8,ob.bind(a8,n,0))),a=r.initReconnect(setTimeout.bind(a8,ob.bind(a8,n,1)));o=()=>{t&&t(),a&&a(),a2.delete(e)}}};return c(),[e,a,c,o]}return[e,a2.get(e)[4]]})(new Map),oS=a9({onLoadingSlow:a5,onSuccess:a5,onError:a5,onErrorRetry:(e,t,r,n,a)=>{let o=r.errorRetryCount,i=a.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;(a7(o)||!(i>o))&&setTimeout(n,s,a)},onDiscarded:a5,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:o_?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:o_?5e3:3e3,compare:(e,t)=>oi(e)==oi(t),isPaused:()=>!1,cache:ow,mutate:ok,fallback:{}},{isOnline:()=>os,isVisible:()=>{let e=or&&document.visibilityState;return a7(e)||"hidden"!==e}}),oE=tI({}),oC=ot&&window.__SWR_DEVTOOLS_USE__,oP=oC?window.__SWR_DEVTOOLS_USE__:[],oT=e=>"function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],oO=oP.concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let n=og(t)[0],[,,,a]=a2.get(ow),o=a[n];return o?(delete a[n],o):r(...e)});return e(t,a,n)});oC&&(window.__SWR_DEVTOOLS_REACT__=rZ);let oA={dedupe:!0};var ox=(r=(e,t,r)=>{let{cache:n,compare:a,suspense:o,fallbackData:i,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:h}=r,[m,p,_]=a2.get(n),[g,f]=og(e),y=tQ(!1),v=tQ(!1),b=tQ(g),w=tQ(t),k=tQ(r),S=()=>k.current.isVisible()&&k.current.isOnline(),[E,C,P,T]=on(n,g),O=tQ({}).current,A=a7(i)?r.fallback[g]:i,x=(e,t)=>{let r=!0;for(let n in O)"data"===n?!a(t[n],e[n])&&(a7(e[n])&&a(t[n],U)||(r=!1)):t[n]!==e[n]&&(r=!1);return r},D=t1(()=>{let e=!!g&&!!t&&(a7(s)?!k.current.isPaused()&&!o&&(!!a7(l)||l):s),r=t=>{let r=a9(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=E(),a=T(),i=r(n),c=n===a?i:r(a),d=i;return[()=>{let e=r(E());return x(e,d)?d:d=e},()=>c]},[n,g]),z=a0.useSyncExternalStore(t0(e=>P(g,(t,r)=>{x(r,t)||e()}),[n,g]),D[0],D[1]),M=!y.current,I=m[g]&&m[g].length>0,R=z.data,L=a7(R)?A:R,B=z.error,N=tQ(L),U=h?a7(R)?N.current:R:L,F=(!I||!!a7(B))&&(M&&!a7(s)?s:!k.current.isPaused()&&(o?!a7(L)&&l:a7(L)||l)),q=!!(g&&t&&M&&F),H=a7(z.isValidating)?q:z.isValidating,K=a7(z.isLoading)?q:z.isLoading,j=t0(async e=>{let t,n,o=w.current;if(!g||!o||v.current||k.current.isPaused())return!1;let i=!0,s=e||{},l=!_[g]||!s.dedupe,c=()=>ou?!v.current&&g===b.current&&y.current:g===b.current,d={isValidating:!1,isLoading:!1},u=()=>{C(d)},h=()=>{let e=_[g];e&&e[1]===n&&delete _[g]},P={isValidating:!0};a7(E().data)&&(P.isLoading=!0);try{if(l&&(C(P),r.loadingTimeout&&a7(E().data)&&setTimeout(()=>{i&&c()&&k.current.onLoadingSlow(g,r)},r.loadingTimeout),_[g]=[o(f),oy()]),[t,n]=_[g],t=await t,l&&setTimeout(h,r.dedupingInterval),!_[g]||_[g][1]!==n)return l&&c()&&k.current.onDiscarded(g),!1;d.error=a8;let e=p[g];if(!a7(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return u(),l&&c()&&k.current.onDiscarded(g),!1;let s=E().data;d.data=a(s,t)?s:t,l&&c()&&k.current.onSuccess(t,g,r)}catch(r){h();let e=k.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&c())&&(e.onError(r,g,e),(!0===t||"function"==typeof t&&t(r))&&S()&&e.onErrorRetry(r,g,e,e=>{let t=m[g];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0}))}return i=!1,u(),!0},[g,n]),$=t0((...e)=>ov(n,b.current,...e),[]);if(om(()=>{w.current=t,k.current=r,a7(R)||(N.current=R)}),om(()=>{var e;let t;if(!g)return;let r=j.bind(a8,oA),n=0,a=(e=(e,t={})=>{if(0==e){let e=Date.now();k.current.revalidateOnFocus&&e>n&&S()&&(n=e+k.current.focusThrottleInterval,r())}else if(1==e)k.current.revalidateOnReconnect&&S()&&r();else if(2==e)return j();else if(3==e)return j(t)},(t=m[g]||(m[g]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(v.current=!1,b.current=g,y.current=!0,C({_k:f}),F)if(a7(L)||oh)r();else ot&&typeof window.requestAnimationFrame!=oe?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{v.current=!0,a()}},[g]),om(()=>{let e;function t(){let t="function"==typeof c?c(L):c;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!E().error&&(d||k.current.isVisible())&&(u||k.current.isOnline())?j(oA).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[c,d,u,g]),t3(U),o&&a7(L)&&g){if(!ou&&oh)throw Error("Fallback data is required when using suspense in SSR.");throw w.current=t,k.current=r,v.current=!1,a7(B)?j(oA):B}return{mutate:$,get data(){return O.data=!0,U},get error(){return O.error=!0,B},get isValidating(){return O.isValidating=!0,H},get isLoading(){return O.isLoading=!0,K}}},function(...e){let t=a9(oS,t2(oE)),[n,a,o]=oT(e),i=((e,t)=>{let r=a9(e,t);if(t){let{use:n,fallback:a}=e,{use:o,fallback:i}=t;n&&o&&(r.use=n.concat(o)),a&&i&&(r.fallback=a9(a,i))}return r})(t,o),s=r,{use:l}=i,c=(l||[]).concat(oO);for(let e=c.length;e--;)s=c[e](s);return s(n,a||i.fetcher||null,i)}),oD=(n=()=>(e,t,r={})=>{var n;let a,o,i,s,l,{mutate:c}=a9(oS,t2(oE)),d=tQ(e),u=tQ(t),h=tQ(r),m=tQ(0),[p,_,g]=(n={data:a8,error:a8,isMutating:!1},a=tG({})[1],o=tQ(!1),i=tQ(n),s=tQ({data:!1,error:!1,isValidating:!1}),l=t0(e=>{let t=!1,r=i.current;for(let n in e)r[n]!==e[n]&&(r[n]=e[n],s.current[n]&&(t=!0));t&&!o.current&&(ou?a({}):rZ.startTransition(()=>a({})))},[]),om(()=>(o.current=!1,()=>{o.current=!0})),[i,s.current,l]),f=p.current,y=t0(async(e,t)=>{let[r,n]=og(d.current);if(!u.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!r)throw Error("Can’t trigger the mutation: missing key.");let a=a9(a9({populateCache:!1,throwOnError:!0},h.current),t),o=oy();m.current=o,g({isMutating:!0});try{let t=await c(r,u.current(n,{arg:e}),a9(a,{throwOnError:!0}));return m.current<=o&&(g({data:t,isMutating:!1,error:void 0}),null==a.onSuccess||a.onSuccess(t,r,a)),t}catch(e){if(m.current<=o&&(g({error:e,isMutating:!1}),null==a.onError||a.onError(e,r,a),a.throwOnError))throw e}},[]),v=t0(()=>{m.current=oy(),g({data:a8,error:a8,isMutating:!1})},[]);return om(()=>{d.current=e,u.current=t,h.current=r}),{trigger:y,reset:v,get data(){return _.data=!0,f.data},get error(){return _.error=!0,f.error},get isMutating(){return _.isMutating=!0,f.isMutating}}},(...e)=>{let[t,r,a]=oT(e),o=(a.use||[]).concat(n);return ox(t,r,{...a,use:o})});let oz={"stytch.magicLinks.authenticate":eu.B2BMagicLinkAuthenticate,"stytch.sso.authenticate":eu.B2BSSOAuthenticate,"stytch.sso.discoverConnections":eu.B2BSSODiscoverConnections,"stytch.magicLinks.discovery.authenticate":eu.B2BMagicLinkDiscoveryAuthenticate,"stytch.discovery.organizations.create":eu.B2BDiscoveryOrganizationsCreate,"stytch.discovery.intermediateSessions.exchange":eu.B2BDiscoveryIntermediateSessionExchange,"stytch.magicLinks.email.loginOrSignup":eu.B2BMagicLinkEmailLoginOrSignup,"stytch.magicLinks.email.discovery.send":eu.B2BMagicLinkEmailDiscoverySend,"stytch.oauth.authenticate":eu.B2BOAuthAuthenticate,"stytch.oauth.discovery.authenticate":eu.B2BOAuthDiscoveryAuthenticate,"stytch.otps.sms.send":eu.B2BSMSOTPSend,"stytch.otps.sms.authenticate":eu.B2BSMSOTPAuthenticate,"stytch.totp.create":eu.B2BTOTPCreate,"stytch.totp.authenticate":eu.B2BTOTPAuthenticate,"stytch.recoveryCodes.recover":eu.B2BRecoveryCodesRecover,"stytch.impersonation.authenticate":eu.B2BImpersonationAuthenticate,"stytch.otps.email.authenticate":eu.B2BOTPsEmailAuthenticate,"stytch.otps.email.discovery.authenticate":eu.B2BOTPsEmailDiscoveryAuthenticate,"stytch.otps.email.discovery.send":eu.B2BOTPsEmailDiscoverySend,"stytch.otps.email.loginOrSignup":eu.B2BOTPsEmailLoginOrSignup,"stytch.organization.getBySlug":eu.B2BOrganizationsGetBySlug},oM=(e,t,r={})=>{let n=aZ(),a=aY(),o=oD(e,t,{throwOnError:!1,...r,onSuccess:(e,t,a)=>{let o=oz[t];o&&n({type:o,data:e}),r.onSuccess?.(e,t,a)},onError:(e,t,n)=>{a(e),r.onError?.(e,t,n)}});return o.isMutating?{...o,error:void 0}:o},oI=()=>{let e=t2(aW).client,[t,r]=tG(r1(e).bootstrap.getSync());return tZ(()=>{r1(e).bootstrap.getAsync().then(e=>{r(e)})},[e]),t},oR=(e,t,r)=>{t({type:"primary_authenticate_success",response:e,includedMfaMethods:r.mfaProductInclude})},oL=(e,t)=>{t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})};function oB(e,t){return e.some(e=>e.id===t)}function oN({products:e,organizationProducts:t},r){return t1(()=>{let n={};for(let a of[...e,...t])a[r]&&Object.assign(n,a[r]);return n},[e,t,r])}let oU=()=>{let e=t2(aW).config;return t1(()=>{let t=e.oauthOptions?aJ(e.oauthOptions?.providers[0]):void 0,r=t?.type===c.Google&&t?.one_tap===!0;return 1===e.products.length&&oB(e.products,"oauth")&&e.oauthOptions?.providers.length===1&&r},[e])},oF=(e,t)=>`stytch_sdk_state_${e}${t?`::${t}`:""}`;function oq(e){return null==e?{getItem:()=>null,removeItem(){},setItem(){}}:{getItem(t,r){let n=oF(t,r);try{return e.getItem(n)}catch{return null}},setItem(t,r,n){let a=oF(t,r);try{n&&e.setItem(a,n)}catch{}},removeItem(t,r){let n=oF(t,r);try{e.removeItem(n)}catch{}}}}let oH=oq(globalThis.localStorage),oK=oq(globalThis.sessionStorage);function oj(e,t){return{getItem:r=>e.getItem(t,r),setItem(r,n){e.setItem(t,r,n)},removeItem(r){e.removeItem(t,r)}}}function o$(){let{publicToken:e}=r1(t2(aW).client);return[t1(()=>oH.getItem(e,"b2b_last_used_method"),[e]),t=>{oH.setItem(e,"b2b_last_used_method",t)}]}nW(".Button_module_button__fba1165e{align-items:center;border:1px solid;border-radius:var(--st-button-radius);box-shadow:var(--st-shadow-button);display:flex;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);gap:var(--st-spacing-2);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);transition:background-color var(--st-transition-duration) ease-in-out,border-color var(--st-transition-duration) ease-in-out}.-st-mobile .Button_module_button__fba1165e{padding:var(--st-spacing-3)}.Button_module_button__fba1165e:focus-visible{box-shadow:var(--st-shadow-button),var(--st-focus-ring-shadow)}.Button_module_button__fba1165e:not(:disabled){cursor:pointer}.Button_module_button__fba1165e:disabled{opacity:.5}.Button_module_block__fba1165e{justify-content:center;width:100%}.Button_module_primary__fba1165e{background-color:var(--st-primary);border-color:var(--st-primary);color:var(--st-primary-foreground)}.Button_module_primary__fba1165e:not(:disabled):hover{background-color:var(--st-primary-button-hover);border-color:var(--st-primary-button-hover)}.Button_module_secondary__fba1165e{background-color:var(--st-secondary);border-color:var(--st-secondary);color:var(--st-secondary-foreground)}.Button_module_secondary__fba1165e:not(:disabled):hover{background-color:var(--st-secondary-button-hover);border-color:var(--st-secondary-button-hover)}.Button_module_outline__fba1165e{background-color:var(--st-background);border:1px solid var(--st-border);color:var(--st-foreground)}.Button_module_outline__fba1165e:not(:disabled):hover{background-color:var(--st-accent);color:var(--st-accent-foreground)}.Button_module_outline__fba1165e:focus-visible{border-color:var(--st-ring)}.Button_module_ghost__fba1165e{background-color:var(--st-background);border:1px solid var(--st-background);box-shadow:none;color:var(--st-foreground)}.Button_module_ghost__fba1165e:not(:disabled):hover{background-color:var(--st-accent);border-color:var(--st-background);color:var(--st-accent-foreground)}.Button_module_ghost__fba1165e:focus-visible{box-shadow:var(--st-focus-ring-shadow)}.Button_module_destructive__fba1165e{background-color:var(--st-destructive);border-color:var(--st-destructive);color:var(--st-destructive-foreground)}.Button_module_destructive__fba1165e:not(:disabled):hover{background-color:var(--st-destructive-button-hover);border-color:var(--st-destructive-button-hover)}");var oV={button:"Button_module_button__fba1165e inputBase_module_focusRing__06c14ae4",block:"Button_module_block__fba1165e",primary:"Button_module_primary__fba1165e",secondary:"Button_module_secondary__fba1165e",outline:"Button_module_outline__fba1165e",ghost:"Button_module_ghost__fba1165e",destructive:"Button_module_destructive__fba1165e"};nW("@keyframes CircularProgress_module_circularRotate__c4a435cb{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes CircularProgress_module_circularDash__c4a435cb{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:1px,200px;stroke-dashoffset:-126px}}.CircularProgress_module_root__c4a435cb{animation:CircularProgress_module_circularRotate__c4a435cb 1.4s linear infinite}.CircularProgress_module_svg__c4a435cb{display:block}.CircularProgress_module_animatedCircle__c4a435cb{animation:CircularProgress_module_circularDash__c4a435cb 1.4s ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px,200px;stroke-dashoffset:0}");let oW=({size:e,label:t,thickness:r=3.6})=>{let{i18n:n,_:a}=nO();return rZ.createElement("div",{className:"CircularProgress_module_root__c4a435cb",style:{width:e,height:e}},rZ.createElement("svg",{className:"CircularProgress_module_svg__c4a435cb",viewBox:"22 22 44 44","aria-label":t??n._({id:"loading.label",message:"Loading"})},rZ.createElement("circle",{className:"CircularProgress_module_animatedCircle__c4a435cb",cx:44,cy:44,r:(44-r)/2,fill:"none",strokeWidth:r})))};function oG({variant:e,block:t=!0}){return nj(oV.button,oV[e],{[oV.block]:t})}let oY=e=>{let{as:t,children:r,icon:n,onClick:a,loading:o,disabled:i=o,block:s,variant:l,...c}=e,d=rZ.createElement(rZ.Fragment,null,n,rZ.createElement("span",null,r));return o&&(d=rZ.createElement(oW,{size:20})),rZ.createElement(t,{className:oG(e),onClick:a,disabled:i,...c},d)},oZ=e=>oY({type:"button",as:"button",...e}),oJ=e=>oY({...e,onKeyDown:t=>{e.onKeyDown?.(t),t.defaultPrevented||" "===t.key&&t.currentTarget.click()},as:"a"}),oQ={[c.Google]:{messageDescriptor:{id:"oauth.continueWithGoogle",message:"Continue with Google"}},[c.Microsoft]:{messageDescriptor:{id:"oauth.continueWithMicrosoft",message:"Continue with Microsoft"}},[c.HubSpot]:{messageDescriptor:{id:"oauth.continueWithHubSpot",message:"Continue with HubSpot"}},[c.Slack]:{messageDescriptor:{id:"oauth.continueWithSlack",message:"Continue with Slack"}},[c.GitHub]:{messageDescriptor:{id:"oauth.continueWithGitHub",message:"Continue with GitHub"}}},oX=({providerType:e,loginRedirectUrl:t,signupRedirectUrl:r,discoveryRedirectUrl:n,customScopes:a,providerParams:o,onSuccess:i})=>{let{i18n:s,_:l}=nO(),c=t2(aW).client,[d]=t2(aW).state,u=t2(nq),h=u.iconRegistry,m=nH(`oauth-${e}`,u.options),p=oQ[e],_=e,g=null;if(p){let{messageDescriptor:t}=p,r=h[e];_=s._(t),g=rZ.createElement(r,null)}let f=async()=>{let s=c.oauth[e];d.flowState.organization?await s.start({login_redirect_url:t,signup_redirect_url:r,custom_scopes:a,organization_id:d.flowState.organization.organization_id,provider_params:o}):await s.discovery.start({discovery_redirect_url:n,custom_scopes:a,provider_params:o}),i?.()};return rZ.createElement(oZ,{onClick:f,variant:"outline",icon:g,id:m},_)},o1=({customScopes:e,providerParams:t,cancelOnTapOutside:r})=>{let n,a=t2(aW).client,o=t2(aW).config,i=oU(),[s,l]=tG(),d=(n=tQ(!1),tZ(()=>(n.current=!0,()=>{n.current=!1}),[]),n),[u,h]=t2(aW).state,[m,p]=o$(),_=t0(async()=>{let e,{oneTap:t}=r1(a),n=await t.createOneTapClient();if(!n.success)return void("oauth_config_not_found"===n.reason?l(n2):"default_provider_not_allowed"===n.reason?l(n3):eP("Unable to load One Tap settings for project",n));let{client:i}=n;if(!d.current)return;e=u.flowState.organization?t.createOnSuccessHandler({organizationId:u.flowState.organization.organization_id,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})}):t.createOnDiscoverySuccessHandler({discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,onSuccess:t.redirectOnSuccess,onError:()=>h({type:"transition",screen:ao})});let s=await i.render({callback:e,style:{position:er.floating},cancelOnTapOutside:r});return d.current?(s.success||("unregistered_origin"===s.reason&&l(n1),"invalid_client"===s.reason&&l(n0),eP("Unable to render One Tap prompt",s)),i):void i.cancel()},[a,d,u.flowState.organization,o.oauthOptions?.signupRedirectURL,o.oauthOptions?.loginRedirectURL,o.oauthOptions?.discoveryRedirectURL,h,r]);if(tZ(()=>{let e;return _().then(t=>e=t).catch(e=>{eP("Unable to render One Tap prompt",e)}),()=>e?.cancel()},[_]),i)return null;let g=rZ.createElement(oX,{providerType:c.Google,loginRedirectUrl:o.oauthOptions?.loginRedirectURL,signupRedirectUrl:o.oauthOptions?.signupRedirectURL,discoveryRedirectUrl:o.oauthOptions?.discoveryRedirectURL,customScopes:e,providerParams:t,onSuccess:()=>p(c.Google)}),f=m===c.Google?rZ.createElement(nQ,null,g):g;return s?rZ.createElement(rZ.Fragment,null,rZ.createElement(n4,{error:s}),f):f};nW(".logo_module_darkInvert__4ffe6ba9{filter:invert(var(--st-dark-mode,0))}");var o0="logo_module_darkInvert__4ffe6ba9";let o2=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#4285F4",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#34A853",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#FBBC05",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#EA4335",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),o3=e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#F35325",d:"M1 1h8.57v8.57H1z"}),tm("path",{fill:"#81BC06",d:"M10.43 1H19v8.57h-8.57z"}),tm("path",{fill:"#05A6F0",d:"M1 10.43h8.57V19H1z"}),tm("path",{fill:"#FFBA08",d:"M10.43 10.43H19V19h-8.57z"})),o4={gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#C5221F",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09"}),tm("path",{fill:"#FBBC04",d:"m14.9 4.48-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#4285F4",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22"}),tm("path",{fill:"#34A853",d:"M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8z"}),tm("path",{fill:"#EA4335",d:"M10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{clipPath:"url(#a)"},tm("path",{fill:"#158FDA",d:"M6.58 17.2h10.25c1.2 0 2.17-.97 2.17-2.17V7.7c0-.64-.32-1.22-.87-1.54L12.77 3.1c-.72-.4-1.6-.4-2.3 0L4.39 6.6V15c0 1.21.98 2.2 2.2 2.2"}),tm("path",{fill:"url(#b)",d:"M8.61 15.82c.06-.66.48-1.24 1.09-1.5 0 0 5.55-3.11 8.3-4.73.85-.5 1-1.5 1-1.5V15a2.2 2.2 0 0 1-2.2 2.2h-6.65c-.8 0-1.46-.6-1.54-1.4"}),tm("path",{fill:"#01459B",d:"m17.83 5.96-9.55 5.27 1.9 1.16c.71.42 1.74.66 2.46.25l5.08-2.85A2.3 2.3 0 0 0 19 7.69c0-1.1-.76-1.47-1.17-1.73"}),tm("path",{fill:"#26AEE9",d:"M11.67 2.81q-.63 0-1.21.32L2.4 7.68l3.06 1.85 9.37-5.28-1.95-1.11q-.57-.33-1.2-.33"}),tm("path",{fill:"#0078D3",d:"M14.83 4.25 5.46 9.53l3.06 1.86 9.56-5.27-.25-.16z"}),tm("path",{fill:"url(#c)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"}),tm("g",{filter:"url(#d)"},tm("path",{fill:"url(#e)",d:"M1.88 5.42h7.5a.74.74 0 0 1 .75.74l-.03 7.32a.76.76 0 0 1-.76.76H1.9a.8.8 0 0 1-.78-.78l.03-7.33a.7.7 0 0 1 .72-.71"})),tm("path",{fill:"#fff",d:"M3.46 8.58q.28-.6.84-.94.64-.36 1.36-.36.69-.02 1.27.3.56.3.85.87.32.6.32 1.3.02.7-.28 1.36a2.2 2.2 0 0 1-1.1 1.06q-.52.21-1.05.21-.7.03-1.3-.3-.57-.3-.86-.87-.32-.6-.32-1.28-.02-.7.27-1.35m.95 2.15q.16.37.5.6t.75.21q.45 0 .8-.24.33-.24.47-.62.15-.41.13-.85 0-.44-.15-.85a1.4 1.4 0 0 0-.47-.63 1.3 1.3 0 0 0-.8-.23 1.3 1.3 0 0 0-1.25.86c-.22.57-.2 1.2.02 1.75"})),tm("defs",null,tm("linearGradient",{id:"b",x1:12.02,x2:19,y1:15.58,y2:12.64,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#4DE2FB"}),tm("stop",{offset:1,stopColor:"#28AEE8"})),tm("linearGradient",{id:"c",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("linearGradient",{id:"e",x1:5.63,x2:5.62,y1:5.42,y2:14.24,gradientUnits:"userSpaceOnUse"},tm("stop",{stopColor:"#1582D8"}),tm("stop",{offset:1,stopColor:"#0A64CC"})),tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M0 0h20v20H0z"})),tm("filter",{id:"d",width:53.58,height:53.4,x:-15.16,y:-10.87,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},tm("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),tm("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),tm("feOffset",{dx:6,dy:6}),tm("feGaussianBlur",{stdDeviation:11.14}),tm("feComposite",{in2:"hardAlpha",operator:"out"}),tm("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.38 0"}),tm("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_893_1954"}),tm("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_893_1954",result:"shape"})))),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#5F01D2",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"}))},o5=20,o8=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 25 25",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("path",{d:"M9.09 7.91L13.67 12.5L9.09 17.09L10.5 18.5L16.5 12.5L10.5 6.5L9.09 7.91Z",fill:"currentColor"})),o6=({size:e=o5,...t})=>rZ.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},rZ.createElement("g",{clipPath:"url(#clip0_221_1596)"},rZ.createElement("path",{d:"M17.5125 10.53C17.0025 7.9425 14.73 6 12 6C9.8325 6 7.95 7.23 7.0125 9.03C4.755 9.27 3 11.1825 3 13.5C3 15.9825 5.0175 18 7.5 18H17.25C19.32 18 21 16.32 21 14.25C21 12.27 19.4625 10.665 17.5125 10.53Z",fill:"currentColor"})),rZ.createElement("g",{clipPath:"url(#clip1_221_1596)"},rZ.createElement("path",{d:"M15.9684 13.1139L14.9987 14.0933L14.5152 13.6098L14.2501 13.3446L13.9849 13.6098L13.5001 14.0946L13.0152 13.6098L12.9054 13.4999H12.7501H12.6188H12.3532L12.2651 13.7504C12.0087 14.4788 11.3147 14.9999 10.5001 14.9999C9.46592 14.9999 8.62506 14.1591 8.62506 13.1249C8.62506 12.0908 9.46592 11.2499 10.5001 11.2499C11.3147 11.2499 12.0087 11.7711 12.2651 12.4994L12.3532 12.7499H12.6188H15.5969L15.9684 13.1139ZM9.00006 13.1249C9.00006 13.9508 9.6742 14.6249 10.5001 14.6249C11.3259 14.6249 12.0001 13.9508 12.0001 13.1249C12.0001 12.2991 11.3259 11.6249 10.5001 11.6249C9.6742 11.6249 9.00006 12.2991 9.00006 13.1249Z",fill:"var(--st-background)",stroke:"var(--st-background)",strokeWidth:"0.75"})),rZ.createElement("defs",null,rZ.createElement("clipPath",{id:"clip0_221_1596"},rZ.createElement("rect",{width:"18",height:"18",transform:"translate(3 3)"})),rZ.createElement("clipPath",{id:"clip1_221_1596"},rZ.createElement("rect",{width:"8.25",height:"6",transform:"translate(8.25006 10.1251)"})))),o7={"google-workspace":"google","microsoft-entra":"microsoft",okta:"okta"},o9=({connection:e,onStart:t})=>{let{i18n:r,_:n}=nO(),a=t2(aW).client,{ssoOptions:o}=t2(aW).config,{iconRegistry:i,options:s}=t2(nq),{connection_id:l,display_name:c,identity_provider:d}=e,u=nH(`sso-${c}`,s),h=i[o7[d]]??o6;return rZ.createElement(oZ,{variant:"outline",onClick:()=>a.sso.start({connection_id:l,signup_redirect_url:o?.signupRedirectURL,login_redirect_url:o?.loginRedirectURL}).then(()=>{t?.(e)}),icon:rZ.createElement(h,null),id:u},r._({id:"provider.continueWith",message:"Continue with {display_name}",values:{display_name:c}}))};function ie(){let[e,t]=tG(0);return{expiration:e,start:e=>{t(Date.now()+1e3*e)},clear:()=>{t(0)}}}let it=e=>Math.max(0,Math.ceil((e-Date.now())/1e3)),ir=e=>{let[t,r]=tG(()=>it(e)),n=t<=0;return tZ(()=>{let t=()=>r(it(e));if(t(),Date.now()>=e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[n,e]),[t,!n]},ia=()=>{let e;return(e="u">typeof window&&window)&&(/Chromatic/.test(e.navigator.userAgent)||/chromatic=true/.test(e.location.href))?"chromatic-ignore":void 0};nW(".VerticalTransition_module_container__9366f503{display:grid;overflow:clip;width:fit-content}.VerticalTransition_module_primary__9366f503,.VerticalTransition_module_secondary__9366f503{grid-area:1/1/2/2;transition:translate var(--st-transition-duration) ease-in-out}.VerticalTransition_module_secondary__9366f503{translate:0 100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_primary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_primary__9366f503{translate:0 -100%}.VerticalTransition_module_container__9366f503.VerticalTransition_module_triggered__9366f503 .VerticalTransition_module_secondary__9366f503,.VerticalTransition_module_hoverTrigger__9366f503:is(:hover,:focus) .VerticalTransition_module_canTriggerByHover__9366f503 .VerticalTransition_module_secondary__9366f503{translate:0 0}");function io(e){let[t,r]=tG(!1);return tZ(()=>{if(!t||!e)return;let n=setTimeout(()=>r(!1),1e3*e);return()=>clearTimeout(n)},[t,e]),[t,r]}let ii=({primary:e,secondary:t,rootClassName:r,className:n,trigger:a="manual",triggered:o})=>rZ.createElement("div",{className:nj(r,"VerticalTransition_module_container__9366f503",{VerticalTransition_module_triggered__9366f503:o,VerticalTransition_module_canTriggerByHover__9366f503:"hover"===a}),"aria-live":"manual"===a?"polite":void 0},rZ.createElement("div",{className:nj(n,"VerticalTransition_module_primary__9366f503"),"aria-hidden":"manual"===a?o:void 0},e),rZ.createElement("div",{className:nj(n,"VerticalTransition_module_secondary__9366f503"),"aria-hidden":"manual"===a?!o:void 0},t)),is=e=>{if(e&&"object"==typeof e&&"error_type"in e&&"string"==typeof e.error_type)return e.error_type},il={invalid_email:{id:"error.invalidEmail",message:"Email format is invalid."},invalid_phone_number:{id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:"error.unsubscribedPhoneNumber",message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:"error.inactiveEmail",message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:"error.unauthorizedCredentials",message:"Unauthorized credentials."},user_unauthenticated:{id:"error.userUnauthenticated",message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:"error.emailNotFound",message:"Email not found."},unable_to_auth_magic_link:{id:"error.unableToAuthMagicLink",message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:"error.noUserPassword",message:"Password not found for this user. Please try again."},breached_password:{id:"error.breachedPassword",message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:"error.resetPassword",message:"Password must be reset."},oauth_token_not_found:{id:"error.oauthTokenNotFound",message:"OAuth Token could not be found."},invalid_code:{id:"error.invalidCode",message:"Code format is invalid, please try again."},member_password_not_found:{id:"error.memberPasswordNotFound",message:"Member password not found."},oauth_flow_callback_error:{id:"error.oauthFlowCallbackError",message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:"error.unauthorizedAction",message:"Unauthorized action."},user_lock_limit_reached:{id:"error.userLockLimitReached",message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:"error.invalidSessionToken",message:"Invalid session token."},session_not_found:{id:"error.sessionNotFound",message:"Session not found."},invalid_phone_number_country_code:{id:"error.invalidPhoneNumberCountryCode",message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:"error.otpCodeNotFound",message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:"error.duplicatePhoneNumber",message:"A member with the specified phone number already exists for this organization."}},ic=(e,t)=>{let r=il[is(e)];return r?t(r):e.error_message};nW(".Column_module_column__efe9ce44{display:flex;flex-direction:column}");let id=rs(({as:e="div",gap:t,className:r,style:n,...a},o)=>{let i={...n};return null!=t&&(i.gap=1===t?"var(--st-spacing)":`var(--st-spacing-${t})`),rZ.createElement(e,{ref:o,className:nj(r,"Column_module_column__efe9ce44"),style:i,...a})});function iu(e){var t;let r;return Number.isNaN(r=parseFloat(t=window.getComputedStyle(e).getPropertyValue("--st-transition-duration")))?0:t.endsWith("ms")?r:1e3*r}nW(".Toast_module_container__ac93617f{bottom:10vh;display:flex;justify-content:center;left:0;pointer-events:none;position:fixed;right:0}.Toast_module_toast__ac93617f{background:var(--st-background);border:1px solid var(--st-border);border-radius:var(--st-rounded-md);box-shadow:0 2px 4px rgba(0,0,0,.05);color:var(--st-destructive);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm);padding:var(--st-spacing-2) var(--st-spacing-3);pointer-events:auto;position:absolute;top:0;white-space:pre}");let ih=[];function im(e){for(let t of ih)t(e)}let ip={opacity:0,translate:"0 var(--st-spacing-2)"},i_={opacity:1,translate:"0"};function ig(e,t){e.animate([i_,ip],{duration:t,easing:"ease-in-out"}).addEventListener("finish",()=>e.remove())}let iy=()=>{let e=tQ(null),t=tQ(),r=tQ();return tZ(()=>{let n=n=>{if(!e.current)return;let a=2*iu(e.current),o=document.createElement("div");o.textContent=n.message,o.className="Toast_module_toast__ac93617f",t.current&&ig(t.current,a),e.current.appendChild(o),t.current=o,o.animate([ip,i_],{duration:a,easing:"ease-in-out"}),r.current=window.setTimeout(()=>{t.current&&(ig(t.current,a),t.current=void 0)},n.durationMs??1e4)};return ih.push(n),()=>{clearTimeout(r.current);let e=ih.indexOf(n);-1!==e&&ih.splice(e,1)}},[]),rZ.createElement("div",{className:"Toast_module_container__ac93617f",ref:e,"aria-live":"polite"})};nW(".Divider_module_container__1fb7194e{align-items:center;display:flex;gap:var(--st-spacing-2);line-height:var(--st-line-height-xs)}.Divider_module_bar__1fb7194e{border-bottom:1px solid var(--st-divider-color);flex:1 1 auto}");var iv="Divider_module_bar__1fb7194e";let ib=()=>{let{i18n:e,_:t}=nO();return rZ.createElement("div",{role:"separator",className:"Divider_module_container__1fb7194e"},rZ.createElement("div",{className:iv}),rZ.createElement(nZ,{variant:"helper"},e._({id:"methodDivider.text",message:"or"})),rZ.createElement("div",{className:iv}))},iw=e=>"children"in e?rZ.createElement(id,{gap:2},e.children):rZ.createElement(id,{gap:4},e.top&&rZ.createElement(iw,null,e.top),rZ.createElement(ib,null),rZ.createElement(iw,null,e.bottom)),ik=({header:e,description:t,children:r,additionalActions:n,resend:a,sendMagicLink:o,goBack:i})=>{let{i18n:s,_:l}=nO(),[c,d]=tG(!1),[u,h]=tG(!1),m=ie(),[p,_]=ir(m.expiration),g=a&&rZ.createElement(oZ,{variant:"outline",onClick:async()=>{d(!0);try{await a(),m.start(15)}catch(e){im({message:ic(e,l)}),m.clear()}finally{d(!1)}},loading:c,disabled:c||_},rZ.createElement(ii,{className:ia(),triggered:_,primary:s._({id:"button.resendEmail",message:"Resend email"}),secondary:s._({id:"button.emailResent",message:"Email resent! Try again in {timeRemaining}s",values:{timeRemaining:p}})})),f=i&&rZ.createElement(oZ,{variant:"ghost",onClick:i},s._({id:"button.goBack",message:"Go back"})),y=o?rZ.createElement(iw,{top:rZ.createElement(rZ.Fragment,null,n,g),bottom:rZ.createElement(rZ.Fragment,null,rZ.createElement(oZ,{variant:"outline",onClick:()=>{h(!0),o().catch(()=>h(!1))},loading:u},s._({id:"button.loginWithoutPassword",message:"Log in without a password"})),f)}):rZ.createElement(iw,null,n,g,f);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e),rZ.createElement(nZ,null,t),r,y)},iS={messageDescriptor:{id:"link.openInGmail",message:"Open in Gmail"},icon:"gmail",getUrl:e=>{let t=encodeURIComponent(e?`from:@${e} in:anywhere`:"in:anywhere");return`https://mail.google.com/mail/u/0/#search/${t}`}},iE={messageDescriptor:{id:"link.openInYahoo",message:"Open in Yahoo"},icon:"yahoo",getUrl:e=>e?`https://mail.yahoo.com/d/search/keyword=${e}`:"https://mail.yahoo.com/d/search/referrer=unread"},iC={messageDescriptor:{id:"link.openInOutlook",message:"Open in Outlook"},icon:"outlook",getUrl:()=>"https://outlook.office.com/mail/0/inbox"},iP=({providerInfo:{icon:e,messageDescriptor:t,getUrl:r},emailDomain:n})=>{let{i18n:a,_:o}=nO(),i=r(n),{iconRegistry:s}=t2(nq),l=s[e];return rZ.createElement(oJ,{variant:"outline",href:i,target:"_blank",rel:"noopener noreferrer",icon:rZ.createElement(l,null)},a._(t))},iT=({emailDomain:e,email:t,goBack:r,resend:n,countdown:a,isSubmitting:o})=>{let{i18n:i,_:s}=nO(),[l,c]=ir(a?.expiration??0);return rZ.createElement(ik,{header:i._({id:"emailConfirmation.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:t}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:e,providerInfo:iS}),rZ.createElement(iP,{emailDomain:e,providerInfo:iE}),rZ.createElement(iP,{emailDomain:e,providerInfo:iC}),n&&a&&rZ.createElement(oZ,{variant:"outline",disabled:o||c,onClick:()=>{a.start(15),n().catch(()=>a.clear())}},rZ.createElement(ii,{className:ia(),primary:i._({id:"button.resendEmail",message:"Resend email"}),secondary:i._({id:"emailConfirmation.emailSent",message:"Email sent! Try again in {timeRemaining}s",values:{timeRemaining:l}}),triggered:c})),r&&rZ.createElement(oZ,{variant:"ghost",onClick:r},i._({id:"button.goBack",message:"Go back"})))})},iO=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.discovery.send",(e,{arg:{email:n}})=>t.magicLinks.email.discovery.send({email_address:n,discovery_redirect_url:r.emailMagicLinksOptions?.discoveryRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})}})},iA=()=>{let[,e]=t2(aW).state,t=t2(aW).client,r=t2(aW).config;return oM("stytch.magicLinks.email.loginOrSignup",(e,{arg:{email:n,organization_id:a}})=>t.magicLinks.email.loginOrSignup({email_address:n,organization_id:a,login_redirect_url:r.emailMagicLinksOptions?.loginRedirectURL,signup_redirect_url:r.emailMagicLinksOptions?.signupRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}),{onSuccess:()=>{e({type:"transition",screen:ar})},onError:e=>{eP(e)}})},ix=()=>{let e=t2(aW).client,t=t2(aW).config,[r,n]=tG(()=>{let{emailDomains:t}=r1(e).bootstrap.getSync();return t});return(tZ(()=>{r1(e).bootstrap.getAsync().then(({emailDomains:e})=>{n(e)})},[e]),t.emailMagicLinksOptions?.domainHint)?t.emailMagicLinksOptions?.domainHint:1===r.length?r[0]:null},iD=()=>{let[e,t]=t2(aW).state,r=ix(),n=ie(),{trigger:a,isMutating:o}=iA(),{trigger:i,isMutating:l}=iO(),c=e.formState.emailState.userSuppliedEmail,d=async()=>{e.flowState.type===s.Discovery?await i({email:c}):e.flowState.type===s.Organization&&e.flowState.organization&&await a({email:c,organization_id:e.flowState.organization.organization_id})};return rZ.createElement(iT,{emailDomain:r,email:c,goBack:()=>{t({type:"set_user_supplied_email",email:""}),t({type:"transition",screen:at})},resend:d,countdown:n,isSubmitting:o||l})},iz={"data-1p-ignore":!0},iM=(e="s")=>e+tQ(((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),""))()).current;nW(".VisuallyHidden_module_hidden__c5a4c7ad,:not(:focus):not(:focus-within) .VisuallyHidden_module_focusable__c5a4c7ad{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap;word-wrap:normal}");let iI=({children:e,focusable:t})=>rZ.createElement("div",{className:nj(t?"VisuallyHidden_module_focusable__c5a4c7ad":"VisuallyHidden_module_hidden__c5a4c7ad")},e),iR=e=>{let t=tQ(e);tZ(()=>t.current(),[])},iL=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g,iB=({children:e,...t})=>{let r=t1(()=>(e=>{let t=e.split(iL),r=Array.from(e.matchAll(iL)).map(e=>e[0]),n=[];for(;t.length||r.length;)if(t.length&&n.push(t.shift()),r.length){let e=r.shift();n.push(rZ.createElement("a",{key:e+"__"+String(r.length),href:e,target:"_blank",rel:"noreferrer"},e))}return n})(e),[e]),[n,a]=tG(!1);return iR(()=>a(!0)),rZ.createElement("div",{"aria-live":"polite"},n&&rZ.createElement(nZ,{...t,variant:"helper",color:"destructive",key:e},r))};nW(".Input_module_label__a0aad2f4{color:var(--st-foreground);display:block;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-semibold);line-height:var(--st-line-height-sm);margin-bottom:var(--st-spacing-0_5);width:fit-content}.Input_module_input__a0aad2f4{padding:var(--st-spacing-2) var(--st-spacing-3);width:100%}.-st-mobile .Input_module_input__a0aad2f4{padding:var(--st-spacing-3)}.Input_module_input__a0aad2f4:disabled{color:var(--st-muted-foreground)}.Input_module_input__a0aad2f4::placeholder{color:var(--st-muted-foreground)}.Input_module_inputWrapper__a0aad2f4{display:flex;position:relative}.Input_module_action__a0aad2f4{inset-inline-end:var(--st-spacing-2);position:absolute;scale:.75;transform-origin:center right}[dir=rtl] .Input_module_action__a0aad2f4{transform-origin:center left}.Input_module_action__a0aad2f4:dir(rtl){transform-origin:center left}.Input_module_error__a0aad2f4{margin-top:var(--st-spacing-2)}");let iN=rs(({className:e,label:t,hideLabel:r,action:n,id:a,containerClassName:o,error:i,...s},l)=>{let c=t2(nq),d=a+(c.options?.inputIdSuffix??""),u=iM(),h=tQ(null),[m,p]=tG();tJ(()=>{h.current&&p(h.current.getBoundingClientRect().width)},[n]);let _=rZ.createElement("label",{className:"Input_module_label__a0aad2f4",htmlFor:d},t);return i&&(s["aria-invalid"]=!0,s["aria-errormessage"]=u),rZ.createElement("div",{className:nj(o,"Input_module_container__a0aad2f4")},r?rZ.createElement(iI,null,_):_,rZ.createElement("div",{className:"Input_module_inputWrapper__a0aad2f4"},rZ.createElement("input",{ref:l,id:d,className:nj(e,"Input_module_input__a0aad2f4 inputBase_module_inputBase__06c14ae4 inputBase_module_focusRing__06c14ae4"),style:m?{paddingInlineEnd:`calc(${m}px + var(--st-spacing-4))`}:void 0,...s}),n&&rZ.createElement("div",{ref:h,className:"Input_module_action__a0aad2f4"},n)),i&&rZ.createElement(iB,{id:u,className:"Input_module_error__a0aad2f4","aria-live":"polite"},i))}),iU=({email:e,setEmail:t,hasPasskeys:r=!1,...n})=>{let{i18n:a,_:o}=nO();return rZ.createElement(iN,{id:"email-input",label:a._({id:"formField.email.label",message:"Email"}),placeholder:a._({id:"formField.email.placeholder",message:"example@email.com"}),type:"email",autoComplete:r?"username webauthn":"email",value:e,onChange:e=>t(e.target.value),required:!0,...r?iz:{},...n})},iF=({email:e})=>{let[,t]=t2(aW).state,{i18n:r,_:n}=nO();return rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"use_password_auth",email:e})}},r._({id:"button.usePassword",message:"Use a password instead"}))},iq={oauth:void 0,sso:"sso",emailMagicLinks:"magic_link",emailOtp:"email_otp",passwords:"password"},iH={[c.Google]:"google_oauth",[c.Microsoft]:"microsoft_oauth",[c.HubSpot]:"hubspot_oauth",[c.Slack]:"slack_oauth",[c.GitHub]:"github_oauth"},iK=Object.fromEntries(Object.entries(iq).map(([e,t])=>[t,e])),ij=Object.fromEntries(Object.entries(iH).map(([e,t])=>[t,e])),i$=e=>e in ij?"oauth":iK[e],iV=Object.values(c),iW=(e,t)=>e.flatMap(e=>{if("oauth"===e.id)return t.map(e=>{let t=iH["string"==typeof e?e:e.type];if(t)return t});{let t=iq[e.id];if(t)return t}}).filter(aN),iG=()=>{let e,[t]=t2(aW).state,r=t2(aW).config,{restrictedAuthMethods:n,hasPrimaryAuthMethods:a}=(()=>{let[e]=t2(aW).state,{primaryAuthMethods:t}=e.primary;return{restrictedAuthMethods:t1(()=>e.primary.primaryAuthMethods?new Set(e.primary.primaryAuthMethods):e.flowState.organization?.auth_methods==="RESTRICTED"?new Set(e.flowState.organization?.allowed_auth_methods??[]):void 0,[e.flowState.organization?.allowed_auth_methods,e.flowState.organization?.auth_methods,e.primary.primaryAuthMethods]),hasPrimaryAuthMethods:!!t}})(),o=(e=t2(aW).config,t1(()=>e.oauthOptions?.providers?e.oauthOptions.providers.map(aJ):[],[e.oauthOptions?.providers])),i=t1(()=>iW(r.products,o),[r.products,o]),s=t1(()=>{if(!n)return i;let e=i.filter(e=>n.has(e));return e.length>0||!a?e:t.flowState.organization?.auth_methods==="RESTRICTED"?iW(r.organizationProducts,iV).filter(e=>n.has(e)):["magic_link"]},[r.organizationProducts,i,a,n,t.flowState.organization?.auth_methods]);return{products:t1(()=>[...new Set(s.map(i$).filter(aN))].map(e=>r.organizationProducts.find(t=>t.id===e)).filter(aN),[s,r.organizationProducts]),oauthProviderSettings:t1(()=>s.map(e=>{let t=ij[e];if(t)return o.find(e=>e.type===t)??aJ(t)}).filter(aN),[s,o])}},iY=()=>new Date(Date.now()+6e5),iZ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.discovery.send",(e,{arg:{email:t}})=>r.otps.email.discovery.send({email_address:t,login_template_id:n.emailOtpOptions?.loginTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iJ=({throwOnError:e}={})=>{let[,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config;return oM("stytch.otps.email.loginOrSignup",(e,{arg:{email:t,organization_id:a}})=>r.otps.email.loginOrSignup({email_address:t,organization_id:a,login_template_id:n.emailOtpOptions?.loginTemplateId,signup_template_id:n.emailOtpOptions?.signupTemplateId,locale:n.emailOtpOptions?.locale}),{onSuccess:()=>{t({type:"send_email_otp",codeExpiration:iY()})},throwOnError:e})},iQ=["email_jit_provisioning_not_allowed","invalid_email_for_jit_provisioning"],iX=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),o=(()=>{let{i18n:e,_:t}=nO();return(r,{email:n,org:a})=>iQ.includes(r.error_type)?e._({id:"error.jitIneligible",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin",values:{email:n,organizationName:a}}):ic(r,t)})(),{i18n:i,_:s}=nO(),{products:l}=iG(),c=oB(l,"emailMagicLinks"),d=oB(l,"emailOtp"),u=t.primary.email,h=u||n,{trigger:m,error:p,isMutating:_}=iA(),{trigger:g,error:f,isMutating:y}=iJ(),v=_||y,b=p||f,w=t.flowState.organization;if(!w)return rZ.createElement(rZ.Fragment,null);let k=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:h}),c&&d?r({type:"transition",screen:av,history:"push"}):c?m({email:h,organization_id:w.organization_id}):d&&g({email:h,organization_id:w.organization_id})};return u?rZ.createElement(id,{gap:2},l.filter(e=>"emailMagicLinks"===e.id||"emailOtp"===e.id).map(e=>{switch(e.id){case"emailMagicLinks":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),m({email:h,organization_id:w.organization_id})},loading:_,disabled:v,variant:"outline"},i._({id:"button.emailLink",message:"Email me a link"}));case"emailOtp":return rZ.createElement(oZ,{key:e.id,onClick:()=>{r({type:"set_user_supplied_email",email:h}),g({email:h,organization_id:w.organization_id})},loading:y,disabled:v,variant:"outline"},i._({id:"button.emailCode",message:"Email me a code"}))}}),e&&rZ.createElement(iF,{email:h})):rZ.createElement(id,{as:"form",onSubmit:k,gap:2},rZ.createElement(iU,{email:h,setEmail:a,hideLabel:!0,error:b?o(b,{email:h,org:w.organization_name}):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:v},i._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:h}))},i1=({showPasswordButton:e})=>{let[t,r]=t2(aW).state,[n,a]=tG(t.formState.passwordState.email),{i18n:o,_:i}=nO(),{products:s}=iG(),l=s.some(e=>"emailMagicLinks"===e.id),c=s.some(e=>"emailOtp"===e.id),{trigger:d,error:u,isMutating:h}=iO(),{trigger:m,error:p,isMutating:_}=iZ(),g=async e=>{e.preventDefault(),r({type:"set_user_supplied_email",email:n}),l&&c?r({type:"transition",screen:av,history:"push"}):l?d({email:n}):c&&m({email:n})},f=u||p;return rZ.createElement(id,{as:"form",onSubmit:g,gap:2},rZ.createElement(iU,{email:n,setEmail:a,hideLabel:!0,error:f?ic(f,i):void 0}),rZ.createElement(oZ,{type:"submit",variant:"primary",loading:h||_},o._({id:"button.continueWithEmail",message:"Continue with email"})),e&&rZ.createElement(iF,{email:n}))},i0={emailMagicLinks:{messageDescriptor:{id:"emailMethodSelection.link",message:"Email me a login link"}},emailOtp:{messageDescriptor:{id:"emailMethodSelection.code",message:"Email me a login code"}}},i2=()=>{let{products:e}=iG(),{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{trigger:o,isMutating:i,error:l,reset:c}=iO(),{trigger:d,isMutating:u,error:h,reset:m}=iZ(),{trigger:p,isMutating:_,error:g,reset:f}=iA(),{trigger:y,isMutating:v,error:b,reset:w}=iJ(),k=i||u||_||v,S=l||h||g||b,E=t1(()=>e.map(e=>{let t=i0[e.id];if(t)return{option:e.id,messageDescriptor:t.messageDescriptor}}).filter(aN),[e]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"emailMethodSelection.title",message:"Select how you’d like to continue"})),rZ.createElement(iw,null,E.map(({option:e,messageDescriptor:r})=>rZ.createElement(oZ,{key:e,variant:"outline",disabled:k,onClick:()=>{switch(c(),m(),f(),w(),e){case"emailMagicLinks":n.flowState.type===s.Discovery?o({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&p({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id});break;case"emailOtp":n.flowState.type===s.Discovery?d({email:n.formState.emailState.userSuppliedEmail}):n.flowState.type===s.Organization&&n.flowState.organization&&y({email:n.formState.emailState.userSuppliedEmail,organization_id:n.flowState.organization.organization_id})}}},t._(r))),S&&rZ.createElement(iB,null,ic(S,r)),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{a({type:"navigate_back"})}},t._({id:"button.goBack",message:"Go back"}))))};nW(".Loading_module_loadingScreen__1c53715a{display:flex;justify-content:center}");let i3=()=>{let{i18n:e,_:t}=nO();return tm(nZ,{variant:"header",align:"center"},e._({id:"login.loading",message:"Logging in..."}))},i4=()=>tm("div",{className:"Loading_module_loadingScreen__1c53715a"},tm(oW,{size:32})),i5=({isSubmitting:e,resendOTP:t,countdown:r})=>{let{i18n:n,_:a}=nO(),[o,i]=ir(r.expiration);return rZ.createElement(oZ,{variant:"outline",disabled:e||i,onClick:()=>{r.start(15),t().catch(()=>r.clear())}},rZ.createElement(ii,{className:ia(),primary:n._({id:"passcode.resendCode",message:"Resend code"}),secondary:n._({id:"passcode.codeSent",message:"Code sent! Try again in {timeRemaining}s",values:{timeRemaining:o}}),triggered:i}))};nW(".AnimatedContainer_module_container__fb438508{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--st-transition-duration) ease-out}.AnimatedContainer_module_open__fb438508{grid-template-rows:1fr}.AnimatedContainer_module_inner__fb438508{min-height:0;overflow:clip}");let i8=({isOpen:e,children:t})=>rZ.createElement("div",{className:nj("AnimatedContainer_module_container__fb438508",{AnimatedContainer_module_open__fb438508:e}),"aria-live":"polite"},rZ.createElement("div",{className:"AnimatedContainer_module_inner__fb438508","aria-hidden":!e},t));nW(".LoadingBar_module_container__3a991498{background-color:var(--st-muted);border-radius:var(--st-rounded-full);height:var(--st-spacing);overflow:clip}.LoadingBar_module_progress__3a991498{animation:LoadingBar_module_loading__3a991498 10s cubic-bezier(.22,1,.36,1);background-color:var(--st-primary);height:100%;width:100%}@keyframes LoadingBar_module_loading__3a991498{0%{transform:translateX(-100%)}to{transform:translateX(-1%)}}");let i6=({isLoading:e})=>rZ.createElement("div",{role:"progressbar",className:"LoadingBar_module_container__3a991498"},e&&rZ.createElement("div",{className:"LoadingBar_module_progress__3a991498"}));nW(".OTPEntry_module_progressInner__6b10f31d{padding-top:var(--st-spacing-2)}");var i7=Object.defineProperty,i9=Object.defineProperties,se=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,sa=(e,t,r)=>t in e?i7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,so=tI({}),si=rs((e,t)=>{let r;var n,a,o,i,s,{value:l,onChange:c,maxLength:d,textAlign:u="left",pattern:h,placeholder:m,inputMode:p="numeric",onComplete:_,pushPasswordManagerStrategy:g="increase-width",pasteTransformer:f,containerClassName:y,noScriptCSSFallback:v=sl,render:b,children:w}=e,k=((e,t)=>{var r={};for(var n in e)sr.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&st)for(var n of st(e))0>t.indexOf(n)&&sn.call(e,n)&&(r[n]=e[n]);return r})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[S,E]=tG("string"==typeof k.defaultValue?k.defaultValue:""),C=null!=l?l:S,P=(r=tQ(),tZ(()=>{r.current=C}),r.current),T=t0(e=>{null==c||c(e),E(e)},[c]),O=t1(()=>h?"string"==typeof h?new RegExp(h):h:null,[h]),A=tQ(null),x=tQ(null),D=tQ({value:C,onChange:T,isIOS:"u">typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),z=tQ({prev:[null==(o=A.current)?void 0:o.selectionStart,null==(i=A.current)?void 0:i.selectionEnd,null==(s=A.current)?void 0:s.selectionDirection]});tX(t,()=>A.current,[]),tZ(()=>{let e=A.current,t=x.current;if(!e||!t)return;function r(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,r=e.selectionEnd,n=e.selectionDirection,a=e.maxLength,o=e.value,i=z.current.prev,s=-1,l=-1,c;if(0!==o.length&&null!==t&&null!==r){let e=t===r,n=t===o.length&&o.length<a;if(e&&!n){if(0===t)s=0,l=1,c="forward";else if(t===a)s=t-1,l=t,c="backward";else if(a>1&&o.length>1){let e=0;if(null!==i[0]&&null!==i[1]){c=t<i[1]?"backward":"forward";let r=i[0]===i[1]&&i[0]<a;"backward"!==c||r||(e=-1)}s=e+t,l=e+t+1}}-1!==s&&-1!==l&&s!==l&&A.current.setSelectionRange(s,l,c)}let d=-1!==s?s:t,u=-1!==l?l:r,h=null!=c?c:n;N(d),F(u),z.current.prev=[d,u,h]}if(D.current.value!==e.value&&D.current.onChange(e.value),z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",r,{capture:!0}),r(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";ss(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),ss(e.sheet,`[data-input-otp]:autofill { ${t} }`),ss(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),ss(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),ss(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let n=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};n();let a=new ResizeObserver(n);return a.observe(e),()=>{document.removeEventListener("selectionchange",r,{capture:!0}),a.disconnect()}},[]);let[M,I]=tG(!1),[R,L]=tG(!1),[B,N]=tG(null),[U,F]=tG(null);tZ(()=>{var e;setTimeout(e=()=>{var e,t,r,n;null==(e=A.current)||e.dispatchEvent(new Event("input"));let a=null==(t=A.current)?void 0:t.selectionStart,o=null==(r=A.current)?void 0:r.selectionEnd,i=null==(n=A.current)?void 0:n.selectionDirection;null!==a&&null!==o&&(N(a),F(o),z.current.prev=[a,o,i])},0),setTimeout(e,10),setTimeout(e,50)},[C,R]),tZ(()=>{void 0!==P&&C!==P&&P.length<d&&C.length===d&&(null==_||_(C))},[d,_,P,C]);let q=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,o]=tG(!1),[i,s]=tG(!1),[l,c]=tG(!1),d=t1(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&i,[a,i,r]),u=t0(()=>{let n=e.current,a=t.current;if(!n||!a||l||"none"===r)return;let i=n.getBoundingClientRect().left+n.offsetWidth,s=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,s)===n||(o(!0),c(!0))},[e,t,l,r]);return tZ(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let a=setInterval(n,1e3);return()=>{clearInterval(a)}},[e,r]),tZ(()=>{let e=n||document.activeElement===t.current;if("none"===r||!e)return;let a=setTimeout(u,0),o=setTimeout(u,2e3),i=setTimeout(u,5e3),s=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(a),clearTimeout(o),clearTimeout(i),clearTimeout(s)}},[t,n,r,u]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:x,inputRef:A,pushPasswordManagerStrategy:g,isFocused:R}),H=t0(e=>{let t=e.currentTarget.value.slice(0,d);t.length>0&&O&&!O.test(t)?e.preventDefault():("string"==typeof P&&t.length<P.length&&document.dispatchEvent(new Event("selectionchange")),T(t))},[d,T,P,O]),K=t0(()=>{var e;if(A.current){let t=Math.min(A.current.value.length,d-1),r=A.current.value.length;null==(e=A.current)||e.setSelectionRange(t,r),N(t),F(r)}L(!0)},[d]),j=t0(e=>{var t,r;let n=A.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!n))return;let a=e.clipboardData.getData("text/plain"),o=f?f(a):a;e.preventDefault();let i=null==(t=A.current)?void 0:t.selectionStart,s=null==(r=A.current)?void 0:r.selectionEnd,l=(i!==s?C.slice(0,i)+o+C.slice(s):C.slice(0,i)+o+C.slice(i)).slice(0,d);if(l.length>0&&O&&!O.test(l))return;n.value=l,T(l);let c=Math.min(l.length,d-1),u=l.length;n.setSelectionRange(c,u),N(c),F(u)},[d,T,O,C]),$=t1(()=>({position:"relative",cursor:k.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[k.disabled]),V=t1(()=>({position:"absolute",inset:0,width:q.willPushPWMBadge?`calc(100% + ${q.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:q.willPushPWMBadge?`inset(0 ${q.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:u,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[q.PWM_BADGE_SPACE_WIDTH,q.willPushPWMBadge,u]),W=t1(()=>tm("input",i9(((e,t)=>{for(var r in t||(t={}))sr.call(t,r)&&sa(e,r,t[r]);if(st)for(var r of st(t))sn.call(t,r)&&sa(e,r,t[r]);return e})({autoComplete:k.autoComplete||"one-time-code"},k),se({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===C.length||void 0,"data-input-otp-mss":B,"data-input-otp-mse":U,inputMode:p,pattern:null==O?void 0:O.source,"aria-placeholder":m,style:V,maxLength:d,value:C,ref:A,onPaste:e=>{var t;j(e),null==(t=k.onPaste)||t.call(k,e)},onChange:H,onMouseOver:e=>{var t;I(!0),null==(t=k.onMouseOver)||t.call(k,e)},onMouseLeave:e=>{var t;I(!1),null==(t=k.onMouseLeave)||t.call(k,e)},onFocus:e=>{var t;K(),null==(t=k.onFocus)||t.call(k,e)},onBlur:e=>{var t;L(!1),null==(t=k.onBlur)||t.call(k,e)}}))),[H,K,j,p,V,d,U,B,k,null==O?void 0:O.source,C]),G=t1(()=>({slots:Array.from({length:d}).map((e,t)=>{var r;let n=R&&null!==B&&null!==U&&(B===U&&t===B||t>=B&&t<U),a=void 0!==C[t]?C[t]:null;return{char:a,placeholderChar:void 0!==C[0]?null:null!=(r=null==m?void 0:m[t])?r:null,isActive:n,hasFakeCaret:n&&null===a}}),isFocused:R,isHovering:!k.disabled&&M}),[R,M,d,U,B,k.disabled,C]),Y=t1(()=>b?b(G):tm(so.Provider,{value:G},w),[w,G,b]);return tm(tg,null,null!==v&&tm("noscript",null,tm("style",null,v)),tm("div",{ref:x,"data-input-otp-container":!0,style:$,className:y},Y,tm("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))});function ss(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}si.displayName="Input";var sl=`
28
28
  [data-input-otp] {
29
29
  --nojs-bg: white !important;
30
30
  --nojs-fg: black !important;
@@ -43,7 +43,7 @@ products: [`+r.map(e=>`${a}.${"string"==typeof e?e:e.id}`).join(", ")+"]"),Error
43
43
  --nojs-bg: black !important;
44
44
  --nojs-fg: white !important;
45
45
  }
46
- }`;nW(".OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*64)}.-st-mobile .OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*70)}.OtpInput_module_slotsContainer__1e43b599{display:flex;gap:var(--st-spacing-2);justify-content:start;width:fit-content}.OtpInput_module_otpSlot__1e43b599{align-items:center;display:flex;height:calc(var(--st-spacing)*9);justify-content:center;width:calc(var(--st-spacing)*9)}.-st-mobile .OtpInput_module_otpSlot__1e43b599{height:calc(var(--st-spacing)*10);width:calc(var(--st-spacing)*10)}.OtpInput_module_disabled__1e43b599 .OtpInput_module_otpSlot__1e43b599{color:var(--st-muted-foreground)}.OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1.5s step-start infinite;border-right:1px solid var(--st-foreground);display:inline-block;height:calc(var(--st-text-sm)*1.25);width:0}.OtpInput_module_safari__1e43b599 .OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1s ease-in-out infinite;border-right-width:2px}@keyframes OtpInput_module_caretBlink__1e43b599{0%,to{opacity:0}50%{opacity:1}}");let sc=e=>e.replace(/\D/g,"").slice(0,6),sd=({slots:e})=>rZ.createElement("div",{className:"OtpInput_module_slotsContainer__1e43b599"},e.map((e,t)=>rZ.createElement("div",{key:t,className:nj("OtpInput_module_otpSlot__1e43b599 inputBase_module_inputBase__06c14ae4",{"OtpInput_module_active__1e43b599 inputBase_module_forceFocusRing__06c14ae4":e.isActive})},rZ.createElement("span",null,e.char),e.hasFakeCaret&&rZ.createElement("div",{className:"OtpInput_module_caret__1e43b599"})))),su=({defaultOtp:e,onSubmit:t,disabled:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(e),l=t1(()=>{let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrom")},[]);return rZ.createElement(si,{"aria-label":a._({id:"formField.otp.ariaLabel",message:"One-time passcode"}),containerClassName:nj("OtpInput_module_inputContainer__1e43b599",{OtpInput_module_disabled__1e43b599:r,OtpInput_module_safari__1e43b599:l}),maxLength:6,value:i,onChange:e=>s(sc(e)),pasteTransformer:sc,disabled:r,onComplete:t,pattern:"[0-9]*",render:sd,...n})},sh=({header:e,body:t,helper:r,align:n})=>rZ.createElement(id,{gap:4},rZ.createElement(nZ,{variant:"header",align:n},e),t&&rZ.createElement(nZ,{align:n},t),r&&rZ.createElement(nZ,{variant:"helper",align:n},r)),sm=({header:e,helperContent:t,instruction:r,isSubmitting:n,onSubmit:a,errorMessage:o})=>{let{i18n:i,_:s}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:e,body:r}),rZ.createElement(id,{gap:2},rZ.createElement(id,null,rZ.createElement(su,{onSubmit:a,disabled:n}),rZ.createElement(i8,{isOpen:n},rZ.createElement(id,{className:"OTPEntry_module_progressInner__6b10f31d",gap:2},rZ.createElement(nZ,{variant:"helper"},i._({id:"formField.passcode.status.verifying",message:"Verifying passcode..."})),rZ.createElement(i6,{isLoading:n})))),rZ.createElement(id,null,!n&&o&&rZ.createElement(iB,null,o),rZ.createElement(nZ,{variant:"helper",className:ia()},t))))},sp=({expiration:e,formattedDestination:t,isSubmitting:r,onSubmit:n,errorMessage:a})=>{let o,{i18n:i,_:s}=nO(),[l,c]=ir(e),d=(o=Math.floor(l/60))+":"+String(l-60*o).padStart(2,"0"),u=c?i._({id:"passcode.expirationCountdown",message:"Your code expires in {timeRemaining}.",values:{timeRemaining:d}}):i._({id:"passcode.expired",message:"Your code has expired."});return rZ.createElement(sm,{header:i._({id:"passcode.title",message:"Enter passcode"}),helperContent:u,instruction:rZ.createElement(nx,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:rZ.createElement("b",null)},values:{destination:t}}),isSubmitting:r,onSubmit:n,errorMessage:a})},s_=({password:e,setPassword:t,type:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(!1),l=tQ(null);return tZ(()=>{let e=l.current?.form;if(!e)return;let t=new AbortController;return e.addEventListener("submit",()=>{l.current&&(l.current.type="password"),s(!1)},{signal:t.signal}),()=>t.abort()},[]),rZ.createElement(iN,{id:`${r}-password`,label:a._({id:"formField.password.label",message:"Password"}),ref:l,autoComplete:`${r}-password`,type:i?"text":"password",value:e,onChange:e=>t(e.target.value),required:!0,action:rZ.createElement(oZ,{variant:"ghost",onClick:()=>s(!i)},i?a._({id:"button.hidePassword",message:"Hide"}):a._({id:"button.showPassword",message:"Show"})),...n})},sg=()=>{let[e,t]=t2(aW).state,r=t2(aW).config,n=t2(aW).client,{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=tG(e.formState.passwordState.email),[d,u]=tG(""),[h,m]=tG(""),[p,_]=tG(!1),g=e.flowState.organization;return{stytch:n,onError:s,email:l,setEmail:c,password:d,setPassword:u,organization:g,errorMessage:h,setErrorMessage:m,isSubmitting:p,setIsSubmitting:_,submitPassword:e=>{m(""),_(!0),n.passwords.authenticate({email_address:l,organization_id:e,password:d,session_duration_minutes:r.sessionOptions?.sessionDurationMinutes??30,locale:r.passwordOptions?.locale}).then(e=>{_(!1),i({type:eu.B2BPasswordAuthenticate,data:e}),oR(e,t,r)}).catch(e=>{_(!1),s(e),m(ic(e,o))})},submitDiscoveryPassword:()=>{m(""),_(!0),n.passwords.discovery.authenticate({email_address:l,password:d}).then(e=>{_(!1),i({type:eu.B2BPasswordDiscoveryAuthenticate,data:e}),t({type:"transition",screen:aa}),t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})}).catch(e=>{_(!1),s(e),m(ic(e,o))})},handleNonMemberReset:()=>{if(g){if(!(({email_jit_provisioning:e,email_allowed_domains:t},r)=>{switch(e){case"ALL_ALLOWED":return!0;case"NOT_ALLOWED":return!1;case"RESTRICTED":{let e=r.split("@").pop();return null!=e&&t.includes(e)}}})(g,l)){_(!1);let e=g.organization_name;m(a._({id:"error.emailNoAccessToOrg",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin.",values:{email:l,organizationName:e}}));return}r1(n).dataLayer.setItem("reset-email-value",l),n.magicLinks.email.loginOrSignup({email_address:l,organization_id:g.organization_id,login_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,signup_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}).then(()=>{_(!1),t({type:"set_password_state",email:l}),t({type:"transition",screen:al})}).catch(e=>{s(e),m(ic(e,o)),_(!1)})}}}},sf=()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{stytch:n,email:a,setEmail:o,password:i,setPassword:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,submitPassword:m,submitDiscoveryPassword:p,handleNonMemberReset:_}=sg(),[g,f]=tG(!!l&&!a),y=async o=>{if(o.preventDefault(),l){let o=l.organization_id;if(!g)return void m(o);if(!a.match(n5))return void d(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}));d(""),h(!0),r1(n).searchManager.searchMember(a,l.organization_id).then(({member:t})=>{if(t){f(!1),h(!1),e({type:"set_password_state",email:a});return}_()}).catch(e=>{h(!1),d(ic(e,r))})}else p()};return rZ.createElement(id,{as:"form",onSubmit:y,gap:2},rZ.createElement(iU,{email:a,setEmail:o}),!g&&rZ.createElement(s_,{password:i,setPassword:s,type:"current",error:c}),rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},t._({id:"button.continue",message:"Continue"})),!g&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:a}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})))},sy=()=>{let e,t,r=((t=(e=new URL(window.location.toString())).searchParams).delete("token"),t.delete("stytch_token_type"),e);window.history.replaceState(null,document.title,r)};nW('.PasswordError_module_item__c070e7fb{margin-left:var(--st-spacing-6);text-indent:calc(var(--st-spacing-6)*-1)}.PasswordError_module_item__c070e7fb svg{display:inline-block;height:var(--st-spacing-4);margin-right:var(--st-spacing-2);vertical-align:middle;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb{display:inline-block;margin-right:var(--st-spacing-2);text-align:center;text-indent:0;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb:before{content:"•"}');nW(".PasswordStrengthCheck_module_container__75d2aaf0{border-radius:var(--st-rounded-full);display:flex;gap:var(--st-spacing-0_5);height:0;overflow:clip;transition:height var(--st-transition-duration)}.PasswordStrengthCheck_module_container__75d2aaf0:is(.PasswordStrengthCheck_module_weak__75d2aaf0,.PasswordStrengthCheck_module_strong__75d2aaf0){height:var(--st-spacing)}.PasswordStrengthCheck_module_block__75d2aaf0{background:var(--st-muted);flex:1 1 auto;height:var(--st-spacing)}.PasswordStrengthCheck_module_weak__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-destructive)}.PasswordStrengthCheck_module_strong__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-success)}");let sv=({score:e})=>{let t,{i18n:r,_:n}=nO();return 1===e||2===e?t="PasswordStrengthCheck_module_weak__75d2aaf0":(3===e||4===e)&&(t="PasswordStrengthCheck_module_strong__75d2aaf0"),rZ.createElement("div",{className:nj("PasswordStrengthCheck_module_container__75d2aaf0",t)},null!=e&&e>0&&rZ.createElement(rZ.Fragment,null,[,,,,].fill(void 0).map((t,r)=>rZ.createElement("div",{key:r,className:nj("PasswordStrengthCheck_module_block__75d2aaf0",{PasswordStrengthCheck_module_filled__75d2aaf0:e>r})})),rZ.createElement(iI,null,r._({id:"password.strength",message:"Password strength: {score} out of 4.",values:{score:e}}))))},sb={"Short keyboard patterns are easy to guess.":{id:"password.zxcvbn.warning.shortKeyboardPatterns",message:"Short keyboard patterns are easy to guess."},"Straight rows of keys are easy to guess.":{id:"password.zxcvbn.warning.straightRows",message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:"password.zxcvbn.warning.repeats",message:'Repeats like "aaa" are easy to guess.'},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:"password.zxcvbn.warning.longerRepeats",message:'Repeats like "abcabcabc" are only slightly harder to guess than "abc".'},'Sequences like "abc" or "6543" are easy to guess.':{id:"password.zxcvbn.warning.sequences",message:'Sequences like "abc" or "6543" are easy to guess.'},"Recent years are easy to guess.":{id:"password.zxcvbn.warning.recentYears",message:"Recent years are easy to guess."},"Dates are often easy to guess.":{id:"password.zxcvbn.warning.dates",message:"Dates are often easy to guess."},"This is a top-10 common password.":{id:"password.zxcvbn.warning.top10CommonPassword",message:"This is a top-10 common password."},"This is a top-100 common password.":{id:"password.zxcvbn.warning.top100CommonPassword",message:"This is a top-100 common password."},"This is a very common password.":{id:"password.zxcvbn.warning.veryCommonPassword",message:"This is a very common password."},"This is similar to a commonly used password.":{id:"password.zxcvbn.warning.similarToCommonPassword",message:"This is similar to a commonly used password."},"A word by itself is easy to guess.":{id:"password.zxcvbn.warning.wordByItself",message:"A word by itself is easy to guess."},"Names and surnames by themselves are easy to guess.":{id:"password.zxcvbn.warning.names",message:"Names and surnames by themselves are easy to guess."},"Common names and surnames are easy to guess.":{id:"password.zxcvbn.warning.commonNames",message:"Common names and surnames are easy to guess."}},sw={"Use a few words, avoid common phrases.":{id:"password.zxcvbn.suggestion.useAFewWords",message:"Use a few words, avoid common phrases."},"No need for symbols, digits, or uppercase letters.":{id:"password.zxcvbn.suggestion.noSymbolsDigitsUppercase",message:"No need for symbols, digits, or uppercase letters."},"Add another word or two. Uncommon words are better.":{id:"password.zxcvbn.suggestion.addWords",message:"Add another word or two. Uncommon words are better."},"Use a longer keyboard pattern with more turns.":{id:"password.zxcvbn.suggestion.longerKeyboardPattern",message:"Use a longer keyboard pattern with more turns."},"Avoid repeated words and characters.":{id:"password.zxcvbn.suggestion.avoidRepeats",message:"Avoid repeated words and characters."},"Avoid sequences.":{id:"password.zxcvbn.suggestion.avoidSequences",message:"Avoid sequences."},"Avoid recent years.":{id:"password.zxcvbn.suggestion.avoidRecentYears",message:"Avoid recent years."},"Avoid years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou",message:"Avoid years that are associated with you."},"Avoid dates and years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou",message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:"password.zxcvbn.suggestion.capitalization",message:"Capitalization doesn't help very much."},"All-uppercase is almost as easy to guess as all-lowercase.":{id:"password.zxcvbn.suggestion.allUppercase",message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:"password.zxcvbn.suggestion.reversed",message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:"password.zxcvbn.suggestion.predictableSubstitutions",message:"Predictable substitutions like '@' instead of 'a' don't help very much."}},sk={fulfilled:{id:"password.requirement.fulfilled",message:"Fulfilled"},notFulfilled:{id:"password.requirement.notFulfilled",message:"Not fulfilled"},warning:{id:"password.requirement.warning",message:"Warning"},suggestion:{id:"password.requirement.suggestion",message:"Suggestion"}},sS=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"currentColor"})),sE=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"currentColor"})),sC=({children:e,type:t})=>{let{i18n:r,_:n}=nO(),a="suggestion"===t?rZ.createElement("span",{role:"presentation",className:"PasswordError_module_bullet__c070e7fb"}):"fulfilled"===t?rZ.createElement(sE,null):rZ.createElement(sS,null);return rZ.createElement(nZ,{variant:"helper",className:"PasswordError_module_item__c070e7fb",color:"suggestion"===t?void 0:"fulfilled"===t?"success":"destructive","aria-atomic":!0},a,rZ.createElement("span",null,rZ.createElement(iI,null,r._(sk[t]),": "),e))},sP=({bootstrap:e,...t})=>{let{i18n:r,_:n}=nO(),a=e.passwordConfig?.ludsComplexity??0,o=e.passwordConfig?.ludsMinimumCount??0;if("notLoaded"===t.policy)return null;let{passwordInvalid:i,isPasswordBreached:s}=t,l=s?rZ.createElement(sC,{type:"warning"},r._({id:"password.strengthError.breached",message:"This password may have been used on a different site that experienced a security issue. Please choose another password."})):null;if("zxcvbn"===t.policy){let{passwordScore:e,passwordWarning:n,passwordSuggestions:a}=t,o=n?sb[n]??n:null,s=[...new Set(a)].map(e=>sw[e]??e);return rZ.createElement(id,{gap:1,"aria-live":"polite"},rZ.createElement(sv,{score:e}),rZ.createElement(iI,null,i?r._({id:"password.strength.notAccepted",message:"Password not accepted."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement("div",null,o&&rZ.createElement(sC,{type:"warning"},r._(o)),s.map(e=>rZ.createElement(sC,{key:e.id,type:"suggestion"},r._(e))),l))}let{missingCharacters:c,missingComplexity:d}=t;return rZ.createElement("div",{"aria-live":"polite"},rZ.createElement(iI,null,i?r._({id:"password.strength.requirementsNotMet",message:"Your password must meet all requirements."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement(sC,{type:0===c?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.minimumLength",message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:o}})),rZ.createElement(sC,{type:0===d?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.complexity",message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:a}})),l)},sT=()=>{throw Error("Assertion failure")};function sO(e){return`sso:${e.connection_id}`}function sA(e){return"oauth"===e.type?e.provider.type:"sso"===e.type?sO(e.connection):"sso-discovery"}let sx=({buttons:e})=>{let{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{oauthProviderSettings:o=[]}=iG(),i=t2(nq),[l,d]=o$(),u=t2(aW).config,{loginRedirectURL:h,signupRedirectURL:m,discoveryRedirectURL:p,customScopes:_,providerParams:g}=u.oauthOptions??{},{B2BGoogleOneTap:f,OAuthB2BButton:y,SSOButton:v}=oN(u,"ssoAndOAuthButtons"),b=n.flowState.type===s.Discovery,w=e.flatMap(e=>e===aP?o.map(e=>({type:"oauth",provider:e})):e===aT?b?{type:"sso-discovery"}:n.flowState.organization?.sso_active_connections?.map(e=>({type:"sso",connection:e}))??[]:void sT());if(0===w.length)return null;let[k,S]=eT(w,e=>sA(e)===l);return rZ.createElement(iw,null,k.map((e,r)=>{let o=(()=>{switch(e.type){case"oauth":var r,o,s;let l,u,b;return b={customScopes:(o=r=e.provider,0==Object.keys(l=o.customScopes).length&&(l=_),l),providerParams:(s=n.primary.email,0==Object.keys(u=r.providerParams).length&&(u=g??{}),!s||r.type!==c.Google&&r.type!==c.Microsoft||"login_hint"in u||(u={...u,login_hint:s}),u)},r.one_tap?rZ.createElement(f,{key:r.type,...b,cancelOnTapOutside:r.cancel_on_tap_outside}):rZ.createElement(y,{key:r.type,providerType:r.type,loginRedirectUrl:h,signupRedirectUrl:m,discoveryRedirectUrl:p,onSuccess:()=>d(r.type),...b});case"sso":return rZ.createElement(v,{key:e.connection.display_name,connection:e.connection,onStart:()=>d(sO(e.connection))});case"sso-discovery":return rZ.createElement(oZ,{key:"sso-discovery",variant:"outline",id:nH("sso-discovery",i.options),onClick:()=>{a({type:"transition",screen:aw,history:"push"})}},t._({id:"provider.continueWithSSO",message:"Use single sign-on"}));default:sT()}})();return S&&0===r?rZ.createElement(nQ,{key:sA(e)},o):o}))},sD=({availableConnections:e})=>{let[t,r]=o$(),n=t?.startsWith("sso:")?t.slice(4):void 0,[a,o]=eT(e,e=>e.connection_id===n);return tm(id,{gap:2},a.map((e,t)=>{let n=tm(o7,{key:e.display_name,connection:e,onStart:e=>r(sO(e))});return o&&0===t?tm(nQ,null,n):n}))},sz=()=>rZ.createElement(iX,{showPasswordButton:!1}),sM=()=>rZ.createElement(iX,{showPasswordButton:!0}),sI=()=>rZ.createElement(i1,{showPasswordButton:!1}),sR=()=>rZ.createElement(i1,{showPasswordButton:!0});var sL=Object.freeze({__proto__:null,emailMagicLinks:{id:"emailMagicLinks",screens:{[ar]:iD,[av]:i2},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},emailOtp:{id:"emailOtp",screens:{[ab]:()=>{let e=t2(aW).client,t=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{codeExpiration:i}=a.formState.otpState,l=ie(),{userSuppliedEmail:c}=a.formState.emailState,d=iJ({throwOnError:!0}),u=iZ({throwOnError:!0}),h=d.isMutating||u.isMutating,m=d.error||u.error,p=oM("stytch.otps.email.discovery.authenticate",(t,{arg:{otp:r,email:n}})=>e.otps.email.discovery.authenticate({code:r,email_address:n}),{onSuccess:e=>{oL(e,o)},throwOnError:!0}),_=oM("stytch.otps.email.authenticate",(t,{arg:{otp:r,emailAddress:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.email.authenticate({code:r,email_address:n,organization_id:a,session_duration_minutes:o}),{onSuccess:e=>{oR(e,o,t)},throwOnError:!0}),g=p.isMutating||_.isMutating,f=p.error||_.error||m,y=f?ic(f,n):void 0,v=()=>{for(let e of[d,u,_,p])e.reset()},b=async e=>{v();try{a.flowState.type===s.Discovery?await p.trigger({otp:e,email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&a.formState.emailState.userSuppliedEmail&&await _.trigger({otp:e,emailAddress:a.formState.emailState.userSuppliedEmail,organizationId:a.flowState.organization.organization_id,sessionDurationMinutes:t.sessionOptions.sessionDurationMinutes})}catch{l.clear()}},w=async()=>{v(),!h&&(a.flowState.type===s.Discovery?await u.trigger({email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&await d.trigger({email:c,organization_id:a.flowState.organization.organization_id}))};return rZ.createElement(id,{gap:6},null!==i?rZ.createElement(sp,{isSubmitting:g,onSubmit:b,errorMessage:y,expiration:i.getTime(),formattedDestination:c}):rZ.createElement(i4,null),rZ.createElement(iw,null,rZ.createElement(i5,{countdown:l,resendOTP:w,isSubmitting:g}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{o({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[av]:i2,[ar]:iD},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},oauth:{id:"oauth",screens:{},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,B2BGoogleOneTap:o1,OAuthB2BButton:oX},icons:{google:o2,microsoft:o3,hubspot:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#FF7A59",fillRule:"evenodd",d:"M13.93 13.97a2.4 2.4 0 0 1-2.43-2.4c0-1.34 1.09-2.42 2.43-2.42a2.4 2.4 0 0 1 2.43 2.41c0 1.33-1.08 2.41-2.43 2.41m.73-7.05V4.78c.56-.26.96-.83.96-1.49v-.05c0-.9-.75-1.64-1.66-1.64h-.05c-.92 0-1.67.74-1.67 1.64v.05c0 .66.4 1.23.96 1.5v2.13q-1.27.21-2.24.98L5 3.32q.07-.21.07-.46C5.08 1.83 4.24 1 3.2 1s-1.88.83-1.88 1.86a1.87 1.87 0 0 0 2.8 1.6l5.85 4.51a4.6 4.6 0 0 0 .07 5.29l-1.77 1.76a1.54 1.54 0 0 0-1.98 1.46 1.54 1.54 0 0 0 3.09 0q-.02-.23-.08-.44l1.76-1.74a4.75 4.75 0 0 0 7.62-3.74 4.7 4.7 0 0 0-4.02-4.64",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#E01E5A",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0z"}),tm("path",{fill:"#36C5F0",d:"M7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79z"}),tm("path",{fill:"#2EB67D",d:"M15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0z"}),tm("path",{fill:"#ECB22E",d:"M12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#24292F",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd",className:o0}))}},passwords:{id:"passwords",screens:{"Password Email":sf,[ai]:()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{email:n,setEmail:a,password:o,setPassword:i,organization:s,errorMessage:l,setErrorMessage:c,isSubmitting:d,submitPassword:u,submitDiscoveryPassword:h}=sg(),m=async e=>{e.preventDefault(),n.match(n5)?s?u(s.organization_id):h():c(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"password.login.title",message:"Log in with email and password"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:4},rZ.createElement(iU,{email:n,setEmail:a}),rZ.createElement(s_,{password:o,setPassword:i,type:"current",error:l}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:d,type:"submit"},t._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:n}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},t._({id:"button.goBack",message:"Go back"})))))},[ac]:()=>{let[,e]=t2(aW).state,t=t2(aW).config,r=aZ(),{i18n:n,_:a}=nO(),{stytch:o,email:i,setEmail:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,handleNonMemberReset:m}=sg(),p=async s=>{(s.preventDefault(),i.match(n5))?(d(""),h(!0),l?r1(o).searchManager.searchMember(i,l.organization_id).then(({member:n})=>{n?o.passwords.resetByEmailStart({email_address:i,organization_id:l.organization_id,login_redirect_url:t.emailMagicLinksOptions?.loginRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(t=>{h(!1),r({type:eu.B2BPasswordResetByEmailStart,data:t}),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))}):m()}).catch(e=>{h(!1),d(ic(e,a))}):o.passwords.discovery.resetByEmailStart({email_address:i,discovery_redirect_url:t.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(()=>{h(!1),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))})):d(n._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},n._({id:"password.forgot.title",message:"Check your email for help signing in"})),rZ.createElement(nZ,{variant:"body"},l?n._({id:"password.forgot.content.organization",message:"We'll email you a login link to sign in to your account directly or reset your password if you have one."}):n._({id:"password.forgot.content.discovery",message:"We'll email you a verification link to sign up for an account or reset your password if you have one."})),rZ.createElement(iU,{email:i,setEmail:s,error:c}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},n._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},n._({id:"button.goBack",message:"Go back"}))))},[ad]:()=>{let[,e]=t2(aW).state,t=aZ(),r=t2(aW).config,{i18n:n,_:a}=nO(),{stytch:o,onError:i,email:s,organization:l,setIsSubmitting:c}=sg();return rZ.createElement(ik,{header:n._({id:"password.reset.emailSent.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"password.reset.emailSent.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:s}}),resend:()=>l?o.passwords.resetByEmailStart({email_address:s,organization_id:l.organization_id,login_redirect_url:r.passwordOptions?.loginRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordResetByEmailStart,data:e})}).catch(e=>{throw i(e),e}):o.passwords.discovery.resetByEmailStart({email_address:s,discovery_redirect_url:r.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordDiscoveryResetStart,data:e})}),goBack:()=>e({type:"transition",screen:at})})},[as]:()=>{let e=t2(aW).client,t=t2(aW).config,[,r]=t2(aW).state,n=oI(),{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=t1(()=>{let t=e.parseAuthenticateUrl();return t?[t.token,t.tokenType]:["",""]},[e]),d=r1(e).dataLayer.getItem("reset-email-value"),[u,h]=tG(""),[m,p]=tG(""),[_,g]=tG({policy:"notLoaded"}),[f,y]=tG(!1),v=t1(()=>((e,t=500)=>{let r;return(...n)=>{clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}})(t=>(p(""),e.passwords.strengthCheck({password:t}).then(({score:e,valid_password:t,zxcvbn_feedback:r,luds_feedback:n,strength_policy:a,breached_password:o})=>{let i={passwordInvalid:!t,isPasswordBreached:o};"zxcvbn"===a?g({policy:a,...i,passwordScore:e,passwordWarning:r.warning,passwordSuggestions:r.suggestions}):"luds"===a&&g({policy:a,...i,missingCharacters:n.missing_characters,missingComplexity:n.missing_complexity})}).catch(e=>{p(ic(e,o))}))),[e.passwords,o]);tZ(()=>{if("multi_tenant_magic_links"===c)return void e.magicLinks.authenticate({magic_links_token:l,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.emailMagicLinksOptions?.locale}).then(e=>{sy(),r({type:"primary_authenticate_success",response:e,includedMfaMethods:t.mfaProductInclude,resetTokenType:c})}).catch(e=>{p(ic(e,o)),s(e)})},[c]);let b=function(e,t){if("notLoaded"===t||"zxcvbn"===t||null==e.passwordConfig)return{type:"new",passwordrules:"allowed: unicode; minlength: 10"};let{ludsComplexity:r,ludsMinimumCount:n}=e.passwordConfig,a=["special","digit","upper","lower"].slice(0,r);return{type:"new",minLength:n,passwordrules:`allowed: unicode; minlength: ${n}; ${a.map(e=>`required: ${e}`).join("; ")}`}}(n,_.policy);return rZ.createElement(id,{gap:6,as:"form",onSubmit:n=>{n.preventDefault(),p(""),y(!0),"multi_tenant_passwords"==c?e.passwords.resetByEmail({password_reset_token:l,password:u,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.passwordOptions?.locale}).then(e=>{y(!1),i({type:eu.B2BPasswordResetByEmail,data:e}),oR(e,r,t)}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):"discovery"==c?e.passwords.discovery.resetByEmail({password_reset_token:l,password:u}).then(e=>{y(!1),i({type:eu.B2BDiscoveryPasswordReset,data:e}),r({type:"transition",screen:aa}),r({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):e.passwords.resetBySession({password:u}).then(e=>{y(!1),i({type:eu.B2BPasswordResetBySession,data:e}),r({type:"transition",screen:an})}).catch(e=>{s(e),p(ic(e,o)),y(!1)})}},rZ.createElement(nZ,{variant:"header"},a._({id:"password.setNew.title",message:"Set a new password"})),rZ.createElement(id,{gap:2},d?rZ.createElement(iU,{email:d,setEmail:n6,disabled:!0}):null,rZ.createElement(s_,{password:u,setPassword:e=>{h(e),v(e)},error:m,...b}),rZ.createElement(sP,{bootstrap:n,..._}),rZ.createElement(oZ,{variant:"primary",loading:f,type:"submit",disabled:"notLoaded"===_.policy||_.passwordInvalid},a._({id:"button.continue",message:"Continue"}))))},[al]:()=>{let{i18n:e,_:t}=nO(),[r,n]=t2(aW).state,a=ix(),o=r.formState.passwordState.email;return rZ.createElement(ik,{header:e._({id:"password.verification.title",message:"Verify your email first."}),description:rZ.createElement(nx,{id:"password.verification.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:o}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:a,providerInfo:iS}),rZ.createElement(iP,{emailDomain:a,providerInfo:iC}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{n({type:"set_user_supplied_email",email:""}),n({type:"transition",screen:at})}},e._({id:"button.retry",message:"Try again"})))})}},mainScreen:{[aO]:sf,[aA]:sM,[ax]:sR},icons:o4},sso:{id:"sso",screens:{[aw]:()=>{let e,[,t]=t2(aW).state,[r,n]=tG(""),{i18n:a,_:o}=nO(),[i,s]=tG(),[l,c]=tG(!1),{trigger:d}=(e=t2(aW).client,oM("stytch.sso.discoverConnections",async(t,{arg:{emailAddress:r}})=>await e.sso.discoverConnections(r),{throwOnError:!0})),u=t2(aW).client,{ssoOptions:h}=t2(aW).config,m=async e=>{e.preventDefault(),s(void 0);let n=async()=>{try{let e=await d({emailAddress:r});if(!e)return[];return e.connections}catch(e){s(((e,t)=>{if(e&&"object"==typeof e){if("error_message"in e&&"string"==typeof e.error_message)return e.error_message;if(t)return t;if("message"in e&&"string"==typeof e.message)return e.message}})(e,a._({id:"ssoDiscovery.email.error.unknown",message:"Something went wrong. Try again later or contact your admin for help."})))}};try{c(!0);let e=await n();if(e?.length===1){let[t]=e;await u.sso.start({connection_id:t.connection_id,login_redirect_url:h?.loginRedirectURL,signup_redirect_url:h?.signupRedirectURL});return}c(!1),e&&t({type:"set_sso_discovery_state",connections:e})}catch(e){throw c(!1),e}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"ssoDiscovery.email.title",message:"Enter your email to continue"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:2},rZ.createElement(iU,{email:r,setEmail:n,hideLabel:!0,error:i}),rZ.createElement(oZ,{variant:"primary",loading:l,type:"submit"},a._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},a._({id:"button.goBack",message:"Go back"}))))},[aS]:()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO();return tm(id,{gap:6},tm(nZ,{variant:"header"},r._({id:"ssoDiscovery.title",message:"Select a connection to continue"})),tm(id,{gap:4},tm(sD,{availableConnections:e.formState.ssoDiscoveryState.connections}),tm(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[ak]:()=>{let[,e]=t2(aW).state,[t,r]=tG(""),[n,a]=tG(),[o,i]=tG(!1),s=t2(aW).client,{ssoOptions:l}=t2(aW).config,{i18n:c,_:d}=nO(),{trigger:u}=oM("stytch.organization.getBySlug",async(e,{arg:{slug:t}})=>s.organization.getBySlug({organization_slug:t}),{onError:()=>{a(c._({id:"ssoDiscovery.fallback.error.unknown",message:"An error occurred. Please try again."})),i(!1)}}),h=async r=>{r.preventDefault(),a(void 0),i(!0);let n=await u({slug:t});if(n){let{organization:t}=n;if(null===t)a(c._({id:"ssoDiscovery.fallback.error.orgNotFound",message:"Organization not found. Please try again."})),i(!1);else if(1===t.sso_active_connections.length){let[e]=t.sso_active_connections;await s.sso.start({connection_id:e.connection_id,login_redirect_url:l?.loginRedirectURL,signup_redirect_url:l?.signupRedirectURL})}else e({type:"set_organization",organization:t}),e({type:"transition",screen:at})}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},c._({id:"ssoDiscovery.fallback.title",message:"Sorry, we couldn't find any connections"})),rZ.createElement(nZ,null,c._({id:"ssoDiscovery.fallback.content",message:"Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."})),rZ.createElement(id,{as:"form",onSubmit:h,gap:2},rZ.createElement(iN,{id:"organization-slug",hideLabel:!0,label:c._({id:"formField.orgSlug.label",message:"Organization slug"}),value:t,onChange:e=>r(e.target.value),placeholder:c._({id:"formField.orgSlug.label",message:"Organization slug"}),error:n}),rZ.createElement(oZ,{variant:"primary",loading:o,type:"submit",disabled:!t||o},c._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"transition",screen:at})}},c._({id:"ssoDiscovery.fallback.button.reset",message:"Try another method"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{e({type:"navigate_back"})}},c._({id:"button.goBack",message:"Go back"}))))}},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,SSOButton:o7},icons:{google:o2,microsoft:o3,okta:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#191919",fillRule:"evenodd",d:"m10.9 1.13-.37 4.56a5 5 0 0 0-1.19.01l-.2-2.2q0-.12.11-.13h.38l-.18-2.24q.01-.12.11-.13h1.23q.11.01.11.13m-3.09.22q-.04-.1-.15-.08l-1.15.42q-.11.06-.07.16l.94 2.04-.36.13q-.1.06-.06.16l.95 2a4 4 0 0 1 1.12-.42zM5 2.62l2.65 3.73q-.51.33-.9.78l-1.6-1.56a.12.12 0 0 1 .01-.18l.3-.23-1.58-1.6a.12.12 0 0 1 0-.18l.94-.78a.12.12 0 0 1 .17.02M2.77 4.78q-.1-.05-.17.04l-.61 1.06a.12.12 0 0 0 .05.17L4.07 7l-.2.32a.12.12 0 0 0 .06.17l2.02.92q.22-.56.59-1.04zm-1.5 2.88q.03-.11.15-.1l4.42 1.16q-.17.57-.19 1.18l-2.21-.18a.12.12 0 0 1-.1-.14l.06-.37L1.16 9q-.11-.02-.1-.14zm-.16 2.99q-.12.02-.1.14l.2 1.2q.05.12.15.1l2.17-.56.07.37c0 .06.08.1.14.09l2.14-.59q-.19-.56-.22-1.17zm.7 3.17a.12.12 0 0 1 .06-.17L6 11.7q.24.55.62 1.02L4.8 14.01a.12.12 0 0 1-.17-.04l-.19-.33-1.84 1.28q-.1.05-.17-.04zm5.02-.86L3.6 16.21a.12.12 0 0 0 0 .18l.95.79q.1.06.17-.02l1.3-1.84.29.25q.1.07.18-.03l1.26-1.82a5 5 0 0 1-.93-.76m-.64 5.22a.12.12 0 0 1-.07-.16l1.91-4.15q.53.27 1.13.39L8.6 16.4a.12.12 0 0 1-.16.07l-.35-.12-.6 2.16q-.04.1-.15.08zm3.28-3.87-.37 4.56q0 .12.12.13h1.22q.12-.01.12-.13l-.18-2.23h.37q.12-.02.12-.14l-.2-2.2a4 4 0 0 1-1.2.01M13.9 1.97a.12.12 0 0 0-.07-.17l-1.15-.41q-.12-.03-.16.08l-.6 2.16-.35-.13q-.1-.02-.15.08l-.56 2.15q.6.12 1.12.39zm2.5 1.81-3.21 3.26a4 4 0 0 0-.93-.76l1.26-1.83a.12.12 0 0 1 .18-.03l.29.25 1.3-1.83a.12.12 0 0 1 .17-.02l.94.79q.09.08.01.17m1.75 2.56q.1-.05.05-.17l-.62-1.05a.12.12 0 0 0-.17-.04l-1.84 1.27-.2-.32q-.06-.1-.16-.04l-1.82 1.29q.38.46.62 1.02zM18.79 8l.2 1.2a.12.12 0 0 1-.1.15l-4.55.42a4 4 0 0 0-.23-1.17l2.14-.59q.12-.02.15.1l.06.37 2.17-.57q.12-.03.15.1zm-.2 4.43q.1.01.14-.1l.2-1.2a.12.12 0 0 0-.1-.15l-2.23-.2.06-.37a.12.12 0 0 0-.1-.14l-2.22-.18q-.01.6-.19 1.18l4.43 1.15m-1.19 2.75a.12.12 0 0 1-.17.04l-3.77-2.6q.36-.48.59-1.04l2.02.92q.1.06.05.16l-.19.33 2.03.96q.1.05.05.17zm-5.04-1.54 2.65 3.73q.08.08.17.02l.94-.79a.12.12 0 0 0 0-.17l-1.57-1.6.3-.23q.08-.09 0-.18l-1.59-1.56q-.4.46-.9.78m-.02 5.08q-.12.03-.16-.08l-1.2-4.41q.59-.14 1.1-.43l.96 2.01c.03.06 0 .14-.06.16l-.36.13.94 2.04q.04.1-.07.16z",clipRule:"evenodd",className:o0}))}}});nW(".Logo_module_container__f17fe7db{align-items:center;display:flex;gap:var(--st-spacing-2);justify-content:center}.Logo_module_logo__f17fe7db{max-height:50px;max-width:100px}");var sB="Logo_module_logo__f17fe7db";let sN=({orgLogo:e,appLogo:t})=>e||t?rZ.createElement("div",{className:"Logo_module_container__f17fe7db"},e&&rZ.createElement("img",{className:sB,src:e.url,alt:e.alt}),t&&rZ.createElement("img",{className:sB,src:t.url,alt:t.alt})):null,sU=({text:e,onGoBack:t})=>{let{i18n:r,_:n}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"error.title",message:"Looks like there was an error!"}),body:e}),t&&rZ.createElement(oZ,{variant:"outline",onClick:t},r._({id:"button.goBack",message:"Go back"})))},sF=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{type:a,canGoBack:o}=e.error,i=e.flowState.organization?.organization_name,s={[az]:r._({id:"error.default",message:"Something went wrong. Try again later or contact your admin for help."}),[aM]:r._({id:"error.eml",message:"Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."}),[aI]:r._({id:"error.organization",message:"The organization you are looking for could not be found. If you think this is a mistake, contact your admin."}),[aR]:i?r._({id:"error.authPolicyWithOrg",message:"Unable to join due to {organizationName}'s authentication policy. Please contact your admin for more information.",values:{organizationName:i}}):r._({id:"error.authPolicyNoOrg",message:"Unable to join due to the organization's authentication policy. Please contact your admin for more information."}),[aL]:r._({id:"error.adBlockerDetected",message:"The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."}),[aB]:r._({id:"error.claimedDomain",message:"Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."})},l=t1(()=>{if(o)return()=>t({type:"transition",screen:at})},[o,t]);return rZ.createElement(sU,{text:s[a],onGoBack:l})};nW(".Root_module_root__5a8e6e98{color-scheme:var(--st-color-scheme);font-family:var(--st-font-family);isolation:isolate}:where(.Root_module_root__5a8e6e98),:where(.Root_module_root__5a8e6e98) *{box-sizing:border-box;margin:0;padding:0}.Root_module_root__5a8e6e98 a{-webkit-text-decoration:none;text-decoration:none}.Root_module_root__5a8e6e98 :is(span,strong,em,p,a){font-feature-settings:inherit;font-size:inherit;font-variant:inherit;line-height:inherit}.Root_module_root__5a8e6e98 :is(span,strong,em,p){color:inherit}.Root_module_root__5a8e6e98 :is(span,em,p){font-weight:inherit}:where(.Root_module_root__5a8e6e98) :is(b,strong){font-weight:var(--st-font-weight-bold)}:where(.Root_module_root__5a8e6e98) :is(img,svg){display:block}.Root_module_root__5a8e6e98{--st-font-weight-normal:400;--st-font-weight-medium:500;--st-font-weight-semibold:600;--st-font-weight-bold:700;--st-rounded-md:calc(var(--st-rounded-base)*2);--st-rounded-2xl:calc(var(--st-rounded-base)*6);--st-rounded-full:calc(var(--st-rounded-base)*9999);--st-text-xs:calc(var(--st-text-base)*0.75);--st-text-sm:calc(var(--st-text-base)*0.875);--st-text-2xl:calc(var(--st-text-base)*1.5);--st-line-height-xs:1.33333;--st-line-height-sm:1.42857;--st-line-height-base:1.5;--st-line-height-2xl:1.33333;--st-spacing-0_5:calc(var(--st-spacing)*0.5);--st-spacing-2:calc(var(--st-spacing)*2);--st-spacing-3:calc(var(--st-spacing)*3);--st-spacing-4:calc(var(--st-spacing)*4);--st-spacing-5:calc(var(--st-spacing)*5);--st-spacing-6:calc(var(--st-spacing)*6);--st-spacing-7:calc(var(--st-spacing)*7);--st-spacing-8:calc(var(--st-spacing)*8);--st-spacing-9:calc(var(--st-spacing)*9);--st-spacing-10:calc(var(--st-spacing)*10);--st-tab-background:color-mix(in oklab,var(--st-accent) 80%,transparent);--st-primary-button-hover:color-mix(in oklab,var(--st-primary) 90%,transparent);--st-secondary-button-hover:color-mix(in oklab,var(--st-secondary) 80%,transparent);--st-destructive-button-hover:color-mix(in oklab,var(--st-destructive) 80%,transparent);--st-divider-color:color-mix(in oklab,var(--st-border) 50%,transparent);--st-focus-ring-shadow:0 0 0 3px color-mix(in oklab,var(--st-ring) 50%,transparent);--st-shadow:0 0;--st-shadow-input:var(--st-shadow);--st-shadow-button:var(--st-shadow);--st-button-radius:var(--st-rounded-md);--st-input-radius:var(--st-rounded-md);--st-container-radius:var(--st-rounded-2xl);--st-container-border:var(--st-border);--st-header-font:var(--st-font-family)}"),nW(".inputBase_module_inputBase__06c14ae4{background-color:var(--st-background);border:1px solid var(--st-input);border-radius:var(--st-input-radius);box-shadow:var(--st-shadow-input);color:var(--st-foreground);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm)}.inputBase_module_forceFocusRing__06c14ae4,:is(.inputBase_module_focusRing__06c14ae4,.inputBase_module_inputBase__06c14ae4):focus-visible{border-color:var(--st-ring);box-shadow:var(--st-shadow-input),var(--st-focus-ring-shadow);outline:0}");nW("[dir=rtl] .i18n_module_rtlIcon__278ecfc9{scale:-1 1}.i18n_module_rtlIcon__278ecfc9:dir(rtl){scale:-1 1}"),nW("a.Watermark_module_watermark__ef279c61{align-items:center;border-radius:var(--st-rounded-md);color:var(--st-muted-foreground);display:flex;gap:var(--st-spacing);padding:var(--st-spacing-2) var(--st-spacing-3);transition:background var(--st-transition-duration),color var(--st-transition-duration)}a.Watermark_module_watermark__ef279c61:hover{background:var(--st-accent);color:var(--st-accent-foreground)}a.Watermark_module_watermark__ef279c61 span{font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);line-height:var(--st-line-height-sm)}a.Watermark_module_watermark__ef279c61 svg{height:24px}a.Watermark_module_watermark__ef279c61 path{fill:hsl(218.92,100%,calc(7.25%*(1 + var(--st-dark-mode, 0)*100)))}");let sq=({poweredBy:e,label:t})=>rZ.createElement("a",{className:nj("Watermark_module_watermark__ef279c61","inputBase_module_focusRing__06c14ae4"),href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},rZ.createElement("span",null,e," "),rZ.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 47 24","aria-label":t},rZ.createElement("path",{fillRule:"evenodd",d:"M3.58 9.1c0 .86.37 1.26 1.4 1.5v.01l1.36.33c2 .5 2.9 1.47 2.9 3.18 0 2.3-1.56 3.6-4.09 3.6S1.19 16.57 1 14.37h2.19c.14 1.1.83 1.66 1.96 1.66 1.14 0 1.87-.61 1.87-1.56 0-.9-.45-1.35-1.62-1.61l-1.37-.31c-1.22-.3-2.67-1.09-2.67-3.2C1.36 7.35 2.9 6 5.18 6c2.46 0 3.73.98 3.89 2.98H6.79c-.1-.89-.64-1.32-1.64-1.32-.93 0-1.57.56-1.57 1.43Zm31.95 2.84c-.16-.83-.7-1.22-1.68-1.22h-.14c-1.3 0-2.13 1.02-2.13 2.6 0 1.57.84 2.59 2.13 2.59h.14c.98 0 1.52-.39 1.68-1.22h2.15c-.2 1.96-1.58 3.03-3.9 3.03-2.46 0-4.18-1.81-4.18-4.4 0-2.6 1.72-4.41 4.18-4.41 2.32 0 3.7 1.07 3.9 3.03h-2.15Zm-8.5 2.9v-4.17h2.27V8.9h-1.48a.8.8 0 0 1-.8-.8V6h-2.17v2.9h-1.8a1.9 1.9 0 0 0-1.74 1.16l-1.88 4.44-2-4.47a1.9 1.9 0 0 0-1.72-1.13h-2.6a.8.8 0 0 1-.8-.8V6h-2.16v9.47c0 1.47.78 2.25 2.25 2.25h2.06v-1.8h-1.08c-.84 0-1.06-.23-1.06-1.08v-4.17h2.64c.24 0 .42.1.5.28l2.92 6.14v.45c0 .87-.24.9-1.06.9h-2.73v1.85h3.6c1.39 0 2.25-.98 2.25-2.57l.01-.73 2.8-6.04c.08-.18.26-.28.5-.28h1.1v4.8c0 1.47.78 2.25 2.25 2.25h2.12v-1.81H28.1c-.85 0-1.07-.22-1.07-1.07Zm13.7-4.77.15-.18c.5-.62 1.02-.98 2.16-.98 1.93 0 3.04 1.21 3.04 3.33v5.48h-2.16v-5.21c0-.66-.2-1.18-.54-1.51-.29-.27-.67-.4-1.11-.37-1.05.07-1.53.88-1.53 2.56v4.53h-2.17V6h2.17v4.07Z"}),rZ.createElement("path",{d:"M29.82 22.74v.4h-.57v-3.13h.58v1.4c.16-.3.4-.5.73-.5.48 0 .8.42.8 1.11v.06c0 .72-.38 1.12-.82 1.12a.75.75 0 0 1-.72-.46Zm.95-.68v-.02c0-.46-.2-.7-.47-.7-.3 0-.5.25-.5.7v.02c0 .47.19.7.5.7.28 0 .46-.22.46-.7Zm.97 1.88v-.4c.07.02.18.03.28.03.26 0 .41-.1.5-.44l.02-.02h-.3l-.67-2.15h.62l.49 1.74.48-1.74h.6l-.74 2.29c-.18.6-.48.75-.88.75-.16 0-.3-.02-.4-.06Zm3.7-3.16h-.81v-.5h2.23v.5h-.83v2.37h-.59v-2.37Zm1.36.18h.6l.36 1.73.4-1.73h.67l.42 1.7.35-1.7h.59l-.53 2.19h-.78l-.4-1.67-.38 1.67h-.78l-.51-2.2Zm3.71-.67c0-.21.12-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.15-.96h.58v3.15h-.58V20Zm1.1.29c0-.21.11-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.04 1.12v-.06c0-.68.45-1.12 1.08-1.12.64 0 1.08.44 1.08 1.12v.06c0 .7-.45 1.12-1.08 1.12-.67 0-1.09-.43-1.09-1.12Zm1.57-.02v-.02c0-.47-.2-.7-.49-.7s-.5.23-.5.7v.02c0 .47.19.7.5.7.3 0 .49-.22.49-.7Z"})));nW(".MainContainer_module_container__d1278a0c{background-color:var(--st-background);border:1px solid var(--st-container-border);border-radius:var(--st-container-radius);color:var(--st-foreground);max-width:var(--st-container-width);padding:var(--st-spacing-10) var(--st-spacing-9);width:100%}.MainContainer_module_watermarkContainer__d1278a0c{display:flex;justify-content:center}");let sH=({children:e,displayWatermark:t,theme:r})=>{let{i18n:n,_:a}=nO(),o=tQ(null),{className:i,style:s}=function(e,t){let r=e["mobile-breakpoint"],[n,a]=tG(r);tZ(()=>{a(function e(t,r){if(!r)return t;let n=t.replace(/var\s*\([^)]+\)/gi,e=>{let[t,n]=e.match(/\(([^)]+)\)/)[1].split(",").map(e=>e.trim());return window.getComputedStyle(r).getPropertyValue(t)||n||e});return n===t?n:e(n,r)}(r,t.current))},[r,t]);let o=nR(`(max-width: ${n})`);return{style:t1(()=>(function(e){let{"color-scheme":t,...r}=e,n=Object.fromEntries(Object.entries(r).map(([e,t])=>[`--st-${e}`,t]));return"shadcn"===e["color-scheme"]?n["--st-color-scheme"]="inherit":(n["--st-color-scheme"]=t,n["--st-dark-mode"]="dark"===e["color-scheme"]?"1":"0"),n})(e),[e]),className:nj({"-st-mobile":o})}}(r,o);return rZ.createElement(id,{gap:6,style:s,className:nj("MainContainer_module_container__d1278a0c Root_module_root__5a8e6e98",i),ref:o},e,t&&rZ.createElement("div",{className:"MainContainer_module_watermarkContainer__d1278a0c"},rZ.createElement(sq,{poweredBy:n._({id:"watermark.poweredBy",message:"Powered by"}),label:n._({id:"watermark.altText",message:"Stytch by Twilio"})})),rZ.createElement(iy,null))},sK=({header:e,text:t})=>{let{i18n:r,_:n}=nO(),a=r._({id:"success.title",message:"Success!"}),o=r._({id:"login.success.content",message:"You have successfully logged in."});return tm(sh,{header:e??a,body:t??o,align:"center"})},sj=()=>{let e=aZ();return iR(()=>{e({type:eu.AuthenticateFlowComplete,data:{}})}),tm(sK,null)};nW(".OrganizationRow_module_organizationRow__bee3960a{justify-content:space-between;text-align:left;width:100%}.OrganizationRow_module_left__bee3960a{align-items:center;display:flex;gap:var(--st-spacing-2)}.OrganizationRow_module_nameText__bee3960a{overflow-wrap:anywhere}.OrganizationRow_module_logo__bee3960a{background-color:var(--st-primary);border-radius:var(--st-rounded-base);color:var(--st-primary-foreground);flex:0 0 auto;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);height:var(--st-spacing-6);line-height:calc(var(--st-spacing-6) - 1px);text-align:center;width:var(--st-spacing-6)}.OrganizationRow_module_right__bee3960a{flex:0 0 auto}.OrganizationRow_module_rightContent__bee3960a{align-items:center;color:var(--st-muted-foreground);display:flex;height:var(--st-spacing-6);justify-content:end;min-width:20px}");var s$="OrganizationRow_module_logo__bee3960a";let sV=()=>rZ.createElement("svg",{className:"OrganizationRow_module_arrow__bee3960a i18n_module_rtlIcon__278ecfc9",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M14.707 10L10.3535 14.3545L9.64648 13.6475L12.793 10.5H6V9.5H12.793L9.64648 6.35352L10.3535 5.64648L14.707 10Z",fill:"currentColor"})),sW=({organization:e,action:t,onClick:r})=>{let{organization_name:n,organization_logo_url:a}=e,o=a?rZ.createElement("img",{className:s$,src:a,alt:""}):rZ.createElement("div",{className:s$,role:"presentation"},Array.from(n)[0]);return rZ.createElement("button",{className:nj("OrganizationRow_module_organizationRow__bee3960a","VerticalTransition_module_hoverTrigger__9366f503",oG({variant:"outline"})),onClick:r},rZ.createElement("div",{className:"OrganizationRow_module_left__bee3960a"},o,rZ.createElement("div",{className:"OrganizationRow_module_nameText__bee3960a"},n)),rZ.createElement(ii,{trigger:"hover",rootClassName:"OrganizationRow_module_right__bee3960a",className:"OrganizationRow_module_rightContent__bee3960a",primary:t&&rZ.createElement(nJ,null,t),secondary:rZ.createElement(sV,null)}))},sG=e=>"eligible_to_join_by_email_domain"===e||"eligible_to_join_by_oauth_tenant"===e,sY=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{createOrganizationEnabled:a}=oI(),{i18n:o,_:i}=nO(),s=()=>t({type:"transition",screen:at}),{trigger:l,isMutating:c}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),d=a&&n.directCreateOrganizationForNoMembership;if(tZ(()=>{d&&l()},[d,l]),d||c)return rZ.createElement(i4,null);let u=e.formState.discoveryState.email;return a&&!n.disableCreateOrganization?rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.create.title",message:"Create an organization to get started"})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.create.content",message:"{email} does not have an account. Think this is a mistake? Try a different email address, or contact your admin.",values:{email:u}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>l()},o._({id:"button.createAnOrganization",message:"Create an organization"})),rZ.createElement(oZ,{variant:"ghost",onClick:s},o._({id:"button.goBack",message:"Go back"})))):rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.title",message:"{email} does not belong to any organizations.",values:{email:u}})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.content",message:"Make sure your email address is correct. Otherwise, you might need to be invited by your admin."})),rZ.createElement(oZ,{variant:"outline",onClick:s},o._({id:"button.tryDifferentEmailAddress",message:"Try a different email address"})))},sZ=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{i18n:a,_:o}=nO(),i=!!n.directLoginForSingleMembership?.status,{createOrganizationEnabled:s}=oI();tZ(()=>{if(u)return;let t=((e,t)=>{if(!t?.status)return null;let r=e.filter(e=>"active_member"===e.membership.type),n=e.some(e=>("pending_member"===e.membership.type||"invited_member"===e.membership.type)&&!t.ignoreInvites||sG(e.membership.type)&&!t.ignoreJitProvisioning);return 1!==r.length||n?null:r[0]})(e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership);i&&null!==t&&l(t)},[i,e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership]);let l=e=>{let r=e.organization;if(e.primary_required){let n=e.primary_required.allowed_auth_methods;n&&1===n.length&&"sso"===n[0]&&r.sso_default_connection_id?c(r.sso_default_connection_id):t({type:"select_discovered_organization",discoveredOrganization:e})}else d({organizationId:r.organization_id})},c=t0(e=>{r.sso.start({connection_id:e,login_redirect_url:n.ssoOptions?.loginRedirectURL,signup_redirect_url:n.ssoOptions?.signupRedirectURL})},[r,n.ssoOptions]),{trigger:d,isMutating:u}=oM("stytch.discovery.intermediateSessions.exchange",(e,{arg:{organizationId:t}})=>r.discovery.intermediateSessions.exchange({organization_id:t,session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),{trigger:h,isMutating:m}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}});if(u)return rZ.createElement(i3,null);if(m)return rZ.createElement(i4,null);if(0===e.formState.discoveryState.discoveredOrganizations.length)return rZ.createElement(sY,null);let p=e.formState.discoveryState.discoveredOrganizations.map(e=>{let t,{organization:r,membership:n}=e;return sG(n.type)||"pending_member"===n.type?t=a._({id:"organizationDiscovery.join",message:"Join"}):"invited_member"===n.type&&(t=a._({id:"organizationDiscovery.acceptInvite",message:"Accept Invite"})),rZ.createElement(sW,{organization:r,action:t,onClick:()=>l(e)})}),_=s&&!n.disableCreateOrganization?rZ.createElement(oZ,{variant:"outline",onClick:()=>h()},a._({id:"button.createAnOrganization",message:"Create an organization"})):null,g=rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"transition",screen:at})},a._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"organizationDiscovery.title",message:"Select an organization to continue"})),_?rZ.createElement(iw,{top:p,bottom:rZ.createElement(rZ.Fragment,null,_,g)}):rZ.createElement(id,{gap:4},rZ.createElement(iw,null,p),g))},sJ=e=>e===aP||e===aT,sQ=()=>{var e;let t,r,n,a,o,{options:i}=t2(nq),[l]=t2(aW).state,{i18n:c,_:d}=nO(),{primaryAuthMethods:u,email:h,emailVerified:m}=l.primary,p=t2(aW).config,{products:_}=iG(),g=l.flowState.type===s.Organization&&!l.flowState.organization,f=(r=(e=l.flowState).type,a=((n=new Set(_.map(e=>e.id))).has("emailMagicLinks")||n.has("emailOtp"))&&n.has("passwords"),o=r===s.Organization?aA:ax,Array.from(_.reduce((t,n)=>{switch(n.id){case"emailMagicLinks":case"emailOtp":a?t.add(o):t.add(r===s.Organization?aE:aC);break;case"oauth":t.add(aP);break;case"sso":(r===s.Discovery||r===s.Organization&&(e.organization?.sso_active_connections?.length??0)>0)&&t.add(aT);break;case"passwords":t.add(a?o:aO)}return t},new Set)).reduce((e,t,r,n)=>{let a=r>0?n[r-1]:void 0;if(a&&sJ(t)&&sJ(a))e[e.length-1].push(t);else{let r=e.length>0?e[e.length-1]:void 0;r&&sJ(r[0])!==sJ(t)&&e.push([aD]),e.push([t])}return e},[])),y=oN(p,"mainScreen"),{SsoAndOAuthButtons:v}=oN(p,"ssoAndOAuthButtons"),b=l.flowState.organization?.organization_name;switch(l.flowState.type){case s.Discovery:t=c._({id:"login.title",message:"Sign up or log in"});break;case s.PasswordReset:t="";break;default:t=b?c._({id:"organizationLogin.title",message:"Continue to {organizationName}",values:{organizationName:b}}):c._({id:"organizationLogin.titleUnknown",message:"Continue to ..."})}return g?rZ.createElement(i4,null):rZ.createElement(id,{gap:6},!i.hideHeaderText&&(h&&!1===m&&u?rZ.createElement(rZ.Fragment,null,rZ.createElement(nZ,{variant:"header"},c._({id:"emailVerification.title",message:"Verify your email"})),rZ.createElement(nZ,null,c._({id:"emailVerification.content",message:"Confirm your email address with one of the following:"}))):t&&rZ.createElement(nZ,{variant:"header",align:"center"},t)),rZ.createElement(id,{gap:4},f.map(e=>e.every(sJ)?rZ.createElement(v,{key:"buttons",buttons:e}):e.map((e,t)=>{let r=y[e];return r?rZ.createElement(r,{key:e}):e===aD?rZ.createElement(ib,{key:"divider"+t}):null}))))},sX={[d.totp]:{messageDescriptor:{id:"mfa.enrollment.option.totp",message:"Use an authenticator app"},screen:af},[d.smsOtp]:{messageDescriptor:{id:"mfa.enrollment.option.sms",message:"Text me a code"},screen:ap}},s1=()=>{let{i18n:e,_:t}=nO(),{mfaProductInclude:r,mfaProductOrder:n}=t2(aW).config,[a,o]=t2(aW).state,{organizationMfaOptionsSupported:i}=a.mfa.primaryInfo,s=t1(()=>{let e=aU({allMethods:aj,orgSupportedMethods:i,uiIncludedMethods:r}),t=[];for(let r of n??aj)e.has(r)&&(t.push(r),e.delete(r));return t.push(...e),t},[r,n,i]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e._({id:"mfa.enrollment.title",message:"Set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},e._({id:"mfa.enrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(iw,null,s.map(t=>{let{messageDescriptor:r,screen:n}=sX[t];return rZ.createElement(oZ,{key:t,variant:"outline",onClick:()=>{o({type:"transition",screen:n,history:"push"})}},e._(r))})))};nW(".RecoveryCodeEntryScreen_module_input__0b7ea085.RecoveryCodeEntryScreen_module_input__0b7ea085{font-family:var(--st-font-family-mono)}");let s0=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{memberId:i,organizationId:s}=a.mfa.primaryInfo,{trigger:l,isMutating:c,error:d}=oM("stytch.recoveryCodes.recover",(t,{arg:{recoveryCode:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.recoveryCodes.recover({recovery_code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{throwOnError:!1,onSuccess:()=>{o({type:"recovery_code/authenticate_success"})}}),[u,h]=tG(""),m=d?r._({id:"recoveryCodes.entry.error.invalidCode",message:"Invalid backup code, please try again."}):void 0,p=async e=>{e.preventDefault(),l({recoveryCode:u,memberId:i,organizationId:s,sessionDurationMinutes:t})};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},r._({id:"recoveryCodes.entry.title",message:"Enter backup code"})),rZ.createElement(nZ,{variant:"body"},r._({id:"recoveryCodes.entry.content",message:"Enter one of the backup codes you saved when setting up your authenticator app."})),rZ.createElement(iN,{id:"recovery-code",className:"RecoveryCodeEntryScreen_module_input__0b7ea085",value:u,onChange:e=>{h(e.target.value)},placeholder:r._({id:"formField.backupCode.placeholder",message:"Enter backup code"}),label:r._({id:"formField.backupCode.ariaLabel",message:"Backup code"}),hideLabel:!0,required:!0,autoComplete:"off",spellCheck:!1,error:m}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:c,type:"submit",disabled:!u||c},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"}))))};nW(".CodeContainer_module_container__1b0ae913{background:var(--st-accent);padding:var(--st-spacing-2) var(--st-spacing-4)}");let s2=({children:e,className:t,...r})=>rZ.createElement("div",{className:nj(t,"CodeContainer_module_container__1b0ae913"),...r},e);nW(".RecoveryCodeSaveScreen_module_codes__5283da32{column-gap:4ch;display:grid;grid-template-columns:repeat(auto-fill,var(--st-max-code-length));justify-content:center;list-style:none;margin:0 auto;max-width:calc(var(--st-max-code-length)*2 + 4ch)}.RecoveryCodeSaveScreen_module_codes__5283da32 li{-webkit-user-select:all;user-select:all;white-space:nowrap}");let s3=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{recoveryCodes:a}=e.mfa.totp.enrollment,o=t1(()=>{let e="Win32"===navigator.platform?"\r\n":"\n",t=new Blob([a.join(e)],{type:"text/plain"});return URL.createObjectURL(t)},[a]),i=e.flowState.organization?.organization_name,s=i?r._({id:"recoveryCodes.filename.withOrganizationName",message:"{organizationName}-backup-codes",values:{organizationName:i}}):r._({id:"recoveryCodes.filename.noOrganizationName",message:"backup-codes"}),[l,c]=io(3),d=async()=>{try{await navigator.clipboard.writeText(a.join("\n")),c(!0)}catch{im({message:r._({id:"recoveryCodes.save.toast.copyFailed",message:"Couldn't copy codes to clipboard"})})}},u=Math.max(...a.map(e=>e.length));return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"recoveryCodes.save.title",message:"Save your backup codes!"}),body:r._({id:"recoveryCodes.save.content",message:"This is the only time you will be able to access and save your backup codes."})}),rZ.createElement(s2,null,rZ.createElement(nZ,{font:"mono"},rZ.createElement("ul",{className:"RecoveryCodeSaveScreen_module_codes__5283da32",style:{"--st-max-code-length":u+"ch"}},a.map((e,t)=>rZ.createElement("li",{key:t},e))))),rZ.createElement(iw,null,rZ.createElement(oJ,{variant:"primary",href:o,download:s+".txt"},rZ.createElement(ii,{primary:r._({id:"recoveryCodes.save.button.download",message:"Download .txt file"}),secondary:r._({id:"recoveryCodes.save.button.copied",message:"Copied!"}),triggered:l})),rZ.createElement(oZ,{variant:"outline",onClick:d},r._({id:"recoveryCodes.save.button.copyAll",message:"Copy all to clipboard"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"recovery_code/save_acknowledge"})}},r._({id:"recoveryCodes.save.button.done",message:"Done"}))))},s4=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),1e4))]);if(!n)return t;return n.national}catch{return t}},s5=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{let n=eA[r],a={isValid:!0,number:`+${n}${t}`};try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),2e3))]);if(!n)return a;return n}catch{return a}};nW(".PhoneInput_module_container__5c1958d4{display:grid;gap:var(--st-spacing-2);grid-template-columns:calc(var(--st-spacing)*22.5) 1fr}.PhoneInput_module_phone__5c1958d4{grid-area:1/2/2/3}.PhoneInput_module_select__5c1958d4{appearance:none;grid-area:1/1/2/2;padding-block:var(--st-spacing-2);padding-inline:var(--st-spacing-3) var(--st-spacing-6)}.-st-mobile .PhoneInput_module_select__5c1958d4{padding-block:var(--st-spacing-3)}.PhoneInput_module_chevron__5c1958d4{color:var(--st-muted-foreground);grid-area:1/1/2/2;margin-inline-end:var(--st-spacing-2);place-self:center end;pointer-events:none;rotate:90deg}.PhoneInput_module_error__5c1958d4{grid-area:2/1/3/3}");let s8="(201) 555-0123",s6=({phone:e,setPhone:t,country:r,setCountry:n,parsePhoneNumber:a,getExampleNumber:o,hasPasskeys:i,error:s,...l})=>{let c,{i18n:d,_:u}=nO(),h=(c=iM(),s?{error:{id:c},input:{"aria-errormessage":c,"aria-invalid":!0}}:{error:{id:c},input:{}}),m=new Intl.DisplayNames(["en"],{type:"region"}),[p,_]=tG(s8),g=tQ(null),[f,y]=tG(e);return rZ.createElement("div",{className:"PhoneInput_module_container__5c1958d4"},rZ.createElement("select",{"aria-label":d._({id:"formField.countryCode.label",message:"Country code"}),className:"PhoneInput_module_select__5c1958d4 inputBase_module_inputBase__06c14ae4",autoComplete:"tel-country-code",value:r,onChange:async e=>{let t=e.target.value;n(t),g.current?.focus();let a=await Promise.race([o(r),new Promise(e=>setTimeout(()=>e(void 0),100))]);t===e.target.value&&_(a??s8)}},Object.entries(eA).map(([e,t])=>rZ.createElement("option",{key:e,value:e},e!==r?`+${t} ${m.of(e)}`:`+${t}`))),rZ.createElement(o8,{className:"PhoneInput_module_chevron__5c1958d4",role:"presentation"}),rZ.createElement(iN,{id:"phone-input",label:d._({id:"formField.phone.label",message:"Phone number"}),hideLabel:!0,ref:g,type:"tel",autoComplete:i?"username webauthn":"tel-national",containerClassName:"PhoneInput_module_phone__5c1958d4",value:f,placeholder:p,onChange:async e=>{let n=e.target.value;y(n);let o=await s4({parsePhoneNumber:a,phoneNumber:n,country:r});n===e.target.value&&(t(o),y(o))},required:!0,...h.input,...i?iz:{},...l}),s&&rZ.createElement("div",{className:"PhoneInput_module_error__5c1958d4"},rZ.createElement(iB,h.error,s)))};class s9 extends b{constructor(){super("InvalidPhoneNumberError","Invalid phone number")}}let s7=()=>{let e,t=t2(aW).client,[r,n]=t2(aW).state,{i18n:a,_:o}=nO(),{smsOtpOptions:i}=t2(aW).config,{mfa:{smsOtp:{isSending:s,sendError:l,enrolledNumber:c}}}=r,{memberId:d,organizationId:u}=r.mfa.primaryInfo,[h,m]=rZ.useState(c?.countryCode??"US"),[p,_]=rZ.useState(c?.phoneNumber??""),g=rZ.useMemo(()=>{if(l)return l instanceof s9?a._({id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."}):ic(l,o)},[l,o]),{parsePhoneNumber:f,getExampleNumber:y}=(e=r1(t).clientsideServices,{getExampleNumber:t=>e.getExamplePhoneNumber({regionCode:t}).then(e=>e.phoneNumber),parsePhoneNumber:(t,r)=>e.parsedPhoneNumber({phoneNumber:t,regionCode:r})}),{trigger:v}=oM("stytch.otps.sms.send",async(e,{arg:{parsedNumber:r,locale:n}})=>t.otps.sms.send({mfa_phone_number:r,member_id:d,organization_id:u,locale:n}),{onSuccess:e=>{n({type:"sms_otp/send_success",response:e,countryCode:h,phoneNumber:p,formattedPhoneNumber:`+${eA[h]} ${p}`})},onError:e=>{n({type:"sms_otp/send_error",error:e})}}),b=async e=>{e.preventDefault(),n({type:"sms_otp/send"});try{let e=await s5({parsePhoneNumber:f,phoneNumber:p,country:h});if(!e.isValid)throw new s9;await v({parsedNumber:e.number,locale:i?.locale})}catch(e){n({type:"sms_otp/send_error",error:e})}};return rZ.createElement(id,{as:"form",gap:6,onSubmit:b},rZ.createElement(nZ,{variant:"header"},a._({id:"mfa.smsEnrollment.title",message:"Enter your phone number to set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},a._({id:"mfa.smsEnrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(s6,{country:h,setCountry:m,phone:p,setPhone:_,parsePhoneNumber:f,getExampleNumber:y,error:g}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:s,type:"submit",disabled:!p||s},a._({id:"button.continue",message:"Continue"})),r.screenHistory.length>0&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>n({type:"navigate_back"})},a._({id:"button.goBack",message:"Go back"}))))},le=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t},smsOtpOptions:r}=t2(aW).config,{i18n:n,_:a}=nO(),[o,i]=t2(aW).state,{mfa:{isEnrolling:s,smsOtp:l,primaryInfo:c}}=o,{codeExpiration:u,formattedDestination:h}=l,{enrolledMfaMethods:m,memberId:p,memberPhoneNumber:_,organizationId:g,organizationMfaOptionsSupported:f}=c,y=ie(),{trigger:v,isMutating:b,error:w}=oM("stytch.otps.sms.send",(t,{arg:{memberId:r,organizationId:n,locale:a}})=>(i({type:"sms_otp/send"}),e.otps.sms.send({member_id:r,organization_id:n,locale:a})),{onSuccess:e=>{i({type:"sms_otp/send_success",response:e})},onError:e=>{let t=ic(e,a);t&&im({message:t}),i({type:"sms_otp/send_error",error:t})},throwOnError:!0}),{trigger:k,isMutating:S,error:E}=oM("stytch.otps.sms.authenticate",(t,{arg:{otp:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.sms.authenticate({code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{onSuccess:()=>{i({type:"sms_otp/authenticate_success"})},onError:()=>{y.clear()}}),C=null===u&&!b&&!w;tZ(()=>{C&&v({memberId:p,organizationId:g,locale:r?.locale}).catch(()=>{})},[p,g,v,C,r?.locale]),tZ(()=>{!h&&_&&(async()=>{i({type:"sms_otp/format_destination",formattedPhoneNumber:await s4({parsePhoneNumber:t=>r1(e).clientsideServices.parsedPhoneNumber({phoneNumber:t}),phoneNumber:_})})})()},[i,h,e,_]);let P=t1(()=>!s&&m.includes(d.totp)&&(0===f.length||f.includes(d.totp)),[m,s,f]),T=E?n._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0,O=t1(()=>s||0===m.length||f.length>0&&!m.some(e=>f.includes(e)),[m,s,f]),A=async()=>{await v({memberId:p,organizationId:g,locale:r?.locale})},x=rZ.createElement(i5,{countdown:y,isSubmitting:S,resendOTP:A}),D=P&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"transition",history:"push",screen:ay})}},n._({id:"mfa.methods.authenticatorApp",message:"Use an authenticator app"})),z=O&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"navigate_back"})}},n._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},null!==u?rZ.createElement(sp,{isSubmitting:S,onSubmit:e=>{k({otp:e,memberId:p,organizationId:g,sessionDurationMinutes:t})},errorMessage:T,expiration:u.getTime(),formattedDestination:h??_??""}):rZ.createElement(i4,null),D&&z?rZ.createElement(iw,{top:x,bottom:rZ.createElement(rZ.Fragment,null,D,z)}):rZ.createElement(iw,null,x,D,z))};nW(".TOTPEnrollManualScreen_module_codeContainer__dc7a0e56{cursor:pointer}.TOTPEnrollManualScreen_module_code__dc7a0e56{column-gap:1ch;display:grid;grid-template-columns:repeat(var(--st-column-count,auto-fill),var(--st-chunk-size,4ch));justify-content:center}");let lt=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),[a,o]=io(3),{secret:i}=e.mfa.totp.enrollment,s=i.toLowerCase(),l=s.split(RegExp("(.{4})","g")).filter(Boolean),{codeRef:c,columnCount:d}=function(e){let t=tQ(null),[r,n]=tG();return tJ(()=>{let r=()=>{if(!t.current)return;let r=Math.floor(t.current.clientWidth/Math.max(...Array.from(t.current.querySelectorAll("span")).map(e=>e.clientWidth))),a=Math.ceil(e/(r-Math.floor(r/4)));n(Math.ceil(e/a))};if(r(),!window.ResizeObserver||!t.current)return;let a=new ResizeObserver(r);return a.observe(t.current),()=>a.disconnect()},[e]),{codeRef:t,columnCount:r}}(l.length),u=async()=>{try{await navigator.clipboard.writeText(s),o(!0)}catch{im({message:r._({id:"mfa.totpEnrollment.toast.copyFailed",message:"Couldn't copy code to clipboard"})});let e=window.getSelection();if(c.current&&e){e.empty();let t=document.createRange();t.selectNodeContents(c.current),e.addRange(t)}}};return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"mfa.totpEnrollment.title",message:"Having trouble scanning the QR code?"}),body:r._({id:"mfa.totpEnrollment.content",message:"Click to copy the code below. Enter into your authenticator app to link your account."})}),rZ.createElement(s2,{className:"TOTPEnrollManualScreen_module_codeContainer__dc7a0e56",onClick:u},rZ.createElement(nZ,{ref:c,className:"TOTPEnrollManualScreen_module_code__dc7a0e56",style:{"--st-column-count":d,"--st-chunk-size":"4ch"},font:"mono"},l.map((e,t)=>rZ.createElement("span",{key:t},e)))),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:u},rZ.createElement(ii,{primary:r._({id:"mfa.totpEnrollment.copyCode.label",message:"Copy to clipboard"}),secondary:r._({id:"mfa.totpEnrollment.copyCode.codeCopied",message:"Copied!"}),triggered:a})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{t({type:"transition",history:"push",screen:ay})}},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"navigate_back"})},r._({id:"button.totpQrRetry",message:"Try to scan the QR code again"}))))};nW(".TOTPEnrollQRScreen_module_qr__ae8d607c{display:block;margin:0 auto}");let lr=()=>{let e=t2(aW).client,[t,r]=t2(aW).state,{i18n:n,_:a}=nO(),{mfa:{totp:{createError:o,enrollment:i,isCreating:s}}}=t,{memberId:l,organizationId:c}=t.mfa.primaryInfo,{trigger:d}=oM("stytch.totp.create",(t,{arg:{memberId:n,organizationId:a}})=>(r({type:"totp/create"}),e.totp.create({member_id:n,organization_id:a})),{onSuccess:e=>{r({type:"totp/create_success",response:e,memberId:l,organizationId:c})},onError:e=>{let t=ic(e,a);t&&im({message:t}),r({type:"totp/create_error",error:e})}}),u=!i&&!s&&!o;return tZ(()=>{u&&d({memberId:l,organizationId:c})},[d,l,c,u]),rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},n._({id:"totp.setupQr.title",message:"Scan the QR code to link your authenticator app"})),rZ.createElement(nZ,{variant:"body"},n._({id:"totp.setupQr.content",message:"Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."})),i?rZ.createElement(rZ.Fragment,null,rZ.createElement("img",{alt:n._({id:"mfaTotpEnrollment.qrAltText",message:"QR code for TOTP enrollment"}),src:i.qrCode,className:"TOTPEnrollQRScreen_module_qr__ae8d607c"}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>{r({type:"transition",history:"push",screen:ay})}},n._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{r({type:"totp/show_code",method:"manual"})}},n._({id:"button.totpQrManual",message:"Having trouble scanning?"})))):rZ.createElement(i4,null))},ln=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{mfa:{isEnrolling:i}}=a,{enrolledMfaMethods:s,memberId:l,organizationId:c,organizationMfaOptionsSupported:u}=a.mfa.primaryInfo,{trigger:h,isMutating:m,error:p}=oM("stytch.totp.authenticate",(t,{arg:{memberId:r,organizationId:n,otp:a,sessionDurationMinutes:o}})=>e.totp.authenticate({code:a,member_id:r,organization_id:n,session_duration_minutes:o}),{onSuccess:()=>{o({type:"totp/authenticate_success"})}}),_=t1(()=>!i&&s.includes(d.smsOtp)&&(0===u.length||u.includes(d.smsOtp)),[s,i,u]),g=p?r._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0;return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"totp.title",message:"Enter verification code"}),instruction:r._({id:"totp.content",message:"Enter the 6-digit code from your authenticator app."}),helperContent:i?r._({id:"mfa.totpEntry.getNewCode",message:"If the verification code doesn’t work, go back to your authenticator app to get a new code."}):null,isSubmitting:m,onSubmit:e=>h({memberId:l,organizationId:c,otp:e,sessionDurationMinutes:t}),errorMessage:g}),rZ.createElement(iw,{top:null,bottom:rZ.createElement(rZ.Fragment,null,_&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:a_})}},r._({id:"mfa.totpEntry.switchToSms",message:"Text me a code instead"})),!i&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:ah})}},r._({id:"mfa.totpEntry.useBackupCode",message:"Use a backup code"})),i&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"})))}))},la={discovery:{mutationKey:"stytch.magicLinks.discovery.authenticate",onSuccess:oL,defaultError:aM},discovery_oauth:{mutationKey:"stytch.oauth.discovery.authenticate",onSuccess:oL},oauth:{mutationKey:"stytch.oauth.authenticate",onSuccess:oR},sso:{mutationKey:"stytch.sso.authenticate",onSuccess:oR},multi_tenant_magic_links:{mutationKey:"stytch.magicLinks.authenticate",onSuccess:oR,defaultError:aM},multi_tenant_impersonation:{mutationKey:"stytch.impersonation.authenticate",onSuccess:oR}},lo={ad_blocker_detected:aL},li=()=>{let e,[t,r]=t2(aW).state,n=t2(aW).client,a=aY(),o=aZ(),i=t2(aW).config,{displayWatermark:l,theme:c,options:d}=t2(nq),u=oU(),h=t.screen,m=oN(i,"screens"),[p,_]=tG(!1),{mutate:g}=a7(oS,t2(oE)),{slug:f,resultPending:y}=(()=>{let[e,t]=t2(aW).state,[r,n]=tG(),a=t2(aW).config,o=t2(aW).client,i=a.organizationSlug??((e,t)=>{if(null===e)return null;let r=new URL(t);r.search="";let n=r.toString().trim(),a=new RegExp(e.replace(/\./g,"\\.").replace(/\*/g,"(?:[^.]+)").replace("{{slug}}","(.+)")),o=n.match(a);return o&&o[1]?o?.[1]:null})(r||null,window.location.href),{trigger:l,isMutating:c}=oM("stytch.organization.getBySlug",(e,{arg:{slug:t}})=>o.organization.getBySlug({organization_slug:t}),{onSuccess:({organization:e})=>{null===e?t({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}):t({type:"set_organization",organization:{...e}})}});return tZ(()=>{r1(o).bootstrap.getAsync().then(({slugPattern:e})=>{n(e)})},[o]),tZ(()=>{null!==i&&null===e.flowState.organization&&e.screen===at&&e.flowState.type==s.Organization&&l({slug:i})},[i,e.flowState,e.screen]),{slug:i,resultPending:void 0===r||c}})();if(tZ(()=>{if(u||t.flowState.type==s.PasswordReset)return;let e=n.parseAuthenticateUrl();if(!e?.handled)return;let{mutationKey:l,defaultError:c,onSuccess:d}=la[e.tokenType];_(!0),g(l,n.authenticateByUrl({session_duration_minutes:i.sessionOptions.sessionDurationMinutes})).then(e=>{if(!e?.handled)return;let{data:t}=e,n=oz[l];n&&o({type:n,data:t}),d(t,r,i)},e=>{a(e),((e,t=az)=>{r({type:"set_error_message_and_transition",errorType:lo[is(e)]??t,canGoBack:!1})})(e,c)}).finally(()=>_(!1))},[]),tZ(()=>{if(u||p)return;let e=n.parseAuthenticateUrl();!e?.handled&&(f||y||null!==t.flowState.organization||t.screen!==at||t.flowState.type!=s.Organization||r({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}))},[r,u,p,y,f,t.flowState.organization,t.flowState.type,t.screen,n,a]),u)return rZ.createElement(o1,null);if(p)return rZ.createElement(sH,{theme:c,displayWatermark:!1},rZ.createElement(i3,null));if(t.flowState.organization?.organization_logo_url){let{organization_name:r,organization_logo_url:n}=t.flowState.organization;e={url:n,alt:r??""}}let v={[at]:sQ,[an]:sj,[aa]:sZ,[ao]:sF,[au]:s1,[ap]:s7,[a_]:le,[ah]:s0,[am]:s3,[af]:lr,[ag]:lt,[ay]:ln}[h]??m[h];return rZ.createElement(sH,{theme:c,displayWatermark:l},rZ.createElement(sN,{appLogo:d.logo,orgLogo:e}),rZ.createElement(v,null))},ls=({client:e,presentation:t,callbacks:r,config:n,strings:a})=>{let[o,i]=tG(()=>{let{displayWatermark:t}=r1(e).bootstrap.getSync();return t});tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_login_screen",details:{options:n,bootstrap:t}}),i(t.displayWatermark)})},[e]);let c=new URL(window.location.href).searchParams.get("stytch_redirect_type")===l.ResetPassword?s.PasswordReset:n.authFlowType,d={...aV,screen:c===s.PasswordReset?as:at,flowState:{...aV.flowState,type:c}},u=t1(()=>({...n,sessionOptions:n.sessionOptions??{}}),[n]),h=nF(t,o,u,"B2BProduct");return rZ.createElement(aG,{client:e,callbacks:r,config:u,initialState:d},rZ.createElement(nq.Provider,{value:h},rZ.createElement(nD,{messages:rQ,overrides:a},rZ.createElement(li,null))))},ll={text:"Verify your identity",details:["View information stored within your account"]},lc={text:"Maintain access to your data even when you're not actively using the app",details:["Access your data even when you are offline.","Synchronize data and process background tasks on your behalf."]},ld="openid",lu="profile",lh="email",lm="phone",lp="offline_access",l_=new Set([ld,lu,lh,lm,"full_access",lp]),lg=[ld,lh,lu],lf=(e,t)=>{if(!t)return[];let r=[];for(let n of e){if(l_.has(n))continue;let e=t.scopes.find(e=>e.scope===n);e&&e.description?r.push(e.description):r.push(`Use the ${n} scope`)}return r},ly=e=>{let t={client_id:"",redirect_uri:"",response_type:"code",scopes:[...lg]};for(let r of["client_id","redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}for(let r of["response_type","scope","code_challenge","state","nonce","prompt"]){let n=e.get(r);n&&("scope"===r?t.scopes=n.split(" ").filter(Boolean):t[r]=n)}return e.has("resource")&&(t.resources=e.getAll("resource")),{error:null,result:t}},lv=e=>{let t={client_id:"",post_logout_redirect_uri:""};for(let r of["client_id","post_logout_redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}return t.id_token_hint=e.get("id_token_hint")||void 0,t.state=e.get("state")||void 0,{error:null,result:t}};nW(".IDPConsentManifest_module_manifest__9dc43278 details{overflow:clip}.IDPConsentManifest_module_manifest__9dc43278 summary,.IDPConsentManifest_module_summaryNoDetail__9dc43278{align-items:center;display:flex;justify-content:space-between}.IDPConsentManifest_module_manifest__9dc43278 summary{cursor:pointer;outline:0}.IDPConsentManifest_module_manifest__9dc43278 details,.IDPConsentManifest_module_summaryNoDetail__9dc43278{padding:var(--st-spacing-2) var(--st-spacing-3)}.IDPConsentManifest_module_summaryNoDetail__9dc43278{min-height:var(--st-spacing-9)}.IDPConsentManifest_module_ungrantable__9dc43278{background:var(--st-muted)}.IDPConsentManifest_module_outerList__9dc43278 details,.IDPConsentManifest_module_ungrantable__9dc43278{border-radius:var(--st-rounded-md)}.IDPConsentManifest_module_outerList__9dc43278 details:has(:focus-visible),.IDPConsentManifest_module_ungrantable__9dc43278:has(:focus-visible){box-shadow:var(--st-focus-ring-shadow)}@supports not selector(:has(:focus-visible)){.IDPConsentManifest_module_outerList__9dc43278 details:focus-within,.IDPConsentManifest_module_ungrantable__9dc43278:focus-within{box-shadow:var(--st-focus-ring-shadow)}}.IDPConsentManifest_module_borderBetween__9dc43278:not(:last-child){border-bottom:1px solid var(--st-border)}.IDPConsentManifest_module_outerList__9dc43278{list-style:none}.IDPConsentManifest_module_nestedList__9dc43278{list-style:disc;padding-block:var(--st-spacing) var(--st-spacing-2);padding-inline-start:var(--st-spacing-4)}.IDPConsentManifest_module_chevron__9dc43278{flex-shrink:0;transition:transform var(--st-transition-duration) ease}details[open] .IDPConsentManifest_module_chevron__9dc43278{transform:rotate(90deg)}");var lb={manifest:"IDPConsentManifest_module_manifest__9dc43278",summaryNoDetail:"IDPConsentManifest_module_summaryNoDetail__9dc43278",ungrantable:"IDPConsentManifest_module_ungrantable__9dc43278 IDPConsentManifest_module_manifest__9dc43278",outerList:"IDPConsentManifest_module_outerList__9dc43278",borderBetween:"IDPConsentManifest_module_borderBetween__9dc43278",nestedList:"IDPConsentManifest_module_nestedList__9dc43278 IDPConsentManifest_module_borderBetween__9dc43278",chevron:"IDPConsentManifest_module_chevron__9dc43278 i18n_module_rtlIcon__278ecfc9"};let lw=({item:e,as:t="li"})=>{"string"==typeof e&&(e={text:e});let r=rZ.createElement(nZ,{variant:"helper"},e.text);return e.details?.length?rZ.createElement(t,{className:lb.borderBetween},rZ.createElement("details",{className:lb.details},rZ.createElement("summary",{onClick:lC},r,rZ.createElement(o8,{className:lb.chevron,role:"presentation"})),rZ.createElement("ul",{className:lb.nestedList},e.details?.map(e=>rZ.createElement(nZ,{as:"li",variant:"helper",key:e},e))))):rZ.createElement(t,{className:nj(lb.summaryNoDetail,lb.borderBetween)},r)},lk=({section:e})=>rZ.createElement(id,{gap:2},rZ.createElement(nZ,{weight:"medium"},e.header),rZ.createElement("ul",{className:lb.outerList},e.items.map((e,t)=>rZ.createElement(lw,{key:t,item:e})))),lS=({manifest:e,clientName:t})=>{let{i18n:r,_:n}=nO(),a="object"==typeof e[0]&&"header"in e[0]?e:[{header:r._({id:"idpConsent.allowClientTo",message:"Allow {clientName} to:",values:{clientName:t}}),items:e}];return rZ.createElement("div",{className:lb.manifest},a.map((e,t)=>rZ.createElement(lk,{key:t,section:e})))},lE=({clientName:e,ungrantableScopeDescriptions:t})=>{let{i18n:r,_:n}=nO();if(!t.length)return null;let a={text:r._({id:"idpConsent.noPermissionsToGrant",message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:e}}),details:t};return rZ.createElement("div",{className:lb.ungrantable},rZ.createElement(lw,{item:a,as:"div"}))};function lC(e){let t=e.currentTarget.parentElement;if(t?.tagName!=="DETAILS")return;e.preventDefault();let r=t.open,n=e.currentTarget.clientHeight+"px",a=getComputedStyle(t),o=`calc(${n} + ${a.paddingTop} + ${a.paddingBottom})`,i={duration:iu(e.currentTarget),easing:"ease-in-out"};if(r){let e=t.clientHeight+"px";t.animate([{height:e},{height:o}],i).finished.then(()=>{t.open=!1})}else t.open=!0,requestAnimationFrame(()=>{let e=t.clientHeight+"px";t.animate([{height:o},{height:e}],i)})}let lP=(e,t)=>{switch(t.type){case"START_SUBMIT":return{...e,loading:!0};case"COMPLETE_SUBMIT":return{...e,loading:!1,success:!0};case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,client:t.client,consent_required:t.consent_required,grantable_scope:t.grantable_scope,ungrantable_scope:t.ungrantable_scope};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lT=({bootstrap:e,bootstrapNotLoaded:t,state:r,submit:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l,success:c,client:d}=r,u=t2(nz),h=t1(()=>{let e=r.client?.client_name??"";if(!e)try{e=new URL(r.redirect_uri).hostname}catch(t){eC("Unable to parse host from redirect URI.",t),e=a._({id:"idpConsent.defaultClientName",message:"The App"})}return e},[r.client?.client_name,r.redirect_uri,o]),m=t1(()=>{if(u)try{return u({scopes:r.grantable_scope.split(" "),clientName:h})}catch(e){eP("Error rendering custom consent screen. Falling back to default consent screen.",e)}return(({scopes:e,clientName:t,rbacPolicy:r})=>{let n;return[{header:`${t} is requesting to:`,items:(n=[],e.includes(ld)&&n.push(ll),(e.includes(lh)||e.includes(lu)||e.includes(lm))&&n.push((({containsProfile:e,containsEmail:t,containsPhoneNumber:r})=>{let n=[];return e&&n.push("Your name, profile picture, and language preferences"),t&&n.push("Your email address"),r&&n.push("Your phone number"),{text:"View your personal profile information",details:n}})({containsEmail:e.includes(lh),containsPhoneNumber:e.includes(lm),containsProfile:e.includes(lu)})),e.includes(lp)&&n.push(lc),n).concat(lf(e,r))}]})({scopes:r.grantable_scope.split(" "),rbacPolicy:e.rbacPolicy,clientName:h})},[u,r.grantable_scope,h,e.rbacPolicy]),p=t1(()=>""===r.ungrantable_scope?[]:lf(r.ungrantable_scope.split(" "),e.rbacPolicy),[r.ungrantable_scope,e.rbacPolicy]);return i||t?rZ.createElement(i4,null):s?rZ.createElement(sU,{text:s}):l?rZ.createElement(sU,{text:a._({id:"idpConsent.denied",message:"Access to the application was denied."})}):c?rZ.createElement(sK,null):rZ.createElement(lO,{client:d,submit:n,grantableScope:r.grantable_scope,projectName:e.projectName},rZ.createElement(lE,{ungrantableScopeDescriptions:p,clientName:h}),rZ.createElement(lS,{manifest:m,clientName:h}))},lO=({client:e,submit:t,grantableScope:r,projectName:n,children:a})=>{let{i18n:o,_:i}=nO(),{options:s}=t2(nq),l=e.client_name,c=r.split(" ").some(e=>!l_.has(e))?o._({id:"idpConsent.customScopes.title",message:"{clientName} wants to access your {projectName} account",values:{clientName:l,projectName:n}}):o._({id:"idpConsent.signIn.title",message:"Sign in to {clientName} with {projectName}",values:{clientName:l,projectName:n}});return rZ.createElement(id,{gap:6},s.logo&&rZ.createElement(sN,{appLogo:s.logo}),rZ.createElement(nZ,{variant:"header",align:"center"},c),a,rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},o._({id:"idpConsent.button.allow",message:"Allow"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},o._({id:"idpConsent.button.deny",message:"Deny"}))))},lA=(e,t)=>{switch(t.type){case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,consent_required:t.consent_required,redirect_uri:t.redirect_uri};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lx=e=>{window.location.href=e},lD=({state:e,submit:t,bootstrap:r,bootstrapNotLoaded:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l}=e;if(i||n)return rZ.createElement(i4,null);if(s)return rZ.createElement(sU,{text:s});if(l)return rZ.createElement(sK,{text:a._({id:"idpLogout.notLoggedOut",message:"You have not been logged out. You may close this page."})});let c=r.projectName;return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header",align:"center"},a._({id:"idpLogout.title",message:"Log out?"})),rZ.createElement(nZ,{variant:"body"},a._({id:"idpLogout.confirmMessage",message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:c}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},a._({id:"idpLogout.yes",message:"Yes"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},a._({id:"idpLogout.no",message:"No"}))))},lz=({initialError:e,initialParams:t})=>{let r=t2(aW).client,n=aY(),a=aZ(),{oauthAuthorizeStart:o,oauthAuthorizeSubmit:i}=r.idp,s=oI(),l=(({initialError:e,initialParams:t,oauthAuthorizeStart:r,oauthAuthorizeSubmit:n,onError:a,onEvent:o})=>{let[i,s]=tY(lP,{loading:!e,preflight:!!e,error:e,success:!1,denied:!1,consent_required:!1,client:null,grantable_scope:"",ungrantable_scope:"",redirect_uri:t.redirect_uri});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async({consent_required:e,consent_granted:r})=>{s({type:"START_SUBMIT"});let a=await n({...t,consent_granted:r});a.authorization_code&&s({type:"COMPLETE_SUBMIT"}),window.location.href=a.redirect_uri,e&&!r?(s({type:"CONSENT_DENIED"}),o({type:eu.OAuthAuthorizeFlowConsentDenied,data:{}})):o({type:eu.OAuthAuthorizeFlowComplete,data:{}})},[n,t,o]),c=t0(({consent_granted:e})=>l({consent_granted:e,consent_required:!0}),[l]),d=t0(async()=>{let e;s({type:"START_PREFLIGHT"}),o({type:eu.OAuthAuthorizeFlowStart,data:{client_id:t.client_id,redirect_uri:t.redirect_uri,scope:t.scopes.join(" ")}});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}if(e.consent_required){let t=e.scope_results.filter(e=>e.is_grantable).map(e=>e.scope).join(" "),r=e.scope_results.filter(e=>!e.is_grantable).map(e=>e.scope).join(" ");s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,client:e.client,grantable_scope:t,ungrantable_scope:r});return}await l({consent_required:!1,consent_granted:!1})},[o,t,r,a,l]);return tZ(()=>{i.preflight||d()},[d,i.preflight]),{state:i,submit:c}})({initialError:e,initialParams:t,oauthAuthorizeStart:o,oauthAuthorizeSubmit:i,onError:n,onEvent:a});return rZ.createElement(lT,{bootstrap:s,bootstrapNotLoaded:!1,...l})},lM=({initialError:e,initialParams:t,navigate:r})=>{let n=t2(aW).client,a=aY(),{oauthLogoutStart:o}=n.idp,i=oI(),s=(({initialError:e,initialParams:t,oauthLogoutStart:r,revokeSession:n,onError:a,navigate:o=lx})=>{let[i,s]=tY(lA,{loading:!e,preflight:!!e,error:e,denied:!1,consent_required:!1,redirect_uri:""});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async e=>{try{await n()}catch{}o(e)},[n,o]),c=t0(async()=>{let e;s({type:"START_PREFLIGHT"});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}e.consent_required?s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,redirect_uri:e.redirect_uri}):l(e.redirect_uri)},[t,r,a,l]);tZ(()=>{i.preflight||c()},[c,i.preflight]);let d=t0(async({consent_granted:e})=>{if(e)return l(i.redirect_uri);s({type:"CONSENT_DENIED"})},[l,i]);return{state:i,submit:d}})({initialError:e,initialParams:t,oauthLogoutStart:o,revokeSession:()=>n.session.revoke({forceClear:!0}),onError:a,navigate:r});return rZ.createElement(lD,{...s,bootstrap:i,bootstrapNotLoaded:!1})},lI=({searchParams:e=window.location.search,navigate:t}={})=>{let r,[{flow:n,error:a}]=tG((e=>{let t=new URLSearchParams(e);if(t.has("post_logout_redirect_uri")){let e=lv(t);return{error:e.error,flow:{type:"Logout",params:e.result}}}let r=ly(t);return{error:r.error,flow:{type:"Authorize",params:r.result}}})(e)),{theme:o,displayWatermark:i}=t2(nq);return"Authorize"===n.type?r=rZ.createElement(lR,null,rZ.createElement(lz,{initialError:a,initialParams:n.params})):"Logout"===n.type&&(r=rZ.createElement(lM,{initialError:a,initialParams:n.params,navigate:t})),rZ.createElement(sH,{theme:o,displayWatermark:i},r)},lR=({children:e})=>{let t,{i18n:r,_:n}=nO(),a=rG((t=t2(aW).client).onStateChange,()=>t.self.getSync()),o=aY(),i=tQ(o);tZ(()=>{i.current=o},[o]);let s=t2(aW).client,l=t2(nM),[c,d]=tG(!1),[u,h]=tG(!1);return(tZ(()=>{c||u||(async e=>{if(e?.trustedAuthToken&&e?.tokenProfileID){d(!0);let t=e.trustedAuthToken,r=e.tokenProfileID,n=s.self.getSync();n&&await s.session.revoke();try{await s.session.attest({token:t,profile_id:r,organization_id:n?.organization_id,session_duration_minutes:60})}catch(e){i.current(e)}finally{d(!1),h(!0)}}h(!0)})(l)},[l,c,u,s]),tZ(()=>{a||i.current(new w)},[a]),c)?rZ.createElement(i4,null):a?e:rZ.createElement(sU,{text:r._({id:"idpConsent.noActiveSession",message:"No active session detected. Please log in to continue."})})};class lL extends Event{stytchEventType;stytchEventData;constructor(e){super("stytch-event",{composed:!0}),this.stytchEventType=e.type,this.stytchEventData=e.data}}class lB extends Event{error;constructor(e){super("stytch-error",{composed:!0}),this.error=e}}function lN(e,{propNames:r,attributeNames:n=[]}){if("u"<typeof window)return class{render(){}flushRender(){}};let a=Object.fromEntries(n.map(e=>[e.toLowerCase(),e]));return class o extends HTMLElement{#e;static observedAttributes=Object.keys(a);#t;#r=!1;#n={};constructor({shadow:e}={}){for(const t of(super(),this.#t=e??null!=this.getAttribute("shadow"),o.observedAttributes)){const e=this.getAttribute(t);if(null!=e){const r=a[t];this.#n[r]=e}}for(const e of r)Object.hasOwn(this,e)&&(this.#n[e]=this[e]),Object.defineProperty(this,e,{get:()=>this.#n[e],set:t=>{n.includes(e)&&this.setAttribute(e,t),this.#n[e]=t,this.#a()}})}connectedCallback(){if(!this.#e)if(this.#e=document.createElement("div"),this.#t){this.setAttribute("shadow","true");let e=this.attachShadow({mode:"open"});e.appendChild(nG()),e.appendChild(this.#e)}else t||(t=nG(),document.head.appendChild(t)),this.appendChild(this.#e);this.#a()}disconnectedCallback(){this.#e&&rq(this.#e)}attributeChangedCallback(e,t,r){let n=a[e];this.#n[n]=r}render(e){Object.assign(this,e)}flushRender(){rj(()=>{this.#o()})}#a(){this.#r||(this.#r=!0,window.queueMicrotask(()=>{this.#o()}))}#i(e){var t;let r=(t=e,t?.config);if(r?.oauthOptions?.providers.some(e=>"object"==typeof e&&"google"===e.type&&e.one_tap)&&!this.querySelector("#google-parent-prompt")){let e=document.createElement("div");e.id="google-parent-prompt",e.slot="one-tap",this.appendChild(e)}}#s={onError:e=>{this.#n.callbacks?.onError?.(e),this.dispatchEvent(new lB(e))},onEvent:e=>{this.#n.callbacks?.onEvent?.(e),this.dispatchEvent(new lL(e))}};#o(){if(!this.#e||(this.#r=!1,0===Object.keys(this.#n).length))return;this.#i(this.#n);let t=this.#n;this.#t&&(t=function(e){let{presentation:t}=e;return lF(e)?e:{...e,presentation:{...t,options:{...t?.options,enableShadowDOM:!0}}}}(t)),rC(rZ.createElement(e,{...t,callbacks:this.#s}),this.#e)}}}function lU(e,t){return"u"<typeof window?()=>null:({elementId:r,...n})=>{let a;customElements.get(e)||customElements.define(e,t);let o=document.querySelector(r);if(!o)throw Error(`The selector you specified (${r}) applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin().`);return o.firstChild?.nodeName.toLowerCase()===e.toLowerCase()?(a=o.firstChild).render(n):(a=new t({shadow:lF(n)}),o.appendChild(a)),a}}function lF(e){let{config:t,presentation:r}=e;return r?.options?.enableShadowDOM??t?.enableShadowDOM}let lq=lN(({client:e,presentation:t,callbacks:r,strings:n,getIDPConsentManifest:a,trustedAuthTokenParams:o,styles:i})=>{let s=nF(t,!1,{products:[]});return tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_idp_screen",details:{bootstrap:t}})})},[e]),i&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide"),rZ.createElement(aG,{client:e,config:{},callbacks:r,initialState:aV},rZ.createElement(nI,{consentManifestGenerator:a,authTokenParams:o},rZ.createElement(nq.Provider,{value:s},rZ.createElement(nD,{messages:rQ,overrides:n},rZ.createElement(lI,null)))))},{propNames:["client","presentation","callbacks","strings","getIDPConsentManifest","trustedAuthTokenParams"]}),lH=lU("stytch-identity-provider",lq),lK=lN(({config:e,styles:t,...r})=>{t&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide");let n={...e,organizationProducts:Object.values(sL)};return rZ.createElement(ls,{config:n,...r})},{propNames:["client","config","presentation","callbacks","strings"]}),lj=lU("stytch-ui",lK),l$=Symbol("__stytch_SSRStubKey"),lV=e=>new Proxy(()=>{},{get:(t,r)=>r===l$||lV(e+"."+String(r)),apply(){throw Error(`[Stytch] Invalid server-side function call to ${e}.
46
+ }`;nW(".OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*64)}.-st-mobile .OtpInput_module_inputContainer__1e43b599{width:calc(var(--st-spacing)*70)}.OtpInput_module_slotsContainer__1e43b599{display:flex;gap:var(--st-spacing-2);justify-content:start;width:fit-content}.OtpInput_module_otpSlot__1e43b599{align-items:center;display:flex;height:calc(var(--st-spacing)*9);justify-content:center;width:calc(var(--st-spacing)*9)}.-st-mobile .OtpInput_module_otpSlot__1e43b599{height:calc(var(--st-spacing)*10);width:calc(var(--st-spacing)*10)}.OtpInput_module_disabled__1e43b599 .OtpInput_module_otpSlot__1e43b599{color:var(--st-muted-foreground)}.OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1.5s step-start infinite;border-right:1px solid var(--st-foreground);display:inline-block;height:calc(var(--st-text-sm)*1.25);width:0}.OtpInput_module_safari__1e43b599 .OtpInput_module_caret__1e43b599{animation:OtpInput_module_caretBlink__1e43b599 1s ease-in-out infinite;border-right-width:2px}@keyframes OtpInput_module_caretBlink__1e43b599{0%,to{opacity:0}50%{opacity:1}}");let sc=e=>e.replace(/\D/g,"").slice(0,6),sd=({slots:e})=>rZ.createElement("div",{className:"OtpInput_module_slotsContainer__1e43b599"},e.map((e,t)=>rZ.createElement("div",{key:t,className:nj("OtpInput_module_otpSlot__1e43b599 inputBase_module_inputBase__06c14ae4",{"OtpInput_module_active__1e43b599 inputBase_module_forceFocusRing__06c14ae4":e.isActive})},rZ.createElement("span",null,e.char),e.hasFakeCaret&&rZ.createElement("div",{className:"OtpInput_module_caret__1e43b599"})))),su=({defaultOtp:e,onSubmit:t,disabled:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(e),l=t1(()=>{let e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrom")},[]);return rZ.createElement(si,{"aria-label":a._({id:"formField.otp.ariaLabel",message:"One-time passcode"}),containerClassName:nj("OtpInput_module_inputContainer__1e43b599",{OtpInput_module_disabled__1e43b599:r,OtpInput_module_safari__1e43b599:l}),maxLength:6,value:i,onChange:e=>s(sc(e)),pasteTransformer:sc,disabled:r,onComplete:t,pattern:"[0-9]*",render:sd,...n})},sh=({header:e,body:t,helper:r,align:n})=>rZ.createElement(id,{gap:4},rZ.createElement(nZ,{variant:"header",align:n},e),t&&rZ.createElement(nZ,{align:n},t),r&&rZ.createElement(nZ,{variant:"helper",align:n},r)),sm=({header:e,helperContent:t,instruction:r,isSubmitting:n,onSubmit:a,errorMessage:o})=>{let{i18n:i,_:s}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:e,body:r}),rZ.createElement(id,{gap:2},rZ.createElement(id,null,rZ.createElement(su,{onSubmit:a,disabled:n}),rZ.createElement(i8,{isOpen:n},rZ.createElement(id,{className:"OTPEntry_module_progressInner__6b10f31d",gap:2},rZ.createElement(nZ,{variant:"helper"},i._({id:"formField.passcode.status.verifying",message:"Verifying passcode..."})),rZ.createElement(i6,{isLoading:n})))),rZ.createElement(id,null,!n&&o&&rZ.createElement(iB,null,o),rZ.createElement(nZ,{variant:"helper",className:ia()},t))))},sp=({expiration:e,formattedDestination:t,isSubmitting:r,onSubmit:n,errorMessage:a})=>{let o,{i18n:i,_:s}=nO(),[l,c]=ir(e),d=(o=Math.floor(l/60))+":"+String(l-60*o).padStart(2,"0"),u=c?i._({id:"passcode.expirationCountdown",message:"Your code expires in {timeRemaining}.",values:{timeRemaining:d}}):i._({id:"passcode.expired",message:"Your code has expired."});return rZ.createElement(sm,{header:i._({id:"passcode.title",message:"Enter passcode"}),helperContent:u,instruction:rZ.createElement(nx,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:rZ.createElement("b",null)},values:{destination:t}}),isSubmitting:r,onSubmit:n,errorMessage:a})},s_=({password:e,setPassword:t,type:r,...n})=>{let{i18n:a,_:o}=nO(),[i,s]=tG(!1),l=tQ(null);return tZ(()=>{let e=l.current?.form;if(!e)return;let t=new AbortController;return e.addEventListener("submit",()=>{l.current&&(l.current.type="password"),s(!1)},{signal:t.signal}),()=>t.abort()},[]),rZ.createElement(iN,{id:`${r}-password`,label:a._({id:"formField.password.label",message:"Password"}),ref:l,autoComplete:`${r}-password`,type:i?"text":"password",value:e,onChange:e=>t(e.target.value),required:!0,action:rZ.createElement(oZ,{variant:"ghost",onClick:()=>s(!i)},i?a._({id:"button.hidePassword",message:"Hide"}):a._({id:"button.showPassword",message:"Show"})),...n})},sg=()=>{let[e,t]=t2(aW).state,r=t2(aW).config,n=t2(aW).client,{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=tG(e.formState.passwordState.email),[d,u]=tG(""),[h,m]=tG(""),[p,_]=tG(!1),g=e.flowState.organization;return{stytch:n,onError:s,email:l,setEmail:c,password:d,setPassword:u,organization:g,errorMessage:h,setErrorMessage:m,isSubmitting:p,setIsSubmitting:_,submitPassword:e=>{m(""),_(!0),n.passwords.authenticate({email_address:l,organization_id:e,password:d,session_duration_minutes:r.sessionOptions?.sessionDurationMinutes??30,locale:r.passwordOptions?.locale}).then(e=>{_(!1),i({type:eu.B2BPasswordAuthenticate,data:e}),oR(e,t,r)}).catch(e=>{_(!1),s(e),m(ic(e,o))})},submitDiscoveryPassword:()=>{m(""),_(!0),n.passwords.discovery.authenticate({email_address:l,password:d}).then(e=>{_(!1),i({type:eu.B2BPasswordDiscoveryAuthenticate,data:e}),t({type:"transition",screen:aa}),t({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})}).catch(e=>{_(!1),s(e),m(ic(e,o))})},handleNonMemberReset:()=>{if(g){if(!(({email_jit_provisioning:e,email_allowed_domains:t},r)=>{switch(e){case"ALL_ALLOWED":return!0;case"NOT_ALLOWED":return!1;case"RESTRICTED":{let e=r.split("@").pop();return null!=e&&t.includes(e)}}})(g,l)){_(!1);let e=g.organization_name;m(a._({id:"error.emailNoAccessToOrg",message:"{email} does not have access to {organizationName}. If you think this is a mistake, contact your admin.",values:{email:l,organizationName:e}}));return}r1(n).dataLayer.setItem("reset-email-value",l),n.magicLinks.email.loginOrSignup({email_address:l,organization_id:g.organization_id,login_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,signup_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,login_template_id:r.emailMagicLinksOptions?.loginTemplateId,signup_template_id:r.emailMagicLinksOptions?.signupTemplateId,locale:r.emailMagicLinksOptions?.locale}).then(()=>{_(!1),t({type:"set_password_state",email:l}),t({type:"transition",screen:al})}).catch(e=>{s(e),m(ic(e,o)),_(!1)})}}}},sf=()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{stytch:n,email:a,setEmail:o,password:i,setPassword:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,submitPassword:m,submitDiscoveryPassword:p,handleNonMemberReset:_}=sg(),[g,f]=tG(!!l&&!a),y=async o=>{if(o.preventDefault(),l){let o=l.organization_id;if(!g)return void m(o);if(!a.match(n5))return void d(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}));d(""),h(!0),r1(n).searchManager.searchMember(a,l.organization_id).then(({member:t})=>{if(t){f(!1),h(!1),e({type:"set_password_state",email:a});return}_()}).catch(e=>{h(!1),d(ic(e,r))})}else p()};return rZ.createElement(id,{as:"form",onSubmit:y,gap:2},rZ.createElement(iU,{email:a,setEmail:o}),!g&&rZ.createElement(s_,{password:i,setPassword:s,type:"current",error:c}),rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},t._({id:"button.continue",message:"Continue"})),!g&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:a}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})))},sy=()=>{let e,t,r=((t=(e=new URL(window.location.toString())).searchParams).delete("token"),t.delete("stytch_token_type"),e);window.history.replaceState(null,document.title,r)};nW('.PasswordError_module_item__c070e7fb{margin-left:var(--st-spacing-6);text-indent:calc(var(--st-spacing-6)*-1)}.PasswordError_module_item__c070e7fb svg{display:inline-block;height:var(--st-spacing-4);margin-right:var(--st-spacing-2);vertical-align:middle;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb{display:inline-block;margin-right:var(--st-spacing-2);text-align:center;text-indent:0;width:var(--st-spacing-4)}.PasswordError_module_bullet__c070e7fb:before{content:"•"}');nW(".PasswordStrengthCheck_module_container__75d2aaf0{border-radius:var(--st-rounded-full);display:flex;gap:var(--st-spacing-0_5);height:0;overflow:clip;transition:height var(--st-transition-duration)}.PasswordStrengthCheck_module_container__75d2aaf0:is(.PasswordStrengthCheck_module_weak__75d2aaf0,.PasswordStrengthCheck_module_strong__75d2aaf0){height:var(--st-spacing)}.PasswordStrengthCheck_module_block__75d2aaf0{background:var(--st-muted);flex:1 1 auto;height:var(--st-spacing)}.PasswordStrengthCheck_module_weak__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-destructive)}.PasswordStrengthCheck_module_strong__75d2aaf0 .PasswordStrengthCheck_module_block__75d2aaf0.PasswordStrengthCheck_module_filled__75d2aaf0{background:var(--st-success)}");let sv=({score:e})=>{let t,{i18n:r,_:n}=nO();return 1===e||2===e?t="PasswordStrengthCheck_module_weak__75d2aaf0":(3===e||4===e)&&(t="PasswordStrengthCheck_module_strong__75d2aaf0"),rZ.createElement("div",{className:nj("PasswordStrengthCheck_module_container__75d2aaf0",t)},null!=e&&e>0&&rZ.createElement(rZ.Fragment,null,[,,,,].fill(void 0).map((t,r)=>rZ.createElement("div",{key:r,className:nj("PasswordStrengthCheck_module_block__75d2aaf0",{PasswordStrengthCheck_module_filled__75d2aaf0:e>r})})),rZ.createElement(iI,null,r._({id:"password.strength",message:"Password strength: {score} out of 4.",values:{score:e}}))))},sb={"Short keyboard patterns are easy to guess.":{id:"password.zxcvbn.warning.shortKeyboardPatterns",message:"Short keyboard patterns are easy to guess."},"Straight rows of keys are easy to guess.":{id:"password.zxcvbn.warning.straightRows",message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:"password.zxcvbn.warning.repeats",message:'Repeats like "aaa" are easy to guess.'},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:"password.zxcvbn.warning.longerRepeats",message:'Repeats like "abcabcabc" are only slightly harder to guess than "abc".'},'Sequences like "abc" or "6543" are easy to guess.':{id:"password.zxcvbn.warning.sequences",message:'Sequences like "abc" or "6543" are easy to guess.'},"Recent years are easy to guess.":{id:"password.zxcvbn.warning.recentYears",message:"Recent years are easy to guess."},"Dates are often easy to guess.":{id:"password.zxcvbn.warning.dates",message:"Dates are often easy to guess."},"This is a top-10 common password.":{id:"password.zxcvbn.warning.top10CommonPassword",message:"This is a top-10 common password."},"This is a top-100 common password.":{id:"password.zxcvbn.warning.top100CommonPassword",message:"This is a top-100 common password."},"This is a very common password.":{id:"password.zxcvbn.warning.veryCommonPassword",message:"This is a very common password."},"This is similar to a commonly used password.":{id:"password.zxcvbn.warning.similarToCommonPassword",message:"This is similar to a commonly used password."},"A word by itself is easy to guess.":{id:"password.zxcvbn.warning.wordByItself",message:"A word by itself is easy to guess."},"Names and surnames by themselves are easy to guess.":{id:"password.zxcvbn.warning.names",message:"Names and surnames by themselves are easy to guess."},"Common names and surnames are easy to guess.":{id:"password.zxcvbn.warning.commonNames",message:"Common names and surnames are easy to guess."}},sw={"Use a few words, avoid common phrases.":{id:"password.zxcvbn.suggestion.useAFewWords",message:"Use a few words, avoid common phrases."},"No need for symbols, digits, or uppercase letters.":{id:"password.zxcvbn.suggestion.noSymbolsDigitsUppercase",message:"No need for symbols, digits, or uppercase letters."},"Add another word or two. Uncommon words are better.":{id:"password.zxcvbn.suggestion.addWords",message:"Add another word or two. Uncommon words are better."},"Use a longer keyboard pattern with more turns.":{id:"password.zxcvbn.suggestion.longerKeyboardPattern",message:"Use a longer keyboard pattern with more turns."},"Avoid repeated words and characters.":{id:"password.zxcvbn.suggestion.avoidRepeats",message:"Avoid repeated words and characters."},"Avoid sequences.":{id:"password.zxcvbn.suggestion.avoidSequences",message:"Avoid sequences."},"Avoid recent years.":{id:"password.zxcvbn.suggestion.avoidRecentYears",message:"Avoid recent years."},"Avoid years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou",message:"Avoid years that are associated with you."},"Avoid dates and years that are associated with you.":{id:"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou",message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:"password.zxcvbn.suggestion.capitalization",message:"Capitalization doesn't help very much."},"All-uppercase is almost as easy to guess as all-lowercase.":{id:"password.zxcvbn.suggestion.allUppercase",message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:"password.zxcvbn.suggestion.reversed",message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:"password.zxcvbn.suggestion.predictableSubstitutions",message:"Predictable substitutions like '@' instead of 'a' don't help very much."}},sk={fulfilled:{id:"password.requirement.fulfilled",message:"Fulfilled"},notFulfilled:{id:"password.requirement.notFulfilled",message:"Not fulfilled"},warning:{id:"password.requirement.warning",message:"Warning"},suggestion:{id:"password.requirement.suggestion",message:"Suggestion"}},sS=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"currentColor"})),sE=()=>rZ.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"currentColor"})),sC=({children:e,type:t})=>{let{i18n:r,_:n}=nO(),a="suggestion"===t?rZ.createElement("span",{role:"presentation",className:"PasswordError_module_bullet__c070e7fb"}):"fulfilled"===t?rZ.createElement(sE,null):rZ.createElement(sS,null);return rZ.createElement(nZ,{variant:"helper",className:"PasswordError_module_item__c070e7fb",color:"suggestion"===t?void 0:"fulfilled"===t?"success":"destructive","aria-atomic":!0},a,rZ.createElement("span",null,rZ.createElement(iI,null,r._(sk[t]),": "),e))},sP=({bootstrap:e,...t})=>{let{i18n:r,_:n}=nO(),a=e.passwordConfig?.ludsComplexity??0,o=e.passwordConfig?.ludsMinimumCount??0;if("notLoaded"===t.policy)return null;let{passwordInvalid:i,isPasswordBreached:s}=t,l=s?rZ.createElement(sC,{type:"warning"},r._({id:"password.strengthError.breached",message:"This password may have been used on a different site that experienced a security issue. Please choose another password."})):null;if("zxcvbn"===t.policy){let{passwordScore:e,passwordWarning:n,passwordSuggestions:a}=t,o=n?sb[n]??n:null,s=[...new Set(a)].map(e=>sw[e]??e);return rZ.createElement(id,{gap:1,"aria-live":"polite"},rZ.createElement(sv,{score:e}),rZ.createElement(iI,null,i?r._({id:"password.strength.notAccepted",message:"Password not accepted."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement("div",null,o&&rZ.createElement(sC,{type:"warning"},r._(o)),s.map(e=>rZ.createElement(sC,{key:e.id,type:"suggestion"},r._(e))),l))}let{missingCharacters:c,missingComplexity:d}=t;return rZ.createElement("div",{"aria-live":"polite"},rZ.createElement(iI,null,i?r._({id:"password.strength.requirementsNotMet",message:"Your password must meet all requirements."}):r._({id:"password.strength.accepted",message:"Password accepted."})),rZ.createElement(sC,{type:0===c?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.minimumLength",message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:o}})),rZ.createElement(sC,{type:0===d?"fulfilled":"notFulfilled"},r._({id:"password.strengthError.complexity",message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:a}})),l)},sT=()=>{throw Error("Assertion failure")};function sO(e){return`sso:${e.connection_id}`}function sA(e){return"oauth"===e.type?e.provider.type:"sso"===e.type?sO(e.connection):"sso-discovery"}let sx=({buttons:e})=>{let{i18n:t,_:r}=nO(),[n,a]=t2(aW).state,{oauthProviderSettings:o=[]}=iG(),i=t2(nq),[l,d]=o$(),u=t2(aW).config,{loginRedirectURL:h,signupRedirectURL:m,discoveryRedirectURL:p,customScopes:_,providerParams:g}=u.oauthOptions??{},{B2BGoogleOneTap:f,OAuthB2BButton:y,SSOButton:v}=oN(u,"ssoAndOAuthButtons"),b=n.flowState.type===s.Discovery,w=e.flatMap(e=>e===aP?o.map(e=>({type:"oauth",provider:e})):e===aT?b?{type:"sso-discovery"}:n.flowState.organization?.sso_active_connections?.map(e=>({type:"sso",connection:e}))??[]:void sT());if(0===w.length)return null;let[k,S]=eT(w,e=>sA(e)===l);return rZ.createElement(iw,null,k.map((e,r)=>{let o=(()=>{switch(e.type){case"oauth":var r,o,s;let l,u,b;return b={customScopes:(o=r=e.provider,0==Object.keys(l=o.customScopes).length&&(l=_),l),providerParams:(s=n.primary.email,0==Object.keys(u=r.providerParams).length&&(u=g??{}),!s||r.type!==c.Google&&r.type!==c.Microsoft||"login_hint"in u||(u={...u,login_hint:s}),u)},r.one_tap?rZ.createElement(f,{key:r.type,...b,cancelOnTapOutside:r.cancel_on_tap_outside}):rZ.createElement(y,{key:r.type,providerType:r.type,loginRedirectUrl:h,signupRedirectUrl:m,discoveryRedirectUrl:p,onSuccess:()=>d(r.type),...b});case"sso":return rZ.createElement(v,{key:e.connection.display_name,connection:e.connection,onStart:()=>d(sO(e.connection))});case"sso-discovery":return rZ.createElement(oZ,{key:"sso-discovery",variant:"outline",id:nH("sso-discovery",i.options),onClick:()=>{a({type:"transition",screen:aw,history:"push"})}},t._({id:"provider.continueWithSSO",message:"Use single sign-on"}));default:sT()}})();return S&&0===r?rZ.createElement(nQ,{key:sA(e)},o):o}))},sD=({availableConnections:e})=>{let[t,r]=o$(),n=t?.startsWith("sso:")?t.slice(4):void 0,[a,o]=eT(e,e=>e.connection_id===n);return tm(id,{gap:2},a.map((e,t)=>{let n=tm(o9,{key:e.display_name,connection:e,onStart:e=>r(sO(e))});return o&&0===t?tm(nQ,null,n):n}))},sz=()=>rZ.createElement(iX,{showPasswordButton:!1}),sM=()=>rZ.createElement(iX,{showPasswordButton:!0}),sI=()=>rZ.createElement(i1,{showPasswordButton:!1}),sR=()=>rZ.createElement(i1,{showPasswordButton:!0});var sL=Object.freeze({__proto__:null,emailMagicLinks:{id:"emailMagicLinks",screens:{[ar]:iD,[av]:i2},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},emailOtp:{id:"emailOtp",screens:{[ab]:()=>{let e=t2(aW).client,t=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{codeExpiration:i}=a.formState.otpState,l=ie(),{userSuppliedEmail:c}=a.formState.emailState,d=iJ({throwOnError:!0}),u=iZ({throwOnError:!0}),h=d.isMutating||u.isMutating,m=d.error||u.error,p=oM("stytch.otps.email.discovery.authenticate",(t,{arg:{otp:r,email:n}})=>e.otps.email.discovery.authenticate({code:r,email_address:n}),{onSuccess:e=>{oL(e,o)},throwOnError:!0}),_=oM("stytch.otps.email.authenticate",(t,{arg:{otp:r,emailAddress:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.email.authenticate({code:r,email_address:n,organization_id:a,session_duration_minutes:o}),{onSuccess:e=>{oR(e,o,t)},throwOnError:!0}),g=p.isMutating||_.isMutating,f=p.error||_.error||m,y=f?ic(f,n):void 0,v=()=>{for(let e of[d,u,_,p])e.reset()},b=async e=>{v();try{a.flowState.type===s.Discovery?await p.trigger({otp:e,email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&a.formState.emailState.userSuppliedEmail&&await _.trigger({otp:e,emailAddress:a.formState.emailState.userSuppliedEmail,organizationId:a.flowState.organization.organization_id,sessionDurationMinutes:t.sessionOptions.sessionDurationMinutes})}catch{l.clear()}},w=async()=>{v(),!h&&(a.flowState.type===s.Discovery?await u.trigger({email:c}):a.flowState.type===s.Organization&&a.flowState.organization&&await d.trigger({email:c,organization_id:a.flowState.organization.organization_id}))};return rZ.createElement(id,{gap:6},null!==i?rZ.createElement(sp,{isSubmitting:g,onSubmit:b,errorMessage:y,expiration:i.getTime(),formattedDestination:c}):rZ.createElement(i4,null),rZ.createElement(iw,null,rZ.createElement(i5,{countdown:l,resendOTP:w,isSubmitting:g}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{o({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[av]:i2,[ar]:iD},mainScreen:{[aE]:sz,[aC]:sI,[aA]:sM,[ax]:sR},icons:o4},oauth:{id:"oauth",screens:{},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,B2BGoogleOneTap:o1,OAuthB2BButton:oX},icons:{google:o2,microsoft:o3,hubspot:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#FF7A59",fillRule:"evenodd",d:"M13.93 13.97a2.4 2.4 0 0 1-2.43-2.4c0-1.34 1.09-2.42 2.43-2.42a2.4 2.4 0 0 1 2.43 2.41c0 1.33-1.08 2.41-2.43 2.41m.73-7.05V4.78c.56-.26.96-.83.96-1.49v-.05c0-.9-.75-1.64-1.66-1.64h-.05c-.92 0-1.67.74-1.67 1.64v.05c0 .66.4 1.23.96 1.5v2.13q-1.27.21-2.24.98L5 3.32q.07-.21.07-.46C5.08 1.83 4.24 1 3.2 1s-1.88.83-1.88 1.86a1.87 1.87 0 0 0 2.8 1.6l5.85 4.51a4.6 4.6 0 0 0 .07 5.29l-1.77 1.76a1.54 1.54 0 0 0-1.98 1.46 1.54 1.54 0 0 0 3.09 0q-.02-.23-.08-.44l1.76-1.74a4.75 4.75 0 0 0 7.62-3.74 4.7 4.7 0 0 0-4.02-4.64",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#E01E5A",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0z"}),tm("path",{fill:"#36C5F0",d:"M7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79z"}),tm("path",{fill:"#2EB67D",d:"M15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0z"}),tm("path",{fill:"#ECB22E",d:"M12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#24292F",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd",className:o0}))}},passwords:{id:"passwords",screens:{"Password Email":sf,[ai]:()=>{let[,e]=t2(aW).state,{i18n:t,_:r}=nO(),{email:n,setEmail:a,password:o,setPassword:i,organization:s,errorMessage:l,setErrorMessage:c,isSubmitting:d,submitPassword:u,submitDiscoveryPassword:h}=sg(),m=async e=>{e.preventDefault(),n.match(n5)?s?u(s.organization_id):h():c(t._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},t._({id:"password.login.title",message:"Log in with email and password"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:4},rZ.createElement(iU,{email:n,setEmail:a}),rZ.createElement(s_,{password:o,setPassword:i,type:"current",error:l}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:d,type:"submit"},t._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"set_password_state",email:n}),e({type:"transition",screen:ac})}},t._({id:"link.signupResetPassword",message:"Sign up or reset password"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},t._({id:"button.goBack",message:"Go back"})))))},[ac]:()=>{let[,e]=t2(aW).state,t=t2(aW).config,r=aZ(),{i18n:n,_:a}=nO(),{stytch:o,email:i,setEmail:s,organization:l,errorMessage:c,setErrorMessage:d,isSubmitting:u,setIsSubmitting:h,handleNonMemberReset:m}=sg(),p=async s=>{(s.preventDefault(),i.match(n5))?(d(""),h(!0),l?r1(o).searchManager.searchMember(i,l.organization_id).then(({member:n})=>{n?o.passwords.resetByEmailStart({email_address:i,organization_id:l.organization_id,login_redirect_url:t.emailMagicLinksOptions?.loginRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(t=>{h(!1),r({type:eu.B2BPasswordResetByEmailStart,data:t}),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))}):m()}).catch(e=>{h(!1),d(ic(e,a))}):o.passwords.discovery.resetByEmailStart({email_address:i,discovery_redirect_url:t.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:t.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:t.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:t.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:t.passwordOptions?.verifyEmailTemplateId,locale:t.passwordOptions?.locale}).then(()=>{h(!1),e({type:"set_password_state",email:i}),e({type:"transition",screen:ad})}).catch(e=>{h(!1),d(ic(e,a))})):d(n._({id:"error.invalidEmailAddress",message:"Invalid email address"}))};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},n._({id:"password.forgot.title",message:"Check your email for help signing in"})),rZ.createElement(nZ,{variant:"body"},l?n._({id:"password.forgot.content.organization",message:"We'll email you a login link to sign in to your account directly or reset your password if you have one."}):n._({id:"password.forgot.content.discovery",message:"We'll email you a verification link to sign up for an account or reset your password if you have one."})),rZ.createElement(iU,{email:i,setEmail:s,error:c}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:u,type:"submit"},n._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>e({type:"transition",screen:at})},n._({id:"button.goBack",message:"Go back"}))))},[ad]:()=>{let[,e]=t2(aW).state,t=aZ(),r=t2(aW).config,{i18n:n,_:a}=nO(),{stytch:o,onError:i,email:s,organization:l,setIsSubmitting:c}=sg();return rZ.createElement(ik,{header:n._({id:"password.reset.emailSent.title",message:"Check your email"}),description:rZ.createElement(nx,{id:"password.reset.emailSent.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:s}}),resend:()=>l?o.passwords.resetByEmailStart({email_address:s,organization_id:l.organization_id,login_redirect_url:r.passwordOptions?.loginRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordResetByEmailStart,data:e})}).catch(e=>{throw i(e),e}):o.passwords.discovery.resetByEmailStart({email_address:s,discovery_redirect_url:r.passwordOptions?.discoveryRedirectURL,reset_password_redirect_url:r.passwordOptions?.resetPasswordRedirectURL,reset_password_expiration_minutes:r.passwordOptions?.resetPasswordExpirationMinutes,reset_password_template_id:r.passwordOptions?.resetPasswordTemplateId,verify_email_template_id:r.passwordOptions?.verifyEmailTemplateId,locale:r.passwordOptions?.locale}).then(e=>{c(!1),t({type:eu.B2BPasswordDiscoveryResetStart,data:e})}),goBack:()=>e({type:"transition",screen:at})})},[as]:()=>{let e=t2(aW).client,t=t2(aW).config,[,r]=t2(aW).state,n=oI(),{i18n:a,_:o}=nO(),i=aZ(),s=aY(),[l,c]=t1(()=>{let t=e.parseAuthenticateUrl();return t?[t.token,t.tokenType]:["",""]},[e]),d=r1(e).dataLayer.getItem("reset-email-value"),[u,h]=tG(""),[m,p]=tG(""),[_,g]=tG({policy:"notLoaded"}),[f,y]=tG(!1),v=t1(()=>((e,t=500)=>{let r;return(...n)=>{clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}})(t=>(p(""),e.passwords.strengthCheck({password:t}).then(({score:e,valid_password:t,zxcvbn_feedback:r,luds_feedback:n,strength_policy:a,breached_password:o})=>{let i={passwordInvalid:!t,isPasswordBreached:o};"zxcvbn"===a?g({policy:a,...i,passwordScore:e,passwordWarning:r.warning,passwordSuggestions:r.suggestions}):"luds"===a&&g({policy:a,...i,missingCharacters:n.missing_characters,missingComplexity:n.missing_complexity})}).catch(e=>{p(ic(e,o))}))),[e.passwords,o]);tZ(()=>{if("multi_tenant_magic_links"===c)return void e.magicLinks.authenticate({magic_links_token:l,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.emailMagicLinksOptions?.locale}).then(e=>{sy(),r({type:"primary_authenticate_success",response:e,includedMfaMethods:t.mfaProductInclude,resetTokenType:c})}).catch(e=>{p(ic(e,o)),s(e)})},[c]);let b=function(e,t){if("notLoaded"===t||"zxcvbn"===t||null==e.passwordConfig)return{type:"new",passwordrules:"allowed: unicode; minlength: 10"};let{ludsComplexity:r,ludsMinimumCount:n}=e.passwordConfig,a=["special","digit","upper","lower"].slice(0,r);return{type:"new",minLength:n,passwordrules:`allowed: unicode; minlength: ${n}; ${a.map(e=>`required: ${e}`).join("; ")}`}}(n,_.policy);return rZ.createElement(id,{gap:6,as:"form",onSubmit:n=>{n.preventDefault(),p(""),y(!0),"multi_tenant_passwords"==c?e.passwords.resetByEmail({password_reset_token:l,password:u,session_duration_minutes:t.sessionOptions?.sessionDurationMinutes??30,locale:t.passwordOptions?.locale}).then(e=>{y(!1),i({type:eu.B2BPasswordResetByEmail,data:e}),oR(e,r,t)}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):"discovery"==c?e.passwords.discovery.resetByEmail({password_reset_token:l,password:u}).then(e=>{y(!1),i({type:eu.B2BDiscoveryPasswordReset,data:e}),r({type:"transition",screen:aa}),r({type:"set_discovery_state",email:e.email_address,discoveredOrganizations:e.discovered_organizations})}).catch(e=>{s(e),p(ic(e,o)),y(!1)}):e.passwords.resetBySession({password:u}).then(e=>{y(!1),i({type:eu.B2BPasswordResetBySession,data:e}),r({type:"transition",screen:an})}).catch(e=>{s(e),p(ic(e,o)),y(!1)})}},rZ.createElement(nZ,{variant:"header"},a._({id:"password.setNew.title",message:"Set a new password"})),rZ.createElement(id,{gap:2},d?rZ.createElement(iU,{email:d,setEmail:n6,disabled:!0}):null,rZ.createElement(s_,{password:u,setPassword:e=>{h(e),v(e)},error:m,...b}),rZ.createElement(sP,{bootstrap:n,..._}),rZ.createElement(oZ,{variant:"primary",loading:f,type:"submit",disabled:"notLoaded"===_.policy||_.passwordInvalid},a._({id:"button.continue",message:"Continue"}))))},[al]:()=>{let{i18n:e,_:t}=nO(),[r,n]=t2(aW).state,a=ix(),o=r.formState.passwordState.email;return rZ.createElement(ik,{header:e._({id:"password.verification.title",message:"Verify your email first."}),description:rZ.createElement(nx,{id:"password.verification.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:rZ.createElement("b",null)},values:{email:o}}),additionalActions:rZ.createElement(rZ.Fragment,null,rZ.createElement(iP,{emailDomain:a,providerInfo:iS}),rZ.createElement(iP,{emailDomain:a,providerInfo:iC}),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{n({type:"set_user_supplied_email",email:""}),n({type:"transition",screen:at})}},e._({id:"button.retry",message:"Try again"})))})}},mainScreen:{[aO]:sf,[aA]:sM,[ax]:sR},icons:o4},sso:{id:"sso",screens:{[aw]:()=>{let e,[,t]=t2(aW).state,[r,n]=tG(""),{i18n:a,_:o}=nO(),[i,s]=tG(),[l,c]=tG(!1),{trigger:d}=(e=t2(aW).client,oM("stytch.sso.discoverConnections",async(t,{arg:{emailAddress:r}})=>await e.sso.discoverConnections(r),{throwOnError:!0})),u=t2(aW).client,{ssoOptions:h}=t2(aW).config,m=async e=>{e.preventDefault(),s(void 0);let n=async()=>{try{let e=await d({emailAddress:r});if(!e)return[];return e.connections}catch(e){s(((e,t)=>{if(e&&"object"==typeof e){if("error_message"in e&&"string"==typeof e.error_message)return e.error_message;if(t)return t;if("message"in e&&"string"==typeof e.message)return e.message}})(e,a._({id:"ssoDiscovery.email.error.unknown",message:"Something went wrong. Try again later or contact your admin for help."})))}};try{c(!0);let e=await n();if(e?.length===1){let[t]=e;await u.sso.start({connection_id:t.connection_id,login_redirect_url:h?.loginRedirectURL,signup_redirect_url:h?.signupRedirectURL});return}c(!1),e&&t({type:"set_sso_discovery_state",connections:e})}catch(e){throw c(!1),e}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"ssoDiscovery.email.title",message:"Enter your email to continue"})),rZ.createElement(id,{as:"form",onSubmit:m,gap:2},rZ.createElement(iU,{email:r,setEmail:n,hideLabel:!0,error:i}),rZ.createElement(oZ,{variant:"primary",loading:l,type:"submit"},a._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},a._({id:"button.goBack",message:"Go back"}))))},[aS]:()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO();return tm(id,{gap:6},tm(nZ,{variant:"header"},r._({id:"ssoDiscovery.title",message:"Select a connection to continue"})),tm(id,{gap:4},tm(sD,{availableConnections:e.formState.ssoDiscoveryState.connections}),tm(oZ,{variant:"ghost",onClick:()=>{t({type:"navigate_back"})}},r._({id:"button.goBack",message:"Go back"}))))},[ak]:()=>{let[,e]=t2(aW).state,[t,r]=tG(""),[n,a]=tG(),[o,i]=tG(!1),s=t2(aW).client,{ssoOptions:l}=t2(aW).config,{i18n:c,_:d}=nO(),{trigger:u}=oM("stytch.organization.getBySlug",async(e,{arg:{slug:t}})=>s.organization.getBySlug({organization_slug:t}),{onError:()=>{a(c._({id:"ssoDiscovery.fallback.error.unknown",message:"An error occurred. Please try again."})),i(!1)}}),h=async r=>{r.preventDefault(),a(void 0),i(!0);let n=await u({slug:t});if(n){let{organization:t}=n;if(null===t)a(c._({id:"ssoDiscovery.fallback.error.orgNotFound",message:"Organization not found. Please try again."})),i(!1);else if(1===t.sso_active_connections.length){let[e]=t.sso_active_connections;await s.sso.start({connection_id:e.connection_id,login_redirect_url:l?.loginRedirectURL,signup_redirect_url:l?.signupRedirectURL})}else e({type:"set_organization",organization:t}),e({type:"transition",screen:at})}};return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},c._({id:"ssoDiscovery.fallback.title",message:"Sorry, we couldn't find any connections"})),rZ.createElement(nZ,null,c._({id:"ssoDiscovery.fallback.content",message:"Please input the Organization's unique slug to continue. If you don't know the unique slug, log in through another method to view all of your available Organizations."})),rZ.createElement(id,{as:"form",onSubmit:h,gap:2},rZ.createElement(iN,{id:"organization-slug",hideLabel:!0,label:c._({id:"formField.orgSlug.label",message:"Organization slug"}),value:t,onChange:e=>r(e.target.value),placeholder:c._({id:"formField.orgSlug.label",message:"Organization slug"}),error:n}),rZ.createElement(oZ,{variant:"primary",loading:o,type:"submit",disabled:!t||o},c._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{e({type:"transition",screen:at})}},c._({id:"ssoDiscovery.fallback.button.reset",message:"Try another method"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{e({type:"navigate_back"})}},c._({id:"button.goBack",message:"Go back"}))))}},ssoAndOAuthButtons:{SsoAndOAuthButtons:sx,SSOButton:o9},icons:{google:o2,microsoft:o3,okta:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#191919",fillRule:"evenodd",d:"m10.9 1.13-.37 4.56a5 5 0 0 0-1.19.01l-.2-2.2q0-.12.11-.13h.38l-.18-2.24q.01-.12.11-.13h1.23q.11.01.11.13m-3.09.22q-.04-.1-.15-.08l-1.15.42q-.11.06-.07.16l.94 2.04-.36.13q-.1.06-.06.16l.95 2a4 4 0 0 1 1.12-.42zM5 2.62l2.65 3.73q-.51.33-.9.78l-1.6-1.56a.12.12 0 0 1 .01-.18l.3-.23-1.58-1.6a.12.12 0 0 1 0-.18l.94-.78a.12.12 0 0 1 .17.02M2.77 4.78q-.1-.05-.17.04l-.61 1.06a.12.12 0 0 0 .05.17L4.07 7l-.2.32a.12.12 0 0 0 .06.17l2.02.92q.22-.56.59-1.04zm-1.5 2.88q.03-.11.15-.1l4.42 1.16q-.17.57-.19 1.18l-2.21-.18a.12.12 0 0 1-.1-.14l.06-.37L1.16 9q-.11-.02-.1-.14zm-.16 2.99q-.12.02-.1.14l.2 1.2q.05.12.15.1l2.17-.56.07.37c0 .06.08.1.14.09l2.14-.59q-.19-.56-.22-1.17zm.7 3.17a.12.12 0 0 1 .06-.17L6 11.7q.24.55.62 1.02L4.8 14.01a.12.12 0 0 1-.17-.04l-.19-.33-1.84 1.28q-.1.05-.17-.04zm5.02-.86L3.6 16.21a.12.12 0 0 0 0 .18l.95.79q.1.06.17-.02l1.3-1.84.29.25q.1.07.18-.03l1.26-1.82a5 5 0 0 1-.93-.76m-.64 5.22a.12.12 0 0 1-.07-.16l1.91-4.15q.53.27 1.13.39L8.6 16.4a.12.12 0 0 1-.16.07l-.35-.12-.6 2.16q-.04.1-.15.08zm3.28-3.87-.37 4.56q0 .12.12.13h1.22q.12-.01.12-.13l-.18-2.23h.37q.12-.02.12-.14l-.2-2.2a4 4 0 0 1-1.2.01M13.9 1.97a.12.12 0 0 0-.07-.17l-1.15-.41q-.12-.03-.16.08l-.6 2.16-.35-.13q-.1-.02-.15.08l-.56 2.15q.6.12 1.12.39zm2.5 1.81-3.21 3.26a4 4 0 0 0-.93-.76l1.26-1.83a.12.12 0 0 1 .18-.03l.29.25 1.3-1.83a.12.12 0 0 1 .17-.02l.94.79q.09.08.01.17m1.75 2.56q.1-.05.05-.17l-.62-1.05a.12.12 0 0 0-.17-.04l-1.84 1.27-.2-.32q-.06-.1-.16-.04l-1.82 1.29q.38.46.62 1.02zM18.79 8l.2 1.2a.12.12 0 0 1-.1.15l-4.55.42a4 4 0 0 0-.23-1.17l2.14-.59q.12-.02.15.1l.06.37 2.17-.57q.12-.03.15.1zm-.2 4.43q.1.01.14-.1l.2-1.2a.12.12 0 0 0-.1-.15l-2.23-.2.06-.37a.12.12 0 0 0-.1-.14l-2.22-.18q-.01.6-.19 1.18l4.43 1.15m-1.19 2.75a.12.12 0 0 1-.17.04l-3.77-2.6q.36-.48.59-1.04l2.02.92q.1.06.05.16l-.19.33 2.03.96q.1.05.05.17zm-5.04-1.54 2.65 3.73q.08.08.17.02l.94-.79a.12.12 0 0 0 0-.17l-1.57-1.6.3-.23q.08-.09 0-.18l-1.59-1.56q-.4.46-.9.78m-.02 5.08q-.12.03-.16-.08l-1.2-4.41q.59-.14 1.1-.43l.96 2.01c.03.06 0 .14-.06.16l-.36.13.94 2.04q.04.1-.07.16z",clipRule:"evenodd",className:o0}))}}});nW(".Logo_module_container__f17fe7db{align-items:center;display:flex;gap:var(--st-spacing-2);justify-content:center}.Logo_module_logo__f17fe7db{max-height:50px;max-width:100px}");var sB="Logo_module_logo__f17fe7db";let sN=({orgLogo:e,appLogo:t})=>e||t?rZ.createElement("div",{className:"Logo_module_container__f17fe7db"},e&&rZ.createElement("img",{className:sB,src:e.url,alt:e.alt}),t&&rZ.createElement("img",{className:sB,src:t.url,alt:t.alt})):null,sU=({text:e,onGoBack:t})=>{let{i18n:r,_:n}=nO();return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"error.title",message:"Looks like there was an error!"}),body:e}),t&&rZ.createElement(oZ,{variant:"outline",onClick:t},r._({id:"button.goBack",message:"Go back"})))},sF=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{type:a,canGoBack:o}=e.error,i=e.flowState.organization?.organization_name,s={[az]:r._({id:"error.default",message:"Something went wrong. Try again later or contact your admin for help."}),[aM]:r._({id:"error.eml",message:"Something went wrong. Your login link may have expired, been revoked, or been used more than once. Request a new login link to try again, or contact your admin for help."}),[aI]:r._({id:"error.organization",message:"The organization you are looking for could not be found. If you think this is a mistake, contact your admin."}),[aR]:i?r._({id:"error.authPolicyWithOrg",message:"Unable to join due to {organizationName}'s authentication policy. Please contact your admin for more information.",values:{organizationName:i}}):r._({id:"error.authPolicyNoOrg",message:"Unable to join due to the organization's authentication policy. Please contact your admin for more information."}),[aL]:r._({id:"error.adBlockerDetected",message:"The request was blocked by an Ad Blocker. Please disable your ad blocker, refresh the page, and try again."}),[aB]:r._({id:"error.claimedDomain",message:"Your email domain is associated with a particular organization, so you are unable to join or create other organizations. Please contact your admin for more information."})},l=t1(()=>{if(o)return()=>t({type:"transition",screen:at})},[o,t]);return rZ.createElement(sU,{text:s[a],onGoBack:l})};nW(".Root_module_root__870c11a1{color-scheme:var(--st-color-scheme);font-family:var(--st-font-family);isolation:isolate}:where(.Root_module_root__870c11a1),:where(.Root_module_root__870c11a1) *{box-sizing:border-box;margin:0;padding:0}:where(.Root_module_root__870c11a1) :is(span,strong,em,p,a){font-feature-settings:inherit;font-size:inherit;font-variant:inherit;line-height:inherit}:where(.Root_module_root__870c11a1) :is(span,strong,em,p){color:inherit}:where(.Root_module_root__870c11a1) :is(span,em,p){font-weight:inherit}:where(.Root_module_root__870c11a1) :is(img,svg){display:block}.Root_module_root__870c11a1 a{-webkit-text-decoration:none;text-decoration:none}.Root_module_root__870c11a1 :is(b,strong){font-weight:var(--st-font-weight-bold)}.Root_module_root__870c11a1{--st-font-weight-normal:400;--st-font-weight-medium:500;--st-font-weight-semibold:600;--st-font-weight-bold:700;--st-rounded-md:calc(var(--st-rounded-base)*2);--st-rounded-2xl:calc(var(--st-rounded-base)*6);--st-rounded-full:calc(var(--st-rounded-base)*9999);--st-text-xs:calc(var(--st-text-base)*0.75);--st-text-sm:calc(var(--st-text-base)*0.875);--st-text-2xl:calc(var(--st-text-base)*1.5);--st-line-height-xs:1.33333;--st-line-height-sm:1.42857;--st-line-height-base:1.5;--st-line-height-2xl:1.33333;--st-spacing-0_5:calc(var(--st-spacing)*0.5);--st-spacing-2:calc(var(--st-spacing)*2);--st-spacing-3:calc(var(--st-spacing)*3);--st-spacing-4:calc(var(--st-spacing)*4);--st-spacing-5:calc(var(--st-spacing)*5);--st-spacing-6:calc(var(--st-spacing)*6);--st-spacing-7:calc(var(--st-spacing)*7);--st-spacing-8:calc(var(--st-spacing)*8);--st-spacing-9:calc(var(--st-spacing)*9);--st-spacing-10:calc(var(--st-spacing)*10);--st-tab-background:color-mix(in oklab,var(--st-accent) 80%,transparent);--st-primary-button-hover:color-mix(in oklab,var(--st-primary) 90%,transparent);--st-secondary-button-hover:color-mix(in oklab,var(--st-secondary) 80%,transparent);--st-destructive-button-hover:color-mix(in oklab,var(--st-destructive) 80%,transparent);--st-divider-color:color-mix(in oklab,var(--st-border) 50%,transparent);--st-focus-ring-shadow:0 0 0 3px color-mix(in oklab,var(--st-ring) 50%,transparent);--st-shadow:0 0;--st-shadow-input:var(--st-shadow);--st-shadow-button:var(--st-shadow);--st-button-radius:var(--st-rounded-md);--st-input-radius:var(--st-rounded-md);--st-container-radius:var(--st-rounded-2xl);--st-container-border:var(--st-border);--st-header-font:var(--st-font-family)}"),nW(".inputBase_module_inputBase__06c14ae4{background-color:var(--st-background);border:1px solid var(--st-input);border-radius:var(--st-input-radius);box-shadow:var(--st-shadow-input);color:var(--st-foreground);font-family:var(--st-font-family);font-size:var(--st-text-sm);line-height:var(--st-line-height-sm)}.inputBase_module_forceFocusRing__06c14ae4,:is(.inputBase_module_focusRing__06c14ae4,.inputBase_module_inputBase__06c14ae4):focus-visible{border-color:var(--st-ring);box-shadow:var(--st-shadow-input),var(--st-focus-ring-shadow);outline:0}");nW("[dir=rtl] .i18n_module_rtlIcon__278ecfc9{scale:-1 1}.i18n_module_rtlIcon__278ecfc9:dir(rtl){scale:-1 1}"),nW("a.Watermark_module_watermark__6a046c31{align-items:center;border-radius:var(--st-rounded-md);color:var(--st-muted-foreground);display:flex;padding:var(--st-spacing-2) var(--st-spacing-3);transition:background var(--st-transition-duration),color var(--st-transition-duration)}a.Watermark_module_watermark__6a046c31:hover{background:var(--st-accent);color:var(--st-accent-foreground)}a.Watermark_module_watermark__6a046c31 span{font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);line-height:var(--st-line-height-sm)}a.Watermark_module_watermark__6a046c31 svg{height:24px}a.Watermark_module_watermark__6a046c31 path{fill:hsl(218.92,100%,calc(7.25%*(1 + var(--st-dark-mode, 0)*100)))}");let sq=({poweredBy:e,label:t})=>rZ.createElement("a",{className:nj("Watermark_module_watermark__6a046c31","inputBase_module_focusRing__06c14ae4"),href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},rZ.createElement("span",null,e,"\xa0"),rZ.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 47 24","aria-label":t},rZ.createElement("path",{fillRule:"evenodd",d:"M3.58 9.1c0 .86.37 1.26 1.4 1.5v.01l1.36.33c2 .5 2.9 1.47 2.9 3.18 0 2.3-1.56 3.6-4.09 3.6S1.19 16.57 1 14.37h2.19c.14 1.1.83 1.66 1.96 1.66 1.14 0 1.87-.61 1.87-1.56 0-.9-.45-1.35-1.62-1.61l-1.37-.31c-1.22-.3-2.67-1.09-2.67-3.2C1.36 7.35 2.9 6 5.18 6c2.46 0 3.73.98 3.89 2.98H6.79c-.1-.89-.64-1.32-1.64-1.32-.93 0-1.57.56-1.57 1.43Zm31.95 2.84c-.16-.83-.7-1.22-1.68-1.22h-.14c-1.3 0-2.13 1.02-2.13 2.6 0 1.57.84 2.59 2.13 2.59h.14c.98 0 1.52-.39 1.68-1.22h2.15c-.2 1.96-1.58 3.03-3.9 3.03-2.46 0-4.18-1.81-4.18-4.4 0-2.6 1.72-4.41 4.18-4.41 2.32 0 3.7 1.07 3.9 3.03h-2.15Zm-8.5 2.9v-4.17h2.27V8.9h-1.48a.8.8 0 0 1-.8-.8V6h-2.17v2.9h-1.8a1.9 1.9 0 0 0-1.74 1.16l-1.88 4.44-2-4.47a1.9 1.9 0 0 0-1.72-1.13h-2.6a.8.8 0 0 1-.8-.8V6h-2.16v9.47c0 1.47.78 2.25 2.25 2.25h2.06v-1.8h-1.08c-.84 0-1.06-.23-1.06-1.08v-4.17h2.64c.24 0 .42.1.5.28l2.92 6.14v.45c0 .87-.24.9-1.06.9h-2.73v1.85h3.6c1.39 0 2.25-.98 2.25-2.57l.01-.73 2.8-6.04c.08-.18.26-.28.5-.28h1.1v4.8c0 1.47.78 2.25 2.25 2.25h2.12v-1.81H28.1c-.85 0-1.07-.22-1.07-1.07Zm13.7-4.77.15-.18c.5-.62 1.02-.98 2.16-.98 1.93 0 3.04 1.21 3.04 3.33v5.48h-2.16v-5.21c0-.66-.2-1.18-.54-1.51-.29-.27-.67-.4-1.11-.37-1.05.07-1.53.88-1.53 2.56v4.53h-2.17V6h2.17v4.07Z"}),rZ.createElement("path",{d:"M29.82 22.74v.4h-.57v-3.13h.58v1.4c.16-.3.4-.5.73-.5.48 0 .8.42.8 1.11v.06c0 .72-.38 1.12-.82 1.12a.75.75 0 0 1-.72-.46Zm.95-.68v-.02c0-.46-.2-.7-.47-.7-.3 0-.5.25-.5.7v.02c0 .47.19.7.5.7.28 0 .46-.22.46-.7Zm.97 1.88v-.4c.07.02.18.03.28.03.26 0 .41-.1.5-.44l.02-.02h-.3l-.67-2.15h.62l.49 1.74.48-1.74h.6l-.74 2.29c-.18.6-.48.75-.88.75-.16 0-.3-.02-.4-.06Zm3.7-3.16h-.81v-.5h2.23v.5h-.83v2.37h-.59v-2.37Zm1.36.18h.6l.36 1.73.4-1.73h.67l.42 1.7.35-1.7h.59l-.53 2.19h-.78l-.4-1.67-.38 1.67h-.78l-.51-2.2Zm3.71-.67c0-.21.12-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.15-.96h.58v3.15h-.58V20Zm1.1.29c0-.21.11-.3.34-.3.23 0 .34.1.34.3 0 .2-.1.3-.34.3-.24 0-.34-.08-.34-.3Zm.05.67h.58v2.19h-.58v-2.2Zm1.04 1.12v-.06c0-.68.45-1.12 1.08-1.12.64 0 1.08.44 1.08 1.12v.06c0 .7-.45 1.12-1.08 1.12-.67 0-1.09-.43-1.09-1.12Zm1.57-.02v-.02c0-.47-.2-.7-.49-.7s-.5.23-.5.7v.02c0 .47.19.7.5.7.3 0 .49-.22.49-.7Z"})));nW(".MainContainer_module_container__d1278a0c{background-color:var(--st-background);border:1px solid var(--st-container-border);border-radius:var(--st-container-radius);color:var(--st-foreground);max-width:var(--st-container-width);padding:var(--st-spacing-10) var(--st-spacing-9);width:100%}.MainContainer_module_watermarkContainer__d1278a0c{display:flex;justify-content:center}");let sH=({children:e,displayWatermark:t,theme:r})=>{let{i18n:n,_:a}=nO(),o=tQ(null),{className:i,style:s}=function(e,t){let r=e["mobile-breakpoint"],[n,a]=tG(r);tZ(()=>{a(function e(t,r){if(!r)return t;let n=t.replace(/var\s*\([^)]+\)/gi,e=>{let[t,n]=e.match(/\(([^)]+)\)/)[1].split(",").map(e=>e.trim());return window.getComputedStyle(r).getPropertyValue(t)||n||e});return n===t?n:e(n,r)}(r,t.current))},[r,t]);let o=nR(`(max-width: ${n})`);return{style:t1(()=>(function(e){let{"color-scheme":t,...r}=e,n=Object.fromEntries(Object.entries(r).map(([e,t])=>[`--st-${e}`,t]));return"shadcn"===e["color-scheme"]?n["--st-color-scheme"]="inherit":(n["--st-color-scheme"]=t,n["--st-dark-mode"]="dark"===e["color-scheme"]?"1":"0"),n})(e),[e]),className:nj({"-st-mobile":o})}}(r,o);return rZ.createElement(id,{gap:6,style:s,className:nj("MainContainer_module_container__d1278a0c Root_module_root__870c11a1",i),ref:o},e,t&&rZ.createElement("div",{className:"MainContainer_module_watermarkContainer__d1278a0c"},rZ.createElement(sq,{poweredBy:n._({id:"watermark.poweredBy",message:"Powered by"}),label:n._({id:"watermark.altText",message:"Stytch by Twilio"})})),rZ.createElement(iy,null))},sK=({header:e,text:t})=>{let{i18n:r,_:n}=nO(),a=r._({id:"success.title",message:"Success!"}),o=r._({id:"login.success.content",message:"You have successfully logged in."});return tm(sh,{header:e??a,body:t??o,align:"center"})},sj=()=>{let e=aZ();return iR(()=>{e({type:eu.AuthenticateFlowComplete,data:{}})}),tm(sK,null)};nW(".OrganizationRow_module_organizationRow__bee3960a{justify-content:space-between;text-align:left;width:100%}.OrganizationRow_module_left__bee3960a{align-items:center;display:flex;gap:var(--st-spacing-2)}.OrganizationRow_module_nameText__bee3960a{overflow-wrap:anywhere}.OrganizationRow_module_logo__bee3960a{background-color:var(--st-primary);border-radius:var(--st-rounded-base);color:var(--st-primary-foreground);flex:0 0 auto;font-family:var(--st-font-family);font-size:var(--st-text-sm);font-weight:var(--st-font-weight-medium);height:var(--st-spacing-6);line-height:calc(var(--st-spacing-6) - 1px);text-align:center;width:var(--st-spacing-6)}.OrganizationRow_module_right__bee3960a{flex:0 0 auto}.OrganizationRow_module_rightContent__bee3960a{align-items:center;color:var(--st-muted-foreground);display:flex;height:var(--st-spacing-6);justify-content:end;min-width:20px}");var s$="OrganizationRow_module_logo__bee3960a";let sV=()=>rZ.createElement("svg",{className:"OrganizationRow_module_arrow__bee3960a i18n_module_rtlIcon__278ecfc9",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rZ.createElement("path",{d:"M14.707 10L10.3535 14.3545L9.64648 13.6475L12.793 10.5H6V9.5H12.793L9.64648 6.35352L10.3535 5.64648L14.707 10Z",fill:"currentColor"})),sW=({organization:e,action:t,onClick:r})=>{let{organization_name:n,organization_logo_url:a}=e,o=a?rZ.createElement("img",{className:s$,src:a,alt:""}):rZ.createElement("div",{className:s$,role:"presentation"},Array.from(n)[0]);return rZ.createElement("button",{className:nj("OrganizationRow_module_organizationRow__bee3960a","VerticalTransition_module_hoverTrigger__9366f503",oG({variant:"outline"})),onClick:r},rZ.createElement("div",{className:"OrganizationRow_module_left__bee3960a"},o,rZ.createElement("div",{className:"OrganizationRow_module_nameText__bee3960a"},n)),rZ.createElement(ii,{trigger:"hover",rootClassName:"OrganizationRow_module_right__bee3960a",className:"OrganizationRow_module_rightContent__bee3960a",primary:t&&rZ.createElement(nJ,null,t),secondary:rZ.createElement(sV,null)}))},sG=e=>"eligible_to_join_by_email_domain"===e||"eligible_to_join_by_oauth_tenant"===e,sY=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{createOrganizationEnabled:a}=oI(),{i18n:o,_:i}=nO(),s=()=>t({type:"transition",screen:at}),{trigger:l,isMutating:c}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),d=a&&n.directCreateOrganizationForNoMembership;if(tZ(()=>{d&&l()},[d,l]),d||c)return rZ.createElement(i4,null);let u=e.formState.discoveryState.email;return a&&!n.disableCreateOrganization?rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.create.title",message:"Create an organization to get started"})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.create.content",message:"{email} does not have an account. Think this is a mistake? Try a different email address, or contact your admin.",values:{email:u}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>l()},o._({id:"button.createAnOrganization",message:"Create an organization"})),rZ.createElement(oZ,{variant:"ghost",onClick:s},o._({id:"button.goBack",message:"Go back"})))):rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"organizationDiscovery.noOrgs.title",message:"{email} does not belong to any organizations.",values:{email:u}})),rZ.createElement(nZ,{variant:"body"},o._({id:"organizationDiscovery.noOrgs.content",message:"Make sure your email address is correct. Otherwise, you might need to be invited by your admin."})),rZ.createElement(oZ,{variant:"outline",onClick:s},o._({id:"button.tryDifferentEmailAddress",message:"Try a different email address"})))},sZ=()=>{let[e,t]=t2(aW).state,r=t2(aW).client,n=t2(aW).config,{i18n:a,_:o}=nO(),i=!!n.directLoginForSingleMembership?.status,{createOrganizationEnabled:s}=oI();tZ(()=>{if(u)return;let t=((e,t)=>{if(!t?.status)return null;let r=e.filter(e=>"active_member"===e.membership.type),n=e.some(e=>("pending_member"===e.membership.type||"invited_member"===e.membership.type)&&!t.ignoreInvites||sG(e.membership.type)&&!t.ignoreJitProvisioning);return 1!==r.length||n?null:r[0]})(e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership);i&&null!==t&&l(t)},[i,e.formState.discoveryState.discoveredOrganizations,n.directLoginForSingleMembership]);let l=e=>{let r=e.organization;if(e.primary_required){let n=e.primary_required.allowed_auth_methods;n&&1===n.length&&"sso"===n[0]&&r.sso_default_connection_id?c(r.sso_default_connection_id):t({type:"select_discovered_organization",discoveredOrganization:e})}else d({organizationId:r.organization_id})},c=t0(e=>{r.sso.start({connection_id:e,login_redirect_url:n.ssoOptions?.loginRedirectURL,signup_redirect_url:n.ssoOptions?.signupRedirectURL})},[r,n.ssoOptions]),{trigger:d,isMutating:u}=oM("stytch.discovery.intermediateSessions.exchange",(e,{arg:{organizationId:t}})=>r.discovery.intermediateSessions.exchange({organization_id:t,session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}}),{trigger:h,isMutating:m}=oM("stytch.discovery.organizations.create",()=>r.discovery.organizations.create({session_duration_minutes:n.sessionOptions.sessionDurationMinutes}),{onSuccess:e=>{oR(e,t,n)},onError:e=>{t({type:"set_error_message_and_transition",errorType:"action_not_allowed_email_domain_is_claimed"===e.error_type?aB:az,canGoBack:!0})}});if(u)return rZ.createElement(i3,null);if(m)return rZ.createElement(i4,null);if(0===e.formState.discoveryState.discoveredOrganizations.length)return rZ.createElement(sY,null);let p=e.formState.discoveryState.discoveredOrganizations.map(e=>{let t,{organization:r,membership:n}=e;return sG(n.type)||"pending_member"===n.type?t=a._({id:"organizationDiscovery.join",message:"Join"}):"invited_member"===n.type&&(t=a._({id:"organizationDiscovery.acceptInvite",message:"Accept Invite"})),rZ.createElement(sW,{key:r.organization_id,organization:r,action:t,onClick:()=>l(e)})}),_=s&&!n.disableCreateOrganization?rZ.createElement(oZ,{variant:"outline",onClick:()=>h()},a._({id:"button.createAnOrganization",message:"Create an organization"})):null,g=rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"transition",screen:at})},a._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},a._({id:"organizationDiscovery.title",message:"Select an organization to continue"})),_?rZ.createElement(iw,{top:p,bottom:rZ.createElement(rZ.Fragment,null,_,g)}):rZ.createElement(id,{gap:4},rZ.createElement(iw,null,p),g))},sJ=e=>e===aP||e===aT,sQ=()=>{var e;let t,r,n,a,o,{options:i}=t2(nq),[l]=t2(aW).state,{i18n:c,_:d}=nO(),{primaryAuthMethods:u,email:h,emailVerified:m}=l.primary,p=t2(aW).config,{products:_}=iG(),g=l.flowState.type===s.Organization&&!l.flowState.organization,f=(r=(e=l.flowState).type,a=((n=new Set(_.map(e=>e.id))).has("emailMagicLinks")||n.has("emailOtp"))&&n.has("passwords"),o=r===s.Organization?aA:ax,Array.from(_.reduce((t,n)=>{switch(n.id){case"emailMagicLinks":case"emailOtp":a?t.add(o):t.add(r===s.Organization?aE:aC);break;case"oauth":t.add(aP);break;case"sso":(r===s.Discovery||r===s.Organization&&(e.organization?.sso_active_connections?.length??0)>0)&&t.add(aT);break;case"passwords":t.add(a?o:aO)}return t},new Set)).reduce((e,t,r,n)=>{let a=r>0?n[r-1]:void 0;if(a&&sJ(t)&&sJ(a))e[e.length-1].push(t);else{let r=e.length>0?e[e.length-1]:void 0;r&&sJ(r[0])!==sJ(t)&&e.push([aD]),e.push([t])}return e},[])),y=oN(p,"mainScreen"),{SsoAndOAuthButtons:v}=oN(p,"ssoAndOAuthButtons"),b=l.flowState.organization?.organization_name;switch(l.flowState.type){case s.Discovery:t=c._({id:"login.title",message:"Sign up or log in"});break;case s.PasswordReset:t="";break;default:t=b?c._({id:"organizationLogin.title",message:"Continue to {organizationName}",values:{organizationName:b}}):c._({id:"organizationLogin.titleUnknown",message:"Continue to ..."})}return g?rZ.createElement(i4,null):rZ.createElement(id,{gap:6},!i.hideHeaderText&&(h&&!1===m&&u?rZ.createElement(rZ.Fragment,null,rZ.createElement(nZ,{variant:"header"},c._({id:"emailVerification.title",message:"Verify your email"})),rZ.createElement(nZ,null,c._({id:"emailVerification.content",message:"Confirm your email address with one of the following:"}))):t&&rZ.createElement(nZ,{variant:"header",align:"center"},t)),rZ.createElement(id,{gap:4},f.map(e=>e.every(sJ)?rZ.createElement(v,{key:"buttons",buttons:e}):e.map((e,t)=>{let r=y[e];return r?rZ.createElement(r,{key:e}):e===aD?rZ.createElement(ib,{key:"divider"+t}):null}))))},sX={[d.totp]:{messageDescriptor:{id:"mfa.enrollment.option.totp",message:"Use an authenticator app"},screen:af},[d.smsOtp]:{messageDescriptor:{id:"mfa.enrollment.option.sms",message:"Text me a code"},screen:ap}},s1=()=>{let{i18n:e,_:t}=nO(),{mfaProductInclude:r,mfaProductOrder:n}=t2(aW).config,[a,o]=t2(aW).state,{organizationMfaOptionsSupported:i}=a.mfa.primaryInfo,s=t1(()=>{let e=aU({allMethods:aj,orgSupportedMethods:i,uiIncludedMethods:r}),t=[];for(let r of n??aj)e.has(r)&&(t.push(r),e.delete(r));return t.push(...e),t},[r,n,i]);return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},e._({id:"mfa.enrollment.title",message:"Set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},e._({id:"mfa.enrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(iw,null,s.map(t=>{let{messageDescriptor:r,screen:n}=sX[t];return rZ.createElement(oZ,{key:t,variant:"outline",onClick:()=>{o({type:"transition",screen:n,history:"push"})}},e._(r))})))};nW(".RecoveryCodeEntryScreen_module_input__0b7ea085.RecoveryCodeEntryScreen_module_input__0b7ea085{font-family:var(--st-font-family-mono)}");let s0=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{memberId:i,organizationId:s}=a.mfa.primaryInfo,{trigger:l,isMutating:c,error:d}=oM("stytch.recoveryCodes.recover",(t,{arg:{recoveryCode:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.recoveryCodes.recover({recovery_code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{throwOnError:!1,onSuccess:()=>{o({type:"recovery_code/authenticate_success"})}}),[u,h]=tG(""),m=d?r._({id:"recoveryCodes.entry.error.invalidCode",message:"Invalid backup code, please try again."}):void 0,p=async e=>{e.preventDefault(),l({recoveryCode:u,memberId:i,organizationId:s,sessionDurationMinutes:t})};return rZ.createElement(id,{as:"form",gap:6,onSubmit:p},rZ.createElement(nZ,{variant:"header"},r._({id:"recoveryCodes.entry.title",message:"Enter backup code"})),rZ.createElement(nZ,{variant:"body"},r._({id:"recoveryCodes.entry.content",message:"Enter one of the backup codes you saved when setting up your authenticator app."})),rZ.createElement(iN,{id:"recovery-code",className:"RecoveryCodeEntryScreen_module_input__0b7ea085",value:u,onChange:e=>{h(e.target.value)},placeholder:r._({id:"formField.backupCode.placeholder",message:"Enter backup code"}),label:r._({id:"formField.backupCode.ariaLabel",message:"Backup code"}),hideLabel:!0,required:!0,autoComplete:"off",spellCheck:!1,error:m}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:c,type:"submit",disabled:!u||c},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"}))))};nW(".CodeContainer_module_container__1b0ae913{background:var(--st-accent);padding:var(--st-spacing-2) var(--st-spacing-4)}");let s2=({children:e,className:t,...r})=>rZ.createElement("div",{className:nj(t,"CodeContainer_module_container__1b0ae913"),...r},e);nW(".RecoveryCodeSaveScreen_module_codes__5283da32{column-gap:4ch;display:grid;grid-template-columns:repeat(auto-fill,var(--st-max-code-length));justify-content:center;list-style:none;margin:0 auto;max-width:calc(var(--st-max-code-length)*2 + 4ch)}.RecoveryCodeSaveScreen_module_codes__5283da32 li{-webkit-user-select:all;user-select:all;white-space:nowrap}");let s3=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),{recoveryCodes:a}=e.mfa.totp.enrollment,o=t1(()=>{let e="Win32"===navigator.platform?"\r\n":"\n",t=new Blob([a.join(e)],{type:"text/plain"});return URL.createObjectURL(t)},[a]),i=e.flowState.organization?.organization_name,s=i?r._({id:"recoveryCodes.filename.withOrganizationName",message:"{organizationName}-backup-codes",values:{organizationName:i}}):r._({id:"recoveryCodes.filename.noOrganizationName",message:"backup-codes"}),[l,c]=io(3),d=async()=>{try{await navigator.clipboard.writeText(a.join("\n")),c(!0)}catch{im({message:r._({id:"recoveryCodes.save.toast.copyFailed",message:"Couldn't copy codes to clipboard"})})}},u=Math.max(...a.map(e=>e.length));return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"recoveryCodes.save.title",message:"Save your backup codes!"}),body:r._({id:"recoveryCodes.save.content",message:"This is the only time you will be able to access and save your backup codes."})}),rZ.createElement(s2,null,rZ.createElement(nZ,{font:"mono"},rZ.createElement("ul",{className:"RecoveryCodeSaveScreen_module_codes__5283da32",style:{"--st-max-code-length":u+"ch"}},a.map((e,t)=>rZ.createElement("li",{key:t},e))))),rZ.createElement(iw,null,rZ.createElement(oJ,{variant:"primary",href:o,download:s+".txt"},rZ.createElement(ii,{primary:r._({id:"recoveryCodes.save.button.download",message:"Download .txt file"}),secondary:r._({id:"recoveryCodes.save.button.copied",message:"Copied!"}),triggered:l})),rZ.createElement(oZ,{variant:"outline",onClick:d},r._({id:"recoveryCodes.save.button.copyAll",message:"Copy all to clipboard"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>{t({type:"recovery_code/save_acknowledge"})}},r._({id:"recoveryCodes.save.button.done",message:"Done"}))))},s4=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),1e4))]);if(!n)return t;return n.national}catch{return t}},s5=async({parsePhoneNumber:e,phoneNumber:t,country:r})=>{let n=eA[r],a={isValid:!0,number:`+${n}${t}`};try{let n=await Promise.race([e(t,r),new Promise(e=>setTimeout(()=>e(void 0),2e3))]);if(!n)return a;return n}catch{return a}};nW(".PhoneInput_module_container__5c1958d4{display:grid;gap:var(--st-spacing-2);grid-template-columns:calc(var(--st-spacing)*22.5) 1fr}.PhoneInput_module_phone__5c1958d4{grid-area:1/2/2/3}.PhoneInput_module_select__5c1958d4{appearance:none;grid-area:1/1/2/2;padding-block:var(--st-spacing-2);padding-inline:var(--st-spacing-3) var(--st-spacing-6)}.-st-mobile .PhoneInput_module_select__5c1958d4{padding-block:var(--st-spacing-3)}.PhoneInput_module_chevron__5c1958d4{color:var(--st-muted-foreground);grid-area:1/1/2/2;margin-inline-end:var(--st-spacing-2);place-self:center end;pointer-events:none;rotate:90deg}.PhoneInput_module_error__5c1958d4{grid-area:2/1/3/3}");let s8="(201) 555-0123",s6=({phone:e,setPhone:t,country:r,setCountry:n,parsePhoneNumber:a,getExampleNumber:o,hasPasskeys:i,error:s,...l})=>{let c,{i18n:d,_:u}=nO(),h=(c=iM(),s?{error:{id:c},input:{"aria-errormessage":c,"aria-invalid":!0}}:{error:{id:c},input:{}}),m=new Intl.DisplayNames(["en"],{type:"region"}),[p,_]=tG(s8),g=tQ(null),[f,y]=tG(e);return rZ.createElement("div",{className:"PhoneInput_module_container__5c1958d4"},rZ.createElement("select",{"aria-label":d._({id:"formField.countryCode.label",message:"Country code"}),className:"PhoneInput_module_select__5c1958d4 inputBase_module_inputBase__06c14ae4",autoComplete:"tel-country-code",value:r,onChange:async e=>{let t=e.target.value;n(t),g.current?.focus();let a=await Promise.race([o(r),new Promise(e=>setTimeout(()=>e(void 0),100))]);t===e.target.value&&_(a??s8)}},Object.entries(eA).map(([e,t])=>rZ.createElement("option",{key:e,value:e},e!==r?`+${t} ${m.of(e)}`:`+${t}`))),rZ.createElement(o8,{className:"PhoneInput_module_chevron__5c1958d4",role:"presentation"}),rZ.createElement(iN,{id:"phone-input",label:d._({id:"formField.phone.label",message:"Phone number"}),hideLabel:!0,ref:g,type:"tel",autoComplete:i?"username webauthn":"tel-national",containerClassName:"PhoneInput_module_phone__5c1958d4",value:f,placeholder:p,onChange:async e=>{let n=e.target.value;y(n);let o=await s4({parsePhoneNumber:a,phoneNumber:n,country:r});n===e.target.value&&(t(o),y(o))},required:!0,...h.input,...i?iz:{},...l}),s&&rZ.createElement("div",{className:"PhoneInput_module_error__5c1958d4"},rZ.createElement(iB,h.error,s)))};class s7 extends b{constructor(){super("InvalidPhoneNumberError","Invalid phone number")}}let s9=()=>{let e,t=t2(aW).client,[r,n]=t2(aW).state,{i18n:a,_:o}=nO(),{smsOtpOptions:i}=t2(aW).config,{mfa:{smsOtp:{isSending:s,sendError:l,enrolledNumber:c}}}=r,{memberId:d,organizationId:u}=r.mfa.primaryInfo,[h,m]=rZ.useState(c?.countryCode??"US"),[p,_]=rZ.useState(c?.phoneNumber??""),g=rZ.useMemo(()=>{if(l)return l instanceof s7?a._({id:"error.invalidPhoneNumber",message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."}):ic(l,o)},[l,o]),{parsePhoneNumber:f,getExampleNumber:y}=(e=r1(t).clientsideServices,{getExampleNumber:t=>e.getExamplePhoneNumber({regionCode:t}).then(e=>e.phoneNumber),parsePhoneNumber:(t,r)=>e.parsedPhoneNumber({phoneNumber:t,regionCode:r})}),{trigger:v}=oM("stytch.otps.sms.send",async(e,{arg:{parsedNumber:r,locale:n}})=>t.otps.sms.send({mfa_phone_number:r,member_id:d,organization_id:u,locale:n}),{onSuccess:e=>{n({type:"sms_otp/send_success",response:e,countryCode:h,phoneNumber:p,formattedPhoneNumber:`+${eA[h]} ${p}`})},onError:e=>{n({type:"sms_otp/send_error",error:e})}}),b=async e=>{e.preventDefault(),n({type:"sms_otp/send"});try{let e=await s5({parsePhoneNumber:f,phoneNumber:p,country:h});if(!e.isValid)throw new s7;await v({parsedNumber:e.number,locale:i?.locale})}catch(e){n({type:"sms_otp/send_error",error:e})}};return rZ.createElement(id,{as:"form",gap:6,onSubmit:b},rZ.createElement(nZ,{variant:"header"},a._({id:"mfa.smsEnrollment.title",message:"Enter your phone number to set up Multi-Factor Authentication"})),rZ.createElement(nZ,{variant:"body"},a._({id:"mfa.smsEnrollment.content",message:"Your organization requires an additional form of verification to make your account more secure."})),rZ.createElement(s6,{country:h,setCountry:m,phone:p,setPhone:_,parsePhoneNumber:f,getExampleNumber:y,error:g}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",loading:s,type:"submit",disabled:!p||s},a._({id:"button.continue",message:"Continue"})),r.screenHistory.length>0&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>n({type:"navigate_back"})},a._({id:"button.goBack",message:"Go back"}))))},le=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t},smsOtpOptions:r}=t2(aW).config,{i18n:n,_:a}=nO(),[o,i]=t2(aW).state,{mfa:{isEnrolling:s,smsOtp:l,primaryInfo:c}}=o,{codeExpiration:u,formattedDestination:h}=l,{enrolledMfaMethods:m,memberId:p,memberPhoneNumber:_,organizationId:g,organizationMfaOptionsSupported:f}=c,y=ie(),{trigger:v,isMutating:b,error:w}=oM("stytch.otps.sms.send",(t,{arg:{memberId:r,organizationId:n,locale:a}})=>(i({type:"sms_otp/send"}),e.otps.sms.send({member_id:r,organization_id:n,locale:a})),{onSuccess:e=>{i({type:"sms_otp/send_success",response:e})},onError:e=>{let t=ic(e,a);t&&im({message:t}),i({type:"sms_otp/send_error",error:t})},throwOnError:!0}),{trigger:k,isMutating:S,error:E}=oM("stytch.otps.sms.authenticate",(t,{arg:{otp:r,memberId:n,organizationId:a,sessionDurationMinutes:o}})=>e.otps.sms.authenticate({code:r,member_id:n,organization_id:a,session_duration_minutes:o}),{onSuccess:()=>{i({type:"sms_otp/authenticate_success"})},onError:()=>{y.clear()}}),C=null===u&&!b&&!w;tZ(()=>{C&&v({memberId:p,organizationId:g,locale:r?.locale}).catch(()=>{})},[p,g,v,C,r?.locale]),tZ(()=>{!h&&_&&(async()=>{i({type:"sms_otp/format_destination",formattedPhoneNumber:await s4({parsePhoneNumber:t=>r1(e).clientsideServices.parsedPhoneNumber({phoneNumber:t}),phoneNumber:_})})})()},[i,h,e,_]);let P=t1(()=>!s&&m.includes(d.totp)&&(0===f.length||f.includes(d.totp)),[m,s,f]),T=E?n._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0,O=t1(()=>s||0===m.length||f.length>0&&!m.some(e=>f.includes(e)),[m,s,f]),A=async()=>{await v({memberId:p,organizationId:g,locale:r?.locale})},x=rZ.createElement(i5,{countdown:y,isSubmitting:S,resendOTP:A}),D=P&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"transition",history:"push",screen:ay})}},n._({id:"mfa.methods.authenticatorApp",message:"Use an authenticator app"})),z=O&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>{i({type:"navigate_back"})}},n._({id:"button.goBack",message:"Go back"}));return rZ.createElement(id,{gap:6},null!==u?rZ.createElement(sp,{isSubmitting:S,onSubmit:e=>{k({otp:e,memberId:p,organizationId:g,sessionDurationMinutes:t})},errorMessage:T,expiration:u.getTime(),formattedDestination:h??_??""}):rZ.createElement(i4,null),D&&z?rZ.createElement(iw,{top:x,bottom:rZ.createElement(rZ.Fragment,null,D,z)}):rZ.createElement(iw,null,x,D,z))};nW(".TOTPEnrollManualScreen_module_codeContainer__dc7a0e56{cursor:pointer}.TOTPEnrollManualScreen_module_code__dc7a0e56{column-gap:1ch;display:grid;grid-template-columns:repeat(var(--st-column-count,auto-fill),var(--st-chunk-size,4ch));justify-content:center}");let lt=()=>{let[e,t]=t2(aW).state,{i18n:r,_:n}=nO(),[a,o]=io(3),{secret:i}=e.mfa.totp.enrollment,s=i.toLowerCase(),l=s.split(RegExp("(.{4})","g")).filter(Boolean),{codeRef:c,columnCount:d}=function(e){let t=tQ(null),[r,n]=tG();return tJ(()=>{let r=()=>{if(!t.current)return;let r=Math.floor(t.current.clientWidth/Math.max(...Array.from(t.current.querySelectorAll("span")).map(e=>e.clientWidth))),a=Math.ceil(e/(r-Math.floor(r/4)));n(Math.ceil(e/a))};if(r(),!window.ResizeObserver||!t.current)return;let a=new ResizeObserver(r);return a.observe(t.current),()=>a.disconnect()},[e]),{codeRef:t,columnCount:r}}(l.length),u=async()=>{try{await navigator.clipboard.writeText(s),o(!0)}catch{im({message:r._({id:"mfa.totpEnrollment.toast.copyFailed",message:"Couldn't copy code to clipboard"})});let e=window.getSelection();if(c.current&&e){e.empty();let t=document.createRange();t.selectNodeContents(c.current),e.addRange(t)}}};return rZ.createElement(id,{gap:6},rZ.createElement(sh,{header:r._({id:"mfa.totpEnrollment.title",message:"Having trouble scanning the QR code?"}),body:r._({id:"mfa.totpEnrollment.content",message:"Click to copy the code below. Enter into your authenticator app to link your account."})}),rZ.createElement(s2,{className:"TOTPEnrollManualScreen_module_codeContainer__dc7a0e56",onClick:u},rZ.createElement(nZ,{ref:c,className:"TOTPEnrollManualScreen_module_code__dc7a0e56",style:{"--st-column-count":d,"--st-chunk-size":"4ch"},font:"mono"},l.map((e,t)=>rZ.createElement("span",{key:t},e)))),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:u},rZ.createElement(ii,{primary:r._({id:"mfa.totpEnrollment.copyCode.label",message:"Copy to clipboard"}),secondary:r._({id:"mfa.totpEnrollment.copyCode.codeCopied",message:"Copied!"}),triggered:a})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{t({type:"transition",history:"push",screen:ay})}},r._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"ghost",onClick:()=>t({type:"navigate_back"})},r._({id:"button.totpQrRetry",message:"Try to scan the QR code again"}))))};nW(".TOTPEnrollQRScreen_module_qr__ae8d607c{display:block;margin:0 auto}");let lr=()=>{let e=t2(aW).client,[t,r]=t2(aW).state,n=aZ(),a=aY(),{i18n:o,_:i}=nO(),{memberId:s,organizationId:l}=t.mfa.primaryInfo,{data:c}=ox(["stytch.totp.create",s,l],()=>e.totp.create({member_id:s,organization_id:l}),{revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,onSuccess:e=>{n({type:eu.B2BTOTPCreate,data:e}),r({type:"totp/create_success",response:e,memberId:s,organizationId:l})},onError:e=>{let t=ic(e,i);t&&im({message:t}),a(e)}});return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header"},o._({id:"totp.setupQr.title",message:"Scan the QR code to link your authenticator app"})),rZ.createElement(nZ,{variant:"body"},o._({id:"totp.setupQr.content",message:"Your organization requires an additional form of verification to make your account more secure. If you don’t have an authenticator app, you’ll need to install one first."})),c?rZ.createElement(rZ.Fragment,null,rZ.createElement("img",{alt:o._({id:"mfaTotpEnrollment.qrAltText",message:"QR code for TOTP enrollment"}),src:c.qr_code,className:"TOTPEnrollQRScreen_module_qr__ae8d607c"}),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>{r({type:"transition",history:"push",screen:ay})}},o._({id:"button.continue",message:"Continue"})),rZ.createElement(oZ,{variant:"outline",onClick:()=>{r({type:"totp/show_code",method:"manual"})}},o._({id:"button.totpQrManual",message:"Having trouble scanning?"})))):rZ.createElement(i4,null))},ln=()=>{let e=t2(aW).client,{sessionOptions:{sessionDurationMinutes:t}}=t2(aW).config,{i18n:r,_:n}=nO(),[a,o]=t2(aW).state,{mfa:{isEnrolling:i}}=a,{enrolledMfaMethods:s,memberId:l,organizationId:c,organizationMfaOptionsSupported:u}=a.mfa.primaryInfo,{trigger:h,isMutating:m,error:p}=oM("stytch.totp.authenticate",(t,{arg:{memberId:r,organizationId:n,otp:a,sessionDurationMinutes:o}})=>e.totp.authenticate({code:a,member_id:r,organization_id:n,session_duration_minutes:o}),{onSuccess:()=>{o({type:"totp/authenticate_success"})}}),_=t1(()=>!i&&s.includes(d.smsOtp)&&(0===u.length||u.includes(d.smsOtp)),[s,i,u]),g=p?r._({id:"error.passcodeInvalid",message:"Invalid passcode, please try again."}):void 0;return rZ.createElement(id,{gap:6},rZ.createElement(sm,{header:r._({id:"totp.title",message:"Enter verification code"}),instruction:r._({id:"totp.content",message:"Enter the 6-digit code from your authenticator app."}),helperContent:i?r._({id:"mfa.totpEntry.getNewCode",message:"If the verification code doesn’t work, go back to your authenticator app to get a new code."}):null,isSubmitting:m,onSubmit:e=>h({memberId:l,organizationId:c,otp:e,sessionDurationMinutes:t}),errorMessage:g}),rZ.createElement(iw,{top:null,bottom:rZ.createElement(rZ.Fragment,null,_&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:a_})}},r._({id:"mfa.totpEntry.switchToSms",message:"Text me a code instead"})),!i&&rZ.createElement(oZ,{variant:"outline",onClick:()=>{o({type:"transition",history:"push",screen:ah})}},r._({id:"mfa.totpEntry.useBackupCode",message:"Use a backup code"})),i&&rZ.createElement(oZ,{variant:"ghost",onClick:()=>o({type:"navigate_back"})},r._({id:"button.goBack",message:"Go back"})))}))},la={discovery:{mutationKey:"stytch.magicLinks.discovery.authenticate",onSuccess:oL,defaultError:aM},discovery_oauth:{mutationKey:"stytch.oauth.discovery.authenticate",onSuccess:oL},oauth:{mutationKey:"stytch.oauth.authenticate",onSuccess:oR},sso:{mutationKey:"stytch.sso.authenticate",onSuccess:oR},multi_tenant_magic_links:{mutationKey:"stytch.magicLinks.authenticate",onSuccess:oR,defaultError:aM},multi_tenant_impersonation:{mutationKey:"stytch.impersonation.authenticate",onSuccess:oR}},lo={ad_blocker_detected:aL},li=()=>{let e,[t,r]=t2(aW).state,n=t2(aW).client,a=aY(),o=aZ(),i=t2(aW).config,{displayWatermark:l,theme:c,options:d}=t2(nq),u=oU(),h=t.screen,m=oN(i,"screens"),[p,_]=tG(!1),{mutate:g}=a9(oS,t2(oE)),{slug:f,resultPending:y}=(()=>{let[e,t]=t2(aW).state,[r,n]=tG(),a=t2(aW).config,o=t2(aW).client,i=a.organizationSlug??((e,t)=>{if(null===e)return null;let r=new URL(t);r.search="";let n=r.toString().trim(),a=new RegExp(e.replace(/\./g,"\\.").replace(/\*/g,"(?:[^.]+)").replace("{{slug}}","(.+)")),o=n.match(a);return o&&o[1]?o?.[1]:null})(r||null,window.location.href),{trigger:l,isMutating:c}=oM("stytch.organization.getBySlug",(e,{arg:{slug:t}})=>o.organization.getBySlug({organization_slug:t}),{onSuccess:({organization:e})=>{null===e?t({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}):t({type:"set_organization",organization:{...e}})}});return tZ(()=>{r1(o).bootstrap.getAsync().then(({slugPattern:e})=>{n(e)})},[o]),tZ(()=>{null!==i&&null===e.flowState.organization&&e.screen===at&&e.flowState.type==s.Organization&&l({slug:i})},[i,e.flowState,e.screen]),{slug:i,resultPending:void 0===r||c}})();if(tZ(()=>{if(u||t.flowState.type==s.PasswordReset)return;let e=n.parseAuthenticateUrl();if(!e?.handled)return;let{mutationKey:l,defaultError:c,onSuccess:d}=la[e.tokenType];_(!0),g(l,n.authenticateByUrl({session_duration_minutes:i.sessionOptions.sessionDurationMinutes})).then(e=>{if(!e?.handled)return;let{data:t}=e,n=oz[l];n&&o({type:n,data:t}),d(t,r,i)},e=>{a(e),((e,t=az)=>{r({type:"set_error_message_and_transition",errorType:lo[is(e)]??t,canGoBack:!1})})(e,c)}).finally(()=>_(!1))},[]),tZ(()=>{if(u||p)return;let e=n.parseAuthenticateUrl();!e?.handled&&(f||y||null!==t.flowState.organization||t.screen!==at||t.flowState.type!=s.Organization||r({type:"set_error_message_and_transition",errorType:aI,canGoBack:!1}))},[r,u,p,y,f,t.flowState.organization,t.flowState.type,t.screen,n,a]),u)return rZ.createElement(o1,null);if(p)return rZ.createElement(sH,{theme:c,displayWatermark:!1},rZ.createElement(i3,null));if(t.flowState.organization?.organization_logo_url){let{organization_name:r,organization_logo_url:n}=t.flowState.organization;e={url:n,alt:r??""}}let v={[at]:sQ,[an]:sj,[aa]:sZ,[ao]:sF,[au]:s1,[ap]:s9,[a_]:le,[ah]:s0,[am]:s3,[af]:lr,[ag]:lt,[ay]:ln}[h]??m[h];return rZ.createElement(sH,{theme:c,displayWatermark:l},rZ.createElement(sN,{appLogo:d.logo,orgLogo:e}),rZ.createElement(v,null))},ls=({client:e,presentation:t,callbacks:r,config:n,strings:a})=>{let[o,i]=tG(()=>{let{displayWatermark:t}=r1(e).bootstrap.getSync();return t});tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_login_screen",details:{options:n,bootstrap:t}}),i(t.displayWatermark)})},[e]);let c=new URL(window.location.href).searchParams.get("stytch_redirect_type")===l.ResetPassword?s.PasswordReset:n.authFlowType,d={...aV,screen:c===s.PasswordReset?as:at,flowState:{...aV.flowState,type:c}},u=t1(()=>({...n,sessionOptions:n.sessionOptions??{}}),[n]),h=nF(t,o,u,"B2BProduct");return rZ.createElement(aG,{client:e,callbacks:r,config:u,initialState:d},rZ.createElement(nq.Provider,{value:h},rZ.createElement(nD,{messages:rQ,overrides:a},rZ.createElement(li,null))))},ll={text:"Verify your identity",details:["View information stored within your account"]},lc={text:"Maintain access to your data even when you're not actively using the app",details:["Access your data even when you are offline.","Synchronize data and process background tasks on your behalf."]},ld="openid",lu="profile",lh="email",lm="phone",lp="offline_access",l_=new Set([ld,lu,lh,lm,"full_access",lp]),lg=[ld,lh,lu],lf=(e,t)=>{if(!t)return[];let r=[];for(let n of e){if(l_.has(n))continue;let e=t.scopes.find(e=>e.scope===n);e&&e.description?r.push(e.description):r.push(`Use the ${n} scope`)}return r},ly=e=>{let t={client_id:"",redirect_uri:"",response_type:"code",scopes:[...lg]};for(let r of["client_id","redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}for(let r of["response_type","scope","code_challenge","state","nonce","prompt"]){let n=e.get(r);n&&("scope"===r?t.scopes=n.split(" ").filter(Boolean):t[r]=n)}return e.has("resource")&&(t.resources=e.getAll("resource")),{error:null,result:t}},lv=e=>{let t={client_id:"",post_logout_redirect_uri:""};for(let r of["client_id","post_logout_redirect_uri"]){let n=e.get(r);if(!n)return{error:`Required parameter is missing: ${r}. Please reach out to the application developer.`,result:t};t[r]=n}return t.id_token_hint=e.get("id_token_hint")||void 0,t.state=e.get("state")||void 0,{error:null,result:t}};nW(".IDPConsentManifest_module_manifest__9dc43278 details{overflow:clip}.IDPConsentManifest_module_manifest__9dc43278 summary,.IDPConsentManifest_module_summaryNoDetail__9dc43278{align-items:center;display:flex;justify-content:space-between}.IDPConsentManifest_module_manifest__9dc43278 summary{cursor:pointer;outline:0}.IDPConsentManifest_module_manifest__9dc43278 details,.IDPConsentManifest_module_summaryNoDetail__9dc43278{padding:var(--st-spacing-2) var(--st-spacing-3)}.IDPConsentManifest_module_summaryNoDetail__9dc43278{min-height:var(--st-spacing-9)}.IDPConsentManifest_module_ungrantable__9dc43278{background:var(--st-muted)}.IDPConsentManifest_module_outerList__9dc43278 details,.IDPConsentManifest_module_ungrantable__9dc43278{border-radius:var(--st-rounded-md)}.IDPConsentManifest_module_outerList__9dc43278 details:has(:focus-visible),.IDPConsentManifest_module_ungrantable__9dc43278:has(:focus-visible){box-shadow:var(--st-focus-ring-shadow)}@supports not selector(:has(:focus-visible)){.IDPConsentManifest_module_outerList__9dc43278 details:focus-within,.IDPConsentManifest_module_ungrantable__9dc43278:focus-within{box-shadow:var(--st-focus-ring-shadow)}}.IDPConsentManifest_module_borderBetween__9dc43278:not(:last-child){border-bottom:1px solid var(--st-border)}.IDPConsentManifest_module_outerList__9dc43278{list-style:none}.IDPConsentManifest_module_nestedList__9dc43278{list-style:disc;padding-block:var(--st-spacing) var(--st-spacing-2);padding-inline-start:var(--st-spacing-4)}.IDPConsentManifest_module_chevron__9dc43278{flex-shrink:0;transition:transform var(--st-transition-duration) ease}details[open] .IDPConsentManifest_module_chevron__9dc43278{transform:rotate(90deg)}");var lb={manifest:"IDPConsentManifest_module_manifest__9dc43278",summaryNoDetail:"IDPConsentManifest_module_summaryNoDetail__9dc43278",ungrantable:"IDPConsentManifest_module_ungrantable__9dc43278 IDPConsentManifest_module_manifest__9dc43278",outerList:"IDPConsentManifest_module_outerList__9dc43278",borderBetween:"IDPConsentManifest_module_borderBetween__9dc43278",nestedList:"IDPConsentManifest_module_nestedList__9dc43278 IDPConsentManifest_module_borderBetween__9dc43278",chevron:"IDPConsentManifest_module_chevron__9dc43278 i18n_module_rtlIcon__278ecfc9"};let lw=({item:e,as:t="li"})=>{"string"==typeof e&&(e={text:e});let r=rZ.createElement(nZ,{variant:"helper"},e.text);return e.details?.length?rZ.createElement(t,{className:lb.borderBetween},rZ.createElement("details",{className:lb.details},rZ.createElement("summary",{onClick:lC},r,rZ.createElement(o8,{className:lb.chevron,role:"presentation"})),rZ.createElement("ul",{className:lb.nestedList},e.details?.map(e=>rZ.createElement(nZ,{as:"li",variant:"helper",key:e},e))))):rZ.createElement(t,{className:nj(lb.summaryNoDetail,lb.borderBetween)},r)},lk=({section:e})=>rZ.createElement(id,{gap:2},rZ.createElement(nZ,{weight:"medium"},e.header),rZ.createElement("ul",{className:lb.outerList},e.items.map((e,t)=>rZ.createElement(lw,{key:t,item:e})))),lS=({manifest:e,clientName:t})=>{let{i18n:r,_:n}=nO(),a="object"==typeof e[0]&&"header"in e[0]?e:[{header:r._({id:"idpConsent.allowClientTo",message:"Allow {clientName} to:",values:{clientName:t}}),items:e}];return rZ.createElement("div",{className:lb.manifest},a.map((e,t)=>rZ.createElement(lk,{key:t,section:e})))},lE=({clientName:e,ungrantableScopeDescriptions:t})=>{let{i18n:r,_:n}=nO();if(!t.length)return null;let a={text:r._({id:"idpConsent.noPermissionsToGrant",message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:e}}),details:t};return rZ.createElement("div",{className:lb.ungrantable},rZ.createElement(lw,{item:a,as:"div"}))};function lC(e){let t=e.currentTarget.parentElement;if(t?.tagName!=="DETAILS")return;e.preventDefault();let r=t.open,n=e.currentTarget.clientHeight+"px",a=getComputedStyle(t),o=`calc(${n} + ${a.paddingTop} + ${a.paddingBottom})`,i={duration:iu(e.currentTarget),easing:"ease-in-out"};if(r){let e=t.clientHeight+"px";t.animate([{height:e},{height:o}],i).finished.then(()=>{t.open=!1})}else t.open=!0,requestAnimationFrame(()=>{let e=t.clientHeight+"px";t.animate([{height:o},{height:e}],i)})}let lP=(e,t)=>{switch(t.type){case"START_SUBMIT":return{...e,loading:!0};case"COMPLETE_SUBMIT":return{...e,loading:!1,success:!0};case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,client:t.client,consent_required:t.consent_required,grantable_scope:t.grantable_scope,ungrantable_scope:t.ungrantable_scope};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lT=({bootstrap:e,bootstrapNotLoaded:t,state:r,submit:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l,success:c,client:d}=r,u=t2(nz),h=t1(()=>{let e=r.client?.client_name??"";if(!e)try{e=new URL(r.redirect_uri).hostname}catch(t){eC("Unable to parse host from redirect URI.",t),e=a._({id:"idpConsent.defaultClientName",message:"The App"})}return e},[r.client?.client_name,r.redirect_uri,o]),m=t1(()=>{if(u)try{return u({scopes:r.grantable_scope.split(" "),clientName:h})}catch(e){eP("Error rendering custom consent screen. Falling back to default consent screen.",e)}return(({scopes:e,clientName:t,rbacPolicy:r})=>{let n;return[{header:`${t} is requesting to:`,items:(n=[],e.includes(ld)&&n.push(ll),(e.includes(lh)||e.includes(lu)||e.includes(lm))&&n.push((({containsProfile:e,containsEmail:t,containsPhoneNumber:r})=>{let n=[];return e&&n.push("Your name, profile picture, and language preferences"),t&&n.push("Your email address"),r&&n.push("Your phone number"),{text:"View your personal profile information",details:n}})({containsEmail:e.includes(lh),containsPhoneNumber:e.includes(lm),containsProfile:e.includes(lu)})),e.includes(lp)&&n.push(lc),n).concat(lf(e,r))}]})({scopes:r.grantable_scope.split(" "),rbacPolicy:e.rbacPolicy,clientName:h})},[u,r.grantable_scope,h,e.rbacPolicy]),p=t1(()=>""===r.ungrantable_scope?[]:lf(r.ungrantable_scope.split(" "),e.rbacPolicy),[r.ungrantable_scope,e.rbacPolicy]);return i||t?rZ.createElement(i4,null):s?rZ.createElement(sU,{text:s}):l?rZ.createElement(sU,{text:a._({id:"idpConsent.denied",message:"Access to the application was denied."})}):c?rZ.createElement(sK,null):rZ.createElement(lO,{client:d,submit:n,grantableScope:r.grantable_scope,projectName:e.projectName},rZ.createElement(lE,{ungrantableScopeDescriptions:p,clientName:h}),rZ.createElement(lS,{manifest:m,clientName:h}))},lO=({client:e,submit:t,grantableScope:r,projectName:n,children:a})=>{let{i18n:o,_:i}=nO(),{options:s}=t2(nq),l=e.client_name,c=r.split(" ").some(e=>!l_.has(e))?o._({id:"idpConsent.customScopes.title",message:"{clientName} wants to access your {projectName} account",values:{clientName:l,projectName:n}}):o._({id:"idpConsent.signIn.title",message:"Sign in to {clientName} with {projectName}",values:{clientName:l,projectName:n}});return rZ.createElement(id,{gap:6},s.logo&&rZ.createElement(sN,{appLogo:s.logo}),rZ.createElement(nZ,{variant:"header",align:"center"},c),a,rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},o._({id:"idpConsent.button.allow",message:"Allow"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},o._({id:"idpConsent.button.deny",message:"Deny"}))))},lA=(e,t)=>{switch(t.type){case"START_PREFLIGHT":return{...e,preflight:!0,loading:!0};case"PREFLIGHT_ERROR":return{...e,preflight:!0,loading:!1,error:t.error};case"COMPLETE_PREFLIGHT":return{...e,loading:!1,consent_required:t.consent_required,redirect_uri:t.redirect_uri};case"CONSENT_DENIED":return{...e,denied:!0};default:return e}},lx=e=>{window.location.href=e},lD=({state:e,submit:t,bootstrap:r,bootstrapNotLoaded:n})=>{let{i18n:a,_:o}=nO(),{loading:i,error:s,denied:l}=e;if(i||n)return rZ.createElement(i4,null);if(s)return rZ.createElement(sU,{text:s});if(l)return rZ.createElement(sK,{text:a._({id:"idpLogout.notLoggedOut",message:"You have not been logged out. You may close this page."})});let c=r.projectName;return rZ.createElement(id,{gap:6},rZ.createElement(nZ,{variant:"header",align:"center"},a._({id:"idpLogout.title",message:"Log out?"})),rZ.createElement(nZ,{variant:"body"},a._({id:"idpLogout.confirmMessage",message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:c}})),rZ.createElement(iw,null,rZ.createElement(oZ,{variant:"primary",onClick:()=>t({consent_granted:!0})},a._({id:"idpLogout.yes",message:"Yes"})),rZ.createElement(oZ,{onClick:()=>t({consent_granted:!1}),variant:"ghost"},a._({id:"idpLogout.no",message:"No"}))))},lz=({initialError:e,initialParams:t})=>{let r=t2(aW).client,n=aY(),a=aZ(),{oauthAuthorizeStart:o,oauthAuthorizeSubmit:i}=r.idp,s=oI(),l=(({initialError:e,initialParams:t,oauthAuthorizeStart:r,oauthAuthorizeSubmit:n,onError:a,onEvent:o})=>{let[i,s]=tY(lP,{loading:!e,preflight:!!e,error:e,success:!1,denied:!1,consent_required:!1,client:null,grantable_scope:"",ungrantable_scope:"",redirect_uri:t.redirect_uri});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async({consent_required:e,consent_granted:r})=>{s({type:"START_SUBMIT"});let a=await n({...t,consent_granted:r});a.authorization_code&&s({type:"COMPLETE_SUBMIT"}),window.location.href=a.redirect_uri,e&&!r?(s({type:"CONSENT_DENIED"}),o({type:eu.OAuthAuthorizeFlowConsentDenied,data:{}})):o({type:eu.OAuthAuthorizeFlowComplete,data:{}})},[n,t,o]),c=t0(({consent_granted:e})=>l({consent_granted:e,consent_required:!0}),[l]),d=t0(async()=>{let e;s({type:"START_PREFLIGHT"}),o({type:eu.OAuthAuthorizeFlowStart,data:{client_id:t.client_id,redirect_uri:t.redirect_uri,scope:t.scopes.join(" ")}});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}if(e.consent_required){let t=e.scope_results.filter(e=>e.is_grantable).map(e=>e.scope).join(" "),r=e.scope_results.filter(e=>!e.is_grantable).map(e=>e.scope).join(" ");s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,client:e.client,grantable_scope:t,ungrantable_scope:r});return}await l({consent_required:!1,consent_granted:!1})},[o,t,r,a,l]);return tZ(()=>{i.preflight||d()},[d,i.preflight]),{state:i,submit:c}})({initialError:e,initialParams:t,oauthAuthorizeStart:o,oauthAuthorizeSubmit:i,onError:n,onEvent:a});return rZ.createElement(lT,{bootstrap:s,bootstrapNotLoaded:!1,...l})},lM=({initialError:e,initialParams:t,navigate:r})=>{let n=t2(aW).client,a=aY(),{oauthLogoutStart:o}=n.idp,i=oI(),s=(({initialError:e,initialParams:t,oauthLogoutStart:r,revokeSession:n,onError:a,navigate:o=lx})=>{let[i,s]=tY(lA,{loading:!e,preflight:!!e,error:e,denied:!1,consent_required:!1,redirect_uri:""});tZ(()=>{e&&a(new et(e))},[e,a]);let l=t0(async e=>{try{await n()}catch{}o(e)},[n,o]),c=t0(async()=>{let e;s({type:"START_PREFLIGHT"});try{e=await r(t)}catch(t){let e=v.from(t);s({type:"PREFLIGHT_ERROR",error:e.error_message}),a(e);return}e.consent_required?s({type:"COMPLETE_PREFLIGHT",consent_required:e.consent_required,redirect_uri:e.redirect_uri}):l(e.redirect_uri)},[t,r,a,l]);tZ(()=>{i.preflight||c()},[c,i.preflight]);let d=t0(async({consent_granted:e})=>{if(e)return l(i.redirect_uri);s({type:"CONSENT_DENIED"})},[l,i]);return{state:i,submit:d}})({initialError:e,initialParams:t,oauthLogoutStart:o,revokeSession:()=>n.session.revoke({forceClear:!0}),onError:a,navigate:r});return rZ.createElement(lD,{...s,bootstrap:i,bootstrapNotLoaded:!1})},lI=({searchParams:e=window.location.search,navigate:t}={})=>{let r,[{flow:n,error:a}]=tG((e=>{let t=new URLSearchParams(e);if(t.has("post_logout_redirect_uri")){let e=lv(t);return{error:e.error,flow:{type:"Logout",params:e.result}}}let r=ly(t);return{error:r.error,flow:{type:"Authorize",params:r.result}}})(e)),{theme:o,displayWatermark:i}=t2(nq);return"Authorize"===n.type?r=rZ.createElement(lR,null,rZ.createElement(lz,{initialError:a,initialParams:n.params})):"Logout"===n.type&&(r=rZ.createElement(lM,{initialError:a,initialParams:n.params,navigate:t})),rZ.createElement(sH,{theme:o,displayWatermark:i},r)},lR=({children:e})=>{let t,{i18n:r,_:n}=nO(),a=rG((t=t2(aW).client).onStateChange,()=>t.self.getSync()),o=aY(),i=tQ(o);tZ(()=>{i.current=o},[o]);let s=t2(aW).client,l=t2(nM),[c,d]=tG(!1),[u,h]=tG(!1);return(tZ(()=>{c||u||(async e=>{if(e?.trustedAuthToken&&e?.tokenProfileID){d(!0);let t=e.trustedAuthToken,r=e.tokenProfileID,n=s.self.getSync();n&&await s.session.revoke();try{await s.session.attest({token:t,profile_id:r,organization_id:n?.organization_id,session_duration_minutes:60})}catch(e){i.current(e)}finally{d(!1),h(!0)}}h(!0)})(l)},[l,c,u,s]),tZ(()=>{a||i.current(new w)},[a]),c)?rZ.createElement(i4,null):a?e:rZ.createElement(sU,{text:r._({id:"idpConsent.noActiveSession",message:"No active session detected. Please log in to continue."})})};class lL extends Event{stytchEventType;stytchEventData;constructor(e){super("stytch-event",{composed:!0}),this.stytchEventType=e.type,this.stytchEventData=e.data}}class lB extends Event{error;constructor(e){super("stytch-error",{composed:!0}),this.error=e}}function lN(e,{propNames:r,attributeNames:n=[]}){if("u"<typeof window)return class{render(){}flushRender(){}};let a=Object.fromEntries(n.map(e=>[e.toLowerCase(),e]));return class o extends HTMLElement{#e;static observedAttributes=Object.keys(a);#t;#r=!1;#n={};constructor({shadow:e}={}){for(const t of(super(),this.#t=e??null!=this.getAttribute("shadow"),o.observedAttributes)){const e=this.getAttribute(t);if(null!=e){const r=a[t];this.#n[r]=e}}for(const e of r)Object.hasOwn(this,e)&&(this.#n[e]=this[e]),Object.defineProperty(this,e,{get:()=>this.#n[e],set:t=>{n.includes(e)&&this.setAttribute(e,t),this.#n[e]=t,this.#a()}})}connectedCallback(){if(!this.#e)if(this.#e=document.createElement("div"),this.#t){this.setAttribute("shadow","true");let e=this.attachShadow({mode:"open"});e.appendChild(nG()),e.appendChild(this.#e)}else t||(t=nG(),document.head.appendChild(t)),this.appendChild(this.#e);this.#a()}disconnectedCallback(){this.#e&&rq(this.#e)}attributeChangedCallback(e,t,r){let n=a[e];this.#n[n]=r}render(e){Object.assign(this,e)}flushRender(){rj(()=>{this.#o()})}#a(){this.#r||(this.#r=!0,window.queueMicrotask(()=>{this.#o()}))}#i(e){var t;let r=(t=e,t?.config);if(r?.oauthOptions?.providers.some(e=>"object"==typeof e&&"google"===e.type&&e.one_tap)&&!this.querySelector("#google-parent-prompt")){let e=document.createElement("div");e.id="google-parent-prompt",e.slot="one-tap",this.appendChild(e)}}#s={onError:e=>{this.#n.callbacks?.onError?.(e),this.dispatchEvent(new lB(e))},onEvent:e=>{this.#n.callbacks?.onEvent?.(e),this.dispatchEvent(new lL(e))}};#o(){if(!this.#e||(this.#r=!1,0===Object.keys(this.#n).length))return;this.#i(this.#n);let t=this.#n;this.#t&&(t=function(e){let{presentation:t}=e;return lF(e)?e:{...e,presentation:{...t,options:{...t?.options,enableShadowDOM:!0}}}}(t)),rC(rZ.createElement(e,{...t,callbacks:this.#s}),this.#e)}}}function lU(e,t){return"u"<typeof window?()=>null:({elementId:r,...n})=>{let a;customElements.get(e)||customElements.define(e,t);let o=document.querySelector(r);if(!o)throw Error(`The selector you specified (${r}) applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin().`);return o.firstChild?.nodeName.toLowerCase()===e.toLowerCase()?(a=o.firstChild).render(n):(a=new t({shadow:lF(n)}),o.appendChild(a)),a}}function lF(e){let{config:t,presentation:r}=e;return r?.options?.enableShadowDOM??t?.enableShadowDOM}let lq=lN(({client:e,presentation:t,callbacks:r,strings:n,getIDPConsentManifest:a,trustedAuthTokenParams:o,styles:i})=>{let s=nF(t,!1,{products:[]});return tZ(()=>{r1(e).bootstrap.getAsync().then(t=>{r1(e).networkClient.logEvent({name:"render_b2b_idp_screen",details:{bootstrap:t}})})},[e]),i&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide"),rZ.createElement(aG,{client:e,config:{},callbacks:r,initialState:aV},rZ.createElement(nI,{consentManifestGenerator:a,authTokenParams:o},rZ.createElement(nq.Provider,{value:s},rZ.createElement(nD,{messages:rQ,overrides:n},rZ.createElement(lI,null)))))},{propNames:["client","presentation","callbacks","strings","getIDPConsentManifest","trustedAuthTokenParams"]}),lH=lU("stytch-identity-provider",lq),lK=lN(({config:e,styles:t,...r})=>{t&&eP("styles is deprecated and has no effect. Use the presentation prop instead.\nSee https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide");let n={...e,organizationProducts:Object.values(sL)};return rZ.createElement(ls,{config:n,...r})},{propNames:["client","config","presentation","callbacks","strings"]}),lj=lU("stytch-ui",lK),l$=Symbol("__stytch_SSRStubKey"),lV=e=>new Proxy(()=>{},{get:(t,r)=>r===l$||lV(e+"."+String(r)),apply(){throw Error(`[Stytch] Invalid server-side function call to ${e}.
47
47
  The Stytch JavaScript SDK is intended to only be used on the client side.
48
48
  Make sure to wrap your API calls in a hook to ensure they are executed on the client.
49
49
 
@@ -60,5 +60,5 @@ const myComponent = () => {
60
60
  \`\`\`
61
61
 
62
62
  If you want to make API calls from server environments, please use the Stytch Node Library
63
- https://www.npmjs.com/package/stytch.`)}}),lW="bootstrap",lG=()=>({displayWatermark:!1,projectName:null,cnameDomain:null,emailDomains:["stytch.com"],captchaSettings:{enabled:!1},pkceRequiredForEmailMagicLinks:!1,pkceRequiredForPasswordResets:!1,pkceRequiredForOAuth:!1,pkceRequiredForSso:!1,slugPattern:null,createOrganizationEnabled:!1,passwordConfig:null,runDFPProtectedAuth:!1,rbacPolicy:null,siweRequiredForCryptoWallets:!1,vertical:null});class lY{_publicToken;_networkClient;_dataLayer;_bootstrapDataPromise;constructor(e,t,r){this._publicToken=e,this._networkClient=t,this._dataLayer=r,this._bootstrapDataPromise=this._networkClient.fetchSDK({url:`/projects/bootstrap/${this._publicToken}`,method:"GET"}).then(lY.mapBootstrapData).then(e=>(this._dataLayer.setItem(lW,JSON.stringify(e)),e)).catch(e=>(eP(e),lG()))}static mapBootstrapData(e){let t=null!==e.password_config?{ludsComplexity:e.password_config.luds_complexity,ludsMinimumCount:e.password_config.luds_minimum_count}:null;return{projectName:e.project_name,displayWatermark:!e.disable_sdk_watermark,captchaSettings:e.captcha_settings,cnameDomain:e.cname_domain,emailDomains:e.email_domains,pkceRequiredForEmailMagicLinks:e.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:e.pkce_required_for_password_resets,pkceRequiredForOAuth:e.pkce_required_for_oauth,pkceRequiredForSso:e.pkce_required_for_sso,slugPattern:e.slug_pattern,createOrganizationEnabled:e.create_organization_enabled,passwordConfig:t,runDFPProtectedAuth:e.dfp_protected_auth_enabled??!1,dfpProtectedAuthMode:e.dfp_protected_auth_mode,rbacPolicy:e.rbac_policy??null,siweRequiredForCryptoWallets:e.siwe_required_for_crypto_wallets,vertical:e.vertical}}getSync(){let e=this._dataLayer.getItem(lW);if(null===e)return lG();try{return JSON.parse(e)}catch{return lG()}}getAsync(){return this._bootstrapDataPromise}}class lZ{bootstrapPromise;state;constructor(e){this.bootstrapPromise=e,this.state=e.then(async e=>{let t;return e.captchaSettings.enabled?{configured:!0,captchaClient:await (t=e.captchaSettings.siteKey,eD(`https://www.google.com/recaptcha/enterprise.js?render=${t}`,()=>window.grecaptcha.enterprise)),siteKey:e.captchaSettings.siteKey}:{configured:!1}})}executeRecaptcha=async()=>{let{captchaClient:e,configured:t,siteKey:r}=await this.state;if(t)return await new Promise(t=>e.ready(t)),e.execute(r,{action:"LOGIN"})}}class lJ{iframeURL;_frameClient;constructor(e){this.iframeURL=e}get frameClient(){return this._frameClient=this._frameClient??new e0(this.iframeURL),this._frameClient}call(e,t){return this.frameClient.call(e,[t])}oneTapStart=e=>this.call("oneTapStart",e);oneTapSubmit=e=>this.call("oneTapSubmit",e);parsedPhoneNumber=e=>this.call("parsedPhoneNumber",e);getExamplePhoneNumber=e=>this.call("getExamplePhoneNumber",e)}class lQ{_publicToken;_subscriptionDataLayer;additionalTelemetryDataFn;eventLogger;baseURL;constructor(e,t,r,n,a){this._publicToken=e,this._subscriptionDataLayer=t,this.additionalTelemetryDataFn=a,this.baseURL=r,(e=>e.includes("public-token-test"))(e)&&(this.baseURL=n),this.eventLogger=new eR({maxBatchSize:15,intervalDurationMs:800,logEventURL:this.buildSDKUrl("/events")})}updateSessionToken=()=>null;logEvent({name:e,details:t,error:r={}}){this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:e,details:t,error_code:r.error_code,error_description:r.error_description,http_status_code:r.http_status_code})}createTelemetryBlob(){return{event_id:`event-id-${ek()}`,app_session_id:`app-session-id-${ek()}`,persistent_id:`persistent-id-${ek()}`,client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.additionalTelemetryDataFn(),app:{identifier:window.location.hostname},sdk:{identifier:"Stytch.js Javascript SDK",version:"0.0.0"}}}async fetchSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return eg({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async submitFormSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return ef({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async retriableFetchSDK({url:e,body:t,method:r,retryCallback:n}){let a=this._subscriptionDataLayer.readSessionCookie().session_token,o="Basic "+window.btoa(this._publicToken+":"+(a||this._publicToken)),i=window.btoa(JSON.stringify(this.createTelemetryBlob())),s=window.location.origin;return e_({basicAuthHeader:o,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:i,xSDKParentHostHeader:s,retryCallback:n})}buildSDKUrl(e){return`${this.baseURL}/sdk/v1${e}`}}function lX(e){let t=e.toString(16);return 1===t.length&&(t="0"+t),t}class l1{_dataLayer;namespace;constructor(e,t){this._dataLayer=e,this.namespace=t}key(){return`PKCE_VERIFIER:${this.namespace}`}async startPKCETransaction(){let e=await l1.createProofkeyPair();return this._dataLayer.setItem(this.key(),JSON.stringify(e)),e}getPKPair(){let e=this._dataLayer.getItem(this.key());if(null!==e)try{return JSON.parse(e)}catch{eC("Found malformed Proof Key pair in localstorage.");return}}clearPKPair(){return this._dataLayer.removeItem(this.key())}static async createProofkeyPair(){var e;let t=new Uint32Array(16);window.crypto.getRandomValues(t);let r=Array.from(t).map(lX).join("");return{code_challenge:(e=await window.crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)),btoa(String.fromCharCode.call(null,...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")),code_verifier:r}}}function l0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var l2=function e(t,r){function n(e,n,a){if("u">typeof document){"number"==typeof(a=l0({},r,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in a)a[i]&&(o+="; "+i,!0!==a[i]&&(o+="="+a[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+o}}return Object.create({set:n,get:function(e){if("u">typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},a=0;a<r.length;a++){var o=r[a].split("="),i=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=t.read(i,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",l0({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,l0({},this.attributes,t))},withConverter:function(t){return e(l0({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});let l3="seen_domains";class l4{publicToken;state;_opaqueTokenCookieName=null;_jwtCookieName=null;_cookiePath=null;_domain=null;_cookieAvailableToSubdomains=!1;_istCookieName=null;subscriptions;_localStorage;browserSessionStorage;constructor(e,t){let r;this.publicToken=e,this.state=null,this.subscriptions={},this._localStorage=oj(oH,e),this.browserSessionStorage=oj(oK,e),t?.cookieOptions&&(this._opaqueTokenCookieName=t.cookieOptions.opaqueTokenCookieName||null,this._jwtCookieName=t.cookieOptions.jwtCookieName||null,this._cookiePath=t.cookieOptions.path||null,this._domain=t.cookieOptions.domain||null,this._cookieAvailableToSubdomains=t.cookieOptions.availableToSubdomains||!1,this._istCookieName=t.cookieOptions.istCookieName||null);const n=this._localStorage.getItem("");if(!n)return;try{r=JSON.parse(n)}catch{this.syncToLocalStorage();return}this.state=r}get opaqueTokenCookieName(){return this._opaqueTokenCookieName??"stytch_session"}get jwtCookieName(){return this._jwtCookieName??"stytch_session_jwt"}get istCookieName(){return this._istCookieName??"stytch_intermediate_session_token"}readSessionCookie(){return{session_token:l2.get(this.opaqueTokenCookieName),session_jwt:l2.get(this.jwtCookieName)}}readIntermediateSessionTokenCookie(){return l2.get(this.istCookieName)}writeSessionCookie(e){let{state:t,session_token:r,session_jwt:n}=e,a=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});a.domain&&this.addSeenDomain(a.domain),l2.set(this.opaqueTokenCookieName,r,a),l2.set(this.jwtCookieName,n,a);let o=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});o.domain&&this.addSeenDomain(o.domain),n8(this.jwtCookieName)&&l2.remove(this.jwtCookieName,o),n8(this.opaqueTokenCookieName)&&l2.remove(this.opaqueTokenCookieName,o),n8(this.jwtCookieName)&&eC("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."),n8(this.opaqueTokenCookieName)&&eC("Could not remove extraneous opaque token cookie.")}writeIntermediateSessionTokenCookie(e){let t=new Date(Date.now()+6e5),r=l4.generateCookieOpts({expiresAt:t.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});l2.set(this.istCookieName,e,r)}removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName])}removeISTCookie(){this.removeCookies([this.istCookieName])}removeCookies(e){let t=this.getSeenDomains(),r=[...new Set([this._domain,null,...t])];[!0,!1].forEach(t=>{[this._cookiePath,null].forEach(n=>{r.forEach(r=>{let a=l4.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:t,path:n,domain:r});e.forEach(e=>{l2.remove(e,a)})})})})}syncToLocalStorage(){this._localStorage.setItem("",JSON.stringify(this.state))}getItem(e){return this._localStorage.getItem(e)}setItem(e,t){this._localStorage.setItem(e,t)}removeItem(e){this._localStorage.removeItem(e)}getSeenDomains(){let e=this.getItem(l3);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}addSeenDomain(e){if(!e)return;let t=this.getSeenDomains();t.includes(e)||(t.push(e),this.setItem(l3,JSON.stringify(t)))}static generateCookieOpts({path:e,domain:t,availableToSubdomains:r,expiresAt:n}){let a={expires:new Date(n),sameSite:"lax"};return e&&(a.path=e),"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)?a.secure=!1:(r&&(a.domain=t||window.location.host),a.secure=!0),a}}class l5 extends l4{}let l8=Symbol.for("__stytch_b2b_DataLayer"),l6=(e,t)=>{Object.values(e).forEach(e=>e(t))},l9=(({KEYS_TO_EXCLUDE:e=[]}={})=>{let t=(r,n)=>typeof r==typeof n&&(null===r||null===n?r===n:"object"==typeof r?!(Object.keys(r).length!==Object.keys(n).length||Object.keys(r).some(e=>!(e in n)))&&Object.entries(r).filter(([t])=>!e.includes(t)).every(([e,r])=>t(r,n[e])):r===n);return t})({KEYS_TO_EXCLUDE:["last_accessed_at"]});class l7{_publicToken;_datalayer;fromCache=!0;constructor(e,t,{usingCustomApiEndpoint:r}){if(this._publicToken=e,this._datalayer=t,window.addEventListener("storage",this._listen),!r){const{session_token:e}=this._datalayer.readSessionCookie();if(!e)return void this.destroySession()}}_listen=e=>{if(e.key!==oF(this._publicToken,""))return;let t=null===e.newValue||"null"===e.newValue?null:JSON.parse(e.newValue);this.updateState(t,!0)};getTokens(){let{session_token:e,session_jwt:t}=this._datalayer.readSessionCookie();return"string"!=typeof e||"string"!=typeof t?null:{session_token:e,session_jwt:t}}getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null}destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null})}destroySession(){this._datalayer.removeSessionCookie(),this.updateState(null)}_updateStateAndTokensInternal(e,t){let r=this._datalayer.state,n=null===e.state?null:{...this._datalayer.state,...e.state};this._datalayer.state=n;let a=this.getFromCache();if(this.setCacheRefreshed(),a||!l9(r,n)){let e;e=null==n||t.fromCache?n:{...n,sessionDurationMinutes:t.sessionDurationMinutes},l6(this._datalayer.subscriptions,e)}}updateStateAndTokens(e,t={fromCache:!1}){e.state?("string"==typeof e.session_token?this._datalayer.writeSessionCookie(e):this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()):e.intermediate_session_token?("string"==typeof e.intermediate_session_token?this._datalayer.writeIntermediateSessionTokenCookie(e.intermediate_session_token):this._datalayer.removeISTCookie(),this._datalayer.removeSessionCookie()):(this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()),this._updateStateAndTokensInternal(e,t),this._datalayer.syncToLocalStorage()}updateState(e,t=!1){let r=this._datalayer.state,n=null===e?null:{...this._datalayer.state,...e};this._datalayer.state=n;let a=this.getFromCache();this.setCacheRefreshed();let o=!l9(r,n);(a||o)&&(l6(this._datalayer.subscriptions,n),o&&!t&&this._datalayer.syncToLocalStorage())}updateTokens(e){let{session_token:t,session_jwt:r}=e,n={...this._datalayer.readSessionCookie(),session_token:t,session_jwt:r};"string"==typeof t||"string"==typeof r?(this._datalayer.writeSessionCookie(n),this._datalayer.removeISTCookie()):this._datalayer.removeSessionCookie()}subscribeToState(e){var t;let r;return t=this._datalayer.subscriptions,t[r=Math.random().toString(36).slice(-10)]=e,()=>delete t[r]}getState(){return this._datalayer.state}destroy(){window.removeEventListener("storage",this._listen)}syncFromDeviceStorage(){return null}getFromCache(){return this.fromCache}setCacheRefreshed(){this.fromCache=!1}}class ce extends l7{updateMember=e=>this.updateState({member:e});getMember=()=>this.getState()?.member??null;updateOrganization=e=>this.updateState({organization:e});getOrganization=()=>this.getState()?.organization??null;getSession=()=>this.getState()?.session??null;updateSession=(e,t)=>{if("member_session"in e&&e.member_session){let r=e.session_token&&e.session_jwt?{session_token:e.session_token,session_jwt:e.session_jwt}:{session_token:!0,session_jwt:!0};this.updateStateAndTokens({state:{session:e.member_session,member:e.member,organization:e.organization},...r,intermediate_session_token:null},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})}else this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:e.intermediate_session_token||!0},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})};withUpdateSession=e=>async t=>{let r=await e(t);return this.updateSession(r,{sessionDurationMinutes:t?.session_duration_minutes}),r}}class ct extends eH{_oneTap;constructor(e,t,r,n,a,o=eM(),i){super(e,t,r,n,a,o),this._oneTap=i}startOneTapDiscovery=async e=>{let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnDiscoverySuccessHandler({discoveryRedirectUrl:e.discovery_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};startOneTap=async e=>{if(!e.organization_id)throw new h("stytch.oauth.googleOneTap.start","organization_id is a required argument");let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnSuccessHandler({organizationId:e.organization_id,signupRedirectUrl:e.signup_redirect_url,loginRedirectUrl:e.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};googleOneTap={discovery:{start:this.startOneTapDiscovery},start:this.startOneTap}}let cr="u">typeof window&&"IdentityCredential"in window,cn=e=>e===er.forceLegacyEmbedded?"force":e===er.embeddedOnly||e===er.embedded||e===er.floatingOrEmbedded;class ca{_googleClient;_clientId;constructor(e,t){this._googleClient=e,this._clientId=t}cancel(){this._googleClient.cancel()}async render({callback:e,onOneTapCancelled:t,style:r,cancelOnTapOutside:n=!0}){let a,o=cn(r.position),i="force"===(a=cn(r.position))||a&&!cr,s={client_id:this._clientId,callback:e,auto_select:!1,context:"use",itp_support:!0,use_fedcm_for_prompt:"force"!==o,cancel_on_tap_outside:n};return i&&(s.prompt_parent_id="google-parent-prompt",s.cancel_on_tap_outside=!1),this._googleClient.initialize(s),new Promise(e=>{this._googleClient.prompt(r=>{if(r.isSkippedMoment()){let n=r.getSkippedReason?.()??"unknown_reason";return"user_cancel"===n&&t?.(),e({success:!1,reason:n})}return!r.isNotDisplayed&&i||r.isNotDisplayed?.()?e({success:!1,reason:r.getNotDisplayedReason?.()??"unknown_reason"}):r.isDismissedMoment()?void 0:(this.styleFrame(i),e({success:!0}))})})}styleFrame(e){e&&Array.from(document.getElementsByTagName("iframe")).forEach(e=>{e.src.includes(a)&&(e.style.width="100%")})}}let co=Promise.resolve({pkceRequiredForOAuth:!1});class ci{_networkClient;_pkceManager;_config;googleClientID;constructor(e,t,r=co){this._networkClient=e,this._pkceManager=t,this._config=r}async fetchGoogleStart(){if(this.googleClientID)return this.googleClientID;let e=await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/start",method:"GET"});return this.googleClientID=e.google_client_id,this.googleClientID}async submitGoogleOneTapTokenDiscovery({credential:e,discoveryRedirectUrl:t}){let r,{pkceRequiredForOAuth:n}=await this._config;return n?r=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/discovery/submit",method:"POST",body:{id_token:e,discovery_redirect_url:t,pkce_code_challenge:r}})}async submitGoogleOneTapToken({credential:e,organizationId:t,signupRedirectUrl:r,loginRedirectUrl:n}){let a,{pkceRequiredForOAuth:o}=await this._config;return o?a=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/submit",method:"POST",body:{id_token:e,organization_id:t,signup_redirect_url:r,login_redirect_url:n,pkce_code_challenge:a}})}async createOneTapClient(){let e;try{e=await this.fetchGoogleStart()}catch(e){return{success:!1,reason:v.from(e).error_type}}return""===e?{success:!1,reason:"oauth_config_not_found"}:{success:!0,client:new ca(await eD(o,()=>window.google.accounts.id),e)}}createOnDiscoverySuccessHandler=({discoveryRedirectUrl:e,onSuccess:t,onError:r})=>async n=>{let{credential:a}=n,o=this.submitGoogleOneTapTokenDiscovery({credential:a,discoveryRedirectUrl:e}).then(e=>t(e.redirect_url));r&&(o=o.catch(e=>r(e))),await o};createOnSuccessHandler=({organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r,onSuccess:n,onError:a})=>async o=>{let{credential:i}=o,s=this.submitGoogleOneTapToken({credential:i,organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r}).then(e=>n(e.redirect_url));a&&(s=s.catch(e=>a(e))),await s};redirectOnSuccess=e=>{window.location.href=e}}class cs{_subscriptionService;_sessionManager;_networkClient;_dataLayer;_stateChangeClient;magicLinks;session;member;self;organization;oauth;sso;discovery;passwords;otps;totp;recoveryCodes;rbac;scim;impersonation;idp;onStateChange;parseAuthenticateUrl;authenticateByUrl;constructor(e,t){if("u"<typeof window)throw Error("`new StytchB2BClient()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `createStytchB2BClient()` instead.");(e=>{"string"!=typeof e?eC(`Public token is malformed. Expected a string, got ${typeof e}.${eO}`):""===e?eC(`Public token is malformed. Expected "public-token-...", got an empty string.${eO}`):e.startsWith("public-token-")||eC(`Public token is malformed. Expected "public-token-...", got ${e}.${eO}`)})(e);const r=e??"",n=((e,t={})=>{let{cookieOptions:r,keepSessionAlive:n}=t;return eL(e,t,{keepSessionAlive:"optionalBoolean"}),r&&eL(`${e}.cookieOptions`,r,{opaqueTokenCookieName:"optionalString",jwtCookieName:"optionalString",istCookieName:"optionalString",path:"optionalString",domain:"optionalString"}),{cookieOptions:r,keepSessionAlive:n,endpoints:{testAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.testApiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"testApiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.testAPIURL??"https://test.stytch.com"})(t),liveAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.apiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"apiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.liveAPIURL??"https://api.stytch.com"})(t),dfpBackendURL:(e=>{let t=e?.dfppaUrl??e?.endpointOptions?.dfppaDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfppaUrl?"dfppaUrl":"dfppaDomain";eC(`Unable to use custom DFPPA domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.dfpBackendURL??"https://telemetry.stytch.com"})(t),dfpCdnURL:(e=>{let t=e?.dfpCdnUrl??e?.endpointOptions?.dfpCdnDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfpCdnUrl?"dfpCdnUrl":"dfpCdnDomain";eC(`Unable to use custom DFP CDN domain \`${t}\`. ${r} should be a valid domain.`)}}return"https://elements.stytch.com"})(t),clientsideServicesIframeURL:t?.endpoints?.clientsideServicesIframeURL??"https://js.stytch.com/clientside-services/index.html"}}})(this.constructor.name,t),a=((e,t={})=>{let{customBaseUrl:r,endpointOptions:n}=t;return e.includes("public-token-test")?!!(r||n?.testApiDomain):!!(r||n?.apiDomain)})(r,t);this._dataLayer=((e,t)=>{let r,n=((r=window)[l8]||(r[l8]={}),r[l8]);return n[e]||(n[e]=new l5(e,t)),n[e]})(r,n),this._subscriptionService=new ce(r,this._dataLayer,{usingCustomApiEndpoint:a}),this._stateChangeClient=new e5(this._subscriptionService,{}),this.onStateChange=(...e)=>this._stateChangeClient.onStateChange(...e);const o=()=>({stytch_member_id:this._dataLayer.state?.member?.member_id,stytch_member_session_id:this._dataLayer.state?.session?.member_session_id}),i=new l1(this._dataLayer,"passwords"),s=new lQ(r,this._dataLayer,n.endpoints.liveAPIURL,n.endpoints.testAPIURL,o);this._networkClient=s;const l=new lY(r,s,this._dataLayer),c=new lZ(l.getAsync()),d=new ez(r,n.endpoints.dfpBackendURL,n.endpoints.dfpCdnURL,l.getAsync(),c.executeRecaptcha),u=new lJ(n.endpoints.clientsideServicesIframeURL),h=new l1(this._dataLayer,"oauth"),m=new ci(s,h,l.getAsync());this.organization=new eK(s,s,this._subscriptionService),this.member=new eJ(s,s,this._subscriptionService),this.self=new eJ(s,s,this._subscriptionService),this.session=new eQ(s,this._subscriptionService),this.magicLinks=new eq(s,this._subscriptionService,new l1(this._dataLayer,"magic_links"),i,l.getAsync(),d),this.oauth=new ct(s,this._subscriptionService,h,l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d,m),this.sso=new eX(s,this._subscriptionService,new l1(this._dataLayer,"sso"),l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d),this.discovery=new eB(s,this._subscriptionService),this.passwords=new eV(s,this._subscriptionService,i,l.getAsync(),d),this.otps=new ej(s,this._subscriptionService,d),this.totp=new e1(s,this._subscriptionService,d),this.recoveryCodes=new eY(s,this._subscriptionService,d),this.rbac=new eG(l.getSync(),l.getAsync(),this._subscriptionService),this.scim=new eZ(this._networkClient,this._subscriptionService),this.impersonation=new eU(this._networkClient,this._subscriptionService,d),this.idp=new eN(s),this._sessionManager=new e4(this._subscriptionService,this.session,r,{keepSessionAlive:n.keepSessionAlive});const p=new e2(s,d);(a||this._dataLayer.readSessionCookie().session_token)&&this._sessionManager.performBackgroundRefresh();const{authenticateByUrl:_,parseAuthenticateUrl:g}=(e=>{let t=Object.keys(e),r=(e=window.location.href)=>{let r=new URL(e),n=r.searchParams.get("stytch_token_type"),a=r.searchParams.get("token");return a&&n?t.includes(n)?{handled:!0,token:a,tokenType:n}:{handled:!1,token:a,tokenType:n}:null};return{authenticateByUrl:async({clearParams:t,...n},a=window.location.href)=>{let o=t??a===window.location.href,i=r(a);if(null==i)return null;if(!i.handled)return i;let{token:s,tokenType:l}=i,c=e[l];try{let e=await c(s,n);return{handled:!0,tokenType:l,data:e}}finally{o&&sy()}},parseAuthenticateUrl:r}})({discovery:e=>this.magicLinks.discovery.authenticate({discovery_magic_links_token:e}),discovery_oauth:e=>this.oauth.discovery.authenticate({discovery_oauth_token:e}),oauth:(e,t)=>this.oauth.authenticate({oauth_token:e,...t}),sso:(e,t)=>this.sso.authenticate({sso_token:e,...t}),multi_tenant_magic_links:(e,t)=>this.magicLinks.authenticate({magic_links_token:e,...t}),multi_tenant_impersonation:e=>this.impersonation.authenticate({impersonation_token:e})});this.authenticateByUrl=_,this.parseAuthenticateUrl=g,s.logEvent({name:"b2b_sdk_instance_instantiated",details:{event_callback_registered:!1,error_callback_registered:!1,success_callback_registered:!1}}),l.getAsync().then(e=>{"CONSUMER"===e.vertical&&eP("This application is using a Stytch client for B2B projects, but the public token is for a Stytch Consumer project. Use a Consumer Stytch client instead, or verify that the public token is correct.")}),((e,t)=>{Object.assign(e,{[rX]:t})})(this,{bootstrap:l,clientsideServices:u,publicToken:r,searchManager:p,dataLayer:this._dataLayer,networkClient:s,oneTap:m})}}let cl=(...e)=>"u"<typeof window?lV("stytch"):new cs(...e),cc={"color-scheme":"shadcn","font-family":`var(--font-sans, ${nL["font-family"]})`,"font-family-mono":`var(--font-mono, ${nL["font-family-mono"]})`,"text-base":"var(--text-base)","transition-duration":nL["transition-duration"],spacing:"var(--spacing)","mobile-breakpoint":"var(--breakpoint-sm)","rounded-base":"calc(var(--radius) / 2.5)","container-width":nL["container-width"],"container-radius":"var(--radius-xl)",shadow:"var(--shadow)",background:"var(--background)",foreground:"var(--foreground)",primary:"var(--primary)","primary-foreground":"var(--primary-foreground)",secondary:"var(--secondary)","secondary-foreground":"var(--secondary-foreground)",muted:"var(--muted)","muted-foreground":"var(--muted-foreground)",accent:"var(--accent)","accent-foreground":"var(--accent-foreground)",border:"var(--border)",input:"var(--input)",ring:"var(--ring)",destructive:"var(--destructive)","destructive-foreground":nL["destructive-foreground"],success:nB.success,warning:nB.warning};return e.AuthFlowType=s,e.B2BMFAProducts=d,e.B2BOAuthProviders=c,e.B2BProducts=sL,e.BiometricRegistrationIdIsNullOrBlank=X,e.BiometricsAlreadyEnrolledError=class extends b{constructor(){super("BiometricsAlreadyEnrolledError","There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.")}},e.BiometricsFailedError=F,e.BiometricsUnavailableError=E,e.ChallengeSigningFailedError=R,e.DFPNotConfigured=ee,e.DeviceCredentialsNotAllowedError=x,e.FailedCodeChallengeError=B,e.FailedToDecryptDataError=U,e.IDPOAuthFlowMissingParamError=et,e.InternalError=k,e.InvalidAuthorizationCredentialError=z,e.InvalidCredentialTypeError=j,e.InvalidPrivateKeyLength=Q,e.InvalidRedirectSchemeError=H,e.InvalidStartUrlError=q,e.JSONDataNotConvertibleToStringError=V,e.KeyInvalidatedError=C,e.KeystoreUnavailableError=P,e.MissingAttestationObjectError=$,e.MissingAuthorizationCredentialIDTokenError=D,e.MissingCipherIv=J,e.MissingGoogleClientIDError=class extends b{constructor(){super("MissingGoogleClientIDError","No Google client ID was found in the project.")}},e.MissingPKCEError=class extends b{constructor(){super("MissingPKCEError","Make sure this flow is completed on the same device on which it was started.")}},e.MissingPublicKeyError=I,e.MissingUrlError=K,e.NoBiometricsEnrolledError=T,e.NoBiometricsRegistrationError=S,e.NoCredentialsPresentError=M,e.NoCurrentSessionError=w,e.OAuthProviders={Google:"google",Microsoft:"microsoft",Apple:"apple",Github:"github",GitLab:"gitlab",Facebook:"facebook",Discord:"discord",Salesforce:"salesforce",Slack:"slack",Amazon:"amazon",Bitbucket:"bitbucket",LinkedIn:"linkedin",Coinbase:"coinbase",Twitch:"twitch",Twitter:"twitter",TikTok:"tiktok",Snapchat:"snapchat",Figma:"figma",Yahoo:"yahoo"},e.OTPMethods={SMS:"sms",WhatsApp:"whatsapp",Email:"email"},e.OneTapPositions=er,e.PasskeysInvalidEncoding=G,e.PasskeysMisconfigured=Y,e.PasskeysUnsupportedError=N,e.RNUIProducts=eh,e.RandomNumberGenerationFailed=W,e.RedirectURLType=l,e.SDKAPIUnreachableError=u,e.SDKNotConfiguredError=L,e.SignInWithAppleMisconfigured=Z,e.StytchAPIError=v,e.StytchAPISchemaError=y,e.StytchAPIUnreachableError=f,e.StytchB2B=lK,e.StytchB2BClient=cs,e.StytchB2BHeadlessClient=cs,e.StytchB2BIdentityProvider=lq,e.StytchB2BUIClient=class extends cs{constructor(e,t){super(e,t),eC("StytchB2BUIClient is deprecated. Use the Stytch web components directly instead.")}mount=lj;mountIdentityProvider=lH},e.StytchError=g,e.StytchEventType=eu,e.StytchSDKAPIError=p,e.StytchSDKError=b,e.StytchSDKSchemaError=m,e.StytchSDKUsageError=h,e.UNRECOVERABLE_ERROR_TYPES=_,e.UserCancellationError=O,e.UserLockedOutError=A,e.Wallets={Phantom:"Phantom",Metamask:"Metamask",Coinbase:"Coinbase",Binance:"Binance",GenericEthereumWallet:"GenericEthereumWallet",GenericSolanaWallet:"GenericSolanaWallet"},e.createStytchB2BClient=cl,e.createStytchB2BHeadlessClient=cl,e.defaultDarkTheme=nN,e.defaultTheme=nB,e.errorToStytchError=function(e){if(e instanceof b)return e;switch(e.message){case"no_current_session":return new w;case"no_biometrics_registration":return new S;case"biometrics_unavailable":case"device_hardware_error":case"biometrics_not_available":return new E;case"key_invalidated":case"no_biometric_key":return new C;case"no_biometrics_enrolled":return new T;case"keystore_unavailable":return new P;case"device_credentials_not_allowed":return new x;case"user_cancellation":return new O;case"user_locked_out":return new A;case"google_onetap_missing_id_token":case"oauth_apple_missing_id_token":case"missing_authorization_credential_id_token":return new D;case"google_onetap_missing_member":case"oauth_apple_credential_invalid":case"invalid_authorization_credential":return new z;case"missing_public_key":return new I;case"challenge_signing_failed":return new R;case"no_credentials_present":return new M;case"sdk_not_configured":return new L;case"failed_code_challenge":return new B;case"passkeys_unsupported":return new N;case"failed_to_decrypt_data":return new U;case"biometrics_failed":return new F;case"invalid_start_url":return new q;case"invalid_redirect_scheme":return new H;case"missing_url":return new K;case"invalid_credential_type":return new j;case"missing_attestation_object":return new $;case"json_data_not_convertible_to_string":return new V;case"random_number_generation_failed":return new W;case"passkeys_invalid_encoding":return new G;case"passkeys_misconfigured":return new Y;case"signinwithapple_misconfigured":return new Z;case"missing_cipher_iv":return new J;case"invalid_private_key_length":return new Q;case"biometric_registration_id_is_null_or_blank":return new X;case"dfp_not_configured":return new ee;default:return new k(e)}},e.iconsBlack={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49q-.35-.03-1.04-.03c-1.48 0-2.05.55-2.05 2V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#000",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#000",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#000",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#000",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#000",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#000",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#000",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#000",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#000",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.iconsWhite={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49Q13.83 7 13.14 7c-1.48 0-2.05.56-2.05 2.02V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#fff",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#fff",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#fff",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#fff",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#fff",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#fff",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#fff",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#fff",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#fff",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.mount=lj,e.mountIdentityProvider=lH,e.parseOAuthAuthorizeParams=ly,e.parseOAuthLogoutParams=lv,e.shadcnTheme=cc,e}({});
63
+ https://www.npmjs.com/package/stytch.`)}}),lW="bootstrap",lG=()=>({displayWatermark:!1,projectName:null,cnameDomain:null,emailDomains:["stytch.com"],captchaSettings:{enabled:!1},pkceRequiredForEmailMagicLinks:!1,pkceRequiredForPasswordResets:!1,pkceRequiredForOAuth:!1,pkceRequiredForSso:!1,slugPattern:null,createOrganizationEnabled:!1,passwordConfig:null,runDFPProtectedAuth:!1,rbacPolicy:null,siweRequiredForCryptoWallets:!1,vertical:null});class lY{_publicToken;_networkClient;_dataLayer;_bootstrapDataPromise;constructor(e,t,r){this._publicToken=e,this._networkClient=t,this._dataLayer=r,this._bootstrapDataPromise=this._networkClient.fetchSDK({url:`/projects/bootstrap/${this._publicToken}`,method:"GET"}).then(lY.mapBootstrapData).then(e=>(this._dataLayer.setItem(lW,JSON.stringify(e)),e)).catch(e=>(eP(e),lG()))}static mapBootstrapData(e){let t=null!==e.password_config?{ludsComplexity:e.password_config.luds_complexity,ludsMinimumCount:e.password_config.luds_minimum_count}:null;return{projectName:e.project_name,displayWatermark:!e.disable_sdk_watermark,captchaSettings:e.captcha_settings,cnameDomain:e.cname_domain,emailDomains:e.email_domains,pkceRequiredForEmailMagicLinks:e.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:e.pkce_required_for_password_resets,pkceRequiredForOAuth:e.pkce_required_for_oauth,pkceRequiredForSso:e.pkce_required_for_sso,slugPattern:e.slug_pattern,createOrganizationEnabled:e.create_organization_enabled,passwordConfig:t,runDFPProtectedAuth:e.dfp_protected_auth_enabled??!1,dfpProtectedAuthMode:e.dfp_protected_auth_mode,rbacPolicy:e.rbac_policy??null,siweRequiredForCryptoWallets:e.siwe_required_for_crypto_wallets,vertical:e.vertical}}getSync(){let e=this._dataLayer.getItem(lW);if(null===e)return lG();try{return JSON.parse(e)}catch{return lG()}}getAsync(){return this._bootstrapDataPromise}}class lZ{bootstrapPromise;state;constructor(e){this.bootstrapPromise=e,this.state=e.then(async e=>{let t;return e.captchaSettings.enabled?{configured:!0,captchaClient:await (t=e.captchaSettings.siteKey,eD(`https://www.google.com/recaptcha/enterprise.js?render=${t}`,()=>window.grecaptcha.enterprise)),siteKey:e.captchaSettings.siteKey}:{configured:!1}})}executeRecaptcha=async()=>{let{captchaClient:e,configured:t,siteKey:r}=await this.state;if(t)return await new Promise(t=>e.ready(t)),e.execute(r,{action:"LOGIN"})}}class lJ{iframeURL;_frameClient;constructor(e){this.iframeURL=e}get frameClient(){return this._frameClient=this._frameClient??new e0(this.iframeURL),this._frameClient}call(e,t){return this.frameClient.call(e,[t])}oneTapStart=e=>this.call("oneTapStart",e);oneTapSubmit=e=>this.call("oneTapSubmit",e);parsedPhoneNumber=e=>this.call("parsedPhoneNumber",e);getExamplePhoneNumber=e=>this.call("getExamplePhoneNumber",e)}class lQ{_publicToken;_subscriptionDataLayer;additionalTelemetryDataFn;eventLogger;baseURL;constructor(e,t,r,n,a){this._publicToken=e,this._subscriptionDataLayer=t,this.additionalTelemetryDataFn=a,this.baseURL=r,(e=>e.includes("public-token-test"))(e)&&(this.baseURL=n),this.eventLogger=new eR({maxBatchSize:15,intervalDurationMs:800,logEventURL:this.buildSDKUrl("/events")})}updateSessionToken=()=>null;logEvent({name:e,details:t,error:r={}}){this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:e,details:t,error_code:r.error_code,error_description:r.error_description,http_status_code:r.http_status_code})}createTelemetryBlob(){return{event_id:`event-id-${ek()}`,app_session_id:`app-session-id-${ek()}`,persistent_id:`persistent-id-${ek()}`,client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.additionalTelemetryDataFn(),app:{identifier:window.location.hostname},sdk:{identifier:"Stytch.js Javascript SDK",version:"0.0.0"}}}async fetchSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return eg({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async submitFormSDK({url:e,body:t,method:r}){let n=this._subscriptionDataLayer.readSessionCookie().session_token,a="Basic "+window.btoa(this._publicToken+":"+(n||this._publicToken)),o=window.btoa(JSON.stringify(this.createTelemetryBlob())),i=window.location.origin;return ef({basicAuthHeader:a,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:o,xSDKParentHostHeader:i})}async retriableFetchSDK({url:e,body:t,method:r,retryCallback:n}){let a=this._subscriptionDataLayer.readSessionCookie().session_token,o="Basic "+window.btoa(this._publicToken+":"+(a||this._publicToken)),i=window.btoa(JSON.stringify(this.createTelemetryBlob())),s=window.location.origin;return e_({basicAuthHeader:o,body:t,finalURL:this.buildSDKUrl(e),method:r,xSDKClientHeader:i,xSDKParentHostHeader:s,retryCallback:n})}buildSDKUrl(e){return`${this.baseURL}/sdk/v1${e}`}}function lX(e){let t=e.toString(16);return 1===t.length&&(t="0"+t),t}class l1{_dataLayer;namespace;constructor(e,t){this._dataLayer=e,this.namespace=t}key(){return`PKCE_VERIFIER:${this.namespace}`}async startPKCETransaction(){let e=await l1.createProofkeyPair();return this._dataLayer.setItem(this.key(),JSON.stringify(e)),e}getPKPair(){let e=this._dataLayer.getItem(this.key());if(null!==e)try{return JSON.parse(e)}catch{eC("Found malformed Proof Key pair in localstorage.");return}}clearPKPair(){return this._dataLayer.removeItem(this.key())}static async createProofkeyPair(){var e;let t=new Uint32Array(16);window.crypto.getRandomValues(t);let r=Array.from(t).map(lX).join("");return{code_challenge:(e=await window.crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)),btoa(String.fromCharCode.call(null,...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")),code_verifier:r}}}function l0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var l2=function e(t,r){function n(e,n,a){if("u">typeof document){"number"==typeof(a=l0({},r,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in a)a[i]&&(o+="; "+i,!0!==a[i]&&(o+="="+a[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+o}}return Object.create({set:n,get:function(e){if("u">typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},a=0;a<r.length;a++){var o=r[a].split("="),i=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=t.read(i,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",l0({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,l0({},this.attributes,t))},withConverter:function(t){return e(l0({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});let l3="seen_domains";class l4{publicToken;state;_opaqueTokenCookieName=null;_jwtCookieName=null;_cookiePath=null;_domain=null;_cookieAvailableToSubdomains=!1;_istCookieName=null;subscriptions;_localStorage;browserSessionStorage;constructor(e,t){let r;this.publicToken=e,this.state=null,this.subscriptions={},this._localStorage=oj(oH,e),this.browserSessionStorage=oj(oK,e),t?.cookieOptions&&(this._opaqueTokenCookieName=t.cookieOptions.opaqueTokenCookieName||null,this._jwtCookieName=t.cookieOptions.jwtCookieName||null,this._cookiePath=t.cookieOptions.path||null,this._domain=t.cookieOptions.domain||null,this._cookieAvailableToSubdomains=t.cookieOptions.availableToSubdomains||!1,this._istCookieName=t.cookieOptions.istCookieName||null);const n=this._localStorage.getItem("");if(!n)return;try{r=JSON.parse(n)}catch{this.syncToLocalStorage();return}this.state=r}get opaqueTokenCookieName(){return this._opaqueTokenCookieName??"stytch_session"}get jwtCookieName(){return this._jwtCookieName??"stytch_session_jwt"}get istCookieName(){return this._istCookieName??"stytch_intermediate_session_token"}readSessionCookie(){return{session_token:l2.get(this.opaqueTokenCookieName),session_jwt:l2.get(this.jwtCookieName)}}readIntermediateSessionTokenCookie(){return l2.get(this.istCookieName)}writeSessionCookie(e){let{state:t,session_token:r,session_jwt:n}=e,a=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});a.domain&&this.addSeenDomain(a.domain),l2.set(this.opaqueTokenCookieName,r,a),l2.set(this.jwtCookieName,n,a);let o=l4.generateCookieOpts({expiresAt:t?.session?.expires_at??"",availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});o.domain&&this.addSeenDomain(o.domain),n8(this.jwtCookieName)&&l2.remove(this.jwtCookieName,o),n8(this.opaqueTokenCookieName)&&l2.remove(this.opaqueTokenCookieName,o),n8(this.jwtCookieName)&&eC("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."),n8(this.opaqueTokenCookieName)&&eC("Could not remove extraneous opaque token cookie.")}writeIntermediateSessionTokenCookie(e){let t=new Date(Date.now()+6e5),r=l4.generateCookieOpts({expiresAt:t.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});l2.set(this.istCookieName,e,r)}removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName])}removeISTCookie(){this.removeCookies([this.istCookieName])}removeCookies(e){let t=this.getSeenDomains(),r=[...new Set([this._domain,null,...t])];[!0,!1].forEach(t=>{[this._cookiePath,null].forEach(n=>{r.forEach(r=>{let a=l4.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:t,path:n,domain:r});e.forEach(e=>{l2.remove(e,a)})})})})}syncToLocalStorage(){this._localStorage.setItem("",JSON.stringify(this.state))}getItem(e){return this._localStorage.getItem(e)}setItem(e,t){this._localStorage.setItem(e,t)}removeItem(e){this._localStorage.removeItem(e)}getSeenDomains(){let e=this.getItem(l3);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}addSeenDomain(e){if(!e)return;let t=this.getSeenDomains();t.includes(e)||(t.push(e),this.setItem(l3,JSON.stringify(t)))}static generateCookieOpts({path:e,domain:t,availableToSubdomains:r,expiresAt:n}){let a={expires:new Date(n),sameSite:"lax"};return e&&(a.path=e),"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)?a.secure=!1:(r&&(a.domain=t||window.location.host),a.secure=!0),a}}class l5 extends l4{}let l8=Symbol.for("__stytch_b2b_DataLayer"),l6=(e,t)=>{Object.values(e).forEach(e=>e(t))},l7=(({KEYS_TO_EXCLUDE:e=[]}={})=>{let t=(r,n)=>typeof r==typeof n&&(null===r||null===n?r===n:"object"==typeof r?!(Object.keys(r).length!==Object.keys(n).length||Object.keys(r).some(e=>!(e in n)))&&Object.entries(r).filter(([t])=>!e.includes(t)).every(([e,r])=>t(r,n[e])):r===n);return t})({KEYS_TO_EXCLUDE:["last_accessed_at"]});class l9{_publicToken;_datalayer;fromCache=!0;constructor(e,t,{usingCustomApiEndpoint:r}){if(this._publicToken=e,this._datalayer=t,window.addEventListener("storage",this._listen),!r){const{session_token:e}=this._datalayer.readSessionCookie();if(!e)return void this.destroySession()}}_listen=e=>{if(e.key!==oF(this._publicToken,""))return;let t=null===e.newValue||"null"===e.newValue?null:JSON.parse(e.newValue);this.updateState(t,!0)};getTokens(){let{session_token:e,session_jwt:t}=this._datalayer.readSessionCookie();return"string"!=typeof e||"string"!=typeof t?null:{session_token:e,session_jwt:t}}getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null}destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null})}destroySession(){this._datalayer.removeSessionCookie(),this.updateState(null)}_updateStateAndTokensInternal(e,t){let r=this._datalayer.state,n=null===e.state?null:{...this._datalayer.state,...e.state};this._datalayer.state=n;let a=this.getFromCache();if(this.setCacheRefreshed(),a||!l7(r,n)){let e;e=null==n||t.fromCache?n:{...n,sessionDurationMinutes:t.sessionDurationMinutes},l6(this._datalayer.subscriptions,e)}}updateStateAndTokens(e,t={fromCache:!1}){e.state?("string"==typeof e.session_token?this._datalayer.writeSessionCookie(e):this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()):e.intermediate_session_token?("string"==typeof e.intermediate_session_token?this._datalayer.writeIntermediateSessionTokenCookie(e.intermediate_session_token):this._datalayer.removeISTCookie(),this._datalayer.removeSessionCookie()):(this._datalayer.removeSessionCookie(),this._datalayer.removeISTCookie()),this._updateStateAndTokensInternal(e,t),this._datalayer.syncToLocalStorage()}updateState(e,t=!1){let r=this._datalayer.state,n=null===e?null:{...this._datalayer.state,...e};this._datalayer.state=n;let a=this.getFromCache();this.setCacheRefreshed();let o=!l7(r,n);(a||o)&&(l6(this._datalayer.subscriptions,n),o&&!t&&this._datalayer.syncToLocalStorage())}updateTokens(e){let{session_token:t,session_jwt:r}=e,n={...this._datalayer.readSessionCookie(),session_token:t,session_jwt:r};"string"==typeof t||"string"==typeof r?(this._datalayer.writeSessionCookie(n),this._datalayer.removeISTCookie()):this._datalayer.removeSessionCookie()}subscribeToState(e){var t;let r;return t=this._datalayer.subscriptions,t[r=Math.random().toString(36).slice(-10)]=e,()=>delete t[r]}getState(){return this._datalayer.state}destroy(){window.removeEventListener("storage",this._listen)}syncFromDeviceStorage(){return null}getFromCache(){return this.fromCache}setCacheRefreshed(){this.fromCache=!1}}class ce extends l9{updateMember=e=>this.updateState({member:e});getMember=()=>this.getState()?.member??null;updateOrganization=e=>this.updateState({organization:e});getOrganization=()=>this.getState()?.organization??null;getSession=()=>this.getState()?.session??null;updateSession=(e,t)=>{if("member_session"in e&&e.member_session){let r=e.session_token&&e.session_jwt?{session_token:e.session_token,session_jwt:e.session_jwt}:{session_token:!0,session_jwt:!0};this.updateStateAndTokens({state:{session:e.member_session,member:e.member,organization:e.organization},...r,intermediate_session_token:null},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})}else this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:e.intermediate_session_token||!0},{fromCache:!1,sessionDurationMinutes:t?.sessionDurationMinutes})};withUpdateSession=e=>async t=>{let r=await e(t);return this.updateSession(r,{sessionDurationMinutes:t?.session_duration_minutes}),r}}class ct extends eH{_oneTap;constructor(e,t,r,n,a,o=eM(),i){super(e,t,r,n,a,o),this._oneTap=i}startOneTapDiscovery=async e=>{let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnDiscoverySuccessHandler({discoveryRedirectUrl:e.discovery_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};startOneTap=async e=>{if(!e.organization_id)throw new h("stytch.oauth.googleOneTap.start","organization_id is a required argument");let t=await this._oneTap.createOneTapClient();if(!t.success)throw Error(`One Tap could not load: ${t.reason}`);let{client:r}=t,n=this._oneTap.createOnSuccessHandler({organizationId:e.organization_id,signupRedirectUrl:e.signup_redirect_url,loginRedirectUrl:e.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return r.render({style:{position:er.floating},callback:n,cancelOnTapOutside:e.cancel_on_tap_outside})};googleOneTap={discovery:{start:this.startOneTapDiscovery},start:this.startOneTap}}let cr="u">typeof window&&"IdentityCredential"in window,cn=e=>e===er.forceLegacyEmbedded?"force":e===er.embeddedOnly||e===er.embedded||e===er.floatingOrEmbedded;class ca{_googleClient;_clientId;constructor(e,t){this._googleClient=e,this._clientId=t}cancel(){this._googleClient.cancel()}async render({callback:e,onOneTapCancelled:t,style:r,cancelOnTapOutside:n=!0}){let a,o=cn(r.position),i="force"===(a=cn(r.position))||a&&!cr,s={client_id:this._clientId,callback:e,auto_select:!1,context:"use",itp_support:!0,use_fedcm_for_prompt:"force"!==o,cancel_on_tap_outside:n};return i&&(s.prompt_parent_id="google-parent-prompt",s.cancel_on_tap_outside=!1),this._googleClient.initialize(s),new Promise(e=>{this._googleClient.prompt(r=>{if(r.isSkippedMoment()){let n=r.getSkippedReason?.()??"unknown_reason";return"user_cancel"===n&&t?.(),e({success:!1,reason:n})}return!r.isNotDisplayed&&i||r.isNotDisplayed?.()?e({success:!1,reason:r.getNotDisplayedReason?.()??"unknown_reason"}):r.isDismissedMoment()?void 0:(this.styleFrame(i),e({success:!0}))})})}styleFrame(e){e&&Array.from(document.getElementsByTagName("iframe")).forEach(e=>{e.src.includes(a)&&(e.style.width="100%")})}}let co=Promise.resolve({pkceRequiredForOAuth:!1});class ci{_networkClient;_pkceManager;_config;googleClientID;constructor(e,t,r=co){this._networkClient=e,this._pkceManager=t,this._config=r}async fetchGoogleStart(){if(this.googleClientID)return this.googleClientID;let e=await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/start",method:"GET"});return this.googleClientID=e.google_client_id,this.googleClientID}async submitGoogleOneTapTokenDiscovery({credential:e,discoveryRedirectUrl:t}){let r,{pkceRequiredForOAuth:n}=await this._config;return n?r=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/discovery/submit",method:"POST",body:{id_token:e,discovery_redirect_url:t,pkce_code_challenge:r}})}async submitGoogleOneTapToken({credential:e,organizationId:t,signupRedirectUrl:r,loginRedirectUrl:n}){let a,{pkceRequiredForOAuth:o}=await this._config;return o?a=(await this._pkceManager.startPKCETransaction()).code_challenge:this._pkceManager.clearPKPair(),await this._networkClient.fetchSDK({url:"/b2b/oauth/google/onetap/submit",method:"POST",body:{id_token:e,organization_id:t,signup_redirect_url:r,login_redirect_url:n,pkce_code_challenge:a}})}async createOneTapClient(){let e;try{e=await this.fetchGoogleStart()}catch(e){return{success:!1,reason:v.from(e).error_type}}return""===e?{success:!1,reason:"oauth_config_not_found"}:{success:!0,client:new ca(await eD(o,()=>window.google.accounts.id),e)}}createOnDiscoverySuccessHandler=({discoveryRedirectUrl:e,onSuccess:t,onError:r})=>async n=>{let{credential:a}=n,o=this.submitGoogleOneTapTokenDiscovery({credential:a,discoveryRedirectUrl:e}).then(e=>t(e.redirect_url));r&&(o=o.catch(e=>r(e))),await o};createOnSuccessHandler=({organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r,onSuccess:n,onError:a})=>async o=>{let{credential:i}=o,s=this.submitGoogleOneTapToken({credential:i,organizationId:e,signupRedirectUrl:t,loginRedirectUrl:r}).then(e=>n(e.redirect_url));a&&(s=s.catch(e=>a(e))),await s};redirectOnSuccess=e=>{window.location.href=e}}class cs{_subscriptionService;_sessionManager;_networkClient;_dataLayer;_stateChangeClient;magicLinks;session;member;self;organization;oauth;sso;discovery;passwords;otps;totp;recoveryCodes;rbac;scim;impersonation;idp;onStateChange;parseAuthenticateUrl;authenticateByUrl;constructor(e,t){if("u"<typeof window)throw Error("`new StytchB2BClient()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `createStytchB2BClient()` instead.");(e=>{"string"!=typeof e?eC(`Public token is malformed. Expected a string, got ${typeof e}.${eO}`):""===e?eC(`Public token is malformed. Expected "public-token-...", got an empty string.${eO}`):e.startsWith("public-token-")||eC(`Public token is malformed. Expected "public-token-...", got ${e}.${eO}`)})(e);const r=e??"",n=((e,t={})=>{let{cookieOptions:r,keepSessionAlive:n}=t;return eL(e,t,{keepSessionAlive:"optionalBoolean"}),r&&eL(`${e}.cookieOptions`,r,{opaqueTokenCookieName:"optionalString",jwtCookieName:"optionalString",istCookieName:"optionalString",path:"optionalString",domain:"optionalString"}),{cookieOptions:r,keepSessionAlive:n,endpoints:{testAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.testApiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"testApiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.testAPIURL??"https://test.stytch.com"})(t),liveAPIURL:(e=>{let t=e?.customBaseUrl??e?.endpointOptions?.apiDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.customBaseUrl?"customBaseUrl":"apiDomain";eC(`Unable to use custom API domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.liveAPIURL??"https://api.stytch.com"})(t),dfpBackendURL:(e=>{let t=e?.dfppaUrl??e?.endpointOptions?.dfppaDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfppaUrl?"dfppaUrl":"dfppaDomain";eC(`Unable to use custom DFPPA domain \`${t}\`. ${r} should be a valid domain.`)}}return e?.endpoints?.dfpBackendURL??"https://telemetry.stytch.com"})(t),dfpCdnURL:(e=>{let t=e?.dfpCdnUrl??e?.endpointOptions?.dfpCdnDomain;if(t){let r=eS(t);if(r)return r;{let r=e?.dfpCdnUrl?"dfpCdnUrl":"dfpCdnDomain";eC(`Unable to use custom DFP CDN domain \`${t}\`. ${r} should be a valid domain.`)}}return"https://elements.stytch.com"})(t),clientsideServicesIframeURL:t?.endpoints?.clientsideServicesIframeURL??"https://js.stytch.com/clientside-services/index.html"}}})(this.constructor.name,t),a=((e,t={})=>{let{customBaseUrl:r,endpointOptions:n}=t;return e.includes("public-token-test")?!!(r||n?.testApiDomain):!!(r||n?.apiDomain)})(r,t);this._dataLayer=((e,t)=>{let r,n=((r=window)[l8]||(r[l8]={}),r[l8]);return n[e]||(n[e]=new l5(e,t)),n[e]})(r,n),this._subscriptionService=new ce(r,this._dataLayer,{usingCustomApiEndpoint:a}),this._stateChangeClient=new e5(this._subscriptionService,{}),this.onStateChange=(...e)=>this._stateChangeClient.onStateChange(...e);const o=()=>({stytch_member_id:this._dataLayer.state?.member?.member_id,stytch_member_session_id:this._dataLayer.state?.session?.member_session_id}),i=new l1(this._dataLayer,"passwords"),s=new lQ(r,this._dataLayer,n.endpoints.liveAPIURL,n.endpoints.testAPIURL,o);this._networkClient=s;const l=new lY(r,s,this._dataLayer),c=new lZ(l.getAsync()),d=new ez(r,n.endpoints.dfpBackendURL,n.endpoints.dfpCdnURL,l.getAsync(),c.executeRecaptcha),u=new lJ(n.endpoints.clientsideServicesIframeURL),h=new l1(this._dataLayer,"oauth"),m=new ci(s,h,l.getAsync());this.organization=new eK(s,s,this._subscriptionService),this.member=new eJ(s,s,this._subscriptionService),this.self=new eJ(s,s,this._subscriptionService),this.session=new eQ(s,this._subscriptionService),this.magicLinks=new eq(s,this._subscriptionService,new l1(this._dataLayer,"magic_links"),i,l.getAsync(),d),this.oauth=new ct(s,this._subscriptionService,h,l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d,m),this.sso=new eX(s,this._subscriptionService,new l1(this._dataLayer,"sso"),l.getAsync(),{publicToken:r,testAPIURL:n.endpoints.testAPIURL,liveAPIURL:n.endpoints.liveAPIURL},d),this.discovery=new eB(s,this._subscriptionService),this.passwords=new eV(s,this._subscriptionService,i,l.getAsync(),d),this.otps=new ej(s,this._subscriptionService,d),this.totp=new e1(s,this._subscriptionService,d),this.recoveryCodes=new eY(s,this._subscriptionService,d),this.rbac=new eG(l.getSync(),l.getAsync(),this._subscriptionService),this.scim=new eZ(this._networkClient,this._subscriptionService),this.impersonation=new eU(this._networkClient,this._subscriptionService,d),this.idp=new eN(s),this._sessionManager=new e4(this._subscriptionService,this.session,r,{keepSessionAlive:n.keepSessionAlive});const p=new e2(s,d);(a||this._dataLayer.readSessionCookie().session_token)&&this._sessionManager.performBackgroundRefresh();const{authenticateByUrl:_,parseAuthenticateUrl:g}=(e=>{let t=Object.keys(e),r=(e=window.location.href)=>{let r=new URL(e),n=r.searchParams.get("stytch_token_type"),a=r.searchParams.get("token");return a&&n?t.includes(n)?{handled:!0,token:a,tokenType:n}:{handled:!1,token:a,tokenType:n}:null};return{authenticateByUrl:async({clearParams:t,...n},a=window.location.href)=>{let o=t??a===window.location.href,i=r(a);if(null==i)return null;if(!i.handled)return i;let{token:s,tokenType:l}=i,c=e[l];try{let e=await c(s,n);return{handled:!0,tokenType:l,data:e}}finally{o&&sy()}},parseAuthenticateUrl:r}})({discovery:e=>this.magicLinks.discovery.authenticate({discovery_magic_links_token:e}),discovery_oauth:e=>this.oauth.discovery.authenticate({discovery_oauth_token:e}),oauth:(e,t)=>this.oauth.authenticate({oauth_token:e,...t}),sso:(e,t)=>this.sso.authenticate({sso_token:e,...t}),multi_tenant_magic_links:(e,t)=>this.magicLinks.authenticate({magic_links_token:e,...t}),multi_tenant_impersonation:e=>this.impersonation.authenticate({impersonation_token:e})});this.authenticateByUrl=_,this.parseAuthenticateUrl=g,s.logEvent({name:"b2b_sdk_instance_instantiated",details:{event_callback_registered:!1,error_callback_registered:!1,success_callback_registered:!1}}),l.getAsync().then(e=>{"CONSUMER"===e.vertical&&eP("This application is using a Stytch client for B2B projects, but the public token is for a Stytch Consumer project. Use a Consumer Stytch client instead, or verify that the public token is correct.")}),((e,t)=>{Object.assign(e,{[rX]:t})})(this,{bootstrap:l,clientsideServices:u,publicToken:r,searchManager:p,dataLayer:this._dataLayer,networkClient:s,oneTap:m})}}let cl=(...e)=>"u"<typeof window?lV("stytch"):new cs(...e),cc={"color-scheme":"shadcn","font-family":`var(--font-sans, ${nL["font-family"]})`,"font-family-mono":`var(--font-mono, ${nL["font-family-mono"]})`,"text-base":"var(--text-base)","transition-duration":nL["transition-duration"],spacing:"var(--spacing)","mobile-breakpoint":"var(--breakpoint-sm)","rounded-base":"calc(var(--radius) / 2.5)","container-width":nL["container-width"],"container-radius":"var(--radius-xl)",shadow:"var(--shadow)",background:"var(--background)",foreground:"var(--foreground)",primary:"var(--primary)","primary-foreground":"var(--primary-foreground)",secondary:"var(--secondary)","secondary-foreground":"var(--secondary-foreground)",muted:"var(--muted)","muted-foreground":"var(--muted-foreground)",accent:"var(--accent)","accent-foreground":"var(--accent-foreground)",border:"var(--border)",input:"var(--input)",ring:"var(--ring)",destructive:"var(--destructive)","destructive-foreground":nL["destructive-foreground"],success:nB.success,warning:nB.warning};return e.AuthFlowType=s,e.B2BMFAProducts=d,e.B2BOAuthProviders=c,e.B2BProducts=sL,e.BiometricRegistrationIdIsNullOrBlank=X,e.BiometricsAlreadyEnrolledError=class extends b{constructor(){super("BiometricsAlreadyEnrolledError","There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.")}},e.BiometricsFailedError=F,e.BiometricsUnavailableError=E,e.ChallengeSigningFailedError=R,e.DFPNotConfigured=ee,e.DeviceCredentialsNotAllowedError=x,e.FailedCodeChallengeError=B,e.FailedToDecryptDataError=U,e.IDPOAuthFlowMissingParamError=et,e.InternalError=k,e.InvalidAuthorizationCredentialError=z,e.InvalidCredentialTypeError=j,e.InvalidPrivateKeyLength=Q,e.InvalidRedirectSchemeError=H,e.InvalidStartUrlError=q,e.JSONDataNotConvertibleToStringError=V,e.KeyInvalidatedError=C,e.KeystoreUnavailableError=P,e.MissingAttestationObjectError=$,e.MissingAuthorizationCredentialIDTokenError=D,e.MissingCipherIv=J,e.MissingGoogleClientIDError=class extends b{constructor(){super("MissingGoogleClientIDError","No Google client ID was found in the project.")}},e.MissingPKCEError=class extends b{constructor(){super("MissingPKCEError","Make sure this flow is completed on the same device on which it was started.")}},e.MissingPublicKeyError=I,e.MissingUrlError=K,e.NoBiometricsEnrolledError=T,e.NoBiometricsRegistrationError=S,e.NoCredentialsPresentError=M,e.NoCurrentSessionError=w,e.OAuthProviders={Google:"google",Microsoft:"microsoft",Apple:"apple",Github:"github",GitLab:"gitlab",Facebook:"facebook",Discord:"discord",Salesforce:"salesforce",Slack:"slack",Amazon:"amazon",Bitbucket:"bitbucket",LinkedIn:"linkedin",Coinbase:"coinbase",Twitch:"twitch",Twitter:"twitter",TikTok:"tiktok",Snapchat:"snapchat",Figma:"figma",Yahoo:"yahoo"},e.OTPMethods={SMS:"sms",WhatsApp:"whatsapp",Email:"email"},e.OneTapPositions=er,e.PasskeysInvalidEncoding=G,e.PasskeysMisconfigured=Y,e.PasskeysUnsupportedError=N,e.RNUIProducts=eh,e.RandomNumberGenerationFailed=W,e.RedirectURLType=l,e.SDKAPIUnreachableError=u,e.SDKNotConfiguredError=L,e.SignInWithAppleMisconfigured=Z,e.StytchAPIError=v,e.StytchAPISchemaError=y,e.StytchAPIUnreachableError=f,e.StytchB2B=lK,e.StytchB2BClient=cs,e.StytchB2BHeadlessClient=cs,e.StytchB2BIdentityProvider=lq,e.StytchB2BUIClient=class extends cs{constructor(e,t){super(e,t),eC("StytchB2BUIClient is deprecated. Use the Stytch web components directly instead.")}mount=lj;mountIdentityProvider=lH},e.StytchError=g,e.StytchEventType=eu,e.StytchSDKAPIError=p,e.StytchSDKError=b,e.StytchSDKSchemaError=m,e.StytchSDKUsageError=h,e.UNRECOVERABLE_ERROR_TYPES=_,e.UserCancellationError=O,e.UserLockedOutError=A,e.Wallets={Phantom:"Phantom",Metamask:"Metamask",Coinbase:"Coinbase",Binance:"Binance",GenericEthereumWallet:"GenericEthereumWallet",GenericSolanaWallet:"GenericSolanaWallet"},e.createStytchB2BClient=cl,e.createStytchB2BHeadlessClient=cl,e.defaultDarkTheme=nN,e.defaultTheme=nB,e.errorToStytchError=function(e){if(e instanceof b)return e;switch(e.message){case"no_current_session":return new w;case"no_biometrics_registration":return new S;case"biometrics_unavailable":case"device_hardware_error":case"biometrics_not_available":return new E;case"key_invalidated":case"no_biometric_key":return new C;case"no_biometrics_enrolled":return new T;case"keystore_unavailable":return new P;case"device_credentials_not_allowed":return new x;case"user_cancellation":return new O;case"user_locked_out":return new A;case"google_onetap_missing_id_token":case"oauth_apple_missing_id_token":case"missing_authorization_credential_id_token":return new D;case"google_onetap_missing_member":case"oauth_apple_credential_invalid":case"invalid_authorization_credential":return new z;case"missing_public_key":return new I;case"challenge_signing_failed":return new R;case"no_credentials_present":return new M;case"sdk_not_configured":return new L;case"failed_code_challenge":return new B;case"passkeys_unsupported":return new N;case"failed_to_decrypt_data":return new U;case"biometrics_failed":return new F;case"invalid_start_url":return new q;case"invalid_redirect_scheme":return new H;case"missing_url":return new K;case"invalid_credential_type":return new j;case"missing_attestation_object":return new $;case"json_data_not_convertible_to_string":return new V;case"random_number_generation_failed":return new W;case"passkeys_invalid_encoding":return new G;case"passkeys_misconfigured":return new Y;case"signinwithapple_misconfigured":return new Z;case"missing_cipher_iv":return new J;case"invalid_private_key_length":return new Q;case"biometric_registration_id_is_null_or_blank":return new X;case"dfp_not_configured":return new ee;default:return new k(e)}},e.iconsBlack={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49q-.35-.03-1.04-.03c-1.48 0-2.05.55-2.05 2V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#000",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#000",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#000",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#000",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#000",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#000",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#000",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#000",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#000",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#000",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.iconsWhite={amazon:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.5 15.53C9.2 19 4.69 16.1 1.8 14.33c-.19-.1-.5.03-.23.34.97 1.17 4.13 3.98 8.25 3.98s6.59-2.25 6.9-2.64c.3-.4.08-.6-.22-.48m2.04-1.13c-.2-.25-1.19-.3-1.81-.22s-1.57.45-1.49.68c.04.09.13.05.56.01s1.64-.2 1.9.14c.25.33-.4 1.9-.51 2.16s.04.32.25.15.6-.6.85-1.23c.25-.62.4-1.5.25-1.69"}),tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.6 8.46c0 .9.02 1.67-.44 2.47-.37.66-.96 1.06-1.62 1.06-.9 0-1.42-.68-1.42-1.69 0-1.99 1.79-2.35 3.48-2.35zm2.35 5.69a.5.5 0 0 1-.55.05c-.78-.64-.91-.94-1.34-1.55-1.28 1.3-2.19 1.7-3.85 1.7-1.96 0-3.5-1.22-3.5-3.64 0-1.9 1.03-3.19 2.5-3.82 1.26-.56 3.03-.66 4.39-.81v-.3c0-.56.04-1.22-.29-1.7-.28-.43-.83-.6-1.3-.6-.9 0-1.7.45-1.89 1.4-.04.21-.19.42-.4.43l-2.27-.25c-.19-.04-.4-.2-.34-.49C5.63 1.83 8.1 1 10.33 1c1.13 0 2.62.3 3.52 1.16 1.13 1.06 1.02 2.48 1.02 4.02v3.64c0 1.1.46 1.57.88 2.16.16.21.19.47 0 .63-.48.4-1.33 1.13-1.8 1.55z",clipRule:"evenodd"})),apple:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M16.55 7.14c-.1.08-1.86 1.12-1.86 3.43A4 4 0 0 0 17 14.2c0 .06-.35 1.3-1.18 2.56-.74 1.1-1.5 2.21-2.67 2.21s-1.47-.7-2.82-.7c-1.32 0-1.79.73-2.86.73S5.66 17.97 4.8 16.7c-1-1.48-1.8-3.78-1.8-5.96C3 7.25 5.17 5.4 7.31 5.4c1.14 0 2.09.78 2.8.78.68 0 1.74-.83 3.03-.83.5 0 2.26.05 3.41 1.79m-4.02-3.27c.53-.66.91-1.59.91-2.5q0-.22-.03-.37c-.87.03-1.9.6-2.53 1.36-.49.59-.95 1.5-.95 2.44 0 .14.03.28.04.33l.23.02c.78 0 1.76-.54 2.33-1.28"})),bitbucket:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m17.96 9.14-1.34 8.08a.9.9 0 0 1-.93.78H4.3a.9.9 0 0 1-.93-.78L1.02 2.81c-.1-.5.17-.81.64-.81h16.68c.47 0 .73.32.64.8l-.64 3.8c-.09.55-.4.78-.93.78H7.37q-.23 0-.2.26l.79 4.78q.05.18.23.2h3.62q.17-.02.23-.2l.56-3.46c.05-.43.35-.6.75-.6h3.94c.58 0 .76.29.67.78"})),coinbase:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M10.02 14.5a4.5 4.5 0 1 1 4.44-5.25H19a9 9 0 1 0 0 1.5h-4.54a4.5 4.5 0 0 1-4.44 3.75"})),discord:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.53 3q-.26.44-.47.92a15 15 0 0 0-4.12 0q-.21-.47-.48-.92-1.93.3-3.72 1.1a13.8 13.8 0 0 0-2.66 9.72Q3.15 15.28 5.63 16q.56-.72.98-1.5a10 10 0 0 1-1.54-.7l.38-.27c2.88 1.3 6.22 1.3 9.1 0q.19.15.38.27a10 10 0 0 1-1.54.7q.41.8.98 1.5 2.48-.7 4.55-2.18c.38-3.69-.64-6.89-2.67-9.73a15 15 0 0 0-3.71-1.08zm-5.52 8.86c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.9 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72m5.98 0c-.89 0-1.62-.77-1.62-1.72 0-.94.7-1.71 1.62-1.71.91 0 1.63.77 1.62 1.71-.02.95-.72 1.72-1.62 1.72"})),facebook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M19 10a9 9 0 1 0-11.17 8.73v-5.98H5.97V10h1.86V8.81c0-3.06 1.38-4.48 4.39-4.48.57 0 1.55.11 1.96.23v2.49Q13.83 7 13.14 7c-1.48 0-2.05.56-2.05 2.02V10h2.94l-.5 2.75h-2.44v6.18A9 9 0 0 0 19 10"})),figma:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M5.47 7.18A3.4 3.4 0 0 1 4 4.36 3.3 3.3 0 0 1 7.23 1h5.54A3.3 3.3 0 0 1 16 4.36a3.4 3.4 0 0 1-1.47 2.82A3.4 3.4 0 0 1 16 10a3.3 3.3 0 0 1-3.23 3.36h-.06c-.84 0-1.61-.33-2.19-.89v3.14c0 1.87-1.48 3.39-3.27 3.39A3.3 3.3 0 0 1 4 15.64a3.4 3.4 0 0 1 1.47-2.82A3.4 3.4 0 0 1 4 10a3.4 3.4 0 0 1 1.47-2.82M10.52 10c0 1.26.98 2.28 2.19 2.28h.06c1.2 0 2.19-1.02 2.19-2.28s-.98-2.28-2.2-2.28h-.05A2.23 2.23 0 0 0 10.52 10M9.48 7.72H7.23A2.23 2.23 0 0 0 5.04 10c0 1.25.98 2.27 2.18 2.28h2.26zm-2.25 5.64a2.23 2.23 0 0 0-2.19 2.28c0 1.25 1 2.27 2.2 2.27a2.3 2.3 0 0 0 2.24-2.3v-2.25zm2.25-6.72H7.23a2.23 2.23 0 0 1-2.19-2.28c0-1.25.98-2.27 2.2-2.27h2.24zm3.29 0h-2.25V2.09h2.25c1.2 0 2.19 1.02 2.19 2.27 0 1.26-.98 2.28-2.2 2.28",clipRule:"evenodd"})),github:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M9.97 1A9.1 9.1 0 0 0 1 10.23a9.2 9.2 0 0 0 6.14 8.75c.44.1.6-.2.6-.44l-.01-1.71c-2.5.55-3.02-1.1-3.02-1.1-.4-1.07-1-1.35-1-1.35-.8-.56.07-.56.07-.56.9.06 1.38.95 1.38.95.8 1.4 2.1 1 2.61.76.08-.6.32-1 .57-1.24-2-.21-4.09-1-4.09-4.55 0-1 .36-1.83.92-2.48-.08-.22-.4-1.17.1-2.44 0 0 .75-.24 2.46.95a8.5 8.5 0 0 1 4.49 0c1.7-1.2 2.46-.95 2.46-.95.5 1.27.18 2.22.1 2.44.57.65.91 1.47.91 2.48 0 3.54-2.1 4.32-4.1 4.55.33.3.61.84.61 1.71l-.01 2.54c0 .24.16.53.6.44a9.2 9.2 0 0 0 6.14-8.75A9.1 9.1 0 0 0 9.97 1",clipRule:"evenodd"})),gitlab:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m18.7 8.2-.02-.07-2.45-6.4a.64.64 0 0 0-.64-.4.7.7 0 0 0-.37.14q-.16.13-.21.33l-1.66 5.06h-6.7L5 1.8a.64.64 0 0 0-1.22-.07l-2.46 6.4-.02.06a4.55 4.55 0 0 0 1.51 5.26l.03.02 3.73 2.8 1.85 1.4 1.12.85a.8.8 0 0 0 .92 0l1.12-.85 1.85-1.4 3.75-2.81.01-.01a4.55 4.55 0 0 0 1.51-5.26"})),google:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.82 10.2q0-.95-.16-1.84h-8.48v3.49h4.84a4.2 4.2 0 0 1-1.8 2.7v2.27h2.92a8.8 8.8 0 0 0 2.68-6.62"}),tm("path",{fill:"#fff",d:"M10.18 19c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.83.86-3.04.86a5.4 5.4 0 0 1-5.04-3.7h-3v2.32A9 9 0 0 0 10.19 19"}),tm("path",{fill:"#fff",d:"M5.14 11.71a5.4 5.4 0 0 1 0-3.42V5.97h-3a8.9 8.9 0 0 0 0 8.06l2.34-1.81z"}),tm("path",{fill:"#fff",d:"M10.18 4.58q2.01 0 3.44 1.35l2.58-2.58A8.98 8.98 0 0 0 2.14 5.97l3 2.32a5.4 5.4 0 0 1 5.04-3.7"})),linkedin:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M17 1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3c0-1.1.9-2 2-2zM3.76 16.5h2.68V7.83H3.76zm9.59-8.93C11.5 7.57 10.73 9 10.73 9V7.83H8.16v8.67h2.57v-4.55c0-1.22.56-1.94 1.64-1.94.99 0 1.46.7 1.46 1.94v4.55h2.67v-5.49c0-2.32-1.32-3.44-3.15-3.44M5.09 3.5A1.6 1.6 0 0 0 3.5 5.1c0 .88.71 1.6 1.59 1.6a1.6 1.6 0 0 0 1.58-1.6c0-.88-.7-1.6-1.58-1.6",clipRule:"evenodd"})),microsoft:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 1h8.57v8.57H1zM10.43 1H19v8.57h-8.57zM1 10.43h8.57V19H1zM10.43 10.43H19V19h-8.57z"})),salesforce:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M8.49 4.92a3.1 3.1 0 0 1 2.28-1.01c1.2 0 2.22.68 2.78 1.7q.75-.35 1.57-.35c2.14 0 3.88 1.8 3.88 4.04a3.96 3.96 0 0 1-4.65 3.96c-.49.9-1.42 1.5-2.47 1.5q-.65 0-1.25-.3a3.2 3.2 0 0 1-2.97 2.04c-1.4 0-2.58-.9-3.04-2.18q-.3.06-.62.06c-1.66 0-3-1.4-3-3.13 0-1.16.6-2.17 1.5-2.71a4 4 0 0 1-.29-1.44c0-1.99 1.57-3.6 3.5-3.6 1.13 0 2.15.56 2.78 1.42",clipRule:"evenodd"})),slack:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M4.8 12.38a1.89 1.89 0 1 1-1.9-1.9h1.9zm.94 0a1.89 1.89 0 1 1 3.78 0v4.73a1.89 1.89 0 1 1-3.78 0zM7.63 4.78A1.89 1.89 0 1 1 9.52 2.9v1.9zm0 .96a1.89 1.89 0 1 1 0 3.79H2.89a1.89 1.89 0 1 1 0-3.79zM15.2 7.64a1.89 1.89 0 1 1 1.9 1.89h-1.9zm-.94 0a1.89 1.89 0 1 1-3.78 0V2.89a1.89 1.89 0 1 1 3.78 0zM12.37 15.22a1.89 1.89 0 1 1-1.89 1.89v-1.9zm0-.95a1.89 1.89 0 1 1 0-3.78h4.74a1.89 1.89 0 1 1 0 3.78z"})),snapchat:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M18.94 14.1a1.3 1.3 0 0 0-.64-.67l-.14-.07-.24-.13a5.4 5.4 0 0 1-1.97-1.68 4 4 0 0 1-.33-.6q-.06-.16-.01-.23l.1-.12.82-.53q.52-.36.74-.8a1.6 1.6 0 0 0 .08-1.3c-.23-.6-.8-.98-1.5-.98a2 2 0 0 0-.54.08q.01-.64-.04-1.29a4.83 4.83 0 0 0-2.44-3.93A5.6 5.6 0 0 0 10 1.15a5.6 5.6 0 0 0-2.82.72 4.8 4.8 0 0 0-2.44 3.93q-.06.66-.04 1.28a3 3 0 0 0-.55-.08 1.54 1.54 0 0 0-1.6 1.65q.01.33.18.64.23.43.74.8l.42.27.38.25q.08.04.12.12.05.07-.01.24-.14.3-.33.59a5.4 5.4 0 0 1-1.91 1.65c-.43.23-.89.39-1.08.9-.14.4-.05.84.32 1.21q.2.21.46.35.53.3 1.12.45.13.03.23.1c.13.12.12.3.3.55q.13.2.33.34c.37.26.78.27 1.23.3.4 0 .85.02 1.37.2q.3.11.7.36c.61.38 1.46.9 2.88.9s2.27-.52 2.9-.9q.37-.25.68-.36c.52-.17.97-.2 1.37-.2.44-.02.86-.04 1.23-.3q.24-.16.38-.41c.13-.22.13-.37.25-.47l.21-.1a5 5 0 0 0 1.14-.46q.28-.15.48-.37v-.01c.35-.37.44-.8.3-1.18m-1.27.68c-.77.42-1.28.38-1.67.64-.34.21-.14.68-.39.85-.3.21-1.2-.01-2.34.37-.95.31-1.56 1.21-3.27 1.21-1.7 0-2.3-.9-3.27-1.22-1.15-.38-2.04-.15-2.34-.36-.25-.17-.05-.64-.38-.86-.4-.25-.91-.2-1.68-.63-.5-.27-.21-.44-.05-.52 2.79-1.35 3.23-3.43 3.25-3.58.02-.2.05-.34-.16-.53-.2-.18-1.08-.73-1.32-.9-.4-.28-.59-.57-.46-.91.1-.25.32-.34.56-.34l.22.03c.44.1.87.32 1.12.38l.1.01q.19 0 .17-.22c-.03-.49-.1-1.43-.02-2.32.1-1.22.5-1.83.96-2.36A4.3 4.3 0 0 1 10 2.15a4.3 4.3 0 0 1 3.3 1.36c.46.54.86 1.14.96 2.36.08.89.01 1.84-.02 2.33q-.01.23.17.22l.1-.02c.24-.06.68-.28 1.12-.38l.22-.02c.24 0 .46.1.56.33q.17.5-.46.91c-.24.17-1.13.72-1.32.9-.21.2-.18.34-.16.53.02.16.46 2.24 3.25 3.59.17.08.44.25-.05.52"})),tiktok:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M11.38 1.79h2.3A4.42 4.42 0 0 0 18 5.3v.68l.01 2.41a7.6 7.6 0 0 1-4.39-1.38v6.28c0 3.14-2.6 5.7-5.8 5.7a6 6 0 0 1-3.33-1.03A5.7 5.7 0 0 1 2 13.3a5.76 5.76 0 0 1 6.59-5.64v3.16q-.37-.11-.78-.12a2.63 2.63 0 0 0-2.66 2.6c0 1 .58 1.87 1.43 2.3q.55.3 1.23.3c1.42 0 2.59-1.1 2.64-2.5V1h3.16q0 .4.08.79z",clipRule:"evenodd"})),twitch:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M5.63 1 2.5 4.21V15.8h3.75V19l3.13-3.21h2.5L17.5 10V1zm10.62 8.36-2.5 2.57h-2.5l-2.19 2.25v-2.25H6.25V2.29h10z"}),tm("path",{fill:"#fff",d:"M14.38 4.54h-1.26v3.85h1.26zM10.94 4.54H9.69v3.85h1.25z"})),xTwitter:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M11.67 8.62 18.23 1h-1.55l-5.7 6.61L6.44 1H1.2l6.87 10-6.87 8h1.55l6.01-7 4.8 7h5.24zm-2.12 2.47-.7-1-5.54-7.92H5.7l4.47 6.4.7 1 5.8 8.3H14.3z"})),yahoo:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",fillRule:"evenodd",d:"M1 5.74 4.92 15l-1.4 3.33h3.44l5.23-12.6H8.76l-2.13 5.4-2.1-5.4zm9.47 7.24c0 1.16.9 2.1 2.1 2.1 1.25 0 2.19-.98 2.19-2.17 0-1.18-.9-2.11-2.11-2.11-1.25 0-2.18 1-2.18 2.18m4.68-11.31L11.7 9.99h3.85L19 1.67z",clipRule:"evenodd"})),phantom:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M3.13 17.5c2.3 0 4.02-2 5.05-3.58q-.19.53-.2 1.04c0 .92.54 1.58 1.58 1.58 1.44 0 2.97-1.26 3.76-2.62a2 2 0 0 0-.08.55c0 .64.36 1.04 1.1 1.04 2.32 0 4.66-4.12 4.66-7.73 0-2.8-1.42-5.28-4.98-5.28C7.75 2.5 1 10.16 1 15.11c0 1.94 1.04 2.39 2.13 2.39m8.73-10.02c0-.7.39-1.2.96-1.2s.95.5.95 1.2-.4 1.2-.95 1.2c-.57 0-.96-.5-.96-1.2m2.98 0c0-.7.39-1.2.96-1.2.55 0 .94.5.94 1.2s-.38 1.2-.94 1.2c-.57 0-.96-.5-.96-1.2"})),metamask:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("g",{fill:"#fff",clipPath:"url(#a)"},tm("path",{d:"m18.66 14.11-1.06 3.5-3.58-1.03-.28-.09-.41-.12-1.76-.5-.15.01-.06.22 2.17.62-2.57 1.5H9.04l-2.56-1.5 2.16-.62-.06-.22-.15-.02-2.17.63-.28.09-3.57 1.04-1.07-3.5-.34-.14 1.21 3.98 3.9-1.13 2.85 1.67h2.08l2.86-1.67 3.89 1.13L19 13.98z"}),tm("path",{d:"M5.98 14.11v2.47l.28-.09v-2.23l2.17 1.6.15.02.14-.15-2.55-1.9H1.34l1.08-3.95-.26-.14L1 13.98l.34.13zm8.92-2.22-.92.22v.3l1.35-.33.01-2.2h-.19l-.1-.07v1.83l-1.11-1.03h-2.3l-.05.29h2.23z"}),tm("path",{d:"M6.02 12.4v-.29l-.92-.22 1.08-1H8.4l-.05-.28H6.12l-.1.04-1.07.99V9.81l-.1.07h-.2l.02 2.2zm11.56-2.52 1.08 3.95h-4.83l-2.55 1.9.14.15.15-.02 2.17-1.6v2.23l.28.09V14.1h4.64l.34-.13-1.16-4.24z"}),tm("path",{d:"M4.66 9.88h.19l.1-.07 2.97-2 .45 2.8.04.29.7 4.41.25-.1h.02l-1.2-7.64.22-2.24h3.2l.23 2.24-1.21 7.64h.02l.25.1.7-4.41.05-.28.44-2.8 2.97 2 .1.06h2.43l.26-.14L19 6.16 17.78 1.5 11.7 5.05H8.3L2.22 1.5 1 6.16l1.16 3.58.26.14zM18.7 6.15 17.6 9.6h-2.35L12.2 7.55 17.62 2zm-1.84-3.78-4.77 4.88-.2-1.98zm-8.75 2.9-.2 1.98-4.77-4.88zm-6.81.88L2.38 2l5.43 5.55L4.76 9.6H2.4z"}),tm("path",{d:"M10.8 15.21H9.2l-.62.67.3 1.1h2.23l.31-1.1zm.1 1.49H9.1l-.2-.74.41-.46h1.36l.42.46zM8.4 12.82l-.03-.07-.47-1.21H6.62l-.6.57v.3l2.12.5zm-1.67-1h.97l.3.77-1.66-.4zm5.12 1.1 2.12-.52v-.29l-.6-.57h-1.29l-.47 1.2-.03.08zm1.79-.73-1.67.4.3-.77h.98z"})),tm("defs",null,tm("clipPath",{id:"a"},tm("path",{fill:"#fff",d:"M1 1.5h18v17H1z"})))),binance:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"m6.43 8.56 3.5-3.5 3.49 3.5 2.03-2.03L9.92 1 4.4 6.53zM4.99 10 2.96 7.97.92 10l2.04 2.03zM6.43 11.44l3.5 3.5 3.49-3.5 2.03 2.03L9.92 19 4.4 13.47zM16.89 12.03 18.92 10 16.9 7.97 14.85 10z"}),tm("path",{fill:"#fff",d:"M11.99 10 9.92 7.93 8.4 9.46l-.18.18-.36.36 2.06 2.07z"})),gmail:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M1 5.1v1.63l1.88 1.82L5.09 9.8l.41-2.76-.4-2.56-1.15-.86A1.84 1.84 0 0 0 1 5.09M14.9 4.48l-.4 2.6.4 2.72 2.02-1L19 6.73V5.09a1.84 1.84 0 0 0-2.95-1.47z"}),tm("path",{fill:"#fff",d:"M2.23 16.75h2.86V9.8L1 6.73v8.8c0 .67.55 1.22 1.23 1.22M14.9 16.75h2.87c.68 0 1.23-.55 1.23-1.23v-8.8L14.9 9.8zM10 8.16 5.1 4.48V9.8l4.9 3.68 4.9-3.68V4.48z"})),outlook:e=>tm("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none",...e},tm("path",{fill:"#fff",d:"M12.24 4.82v3.52l1.23.77q.06.01.14 0l5.3-3.57c0-.42-.4-.72-.63-.72z"}),tm("path",{fill:"#fff",d:"m12.24 9.65 1.12.77c.16.12.35 0 .35 0l5.2-3.46v6.48c0 .7-.46 1-.97 1h-5.7zM6.43 8.03q-.59 0-.92.54t-.34 1.42q0 .9.34 1.43t.89.52q.56 0 .9-.51.32-.51.33-1.41 0-.95-.33-1.47-.32-.52-.87-.52"}),tm("path",{fill:"#fff",d:"M1.1 3.03V16.8L11.58 19V1zm7.01 9.21q-.66.88-1.73.88-1.04 0-1.7-.85a3.5 3.5 0 0 1-.65-2.2q0-1.44.66-2.33a2.1 2.1 0 0 1 1.77-.89 2 2 0 0 1 1.67.85q.64.85.64 2.24a3.7 3.7 0 0 1-.66 2.3"}))},e.mount=lj,e.mountIdentityProvider=lH,e.parseOAuthAuthorizeParams=ly,e.parseOAuthLogoutParams=lv,e.shadcnTheme=cc,e}({});
64
64
  //# sourceMappingURL=index.js.map