{"version":3,"file":"index.DXcEp16F.js","sources":["../../../../../../src/lib/utils/auth-store/types/index.ts","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/types/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/console.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/object.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/CustomError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/types.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/WWWAuthError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/misc.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/url.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/AuthSdkError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/oauth.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/oauthMeta.js","../../../../../../node_modules/tiny-emitter/index.js","../../../../../../node_modules/js-cookie/dist/js.cookie.mjs","../../../../../../node_modules/cross-fetch/dist/browser-ponyfill.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/types/Token.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/transactionMeta.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/constants.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/AuthApiError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/OAuthError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/http/request.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/interact.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/_virtual/_tslib.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/actionParser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/generateIdxAction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/remediationParser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/jsonpath.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/idxResponseParser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/makeIdxState.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/v1/parsers.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/idxState/index.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/types/idx-js.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/index.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/introspect.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/util.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/util.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Base/Remediator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/GenericRemediator/util.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/GenericRemediator/GenericRemediator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/util.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediate.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/run.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticate.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/Authenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/VerificationCodeAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/OktaVerifyTotp.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/OktaPassword.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/SecurityQuestionEnrollment.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/SecurityQuestionVerification.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/WebauthnEnrollment.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/WebauthnVerification.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/authenticator/getAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Base/VerifyAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/EnrollAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/EnrollPoll.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/SelectEnrollmentChannel.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/EnrollmentChannelData.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/ChallengeAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/ChallengePoll.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/ResetAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/EnrollProfile.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Identify.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/ReEnrollAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/ReEnrollAuthenticatorWarning.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/RedirectIdp.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Base/SelectAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/SelectAuthenticatorAuthenticate.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/SelectAuthenticatorEnroll.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/SelectAuthenticatorUnlockAccount.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/SelectEnrollProfile.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Base/AuthenticatorData.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/AuthenticatorVerificationData.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/AuthenticatorEnrollmentData.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/Skip.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/flow/AuthenticationFlow.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/flow/PasswordRecoveryFlow.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/flow/RegistrationFlow.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/flow/AccountUnlockFlow.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/flow/FlowSpecification.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/cancel.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/urlParams.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/emailVerify.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/proceed.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/poll.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/startTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/register.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/recoverPassword.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/handleInteractionCodeRedirect.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/unlockAccount.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/errors.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/loginRedirect.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/remediators/index.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/factory/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/crypto/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/features.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/base/factory.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/storage/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/http/OktaUserAgent.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/http/headers.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/http/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/crypto/base64.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/crypto/oidcHash.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/crypto/verifyToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/crypto/index.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/util/PromiseQueue.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/pkce.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/decodeToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/defaultTokenParams.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/dpop.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/endpoints/token.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/endpoints/well-known.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/validateClaims.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/verifyToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/handleOAuthResponse.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/exchangeCodeForTokens.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/getUserInfo.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/prepareTokenParams.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/endpoints/authorize.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/getToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/getWithoutPrompt.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/getWithPopup.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/getWithRedirect.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/parseFromUrl.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/refreshToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/renewTokensWithRefresh.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/renewToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/renewTokens.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/revokeToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/introspect.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/enrollAuthenticatorMeta.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/defaultEnrollAuthenticatorParams.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/prepareEnrollAuthenticatorParams.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/enrollAuthenticator.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/factory/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/validateToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/clock.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/types/TokenManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/TokenManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/browser/browserStorage.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/mixin/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/mixin/index.js","../../../../../../node_modules/p-cancelable/index.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/AuthStateManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/services/AutoRenewService.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/util.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/methods/native.js","../../../../../../node_modules/oblivious-set/dist/es/index.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/options.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/methods/indexed-db.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/methods/localstorage.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/methods/simulate.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/method-chooser.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/broadcast-channel.js","../../../../../../node_modules/unload/dist/es/browser.js","../../../../../../node_modules/unload/dist/es/node.js","../../../../../../node_modules/unload/dist/es/index.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/leader-election-util.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/leader-election-web-lock.js","../../../../../../node_modules/broadcast-channel/dist/esbrowser/leader-election.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/services/SyncStorageService.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/services/LeaderElectionService.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/services/RenewOnTabActivationService.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/ServiceManager/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/session/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/session/factory.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/session/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/factory.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/browser/fingerprint.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/webauthn.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/factory/OktaAuthIdx.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/base/options.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/storage/options/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/storage/options/StorageOptionsConstructor.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/fetch/fetchRequest.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/http/options.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/options/browser.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/options/OAuthOptionsConstructor.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/options.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/options.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/storage/SavedObject.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/storage/BaseStorageManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/storage.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/core/storage.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/storage.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/types/Transaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/util/sharedStorage.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/oidc/TransactionManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/idx/IdxTransactionManager.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/Base.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/request.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/ProfileTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/ProfileSchemaTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/types.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/profileApi.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/EmailStatusTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/EmailChallengeTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/EmailTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/emailApi.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/PhoneTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/phoneApi.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/transactions/PasswordTransaction.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/passwordApi.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/myaccount/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/util/stateToken.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/api.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/util/link2fn.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/errors/AuthPollStopError.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/util/poll.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/util/links2fns.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/util/flattenEmbedded.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/AuthnTransactionImpl.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/factory.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/authn/mixin.js","../../../../../../node_modules/@okta/okta-auth-js/esm/browser/exports/exports/default.js","../../../../../../src/lib/utils/auth-store/state.ts","../../../../../../src/lib/utils/auth-store/okta/store.ts","../../../../../../src/lib/utils/auth-store/index.ts"],"sourcesContent":["import type { Readable } from 'svelte/store';\nimport type { Page } from '@sveltejs/kit';\nimport type { IdpState } from '../state';\n\n/**\n * The configuration for the Okta authentication store.\n */\nexport interface IOktaAuthConfig {\n issuer: string;\n domain: string;\n clientId: string;\n redirectUri: string;\n loginUri: string;\n\n /**\n * Optional callback function to be called every time the user is updated.\n * @returns The promise resolved when callback is completed.\n */\n onAuthUpdatedCallbackFn?: OnAuthUpdatedCallbackFn;\n /**\n * Optional callback function to be called every time the user signs up.\n */\n onSignupCallbackFn?: OnSignupCallbackFn;\n\n /**\n * Callback function to be called every time the user is activated.\n */\n onActivateFn: OnActivateFn;\n\n /**\n * Callback function to be called when updating the user profile.\n */\n onUpdateUserProfileFn: OnUpdateUserProfileFn;\n\n /**\n * Callback function to be called every time the user signs out.\n */\n onSignoutCallbackFn?: OnSignoutCallbackFn;\n\n};\n\n/**\n * The callback function to be called every time the user is updated.\n */\nexport type OnAuthUpdatedCallbackFn = () => Promise | void;\n\n/**\n * The callback function to be called after the user signs up.\n */\nexport type OnSignupCallbackFn = (userInfo: IUserInfo) => Promise;\n\n/**\n * The function to be called before the activation.\n */\nexport type OnActivateFn = (token: string, password: string) => Promise<{ username: string, password: string }>\n\n/**\n * The function to be called before the user profile is updated.\n */\nexport type OnUpdateUserProfileFn = (newUserInfo: IUserInfo) => Promise\n\n/**\n * The function to be called after the user signs out.\n */\nexport type OnSignoutCallbackFn = () => Promise;\n\n/**\n* Generic user info interface.\n*/\nexport interface IUserInfo {\n /**\n * The unique identifier of the user\n */\n bsid: string,\n /**\n * The unique identifier of the user\n */\n id: string,\n /**\n * The name of the user\n */\n name: string,\n /**\n * The surname of the user\n */\n surname: string,\n /**\n * The full name of the user\n */\n fullname: string,\n /**\n * The phone number of the user\n */\n phone?: string,\n /**\n * The mail of the user\n */\n email: string,\n /**\n * True if the user allows to subscribe to ads and newsletters\n */\n subscribe: boolean,\n /**\n * True if the user allows to use personal infos for business uses\n */\n businessUseConsent: boolean,\n /**\n * True if user allows to use personal infos for profiling\n */\n profilingConsent: boolean,\n /**\n * The birthday date (YYYYMMDD)\n */\n birthday?: string,\n /**\n * The city associated to address\n */\n city?: string,\n /**\n * The address\n */\n address?: string,\n /**\n * The postal code associated to address\n */\n postalCode?: string,\n /**\n * The name of the organization\n */\n organization?: string,\n /**\n * The division/department in organization\n */\n sector?: string,\n /**\n * The role in organization\n */\n function?: string\n /**\n * Graduation informations\n */\n graduation?: IGraduation | null\n}\n\n/**\n* The graduation\n*/\nexport interface IGraduation {\n /**\n * Graduation name\n */\n name: string | null\n /**\n * Graduation level\n */\n type: GraduationType | null\n /**\n * Graduation vote\n */\n vote: string | null\n}\n\n/**\n* The type of graduation (italian system)\n*/\nexport enum GraduationType {\n /**\n * First level degree\n */\n FIRST_LEVEL = \"1\",\n /**\n * Second level degree\n */\n SECOND_LEVEL = \"2\",\n /**\n * Old system (< year 2001)\n */\n OLD_SYSTEM = \"Vecchio ordinamento\"\n}\n\n/**\n* \n*/\nexport enum AuthErrorStatus {\n WRONG_PASSWORD,\n LOCKED_OUT,\n PASSWORD_WARN,\n PASSWORD_EXPIRED,\n}\n\n/**\n* Authentication error reported by IAuthStore\n*/\nexport class AuthError extends Error {\n private _status: AuthErrorStatus;\n private _inner: any | null;\n\n /**\n * Construct a new authentication error.\n * \n * @param message The message.\n * @param status The status.\n * @param inner The inner error object.\n */\n public constructor(message: string, status: AuthErrorStatus, inner?: any) {\n super(message)\n this._status = status;\n this._inner = inner;\n }\n\n public get status(): AuthErrorStatus {\n return this._status;\n }\n\n public get inner(): any {\n return this._inner;\n }\n}\n\n/**\n* Generic authentication store interface.\n*/\nexport interface IAuthStore {\n /**\n * Start the auth store\n */\n start(): void,\n /**\n * Stop the auth store\n */\n stop(): void,\n /**\n * Get the current user status\n */\n readonly isLoggedIn: Readable,\n /**\n * Get the current user profile\n */\n readonly userInfo: Readable,\n\n /**\n * Complete the user activation with given token.\n * \n * @param token The activation token.\n * @param password The password to be set.\n * \n * @returns True on successful sign in.\n */\n signInWithToken(token: string, password: string): Promise\n\n\n /**\n * Sign in user.\n * \n * @param username The username.\n * @param password The password.\n * \n * @throws AuthError\n */\n signIn(username: string, password: string): Promise\n\n /**\n * Sing in the user using given idp\n * \n * @param idp The idp unique identifier.\n * @param redirect True to redirect, false to use popup.\n * @param callback The optional callback URL to encode in state passed to IdP (so it gets propagated)\n * @param callback The optional cta action to encode in state passed to IdP (so it gets propagated)\n * \n * \n * @returns A promise resolved when user get logged in.\n *\n * @throws An error if a login error occurs.\n */\n signInWithIdp(idp: string, redirect: boolean, callback?: string, cta?: string, isSocialLogin?: boolean): Promise\n\n /**\n * Trigger forgot password \n * \n * @param username The username (with or without domain) used to send reset password link.\n * \n * @throws AuthError\n */\n forgotPassword(username: string): Promise\n\n\n /**\n * Trigger account unlock\n * \n * @param username The username (with or without domain) used to send the unlock link.\n * \n * @throws AuthError\n */\n unlock(username: string): Promise\n\n /**\n * Logout the user (if logged in).\n * \n * @return A promise resolved whe operation is completed.\n */\n signOut(): Promise\n\n\n /**\n * Handles the login redirect call\n * \n * @param page The calling page\n * @param callback The callback function to be called after login\n */\n handleLoginRedirect(): Promise\n\n\n /**\n * Update the user profile.\n * @param userInfo The updated user infos.\n */\n updateUserProfile(userInfo: IUserInfo): Promise;\n\n\n /**\n * Retrieve user details\n */\n retrieveUser(): Promise\n\n\n /**\n * Get the current access token\n * \n * @returns The access token to use to call resource servers \n */\n readonly accessToken: string | null;\n\n}\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nvar IdxStatus;\n(function (IdxStatus) {\n IdxStatus[\"SUCCESS\"] = \"SUCCESS\";\n IdxStatus[\"PENDING\"] = \"PENDING\";\n IdxStatus[\"FAILURE\"] = \"FAILURE\";\n IdxStatus[\"TERMINAL\"] = \"TERMINAL\";\n IdxStatus[\"CANCELED\"] = \"CANCELED\";\n})(IdxStatus || (IdxStatus = {}));\nvar AuthenticatorKey;\n(function (AuthenticatorKey) {\n AuthenticatorKey[\"OKTA_PASSWORD\"] = \"okta_password\";\n AuthenticatorKey[\"OKTA_EMAIL\"] = \"okta_email\";\n AuthenticatorKey[\"PHONE_NUMBER\"] = \"phone_number\";\n AuthenticatorKey[\"GOOGLE_AUTHENTICATOR\"] = \"google_otp\";\n AuthenticatorKey[\"SECURITY_QUESTION\"] = \"security_question\";\n AuthenticatorKey[\"OKTA_VERIFY\"] = \"okta_verify\";\n AuthenticatorKey[\"WEBAUTHN\"] = \"webauthn\";\n})(AuthenticatorKey || (AuthenticatorKey = {}));\nvar IdxFeature;\n(function (IdxFeature) {\n IdxFeature[\"PASSWORD_RECOVERY\"] = \"recover-password\";\n IdxFeature[\"REGISTRATION\"] = \"enroll-profile\";\n IdxFeature[\"SOCIAL_IDP\"] = \"redirect-idp\";\n IdxFeature[\"ACCOUNT_UNLOCK\"] = \"unlock-account\";\n})(IdxFeature || (IdxFeature = {}));\nfunction isAuthenticator(obj) {\n return obj && (obj.key || obj.id);\n}\n\nexport { AuthenticatorKey, IdxFeature, IdxStatus, isAuthenticator };\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction getNativeConsole() {\n if (typeof window !== 'undefined') {\n return window.console;\n }\n else if (typeof console !== 'undefined') {\n return console;\n }\n else {\n return undefined;\n }\n}\nfunction getConsole() {\n var nativeConsole = getNativeConsole();\n if (nativeConsole && nativeConsole.log) {\n return nativeConsole;\n }\n return {\n log: function () { },\n warn: function () { },\n group: function () { },\n groupEnd: function () { }\n };\n}\nfunction warn(text) {\n getConsole().warn('[okta-auth-sdk] WARN: ' + text);\n}\nfunction deprecate(text) {\n getConsole().warn('[okta-auth-sdk] DEPRECATION: ' + text);\n}\nfunction deprecateWrap(text, fn) {\n return function () {\n deprecate(text);\n return fn.apply(null, arguments);\n };\n}\n\nexport { deprecate, deprecateWrap, getConsole, getNativeConsole, warn };\n//# sourceMappingURL=console.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction bind(fn, ctx) {\n var additionalArgs = Array.prototype.slice.call(arguments, 2);\n return function () {\n var args = Array.prototype.slice.call(arguments);\n args = additionalArgs.concat(args);\n return fn.apply(ctx, args);\n };\n}\nfunction extend() {\n var obj1 = arguments[0];\n var objArray = [].slice.call(arguments, 1);\n objArray.forEach(function (obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop) && obj[prop] !== undefined) {\n obj1[prop] = obj[prop];\n }\n }\n });\n return obj1;\n}\nfunction removeNils(obj) {\n var cleaned = {};\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n var value = obj[prop];\n if (value !== null && value !== undefined) {\n cleaned[prop] = value;\n }\n }\n }\n return cleaned;\n}\nfunction clone(obj) {\n if (obj) {\n var str = JSON.stringify(obj);\n if (str) {\n return JSON.parse(str);\n }\n }\n return obj;\n}\nfunction omit(obj, ...props) {\n var newobj = {};\n for (var p in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, p) && props.indexOf(p) == -1) {\n newobj[p] = obj[p];\n }\n }\n return clone(newobj);\n}\nfunction find(collection, searchParams) {\n var c = collection.length;\n while (c--) {\n var item = collection[c];\n var found = true;\n for (var prop in searchParams) {\n if (!Object.prototype.hasOwnProperty.call(searchParams, prop)) {\n continue;\n }\n if (item[prop] !== searchParams[prop]) {\n found = false;\n break;\n }\n }\n if (found) {\n return item;\n }\n }\n}\nfunction getLink(obj, linkName, altName) {\n if (!obj || !obj._links) {\n return;\n }\n var link = clone(obj._links[linkName]);\n if (link && link.name && altName) {\n if (link.name === altName) {\n return link;\n }\n }\n else {\n return link;\n }\n}\n\nexport { bind, clone, extend, find, getLink, omit, removeNils };\n//# sourceMappingURL=object.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nclass CustomError extends Error {\n constructor(message) {\n super(message);\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nexport { CustomError as default };\n//# sourceMappingURL=CustomError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\nfunction isNumber(obj) {\n return Object.prototype.toString.call(obj) === '[object Number]';\n}\nfunction isFunction(fn) {\n return !!fn && {}.toString.call(fn) === '[object Function]';\n}\nfunction isPromise(obj) {\n return obj && obj.finally && (typeof obj.finally === 'function');\n}\n\nexport { isFunction, isNumber, isObject, isPromise, isString };\n//# sourceMappingURL=types.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from './CustomError.js';\nimport { isFunction } from '../util/types.js';\n\nclass WWWAuthError extends CustomError {\n constructor(scheme, parameters, resp) {\n var _a;\n super((_a = parameters.error) !== null && _a !== void 0 ? _a : WWWAuthError.UNKNOWN_ERROR);\n this.name = 'WWWAuthError';\n this.resp = null;\n this.scheme = scheme;\n this.parameters = parameters;\n if (resp) {\n this.resp = resp;\n }\n }\n get error() { return this.parameters.error; }\n get errorCode() { return this.error; }\n get error_description() { return this.parameters.error_description; }\n get errorDescription() { return this.error_description; }\n get errorSummary() { return this.errorDescription; }\n get realm() { return this.parameters.realm; }\n static parseHeader(header) {\n var _a;\n if (!header) {\n return null;\n }\n const regex = /(?:,|, )?([a-zA-Z0-9!#$%&'*+\\-.^_`|~]+)=(?:\"([a-zA-Z0-9!#$%&'*+\\-.,^_`|~ /:]+)\"|([a-zA-Z0-9!#$%&'*+\\-.^_`|~/:]+))/g;\n const firstSpace = header.indexOf(' ');\n const scheme = header.slice(0, firstSpace);\n const remaining = header.slice(firstSpace + 1);\n const params = {};\n let match;\n while ((match = regex.exec(remaining)) !== null) {\n params[match[1]] = ((_a = match[2]) !== null && _a !== void 0 ? _a : match[3]);\n }\n return new WWWAuthError(scheme, params);\n }\n static getWWWAuthenticateHeader(headers = {}) {\n var _a;\n if (isFunction(headers === null || headers === void 0 ? void 0 : headers.get)) {\n return headers.get('WWW-Authenticate');\n }\n return (_a = headers['www-authenticate']) !== null && _a !== void 0 ? _a : headers['WWW-Authenticate'];\n }\n}\nWWWAuthError.UNKNOWN_ERROR = 'UNKNOWN_WWW_AUTH_ERROR';\n\nexport { WWWAuthError as default };\n//# sourceMappingURL=WWWAuthError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction isoToUTCString(str) {\n var parts = str.match(/\\d+/g), isoTime = Date.UTC(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]), isoDate = new Date(isoTime);\n return isoDate.toUTCString();\n}\nfunction genRandomString(length) {\n var randomCharset = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n var random = '';\n for (var c = 0, cl = randomCharset.length; c < length; ++c) {\n random += randomCharset[Math.floor(Math.random() * cl)];\n }\n return random;\n}\nfunction delay(ms) {\n return new Promise(function (resolve) {\n setTimeout(resolve, ms);\n });\n}\nfunction split2(str, delim) {\n const parts = str.split(delim);\n return [\n parts[0],\n parts.splice(1, parts.length).join(delim),\n ];\n}\n\nexport { delay, genRandomString, isoToUTCString, split2 };\n//# sourceMappingURL=misc.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction isAbsoluteUrl(url) {\n return /^[a-z][a-z0-9+.-]*:/i.test(url);\n}\nfunction toAbsoluteUrl(url = '', baseUrl) {\n if (isAbsoluteUrl(url)) {\n return url;\n }\n baseUrl = removeTrailingSlash(baseUrl);\n return url[0] === '/' ? `${baseUrl}${url}` : `${baseUrl}/${url}`;\n}\nfunction toRelativeUrl(url = '', baseUrl) {\n if (isAbsoluteUrl(url)) {\n url = url.substring(baseUrl.length);\n }\n return url[0] === '/' ? url : `/${url}`;\n}\nfunction toQueryString(obj) {\n var str = [];\n if (obj !== null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) &&\n obj[key] !== undefined &&\n obj[key] !== null) {\n str.push(key + '=' + encodeURIComponent(obj[key]));\n }\n }\n }\n if (str.length) {\n return '?' + str.join('&');\n }\n else {\n return '';\n }\n}\nfunction removeTrailingSlash(path) {\n if (!path) {\n return;\n }\n var trimmed = path.replace(/^\\s+|\\s+$/gm, '');\n trimmed = trimmed.replace(/\\/+$/, '');\n return trimmed;\n}\n\nexport { isAbsoluteUrl, removeTrailingSlash, toAbsoluteUrl, toQueryString, toRelativeUrl };\n//# sourceMappingURL=url.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from './CustomError.js';\n\nclass AuthSdkError extends CustomError {\n constructor(msg, xhr) {\n super(msg);\n this.name = 'AuthSdkError';\n this.errorCode = 'INTERNAL';\n this.errorSummary = msg;\n this.errorLink = 'INTERNAL';\n this.errorId = 'INTERNAL';\n this.errorCauses = [];\n if (xhr) {\n this.xhr = xhr;\n }\n }\n}\n\nexport { AuthSdkError as default };\n//# sourceMappingURL=AuthSdkError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { genRandomString } from '../../util/misc.js';\nimport { removeTrailingSlash } from '../../util/url.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\n\nfunction generateState() {\n return genRandomString(64);\n}\nfunction generateNonce() {\n return genRandomString(64);\n}\nfunction getIssuer(sdk, options = {}) {\n const issuer = removeTrailingSlash(options.issuer) || sdk.options.issuer;\n return issuer;\n}\nfunction getOAuthBaseUrl(sdk, options = {}) {\n const issuer = getIssuer(sdk, options);\n const baseUrl = issuer.indexOf('/oauth2') > 0 ? issuer : issuer + '/oauth2';\n return baseUrl;\n}\nfunction getOAuthDomain(sdk, options = {}) {\n const issuer = getIssuer(sdk, options);\n const domain = issuer.split('/oauth2')[0];\n return domain;\n}\nfunction getOAuthUrls(sdk, options) {\n if (arguments.length > 2) {\n throw new AuthSdkError('As of version 3.0, \"getOAuthUrls\" takes only a single set of options');\n }\n options = options || {};\n var authorizeUrl = removeTrailingSlash(options.authorizeUrl) || sdk.options.authorizeUrl;\n var issuer = getIssuer(sdk, options);\n var userinfoUrl = removeTrailingSlash(options.userinfoUrl) || sdk.options.userinfoUrl;\n var tokenUrl = removeTrailingSlash(options.tokenUrl) || sdk.options.tokenUrl;\n var logoutUrl = removeTrailingSlash(options.logoutUrl) || sdk.options.logoutUrl;\n var revokeUrl = removeTrailingSlash(options.revokeUrl) || sdk.options.revokeUrl;\n var baseUrl = getOAuthBaseUrl(sdk, options);\n authorizeUrl = authorizeUrl || baseUrl + '/v1/authorize';\n userinfoUrl = userinfoUrl || baseUrl + '/v1/userinfo';\n tokenUrl = tokenUrl || baseUrl + '/v1/token';\n revokeUrl = revokeUrl || baseUrl + '/v1/revoke';\n logoutUrl = logoutUrl || baseUrl + '/v1/logout';\n return {\n issuer: issuer,\n authorizeUrl: authorizeUrl,\n userinfoUrl: userinfoUrl,\n tokenUrl: tokenUrl,\n revokeUrl: revokeUrl,\n logoutUrl: logoutUrl\n };\n}\n\nexport { generateNonce, generateState, getOAuthBaseUrl, getOAuthDomain, getOAuthUrls };\n//# sourceMappingURL=oauth.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getOAuthUrls } from './oauth.js';\n\nfunction createOAuthMeta(sdk, tokenParams) {\n const issuer = sdk.options.issuer;\n const urls = getOAuthUrls(sdk, tokenParams);\n const oauthMeta = {\n issuer,\n urls,\n clientId: tokenParams.clientId,\n redirectUri: tokenParams.redirectUri,\n responseType: tokenParams.responseType,\n responseMode: tokenParams.responseMode,\n scopes: tokenParams.scopes,\n state: tokenParams.state,\n nonce: tokenParams.nonce,\n ignoreSignature: tokenParams.ignoreSignature,\n acrValues: tokenParams.acrValues,\n extraParams: tokenParams.extraParams\n };\n if (tokenParams.pkce === false) {\n return oauthMeta;\n }\n const pkceMeta = Object.assign(Object.assign({}, oauthMeta), { codeVerifier: tokenParams.codeVerifier, codeChallengeMethod: tokenParams.codeChallengeMethod, codeChallenge: tokenParams.codeChallenge });\n return pkceMeta;\n}\n\nexport { createOAuthMeta };\n//# sourceMappingURL=oauthMeta.js.map\n","function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\n","/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n },\n write: function (value) {\n return encodeURIComponent(value).replace(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n function set (name, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n\n name = encodeURIComponent(name)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return (document.cookie =\n name + '=' + converter.write(value, name) + stringifiedAttributes)\n }\n\n function get (name) {\n if (typeof document === 'undefined' || (arguments.length && !name)) {\n return\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n\n if (name === found) {\n break\n }\n } catch (e) {}\n }\n\n return name ? jar[name] : jar\n }\n\n return Object.create(\n {\n set,\n get,\n remove: function (name, attributes) {\n set(\n name,\n '',\n assign({}, attributes, {\n expires: -1\n })\n );\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes))\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes)\n }\n },\n {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","var global = typeof self !== 'undefined' ? self : this;\nvar __self__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = global.DOMException\n}\nF.prototype = global;\nreturn new F();\n})();\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nvar TokenKind;\n(function (TokenKind) {\n TokenKind[\"ACCESS\"] = \"accessToken\";\n TokenKind[\"ID\"] = \"idToken\";\n TokenKind[\"REFRESH\"] = \"refreshToken\";\n})(TokenKind || (TokenKind = {}));\nfunction isToken(obj) {\n if (obj &&\n (obj.accessToken || obj.idToken || obj.refreshToken) &&\n Array.isArray(obj.scopes)) {\n return true;\n }\n return false;\n}\nfunction isAccessToken(obj) {\n return obj && obj.accessToken;\n}\nfunction isIDToken(obj) {\n return obj && obj.idToken;\n}\nfunction isRefreshToken(obj) {\n return obj && obj.refreshToken;\n}\n\nexport { TokenKind, isAccessToken, isIDToken, isRefreshToken, isToken };\n//# sourceMappingURL=Token.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { warn } from '../util/console.js';\nimport { removeNils } from '../util/object.js';\nimport '../errors/WWWAuthError.js';\nimport { createOAuthMeta } from '../oidc/util/oauthMeta.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\n\nasync function createTransactionMeta(authClient, options = {}) {\n const tokenParams = await authClient.token.prepareTokenParams(options);\n const pkceMeta = createOAuthMeta(authClient, tokenParams);\n let { flow = 'default', withCredentials = true, activationToken = undefined, recoveryToken = undefined, maxAge = undefined, acrValues = undefined, } = Object.assign(Object.assign({}, authClient.options), options);\n const meta = Object.assign(Object.assign({}, pkceMeta), { flow,\n withCredentials,\n activationToken,\n recoveryToken,\n maxAge,\n acrValues });\n return meta;\n}\nfunction hasSavedInteractionHandle(authClient, options) {\n const savedMeta = getSavedTransactionMeta(authClient, options);\n if (savedMeta === null || savedMeta === void 0 ? void 0 : savedMeta.interactionHandle) {\n return true;\n }\n return false;\n}\nfunction getSavedTransactionMeta(authClient, options) {\n options = removeNils(options);\n options = Object.assign(Object.assign({}, authClient.options), options);\n let savedMeta;\n try {\n savedMeta = authClient.transactionManager.load(options);\n }\n catch (e) {\n }\n if (!savedMeta) {\n return;\n }\n if (isTransactionMetaValid(savedMeta, options)) {\n return savedMeta;\n }\n warn('Saved transaction meta does not match the current configuration. ' +\n 'This may indicate that two apps are sharing a storage key.');\n}\nasync function getTransactionMeta(authClient, options) {\n options = removeNils(options);\n options = Object.assign(Object.assign({}, authClient.options), options);\n const validExistingMeta = getSavedTransactionMeta(authClient, options);\n if (validExistingMeta) {\n return validExistingMeta;\n }\n return createTransactionMeta(authClient, options);\n}\nfunction saveTransactionMeta(authClient, meta) {\n authClient.transactionManager.save(meta, { muteWarning: true });\n}\nfunction clearTransactionMeta(authClient) {\n authClient.transactionManager.clear();\n}\nfunction isTransactionMetaValid(meta, options = {}) {\n const keys = [\n 'issuer',\n 'clientId',\n 'redirectUri',\n 'state',\n 'codeChallenge',\n 'codeChallengeMethod',\n 'activationToken',\n 'recoveryToken'\n ];\n if (isTransactionMetaValidForOptions(meta, options, keys) === false) {\n return false;\n }\n const { flow } = options;\n if (isTransactionMetaValidForFlow(meta, flow) === false) {\n return false;\n }\n return true;\n}\nfunction isTransactionMetaValidForFlow(meta, flow) {\n const shouldValidateFlow = flow && flow !== 'default' && flow !== 'proceed';\n if (shouldValidateFlow) {\n if (flow !== meta.flow) {\n return false;\n }\n }\n return true;\n}\nfunction isTransactionMetaValidForOptions(meta, options, keys) {\n const mismatch = keys.some(key => {\n const value = options[key];\n if (value && value !== meta[key]) {\n return true;\n }\n });\n return !mismatch;\n}\n\nexport { clearTransactionMeta, createTransactionMeta, getSavedTransactionMeta, getTransactionMeta, hasSavedInteractionHandle, isTransactionMetaValid, isTransactionMetaValidForFlow, isTransactionMetaValidForOptions, saveTransactionMeta };\n//# sourceMappingURL=transactionMeta.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst STATE_TOKEN_KEY_NAME = 'oktaStateToken';\nconst DEFAULT_POLLING_DELAY = 500;\nconst DEFAULT_MAX_CLOCK_SKEW = 300;\nconst DEFAULT_CACHE_DURATION = 86400;\nconst TOKEN_STORAGE_NAME = 'okta-token-storage';\nconst CACHE_STORAGE_NAME = 'okta-cache-storage';\nconst PKCE_STORAGE_NAME = 'okta-pkce-storage';\nconst TRANSACTION_STORAGE_NAME = 'okta-transaction-storage';\nconst SHARED_TRANSACTION_STORAGE_NAME = 'okta-shared-transaction-storage';\nconst ORIGINAL_URI_STORAGE_NAME = 'okta-original-uri-storage';\nconst IDX_RESPONSE_STORAGE_NAME = 'okta-idx-response-storage';\nconst ACCESS_TOKEN_STORAGE_KEY = 'accessToken';\nconst ID_TOKEN_STORAGE_KEY = 'idToken';\nconst REFRESH_TOKEN_STORAGE_KEY = 'refreshToken';\nconst REFERRER_PATH_STORAGE_KEY = 'referrerPath';\nconst MIN_VERIFIER_LENGTH = 43;\nconst MAX_VERIFIER_LENGTH = 128;\nconst DEFAULT_CODE_CHALLENGE_METHOD = 'S256';\nconst IDX_API_VERSION = '1.0.0';\n\nexport { ACCESS_TOKEN_STORAGE_KEY, CACHE_STORAGE_NAME, DEFAULT_CACHE_DURATION, DEFAULT_CODE_CHALLENGE_METHOD, DEFAULT_MAX_CLOCK_SKEW, DEFAULT_POLLING_DELAY, IDX_API_VERSION, IDX_RESPONSE_STORAGE_NAME, ID_TOKEN_STORAGE_KEY, MAX_VERIFIER_LENGTH, MIN_VERIFIER_LENGTH, ORIGINAL_URI_STORAGE_NAME, PKCE_STORAGE_NAME, REFERRER_PATH_STORAGE_KEY, REFRESH_TOKEN_STORAGE_KEY, SHARED_TRANSACTION_STORAGE_NAME, STATE_TOKEN_KEY_NAME, TOKEN_STORAGE_NAME, TRANSACTION_STORAGE_NAME };\n//# sourceMappingURL=constants.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from './CustomError.js';\n\nclass AuthApiError extends CustomError {\n constructor(err, xhr, meta) {\n const message = err.errorSummary;\n super(message);\n this.name = 'AuthApiError';\n this.errorSummary = err.errorSummary;\n this.errorCode = err.errorCode;\n this.errorLink = err.errorLink;\n this.errorId = err.errorId;\n this.errorCauses = err.errorCauses;\n if (xhr) {\n this.xhr = xhr;\n }\n if (meta) {\n this.meta = meta;\n }\n }\n}\n\nexport { AuthApiError as default };\n//# sourceMappingURL=AuthApiError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from './CustomError.js';\n\nclass OAuthError extends CustomError {\n constructor(errorCode, summary, resp) {\n super(summary);\n this.resp = null;\n this.name = 'OAuthError';\n this.errorCode = errorCode;\n this.errorSummary = summary;\n this.error = errorCode;\n this.error_description = summary;\n if (resp) {\n this.resp = resp;\n }\n }\n}\n\nexport { OAuthError as default };\n//# sourceMappingURL=OAuthError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { removeNils, clone } from '../util/object.js';\nimport { isString } from '../util/types.js';\nimport { isAbsoluteUrl } from '../util/url.js';\nimport { STATE_TOKEN_KEY_NAME, DEFAULT_CACHE_DURATION } from '../constants.js';\nimport AuthApiError from '../errors/AuthApiError.js';\nimport OAuthError from '../errors/OAuthError.js';\nimport WWWAuthError from '../errors/WWWAuthError.js';\n\nconst formatError = (sdk, error) => {\n var _a;\n if (error instanceof Error) {\n return new AuthApiError({\n errorSummary: error.message,\n });\n }\n let resp = error;\n let err;\n let serverErr = {};\n if (resp.responseText && isString(resp.responseText)) {\n try {\n serverErr = JSON.parse(resp.responseText);\n }\n catch (e) {\n serverErr = {\n errorSummary: 'Unknown error'\n };\n }\n }\n if (resp.status >= 500) {\n serverErr.errorSummary = 'Unknown error';\n }\n if (sdk.options.transformErrorXHR) {\n resp = sdk.options.transformErrorXHR(clone(resp));\n }\n const wwwAuthHeader = (_a = WWWAuthError.getWWWAuthenticateHeader(resp === null || resp === void 0 ? void 0 : resp.headers)) !== null && _a !== void 0 ? _a : '';\n if (serverErr.error && serverErr.error_description) {\n err = new OAuthError(serverErr.error, serverErr.error_description, resp);\n }\n else {\n err = new AuthApiError(serverErr, resp, { wwwAuthHeader });\n }\n if (wwwAuthHeader && (resp === null || resp === void 0 ? void 0 : resp.status) >= 400 && (resp === null || resp === void 0 ? void 0 : resp.status) < 500) {\n const wwwAuthErr = WWWAuthError.parseHeader(wwwAuthHeader);\n if (resp.status === 403 && (wwwAuthErr === null || wwwAuthErr === void 0 ? void 0 : wwwAuthErr.error) === 'insufficient_authentication_context') {\n const { max_age, acr_values } = wwwAuthErr.parameters;\n err = new AuthApiError({\n errorSummary: wwwAuthErr.error,\n errorCauses: [{ errorSummary: wwwAuthErr.errorDescription }]\n }, resp, Object.assign({\n max_age: +max_age }, (acr_values && { acr_values })));\n }\n else if ((wwwAuthErr === null || wwwAuthErr === void 0 ? void 0 : wwwAuthErr.scheme) === 'DPoP') {\n err = wwwAuthErr;\n }\n }\n return err;\n};\nfunction httpRequest(sdk, options) {\n options = options || {};\n if (sdk.options.httpRequestInterceptors) {\n for (const interceptor of sdk.options.httpRequestInterceptors) {\n interceptor(options);\n }\n }\n var url = options.url, method = options.method, args = options.args, saveAuthnState = options.saveAuthnState, accessToken = options.accessToken, withCredentials = options.withCredentials === true,\n storageUtil = sdk.options.storageUtil, storage = storageUtil.storage, httpCache = sdk.storageManager.getHttpCache(sdk.options.cookies);\n if (options.cacheResponse) {\n var cacheContents = httpCache.getStorage();\n var cachedResponse = cacheContents[url];\n if (cachedResponse && Date.now() / 1000 < cachedResponse.expiresAt) {\n return Promise.resolve(cachedResponse.response);\n }\n }\n var oktaUserAgentHeader = sdk._oktaUserAgent.getHttpHeader();\n var headers = Object.assign({ 'Accept': 'application/json', 'Content-Type': 'application/json' }, oktaUserAgentHeader);\n Object.assign(headers, sdk.options.headers, options.headers);\n headers = removeNils(headers);\n if (accessToken && isString(accessToken)) {\n headers['Authorization'] = 'Bearer ' + accessToken;\n }\n var ajaxOptions = {\n headers,\n data: args || undefined,\n withCredentials\n };\n var err, res;\n return sdk.options.httpRequestClient(method, url, ajaxOptions)\n .then(function (resp) {\n res = resp.responseText;\n if (res && isString(res)) {\n res = JSON.parse(res);\n if (res && typeof res === 'object' && !res.headers) {\n if (Array.isArray(res)) {\n res.forEach(item => {\n item.headers = resp.headers;\n });\n }\n else {\n res.headers = resp.headers;\n }\n }\n }\n if (saveAuthnState) {\n if (!res.stateToken) {\n storage.delete(STATE_TOKEN_KEY_NAME);\n }\n }\n if (res && res.stateToken && res.expiresAt) {\n storage.set(STATE_TOKEN_KEY_NAME, res.stateToken, res.expiresAt, sdk.options.cookies);\n }\n if (res && options.cacheResponse) {\n httpCache.updateStorage(url, {\n expiresAt: Math.floor(Date.now() / 1000) + DEFAULT_CACHE_DURATION,\n response: res\n });\n }\n return res;\n })\n .catch(function (resp) {\n err = formatError(sdk, resp);\n if (err.errorCode === 'E0000011') {\n storage.delete(STATE_TOKEN_KEY_NAME);\n }\n throw err;\n });\n}\nfunction get(sdk, url, options) {\n url = isAbsoluteUrl(url) ? url : sdk.getIssuerOrigin() + url;\n var getOptions = {\n url: url,\n method: 'GET'\n };\n Object.assign(getOptions, options);\n return httpRequest(sdk, getOptions);\n}\nfunction post(sdk, url, args, options) {\n url = isAbsoluteUrl(url) ? url : sdk.getIssuerOrigin() + url;\n var postOptions = {\n url: url,\n method: 'POST',\n args: args,\n saveAuthnState: true\n };\n Object.assign(postOptions, options);\n return httpRequest(sdk, postOptions);\n}\n\nexport { get, httpRequest, post };\n//# sourceMappingURL=request.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getSavedTransactionMeta, createTransactionMeta, saveTransactionMeta } from './transactionMeta.js';\nimport { removeNils } from '../util/object.js';\nimport '../errors/WWWAuthError.js';\nimport { getOAuthBaseUrl } from '../oidc/util/oauth.js';\nimport { httpRequest } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\n\nfunction getResponse(meta) {\n return {\n meta,\n interactionHandle: meta.interactionHandle,\n state: meta.state\n };\n}\nasync function interact(authClient, options = {}) {\n options = removeNils(options);\n let meta = getSavedTransactionMeta(authClient, options);\n if (meta === null || meta === void 0 ? void 0 : meta.interactionHandle) {\n return getResponse(meta);\n }\n meta = await createTransactionMeta(authClient, Object.assign(Object.assign({}, meta), options));\n const baseUrl = getOAuthBaseUrl(authClient);\n let { clientId, redirectUri, state, scopes, withCredentials, codeChallenge, codeChallengeMethod, activationToken, recoveryToken, maxAge, acrValues, nonce } = meta;\n const clientSecret = options.clientSecret || authClient.options.clientSecret;\n withCredentials = withCredentials !== null && withCredentials !== void 0 ? withCredentials : true;\n const url = `${baseUrl}/v1/interact`;\n const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ client_id: clientId, scope: scopes.join(' '), redirect_uri: redirectUri, code_challenge: codeChallenge, code_challenge_method: codeChallengeMethod, state }, (activationToken && { activation_token: activationToken })), (recoveryToken && { recovery_token: recoveryToken })), (clientSecret && { client_secret: clientSecret })), (maxAge && { max_age: maxAge })), (acrValues && { acr_values: acrValues })), (nonce && { nonce }));\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n const resp = await httpRequest(authClient, {\n method: 'POST',\n url,\n headers,\n withCredentials,\n args: params\n });\n const interactionHandle = resp.interaction_handle;\n const newMeta = Object.assign(Object.assign({}, meta), { interactionHandle,\n withCredentials,\n state,\n scopes,\n recoveryToken,\n activationToken });\n saveTransactionMeta(authClient, newMeta);\n return getResponse(newMeta);\n}\n\nexport { interact };\n//# sourceMappingURL=interact.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\nexport { __rest };\n//# sourceMappingURL=_tslib.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst isFieldMutable = function isFieldMutable(field) {\n return (field.mutable !== false);\n};\nconst divideSingleActionParamsByMutability = function divideSingleActionParamsByMutability(action) {\n var _a, _b;\n const defaultParamsForAction = {};\n const neededParamsForAction = [];\n const immutableParamsForAction = {};\n if (!action.value) {\n neededParamsForAction.push(action);\n return { defaultParamsForAction, neededParamsForAction, immutableParamsForAction };\n }\n for (let field of action.value) {\n if (isFieldMutable(field)) {\n neededParamsForAction.push(field);\n if ((_a = field.value) !== null && _a !== void 0 ? _a : false) {\n defaultParamsForAction[field.name] = field.value;\n }\n }\n else {\n immutableParamsForAction[field.name] = (_b = field.value) !== null && _b !== void 0 ? _b : '';\n }\n }\n return { defaultParamsForAction, neededParamsForAction, immutableParamsForAction };\n};\nconst divideActionParamsByMutability = function divideActionParamsByMutability(actionList) {\n actionList = Array.isArray(actionList) ? actionList : [actionList];\n const neededParams = [];\n const defaultParams = {};\n const immutableParams = {};\n for (let action of actionList) {\n const { defaultParamsForAction, neededParamsForAction, immutableParamsForAction } = divideSingleActionParamsByMutability(action);\n neededParams.push(neededParamsForAction);\n defaultParams[action.name] = defaultParamsForAction;\n immutableParams[action.name] = immutableParamsForAction;\n }\n return { defaultParams, neededParams, immutableParams };\n};\n\nexport { divideActionParamsByMutability };\n//# sourceMappingURL=actionParser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthApiError from '../../../errors/AuthApiError.js';\nimport '../../../errors/WWWAuthError.js';\nimport { httpRequest } from '../../../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { divideActionParamsByMutability } from './actionParser.js';\n\nconst generateDirectFetch = function generateDirectFetch(authClient, { actionDefinition, defaultParamsForAction = {}, immutableParamsForAction = {}, toPersist = {} }) {\n const target = actionDefinition.href;\n return async function (params = {}) {\n var _a;\n const headers = {\n 'Content-Type': 'application/json',\n 'Accept': actionDefinition.accepts || 'application/ion+json',\n };\n const body = JSON.stringify(Object.assign(Object.assign(Object.assign({}, defaultParamsForAction), params), immutableParamsForAction));\n try {\n const response = await httpRequest(authClient, {\n url: target,\n method: actionDefinition.method,\n headers,\n args: body,\n withCredentials: (_a = toPersist === null || toPersist === void 0 ? void 0 : toPersist.withCredentials) !== null && _a !== void 0 ? _a : true\n });\n return authClient.idx.makeIdxResponse(Object.assign({}, response), toPersist, true);\n }\n catch (err) {\n if (!(err instanceof AuthApiError) || !(err === null || err === void 0 ? void 0 : err.xhr)) {\n throw err;\n }\n const response = err.xhr;\n const payload = response.responseJSON || JSON.parse(response.responseText);\n const wwwAuthHeader = response.headers['WWW-Authenticate'] || response.headers['www-authenticate'];\n const idxResponse = authClient.idx.makeIdxResponse(Object.assign({}, payload), toPersist, false);\n if (response.status === 401 && wwwAuthHeader === 'Oktadevicejwt realm=\"Okta Device\"') {\n idxResponse.stepUp = true;\n }\n return idxResponse;\n }\n };\n};\nconst generateIdxAction = function generateIdxAction(authClient, actionDefinition, toPersist) {\n const generator = generateDirectFetch;\n const { defaultParams, neededParams, immutableParams } = divideActionParamsByMutability(actionDefinition);\n const action = generator(authClient, {\n actionDefinition,\n defaultParamsForAction: defaultParams[actionDefinition.name],\n immutableParamsForAction: immutableParams[actionDefinition.name],\n toPersist\n });\n action.neededParams = neededParams;\n return action;\n};\n\nexport { generateIdxAction as default };\n//# sourceMappingURL=generateIdxAction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport generateIdxAction from './generateIdxAction.js';\n\nconst generateRemediationFunctions = function generateRemediationFunctions(authClient, remediationValue, toPersist = {}) {\n return remediationValue.reduce((obj, remediation) => (Object.assign(Object.assign({}, obj), { [remediation.name]: generateIdxAction(authClient, remediation, toPersist) })), {});\n};\n\nexport { generateRemediationFunctions };\n//# sourceMappingURL=remediationParser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst jsonpathRegex = /\\$?(?\\w+)|(?:\\[(?\\d+)\\])/g;\nfunction jsonpath({ path, json }) {\n var _a, _b, _c;\n const steps = [];\n let match;\n while ((match = jsonpathRegex.exec(path)) !== null) {\n const step = (_b = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.index;\n if (step) {\n steps.push(step);\n }\n }\n if (steps.length < 1) {\n return undefined;\n }\n const lastStep = steps.pop();\n let curr = json;\n for (const step of steps) {\n if (Object.prototype.hasOwnProperty.call(curr, step)) {\n if (typeof curr[step] !== 'object') {\n return undefined;\n }\n curr = curr[step];\n }\n }\n return curr[lastStep];\n}\n\nexport { jsonpath };\n//# sourceMappingURL=jsonpath.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { __rest } from '../../../_virtual/_tslib.js';\nimport { generateRemediationFunctions } from './remediationParser.js';\nimport generateIdxAction from './generateIdxAction.js';\nimport { jsonpath } from '../../../util/jsonpath.js';\nimport AuthSdkError from '../../../errors/AuthSdkError.js';\nimport '../../../errors/WWWAuthError.js';\n\nconst SKIP_FIELDS = {\n 'remediation': true,\n 'context': true,\n};\nconst parseNonRemediations = function parseNonRemediations(authClient, idxResponse, toPersist = {}) {\n const actions = {};\n const context = {};\n Object.keys(idxResponse)\n .filter(field => !SKIP_FIELDS[field])\n .forEach(field => {\n const fieldIsObject = typeof idxResponse[field] === 'object' && !!idxResponse[field];\n if (!fieldIsObject) {\n context[field] = idxResponse[field];\n return;\n }\n if (idxResponse[field].rel) {\n actions[idxResponse[field].name] = generateIdxAction(authClient, idxResponse[field], toPersist);\n return;\n }\n const _a = idxResponse[field], { value: fieldValue, type } = _a, info = __rest(_a, [\"value\", \"type\"]);\n context[field] = Object.assign({ type }, info);\n if (type !== 'object') {\n context[field].value = fieldValue;\n return;\n }\n context[field].value = {};\n Object.entries(fieldValue)\n .forEach(([subField, value]) => {\n if (value.rel) {\n actions[`${field}-${subField.name || subField}`] = generateIdxAction(authClient, value, toPersist);\n }\n else {\n context[field].value[subField] = value;\n }\n });\n });\n return { context, actions };\n};\nconst expandRelatesTo = (idxResponse, value) => {\n Object.keys(value).forEach(k => {\n if (k === 'relatesTo') {\n const query = Array.isArray(value[k]) ? value[k][0] : value[k];\n if (typeof query === 'string') {\n const result = jsonpath({ path: query, json: idxResponse });\n if (result) {\n value[k] = result;\n return;\n }\n else {\n throw new AuthSdkError(`Cannot resolve relatesTo: ${query}`);\n }\n }\n }\n if (Array.isArray(value[k])) {\n value[k].forEach(innerValue => expandRelatesTo(idxResponse, innerValue));\n }\n });\n};\nconst convertRemediationAction = (authClient, remediation, toPersist) => {\n if (remediation.rel) {\n const remediationActions = generateRemediationFunctions(authClient, [remediation], toPersist);\n const actionFn = remediationActions[remediation.name];\n return Object.assign(Object.assign({}, remediation), { action: actionFn });\n }\n return remediation;\n};\nconst parseIdxResponse = function parseIdxResponse(authClient, idxResponse, toPersist = {}) {\n var _a;\n const remediationData = ((_a = idxResponse.remediation) === null || _a === void 0 ? void 0 : _a.value) || [];\n remediationData.forEach(remediation => {\n var _a;\n if (remediation.name === 'launch-authenticator' &&\n ((_a = remediation === null || remediation === void 0 ? void 0 : remediation.relatesTo) === null || _a === void 0 ? void 0 : _a[0]) === 'authenticatorChallenge' &&\n !(idxResponse === null || idxResponse === void 0 ? void 0 : idxResponse.authenticatorChallenge)) {\n delete remediation.relatesTo;\n return;\n }\n return expandRelatesTo(idxResponse, remediation);\n });\n const remediations = remediationData.map(remediation => convertRemediationAction(authClient, remediation, toPersist));\n const { context, actions } = parseNonRemediations(authClient, idxResponse, toPersist);\n return {\n remediations,\n context,\n actions,\n };\n};\n\nexport { parseIdxResponse, parseNonRemediations };\n//# sourceMappingURL=idxResponseParser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { parseIdxResponse } from './idxResponseParser.js';\n\nfunction makeIdxState(authClient, idxResponse, toPersist, requestDidSucceed) {\n var _a, _b, _c;\n const rawIdxResponse = idxResponse;\n const { remediations, context, actions } = parseIdxResponse(authClient, idxResponse, toPersist);\n const neededToProceed = [...remediations];\n const proceed = async function (remediationChoice, paramsFromUser = {}) {\n const remediationChoiceObject = remediations.find((remediation) => remediation.name === remediationChoice);\n if (!remediationChoiceObject) {\n return Promise.reject(`Unknown remediation choice: [${remediationChoice}]`);\n }\n const actionFn = remediationChoiceObject.action;\n if (typeof actionFn !== 'function') {\n return Promise.reject(`Current remediation cannot make form submit action: [${remediationChoice}]`);\n }\n return remediationChoiceObject.action(paramsFromUser);\n };\n const findCode = item => item.name === 'interaction_code';\n const interactionCode = (_c = (_b = (_a = rawIdxResponse.successWithInteractionCode) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.find(findCode)) === null || _c === void 0 ? void 0 : _c.value;\n return {\n proceed,\n neededToProceed,\n actions,\n context,\n rawIdxState: rawIdxResponse,\n interactionCode,\n toPersist,\n requestDidSucceed,\n };\n}\n\nexport { makeIdxState };\n//# sourceMappingURL=makeIdxState.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { makeIdxState } from './makeIdxState.js';\n\nvar v1 = {\n makeIdxState,\n};\n\nexport { v1 as default };\n//# sourceMappingURL=parsers.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IDX_API_VERSION } from '../../constants.js';\nimport v1 from './v1/parsers.js';\n\nconst parsersForVersion = function parsersForVersion(version) {\n switch (version) {\n case '1.0.0':\n return v1;\n case undefined:\n case null:\n throw new Error('Api version is required');\n default:\n throw new Error(`Unknown api version: ${version}. Use an exact semver version.`);\n }\n};\nfunction validateVersionConfig(version) {\n if (!version) {\n throw new Error('version is required');\n }\n const cleanVersion = (version !== null && version !== void 0 ? version : '').replace(/[^0-9a-zA-Z._-]/, '');\n if (cleanVersion !== version || !version) {\n throw new Error('invalid version supplied - version is required and uses semver syntax');\n }\n parsersForVersion(version);\n}\nfunction makeIdxState(authClient, rawIdxResponse, toPersist, requestDidSucceed) {\n var _a;\n const version = (_a = rawIdxResponse === null || rawIdxResponse === void 0 ? void 0 : rawIdxResponse.version) !== null && _a !== void 0 ? _a : IDX_API_VERSION;\n validateVersionConfig(version);\n const { makeIdxState } = parsersForVersion(version);\n return makeIdxState(authClient, rawIdxResponse, toPersist, requestDidSucceed);\n}\n\nexport { makeIdxState, parsersForVersion, validateVersionConfig };\n//# sourceMappingURL=index.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction isRawIdxResponse(obj) {\n return obj && obj.version;\n}\n\nexport { isRawIdxResponse };\n//# sourceMappingURL=idx-js.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthApiError from './AuthApiError.js';\nexport { default as AuthApiError } from './AuthApiError.js';\nimport OAuthError from './OAuthError.js';\nexport { default as OAuthError } from './OAuthError.js';\nimport WWWAuthError from './WWWAuthError.js';\nexport { default as WWWAuthError } from './WWWAuthError.js';\n\nfunction isAuthApiError(obj) {\n return (obj instanceof AuthApiError);\n}\nfunction isOAuthError(obj) {\n return (obj instanceof OAuthError);\n}\nfunction isWWWAuthError(obj) {\n return (obj instanceof WWWAuthError);\n}\n\nexport { isAuthApiError, isOAuthError, isWWWAuthError };\n//# sourceMappingURL=index.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { validateVersionConfig, makeIdxState } from './idxState/index.js';\nimport { isRawIdxResponse } from './types/idx-js.js';\nimport { isAuthApiError } from '../errors/index.js';\nimport { getOAuthDomain } from '../oidc/util/oauth.js';\nimport { IDX_API_VERSION } from '../constants.js';\nimport { httpRequest } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\n\nasync function introspect(authClient, options = {}) {\n var _a;\n let rawIdxResponse;\n let requestDidSucceed;\n const savedIdxResponse = authClient.transactionManager.loadIdxResponse(options);\n if (savedIdxResponse) {\n rawIdxResponse = savedIdxResponse.rawIdxResponse;\n requestDidSucceed = savedIdxResponse.requestDidSucceed;\n }\n if (!rawIdxResponse) {\n const version = options.version || IDX_API_VERSION;\n const domain = getOAuthDomain(authClient);\n const { interactionHandle, stateHandle } = options;\n const withCredentials = (_a = options.withCredentials) !== null && _a !== void 0 ? _a : true;\n try {\n requestDidSucceed = true;\n validateVersionConfig(version);\n const url = `${domain}/idp/idx/introspect`;\n const body = stateHandle ? { stateToken: stateHandle } : { interactionHandle };\n const headers = {\n 'Content-Type': `application/ion+json; okta-version=${version}`,\n Accept: `application/ion+json; okta-version=${version}`,\n };\n rawIdxResponse = await httpRequest(authClient, {\n method: 'POST',\n url,\n headers,\n withCredentials,\n args: body\n });\n }\n catch (err) {\n if (isAuthApiError(err) && err.xhr && isRawIdxResponse(err.xhr.responseJSON)) {\n rawIdxResponse = err.xhr.responseJSON;\n requestDidSucceed = false;\n }\n else {\n throw err;\n }\n }\n }\n const { withCredentials } = options;\n return makeIdxState(authClient, rawIdxResponse, { withCredentials }, requestDidSucceed);\n}\n\nexport { introspect };\n//# sourceMappingURL=introspect.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction getAllValues(idxRemediation) {\n var _a;\n return (_a = idxRemediation.value) === null || _a === void 0 ? void 0 : _a.map(r => r.name);\n}\nfunction getRequiredValues(idxRemediation) {\n var _a;\n return (_a = idxRemediation.value) === null || _a === void 0 ? void 0 : _a.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name);\n }\n return required;\n }, []);\n}\nfunction titleCase(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\nfunction getAuthenticatorFromRemediation(remediation) {\n return remediation.value.find(({ name }) => name === 'authenticator');\n}\n\nexport { getAllValues, getAuthenticatorFromRemediation, getRequiredValues, titleCase };\n//# sourceMappingURL=util.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isAuthenticator } from '../types/api.js';\n\nfunction formatAuthenticator(incoming) {\n let authenticator;\n if (isAuthenticator(incoming)) {\n authenticator = incoming;\n }\n else if (typeof incoming === 'string') {\n authenticator = {\n key: incoming\n };\n }\n else {\n throw new Error('Invalid format for authenticator');\n }\n return authenticator;\n}\nfunction compareAuthenticators(auth1, auth2) {\n if (!auth1 || !auth2) {\n return false;\n }\n if (auth1.id && auth2.id) {\n return (auth1.id === auth2.id);\n }\n if (auth1.key && auth2.key) {\n return (auth1.key === auth2.key);\n }\n return false;\n}\nfunction findMatchedOption(authenticators, options) {\n let option;\n for (let authenticator of authenticators) {\n option = options\n .find(({ relatesTo }) => relatesTo.key && relatesTo.key === authenticator.key);\n if (option) {\n break;\n }\n }\n return option;\n}\n\nexport { compareAuthenticators, findMatchedOption, formatAuthenticator };\n//# sourceMappingURL=util.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getRequiredValues, getAllValues, titleCase, getAuthenticatorFromRemediation } from '../util.js';\nimport { formatAuthenticator, compareAuthenticators } from '../../authenticator/util.js';\n\nclass Remediator {\n constructor(remediation, values = {}, options = {}) {\n this.values = Object.assign({}, values);\n this.options = Object.assign({}, options);\n this.formatAuthenticators();\n this.remediation = remediation;\n }\n formatAuthenticators() {\n this.values.authenticators = (this.values.authenticators || []);\n this.values.authenticators = this.values.authenticators.map(authenticator => {\n return formatAuthenticator(authenticator);\n });\n if (this.values.authenticator) {\n const authenticator = formatAuthenticator(this.values.authenticator);\n const hasAuthenticatorInList = this.values.authenticators.some(existing => {\n return compareAuthenticators(authenticator, existing);\n });\n if (!hasAuthenticatorInList) {\n this.values.authenticators.push(authenticator);\n }\n }\n this.values.authenticatorsData = this.values.authenticators.reduce((acc, authenticator) => {\n if (typeof authenticator === 'object' && Object.keys(authenticator).length > 1) {\n acc.push(authenticator);\n }\n return acc;\n }, this.values.authenticatorsData || []);\n }\n getName() {\n return this.remediation.name;\n }\n canRemediate(context) {\n const required = getRequiredValues(this.remediation);\n const needed = required.find((key) => !this.hasData(key));\n if (needed) {\n return false;\n }\n return true;\n }\n getData(key) {\n if (!key) {\n let allValues = getAllValues(this.remediation);\n let res = allValues.reduce((data, key) => {\n data[key] = this.getData(key);\n return data;\n }, {});\n return res;\n }\n if (typeof this[`map${titleCase(key)}`] === 'function') {\n const val = this[`map${titleCase(key)}`](this.remediation.value.find(({ name }) => name === key));\n if (val) {\n return val;\n }\n }\n if (this.map && this.map[key]) {\n const entry = this.map[key];\n for (let i = 0; i < entry.length; i++) {\n let val = this.values[entry[i]];\n if (val) {\n return val;\n }\n }\n }\n return this.values[key];\n }\n hasData(key\n ) {\n return !!this.getData(key);\n }\n getNextStep(_authClient, _context) {\n const name = this.getName();\n const inputs = this.getInputs();\n const authenticator = this.getAuthenticator();\n const type = authenticator === null || authenticator === void 0 ? void 0 : authenticator.type;\n return Object.assign(Object.assign({ name,\n inputs }, (type && { type })), (authenticator && { authenticator }));\n }\n getInputs() {\n const inputs = [];\n const inputsFromRemediation = this.remediation.value || [];\n inputsFromRemediation.forEach(inputFromRemediation => {\n let input;\n let { name, type, visible, messages } = inputFromRemediation;\n if (visible === false) {\n return;\n }\n if (typeof this[`getInput${titleCase(name)}`] === 'function') {\n input = this[`getInput${titleCase(name)}`](inputFromRemediation);\n }\n else if (type !== 'object') {\n let alias;\n const aliases = (this.map ? this.map[name] : null) || [];\n if (aliases.length === 1) {\n alias = aliases[0];\n }\n else {\n alias = aliases.find(name => Object.keys(this.values).includes(name));\n }\n if (alias) {\n input = Object.assign(Object.assign({}, inputFromRemediation), { name: alias });\n }\n }\n if (!input) {\n input = inputFromRemediation;\n }\n if (Array.isArray(input)) {\n input.forEach(i => inputs.push(i));\n }\n else {\n if (messages) {\n input.messages = messages;\n }\n inputs.push(input);\n }\n });\n return inputs;\n }\n static getMessages(remediation) {\n var _a, _b;\n if (!remediation.value) {\n return;\n }\n return (_b = (_a = remediation.value[0]) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.value.reduce((messages, field) => {\n if (field.messages) {\n messages = [...messages, ...field.messages.value];\n }\n return messages;\n }, []);\n }\n getValuesAfterProceed() {\n const inputsFromRemediation = this.remediation.value || [];\n const inputsFromRemediator = this.getInputs();\n const inputs = [\n ...inputsFromRemediation,\n ...inputsFromRemediator\n ];\n for (const input of inputs) {\n delete this.values[input.name];\n }\n return this.values;\n }\n getAuthenticator() {\n var _a, _b;\n const relatesTo = (_a = this.remediation.relatesTo) === null || _a === void 0 ? void 0 : _a.value;\n if (!relatesTo) {\n return;\n }\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n if (!authenticatorFromRemediation) {\n return relatesTo;\n }\n const id = authenticatorFromRemediation.form.value\n .find(({ name }) => name === 'id').value;\n const enrollmentId = (_b = authenticatorFromRemediation.form.value\n .find(({ name }) => name === 'enrollmentId')) === null || _b === void 0 ? void 0 : _b.value;\n return Object.assign(Object.assign({}, relatesTo), { id,\n enrollmentId });\n }\n}\n\nexport { Remediator };\n//# sourceMappingURL=Remediator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../../../errors/WWWAuthError.js';\n\nfunction unwrapFormValue(remediation) {\n if (Array.isArray(remediation)) {\n return remediation\n .map(item => {\n if (typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean') {\n return item;\n }\n return unwrapFormValue(item);\n });\n }\n const res = {};\n for (const [key, value] of Object.entries(remediation)) {\n if (value === null || typeof value === 'undefined') {\n continue;\n }\n if (typeof value === 'object') {\n const formKeys = Object.keys(value);\n if (['value', 'form'].includes(key)\n && formKeys.length === 1\n && ['value', 'form'].includes(formKeys[0])) {\n const unwrappedForm = unwrapFormValue(value);\n Object.entries(unwrappedForm).forEach(([key, value]) => {\n res[key] = value;\n });\n }\n else {\n res[key] = unwrapFormValue(value);\n }\n }\n else {\n res[key] = value;\n }\n }\n return res;\n}\n\nexport { unwrapFormValue };\n//# sourceMappingURL=util.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { __rest } from '../../../_virtual/_tslib.js';\nimport { Remediator } from '../Base/Remediator.js';\nimport { unwrapFormValue } from './util.js';\n\nclass GenericRemediator extends Remediator {\n canRemediate() {\n if (typeof this.remediation.action !== 'function') {\n return false;\n }\n if (this.remediation.name === 'poll' || this.remediation.name.endsWith('-poll')) {\n return true;\n }\n if (this.options.step) {\n return true;\n }\n return false;\n }\n getData() {\n const data = this.getInputs().reduce((acc, { name }) => {\n acc[name] = this.values[name];\n return acc;\n }, {});\n return data;\n }\n getNextStep(authClient, _context) {\n const name = this.getName();\n const inputs = this.getInputs();\n const _a = this.remediation, {\n href, method, rel, accepts, produces,\n value,\n action } = _a, rest = __rest(_a, [\"href\", \"method\", \"rel\", \"accepts\", \"produces\", \"value\", \"action\"]);\n if (action) {\n return Object.assign(Object.assign(Object.assign({}, rest), (!!inputs.length && { inputs })), { action: async (params) => {\n return authClient.idx.proceed(Object.assign({ step: name }, params));\n } });\n }\n return Object.assign({}, this.remediation);\n }\n getInputs() {\n return (this.remediation.value || [])\n .filter(({ name }) => name !== 'stateHandle')\n .map(unwrapFormValue)\n .map(input => {\n input.type = input.type || 'string';\n return input;\n });\n }\n}\n\nexport { GenericRemediator };\n//# sourceMappingURL=GenericRemediator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { __rest } from '../_virtual/_tslib.js';\nimport { warn } from '../util/console.js';\nimport { split2 } from '../util/misc.js';\nimport { GenericRemediator } from './remediators/GenericRemediator/GenericRemediator.js';\nimport { IdxFeature } from './types/api.js';\n\nconst ctx = {\n remediators: {},\n getFlowSpecification: function (_oktaAuth, _flow = 'default') {\n return {\n remediators: {}\n };\n }\n};\nfunction setRemediatorsCtx(newCtx) {\n Object.assign(ctx, newCtx);\n}\nfunction getFlowSpecification(oktaAuth, flow = 'default') {\n return ctx.getFlowSpecification(oktaAuth, flow);\n}\nfunction isTerminalResponse(idxResponse) {\n const { neededToProceed, interactionCode } = idxResponse;\n return !neededToProceed.length && !interactionCode;\n}\nfunction canSkipFn(idxResponse) {\n return idxResponse.neededToProceed.some(({ name }) => name === 'skip');\n}\nfunction canResendFn(idxResponse) {\n return Object.keys(idxResponse.actions).some(actionName => actionName.includes('resend'));\n}\nfunction getMessagesFromIdxRemediationValue(value) {\n if (!value || !Array.isArray(value)) {\n return;\n }\n return value.reduce((messages, value) => {\n if (value.messages) {\n messages = [...messages, ...value.messages.value];\n }\n if (value.form) {\n const messagesFromForm = getMessagesFromIdxRemediationValue(value.form.value) || [];\n messages = [...messages, ...messagesFromForm];\n }\n if (value.options) {\n let optionValues = [];\n value.options.forEach(option => {\n if (!option.value || typeof option.value === 'string') {\n return;\n }\n optionValues = [...optionValues, option.value];\n });\n const messagesFromOptions = getMessagesFromIdxRemediationValue(optionValues) || [];\n messages = [...messages, ...messagesFromOptions];\n }\n return messages;\n }, []);\n}\nfunction getMessagesFromResponse(idxResponse, options) {\n var _a;\n let messages = [];\n const { rawIdxState, neededToProceed } = idxResponse;\n const globalMessages = (_a = rawIdxState.messages) === null || _a === void 0 ? void 0 : _a.value.map(message => message);\n if (globalMessages) {\n messages = [...messages, ...globalMessages];\n }\n if (!options.useGenericRemediator) {\n for (let remediation of neededToProceed) {\n const fieldMessages = getMessagesFromIdxRemediationValue(remediation.value);\n if (fieldMessages) {\n messages = [...messages, ...fieldMessages];\n }\n }\n }\n const seen = {};\n messages = messages.reduce((filtered, message) => {\n var _a;\n const key = (_a = message.i18n) === null || _a === void 0 ? void 0 : _a.key;\n if (key && seen[key] && message.message === seen[key].message) {\n return filtered;\n }\n seen[key] = message;\n filtered = [...filtered, message];\n return filtered;\n }, []);\n return messages;\n}\nfunction getEnabledFeatures(idxResponse) {\n const res = [];\n const { actions, neededToProceed } = idxResponse;\n if (actions['currentAuthenticator-recover']) {\n res.push(IdxFeature.PASSWORD_RECOVERY);\n }\n if (neededToProceed.some(({ name }) => name === 'select-enroll-profile')) {\n res.push(IdxFeature.REGISTRATION);\n }\n if (neededToProceed.some(({ name }) => name === 'redirect-idp')) {\n res.push(IdxFeature.SOCIAL_IDP);\n }\n if (neededToProceed.some(({ name }) => name === 'unlock-account')) {\n res.push(IdxFeature.ACCOUNT_UNLOCK);\n }\n return res;\n}\nfunction getAvailableSteps(authClient, idxResponse, useGenericRemediator) {\n var _a;\n const res = [];\n const remediatorMap = Object.values(ctx.remediators)\n .reduce((map, remediatorClass) => {\n if (remediatorClass.remediationName) {\n map[remediatorClass.remediationName] = remediatorClass;\n }\n return map;\n }, {});\n for (let remediation of idxResponse.neededToProceed) {\n const T = getRemediatorClass(remediation, { useGenericRemediator, remediators: remediatorMap });\n if (T) {\n const remediator = new T(remediation);\n res.push(remediator.getNextStep(authClient, idxResponse.context));\n }\n }\n for (const [name] of Object.entries((idxResponse.actions || {}))) {\n let stepObj = {\n name,\n action: async (params) => {\n return authClient.idx.proceed({\n actions: [{ name, params }]\n });\n }\n };\n if (name.startsWith('currentAuthenticator')) {\n const [part1, part2] = split2(name, '-');\n const actionObj = idxResponse.rawIdxState[part1].value[part2];\n const rest = __rest(actionObj, [\"href\", \"method\", \"rel\", \"accepts\", \"produces\"]);\n const value = (_a = actionObj.value) === null || _a === void 0 ? void 0 : _a.filter(item => item.name !== 'stateHandle');\n stepObj = Object.assign(Object.assign(Object.assign({}, rest), (value && { value })), stepObj);\n }\n res.push(stepObj);\n }\n return res;\n}\nfunction filterValuesForRemediation(idxResponse, remediationName, values) {\n const remediations = idxResponse.neededToProceed || [];\n const remediation = remediations.find(r => r.name === remediationName);\n if (!remediation) {\n warn(`filterValuesForRemediation: \"${remediationName}\" did not match any remediations`);\n return values;\n }\n const valuesForRemediation = remediation.value.reduce((res, entry) => {\n const { name, value } = entry;\n if (name === 'stateHandle') {\n res[name] = value;\n }\n else {\n res[name] = values[name];\n }\n return res;\n }, {});\n return valuesForRemediation;\n}\nfunction getRemediatorClass(remediation, options) {\n const { useGenericRemediator, remediators } = options;\n if (!remediation) {\n return undefined;\n }\n if (useGenericRemediator) {\n return GenericRemediator;\n }\n return remediators[remediation.name];\n}\nfunction getRemediator(idxResponse, values, options) {\n const remediators = options.remediators;\n const useGenericRemediator = options.useGenericRemediator;\n const { neededToProceed: idxRemediations, context } = idxResponse;\n let remediator;\n if (options.step) {\n const remediation = idxRemediations.find(({ name }) => name === options.step);\n if (remediation) {\n const T = getRemediatorClass(remediation, options);\n return T ? new T(remediation, values, options) : undefined;\n }\n else {\n warn(`step \"${options.step}\" did not match any remediations`);\n return;\n }\n }\n const remediatorCandidates = [];\n if (useGenericRemediator) {\n remediatorCandidates.push(new GenericRemediator(idxRemediations[0], values, options));\n }\n else {\n for (let remediation of idxRemediations) {\n const isRemeditionInFlow = Object.keys(remediators).includes(remediation.name);\n if (!isRemeditionInFlow) {\n continue;\n }\n const T = getRemediatorClass(remediation, options);\n remediator = new T(remediation, values, options);\n if (remediator.canRemediate(context)) {\n return remediator;\n }\n remediatorCandidates.push(remediator);\n }\n }\n return remediatorCandidates[0];\n}\nfunction getNextStep(authClient, remediator, idxResponse) {\n const nextStep = remediator.getNextStep(authClient, idxResponse.context);\n const canSkip = canSkipFn(idxResponse);\n const canResend = canResendFn(idxResponse);\n return Object.assign(Object.assign(Object.assign({}, nextStep), (canSkip && { canSkip })), (canResend && { canResend }));\n}\nfunction handleFailedResponse(authClient, idxResponse, options = {}) {\n const terminal = isTerminalResponse(idxResponse);\n const messages = getMessagesFromResponse(idxResponse, options);\n if (terminal) {\n return { idxResponse, terminal, messages };\n }\n else {\n const remediator = getRemediator(idxResponse, {}, options);\n const nextStep = remediator && getNextStep(authClient, remediator, idxResponse);\n return Object.assign({ idxResponse,\n messages }, (nextStep && { nextStep }));\n }\n}\n\nexport { canResendFn, canSkipFn, filterValuesForRemediation, getAvailableSteps, getEnabledFeatures, getFlowSpecification, getMessagesFromIdxRemediationValue, getMessagesFromResponse, getNextStep, getRemediator, handleFailedResponse, isTerminalResponse, setRemediatorsCtx };\n//# sourceMappingURL=util.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getRemediator, handleFailedResponse, isTerminalResponse, filterValuesForRemediation, getNextStep } from './util.js';\n\nfunction getActionFromValues(values, idxResponse) {\n return Object.keys(idxResponse.actions).find(action => !!values.resend && action.includes('-resend'));\n}\nfunction removeActionFromValues(values) {\n return Object.assign(Object.assign({}, values), { resend: undefined });\n}\nfunction removeActionFromOptions(options, actionName) {\n let actions = options.actions || [];\n actions = actions.filter(entry => {\n if (typeof entry === 'string') {\n return entry !== actionName;\n }\n return entry.name !== actionName;\n });\n return Object.assign(Object.assign({}, options), { actions });\n}\nasync function remediate(authClient, idxResponse, values, options) {\n let { neededToProceed, interactionCode } = idxResponse;\n const { flow } = options;\n if (interactionCode) {\n return { idxResponse };\n }\n const remediator = getRemediator(idxResponse, values, options);\n const actionFromValues = getActionFromValues(values, idxResponse);\n const actionFromOptions = options.actions || [];\n const actions = [\n ...actionFromOptions,\n ...(actionFromValues && [actionFromValues] || []),\n ];\n if (actions) {\n for (let action of actions) {\n let params = {};\n if (typeof action !== 'string') {\n params = action.params || {};\n action = action.name;\n }\n let valuesWithoutExecutedAction = removeActionFromValues(values);\n let optionsWithoutExecutedAction = removeActionFromOptions(options, action);\n if (typeof idxResponse.actions[action] === 'function') {\n idxResponse = await idxResponse.actions[action](params);\n if (idxResponse.requestDidSucceed === false) {\n return handleFailedResponse(authClient, idxResponse, options);\n }\n if (action === 'cancel') {\n return { idxResponse, canceled: true };\n }\n return remediate(authClient, idxResponse, valuesWithoutExecutedAction, optionsWithoutExecutedAction);\n }\n const remediationAction = neededToProceed.find(({ name }) => name === action);\n if (remediationAction) {\n idxResponse = await idxResponse.proceed(action, params);\n if (idxResponse.requestDidSucceed === false) {\n return handleFailedResponse(authClient, idxResponse, options);\n }\n return remediate(authClient, idxResponse, values, optionsWithoutExecutedAction);\n }\n }\n }\n const terminal = isTerminalResponse(idxResponse);\n if (terminal) {\n return { idxResponse, terminal };\n }\n if (!remediator) {\n if (options.step) {\n values = filterValuesForRemediation(idxResponse, options.step, values);\n idxResponse = await idxResponse.proceed(options.step, values);\n if (idxResponse.requestDidSucceed === false) {\n return handleFailedResponse(authClient, idxResponse, options);\n }\n return { idxResponse };\n }\n if (flow === 'default') {\n return { idxResponse };\n }\n throw new AuthSdkError(`\n No remediation can match current flow, check policy settings in your org.\n Remediations: [${neededToProceed.reduce((acc, curr) => acc ? acc + ' ,' + curr.name : curr.name, '')}]\n `);\n }\n if (!remediator.canRemediate()) {\n const nextStep = getNextStep(authClient, remediator, idxResponse);\n return {\n idxResponse,\n nextStep,\n };\n }\n const name = remediator.getName();\n const data = remediator.getData();\n idxResponse = await idxResponse.proceed(name, data);\n if (idxResponse.requestDidSucceed === false) {\n return handleFailedResponse(authClient, idxResponse, options);\n }\n values = remediator.getValuesAfterProceed();\n options = Object.assign(Object.assign({}, options), { step: undefined });\n if (options.useGenericRemediator && !idxResponse.interactionCode && !isTerminalResponse(idxResponse)) {\n const gr = getRemediator(idxResponse, values, options);\n const nextStep = getNextStep(authClient, gr, idxResponse);\n return {\n idxResponse,\n nextStep,\n };\n }\n return remediate(authClient, idxResponse, values, options);\n}\n\nexport { remediate };\n//# sourceMappingURL=remediate.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { interact } from './interact.js';\nimport { introspect } from './introspect.js';\nimport { remediate } from './remediate.js';\nimport { IdxStatus } from './types/api.js';\nimport { saveTransactionMeta, getSavedTransactionMeta } from './transactionMeta.js';\nimport { getFlowSpecification, getEnabledFeatures, getAvailableSteps, getMessagesFromResponse, isTerminalResponse } from './util.js';\n\nfunction initializeValues(options) {\n const knownOptions = [\n 'flow',\n 'remediators',\n 'actions',\n 'withCredentials',\n 'step',\n 'useGenericRemediator',\n 'exchangeCodeForTokens',\n ];\n const values = Object.assign({}, options);\n knownOptions.forEach(option => {\n delete values[option];\n });\n return values;\n}\nfunction initializeData(authClient, data) {\n var _a, _b, _c, _d;\n let { options } = data;\n options = Object.assign(Object.assign({}, authClient.options.idx), options);\n let { flow, withCredentials, remediators, actions, } = options;\n const status = IdxStatus.PENDING;\n flow = flow || ((_b = (_a = authClient.idx).getFlow) === null || _b === void 0 ? void 0 : _b.call(_a)) || 'default';\n if (flow) {\n (_d = (_c = authClient.idx).setFlow) === null || _d === void 0 ? void 0 : _d.call(_c, flow);\n const flowSpec = getFlowSpecification(authClient, flow);\n withCredentials = (typeof withCredentials !== 'undefined') ? withCredentials : flowSpec.withCredentials;\n remediators = remediators || flowSpec.remediators;\n actions = actions || flowSpec.actions;\n }\n return Object.assign(Object.assign({}, data), { options: Object.assign(Object.assign({}, options), { flow,\n withCredentials,\n remediators,\n actions }), status });\n}\nasync function getDataFromIntrospect(authClient, data) {\n const { options } = data;\n const { stateHandle, withCredentials, version, state, scopes, recoveryToken, activationToken, maxAge, acrValues, nonce, useGenericRemediator, } = options;\n let idxResponse;\n let meta = getSavedTransactionMeta(authClient, { state, recoveryToken, activationToken });\n if (stateHandle) {\n idxResponse = await introspect(authClient, { withCredentials, version, stateHandle, useGenericRemediator });\n }\n else {\n let interactionHandle = meta === null || meta === void 0 ? void 0 : meta.interactionHandle;\n if (!interactionHandle) {\n authClient.transactionManager.clear();\n const interactResponse = await interact(authClient, {\n withCredentials,\n state,\n scopes,\n activationToken,\n recoveryToken,\n maxAge,\n acrValues,\n nonce,\n });\n interactionHandle = interactResponse.interactionHandle;\n meta = interactResponse.meta;\n }\n idxResponse = await introspect(authClient, { withCredentials, version, interactionHandle, useGenericRemediator });\n }\n return Object.assign(Object.assign({}, data), { idxResponse, meta });\n}\nasync function getDataFromRemediate(authClient, data) {\n let { idxResponse, options, values } = data;\n const { autoRemediate, remediators, actions, flow, step, useGenericRemediator, } = options;\n const shouldRemediate = (autoRemediate !== false && (remediators || actions || step));\n if (!shouldRemediate) {\n return data;\n }\n values = Object.assign(Object.assign({}, values), { stateHandle: idxResponse.rawIdxState.stateHandle });\n const { idxResponse: idxResponseFromRemediation, nextStep, canceled, } = await remediate(authClient, idxResponse, values, {\n remediators,\n actions,\n flow,\n step,\n useGenericRemediator,\n });\n idxResponse = idxResponseFromRemediation;\n return Object.assign(Object.assign({}, data), { idxResponse, nextStep, canceled });\n}\nasync function getTokens(authClient, data) {\n let { meta, idxResponse } = data;\n const { interactionCode } = idxResponse;\n const { clientId, codeVerifier, ignoreSignature, redirectUri, urls, scopes, } = meta;\n const tokenResponse = await authClient.token.exchangeCodeForTokens({\n interactionCode,\n clientId,\n codeVerifier,\n ignoreSignature,\n redirectUri,\n scopes\n }, urls);\n return tokenResponse.tokens;\n}\nasync function finalizeData(authClient, data) {\n let { options, idxResponse, canceled, status, } = data;\n const { exchangeCodeForTokens } = options;\n let shouldSaveResponse = false;\n let shouldClearTransaction = false;\n let clearSharedStorage = true;\n let interactionCode;\n let tokens;\n let enabledFeatures;\n let availableSteps;\n let messages;\n let terminal;\n if (idxResponse) {\n shouldSaveResponse = !!(idxResponse.requestDidSucceed || idxResponse.stepUp);\n enabledFeatures = getEnabledFeatures(idxResponse);\n availableSteps = getAvailableSteps(authClient, idxResponse, options.useGenericRemediator);\n messages = getMessagesFromResponse(idxResponse, options);\n terminal = isTerminalResponse(idxResponse);\n }\n if (terminal) {\n status = IdxStatus.TERMINAL;\n const hasActions = Object.keys(idxResponse.actions).length > 0;\n const hasErrors = !!messages.find(msg => msg.class === 'ERROR');\n const isTerminalSuccess = !hasActions && !hasErrors && idxResponse.requestDidSucceed === true;\n if (isTerminalSuccess) {\n shouldClearTransaction = true;\n }\n else {\n shouldSaveResponse = !!hasActions;\n }\n clearSharedStorage = false;\n }\n else if (canceled) {\n status = IdxStatus.CANCELED;\n shouldClearTransaction = true;\n }\n else if (idxResponse === null || idxResponse === void 0 ? void 0 : idxResponse.interactionCode) {\n interactionCode = idxResponse.interactionCode;\n if (exchangeCodeForTokens === false) {\n status = IdxStatus.SUCCESS;\n shouldClearTransaction = false;\n }\n else {\n tokens = await getTokens(authClient, data);\n status = IdxStatus.SUCCESS;\n shouldClearTransaction = true;\n }\n }\n return Object.assign(Object.assign({}, data), { status,\n interactionCode,\n tokens,\n shouldSaveResponse,\n shouldClearTransaction,\n clearSharedStorage,\n enabledFeatures,\n availableSteps,\n messages,\n terminal });\n}\nasync function run(authClient, options = {}) {\n var _a;\n let data = {\n options,\n values: initializeValues(options)\n };\n data = initializeData(authClient, data);\n data = await getDataFromIntrospect(authClient, data);\n data = await getDataFromRemediate(authClient, data);\n data = await finalizeData(authClient, data);\n const { idxResponse, meta, shouldSaveResponse, shouldClearTransaction, clearSharedStorage, status, enabledFeatures, availableSteps, tokens, nextStep, messages, error, interactionCode } = data;\n if (shouldClearTransaction) {\n authClient.transactionManager.clear({ clearSharedStorage });\n }\n else {\n saveTransactionMeta(authClient, Object.assign({}, meta));\n if (shouldSaveResponse) {\n const { rawIdxState: rawIdxResponse, requestDidSucceed } = idxResponse;\n authClient.transactionManager.saveIdxResponse({\n rawIdxResponse,\n requestDidSucceed,\n stateHandle: (_a = idxResponse.context) === null || _a === void 0 ? void 0 : _a.stateHandle,\n interactionHandle: meta === null || meta === void 0 ? void 0 : meta.interactionHandle\n });\n }\n }\n const { actions, context, neededToProceed, proceed, rawIdxState, requestDidSucceed, stepUp } = idxResponse || {};\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ status: status }, (meta && { meta })), (enabledFeatures && { enabledFeatures })), (availableSteps && { availableSteps })), (tokens && { tokens })), (nextStep && { nextStep })), (messages && messages.length && { messages })), (error && { error })), (stepUp && { stepUp })), { interactionCode,\n actions: actions, context: context, neededToProceed: neededToProceed, proceed: proceed, rawIdxState: rawIdxState, requestDidSucceed });\n}\n\nexport { run };\n//# sourceMappingURL=run.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { AuthenticatorKey } from './types/api.js';\nimport { run } from './run.js';\n\nasync function authenticate(authClient, options = {}) {\n if (options.password && !options.authenticator) {\n options.authenticator = AuthenticatorKey.OKTA_PASSWORD;\n }\n return run(authClient, Object.assign(Object.assign({}, options), { flow: 'authenticate' }));\n}\n\nexport { authenticate };\n//# sourceMappingURL=authenticate.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nclass Authenticator {\n constructor(authenticator) {\n this.meta = authenticator;\n }\n}\n\nexport { Authenticator };\n//# sourceMappingURL=Authenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass VerificationCodeAuthenticator extends Authenticator {\n canVerify(values) {\n return !!(values.credentials || values.verificationCode || values.otp);\n }\n mapCredentials(values) {\n const { credentials, verificationCode, otp } = values;\n if (!credentials && !verificationCode && !otp) {\n return;\n }\n return credentials || { passcode: verificationCode || otp };\n }\n getInputs(idxRemediationValue) {\n var _a;\n return Object.assign(Object.assign({}, (_a = idxRemediationValue.form) === null || _a === void 0 ? void 0 : _a.value[0]), { name: 'verificationCode', type: 'string', required: idxRemediationValue.required });\n }\n}\n\nexport { VerificationCodeAuthenticator };\n//# sourceMappingURL=VerificationCodeAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { VerificationCodeAuthenticator } from './VerificationCodeAuthenticator.js';\n\nclass OktaVerifyTotp extends VerificationCodeAuthenticator {\n mapCredentials(values) {\n const { verificationCode } = values;\n if (!verificationCode) {\n return;\n }\n return { totp: verificationCode };\n }\n}\n\nexport { OktaVerifyTotp };\n//# sourceMappingURL=OktaVerifyTotp.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass OktaPassword extends Authenticator {\n canVerify(values) {\n return !!(values.credentials || values.password || values.passcode);\n }\n mapCredentials(values) {\n const { credentials, password, passcode, revokeSessions } = values;\n if (!credentials && !password && !passcode) {\n return;\n }\n return credentials || {\n passcode: passcode || password,\n revokeSessions,\n };\n }\n getInputs(idxRemediationValue) {\n var _a, _b;\n const inputs = [Object.assign(Object.assign({}, (_a = idxRemediationValue.form) === null || _a === void 0 ? void 0 : _a.value[0]), { name: 'password', type: 'string', required: idxRemediationValue.required })];\n const revokeSessions = (_b = idxRemediationValue.form) === null || _b === void 0 ? void 0 : _b.value.find(input => input.name === 'revokeSessions');\n if (revokeSessions) {\n inputs.push({\n name: 'revokeSessions',\n type: 'boolean',\n label: 'Sign me out of all other devices',\n required: false,\n });\n }\n return inputs;\n }\n}\n\nexport { OktaPassword };\n//# sourceMappingURL=OktaPassword.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass SecurityQuestionEnrollment extends Authenticator {\n canVerify(values) {\n const { credentials } = values;\n if (credentials && credentials.questionKey && credentials.answer) {\n return true;\n }\n const { questionKey, question, answer } = values;\n return !!(questionKey && answer) || !!(question && answer);\n }\n mapCredentials(values) {\n const { questionKey, question, answer } = values;\n if (!answer || (!questionKey && !question)) {\n return;\n }\n return {\n questionKey: question ? 'custom' : questionKey,\n question,\n answer\n };\n }\n getInputs() {\n return [\n { name: 'questionKey', type: 'string', required: true },\n { name: 'question', type: 'string', label: 'Create a security question' },\n { name: 'answer', type: 'string', label: 'Answer', required: true },\n ];\n }\n}\n\nexport { SecurityQuestionEnrollment };\n//# sourceMappingURL=SecurityQuestionEnrollment.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass SecurityQuestionVerification extends Authenticator {\n canVerify(values) {\n const { credentials } = values;\n if (credentials && credentials.answer) {\n return true;\n }\n const { answer } = values;\n return !!answer;\n }\n mapCredentials(values) {\n const { answer } = values;\n if (!answer) {\n return;\n }\n return {\n questionKey: this.meta.contextualData.enrolledQuestion.questionKey,\n answer\n };\n }\n getInputs() {\n return [\n { name: 'answer', type: 'string', label: 'Answer', required: true }\n ];\n }\n}\n\nexport { SecurityQuestionVerification };\n//# sourceMappingURL=SecurityQuestionVerification.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass WebauthnEnrollment extends Authenticator {\n canVerify(values) {\n const { credentials } = values;\n const obj = credentials || values;\n const { clientData, attestation } = obj;\n return !!(clientData && attestation);\n }\n mapCredentials(values) {\n const { credentials, clientData, attestation } = values;\n if (!credentials && !clientData && !attestation) {\n return;\n }\n return credentials || ({\n clientData,\n attestation\n });\n }\n getInputs() {\n return [\n { name: 'clientData', type: 'string', required: true, visible: false, label: 'Client Data' },\n { name: 'attestation', type: 'string', required: true, visible: false, label: 'Attestation' },\n ];\n }\n}\n\nexport { WebauthnEnrollment };\n//# sourceMappingURL=WebauthnEnrollment.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Authenticator } from './Authenticator.js';\n\nclass WebauthnVerification extends Authenticator {\n canVerify(values) {\n const { credentials } = values;\n const obj = credentials || values;\n const { clientData, authenticatorData, signatureData } = obj;\n return !!(clientData && authenticatorData && signatureData);\n }\n mapCredentials(values) {\n const { credentials, authenticatorData, clientData, signatureData } = values;\n if (!credentials && !authenticatorData && !clientData && !signatureData) {\n return;\n }\n return credentials || ({\n authenticatorData,\n clientData,\n signatureData\n });\n }\n getInputs() {\n return [\n { name: 'authenticatorData', type: 'string', label: 'Authenticator Data', required: true, visible: false },\n { name: 'clientData', type: 'string', label: 'Client Data', required: true, visible: false },\n { name: 'signatureData', type: 'string', label: 'Signature Data', required: true, visible: false },\n ];\n }\n}\n\nexport { WebauthnVerification };\n//# sourceMappingURL=WebauthnVerification.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { OktaVerifyTotp } from './OktaVerifyTotp.js';\nimport { VerificationCodeAuthenticator } from './VerificationCodeAuthenticator.js';\nimport { OktaPassword } from './OktaPassword.js';\nimport { SecurityQuestionEnrollment } from './SecurityQuestionEnrollment.js';\nimport { SecurityQuestionVerification } from './SecurityQuestionVerification.js';\nimport { WebauthnEnrollment } from './WebauthnEnrollment.js';\nimport { WebauthnVerification } from './WebauthnVerification.js';\nimport { AuthenticatorKey } from '../types/api.js';\n\nfunction getAuthenticator(remediation) {\n var _a, _b;\n const relatesTo = remediation.relatesTo;\n const value = (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.value) || {};\n switch (value.key) {\n case AuthenticatorKey.OKTA_PASSWORD:\n return new OktaPassword(value);\n case AuthenticatorKey.SECURITY_QUESTION:\n if ((_a = value.contextualData) === null || _a === void 0 ? void 0 : _a.enrolledQuestion) {\n return new SecurityQuestionVerification(value);\n }\n else {\n return new SecurityQuestionEnrollment(value);\n }\n case AuthenticatorKey.OKTA_VERIFY:\n return new OktaVerifyTotp(value);\n case AuthenticatorKey.WEBAUTHN:\n if ((_b = value.contextualData) === null || _b === void 0 ? void 0 : _b.challengeData) {\n return new WebauthnVerification(value);\n }\n else {\n return new WebauthnEnrollment(value);\n }\n default:\n return new VerificationCodeAuthenticator(value);\n }\n}\n\nexport { getAuthenticator };\n//# sourceMappingURL=getAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Remediator.js';\nimport { getAuthenticator } from '../../authenticator/getAuthenticator.js';\n\nclass VerifyAuthenticator extends Remediator {\n constructor(remediation, values = {}) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n getNextStep(authClient, context) {\n var _a;\n const nextStep = super.getNextStep(authClient, context);\n const authenticatorEnrollments = (_a = context === null || context === void 0 ? void 0 : context.authenticatorEnrollments) === null || _a === void 0 ? void 0 : _a.value;\n return Object.assign(Object.assign({}, nextStep), { authenticatorEnrollments });\n }\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n getValuesAfterProceed() {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => (Object.assign(Object.assign({}, values), { [valueKey]: this.values[valueKey] })), {});\n }\n}\n\nexport { VerifyAuthenticator };\n//# sourceMappingURL=VerifyAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { VerifyAuthenticator } from './Base/VerifyAuthenticator.js';\n\nclass EnrollAuthenticator extends VerifyAuthenticator {\n}\nEnrollAuthenticator.remediationName = 'enroll-authenticator';\n\nexport { EnrollAuthenticator };\n//# sourceMappingURL=EnrollAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass EnrollPoll extends Remediator {\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n getNextStep(authClient, context) {\n const common = super.getNextStep(authClient, context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && (context === null || context === void 0 ? void 0 : context.currentAuthenticator)) {\n authenticator = context.currentAuthenticator.value;\n }\n return Object.assign(Object.assign({}, common), { authenticator, poll: {\n required: true,\n refresh: this.remediation.refresh\n } });\n }\n getValuesAfterProceed() {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => (Object.assign(Object.assign({}, values), { [valueKey]: this.values[valueKey] })), {});\n }\n}\nEnrollPoll.remediationName = 'enroll-poll';\n\nexport { EnrollPoll };\n//# sourceMappingURL=EnrollPoll.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass SelectEnrollmentChannel extends Remediator {\n canRemediate() {\n if (this.values.channel) {\n return true;\n }\n if (this.values.authenticator) {\n const { id, channel } = this.values.authenticator;\n if (!!id && !!channel) {\n return true;\n }\n }\n return false;\n }\n getNextStep(authClient, context) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return Object.assign(Object.assign({}, common), { authenticator });\n }\n getData() {\n var _a;\n const remediationValue = this.remediation.value[0].value;\n return {\n authenticator: {\n id: remediationValue.form.value[0].value,\n channel: ((_a = this.values.authenticator) === null || _a === void 0 ? void 0 : _a.channel) || this.values.channel,\n },\n stateHandle: this.values.stateHandle,\n };\n }\n getValuesAfterProceed() {\n this.values = super.getValuesAfterProceed();\n delete this.values.authenticators;\n const filterKey = this.values.channel ? 'channel' : 'authenticator';\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== filterKey);\n return trimmedValues.reduce((values, valueKey) => (Object.assign(Object.assign({}, values), { [valueKey]: this.values[valueKey] })), {});\n }\n}\nSelectEnrollmentChannel.remediationName = 'select-enrollment-channel';\n\nexport { SelectEnrollmentChannel };\n//# sourceMappingURL=SelectEnrollmentChannel.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass EnrollmentChannelData extends Remediator {\n getInputEmail() {\n return [\n { name: 'email', type: 'string', required: true, label: 'Email' },\n ];\n }\n getInputPhoneNumber() {\n return [\n { name: 'phoneNumber', type: 'string', required: true, label: 'Phone Number' },\n ];\n }\n canRemediate() {\n return Boolean(this.values.email || this.values.phoneNumber);\n }\n getNextStep(authClient, context) {\n const common = super.getNextStep(authClient, context);\n const authenticator = context.currentAuthenticator.value;\n return Object.assign(Object.assign({}, common), { authenticator });\n }\n getData() {\n return {\n stateHandle: this.values.stateHandle,\n email: this.values.email,\n phoneNumber: this.values.phoneNumber\n };\n }\n getValuesAfterProceed() {\n let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));\n return trimmedValues.reduce((values, valueKey) => (Object.assign(Object.assign({}, values), { [valueKey]: this.values[valueKey] })), {});\n }\n}\nEnrollmentChannelData.remediationName = 'enrollment-channel-data';\n\nexport { EnrollmentChannelData };\n//# sourceMappingURL=EnrollmentChannelData.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { VerifyAuthenticator } from './Base/VerifyAuthenticator.js';\n\nclass ChallengeAuthenticator extends VerifyAuthenticator {\n}\nChallengeAuthenticator.remediationName = 'challenge-authenticator';\n\nexport { ChallengeAuthenticator };\n//# sourceMappingURL=ChallengeAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { EnrollPoll } from './EnrollPoll.js';\n\nclass ChallengePoll extends EnrollPoll {\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'challenge-poll';\n }\n}\nChallengePoll.remediationName = 'challenge-poll';\n\nexport { ChallengePoll };\n//# sourceMappingURL=ChallengePoll.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { VerifyAuthenticator } from './Base/VerifyAuthenticator.js';\n\nclass ResetAuthenticator extends VerifyAuthenticator {\n}\nResetAuthenticator.remediationName = 'reset-authenticator';\n\nexport { ResetAuthenticator };\n//# sourceMappingURL=ResetAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\nimport { OktaPassword } from '../authenticator/OktaPassword.js';\nimport '../types/api.js';\n\nclass EnrollProfile extends Remediator {\n constructor(remediation, values = {}, options = {}) {\n super(remediation, values, options);\n this.authenticator = null;\n const credentials = this.getCredentialsFromRemediation();\n if (credentials) {\n this.authenticator = this.authenticator = new OktaPassword({});\n }\n }\n canRemediate() {\n if (this.authenticator && !this.authenticator.canVerify(this.values)) {\n return false;\n }\n const userProfileFromValues = this.getData().userProfile;\n if (!userProfileFromValues) {\n return false;\n }\n const userProfileFromRemediation = this.remediation.value.find(({ name }) => name === 'userProfile');\n return userProfileFromRemediation.form.value.reduce((canRemediate, curr) => {\n if (curr.required) {\n canRemediate = canRemediate && !!userProfileFromValues[curr.name];\n }\n return canRemediate;\n }, true);\n }\n getCredentialsFromRemediation() {\n return this.remediation.value.find(({ name }) => name === 'credentials');\n }\n mapUserProfile({ form: { value: profileAttributes } }) {\n const attributeNames = profileAttributes.map(({ name }) => name);\n const data = attributeNames.reduce((attributeValues, attributeName) => (this.values[attributeName] ? Object.assign(Object.assign({}, attributeValues), { [attributeName]: this.values[attributeName] }) : attributeValues), {});\n if (Object.keys(data).length === 0) {\n return;\n }\n return data;\n }\n mapCredentials() {\n const val = this.authenticator && this.authenticator.mapCredentials(this.values);\n if (!val) {\n return;\n }\n return val;\n }\n getInputUserProfile(input) {\n return [...input.form.value];\n }\n getInputCredentials(input) {\n return [...input.form.value];\n }\n getErrorMessages(errorRemediation) {\n return errorRemediation.value[0].form.value.reduce((errors, field) => {\n if (field.messages) {\n errors.push(field.messages.value[0].message);\n }\n return errors;\n }, []);\n }\n}\nEnrollProfile.remediationName = 'enroll-profile';\n\nexport { EnrollProfile };\n//# sourceMappingURL=EnrollProfile.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass Identify extends Remediator {\n constructor() {\n super(...arguments);\n this.map = {\n 'identifier': ['username']\n };\n }\n canRemediate() {\n const { identifier } = this.getData();\n return !!identifier;\n }\n mapCredentials() {\n const { credentials, password } = this.values;\n if (!credentials && !password) {\n return;\n }\n return credentials || { passcode: password };\n }\n getInputCredentials(input) {\n return Object.assign(Object.assign({}, input.form.value[0]), { name: 'password', required: input.required });\n }\n}\nIdentify.remediationName = 'identify';\n\nexport { Identify };\n//# sourceMappingURL=Identify.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass ReEnrollAuthenticator extends Remediator {\n mapCredentials() {\n const { newPassword } = this.values;\n if (!newPassword) {\n return;\n }\n return {\n passcode: newPassword,\n };\n }\n getInputCredentials(input) {\n const challengeType = this.getAuthenticator().type;\n const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';\n return Object.assign(Object.assign({}, input.form.value[0]), { name });\n }\n}\nReEnrollAuthenticator.remediationName = 'reenroll-authenticator';\n\nexport { ReEnrollAuthenticator };\n//# sourceMappingURL=ReEnrollAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReEnrollAuthenticator } from './ReEnrollAuthenticator.js';\n\nclass ReEnrollAuthenticatorWarning extends ReEnrollAuthenticator {\n}\nReEnrollAuthenticatorWarning.remediationName = 'reenroll-authenticator-warning';\n\nexport { ReEnrollAuthenticatorWarning };\n//# sourceMappingURL=ReEnrollAuthenticatorWarning.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass RedirectIdp extends Remediator {\n canRemediate() {\n return false;\n }\n getNextStep() {\n const { name, type, idp, href } = this.remediation;\n return {\n name,\n type,\n idp,\n href\n };\n }\n}\nRedirectIdp.remediationName = 'redirect-idp';\n\nexport { RedirectIdp };\n//# sourceMappingURL=RedirectIdp.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Remediator.js';\nimport { getAuthenticatorFromRemediation } from '../util.js';\nimport { isAuthenticator } from '../../types/api.js';\nimport { findMatchedOption, compareAuthenticators } from '../../authenticator/util.js';\n\nclass SelectAuthenticator extends Remediator {\n findMatchedOption(authenticators, options) {\n let option;\n for (let authenticator of authenticators) {\n option = options\n .find(({ relatesTo }) => relatesTo.key && relatesTo.key === authenticator.key);\n if (option) {\n break;\n }\n }\n return option;\n }\n canRemediate(context) {\n var _a, _b;\n const { authenticators, authenticator } = this.values;\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n const { options } = authenticatorFromRemediation;\n if (!authenticators || !authenticators.length) {\n return false;\n }\n if (isAuthenticator(authenticator) && authenticator.id) {\n return true;\n }\n const matchedOption = this.findMatchedOption(authenticators, options);\n if (matchedOption) {\n const isCurrentAuthenticator = (context === null || context === void 0 ? void 0 : context.currentAuthenticator)\n && (context === null || context === void 0 ? void 0 : context.currentAuthenticator.value.id) === ((_a = matchedOption.relatesTo) === null || _a === void 0 ? void 0 : _a.id);\n const isCurrentAuthenticatorEnrollment = (context === null || context === void 0 ? void 0 : context.currentAuthenticatorEnrollment)\n && (context === null || context === void 0 ? void 0 : context.currentAuthenticatorEnrollment.value.id) === ((_b = matchedOption.relatesTo) === null || _b === void 0 ? void 0 : _b.id);\n return !isCurrentAuthenticator && !isCurrentAuthenticatorEnrollment;\n }\n return false;\n }\n mapAuthenticator(remediationValue) {\n const { authenticators, authenticator } = this.values;\n if (isAuthenticator(authenticator) && authenticator.id) {\n this.selectedAuthenticator = authenticator;\n return authenticator;\n }\n const { options } = remediationValue;\n const selectedOption = findMatchedOption(authenticators, options);\n this.selectedAuthenticator = selectedOption.relatesTo;\n this.selectedOption = selectedOption;\n return {\n id: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value.form.value.find(({ name }) => name === 'id').value\n };\n }\n getInputAuthenticator(remediation) {\n const options = remediation.options.map(({ label, relatesTo }) => {\n return {\n label,\n value: relatesTo.key\n };\n });\n return { name: 'authenticator', type: 'string', options };\n }\n getValuesAfterProceed() {\n this.values = super.getValuesAfterProceed();\n const authenticators = this.values.authenticators\n .filter(authenticator => {\n return compareAuthenticators(authenticator, this.selectedAuthenticator) !== true;\n });\n return Object.assign(Object.assign({}, this.values), { authenticators });\n }\n}\n\nexport { SelectAuthenticator };\n//# sourceMappingURL=SelectAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { SelectAuthenticator } from './Base/SelectAuthenticator.js';\nimport { getAuthenticatorFromRemediation } from './util.js';\nimport { AuthenticatorKey } from '../types/api.js';\n\nclass SelectAuthenticatorAuthenticate extends SelectAuthenticator {\n constructor(remediation, values = {}, options = {}) {\n var _a;\n super(remediation, values, options);\n const isRecoveryFlow = this.options.flow === 'recoverPassword';\n const hasPasswordInOptions = (_a = getAuthenticatorFromRemediation(remediation)\n .options) === null || _a === void 0 ? void 0 : _a.some(({ relatesTo }) => (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.key) === AuthenticatorKey.OKTA_PASSWORD);\n if (hasPasswordInOptions && (isRecoveryFlow || this.values.password)) {\n this.values.authenticators = [\n ...this.values.authenticators || [],\n { key: AuthenticatorKey.OKTA_PASSWORD }\n ];\n }\n }\n}\nSelectAuthenticatorAuthenticate.remediationName = 'select-authenticator-authenticate';\n\nexport { SelectAuthenticatorAuthenticate };\n//# sourceMappingURL=SelectAuthenticatorAuthenticate.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { SelectAuthenticator } from './Base/SelectAuthenticator.js';\n\nclass SelectAuthenticatorEnroll extends SelectAuthenticator {\n}\nSelectAuthenticatorEnroll.remediationName = 'select-authenticator-enroll';\n\nexport { SelectAuthenticatorEnroll };\n//# sourceMappingURL=SelectAuthenticatorEnroll.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { SelectAuthenticator } from './Base/SelectAuthenticator.js';\n\nclass SelectAuthenticatorUnlockAccount extends SelectAuthenticator {\n constructor() {\n super(...arguments);\n this.map = {\n identifier: ['username']\n };\n }\n canRemediate() {\n const identifier = this.getData('identifier');\n return !!identifier && super.canRemediate();\n }\n mapAuthenticator(remediationValue) {\n var _a, _b, _c;\n const authenticatorMap = super.mapAuthenticator(remediationValue);\n const methodTypeOption = (_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value.form.value.find(({ name }) => name === 'methodType');\n const methodTypeValue = this.values.methodType ||\n (methodTypeOption === null || methodTypeOption === void 0 ? void 0 : methodTypeOption.value) || ((_c = (_b = methodTypeOption === null || methodTypeOption === void 0 ? void 0 : methodTypeOption.options) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value);\n if (methodTypeValue) {\n return Object.assign(Object.assign({}, authenticatorMap), { methodType: methodTypeValue });\n }\n return authenticatorMap;\n }\n getInputUsername() {\n return { name: 'username', type: 'string' };\n }\n}\nSelectAuthenticatorUnlockAccount.remediationName = 'select-authenticator-unlock-account';\n\nexport { SelectAuthenticatorUnlockAccount };\n//# sourceMappingURL=SelectAuthenticatorUnlockAccount.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass SelectEnrollProfile extends Remediator {\n canRemediate() {\n return true;\n }\n}\nSelectEnrollProfile.remediationName = 'select-enroll-profile';\n\nexport { SelectEnrollProfile };\n//# sourceMappingURL=SelectEnrollProfile.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Remediator.js';\nimport { isAuthenticator } from '../../types/api.js';\nimport { compareAuthenticators } from '../../authenticator/util.js';\n\nclass AuthenticatorData extends Remediator {\n constructor(remediation, values = {}) {\n super(remediation, values);\n this.authenticator = this.getAuthenticator();\n this.formatAuthenticatorData();\n }\n formatAuthenticatorData() {\n const authenticatorData = this.getAuthenticatorData();\n if (authenticatorData) {\n this.values.authenticatorsData = this.values.authenticatorsData.map(data => {\n if (compareAuthenticators(this.authenticator, data)) {\n return this.mapAuthenticatorDataFromValues(data);\n }\n return data;\n });\n }\n else {\n const data = this.mapAuthenticatorDataFromValues();\n if (data) {\n this.values.authenticatorsData.push(data);\n }\n }\n }\n getAuthenticatorData() {\n return this.values.authenticatorsData\n .find((data) => compareAuthenticators(this.authenticator, data));\n }\n canRemediate() {\n return this.values.authenticatorsData\n .some(data => compareAuthenticators(this.authenticator, data));\n }\n mapAuthenticatorDataFromValues(authenticatorData) {\n let { methodType, authenticator } = this.values;\n if (!methodType && isAuthenticator(authenticator)) {\n methodType = authenticator === null || authenticator === void 0 ? void 0 : authenticator.methodType;\n }\n const { id, enrollmentId } = this.authenticator;\n const data = Object.assign(Object.assign({ id,\n enrollmentId }, (authenticatorData && authenticatorData)), (methodType && { methodType }));\n return data.methodType ? data : null;\n }\n getAuthenticatorFromRemediation() {\n const authenticator = this.remediation.value\n .find(({ name }) => name === 'authenticator');\n return authenticator;\n }\n getValuesAfterProceed() {\n this.values = super.getValuesAfterProceed();\n const authenticatorsData = this.values.authenticatorsData\n .filter(data => compareAuthenticators(this.authenticator, data) !== true);\n return Object.assign(Object.assign({}, this.values), { authenticatorsData });\n }\n}\n\nexport { AuthenticatorData };\n//# sourceMappingURL=AuthenticatorData.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { AuthenticatorData } from './Base/AuthenticatorData.js';\n\nclass AuthenticatorVerificationData extends AuthenticatorData {\n mapAuthenticator() {\n return this.getAuthenticatorData();\n }\n getInputAuthenticator() {\n const authenticator = this.getAuthenticatorFromRemediation();\n const methodType = authenticator.form.value.find(({ name }) => name === 'methodType');\n if (methodType && methodType.options) {\n return {\n name: 'methodType',\n type: 'string',\n required: true,\n options: methodType.options\n };\n }\n const inputs = [...authenticator.form.value];\n return inputs;\n }\n getValuesAfterProceed() {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'authenticator');\n return trimmedValues.reduce((values, valueKey) => (Object.assign(Object.assign({}, values), { [valueKey]: this.values[valueKey] })), {});\n }\n}\nAuthenticatorVerificationData.remediationName = 'authenticator-verification-data';\n\nexport { AuthenticatorVerificationData };\n//# sourceMappingURL=AuthenticatorVerificationData.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { AuthenticatorData } from './Base/AuthenticatorData.js';\nimport { getAuthenticatorFromRemediation } from './util.js';\n\nclass AuthenticatorEnrollmentData extends AuthenticatorData {\n mapAuthenticator() {\n const authenticatorData = this.getAuthenticatorData();\n const authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);\n return {\n id: authenticatorFromRemediation.form.value\n .find(({ name }) => name === 'id').value,\n methodType: authenticatorData.methodType,\n phoneNumber: authenticatorData.phoneNumber,\n };\n }\n getInputAuthenticator(remediation) {\n return [\n { name: 'methodType', type: 'string' },\n { name: 'phoneNumber', label: 'Phone Number', type: 'string' }\n ].map(item => {\n const value = remediation.form.value.find(val => val.name === item.name);\n return Object.assign(Object.assign({}, value), item);\n });\n }\n mapAuthenticatorDataFromValues(data) {\n data = super.mapAuthenticatorDataFromValues(data);\n const { phoneNumber } = this.values;\n if (!data && !phoneNumber) {\n return;\n }\n return Object.assign(Object.assign({}, (data && data)), (phoneNumber && { phoneNumber }));\n }\n}\nAuthenticatorEnrollmentData.remediationName = 'authenticator-enrollment-data';\n\nexport { AuthenticatorEnrollmentData };\n//# sourceMappingURL=AuthenticatorEnrollmentData.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Remediator } from './Base/Remediator.js';\n\nclass Skip extends Remediator {\n canRemediate() {\n return !!this.values.skip || this.options.step === 'skip';\n }\n}\nSkip.remediationName = 'skip';\n\nexport { Skip };\n//# sourceMappingURL=Skip.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../types/api.js';\nimport { EnrollAuthenticator } from '../remediators/EnrollAuthenticator.js';\nimport { EnrollPoll } from '../remediators/EnrollPoll.js';\nimport { SelectEnrollmentChannel } from '../remediators/SelectEnrollmentChannel.js';\nimport { EnrollmentChannelData } from '../remediators/EnrollmentChannelData.js';\nimport { ChallengeAuthenticator } from '../remediators/ChallengeAuthenticator.js';\nimport { ChallengePoll } from '../remediators/ChallengePoll.js';\nimport '../remediators/ResetAuthenticator.js';\nimport '../remediators/EnrollProfile.js';\nimport { Identify } from '../remediators/Identify.js';\nimport { ReEnrollAuthenticator } from '../remediators/ReEnrollAuthenticator.js';\nimport { ReEnrollAuthenticatorWarning } from '../remediators/ReEnrollAuthenticatorWarning.js';\nimport { RedirectIdp } from '../remediators/RedirectIdp.js';\nimport { SelectAuthenticatorAuthenticate } from '../remediators/SelectAuthenticatorAuthenticate.js';\nimport { SelectAuthenticatorEnroll } from '../remediators/SelectAuthenticatorEnroll.js';\nimport '../remediators/SelectAuthenticatorUnlockAccount.js';\nimport '../remediators/SelectEnrollProfile.js';\nimport { AuthenticatorVerificationData } from '../remediators/AuthenticatorVerificationData.js';\nimport { AuthenticatorEnrollmentData } from '../remediators/AuthenticatorEnrollmentData.js';\nimport { Skip } from '../remediators/Skip.js';\nimport '../../errors/WWWAuthError.js';\n\nconst AuthenticationFlow = {\n 'identify': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'enroll-authenticator': EnrollAuthenticator,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n 'enroll-poll': EnrollPoll,\n 'select-enrollment-channel': SelectEnrollmentChannel,\n 'enrollment-channel-data': EnrollmentChannelData,\n 'redirect-idp': RedirectIdp,\n 'skip': Skip,\n};\n\nexport { AuthenticationFlow };\n//# sourceMappingURL=AuthenticationFlow.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../types/api.js';\nimport '../remediators/EnrollAuthenticator.js';\nimport { EnrollPoll } from '../remediators/EnrollPoll.js';\nimport '../remediators/SelectEnrollmentChannel.js';\nimport '../remediators/EnrollmentChannelData.js';\nimport { ChallengeAuthenticator } from '../remediators/ChallengeAuthenticator.js';\nimport '../remediators/ChallengePoll.js';\nimport { ResetAuthenticator } from '../remediators/ResetAuthenticator.js';\nimport '../remediators/EnrollProfile.js';\nimport { Identify } from '../remediators/Identify.js';\nimport { ReEnrollAuthenticator } from '../remediators/ReEnrollAuthenticator.js';\nimport { ReEnrollAuthenticatorWarning } from '../remediators/ReEnrollAuthenticatorWarning.js';\nimport '../remediators/RedirectIdp.js';\nimport { SelectAuthenticatorAuthenticate } from '../remediators/SelectAuthenticatorAuthenticate.js';\nimport { SelectAuthenticatorEnroll } from '../remediators/SelectAuthenticatorEnroll.js';\nimport '../remediators/SelectAuthenticatorUnlockAccount.js';\nimport '../remediators/SelectEnrollProfile.js';\nimport { AuthenticatorVerificationData } from '../remediators/AuthenticatorVerificationData.js';\nimport { AuthenticatorEnrollmentData } from '../remediators/AuthenticatorEnrollmentData.js';\nimport '../remediators/Skip.js';\nimport '../../errors/WWWAuthError.js';\n\nconst PasswordRecoveryFlow = {\n 'identify': Identify,\n 'identify-recovery': Identify,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'reset-authenticator': ResetAuthenticator,\n 'reenroll-authenticator': ReEnrollAuthenticator,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n 'enroll-poll': EnrollPoll,\n};\n\nexport { PasswordRecoveryFlow };\n//# sourceMappingURL=PasswordRecoveryFlow.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../types/api.js';\nimport { EnrollAuthenticator } from '../remediators/EnrollAuthenticator.js';\nimport { EnrollPoll } from '../remediators/EnrollPoll.js';\nimport { SelectEnrollmentChannel } from '../remediators/SelectEnrollmentChannel.js';\nimport { EnrollmentChannelData } from '../remediators/EnrollmentChannelData.js';\nimport '../remediators/ChallengeAuthenticator.js';\nimport '../remediators/ChallengePoll.js';\nimport '../remediators/ResetAuthenticator.js';\nimport { EnrollProfile } from '../remediators/EnrollProfile.js';\nimport '../remediators/Identify.js';\nimport '../remediators/ReEnrollAuthenticator.js';\nimport '../remediators/ReEnrollAuthenticatorWarning.js';\nimport '../remediators/RedirectIdp.js';\nimport '../remediators/SelectAuthenticatorAuthenticate.js';\nimport { SelectAuthenticatorEnroll } from '../remediators/SelectAuthenticatorEnroll.js';\nimport '../remediators/SelectAuthenticatorUnlockAccount.js';\nimport { SelectEnrollProfile } from '../remediators/SelectEnrollProfile.js';\nimport '../remediators/AuthenticatorVerificationData.js';\nimport { AuthenticatorEnrollmentData } from '../remediators/AuthenticatorEnrollmentData.js';\nimport { Skip } from '../remediators/Skip.js';\nimport '../../errors/WWWAuthError.js';\n\nconst RegistrationFlow = {\n 'select-enroll-profile': SelectEnrollProfile,\n 'enroll-profile': EnrollProfile,\n 'authenticator-enrollment-data': AuthenticatorEnrollmentData,\n 'select-authenticator-enroll': SelectAuthenticatorEnroll,\n 'enroll-poll': EnrollPoll,\n 'select-enrollment-channel': SelectEnrollmentChannel,\n 'enrollment-channel-data': EnrollmentChannelData,\n 'enroll-authenticator': EnrollAuthenticator,\n 'skip': Skip,\n};\n\nexport { RegistrationFlow };\n//# sourceMappingURL=RegistrationFlow.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../types/api.js';\nimport '../remediators/EnrollAuthenticator.js';\nimport '../remediators/EnrollPoll.js';\nimport '../remediators/SelectEnrollmentChannel.js';\nimport '../remediators/EnrollmentChannelData.js';\nimport { ChallengeAuthenticator } from '../remediators/ChallengeAuthenticator.js';\nimport { ChallengePoll } from '../remediators/ChallengePoll.js';\nimport '../remediators/ResetAuthenticator.js';\nimport '../remediators/EnrollProfile.js';\nimport { Identify } from '../remediators/Identify.js';\nimport '../remediators/ReEnrollAuthenticator.js';\nimport { ReEnrollAuthenticatorWarning } from '../remediators/ReEnrollAuthenticatorWarning.js';\nimport '../remediators/RedirectIdp.js';\nimport { SelectAuthenticatorAuthenticate } from '../remediators/SelectAuthenticatorAuthenticate.js';\nimport '../remediators/SelectAuthenticatorEnroll.js';\nimport { SelectAuthenticatorUnlockAccount } from '../remediators/SelectAuthenticatorUnlockAccount.js';\nimport '../remediators/SelectEnrollProfile.js';\nimport { AuthenticatorVerificationData } from '../remediators/AuthenticatorVerificationData.js';\nimport '../remediators/AuthenticatorEnrollmentData.js';\nimport '../remediators/Skip.js';\nimport '../../errors/WWWAuthError.js';\n\nconst AccountUnlockFlow = {\n 'identify': Identify,\n 'select-authenticator-unlock-account': SelectAuthenticatorUnlockAccount,\n 'select-authenticator-authenticate': SelectAuthenticatorAuthenticate,\n 'challenge-authenticator': ChallengeAuthenticator,\n 'challenge-poll': ChallengePoll,\n 'authenticator-verification-data': AuthenticatorVerificationData,\n 'reenroll-authenticator-warning': ReEnrollAuthenticatorWarning,\n};\n\nexport { AccountUnlockFlow };\n//# sourceMappingURL=AccountUnlockFlow.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { AuthenticationFlow } from './AuthenticationFlow.js';\nimport { PasswordRecoveryFlow } from './PasswordRecoveryFlow.js';\nimport { RegistrationFlow } from './RegistrationFlow.js';\nimport { AccountUnlockFlow } from './AccountUnlockFlow.js';\n\nfunction getFlowSpecification(oktaAuth, flow = 'default') {\n let remediators, actions, withCredentials = true;\n switch (flow) {\n case 'register':\n case 'signup':\n case 'enrollProfile':\n remediators = RegistrationFlow;\n withCredentials = false;\n break;\n case 'recoverPassword':\n case 'resetPassword':\n remediators = PasswordRecoveryFlow;\n actions = [\n 'currentAuthenticator-recover',\n 'currentAuthenticatorEnrollment-recover'\n ];\n withCredentials = false;\n break;\n case 'unlockAccount':\n remediators = AccountUnlockFlow;\n withCredentials = false;\n actions = [\n 'unlock-account'\n ];\n break;\n case 'authenticate':\n case 'login':\n case 'signin':\n remediators = AuthenticationFlow;\n break;\n default:\n remediators = AuthenticationFlow;\n break;\n }\n return { flow, remediators, actions, withCredentials };\n}\n\nexport { getFlowSpecification };\n//# sourceMappingURL=FlowSpecification.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\nimport './types/api.js';\nimport './remediators/EnrollAuthenticator.js';\nimport './remediators/EnrollPoll.js';\nimport './remediators/SelectEnrollmentChannel.js';\nimport './remediators/EnrollmentChannelData.js';\nimport './remediators/ChallengeAuthenticator.js';\nimport './remediators/ChallengePoll.js';\nimport './remediators/ResetAuthenticator.js';\nimport './remediators/EnrollProfile.js';\nimport './remediators/Identify.js';\nimport './remediators/ReEnrollAuthenticator.js';\nimport './remediators/ReEnrollAuthenticatorWarning.js';\nimport './remediators/RedirectIdp.js';\nimport './remediators/SelectAuthenticatorAuthenticate.js';\nimport './remediators/SelectAuthenticatorEnroll.js';\nimport './remediators/SelectAuthenticatorUnlockAccount.js';\nimport './remediators/SelectEnrollProfile.js';\nimport './remediators/AuthenticatorVerificationData.js';\nimport './remediators/AuthenticatorEnrollmentData.js';\nimport './remediators/Skip.js';\nimport '../errors/WWWAuthError.js';\nimport { getFlowSpecification } from './flow/FlowSpecification.js';\n\nasync function cancel(authClient, options) {\n const meta = authClient.transactionManager.load();\n const flowSpec = getFlowSpecification(authClient, meta.flow);\n return run(authClient, Object.assign(Object.assign(Object.assign({}, options), flowSpec), { actions: ['cancel'] }));\n}\n\nexport { cancel };\n//# sourceMappingURL=cancel.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction urlParamsToObject(hashOrSearch) {\n var plus2space = /\\+/g;\n var paramSplit = /([^&=]+)=?([^&]*)/g;\n var fragment = hashOrSearch || '';\n if (fragment.charAt(0) === '#' && fragment.charAt(1) === '/') {\n fragment = fragment.substring(2);\n }\n if (fragment.charAt(0) === '#' || fragment.charAt(0) === '?') {\n fragment = fragment.substring(1);\n }\n var obj = {};\n var param;\n while (true) {\n param = paramSplit.exec(fragment);\n if (!param) {\n break;\n }\n var key = param[1];\n var value = param[2];\n if (key === 'id_token' || key === 'access_token' || key === 'code') {\n obj[key] = value;\n }\n else {\n obj[key] = decodeURIComponent(value.replace(plus2space, ' '));\n }\n }\n return obj;\n}\n\nexport { urlParamsToObject };\n//# sourceMappingURL=urlParams.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from '../errors/CustomError.js';\nimport { urlParamsToObject } from '../oidc/util/urlParams.js';\n\nclass EmailVerifyCallbackError extends CustomError {\n constructor(state, otp) {\n super(`Enter the OTP code in the originating client: ${otp}`);\n this.name = 'EmailVerifyCallbackError';\n this.state = state;\n this.otp = otp;\n }\n}\nfunction isEmailVerifyCallbackError(error) {\n return (error.name === 'EmailVerifyCallbackError');\n}\nfunction isEmailVerifyCallback(urlPath) {\n return /(otp=)/i.test(urlPath) && /(state=)/i.test(urlPath);\n}\nfunction parseEmailVerifyCallback(urlPath) {\n return urlParamsToObject(urlPath);\n}\nasync function handleEmailVerifyCallback(authClient, search) {\n if (isEmailVerifyCallback(search)) {\n const { state, otp } = parseEmailVerifyCallback(search);\n if (authClient.idx.canProceed({ state })) {\n return await authClient.idx.proceed({ state, otp });\n }\n else {\n throw new EmailVerifyCallbackError(state, otp);\n }\n }\n}\n\nexport { EmailVerifyCallbackError, handleEmailVerifyCallback, isEmailVerifyCallback, isEmailVerifyCallbackError, parseEmailVerifyCallback };\n//# sourceMappingURL=emailVerify.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\nimport { getSavedTransactionMeta } from './transactionMeta.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\n\nfunction canProceed(authClient, options = {}) {\n const meta = getSavedTransactionMeta(authClient, options);\n return !!(meta || options.stateHandle);\n}\nasync function proceed(authClient, options = {}) {\n if (!canProceed(authClient, options)) {\n throw new AuthSdkError('Unable to proceed: saved transaction could not be loaded');\n }\n let { flow, state } = options;\n if (!flow) {\n const meta = getSavedTransactionMeta(authClient, { state });\n flow = meta === null || meta === void 0 ? void 0 : meta.flow;\n }\n return run(authClient, Object.assign(Object.assign({}, options), { flow }));\n}\n\nexport { canProceed, proceed };\n//# sourceMappingURL=proceed.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { proceed } from './proceed.js';\nimport { getSavedTransactionMeta } from './transactionMeta.js';\nimport { warn } from '../util/console.js';\n\nasync function poll(authClient, options = {}) {\n var _a;\n let transaction = await proceed(authClient, {\n startPolling: true\n });\n const meta = getSavedTransactionMeta(authClient);\n let availablePollingRemeditaions = (_a = meta === null || meta === void 0 ? void 0 : meta.remediations) === null || _a === void 0 ? void 0 : _a.find(remediation => remediation.includes('poll'));\n if (!(availablePollingRemeditaions === null || availablePollingRemeditaions === void 0 ? void 0 : availablePollingRemeditaions.length)) {\n warn('No polling remediations available at the current IDX flow stage');\n }\n if (Number.isInteger(options.refresh)) {\n return new Promise(function (resolve, reject) {\n setTimeout(async function () {\n var _a, _b;\n try {\n const refresh = (_b = (_a = transaction.nextStep) === null || _a === void 0 ? void 0 : _a.poll) === null || _b === void 0 ? void 0 : _b.refresh;\n if (refresh) {\n resolve(poll(authClient, {\n refresh\n }));\n }\n else {\n resolve(transaction);\n }\n }\n catch (err) {\n reject(err);\n }\n }, options.refresh);\n });\n }\n return transaction;\n}\n\nexport { poll };\n//# sourceMappingURL=poll.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\n\nasync function startTransaction(authClient, options = {}) {\n authClient.transactionManager.clear();\n return run(authClient, Object.assign({ exchangeCodeForTokens: false }, options));\n}\n\nexport { startTransaction };\n//# sourceMappingURL=startTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\nimport { hasSavedInteractionHandle } from './transactionMeta.js';\nimport { startTransaction } from './startTransaction.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { IdxFeature } from './types/api.js';\n\nasync function register(authClient, options = {}) {\n if (!hasSavedInteractionHandle(authClient)) {\n const { enabledFeatures } = await startTransaction(authClient, Object.assign(Object.assign({}, options), { flow: 'register', autoRemediate: false }));\n if (!options.activationToken && enabledFeatures && !enabledFeatures.includes(IdxFeature.REGISTRATION)) {\n throw new AuthSdkError('Registration is not supported based on your current org configuration.');\n }\n }\n return run(authClient, Object.assign(Object.assign({}, options), { flow: 'register' }));\n}\n\nexport { register };\n//# sourceMappingURL=register.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\nimport './types/api.js';\nimport './remediators/EnrollAuthenticator.js';\nimport './remediators/EnrollPoll.js';\nimport './remediators/SelectEnrollmentChannel.js';\nimport './remediators/EnrollmentChannelData.js';\nimport './remediators/ChallengeAuthenticator.js';\nimport './remediators/ChallengePoll.js';\nimport './remediators/ResetAuthenticator.js';\nimport './remediators/EnrollProfile.js';\nimport './remediators/Identify.js';\nimport './remediators/ReEnrollAuthenticator.js';\nimport './remediators/ReEnrollAuthenticatorWarning.js';\nimport './remediators/RedirectIdp.js';\nimport './remediators/SelectAuthenticatorAuthenticate.js';\nimport './remediators/SelectAuthenticatorEnroll.js';\nimport './remediators/SelectAuthenticatorUnlockAccount.js';\nimport './remediators/SelectEnrollProfile.js';\nimport './remediators/AuthenticatorVerificationData.js';\nimport './remediators/AuthenticatorEnrollmentData.js';\nimport './remediators/Skip.js';\nimport '../errors/WWWAuthError.js';\nimport { getFlowSpecification } from './flow/FlowSpecification.js';\n\nasync function recoverPassword(authClient, options = {}) {\n const flowSpec = getFlowSpecification(authClient, 'recoverPassword');\n return run(authClient, Object.assign(Object.assign({}, options), flowSpec));\n}\n\nexport { recoverPassword };\n//# sourceMappingURL=recoverPassword.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport OAuthError from '../errors/OAuthError.js';\nimport '../errors/WWWAuthError.js';\n\nasync function handleInteractionCodeRedirect(authClient, url) {\n const meta = authClient.transactionManager.load();\n if (!meta) {\n throw new AuthSdkError('No transaction data was found in storage');\n }\n const { codeVerifier, state: savedState } = meta;\n const { searchParams\n } = new URL(url);\n const state = searchParams.get('state');\n const interactionCode = searchParams.get('interaction_code');\n const error = searchParams.get('error');\n if (error) {\n throw new OAuthError(error, searchParams.get('error_description'));\n }\n if (state !== savedState) {\n throw new AuthSdkError('State in redirect uri does not match with transaction state');\n }\n if (!interactionCode) {\n throw new AuthSdkError('Unable to parse interaction_code from the url');\n }\n const { tokens } = await authClient.token.exchangeCodeForTokens({ interactionCode, codeVerifier });\n authClient.tokenManager.setTokens(tokens);\n}\n\nexport { handleInteractionCodeRedirect };\n//# sourceMappingURL=handleInteractionCodeRedirect.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { run } from './run.js';\nimport { hasSavedInteractionHandle } from './transactionMeta.js';\nimport { startTransaction } from './startTransaction.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { IdxFeature } from './types/api.js';\n\nasync function unlockAccount(authClient, options = {}) {\n options.flow = 'unlockAccount';\n if (!hasSavedInteractionHandle(authClient)) {\n const { enabledFeatures } = await startTransaction(authClient, Object.assign(Object.assign({}, options), { autoRemediate: false }));\n if (enabledFeatures && !enabledFeatures.includes(IdxFeature.ACCOUNT_UNLOCK)) {\n throw new AuthSdkError('Self Service Account Unlock is not supported based on your current org configuration.');\n }\n }\n return run(authClient, Object.assign({}, options));\n}\n\nexport { unlockAccount };\n//# sourceMappingURL=unlockAccount.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isOAuthError } from '../../errors/index.js';\n\nfunction isInteractionRequiredError(error) {\n if (error.name !== 'OAuthError') {\n return false;\n }\n const oauthError = error;\n return (oauthError.errorCode === 'interaction_required');\n}\nfunction isAuthorizationCodeError(sdk, error) {\n if (error.name !== 'AuthApiError') {\n return false;\n }\n const authApiError = error;\n const errorResponse = authApiError.xhr;\n const responseJSON = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.responseJSON;\n return sdk.options.pkce && ((responseJSON === null || responseJSON === void 0 ? void 0 : responseJSON.error) === 'invalid_grant');\n}\nfunction isRefreshTokenInvalidError(error) {\n return isOAuthError(error) &&\n error.errorCode === 'invalid_grant' &&\n error.errorSummary === 'The refresh token is invalid or expired.';\n}\n\nexport { isAuthorizationCodeError, isInteractionRequiredError, isRefreshTokenInvalidError };\n//# sourceMappingURL=errors.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction hasTokensInHash(hash) {\n return /((id|access)_token=)/i.test(hash);\n}\nfunction hasAuthorizationCode(hashOrSearch) {\n return /(code=)/i.test(hashOrSearch);\n}\nfunction hasInteractionCode(hashOrSearch) {\n return /(interaction_code=)/i.test(hashOrSearch);\n}\nfunction hasErrorInUrl(hashOrSearch) {\n return /(error=)/i.test(hashOrSearch) || /(error_description)/i.test(hashOrSearch);\n}\nfunction isRedirectUri(uri, sdk) {\n var authParams = sdk.options;\n if (!uri || !authParams.redirectUri) {\n return false;\n }\n return uri.indexOf(authParams.redirectUri) === 0;\n}\nfunction isCodeFlow(options) {\n return options.pkce || options.responseType === 'code' || options.responseMode === 'query';\n}\nfunction hasResponseType(responseType, options) {\n let hasResponseType = false;\n if (Array.isArray(options.responseType) && options.responseType.length) {\n hasResponseType = options.responseType.indexOf(responseType) >= 0;\n }\n else {\n hasResponseType = options.responseType === responseType;\n }\n return hasResponseType;\n}\nfunction getHashOrSearch(options) {\n var codeFlow = isCodeFlow(options);\n var useQuery = codeFlow && options.responseMode !== 'fragment';\n return useQuery ? window.location.search : window.location.hash;\n}\nfunction isLoginRedirect(sdk) {\n if (!isRedirectUri(window.location.href, sdk)) {\n return false;\n }\n var codeFlow = isCodeFlow(sdk.options);\n var hashOrSearch = getHashOrSearch(sdk.options);\n if (hasErrorInUrl(hashOrSearch)) {\n return true;\n }\n if (codeFlow) {\n var hasCode = hasAuthorizationCode(hashOrSearch) || hasInteractionCode(hashOrSearch);\n return hasCode;\n }\n return hasTokensInHash(window.location.hash);\n}\nfunction isInteractionRequired(sdk, hashOrSearch) {\n if (!hashOrSearch) {\n if (!isLoginRedirect(sdk)) {\n return false;\n }\n hashOrSearch = getHashOrSearch(sdk.options);\n }\n return /(error=interaction_required)/i.test(hashOrSearch);\n}\n\nexport { getHashOrSearch, hasAuthorizationCode, hasErrorInUrl, hasInteractionCode, hasResponseType, hasTokensInHash, isCodeFlow, isInteractionRequired, isLoginRedirect, isRedirectUri };\n//# sourceMappingURL=loginRedirect.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { Remediator } from './Base/Remediator.js';\nexport { EnrollAuthenticator } from './EnrollAuthenticator.js';\nexport { EnrollPoll } from './EnrollPoll.js';\nexport { SelectEnrollmentChannel } from './SelectEnrollmentChannel.js';\nexport { EnrollmentChannelData } from './EnrollmentChannelData.js';\nexport { ChallengeAuthenticator } from './ChallengeAuthenticator.js';\nexport { ChallengePoll } from './ChallengePoll.js';\nexport { ResetAuthenticator } from './ResetAuthenticator.js';\nexport { EnrollProfile } from './EnrollProfile.js';\nexport { Identify } from './Identify.js';\nexport { ReEnrollAuthenticator } from './ReEnrollAuthenticator.js';\nexport { ReEnrollAuthenticatorWarning } from './ReEnrollAuthenticatorWarning.js';\nexport { RedirectIdp } from './RedirectIdp.js';\nexport { SelectAuthenticatorAuthenticate } from './SelectAuthenticatorAuthenticate.js';\nexport { SelectAuthenticatorEnroll } from './SelectAuthenticatorEnroll.js';\nexport { SelectAuthenticatorUnlockAccount } from './SelectAuthenticatorUnlockAccount.js';\nexport { SelectEnrollProfile } from './SelectEnrollProfile.js';\nexport { AuthenticatorVerificationData } from './AuthenticatorVerificationData.js';\nexport { AuthenticatorEnrollmentData } from './AuthenticatorEnrollmentData.js';\nexport { Skip } from './Skip.js';\nexport { GenericRemediator } from './GenericRemediator/GenericRemediator.js';\n//# sourceMappingURL=index.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../../errors/WWWAuthError.js';\nimport { isInteractionRequiredError } from '../../oidc/util/errors.js';\nimport { isInteractionRequired } from '../../oidc/util/loginRedirect.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../../oidc/types/Token.js';\nimport { authenticate } from '../authenticate.js';\nimport { cancel } from '../cancel.js';\nimport { handleEmailVerifyCallback, isEmailVerifyCallback, parseEmailVerifyCallback, isEmailVerifyCallbackError } from '../emailVerify.js';\nimport { handleInteractionCodeRedirect } from '../handleInteractionCodeRedirect.js';\nimport { makeIdxState } from '../idxState/index.js';\nimport { interact } from '../interact.js';\nimport { introspect } from '../introspect.js';\nimport { poll } from '../poll.js';\nimport { proceed, canProceed } from '../proceed.js';\nimport { recoverPassword } from '../recoverPassword.js';\nimport { register } from '../register.js';\nimport { startTransaction } from '../startTransaction.js';\nimport { getSavedTransactionMeta, createTransactionMeta, getTransactionMeta, saveTransactionMeta, clearTransactionMeta, isTransactionMetaValid } from '../transactionMeta.js';\nimport { unlockAccount } from '../unlockAccount.js';\nimport * as index from '../remediators/index.js';\nimport { getFlowSpecification } from '../flow/FlowSpecification.js';\nimport { setRemediatorsCtx } from '../util.js';\n\nfunction createIdxAPI(sdk) {\n setRemediatorsCtx({\n remediators: index,\n getFlowSpecification,\n });\n const boundStartTransaction = startTransaction.bind(null, sdk);\n const idx = {\n interact: interact.bind(null, sdk),\n introspect: introspect.bind(null, sdk),\n makeIdxResponse: makeIdxState.bind(null, sdk),\n authenticate: authenticate.bind(null, sdk),\n register: register.bind(null, sdk),\n start: boundStartTransaction,\n startTransaction: boundStartTransaction,\n poll: poll.bind(null, sdk),\n proceed: proceed.bind(null, sdk),\n cancel: cancel.bind(null, sdk),\n recoverPassword: recoverPassword.bind(null, sdk),\n handleInteractionCodeRedirect: handleInteractionCodeRedirect.bind(null, sdk),\n isInteractionRequired: isInteractionRequired.bind(null, sdk),\n isInteractionRequiredError,\n handleEmailVerifyCallback: handleEmailVerifyCallback.bind(null, sdk),\n isEmailVerifyCallback,\n parseEmailVerifyCallback,\n isEmailVerifyCallbackError,\n getSavedTransactionMeta: getSavedTransactionMeta.bind(null, sdk),\n createTransactionMeta: createTransactionMeta.bind(null, sdk),\n getTransactionMeta: getTransactionMeta.bind(null, sdk),\n saveTransactionMeta: saveTransactionMeta.bind(null, sdk),\n clearTransactionMeta: clearTransactionMeta.bind(null, sdk),\n isTransactionMetaValid,\n setFlow: (flow) => {\n sdk.options.flow = flow;\n },\n getFlow: () => {\n return sdk.options.flow;\n },\n canProceed: canProceed.bind(null, sdk),\n unlockAccount: unlockAccount.bind(null, sdk),\n };\n return idx;\n}\n\nexport { createIdxAPI };\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst a = function (str) { return atob(str); };\nconst b = function (str) { return btoa(str); };\nconst c = typeof crypto === 'undefined' ? null : crypto;\n\nexport { a as atob, b as btoa, c as webcrypto };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport './errors/WWWAuthError.js';\nimport { webcrypto as c } from './crypto/browser.js';\n\nconst isWindowsPhone = /windows phone|iemobile|wpdesktop/i;\nfunction isBrowser() {\n return typeof document !== 'undefined' && typeof window !== 'undefined';\n}\nfunction isIE11OrLess() {\n if (!isBrowser()) {\n return false;\n }\n const documentMode = document.documentMode;\n return !!documentMode && documentMode <= 11;\n}\nfunction getUserAgent() {\n return navigator.userAgent;\n}\nfunction isFingerprintSupported() {\n const agent = getUserAgent();\n return agent && !isWindowsPhone.test(agent);\n}\nfunction isPopupPostMessageSupported() {\n if (!isBrowser()) {\n return false;\n }\n const documentMode = document.documentMode;\n var isIE8or9 = documentMode && documentMode < 10;\n if (typeof window.postMessage !== 'undefined' && !isIE8or9) {\n return true;\n }\n return false;\n}\nfunction isWebCryptoSubtleSupported() {\n return typeof c !== 'undefined'\n && c !== null\n && typeof c.subtle !== 'undefined'\n && typeof Uint8Array !== 'undefined';\n}\nfunction isTokenVerifySupported() {\n return isWebCryptoSubtleSupported();\n}\nfunction hasTextEncoder() {\n return typeof TextEncoder !== 'undefined';\n}\nfunction isPKCESupported() {\n return isTokenVerifySupported() && hasTextEncoder();\n}\nfunction isHTTPS() {\n if (!isBrowser()) {\n return false;\n }\n return window.location.protocol === 'https:';\n}\nfunction isLocalhost() {\n return isBrowser() && window.location.hostname === 'localhost';\n}\nfunction isDPoPSupported() {\n return !isIE11OrLess() &&\n typeof window.indexedDB !== 'undefined' &&\n hasTextEncoder() &&\n isWebCryptoSubtleSupported();\n}\n\nexport { getUserAgent, hasTextEncoder, isBrowser, isDPoPSupported, isFingerprintSupported, isHTTPS, isIE11OrLess, isLocalhost, isPKCESupported, isPopupPostMessageSupported, isTokenVerifySupported };\n//# sourceMappingURL=features.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { removeNils } from '../util/object.js';\nimport * as features from '../features.js';\nimport * as constants from '../constants.js';\nimport Emitter from 'tiny-emitter';\n\nfunction createOktaAuthBase(OptionsConstructor) {\n class OktaAuthBase {\n constructor(...args) {\n const options = new OptionsConstructor(args.length ? args[0] || {} : {});\n this.options = removeNils(options);\n this.emitter = new Emitter();\n this.features = features;\n }\n }\n OktaAuthBase.features = features;\n OktaAuthBase.constants = constants;\n OktaAuthBase.features = OktaAuthBase.prototype.features = features;\n Object.assign(OktaAuthBase, {\n constants\n });\n return OktaAuthBase;\n}\n\nexport { createOktaAuthBase };\n//# sourceMappingURL=factory.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction mixinStorage(Base, StorageManager) {\n return class OktaAuthStorage extends Base {\n constructor(...args) {\n super(...args);\n const { storageManager, cookies, storageUtil } = this.options;\n this.storageManager = new StorageManager(storageManager, cookies, storageUtil);\n }\n clearStorage() {\n }\n };\n}\n\nexport { mixinStorage };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isBrowser } from '../features.js';\n\nclass OktaUserAgent {\n constructor() {\n this.environments = [`okta-auth-js/${\"7.8.1\"}`];\n this.maybeAddNodeEnvironment();\n }\n addEnvironment(env) {\n this.environments.push(env);\n }\n getHttpHeader() {\n return { 'X-Okta-User-Agent-Extended': this.environments.join(' ') };\n }\n getVersion() {\n return \"7.8.1\";\n }\n maybeAddNodeEnvironment() {\n if (isBrowser() || !process || !process.versions) {\n return;\n }\n const { node: version } = process.versions;\n this.environments.push(`nodejs/${version}`);\n }\n}\n\nexport { OktaUserAgent };\n//# sourceMappingURL=OktaUserAgent.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction setRequestHeader(authClient, headerName, headerValue) {\n authClient.options.headers = authClient.options.headers || {};\n authClient.options.headers[headerName] = headerValue;\n}\n\nexport { setRequestHeader };\n//# sourceMappingURL=headers.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { OktaUserAgent } from './OktaUserAgent.js';\nimport { setRequestHeader } from './headers.js';\nimport { toQueryString } from '../util/url.js';\nimport { get } from './request.js';\n\nfunction mixinHttp(Base) {\n return class OktaAuthHttp extends Base {\n constructor(...args) {\n super(...args);\n this._oktaUserAgent = new OktaUserAgent();\n this.http = {\n setRequestHeader: setRequestHeader.bind(null, this)\n };\n }\n setHeaders(headers) {\n this.options.headers = Object.assign({}, this.options.headers, headers);\n }\n getIssuerOrigin() {\n return this.options.issuer.split('/oauth2/')[0];\n }\n webfinger(opts) {\n var url = '/.well-known/webfinger' + toQueryString(opts);\n var options = {\n headers: {\n 'Accept': 'application/jrd+json'\n }\n };\n return get(this, url, options);\n }\n };\n}\n\nexport { mixinHttp };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { btoa as b, atob as a } from './browser.js';\n\nfunction stringToBase64Url(str) {\n var b64 = b(str);\n return base64ToBase64Url(b64);\n}\nfunction base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nfunction base64UrlToBase64(b64u) {\n return b64u.replace(/-/g, '+').replace(/_/g, '/');\n}\nfunction base64UrlToString(b64u) {\n var b64 = base64UrlToBase64(b64u);\n switch (b64.length % 4) {\n case 0:\n break;\n case 2:\n b64 += '==';\n break;\n case 3:\n b64 += '=';\n break;\n default:\n throw new AuthSdkError('Not a valid Base64Url');\n }\n var utf8 = a(b64);\n try {\n return decodeURIComponent(escape(utf8));\n }\n catch (e) {\n return utf8;\n }\n}\nfunction stringToBuffer(str) {\n var buffer = new Uint8Array(str.length);\n for (var i = 0; i < str.length; i++) {\n buffer[i] = str.charCodeAt(i);\n }\n return buffer;\n}\nfunction base64UrlDecode(str) {\n return a(base64UrlToBase64(str));\n}\nfunction base64UrlToBuffer(b64u) {\n return Uint8Array.from(base64UrlDecode(b64u), (c) => c.charCodeAt(0));\n}\nfunction bufferToBase64Url(bin) {\n return b(new Uint8Array(bin).reduce((s, byte) => s + String.fromCharCode(byte), ''));\n}\n\nexport { base64ToBase64Url, base64UrlDecode, base64UrlToBase64, base64UrlToBuffer, base64UrlToString, bufferToBase64Url, stringToBase64Url, stringToBuffer };\n//# sourceMappingURL=base64.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { stringToBase64Url } from './base64.js';\nimport { webcrypto as c } from './browser.js';\n\nfunction getOidcHash(str) {\n var buffer = new TextEncoder().encode(str);\n return c.subtle.digest('SHA-256', buffer).then(function (arrayBuffer) {\n var intBuffer = new Uint8Array(arrayBuffer);\n var firstHalf = intBuffer.slice(0, 16);\n var hash = String.fromCharCode.apply(null, firstHalf);\n var b64u = stringToBase64Url(hash);\n return b64u;\n });\n}\n\nexport { getOidcHash };\n//# sourceMappingURL=oidcHash.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { clone } from '../util/object.js';\nimport { stringToBuffer, base64UrlDecode } from './base64.js';\nimport { webcrypto as c } from './browser.js';\n\nfunction verifyToken(idToken, key) {\n key = clone(key);\n var format = 'jwk';\n var algo = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n };\n var extractable = true;\n var usages = ['verify'];\n delete key.use;\n return c.subtle.importKey(format, key, algo, extractable, usages)\n .then(function (cryptoKey) {\n var jwt = idToken.split('.');\n var payload = stringToBuffer(jwt[0] + '.' + jwt[1]);\n var b64Signature = base64UrlDecode(jwt[2]);\n var signature = stringToBuffer(b64Signature);\n return c.subtle.verify(algo, cryptoKey, signature, payload);\n });\n}\n\nexport { verifyToken };\n//# sourceMappingURL=verifyToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { base64ToBase64Url, base64UrlDecode, base64UrlToBase64, base64UrlToBuffer, base64UrlToString, bufferToBase64Url, stringToBase64Url, stringToBuffer } from './base64.js';\nexport { getOidcHash } from './oidcHash.js';\nexport { verifyToken } from './verifyToken.js';\nexport { atob, btoa, webcrypto } from './browser.js';\n//# sourceMappingURL=index.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isPromise } from './types.js';\nimport { warn } from './console.js';\n\nclass PromiseQueue {\n constructor(options = { quiet: false }) {\n this.queue = [];\n this.running = false;\n this.options = options;\n }\n push(method, thisObject, ...args) {\n return new Promise((resolve, reject) => {\n if (this.queue.length > 0) {\n if (this.options.quiet !== false) {\n warn('Async method is being called but another async method is already running. ' +\n 'The new method will be delayed until the previous method completes.');\n }\n }\n this.queue.push({\n method,\n thisObject,\n args,\n resolve,\n reject\n });\n this.run();\n });\n }\n run() {\n if (this.running) {\n return;\n }\n if (this.queue.length === 0) {\n return;\n }\n this.running = true;\n var queueItem = this.queue.shift();\n var res = queueItem.method.apply(queueItem.thisObject, queueItem.args);\n if (isPromise(res)) {\n res.then(queueItem.resolve, queueItem.reject).finally(() => {\n this.running = false;\n this.run();\n });\n }\n else {\n queueItem.resolve(res);\n this.running = false;\n this.run();\n }\n }\n}\n\nexport { PromiseQueue };\n//# sourceMappingURL=PromiseQueue.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { stringToBase64Url } from '../../crypto/base64.js';\nimport { webcrypto as c } from '../../crypto/browser.js';\nimport { DEFAULT_CODE_CHALLENGE_METHOD, MIN_VERIFIER_LENGTH, MAX_VERIFIER_LENGTH } from '../../constants.js';\n\nfunction dec2hex(dec) {\n return ('0' + dec.toString(16)).substr(-2);\n}\nfunction getRandomString(length) {\n var a = new Uint8Array(Math.ceil(length / 2));\n c.getRandomValues(a);\n var str = Array.from(a, dec2hex).join('');\n return str.slice(0, length);\n}\nfunction generateVerifier(prefix) {\n var verifier = prefix || '';\n if (verifier.length < MIN_VERIFIER_LENGTH) {\n verifier = verifier + getRandomString(MIN_VERIFIER_LENGTH - verifier.length);\n }\n return encodeURIComponent(verifier).slice(0, MAX_VERIFIER_LENGTH);\n}\nfunction computeChallenge(str) {\n var buffer = new TextEncoder().encode(str);\n return c.subtle.digest('SHA-256', buffer).then(function (arrayBuffer) {\n var hash = String.fromCharCode.apply(null, new Uint8Array(arrayBuffer));\n var b64u = stringToBase64Url(hash);\n return b64u;\n });\n}\nvar PKCE = {\n DEFAULT_CODE_CHALLENGE_METHOD,\n generateVerifier,\n computeChallenge\n};\n\nexport { PKCE as default };\n//# sourceMappingURL=pkce.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { base64UrlToString } from '../crypto/base64.js';\n\nfunction decodeToken(token) {\n var jwt = token.split('.');\n var decodedToken;\n try {\n decodedToken = {\n header: JSON.parse(base64UrlToString(jwt[0])),\n payload: JSON.parse(base64UrlToString(jwt[1])),\n signature: jwt[2]\n };\n }\n catch (e) {\n throw new AuthSdkError('Malformed token');\n }\n return decodedToken;\n}\n\nexport { decodeToken };\n//# sourceMappingURL=decodeToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { generateState, generateNonce } from './oauth.js';\nimport { isBrowser } from '../../features.js';\nimport { removeNils } from '../../util/object.js';\n\nfunction getDefaultTokenParams(sdk) {\n const { pkce, clientId, redirectUri, responseType, responseMode, scopes, acrValues, maxAge, state, ignoreSignature, dpop } = sdk.options;\n const defaultRedirectUri = isBrowser() ? window.location.href : undefined;\n return removeNils({\n pkce,\n clientId,\n redirectUri: redirectUri || defaultRedirectUri,\n responseType: responseType || ['token', 'id_token'],\n responseMode,\n state: state || generateState(),\n nonce: generateNonce(),\n scopes: scopes || ['openid', 'email'],\n acrValues,\n maxAge,\n ignoreSignature,\n dpop,\n });\n}\n\nexport { getDefaultTokenParams };\n//# sourceMappingURL=defaultTokenParams.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { stringToBase64Url, stringToBuffer, base64ToBase64Url, bufferToBase64Url } from '../crypto/base64.js';\nimport { webcrypto as c, btoa as b } from '../crypto/browser.js';\nimport { isOAuthError, isWWWAuthError } from '../errors/index.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\n\nconst INDEXEDDB_NAME = 'OktaAuthJs';\nconst DB_KEY = 'DPoPKeys';\nfunction isDPoPNonceError(obj) {\n return ((isOAuthError(obj) || isWWWAuthError(obj)) &&\n obj.errorCode === 'use_dpop_nonce');\n}\nasync function createJwt(header, claims, signingKey) {\n const head = stringToBase64Url(JSON.stringify(header));\n const body = stringToBase64Url(JSON.stringify(claims));\n const signature = await c.subtle.sign({ name: signingKey.algorithm.name }, signingKey, stringToBuffer(`${head}.${body}`));\n return `${head}.${body}.${base64ToBase64Url(bufferToBase64Url(signature))}`;\n}\nfunction cryptoRandomValue(byteLen = 32) {\n return [...c.getRandomValues(new Uint8Array(byteLen))].map(v => v.toString(16)).join('');\n}\nasync function generateKeyPair() {\n const algorithm = {\n name: 'RSASSA-PKCS1-v1_5',\n hash: 'SHA-256',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n };\n return c.subtle.generateKey(algorithm, false, ['sign', 'verify']);\n}\nasync function hashAccessToken(accessToken) {\n const buffer = new TextEncoder().encode(accessToken);\n const hash = await c.subtle.digest('SHA-256', buffer);\n return b(String.fromCharCode.apply(null, new Uint8Array(hash)))\n .replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\nfunction keyStore() {\n return new Promise((resolve, reject) => {\n try {\n const indexedDB = window.indexedDB;\n const req = indexedDB.open(INDEXEDDB_NAME, 1);\n req.onerror = function () {\n reject(req.error);\n };\n req.onupgradeneeded = function () {\n const db = req.result;\n db.createObjectStore(DB_KEY);\n };\n req.onsuccess = function () {\n const db = req.result;\n const tx = db.transaction(DB_KEY, 'readwrite');\n tx.onerror = function () {\n reject(tx.error);\n };\n const store = tx.objectStore(DB_KEY);\n resolve(store);\n tx.oncomplete = function () {\n db.close();\n };\n };\n }\n catch (err) {\n reject(err);\n }\n });\n}\nasync function invokeStoreMethod(method, ...args) {\n const store = await keyStore();\n return new Promise((resolve, reject) => {\n const req = store[method](...args);\n req.onsuccess = function () {\n resolve(req);\n };\n req.onerror = function () {\n reject(req.error);\n };\n });\n}\nasync function storeKeyPair(pairId, keyPair) {\n await invokeStoreMethod('add', keyPair, pairId);\n return keyPair;\n}\nasync function findKeyPair(pairId) {\n if (pairId) {\n const req = await invokeStoreMethod('get', pairId);\n if (req.result) {\n return req.result;\n }\n }\n throw new AuthSdkError(`Unable to locate dpop key pair required for refresh${pairId ? ` (${pairId})` : ''}`);\n}\nasync function clearDPoPKeyPair(pairId) {\n await invokeStoreMethod('delete', pairId);\n}\nasync function clearAllDPoPKeyPairs() {\n await invokeStoreMethod('clear');\n}\nasync function createDPoPKeyPair() {\n const keyPairId = cryptoRandomValue(4);\n const keyPair = await generateKeyPair();\n await storeKeyPair(keyPairId, keyPair);\n return { keyPair, keyPairId };\n}\nasync function clearDPoPKeyPairAfterRevoke(revokedToken, tokens) {\n var _a;\n let shouldClear = false;\n const { accessToken, refreshToken } = tokens;\n if (revokedToken === 'access' && accessToken && accessToken.tokenType === 'DPoP' && !refreshToken) {\n shouldClear = true;\n }\n if (revokedToken === 'refresh' && refreshToken && !accessToken) {\n shouldClear = true;\n }\n const pairId = (_a = accessToken === null || accessToken === void 0 ? void 0 : accessToken.dpopPairId) !== null && _a !== void 0 ? _a : refreshToken === null || refreshToken === void 0 ? void 0 : refreshToken.dpopPairId;\n if (shouldClear && pairId) {\n await clearDPoPKeyPair(pairId);\n }\n}\nasync function generateDPoPProof({ keyPair, url, method, nonce, accessToken }) {\n const { kty, crv, e, n, x, y } = await c.subtle.exportKey('jwk', keyPair.publicKey);\n const header = {\n alg: 'RS256',\n typ: 'dpop+jwt',\n jwk: { kty, crv, e, n, x, y }\n };\n const claims = {\n htm: method,\n htu: url,\n iat: Math.floor(Date.now() / 1000),\n jti: cryptoRandomValue(),\n };\n if (nonce) {\n claims.nonce = nonce;\n }\n if (accessToken) {\n claims.ath = await hashAccessToken(accessToken);\n }\n return createJwt(header, claims, keyPair.privateKey);\n}\nasync function generateDPoPForTokenRequest({ keyPair, url, method, nonce }) {\n const params = { keyPair, url, method };\n if (nonce) {\n params.nonce = nonce;\n }\n return generateDPoPProof(params);\n}\n\nexport { clearAllDPoPKeyPairs, clearDPoPKeyPair, clearDPoPKeyPairAfterRevoke, createDPoPKeyPair, createJwt, cryptoRandomValue, findKeyPair, generateDPoPForTokenRequest, generateDPoPProof, generateKeyPair, isDPoPNonceError };\n//# sourceMappingURL=dpop.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthApiError from '../../errors/AuthApiError.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { removeNils } from '../../util/object.js';\nimport { toQueryString } from '../../util/url.js';\nimport { httpRequest } from '../../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { generateDPoPForTokenRequest, isDPoPNonceError } from '../dpop.js';\n\nfunction validateOptions(options) {\n if (!options.clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to get a token');\n }\n if (!options.redirectUri) {\n throw new AuthSdkError('The redirectUri passed to /authorize must also be passed to /token');\n }\n if (!options.authorizationCode && !options.interactionCode) {\n throw new AuthSdkError('An authorization code (returned from /authorize) must be passed to /token');\n }\n if (!options.codeVerifier) {\n throw new AuthSdkError('The \"codeVerifier\" (generated and saved by your app) must be passed to /token');\n }\n}\nfunction getPostData(sdk, options) {\n var params = removeNils({\n 'client_id': options.clientId,\n 'redirect_uri': options.redirectUri,\n 'grant_type': options.interactionCode ? 'interaction_code' : 'authorization_code',\n 'code_verifier': options.codeVerifier\n });\n if (options.interactionCode) {\n params['interaction_code'] = options.interactionCode;\n }\n else if (options.authorizationCode) {\n params.code = options.authorizationCode;\n }\n const { clientSecret } = sdk.options;\n if (clientSecret) {\n params['client_secret'] = clientSecret;\n }\n return toQueryString(params).slice(1);\n}\nasync function makeTokenRequest(sdk, { url, data, nonce, dpopKeyPair }) {\n var _a, _b;\n const method = 'POST';\n const headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n if (sdk.options.dpop) {\n if (!dpopKeyPair) {\n throw new AuthSdkError('DPoP is configured but no key pair was provided');\n }\n const proof = await generateDPoPForTokenRequest({ url, method, nonce, keyPair: dpopKeyPair });\n headers.DPoP = proof;\n }\n try {\n const resp = await httpRequest(sdk, {\n url,\n method,\n args: data,\n headers\n });\n return resp;\n }\n catch (err) {\n if (isDPoPNonceError(err) && !nonce) {\n const dpopNonce = (_a = err.resp) === null || _a === void 0 ? void 0 : _a.headers['dpop-nonce'];\n if (!dpopNonce) {\n throw new AuthApiError({ errorSummary: 'No `dpop-nonce` header found when required' }, (_b = err.resp) !== null && _b !== void 0 ? _b : undefined\n );\n }\n return makeTokenRequest(sdk, { url, data, dpopKeyPair, nonce: dpopNonce });\n }\n throw err;\n }\n}\nasync function postToTokenEndpoint(sdk, options, urls) {\n validateOptions(options);\n var data = getPostData(sdk, options);\n const params = {\n url: urls.tokenUrl,\n data,\n dpopKeyPair: options === null || options === void 0 ? void 0 : options.dpopKeyPair\n };\n return makeTokenRequest(sdk, params);\n}\nasync function postRefreshToken(sdk, options, refreshToken) {\n const data = Object.entries({\n client_id: options.clientId,\n grant_type: 'refresh_token',\n scope: refreshToken.scopes.join(' '),\n refresh_token: refreshToken.refreshToken,\n }).map(function ([name, value]) {\n return name + '=' + encodeURIComponent(value);\n }).join('&');\n let url = refreshToken.tokenUrl;\n if (options.extraParams && Object.keys(options.extraParams).length >= 1) {\n url += toQueryString(options.extraParams);\n }\n const params = {\n url,\n data,\n dpopKeyPair: options === null || options === void 0 ? void 0 : options.dpopKeyPair\n };\n return makeTokenRequest(sdk, params);\n}\n\nexport { postRefreshToken, postToTokenEndpoint };\n//# sourceMappingURL=token.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { find } from '../../util/object.js';\nimport { get } from '../../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\n\nfunction getWellKnown(sdk, issuer) {\n var authServerUri = (issuer || sdk.options.issuer);\n return get(sdk, authServerUri + '/.well-known/openid-configuration', {\n cacheResponse: true\n });\n}\nfunction getKey(sdk, issuer, kid) {\n var httpCache = sdk.storageManager.getHttpCache(sdk.options.cookies);\n return getWellKnown(sdk, issuer)\n .then(function (wellKnown) {\n var jwksUri = wellKnown['jwks_uri'];\n var cacheContents = httpCache.getStorage();\n var cachedResponse = cacheContents[jwksUri];\n if (cachedResponse && Date.now() / 1000 < cachedResponse.expiresAt) {\n var cachedKey = find(cachedResponse.response.keys, {\n kid: kid\n });\n if (cachedKey) {\n return cachedKey;\n }\n }\n httpCache.clearStorage(jwksUri);\n return get(sdk, jwksUri, {\n cacheResponse: true\n })\n .then(function (res) {\n var key = find(res.keys, {\n kid: kid\n });\n if (key) {\n return key;\n }\n throw new AuthSdkError('The key id, ' + kid + ', was not found in the server\\'s keys');\n });\n });\n}\n\nexport { getKey, getWellKnown };\n//# sourceMappingURL=well-known.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../../errors/AuthSdkError.js';\n\nfunction validateClaims(sdk, claims, validationParams) {\n const aud = validationParams.clientId;\n const iss = validationParams.issuer;\n const nonce = validationParams.nonce;\n const acr = validationParams.acrValues;\n if (!claims || !iss || !aud) {\n throw new AuthSdkError('The jwt, iss, and aud arguments are all required');\n }\n if (nonce && claims.nonce !== nonce) {\n throw new AuthSdkError('OAuth flow response nonce doesn\\'t match request nonce');\n }\n const now = Math.floor(Date.now() / 1000);\n if (claims.iss !== iss) {\n throw new AuthSdkError('The issuer [' + claims.iss + '] ' +\n 'does not match [' + iss + ']');\n }\n if ((Array.isArray(claims.aud) && claims.aud.indexOf(aud) < 0) ||\n (!Array.isArray(claims.aud) && claims.aud !== aud)) {\n throw new AuthSdkError('The audience [' + claims.aud + '] ' +\n 'does not match [' + aud + ']');\n }\n if (acr && claims.acr !== acr) {\n throw new AuthSdkError('The acr [' + claims.acr + '] ' +\n 'does not match acr_values [' + acr + ']');\n }\n if (claims.iat > claims.exp) {\n throw new AuthSdkError('The JWT expired before it was issued');\n }\n if (!sdk.options.ignoreLifetime) {\n if ((now - sdk.options.maxClockSkew) > claims.exp) {\n throw new AuthSdkError('The JWT expired and is no longer valid');\n }\n if (claims.iat > (now + sdk.options.maxClockSkew)) {\n throw new AuthSdkError('The JWT was issued in the future');\n }\n }\n}\n\nexport { validateClaims };\n//# sourceMappingURL=validateClaims.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getWellKnown, getKey } from './endpoints/well-known.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getOidcHash } from '../crypto/oidcHash.js';\nimport { verifyToken as verifyToken$1 } from '../crypto/verifyToken.js';\nimport { validateClaims } from './util/validateClaims.js';\nimport './types/Token.js';\nimport { decodeToken } from './decodeToken.js';\n\nasync function verifyToken(sdk, token, validationParams) {\n if (!token || !token.idToken) {\n throw new AuthSdkError('Only idTokens may be verified');\n }\n const jwt = decodeToken(token.idToken);\n const configuredIssuer = (validationParams === null || validationParams === void 0 ? void 0 : validationParams.issuer) || sdk.options.issuer;\n const { issuer } = await getWellKnown(sdk, configuredIssuer);\n const validationOptions = Object.assign({\n clientId: sdk.options.clientId,\n ignoreSignature: sdk.options.ignoreSignature\n }, validationParams, {\n issuer\n });\n validateClaims(sdk, jwt.payload, validationOptions);\n if (validationOptions.ignoreSignature == true || !sdk.features.isTokenVerifySupported()) {\n return token;\n }\n const key = await getKey(sdk, token.issuer, jwt.header.kid);\n const valid = await verifyToken$1(token.idToken, key);\n if (!valid) {\n throw new AuthSdkError('The token signature is not valid');\n }\n if (validationParams && validationParams.accessToken && token.claims.at_hash) {\n const hash = await getOidcHash(validationParams.accessToken);\n if (hash !== token.claims.at_hash) {\n throw new AuthSdkError('Token hash verification failed');\n }\n }\n return token;\n}\n\nexport { verifyToken };\n//# sourceMappingURL=verifyToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { clone } from '../util/object.js';\nimport { getOAuthUrls } from './util/oauth.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport OAuthError from '../errors/OAuthError.js';\nimport '../errors/WWWAuthError.js';\nimport { verifyToken } from './verifyToken.js';\nimport { getDefaultTokenParams } from './util/defaultTokenParams.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport './types/Token.js';\n\nfunction validateResponse(res, oauthParams) {\n if (res['error'] && res['error_description']) {\n throw new OAuthError(res['error'], res['error_description']);\n }\n if (res.state !== oauthParams.state) {\n throw new AuthSdkError('OAuth flow response state doesn\\'t match request state');\n }\n if (oauthParams.dpop && res.token_type !== 'DPoP') {\n throw new AuthSdkError('Unable to parse OAuth flow response: DPoP was configured but \"token_type\" was not DPoP');\n }\n}\nasync function handleOAuthResponse(sdk, tokenParams, res, urls) {\n const pkce = sdk.options.pkce !== false;\n if (pkce && (res.code || res.interaction_code)) {\n return sdk.token.exchangeCodeForTokens(Object.assign({}, tokenParams, {\n authorizationCode: res.code,\n interactionCode: res.interaction_code\n }), urls);\n }\n tokenParams = tokenParams || getDefaultTokenParams(sdk);\n urls = urls || getOAuthUrls(sdk, tokenParams);\n let responseType = tokenParams.responseType || [];\n if (!Array.isArray(responseType) && responseType !== 'none') {\n responseType = [responseType];\n }\n let scopes;\n if (res.scope) {\n scopes = res.scope.split(' ');\n }\n else {\n scopes = clone(tokenParams.scopes);\n }\n const clientId = tokenParams.clientId || sdk.options.clientId;\n validateResponse(res, tokenParams);\n const tokenDict = {};\n const expiresIn = res.expires_in;\n const tokenType = res.token_type;\n const accessToken = res.access_token;\n const idToken = res.id_token;\n const refreshToken = res.refresh_token;\n const now = Math.floor(Date.now() / 1000);\n if (accessToken) {\n const accessJwt = sdk.token.decode(accessToken);\n tokenDict.accessToken = {\n accessToken: accessToken,\n claims: accessJwt.payload,\n expiresAt: Number(expiresIn) + now,\n tokenType: tokenType,\n scopes: scopes,\n authorizeUrl: urls.authorizeUrl,\n userinfoUrl: urls.userinfoUrl\n };\n if (tokenParams.dpopPairId) {\n tokenDict.accessToken.dpopPairId = tokenParams.dpopPairId;\n }\n if (tokenParams.extraParams) {\n tokenDict.accessToken.extraParams = tokenParams.extraParams;\n }\n }\n if (refreshToken) {\n tokenDict.refreshToken = {\n refreshToken: refreshToken,\n expiresAt: Number(expiresIn) + now,\n scopes: scopes,\n tokenUrl: urls.tokenUrl,\n authorizeUrl: urls.authorizeUrl,\n issuer: urls.issuer,\n };\n if (tokenParams.dpopPairId) {\n tokenDict.refreshToken.dpopPairId = tokenParams.dpopPairId;\n }\n if (tokenParams.extraParams) {\n tokenDict.refreshToken.extraParams = tokenParams.extraParams;\n }\n }\n if (idToken) {\n const idJwt = sdk.token.decode(idToken);\n const idTokenObj = {\n idToken: idToken,\n claims: idJwt.payload,\n expiresAt: idJwt.payload.exp - idJwt.payload.iat + now,\n scopes: scopes,\n authorizeUrl: urls.authorizeUrl,\n issuer: urls.issuer,\n clientId: clientId\n };\n if (tokenParams.extraParams) {\n idTokenObj.extraParams = tokenParams.extraParams;\n }\n const validationParams = {\n clientId: clientId,\n issuer: urls.issuer,\n nonce: tokenParams.nonce,\n accessToken: accessToken,\n acrValues: tokenParams.acrValues\n };\n if (tokenParams.ignoreSignature !== undefined) {\n validationParams.ignoreSignature = tokenParams.ignoreSignature;\n }\n await verifyToken(sdk, idTokenObj, validationParams);\n tokenDict.idToken = idTokenObj;\n }\n if (responseType.indexOf('token') !== -1 && !tokenDict.accessToken) {\n throw new AuthSdkError('Unable to parse OAuth flow response: response type \"token\" was requested but \"access_token\" was not returned.');\n }\n if (responseType.indexOf('id_token') !== -1 && !tokenDict.idToken) {\n throw new AuthSdkError('Unable to parse OAuth flow response: response type \"id_token\" was requested but \"id_token\" was not returned.');\n }\n return {\n tokens: tokenDict,\n state: res.state,\n code: res.code,\n responseType\n };\n}\n\nexport { handleOAuthResponse };\n//# sourceMappingURL=handleOAuthResponse.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../errors/WWWAuthError.js';\nimport { getDefaultTokenParams } from './util/defaultTokenParams.js';\nimport { getOAuthUrls } from './util/oauth.js';\nimport { clone } from '../util/object.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport './types/Token.js';\nimport { postToTokenEndpoint } from './endpoints/token.js';\nimport { handleOAuthResponse } from './handleOAuthResponse.js';\nimport { findKeyPair, createDPoPKeyPair } from './dpop.js';\n\nasync function exchangeCodeForTokens(sdk, tokenParams, urls) {\n urls = urls || getOAuthUrls(sdk, tokenParams);\n tokenParams = Object.assign({}, getDefaultTokenParams(sdk), clone(tokenParams));\n const { authorizationCode, interactionCode, codeVerifier, clientId, redirectUri, scopes, ignoreSignature, state, acrValues, dpop, dpopPairId, extraParams } = tokenParams;\n const getTokenOptions = {\n clientId,\n redirectUri,\n authorizationCode,\n interactionCode,\n codeVerifier,\n dpop,\n };\n const responseType = ['token'];\n if (scopes.indexOf('openid') !== -1) {\n responseType.push('id_token');\n }\n const handleResponseOptions = {\n clientId,\n redirectUri,\n scopes,\n responseType,\n ignoreSignature,\n acrValues,\n extraParams\n };\n try {\n if (dpop) {\n if (dpopPairId) {\n const keyPair = await findKeyPair(dpopPairId);\n getTokenOptions.dpopKeyPair = keyPair;\n handleResponseOptions.dpop = dpop;\n handleResponseOptions.dpopPairId = dpopPairId;\n }\n else {\n const { keyPair, keyPairId } = await createDPoPKeyPair();\n getTokenOptions.dpopKeyPair = keyPair;\n handleResponseOptions.dpop = dpop;\n handleResponseOptions.dpopPairId = keyPairId;\n }\n }\n const oauthResponse = await postToTokenEndpoint(sdk, getTokenOptions, urls);\n const tokenResponse = await handleOAuthResponse(sdk, handleResponseOptions, oauthResponse, urls);\n tokenResponse.code = authorizationCode;\n tokenResponse.state = state;\n return tokenResponse;\n }\n finally {\n sdk.transactionManager.clear();\n }\n}\n\nexport { exchangeCodeForTokens };\n//# sourceMappingURL=exchangeCodeForTokens.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthApiError from '../errors/AuthApiError.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport OAuthError from '../errors/OAuthError.js';\nimport WWWAuthError from '../errors/WWWAuthError.js';\nimport { httpRequest } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { isAccessToken, isIDToken } from './types/Token.js';\n\nasync function getUserInfo(sdk, accessTokenObject, idTokenObject) {\n if (!accessTokenObject) {\n accessTokenObject = (await sdk.tokenManager.getTokens()).accessToken;\n }\n if (!idTokenObject) {\n idTokenObject = (await sdk.tokenManager.getTokens()).idToken;\n }\n if (!accessTokenObject || !isAccessToken(accessTokenObject)) {\n return Promise.reject(new AuthSdkError('getUserInfo requires an access token object'));\n }\n if (!idTokenObject || !isIDToken(idTokenObject)) {\n return Promise.reject(new AuthSdkError('getUserInfo requires an ID token object'));\n }\n const options = {\n url: accessTokenObject.userinfoUrl,\n method: 'GET',\n accessToken: accessTokenObject.accessToken\n };\n if (sdk.options.dpop) {\n const headers = await sdk.getDPoPAuthorizationHeaders(Object.assign(Object.assign({}, options), { accessToken: accessTokenObject }));\n options.headers = headers;\n delete options.accessToken;\n }\n return httpRequest(sdk, options)\n .then(userInfo => {\n if (userInfo.sub === idTokenObject.claims.sub) {\n return userInfo;\n }\n return Promise.reject(new AuthSdkError('getUserInfo request was rejected due to token mismatch'));\n })\n .catch(function (err) {\n var _a;\n if (err instanceof WWWAuthError && !sdk.options.dpop) {\n const { error, errorDescription } = err;\n throw new OAuthError(error, errorDescription);\n }\n if (!sdk.options.dpop) {\n let e = err;\n if (err instanceof AuthApiError && ((_a = err === null || err === void 0 ? void 0 : err.meta) === null || _a === void 0 ? void 0 : _a.wwwAuthHeader)) {\n e = WWWAuthError.parseHeader(err.meta.wwwAuthHeader);\n }\n if (e instanceof WWWAuthError) {\n const { error, errorDescription } = e;\n throw new OAuthError(error, errorDescription);\n }\n }\n throw err;\n });\n}\n\nexport { getUserInfo };\n//# sourceMappingURL=getUserInfo.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\n\nfunction addListener(eventTarget, name, fn) {\n if (eventTarget.addEventListener) {\n eventTarget.addEventListener(name, fn);\n }\n else {\n eventTarget.attachEvent('on' + name, fn);\n }\n}\nfunction removeListener(eventTarget, name, fn) {\n if (eventTarget.removeEventListener) {\n eventTarget.removeEventListener(name, fn);\n }\n else {\n eventTarget.detachEvent('on' + name, fn);\n }\n}\nfunction loadFrame(src) {\n var iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n iframe.src = src;\n return document.body.appendChild(iframe);\n}\nfunction loadPopup(src, options) {\n var title = options.popupTitle || 'External Identity Provider User Authentication';\n var appearance = 'toolbar=no, scrollbars=yes, resizable=yes, ' +\n 'top=100, left=500, width=600, height=600';\n return window.open(src, title, appearance);\n}\nfunction addPostMessageListener(sdk, timeout, state) {\n var responseHandler;\n var timeoutId;\n var msgReceivedOrTimeout = new Promise(function (resolve, reject) {\n responseHandler = function responseHandler(e) {\n if (!e.data || e.data.state !== state) {\n return;\n }\n if (e.origin !== sdk.getIssuerOrigin()) {\n return reject(new AuthSdkError('The request does not match client configuration'));\n }\n resolve(e.data);\n };\n addListener(window, 'message', responseHandler);\n timeoutId = setTimeout(function () {\n reject(new AuthSdkError('OAuth flow timed out'));\n }, timeout || 120000);\n });\n return msgReceivedOrTimeout\n .finally(function () {\n clearTimeout(timeoutId);\n removeListener(window, 'message', responseHandler);\n });\n}\n\nexport { addListener, addPostMessageListener, loadFrame, loadPopup, removeListener };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getWellKnown } from '../endpoints/well-known.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { getDefaultTokenParams } from './defaultTokenParams.js';\nimport { DEFAULT_CODE_CHALLENGE_METHOD } from '../../constants.js';\nimport PKCE from './pkce.js';\n\nfunction assertPKCESupport(sdk) {\n if (!sdk.features.isPKCESupported()) {\n var errorMessage = 'PKCE requires a modern browser with encryption support running in a secure context.';\n if (!sdk.features.isHTTPS()) {\n errorMessage += '\\nThe current page is not being served with HTTPS protocol. PKCE requires secure HTTPS protocol.';\n }\n if (!sdk.features.hasTextEncoder()) {\n errorMessage += '\\n\"TextEncoder\" is not defined. To use PKCE, you may need to include a polyfill/shim for this browser.';\n }\n throw new AuthSdkError(errorMessage);\n }\n}\nasync function validateCodeChallengeMethod(sdk, codeChallengeMethod) {\n codeChallengeMethod = codeChallengeMethod || sdk.options.codeChallengeMethod || DEFAULT_CODE_CHALLENGE_METHOD;\n const wellKnownResponse = await getWellKnown(sdk);\n var methods = wellKnownResponse['code_challenge_methods_supported'] || [];\n if (methods.indexOf(codeChallengeMethod) === -1) {\n throw new AuthSdkError('Invalid code_challenge_method');\n }\n return codeChallengeMethod;\n}\nasync function preparePKCE(sdk, tokenParams) {\n let { codeVerifier, codeChallenge, codeChallengeMethod } = tokenParams;\n codeChallenge = codeChallenge || sdk.options.codeChallenge;\n if (!codeChallenge) {\n assertPKCESupport(sdk);\n codeVerifier = codeVerifier || PKCE.generateVerifier();\n codeChallenge = await PKCE.computeChallenge(codeVerifier);\n }\n codeChallengeMethod = await validateCodeChallengeMethod(sdk, codeChallengeMethod);\n tokenParams = Object.assign(Object.assign({}, tokenParams), { responseType: 'code',\n codeVerifier,\n codeChallenge,\n codeChallengeMethod });\n return tokenParams;\n}\nasync function prepareTokenParams(sdk, tokenParams = {}) {\n const defaults = getDefaultTokenParams(sdk);\n tokenParams = Object.assign(Object.assign({}, defaults), tokenParams);\n if (tokenParams.dpop && !sdk.features.isDPoPSupported()) {\n throw new AuthSdkError('DPoP has been configured, but is not supported by browser');\n }\n if (tokenParams.pkce === false) {\n return tokenParams;\n }\n return preparePKCE(sdk, tokenParams);\n}\n\nexport { assertPKCESupport, preparePKCE, prepareTokenParams, validateCodeChallengeMethod };\n//# sourceMappingURL=prepareTokenParams.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { removeNils } from '../../util/object.js';\nimport { isString } from '../../util/types.js';\nimport { toQueryString } from '../../util/url.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\n\nfunction convertTokenParamsToOAuthParams(tokenParams) {\n if (!tokenParams.clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to get a token');\n }\n if (isString(tokenParams.responseType) && tokenParams.responseType.indexOf(' ') !== -1) {\n throw new AuthSdkError('Multiple OAuth responseTypes must be defined as an array');\n }\n var oauthParams = {\n 'client_id': tokenParams.clientId,\n 'code_challenge': tokenParams.codeChallenge,\n 'code_challenge_method': tokenParams.codeChallengeMethod,\n 'display': tokenParams.display,\n 'idp': tokenParams.idp,\n 'idp_scope': tokenParams.idpScope,\n 'login_hint': tokenParams.loginHint,\n 'max_age': tokenParams.maxAge,\n 'nonce': tokenParams.nonce,\n 'prompt': tokenParams.prompt,\n 'redirect_uri': tokenParams.redirectUri,\n 'response_mode': tokenParams.responseMode,\n 'response_type': tokenParams.responseType,\n 'sessionToken': tokenParams.sessionToken,\n 'state': tokenParams.state,\n 'acr_values': tokenParams.acrValues,\n 'enroll_amr_values': tokenParams.enrollAmrValues,\n };\n oauthParams = removeNils(oauthParams);\n ['idp_scope', 'response_type', 'enroll_amr_values'].forEach(function (mayBeArray) {\n if (Array.isArray(oauthParams[mayBeArray])) {\n oauthParams[mayBeArray] = oauthParams[mayBeArray].join(' ');\n }\n });\n if (tokenParams.responseType.indexOf('id_token') !== -1 &&\n tokenParams.scopes.indexOf('openid') === -1) {\n throw new AuthSdkError('openid scope must be specified in the scopes argument when requesting an id_token');\n }\n else if (tokenParams.scopes) {\n oauthParams.scope = tokenParams.scopes.join(' ');\n }\n return oauthParams;\n}\nfunction buildAuthorizeParams(tokenParams) {\n var oauthQueryParams = convertTokenParamsToOAuthParams(tokenParams);\n return toQueryString(Object.assign(Object.assign({}, oauthQueryParams), (tokenParams.extraParams && Object.assign({}, tokenParams.extraParams))));\n}\n\nexport { buildAuthorizeParams, convertTokenParamsToOAuthParams };\n//# sourceMappingURL=authorize.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { addPostMessageListener, loadFrame } from './util/browser.js';\nimport { getOAuthUrls } from './util/oauth.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { prepareTokenParams } from './util/prepareTokenParams.js';\nimport './types/Token.js';\nimport { buildAuthorizeParams } from './endpoints/authorize.js';\nimport { handleOAuthResponse } from './handleOAuthResponse.js';\n\nfunction getToken(sdk, options) {\n if (arguments.length > 2) {\n return Promise.reject(new AuthSdkError('As of version 3.0, \"getToken\" takes only a single set of options'));\n }\n options = options || {};\n const popupWindow = options.popupWindow;\n options.popupWindow = undefined;\n return prepareTokenParams(sdk, options)\n .then(function (tokenParams) {\n var sessionTokenOverrides = {\n prompt: 'none',\n responseMode: 'okta_post_message',\n display: null\n };\n var idpOverrides = {\n display: 'popup'\n };\n if (options.sessionToken) {\n Object.assign(tokenParams, sessionTokenOverrides);\n }\n else if (options.idp) {\n Object.assign(tokenParams, idpOverrides);\n }\n var requestUrl, endpoint, urls;\n urls = getOAuthUrls(sdk, tokenParams);\n endpoint = options.codeVerifier ? urls.tokenUrl : urls.authorizeUrl;\n requestUrl = endpoint + buildAuthorizeParams(tokenParams);\n var flowType;\n if (tokenParams.sessionToken || tokenParams.display === null) {\n flowType = 'IFRAME';\n }\n else if (tokenParams.display === 'popup') {\n flowType = 'POPUP';\n }\n else {\n flowType = 'IMPLICIT';\n }\n switch (flowType) {\n case 'IFRAME':\n var iframePromise = addPostMessageListener(sdk, options.timeout, tokenParams.state);\n var iframeEl = loadFrame(requestUrl);\n return iframePromise\n .then(function (res) {\n return handleOAuthResponse(sdk, tokenParams, res, urls);\n })\n .finally(function () {\n var _a;\n if (document.body.contains(iframeEl)) {\n (_a = iframeEl.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(iframeEl);\n }\n });\n case 'POPUP':\n var oauthPromise;\n if (tokenParams.responseMode === 'okta_post_message') {\n if (!sdk.features.isPopupPostMessageSupported()) {\n throw new AuthSdkError('This browser doesn\\'t have full postMessage support');\n }\n oauthPromise = addPostMessageListener(sdk, options.timeout, tokenParams.state);\n }\n if (popupWindow) {\n popupWindow.location.assign(requestUrl);\n }\n var popupPromise = new Promise(function (resolve, reject) {\n var closePoller = setInterval(function () {\n if (!popupWindow || popupWindow.closed) {\n clearInterval(closePoller);\n reject(new AuthSdkError('Unable to parse OAuth flow response'));\n }\n }, 100);\n oauthPromise\n .then(function (res) {\n clearInterval(closePoller);\n resolve(res);\n })\n .catch(function (err) {\n clearInterval(closePoller);\n reject(err);\n });\n });\n return popupPromise\n .then(function (res) {\n return handleOAuthResponse(sdk, tokenParams, res, urls);\n })\n .finally(function () {\n if (popupWindow && !popupWindow.closed) {\n popupWindow.close();\n }\n });\n default:\n throw new AuthSdkError('The full page redirect flow is not supported');\n }\n });\n}\n\nexport { getToken };\n//# sourceMappingURL=getToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { clone } from '../util/object.js';\nimport { getToken } from './getToken.js';\n\nfunction getWithoutPrompt(sdk, options) {\n if (arguments.length > 2) {\n return Promise.reject(new AuthSdkError('As of version 3.0, \"getWithoutPrompt\" takes only a single set of options'));\n }\n options = clone(options) || {};\n Object.assign(options, {\n prompt: 'none',\n responseMode: 'okta_post_message',\n display: null\n });\n return getToken(sdk, options);\n}\n\nexport { getWithoutPrompt };\n//# sourceMappingURL=getWithoutPrompt.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { clone } from '../util/object.js';\nimport { getToken } from './getToken.js';\nimport { loadPopup } from './util/browser.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport './types/Token.js';\n\nfunction getWithPopup(sdk, options) {\n if (arguments.length > 2) {\n return Promise.reject(new AuthSdkError('As of version 3.0, \"getWithPopup\" takes only a single set of options'));\n }\n const popupWindow = loadPopup('/', options);\n options = clone(options) || {};\n Object.assign(options, {\n display: 'popup',\n responseMode: 'okta_post_message',\n popupWindow\n });\n return getToken(sdk, options);\n}\n\nexport { getWithPopup };\n//# sourceMappingURL=getWithPopup.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { clone } from '../util/object.js';\nimport { createOAuthMeta } from './util/oauthMeta.js';\nimport { prepareTokenParams } from './util/prepareTokenParams.js';\nimport './types/Token.js';\nimport { buildAuthorizeParams } from './endpoints/authorize.js';\n\nasync function getWithRedirect(sdk, options) {\n if (arguments.length > 2) {\n return Promise.reject(new AuthSdkError('As of version 3.0, \"getWithRedirect\" takes only a single set of options'));\n }\n options = clone(options) || {};\n const tokenParams = await prepareTokenParams(sdk, options);\n const meta = createOAuthMeta(sdk, tokenParams);\n const requestUrl = meta.urls.authorizeUrl + buildAuthorizeParams(tokenParams);\n sdk.transactionManager.save(meta);\n if (sdk.options.setLocation) {\n sdk.options.setLocation(requestUrl);\n }\n else {\n window.location.assign(requestUrl);\n }\n}\n\nexport { getWithRedirect };\n//# sourceMappingURL=getWithRedirect.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { isString } from '../util/types.js';\nimport { isInteractionRequiredError } from './util/errors.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { urlParamsToObject } from './util/urlParams.js';\nimport './types/Token.js';\nimport { handleOAuthResponse } from './handleOAuthResponse.js';\n\nfunction removeHash(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.search);\n }\n else {\n nativeLoc.hash = '';\n }\n}\nfunction removeSearch(sdk) {\n var nativeHistory = sdk.token.parseFromUrl._getHistory();\n var nativeDoc = sdk.token.parseFromUrl._getDocument();\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n if (nativeHistory && nativeHistory.replaceState) {\n nativeHistory.replaceState(null, nativeDoc.title, nativeLoc.pathname + nativeLoc.hash);\n }\n else {\n nativeLoc.search = '';\n }\n}\nfunction getResponseMode(sdk) {\n var defaultResponseMode = sdk.options.pkce ? 'query' : 'fragment';\n var responseMode = sdk.options.responseMode || defaultResponseMode;\n return responseMode;\n}\nfunction parseOAuthResponseFromUrl(sdk, options) {\n options = options || {};\n if (isString(options)) {\n options = { url: options };\n }\n else {\n options = options;\n }\n var url = options.url;\n var responseMode = options.responseMode || getResponseMode(sdk);\n var nativeLoc = sdk.token.parseFromUrl._getLocation();\n var paramStr;\n if (responseMode === 'query') {\n paramStr = url ? url.substring(url.indexOf('?')) : nativeLoc.search;\n }\n else {\n paramStr = url ? url.substring(url.indexOf('#')) : nativeLoc.hash;\n }\n if (!paramStr) {\n throw new AuthSdkError('Unable to parse a token from the url');\n }\n return urlParamsToObject(paramStr);\n}\nfunction cleanOAuthResponseFromUrl(sdk, options) {\n const responseMode = options.responseMode || getResponseMode(sdk);\n responseMode === 'query' ? removeSearch(sdk) : removeHash(sdk);\n}\nasync function parseFromUrl(sdk, options) {\n options = options || {};\n if (isString(options)) {\n options = { url: options };\n }\n else {\n options = options;\n }\n const res = parseOAuthResponseFromUrl(sdk, options);\n const state = res.state;\n const oauthParams = sdk.transactionManager.load({\n state\n });\n if (!oauthParams) {\n if (sdk.options.pkce) {\n throw new AuthSdkError('Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already completed or multiple auth flows are executing concurrently.', undefined);\n }\n throw new AuthSdkError('Unable to retrieve OAuth redirect params from storage');\n }\n const urls = oauthParams.urls;\n delete oauthParams.urls;\n if (!options.url) {\n cleanOAuthResponseFromUrl(sdk, options);\n }\n return handleOAuthResponse(sdk, oauthParams, res, urls)\n .catch(err => {\n if (!isInteractionRequiredError(err)) {\n sdk.transactionManager.clear({\n state\n });\n }\n throw err;\n })\n .then(res => {\n sdk.transactionManager.clear({\n state\n });\n return res;\n });\n}\n\nexport { cleanOAuthResponseFromUrl, getResponseMode, parseFromUrl, parseOAuthResponseFromUrl };\n//# sourceMappingURL=parseFromUrl.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isAuthApiError } from '../../errors/index.js';\n\nfunction isSameRefreshToken(a, b) {\n return (a.refreshToken === b.refreshToken);\n}\nfunction isRefreshTokenError(err) {\n if (!isAuthApiError(err)) {\n return false;\n }\n if (!err.xhr || !err.xhr.responseJSON) {\n return false;\n }\n const { responseJSON } = err.xhr;\n if (responseJSON.error === 'invalid_grant') {\n return true;\n }\n return false;\n}\n\nexport { isRefreshTokenError, isSameRefreshToken };\n//# sourceMappingURL=refreshToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getOAuthUrls } from './util/oauth.js';\nimport { isSameRefreshToken } from './util/refreshToken.js';\nimport { handleOAuthResponse } from './handleOAuthResponse.js';\nimport { postRefreshToken } from './endpoints/token.js';\nimport { findKeyPair } from './dpop.js';\nimport { isRefreshTokenInvalidError } from './util/errors.js';\n\nasync function renewTokensWithRefresh(sdk, tokenParams, refreshTokenObject) {\n const { clientId, dpop } = sdk.options;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to renew tokens');\n }\n try {\n const renewTokenParams = Object.assign({}, tokenParams, { clientId });\n if (refreshTokenObject.extraParams) {\n renewTokenParams.extraParams = refreshTokenObject.extraParams;\n }\n const endpointParams = Object.assign({}, renewTokenParams);\n if (dpop) {\n const keyPair = await findKeyPair(refreshTokenObject === null || refreshTokenObject === void 0 ? void 0 : refreshTokenObject.dpopPairId);\n endpointParams.dpopKeyPair = keyPair;\n renewTokenParams.dpop = dpop;\n renewTokenParams.dpopPairId = refreshTokenObject.dpopPairId;\n }\n const tokenResponse = await postRefreshToken(sdk, endpointParams, refreshTokenObject);\n const urls = getOAuthUrls(sdk, tokenParams);\n const { tokens } = await handleOAuthResponse(sdk, renewTokenParams, tokenResponse, urls);\n const { refreshToken } = tokens;\n if (refreshToken && !isSameRefreshToken(refreshToken, refreshTokenObject)) {\n sdk.tokenManager.updateRefreshToken(refreshToken);\n }\n return tokens;\n }\n catch (err) {\n if (isRefreshTokenInvalidError(err)) {\n sdk.tokenManager.removeRefreshToken();\n }\n throw err;\n }\n}\n\nexport { renewTokensWithRefresh };\n//# sourceMappingURL=renewTokensWithRefresh.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { isIDToken, isAccessToken } from './types/Token.js';\nimport { getWithoutPrompt } from './getWithoutPrompt.js';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh.js';\n\nfunction throwInvalidTokenError() {\n throw new AuthSdkError('Renew must be passed a token with an array of scopes and an accessToken or idToken');\n}\nfunction getSingleToken(originalToken, tokens) {\n if (isIDToken(originalToken)) {\n return tokens.idToken;\n }\n if (isAccessToken(originalToken)) {\n return tokens.accessToken;\n }\n throwInvalidTokenError();\n}\nasync function renewToken(sdk, token) {\n if (!isIDToken(token) && !isAccessToken(token)) {\n throwInvalidTokenError();\n }\n let tokens = sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n tokens = await renewTokensWithRefresh(sdk, {\n scopes: token.scopes,\n }, tokens.refreshToken);\n return getSingleToken(token, tokens);\n }\n var responseType;\n if (sdk.options.pkce) {\n responseType = 'code';\n }\n else if (isAccessToken(token)) {\n responseType = 'token';\n }\n else {\n responseType = 'id_token';\n }\n const { scopes, authorizeUrl, userinfoUrl, issuer, dpopPairId, extraParams } = token;\n return getWithoutPrompt(sdk, {\n responseType,\n scopes,\n authorizeUrl,\n userinfoUrl,\n issuer,\n dpopPairId,\n extraParams\n })\n .then(function (res) {\n return getSingleToken(token, res.tokens);\n });\n}\n\nexport { renewToken };\n//# sourceMappingURL=renewToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getWithoutPrompt } from './getWithoutPrompt.js';\nimport { renewTokensWithRefresh } from './renewTokensWithRefresh.js';\nimport { getDefaultTokenParams } from './util/defaultTokenParams.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport './types/Token.js';\n\nasync function renewTokens(sdk, options) {\n var _a;\n const tokens = (_a = options === null || options === void 0 ? void 0 : options.tokens) !== null && _a !== void 0 ? _a : sdk.tokenManager.getTokensSync();\n if (tokens.refreshToken) {\n return renewTokensWithRefresh(sdk, options || {}, tokens.refreshToken);\n }\n if (!tokens.accessToken && !tokens.idToken) {\n throw new AuthSdkError('renewTokens() was called but there is no existing token');\n }\n const accessToken = tokens.accessToken || {};\n const idToken = tokens.idToken || {};\n const scopes = accessToken.scopes || idToken.scopes;\n if (!scopes) {\n throw new AuthSdkError('renewTokens: invalid tokens: could not read scopes');\n }\n const authorizeUrl = accessToken.authorizeUrl || idToken.authorizeUrl;\n if (!authorizeUrl) {\n throw new AuthSdkError('renewTokens: invalid tokens: could not read authorizeUrl');\n }\n const userinfoUrl = accessToken.userinfoUrl || sdk.options.userinfoUrl;\n const issuer = idToken.issuer || sdk.options.issuer;\n const dpopPairId = accessToken === null || accessToken === void 0 ? void 0 : accessToken.dpopPairId;\n const extraParams = (accessToken === null || accessToken === void 0 ? void 0 : accessToken.extraParams) || (idToken === null || idToken === void 0 ? void 0 : idToken.extraParams);\n options = Object.assign({\n scopes,\n authorizeUrl,\n userinfoUrl,\n issuer,\n dpopPairId,\n extraParams\n }, options);\n if (sdk.options.pkce) {\n options.responseType = 'code';\n }\n else {\n const { responseType } = getDefaultTokenParams(sdk);\n options.responseType = responseType;\n }\n return getWithoutPrompt(sdk, options)\n .then(res => res.tokens);\n}\n\nexport { renewTokens };\n//# sourceMappingURL=renewTokens.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { btoa as b } from '../crypto/browser.js';\nimport { toQueryString } from '../util/url.js';\nimport { post } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { getOAuthUrls } from './util/oauth.js';\n\nasync function revokeToken(sdk, token) {\n let accessToken = '';\n let refreshToken = '';\n if (token) {\n accessToken = token.accessToken;\n refreshToken = token.refreshToken;\n }\n if (!accessToken && !refreshToken) {\n throw new AuthSdkError('A valid access or refresh token object is required');\n }\n var clientId = sdk.options.clientId;\n var clientSecret = sdk.options.clientSecret;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to revoke a token');\n }\n var revokeUrl = getOAuthUrls(sdk).revokeUrl;\n var args = toQueryString({\n token_type_hint: refreshToken ? 'refresh_token' : 'access_token',\n token: refreshToken || accessToken,\n }).slice(1);\n var creds = clientSecret ? b(`${clientId}:${clientSecret}`) : b(clientId);\n return post(sdk, revokeUrl, args, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Basic ' + creds\n }\n });\n}\n\nexport { revokeToken };\n//# sourceMappingURL=revokeToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getWellKnown } from './endpoints/well-known.js';\nimport { btoa as b } from '../crypto/browser.js';\nimport { toQueryString } from '../util/url.js';\nimport { post } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { TokenKind } from './types/Token.js';\n\nconst hintMap = {\n accessToken: 'access_token',\n idToken: 'id_token',\n refreshToken: 'refresh_token'\n};\nasync function oidcIntrospect(sdk, kind, token) {\n var _a;\n let issuer;\n let clientId = sdk.options.clientId;\n let clientSecret = sdk.options.clientSecret;\n if (!token) {\n token = sdk.tokenManager.getTokens()[kind];\n }\n if (!token) {\n throw new AuthSdkError(`unable to find ${kind} in storage or fn params`);\n }\n if (kind !== TokenKind.ACCESS) {\n issuer = token === null || token === void 0 ? void 0 : token.issuer;\n }\n else {\n issuer = (_a = token === null || token === void 0 ? void 0 : token.claims) === null || _a === void 0 ? void 0 : _a.iss;\n }\n issuer = issuer || sdk.options.issuer;\n if (!clientId) {\n throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to introspect a token');\n }\n if (!issuer) {\n throw new AuthSdkError('Unable to find issuer');\n }\n const { introspection_endpoint: introspectUrl } = await getWellKnown(sdk, issuer);\n const authHeader = clientSecret ? b(`${clientId}:${clientSecret}`) : b(clientId);\n const args = toQueryString({\n token_type_hint: hintMap[kind],\n token: token[kind]\n }).slice(1);\n return post(sdk, introspectUrl, args, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Basic ' + authHeader\n }\n });\n}\n\nexport { oidcIntrospect };\n//# sourceMappingURL=introspect.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { getOAuthUrls } from './oauth.js';\n\nfunction createEnrollAuthenticatorMeta(sdk, params) {\n const issuer = sdk.options.issuer;\n const urls = getOAuthUrls(sdk, params);\n const oauthMeta = {\n issuer,\n urls,\n clientId: params.clientId,\n redirectUri: params.redirectUri,\n responseType: params.responseType,\n responseMode: params.responseMode,\n state: params.state,\n acrValues: params.acrValues,\n enrollAmrValues: params.enrollAmrValues,\n };\n return oauthMeta;\n}\n\nexport { createEnrollAuthenticatorMeta };\n//# sourceMappingURL=enrollAuthenticatorMeta.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { generateState } from './oauth.js';\nimport { isBrowser } from '../../features.js';\nimport { removeNils } from '../../util/object.js';\n\nfunction getDefaultEnrollAuthenticatorParams(sdk) {\n const { clientId, redirectUri, responseMode, state, } = sdk.options;\n const defaultRedirectUri = isBrowser() ? window.location.href : undefined;\n return removeNils({\n clientId,\n redirectUri: redirectUri || defaultRedirectUri,\n responseMode,\n state: state || generateState(),\n responseType: 'none',\n prompt: 'enroll_authenticator',\n });\n}\n\nexport { getDefaultEnrollAuthenticatorParams };\n//# sourceMappingURL=defaultEnrollAuthenticatorParams.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { getDefaultEnrollAuthenticatorParams } from './defaultEnrollAuthenticatorParams.js';\n\nfunction prepareParams(params) {\n params = Object.assign(Object.assign({}, params), {\n responseType: 'none', prompt: 'enroll_authenticator', maxAge: 0 });\n if (!params.enrollAmrValues) {\n throw new AuthSdkError('enroll_amr_values must be specified');\n }\n if (!params.acrValues) {\n throw new AuthSdkError('acr_values must be specified');\n }\n delete params.scopes;\n delete params.nonce;\n return params;\n}\nfunction prepareEnrollAuthenticatorParams(sdk, options) {\n return prepareParams(Object.assign(Object.assign({}, getDefaultEnrollAuthenticatorParams(sdk)), options));\n}\n\nexport { prepareEnrollAuthenticatorParams };\n//# sourceMappingURL=prepareEnrollAuthenticatorParams.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { clone } from '../util/object.js';\nimport '../errors/WWWAuthError.js';\nimport { createEnrollAuthenticatorMeta } from './util/enrollAuthenticatorMeta.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { prepareEnrollAuthenticatorParams } from './util/prepareEnrollAuthenticatorParams.js';\nimport './types/Token.js';\nimport { buildAuthorizeParams } from './endpoints/authorize.js';\n\nfunction enrollAuthenticator(sdk, options) {\n options = clone(options) || {};\n const params = prepareEnrollAuthenticatorParams(sdk, options);\n const meta = createEnrollAuthenticatorMeta(sdk, params);\n const requestUrl = meta.urls.authorizeUrl + buildAuthorizeParams(params);\n sdk.transactionManager.save(meta);\n if (sdk.options.setLocation) {\n sdk.options.setLocation(requestUrl);\n }\n else {\n window.location.assign(requestUrl);\n }\n}\n\nexport { enrollAuthenticator };\n//# sourceMappingURL=enrollAuthenticator.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { PromiseQueue } from '../../util/PromiseQueue.js';\nimport { decodeToken } from '../decodeToken.js';\nimport { exchangeCodeForTokens } from '../exchangeCodeForTokens.js';\nimport { getUserInfo } from '../getUserInfo.js';\nimport { getWithoutPrompt } from '../getWithoutPrompt.js';\nimport { getWithPopup } from '../getWithPopup.js';\nimport { getWithRedirect } from '../getWithRedirect.js';\nimport { parseFromUrl } from '../parseFromUrl.js';\nimport { renewToken } from '../renewToken.js';\nimport { renewTokens } from '../renewTokens.js';\nimport { renewTokensWithRefresh } from '../renewTokensWithRefresh.js';\nimport { revokeToken } from '../revokeToken.js';\nimport { oidcIntrospect } from '../introspect.js';\nimport '../../errors/WWWAuthError.js';\nimport { isLoginRedirect } from '../util/loginRedirect.js';\nimport { prepareTokenParams } from '../util/prepareTokenParams.js';\nimport '../types/Token.js';\nimport { verifyToken } from '../verifyToken.js';\nimport { enrollAuthenticator } from '../enrollAuthenticator.js';\n\nfunction createTokenAPI(sdk, queue) {\n const useQueue = (method) => {\n return PromiseQueue.prototype.push.bind(queue, method, null);\n };\n const getWithRedirectFn = useQueue(getWithRedirect.bind(null, sdk));\n const parseFromUrlFn = useQueue(parseFromUrl.bind(null, sdk));\n const parseFromUrlApi = Object.assign(parseFromUrlFn, {\n _getHistory: function () {\n return window.history;\n },\n _getLocation: function () {\n return window.location;\n },\n _getDocument: function () {\n return window.document;\n }\n });\n const token = {\n prepareTokenParams: prepareTokenParams.bind(null, sdk),\n exchangeCodeForTokens: exchangeCodeForTokens.bind(null, sdk),\n getWithoutPrompt: getWithoutPrompt.bind(null, sdk),\n getWithPopup: getWithPopup.bind(null, sdk),\n getWithRedirect: getWithRedirectFn,\n parseFromUrl: parseFromUrlApi,\n decode: decodeToken,\n revoke: revokeToken.bind(null, sdk),\n renew: renewToken.bind(null, sdk),\n renewTokensWithRefresh: renewTokensWithRefresh.bind(null, sdk),\n renewTokens: renewTokens.bind(null, sdk),\n getUserInfo: (accessTokenObject, idTokenObject) => {\n return getUserInfo(sdk, accessTokenObject, idTokenObject);\n },\n verify: verifyToken.bind(null, sdk),\n isLoginRedirect: isLoginRedirect.bind(null, sdk),\n introspect: oidcIntrospect.bind(null, sdk),\n };\n const toWrap = [\n 'getWithoutPrompt',\n 'getWithPopup',\n 'revoke',\n 'renew',\n 'renewTokensWithRefresh',\n 'renewTokens'\n ];\n toWrap.forEach(key => {\n token[key] = useQueue(token[key]);\n });\n return token;\n}\nfunction createEndpoints(sdk) {\n return {\n authorize: {\n enrollAuthenticator: enrollAuthenticator.bind(null, sdk),\n }\n };\n}\n\nexport { createEndpoints, createTokenAPI };\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { isIDToken, isAccessToken, isRefreshToken } from '../types/Token.js';\n\nfunction validateToken(token, type) {\n if (!isIDToken(token) && !isAccessToken(token) && !isRefreshToken(token)) {\n throw new AuthSdkError('Token must be an Object with scopes, expiresAt, and one of: an idToken, accessToken, or refreshToken property');\n }\n if (type === 'accessToken' && !isAccessToken(token)) {\n throw new AuthSdkError('invalid accessToken');\n }\n if (type === 'idToken' && !isIDToken(token)) {\n throw new AuthSdkError('invalid idToken');\n }\n if (type === 'refreshToken' && !isRefreshToken(token)) {\n throw new AuthSdkError('invalid refreshToken');\n }\n}\n\nexport { validateToken };\n//# sourceMappingURL=validateToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nclass SdkClock {\n constructor(localOffset) {\n this.localOffset = parseInt(localOffset || 0);\n }\n static create( ) {\n var localOffset = 0;\n return new SdkClock(localOffset);\n }\n now() {\n var now = (Date.now() + this.localOffset) / 1000;\n return now;\n }\n}\n\nexport { SdkClock as default };\n//# sourceMappingURL=clock.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst EVENT_EXPIRED = 'expired';\nconst EVENT_RENEWED = 'renewed';\nconst EVENT_ADDED = 'added';\nconst EVENT_REMOVED = 'removed';\nconst EVENT_ERROR = 'error';\nconst EVENT_SET_STORAGE = 'set_storage';\n\nexport { EVENT_ADDED, EVENT_ERROR, EVENT_EXPIRED, EVENT_REMOVED, EVENT_RENEWED, EVENT_SET_STORAGE };\n//# sourceMappingURL=TokenManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { removeNils, clone } from '../util/object.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { isLocalhost, isIE11OrLess } from '../features.js';\nimport { REFRESH_TOKEN_STORAGE_KEY, TOKEN_STORAGE_NAME } from '../constants.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { validateToken } from './util/validateToken.js';\nimport SdkClock from '../clock.js';\nimport { isRefreshToken, isAccessToken, isIDToken } from './types/Token.js';\nimport { EVENT_EXPIRED, EVENT_RENEWED, EVENT_ADDED, EVENT_REMOVED, EVENT_ERROR, EVENT_SET_STORAGE } from './types/TokenManager.js';\n\nconst DEFAULT_OPTIONS = {\n autoRenew: true,\n autoRemove: true,\n syncStorage: true,\n clearPendingRemoveTokens: true,\n storage: undefined,\n expireEarlySeconds: 30,\n storageKey: TOKEN_STORAGE_NAME\n};\nfunction defaultState() {\n return {\n expireTimeouts: {},\n renewPromise: null\n };\n}\nclass TokenManager {\n constructor(sdk, options = {}) {\n this.sdk = sdk;\n this.emitter = sdk.emitter;\n if (!this.emitter) {\n throw new AuthSdkError('Emitter should be initialized before TokenManager');\n }\n options = Object.assign({}, DEFAULT_OPTIONS, removeNils(options));\n if (!isLocalhost()) {\n options.expireEarlySeconds = DEFAULT_OPTIONS.expireEarlySeconds;\n }\n this.options = options;\n const storageOptions = removeNils({\n storageKey: options.storageKey,\n secure: options.secure,\n });\n if (typeof options.storage === 'object') {\n storageOptions.storageProvider = options.storage;\n }\n else if (options.storage) {\n storageOptions.storageType = options.storage;\n }\n this.storage = sdk.storageManager.getTokenStorage(Object.assign(Object.assign({}, storageOptions), { useSeparateCookies: true }));\n this.clock = SdkClock.create( );\n this.state = defaultState();\n }\n on(event, handler, context) {\n if (context) {\n this.emitter.on(event, handler, context);\n }\n else {\n this.emitter.on(event, handler);\n }\n }\n off(event, handler) {\n if (handler) {\n this.emitter.off(event, handler);\n }\n else {\n this.emitter.off(event);\n }\n }\n start() {\n if (this.options.clearPendingRemoveTokens) {\n this.clearPendingRemoveTokens();\n }\n this.setExpireEventTimeoutAll();\n this.state.started = true;\n }\n stop() {\n this.clearExpireEventTimeoutAll();\n this.state.started = false;\n }\n isStarted() {\n return !!this.state.started;\n }\n getOptions() {\n return clone(this.options);\n }\n getExpireTime(token) {\n const expireEarlySeconds = this.options.expireEarlySeconds || 0;\n var expireTime = token.expiresAt - expireEarlySeconds;\n return expireTime;\n }\n hasExpired(token) {\n var expireTime = this.getExpireTime(token);\n return expireTime <= this.clock.now();\n }\n emitExpired(key, token) {\n this.emitter.emit(EVENT_EXPIRED, key, token);\n }\n emitRenewed(key, freshToken, oldToken) {\n this.emitter.emit(EVENT_RENEWED, key, freshToken, oldToken);\n }\n emitAdded(key, token) {\n this.emitter.emit(EVENT_ADDED, key, token);\n }\n emitRemoved(key, token) {\n this.emitter.emit(EVENT_REMOVED, key, token);\n }\n emitError(error) {\n this.emitter.emit(EVENT_ERROR, error);\n }\n clearExpireEventTimeout(key) {\n clearTimeout(this.state.expireTimeouts[key]);\n delete this.state.expireTimeouts[key];\n this.state.renewPromise = null;\n }\n clearExpireEventTimeoutAll() {\n var expireTimeouts = this.state.expireTimeouts;\n for (var key in expireTimeouts) {\n if (!Object.prototype.hasOwnProperty.call(expireTimeouts, key)) {\n continue;\n }\n this.clearExpireEventTimeout(key);\n }\n }\n setExpireEventTimeout(key, token) {\n if (isRefreshToken(token)) {\n return;\n }\n var expireTime = this.getExpireTime(token);\n var expireEventWait = Math.max(expireTime - this.clock.now(), 0) * 1000;\n this.clearExpireEventTimeout(key);\n var expireEventTimeout = setTimeout(() => {\n this.emitExpired(key, token);\n }, expireEventWait);\n this.state.expireTimeouts[key] = expireEventTimeout;\n }\n setExpireEventTimeoutAll() {\n var tokenStorage = this.storage.getStorage();\n for (var key in tokenStorage) {\n if (!Object.prototype.hasOwnProperty.call(tokenStorage, key)) {\n continue;\n }\n var token = tokenStorage[key];\n this.setExpireEventTimeout(key, token);\n }\n }\n resetExpireEventTimeoutAll() {\n this.clearExpireEventTimeoutAll();\n this.setExpireEventTimeoutAll();\n }\n add(key, token) {\n var tokenStorage = this.storage.getStorage();\n validateToken(token);\n tokenStorage[key] = token;\n this.storage.setStorage(tokenStorage);\n this.emitSetStorageEvent();\n this.emitAdded(key, token);\n this.setExpireEventTimeout(key, token);\n }\n getSync(key) {\n var tokenStorage = this.storage.getStorage();\n return tokenStorage[key];\n }\n async get(key) {\n return this.getSync(key);\n }\n getTokensSync() {\n const tokens = {};\n const tokenStorage = this.storage.getStorage();\n Object.keys(tokenStorage).forEach(key => {\n const token = tokenStorage[key];\n if (isAccessToken(token)) {\n tokens.accessToken = token;\n }\n else if (isIDToken(token)) {\n tokens.idToken = token;\n }\n else if (isRefreshToken(token)) {\n tokens.refreshToken = token;\n }\n });\n return tokens;\n }\n async getTokens() {\n return this.getTokensSync();\n }\n getStorageKeyByType(type) {\n const tokenStorage = this.storage.getStorage();\n const key = Object.keys(tokenStorage).filter(key => {\n const token = tokenStorage[key];\n return (isAccessToken(token) && type === 'accessToken')\n || (isIDToken(token) && type === 'idToken')\n || (isRefreshToken(token) && type === 'refreshToken');\n })[0];\n return key;\n }\n getTokenType(token) {\n if (isAccessToken(token)) {\n return 'accessToken';\n }\n if (isIDToken(token)) {\n return 'idToken';\n }\n if (isRefreshToken(token)) {\n return 'refreshToken';\n }\n throw new AuthSdkError('Unknown token type');\n }\n emitSetStorageEvent() {\n if (isIE11OrLess()) {\n const storage = this.storage.getStorage();\n this.emitter.emit(EVENT_SET_STORAGE, storage);\n }\n }\n getStorage() {\n return this.storage;\n }\n setTokens(tokens,\n accessTokenCb, idTokenCb, refreshTokenCb) {\n const handleTokenCallback = (key, token) => {\n const type = this.getTokenType(token);\n if (type === 'accessToken') {\n accessTokenCb && accessTokenCb(key, token);\n }\n else if (type === 'idToken') {\n idTokenCb && idTokenCb(key, token);\n }\n else if (type === 'refreshToken') {\n refreshTokenCb && refreshTokenCb(key, token);\n }\n };\n const handleAdded = (key, token) => {\n this.emitAdded(key, token);\n this.setExpireEventTimeout(key, token);\n handleTokenCallback(key, token);\n };\n const handleRenewed = (key, token, oldToken) => {\n this.emitRenewed(key, token, oldToken);\n this.clearExpireEventTimeout(key);\n this.setExpireEventTimeout(key, token);\n handleTokenCallback(key, token);\n };\n const handleRemoved = (key, token) => {\n this.clearExpireEventTimeout(key);\n this.emitRemoved(key, token);\n handleTokenCallback(key, token);\n };\n const types = ['idToken', 'accessToken', 'refreshToken'];\n const existingTokens = this.getTokensSync();\n types.forEach((type) => {\n const token = tokens[type];\n if (token) {\n validateToken(token, type);\n }\n });\n const storage = types.reduce((storage, type) => {\n const token = tokens[type];\n if (token) {\n const storageKey = this.getStorageKeyByType(type) || type;\n storage[storageKey] = token;\n }\n return storage;\n }, {});\n this.storage.setStorage(storage);\n this.emitSetStorageEvent();\n types.forEach(type => {\n const newToken = tokens[type];\n const existingToken = existingTokens[type];\n const storageKey = this.getStorageKeyByType(type) || type;\n if (newToken && existingToken) {\n handleRemoved(storageKey, existingToken);\n handleAdded(storageKey, newToken);\n handleRenewed(storageKey, newToken, existingToken);\n }\n else if (newToken) {\n handleAdded(storageKey, newToken);\n }\n else if (existingToken) {\n handleRemoved(storageKey, existingToken);\n }\n });\n }\n remove(key) {\n this.clearExpireEventTimeout(key);\n var tokenStorage = this.storage.getStorage();\n var removedToken = tokenStorage[key];\n delete tokenStorage[key];\n this.storage.setStorage(tokenStorage);\n this.emitSetStorageEvent();\n this.emitRemoved(key, removedToken);\n }\n async renewToken(token) {\n var _a;\n return (_a = this.sdk.token) === null || _a === void 0 ? void 0 : _a.renew(token);\n }\n validateToken(token) {\n return validateToken(token);\n }\n renew(key) {\n if (this.state.renewPromise) {\n return this.state.renewPromise;\n }\n try {\n var token = this.getSync(key);\n let shouldRenew = token !== undefined;\n if (!token && key === 'accessToken') {\n const refreshKey = this.getStorageKeyByType('refreshToken');\n const refreshToken = this.getSync(refreshKey);\n shouldRenew = refreshToken !== undefined;\n }\n if (!shouldRenew) {\n throw new AuthSdkError('The tokenManager has no token for the key: ' + key);\n }\n }\n catch (err) {\n this.emitError(err);\n return Promise.reject(err);\n }\n this.clearExpireEventTimeout(key);\n const renewPromise = this.state.renewPromise = this.sdk.token.renewTokens()\n .then(tokens => {\n this.setTokens(tokens);\n if (!token && key === 'accessToken') {\n const accessToken = tokens['accessToken'];\n this.emitRenewed(key, accessToken, null);\n return accessToken;\n }\n const tokenType = this.getTokenType(token);\n return tokens[tokenType];\n })\n .catch(err => {\n this.remove(key);\n err.tokenKey = key;\n this.emitError(err);\n throw err;\n })\n .finally(() => {\n this.state.renewPromise = null;\n });\n return renewPromise;\n }\n clear() {\n const tokens = this.getTokensSync();\n this.clearExpireEventTimeoutAll();\n this.storage.clearStorage();\n this.emitSetStorageEvent();\n Object.keys(tokens).forEach(key => {\n this.emitRemoved(key, tokens[key]);\n });\n }\n clearPendingRemoveTokens() {\n const tokenStorage = this.storage.getStorage();\n const removedTokens = {};\n Object.keys(tokenStorage).forEach(key => {\n if (tokenStorage[key].pendingRemove) {\n removedTokens[key] = tokenStorage[key];\n delete tokenStorage[key];\n }\n });\n this.storage.setStorage(tokenStorage);\n this.emitSetStorageEvent();\n Object.keys(removedTokens).forEach(key => {\n this.clearExpireEventTimeout(key);\n this.emitRemoved(key, removedTokens[key]);\n });\n }\n updateRefreshToken(token) {\n const key = this.getStorageKeyByType('refreshToken') || REFRESH_TOKEN_STORAGE_KEY;\n var tokenStorage = this.storage.getStorage();\n validateToken(token);\n tokenStorage[key] = token;\n this.storage.setStorage(tokenStorage);\n this.emitSetStorageEvent();\n }\n removeRefreshToken() {\n const key = this.getStorageKeyByType('refreshToken') || REFRESH_TOKEN_STORAGE_KEY;\n this.remove(key);\n }\n addPendingRemoveFlags() {\n const tokens = this.getTokensSync();\n Object.keys(tokens).forEach(key => {\n tokens[key].pendingRemove = true;\n });\n this.setTokens(tokens);\n }\n}\n\nexport { TokenManager };\n//# sourceMappingURL=TokenManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport Cookies from 'js-cookie';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport { warn } from '../util/console.js';\nimport { isIE11OrLess } from '../features.js';\n\nvar storageUtil = {\n browserHasLocalStorage: function () {\n try {\n var storage = this.getLocalStorage();\n return this.testStorage(storage);\n }\n catch (e) {\n return false;\n }\n },\n browserHasSessionStorage: function () {\n try {\n var storage = this.getSessionStorage();\n return this.testStorage(storage);\n }\n catch (e) {\n return false;\n }\n },\n testStorageType: function (storageType) {\n var supported = false;\n switch (storageType) {\n case 'sessionStorage':\n supported = this.browserHasSessionStorage();\n break;\n case 'localStorage':\n supported = this.browserHasLocalStorage();\n break;\n case 'cookie':\n case 'memory':\n supported = true;\n break;\n default:\n supported = false;\n break;\n }\n return supported;\n },\n getStorageByType: function (storageType, options) {\n let storageProvider;\n switch (storageType) {\n case 'sessionStorage':\n storageProvider = this.getSessionStorage();\n break;\n case 'localStorage':\n storageProvider = this.getLocalStorage();\n break;\n case 'cookie':\n storageProvider = this.getCookieStorage(options);\n break;\n case 'memory':\n storageProvider = this.getInMemoryStorage();\n break;\n default:\n throw new AuthSdkError(`Unrecognized storage option: ${storageType}`);\n }\n return storageProvider;\n },\n findStorageType: function (types) {\n let curType;\n let nextType;\n types = types.slice();\n curType = types.shift();\n nextType = types.length ? types[0] : null;\n if (!nextType) {\n return curType;\n }\n if (this.testStorageType(curType)) {\n return curType;\n }\n warn(`This browser doesn't support ${curType}. Switching to ${nextType}.`);\n return this.findStorageType(types);\n },\n getLocalStorage: function () {\n if (isIE11OrLess() && !window.onstorage) {\n window.onstorage = function () { };\n }\n return localStorage;\n },\n getSessionStorage: function () {\n return sessionStorage;\n },\n getCookieStorage: function (options) {\n const secure = options.secure;\n const sameSite = options.sameSite;\n const sessionCookie = options.sessionCookie;\n if (typeof secure === 'undefined' || typeof sameSite === 'undefined') {\n throw new AuthSdkError('getCookieStorage: \"secure\" and \"sameSite\" options must be provided');\n }\n const storage = {\n getItem: this.storage.get,\n setItem: (key, value, expiresAt = '2200-01-01T00:00:00.000Z') => {\n expiresAt = (sessionCookie ? null : expiresAt);\n this.storage.set(key, value, expiresAt, {\n secure: secure,\n sameSite: sameSite,\n });\n },\n removeItem: (key) => {\n this.storage.delete(key);\n },\n };\n if (!options.useSeparateCookies) {\n return storage;\n }\n return {\n getItem: function (key) {\n var data = storage.getItem();\n var value = {};\n Object.keys(data).forEach(k => {\n if (k.indexOf(key) === 0) {\n value[k.replace(`${key}_`, '')] = JSON.parse(data[k]);\n }\n });\n return JSON.stringify(value);\n },\n setItem: function (key, value) {\n var existingValues = JSON.parse(this.getItem(key));\n value = JSON.parse(value);\n Object.keys(value).forEach(k => {\n var storageKey = key + '_' + k;\n var valueToStore = JSON.stringify(value[k]);\n storage.setItem(storageKey, valueToStore);\n delete existingValues[k];\n });\n Object.keys(existingValues).forEach(k => {\n storage.removeItem(key + '_' + k);\n });\n },\n removeItem: function (key) {\n var existingValues = JSON.parse(this.getItem(key));\n Object.keys(existingValues).forEach(k => {\n storage.removeItem(key + '_' + k);\n });\n },\n };\n },\n inMemoryStore: {},\n getInMemoryStorage: function () {\n return {\n getItem: (key) => {\n return this.inMemoryStore[key];\n },\n setItem: (key, value) => {\n this.inMemoryStore[key] = value;\n },\n };\n },\n testStorage: function (storage) {\n var key = 'okta-test-storage';\n try {\n storage.setItem(key, key);\n storage.removeItem(key);\n return true;\n }\n catch (e) {\n return false;\n }\n },\n storage: {\n set: function (name, value, expiresAt, options) {\n const { sameSite, secure } = options;\n if (typeof secure === 'undefined' || typeof sameSite === 'undefined') {\n throw new AuthSdkError('storage.set: \"secure\" and \"sameSite\" options must be provided');\n }\n var cookieOptions = {\n path: options.path || '/',\n secure,\n sameSite\n };\n if (!!(Date.parse(expiresAt))) {\n cookieOptions.expires = new Date(expiresAt);\n }\n Cookies.set(name, value, cookieOptions);\n return this.get(name);\n },\n get: function (name) {\n if (!arguments.length) {\n return Cookies.get();\n }\n return Cookies.get(name);\n },\n delete: function (name) {\n return Cookies.remove(name, { path: '/' });\n }\n }\n};\n\nexport { storageUtil as default };\n//# sourceMappingURL=browserStorage.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { REFERRER_PATH_STORAGE_KEY } from '../../constants.js';\nimport storageUtil from '../../browser/browserStorage.js';\n\nfunction provideOriginalUri(BaseClass) {\n return class WithOriginalUri extends BaseClass {\n setOriginalUri(originalUri, state) {\n const sessionStorage = storageUtil.getSessionStorage();\n sessionStorage.setItem(REFERRER_PATH_STORAGE_KEY, originalUri);\n state = state || this.options.state;\n if (state) {\n const sharedStorage = this.storageManager.getOriginalUriStorage();\n sharedStorage.setItem(state, originalUri);\n }\n }\n getOriginalUri(state) {\n state = state || this.options.state;\n if (state) {\n const sharedStorage = this.storageManager.getOriginalUriStorage();\n const originalUri = sharedStorage.getItem(state);\n if (originalUri) {\n return originalUri;\n }\n }\n const storage = storageUtil.getSessionStorage();\n return storage ? storage.getItem(REFERRER_PATH_STORAGE_KEY) || undefined : undefined;\n }\n removeOriginalUri(state) {\n const storage = storageUtil.getSessionStorage();\n storage.removeItem(REFERRER_PATH_STORAGE_KEY);\n state = state || this.options.state;\n if (state) {\n const sharedStorage = this.storageManager.getOriginalUriStorage();\n sharedStorage.removeItem && sharedStorage.removeItem(state);\n }\n }\n };\n}\n\nexport { provideOriginalUri };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { __rest } from '../../_virtual/_tslib.js';\nimport * as index from '../../crypto/index.js';\nimport { httpRequest } from '../../http/request.js';\nimport { PromiseQueue } from '../../util/PromiseQueue.js';\nimport { isFunction } from '../../util/types.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport 'cross-fetch';\nimport PKCE from '../util/pkce.js';\nimport { createTokenAPI, createEndpoints } from '../factory/api.js';\nimport { TokenManager } from '../TokenManager.js';\nimport WWWAuthError from '../../errors/WWWAuthError.js';\nimport { getOAuthUrls } from '../util/oauth.js';\nimport { isLoginRedirect, hasResponseType } from '../util/loginRedirect.js';\nimport '../types/Token.js';\nimport { clearDPoPKeyPairAfterRevoke, clearDPoPKeyPair, findKeyPair, generateDPoPProof, clearAllDPoPKeyPairs, isDPoPNonceError } from '../dpop.js';\nimport { provideOriginalUri } from './browser.js';\n\nfunction mixinOAuth(Base, TransactionManagerConstructor) {\n var _a;\n const WithOriginalUri = provideOriginalUri(Base);\n return _a = class OktaAuthOAuth extends WithOriginalUri {\n constructor(...args) {\n super(...args);\n this.transactionManager = new TransactionManagerConstructor(Object.assign({\n storageManager: this.storageManager,\n }, this.options.transactionManager));\n this.pkce = {\n DEFAULT_CODE_CHALLENGE_METHOD: PKCE.DEFAULT_CODE_CHALLENGE_METHOD,\n generateVerifier: PKCE.generateVerifier,\n computeChallenge: PKCE.computeChallenge\n };\n this._pending = { handleLogin: false };\n this._tokenQueue = new PromiseQueue();\n this.token = createTokenAPI(this, this._tokenQueue);\n this.tokenManager = new TokenManager(this, this.options.tokenManager);\n this.endpoints = createEndpoints(this);\n }\n clearStorage() {\n super.clearStorage();\n this.tokenManager.clear();\n }\n async isAuthenticated(options = {}) {\n const { autoRenew, autoRemove } = this.tokenManager.getOptions();\n const shouldRenew = options.onExpiredToken ? options.onExpiredToken === 'renew' : autoRenew;\n const shouldRemove = options.onExpiredToken ? options.onExpiredToken === 'remove' : autoRemove;\n let { accessToken } = this.tokenManager.getTokensSync();\n if (accessToken && this.tokenManager.hasExpired(accessToken)) {\n accessToken = undefined;\n if (shouldRenew) {\n try {\n accessToken = await this.tokenManager.renew('accessToken');\n }\n catch (_a) {\n }\n }\n else if (shouldRemove) {\n this.tokenManager.remove('accessToken');\n }\n }\n let { idToken } = this.tokenManager.getTokensSync();\n if (idToken && this.tokenManager.hasExpired(idToken)) {\n idToken = undefined;\n if (shouldRenew) {\n try {\n idToken = await this.tokenManager.renew('idToken');\n }\n catch (_b) {\n }\n }\n else if (shouldRemove) {\n this.tokenManager.remove('idToken');\n }\n }\n return !!(accessToken && idToken);\n }\n async signInWithRedirect(opts = {}) {\n const { originalUri } = opts, additionalParams = __rest(opts, [\"originalUri\"]);\n if (this._pending.handleLogin) {\n return;\n }\n this._pending.handleLogin = true;\n try {\n if (originalUri) {\n this.setOriginalUri(originalUri);\n }\n const params = Object.assign({\n scopes: this.options.scopes || ['openid', 'email', 'profile']\n }, additionalParams);\n await this.token.getWithRedirect(params);\n }\n finally {\n this._pending.handleLogin = false;\n }\n }\n async getUser() {\n const { idToken, accessToken } = this.tokenManager.getTokensSync();\n return this.token.getUserInfo(accessToken, idToken);\n }\n getIdToken() {\n const { idToken } = this.tokenManager.getTokensSync();\n return idToken ? idToken.idToken : undefined;\n }\n getAccessToken() {\n const { accessToken } = this.tokenManager.getTokensSync();\n return accessToken ? accessToken.accessToken : undefined;\n }\n getRefreshToken() {\n const { refreshToken } = this.tokenManager.getTokensSync();\n return refreshToken ? refreshToken.refreshToken : undefined;\n }\n async getOrRenewAccessToken() {\n var _a;\n const { accessToken } = this.tokenManager.getTokensSync();\n if (accessToken && !this.tokenManager.hasExpired(accessToken)) {\n return accessToken.accessToken;\n }\n try {\n const key = this.tokenManager.getStorageKeyByType('accessToken');\n const token = await this.tokenManager.renew(key !== null && key !== void 0 ? key : 'accessToken');\n return (_a = token === null || token === void 0 ? void 0 : token.accessToken) !== null && _a !== void 0 ? _a : null;\n }\n catch (err) {\n this.emitter.emit('error', err);\n return null;\n }\n }\n async storeTokensFromRedirect() {\n const { tokens, responseType } = await this.token.parseFromUrl();\n if (responseType !== 'none') {\n this.tokenManager.setTokens(tokens);\n }\n }\n isLoginRedirect() {\n return isLoginRedirect(this);\n }\n isPKCE() {\n return !!this.options.pkce;\n }\n hasResponseType(responseType) {\n return hasResponseType(responseType, this.options);\n }\n isAuthorizationCodeFlow() {\n return this.hasResponseType('code');\n }\n async invokeApiMethod(options) {\n if (!options.accessToken) {\n const accessToken = (await this.tokenManager.getTokens()).accessToken;\n options.accessToken = accessToken === null || accessToken === void 0 ? void 0 : accessToken.accessToken;\n }\n return httpRequest(this, options);\n }\n async revokeAccessToken(accessToken) {\n if (!accessToken) {\n const tokens = await this.tokenManager.getTokens();\n accessToken = tokens.accessToken;\n const accessTokenKey = this.tokenManager.getStorageKeyByType('accessToken');\n this.tokenManager.remove(accessTokenKey);\n if (this.options.dpop) {\n await clearDPoPKeyPairAfterRevoke('access', tokens);\n }\n }\n if (!accessToken) {\n return Promise.resolve(null);\n }\n return this.token.revoke(accessToken);\n }\n async revokeRefreshToken(refreshToken) {\n if (!refreshToken) {\n const tokens = await this.tokenManager.getTokens();\n refreshToken = tokens.refreshToken;\n const refreshTokenKey = this.tokenManager.getStorageKeyByType('refreshToken');\n this.tokenManager.remove(refreshTokenKey);\n if (this.options.dpop) {\n await clearDPoPKeyPairAfterRevoke('refresh', tokens);\n }\n }\n if (!refreshToken) {\n return Promise.resolve(null);\n }\n return this.token.revoke(refreshToken);\n }\n getSignOutRedirectUrl(options = {}) {\n let { idToken, postLogoutRedirectUri, state, } = options;\n if (!idToken) {\n idToken = this.tokenManager.getTokensSync().idToken;\n }\n if (!idToken) {\n return '';\n }\n if (postLogoutRedirectUri === undefined) {\n postLogoutRedirectUri = this.options.postLogoutRedirectUri;\n }\n const logoutUrl = getOAuthUrls(this).logoutUrl;\n const idTokenHint = idToken.idToken;\n let logoutUri = logoutUrl + '?id_token_hint=' + encodeURIComponent(idTokenHint);\n if (postLogoutRedirectUri) {\n logoutUri += '&post_logout_redirect_uri=' + encodeURIComponent(postLogoutRedirectUri);\n }\n if (state) {\n logoutUri += '&state=' + encodeURIComponent(state);\n }\n return logoutUri;\n }\n async signOut(options) {\n var _a;\n options = Object.assign({}, options);\n const defaultUri = window.location.origin;\n const currentUri = window.location.href;\n const postLogoutRedirectUri = options.postLogoutRedirectUri === null ? null :\n (options.postLogoutRedirectUri\n || this.options.postLogoutRedirectUri\n || defaultUri);\n const state = options === null || options === void 0 ? void 0 : options.state;\n let accessToken = options.accessToken;\n let refreshToken = options.refreshToken;\n const revokeAccessToken = options.revokeAccessToken !== false;\n const revokeRefreshToken = options.revokeRefreshToken !== false;\n if (revokeRefreshToken && typeof refreshToken === 'undefined') {\n refreshToken = this.tokenManager.getTokensSync().refreshToken;\n }\n if (revokeAccessToken && typeof accessToken === 'undefined') {\n accessToken = this.tokenManager.getTokensSync().accessToken;\n }\n if (!options.idToken) {\n options.idToken = this.tokenManager.getTokensSync().idToken;\n }\n if (revokeRefreshToken && refreshToken) {\n await this.revokeRefreshToken(refreshToken);\n }\n if (revokeAccessToken && accessToken) {\n await this.revokeAccessToken(accessToken);\n }\n const dpopPairId = (_a = accessToken === null || accessToken === void 0 ? void 0 : accessToken.dpopPairId) !== null && _a !== void 0 ? _a : refreshToken === null || refreshToken === void 0 ? void 0 : refreshToken.dpopPairId;\n if (this.options.dpop && dpopPairId) {\n await clearDPoPKeyPair(dpopPairId);\n }\n const logoutUri = this.getSignOutRedirectUrl(Object.assign(Object.assign({}, options), { postLogoutRedirectUri }));\n if (!logoutUri) {\n const sessionClosed = await this.closeSession();\n const redirectUri = new URL(postLogoutRedirectUri || defaultUri);\n if (state) {\n redirectUri.searchParams.append('state', state);\n }\n if (postLogoutRedirectUri === currentUri) {\n window.location.href = redirectUri.href;\n }\n else {\n window.location.assign(redirectUri.href);\n }\n return sessionClosed;\n }\n else {\n if (options.clearTokensBeforeRedirect) {\n this.tokenManager.clear();\n }\n else {\n this.tokenManager.addPendingRemoveFlags();\n }\n window.location.assign(logoutUri);\n return true;\n }\n }\n async getDPoPAuthorizationHeaders(params) {\n if (!this.options.dpop) {\n throw new AuthSdkError('DPoP is not configured for this client instance');\n }\n let { accessToken } = params;\n if (!accessToken) {\n accessToken = (this.tokenManager.getTokensSync()).accessToken;\n }\n if (!accessToken) {\n throw new AuthSdkError('AccessToken is required to generate a DPoP Proof');\n }\n const keyPair = await findKeyPair(accessToken === null || accessToken === void 0 ? void 0 : accessToken.dpopPairId);\n const proof = await generateDPoPProof(Object.assign(Object.assign({}, params), { keyPair, accessToken: accessToken.accessToken }));\n return {\n Authorization: `DPoP ${accessToken.accessToken}`,\n Dpop: proof\n };\n }\n async clearDPoPStorage(clearAll = false) {\n var _a, _b;\n if (clearAll) {\n return clearAllDPoPKeyPairs();\n }\n const tokens = await this.tokenManager.getTokens();\n const keyPair = ((_a = tokens.accessToken) === null || _a === void 0 ? void 0 : _a.dpopPairId) || ((_b = tokens.refreshToken) === null || _b === void 0 ? void 0 : _b.dpopPairId);\n if (keyPair) {\n await clearDPoPKeyPair(keyPair);\n }\n }\n parseUseDPoPNonceError(headers) {\n var _a;\n const wwwAuth = WWWAuthError.getWWWAuthenticateHeader(headers);\n const wwwErr = WWWAuthError.parseHeader(wwwAuth !== null && wwwAuth !== void 0 ? wwwAuth : '');\n if (isDPoPNonceError(wwwErr)) {\n let nonce = null;\n if (isFunction(headers === null || headers === void 0 ? void 0 : headers.get)) {\n nonce = headers.get('DPoP-Nonce');\n }\n nonce = (_a = nonce !== null && nonce !== void 0 ? nonce : headers['dpop-nonce']) !== null && _a !== void 0 ? _a : headers['DPoP-Nonce'];\n return nonce;\n }\n return null;\n }\n },\n _a.crypto = index,\n _a;\n}\n\nexport { mixinOAuth };\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nclass CancelError extends Error {\n\tconstructor(reason) {\n\t\tsuper(reason || 'Promise was canceled');\n\t\tthis.name = 'CancelError';\n\t}\n\n\tget isCanceled() {\n\t\treturn true;\n\t}\n}\n\nclass PCancelable {\n\tstatic fn(userFn) {\n\t\treturn (...arguments_) => {\n\t\t\treturn new PCancelable((resolve, reject, onCancel) => {\n\t\t\t\targuments_.push(onCancel);\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\tuserFn(...arguments_).then(resolve, reject);\n\t\t\t});\n\t\t};\n\t}\n\n\tconstructor(executor) {\n\t\tthis._cancelHandlers = [];\n\t\tthis._isPending = true;\n\t\tthis._isCanceled = false;\n\t\tthis._rejectOnCancel = true;\n\n\t\tthis._promise = new Promise((resolve, reject) => {\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = value => {\n\t\t\t\tif (!this._isCanceled || !onCancel.shouldReject) {\n\t\t\t\t\tthis._isPending = false;\n\t\t\t\t\tresolve(value);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onReject = error => {\n\t\t\t\tthis._isPending = false;\n\t\t\t\treject(error);\n\t\t\t};\n\n\t\t\tconst onCancel = handler => {\n\t\t\t\tif (!this._isPending) {\n\t\t\t\t\tthrow new Error('The `onCancel` handler was attached after the promise settled.');\n\t\t\t\t}\n\n\t\t\t\tthis._cancelHandlers.push(handler);\n\t\t\t};\n\n\t\t\tObject.defineProperties(onCancel, {\n\t\t\t\tshouldReject: {\n\t\t\t\t\tget: () => this._rejectOnCancel,\n\t\t\t\t\tset: boolean => {\n\t\t\t\t\t\tthis._rejectOnCancel = boolean;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel);\n\t\t});\n\t}\n\n\tthen(onFulfilled, onRejected) {\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\treturn this._promise.then(onFulfilled, onRejected);\n\t}\n\n\tcatch(onRejected) {\n\t\treturn this._promise.catch(onRejected);\n\t}\n\n\tfinally(onFinally) {\n\t\treturn this._promise.finally(onFinally);\n\t}\n\n\tcancel(reason) {\n\t\tif (!this._isPending || this._isCanceled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._isCanceled = true;\n\n\t\tif (this._cancelHandlers.length > 0) {\n\t\t\ttry {\n\t\t\t\tfor (const handler of this._cancelHandlers) {\n\t\t\t\t\thandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis._reject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (this._rejectOnCancel) {\n\t\t\tthis._reject(new CancelError(reason));\n\t\t}\n\t}\n\n\tget isCanceled() {\n\t\treturn this._isCanceled;\n\t}\n}\n\nObject.setPrototypeOf(PCancelable.prototype, Promise.prototype);\n\nmodule.exports = PCancelable;\nmodule.exports.CancelError = CancelError;\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport PCancelable from 'p-cancelable';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { getConsole } from '../util/console.js';\nimport { PromiseQueue } from '../util/PromiseQueue.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\nimport { EVENT_ADDED, EVENT_REMOVED } from '../oidc/types/TokenManager.js';\n\nconst INITIAL_AUTH_STATE = null;\nconst DEFAULT_PENDING = {\n updateAuthStatePromise: null,\n canceledTimes: 0\n};\nconst EVENT_AUTH_STATE_CHANGE = 'authStateChange';\nconst MAX_PROMISE_CANCEL_TIMES = 10;\nconst isSameAuthState = (prevState, state) => {\n if (!prevState) {\n return false;\n }\n return prevState.isAuthenticated === state.isAuthenticated\n && JSON.stringify(prevState.idToken) === JSON.stringify(state.idToken)\n && JSON.stringify(prevState.accessToken) === JSON.stringify(state.accessToken)\n && prevState.error === state.error;\n};\nclass AuthStateManager {\n constructor(sdk) {\n if (!sdk.emitter) {\n throw new AuthSdkError('Emitter should be initialized before AuthStateManager');\n }\n this._sdk = sdk;\n this._pending = Object.assign({}, DEFAULT_PENDING);\n this._authState = INITIAL_AUTH_STATE;\n this._logOptions = {};\n this._prevAuthState = null;\n this._transformQueue = new PromiseQueue({\n quiet: true\n });\n sdk.tokenManager.on(EVENT_ADDED, (key, token) => {\n this._setLogOptions({ event: EVENT_ADDED, key, token });\n this.updateAuthState();\n });\n sdk.tokenManager.on(EVENT_REMOVED, (key, token) => {\n this._setLogOptions({ event: EVENT_REMOVED, key, token });\n this.updateAuthState();\n });\n }\n _setLogOptions(options) {\n this._logOptions = options;\n }\n getAuthState() {\n return this._authState;\n }\n getPreviousAuthState() {\n return this._prevAuthState;\n }\n async updateAuthState() {\n const { transformAuthState, devMode } = this._sdk.options;\n const log = (status) => {\n const { event, key, token } = this._logOptions;\n getConsole().group(`OKTA-AUTH-JS:updateAuthState: Event:${event} Status:${status}`);\n getConsole().log(key, token);\n getConsole().log('Current authState', this._authState);\n getConsole().groupEnd();\n this._logOptions = {};\n };\n const emitAuthStateChange = (authState) => {\n if (isSameAuthState(this._authState, authState)) {\n devMode && log('unchanged');\n return;\n }\n this._prevAuthState = this._authState;\n this._authState = authState;\n this._sdk.emitter.emit(EVENT_AUTH_STATE_CHANGE, Object.assign({}, authState));\n devMode && log('emitted');\n };\n const finalPromise = (origPromise) => {\n return this._pending.updateAuthStatePromise.then(() => {\n const curPromise = this._pending.updateAuthStatePromise;\n if (curPromise && curPromise !== origPromise) {\n return finalPromise(curPromise);\n }\n return this.getAuthState();\n });\n };\n if (this._pending.updateAuthStatePromise) {\n if (this._pending.canceledTimes >= MAX_PROMISE_CANCEL_TIMES) {\n devMode && log('terminated');\n return finalPromise(this._pending.updateAuthStatePromise);\n }\n else {\n this._pending.updateAuthStatePromise.cancel();\n }\n }\n const cancelablePromise = new PCancelable((resolve, _, onCancel) => {\n onCancel.shouldReject = false;\n onCancel(() => {\n this._pending.updateAuthStatePromise = null;\n this._pending.canceledTimes = this._pending.canceledTimes + 1;\n devMode && log('canceled');\n });\n const emitAndResolve = (authState) => {\n if (cancelablePromise.isCanceled) {\n resolve();\n return;\n }\n emitAuthStateChange(authState);\n resolve();\n this._pending = Object.assign({}, DEFAULT_PENDING);\n };\n this._sdk.isAuthenticated()\n .then(() => {\n if (cancelablePromise.isCanceled) {\n resolve();\n return;\n }\n const { accessToken, idToken, refreshToken } = this._sdk.tokenManager.getTokensSync();\n const authState = {\n accessToken,\n idToken,\n refreshToken,\n isAuthenticated: !!(accessToken && idToken)\n };\n const promise = transformAuthState\n ? this._transformQueue.push(transformAuthState, null, this._sdk, authState)\n : Promise.resolve(authState);\n promise\n .then(authState => emitAndResolve(authState))\n .catch(error => emitAndResolve({\n accessToken,\n idToken,\n refreshToken,\n isAuthenticated: false,\n error\n }));\n });\n });\n this._pending.updateAuthStatePromise = cancelablePromise;\n return finalPromise(cancelablePromise);\n }\n subscribe(handler) {\n this._sdk.emitter.on(EVENT_AUTH_STATE_CHANGE, handler);\n }\n unsubscribe(handler) {\n this._sdk.emitter.off(EVENT_AUTH_STATE_CHANGE, handler);\n }\n}\n\nexport { AuthStateManager, INITIAL_AUTH_STATE };\n//# sourceMappingURL=AuthStateManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { isRefreshToken } from '../oidc/types/Token.js';\nimport { EVENT_EXPIRED } from '../oidc/types/TokenManager.js';\nimport { isBrowser } from '../features.js';\n\nclass AutoRenewService {\n constructor(tokenManager, options = {}) {\n this.started = false;\n this.tokenManager = tokenManager;\n this.options = options;\n this.renewTimeQueue = [];\n this.onTokenExpiredHandler = this.onTokenExpiredHandler.bind(this);\n }\n shouldThrottleRenew() {\n let res = false;\n this.renewTimeQueue.push(Date.now());\n if (this.renewTimeQueue.length >= 10) {\n const firstTime = this.renewTimeQueue.shift();\n const lastTime = this.renewTimeQueue[this.renewTimeQueue.length - 1];\n res = (lastTime - firstTime) < 30 * 1000;\n }\n return res;\n }\n requiresLeadership() {\n return !!this.options.syncStorage && isBrowser();\n }\n processExpiredTokens() {\n const tokenStorage = this.tokenManager.getStorage();\n const tokens = tokenStorage.getStorage();\n Object.keys(tokens).forEach(key => {\n const token = tokens[key];\n if (!isRefreshToken(token) && this.tokenManager.hasExpired(token)) {\n this.onTokenExpiredHandler(key);\n }\n });\n }\n onTokenExpiredHandler(key) {\n if (this.options.autoRenew) {\n if (this.shouldThrottleRenew()) {\n const error = new AuthSdkError('Too many token renew requests');\n this.tokenManager.emitError(error);\n }\n else {\n this.tokenManager.renew(key).catch(() => { });\n }\n }\n else if (this.options.autoRemove) {\n this.tokenManager.remove(key);\n }\n }\n canStart() {\n return (!!this.options.autoRenew || !!this.options.autoRemove) && !this.started;\n }\n async start() {\n if (this.canStart()) {\n this.tokenManager.on(EVENT_EXPIRED, this.onTokenExpiredHandler);\n if (this.tokenManager.isStarted()) {\n this.processExpiredTokens();\n }\n this.started = true;\n }\n }\n async stop() {\n if (this.started) {\n this.tokenManager.off(EVENT_EXPIRED, this.onTokenExpiredHandler);\n this.renewTimeQueue = [];\n this.started = false;\n }\n }\n isStarted() {\n return this.started;\n }\n}\n\nexport { AutoRenewService };\n//# sourceMappingURL=AutoRenewService.js.map\n","/**\n * returns true if the given object is a promise\n */\nexport function isPromise(obj) {\n return obj && typeof obj.then === 'function';\n}\nexport var PROMISE_RESOLVED_FALSE = Promise.resolve(false);\nexport var PROMISE_RESOLVED_TRUE = Promise.resolve(true);\nexport var PROMISE_RESOLVED_VOID = Promise.resolve();\nexport function sleep(time, resolveWith) {\n if (!time) time = 0;\n return new Promise(function (res) {\n return setTimeout(function () {\n return res(resolveWith);\n }, time);\n });\n}\nexport function randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\n/**\n * https://stackoverflow.com/a/8084248\n */\nexport function randomToken() {\n return Math.random().toString(36).substring(2);\n}\nvar lastMs = 0;\nvar additional = 0;\n\n/**\n * returns the current time in micro-seconds,\n * WARNING: This is a pseudo-function\n * Performance.now is not reliable in webworkers, so we just make sure to never return the same time.\n * This is enough in browsers, and this function will not be used in nodejs.\n * The main reason for this hack is to ensure that BroadcastChannel behaves equal to production when it is used in fast-running unit tests.\n */\nexport function microSeconds() {\n var ms = new Date().getTime();\n if (ms === lastMs) {\n additional++;\n return ms * 1000 + additional;\n } else {\n lastMs = ms;\n additional = 0;\n return ms * 1000;\n }\n}\n\n/**\n * Check if WebLock API is supported.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n */\nexport function supportsWebLockAPI() {\n if (typeof navigator !== 'undefined' && typeof navigator.locks !== 'undefined' && typeof navigator.locks.request === 'function') {\n return true;\n } else {\n return false;\n }\n}","import { microSeconds as micro, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'native';\nexport function create(channelName) {\n var state = {\n messagesCallback: null,\n bc: new BroadcastChannel(channelName),\n subFns: [] // subscriberFunctions\n };\n\n state.bc.onmessage = function (msg) {\n if (state.messagesCallback) {\n state.messagesCallback(msg.data);\n }\n };\n return state;\n}\nexport function close(channelState) {\n channelState.bc.close();\n channelState.subFns = [];\n}\nexport function postMessage(channelState, messageJson) {\n try {\n channelState.bc.postMessage(messageJson, false);\n return PROMISE_RESOLVED_VOID;\n } catch (err) {\n return Promise.reject(err);\n }\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {\n if (BroadcastChannel._pubkey) {\n throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');\n }\n return true;\n } else {\n return false;\n }\n}\nexport function averageResponseTime() {\n return 150;\n}\nexport var NativeMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","/**\n * this is a set which automatically forgets\n * a given entry when a new entry is set and the ttl\n * of the old one is over\n */\nvar ObliviousSet = /** @class */ (function () {\n function ObliviousSet(ttl) {\n this.ttl = ttl;\n this.map = new Map();\n /**\n * Creating calls to setTimeout() is expensive,\n * so we only do that if there is not timeout already open.\n */\n this._to = false;\n }\n ObliviousSet.prototype.has = function (value) {\n return this.map.has(value);\n };\n ObliviousSet.prototype.add = function (value) {\n var _this = this;\n this.map.set(value, now());\n /**\n * When a new value is added,\n * start the cleanup at the next tick\n * to not block the cpu for more important stuff\n * that might happen.\n */\n if (!this._to) {\n this._to = true;\n setTimeout(function () {\n _this._to = false;\n removeTooOldValues(_this);\n }, 0);\n }\n };\n ObliviousSet.prototype.clear = function () {\n this.map.clear();\n };\n return ObliviousSet;\n}());\nexport { ObliviousSet };\n/**\n * Removes all entries from the set\n * where the TTL has expired\n */\nexport function removeTooOldValues(obliviousSet) {\n var olderThen = now() - obliviousSet.ttl;\n var iterator = obliviousSet.map[Symbol.iterator]();\n /**\n * Because we can assume the new values are added at the bottom,\n * we start from the top and stop as soon as we reach a non-too-old value.\n */\n while (true) {\n var next = iterator.next().value;\n if (!next) {\n return; // no more elements\n }\n var value = next[0];\n var time = next[1];\n if (time < olderThen) {\n obliviousSet.map.delete(value);\n }\n else {\n // We reached a value that is not old enough\n return;\n }\n }\n}\nexport function now() {\n return new Date().getTime();\n}\n//# sourceMappingURL=index.js.map","export function fillOptionsWithDefaults() {\n var originalOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = JSON.parse(JSON.stringify(originalOptions));\n\n // main\n if (typeof options.webWorkerSupport === 'undefined') options.webWorkerSupport = true;\n\n // indexed-db\n if (!options.idb) options.idb = {};\n // after this time the messages get deleted\n if (!options.idb.ttl) options.idb.ttl = 1000 * 45;\n if (!options.idb.fallbackInterval) options.idb.fallbackInterval = 150;\n // handles abrupt db onclose events.\n if (originalOptions.idb && typeof originalOptions.idb.onclose === 'function') options.idb.onclose = originalOptions.idb.onclose;\n\n // localstorage\n if (!options.localstorage) options.localstorage = {};\n if (!options.localstorage.removeTimeout) options.localstorage.removeTimeout = 1000 * 60;\n\n // custom methods\n if (originalOptions.methods) options.methods = originalOptions.methods;\n\n // node\n if (!options.node) options.node = {};\n if (!options.node.ttl) options.node.ttl = 1000 * 60 * 2; // 2 minutes;\n /**\n * On linux use 'ulimit -Hn' to get the limit of open files.\n * On ubuntu this was 4096 for me, so we use half of that as maxParallelWrites default.\n */\n if (!options.node.maxParallelWrites) options.node.maxParallelWrites = 2048;\n if (typeof options.node.useFastPath === 'undefined') options.node.useFastPath = true;\n return options;\n}","/**\n * this method uses indexeddb to store the messages\n * There is currently no observerAPI for idb\n * @link https://github.com/w3c/IndexedDB/issues/51\n * \n * When working on this, ensure to use these performance optimizations:\n * @link https://rxdb.info/slow-indexeddb.html\n */\n\nimport { sleep, randomInt, randomToken, microSeconds as micro, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nvar DB_PREFIX = 'pubkey.broadcast-channel-0-';\nvar OBJECT_STORE_ID = 'messages';\n\n/**\n * Use relaxed durability for faster performance on all transactions.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\nexport var TRANSACTION_SETTINGS = {\n durability: 'relaxed'\n};\nexport var type = 'idb';\nexport function getIdb() {\n if (typeof indexedDB !== 'undefined') return indexedDB;\n if (typeof window !== 'undefined') {\n if (typeof window.mozIndexedDB !== 'undefined') return window.mozIndexedDB;\n if (typeof window.webkitIndexedDB !== 'undefined') return window.webkitIndexedDB;\n if (typeof window.msIndexedDB !== 'undefined') return window.msIndexedDB;\n }\n return false;\n}\n\n/**\n * If possible, we should explicitly commit IndexedDB transactions\n * for better performance.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\nexport function commitIndexedDBTransaction(tx) {\n if (tx.commit) {\n tx.commit();\n }\n}\nexport function createDatabase(channelName) {\n var IndexedDB = getIdb();\n\n // create table\n var dbName = DB_PREFIX + channelName;\n\n /**\n * All IndexedDB databases are opened without version\n * because it is a bit faster, especially on firefox\n * @link http://nparashuram.com/IndexedDB/perf/#Open%20Database%20with%20version\n */\n var openRequest = IndexedDB.open(dbName);\n openRequest.onupgradeneeded = function (ev) {\n var db = ev.target.result;\n db.createObjectStore(OBJECT_STORE_ID, {\n keyPath: 'id',\n autoIncrement: true\n });\n };\n return new Promise(function (res, rej) {\n openRequest.onerror = function (ev) {\n return rej(ev);\n };\n openRequest.onsuccess = function () {\n res(openRequest.result);\n };\n });\n}\n\n/**\n * writes the new message to the database\n * so other readers can find it\n */\nexport function writeMessage(db, readerUuid, messageJson) {\n var time = new Date().getTime();\n var writeObject = {\n uuid: readerUuid,\n time: time,\n data: messageJson\n };\n var tx = db.transaction([OBJECT_STORE_ID], 'readwrite', TRANSACTION_SETTINGS);\n return new Promise(function (res, rej) {\n tx.oncomplete = function () {\n return res();\n };\n tx.onerror = function (ev) {\n return rej(ev);\n };\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n objectStore.add(writeObject);\n commitIndexedDBTransaction(tx);\n });\n}\nexport function getAllMessages(db) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n ret.push(cursor.value);\n //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n cursor[\"continue\"]();\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function getMessagesHigherThan(db, lastCursorId) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n var keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n\n /**\n * Optimization shortcut,\n * if getAll() can be used, do not use a cursor.\n * @link https://rxdb.info/slow-indexeddb.html\n */\n if (objectStore.getAll) {\n var getAllRequest = objectStore.getAll(keyRangeValue);\n return new Promise(function (res, rej) {\n getAllRequest.onerror = function (err) {\n return rej(err);\n };\n getAllRequest.onsuccess = function (e) {\n res(e.target.result);\n };\n });\n }\n function openCursor() {\n // Occasionally Safari will fail on IDBKeyRange.bound, this\n // catches that error, having it open the cursor to the first\n // item. When it gets data it will advance to the desired key.\n try {\n keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n return objectStore.openCursor(keyRangeValue);\n } catch (e) {\n return objectStore.openCursor();\n }\n }\n return new Promise(function (res, rej) {\n var openCursorRequest = openCursor();\n openCursorRequest.onerror = function (err) {\n return rej(err);\n };\n openCursorRequest.onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n if (cursor.value.id < lastCursorId + 1) {\n cursor[\"continue\"](lastCursorId + 1);\n } else {\n ret.push(cursor.value);\n cursor[\"continue\"]();\n }\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function removeMessagesById(channelState, ids) {\n if (channelState.closed) {\n return Promise.resolve([]);\n }\n var tx = channelState.db.transaction(OBJECT_STORE_ID, 'readwrite', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n return Promise.all(ids.map(function (id) {\n var deleteRequest = objectStore[\"delete\"](id);\n return new Promise(function (res) {\n deleteRequest.onsuccess = function () {\n return res();\n };\n });\n }));\n}\nexport function getOldMessages(db, ttl) {\n var olderThen = new Date().getTime() - ttl;\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n var msgObk = cursor.value;\n if (msgObk.time < olderThen) {\n ret.push(msgObk);\n //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n cursor[\"continue\"]();\n } else {\n // no more old messages,\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n } else {\n res(ret);\n }\n };\n });\n}\nexport function cleanOldMessages(channelState) {\n return getOldMessages(channelState.db, channelState.options.idb.ttl).then(function (tooOld) {\n return removeMessagesById(channelState, tooOld.map(function (msg) {\n return msg.id;\n }));\n });\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n return createDatabase(channelName).then(function (db) {\n var state = {\n closed: false,\n lastCursorId: 0,\n channelName: channelName,\n options: options,\n uuid: randomToken(),\n /**\n * emittedMessagesIds\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n eMIs: new ObliviousSet(options.idb.ttl * 2),\n // ensures we do not read messages in parallel\n writeBlockPromise: PROMISE_RESOLVED_VOID,\n messagesCallback: null,\n readQueuePromises: [],\n db: db\n };\n\n /**\n * Handle abrupt closes that do not originate from db.close().\n * This could happen, for example, if the underlying storage is\n * removed or if the user clears the database in the browser's\n * history preferences.\n */\n db.onclose = function () {\n state.closed = true;\n if (options.idb.onclose) options.idb.onclose();\n };\n\n /**\n * if service-workers are used,\n * we have no 'storage'-event if they post a message,\n * therefore we also have to set an interval\n */\n _readLoop(state);\n return state;\n });\n}\nfunction _readLoop(state) {\n if (state.closed) return;\n readNewMessages(state).then(function () {\n return sleep(state.options.idb.fallbackInterval);\n }).then(function () {\n return _readLoop(state);\n });\n}\nfunction _filterMessage(msgObj, state) {\n if (msgObj.uuid === state.uuid) return false; // send by own\n if (state.eMIs.has(msgObj.id)) return false; // already emitted\n if (msgObj.data.time < state.messagesCallbackTime) return false; // older then onMessageCallback\n return true;\n}\n\n/**\n * reads all new messages from the database and emits them\n */\nfunction readNewMessages(state) {\n // channel already closed\n if (state.closed) return PROMISE_RESOLVED_VOID;\n\n // if no one is listening, we do not need to scan for new messages\n if (!state.messagesCallback) return PROMISE_RESOLVED_VOID;\n return getMessagesHigherThan(state.db, state.lastCursorId).then(function (newerMessages) {\n var useMessages = newerMessages\n /**\n * there is a bug in iOS where the msgObj can be undefined sometimes\n * so we filter them out\n * @link https://github.com/pubkey/broadcast-channel/issues/19\n */.filter(function (msgObj) {\n return !!msgObj;\n }).map(function (msgObj) {\n if (msgObj.id > state.lastCursorId) {\n state.lastCursorId = msgObj.id;\n }\n return msgObj;\n }).filter(function (msgObj) {\n return _filterMessage(msgObj, state);\n }).sort(function (msgObjA, msgObjB) {\n return msgObjA.time - msgObjB.time;\n }); // sort by time\n useMessages.forEach(function (msgObj) {\n if (state.messagesCallback) {\n state.eMIs.add(msgObj.id);\n state.messagesCallback(msgObj.data);\n }\n });\n return PROMISE_RESOLVED_VOID;\n });\n}\nexport function close(channelState) {\n channelState.closed = true;\n channelState.db.close();\n}\nexport function postMessage(channelState, messageJson) {\n channelState.writeBlockPromise = channelState.writeBlockPromise.then(function () {\n return writeMessage(channelState.db, channelState.uuid, messageJson);\n }).then(function () {\n if (randomInt(0, 10) === 0) {\n /* await (do not await) */\n cleanOldMessages(channelState);\n }\n });\n return channelState.writeBlockPromise;\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n readNewMessages(channelState);\n}\nexport function canBeUsed() {\n return !!getIdb();\n}\nexport function averageResponseTime(options) {\n return options.idb.fallbackInterval * 2;\n}\nexport var IndexedDBMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","/**\n * A localStorage-only method which uses localstorage and its 'storage'-event\n * This does not work inside webworkers because they have no access to localstorage\n * This is basically implemented to support IE9 or your grandmother's toaster.\n * @link https://caniuse.com/#feat=namevalue-storage\n * @link https://caniuse.com/#feat=indexeddb\n */\n\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nimport { sleep, randomToken, microSeconds as micro } from '../util.js';\nexport var microSeconds = micro;\nvar KEY_PREFIX = 'pubkey.broadcastChannel-';\nexport var type = 'localstorage';\n\n/**\n * copied from crosstab\n * @link https://github.com/tejacques/crosstab/blob/master/src/crosstab.js#L32\n */\nexport function getLocalStorage() {\n var localStorage;\n if (typeof window === 'undefined') return null;\n try {\n localStorage = window.localStorage;\n localStorage = window['ie8-eventlistener/storage'] || window.localStorage;\n } catch (e) {\n // New versions of Firefox throw a Security exception\n // if cookies are disabled. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1028153\n }\n return localStorage;\n}\nexport function storageKey(channelName) {\n return KEY_PREFIX + channelName;\n}\n\n/**\n* writes the new message to the storage\n* and fires the storage-event so other readers can find it\n*/\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n sleep().then(function () {\n var key = storageKey(channelState.channelName);\n var writeObj = {\n token: randomToken(),\n time: new Date().getTime(),\n data: messageJson,\n uuid: channelState.uuid\n };\n var value = JSON.stringify(writeObj);\n getLocalStorage().setItem(key, value);\n\n /**\n * StorageEvent does not fire the 'storage' event\n * in the window that changes the state of the local storage.\n * So we fire it manually\n */\n var ev = document.createEvent('Event');\n ev.initEvent('storage', true, true);\n ev.key = key;\n ev.newValue = value;\n window.dispatchEvent(ev);\n res();\n });\n });\n}\nexport function addStorageEventListener(channelName, fn) {\n var key = storageKey(channelName);\n var listener = function listener(ev) {\n if (ev.key === key) {\n fn(JSON.parse(ev.newValue));\n }\n };\n window.addEventListener('storage', listener);\n return listener;\n}\nexport function removeStorageEventListener(listener) {\n window.removeEventListener('storage', listener);\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n if (!canBeUsed()) {\n throw new Error('BroadcastChannel: localstorage cannot be used');\n }\n var uuid = randomToken();\n\n /**\n * eMIs\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n var eMIs = new ObliviousSet(options.localstorage.removeTimeout);\n var state = {\n channelName: channelName,\n uuid: uuid,\n eMIs: eMIs // emittedMessagesIds\n };\n\n state.listener = addStorageEventListener(channelName, function (msgObj) {\n if (!state.messagesCallback) return; // no listener\n if (msgObj.uuid === uuid) return; // own message\n if (!msgObj.token || eMIs.has(msgObj.token)) return; // already emitted\n if (msgObj.data.time && msgObj.data.time < state.messagesCallbackTime) return; // too old\n\n eMIs.add(msgObj.token);\n state.messagesCallback(msgObj.data);\n });\n return state;\n}\nexport function close(channelState) {\n removeStorageEventListener(channelState.listener);\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n var ls = getLocalStorage();\n if (!ls) return false;\n try {\n var key = '__broadcastchannel_check';\n ls.setItem(key, 'works');\n ls.removeItem(key);\n } catch (e) {\n // Safari 10 in private mode will not allow write access to local\n // storage and fail with a QuotaExceededError. See\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Private_Browsing_Incognito_modes\n return false;\n }\n return true;\n}\nexport function averageResponseTime() {\n var defaultTime = 120;\n var userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.includes('safari') && !userAgent.includes('chrome')) {\n // safari is much slower so this time is higher\n return defaultTime * 2;\n }\n return defaultTime;\n}\nexport var LocalstorageMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import { microSeconds as micro } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'simulate';\nvar SIMULATE_CHANNELS = new Set();\nexport function create(channelName) {\n var state = {\n name: channelName,\n messagesCallback: null\n };\n SIMULATE_CHANNELS.add(state);\n return state;\n}\nexport function close(channelState) {\n SIMULATE_CHANNELS[\"delete\"](channelState);\n}\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n return setTimeout(function () {\n var channelArray = Array.from(SIMULATE_CHANNELS);\n channelArray.filter(function (channel) {\n return channel.name === channelState.name;\n }).filter(function (channel) {\n return channel !== channelState;\n }).filter(function (channel) {\n return !!channel.messagesCallback;\n }).forEach(function (channel) {\n return channel.messagesCallback(messageJson);\n });\n res();\n }, 5);\n });\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n return true;\n}\nexport function averageResponseTime() {\n return 5;\n}\nexport var SimulateMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import { NativeMethod } from './methods/native.js';\nimport { IndexedDBMethod } from './methods/indexed-db.js';\nimport { LocalstorageMethod } from './methods/localstorage.js';\nimport { SimulateMethod } from './methods/simulate.js';\n// the line below will be removed from es5/browser builds\n\n// order is important\nvar METHODS = [NativeMethod,\n// fastest\nIndexedDBMethod, LocalstorageMethod];\nexport function chooseMethod(options) {\n var chooseMethods = [].concat(options.methods, METHODS).filter(Boolean);\n\n // the line below will be removed from es5/browser builds\n\n // directly chosen\n if (options.type) {\n if (options.type === 'simulate') {\n // only use simulate-method if directly chosen\n return SimulateMethod;\n }\n var ret = chooseMethods.find(function (m) {\n return m.type === options.type;\n });\n if (!ret) throw new Error('method-type ' + options.type + ' not found');else return ret;\n }\n\n /**\n * if no webworker support is needed,\n * remove idb from the list so that localstorage will be chosen\n */\n if (!options.webWorkerSupport) {\n chooseMethods = chooseMethods.filter(function (m) {\n return m.type !== 'idb';\n });\n }\n var useMethod = chooseMethods.find(function (method) {\n return method.canBeUsed();\n });\n if (!useMethod) {\n throw new Error(\"No usable method found in \" + JSON.stringify(METHODS.map(function (m) {\n return m.type;\n })));\n } else {\n return useMethod;\n }\n}","import { isPromise, PROMISE_RESOLVED_FALSE, PROMISE_RESOLVED_VOID } from './util.js';\nimport { chooseMethod } from './method-chooser.js';\nimport { fillOptionsWithDefaults } from './options.js';\n\n/**\n * Contains all open channels,\n * used in tests to ensure everything is closed.\n */\nexport var OPEN_BROADCAST_CHANNELS = new Set();\nvar lastId = 0;\nexport var BroadcastChannel = function BroadcastChannel(name, options) {\n // identifier of the channel to debug stuff\n this.id = lastId++;\n OPEN_BROADCAST_CHANNELS.add(this);\n this.name = name;\n if (ENFORCED_OPTIONS) {\n options = ENFORCED_OPTIONS;\n }\n this.options = fillOptionsWithDefaults(options);\n this.method = chooseMethod(this.options);\n\n // isListening\n this._iL = false;\n\n /**\n * _onMessageListener\n * setting onmessage twice,\n * will overwrite the first listener\n */\n this._onML = null;\n\n /**\n * _addEventListeners\n */\n this._addEL = {\n message: [],\n internal: []\n };\n\n /**\n * Unsent message promises\n * where the sending is still in progress\n * @type {Set}\n */\n this._uMP = new Set();\n\n /**\n * _beforeClose\n * array of promises that will be awaited\n * before the channel is closed\n */\n this._befC = [];\n\n /**\n * _preparePromise\n */\n this._prepP = null;\n _prepareChannel(this);\n};\n\n// STATICS\n\n/**\n * used to identify if someone overwrites\n * window.BroadcastChannel with this\n * See methods/native.js\n */\nBroadcastChannel._pubkey = true;\n\n/**\n * clears the tmp-folder if is node\n * @return {Promise} true if has run, false if not node\n */\nexport function clearNodeFolder(options) {\n options = fillOptionsWithDefaults(options);\n var method = chooseMethod(options);\n if (method.type === 'node') {\n return method.clearNodeFolder().then(function () {\n return true;\n });\n } else {\n return PROMISE_RESOLVED_FALSE;\n }\n}\n\n/**\n * if set, this method is enforced,\n * no mather what the options are\n */\nvar ENFORCED_OPTIONS;\nexport function enforceOptions(options) {\n ENFORCED_OPTIONS = options;\n}\n\n// PROTOTYPE\nBroadcastChannel.prototype = {\n postMessage: function postMessage(msg) {\n if (this.closed) {\n throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +\n /**\n * In the past when this error appeared, it was really hard to debug.\n * So now we log the msg together with the error so it at least\n * gives some clue about where in your application this happens.\n */\n JSON.stringify(msg));\n }\n return _post(this, 'message', msg);\n },\n postInternal: function postInternal(msg) {\n return _post(this, 'internal', msg);\n },\n set onmessage(fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n _removeListenerObject(this, 'message', this._onML);\n if (fn && typeof fn === 'function') {\n this._onML = listenObj;\n _addListenerObject(this, 'message', listenObj);\n } else {\n this._onML = null;\n }\n },\n addEventListener: function addEventListener(type, fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n _addListenerObject(this, type, listenObj);\n },\n removeEventListener: function removeEventListener(type, fn) {\n var obj = this._addEL[type].find(function (obj) {\n return obj.fn === fn;\n });\n _removeListenerObject(this, type, obj);\n },\n close: function close() {\n var _this = this;\n if (this.closed) {\n return;\n }\n OPEN_BROADCAST_CHANNELS[\"delete\"](this);\n this.closed = true;\n var awaitPrepare = this._prepP ? this._prepP : PROMISE_RESOLVED_VOID;\n this._onML = null;\n this._addEL.message = [];\n return awaitPrepare\n // wait until all current sending are processed\n .then(function () {\n return Promise.all(Array.from(_this._uMP));\n })\n // run before-close hooks\n .then(function () {\n return Promise.all(_this._befC.map(function (fn) {\n return fn();\n }));\n })\n // close the channel\n .then(function () {\n return _this.method.close(_this._state);\n });\n },\n get type() {\n return this.method.type;\n },\n get isClosed() {\n return this.closed;\n }\n};\n\n/**\n * Post a message over the channel\n * @returns {Promise} that resolved when the message sending is done\n */\nfunction _post(broadcastChannel, type, msg) {\n var time = broadcastChannel.method.microSeconds();\n var msgObj = {\n time: time,\n type: type,\n data: msg\n };\n var awaitPrepare = broadcastChannel._prepP ? broadcastChannel._prepP : PROMISE_RESOLVED_VOID;\n return awaitPrepare.then(function () {\n var sendPromise = broadcastChannel.method.postMessage(broadcastChannel._state, msgObj);\n\n // add/remove to unsent messages list\n broadcastChannel._uMP.add(sendPromise);\n sendPromise[\"catch\"]().then(function () {\n return broadcastChannel._uMP[\"delete\"](sendPromise);\n });\n return sendPromise;\n });\n}\nfunction _prepareChannel(channel) {\n var maybePromise = channel.method.create(channel.name, channel.options);\n if (isPromise(maybePromise)) {\n channel._prepP = maybePromise;\n maybePromise.then(function (s) {\n // used in tests to simulate slow runtime\n /*if (channel.options.prepareDelay) {\n await new Promise(res => setTimeout(res, this.options.prepareDelay));\n }*/\n channel._state = s;\n });\n } else {\n channel._state = maybePromise;\n }\n}\nfunction _hasMessageListeners(channel) {\n if (channel._addEL.message.length > 0) return true;\n if (channel._addEL.internal.length > 0) return true;\n return false;\n}\nfunction _addListenerObject(channel, type, obj) {\n channel._addEL[type].push(obj);\n _startListening(channel);\n}\nfunction _removeListenerObject(channel, type, obj) {\n channel._addEL[type] = channel._addEL[type].filter(function (o) {\n return o !== obj;\n });\n _stopListening(channel);\n}\nfunction _startListening(channel) {\n if (!channel._iL && _hasMessageListeners(channel)) {\n // someone is listening, start subscribing\n\n var listenerFn = function listenerFn(msgObj) {\n channel._addEL[msgObj.type].forEach(function (listenerObject) {\n /**\n * Getting the current time in JavaScript has no good precision.\n * So instead of only listening to events that happened 'after' the listener\n * was added, we also listen to events that happened 100ms before it.\n * This ensures that when another process, like a WebWorker, sends events\n * we do not miss them out because their timestamp is a bit off compared to the main process.\n * Not doing this would make messages missing when we send data directly after subscribing and awaiting a response.\n * @link https://johnresig.com/blog/accuracy-of-javascript-time/\n */\n var hundredMsInMicro = 100 * 1000;\n var minMessageTime = listenerObject.time - hundredMsInMicro;\n if (msgObj.time >= minMessageTime) {\n listenerObject.fn(msgObj.data);\n }\n });\n };\n var time = channel.method.microSeconds();\n if (channel._prepP) {\n channel._prepP.then(function () {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n });\n } else {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n }\n }\n}\nfunction _stopListening(channel) {\n if (channel._iL && !_hasMessageListeners(channel)) {\n // no one is listening, stop subscribing\n channel._iL = false;\n var time = channel.method.microSeconds();\n channel.method.onMessage(channel._state, null, time);\n }\n}","/* global WorkerGlobalScope */\n\nexport function addBrowser(fn) {\n if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {\n /**\n * Because killing a worker does directly stop the excution\n * of the code, our only chance is to overwrite the close function\n * which could work some times.\n * @link https://stackoverflow.com/q/72903255/3443137\n */\n var oldClose = self.close.bind(self);\n self.close = function () {\n fn();\n return oldClose();\n };\n } else {\n /**\n * if we are on react-native, there is no window.addEventListener\n * @link https://github.com/pubkey/unload/issues/6\n */\n if (typeof window.addEventListener !== 'function') {\n return;\n }\n\n /**\n * for normal browser-windows, we use the beforeunload-event\n */\n window.addEventListener('beforeunload', function () {\n fn();\n }, true);\n\n /**\n * for iframes, we have to use the unload-event\n * @link https://stackoverflow.com/q/47533670/3443137\n */\n window.addEventListener('unload', function () {\n fn();\n }, true);\n }\n\n /**\n * TODO add fallback for safari-mobile\n * @link https://stackoverflow.com/a/26193516/3443137\n */\n}","export function addNode(fn) {\n process.on('exit', function () {\n return fn();\n });\n\n /**\n * on the following events,\n * the process will not end if there are\n * event-handlers attached,\n * therefore we have to call process.exit()\n */\n process.on('beforeExit', function () {\n return fn().then(function () {\n return process.exit();\n });\n });\n // catches ctrl+c event\n process.on('SIGINT', function () {\n return fn().then(function () {\n return process.exit();\n });\n });\n // catches uncaught exceptions\n process.on('uncaughtException', function (err) {\n return fn().then(function () {\n console.trace(err);\n process.exit(101);\n });\n });\n}","import { addBrowser } from './browser.js';\nimport { addNode } from './node.js';\n\n/**\n * Use the code directly to prevent import problems\n * with the detect-node package.\n * @link https://github.com/iliakan/detect-node/blob/master/index.js\n */\nvar isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\nvar USE_METHOD = isNode ? addNode : addBrowser;\nvar LISTENERS = new Set();\nvar startedListening = false;\nfunction startListening() {\n if (startedListening) {\n return;\n }\n startedListening = true;\n USE_METHOD(runAll);\n}\nexport function add(fn) {\n startListening();\n if (typeof fn !== 'function') {\n throw new Error('Listener is no function');\n }\n LISTENERS.add(fn);\n var addReturn = {\n remove: function remove() {\n return LISTENERS[\"delete\"](fn);\n },\n run: function run() {\n LISTENERS[\"delete\"](fn);\n return fn();\n }\n };\n return addReturn;\n}\nexport function runAll() {\n var promises = [];\n LISTENERS.forEach(function (fn) {\n promises.push(fn());\n LISTENERS[\"delete\"](fn);\n });\n return Promise.all(promises);\n}\nexport function removeAll() {\n LISTENERS.clear();\n}\nexport function getSize() {\n return LISTENERS.size;\n}","import { add as unloadAdd } from 'unload';\n\n/**\n * sends and internal message over the broadcast-channel\n */\nexport function sendLeaderMessage(leaderElector, action) {\n var msgJson = {\n context: 'leader',\n action: action,\n token: leaderElector.token\n };\n return leaderElector.broadcastChannel.postInternal(msgJson);\n}\nexport function beLeader(leaderElector) {\n leaderElector.isLeader = true;\n leaderElector._hasLeader = true;\n var unloadFn = unloadAdd(function () {\n return leaderElector.die();\n });\n leaderElector._unl.push(unloadFn);\n var isLeaderListener = function isLeaderListener(msg) {\n if (msg.context === 'leader' && msg.action === 'apply') {\n sendLeaderMessage(leaderElector, 'tell');\n }\n if (msg.context === 'leader' && msg.action === 'tell' && !leaderElector._dpLC) {\n /**\n * another instance is also leader!\n * This can happen on rare events\n * like when the CPU is at 100% for long time\n * or the tabs are open very long and the browser throttles them.\n * @link https://github.com/pubkey/broadcast-channel/issues/414\n * @link https://github.com/pubkey/broadcast-channel/issues/385\n */\n leaderElector._dpLC = true;\n leaderElector._dpL(); // message the lib user so the app can handle the problem\n sendLeaderMessage(leaderElector, 'tell'); // ensure other leader also knows the problem\n }\n };\n\n leaderElector.broadcastChannel.addEventListener('internal', isLeaderListener);\n leaderElector._lstns.push(isLeaderListener);\n return sendLeaderMessage(leaderElector, 'tell');\n}","import { randomToken } from './util.js';\nimport { sendLeaderMessage, beLeader } from './leader-election-util.js';\n\n/**\n * A faster version of the leader elector that uses the WebLock API\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n */\nexport var LeaderElectionWebLock = function LeaderElectionWebLock(broadcastChannel, options) {\n var _this = this;\n this.broadcastChannel = broadcastChannel;\n broadcastChannel._befC.push(function () {\n return _this.die();\n });\n this._options = options;\n this.isLeader = false;\n this.isDead = false;\n this.token = randomToken();\n this._lstns = [];\n this._unl = [];\n this._dpL = function () {}; // onduplicate listener\n this._dpLC = false; // true when onduplicate called\n\n this._wKMC = {}; // stuff for cleanup\n\n // lock name\n this.lN = 'pubkey-bc||' + broadcastChannel.method.type + '||' + broadcastChannel.name;\n};\nLeaderElectionWebLock.prototype = {\n hasLeader: function hasLeader() {\n var _this2 = this;\n return navigator.locks.query().then(function (locks) {\n var relevantLocks = locks.held ? locks.held.filter(function (lock) {\n return lock.name === _this2.lN;\n }) : [];\n if (relevantLocks && relevantLocks.length > 0) {\n return true;\n } else {\n return false;\n }\n });\n },\n awaitLeadership: function awaitLeadership() {\n var _this3 = this;\n if (!this._wLMP) {\n this._wKMC.c = new AbortController();\n var returnPromise = new Promise(function (res, rej) {\n _this3._wKMC.res = res;\n _this3._wKMC.rej = rej;\n });\n this._wLMP = new Promise(function (res) {\n navigator.locks.request(_this3.lN, {\n signal: _this3._wKMC.c.signal\n }, function () {\n // if the lock resolved, we can drop the abort controller\n _this3._wKMC.c = undefined;\n beLeader(_this3);\n res();\n return returnPromise;\n })[\"catch\"](function () {});\n });\n }\n return this._wLMP;\n },\n set onduplicate(_fn) {\n // Do nothing because there are no duplicates in the WebLock version\n },\n die: function die() {\n var _this4 = this;\n this._lstns.forEach(function (listener) {\n return _this4.broadcastChannel.removeEventListener('internal', listener);\n });\n this._lstns = [];\n this._unl.forEach(function (uFn) {\n return uFn.remove();\n });\n this._unl = [];\n if (this.isLeader) {\n this.isLeader = false;\n }\n this.isDead = true;\n if (this._wKMC.res) {\n this._wKMC.res();\n }\n if (this._wKMC.c) {\n this._wKMC.c.abort('LeaderElectionWebLock.die() called');\n }\n return sendLeaderMessage(this, 'death');\n }\n};","import { sleep, randomToken, PROMISE_RESOLVED_VOID, PROMISE_RESOLVED_TRUE, supportsWebLockAPI } from './util.js';\nimport { sendLeaderMessage, beLeader } from './leader-election-util.js';\nimport { LeaderElectionWebLock } from './leader-election-web-lock.js';\nvar LeaderElection = function LeaderElection(broadcastChannel, options) {\n var _this = this;\n this.broadcastChannel = broadcastChannel;\n this._options = options;\n this.isLeader = false;\n this._hasLeader = false;\n this.isDead = false;\n this.token = randomToken();\n\n /**\n * Apply Queue,\n * used to ensure we do not run applyOnce()\n * in parallel.\n */\n this._aplQ = PROMISE_RESOLVED_VOID;\n // amount of unfinished applyOnce() calls\n this._aplQC = 0;\n\n // things to clean up\n this._unl = []; // _unloads\n this._lstns = []; // _listeners\n this._dpL = function () {}; // onduplicate listener\n this._dpLC = false; // true when onduplicate called\n\n /**\n * Even when the own instance is not applying,\n * we still listen to messages to ensure the hasLeader flag\n * is set correctly.\n */\n var hasLeaderListener = function hasLeaderListener(msg) {\n if (msg.context === 'leader') {\n if (msg.action === 'death') {\n _this._hasLeader = false;\n }\n if (msg.action === 'tell') {\n _this._hasLeader = true;\n }\n }\n };\n this.broadcastChannel.addEventListener('internal', hasLeaderListener);\n this._lstns.push(hasLeaderListener);\n};\nLeaderElection.prototype = {\n hasLeader: function hasLeader() {\n return Promise.resolve(this._hasLeader);\n },\n /**\n * Returns true if the instance is leader,\n * false if not.\n * @async\n */\n applyOnce: function applyOnce(\n // true if the applyOnce() call came from the fallbackInterval cycle\n isFromFallbackInterval) {\n var _this2 = this;\n if (this.isLeader) {\n return sleep(0, true);\n }\n if (this.isDead) {\n return sleep(0, false);\n }\n\n /**\n * Already applying more than once,\n * -> wait for the apply queue to be finished.\n */\n if (this._aplQC > 1) {\n return this._aplQ;\n }\n\n /**\n * Add a new apply-run\n */\n var applyRun = function applyRun() {\n /**\n * Optimization shortcuts.\n * Directly return if a previous run\n * has already elected a leader.\n */\n if (_this2.isLeader) {\n return PROMISE_RESOLVED_TRUE;\n }\n var stopCriteria = false;\n var stopCriteriaPromiseResolve;\n /**\n * Resolves when a stop criteria is reached.\n * Uses as a performance shortcut so we do not\n * have to await the responseTime when it is already clear\n * that the election failed.\n */\n var stopCriteriaPromise = new Promise(function (res) {\n stopCriteriaPromiseResolve = function stopCriteriaPromiseResolve() {\n stopCriteria = true;\n res();\n };\n });\n var handleMessage = function handleMessage(msg) {\n if (msg.context === 'leader' && msg.token != _this2.token) {\n if (msg.action === 'apply') {\n // other is applying\n if (msg.token > _this2.token) {\n /**\n * other has higher token\n * -> stop applying and let other become leader.\n */\n stopCriteriaPromiseResolve();\n }\n }\n if (msg.action === 'tell') {\n // other is already leader\n stopCriteriaPromiseResolve();\n _this2._hasLeader = true;\n }\n }\n };\n _this2.broadcastChannel.addEventListener('internal', handleMessage);\n\n /**\n * If the applyOnce() call came from the fallbackInterval,\n * we can assume that the election runs in the background and\n * not critical process is waiting for it.\n * When this is true, we give the other instances\n * more time to answer to messages in the election cycle.\n * This makes it less likely to elect duplicate leaders.\n * But also it takes longer which is not a problem because we anyway\n * run in the background.\n */\n var waitForAnswerTime = isFromFallbackInterval ? _this2._options.responseTime * 4 : _this2._options.responseTime;\n return sendLeaderMessage(_this2, 'apply') // send out that this one is applying\n .then(function () {\n return Promise.race([sleep(waitForAnswerTime), stopCriteriaPromise.then(function () {\n return Promise.reject(new Error());\n })]);\n })\n // send again in case another instance was just created\n .then(function () {\n return sendLeaderMessage(_this2, 'apply');\n })\n // let others time to respond\n .then(function () {\n return Promise.race([sleep(waitForAnswerTime), stopCriteriaPromise.then(function () {\n return Promise.reject(new Error());\n })]);\n })[\"catch\"](function () {}).then(function () {\n _this2.broadcastChannel.removeEventListener('internal', handleMessage);\n if (!stopCriteria) {\n // no stop criteria -> own is leader\n return beLeader(_this2).then(function () {\n return true;\n });\n } else {\n // other is leader\n return false;\n }\n });\n };\n this._aplQC = this._aplQC + 1;\n this._aplQ = this._aplQ.then(function () {\n return applyRun();\n }).then(function () {\n _this2._aplQC = _this2._aplQC - 1;\n });\n return this._aplQ.then(function () {\n return _this2.isLeader;\n });\n },\n awaitLeadership: function awaitLeadership() {\n if ( /* _awaitLeadershipPromise */\n !this._aLP) {\n this._aLP = _awaitLeadershipOnce(this);\n }\n return this._aLP;\n },\n set onduplicate(fn) {\n this._dpL = fn;\n },\n die: function die() {\n var _this3 = this;\n this._lstns.forEach(function (listener) {\n return _this3.broadcastChannel.removeEventListener('internal', listener);\n });\n this._lstns = [];\n this._unl.forEach(function (uFn) {\n return uFn.remove();\n });\n this._unl = [];\n if (this.isLeader) {\n this._hasLeader = false;\n this.isLeader = false;\n }\n this.isDead = true;\n return sendLeaderMessage(this, 'death');\n }\n};\n\n/**\n * @param leaderElector {LeaderElector}\n */\nfunction _awaitLeadershipOnce(leaderElector) {\n if (leaderElector.isLeader) {\n return PROMISE_RESOLVED_VOID;\n }\n return new Promise(function (res) {\n var resolved = false;\n function finish() {\n if (resolved) {\n return;\n }\n resolved = true;\n leaderElector.broadcastChannel.removeEventListener('internal', whenDeathListener);\n res(true);\n }\n\n // try once now\n leaderElector.applyOnce().then(function () {\n if (leaderElector.isLeader) {\n finish();\n }\n });\n\n /**\n * Try on fallbackInterval\n * @recursive\n */\n var tryOnFallBack = function tryOnFallBack() {\n return sleep(leaderElector._options.fallbackInterval).then(function () {\n if (leaderElector.isDead || resolved) {\n return;\n }\n if (leaderElector.isLeader) {\n finish();\n } else {\n return leaderElector.applyOnce(true).then(function () {\n if (leaderElector.isLeader) {\n finish();\n } else {\n tryOnFallBack();\n }\n });\n }\n });\n };\n tryOnFallBack();\n\n // try when other leader dies\n var whenDeathListener = function whenDeathListener(msg) {\n if (msg.context === 'leader' && msg.action === 'death') {\n leaderElector._hasLeader = false;\n leaderElector.applyOnce().then(function () {\n if (leaderElector.isLeader) {\n finish();\n }\n });\n }\n };\n leaderElector.broadcastChannel.addEventListener('internal', whenDeathListener);\n leaderElector._lstns.push(whenDeathListener);\n });\n}\nfunction fillOptionsWithDefaults(options, channel) {\n if (!options) options = {};\n options = JSON.parse(JSON.stringify(options));\n if (!options.fallbackInterval) {\n options.fallbackInterval = 3000;\n }\n if (!options.responseTime) {\n options.responseTime = channel.method.averageResponseTime(channel.options);\n }\n return options;\n}\nexport function createLeaderElection(channel, options) {\n if (channel._leaderElector) {\n throw new Error('BroadcastChannel already has a leader-elector');\n }\n options = fillOptionsWithDefaults(options, channel);\n var elector = supportsWebLockAPI() ? new LeaderElectionWebLock(channel, options) : new LeaderElection(channel, options);\n channel._befC.push(function () {\n return elector.die();\n });\n channel._leaderElector = elector;\n return elector;\n}","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { BroadcastChannel } from 'broadcast-channel';\nimport { isBrowser } from '../features.js';\nimport '../oidc/types/Token.js';\nimport { EVENT_ADDED, EVENT_REMOVED, EVENT_RENEWED, EVENT_SET_STORAGE } from '../oidc/types/TokenManager.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\n\nclass SyncStorageService {\n constructor(tokenManager, options = {}) {\n this.started = false;\n this.enablePostMessage = true;\n this.tokenManager = tokenManager;\n this.options = options;\n this.onTokenAddedHandler = this.onTokenAddedHandler.bind(this);\n this.onTokenRemovedHandler = this.onTokenRemovedHandler.bind(this);\n this.onTokenRenewedHandler = this.onTokenRenewedHandler.bind(this);\n this.onSetStorageHandler = this.onSetStorageHandler.bind(this);\n this.onSyncMessageHandler = this.onSyncMessageHandler.bind(this);\n }\n requiresLeadership() {\n return false;\n }\n isStarted() {\n return this.started;\n }\n canStart() {\n return !!this.options.syncStorage && isBrowser() && !this.started;\n }\n async start() {\n if (!this.canStart()) {\n return;\n }\n const { syncChannelName } = this.options;\n try {\n this.channel = new BroadcastChannel(syncChannelName);\n }\n catch (err) {\n throw new AuthSdkError('SyncStorageService is not supported in current browser.');\n }\n this.tokenManager.on(EVENT_ADDED, this.onTokenAddedHandler);\n this.tokenManager.on(EVENT_REMOVED, this.onTokenRemovedHandler);\n this.tokenManager.on(EVENT_RENEWED, this.onTokenRenewedHandler);\n this.tokenManager.on(EVENT_SET_STORAGE, this.onSetStorageHandler);\n this.channel.addEventListener('message', this.onSyncMessageHandler);\n this.started = true;\n }\n async stop() {\n var _a, _b;\n if (this.started) {\n this.tokenManager.off(EVENT_ADDED, this.onTokenAddedHandler);\n this.tokenManager.off(EVENT_REMOVED, this.onTokenRemovedHandler);\n this.tokenManager.off(EVENT_RENEWED, this.onTokenRenewedHandler);\n this.tokenManager.off(EVENT_SET_STORAGE, this.onSetStorageHandler);\n (_a = this.channel) === null || _a === void 0 ? void 0 : _a.removeEventListener('message', this.onSyncMessageHandler);\n await ((_b = this.channel) === null || _b === void 0 ? void 0 : _b.close());\n this.channel = undefined;\n this.started = false;\n }\n }\n onTokenAddedHandler(key, token) {\n var _a;\n if (!this.enablePostMessage) {\n return;\n }\n (_a = this.channel) === null || _a === void 0 ? void 0 : _a.postMessage({\n type: EVENT_ADDED,\n key,\n token\n });\n }\n onTokenRemovedHandler(key, token) {\n var _a;\n if (!this.enablePostMessage) {\n return;\n }\n (_a = this.channel) === null || _a === void 0 ? void 0 : _a.postMessage({\n type: EVENT_REMOVED,\n key,\n token\n });\n }\n onTokenRenewedHandler(key, token, oldToken) {\n var _a;\n if (!this.enablePostMessage) {\n return;\n }\n (_a = this.channel) === null || _a === void 0 ? void 0 : _a.postMessage({\n type: EVENT_RENEWED,\n key,\n token,\n oldToken\n });\n }\n onSetStorageHandler(storage) {\n var _a;\n (_a = this.channel) === null || _a === void 0 ? void 0 : _a.postMessage({\n type: EVENT_SET_STORAGE,\n storage\n });\n }\n onSyncMessageHandler(msg) {\n this.enablePostMessage = false;\n switch (msg.type) {\n case EVENT_SET_STORAGE:\n this.tokenManager.getStorage().setStorage(msg.storage);\n break;\n case EVENT_ADDED:\n this.tokenManager.emitAdded(msg.key, msg.token);\n this.tokenManager.setExpireEventTimeout(msg.key, msg.token);\n break;\n case EVENT_REMOVED:\n this.tokenManager.clearExpireEventTimeout(msg.key);\n this.tokenManager.emitRemoved(msg.key, msg.token);\n break;\n case EVENT_RENEWED:\n this.tokenManager.emitRenewed(msg.key, msg.token, msg.oldToken);\n break;\n }\n this.enablePostMessage = true;\n }\n}\n\nexport { SyncStorageService };\n//# sourceMappingURL=SyncStorageService.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { BroadcastChannel, createLeaderElection } from 'broadcast-channel';\nimport { isBrowser } from '../features.js';\n\nclass LeaderElectionService {\n constructor(options = {}) {\n this.started = false;\n this.options = options;\n this.onLeaderDuplicate = this.onLeaderDuplicate.bind(this);\n this.onLeader = this.onLeader.bind(this);\n }\n onLeaderDuplicate() {\n }\n async onLeader() {\n var _a, _b;\n await ((_b = (_a = this.options).onLeader) === null || _b === void 0 ? void 0 : _b.call(_a));\n }\n isLeader() {\n var _a;\n return !!((_a = this.elector) === null || _a === void 0 ? void 0 : _a.isLeader);\n }\n hasLeader() {\n var _a;\n return !!((_a = this.elector) === null || _a === void 0 ? void 0 : _a.hasLeader);\n }\n async start() {\n if (this.canStart()) {\n const { electionChannelName } = this.options;\n this.channel = new BroadcastChannel(electionChannelName);\n this.elector = createLeaderElection(this.channel);\n this.elector.onduplicate = this.onLeaderDuplicate;\n this.elector.awaitLeadership().then(this.onLeader);\n this.started = true;\n }\n }\n async stop() {\n if (this.started) {\n if (this.elector) {\n await this.elector.die();\n this.elector = undefined;\n }\n if (this.channel) {\n this.channel.postInternal = () => Promise.resolve();\n await this.channel.close();\n this.channel = undefined;\n }\n this.started = false;\n }\n }\n requiresLeadership() {\n return false;\n }\n isStarted() {\n return this.started;\n }\n canStart() {\n return isBrowser() && !this.started;\n }\n}\n\nexport { LeaderElectionService };\n//# sourceMappingURL=LeaderElectionService.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isBrowser } from '../features.js';\n\nconst getNow = () => Math.floor(Date.now() / 1000);\nclass RenewOnTabActivationService {\n constructor(tokenManager, options = {}) {\n this.started = false;\n this.lastHidden = -1;\n this.tokenManager = tokenManager;\n this.options = options;\n this.onPageVisbilityChange = this._onPageVisbilityChange.bind(this);\n }\n _onPageVisbilityChange() {\n if (document.hidden) {\n this.lastHidden = getNow();\n }\n else if (this.lastHidden > 0 && (getNow() - this.lastHidden >= this.options.tabInactivityDuration)) {\n const { accessToken, idToken } = this.tokenManager.getTokensSync();\n if (!!accessToken && this.tokenManager.hasExpired(accessToken)) {\n const key = this.tokenManager.getStorageKeyByType('accessToken');\n this.tokenManager.renew(key).catch(() => { });\n }\n else if (!!idToken && this.tokenManager.hasExpired(idToken)) {\n const key = this.tokenManager.getStorageKeyByType('idToken');\n this.tokenManager.renew(key).catch(() => { });\n }\n }\n }\n async start() {\n if (this.canStart() && !!document) {\n document.addEventListener('visibilitychange', this.onPageVisbilityChange);\n this.started = true;\n }\n }\n async stop() {\n if (document) {\n document.removeEventListener('visibilitychange', this.onPageVisbilityChange);\n this.started = false;\n }\n }\n canStart() {\n return isBrowser() &&\n !!this.options.autoRenew &&\n !!this.options.renewOnTabActivation &&\n !this.started;\n }\n requiresLeadership() {\n return false;\n }\n isStarted() {\n return this.started;\n }\n}\n\nexport { RenewOnTabActivationService };\n//# sourceMappingURL=RenewOnTabActivationService.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { AutoRenewService } from '../../services/AutoRenewService.js';\nimport { SyncStorageService } from '../../services/SyncStorageService.js';\nimport { LeaderElectionService } from '../../services/LeaderElectionService.js';\nimport { RenewOnTabActivationService } from '../../services/RenewOnTabActivationService.js';\nimport { removeNils } from '../../util/object.js';\n\nconst AUTO_RENEW = 'autoRenew';\nconst SYNC_STORAGE = 'syncStorage';\nconst LEADER_ELECTION = 'leaderElection';\nconst RENEW_ON_TAB_ACTIVATION = 'renewOnTabActivation';\nclass ServiceManager {\n constructor(sdk, options = {}) {\n this.sdk = sdk;\n this.onLeader = this.onLeader.bind(this);\n const { autoRenew, autoRemove, syncStorage } = sdk.tokenManager.getOptions();\n options.electionChannelName = options.electionChannelName || options.broadcastChannelName;\n this.options = Object.assign({}, ServiceManager.defaultOptions, { autoRenew, autoRemove, syncStorage }, {\n electionChannelName: `${sdk.options.clientId}-election`,\n syncChannelName: `${sdk.options.clientId}-sync`,\n }, removeNils(options));\n this.started = false;\n this.services = new Map();\n ServiceManager.knownServices.forEach(name => {\n const svc = this.createService(name);\n if (svc) {\n this.services.set(name, svc);\n }\n });\n }\n async onLeader() {\n if (this.started) {\n await this.startServices();\n }\n }\n isLeader() {\n var _a;\n return (_a = this.getService(LEADER_ELECTION)) === null || _a === void 0 ? void 0 : _a.isLeader();\n }\n isLeaderRequired() {\n return [...this.services.values()].some(srv => srv.canStart() && srv.requiresLeadership());\n }\n async start() {\n if (this.started) {\n return;\n }\n await this.startServices();\n this.started = true;\n }\n async stop() {\n await this.stopServices();\n this.started = false;\n }\n getService(name) {\n return this.services.get(name);\n }\n async startServices() {\n for (const [name, srv] of this.services.entries()) {\n if (this.canStartService(name, srv)) {\n await srv.start();\n }\n }\n }\n async stopServices() {\n for (const srv of this.services.values()) {\n await srv.stop();\n }\n }\n canStartService(name, srv) {\n let canStart = srv.canStart() && !srv.isStarted();\n if (name === LEADER_ELECTION) {\n canStart && (canStart = this.isLeaderRequired());\n }\n else if (srv.requiresLeadership()) {\n canStart && (canStart = this.isLeader());\n }\n return canStart;\n }\n createService(name) {\n const tokenManager = this.sdk.tokenManager;\n let service;\n switch (name) {\n case LEADER_ELECTION:\n service = new LeaderElectionService(Object.assign(Object.assign({}, this.options), { onLeader: this.onLeader }));\n break;\n case AUTO_RENEW:\n service = new AutoRenewService(tokenManager, Object.assign({}, this.options));\n break;\n case SYNC_STORAGE:\n service = new SyncStorageService(tokenManager, Object.assign({}, this.options));\n break;\n case RENEW_ON_TAB_ACTIVATION:\n service = new RenewOnTabActivationService(tokenManager, Object.assign({}, this.options));\n break;\n default:\n throw new Error(`Unknown service ${name}`);\n }\n return service;\n }\n}\nServiceManager.knownServices = [AUTO_RENEW, SYNC_STORAGE, LEADER_ELECTION, RENEW_ON_TAB_ACTIVATION];\nServiceManager.defaultOptions = {\n autoRenew: true,\n autoRemove: true,\n syncStorage: true,\n renewOnTabActivation: true,\n tabInactivityDuration: 1800,\n};\n\nexport { ServiceManager };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { parseOAuthResponseFromUrl } from '../oidc/parseFromUrl.js';\nimport { AuthStateManager } from './AuthStateManager.js';\nimport { ServiceManager } from './ServiceManager/browser.js';\n\nfunction mixinCore(Base) {\n return class OktaAuthCore extends Base {\n constructor(...args) {\n super(...args);\n this.authStateManager = new AuthStateManager(this);\n this.serviceManager = new ServiceManager(this, this.options.services);\n }\n async start() {\n await this.serviceManager.start();\n this.tokenManager.start();\n if (!this.token.isLoginRedirect()) {\n await this.authStateManager.updateAuthState();\n }\n }\n async stop() {\n this.tokenManager.stop();\n await this.serviceManager.stop();\n }\n async handleRedirect(originalUri) {\n await this.handleLoginRedirect(undefined, originalUri);\n }\n async handleLoginRedirect(tokens, originalUri) {\n let state = this.options.state;\n if (tokens) {\n this.tokenManager.setTokens(tokens);\n originalUri = originalUri || this.getOriginalUri(this.options.state);\n }\n else if (this.isLoginRedirect()) {\n try {\n const oAuthResponse = await parseOAuthResponseFromUrl(this, {});\n state = oAuthResponse.state;\n originalUri = originalUri || this.getOriginalUri(state);\n await this.storeTokensFromRedirect();\n }\n catch (e) {\n await this.authStateManager.updateAuthState();\n throw e;\n }\n }\n else {\n return;\n }\n await this.authStateManager.updateAuthState();\n this.removeOriginalUri(state);\n const { restoreOriginalUri } = this.options;\n if (restoreOriginalUri) {\n await restoreOriginalUri(this, originalUri);\n }\n else if (originalUri) {\n window.location.replace(originalUri);\n }\n }\n };\n}\n\nexport { mixinCore };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { omit, getLink } from '../util/object.js';\nimport { toQueryString } from '../util/url.js';\nimport '../errors/WWWAuthError.js';\nimport { get, post, httpRequest } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\n\nfunction sessionExists(sdk) {\n return sdk.session.get()\n .then(function (res) {\n if (res.status === 'ACTIVE') {\n return true;\n }\n return false;\n })\n .catch(function () {\n return false;\n });\n}\nfunction getSession(sdk) {\n return get(sdk, '/api/v1/sessions/me', { withCredentials: true })\n .then(function (session) {\n var res = omit(session, '_links');\n res.refresh = function () {\n return post(sdk, getLink(session, 'refresh').href, {}, { withCredentials: true });\n };\n res.user = function () {\n return get(sdk, getLink(session, 'user').href, { withCredentials: true });\n };\n return res;\n })\n .catch(function () {\n return { status: 'INACTIVE' };\n });\n}\nfunction closeSession(sdk) {\n return httpRequest(sdk, {\n url: sdk.getIssuerOrigin() + '/api/v1/sessions/me',\n method: 'DELETE',\n withCredentials: true\n });\n}\nfunction refreshSession(sdk) {\n return post(sdk, '/api/v1/sessions/me/lifecycle/refresh', {}, { withCredentials: true });\n}\nfunction setCookieAndRedirect(sdk, sessionToken, redirectUrl) {\n redirectUrl = redirectUrl || window.location.href;\n window.location.assign(sdk.getIssuerOrigin() + '/login/sessionCookieRedirect' +\n toQueryString({\n checkAccountSetupComplete: true,\n token: sessionToken,\n redirectUrl: redirectUrl\n }));\n}\n\nexport { closeSession, getSession, refreshSession, sessionExists, setCookieAndRedirect };\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { closeSession, sessionExists, getSession, refreshSession, setCookieAndRedirect } from './api.js';\n\nfunction createSessionApi(sdk) {\n const session = {\n close: closeSession.bind(null, sdk),\n exists: sessionExists.bind(null, sdk),\n get: getSession.bind(null, sdk),\n refresh: refreshSession.bind(null, sdk),\n setCookieAndRedirect: setCookieAndRedirect.bind(null, sdk)\n };\n return session;\n}\n\nexport { createSessionApi };\n//# sourceMappingURL=factory.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createSessionApi } from './factory.js';\n\nfunction mixinSession(Base) {\n return class OktaAuthSession extends Base {\n constructor(...args) {\n super(...args);\n this.session = createSessionApi(this);\n }\n closeSession() {\n return this.session.close()\n .then(async () => {\n this.clearStorage();\n return true;\n })\n .catch(function (e) {\n if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {\n return false;\n }\n throw e;\n });\n }\n };\n}\n\nexport { mixinSession };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createOktaAuthBase } from '../base/factory.js';\nimport { mixinStorage } from '../storage/mixin.js';\nimport { mixinHttp } from '../http/mixin.js';\nimport { mixinOAuth } from '../oidc/mixin/index.js';\nimport { mixinCore } from './mixin.js';\nimport { mixinSession } from '../session/mixin.js';\n\nfunction createOktaAuthCore(StorageManagerConstructor, OptionsConstructor, TransactionManagerConstructor) {\n const Base = createOktaAuthBase(OptionsConstructor);\n const WithStorage = mixinStorage(Base, StorageManagerConstructor);\n const WithHttp = mixinHttp(WithStorage);\n const WithSession = mixinSession(WithHttp);\n const WithOAuth = mixinOAuth(WithSession, TransactionManagerConstructor);\n const Core = mixinCore(WithOAuth);\n return Core;\n}\n\nexport { createOktaAuthCore };\n//# sourceMappingURL=factory.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { isFingerprintSupported } from '../features.js';\nimport { addListener, removeListener } from '../oidc/util/browser.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\n\nconst isMessageFromCorrectSource = (iframe, event) => event.source === iframe.contentWindow;\nfunction fingerprint(sdk, options) {\n var _a;\n if (!isFingerprintSupported()) {\n return Promise.reject(new AuthSdkError('Fingerprinting is not supported on this device'));\n }\n const container = (_a = options === null || options === void 0 ? void 0 : options.container) !== null && _a !== void 0 ? _a : document.body;\n let timeout;\n let iframe;\n let listener;\n const promise = new Promise(function (resolve, reject) {\n iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n listener = function listener(e) {\n var _a;\n if (!isMessageFromCorrectSource(iframe, e)) {\n return;\n }\n if (!e || !e.data || e.origin !== sdk.getIssuerOrigin()) {\n return;\n }\n let msg;\n try {\n msg = JSON.parse(e.data);\n }\n catch (err) {\n return;\n }\n if (!msg) {\n return;\n }\n if (msg.type === 'FingerprintAvailable') {\n return resolve(msg.fingerprint);\n }\n else if (msg.type === 'FingerprintServiceReady') {\n (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({\n type: 'GetFingerprint'\n }), e.origin);\n }\n else {\n return reject(new AuthSdkError('No data'));\n }\n };\n addListener(window, 'message', listener);\n iframe.src = sdk.getIssuerOrigin() + '/auth/services/devicefingerprint';\n container.appendChild(iframe);\n timeout = setTimeout(function () {\n reject(new AuthSdkError('Fingerprinting timed out'));\n }, (options === null || options === void 0 ? void 0 : options.timeout) || 15000);\n });\n return promise.finally(function () {\n var _a;\n clearTimeout(timeout);\n removeListener(window, 'message', listener);\n if (container.contains(iframe)) {\n (_a = iframe.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(iframe);\n }\n });\n}\n\nexport { fingerprint as default };\n//# sourceMappingURL=fingerprint.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { base64UrlToBuffer, bufferToBase64Url } from '../crypto/base64.js';\n\nconst getEnrolledCredentials = (authenticatorEnrollments = []) => {\n const credentials = [];\n authenticatorEnrollments.forEach((enrollement) => {\n if (enrollement.key === 'webauthn') {\n credentials.push({\n type: 'public-key',\n id: base64UrlToBuffer(enrollement.credentialId),\n });\n }\n });\n return credentials;\n};\nconst buildCredentialCreationOptions = (activationData, authenticatorEnrollments) => {\n return {\n publicKey: {\n rp: activationData.rp,\n user: {\n id: base64UrlToBuffer(activationData.user.id),\n name: activationData.user.name,\n displayName: activationData.user.displayName\n },\n challenge: base64UrlToBuffer(activationData.challenge),\n pubKeyCredParams: activationData.pubKeyCredParams,\n attestation: activationData.attestation,\n authenticatorSelection: activationData.authenticatorSelection,\n excludeCredentials: getEnrolledCredentials(authenticatorEnrollments),\n }\n };\n};\nconst buildCredentialRequestOptions = (challengeData, authenticatorEnrollments) => {\n return {\n publicKey: {\n challenge: base64UrlToBuffer(challengeData.challenge),\n userVerification: challengeData.userVerification,\n allowCredentials: getEnrolledCredentials(authenticatorEnrollments),\n }\n };\n};\nconst getAttestation = (credential) => {\n const response = credential.response;\n const id = credential.id;\n const clientData = bufferToBase64Url(response.clientDataJSON);\n const attestation = bufferToBase64Url(response.attestationObject);\n return {\n id,\n clientData,\n attestation\n };\n};\nconst getAssertion = (credential) => {\n const response = credential.response;\n const id = credential.id;\n const clientData = bufferToBase64Url(response.clientDataJSON);\n const authenticatorData = bufferToBase64Url(response.authenticatorData);\n const signatureData = bufferToBase64Url(response.signature);\n return {\n id,\n clientData,\n authenticatorData,\n signatureData\n };\n};\n\nexport { buildCredentialCreationOptions, buildCredentialRequestOptions, getAssertion, getAttestation };\n//# sourceMappingURL=webauthn.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createIdxAPI } from './factory/api.js';\nimport fingerprint from '../browser/fingerprint.js';\nimport * as webauthn from './webauthn.js';\n\nfunction mixinIdx(Base) {\n var _a;\n return _a = class OktaAuthIdx extends Base {\n constructor(...args) {\n super(...args);\n this.idx = createIdxAPI(this);\n this.fingerprint = fingerprint.bind(null, this);\n }\n },\n _a.webauthn = webauthn,\n _a;\n}\n\nexport { mixinIdx };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createOktaAuthCore } from '../../core/factory.js';\nimport { mixinIdx } from '../mixin.js';\n\nfunction createOktaAuthIdx(StorageManagerConstructor, OptionsConstructor, TransactionManagerConstructor) {\n const Core = createOktaAuthCore(StorageManagerConstructor, OptionsConstructor, TransactionManagerConstructor);\n const WithIdx = mixinIdx(Core);\n return WithIdx;\n}\n\nexport { createOktaAuthIdx };\n//# sourceMappingURL=OktaAuthIdx.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction createBaseOptionsConstructor() {\n return class BaseOptionsConstructor {\n constructor(args) {\n this.devMode = !!args.devMode;\n }\n };\n}\n\nexport { createBaseOptionsConstructor };\n//# sourceMappingURL=options.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { warn } from '../../util/console.js';\nimport storageUtil from '../../browser/browserStorage.js';\n\nfunction getStorage() {\n const storageUtil$1 = Object.assign({}, storageUtil, {\n inMemoryStore: {}\n });\n return storageUtil$1;\n}\nconst STORAGE_MANAGER_OPTIONS = {\n token: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n cache: {\n storageTypes: [\n 'localStorage',\n 'sessionStorage',\n 'cookie'\n ]\n },\n transaction: {\n storageTypes: [\n 'sessionStorage',\n 'localStorage',\n 'cookie'\n ]\n },\n 'shared-transaction': {\n storageTypes: [\n 'localStorage'\n ]\n },\n 'original-uri': {\n storageTypes: [\n 'localStorage'\n ]\n }\n};\nfunction getCookieSettings(args = {}, isHTTPS) {\n var cookieSettings = args.cookies || {};\n if (typeof cookieSettings.secure === 'undefined') {\n cookieSettings.secure = isHTTPS;\n }\n if (typeof cookieSettings.sameSite === 'undefined') {\n cookieSettings.sameSite = cookieSettings.secure ? 'none' : 'lax';\n }\n if (cookieSettings.secure && !isHTTPS) {\n warn('The current page is not being served with the HTTPS protocol.\\n' +\n 'For security reasons, we strongly recommend using HTTPS.\\n' +\n 'If you cannot use HTTPS, set \"cookies.secure\" option to false.');\n cookieSettings.secure = false;\n }\n if (cookieSettings.sameSite === 'none' && !cookieSettings.secure) {\n cookieSettings.sameSite = 'lax';\n }\n return cookieSettings;\n}\n\nexport { STORAGE_MANAGER_OPTIONS, getCookieSettings, getStorage };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { isHTTPS } from '../../features.js';\nimport 'tiny-emitter';\nimport { createBaseOptionsConstructor } from '../../base/options.js';\nimport { getCookieSettings, getStorage, STORAGE_MANAGER_OPTIONS } from './browser.js';\n\nfunction createStorageOptionsConstructor() {\n const BaseOptionsConstructor = createBaseOptionsConstructor();\n return class StorageOptionsConstructor extends BaseOptionsConstructor {\n constructor(args) {\n super(args);\n this.cookies = getCookieSettings(args, isHTTPS());\n this.storageUtil = args.storageUtil || getStorage();\n this.storageManager = Object.assign(Object.assign({}, STORAGE_MANAGER_OPTIONS), args.storageManager);\n }\n };\n}\n\nexport { createStorageOptionsConstructor };\n//# sourceMappingURL=StorageOptionsConstructor.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport crossFetch from 'cross-fetch';\n\nconst appJsonContentTypeRegex = /application\\/\\w*\\+?json/;\nfunction readData(response) {\n if (response.headers.get('Content-Type') &&\n response.headers.get('Content-Type').toLowerCase().indexOf('application/json') >= 0) {\n return response.json()\n .catch(e => {\n return {\n error: e,\n errorSummary: 'Could not parse server response'\n };\n });\n }\n else {\n return response.text();\n }\n}\nfunction formatResult(status, data, response) {\n const isObject = typeof data === 'object';\n const headers = {};\n for (const pair of response.headers.entries()) {\n headers[pair[0]] = pair[1];\n }\n const result = {\n responseText: isObject ? JSON.stringify(data) : data,\n status: status,\n headers\n };\n if (isObject) {\n result.responseType = 'json';\n result.responseJSON = data;\n }\n return result;\n}\nfunction fetchRequest(method, url, args) {\n var body = args.data;\n var headers = args.headers || {};\n var contentType = (headers['Content-Type'] || headers['content-type'] || '');\n if (body && typeof body !== 'string') {\n if (appJsonContentTypeRegex.test(contentType)) {\n body = JSON.stringify(body);\n }\n else if (contentType === 'application/x-www-form-urlencoded') {\n body = Object.entries(body)\n .map(([param, value]) => `${param}=${encodeURIComponent(value)}`)\n .join('&');\n }\n }\n var fetch = window.fetch || crossFetch;\n var fetchPromise = fetch(url, {\n method: method,\n headers: args.headers,\n body: body,\n credentials: args.withCredentials ? 'include' : 'omit'\n });\n if (!fetchPromise.finally) {\n fetchPromise = Promise.resolve(fetchPromise);\n }\n return fetchPromise.then(function (response) {\n var error = !response.ok;\n var status = response.status;\n return readData(response)\n .then(data => {\n return formatResult(status, data, response);\n })\n .then(result => {\n var _a;\n if (error || ((_a = result.responseJSON) === null || _a === void 0 ? void 0 : _a.error)) {\n throw result;\n }\n return result;\n });\n });\n}\n\nexport { fetchRequest as default };\n//# sourceMappingURL=fetchRequest.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createStorageOptionsConstructor } from '../storage/options/StorageOptionsConstructor.js';\nimport '../errors/WWWAuthError.js';\nimport fetchRequest from '../fetch/fetchRequest.js';\n\nfunction createHttpOptionsConstructor() {\n const StorageOptionsConstructor = createStorageOptionsConstructor();\n return class HttpOptionsConstructor extends StorageOptionsConstructor {\n constructor(args) {\n super(args);\n this.issuer = args.issuer;\n this.transformErrorXHR = args.transformErrorXHR;\n this.headers = args.headers;\n this.httpRequestClient = args.httpRequestClient || fetchRequest;\n this.httpRequestInterceptors = args.httpRequestInterceptors;\n }\n };\n}\n\nexport { createHttpOptionsConstructor };\n//# sourceMappingURL=options.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nconst enableSharedStorage = true;\n\nexport { enableSharedStorage };\n//# sourceMappingURL=browser.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { DEFAULT_MAX_CLOCK_SKEW } from '../../constants.js';\nimport { removeTrailingSlash, toAbsoluteUrl } from '../../util/url.js';\nimport { isBrowser } from '../../features.js';\nimport { createHttpOptionsConstructor } from '../../http/options.js';\nimport { enableSharedStorage } from './browser.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\n\nfunction assertValidConfig(args) {\n args = args || {};\n var scopes = args.scopes;\n if (scopes && !Array.isArray(scopes)) {\n throw new AuthSdkError('scopes must be a array of strings. ' +\n 'Required usage: new OktaAuth({scopes: [\"openid\", \"email\"]})');\n }\n var issuer = args.issuer;\n if (!issuer) {\n throw new AuthSdkError('No issuer passed to constructor. ' +\n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})');\n }\n var isUrlRegex = new RegExp('^http?s?://.+');\n if (!isUrlRegex.test(issuer)) {\n throw new AuthSdkError('Issuer must be a valid URL. ' +\n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com/oauth2/{authServerId}\"})');\n }\n if (issuer.indexOf('-admin.okta') !== -1) {\n throw new AuthSdkError('Issuer URL passed to constructor contains \"-admin\" in subdomain. ' +\n 'Required usage: new OktaAuth({issuer: \"https://{yourOktaDomain}.com})');\n }\n}\nfunction createOAuthOptionsConstructor() {\n const HttpOptionsConstructor = createHttpOptionsConstructor();\n return class OAuthOptionsConstructor extends HttpOptionsConstructor {\n constructor(options) {\n super(options);\n assertValidConfig(options);\n this.issuer = removeTrailingSlash(options.issuer);\n this.tokenUrl = removeTrailingSlash(options.tokenUrl);\n this.authorizeUrl = removeTrailingSlash(options.authorizeUrl);\n this.userinfoUrl = removeTrailingSlash(options.userinfoUrl);\n this.revokeUrl = removeTrailingSlash(options.revokeUrl);\n this.logoutUrl = removeTrailingSlash(options.logoutUrl);\n this.pkce = options.pkce === false ? false : true;\n this.clientId = options.clientId;\n this.redirectUri = options.redirectUri;\n if (isBrowser()) {\n this.redirectUri = toAbsoluteUrl(options.redirectUri, window.location.origin);\n }\n this.responseType = options.responseType;\n this.responseMode = options.responseMode;\n this.state = options.state;\n this.scopes = options.scopes;\n this.ignoreSignature = !!options.ignoreSignature;\n this.codeChallenge = options.codeChallenge;\n this.codeChallengeMethod = options.codeChallengeMethod;\n this.acrValues = options.acrValues;\n this.maxAge = options.maxAge;\n this.dpop = options.dpop === true;\n this.tokenManager = options.tokenManager;\n this.postLogoutRedirectUri = options.postLogoutRedirectUri;\n this.restoreOriginalUri = options.restoreOriginalUri;\n this.transactionManager = Object.assign({ enableSharedStorage }, options.transactionManager);\n this.clientSecret = options.clientSecret;\n this.setLocation = options.setLocation;\n this.ignoreLifetime = !!options.ignoreLifetime;\n if (!options.maxClockSkew && options.maxClockSkew !== 0) {\n this.maxClockSkew = DEFAULT_MAX_CLOCK_SKEW;\n }\n else {\n this.maxClockSkew = options.maxClockSkew;\n }\n }\n };\n}\n\nexport { createOAuthOptionsConstructor };\n//# sourceMappingURL=OAuthOptionsConstructor.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../errors/WWWAuthError.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport '../oidc/types/Token.js';\nimport { createOAuthOptionsConstructor } from '../oidc/options/OAuthOptionsConstructor.js';\n\nfunction createCoreOptionsConstructor() {\n const OAuthOptionsConstructor = createOAuthOptionsConstructor();\n return class CoreOptionsConstructor extends OAuthOptionsConstructor {\n constructor(options) {\n super(options);\n this.services = options.services;\n this.transformAuthState = options.transformAuthState;\n }\n };\n}\n\nexport { createCoreOptionsConstructor };\n//# sourceMappingURL=options.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createCoreOptionsConstructor } from '../core/options.js';\n\nfunction createIdxOptionsConstructor() {\n const CoreOptionsConstructor = createCoreOptionsConstructor();\n return class IdxOptionsConstructor extends CoreOptionsConstructor {\n constructor(options) {\n super(options);\n this.flow = options.flow;\n this.activationToken = options.activationToken;\n this.recoveryToken = options.recoveryToken;\n this.idx = options.idx;\n }\n };\n}\n\nexport { createIdxOptionsConstructor };\n//# sourceMappingURL=options.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\n\nclass SavedObject {\n constructor(storage, storageName) {\n if (!storage) {\n throw new AuthSdkError('\"storage\" is required');\n }\n if (typeof storageName !== 'string' || !storageName.length) {\n throw new AuthSdkError('\"storageName\" is required');\n }\n this.storageName = storageName;\n this.storageProvider = storage;\n }\n getItem(key) {\n return this.getStorage()[key];\n }\n setItem(key, value) {\n return this.updateStorage(key, value);\n }\n removeItem(key) {\n return this.clearStorage(key);\n }\n getStorage() {\n var storageString = this.storageProvider.getItem(this.storageName);\n storageString = storageString || '{}';\n try {\n return JSON.parse(storageString);\n }\n catch (e) {\n throw new AuthSdkError('Unable to parse storage string: ' + this.storageName);\n }\n }\n setStorage(obj) {\n try {\n var storageString = obj ? JSON.stringify(obj) : '{}';\n this.storageProvider.setItem(this.storageName, storageString);\n }\n catch (e) {\n throw new AuthSdkError('Unable to set storage: ' + this.storageName);\n }\n }\n clearStorage(key) {\n if (!key) {\n if (this.storageProvider.removeItem) {\n this.storageProvider.removeItem(this.storageName);\n }\n else {\n this.setStorage();\n }\n return;\n }\n var obj = this.getStorage();\n delete obj[key];\n this.setStorage(obj);\n }\n updateStorage(key, value) {\n var obj = this.getStorage();\n obj[key] = value;\n this.setStorage(obj);\n }\n}\n\nexport { SavedObject };\n//# sourceMappingURL=SavedObject.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { TOKEN_STORAGE_NAME, CACHE_STORAGE_NAME } from '../constants.js';\nimport { SavedObject } from './SavedObject.js';\nimport { isBrowser } from '../features.js';\nimport { warn } from '../util/console.js';\n\nfunction logServerSideMemoryStorageWarning(options) {\n if (!isBrowser() && !options.storageProvider && !options.storageKey) {\n warn('Memory storage can only support simple single user use case on server side, please provide custom storageProvider or storageKey if advanced scenarios need to be supported.');\n }\n}\nclass BaseStorageManager {\n constructor(storageManagerOptions, cookieOptions, storageUtil) {\n this.storageManagerOptions = storageManagerOptions;\n this.cookieOptions = cookieOptions;\n this.storageUtil = storageUtil;\n }\n getOptionsForSection(sectionName, overrideOptions) {\n return Object.assign({}, this.storageManagerOptions[sectionName], overrideOptions);\n }\n getStorage(options) {\n options = Object.assign({}, this.cookieOptions, options);\n if (options.storageProvider) {\n return options.storageProvider;\n }\n let { storageType, storageTypes } = options;\n if (storageType === 'sessionStorage') {\n options.sessionCookie = true;\n }\n if (storageType && storageTypes) {\n const idx = storageTypes.indexOf(storageType);\n if (idx >= 0) {\n storageTypes = storageTypes.slice(idx);\n storageType = undefined;\n }\n }\n if (!storageType) {\n storageType = this.storageUtil.findStorageType(storageTypes);\n }\n return this.storageUtil.getStorageByType(storageType, options);\n }\n getTokenStorage(options) {\n options = this.getOptionsForSection('token', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || TOKEN_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n getHttpCache(options) {\n options = this.getOptionsForSection('cache', options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || CACHE_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n}\n\nexport { BaseStorageManager, logServerSideMemoryStorageWarning };\n//# sourceMappingURL=BaseStorageManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { BaseStorageManager, logServerSideMemoryStorageWarning } from '../storage/BaseStorageManager.js';\nimport '../errors/WWWAuthError.js';\nimport { TRANSACTION_STORAGE_NAME, SHARED_TRANSACTION_STORAGE_NAME, ORIGINAL_URI_STORAGE_NAME } from '../constants.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport { SavedObject } from '../storage/SavedObject.js';\n\nfunction createOAuthStorageManager() {\n return class OAuthStorageManager extends BaseStorageManager {\n constructor(storageManagerOptions, cookieOptions, storageUtil) {\n super(storageManagerOptions, cookieOptions, storageUtil);\n }\n getTransactionStorage(options) {\n options = this.getOptionsForSection('transaction', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || TRANSACTION_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n getSharedTansactionStorage(options) {\n options = this.getOptionsForSection('shared-transaction', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || SHARED_TRANSACTION_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n getOriginalUriStorage(options) {\n options = this.getOptionsForSection('original-uri', options);\n logServerSideMemoryStorageWarning(options);\n const storage = this.getStorage(options);\n const storageKey = options.storageKey || ORIGINAL_URI_STORAGE_NAME;\n return new SavedObject(storage, storageKey);\n }\n };\n}\n\nexport { createOAuthStorageManager };\n//# sourceMappingURL=storage.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createOAuthStorageManager } from '../oidc/storage.js';\n\nfunction createCoreStorageManager() {\n return createOAuthStorageManager();\n}\n\nexport { createCoreStorageManager };\n//# sourceMappingURL=storage.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { warn } from '../util/console.js';\nimport { isBrowser } from '../features.js';\nimport { IDX_RESPONSE_STORAGE_NAME } from '../constants.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport { SavedObject } from '../storage/SavedObject.js';\nimport { createCoreStorageManager } from '../core/storage.js';\n\nfunction createIdxStorageManager() {\n const CoreStorageManager = createCoreStorageManager();\n return class IdxStorageManager extends CoreStorageManager {\n constructor(storageManagerOptions, cookieOptions, storageUtil) {\n super(storageManagerOptions, cookieOptions, storageUtil);\n }\n getIdxResponseStorage(options) {\n let storage;\n if (isBrowser()) {\n try {\n storage = this.storageUtil.getStorageByType('memory', options);\n }\n catch (e) {\n warn('No response storage found, you may want to provide custom implementation for intermediate idx responses to optimize the network traffic');\n }\n }\n else {\n const transactionStorage = this.getTransactionStorage(options);\n if (transactionStorage) {\n storage = {\n getItem: (key) => {\n const transaction = transactionStorage.getStorage();\n if (transaction && transaction[key]) {\n return transaction[key];\n }\n return null;\n },\n setItem: (key, val) => {\n const transaction = transactionStorage.getStorage();\n if (!transaction) {\n throw new AuthSdkError('Transaction has been cleared, failed to save idxState');\n }\n transaction[key] = val;\n transactionStorage.setStorage(transaction);\n },\n removeItem: (key) => {\n const transaction = transactionStorage.getStorage();\n if (!transaction) {\n return;\n }\n delete transaction[key];\n transactionStorage.setStorage(transaction);\n }\n };\n }\n }\n if (!storage) {\n return null;\n }\n return new SavedObject(storage, IDX_RESPONSE_STORAGE_NAME);\n }\n };\n}\n\nexport { createIdxStorageManager };\n//# sourceMappingURL=storage.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction isObjectWithProperties(obj) {\n if (!obj || typeof obj !== 'object' || Object.values(obj).length === 0) {\n return false;\n }\n return true;\n}\nfunction isOAuthTransactionMeta(obj) {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n return !!obj.redirectUri || !!obj.responseType;\n}\nfunction isPKCETransactionMeta(obj) {\n if (!isOAuthTransactionMeta(obj)) {\n return false;\n }\n return !!obj.codeVerifier;\n}\nfunction isIdxTransactionMeta(obj) {\n if (!isPKCETransactionMeta(obj)) {\n return false;\n }\n return !!obj.interactionHandle;\n}\nfunction isCustomAuthTransactionMeta(obj) {\n if (!isObjectWithProperties(obj)) {\n return false;\n }\n const isAllStringValues = Object.values(obj).find((value) => (typeof value !== 'string')) === undefined;\n return isAllStringValues;\n}\nfunction isTransactionMeta(obj) {\n if (isOAuthTransactionMeta(obj) || isCustomAuthTransactionMeta(obj)) {\n return true;\n }\n return false;\n}\n\nexport { isCustomAuthTransactionMeta, isIdxTransactionMeta, isOAuthTransactionMeta, isPKCETransactionMeta, isTransactionMeta };\n//# sourceMappingURL=Transaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport '../types/Token.js';\nimport { isTransactionMeta } from '../types/Transaction.js';\n\nconst MAX_ENTRY_LIFETIME = 30 * 60 * 1000;\nfunction pruneSharedStorage(storageManager) {\n const sharedStorage = storageManager.getSharedTansactionStorage();\n const entries = sharedStorage.getStorage();\n Object.keys(entries).forEach(state => {\n const entry = entries[state];\n const age = Date.now() - entry.dateCreated;\n if (age > MAX_ENTRY_LIFETIME) {\n delete entries[state];\n }\n });\n sharedStorage.setStorage(entries);\n}\nfunction saveTransactionToSharedStorage(storageManager, state, meta) {\n const sharedStorage = storageManager.getSharedTansactionStorage();\n const entries = sharedStorage.getStorage();\n entries[state] = {\n dateCreated: Date.now(),\n transaction: meta\n };\n sharedStorage.setStorage(entries);\n}\nfunction loadTransactionFromSharedStorage(storageManager, state) {\n const sharedStorage = storageManager.getSharedTansactionStorage();\n const entries = sharedStorage.getStorage();\n const entry = entries[state];\n if (entry && entry.transaction && isTransactionMeta(entry.transaction)) {\n return entry.transaction;\n }\n return null;\n}\nfunction clearTransactionFromSharedStorage(storageManager, state) {\n const sharedStorage = storageManager.getSharedTansactionStorage();\n const entries = sharedStorage.getStorage();\n delete entries[state];\n sharedStorage.setStorage(entries);\n}\n\nexport { clearTransactionFromSharedStorage, loadTransactionFromSharedStorage, pruneSharedStorage, saveTransactionToSharedStorage };\n//# sourceMappingURL=sharedStorage.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport './types/Token.js';\nimport { isTransactionMeta } from './types/Transaction.js';\nimport { warn } from '../util/console.js';\nimport { clearTransactionFromSharedStorage, saveTransactionToSharedStorage, pruneSharedStorage, loadTransactionFromSharedStorage } from './util/sharedStorage.js';\n\nfunction createTransactionManager() {\n return class TransactionManager {\n constructor(options) {\n this.storageManager = options.storageManager;\n this.enableSharedStorage = options.enableSharedStorage === false ? false : true;\n this.saveLastResponse = options.saveLastResponse === false ? false : true;\n this.options = options;\n }\n clear(options = {}) {\n const transactionStorage = this.storageManager.getTransactionStorage();\n const meta = transactionStorage.getStorage();\n transactionStorage.clearStorage();\n if (this.enableSharedStorage && options.clearSharedStorage !== false) {\n const state = options.state || (meta === null || meta === void 0 ? void 0 : meta.state);\n if (state) {\n clearTransactionFromSharedStorage(this.storageManager, state);\n }\n }\n }\n save(meta, options = {}) {\n let storage = this.storageManager.getTransactionStorage();\n const obj = storage.getStorage();\n if (isTransactionMeta(obj) && !options.muteWarning) {\n warn('a saved auth transaction exists in storage. This may indicate another auth flow is already in progress.');\n }\n storage.setStorage(meta);\n if (this.enableSharedStorage && meta.state) {\n saveTransactionToSharedStorage(this.storageManager, meta.state, meta);\n }\n }\n exists(options = {}) {\n try {\n const meta = this.load(options);\n return !!meta;\n }\n catch (_a) {\n return false;\n }\n }\n load(options = {}) {\n let meta;\n if (this.enableSharedStorage && options.state) {\n pruneSharedStorage(this.storageManager);\n meta = loadTransactionFromSharedStorage(this.storageManager, options.state);\n if (isTransactionMeta(meta)) {\n return meta;\n }\n }\n let storage = this.storageManager.getTransactionStorage();\n meta = storage.getStorage();\n if (isTransactionMeta(meta)) {\n return meta;\n }\n return null;\n }\n };\n}\n\nexport { createTransactionManager };\n//# sourceMappingURL=TransactionManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createTransactionManager } from '../oidc/TransactionManager.js';\nimport { isRawIdxResponse } from './types/idx-js.js';\n\nfunction createIdxTransactionManager() {\n const TransactionManager = createTransactionManager();\n return class IdxTransactionManager extends TransactionManager {\n constructor(options) {\n super(options);\n }\n clear(options = {}) {\n super.clear(options);\n if (options.clearIdxResponse !== false) {\n this.clearIdxResponse();\n }\n }\n saveIdxResponse(data) {\n if (!this.saveLastResponse) {\n return;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n if (!storage) {\n return;\n }\n storage.setStorage(data);\n }\n loadIdxResponse(options) {\n if (!this.saveLastResponse) {\n return null;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n if (!storage) {\n return null;\n }\n const storedValue = storage.getStorage();\n if (!storedValue || !isRawIdxResponse(storedValue.rawIdxResponse)) {\n return null;\n }\n if (options) {\n const { stateHandle, interactionHandle } = options;\n if (!options.useGenericRemediator && stateHandle && storedValue.stateHandle !== stateHandle) {\n return null;\n }\n if (interactionHandle && storedValue.interactionHandle !== interactionHandle) {\n return null;\n }\n }\n return storedValue;\n }\n clearIdxResponse() {\n if (!this.saveLastResponse) {\n return;\n }\n const storage = this.storageManager.getIdxResponseStorage();\n storage === null || storage === void 0 ? void 0 : storage.clearStorage();\n }\n };\n}\n\nexport { createIdxTransactionManager };\n//# sourceMappingURL=IdxTransactionManager.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { __rest } from '../../_virtual/_tslib.js';\n\nclass BaseTransaction {\n constructor(oktaAuth, options) {\n const { res } = options;\n const { headers } = res, rest = __rest(res, [\"headers\"]);\n if (headers) {\n this.headers = headers;\n }\n Object.keys(rest).forEach(key => {\n if (key === '_links') {\n return;\n }\n this[key] = rest[key];\n });\n }\n}\n\nexport { BaseTransaction as default };\n//# sourceMappingURL=Base.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport BaseTransaction from './transactions/Base.js';\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { httpRequest } from '../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\n\nasync function sendRequest(oktaAuth, options, TransactionClass = BaseTransaction) {\n const { accessToken: accessTokenObj } = oktaAuth.tokenManager.getTokensSync();\n const accessToken = options.accessToken || (accessTokenObj === null || accessTokenObj === void 0 ? void 0 : accessTokenObj.accessToken);\n const issuer = oktaAuth.getIssuerOrigin();\n const { url, method, payload } = options;\n const requestUrl = url.startsWith(issuer) ? url : `${issuer}${url}`;\n if (!accessToken) {\n throw new AuthSdkError('AccessToken is required to request MyAccount API endpoints.');\n }\n const res = await httpRequest(oktaAuth, Object.assign({ headers: { 'Accept': '*/*;okta-version=1.0.0' }, accessToken, url: requestUrl, method }, (payload && { args: payload })));\n let ret;\n if (Array.isArray(res)) {\n ret = res.map(item => new TransactionClass(oktaAuth, {\n res: item,\n accessToken\n }));\n }\n else {\n ret = new TransactionClass(oktaAuth, {\n res,\n accessToken\n });\n }\n return ret;\n}\nfunction generateRequestFnFromLinks({ oktaAuth, accessToken, methodName, links, }, TransactionClass = BaseTransaction) {\n for (const method of ['GET', 'POST', 'PUT', 'DELETE']) {\n if (method.toLowerCase() === methodName) {\n const link = links.self;\n return (async (payload) => sendRequest(oktaAuth, {\n accessToken,\n url: link.href,\n method,\n payload,\n }, TransactionClass));\n }\n }\n const link = links[methodName];\n if (!link) {\n throw new AuthSdkError(`No link is found with methodName: ${methodName}`);\n }\n return (async (payload) => sendRequest(oktaAuth, {\n accessToken,\n url: link.href,\n method: link.hints.allow[0],\n payload,\n }, TransactionClass));\n}\n\nexport { generateRequestFnFromLinks, sendRequest };\n//# sourceMappingURL=request.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport BaseTransaction from './Base.js';\n\nclass ProfileTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { createdAt, modifiedAt, profile } = options.res;\n this.createdAt = createdAt;\n this.modifiedAt = modifiedAt;\n this.profile = profile;\n }\n}\n\nexport { ProfileTransaction as default };\n//# sourceMappingURL=ProfileTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport BaseTransaction from './Base.js';\n\nclass ProfileSchemaTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n this.properties = options.res.properties;\n }\n}\n\nexport { ProfileSchemaTransaction as default };\n//# sourceMappingURL=ProfileSchemaTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nvar EmailRole;\n(function (EmailRole) {\n EmailRole[\"PRIMARY\"] = \"PRIMARY\";\n EmailRole[\"SECONDARY\"] = \"SECONDARY\";\n})(EmailRole || (EmailRole = {}));\nvar Status;\n(function (Status) {\n Status[\"VERIFIED\"] = \"VERIFIED\";\n Status[\"UNVERIFIED\"] = \"UNVERIFIED\";\n})(Status || (Status = {}));\nvar PasswordStatus;\n(function (PasswordStatus) {\n PasswordStatus[\"NOT_ENROLLED\"] = \"NOT_ENROLLED\";\n PasswordStatus[\"ACTIVE\"] = \"ACTIVE\";\n})(PasswordStatus || (PasswordStatus = {}));\n\nexport { EmailRole, PasswordStatus, Status };\n//# sourceMappingURL=types.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { sendRequest } from './request.js';\nimport ProfileTransaction from './transactions/ProfileTransaction.js';\nimport ProfileSchemaTransaction from './transactions/ProfileSchemaTransaction.js';\nimport './types.js';\n\nconst getProfile = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/profile',\n method: 'GET',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken,\n }, ProfileTransaction);\n return transaction;\n};\nconst updateProfile = async (oktaAuth, options) => {\n const { payload, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/profile',\n method: 'PUT',\n payload,\n accessToken,\n }, ProfileTransaction);\n return transaction;\n};\nconst getProfileSchema = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/profile/schema',\n method: 'GET',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken,\n }, ProfileSchemaTransaction);\n return transaction;\n};\n\nexport { getProfile, getProfileSchema, updateProfile };\n//# sourceMappingURL=profileApi.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport BaseTransaction from './Base.js';\n\nclass EmailStatusTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { res } = options;\n const { id, profile, expiresAt, status } = res;\n this.id = id;\n this.expiresAt = expiresAt;\n this.profile = profile;\n this.status = status;\n }\n}\n\nexport { EmailStatusTransaction as default };\n//# sourceMappingURL=EmailStatusTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport EmailStatusTransaction from './EmailStatusTransaction.js';\nimport BaseTransaction from './Base.js';\nimport { generateRequestFnFromLinks } from '../request.js';\n\nclass EmailChallengeTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { accessToken, res } = options;\n const { id, expiresAt, profile, status, _links } = res;\n this.id = id;\n this.expiresAt = expiresAt;\n this.profile = profile;\n this.status = status;\n this.poll = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'poll',\n links: _links,\n }, EmailStatusTransaction);\n return await fn();\n };\n this.verify = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'verify',\n links: _links,\n }, EmailChallengeTransaction);\n return await fn(payload);\n };\n }\n}\n\nexport { EmailChallengeTransaction as default };\n//# sourceMappingURL=EmailChallengeTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport EmailChallengeTransaction from './EmailChallengeTransaction.js';\nimport EmailStatusTransaction from './EmailStatusTransaction.js';\nimport BaseTransaction from './Base.js';\nimport { generateRequestFnFromLinks } from '../request.js';\n\nclass EmailTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { accessToken, res } = options;\n const { id, profile, roles, status, _links } = res;\n this.id = id;\n this.profile = profile;\n this.roles = roles;\n this.status = status;\n this.get = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'get',\n links: _links,\n }, EmailTransaction);\n return await fn();\n };\n this.delete = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'delete',\n links: _links\n });\n return await fn();\n };\n this.challenge = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'challenge',\n links: _links,\n }, EmailChallengeTransaction);\n return await fn();\n };\n if (_links.poll) {\n this.poll = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'poll',\n links: _links,\n }, EmailStatusTransaction);\n return await fn();\n };\n }\n if (_links.verify) {\n this.verify = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'verify',\n links: _links,\n });\n return await fn(payload);\n };\n }\n }\n}\n\nexport { EmailTransaction as default };\n//# sourceMappingURL=EmailTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { sendRequest } from './request.js';\nimport EmailTransaction from './transactions/EmailTransaction.js';\nimport EmailChallengeTransaction from './transactions/EmailChallengeTransaction.js';\nimport './types.js';\n\nconst getEmails = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/emails',\n method: 'GET',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken\n }, EmailTransaction);\n return transaction;\n};\nconst getEmail = async (oktaAuth, options) => {\n const { id, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/emails/${id}`,\n method: 'GET',\n accessToken,\n }, EmailTransaction);\n return transaction;\n};\nconst addEmail = async (oktaAuth, options) => {\n const { accessToken, payload } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/emails',\n method: 'POST',\n payload,\n accessToken,\n }, EmailTransaction);\n return transaction;\n};\nconst deleteEmail = async (oktaAuth, options) => {\n const { id, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/emails/${id}`,\n method: 'DELETE',\n accessToken\n });\n return transaction;\n};\nconst sendEmailChallenge = async (oktaAuth, options) => {\n const { id, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/emails/${id}/challenge`,\n method: 'POST',\n accessToken,\n }, EmailChallengeTransaction);\n return transaction;\n};\nconst getEmailChallenge = async (oktaAuth, options) => {\n const { emailId, challengeId, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/emails/${emailId}/challenge/${challengeId}`,\n method: 'POST',\n accessToken,\n }, EmailChallengeTransaction);\n return transaction;\n};\nconst verifyEmailChallenge = async (oktaAuth, options) => {\n const { emailId, challengeId, payload, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/emails/${emailId}/challenge/${challengeId}/verify`,\n method: 'POST',\n payload,\n accessToken\n });\n return transaction;\n};\n\nexport { addEmail, deleteEmail, getEmail, getEmailChallenge, getEmails, sendEmailChallenge, verifyEmailChallenge };\n//# sourceMappingURL=emailApi.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport BaseTransaction from './Base.js';\nimport { generateRequestFnFromLinks } from '../request.js';\n\nclass PhoneTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { res, accessToken } = options;\n const { id, profile, status, _links } = res;\n this.id = id;\n this.profile = profile;\n this.status = status;\n this.get = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'get',\n links: _links,\n }, PhoneTransaction);\n return await fn();\n };\n this.delete = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'delete',\n links: _links\n });\n return await fn();\n };\n this.challenge = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'challenge',\n links: _links\n });\n return await fn(payload);\n };\n if (_links.verify) {\n this.verify = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'verify',\n links: _links\n });\n return await fn(payload);\n };\n }\n }\n}\n\nexport { PhoneTransaction as default };\n//# sourceMappingURL=PhoneTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { sendRequest } from './request.js';\nimport PhoneTransaction from './transactions/PhoneTransaction.js';\nimport './types.js';\n\nconst getPhones = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/phones',\n method: 'GET',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken,\n }, PhoneTransaction);\n return transaction;\n};\nconst getPhone = async (oktaAuth, options) => {\n const { accessToken, id } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/phones/${id}`,\n method: 'GET',\n accessToken,\n }, PhoneTransaction);\n return transaction;\n};\nconst addPhone = async (oktaAuth, options) => {\n const { accessToken, payload } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/phones',\n method: 'POST',\n payload,\n accessToken,\n }, PhoneTransaction);\n return transaction;\n};\nconst deletePhone = async (oktaAuth, options) => {\n const { id, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/phones/${id}`,\n method: 'DELETE',\n accessToken,\n });\n return transaction;\n};\nconst sendPhoneChallenge = async (oktaAuth, options) => {\n const { accessToken, id, payload } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/phones/${id}/challenge`,\n method: 'POST',\n payload,\n accessToken\n });\n return transaction;\n};\nconst verifyPhoneChallenge = async (oktaAuth, options) => {\n const { id, payload, accessToken } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/phones/${id}/verify`,\n method: 'POST',\n payload,\n accessToken\n });\n return transaction;\n};\n\nexport { addPhone, deletePhone, getPhone, getPhones, sendPhoneChallenge, verifyPhoneChallenge };\n//# sourceMappingURL=phoneApi.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { PasswordStatus } from '../types.js';\nimport BaseTransaction from './Base.js';\nimport { generateRequestFnFromLinks } from '../request.js';\n\nclass PasswordTransaction extends BaseTransaction {\n constructor(oktaAuth, options) {\n super(oktaAuth, options);\n const { res, accessToken } = options;\n const { id, status, created, lastUpdated, _links } = res;\n this.id = id;\n this.status = status;\n this.created = created;\n this.lastUpdated = lastUpdated;\n if (this.status == PasswordStatus.NOT_ENROLLED) {\n this.enroll = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'enroll',\n links: _links,\n }, PasswordTransaction);\n return await fn(payload);\n };\n }\n else {\n this.get = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'get',\n links: _links,\n }, PasswordTransaction);\n return await fn();\n };\n this.update = async (payload) => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'put',\n links: _links,\n }, PasswordTransaction);\n return await fn(payload);\n };\n this.delete = async () => {\n const fn = generateRequestFnFromLinks({\n oktaAuth,\n accessToken,\n methodName: 'delete',\n links: _links\n });\n return await fn();\n };\n }\n }\n}\n\nexport { PasswordTransaction as default };\n//# sourceMappingURL=PasswordTransaction.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { sendRequest } from './request.js';\nimport PasswordTransaction from './transactions/PasswordTransaction.js';\n\nconst getPassword = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/password`,\n method: 'GET',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken,\n }, PasswordTransaction);\n return transaction;\n};\nconst enrollPassword = async (oktaAuth, options) => {\n const { accessToken, payload } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/password',\n method: 'POST',\n payload,\n accessToken,\n }, PasswordTransaction);\n return transaction;\n};\nconst updatePassword = async (oktaAuth, options) => {\n const { accessToken, payload } = options;\n const transaction = await sendRequest(oktaAuth, {\n url: '/idp/myaccount/password',\n method: 'PUT',\n payload,\n accessToken,\n }, PasswordTransaction);\n return transaction;\n};\nconst deletePassword = async (oktaAuth, options) => {\n const transaction = await sendRequest(oktaAuth, {\n url: `/idp/myaccount/password`,\n method: 'DELETE',\n accessToken: options === null || options === void 0 ? void 0 : options.accessToken,\n });\n return transaction;\n};\n\nexport { deletePassword, enrollPassword, getPassword, updatePassword };\n//# sourceMappingURL=passwordApi.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { getProfile, getProfileSchema, updateProfile } from './profileApi.js';\nexport { addEmail, deleteEmail, getEmail, getEmailChallenge, getEmails, sendEmailChallenge, verifyEmailChallenge } from './emailApi.js';\nexport { addPhone, deletePhone, getPhone, getPhones, sendPhoneChallenge, verifyPhoneChallenge } from './phoneApi.js';\nexport { deletePassword, enrollPassword, getPassword, updatePassword } from './passwordApi.js';\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport * as api from './api.js';\n\nfunction mixinMyAccount(Base) {\n return class OktaAuthMyAccount extends Base {\n constructor(...args) {\n super(...args);\n this.myaccount = Object.entries(api)\n .filter(([name]) => name !== 'default')\n .reduce((acc, [name, fn]) => {\n acc[name] = fn.bind(null, this);\n return acc;\n }, {});\n }\n };\n}\n\nexport { mixinMyAccount };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nfunction addStateToken(res, options) {\n var builtArgs = {};\n Object.assign(builtArgs, options);\n if (!builtArgs.stateToken && res.stateToken) {\n builtArgs.stateToken = res.stateToken;\n }\n return builtArgs;\n}\nfunction getStateToken(res) {\n return addStateToken(res);\n}\n\nexport { addStateToken, getStateToken };\n//# sourceMappingURL=stateToken.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthSdkError from '../errors/AuthSdkError.js';\nimport '../errors/WWWAuthError.js';\nimport { post } from '../http/request.js';\nimport { STATE_TOKEN_KEY_NAME } from '../constants.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { addStateToken } from './util/stateToken.js';\n\nfunction transactionStatus(sdk, args) {\n args = addStateToken(sdk, args);\n return post(sdk, sdk.getIssuerOrigin() + '/api/v1/authn', args, { withCredentials: true });\n}\nfunction resumeTransaction(sdk, tx, args) {\n if (!args || !args.stateToken) {\n var stateToken = getSavedStateToken(sdk);\n if (stateToken) {\n args = {\n stateToken: stateToken\n };\n }\n else {\n return Promise.reject(new AuthSdkError('No transaction to resume'));\n }\n }\n return transactionStatus(sdk, args)\n .then(function (res) {\n return tx.createTransaction(res);\n });\n}\nfunction introspectAuthn(sdk, tx, args) {\n if (!args || !args.stateToken) {\n var stateToken = getSavedStateToken(sdk);\n if (stateToken) {\n args = {\n stateToken: stateToken\n };\n }\n else {\n return Promise.reject(new AuthSdkError('No transaction to evaluate'));\n }\n }\n return transactionStep(sdk, args)\n .then(function (res) {\n return tx.createTransaction(res);\n });\n}\nfunction transactionStep(sdk, args) {\n args = addStateToken(sdk, args);\n return post(sdk, sdk.getIssuerOrigin() + '/api/v1/authn/introspect', args, { withCredentials: true });\n}\nfunction transactionExists(sdk) {\n return !!getSavedStateToken(sdk);\n}\nfunction postToTransaction(sdk, tx, url, args, options) {\n options = Object.assign({ withCredentials: true }, options);\n return post(sdk, url, args, options)\n .then(function (res) {\n return tx.createTransaction(res);\n });\n}\nfunction getSavedStateToken(sdk) {\n const storage = sdk.options.storageUtil.storage;\n return storage.get(STATE_TOKEN_KEY_NAME);\n}\n\nexport { getSavedStateToken, introspectAuthn, postToTransaction, resumeTransaction, transactionExists, transactionStatus, transactionStep };\n//# sourceMappingURL=api.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { find, omit } from '../../util/object.js';\nimport { toQueryString } from '../../util/url.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { get } from '../../http/request.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { postToTransaction } from '../api.js';\nimport { addStateToken } from './stateToken.js';\n\nfunction link2fn(sdk, tx, res, obj, link, ref) {\n if (Array.isArray(link)) {\n return function (name, opts) {\n if (!name) {\n throw new AuthSdkError('Must provide a link name');\n }\n var lk = find(link, { name: name });\n if (!lk) {\n throw new AuthSdkError('No link found for that name');\n }\n return link2fn(sdk, tx, res, obj, lk, ref)(opts);\n };\n }\n else if (link.hints &&\n link.hints.allow &&\n link.hints.allow.length === 1) {\n var method = link.hints.allow[0];\n switch (method) {\n case 'GET':\n return function () {\n return get(sdk, link.href, { withCredentials: true });\n };\n case 'POST':\n return function (opts) {\n if (ref && ref.isPolling) {\n ref.isPolling = false;\n }\n var data = addStateToken(res, opts);\n if (res.status === 'MFA_ENROLL' || res.status === 'FACTOR_ENROLL') {\n Object.assign(data, {\n factorType: obj.factorType,\n provider: obj.provider\n });\n }\n var params = {};\n var autoPush = data.autoPush;\n if (autoPush !== undefined) {\n if (typeof autoPush === 'function') {\n try {\n params.autoPush = !!autoPush();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('AutoPush resulted in an error.'));\n }\n }\n else if (autoPush !== null) {\n params.autoPush = !!autoPush;\n }\n data = omit(data, 'autoPush');\n }\n var rememberDevice = data.rememberDevice;\n if (rememberDevice !== undefined) {\n if (typeof rememberDevice === 'function') {\n try {\n params.rememberDevice = !!rememberDevice();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('RememberDevice resulted in an error.'));\n }\n }\n else if (rememberDevice !== null) {\n params.rememberDevice = !!rememberDevice;\n }\n data = omit(data, 'rememberDevice');\n }\n else if (data.profile &&\n data.profile.updatePhone !== undefined) {\n if (data.profile.updatePhone) {\n params.updatePhone = true;\n }\n data.profile = omit(data.profile, 'updatePhone');\n }\n var href = link.href + toQueryString(params);\n return postToTransaction(sdk, tx, href, data);\n };\n }\n }\n}\n\nexport { link2fn };\n//# sourceMappingURL=link2fn.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport CustomError from './CustomError.js';\n\nclass AuthPollStopError extends CustomError {\n constructor() {\n const message = 'The poll was stopped by the sdk';\n super(message);\n }\n}\n\nexport { AuthPollStopError as default };\n//# sourceMappingURL=AuthPollStopError.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport AuthPollStopError from '../../errors/AuthPollStopError.js';\nimport AuthSdkError from '../../errors/AuthSdkError.js';\nimport '../../errors/WWWAuthError.js';\nimport { delay } from '../../util/misc.js';\nimport { getLink } from '../../util/object.js';\nimport { isNumber, isObject } from '../../util/types.js';\nimport { toQueryString } from '../../util/url.js';\nimport { post } from '../../http/request.js';\nimport { DEFAULT_POLLING_DELAY } from '../../constants.js';\nimport 'tiny-emitter';\nimport 'js-cookie';\nimport 'cross-fetch';\nimport { getStateToken } from './stateToken.js';\n\nfunction getPollFn(sdk, res, ref) {\n return function (options) {\n var delay$1;\n var rememberDevice;\n var autoPush;\n var transactionCallBack;\n if (isNumber(options)) {\n delay$1 = options;\n }\n else if (isObject(options)) {\n options = options;\n delay$1 = options.delay;\n rememberDevice = options.rememberDevice;\n autoPush = options.autoPush;\n transactionCallBack = options.transactionCallBack;\n }\n if (!delay$1 && delay$1 !== 0) {\n delay$1 = DEFAULT_POLLING_DELAY;\n }\n var pollLink = getLink(res, 'next', 'poll');\n function pollFn() {\n var opts = {};\n if (typeof autoPush === 'function') {\n try {\n opts.autoPush = !!autoPush();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('AutoPush resulted in an error.'));\n }\n }\n else if (autoPush !== undefined && autoPush !== null) {\n opts.autoPush = !!autoPush;\n }\n if (typeof rememberDevice === 'function') {\n try {\n opts.rememberDevice = !!rememberDevice();\n }\n catch (e) {\n return Promise.reject(new AuthSdkError('RememberDevice resulted in an error.'));\n }\n }\n else if (rememberDevice !== undefined && rememberDevice !== null) {\n opts.rememberDevice = !!rememberDevice;\n }\n var href = pollLink.href + toQueryString(opts);\n return post(sdk, href, getStateToken(res), {\n saveAuthnState: false,\n withCredentials: true\n });\n }\n ref.isPolling = true;\n var retryCount = 0;\n var recursivePoll = function () {\n if (!ref.isPolling) {\n return Promise.reject(new AuthPollStopError());\n }\n return pollFn()\n .then(function (pollRes) {\n retryCount = 0;\n if (pollRes.factorResult && pollRes.factorResult === 'WAITING') {\n if (!ref.isPolling) {\n throw new AuthPollStopError();\n }\n if (typeof transactionCallBack === 'function') {\n transactionCallBack(pollRes);\n }\n return delay(delay$1).then(recursivePoll);\n }\n else {\n ref.isPolling = false;\n return sdk.tx.createTransaction(pollRes);\n }\n })\n .catch(function (err) {\n if (err.xhr &&\n (err.xhr.status === 0 || err.xhr.status === 429) &&\n retryCount <= 4) {\n var delayLength = Math.pow(2, retryCount) * 1000;\n retryCount++;\n return delay(delayLength)\n .then(recursivePoll);\n }\n throw err;\n });\n };\n return recursivePoll()\n .catch(function (err) {\n ref.isPolling = false;\n throw err;\n });\n };\n}\n\nexport { getPollFn };\n//# sourceMappingURL=poll.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { link2fn } from './link2fn.js';\nimport { getPollFn } from './poll.js';\n\nfunction links2fns(sdk, tx, res, obj, ref) {\n var fns = {};\n for (var linkName in obj._links) {\n if (!Object.prototype.hasOwnProperty.call(obj._links, linkName)) {\n continue;\n }\n var link = obj._links[linkName];\n if (linkName === 'next') {\n linkName = link.name;\n }\n if (link.type) {\n fns[linkName] = link;\n continue;\n }\n switch (linkName) {\n case 'poll':\n fns.poll = getPollFn(sdk, res, ref);\n break;\n default:\n var fn = link2fn(sdk, tx, res, obj, link, ref);\n if (fn) {\n fns[linkName] = fn;\n }\n }\n }\n return fns;\n}\n\nexport { links2fns };\n//# sourceMappingURL=links2fns.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { clone, omit } from '../../util/object.js';\nimport { isObject } from '../../util/types.js';\nimport { links2fns } from './links2fns.js';\n\nfunction flattenEmbedded(sdk, tx, res, obj, ref) {\n obj = obj || res;\n obj = clone(obj);\n if (Array.isArray(obj)) {\n var objArr = [];\n for (var o = 0, ol = obj.length; o < ol; o++) {\n objArr.push(flattenEmbedded(sdk, tx, res, obj[o], ref));\n }\n return objArr;\n }\n var embedded = obj._embedded || {};\n for (var key in embedded) {\n if (!Object.prototype.hasOwnProperty.call(embedded, key)) {\n continue;\n }\n if (isObject(embedded[key]) || Array.isArray(embedded[key])) {\n embedded[key] = flattenEmbedded(sdk, tx, res, embedded[key], ref);\n }\n }\n var fns = links2fns(sdk, tx, res, obj, ref);\n Object.assign(embedded, fns);\n obj = omit(obj, '_embedded', '_links');\n Object.assign(obj, embedded);\n return obj;\n}\n\nexport { flattenEmbedded };\n//# sourceMappingURL=flattenEmbedded.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { flattenEmbedded } from './util/flattenEmbedded.js';\n\nclass AuthnTransactionImpl {\n constructor(sdk, tx, res = null) {\n this.data = undefined;\n this.status = undefined;\n if (res) {\n this.data = res;\n Object.assign(this, flattenEmbedded(sdk, tx, res, res, {}));\n delete this.stateToken;\n if (res.status === 'RECOVERY_CHALLENGE' && !res._links) {\n this.cancel = function () {\n return Promise.resolve(tx.createTransaction());\n };\n }\n }\n }\n}\n\nexport { AuthnTransactionImpl };\n//# sourceMappingURL=AuthnTransactionImpl.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { transactionStatus, resumeTransaction, transactionExists, introspectAuthn, postToTransaction } from './api.js';\nimport { AuthnTransactionImpl } from './AuthnTransactionImpl.js';\n\nfunction createAuthnTransactionAPI(sdk) {\n const tx = {\n status: transactionStatus.bind(null, sdk),\n resume(args) {\n return resumeTransaction(sdk, tx, args);\n },\n exists: transactionExists.bind(null, sdk),\n introspect(args) {\n return introspectAuthn(sdk, tx, args);\n },\n createTransaction: (res) => {\n return new AuthnTransactionImpl(sdk, tx, res);\n },\n postToTransaction: (url, args, options) => {\n return postToTransaction(sdk, tx, url, args, options);\n }\n };\n return tx;\n}\n\nexport { createAuthnTransactionAPI };\n//# sourceMappingURL=factory.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { clone } from '../util/object.js';\nimport fingerprint from '../browser/fingerprint.js';\nimport { createAuthnTransactionAPI } from './factory.js';\n\nfunction mixinAuthn(Base) {\n return class OktaAuthTx extends Base {\n constructor(...args) {\n super(...args);\n this.authn = this.tx = createAuthnTransactionAPI(this);\n this.fingerprint = fingerprint.bind(null, this);\n }\n async signIn(opts) {\n opts = clone(opts || {});\n const _postToTransaction = (options) => {\n delete opts.sendFingerprint;\n return this.tx.postToTransaction('/api/v1/authn', opts, options);\n };\n if (!opts.sendFingerprint) {\n return _postToTransaction();\n }\n return this.fingerprint()\n .then(function (fingerprint) {\n return _postToTransaction({\n headers: {\n 'X-Device-Fingerprint': fingerprint\n }\n });\n });\n }\n async signInWithCredentials(opts) {\n return this.signIn(opts);\n }\n forgotPassword(opts) {\n return this.tx.postToTransaction('/api/v1/authn/recovery/password', opts);\n }\n unlockAccount(opts) {\n return this.tx.postToTransaction('/api/v1/authn/recovery/unlock', opts);\n }\n verifyRecoveryToken(opts) {\n return this.tx.postToTransaction('/api/v1/authn/recovery/token', opts);\n }\n };\n}\n\nexport { mixinAuthn };\n//# sourceMappingURL=mixin.js.map\n","/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { authenticate } from '../../idx/authenticate.js';\nexport { cancel } from '../../idx/cancel.js';\nexport { handleEmailVerifyCallback, isEmailVerifyCallback, isEmailVerifyCallbackError, parseEmailVerifyCallback } from '../../idx/emailVerify.js';\nexport { interact } from '../../idx/interact.js';\nexport { introspect } from '../../idx/introspect.js';\nexport { poll } from '../../idx/poll.js';\nexport { canProceed, proceed } from '../../idx/proceed.js';\nexport { register } from '../../idx/register.js';\nexport { recoverPassword } from '../../idx/recoverPassword.js';\nexport { handleInteractionCodeRedirect } from '../../idx/handleInteractionCodeRedirect.js';\nexport { startTransaction } from '../../idx/startTransaction.js';\nexport { unlockAccount } from '../../idx/unlockAccount.js';\nexport { clearTransactionMeta, createTransactionMeta, getSavedTransactionMeta, getTransactionMeta, hasSavedInteractionHandle, isTransactionMetaValid, isTransactionMetaValidForFlow, isTransactionMetaValidForOptions, saveTransactionMeta } from '../../idx/transactionMeta.js';\nexport { createIdxAPI } from '../../idx/factory/api.js';\nimport { createOktaAuthIdx } from '../../idx/factory/OktaAuthIdx.js';\nexport { createOktaAuthIdx } from '../../idx/factory/OktaAuthIdx.js';\nexport { createMinimalOktaAuthIdx } from '../../idx/factory/MinimalOktaAuthIdx.js';\nexport { mixinIdx } from '../../idx/mixin.js';\nimport { createIdxOptionsConstructor } from '../../idx/options.js';\nexport { createIdxOptionsConstructor } from '../../idx/options.js';\nimport { createIdxStorageManager } from '../../idx/storage.js';\nexport { createIdxStorageManager } from '../../idx/storage.js';\nexport { AuthenticatorKey, IdxFeature, IdxStatus, isAuthenticator } from '../../idx/types/api.js';\nimport { createIdxTransactionManager } from '../../idx/IdxTransactionManager.js';\nexport { createIdxTransactionManager } from '../../idx/IdxTransactionManager.js';\nexport { getProfile, getProfileSchema, updateProfile } from '../../myaccount/profileApi.js';\nexport { addEmail, deleteEmail, getEmail, getEmailChallenge, getEmails, sendEmailChallenge, verifyEmailChallenge } from '../../myaccount/emailApi.js';\nexport { addPhone, deletePhone, getPhone, getPhones, sendPhoneChallenge, verifyPhoneChallenge } from '../../myaccount/phoneApi.js';\nexport { deletePassword, enrollPassword, getPassword, updatePassword } from '../../myaccount/passwordApi.js';\nexport { createOktaAuthMyAccount } from '../../myaccount/factory.js';\nimport { mixinMyAccount } from '../../myaccount/mixin.js';\nexport { mixinMyAccount } from '../../myaccount/mixin.js';\nexport { EmailRole, PasswordStatus, Status } from '../../myaccount/types.js';\nexport { createAuthnTransactionAPI } from '../../authn/factory.js';\nimport { mixinAuthn } from '../../authn/mixin.js';\nexport { mixinAuthn } from '../../authn/mixin.js';\nimport * as index from '../../crypto/index.js';\nexport { index as crypto };\nexport { createOktaAuthBase } from '../../base/factory.js';\nexport { createBaseOptionsConstructor } from '../../base/options.js';\nexport { ACCESS_TOKEN_STORAGE_KEY, CACHE_STORAGE_NAME, DEFAULT_CACHE_DURATION, DEFAULT_CODE_CHALLENGE_METHOD, DEFAULT_MAX_CLOCK_SKEW, DEFAULT_POLLING_DELAY, IDX_API_VERSION, IDX_RESPONSE_STORAGE_NAME, ID_TOKEN_STORAGE_KEY, MAX_VERIFIER_LENGTH, MIN_VERIFIER_LENGTH, ORIGINAL_URI_STORAGE_NAME, PKCE_STORAGE_NAME, REFERRER_PATH_STORAGE_KEY, REFRESH_TOKEN_STORAGE_KEY, SHARED_TRANSACTION_STORAGE_NAME, STATE_TOKEN_KEY_NAME, TOKEN_STORAGE_NAME, TRANSACTION_STORAGE_NAME } from '../../constants.js';\nexport { AuthStateManager, INITIAL_AUTH_STATE } from '../../core/AuthStateManager.js';\nexport { createCoreOptionsConstructor } from '../../core/options.js';\nexport { createOktaAuthCore } from '../../core/factory.js';\nexport { mixinCore } from '../../core/mixin.js';\nexport { createCoreStorageManager } from '../../core/storage.js';\nexport { ServiceManager } from '../../core/ServiceManager/browser.js';\nexport { isAuthApiError, isOAuthError, isWWWAuthError } from '../../errors/index.js';\nexport { setRequestHeader } from '../../http/headers.js';\nexport { OktaUserAgent } from '../../http/OktaUserAgent.js';\nexport { get, httpRequest, post } from '../../http/request.js';\nexport { mixinHttp } from '../../http/mixin.js';\nexport { createHttpOptionsConstructor } from '../../http/options.js';\nexport { createEndpoints, createTokenAPI } from '../../oidc/factory/api.js';\nexport { createOktaAuthOAuth } from '../../oidc/factory/OktaAuthOAuth.js';\nexport { mixinOAuth } from '../../oidc/mixin/index.js';\nexport { createOAuthStorageManager } from '../../oidc/storage.js';\nexport { buildAuthorizeParams, convertTokenParamsToOAuthParams } from '../../oidc/endpoints/authorize.js';\nexport { postRefreshToken, postToTokenEndpoint } from '../../oidc/endpoints/token.js';\nexport { getKey, getWellKnown } from '../../oidc/endpoints/well-known.js';\nexport { createOAuthOptionsConstructor } from '../../oidc/options/OAuthOptionsConstructor.js';\nexport { TokenKind, isAccessToken, isIDToken, isRefreshToken, isToken } from '../../oidc/types/Token.js';\nexport { EVENT_ADDED, EVENT_ERROR, EVENT_EXPIRED, EVENT_REMOVED, EVENT_RENEWED, EVENT_SET_STORAGE } from '../../oidc/types/TokenManager.js';\nexport { isCustomAuthTransactionMeta, isIdxTransactionMeta, isOAuthTransactionMeta, isPKCETransactionMeta, isTransactionMeta } from '../../oidc/types/Transaction.js';\nexport { TokenManager } from '../../oidc/TokenManager.js';\nexport { createTransactionManager } from '../../oidc/TransactionManager.js';\nexport { addListener, addPostMessageListener, loadFrame, loadPopup, removeListener } from '../../oidc/util/browser.js';\nexport { getDefaultTokenParams } from '../../oidc/util/defaultTokenParams.js';\nexport { getDefaultEnrollAuthenticatorParams } from '../../oidc/util/defaultEnrollAuthenticatorParams.js';\nexport { isAuthorizationCodeError, isInteractionRequiredError, isRefreshTokenInvalidError } from '../../oidc/util/errors.js';\nexport { getHashOrSearch, hasAuthorizationCode, hasErrorInUrl, hasInteractionCode, hasResponseType, hasTokensInHash, isCodeFlow, isInteractionRequired, isLoginRedirect, isRedirectUri } from '../../oidc/util/loginRedirect.js';\nexport { generateNonce, generateState, getOAuthBaseUrl, getOAuthDomain, getOAuthUrls } from '../../oidc/util/oauth.js';\nexport { createOAuthMeta } from '../../oidc/util/oauthMeta.js';\nexport { createEnrollAuthenticatorMeta } from '../../oidc/util/enrollAuthenticatorMeta.js';\nexport { default as pkce } from '../../oidc/util/pkce.js';\nexport { assertPKCESupport, preparePKCE, prepareTokenParams, validateCodeChallengeMethod } from '../../oidc/util/prepareTokenParams.js';\nexport { prepareEnrollAuthenticatorParams } from '../../oidc/util/prepareEnrollAuthenticatorParams.js';\nexport { isRefreshTokenError, isSameRefreshToken } from '../../oidc/util/refreshToken.js';\nexport { urlParamsToObject } from '../../oidc/util/urlParams.js';\nexport { validateClaims } from '../../oidc/util/validateClaims.js';\nexport { validateToken } from '../../oidc/util/validateToken.js';\nexport { decodeToken } from '../../oidc/decodeToken.js';\nexport { revokeToken } from '../../oidc/revokeToken.js';\nexport { renewToken } from '../../oidc/renewToken.js';\nexport { renewTokensWithRefresh } from '../../oidc/renewTokensWithRefresh.js';\nexport { renewTokens } from '../../oidc/renewTokens.js';\nexport { verifyToken } from '../../oidc/verifyToken.js';\nexport { getUserInfo } from '../../oidc/getUserInfo.js';\nexport { handleOAuthResponse } from '../../oidc/handleOAuthResponse.js';\nexport { exchangeCodeForTokens } from '../../oidc/exchangeCodeForTokens.js';\nexport { getToken } from '../../oidc/getToken.js';\nexport { getWithoutPrompt } from '../../oidc/getWithoutPrompt.js';\nexport { getWithPopup } from '../../oidc/getWithPopup.js';\nexport { getWithRedirect } from '../../oidc/getWithRedirect.js';\nexport { parseFromUrl } from '../../oidc/parseFromUrl.js';\nexport { oidcIntrospect } from '../../oidc/introspect.js';\nexport { closeSession, getSession, refreshSession, sessionExists, setCookieAndRedirect } from '../../session/api.js';\nexport { createSessionApi } from '../../session/factory.js';\nexport { mixinSession } from '../../session/mixin.js';\nexport { createStorageOptionsConstructor } from '../../storage/options/StorageOptionsConstructor.js';\nexport { BaseStorageManager, logServerSideMemoryStorageWarning } from '../../storage/BaseStorageManager.js';\nexport { mixinStorage } from '../../storage/mixin.js';\nexport { SavedObject } from '../../storage/SavedObject.js';\nexport { deprecate, deprecateWrap, getConsole, getNativeConsole, warn } from '../../util/console.js';\nexport { delay, genRandomString, isoToUTCString, split2 } from '../../util/misc.js';\nexport { bind, clone, extend, find, getLink, omit, removeNils } from '../../util/object.js';\nexport { PromiseQueue } from '../../util/PromiseQueue.js';\nexport { isFunction, isNumber, isObject, isPromise, isString } from '../../util/types.js';\nexport { isAbsoluteUrl, removeTrailingSlash, toAbsoluteUrl, toQueryString, toRelativeUrl } from '../../util/url.js';\nexport { default as AuthApiError } from '../../errors/AuthApiError.js';\nexport { default as AuthPollStopError } from '../../errors/AuthPollStopError.js';\nexport { default as AuthSdkError } from '../../errors/AuthSdkError.js';\nexport { default as OAuthError } from '../../errors/OAuthError.js';\nexport { default as WWWAuthError } from '../../errors/WWWAuthError.js';\n\nconst OptionsConstructor = createIdxOptionsConstructor();\nconst StorageManager = createIdxStorageManager();\nconst TransactionManager = createIdxTransactionManager();\nconst WithIdx = createOktaAuthIdx(StorageManager, OptionsConstructor, TransactionManager);\nconst WithMyAccount = mixinMyAccount(WithIdx);\nconst WithAuthn = mixinAuthn(WithMyAccount);\nclass OktaAuth extends WithAuthn {\n constructor(options) {\n super(options);\n }\n}\n\nexport { OktaAuth, OktaAuth as default };\n//# sourceMappingURL=default.js.map\n","/**\n* The state object passed to IDPs\n*/\nexport interface IdpState {\n /**\n * Random string\n */\n random: string,\n \n /**\n * Optional callback path\n */\n callback?: string\n \n /**\n * Optional cta action\n */\n cta?: string;\n}\n\n/**\n* Encode the given state object\n* @param state \n*/\nexport const encodeState = (state: IdpState): string => {\n return btoa(JSON.stringify(state));\n}\n\n/**\n* Decode the given state string.\n* \n* @param encodedState The encoded state to decode\n*/\nexport const decodeState = (encodedState: string): IdpState => {\n return JSON.parse(atob(encodedState));\n}","\nimport { derived, writable, get } from 'svelte/store';\nimport type { Readable, Writable } from 'svelte/store';\nimport { OktaAuth } from '@okta/okta-auth-js'\nimport type { AuthState, UserClaims, OktaAuthOptions } from '@okta/okta-auth-js';\nimport type { IAuthStore, IOktaAuthConfig, IUserInfo, OnActivateFn, OnAuthUpdatedCallbackFn, OnSignoutCallbackFn, OnSignupCallbackFn, OnUpdateUserProfileFn } from '../types'\nimport { AuthError, AuthErrorStatus } from '../types'\nimport { encodeState, decodeState } from '../state';\nimport type { IdpState } from '../state';\nimport { isMobile } from '../../responsive';\nimport type { Page } from '@sveltejs/kit';\nimport { decode } from 'punycode';\nimport { tick } from 'svelte';\n\ntype OnAuthRequiredCallbackFn = (oktaAuth: OktaAuth) => Promise | void;\n\ninterface OktaSvelteOptions {\n oktaAuth?: OktaAuth;\n onAuthRequiredCallbackFn: OnAuthRequiredCallbackFn;\n onAuthResumeCallbackFn: OnAuthRequiredCallbackFn;\n onAuthUpdatedCallbackFn?: OnAuthUpdatedCallbackFn;\n onSignupCallbackFn?: OnSignupCallbackFn;\n onActivateFn: OnActivateFn;\n onUpdateUserProfileFn: OnUpdateUserProfileFn;\n onSignoutCallbackFn?: OnSignoutCallbackFn;\n}\n\n/**\n* Okta specific implementation of IAuthStore\n*/\nexport class OktaSvelteStore implements IAuthStore {\n // singleton instance \n private static _oktaSvelteStore: OktaSvelteStore | null;\n\n // OpenID Connect parameters from dotenv environment variables\n private static _issuer: string;\n private static _domain: string;\n private static _clientId: string;\n private static _redirectUri: string;\n private static _scopes: string[];\n\n private _oktaAuth: OktaAuth | null;\n private _authState: Writable;\n private _userInfo: Writable;\n private _onAuthRequiredCallbackFn: OnAuthRequiredCallbackFn | undefined;\n private _onAuthResumeCallbackFn: OnAuthRequiredCallbackFn | undefined;\n private _state: string | null;\n private _nonce: string | null;\n private _onAuthUpdatedCallbackFn: OnAuthUpdatedCallbackFn | undefined;\n private _onSignupCallbackFn: OnSignupCallbackFn | undefined;\n private _onActivateFn: OnActivateFn;\n private _onUpdateUserProfileFn: OnUpdateUserProfileFn;\n private _onSignoutCallbackFn: OnAuthUpdatedCallbackFn | undefined;\n\n private static _config: IOktaAuthConfig | null = null;\n\n private static async onHandleAuthStateUpdate(authState: AuthState) {\n (OktaSvelteStore.getInstance() as OktaSvelteStore)._authState.update(() => authState)\n }\n\n /**\n * Configure the OktaSvelteStore singleton instance.\n * \n * @param config The configuration object\n * \n * @returns The svelte okta auth store instance\n */\n public static configure(config: IOktaAuthConfig): void {\n if (OktaSvelteStore._config) {\n // throw new Error('DbUtils has already been configured.');\n return;\n }\n OktaSvelteStore._config = {\n ...config\n }\n }\n\n /**\n * Get the svelte okta auth store singleton instance.\n * \n * @returns The svelte okta auth store instance\n */\n public static getInstance(): IAuthStore {\n\n if (!OktaSvelteStore._config) {\n throw new Error('OktaSvelteStore has not been configured yet.');\n }\n\n OktaSvelteStore._issuer = OktaSvelteStore._config.issuer;\n OktaSvelteStore._domain = OktaSvelteStore._config.domain;\n OktaSvelteStore._clientId = OktaSvelteStore._config.clientId;\n OktaSvelteStore._redirectUri = OktaSvelteStore._config.redirectUri;\n\n OktaSvelteStore._scopes = ['openid', 'profile', 'email', 'phone', 'address', 'offline_access'];\n\n if (OktaSvelteStore._oktaSvelteStore == null) {\n\n if (typeof window !== 'undefined') {\n const config: OktaAuthOptions = {\n clientId: OktaSvelteStore._clientId,\n issuer: OktaSvelteStore._issuer,\n redirectUri: OktaSvelteStore._redirectUri,\n scopes: OktaSvelteStore._scopes,\n pkce: true,\n //devMode: true, // TODO: uncomment to run in dev mode and log more info\n services: {\n autoRenew: true,\n autoRemove: false,\n syncStorage: true,\n },\n tokenManager: {\n autoRenew: true,\n autoRemove: false\n }\n };\n\n const oktaAuth = new OktaAuth(config);\n\n OktaSvelteStore._oktaSvelteStore = new OktaSvelteStore({\n oktaAuth: oktaAuth,\n onAuthRequiredCallbackFn: () => { },\n onAuthResumeCallbackFn: () => { },\n onAuthUpdatedCallbackFn: OktaSvelteStore._config.onAuthUpdatedCallbackFn,\n onSignupCallbackFn: OktaSvelteStore._config.onSignupCallbackFn,\n onActivateFn: OktaSvelteStore._config.onActivateFn,\n onUpdateUserProfileFn: OktaSvelteStore._config.onUpdateUserProfileFn,\n onSignoutCallbackFn: OktaSvelteStore._config.onSignoutCallbackFn\n } as OktaSvelteOptions);\n } else {\n OktaSvelteStore._oktaSvelteStore = new OktaSvelteStore({\n onAuthRequiredCallbackFn: () => { },\n onAuthResumeCallbackFn: () => { },\n onAuthUpdatedCallbackFn: OktaSvelteStore._config.onAuthUpdatedCallbackFn,\n onSignupCallbackFn: OktaSvelteStore._config.onSignupCallbackFn,\n onActivateFn: OktaSvelteStore._config.onActivateFn,\n onUpdateUserProfileFn: OktaSvelteStore._config.onUpdateUserProfileFn,\n onSignoutCallbackFn: OktaSvelteStore._config.onSignoutCallbackFn\n } as OktaSvelteOptions)\n }\n }\n return OktaSvelteStore._oktaSvelteStore;\n }\n\n /**\n * Construct a new instance\n * @param param The initialization parameters\n */\n private constructor({\n oktaAuth,\n onAuthRequiredCallbackFn,\n onAuthResumeCallbackFn,\n onAuthUpdatedCallbackFn,\n onSignupCallbackFn,\n onActivateFn,\n onUpdateUserProfileFn,\n onSignoutCallbackFn\n } = {} as OktaSvelteOptions) {\n\n if (!OktaSvelteStore._config) {\n throw new Error('OktaSvelteStore has not been configured yet.');\n }\n\n this._onAuthRequiredCallbackFn = onAuthRequiredCallbackFn;\n this._onAuthResumeCallbackFn = onAuthResumeCallbackFn;\n this._onAuthUpdatedCallbackFn = onAuthUpdatedCallbackFn;\n this._onSignupCallbackFn = onSignupCallbackFn;\n this._onSignoutCallbackFn = onSignoutCallbackFn;\n this._onActivateFn = onActivateFn;\n this._onUpdateUserProfileFn = onUpdateUserProfileFn;\n\n if (oktaAuth) {\n this._oktaAuth = oktaAuth;\n this._authState = writable(null);\n oktaAuth.start().then(() => {\n this._authState.set(oktaAuth.authStateManager.getAuthState());\n });\n this._userInfo = writable(null)\n } else {\n this._oktaAuth = null;\n this._authState = writable(null);\n this._userInfo = writable(null)\n }\n\n // generate random string as nonce and state\n this._nonce = (0 | Math.random() * 9e6).toString(36)\n\n if (typeof window !== 'undefined') {\n this._state = this.getState();\n }\n }\n\n /**\n * Retrieve state from localhost if present, otherwise generate a new one\n */\n private getState(): string {\n let state: string = localStorage.getItem(\"oktaState\") as string;\n if (!state) {\n state = (0 | Math.random() * 9e6).toString(36);\n localStorage.setItem(\"oktaState\", state);\n }\n return state;\n }\n\n /**\n * Clear state\n */\n private clearState() {\n localStorage.removeItem(\"oktaState\");\n }\n\n buildSocialLoginAuthorizeUrl(): string {\n throw new Error('Method not implemented.');\n }\n\n private _mapClaimsToUserInfo = async (userClaims: UserClaims): Promise => {\n\n // from data to string YYYYMMDD\n function dateToYYYYMMDD(date: string | Date): string | undefined {\n if (!date || (date && typeof date === 'string')) {\n return date;\n }\n\n if (date && date instanceof Date) {\n return date.getFullYear() + (\"0\" + (date.getMonth() + 1)).slice(-2) + (\"0\" + date.getDate()).slice(-2);\n }\n }\n\n return {\n bsid: \"BS\" + userClaims.sub,\n id: userClaims.sub,\n name: userClaims.given_name || '',\n surname: userClaims.family_name || '',\n fullname: userClaims.name || '',\n email: userClaims.email || '',\n phone: userClaims.phone_number ? userClaims.phone_number.toString() : userClaims.mobilePhone ? userClaims.mobilePhone.toString() : \"\",\n subscribe: typeof userClaims.consensoMailingBS === 'boolean' ? userClaims.consensoMailingBS : userClaims.consensoMailingBS == '1',\n profilingConsent: typeof userClaims.consensoProfilazione === 'boolean' ? userClaims.consensoProfilazione : userClaims.consensoProfilazione == '1',\n businessUseConsent: typeof userClaims.consensoSocietaBS === 'boolean' ? userClaims.consensoSocietaBS : userClaims.consensoSocietaBS == '1',\n birthday: userClaims.dataNascita && typeof userClaims.dataNascita === 'string' ? dateToYYYYMMDD(userClaims.dataNascita) : '',\n city: userClaims.city ? userClaims.city.toString() : '',\n address: userClaims.address ? (userClaims.address)['street_address'] ? (userClaims.address)['street_address'] : '' : '',\n postalCode: userClaims.zipCode ? userClaims.zipCode.toString() : '',\n organization: userClaims.organization ? userClaims.organization.toString() : '',\n sector: userClaims.settore ? userClaims.settore.toString() : '',\n function: userClaims.function ? userClaims.function.toString() : '',\n //graduation: userClaims.graduation // FIXME: decode correctly from user claims\n }\n }\n\n /**\n * Start the auth state manager.\n */\n public async start() {\n\n if (this._oktaAuth) {\n const oktaAuth = this._oktaAuth;\n await oktaAuth.start();\n\n this._authState.set(oktaAuth.authStateManager.getAuthState());\n\n oktaAuth.setOriginalUri(\"/\")\n\n // subscribe to the latest authState\n oktaAuth.authStateManager.subscribe(OktaSvelteStore.onHandleAuthStateUpdate)\n\n if (!oktaAuth.token.isLoginRedirect()) {\n // Calculates initial auth state and fires change event for listeners\n // Also starts the token auto-renew service\n\n const authenticated = await oktaAuth.isAuthenticated();\n\n if (authenticated) {\n // if authenticated reload user details using saved tokens\n oktaAuth.token.getUserInfo().then(async (userClaims) => {\n this._userInfo.set(await this._mapClaimsToUserInfo(userClaims))\n })\n }\n }\n }\n }\n\n /**\n * Stop the auth state manager.\n */\n public async stop() {\n if (this._oktaAuth) {\n this._oktaAuth.authStateManager.unsubscribe(OktaSvelteStore.onHandleAuthStateUpdate)\n await this._oktaAuth.stop()\n }\n }\n\n /**\n * Check if user is logged in.\n */\n public get isLoggedIn(): Readable {\n return derived(this._authState, $authState => this._oktaAuth != null && ($authState != null) && ($authState.isAuthenticated != undefined) && $authState.isAuthenticated, false)\n }\n\n /**\n * Get information about current logged in user.\n */\n public get userInfo(): Readable {\n return derived([this._authState, this._userInfo], $v => this._oktaAuth && $v[0] && $v[0].isAuthenticated ? $v[1] : null, null)\n }\n\n /**\n * Get the access token\n */\n public get accessToken(): string | null {\n const accessToken = this._oktaAuth ? this._oktaAuth.getAccessToken() : null;\n return accessToken ? accessToken : null;\n }\n\n /**\n * Handles the login redirect call\n * \n * @param page The calling page\n */\n public async handleLoginRedirect(): Promise {\n\n await tick();\n\n if (this._oktaAuth) {\n try {\n const res = await this._oktaAuth.token.parseFromUrl();\n\n this._oktaAuth.tokenManager.setTokens(res.tokens);\n\n const userClaims = await this._oktaAuth.token.getUserInfo();\n const userInfo = await this._mapClaimsToUserInfo(userClaims);\n this._userInfo.set(userInfo)\n\n // call the signup callback function\n if (this._onSignupCallbackFn) {\n await this._onSignupCallbackFn(userInfo);\n }\n\n // call the user updated callback function\n if (this._onAuthUpdatedCallbackFn) {\n await this._onAuthUpdatedCallbackFn();\n }\n\n if (!res.state) {\n throw new Error(\"State not found\");\n }\n\n const decodedState: IdpState = decodeState(res.state);\n if (decodedState.random !== this._state) {\n throw new Error(\"Invalid state\");\n }\n\n this.clearState();\n\n return decodedState;\n\n } catch (error: any) {\n if (this._oktaAuth.idx.isInteractionRequiredError(error)) {\n // user interaction is required eventually call callback functions\n const callbackFn = this._onAuthResumeCallbackFn || this._onAuthRequiredCallbackFn;\n if (callbackFn) {\n callbackFn(this._oktaAuth);\n return;\n }\n } else {\n // TODO: no user interaction is required, what to do?\n throw (error);\n }\n }\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Complete the user activation with given token.\n * \n * @param token The activation token.\n * @param password The password to be set.\n * \n * @returns True on successful sign in.\n */\n public async signInWithToken(token: string, password: string): Promise {\n\n\n if (this._oktaAuth) {\n // call the activation function\n const activateResult = await this._onActivateFn(token, password);\n\n await this.signIn(activateResult.username, activateResult.password);\n\n return true;\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Sign in user.\n * \n * @param username The username.\n * @param password The password.\n * \n * @throws AuthError\n */\n public async signIn(username: string, password: string): Promise {\n\n if (this._oktaAuth) {\n const transaction = await this._oktaAuth.signInWithCredentials({ username, password });\n\n if (transaction.status === 'SUCCESS' || transaction.status === 'PASSWORD_WARN') {\n const res = await this._oktaAuth.token.getWithoutPrompt({\n sessionToken: transaction.sessionToken,\n responseType: 'id_token',\n scopes: OktaSvelteStore._scopes\n });\n\n this._oktaAuth.tokenManager.setTokens(res.tokens);\n\n const userClaims = await this._oktaAuth.token.getUserInfo()\n\n this._userInfo.set(await this._mapClaimsToUserInfo(userClaims))\n\n // call the auth updated callback function\n if (this._onAuthUpdatedCallbackFn) {\n await this._onAuthUpdatedCallbackFn();\n }\n\n return;\n } else {\n // map statuses from transaction to error, so UI could take care of special cases\n const status = transaction.status === 'LOCKED_OUT' ? AuthErrorStatus.LOCKED_OUT :\n transaction.status === 'PASSWORD_EXPIRED' ? AuthErrorStatus.PASSWORD_EXPIRED :\n AuthErrorStatus.WRONG_PASSWORD;\n\n throw new AuthError(\"Okta reported \" + transaction.status, status)\n }\n\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n public async signInWithIdp(idp: string, redirect: boolean = false, callback?: string, cta?: string, isSocialLogin?: boolean): Promise {\n // if present encode callback in state\n const state = encodeState({\n random: this._state || \"\",\n callback: callback,\n cta: cta\n });\n\n if (this._oktaAuth) {\n const oktaAuth = this._oktaAuth;\n // call the auth updated callback function\n if (this._onAuthUpdatedCallbackFn) {\n await this._onAuthUpdatedCallbackFn();\n }\n\n try {\n await tick();\n await oktaAuth.token.getWithRedirect({\n idp: idp,\n scopes: OktaSvelteStore._scopes,\n state: state,\n nonce: this._nonce ? this._nonce : undefined,\n redirectUri: OktaSvelteStore._redirectUri\n });\n } catch (error) {\n throw new Error(\"Error during social login\");\n }\n // }\n } else {\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Logout the user (if logged in).\n * \n * @param callbackFn The callback function to be called before the sign out.\n * \n * @return A promise resolved whe operation is completed.\n */\n public async signOut(): Promise {\n if (this._oktaAuth) {\n\n await this._oktaAuth.revokeAccessToken();\n\n if (await this._oktaAuth.session.exists()) {\n try {\n await this._oktaAuth.closeSession();\n } catch (e: any) {\n if (e.xhr && e.xhr.status === 429) {\n throw new Error(\"Too many requests\");\n } else {\n throw e;\n }\n }\n }\n\n // call the auth updated callback function\n if (this._onAuthUpdatedCallbackFn) {\n await this._onAuthUpdatedCallbackFn();\n }\n\n // call the signout callback function\n if (this._onSignoutCallbackFn) {\n await this._onSignoutCallbackFn();\n }\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\");\n }\n }\n\n /**\n * Send forgot password generation link.\n * \n * @param username The username, without domain or fully qualified.\n * \n * @returns A promise resolved whe operation is completed.\n */\n public async forgotPassword(username: string): Promise {\n if (this._oktaAuth) {\n const transaction = await this._oktaAuth.forgotPassword({\n username: username,\n factorType: \"EMAIL\"\n })\n\n if (transaction.status === \"SUCCESS\") {\n // TODO: forgot password waits until termination of transaction (for example for SM confirmation code), so just skip\n }\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Send unlock link.\n * \n * @param username The username, without domain or fully qualified.\n * \n * @returns A promise resolved whe operation is completed.\n */\n public async unlock(username: string): Promise {\n if (this._oktaAuth) {\n const transaction = await this._oktaAuth.unlockAccount({\n username: username,\n factorType: \"EMAIL\"\n });\n\n if (transaction.status === \"SUCCESS\") {\n // TODO: unlock waits until termination of transaction (for example for SM confirmation code), so just skip\n }\n\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Retrieve user details\n * \n */\n public async retrieveUser(): Promise {\n if (this._oktaAuth) {\n const userClaims = await this._oktaAuth.token.getUserInfo();\n\n this._userInfo.set(await this._mapClaimsToUserInfo(userClaims))\n\n // call the auth updated callback function\n if (this._onAuthUpdatedCallbackFn) {\n await this._onAuthUpdatedCallbackFn();\n }\n\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw new Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n\n /**\n * Update the user profile.\n * \n * @param newUserInfo The updated user profile\n * @returns A promise containing the updated user profile.\n */\n public async updateUserProfile(newUserInfo: IUserInfo): Promise {\n if (this._oktaAuth) {\n\n const updatedUser = await this._onUpdateUserProfileFn(newUserInfo);\n\n if (updatedUser) {\n this._userInfo.update((value) => {\n\n if (!value) {\n throw new Error(\"Error updating user profile, there is nothing to update since we have no profile loaded\");\n }\n\n return {\n bsid: value.bsid,\n id: value.id,\n fullname: `${updatedUser.name} ${updatedUser.surname}`,\n name: updatedUser.name,\n surname: updatedUser.surname,\n email: value.email,\n phone: updatedUser.phone,\n birthday: updatedUser.birthday,\n address: updatedUser.address,\n city: updatedUser.city,\n postalCode: updatedUser.postalCode,\n organization: updatedUser.organization,\n sector: updatedUser.sector,\n function: updatedUser.function,\n subscribe: updatedUser.subscribe,\n businessUseConsent: updatedUser.businessUseConsent,\n profilingConsent: updatedUser.profilingConsent\n }\n });\n\n const userInfo = get(this._userInfo);\n\n if (userInfo) {\n return userInfo;\n }\n }\n\n console.error(\"Error updating user profile, there is nothing to update since we have no profile loaded\");\n throw new Error(\"Error updating user profile, there is nothing to update since we have no profile loaded\");\n } else {\n console.error(\"No okta auth object, maybe are you server side?\");\n throw Error(\"No okta auth object, maybe are you server side?\")\n }\n }\n}\n\n","export type { IAuthStore, IUserInfo } from './types'\nexport type { IdpState } from './state'\nexport { AuthErrorStatus, AuthError } from './types'\nimport { OktaSvelteStore } from './okta/store'\n\nexport { OktaSvelteStore } from './okta/store'\nexport const useOktaStore = OktaSvelteStore.getInstance"],"names":["GraduationType","AuthErrorStatus","AuthErrorStatus2","AuthError","message","status","inner","__publicField","IdxStatus","AuthenticatorKey","IdxFeature","isAuthenticator","obj","getNativeConsole","getConsole","nativeConsole","warn","text","removeNils","cleaned","prop","value","clone","str","omit","props","newobj","p","find","collection","searchParams","c","item","found","getLink","linkName","altName","link","CustomError","isString","isObject","isNumber","isFunction","fn","isPromise","WWWAuthError","scheme","parameters","resp","_a","header","regex","firstSpace","remaining","params","match","headers","genRandomString","length","randomCharset","random","cl","delay","ms","resolve","split2","delim","parts","isAbsoluteUrl","url","toAbsoluteUrl","baseUrl","removeTrailingSlash","toQueryString","key","path","trimmed","AuthSdkError","msg","xhr","generateState","generateNonce","getIssuer","sdk","options","getOAuthBaseUrl","issuer","getOAuthDomain","getOAuthUrls","authorizeUrl","userinfoUrl","tokenUrl","logoutUrl","revokeUrl","createOAuthMeta","tokenParams","urls","oauthMeta","E","name","callback","ctx","e","self","listener","data","evtArr","i","len","evts","liveEvents","tinyEmitter","assign","target","source","defaultConverter","init","converter","defaultAttributes","set","attributes","stringifiedAttributes","attributeName","get","cookies","jar","api","global","this","__self__","F","exports","support","isDataView","viewClasses","isArrayBufferView","normalizeName","normalizeValue","iteratorFor","items","iterator","Headers","oldValue","thisArg","consumed","body","fileReaderReady","reader","reject","readBlobAsArrayBuffer","blob","promise","readBlobAsText","readArrayBufferAsText","buf","view","chars","bufferClone","Body","rejected","decode","methods","normalizeMethod","method","upcased","Request","input","form","bytes","split","parseHeaders","rawHeaders","preProcessedHeaders","line","Response","bodyInit","response","redirectStatuses","error","fetch","request","abortXhr","module","TokenKind","isAccessToken","isIDToken","isRefreshToken","createTransactionMeta","authClient","pkceMeta","flow","withCredentials","activationToken","recoveryToken","maxAge","acrValues","hasSavedInteractionHandle","savedMeta","getSavedTransactionMeta","isTransactionMetaValid","getTransactionMeta","validExistingMeta","saveTransactionMeta","meta","clearTransactionMeta","isTransactionMetaValidForOptions","isTransactionMetaValidForFlow","keys","STATE_TOKEN_KEY_NAME","DEFAULT_POLLING_DELAY","DEFAULT_MAX_CLOCK_SKEW","DEFAULT_CACHE_DURATION","TOKEN_STORAGE_NAME","CACHE_STORAGE_NAME","PKCE_STORAGE_NAME","TRANSACTION_STORAGE_NAME","SHARED_TRANSACTION_STORAGE_NAME","ORIGINAL_URI_STORAGE_NAME","IDX_RESPONSE_STORAGE_NAME","ACCESS_TOKEN_STORAGE_KEY","ID_TOKEN_STORAGE_KEY","REFRESH_TOKEN_STORAGE_KEY","REFERRER_PATH_STORAGE_KEY","MIN_VERIFIER_LENGTH","MAX_VERIFIER_LENGTH","DEFAULT_CODE_CHALLENGE_METHOD","IDX_API_VERSION","AuthApiError","err","OAuthError","errorCode","summary","formatError","serverErr","wwwAuthHeader","wwwAuthErr","max_age","acr_values","httpRequest","interceptor","args","saveAuthnState","accessToken","storageUtil","storage","httpCache","cacheContents","cachedResponse","oktaUserAgentHeader","ajaxOptions","res","getOptions","post","postOptions","getResponse","interact","clientId","redirectUri","state","scopes","codeChallenge","codeChallengeMethod","nonce","clientSecret","interactionHandle","newMeta","__rest","s","t","isFieldMutable","field","divideSingleActionParamsByMutability","action","_b","defaultParamsForAction","neededParamsForAction","immutableParamsForAction","divideActionParamsByMutability","actionList","neededParams","defaultParams","immutableParams","generateDirectFetch","actionDefinition","toPersist","payload","idxResponse","generateIdxAction","generator","generateRemediationFunctions","remediationValue","remediation","jsonpathRegex","jsonpath","json","_c","steps","step","lastStep","curr","SKIP_FIELDS","parseNonRemediations","actions","context","fieldValue","type","info","subField","expandRelatesTo","k","query","result","innerValue","convertRemediationAction","actionFn","parseIdxResponse","remediationData","remediations","makeIdxState","requestDidSucceed","rawIdxResponse","neededToProceed","proceed","remediationChoice","paramsFromUser","remediationChoiceObject","findCode","interactionCode","v1","parsersForVersion","version","validateVersionConfig","isRawIdxResponse","isAuthApiError","isOAuthError","isWWWAuthError","introspect","savedIdxResponse","domain","stateHandle","getAllValues","idxRemediation","r","getRequiredValues","required","cur","titleCase","getAuthenticatorFromRemediation","formatAuthenticator","incoming","authenticator","compareAuthenticators","auth1","auth2","findMatchedOption","authenticators","option","relatesTo","Remediator","values","existing","acc","val","entry","_authClient","_context","inputs","inputFromRemediation","visible","messages","alias","aliases","inputsFromRemediation","inputsFromRemediator","authenticatorFromRemediation","id","enrollmentId","unwrapFormValue","formKeys","unwrappedForm","GenericRemediator","href","rel","accepts","produces","rest","_oktaAuth","_flow","setRemediatorsCtx","newCtx","getFlowSpecification","oktaAuth","isTerminalResponse","canSkipFn","canResendFn","actionName","getMessagesFromIdxRemediationValue","messagesFromForm","optionValues","messagesFromOptions","getMessagesFromResponse","rawIdxState","globalMessages","fieldMessages","seen","filtered","getEnabledFeatures","getAvailableSteps","useGenericRemediator","remediatorMap","map","remediatorClass","T","getRemediatorClass","remediator","stepObj","part1","part2","actionObj","filterValuesForRemediation","remediationName","remediators","getRemediator","idxRemediations","remediatorCandidates","getNextStep","nextStep","canSkip","canResend","handleFailedResponse","terminal","getActionFromValues","removeActionFromValues","removeActionFromOptions","remediate","actionFromValues","valuesWithoutExecutedAction","optionsWithoutExecutedAction","gr","initializeValues","knownOptions","initializeData","_d","flowSpec","getDataFromIntrospect","interactResponse","getDataFromRemediate","autoRemediate","idxResponseFromRemediation","canceled","getTokens","codeVerifier","ignoreSignature","finalizeData","exchangeCodeForTokens","shouldSaveResponse","shouldClearTransaction","clearSharedStorage","tokens","enabledFeatures","availableSteps","hasActions","hasErrors","run","stepUp","authenticate","Authenticator","VerificationCodeAuthenticator","credentials","verificationCode","otp","idxRemediationValue","OktaVerifyTotp","OktaPassword","password","passcode","revokeSessions","SecurityQuestionEnrollment","questionKey","question","answer","SecurityQuestionVerification","WebauthnEnrollment","clientData","attestation","WebauthnVerification","authenticatorData","signatureData","getAuthenticator","VerifyAuthenticator","authenticatorEnrollments","valueKey","EnrollAuthenticator","EnrollPoll","common","SelectEnrollmentChannel","channel","filterKey","EnrollmentChannelData","ChallengeAuthenticator","ChallengePoll","ResetAuthenticator","EnrollProfile","userProfileFromValues","canRemediate","profileAttributes","attributeValues","errorRemediation","errors","Identify","identifier","ReEnrollAuthenticator","newPassword","ReEnrollAuthenticatorWarning","RedirectIdp","idp","SelectAuthenticator","matchedOption","isCurrentAuthenticator","isCurrentAuthenticatorEnrollment","selectedOption","label","SelectAuthenticatorAuthenticate","isRecoveryFlow","SelectAuthenticatorEnroll","SelectAuthenticatorUnlockAccount","authenticatorMap","methodTypeOption","methodTypeValue","SelectEnrollProfile","AuthenticatorData","methodType","authenticatorsData","AuthenticatorVerificationData","AuthenticatorEnrollmentData","phoneNumber","Skip","AuthenticationFlow","PasswordRecoveryFlow","RegistrationFlow","AccountUnlockFlow","cancel","urlParamsToObject","hashOrSearch","plus2space","paramSplit","fragment","param","EmailVerifyCallbackError","isEmailVerifyCallbackError","isEmailVerifyCallback","urlPath","parseEmailVerifyCallback","handleEmailVerifyCallback","search","canProceed","poll","transaction","availablePollingRemeditaions","refresh","startTransaction","register","recoverPassword","handleInteractionCodeRedirect","savedState","unlockAccount","isInteractionRequiredError","isRefreshTokenInvalidError","hasTokensInHash","hash","hasAuthorizationCode","hasInteractionCode","hasErrorInUrl","isRedirectUri","uri","authParams","isCodeFlow","hasResponseType","responseType","getHashOrSearch","codeFlow","useQuery","isLoginRedirect","hasCode","isInteractionRequired","createIdxAPI","index","boundStartTransaction","a","b","isWindowsPhone","isBrowser","isIE11OrLess","documentMode","getUserAgent","isFingerprintSupported","agent","isPopupPostMessageSupported","isIE8or9","isWebCryptoSubtleSupported","isTokenVerifySupported","hasTextEncoder","isPKCESupported","isHTTPS","isLocalhost","isDPoPSupported","createOktaAuthBase","OptionsConstructor","OktaAuthBase","Emitter","features","constants","mixinStorage","Base","StorageManager","storageManager","OktaUserAgent","env","setRequestHeader","headerName","headerValue","mixinHttp","opts","stringToBase64Url","b64","base64ToBase64Url","base64UrlToBase64","b64u","base64UrlToString","utf8","stringToBuffer","buffer","base64UrlDecode","base64UrlToBuffer","bufferToBase64Url","bin","byte","getOidcHash","arrayBuffer","intBuffer","firstHalf","verifyToken","idToken","format","algo","extractable","usages","cryptoKey","jwt","b64Signature","signature","PromiseQueue","thisObject","queueItem","dec2hex","dec","getRandomString","generateVerifier","prefix","verifier","computeChallenge","PKCE","decodeToken","token","decodedToken","getDefaultTokenParams","pkce","responseMode","dpop","defaultRedirectUri","INDEXEDDB_NAME","DB_KEY","isDPoPNonceError","createJwt","claims","signingKey","head","cryptoRandomValue","byteLen","v","generateKeyPair","algorithm","hashAccessToken","keyStore","req","db","tx","store","invokeStoreMethod","storeKeyPair","pairId","keyPair","findKeyPair","clearDPoPKeyPair","clearAllDPoPKeyPairs","createDPoPKeyPair","keyPairId","clearDPoPKeyPairAfterRevoke","revokedToken","shouldClear","refreshToken","generateDPoPProof","kty","crv","n","x","y","generateDPoPForTokenRequest","validateOptions","getPostData","makeTokenRequest","dpopKeyPair","proof","dpopNonce","postToTokenEndpoint","postRefreshToken","getWellKnown","authServerUri","getKey","kid","wellKnown","jwksUri","cachedKey","validateClaims","validationParams","aud","iss","acr","now","configuredIssuer","validationOptions","verifyToken$1","validateResponse","oauthParams","handleOAuthResponse","tokenDict","expiresIn","tokenType","accessJwt","idJwt","idTokenObj","authorizationCode","dpopPairId","extraParams","getTokenOptions","handleResponseOptions","oauthResponse","tokenResponse","getUserInfo","accessTokenObject","idTokenObject","userInfo","errorDescription","addListener","eventTarget","removeListener","loadFrame","src","iframe","loadPopup","title","appearance","addPostMessageListener","timeout","responseHandler","timeoutId","msgReceivedOrTimeout","assertPKCESupport","errorMessage","validateCodeChallengeMethod","preparePKCE","prepareTokenParams","defaults","convertTokenParamsToOAuthParams","mayBeArray","buildAuthorizeParams","oauthQueryParams","getToken","popupWindow","sessionTokenOverrides","idpOverrides","requestUrl","endpoint","flowType","iframePromise","iframeEl","oauthPromise","popupPromise","closePoller","getWithoutPrompt","getWithPopup","getWithRedirect","removeHash","nativeHistory","nativeDoc","nativeLoc","removeSearch","getResponseMode","defaultResponseMode","parseOAuthResponseFromUrl","paramStr","cleanOAuthResponseFromUrl","parseFromUrl","isSameRefreshToken","renewTokensWithRefresh","refreshTokenObject","renewTokenParams","endpointParams","throwInvalidTokenError","getSingleToken","originalToken","renewToken","renewTokens","revokeToken","creds","hintMap","oidcIntrospect","kind","introspectUrl","authHeader","createEnrollAuthenticatorMeta","getDefaultEnrollAuthenticatorParams","prepareParams","prepareEnrollAuthenticatorParams","enrollAuthenticator","createTokenAPI","queue","useQueue","getWithRedirectFn","parseFromUrlFn","parseFromUrlApi","createEndpoints","validateToken","SdkClock","localOffset","EVENT_EXPIRED","EVENT_RENEWED","EVENT_ADDED","EVENT_REMOVED","EVENT_ERROR","EVENT_SET_STORAGE","DEFAULT_OPTIONS","defaultState","TokenManager","storageOptions","event","handler","expireEarlySeconds","expireTime","freshToken","oldToken","expireTimeouts","expireEventWait","expireEventTimeout","tokenStorage","accessTokenCb","idTokenCb","refreshTokenCb","handleTokenCallback","handleAdded","handleRenewed","handleRemoved","types","existingTokens","storageKey","newToken","existingToken","removedToken","shouldRenew","refreshKey","removedTokens","storageType","supported","storageProvider","curType","nextType","secure","sameSite","sessionCookie","expiresAt","existingValues","valueToStore","cookieOptions","Cookies","provideOriginalUri","BaseClass","originalUri","sharedStorage","mixinOAuth","TransactionManagerConstructor","WithOriginalUri","autoRenew","autoRemove","shouldRemove","additionalParams","accessTokenKey","refreshTokenKey","postLogoutRedirectUri","idTokenHint","logoutUri","defaultUri","currentUri","revokeAccessToken","revokeRefreshToken","sessionClosed","clearAll","wwwAuth","wwwErr","CancelError","reason","PCancelable","userFn","arguments_","onCancel","executor","onResolve","onReject","boolean","onFulfilled","onRejected","onFinally","pCancelableModule","INITIAL_AUTH_STATE","DEFAULT_PENDING","EVENT_AUTH_STATE_CHANGE","MAX_PROMISE_CANCEL_TIMES","isSameAuthState","prevState","AuthStateManager","transformAuthState","devMode","log","emitAuthStateChange","authState","finalPromise","origPromise","curPromise","cancelablePromise","_","emitAndResolve","AutoRenewService","tokenManager","firstTime","PROMISE_RESOLVED_TRUE","PROMISE_RESOLVED_VOID","sleep","time","resolveWith","randomInt","min","max","randomToken","lastMs","additional","microSeconds","supportsWebLockAPI","micro","create","channelName","close","channelState","postMessage","messageJson","onMessage","canBeUsed","averageResponseTime","NativeMethod","ObliviousSet","ttl","_this","removeTooOldValues","obliviousSet","olderThen","next","fillOptionsWithDefaults","originalOptions","DB_PREFIX","OBJECT_STORE_ID","TRANSACTION_SETTINGS","getIdb","commitIndexedDBTransaction","createDatabase","IndexedDB","dbName","openRequest","ev","rej","writeMessage","readerUuid","writeObject","objectStore","getMessagesHigherThan","lastCursorId","ret","keyRangeValue","getAllRequest","openCursor","openCursorRequest","cursor","removeMessagesById","ids","deleteRequest","getOldMessages","msgObk","cleanOldMessages","tooOld","_readLoop","readNewMessages","_filterMessage","msgObj","newerMessages","useMessages","msgObjA","msgObjB","IndexedDBMethod","KEY_PREFIX","getLocalStorage","localStorage","writeObj","addStorageEventListener","removeStorageEventListener","uuid","eMIs","ls","defaultTime","userAgent","LocalstorageMethod","SIMULATE_CHANNELS","channelArray","SimulateMethod","METHODS","chooseMethod","chooseMethods","m","useMethod","OPEN_BROADCAST_CHANNELS","lastId","BroadcastChannel","ENFORCED_OPTIONS","_prepareChannel","_post","listenObj","_removeListenerObject","_addListenerObject","awaitPrepare","broadcastChannel","sendPromise","maybePromise","_hasMessageListeners","_startListening","o","_stopListening","listenerFn","listenerObject","hundredMsInMicro","minMessageTime","addBrowser","oldClose","addNode","isNode","USE_METHOD","LISTENERS","startedListening","startListening","runAll","add","addReturn","promises","sendLeaderMessage","leaderElector","msgJson","beLeader","unloadFn","unloadAdd","isLeaderListener","LeaderElectionWebLock","_this2","locks","relevantLocks","lock","_this3","returnPromise","_fn","_this4","uFn","LeaderElection","hasLeaderListener","isFromFallbackInterval","applyRun","stopCriteria","stopCriteriaPromiseResolve","stopCriteriaPromise","handleMessage","waitForAnswerTime","_awaitLeadershipOnce","resolved","finish","whenDeathListener","tryOnFallBack","createLeaderElection","elector","SyncStorageService","syncChannelName","LeaderElectionService","electionChannelName","getNow","RenewOnTabActivationService","AUTO_RENEW","SYNC_STORAGE","LEADER_ELECTION","RENEW_ON_TAB_ACTIVATION","ServiceManager","syncStorage","svc","srv","canStart","service","mixinCore","restoreOriginalUri","sessionExists","getSession","session","closeSession","refreshSession","setCookieAndRedirect","sessionToken","redirectUrl","createSessionApi","mixinSession","createOktaAuthCore","StorageManagerConstructor","WithStorage","WithHttp","WithSession","WithOAuth","isMessageFromCorrectSource","fingerprint","container","getEnrolledCredentials","enrollement","buildCredentialCreationOptions","activationData","buildCredentialRequestOptions","challengeData","getAttestation","credential","getAssertion","mixinIdx","webauthn","createOktaAuthIdx","Core","createBaseOptionsConstructor","getStorage","STORAGE_MANAGER_OPTIONS","getCookieSettings","cookieSettings","createStorageOptionsConstructor","BaseOptionsConstructor","appJsonContentTypeRegex","readData","formatResult","pair","fetchRequest","contentType","crossFetch","fetchPromise","createHttpOptionsConstructor","StorageOptionsConstructor","enableSharedStorage","assertValidConfig","isUrlRegex","createOAuthOptionsConstructor","HttpOptionsConstructor","createCoreOptionsConstructor","OAuthOptionsConstructor","createIdxOptionsConstructor","CoreOptionsConstructor","SavedObject","storageName","storageString","logServerSideMemoryStorageWarning","BaseStorageManager","storageManagerOptions","sectionName","overrideOptions","storageTypes","idx","createOAuthStorageManager","createCoreStorageManager","createIdxStorageManager","CoreStorageManager","transactionStorage","isObjectWithProperties","isOAuthTransactionMeta","isCustomAuthTransactionMeta","isTransactionMeta","MAX_ENTRY_LIFETIME","pruneSharedStorage","entries","saveTransactionToSharedStorage","loadTransactionFromSharedStorage","clearTransactionFromSharedStorage","createTransactionManager","createIdxTransactionManager","TransactionManager","storedValue","BaseTransaction","sendRequest","TransactionClass","accessTokenObj","generateRequestFnFromLinks","methodName","links","ProfileTransaction","createdAt","modifiedAt","profile","ProfileSchemaTransaction","EmailRole","Status","PasswordStatus","getProfile","updateProfile","getProfileSchema","EmailStatusTransaction","EmailChallengeTransaction","_links","EmailTransaction","roles","getEmails","getEmail","addEmail","deleteEmail","sendEmailChallenge","getEmailChallenge","emailId","challengeId","verifyEmailChallenge","PhoneTransaction","getPhones","getPhone","addPhone","deletePhone","sendPhoneChallenge","verifyPhoneChallenge","PasswordTransaction","created","lastUpdated","getPassword","enrollPassword","updatePassword","deletePassword","mixinMyAccount","addStateToken","builtArgs","getStateToken","transactionStatus","resumeTransaction","stateToken","getSavedStateToken","introspectAuthn","transactionStep","transactionExists","postToTransaction","link2fn","ref","lk","autoPush","rememberDevice","AuthPollStopError","getPollFn","delay$1","transactionCallBack","pollLink","pollFn","retryCount","recursivePoll","pollRes","delayLength","links2fns","fns","flattenEmbedded","objArr","ol","embedded","AuthnTransactionImpl","createAuthnTransactionAPI","mixinAuthn","_postToTransaction","WithIdx","WithMyAccount","WithAuthn","OktaAuth","encodeState","decodeState","encodedState","_OktaSvelteStore","onAuthRequiredCallbackFn","onAuthResumeCallbackFn","onAuthUpdatedCallbackFn","onSignupCallbackFn","onActivateFn","onUpdateUserProfileFn","onSignoutCallbackFn","userClaims","dateToYYYYMMDD","date","writable","config","derived","$authState","$v","tick","decodedState","callbackFn","activateResult","username","redirect","cta","isSocialLogin","newUserInfo","updatedUser","OktaSvelteStore","useOktaStore"],"mappings":"wUAqKY,IAAAA,IAAAA,IAIVA,EAAA,YAAc,IAIdA,EAAA,aAAe,IAIfA,EAAA,WAAa,sBAZHA,IAAAA,IAAA,CAAA,CAAA,EAkBAC,IAAAA,IACVA,EAAAC,EAAA,eAAA,CAAA,EAAA,iBACAD,EAAAC,EAAA,WAAA,CAAA,EAAA,aACAD,EAAAC,EAAA,cAAA,CAAA,EAAA,gBACAD,EAAAC,EAAA,iBAAA,CAAA,EAAA,mBAJUD,IAAAA,IAAA,CAAA,CAAA,EAUL,MAAME,WAAkB,KAAM,CAW5B,YAAYC,EAAiBC,EAAyBC,EAAa,CACxE,MAAMF,CAAO,EAXPG,EAAA,gBACAA,EAAA,eAWN,KAAK,QAAUF,EACf,KAAK,OAASC,CAAA,CAGhB,IAAW,QAA0B,CACnC,OAAO,KAAK,OAAA,CAGd,IAAW,OAAa,CACtB,OAAO,KAAK,MAAA,CAEhB,CCzNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAYA,IAAIE,IACH,SAAUA,EAAW,CAClBA,EAAU,QAAa,UACvBA,EAAU,QAAa,UACvBA,EAAU,QAAa,UACvBA,EAAU,SAAc,WACxBA,EAAU,SAAc,UAC5B,GAAGA,KAAcA,GAAY,CAAA,EAAG,EAChC,IAAIC,GACH,SAAUA,EAAkB,CACzBA,EAAiB,cAAmB,gBACpCA,EAAiB,WAAgB,aACjCA,EAAiB,aAAkB,eACnCA,EAAiB,qBAA0B,aAC3CA,EAAiB,kBAAuB,oBACxCA,EAAiB,YAAiB,cAClCA,EAAiB,SAAc,UACnC,GAAGA,IAAqBA,EAAmB,CAAA,EAAG,E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AY,gBAChC,CAAA,CACD,EAEK,MAAA1jB,EAAWpnB,GAAI,KAAK,SAAS,EAEnC,GAAIonB,EACK,OAAAA,CACT,CAGF,cAAQ,MAAM,yFAAyF,EACjG,IAAI,MAAM,yFAAyF,CAAA,KAEzG,eAAQ,MAAM,iDAAiD,EACzD,MAAM,iDAAiD,CAC/D,CAEJ,EA9lBExuB,EAFWywC,EAEI,oBAGfzwC,EALWywC,EAKI,WACfzwC,EANWywC,EAMI,WACfzwC,EAPWywC,EAOI,aACfzwC,EARWywC,EAQI,gBACfzwC,EATWywC,EASI,WAefzwC,EAxBWywC,EAwBI,UAAkC,MAxB5C,IAAM0B,GAAN1B,ECxBA,MAAM2B,GAAeD,GAAgB","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217]}