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mB,CAC3D,IAAKhB,EAID,YAHAnF,KAAKc,OAAOwB,MAAM,+EAADQ,OACkE3C,EAAQwC,aAI/F2C,aAAatF,KAAKuE,WAClBZ,OAAOc,oBACH,UACAzE,KAAK6B,gBACL,GAEJ7B,KAAKuB,YAAcpB,EAAQoB,YAC3BvB,KAAKoG,iBAAmBjG,EAAQkC,KAAKpB,QACrCjB,KAAKc,OAAOuE,QAAQ,qEAADvC,OACsD9C,KAAKuB,cAE9EvB,KAAKgC,eAAe2C,IAAI,CACpBY,oBAAoB,EACpBV,SAAS,IAGbM,EAAkBhC,UAClBnD,KAAK0B,mBAAmBsD,OAAO7E,EAAQwC,WAC1C,CAEJ,CAAC,MAAO0D,GACLrG,KAAKc,OAAOwF,MAAM,6CAClBtG,KAAKc,OAAOyF,SAAS,8CAADzD,OAC8BuD,IAElDrG,KAAKc,OAAOyF,SAAS,mBAADzD,OAAoBqB,IAEpCsB,EACAA,EAASlI,OAAO8I,GACTlB,GACPA,EAAkB5H,OAAO8I,EAEhC,C,CAOLG,cAAAA,GACI,OAAOxG,KAAKuB,W,CAOhBkF,mBAAAA,GACI,OAAOzG,KAAKoG,gB,CAUhB,wBAAOM,CACHC,EACA7F,EACA8F,EACAC,GAGA,GADA/F,EAAOwB,MAAM,6BACRqE,EAAOG,OAAOC,kBAKf,OAJAjG,EAAOwB,MACH,yEAGG,EAGX,IAAKsE,EAKD,OAJA9F,EAAOwB,MACH,kFAGG,EAGX,GAAIuE,EACA,OAAQA,GACJ,KAAKG,EAAAA,GAAqBC,OAC1B,KAAKD,EAAAA,GAAqBE,IAItB,OAHApG,EAAOwB,MACH,yEAEG,EACX,QAII,OAHAxB,EAAOwB,MACH,8EAEG,EAInB,OAAO,C,kFCvZR,MAAM6E,EAA4B,4BAC5BC,EAAc,cACdC,EAAa,aAEbC,EAAmB,mBACnBC,EAAW,WACXC,EAAsB,qB","sources":["../node_modules/@azure/msal-browser/src/app/IPublicClientApplication.ts","../node_modules/@azure/msal-browser/src/app/PublicClientApplication.ts","../node_modules/@azure/msal-browser/src/broker/nativeBroker/NativeMessageHandler.ts","../node_modules/@azure/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n AccountFilter,\n AccountInfo,\n Logger,\n PerformanceCallbackFunction,\n} from \"@azure/msal-common/browser\";\nimport { RedirectRequest } from \"../request/RedirectRequest.js\";\nimport { PopupRequest } from \"../request/PopupRequest.js\";\nimport { SilentRequest } from \"../request/SilentRequest.js\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest.js\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest.js\";\nimport {\n BrowserConfigurationAuthErrorCodes,\n createBrowserConfigurationAuthError,\n} from \"../error/BrowserConfigurationAuthError.js\";\nimport { WrapperSKU } from \"../utils/BrowserConstants.js\";\nimport { INavigationClient } from \"../navigation/INavigationClient.js\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest.js\";\nimport { ITokenCache } from \"../cache/ITokenCache.js\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest.js\";\nimport { BrowserConfiguration } from \"../config/Configuration.js\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult.js\";\nimport { EventCallbackFunction } from \"../event/EventMessage.js\";\nimport { ClearCacheRequest } from \"../request/ClearCacheRequest.js\";\nimport { InitializeApplicationRequest } from \"../request/InitializeApplicationRequest.js\";\nimport { EventType } from \"../event/EventType.js\";\n\nexport interface IPublicClientApplication {\n // TODO: Make request mandatory in the next major version?\n initialize(request?: InitializeApplicationRequest): Promise;\n acquireTokenPopup(request: PopupRequest): Promise;\n acquireTokenRedirect(request: RedirectRequest): Promise;\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Promise;\n acquireTokenByCode(\n request: AuthorizationCodeRequest\n ): Promise;\n addEventCallback(\n callback: EventCallbackFunction,\n eventTypes?: Array\n ): string | null;\n removeEventCallback(callbackId: string): void;\n addPerformanceCallback(callback: PerformanceCallbackFunction): string;\n removePerformanceCallback(callbackId: string): boolean;\n enableAccountStorageEvents(): void;\n disableAccountStorageEvents(): void;\n getAccount(accountFilter: AccountFilter): AccountInfo | null;\n getAccountByHomeId(homeAccountId: string): AccountInfo | null;\n getAccountByLocalId(localId: string): AccountInfo | null;\n getAccountByUsername(userName: string): AccountInfo | null;\n getAllAccounts(): AccountInfo[];\n handleRedirectPromise(hash?: string): Promise;\n loginPopup(request?: PopupRequest): Promise;\n loginRedirect(request?: RedirectRequest): Promise;\n logout(logoutRequest?: EndSessionRequest): Promise;\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise;\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise;\n ssoSilent(request: SsoSilentRequest): Promise;\n getTokenCache(): ITokenCache;\n getLogger(): Logger;\n setLogger(logger: Logger): void;\n setActiveAccount(account: AccountInfo | null): void;\n getActiveAccount(): AccountInfo | null;\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void;\n setNavigationClient(navigationClient: INavigationClient): void;\n /** @internal */\n getConfiguration(): BrowserConfiguration;\n hydrateCache(\n result: AuthenticationResult,\n request:\n | SilentRequest\n | SsoSilentRequest\n | RedirectRequest\n | PopupRequest\n ): Promise;\n clearCache(logoutRequest?: ClearCacheRequest): Promise;\n}\n\nexport const stubbedPublicClientApplication: IPublicClientApplication = {\n initialize: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n acquireTokenPopup: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n acquireTokenRedirect: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n acquireTokenSilent: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n acquireTokenByCode: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n getAllAccounts: () => {\n return [];\n },\n getAccount: () => {\n return null;\n },\n getAccountByHomeId: () => {\n return null;\n },\n getAccountByUsername: () => {\n return null;\n },\n getAccountByLocalId: () => {\n return null;\n },\n handleRedirectPromise: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n loginPopup: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n loginRedirect: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n logout: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n logoutRedirect: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n logoutPopup: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n ssoSilent: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n addEventCallback: () => {\n return null;\n },\n removeEventCallback: () => {\n return;\n },\n addPerformanceCallback: () => {\n return \"\";\n },\n removePerformanceCallback: () => {\n return false;\n },\n enableAccountStorageEvents: () => {\n return;\n },\n disableAccountStorageEvents: () => {\n return;\n },\n getTokenCache: () => {\n throw createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n );\n },\n getLogger: () => {\n throw createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n );\n },\n setLogger: () => {\n return;\n },\n setActiveAccount: () => {\n return;\n },\n getActiveAccount: () => {\n return null;\n },\n initializeWrapperLibrary: () => {\n return;\n },\n setNavigationClient: () => {\n return;\n },\n getConfiguration: () => {\n throw createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n );\n },\n hydrateCache: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n clearCache: () => {\n return Promise.reject(\n createBrowserConfigurationAuthError(\n BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled\n )\n );\n },\n};\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITokenCache } from \"../cache/ITokenCache.js\";\nimport { INavigationClient } from \"../navigation/INavigationClient.js\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest.js\";\nimport { PopupRequest } from \"../request/PopupRequest.js\";\nimport { RedirectRequest } from \"../request/RedirectRequest.js\";\nimport { SilentRequest } from \"../request/SilentRequest.js\";\nimport { WrapperSKU } from \"../utils/BrowserConstants.js\";\nimport { IPublicClientApplication } from \"./IPublicClientApplication.js\";\nimport { IController } from \"../controllers/IController.js\";\nimport {\n PerformanceCallbackFunction,\n AccountInfo,\n AccountFilter,\n Logger,\n} from \"@azure/msal-common/browser\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest.js\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest.js\";\nimport * as ControllerFactory from \"../controllers/ControllerFactory.js\";\nimport { StandardController } from \"../controllers/StandardController.js\";\nimport {\n BrowserConfiguration,\n Configuration,\n} from \"../config/Configuration.js\";\nimport { StandardOperatingContext } from \"../operatingcontext/StandardOperatingContext.js\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult.js\";\nimport { EventCallbackFunction } from \"../event/EventMessage.js\";\nimport { ClearCacheRequest } from \"../request/ClearCacheRequest.js\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest.js\";\nimport { NestedAppAuthController } from \"../controllers/NestedAppAuthController.js\";\nimport { NestedAppOperatingContext } from \"../operatingcontext/NestedAppOperatingContext.js\";\nimport { InitializeApplicationRequest } from \"../request/InitializeApplicationRequest.js\";\nimport { EventType } from \"../event/EventType.js\";\n\n/**\n * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications\n * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.\n */\nexport class PublicClientApplication implements IPublicClientApplication {\n protected controller: IController;\n\n /**\n * Creates StandardController and passes it to the PublicClientApplication\n *\n * @param configuration {Configuration}\n */\n public static async createPublicClientApplication(\n configuration: Configuration\n ): Promise {\n const controller = await ControllerFactory.createV3Controller(\n configuration\n );\n const pca = new PublicClientApplication(configuration, controller);\n\n return pca;\n }\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n * @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)\n */\n public constructor(configuration: Configuration, controller?: IController) {\n this.controller =\n controller ||\n new StandardController(new StandardOperatingContext(configuration));\n }\n\n /**\n * Initializer function to perform async startup tasks such as connecting to WAM extension\n * @param request {?InitializeApplicationRequest}\n */\n async initialize(request?: InitializeApplicationRequest): Promise {\n return this.controller.initialize(request);\n }\n\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenPopup(\n request: PopupRequest\n ): Promise {\n return this.controller.acquireTokenPopup(request);\n }\n\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n acquireTokenRedirect(request: RedirectRequest): Promise {\n return this.controller.acquireTokenRedirect(request);\n }\n\n /**\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\n *\n * @param {@link (SilentRequest:type)}\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object\n */\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Promise {\n return this.controller.acquireTokenSilent(silentRequest);\n }\n\n /**\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\n * This API is not indended for normal authorization code acquisition and redemption.\n *\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\n *\n * @param request {@link AuthorizationCodeRequest}\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenByCode(\n request: AuthorizationCodeRequest\n ): Promise {\n return this.controller.acquireTokenByCode(request);\n }\n\n /**\n * Adds event callbacks to array\n * @param callback\n * @param eventTypes\n */\n addEventCallback(\n callback: EventCallbackFunction,\n eventTypes?: Array\n ): string | null {\n return this.controller.addEventCallback(callback, eventTypes);\n }\n\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId: string): void {\n return this.controller.removeEventCallback(callbackId);\n }\n\n /**\n * Registers a callback to receive performance events.\n *\n * @param {PerformanceCallbackFunction} callback\n * @returns {string}\n */\n addPerformanceCallback(callback: PerformanceCallbackFunction): string {\n return this.controller.addPerformanceCallback(callback);\n }\n\n /**\n * Removes a callback registered with addPerformanceCallback.\n *\n * @param {string} callbackId\n * @returns {boolean}\n */\n removePerformanceCallback(callbackId: string): boolean {\n return this.controller.removePerformanceCallback(callbackId);\n }\n\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents(): void {\n this.controller.enableAccountStorageEvents();\n }\n\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents(): void {\n this.controller.disableAccountStorageEvents();\n }\n\n /**\n * Returns the first account found in the cache that matches the account filter passed in.\n * @param accountFilter\n * @returns The first account found in the cache matching the provided filter or null if no account could be found.\n */\n getAccount(accountFilter: AccountFilter): AccountInfo | null {\n return this.controller.getAccount(accountFilter);\n }\n\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n * @deprecated - Use getAccount instead\n */\n getAccountByHomeId(homeAccountId: string): AccountInfo | null {\n return this.controller.getAccountByHomeId(homeAccountId);\n }\n\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n * @deprecated - Use getAccount instead\n */\n getAccountByLocalId(localId: string): AccountInfo | null {\n return this.controller.getAccountByLocalId(localId);\n }\n\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param userName\n * @returns The account object stored in MSAL\n * @deprecated - Use getAccount instead\n */\n getAccountByUsername(userName: string): AccountInfo | null {\n return this.controller.getAccountByUsername(userName);\n }\n\n /**\n * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.\n * @param accountFilter - (Optional) filter to narrow down the accounts returned\n * @returns Array of AccountInfo objects in cache\n */\n getAllAccounts(accountFilter?: AccountFilter): AccountInfo[] {\n return this.controller.getAllAccounts(accountFilter);\n }\n\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n handleRedirectPromise(\n hash?: string | undefined\n ): Promise {\n return this.controller.handleRedirectPromise(hash);\n }\n\n /**\n * Use when initiating the login process via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n loginPopup(\n request?: PopupRequest | undefined\n ): Promise {\n return this.controller.loginPopup(request);\n }\n\n /**\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\n * any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n loginRedirect(request?: RedirectRequest | undefined): Promise {\n return this.controller.loginRedirect(request);\n }\n\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest\n * @deprecated\n */\n logout(logoutRequest?: EndSessionRequest): Promise {\n return this.controller.logout(logoutRequest);\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise {\n return this.controller.logoutRedirect(logoutRequest);\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest\n */\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise {\n return this.controller.logoutPopup(logoutRequest);\n }\n\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n ssoSilent(request: SsoSilentRequest): Promise {\n return this.controller.ssoSilent(request);\n }\n\n /**\n * Gets the token cache for the application.\n */\n getTokenCache(): ITokenCache {\n return this.controller.getTokenCache();\n }\n\n /**\n * Returns the logger instance\n */\n getLogger(): Logger {\n return this.controller.getLogger();\n }\n\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger: Logger): void {\n this.controller.setLogger(logger);\n }\n\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account: AccountInfo | null): void {\n this.controller.setActiveAccount(account);\n }\n\n /**\n * Gets the currently active account\n */\n getActiveAccount(): AccountInfo | null {\n return this.controller.getActiveAccount();\n }\n\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void {\n return this.controller.initializeWrapperLibrary(sku, version);\n }\n\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient: INavigationClient): void {\n this.controller.setNavigationClient(navigationClient);\n }\n\n /**\n * Returns the configuration object\n * @internal\n */\n getConfiguration(): BrowserConfiguration {\n return this.controller.getConfiguration();\n }\n\n /**\n * Hydrates cache with the tokens and account in the AuthenticationResult object\n * @param result\n * @param request - The request object that was used to obtain the AuthenticationResult\n * @returns\n */\n async hydrateCache(\n result: AuthenticationResult,\n request:\n | SilentRequest\n | SsoSilentRequest\n | RedirectRequest\n | PopupRequest\n ): Promise {\n return this.controller.hydrateCache(result, request);\n }\n\n /**\n * Clears tokens and account from the browser cache.\n * @param logoutRequest\n */\n clearCache(logoutRequest?: ClearCacheRequest): Promise {\n return this.controller.clearCache(logoutRequest);\n }\n}\n\n/**\n * creates NestedAppAuthController and passes it to the PublicClientApplication,\n * falls back to StandardController if NestedAppAuthController is not available\n *\n * @param configuration\n * @returns IPublicClientApplication\n *\n */\nexport async function createNestablePublicClientApplication(\n configuration: Configuration\n): Promise {\n const nestedAppAuth = new NestedAppOperatingContext(configuration);\n await nestedAppAuth.initialize();\n\n if (nestedAppAuth.isAvailable()) {\n const controller = new NestedAppAuthController(nestedAppAuth);\n return new PublicClientApplication(configuration, controller);\n }\n\n return createStandardPublicClientApplication(configuration);\n}\n\n/**\n * creates PublicClientApplication using StandardController\n *\n * @param configuration\n * @returns IPublicClientApplication\n *\n */\nexport async function createStandardPublicClientApplication(\n configuration: Configuration\n): Promise {\n const pca = new PublicClientApplication(configuration);\n await pca.initialize();\n return pca;\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n NativeConstants,\n NativeExtensionMethod,\n} from \"../../utils/BrowserConstants.js\";\nimport {\n Logger,\n AuthError,\n createAuthError,\n AuthErrorCodes,\n AuthenticationScheme,\n InProgressPerformanceEvent,\n PerformanceEvents,\n IPerformanceClient,\n} from \"@azure/msal-common/browser\";\nimport {\n NativeExtensionRequest,\n NativeExtensionRequestBody,\n} from \"./NativeRequest.js\";\nimport { createNativeAuthError } from \"../../error/NativeAuthError.js\";\nimport {\n createBrowserAuthError,\n BrowserAuthErrorCodes,\n} from \"../../error/BrowserAuthError.js\";\nimport { BrowserConfiguration } from \"../../config/Configuration.js\";\nimport { createNewGuid } from \"../../crypto/BrowserCrypto.js\";\n\ntype ResponseResolvers = {\n resolve: (value: T | PromiseLike) => void;\n reject: (\n value: AuthError | Error | PromiseLike | PromiseLike\n ) => void;\n};\n\nexport class NativeMessageHandler {\n private extensionId: string | undefined;\n private extensionVersion: string | undefined;\n private logger: Logger;\n private readonly handshakeTimeoutMs: number;\n private timeoutId: number | undefined;\n private resolvers: Map>;\n private handshakeResolvers: Map>;\n private messageChannel: MessageChannel;\n private readonly windowListener: (event: MessageEvent) => void;\n private readonly performanceClient: IPerformanceClient;\n private readonly handshakeEvent: InProgressPerformanceEvent;\n\n constructor(\n logger: Logger,\n handshakeTimeoutMs: number,\n performanceClient: IPerformanceClient,\n extensionId?: string\n ) {\n this.logger = logger;\n this.handshakeTimeoutMs = handshakeTimeoutMs;\n this.extensionId = extensionId;\n this.resolvers = new Map(); // Used for non-handshake messages\n this.handshakeResolvers = new Map(); // Used for handshake messages\n this.messageChannel = new MessageChannel();\n this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound\n this.performanceClient = performanceClient;\n this.handshakeEvent = performanceClient.startMeasurement(\n PerformanceEvents.NativeMessageHandlerHandshake\n );\n }\n\n /**\n * Sends a given message to the extension and resolves with the extension response\n * @param body\n */\n async sendMessage(body: NativeExtensionRequestBody): Promise {\n this.logger.trace(\"NativeMessageHandler - sendMessage called.\");\n const req: NativeExtensionRequest = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: createNewGuid(),\n body: body,\n };\n\n this.logger.trace(\n \"NativeMessageHandler - Sending request to browser extension\"\n );\n this.logger.tracePii(\n `NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(\n req\n )}`\n );\n this.messageChannel.port1.postMessage(req);\n\n return new Promise((resolve, reject) => {\n this.resolvers.set(req.responseId, { resolve, reject });\n });\n }\n\n /**\n * Returns an instance of the MessageHandler that has successfully established a connection with an extension\n * @param {Logger} logger\n * @param {number} handshakeTimeoutMs\n * @param {IPerformanceClient} performanceClient\n * @param {ICrypto} crypto\n */\n static async createProvider(\n logger: Logger,\n handshakeTimeoutMs: number,\n performanceClient: IPerformanceClient\n ): Promise {\n logger.trace(\"NativeMessageHandler - createProvider called.\");\n try {\n const preferredProvider = new NativeMessageHandler(\n logger,\n handshakeTimeoutMs,\n performanceClient,\n NativeConstants.PREFERRED_EXTENSION_ID\n );\n await preferredProvider.sendHandshakeRequest();\n return preferredProvider;\n } catch (e) {\n // If preferred extension fails for whatever reason, fallback to using any installed extension\n const backupProvider = new NativeMessageHandler(\n logger,\n handshakeTimeoutMs,\n performanceClient\n );\n await backupProvider.sendHandshakeRequest();\n return backupProvider;\n }\n }\n\n /**\n * Send handshake request helper.\n */\n private async sendHandshakeRequest(): Promise {\n this.logger.trace(\n \"NativeMessageHandler - sendHandshakeRequest called.\"\n );\n // Register this event listener before sending handshake\n window.addEventListener(\"message\", this.windowListener, false); // false is important, because content script message processing should work first\n\n const req: NativeExtensionRequest = {\n channel: NativeConstants.CHANNEL_ID,\n extensionId: this.extensionId,\n responseId: createNewGuid(),\n body: {\n method: NativeExtensionMethod.HandshakeRequest,\n },\n };\n this.handshakeEvent.add({\n extensionId: this.extensionId,\n extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,\n });\n\n this.messageChannel.port1.onmessage = (event) => {\n this.onChannelMessage(event);\n };\n\n window.postMessage(req, window.origin, [this.messageChannel.port2]);\n\n return new Promise((resolve, reject) => {\n this.handshakeResolvers.set(req.responseId, { resolve, reject });\n this.timeoutId = window.setTimeout(() => {\n /*\n * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.\n * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port\n */\n window.removeEventListener(\n \"message\",\n this.windowListener,\n false\n );\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n this.handshakeEvent.end({\n extensionHandshakeTimedOut: true,\n success: false,\n });\n reject(\n createBrowserAuthError(\n BrowserAuthErrorCodes.nativeHandshakeTimeout\n )\n );\n this.handshakeResolvers.delete(req.responseId);\n }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here\n });\n }\n\n /**\n * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.\n * @param event\n */\n private onWindowMessage(event: MessageEvent): void {\n this.logger.trace(\"NativeMessageHandler - onWindowMessage called\");\n // We only accept messages from ourselves\n if (event.source !== window) {\n return;\n }\n\n const request = event.data;\n\n if (\n !request.channel ||\n request.channel !== NativeConstants.CHANNEL_ID\n ) {\n return;\n }\n\n if (request.extensionId && request.extensionId !== this.extensionId) {\n return;\n }\n\n if (request.body.method === NativeExtensionMethod.HandshakeRequest) {\n const handshakeResolver = this.handshakeResolvers.get(\n request.responseId\n );\n /*\n * Filter out responses with no matched resolvers sooner to keep channel ports open while waiting for\n * the proper response.\n */\n if (!handshakeResolver) {\n this.logger.trace(\n `NativeMessageHandler.onWindowMessage - resolver can't be found for request ${request.responseId}`\n );\n return;\n }\n\n // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed\n this.logger.verbose(\n request.extensionId\n ? `Extension with id: ${request.extensionId} not installed`\n : \"No extension installed\"\n );\n clearTimeout(this.timeoutId);\n this.messageChannel.port1.close();\n this.messageChannel.port2.close();\n window.removeEventListener(\"message\", this.windowListener, false);\n this.handshakeEvent.end({\n success: false,\n extensionInstalled: false,\n });\n handshakeResolver.reject(\n createBrowserAuthError(\n BrowserAuthErrorCodes.nativeExtensionNotInstalled\n )\n );\n }\n }\n\n /**\n * Invoked when a message is received from the extension on the MessageChannel port\n * @param event\n */\n private onChannelMessage(event: MessageEvent): void {\n this.logger.trace(\"NativeMessageHandler - onChannelMessage called.\");\n const request = event.data;\n\n const resolver = this.resolvers.get(request.responseId);\n const handshakeResolver = this.handshakeResolvers.get(\n request.responseId\n );\n\n try {\n const method = request.body.method;\n\n if (method === NativeExtensionMethod.Response) {\n if (!resolver) {\n return;\n }\n const response = request.body.response;\n this.logger.trace(\n \"NativeMessageHandler - Received response from browser extension\"\n );\n this.logger.tracePii(\n `NativeMessageHandler - Received response from browser extension: ${JSON.stringify(\n response\n )}`\n );\n if (response.status !== \"Success\") {\n resolver.reject(\n createNativeAuthError(\n response.code,\n response.description,\n response.ext\n )\n );\n } else if (response.result) {\n if (\n response.result[\"code\"] &&\n response.result[\"description\"]\n ) {\n resolver.reject(\n createNativeAuthError(\n response.result[\"code\"],\n response.result[\"description\"],\n response.result[\"ext\"]\n )\n );\n } else {\n resolver.resolve(response.result);\n }\n } else {\n throw createAuthError(\n AuthErrorCodes.unexpectedError,\n \"Event does not contain result.\"\n );\n }\n this.resolvers.delete(request.responseId);\n } else if (method === NativeExtensionMethod.HandshakeResponse) {\n if (!handshakeResolver) {\n this.logger.trace(\n `NativeMessageHandler.onChannelMessage - resolver can't be found for request ${request.responseId}`\n );\n return;\n }\n clearTimeout(this.timeoutId); // Clear setTimeout\n window.removeEventListener(\n \"message\",\n this.windowListener,\n false\n ); // Remove 'No extension' listener\n this.extensionId = request.extensionId;\n this.extensionVersion = request.body.version;\n this.logger.verbose(\n `NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`\n );\n this.handshakeEvent.end({\n extensionInstalled: true,\n success: true,\n });\n\n handshakeResolver.resolve();\n this.handshakeResolvers.delete(request.responseId);\n }\n // Do nothing if method is not Response or HandshakeResponse\n } catch (err) {\n this.logger.error(\"Error parsing response from WAM Extension\");\n this.logger.errorPii(\n `Error parsing response from WAM Extension: ${err as string}`\n );\n this.logger.errorPii(`Unable to parse ${event}`);\n\n if (resolver) {\n resolver.reject(err as AuthError);\n } else if (handshakeResolver) {\n handshakeResolver.reject(err as AuthError);\n }\n }\n }\n\n /**\n * Returns the Id for the browser extension this handler is communicating with\n * @returns\n */\n getExtensionId(): string | undefined {\n return this.extensionId;\n }\n\n /**\n * Returns the version for the browser extension this handler is communicating with\n * @returns\n */\n getExtensionVersion(): string | undefined {\n return this.extensionVersion;\n }\n\n /**\n * Returns boolean indicating whether or not the request should attempt to use native broker\n * @param logger\n * @param config\n * @param nativeExtensionProvider\n * @param authenticationScheme\n */\n static isNativeAvailable(\n config: BrowserConfiguration,\n logger: Logger,\n nativeExtensionProvider?: NativeMessageHandler,\n authenticationScheme?: AuthenticationScheme\n ): boolean {\n logger.trace(\"isNativeAvailable called\");\n if (!config.system.allowNativeBroker) {\n logger.trace(\n \"isNativeAvailable: allowNativeBroker is not enabled, returning false\"\n );\n // Developer disabled WAM\n return false;\n }\n\n if (!nativeExtensionProvider) {\n logger.trace(\n \"isNativeAvailable: WAM extension provider is not initialized, returning false\"\n );\n // Extension is not available\n return false;\n }\n\n if (authenticationScheme) {\n switch (authenticationScheme) {\n case AuthenticationScheme.BEARER:\n case AuthenticationScheme.POP:\n logger.trace(\n \"isNativeAvailable: authenticationScheme is supported, returning true\"\n );\n return true;\n default:\n logger.trace(\n \"isNativeAvailable: authenticationScheme is not supported, returning false\"\n );\n return false;\n }\n }\n\n return true;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Status Codes that can be thrown by WAM\nexport const USER_INTERACTION_REQUIRED = \"USER_INTERACTION_REQUIRED\";\nexport const USER_CANCEL = \"USER_CANCEL\";\nexport const NO_NETWORK = \"NO_NETWORK\";\nexport const TRANSIENT_ERROR = \"TRANSIENT_ERROR\";\nexport const PERSISTENT_ERROR = \"PERSISTENT_ERROR\";\nexport const DISABLED = \"DISABLED\";\nexport const ACCOUNT_UNAVAILABLE = \"ACCOUNT_UNAVAILABLE\";\n"],"names":["stubbedPublicClientApplication","initialize","Promise","reject","createBrowserConfigurationAuthError","stubbedPublicClientApplicationCalled","acquireTokenPopup","acquireTokenRedirect","acquireTokenSilent","acquireTokenByCode","getAllAccounts","getAccount","getAccountByHomeId","getAccountByUsername","getAccountByLocalId","handleRedirectPromise","loginPopup","loginRedirect","logout","logoutRedirect","logoutPopup","ssoSilent","addEventCallback","removeEventCallback","addPerformanceCallback","removePerformanceCallback","enableAccountStorageEvents","disableAccountStorageEvents","getTokenCache","getLogger","setLogger","setActiveAccount","getActiveAccount","initializeWrapperLibrary","setNavigationClient","getConfiguration","hydrateCache","clearCache","PublicClientApplication","createPublicClientApplication","configuration","controller","createV3Controller","constructor","this","StandardController","StandardOperatingContext","request","silentRequest","callback","eventTypes","callbackId","accountFilter","homeAccountId","localId","userName","hash","logoutRequest","logger","account","sku","version","navigationClient","result","NativeMessageHandler","handshakeTimeoutMs","performanceClient","extensionId","resolvers","Map","handshakeResolvers","messageChannel","MessageChannel","windowListener","onWindowMessage","bind","handshakeEvent","startMeasurement","PerformanceEvents","NativeMessageHandlerHandshake","sendMessage","body","trace","req","channel","NativeConstants","CHANNEL_ID","responseId","createNewGuid","tracePii","concat","JSON","stringify","port1","postMessage","resolve","set","createProvider","preferredProvider","PREFERRED_EXTENSION_ID","sendHandshakeRequest","e","backupProvider","window","addEventListener","method","NativeExtensionMethod","HandshakeRequest","add","extensionHandshakeTimeoutMs","onmessage","event","onChannelMessage","origin","port2","timeoutId","setTimeout","removeEventListener","close","end","extensionHandshakeTimedOut","success","createBrowserAuthError","nativeHandshakeTimeout","delete","source","data","handshakeResolver","get","verbose","clearTimeout","extensionInstalled","nativeExtensionNotInstalled","resolver","Response","response","status","createNativeAuthError","code","description","ext","createAuthError","AuthErrorCodes","HandshakeResponse","extensionVersion","err","error","errorPii","getExtensionId","getExtensionVersion","isNativeAvailable","config","nativeExtensionProvider","authenticationScheme","system","allowNativeBroker","AuthenticationScheme","BEARER","POP","USER_INTERACTION_REQUIRED","USER_CANCEL","NO_NETWORK","PERSISTENT_ERROR","DISABLED","ACCOUNT_UNAVAILABLE"],"sourceRoot":""}