{"version":3,"file":"PopupClient.js","sources":["../../src/interaction_client/PopupClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, ThrottlingUtils, CommonEndSessionRequest, UrlString, AuthError, OIDC_DEFAULT_SCOPES, Constants, ProtocolUtils, ServerAuthorizationCodeResponse, PerformanceEvents, StringUtils, IPerformanceClient, Logger, ICrypto } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { EventType } from \"../event/EventType\";\nimport { InteractionType, ApiId, BrowserConstants } from \"../utils/BrowserConstants\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { NativeInteractionClient } from \"./NativeInteractionClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { InteractionHandler, InteractionParams } from \"../interaction_handler/InteractionHandler\";\nimport { PopupWindowAttributes } from \"../request/PopupWindowAttributes\";\n\nexport type PopupParams = InteractionParams & {\n popup?: Window|null;\n popupName: string;\n popupWindowAttributes: PopupWindowAttributes\n};\n\nexport class PopupClient extends StandardInteractionClient {\n private currentWindow: Window | undefined;\n protected nativeStorage: BrowserCacheManager;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeStorageImpl: BrowserCacheManager, nativeMessageHandler?: NativeMessageHandler, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId);\n // Properly sets this reference for the unload event.\n this.unloadWindow = this.unloadWindow.bind(this);\n this.nativeStorage = nativeStorageImpl;\n }\n\n /**\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\n * @param request\n */\n acquireToken(request: PopupRequest): Promise {\n try {\n const popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\n const popupWindowAttributes = request.popupWindowAttributes || {};\n\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\n // Passes on popup position and dimensions if in request\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\n } else {\n // asyncPopups flag is set to false. Opens popup before acquiring token.\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\n }\n } catch (e) {\n return Promise.reject(e);\n }\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 logout(logoutRequest?: EndSessionPopupRequest): Promise {\n try {\n this.logger.verbose(\"logoutPopup called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n\n const popupName = this.generateLogoutPopupName(validLogoutRequest);\n const authority = logoutRequest && logoutRequest.authority;\n const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\n const popupWindowAttributes = logoutRequest?.popupWindowAttributes || {};\n\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\n if (this.config.system.asyncPopups) {\n this.logger.verbose(\"asyncPopups set to true\");\n // Passes on popup position and dimensions if in request\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\n } else {\n // asyncPopups flag is set to false. Opens popup before logging out.\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\n const popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\n }\n } catch (e) {\n // Since this function is synchronous we need to reject\n return Promise.reject(e);\n }\n }\n\n /**\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\n * @param validRequest\n * @param popupName\n * @param popup\n * @param popupWindowAttributes\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenPopupAsync(request: PopupRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, popup?: Window|null): Promise {\n this.logger.verbose(\"acquireTokenPopupAsync called\");\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Popup);\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\n\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\n\n // Initialize the client\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\n // Start measurement for server calls with native brokering enabled\n let fetchNativeAccountIdMeasurement;\n if (isNativeBroker) {\n fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\n }\n\n // Create acquire token url.\n const navigateUrl = await authClient.getAuthCodeUrl({\n ...validRequest,\n nativeBroker: isNativeBroker\n });\n\n // Create popup interaction handler.\n const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger);\n\n // Show the UI once the url has been created. Get the window handle for the popup.\n const popupParameters: PopupParams = {\n popup,\n popupName,\n popupWindowAttributes\n };\n const popupWindow: Window = this.initiateAuthRequest(navigateUrl, popupParameters);\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\n\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\n const hash = await this.monitorPopupForHash(popupWindow);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n const state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);\n // Remove throttle if it exists\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\n\n if (serverParams.accountId) {\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\n // end measurement for server call with native brokering enabled\n if (fetchNativeAccountIdMeasurement) {\n fetchNativeAccountIdMeasurement.endMeasurement({\n success: true,\n isNativeBroker: true\n });\n }\n\n if (!this.nativeMessageHandler) {\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\n }\n const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\n const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);\n return nativeInteractionClient.acquireToken({\n ...validRequest,\n state: userRequestState,\n prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\n }).finally(() => {\n this.browserStorage.cleanRequestByState(state);\n });\n }\n\n // Handle response from hash string.\n const result = await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\n\n return result;\n } catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(validRequest.state);\n throw e;\n }\n }\n\n /**\n *\n * @param validRequest\n * @param popupName\n * @param requestAuthority\n * @param popup\n * @param mainWindowRedirectUri\n * @param popupWindowAttributes\n */\n protected async logoutPopupAsync(validRequest: CommonEndSessionRequest, popupName: string, popupWindowAttributes: PopupWindowAttributes, requestAuthority?: string, popup?: Window|null, mainWindowRedirectUri?: string): Promise {\n this.logger.verbose(\"logoutPopupAsync called\");\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\n\n try {\n // Clear cache on logout\n await this.clearCacheOnLogout(validRequest.account);\n\n // Initialize the client\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);\n this.logger.verbose(\"Auth code client created\");\n\n // Create logout string and navigate user window to logout.\n const logoutUri: string = authClient.getLogoutUri(validRequest);\n\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\n\n // Open the popup window to requestUrl.\n const popupWindow = this.openPopup(logoutUri, {popupName, popupWindowAttributes, popup});\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, {popupWindow}, null);\n\n await this.waitForLogoutPopup(popupWindow);\n\n if (mainWindowRedirectUri) {\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.logoutPopup,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false\n };\n const absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());\n\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\n this.logger.verbosePii(`Redirecting main window to: ${absoluteUrl}`);\n this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\n } else {\n this.logger.verbose(\"No main window navigation requested\");\n }\n } catch (e) {\n if (popup) {\n // Close the synchronous popup if an error is thrown before the window unload event is registered\n popup.close();\n }\n\n if (e instanceof AuthError) {\n (e as AuthError).setCorrelationId(this.correlationId);\n }\n\n this.browserStorage.setInteractionInProgress(false);\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e);\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n serverTelemetryManager.cacheFailedRequest(e);\n throw e;\n }\n\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\n }\n\n /**\n * Opens a popup window with given request Url.\n * @param requestUrl\n */\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\n // Check that request url is not empty.\n if (!StringUtils.isEmpty(requestUrl)) {\n this.logger.infoPii(`Navigate to: ${requestUrl}`);\n // Open the popup window to requestUrl.\n return this.openPopup(requestUrl, params);\n } else {\n // Throw error if request URL is empty.\n this.logger.error(\"Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Monitors a window until it loads a url with the same origin.\n * @param popupWindow - window that is being monitored\n * @param timeout - timeout for processing hash once popup is redirected back to application\n */\n monitorPopupForHash(popupWindow: Window): Promise {\n return new Promise((resolve, reject) => {\n /*\n * Polling for popups needs to be tick-based,\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\n */\n const maxTicks = this.config.system.windowHashTimeout / this.config.system.pollIntervalMilliseconds;\n let ticks = 0;\n\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\n\n const intervalId = setInterval(() => {\n // Window is closed\n if (popupWindow.closed) {\n this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\n this.cleanPopup();\n clearInterval(intervalId);\n reject(BrowserAuthError.createUserCancelledError());\n return;\n }\n\n let href: string = Constants.EMPTY_STRING;\n let hash: string = Constants.EMPTY_STRING;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = popupWindow.location.href;\n hash = popupWindow.location.hash;\n } catch (e) {}\n\n // Don't process blank pages or cross domain\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\n return;\n }\n\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\n\n /*\n * Only run clock when we are on same domain for popups\n * as popup operations can take a long time.\n */\n ticks++;\n\n if (hash) {\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - found hash in url\");\n clearInterval(intervalId);\n this.cleanPopup(popupWindow);\n\n if (UrlString.hashContainsKnownProperties(hash)) {\n this.logger.verbose(\"PopupHandler.monitorPopupForHash - hash contains known properties, returning.\");\n resolve(hash);\n } else {\n this.logger.error(\"PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely.\");\n this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${hash}`);\n reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());\n }\n } else if (ticks > maxTicks) {\n this.logger.error(\"PopupHandler.monitorPopupForHash - unable to find hash in url, timing out\");\n clearInterval(intervalId);\n reject(BrowserAuthError.createMonitorPopupTimeoutError());\n }\n }, this.config.system.pollIntervalMilliseconds);\n });\n }\n\n /**\n * Waits for user interaction in logout popup window\n * @param popupWindow\n * @returns\n */\n waitForLogoutPopup(popupWindow: Window): Promise {\n return new Promise((resolve) => {\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - polling started\");\n\n const intervalId = setInterval(() => {\n // Window is closed\n if (popupWindow.closed) {\n this.logger.error(\"PopupHandler.waitForLogoutPopup - window closed\");\n this.cleanPopup();\n clearInterval(intervalId);\n resolve();\n }\n\n let href: string = Constants.EMPTY_STRING;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = popupWindow.location.href;\n } catch (e) {}\n\n // Don't process blank pages or cross domain\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\n return;\n }\n\n this.logger.verbose(\"PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.\");\n\n clearInterval(intervalId);\n this.cleanPopup(popupWindow);\n resolve();\n }, this.config.system.pollIntervalMilliseconds);\n });\n }\n\n /**\n * @hidden\n *\n * Configures popup window for login.\n *\n * @param urlNavigate\n * @param title\n * @param popUpWidth\n * @param popUpHeight\n * @param popupWindowAttributes\n * @ignore\n * @hidden\n */\n openPopup(urlNavigate: string, popupParams: PopupParams): Window {\n try {\n let popupWindow;\n // Popup window passed in, setting url to navigate to\n if (popupParams.popup) {\n popupWindow = popupParams.popup;\n this.logger.verbosePii(`Navigating popup window to: ${urlNavigate}`);\n popupWindow.location.assign(urlNavigate);\n } else if (typeof popupParams.popup === \"undefined\") {\n // Popup will be undefined if it was not passed in\n this.logger.verbosePii(`Opening popup window to: ${urlNavigate}`);\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\n }\n\n // Popup will be null if popups are blocked\n if (!popupWindow) {\n throw BrowserAuthError.createEmptyWindowCreatedError();\n }\n if (popupWindow.focus) {\n popupWindow.focus();\n }\n this.currentWindow = popupWindow;\n window.addEventListener(\"beforeunload\", this.unloadWindow);\n\n return popupWindow;\n } catch (e) {\n this.logger.error(\"error opening popup \" + (e as AuthError).message);\n this.browserStorage.setInteractionInProgress(false);\n throw BrowserAuthError.createPopupWindowError((e as AuthError).toString());\n }\n }\n\n /**\n * Helper function to set popup window dimensions and position\n * @param urlNavigate\n * @param popupName\n * @param popupWindowAttributes\n * @returns\n */\n openSizedPopup(urlNavigate: string, popupName: string, popupWindowAttributes: PopupWindowAttributes): Window|null {\n /**\n * adding winLeft and winTop to account for dual monitor\n * using screenLeft and screenTop for IE8 and earlier\n */\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\n const winTop = window.screenTop ? window.screenTop : window.screenY;\n /**\n * window.innerWidth displays browser window\"s height and width excluding toolbars\n * using document.documentElement.clientWidth for IE8 and earlier\n */\n const winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n const winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n\n let width = popupWindowAttributes.popupSize?.width;\n let height = popupWindowAttributes.popupSize?.height;\n let top = popupWindowAttributes.popupPosition?.top;\n let left = popupWindowAttributes.popupPosition?.left;\n\n if (!width || width < 0 || width > winWidth) {\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\n width = BrowserConstants.POPUP_WIDTH;\n }\n\n if (!height || height < 0 || height > winHeight) {\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\n height = BrowserConstants.POPUP_HEIGHT;\n }\n\n if (!top || top < 0 || top > winHeight) {\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\n top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);\n }\n\n if (!left || left < 0 || left > winWidth) {\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\n left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);\n }\n\n return window.open(urlNavigate, popupName, `width=${width}, height=${height}, top=${top}, left=${left}, scrollbars=yes`);\n }\n\n /**\n * Event callback to unload main window.\n */\n unloadWindow(e: Event): void {\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\n if (this.currentWindow) {\n this.currentWindow.close();\n }\n // Guarantees browser unload will happen, so no other errors will be thrown.\n e.preventDefault();\n }\n\n /**\n * Closes popup, removes any state vars created during popup calls.\n * @param popupWindow\n */\n cleanPopup(popupWindow?: Window): void {\n if (popupWindow) {\n // Close window.\n popupWindow.close();\n }\n // Remove window unload function\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\n\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n }\n\n /**\n * Generates the name for the popup based on the client id and request\n * @param clientId\n * @param request\n */\n generatePopupName(scopes: Array, authority: string): string {\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${scopes.join(\"-\")}.${authority}.${this.correlationId}`;\n }\n\n /**\n * Generates the name for the popup based on the client id and request for logouts\n * @param clientId\n * @param request\n */\n generateLogoutPopupName(request: CommonEndSessionRequest): string {\n const homeAccountId = request.account && request.account.homeAccountId;\n return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;IA6BiC,+BAAyB;IAItD,qBAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,iBAAqC,EAAE,iBAAsC,EAAE,oBAA2C,EAAE,aAAsB;QAAvU,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,CAAC,SAI5I;;QAFG,KAAI,CAAC,YAAY,GAAG,KAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACjD,KAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;;KAC1C;;;;;IAMD,kCAAY,GAAZ,UAAa,OAAqB;QAC9B,IAAI;YACA,IAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAM,IAAI,mBAAmB,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjI,IAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,EAAE,CAAC;;YAGlE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;gBAChC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;;gBAEhE,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;aACjF;iBAAM;;gBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+DAA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