PageSourceSearch

https://www.centerparkstorage.com/_nuxt/648209aa37ce66ed.js

js centerparkstorage.com collected 2026-09-24 14:12:09 UTC 128,848 bytes, 2 lines download raw bytes

vendor: 4,235 bytes, lines 1-2
1/*! For license information please see LICENSES */
2(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{10:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,r){return(e=function(t){var i=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(i)?i:i+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,d=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){d=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(d)throw o}}return a}}(t,e)||function(t,a){if(t){if("string"==typeof t)return d(t,a);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?d(t,a):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,r=Array(a);e<a;e++)r[e]=t[e];return r}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function f(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _(t){var i=function(t,e){if("object"!=l(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==l(i)?i:i+""}function m(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function v(t,e,r){return e=P(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,S()?Reflect.construct(e,r||[],P(t).constructor):e.apply(t,r))}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}function w(t){var e="function"==typeof Map?new Map:void 0;return w=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(S())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var p=new(t.bind.apply(t,n));return r&&k(p,r.prototype),p}(t,arguments,P(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),k(r,t)},w(t)}function S(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(S=function(){return!!t})()}
2function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}var x,O,C,A,E,T,D;r.d(e,"a",(function(){return Ot})),r.d(e,"b",(function(){return B})),r.d(e,"c",(function(){return F})),r.d(e,"d",(function(){return _t})),r.d(e,"e",(function(){return Q})),r.d(e,"f",(function(){return ct})),r.d(e,"g",(function(){return Bt})),r.d(e,"h",(function(){return Pt})),r.d(e,"i",(function(){return $})),r.d(e,"j",(function(){return Et})),r.d(e,"k",(function(){return kt})),r.d(e,"l",(function(){return V})),r.d(e,"m",(function(){return O})),r.d(e,"n",(function(){return x})),r.d(e,"o",(function(){return st})),r.d(e,"p",(function(){return R})),r.d(e,"q",(function(){return T})),r.d(e,"r",(function(){return at})),r.d(e,"s",(function(){return ht})),r.d(e,"t",(function(){return wt})),r.d(e,"u",(function(){return C})),r.d(e,"v",(function(){return tt})),r.d(e,"w",(function(){return X})),r.d(e,"x",(function(){return lt})),r.d(e,"y",(function(){return I})),r.d(e,"z",(function(){return Ct})),r.d(e,"A",(function(){return mt})),r.d(e,"B",(function(){return D})),r.d(e,"C",(function(){return xt})),r.d(e,"D",(function(){return M})),r.d(e,"E",(function(){return ft})),r.d(e,"F",(function(){return At})),r.d(e,"G",(function(){return G})),r.d(e,"H",(function(){return W})),r.d(e,"I",(function(){return U})),r.d(e,"J",(function(){return $t})),r.d(e,"K",(function(){return Pe})),r.d(e,"L",(function(){return pr})),r.d(e,"M",(function(){return cr})),r.d(e,"N",(function(){return Be})),r.d(e,"O",(function(){return He})),r.d(e,"P",(function(){return Ue})),r.d(e,"Q",(function(){return Ye})),r.d(e,"R",(function(){return ze})),r.d(e,"S",(function(){return We})),r.d(e,"T",(function(){return Ve})),r.d(e,"U",(function(){return Xe})),r.d(e,"V",(function(){return Ze})),r.d(e,"W",(function(){return $e})),r.d(e,"X",(function(){return Qe})),r.d(e,"Y",(function(){return er})),r.d(e,"Z",(function(){return Ge})),r.d(e,"ab",(function(){return rr})),r.d(e,"bb",(function(){return nr})),r.d(e,"cb",(function(){return ar})),r.d(e,"db",(function(){return or})),r.d(e,"eb",(function(){return ur})),r.d(e,"fb",(function(){return vr})),r.d(e,"gb",(function(){return L})),r.d(e,"hb",(function(){return N})),r.d(e,"ib",(function(){return j})),r.d(e,"jb",(function(){return z})),r.d(e,"kb",(function(){return nt})),r.d(e,"lb",(function(){return it})),r.d(e,"mb",(function(){return Rt})),r.d(e,"nb",(function(){return _r})),r.d(e,"ob",(function(){return fe})),r.d(e,"pb",(function(){return ir})),r.d(e,"qb",(function(){return je})),r.d(e,"rb",(function(){return Ke})),r.d(e,"sb",(function(){return Me})),r.d(e,"tb",(function(){return Ee})),r.d(e,"ub",(function(){return Te})),r.d(e,"vb",(function(){return De})),r.d(e,"wb",(function(){return oe})),r.d(e,"xb",(function(){return se})),r.d(e,"yb",(function(){return ie})),r.d(e,"zb",(function(){return Ie})),r.d(e,"Ab",(function(){return fr})),r.d(e,"Bb",(function(){return lr})),r.d(e,"Cb",(function(){return qe})),r.d(e,"Db",(function(){return Re})),r.d(e,"Eb",(function(){return Zt})),r.d(e,"Fb",(function(){return E})),r.d(e,"Gb",(function(){return K})),r.d(e,"Hb",(function(){return dr})),r.d(e,"Ib",(function(){return A})),r.d(e,"Jb",(function(){return Y})),r.d(e,"Kb",(function(){return H})),r.d(e,"Lb",(function(){return Ae})),r.d(e,"Mb",(function(){return xe})),r.d(e,"Nb",(function(){return Dt})),r.d(e,"Ob",(function(){return ge})),r.d(e,"Pb",(function(){return et})),r.d(e,"Qb",(function(){return vt})),r.d(e,"Rb",(function(){return Z})),r.d(e,"Sb",(function(){return pt})),r.d(e,"Tb",(function(){return It})),r.d(e,"Ub",(function(){return ot})),r.d(e,"Vb",(function(){return bt})),r.d(e,"Wb",(function(){return J})),r.d(e,"Xb",(function(){return ut})),r.d(e,"Yb",(function(){return St})),r.d(e,"Zb",(function(){return Tt})),r.d(e,"ac",(function(){return gt})),r.d(e,"bc",(function(){return yt})),function(t){t.emailMagicLinks="emailMagicLinks",t.oauth="oauth",t.otp="otp",t.crypto="crypto",t.passwords="passwords",t.passkeys="passkeys"}(x||(x={})),function(t){t.Google="google",t.Microsoft="microsoft",t.Apple="apple",t.Github="github",t.GitLab="gitlab",t.Facebook="facebook",t.Discord="discord",t.Salesforce="salesforce",t.Slack="slack",t.Amazon="amazon",t.Bitbucket="bitbucket",t.LinkedIn="linkedin",t.Coinbase="coinbase",t.Twitch="twitch",t.Twitter="twitter",t.TikTok="tiktok",t.Snapchat="snapchat",t.Figma="figma",t.Yahoo="yahoo"}(O||(O={})),function(t){t.Vessel="Vessel",t.Phantom="Phantom",t.Metamask="Metamask",t.Coinbase="Coinbase",t.Binance="Binance",t.GenericEthereumWallet="Other Ethereum Wallet",t.GenericSolanaWallet="Other Solana Wallet"}(C||(C={})),function(t){t.embedded="embedded",t.floating="floating",t.embeddedOnly="embeddedOnly",t.floatingOrEmbedded="floatingOrEmbedded",t.forceLegacyEmbedded="forceLegacyEmbedded"}(A||(A={})),function(t){t.SMS="sms",t.WhatsApp="whatsapp",t.Email="email"}(E||(E={})),function(t){t.MagicLinkLoginOrCreateEvent="MAGIC_LINK_LOGIN_OR_CREATE",t.OTPsLoginOrCreateEvent="OTP_LOGIN_OR_CREATE",t.OTPsAuthenticate="OTP_AUTHENTICATE",t.CryptoWalletAuthenticateStart="CRYPTO_WALLET_AUTHENTICATE_START",t.CryptoWalletAuthenticate="CRYPTO_WALLET_AUTHENTICATE",t.PasswordCreate="PASSWORD_CREATE",t.PasswordAuthenticate="PASSWORD_AUTHENTICATE",t.PasswordResetByEmailStart="PASSWORD_RESET_BY_EMAIL_START",t.PasswordResetByEmail="PASSWORD_RESET_BY_EMAIL",t.PasskeyRegister="PASSKEY_REGISTER",t.PasskeyAuthenticate="PASSKEY_AUTHENTICATE",t.PasskeySkip="PASSKEY_SKIP",t.PasskeyDone="PASSKEY_DONE",t.AuthenticateFlowComplete="AUTHENTICATE_FLOW_COMPLETE",t.OAuthAuthorizeFlowStart="OAUTH_AUTHORIZE_FLOW_START",t.OAuthAuthorizeFlowComplete="OAUTH_AUTHORIZE_FLOW_COMPLETE",t.OAuthAuthorizeFlowConsentDenied="OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED",t.B2BMagicLinkEmailLoginOrSignup="B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP",t.B2BMagicLinkAuthenticate="B2B_MAGIC_LINK_AUTHENTICATE",t.B2BMagicLinkEmailDiscoverySend="B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND",t.B2BMagicLinkDiscoveryAuthenticate="B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE",t.B2BSSOStart="B2B_SSO_START",t.B2BSSOAuthenticate="B2B_SSO_AUTHENTICATE",t.B2BSSODiscoverConnections="B2B_SSO_DISCOVER_CONNECTIONS",t.B2BOAuthAuthenticate="B2B_OAUTH_AUTHENTICATE",t.B2BOAuthDiscoveryAuthenticate="B2B_OAUTH_DISCOVERY_AUTHENTICATE",t.B2BDiscoveryOrganizationsCreate="B2B_DISCOVERY_ORGANIZATIONS_CREATE",t.B2BDiscoveryIntermediateSessionExchange="B2B_DISCOVERY_INT
2ERMEDIATE_SESSION_EXCHANGE",t.B2BPasswordAuthenticate="B2B_PASSWORD_AUTHENTICATE",t.B2BPasswordDiscoveryAuthenticate="B2B_PASSWORD_DISCOVERY_AUTHENTICATE",t.B2BPasswordResetByEmailStart="B2B_PASSWORD_RESET_BY_EMAIL_START",t.B2BPasswordResetByEmail="B2B_PASSWORD_RESET_BY_EMAIL",t.B2BPasswordResetBySession="B2B_PASSWORD_RESET_BY_SESSION",t.B2BSMSOTPSend="B2B_SMS_OTP_SEND",t.B2BSMSOTPAuthenticate="B2B_SMS_OTP_AUTHENTICATE",t.B2BTOTPCreate="B2B_TOTP_CREATE",t.B2BTOTPAuthenticate="B2B_TOTP_AUTHENTICATE",t.B2BRecoveryCodesRecover="B2B_RECOVERY_CODES_RECOVER",t.B2BPasswordDiscoveryResetStart="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START",t.B2BDiscoveryPasswordReset="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL",t.B2BImpersonationAuthenticate="B2B_IMPERSONATION_AUTHENTICATE",t.B2BOTPsEmailAuthenticate="B2B_OTPS_EMAIL_AUTHENTICATE",t.B2BOTPsEmailDiscoveryAuthenticate="B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE",t.B2BOTPsEmailDiscoverySend="B2B_OTPS_EMAIL_DISCOVERY_SEND",t.B2BOTPsEmailLoginOrSignup="B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP",t.B2BOrganizationsGetBySlug="B2B_ORGANIZATIONS_GET_BY_SLUG"}(T||(T={})),function(t){t[t.emailMagicLinks=0]="emailMagicLinks",t[t.oauth=1]="oauth",t[t.otp=2]="otp",t[t.passwords=3]="passwords"}(D||(D={}));var I,B,R,F,K,M=function(t){function e(t,details){var r;return m(this,e),(r=v(this,e,[t+"\n"+details])).message=t+"\n"+details,r.name="SDKAPIUnreachableError",r.details=details,Object.setPrototypeOf(r,e.prototype),r}return y(e,t),f(e)}(w(Error)),j=function(t){function e(t,r){var n;return m(this,e),(n=v(this,e)).name="StytchSDKUsageError",n.message="Invalid call to ".concat(t,"\n")+r,n}return y(e,t),f(e)}(w(Error)),N=function(t){function e(t){var r,n;m(this,e),(r=v(this,e)).name="StytchSDKSchemaError";var o=null===(n=t.body)||void 0===n?void 0:n.map((function(t){return"".concat(t.dataPath,": ").concat(t.message)})).join("\n");return r.message="[400] Request does not match expected schema\n".concat(o),r}return y(e,t),f(e)}(w(Error)),L=function(t){function e(details){var t;m(this,e),(t=v(this,e)).name="StytchSDKAPIError";var r=details.status_code,n=details.error_type,o=details.error_message,c=details.error_url,d=detail
2s.request_id,l=details.error_details;return t.error_type=n,t.error_message=o,t.error_url=c,t.request_id=d,t.status_code=r,t.error_details=l,t.message="[".concat(r,"] ").concat(n,"\n")+"".concat(o,"\n")+"See ".concat(c," for more information.\n")+(d?"request_id: ".concat(d,"\n"):"")+(t.error_details?"Details: \n"+JSON.stringify(t.error_details)+"\n":""),t}return y(e,t),f(e)}(w(Error)),z=["unauthorized_credentials","user_unauthenticated","invalid_secret_authentication","session_not_found"],U=function(t){function e(t,r){var n;return m(this,e),(n=v(this,e,[r])).name=t,n}return y(e,t),f(e)}(w(Error)),W=function(t){function e(details){var t;return m(this,e),t=v(this,e,["StytchAPIUnreachableError",details]),Object.setPrototypeOf(t,e.prototype),t}return y(e,t),f(e)}(U),G=function(t){function e(t){var r;m(this,e);var n=null===(r=t.body)||void 0===r?void 0:r.map((function(t){return"".concat(t.dataPath,": ").concat(t.message)})).join("\n");return v(this,e,["StytchAPISchemaError","Request does not match expected schema\n".concat(n)])}return y(e,t),f(e)}(U),H=function(t){function e(details){var t;m(this,e);var r=details.status_code,n=details.error_type,o=details.error_message,c=details.error_url,d=detail
2s.request_id,l=details.error_details;return(t=v(this,e,["StytchAPIError","[".concat(r,"] ").concat(n,"\n")+"".concat(o,"\n")+"See ".concat(c," for more information.\n")+(d?"request_id: ".concat(d,"\n"):"")+(l?"Details: \n"+JSON.stringify(l)+"\n":"")])).error_type=n,t.error_message=o,t.error_url=c,t.request_id=d,t.status_code=r,t.error_details=l,t}return y(e,t),f(e,null,[{key:"from",value:function(t){if(t instanceof e)return t;if(t&&"object"===l(t)){var r=t;if("number"==typeof r.status_code&&"string"==typeof r.error_type&&"string"==typeof r.error_message&&"string"==typeof r.error_url)return new e({status_code:r.status_code,error_type:r.error_type,error_message:r.error_message,error_url:r.error_url,request_id:"string"==typeof r.request_id?r.request_id:void 0,error_details:"object"===l(r.error_details)?r.error_details:void 0})}return new e({status_code:400,error_type:"unknown_error",error_message:t instanceof Error?t.message:"Unknown error: "+String(t),error_url:"",request_id:void 0,error_details:void 0})}}])}(U),Y=function(t){function e(t,r,n){var o;return m(this,e),(o=v(this,e,[t,r])).options=n,o}return y(e,t),f(e)}(U),V=function(t){function e(){return m(this,e),v(this,e,["NoCurrentSessionError","There is no session currently available. Make sure the user is authenticated with a valid session."])}return y(e,t),f(e)}(Y),J=function(t){function e(t){var r;return m(this,e),(r=v(this,e,[t.name?t.name:"Internal Error",t.message?t.message:"An internal error has occurred. Please contact Stytch if this occurs."])).nativeStack=t.nativeStackAndroid||t.n
2ativeStackIOS,r}return y(e,t),f(e)}(Y),X=function(t){function e(){return m(this,e),v(this,e,["NoBiometricsRegistrationError","There is no biometric registration available. Authenticate with another method and add a new biometric registration first."])}return y(e,t),f(e)}(Y),Z=function(t){function e(){return m(this,e),v(this,e,["BiometricsUnavailableError","Biometrics is not available on the device."])}return y(e,t),f(e)}(Y),$=function(t){function e(){return m(this,e),v(this,e,["KeyInvalidatedError","The biometrics enrollment on the device has changed."])}return y(e,t),f(e)}(Y),Q=function(t){function e(){return m(this,e),v(this,e,["KeystoreUnavailableError","The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true."])}return y(e,t),f(e)}(Y),tt=function(t){function e(){return m(this,e),v(this,e,["NoBiometricsEnrolledError","There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."])}return y(e,t),f(e)}(Y),et=function(t){function e(){return m(this,e),v(this,e,["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."])}return y(e,t),f(e)}(Y),nt=function(t){function e(){return m(this,e),v(this,e,["UserCancellationError","The user canceled the prompt. Ask the user to try again."])}return y(e,t),f(e)}(Y),it=function(t){function e(){return m(this,e),v(this,e,["UserLockedOutError","The user has been locked out due to too many failed attempts. Ask the user to try again later."])}return y(e,t),f(e)}(Y),ot=function(t){function e(){return m(this,e),v(this,e,["DeviceCredentialsNotAllowedError","The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods."])}return y(e,t),f(e)}(Y),st=function(t){function e(){return m(this,e),v(this,e,["MissingGoogleClientIDError","No Google client ID was found in the project."])}return y(e,t),f(e)}(Y),at=function(t){function e(){return m(this,e),v(this,e,["MissingPKCEError","Make sure this flow is completed on the same device on which it was started."])}return y(e,t),f(e)}(Y),ct=function(t){function e(){return m(this,e),v(this,e,["MissingAuthorizationCredentialIDTokenError","The authorization credential is missing an ID token."])}return y(e,t),f(e)}(Y),ut=function(t){function e(){return m(this,e),v(this,e,["InvalidAuthorizationCredentialError","The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method."])}return y(e,t),f(e)}(Y),lt=function(t){function e(){return m(this,e),v(this,e,["NoCredentialsPresentError","The user did not provide credentials for a Google OneTap attempt"])}return y(e,t),f(e)}(Y),ht=function(t){function e(){return m(this,e),v(this,e,["MissingPublicKeyError","Failed to retrieve the public key. Add a new biometric registration."])}return y(e,t),f(e)}(Y),pt=function(t){function e(){return m(this,e),v(this,e,["ChallengeSigningFailedError","Failed to sign the challenge with the key."])}return y(e,t),f(e)}(Y),ft=function(t){function e(){return m(this,e),v(this,e,["SDKNotConfiguredError","Stytch client is not confiured. You must call the configure method before using the SDK"])}return y(e,t),f(e)}(Y),_t=function(t){function e(){return m(this,e),v(this,e,["FailedCodeChallengeError","Failed to create a code challenge"])}return y(e,t),f(e)}(Y),mt=function(t){function e(){return m(this,e),v(this,e,["PasskeysUnsupportedError","Passkeys are not supported on this device"])}return y(e,t),f(e)}(Y),bt=function(t){function e(){return m(this,e),v(this,e,["FailedToDecryptDataError","Failed to decrypt user data"])}return y(e,t),f(e)}(Y),vt=function(t){function e(){return m(this,e),v(this,e,["BiometricsFailedError","Biometric authentication failed"])}return y(e,t),f(e)}(Y),yt=function(t){function e(){return m(this,e),v(this,e,["InvalidStartUrlError","The start URL was invalid or improperly formatted."])}return y(e,t),f(e)}(Y),gt=function(t){function e(){return m(this,e),v(this,e,["InvalidRedirectSchemeError","The scheme from the given redirect urls w
2as invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls."])}return y(e,t),f(e)}(Y),wt=function(t){function e(){return m(this,e),v(this,e,["MissingUrlError","The underlying web authentication service failed to return a URL."])}return y(e,t),f(e)}(Y),St=function(t){function e(){return m(this,e),v(this,e,["InvalidCredentialTypeError","The public key credential type was not of the expected type."])}return y(e,t),f(e)}(Y),kt=function(t){function e(){return m(this,e),v(this,e,["MissingAttestationObjectError","The public key credential is missing the attestation object."])}return y(e,t),f(e)}(Y),Pt=function(t){function e(){return m(this,e),v(this,e,["JSONDataNotConvertibleToStringError","JSON data unable to be converted to String type."])}return y(e,t),f(e)}(Y),xt=function(t){function e(){return m(this,e),v(this,e,["RandomNumberGenerationFailed","Random number generation failed"])}return y(e,t),f(e)}(Y),Ot=function(t){function e(){return m(this,e),v(this,e,["PasskeysInvalidEncoding","Invalid passkey encoding"])}return y(e,t),f(e)}(Y),Ct=function(t){function e(){return m(this,e),v(this,e,["PasskeysMisconfigured","Passkeys are misconfigured. Verify that you have added the correct associated domain for your application, and that the signing information is correct."])}return y(e,t),f(e)}(Y),At=function(t){function e(){return m(this,e),v(this,e,["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."])}return y(e,t),f(e)}(Y),Et=function(t){function e(){return m(this,e),v(this,e,["MissingCipherIv","The expected cipher Iv was not found when attempting to decrypt an existing biometric key."])}return y(e,t),f(e)}(Y),Tt=function(t){function e(){return m(this,e),v(this,e,["InvalidPrivateKeyLength","The private key was of an incorrect length."])}return y(e,t),f(e)}(Y),Dt=function(t){function e(){return m(this,e),v(this,e,["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."])}return y(e,t),f(e)}(Y),It=function(t){function e(){return m(this,e),v(this,e,["DFPNotConfigured","You have attempted to retrieve a telemetry ID before the DFP client has been configured."])}return y(e,t),f(e)}(Y),Bt=function(t){function e(details){return m(this,e),v(this,e,["IDPOAuthFlowMissingParamError",details])}return y(e,t),f(e)}(Y);function Rt(t){switch(t.message){case"no_current_session":return new V;case"no_biometrics_registration":return new X;case"biometrics_unavailable":case"device_hardware_error":case"biometrics_not_available":return new Z;case"key_invalidated":case"no_biometric_key":return new $;case"no_biometrics_enrolled":return new tt;case"keystore_unavailable":return new Q;case"device_credentials_not_allowed":return new ot;case"user_cancellation":return new nt;case"user_locked_out":return new it;case"google_onetap_missing_id_token":case"oauth_apple_missing_id_token":case"missing_authorization_credential_id_token":return new ct;case"google_onetap_missing_member":case"oauth_apple_credential_invalid":case"invalid_authorization_credential":return new ut;case"missing_public_key":return new ht;case"challenge_signing_failed":return new pt;case"no_credentials_present":return new lt;case"sdk_not_configured":return new ft;case"failed_code_challenge":return new _t;case"passkeys_unsupported":return new mt;case"failed_to_decrypt_data":return new bt;case"biometrics_failed":return new vt;case"invalid_start_url":return new yt;case"invalid_redirect_scheme":return new gt;case"missing_url":return new wt;case"invalid_credential_type":return new St;case"missing_attestation_object":return new kt;case"json_data_not_convertible_to_string":return new Pt;case"random_number_generation_failed":return new xt;case"passkeys_invalid_encoding":return new Ot;case"passkeys_misconfigured":return new Ct;case"signinwithapple_misconfigured":return new At;case"missing_cipher_iv":return new Et;
2case"invalid_private_key_length":return new Tt;case"biometric_registration_id_is_null_or_blank":return new Dt;case"dfp_not_configured":return new It;default:return new J(t)}}function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Kt(t){return function(t){if(Array.isArray(t))return Nt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||jt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,d=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(t){d=!0,o=t}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(d)throw o}}return a}}(t,e)||jt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(t,a){if(t){if("string"==typeof t)return Nt(t,a);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Nt(t,a):void 0}}function Nt(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,r=Array(a);e<a;e++)r[e]=t[e];return r}function Lt(){Lt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function d(e,r,n,o){var i=r&&r.prototype instanceof h?r:h,a=Object.create(i.prototype);return c(a,"_invoke",function(e,r,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var d=s(e,r,n);if("normal"===d.type){if(o=n.done?4:2,d.arg===l)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=4,n.method="throw",n.arg=d.arg)}}}(e,n,new x(o||[])),!0),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var l={};function h(){}function f(){}function _(){}var m={};c(m,i,(function(){return this}));var p=Object.getPrototypeOf,v=p&&p(p(O([])));v&&v!==r&&n.call(v,i)&&(m=v);var y=_.prototype=h.prototype=Object.create(m);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var d=c.arg,l=d.value;return l&&"object"==Ft(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){d.value=t,a(d)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var o;c(this,"_invoke",(function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}),!0)}function S(e,r){var n=r.method,o=e.i[n];if(o===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var i=s(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,l;var a=i.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,l):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}function k(t){this.tryEntries.push(t)}function P(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function x(t){this.tryEntries=[[-1]],t.forEach(k,this),this.reset(!0)}function O(e){if(null!=e){var r=e[i];if(r)return r.call(e);
2if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Ft(e)+" is not iterable")}return f.prototype=_,c(y,"constructor",_),c(_,"constructor",f),f.displayName=c(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,c(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},e.awrap=function(t){return{__await:t}},g(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(d(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),c(y,u,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=O,x.prototype={constructor:x,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var o=r.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],d=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!d)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=t,n(c),!0;if(u<d)return n(d),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),P(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:O(e),r:r,n:n},"next"===this.method&&(this.arg=t),l}},e}function zt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Ut(t,e,r){return e&&zt(t.prototype,e),r&&zt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wt(t){var i=function(t,e){if("object"!=Ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e);if("object"!=Ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ft(i)?i:i+""}function Gt(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(t,e,r){return e=Jt(e),function(t,e){if(e&&("object"==Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Yt()?Reflect.construct(e,r||[],Jt(t).constructor):e.apply(t,r))}function qt(t){var e="function"==typeof Map?new Map:void 0;return qt=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(Yt())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var p=new(t.bind.apply(t,n));return r&&Vt(p,r.prototype),p}(t,arguments,Jt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Vt(r,t)},qt(t)}function Yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Yt=function(){return!!t})()}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(t)}!function(t){t.emailMagicLinks="emailMagicLinks",t.emailOtp="emailOtp",t.sso="sso",t.passwords="passwords",t.oauth="oauth"}(I||(I={})),function(t){t.Discovery="Discovery",t.Organization="Organization",t.PasswordReset="PasswordReset"}(B||(B={})),function(t){t.ResetPassword="reset_password"}(R||(R={})),function(t){t.smsOtp="smsOtp",t.totp="totp"}(F||(F={})),function(t){t.Google="google",t.Microsoft="microsoft",t.HubSpot="hubspot",t.Slack="slack",t.GitHub="github"}(K||(K={}));var Xt,Zt="https://accounts.google.com/gsi",$t="".concat(Zt,"/client"),Qt="It looks like you're creating multiple copies of the Stytch client. This behavior is unsupported, and unintended side effects may occur. Make sure you are creating the Stytch client at the global level, and not inside a component's render function.";function te(s,t){var e={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&t.indexOf(p)<0&&(e[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)t.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(e[p[i]]=s[p[i]])}return e}function ee(t,e,r,n){return new(r||(r=Promise))((function(e,o){function c(t){try{l(n.next(t))}catch(t){o(t)}}function d(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(c,d)}l((n=n.apply(t,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.RequiredCatcha="Catcha Required"}(Xt||(Xt={}));var re,ne=function(t){function e(t){var r;return Gt(this,e),(r=Ht(this,e,[t])).type=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}(e,t),Ut(e)}(qt(Error));function ie(t){var e=t.method,r=t.finalURL,n=t.basicAuthHeader,o=t.xSDKClientHeader,c=t.xSDKParentHostHeader,body=t.body,d=t.retryCallback;return ee(this,0,void 0,Lt().mark((function t(){var l;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l={method:e,finalURL:r,basicAuthHeader:n,xSDKClientHeader:o,xSDKParentHostHeader:c,body:body},t.prev=1,t.next=4,oe(l);case 4:case 15:return t.abrupt("return",t.sent);case 7:if(t.prev=7,t.t0=t.catch(1),!(t.t0 instanceof ne)){t.next=16;break}return t.next=12,d(t.t0,l);
vendor: 4,856 bytes, line 2
2case 12:return l=t.sent,t.next=15,oe(l);case 16:throw t.t0;case 17:case"end":return t.stop()}}),t,null,[[1,7]])})))}function oe(t){var e,r=t.method,n=t.finalURL,o=t.basicAuthHeader,c=t.xSDKClientHeader,d=t.xSDKParentHostHeader,body=t.body;return ee(this,0,void 0,Lt().mark((function t(){var l,h,f,_,m,v;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l={Authorization:o,"Content-Type":"application/json","X-SDK-Client":c},d&&(l["X-SDK-Parent-Host"]=d),h={method:r,headers:l,body:body&&JSON.stringify(body),credentials:"include"},t.prev=3,t.next=6,fetch(n,h);case 6:f=t.sent,t.next=14;break;case 9:if(t.prev=9,t.t0=t.catch(3),"Failed to fetch"!==t.t0.message){t.next=13;break}throw new W("Unable to contact our servers.");case 13:throw t.t0;case 14:if(!(f.status<=299)){t.next=25;break}return t.prev=15,t.next=18,f.json();case 18:return _=t.sent,t.abrupt("return",_.data);case 22:throw t.prev=22,t.t1=t.catch(15),new W("Invalid JSON response from our servers.");case 25:if(200===f.status||!(null===(e=f.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))){t.next=38;break}return t.prev=26,t.next=29,f.json();case 29:m=t.sent,t.next=35;break;case 32:throw t.prev=32,t.t2=t.catch(26),new W("Invalid or no response from server");case 35:if(!("body"in m||"params"in m||"query"in m)){t.next=37;break}throw new G(m);case 37:throw new H(m);case 38:return t.prev=38,t.next=41,f.text();case 41:v=t.sent,t.next=47;break;case 44:throw t.prev=44,t.t3=t.catch(38),new W("Invalid response from our servers.");case 47:if(!v.includes("Captcha required")){t.next=49;break}throw new ne(Xt.RequiredCatcha);case 49:throw new W("Invalid response from our servers.");case 50:case"end":return t.stop()}}),t,null,[[3,9],[15,22],[26,32],[38,44]])})))}function se(t){var e=t.method,r=t.finalURL,n=t.basicAuthHeader,o=t.xSDKClientHeader,c=t.xSDKParentHostHeader,body=t.body;return ee(this,0,void 0,Lt().mark((function t(){var d,l,h,form;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d=body||{},l=Object.assign(Object.assign({},d),{__Authorization:n,"__X-SDK-Client":o}),c&&(l["__X-SDK-Parent-Host"]=c),h=Object.entries(l).map((function(t){var e=Mt(t,2),r=e[0],n=e[1],input=document.createElement("input");return input.type="hidden",input.name=r,input.value=n,input})),(form=document.createElement("form")).method=e,form.action=r,form.append.apply(form,Kt(h)),document.body.appendChild(form),form.submit();case 10:case"end":return t.stop()}}),t)})))}var ae=new Uint8Array(16);function ce(){if(!re&&!(re="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re(ae)}var ue=/^(?:[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;for(var de=[],i=0;i<256;++i)de.push((i+256).toString(16).substr(1));function le(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(de[t[e+0]]+de[t[e+1]]+de[t[e+2]]+de[t[e+3]]+"-"+de[t[e+4]]+de[t[e+5]]+"-"+de[t[e+6]]+de[t[e+7]]+"-"+de[t[e+8]]+de[t[e+9]]+"-"+de[t[e+10]]+de[t[e+11]]+de[t[e+12]]+de[t[e+13]]+de[t[e+14]]+de[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&ue.test(t)}(r))throw TypeError("Stringified UUID is invalid");return r}function he(t,e,r){var n=(t=t||{}).random||(t.rng||ce)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,le(n)}var pe={};function fe(t,e){return ee(this,0,void 0,Lt().mark((function r(){return Lt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0===pe[t]){r.next=2;break}return r.abrupt("return",pe[t]);case 2:return pe[t]=_e(t,e),r.abrupt("return",pe[t]);case 4:case"end":return r.stop()}}),r)})))}function _e(t,e){return new Promise((function(r,n){var o=function(t){var e=me(t);if(e[0])return e[0]}(t);if(o&&"true"===o.dataset.loaded)try{r(e())}catch(e){return n(new Error("".concat(t," already loaded, but module was not found in global scope: ").concat(e)))}var script=function(t){var script=document.createElement("script");return script.setAttribute("src",t),script.setAttribute("async","true"),script.setAttribute("defer","true"),document.head.appendChild(script),script}(t);script.addEventListener("load",(function(){script.dataset.loaded="true";try{r(e())}catch(e){n(new Error("".concat(t," was loaded, but module was not found in global scope: ").concat(e)))}})),script.addEventListener("error",(function(e){n(new Error("".concat(t," could not be loaded: ").concat(e)))}))}))}var me=function(t){return document.querySelectorAll('script[src="'.concat(t,'"]'))};var be,ve=function(t){try{var e=new URL(t);return"https://".concat(e.hostname)}catch(t){}
2try{var r=new URL("https://".concat(t));return"https://".concat(r.hostname)}catch(t){}},ye=["[Stytch]"],ge={debug:function(){return false},log:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=console).log.apply(t,ye.concat(r))},warn:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=console).warn.apply(t,ye.concat(r))},error:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=console).error.apply(t,ye.concat(r))}},we=function(t){var e,r,n;if(null===(e=null==t?void 0:t.endpointOptions)||void 0===e?void 0:e.apiDomain){var o=ve(t.endpointOptions.apiDomain);if(o)return o;ge.warn("Unable to use custom API domain `".concat(t.endpointOptions.apiDomain,"`. apiDomain should be a valid domain."))}return null!==(n=null===(r=null==t?void 0:t.endpoints)||void 0===r?void 0:r.liveAPIURL)&&void 0!==n?n:"https://api.stytch.com"},Se=function(t){var e,r,n;if(null===(e=null==t?void 0:t.endpointOptions)||void 0===e?void 0:e.testApiDomain){var o=ve(t.endpointOptions.testApiDomain);if(o)return o;ge.warn("Unable to use custom API domain `".concat(t.endpointOptions.testApiDomain,"`. testApiDomain should be a valid domain."))}return null!==(n=null===(r=null==t?void 0:t.endpoints)||void 0===r?void 0:r.testAPIURL)&&void 0!==n?n:"https://test.stytch.com"},ke="\nYou can find your public token at https://stytch.com/dashboard/api-keys.",Pe=function(t){"string"!=typeof t?ge.warn("Public token is malformed. Expected a string, got ".concat(Ft(t),".").concat(ke)):""===t?ge.warn('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(ke)):t.startsWith("public-token-")||ge.warn('Public token is malformed. Expected "public-token-...", got '.concat(t,".").concat(ke))},xe=function(t){var e="StytchB2BUIClient"===t?"createStytchB2BUIClient":"createStytchB2BHeadlessClient";if("undefined"==typeof window)throw new Error("`new ".concat(t,"()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `").concat(e,"()` instead."))},Oe=function(t){var e,r,n;if(null===(e=null==t?void 0:t.endpointOptions)||void 0===e?void 0:e.dfppaDomain){var o=ve(t.endpointOptions.dfppaDomain);if(o)return o;ge.warn("Unable to use custom DFPPA domain `".concat(t.endpointOptions.dfppaDomain,"`. dfppaDomain should be a valid domain."))}return null!==(n=null===(r=null==t?void 0:t.endpoints)||void 0===r?void 0:r.dfpBackendURL)&&void 0!==n?n:"https://telemetry.stytch.com"},Ce=function(t){var e;if(null===(e=null==t?void 0:t.endpointOptions)||void 0===e?void 0:e.dfpCdnDomain){var r=ve(t.endpointOptions.dfpCdnDomain);if(r)return r;ge.warn("Unable to use custom DFP CDN domain `".concat(t.endpointOptions.dfpCdnDomain,"`. dfpCdnDomain should be a valid domain."))}return"https://elements.stytch.com"},Ae=function(t){return t.includes("public-token-test")},Ee=function(){return"event-id-".concat(he())},Te=function(){return"app-session-id-".concat(he())},De=function(){return"persistent-id-".concat(he())},Ie=function(t){var e={isObject:function(r,n){var o="object"===Ft(n)&&!Array.isArray(n)&&null!==n;if(!o)throw new j(t,r+" must be an object.");return e},isOptionalObject:function(t,r){return void 0===r?e:e.isObject(t,r)},isString:function(r,n){if("string"!=typeof n)throw new j(t,r+" must be a string.");return e},isOptionalString:function(t,r){return void 0===r?e:e.isString(t,r)},isStringArray:function(r,n){if(!Array.isArray(n))throw new j(t,r+" must be an array of strings.");var o,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=jt(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,c=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw c}}}}(n);try{for(c.s();!(o=c.n()).done;){if("string"!=typeof o.value)throw new j(t,r+" must be an array of str
2ings.")}}catch(t){c.e(t)}finally{c.f()}return e},isOptionalStringArray:function(t,r){return void 0===r?e:e.isStringArray(t,r)},isNumber:function(r,n){if("number"!=typeof n)throw new j(t,r+" must be a number.");return e},isOptionalNumber:function(t,r){return void 0===r?e:e.isNumber(t,r)},isBoolean:function(r,n){if("boolean"!=typeof n)throw new j(t,r+" must be a boolean.");return e},isOptionalBoolean:function(t,r){return void 0===r?e:e.isBoolean(t,r)}};return e},Be=Ut((function t(e,r,n,o){var c=this,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return Promise.resolve(void 0)};Gt(this,t),this.bootstrapPromise=o,this.isEnabled=function(){return ee(c,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.state.then((function(t){return t.enabled})));case 1:case"end":return t.stop()}}),t,this)})))},this.getTelemetryID=function(){return ee(c,0,void 0,Lt().mark((function t(){var e,r,n,o;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.state;case 2:if(e=t.sent,r=e.publicToken,n=e.enabled,o=e.dfpBackendURL,n){t.next=8;break}return t.abrupt("return",void 0);case 8:return t.next=10,window.GetTelemetryID(r,"".concat(o,"/submit"));case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,this)})))},this.getDFPTelemetryIDAndCaptcha=function(){return ee(c,0,void 0,Lt().mark((function t(){var e,r,n,o,c,d;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.state;case 2:if(e=t.sent,r=e.enabled,n=e.executeRecaptcha,o=e.mode,c=void 0,d=void 0,r){t.next=12;break}return t.next=11,n();case 11:d=t.sent;case 12:if("DECISIONING"!==o){t.next=18;break}return t.next=15,this.getTelemetryID();case 15:c=t.sent,t.next=25;break;case 18:if("OBSERVATION"!==o){t.next=25;break}return t.next=21,this.getTelemetryID();case 21:return c=t.sent,t.next=24,n();case 24:d=t.sent;case 25:return t.abrupt("return",{dfp_telemetry_id:c,captcha_token:d});case 26:case"end":return t.stop()}}),t,this)})))},this.retryWithCaptchaAndDFP=function(t,e){return ee(c,0,void 0,Lt().mark((function r(){var n,o,c;return Lt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.state;case 2:if(n=r.sent,o=n.enabled,c=n.executeRecaptcha,t.type!==Xt.RequiredCatcha||!o){r.next=14;break}if(!e.body){r.next=13;break}return r.next=9,this.getTelemetryID();case 9:return e.body.dfp_telemetry_id=r.sent,r.next=12,c();case 12:e.body.captcha_token=r.sent;case 13:return r.abrupt("return",e);case 14:throw new Error("Unable to query captcha and/or dfp telemetry ID");case 15:case"end":return r.stop()}}),r,this)})))},this.state=o.then((function(t){return ee(c,0,void 0,Lt().mark((function o(){return Lt().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(t.runDFPProtectedAuth){o.next=2;break}return o.abrupt("return",{publicToken:e,dfpBackendURL:r,enabled:!1,loaded:!1,executeRecaptcha:d});case 2:return o.next=4,fe("".concat(n,"/telemetry.js"),(function(){return window.GetTelemetryID}));case 4:return o.abrupt("return",{publicToken:e,dfpBackendURL:r,enabled:!0,mode:t.dfpProtectedAuthMode||"OBSERVATION",loaded:!0,executeRecaptcha:d});case 5:case"end":return o.stop()}}),o)})))}))})),Re=function(){return{isEnabled:function(){return ee(void 0,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",!1);case 1:case"end":return t.stop()}}),t)})))},getTelemetryID:function(){return ee(void 0,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",void 0);case 1:case"end":return t.stop()}}),t)})))},getDFPTelemetryIDAndCaptcha:function(){return ee(void 0,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{dfp_telemetry_id:void 0,captcha_token:void 0});case 1:case"end":return t.stop()}}),t)})))},retryWithCaptchaAndDFP:function(){return ee(void 0,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new Error("DFP protected auth is disabled");case 1:case"end":return t.stop()}}),t)})))}}},Fe=function(){function t(){Gt(this,t)}return Ut(t,null,[{key:"inflate",value:function(t,e){var r=new t(e);return Object.assign(r,e),Object.setPrototypeOf(r,t.prototype),r}},{key:"unmarshall",value:function(e){if("name"in e)switch(e.name){case"SDKAPIUnreachableError":return t.inflate(M,e);case"StytchSDKSchemaError":return t.inflate(N,e);case"StytchAPIUnreachableError":return t.inflate(W,e);case"StytchAPISchemaError":return t.inflate(G,e);case"StytchSDKAPIError":return t.inflate(L,e);case"StytchAPIError":return t.inflate(H,e);case"TypeError":return t.inflate(TypeError,e);case"SyntaxError":return t.inflate(SyntaxError,e);case"ReferenceError":return t.inflate(ReferenceError,e);case"RangeError":return t.inflate(RangeError,e);case"EvalError":return t.inflate(EvalError,e);case"URIError":return t.inflate(URIError,e)}return t.inflate(Error,e)}}])}(),Ke=15,Me=800,je=function(){return Ut((function t(e){Gt(this,t),this.maxBatchSize=e.maxBatchSize,this.logEventURL=e.logEventURL,setInterval(this.flush.bind(this),e.intervalDurationMs),this.batch=[]}),[{key:"logEvent",value:function(t,e){this.batch.push({telemetry:t,event:e}),this.batch.length>=this.maxBatchSize&&this.flush()}},{key:"flush",value:function(){return ee(this,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.batch.length){t.next=2;break}return t.abrupt("return");case 2:return e=this.batch,this.batch=[],t.prev=4,t.next=7,fetch(this.logEventURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});case 7:t.next=11;break;case 9:t.prev=9,t.t0=t.catch(4);case 11:case"end":return t.stop()}}),t,this,[[4,9]])}
2)))}}])}();!function(t){t.LoginOrCreateEML="login_or_create_eml",t.LoginOrCreateOTP="login_or_create_otp",t.ResetPassword="reset_password"}(be||(be={})),Promise.resolve({pkceRequiredForEmailMagicLinks:!1}),Promise.resolve({siweRequiredForCryptoWallets:!1}),Promise.resolve({pkceRequiredForPasswordResets:!1});var Ne=function(){function t(e,r){var n=this;Gt(this,t),this.roles=e,this.resources=r,this.rolesByID={},e.forEach((function(t){return n.rolesByID[t.role_id]=t}))}return Ut(t,[{key:"callerIsAuthorized",value:function(t,e,r){var n=this;return!!t.map((function(t){return n.rolesByID[t]})).filter((function(t){return t})).flatMap((function(t){return t.permissions})).filter((function(t){return t.resource_id===e})).find((function(t){return t.actions.includes(r)||t.actions.includes("*")}))}},{key:"allPermissionsForCaller",value:function(t){var e=this,r=Object.create(null);return this.resources.forEach((function(n){r[n.resource_id]={},n.actions.forEach((function(o){r[n.resource_id][o]=e.callerIsAuthorized(t,n.resource_id,o)}))})),r}}],[{key:"fromJSON",value:function(input){return new t(input.roles,input.resources)}}])}(),Le=Promise.resolve({pkceRequiredForEmailMagicLinks:!1}),ze=function(){return Ut((function t(e,r,n,o){var c=this,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Le,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Re();Gt(this,t),this._networkClient=e,this._subscriptionService=r,this._pkceManager=n,this._passwordResetPKCEManager=o,this._config=d,this.dfpProtectedAuth=l,this.email={invite:function(data){return ee(c,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.magicLinks.email.invite").isString("email_address",data.email_address).isOptionalString("invite_redirect_url",data.invite_redirect_url).isOptionalString("invite_template_id",data.invite_template_id).isOptionalString("name",data.name).isOptionalString("locale",data.locale).isOptionalStringArray("roles",data.roles).isOptionalNumber("invite_expiration_minutes",data.invite_expiration_minutes),t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/magic_links/email/invite",body:data,method:"POST"}));case 2:case"end":return t.stop()}}),t,this)})))},loginOrSignup:function(data){return ee(c,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.magicLinks.email.loginOrSignup").isString("email_address",data.email_address).isString("organization_id",data.organization_id).isOptionalString("login_redirect_url",data.login_redirect_url).isOptionalString("login_template_id",data.login_template_id).isOptionalString("signup_redirect_url",data.signup_redirect_url).isOptionalString("signup_template_id",data.signup_template_id).isOptionalString("locale",data.locale).isOptionalNumber("login_expiration_minutes",data.login_expiration_minutes).isOptionalNumber("signup_expiration_minutes",data.signup_expiration_minutes),t.next=3,this.getCodeChallenge();case 3:return e=t.sent,r=Object.assign(Object.assign({},data),{pkce_code_challenge:e}),t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/magic_links/email/login_or_signup",body:r,method:"POST"}));case 6:case"end":return t.stop()}}),t,this)})))},discovery:{send:function(data){return ee(c,0,void 0,Lt().mark((function t(){var e,r,n,o,c;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.magicLinks.email.discovery.send").isString("email_address",data.email_address).isOptionalString("discovery_redirect_url",data.discovery_redirect_url).isOptionalString("login_template_id",data.login_template_id).isOptionalString("locale",data.locale).isOptionalNumber("discovery_expiration_minutes",data.discovery_expiration_minutes),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.next=8,this.getCodeChallenge();case 8:return o=t.sent,c=Object.assign(Object.assign({},data),{pkce_code_challenge:o,dfp_telemetry_id:r,captcha_token:n}),t.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/email/discovery/send",body:c,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 11:case"end":return t.stop()}}),t,this)})))}}},this.authenticate=function(data){return ee(c,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.magicLinks.authenticate").isString("magic_links_token",data.magic_links_token).isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("locale",data.locale),t.next=3,this._passwordResetPKCEManager.getPKPair();case 3:if(e=t.sent,r=null,!(null==e?void 0:e.code_verifier)){t.next=19;break}return t.prev=6,t.next=9,this.handlePKCEForAuthenticate(this._passwordResetPKCEManager,data);case 9:r=t.sent,t.next=19;break;case 12:if(t.prev=12,t.t0=t.catch(6),!t.t0.message.includes("pkce")){t.next=18;break}console.log("Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace."),t.next=19;break;case 18:throw t.t0;case 19:if(r){t.next=23;break}return t.next=22,this.handlePKCEForAuthenticate(this._pkceManager,data);case 22:r=t.sent;case 23:return this._subscriptionService.updateSession(r),t.abrupt("return",r);case 25:case"end":return t.stop()}}),t,this,[[6,12]])})))},this.discovery={authenticate:function(data){return ee(c,0,void 0,Lt().mark((function t(){var e,r,n,o,c,d;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.magicLinks.discovery.authenticate").isString("discovery_magic_links_token",data.discovery_magic_links_token),t.next=3,this._pkceManager.getPKPair();case 3:return e=t.sent,t.next=6,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 6:return r=t.sent,n=r.dfp_telemetry_id,o=r.captcha_token,c=Object.assign({pkce_code_verifier:null==e?void 0:e.code_verifier,dfp_telemetry_id:n,captcha_token:o},data),t.next=12,this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/discovery/authenticate",body:c,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 12:return d=t.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(d),t.abrupt("return",d);case 16:case"end":return t.stop()}}),t,this)})))}}}),[{key:"getCodeChallenge",value:function(){return ee(this,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._config;case 2:if(e=t.sent,e.pkceRequiredForEmailMagicLinks){t.next=6;break}return t.abrupt("return",void 0);case 6:return t.next=8,this._pkceManager.getPKPair();
2case 8:if(!(r=t.sent)){t.next=11;break}return t.abrupt("return",r.code_challenge);case 11:return t.next=13,this._pkceManager.startPKCETransaction();case 13:return r=t.sent,t.abrupt("return",r.code_challenge);case 15:case"end":return t.stop()}}),t,this)})))}},{key:"handlePKCEForAuthenticate",value:function(t,data){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c,d,l;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getPKPair();case 2:return r=e.sent,e.next=5,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 5:return n=e.sent,o=n.dfp_telemetry_id,c=n.captcha_token,e.t0=Object,e.t1=null==r?void 0:r.code_verifier,e.t2=o,e.t3=c,e.next=14,this._subscriptionService.getIntermediateSessionToken();case 14:if(e.t4=e.sent,e.t4){e.next=17;break}e.t4=void 0;case 17:return e.t5=e.t4,e.t6={pkce_code_verifier:e.t1,dfp_telemetry_id:e.t2,captcha_token:e.t3,intermediate_session_token:e.t5},e.t7=data,d=e.t0.assign.call(e.t0,e.t6,e.t7),e.next=23,this._networkClient.retriableFetchSDK({url:"/b2b/magic_links/authenticate",body:d,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 23:return l=e.sent,t.clearPKPair(),e.abrupt("return",l);case 26:case"end":return e.stop()}}),e,this)})))}}])}(),Ue=Ut((function t(e,r,n){var o=this;Gt(this,t),this._networkClient=e,this._apiNetworkClient=r,this._subscriptionService=n,this.get=function(){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/me",method:"GET"});case 2:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e.member);case 5:case"end":return t.stop()}}),t,this)})))},this.getSync=function(){return o._subscriptionService.getMember()},this.getInfo=function(){return{member:o.getSync(),fromCache:o._subscriptionService.getFromCache()}},this.onChange=function(t){return o._subscriptionService.subscribeToState((function(e){var r;return t(null!==(r=null==e?void 0:e.member)&&void 0!==r?r:null)}))},this.update=function(data){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.self.update").isOptionalString("name",data.name).isOptionalObject("untrusted_metadata",data.untrusted_metadata).isOptionalBoolean("mfa_enrolled",data.mfa_enrolled).isOptionalString("mfa_phone_number",data.mfa_phone_number).isOptionalString("default_mfa_method",data.default_mfa_method),t.next=3,this._networkClient.fetchSDK({url:"/b2b/organizations/members/update",body:data,method:"PUT"});case 3:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e);case 6:case"end":return t.stop()}}),t,this)})))},this.deleteMFAPhoneNumber=function(){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/deletePhoneNumber",method:"DELETE"});case 2:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.deleteMFATOTP=function(){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/deleteTOTP",method:"DELETE"});case 2:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.deletePassword=function(t){return ee(o,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/passwords/".concat(t),method:"DELETE"});case 2:return r=e.sent,this._subscriptionService.updateMember(r.member),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})))},this.unlinkRetiredEmail=function(data){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/unlink_retired_email",method:"POST",body:data});case 2:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.startEmailUpdate=function(data){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/start_email_update",method:"POST",body:data});case 2:return e=t.sent,this._subscriptionService.updateMember(e.member),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.getConnectedApps=function(){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/members/connected_apps",method:"GET"}));case 1:case"end":return t.stop()}}),t,this)})))},this.revokeConnectedApp=function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/members/connected_apps/".concat(data.connected_app_id,"/revoke"),method:"POST"}));case 1:case"end":return t.stop()}}),t,this)})))}})),We=function(){return Ut((function t(e,r,n,o,c,d){var l=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this._pkceManager=n,this._dynamicConfig=o,this._config=c,this.dfpProtectedAuth=d,this.saml={createConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/saml",method:"POST",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},updateConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/saml/".concat(data.connection_id),method:"PUT",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},updateConnectionByURL:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/saml/".concat(data.connection_id,"/url"),method:"PUT",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},deleteVerificationCertificate:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/saml/".concat(data.connection_id,"/verification_certificates/").concat(data.certificate_id),method:"DELETE"});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},deleteEncryptionPrivateKey:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/saml/".concat(data.connection_id,"/encryption_private_key/").concat(data.private_key_id),method:"DELETE"});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},this.oidc={createConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/oidc",method:"POST",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},updateConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/oidc/".concat(data.connection_id),method:"PUT",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},this.external={createConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/external",method:"POST",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))},updateConnection:function(data){return ee(l,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/external/".concat(data.connection_id),method:"PUT",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}}}),[{key:"authenticate",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c,d;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.sso.authenticate").isString("sso_token",t.sso_token).isNumber("session_duration_minutes",t.session_duration_minutes).isOptionalString("locale",t.locale),e.next=3,this._pkceManager.getPKPair();case 3:return(r=e.sent)||ge.warn("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."),e.next=7,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 7:return n=e.sent,o=n.dfp_telemetry_id,c=n.captcha_token,e.t0=this._networkClient,e.t1=Object,e.t2=Object.assign({pkce_code_verifier:null==r?void 0:r.code_verifier},t),e.t3=o,e.t4=c,e.next=17,this._subscriptionService.getIntermediateSessionToken();case 17:if(e.t5=e.sent,e.t5){e.next=20;break}e.t5=void 0;case 20:return e.t6=e.t5,e.t7={dfp_telemetry_id:e.t3,captcha_token:e.t4,intermediate_session_token:e.t6},e.t8=e.t1.assign.call(e.t1,e.t2,e.t7),e.t9=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t10={url:"/b2b/sso/authenticate",method:"POST",body:e.t8,retryCallback:e.t9}
vendor: 6,594 bytes, line 2
2,e.next=27,e.t0.retriableFetchSDK.call(e.t0,e.t10);case 27:return d=e.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(d),e.abrupt("return",d);case 31:case"end":return e.stop()}}),e,this)})))}},{key:"getBaseApiUrl",value:function(){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Ae(this._config.publicToken)){t.next=2;break}return t.abrupt("return",this._config.testAPIURL);case 2:return t.abrupt("return",this._config.liveAPIURL);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"start",value:function(t){var e=t.connection_id,r=t.login_redirect_url,n=t.signup_redirect_url;return ee(this,0,void 0,Lt().mark((function t(){var o,c,d,l,h;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._dynamicConfig;case 2:return o=t.sent,c=o.pkceRequiredForSso,t.next=6,this.getBaseApiUrl();case 6:if(d=t.sent,(l=new URL("".concat(d,"/v1/public/sso/start"))).searchParams.set("public_token",this._config.publicToken),l.searchParams.set("connection_id",e),!c){t.next=17;break}return t.next=13,this._pkceManager.startPKCETransaction();case 13:h=t.sent,l.searchParams.set("pkce_code_challenge",h.code_challenge),t.next=18;break;case 17:this._pkceManager.clearPKPair();case 18:r&&l.searchParams.set("login_redirect_url",r),n&&l.searchParams.set("signup_redirect_url",n),window.location.href=l.toString();case 21:case"end":return t.stop()}}),t,this)})))}},{key:"getConnections",value:function(){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/sso",method:"GET"});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"discoverConnections",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/sso/discovery/connections?email_address=".concat(encodeURIComponent(t)),method:"GET"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"deleteConnection",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/sso/".concat(t),method:"DELETE"}));case 1:case"end":return e.stop()}}),e,this)})))}}])}(),Ge=function(){return Ut((function t(e,r){Gt(this,t),this._networkClient=e,this._subscriptionService=r}),[{key:"createConnection",value:function(data){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.scim.createConnection").isOptionalString("display_name",data.display_name).isOptionalString("identity_provider",data.identity_provider),t.next=3,this._networkClient.fetchSDK({url:"/b2b/scim",method:"POST",body:data});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"updateConnection",value:function(data){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.scim.updateConnection").isString("connection_id",data.connection_id).isOptionalString("display_name",data.display_name).isOptionalString("identity_provider",data.identity_provider),t.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/".concat(data.connection_id),method:"PUT",body:data});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"deleteConnection",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.scim.deleteConnection").isString("connection_id",t),e.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/".concat(t),method:"DELETE"});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getConnection",value:function(){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/scim",method:"GET"});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getConnectionGroups",value:function(data){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.scim.getConnectionGroups").isOptionalNumber("limit",data.limit).isOptionalString("cursor",data.cursor),t.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/groups",method:"POST",body:data});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"rotateStart",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.scim.rotateStart").isString("connectionId",t),e.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/rotate/start",method:"POST",body:{connection_id:t}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"rotateComplete",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.scim.rotateComplete").isString("connectionId",t),e.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/rotate/complete",method:"POST",body:{connection_id:t}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"rotateCancel",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.scim.rotateCancel").isString("connectionId",t),e.next=3,this._networkClient.fetchSDK({url:"/b2b/scim/rotate/cancel",method:"POST",body:{connection_id:t}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}}])}(),He=Ut((function t(e,r,n){var o=this;Gt(this,t),this._networkClient=e,this._apiNetworkClient=r,this._subscriptionService=n,this.get=function(){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"GET"});case 2:return e=t.sent,this._subscriptionService.updateOrganization(e.organization),t.abrupt("return",e.organization);case 5:case"end":return t.stop()}}),t,this)})))}
2,this.getSync=function(){return o._subscriptionService.getOrganization()},this.getInfo=function(){return{organization:o.getSync(),fromCache:o._subscriptionService.getFromCache()}},this.onChange=function(t){return o._subscriptionService.subscribeToState((function(e){var r;return t(null!==(r=null==e?void 0:e.organization)&&void 0!==r?r:null)}))},this.update=function(data){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"PUT",body:data});case 2:return e=t.sent,this._subscriptionService.updateOrganization(e.organization),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.delete=function(){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/me",method:"DELETE"});case 2:return e=t.sent,this._subscriptionService.destroyState(),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},this.getBySlug=function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.organization.getBySlug").isString("organization_slug",data.organization_slug),t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/search",method:"POST",body:data}));case 2:case"end":return t.stop()}}),t,this)})))},this.getConnectedApps=function(){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/connected_apps",method:"GET"}));case 1:case"end":return t.stop()}}),t,this)})))},this.getConnectedApp=function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/connected_apps/".concat(data.connected_app_id),method:"GET"}));case 1:case"end":return t.stop()}}),t,this)})))},this.members={create:function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/members",method:"POST",body:data}));case 1:case"end":return t.stop()}}),t,this)})))},search:function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/me/members/search",method:"POST",body:data}));case 1:case"end":return t.stop()}}),t,this)})))},update:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/".concat(data.member_id),method:"PUT",body:data});case 2:return e=t.sent,this.updateMemberIfSelf(e),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)})))},deletePassword:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/passwords/".concat(t),method:"DELETE"});case 2:return r=e.sent,this.updateMemberIfSelf(r),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})))},deleteMFAPhoneNumber:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/mfa_phone_numbers/".concat(t),method:"DELETE"});case 2:return r=e.sent,this.updateMemberIfSelf(r),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})))},deleteMFATOTP:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/totp/".concat(t),method:"DELETE"});case 2:return r=e.sent,this.updateMemberIfSelf(r),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})))},delete:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r,n;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._networkClient.fetchSDK({url:"/b2b/organizations/members/".concat(t),method:"DELETE"});case 2:return n=e.sent,t===(null===(r=this._subscriptionService.getMember())||void 0===r?void 0:r.member_id)&&this._subscriptionService.destroyState(),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)})))},reactivate:function(t){return ee(o,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/members/".concat(t,"/reactivate"),method:"PUT"}));case 1:case"end":return e.stop()}}),e,this)})))},unlinkRetiredEmail:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,body,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=data.member_id,body=te(data,["member_id"]),t.next=3,this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/".concat(e,"/unlink_retired_email"),method:"POST",body:body});case 3:return r=t.sent,this.updateMemberIfSelf(r),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)})))},startEmailUpdate:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,body,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=data.member_id,body=te(data,["member_id"]),t.next=3,this._apiNetworkClient.fetchSDK({url:"/b2b/organizations/members/".concat(e,"/start_email_update"),method:"POST",body:body});case 3:return r=t.sent,this.updateMemberIfSelf(r),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)})))},getConnectedApps:function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"b2b/organizations/members/".concat(data.member_id,"/connected_apps"),method:"GET"}));case 1:case"end":return t.stop()}}),t,this)})))},revokeConnectedApp:function(data){return ee(o,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/organizations/members/".concat(data.member_id,"/connected_apps/").concat(data.connected_app_id,"/revoke"),method:"POST"}));case 1:case"end":return t.stop()}}),t,this)})))}},this.updateMemberIfSelf=function(t){var e;t.member_id===(null===(e=o._subscriptionService.getMember())||void 0===e?void 0:e.member_id)&&o._subscriptionService.updateMember(t.member)}})),qe=function(){return Ut((function t(e,r,n,o,c,d){var l=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this._pkceManager=n,this._dynamicConfig=o,this._config=c,this.dfpProtectedAuth=d,this.discovery={authenticate:function(data){return ee(l,0,void 0,Lt().mark((function t(){var e,r,n,o,c,d;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.oauth.discovery.authenticate").isString("discovery_oauth_token",data.discovery_oauth_token),t.next=3,this._pkceManager.getPKPair();case 3:return e=t.sent,t.next=6,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 6:return r=t.sent,n=r.dfp_telemetry_id,o=r.captcha_token,c=Object.assign({pkce_code_verifier:null==e?void 0:e.code_verifier,dfp_telemetry_id:n,captcha_token:o},data),t.next=12,this._networkClient.retriableFetchSDK({url:"/b2b/oauth/discovery/authenticate",body:c,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 12:return d=t.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(d),t.abrupt("return",d);case 16:case"end":return t.stop()}}),t,this)})))}},this.google={start:this.startOAuthFlow(K.Google),discovery:{start:this.startDiscoveryOAuthFlow(K.Google)}},this.microsoft={start:this.startOAuthFlow(K.Microsoft),discovery:{start:this.startDiscoveryOAuthFlow(K.Microsoft)}},this.hubspot={start:this.startOAuthFlow(K.HubSpot),discovery:{start:this.startDiscoveryOAuthFlow(K.HubSpot)}},this.slack={start:this.startOAuthFlow(K.Slack),discovery:{start:this.startDiscoveryOAuthFlow(K.Slack)}},this.github={start:this.startOAuthFlow(K.GitHub),discovery:{start:this.startDiscoveryOAuthFlow(K.GitHub)}}}),[{key:"authenticate",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c,d;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.oauth.authenticate").isString("oauth_token",t.oauth_token).isNumber("session_duration_minutes",t.session_duration_minutes).isOptionalString("locale",t.locale),e.next=3,this._pkceManager.getPKPair();case 3:return(r=e.sent)||ge.warn("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."),e.next=7,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 7:return n=e.sent,o=n.dfp_telemetry_id,c=n.captcha_token,e.t0=this._networkClient,e.t1=Object,e.t2=null==r?void 0:r.code_verifier,e.t3=o,e.t4=c,e.next=17,this._subscriptionService.getIntermediateSessionToken();case 17:if(e.t5=e.sent,e.t5){e.next=20;break}e.t5=void 0;case 20:return e.t6=e.t5,e.t7={pkce_code_verifier:e.t2,dfp_telemetry_id:e.t3,captcha_token:e.t4,intermediate_session_token:e.t6},e.t8=t,e.t9=e.t1.assign.call(e.t1,e.t7,e.t8),e.t10=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t11={url:"/b2b/oauth/authenticate",method:"POST",body:e.t9,retryCallback:e.t10}
2,e.next=28,e.t0.retriableFetchSDK.call(e.t0,e.t11);case 28:return d=e.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(d),e.abrupt("return",d);case 32:case"end":return e.stop()}}),e,this)})))}},{key:"getBaseApiUrl",value:function(){return ee(this,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._dynamicConfig;case 2:if(e=t.sent,!(r=e.cnameDomain)){t.next=6;break}return t.abrupt("return","https://".concat(r));case 6:if(!Ae(this._config.publicToken)){t.next=8;break}return t.abrupt("return",this._config.testAPIURL);case 8:return t.abrupt("return",this._config.liveAPIURL);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"startOAuthFlow",value:function(t){var e=this;return function(r){var n=r.organization_id,o=r.organization_slug,c=r.login_redirect_url,d=r.signup_redirect_url,l=r.custom_scopes,h=r.provider_params;return ee(e,0,void 0,Lt().mark((function e(){var r,f,_,m,v,y;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._dynamicConfig;case 2:return r=e.sent,f=r.pkceRequiredForOAuth,e.next=6,this.getBaseApiUrl();case 6:if(_=e.sent,(m=new URL("".concat(_,"/v1/b2b/public/oauth/").concat(t,"/start"))).searchParams.set("public_token",this._config.publicToken),n&&""!=n&&m.searchParams.set("organization_id",n),o&&""!=o&&m.searchParams.set("slug",o),l&&(Ie("startOAuthFlow").isStringArray("custom_scopes",l),m.searchParams.set("custom_scopes",l.join(" "))),h)for(v in Ie("startOAuthFlow").isOptionalObject("provider_params",h),h)m.searchParams.set("provider_"+v,h[v]);if(!f){e.next=20;break}return e.next=16,this._pkceManager.startPKCETransaction();case 16:y=e.sent,m.searchParams.set("pkce_code_challenge",y.code_challenge),e.next=21;break;case 20:this._pkceManager.clearPKPair();case 21:c&&m.searchParams.set("login_redirect_url",c),d&&m.searchParams.set("signup_redirect_url",d),window.location.href=m.toString();case 24:case"end":return e.stop()}}),e,this)})))}}},{key:"startDiscoveryOAuthFlow",value:function(t){var e=this;return function(r){var n=r.discovery_redirect_url,o=r.custom_scopes,c=r.provider_params;return ee(e,0,void 0,Lt().mark((function e(){var r,d,l,h,f,_;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._dynamicConfig;case 2:return r=e.sent,d=r.pkceRequiredForOAuth,e.next=6,this.getBaseApiUrl();case 6:if(l=e.sent,(h=new URL("".concat(l,"/v1/b2b/public/oauth/").concat(t,"/discovery/start"))).searchParams.set("public_token",this._config.publicToken),o&&(Ie("startOAuthFlow").isStringArray("custom_scopes",o),h.searchParams.set("custom_scopes",o.join(" "))),c)for(f in Ie("startOAuthFlow").isOptionalObject("provider_params",c),c)h.searchParams.set("provider_"+f,c[f]);if(!d){e.next=18;break}return e.next=14,this._pkceManager.startPKCETransaction();case 14:_=e.sent,h.searchParams.set("pkce_code_challenge",_.code_challenge),e.next=19;break;case 18:this._pkceManager.clearPKPair();case 19:n&&h.searchParams.set("discovery_redirect_url",n),window.location.href=h.toString();case 21:case"end":return e.stop()}}),e,this)})))}}}])}(),Ye=function(){return Ut((function t(e,r){var n=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.getSync=function(){return n._subscriptionService.getSession()},this.getInfo=function(){return{session:n.getSync(),fromCache:n._subscriptionService.getFromCache()}},this.onChange=function(t){return n._subscriptionService.subscribeToState((function(e){var r;return t(null!==(r=null==e?void 0:e.session)&&void 0!==r?r:null)}))},this.revoke=function(t){return ee(n,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._networkClient.fetchSDK({url:"/b2b/sessions/revoke",method:"POST"});case 3:return r=e.sent,this._subscriptionService.destroyState(),e.abrupt("return",r);case 8:throw e.prev=8,e.t0=e.catch(0),((null==t?void 0:t.forceClear)||z.includes(e.t0.error_type))&&this._subscriptionService.destroyState(),e.t0;case 12:case"end":return e.stop()}}),e,this,[[0,8]])})))},this.revokeForMember=function(t){return ee(n,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.session.revokeForMember").isString("member_id",t.member_id),e.next=3,this._networkClient.fetchSDK({url:"/b2b/sessions/revoke/".concat(t.member_id),method:"POST"});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))},this.authenticate=function(t){return ee(n,0,void 0,Lt().mark((function e(){var r,n,o,c,d=this;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this._subscriptionService.getSession(),n=function(){var t;return(null==r?void 0:r.member_session_id)!==(null===(t=d._subscriptionService.getSession())||void 0===t?void 0:t.member_session_id)},e.prev=2,o={session_duration_minutes:null==t?void 0:t.session_duration_minutes},e.next=6,this._networkClient.fetchSDK({url:"/b2b/sessions/authenticate",body:o,method:"POST"});
2case 6:if(c=e.sent,!n()){e.next=9;break}return e.abrupt("return",this.authenticate(t));case 9:return this._subscriptionService.updateSession(c),e.abrupt("return",c);case 13:if(e.prev=13,e.t0=e.catch(2),!n()){e.next=17;break}return e.abrupt("return",this.authenticate(t));case 17:throw z.includes(e.t0.error_type)&&this._subscriptionService.destroySession(),e.t0;case 19:case"end":return e.stop()}}),e,this,[[2,13]])})))},this.exchange=function(data){return ee(n,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.session.exchange").isString("organization_id",data.organization_id).isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("locale",data.locale),t.prev=1,t.next=4,this._networkClient.fetchSDK({url:"/b2b/sessions/exchange",body:data,method:"POST"});case 4:return e=t.sent,this._subscriptionService.updateSession(e),t.abrupt("return",e);case 9:throw t.prev=9,t.t0=t.catch(1),t.t0;case 12:case"end":return t.stop()}}),t,this,[[1,9]])})))},this.exchangeAccessToken=function(data){return ee(n,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.session.exchange").isString("organization_id",data.access_token).isNumber("session_duration_minutes",data.session_duration_minutes),t.next=3,this._networkClient.fetchSDK({url:"/b2b/sessions/exchange_access_token",body:data,method:"POST"});case 3:return e=t.sent,this._subscriptionService.updateSession(e),t.abrupt("return",e);case 6:case"end":return t.stop()}}),t,this)})))},this.attest=function(data){return ee(n,0,void 0,Lt().mark((function t(){var e;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.session.attest").isOptionalString("organization_id",data.organization_id).isString("profile_id",data.profile_id).isString("token",data.token).isOptionalNumber("session_duration_minutes",data.session_duration_minutes),t.next=3,this._networkClient.fetchSDK({url:"/b2b/sessions/attest",body:data,method:"POST"});case 3:return e=t.sent,this._subscriptionService.updateSession(e),t.abrupt("return",e);case 6:case"end":return t.stop()}}),t,this)})))}}),[{key:"getTokens",value:function(){return this._subscriptionService.getTokens()}},{key:"updateSession",value:function(t){var e;Ie("stytch.session.updateSession").isString("session_token",t.session_token).isOptionalString("session_jwt",null!==(e=t.session_jwt)&&void 0!==e?e:void 0),this._subscriptionService.updateTokens(t)}}])}(),Ve=Ut((function t(e,r){var n=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.organizations={list:function(){return ee(n,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=this._networkClient,t.next=3,this._subscriptionService.getIntermediateSessionToken();case 3:if(t.t1=t.sent,t.t1){t.next=6;break}t.t1=void 0;case 6:return t.t2=t.t1,t.t3={intermediate_session_token:t.t2},t.t4={url:"/b2b/discovery/organizations",body:t.t3,method:"POST"},t.abrupt("return",t.t0.fetchSDK.call(t.t0,t.t4));case 10:case"end":return t.stop()}}),t,this)})))},create:function(data){return ee(n,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.discovery.organizations.create").isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("organization_name",data.organization_name).isOptionalString("organization_slug",data.organization_slug).isOptionalString("organization_logo_url",data.organization_logo_url).isOptionalString("sso_jit_provisioning",data.sso_jit_provisioning).isOptionalStringArray("email_allowed_domains",data.email_allowed_domains).isOptionalString("email_invites",data.email_invites).isOptionalString("auth_methods",data.auth_methods).isOptionalStringArray("allowed_auth_methods",data.allowed_auth_methods).isOptionalString("mfa_policy",data.mfa_policy),t.t0=Object,t.t1=Object.assign({},data),t.next=5,this._subscriptionService.getIntermediateSessionToken();case 5:if(t.t2=t.sent,t.t2){t.next=8;break}t.t2=void 0;case 8:return t.t3=t.t2,t.t4={intermediate_session_token:t.t3},e=t.t0.assign.call(t.t0,t.t1,t.t4),t.next=13,this._networkClient.fetchSDK({url:"/b2b/discovery/organizations/create",body:e,method:"POST"});case 13:return r=t.sent,this._subscriptionService.updateSession(r),t.abrupt("return",r);case 16:case"end":return t.stop()}}),t,this)})))}},this.intermediateSessions={exchange:function(data){return ee(n,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.discovery.intermediateSessions.exchange").isString("organization_id",data.organization_id).isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("locale",data.locale),t.t0=Object,t.t1=Object.assign({},data),t.next=5,this._subscriptionService.getIntermediateSessionToken();case 5:if(t.t2=t.sent,t.t2){t.next=8;break}t.t2=void 0;case 8:return t.t3=t.t2,t.t4={intermediate_session_token:t.t3},e=t.t0.assign.call(t.t0,t.t1,t.t4),t.next=13,this._networkClient.fetchSDK({url:"/b2b/discovery/intermediate_sessions/exchange",body:e,method:"POST"});case 13:return r=t.sent,this._subscriptionService.updateSession(r),t.abrupt("return",r);case 16:case"end":return t.stop()}}),t,this)})))}}})),Je=Promise.resolve({pkceRequiredForPasswordResets:!1}),Xe=function(){return Ut((function t(e,r,n){var o=this,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Je,d=arguments.length>4?arguments[4]:void 0;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this._pkceManager=n,this._config=c,this.dfpProtectedAuth=d,this.discovery={resetByEmailStart:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r,n,o,c;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.discovery.resetByEmailStart").isString("email",t.email_address).isOptionalString("login_redirect_url",t.discovery_redirect_url).isOptionalString("reset_password_redirect_url",t.reset_password_redirect_url).isOptionalString("reset_password_template_id",t.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes",t.reset_password_expiration_minutes).isOptionalString("verify_email_template_id",t.verify_email_template_id).isOptionalString("locale",t.locale),e.next=3,this.getCodeChallenge(
2);case 3:return r=e.sent,e.next=6,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 6:return n=e.sent,o=n.dfp_telemetry_id,c=n.captcha_token,e.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/reset/start",method:"POST",body:{email_address:t.email_address,discovery_redirect_url:t.discovery_redirect_url,reset_password_redirect_url:t.reset_password_redirect_url,reset_password_expiration_minutes:t.reset_password_expiration_minutes,reset_password_template_id:t.reset_password_template_id,verify_email_template_id:t.verify_email_template_id,locale:t.locale,pkce_code_challenge:r,captcha_token:c,dfp_telemetry_id:o},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 10:case"end":return e.stop()}}),e,this)})))},resetByEmail:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r,n,o,c,d,l;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.discovery.resetByEmail").isString("password_reset_token",t.password_reset_token).isString("password",t.password),e.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return r=e.sent,n=r.dfp_telemetry_id,o=r.captcha_token,e.next=8,this._pkceManager.getPKPair();case 8:return c=e.sent,d=null==c?void 0:c.code_verifier,e.t0=this._networkClient,e.t1=t.password_reset_token,e.t2=t.password,e.t3=o,e.t4=n,e.t5=d,e.next=18,this._subscriptionService.getIntermediateSessionToken();case 18:if(e.t6=e.sent,e.t6){e.next=21;break}e.t6=void 0;case 21:return e.t7=e.t6,e.t8={password_reset_token:e.t1,password:e.t2,captcha_token:e.t3,dfp_telemetry_id:e.t4,pkce_code_verifier:e.t5,intermediate_session_token:e.t7},e.t9=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t10={url:"/b2b/passwords/discovery/reset",method:"POST",body:e.t8,retryCallback:e.t9},e.next=27,e.t0.retriableFetchSDK.call(e.t0,e.t10);case 27:return l=e.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(l),e.abrupt("return",l);case 31:case"end":return e.stop()}}),e,this)})))},authenticate:function(t){return ee(o,0,void 0,Lt().mark((function e(){var r,n,o,c,d,l;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.discovery.authenticate").isString("password",t.password).isString("email_address",t.email_address),e.next=3,this._pkceManager.getPKPair();case 3:return r=e.sent,n=null==r?void 0:r.code_verifier,e.next=7,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 7:return o=e.sent,c=o.dfp_telemetry_id,d=o.captcha_token,e.next=12,this._networkClient.retriableFetchSDK({url:"/b2b/passwords/discovery/authenticate",method:"POST",body:{email_address:t.email_address,password:t.password,captcha_token:d,dfp_telemetry_id:c,code_verifier:n},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 12:return l=e.sent,this._subscriptionService.updateSession(l),e.abrupt("return",l);case 15:case"end":return e.stop()}}),e,this)})))}}}),[{key:"getCodeChallenge",value:function(){return ee(this,0,void 0,Lt().mark((function t(){var e,r;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._config;case 2:if(e=t.sent,e.pkceRequiredForPasswordResets){t.next=6;break}return t.abrupt("return",void 0);case 6:return t.next=8,this._pkceManager.getPKPair();case 8:if(!(r=t.sent)){t.next=11;break}return t.abrupt("return",r.code_challenge);case 11:return t.next=13,this._pkceManager.startPKCETransaction();case 13:return r=t.sent,t.abrupt("return",r.code_challenge);case 15:case"end":return t.stop()}}),t,this)})))}},{key:"authenticate",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c,d,l;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.authenticate").isString("org_id",t.organization_id).isString("password",t.password).isString("email_address",t.email_address).isNumber("session_duration_minutes",t.session_duration_minutes).isOptionalString("locale",t.locale),e.next=3,this._pkceManager.getPKPair();case 3:return r=e.sent,n=null==r?void 0:r.code_verifier,e.next=7,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 7:return o=e.sent,c=o.dfp_telemetry_id,d=o.captcha_token,e.t0=this._networkClient,e.t1=t.organization_id,e.t2=t.email_address,e.t3=t.password,e.t4=t.session_duration_minutes,e.t5=t.locale,e.t6=d,e.t7=c,e.t8=n,e.next=21,this._subscriptionService.getIntermediateSessionToken();case 21:if(e.t9=e.sent,e.t9){e.next=24;break}e.t9=void 0;case 24:return e.t10=e.t9,e.t11={organization_id:e.t1,email_address:e.t2,password:e.t3,session_duration_minutes:e.t4,locale:e.t5,captcha_token:e.t6,dfp_telemetry_id:e.t7,co
2de_verifier:e.t8,intermediate_session_token:e.t10},e.t12=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t13={url:"/b2b/passwords/authenticate",method:"POST",body:e.t11,retryCallback:e.t12},e.next=30,e.t0.retriableFetchSDK.call(e.t0,e.t13);case 30:return l=e.sent,this._subscriptionService.updateSession(l),e.abrupt("return",l);case 33:case"end":return e.stop()}}),e,this)})))}},{key:"resetByEmailStart",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.resetByEmailStart").isString("email",t.email_address).isOptionalString("login_redirect_url",t.login_redirect_url).isOptionalString("reset_password_redirect_url",t.reset_password_redirect_url).isOptionalString("reset_password_template_id",t.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes",t.reset_password_expiration_minutes).isOptionalString("verify_email_template_id",t.verify_email_template_id).isOptionalString("locale",t.locale),e.next=3,this.getCodeChallenge();case 3:return r=e.sent,e.next=6,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 6:return n=e.sent,o=n.dfp_telemetry_id,c=n.captcha_token,e.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/passwords/email/reset/start",method:"POST",body:{organization_id:t.organization_id,email_address:t.email_address,login_redirect_url:t.login_redirect_url,reset_password_redirect_url:t.reset_password_redirect_url,reset_password_expiration_minutes:t.reset_password_expiration_minutes,reset_password_template_id:t.reset_password_template_id,verify_email_template_id:t.verify_email_template_id,locale:t.locale,code_challenge:r,captcha_token:c,dfp_telemetry_id:o},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 10:case"end":return e.stop()}}),e,this)})))}},{key:"resetByEmail",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c,d,l;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.resetByEmail").isString("password_reset_token",t.password_reset_token).isString("password",t.password).isNumber("session_duration_minutes",t.session_duration_minutes).isOptionalString("locale",t.locale),e.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return r=e.sent,n=r.dfp_telemetry_id,o=r.captcha_token,e.next=8,this._pkceManager.getPKPair();case 8:return c=e.sent,d=null==c?void 0:c.code_verifier,e.t0=this._networkClient,e.t1=t.password_reset_token,e.t2=t.password,e.t3=t.session_duration_minutes,e.t4=t.locale,e.t5=o,e.t6=n,e.t7=d,e.next=20,this._subscriptionService.getIntermediateSessionToken();case 20:if(e.t8=e.sent,e.t8){e.next=23;break}e.t8=void 0;case 23:return e.t9=e.t8,e.t10={password_reset_token:e.t1,password:e.t2,session_duration_minutes:e.t3,locale:e.t4,captcha_token:e.t5,dfp_telemetry_id:e.t6,code_verifier:e.t7,intermediate_session_token:e.t9},e.t11=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t12={url:"/b2b/passwords/email/reset",method:"POST",body:e.t10,retryCallback:e.t11},e.next=29,e.t0.retriableFetchSDK.call(e.t0,e.t12);case 29:return l=e.sent,this._pkceManager.clearPKPair(),this._subscriptionService.updateSession(l),e.abrupt("return",l);case 33:case"end":return e.stop()}}),e,this)})))}},{key:"resetByExistingPassword",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.resetByExistingPassword").isString("email",t.email_address).isString("existing_password",t.existing_password).isString("new_password",t.new_password).isOptionalString("locale",t.locale).isNumber("session_duration_minutes",t.session_duration_minutes),e.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return r=e.sent,n=r.dfp_telemetry_id,o=r.captcha_token,e.next=8,this._networkClient.retriableFetchSDK({url:"/b2b/passwords/existing_password/reset",method:"POST",body:{organization_id:t.organization_id,email_address:t.email_address,existing_password:t.existing_password,new_password:t.new_password,locale:t.locale,session_duration_minutes:t.session_duration_minutes,c
2aptcha_token:o,dfp_telemetry_id:n},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 8:return c=e.sent,this._subscriptionService.updateSession(c),e.abrupt("return",c);case 11:case"end":return e.stop()}}),e,this)})))}},{key:"resetBySession",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.resetBySession").isString("password",t.password),e.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return r=e.sent,n=r.dfp_telemetry_id,o=r.captcha_token,e.next=8,this._networkClient.retriableFetchSDK({url:"/b2b/passwords/session/reset",method:"POST",body:{password:t.password,captcha_token:o,dfp_telemetry_id:n},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 8:return c=e.sent,this._subscriptionService.updateSession(c),e.abrupt("return",c);case 11:case"end":return e.stop()}}),e,this)})))}},{key:"strengthCheck",value:function(t){return ee(this,0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.passwords.strengthCheck").isOptionalString("email",t.email_address).isString("password",t.password),e.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/passwords/strength_check",method:"POST",body:{email_address:t.email_address,password:t.password}}));case 2:case"end":return e.stop()}}),e,this)})))}}])}(),Ze=Ut((function t(e,r,n){var o=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.dfpProtectedAuth=n,this.sms={send:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.sms.send").isString("organization_id",data.organization_id).isString("member_id",data.member_id).isOptionalString("mfa_phone_number",data.mfa_phone_number).isOptionalString("locale",data.locale),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.t0=this._networkClient,t.t1=Object,t.t2=Object.assign({},data),t.t3=r,t.t4=n,t.next=13,this._subscriptionService.getIntermediateSessionToken();case 13:if(t.t5=t.sent,t.t5){t.next=16;break}t.t5=void 0;case 16:return t.t6=t.t5,t.t7={dfp_telemetry_id:t.t3,captcha_token:t.t4,intermediate_session_token:t.t6},t.t8=t.t1.assign.call(t.t1,t.t2,t.t7),t.t9=this.dfpProtectedAuth.retryWithCaptchaAndDFP,t.t10={url:"/b2b/otps/sms/send",body:t.t8,method:"POST",retryCallback:t.t9},t.abrupt("return",t.t0.retriableFetchSDK.call(t.t0,t.t10));case 22:case"end":return t.stop()}}),t,this)})))},authenticate:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n,o,c;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.sms.authenticate").isNumber("session_duration_minutes",data.session_duration_minutes).isString("organization_id",data.organization_id).isString("member_id",data.member_id).isString("code",data.code).isOptionalString("set_mfa_enrollment",data.set_mfa_enrollment),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.t0=Object,t.t1=Object.assign({},data),t.t2=r,t.t3=n,t.next=12,this._subscriptionService.getIntermediateSessionToken();case 12:if(t.t4=t.sent,t.t4){t.next=15;break}t.t4=void 0;case 15:return t.t5=t.t4,t.t6={dfp_telemetry_id:t.t2,captcha_token:t.t3,intermediate_session_token:t.t5},o=t.t0.assign.call(t.t0,t.t1,t.t6),t.next=20,this._networkClient.retriableFetchSDK({url:"/b2b/otps/sms/authenticate",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 20:return c=t.sent,this._subscriptionService.updateSession(c),t.abrupt("return",c);case 23:case"end":return t.stop()}}),t,this)})))}},this.email={loginOrSignup:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.email.loginOrSignup").isString("organization_id",data.organization_id).isString("email_address",data.email_address).isOptionalString("login_template_id",data.login_template_id).isOptionalString("signup_template_id",data.signup_template_id).isOptionalString("locale",data.locale).isOptionalNumber("login_expiration_minutes",data.login_expiration_minutes).isOptionalNumber("signup_expiration_minutes",data.signup_expiration_minutes),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/login_or_signup",body:Object.assign(Object.assign({},data),{dfp_telemetry_id:r,captcha_token:n}),method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 7:case"end":return t.stop()}}),t,this)})))},authenticate:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n,o;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.email.authenticate").isString("code",data.code).isString("email_address",data.email_address).isString("organization_id",data.organization_id).isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("locale",data.locale),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.t0=this._networkClient,t.t1=Object,t.t2=Object.assign({},data),t.next=11,this._subscriptionService.getIntermediateSessionToken();case 11:if(t.t3=t.sent,t.t3){t.next=14;break}t.t3=void 0;case 14:return t.t4=t.t3,t.t5=r,t.t6=n,t.t7={intermediate_session_token:t.t4,dfp_telemetry_id:t.t5,captcha_token:t.t6},t.t8=t.t1.assign.call(t.t1,t.t2,t.t7),t.t9=this.dfpProtectedAuth.retryWithCaptchaAndDFP,t.t10={url:"/b2b/otps/email/authenticate",body:t.t8,method:"POST",retryCallback:t.t9}
2,t.next=23,t.t0.retriableFetchSDK.call(t.t0,t.t10);case 23:return o=t.sent,this._subscriptionService.updateSession(o),t.abrupt("return",o);case 26:case"end":return t.stop()}}),t,this)})))},discovery:{send:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n,o;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.email.discovery.send").isString("email_address",data.email_address).isOptionalString("login_template_id",data.login_template_id).isOptionalString("locale",data.locale).isOptionalNumber("discovery_expiration_minutes",data.discovery_expiration_minutes),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,o=Object.assign(Object.assign({},data),{dfp_telemetry_id:r,captcha_token:n}),t.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/send",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 8:case"end":return t.stop()}}),t,this)})))},authenticate:function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n,o,c;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.otps.email.discovery.authenticate").isString("code",data.code).isString("email_address",data.email_address),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,o=Object.assign({dfp_telemetry_id:r,captcha_token:n},data),t.next=9,this._networkClient.retriableFetchSDK({url:"/b2b/otps/email/discovery/authenticate",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 9:return c=t.sent,this._subscriptionService.updateSession(c),t.abrupt("return",c);case 12:case"end":return t.stop()}}),t,this)})))}}}})),$e=function(){return Ut((function t(e,r,n){Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.dfpProtectedAuth=n}),[{key:"create",value:function(data){var t;return ee(this,0,void 0,Lt().mark((function e(){var r,n,o,c;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie("stytch.totp.create").isString("organization_id",data.organization_id).isString("member_id",data.member_id).isOptionalNumber("expiration_minutes",data.expiration_minutes),e.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return r=e.sent,n=r.dfp_telemetry_id,o=r.captcha_token,e.t0=this._networkClient,e.t1=Object,e.t2=Object.assign({},data),e.t3=n,e.t4=o,e.next=13,this._subscriptionService.getIntermediateSessionToken();case 13:if(e.t5=e.sent,e.t5){e.next=16;break}e.t5=void 0;case 16:return e.t6=e.t5,e.t7={dfp_telemetry_id:e.t3,captcha_token:e.t4,intermediate_session_token:e.t6},e.t8=e.t1.assign.call(e.t1,e.t2,e.t7),e.t9=this.dfpProtectedAuth.retryWithCaptchaAndDFP,e.t10={url:"/b2b/totp",body:e.t8,method:"POST",retryCallback:e.t9},e.next=23,e.t0.retriableFetchSDK.call(e.t0,e.t10);case 23:return(c=e.sent).member_id===(null===(t=this._subscriptionService.getMember())||void 0===t?void 0:t.member_id)&&this._subscriptionService.updateMember(c.member),e.abrupt("return",c);case 26:case"end":return e.stop()}}),e,this)})))}},{key:"authenticate",value:function(data){return ee(this,0,void 0,Lt().mark((function t(){var e,r,n,o,c;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.totp.authenticate").isString("organization_id",data.organization_id).isString("member_id",data.member_id).isString("code",data.code).isNumber("session_duration_minutes",data.session_duration_minutes).isOptionalString("set_mfa_enrollment",data.set_mfa_enrollment).isOptionalBoolean("set_default_mfa",data.set_default_mfa),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.t0=Object,t.t1=Object.assign({},data),t.t2=r,t.t3=n,t.next=12,this._subscriptionService.getIntermediateSessionToken();case 12:if(t.t4=t.sent,t.t4){t.next=15;break}t.t4=void 0;case 15:return t.t5=t.t4,t.t6={dfp_telemetry_id:t.t2,captcha_token:t.t3,intermediate_session_token:t.t5},o=t.t0.assign.call(t.t0,t.t1,t.t6),t.next=20,this._networkClient.retriableFetchSDK({url:"/b2b/totp/authenticate",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 20:return c=t.sent,this._subscriptionService.updateSession(c),t.abrupt("return",c);case 23:case"end":return t.stop()}}),t,this)})))}}])}(),Qe=function(){return Ut((function t(e,r,n){Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.dfpProtectedAuth=n}),[{key:"recover",value:function(data){return ee(this,0,void 0,Lt().mark((function t(){var e,r,n,o,c;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.recoveryCodes.recover").isString("organization_id",data.organization_id).isString("member_id",data.member_id).isString("recovery_code",data.recovery_code).isNumber("session_duration_minutes",data.session_duration_minutes),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.t0=Object,t.t1=Object.assign({},data),t.t2=r,t.t3=n,t.next=12,this._subscriptionService.getIntermediateSessionToken();case 12:if(t.t4=t.sent,t.t4){t.next=15;break}t.t4=void 0;case 15:return t.t5=t.t4,t.t6={dfp_telemetry_id:t.t2,captcha_token:t.t3,intermediate_session_token:t.t5},o=t.t0.assign.call(t.t0,t.t1,t.t6),t.next=20,this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/recover",body:o,method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 20:return c=t.sent,this._subscriptionService.updateSession(c),t.abrupt("return",c);case 23:case"end":return t.stop()}}),t,this)})))}},{key:"rotate",value:function(){return ee(this,0,void 0,Lt().mark((function t(){var e,r,n;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 2:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.abrupt("return",this._networkClient.retriableFetchSDK({url:"/b2b/recovery_codes/rotate",body:{dfp_telemetry_id:r,captcha_token:n},method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));case 6:case"end":return t.stop()}}),t,this)})))}},{key:"get",value:function(){return ee(this,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/b2b/recovery_codes",method:"GET"}));case 1:case"end":return t.stop()}}),t,this)})))}}])}(),er=function(){return Ut((function t(e,r,n){var o=this;Gt(this,t),this._subscriptionService=n,this.isAuthorizedSync=function(t,e){var r;return!!(null===(r=o.cachedPolicy)||void 0===r?void 0:r.callerIsAuthorized(o.roleIds(),t,e))}
2,this.isAuthorized=function(t,e){return o.policyPromise.then((function(r){return r.callerIsAuthorized(o.roleIds(),t,e)}))},this.cachedPolicy=e.rbacPolicy?Ne.fromJSON(e.rbacPolicy):null,this.policyPromise=r.then((function(data){return data.rbacPolicy?(o.cachedPolicy=Ne.fromJSON(data.rbacPolicy),o.cachedPolicy):(ge.error("Unable to retrieve RBAC policy from servers. Assuming caller has no permissions."),new Ne([],[]))}))}),[{key:"allPermissions",value:function(){var t=this;return this.policyPromise.then((function(e){return e.allPermissionsForCaller(t.roleIds())}))}},{key:"roleIds",value:function(){var t,e=this._subscriptionService.getSession();return e&&null!==(t=e.roles)&&void 0!==t?t:[]}}])}(),rr=Ut((function t(e,r,n){var o=this;Gt(this,t),this._networkClient=e,this._subscriptionService=r,this.dfpProtectedAuth=n,this.authenticate=function(data){return ee(o,0,void 0,Lt().mark((function t(){var e,r,n,o;return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ie("stytch.impersonation.authenticate").isString("impersonation_token",data.impersonation_token),t.next=3,this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 3:return e=t.sent,r=e.dfp_telemetry_id,n=e.captcha_token,t.next=8,this._networkClient.retriableFetchSDK({url:"/b2b/impersonation/authenticate",body:Object.assign(Object.assign({},data),{dfp_telemetry_id:r,captcha_token:n}),method:"POST",retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 8:return o=t.sent,this._subscriptionService.updateSession(o),t.abrupt("return",o);case 11:case"end":return t.stop()}}),t,this)})))}})),nr=Ut((function t(e){var r=this;Gt(this,t),this._networkClient=e,this.oauthAuthorizeStart=function(data){return ee(r,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/start",method:"POST",body:data}));case 1:case"end":return t.stop()}}),t,this)})))},this.oauthAuthorizeSubmit=function(data){return ee(r,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this._networkClient.fetchSDK({url:"/idp/b2b/oauth/authorize/submit",method:"POST",body:data}));case 1:case"end":return t.stop()}}),t,this)})))},this.oauthLogoutStart=function(data){return ee(r,0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._networkClient.fetchSDK({url:"/b2b/oauth/logout/start",method:"POST",body:data});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}})),ir=function(){return Ut((function t(e){Gt(this,t),this.iframeURL=e,this.createIframe()}),[{key:"createIframe",value:function(){var t=document.querySelector('[src~="'.concat(this.iframeURL,'"]'));t?ge.warn(Qt):((t=document.createElement("iframe")).src=this.iframeURL,t.style.position="absolute",t.style.width="0",t.style.height="0",t.style.border="0",document.body.appendChild(t)),"true"!==t.dataset.loaded?this.frame=new Promise((function(e){t.addEventListener("load",(function(){t.dataset.loaded="true",e(t)}),{once:!0})})):this.frame=Promise.resolve(t)}},{key:"call",value:function(t,e){return ee(this,0,void 0,Lt().mark((function r(){var n,o,c=this;return Lt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.frame;case 2:return n=r.sent,o=new MessageChannel,r.abrupt("return",new Promise((function(r,d){var l;o.port1.onmessage=function(t){var e=t.data;o.port1.close(),e.success?r(e.payload):d(Fe.unmarshall(e.error))};var h={method:t,args:e};null===(l=n.contentWindow)||void 0===l||l.postMessage(h,c.iframeURL,[o.port2])})));case 5:case"end":return r.stop()}}),r,this)})))}}])}(),or=function(){return Ut((function t(e,r){Gt(this,t),this._networkClient=e,this.dfpProtectedAuth=r}),[{key:"searchUser",value:function(t){var e=this;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then((function(r){var n=r.dfp_telemetry_id,o=r.captcha_token;return e._networkClient.fetchSDK({url:"/users/search",method:"POST",body:{email:t,dfp_telemetry_id:n,captcha_token:o}})}))}},{key:"searchMember",value:function(t,e){return this._networkClient.fetchSDK({url:"/b2b/organizations/members/search",method:"POST",body:{email_address:t,organization_id:e}})}}])}(),sr=function(){return Ut((function t(){Gt(this,t),this.hasWarned=!1,this.registry=new Map}),[{key:"register",value:function(t,e){var r=this.registry.get(t);r&&r!==e&&(this.hasWarned||(ge.warn(Qt),this.hasWarned=!0),r.cancelBackgroun
vendor: 1,393 bytes, line 2
2dRefresh()),this.registry.set(t,e)}},{key:"unregister",value:function(t,e){var r=this.registry.get(t);r&&r===e&&this.registry.delete(t)}}])}(),ar=function(){function t(e,r,n){var o=this;Gt(this,t),this._subscriptionService=e,this._headlessSessionClient=r,this._publicToken=n,this._onDataChange=function(t){!function(t){return!!(null==t?void 0:t.session)}(t)?o.cancelBackgroundRefresh():o.scheduleBackgroundRefresh()},this._reauthenticateWithBackoff=function(){return ee(o,0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.prev=2,e.next=5,this._headlessSessionClient.authenticate();case 5:return e.abrupt("return",e.sent);case 8:if(e.prev=8,e.t0=e.catch(2),!t.isUnrecoverableError(e.t0)){e.next=12;break}return e.abrupt("return",Promise.reject(e.t0));case 12:return r++,e.next=15,new Promise((function(e){return setTimeout(e,t.timeoutForAttempt(r))}));case 15:e.next=1;break;case 17:case"end":return e.stop()}}),e,this,[[2,8]])})))},this.timeout=null,this._subscriptionService.subscribeToState(this._onDataChange)}return Ut(t,[{key:"register",value:function(){t.registry.register(this._publicToken,this)}},{key:"unregister",value:function(){t.registry.unregister(this._publicToken,this)}},{key:"performBackgroundRefresh",value:function(){var t=this;this._reauthenticateWithBackoff().then((function(){t.scheduleBackgroun
2dRefresh()})).catch((function(e){ge.warn("Session background refresh failed. Signalling to app that user is logged out.",{error:e}),t._subscriptionService.destroySession()}))}},{key:"scheduleBackgroundRefresh",value:function(){var e=this;this.cancelBackgroundRefresh(),this.register(),this.timeout=setTimeout((function(){e.performBackgroundRefresh()}),t.REFRESH_INTERVAL_MS)}},{key:"cancelBackgroundRefresh",value:function(){null!==this.timeout&&(this.unregister(),clearTimeout(this.timeout),this.timeout=null)}}],[{key:"timeoutForAttempt",value:function(t){return t=Math.min(t,7),Math.floor(350*Math.random())-175+2e3*Math.pow(2,t)}},{key:"isUnrecoverableError",value:function(t){return z.includes(t.error_type)}}])}();ar.REFRESH_INTERVAL_MS=18e4,ar.registry=new sr;var cr=Ut((function t(e,r){var n=this;Gt(this,t),this._subscriptionService=e,this.emptyState=r,this.onStateChange=function(t){return n._subscriptionService.subscribeToState((function(e){t(null!=e?e:n.emptyState)}))}})),ur="CONSUMER";function dr(t,e,r,n){return new(r||(r=Promise))((function(o,c){function d(t){try{h(n.next(t))}catch(t){c(t)}}function l(t){try{h(n.throw(t))}catch(t){c(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(d,l)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var lr=function(){return Boolean("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}$/))},pr=function(t){var e,r;return{cookieOptions:null==t?void 0:t.cookieOptions,endpoints:{testAPIURL:Se(t),liveAPIURL:we(t),dfpBackendURL:Oe(t),dfpCdnURL:Ce(t),clientsideServicesIframeURL:null!==(r=null===(e=null==t?void 0:t.endpoints)||void 0===e?void 0:e.clientsideServicesIframeURL)&&void 0!==r?r:"https://js.stytch.com/clientside-services/index.html"}}},fr=function(t){return(document.cookie?document.cookie.split("; "):[]).filter((function(e){var r=c(e.split("="),1)[0];return t===r})).length>1},_r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat("stytch_sdk_state_").concat(t).concat(e?"::".concat(e):"")},mr=Symbol.for("stytch__internal_b2b"),vr=function(t,e){Object.assign(t,o({},mr,e))}},1261:function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return _}));var n=r(472),o=r(345),c=r.n(o),d=r(843),l=r(842),h=3e5,f=100;function _(e,r){var o=this;void 0===r&&(r={});var _=r.enabledByDefault,m=void 0===_||_,v=r.cacheFlag,y=void 0===v?"cache":v,w=r.defaultCache,S=void 0===w?new c.a({maxAge:h,max:f}):w;return function(r){var c=r.url,h=r.method,f=r.params,_=r.paramsSerializer,v=r.forceUpdate,w=void 0!==r[y]&&null!==r[y]?r[y]:m;if("get"===h&&w){var k=Object(l.a)(w)?w:S,P=Object(d.a)(c,f,_),x=k.get(P);return!x||v?(x=n.a(o,void 0,void 0,(function(){var t;return n.b(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e(r)];case 1:return[2,n.sent()];case 2:throw t=n.sent(),k.del(P),t;case 3:return[2]}}
2))})),k.set(P,x),x):("info"===t.env.LOGGER_LEVEL&&console.info("[axios-extensions] request cached by cache adapter --\x3e url: "+P),x)}return e(r)}}}).call(this,r(288))},472:function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return o}));function n(t,e,r,n){return new(r||(r=Promise))((function(o,c){function d(t){try{h(n.next(t))}catch(t){c(t)}}function l(t){try{h(n.throw(t))}catch(t){c(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(d,l)}h((n=n.apply(t,e||[])).next())}))}function o(t,body){var e,r,n,g,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return g={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function c(c){return function(d){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;o;)try{if(e=1,r&&(n=2&c[0]?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){o.label=c[1];break}if(6===c[0]&&o.label<n[1]){o.label=n[1],n=c;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(c);break}n[2]&&o.ops.pop(),o.trys.pop();continue}c=body.call(t,o)}catch(t){c=[6,t],r=0}finally{e=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,d])}}}},842:function(t,e,r){"use strict";function n(t){return!!(t.set&&t.get&&t.del&&"function"==typeof t.get&&"function"==typeof t.set&&"function"==typeof t.del)}r.d(e,"a",(function(){return n}))},843:function(t,e,r){"use strict";r.d(e,"a",(function(){return c}));var n=r(325),o=r.n(n);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=o.a.apply(void 0,t),n=r.split("?"),c=n[0],d=n[1];return d?c+"?"+d.split("&").sort().join("&"):r}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.