@azure/msal-browser 5.20.0 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/index.mjs +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +2 -2
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +151 -14
- package/dist/popup_relay/index.mjs.map +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +139 -0
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs.map +1 -0
- package/dist/webBrokerBridge/index.mjs +7 -0
- package/dist/webBrokerBridge/index.mjs.map +1 -0
- package/lib/custom-auth-path/log-strings-mapping.json +2 -2
- package/lib/custom-auth-path/msal-custom-auth.cjs +90 -75
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +90 -75
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +2 -2
- package/lib/msal-browser.cjs +92 -77
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +92 -77
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +152 -15
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +152 -15
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +295 -0
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs.map +1 -0
- package/package.json +19 -2
- package/src/index.ts +0 -2
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/index.ts +202 -20
- package/src/webBrokerBridge/index.ts +2 -6
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/popup_relay/index.d.ts +27 -3
- package/types/popup_relay/index.d.ts.map +1 -1
- package/types/webBrokerBridge/index.d.cts +1 -0
- package/types/webBrokerBridge/index.d.ts +2 -5
- package/types/webBrokerBridge/index.d.ts.map +1 -1
package/dist/naa/BridgeError.mjs
CHANGED
package/dist/naa/BridgeProxy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { RequestParameterBuilder, CacheHelpers, StringUtils, Constants, createClientAuthError, ClientAuthErrorCodes, TimeUtils, AuthToken, getTenantIdFromIdTokenClaims, buildTenantProfile, AuthError } from '@azure/msal-common/browser';
|
|
4
4
|
import { isBridgeError } from '../BridgeError.mjs';
|
package/dist/packageMetadata.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/* eslint-disable header/header */
|
|
4
4
|
const name = "@azure/msal-browser";
|
|
5
|
-
const version = "5.
|
|
5
|
+
const version = "5.22.0";
|
|
6
6
|
|
|
7
7
|
export { name, version };
|
|
8
8
|
//# sourceMappingURL=packageMetadata.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { POPUP_RELAY_RESPONSE_TYPE } from './constants.mjs';
|
|
4
4
|
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
|
@@ -12,6 +12,142 @@ import { popupRelayUnsupportedFlow, popupWindowError, userCancelled, timedOut }
|
|
|
12
12
|
const DEFAULT_POPUP_RELAY_TIMEOUT_MS = 300000;
|
|
13
13
|
const DEFAULT_POPUP_RELAY_WIDTH = 520;
|
|
14
14
|
const DEFAULT_POPUP_RELAY_HEIGHT = 640;
|
|
15
|
+
const BAD_REQUEST_SUBERROR = "popup_relay_bad_request";
|
|
16
|
+
const UNSAFE_URL_SUBERROR = "popup_relay_unsafe_url";
|
|
17
|
+
const UNTRUSTED_AUTHORITY_SUBERROR = "popup_relay_untrusted_authority";
|
|
18
|
+
const INVALID_ALLOWED_ORIGIN_SUBERROR = "popup_relay_invalid_allowed_origin";
|
|
19
|
+
function throwRelayError(subError) {
|
|
20
|
+
throw createBrowserAuthError(popupRelayUnsupportedFlow, "", subError);
|
|
21
|
+
}
|
|
22
|
+
function tryParseUrl(raw) {
|
|
23
|
+
try {
|
|
24
|
+
return new URL(raw);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reduces each configured allow-list entry to its origin so the comparison is
|
|
32
|
+
* robust to the shapes a developer naturally reaches for. Passing the
|
|
33
|
+
* configured authority (`https://login.microsoftonline.com/common`), a trailing
|
|
34
|
+
* slash, mixed case, or an explicit default port all normalize to the same
|
|
35
|
+
* origin the navigation target is compared against.
|
|
36
|
+
*
|
|
37
|
+
* A malformed entry is a configuration bug in the relay page, and silently
|
|
38
|
+
* dropping it would quietly change the size of the allow list, so it fails
|
|
39
|
+
* loudly instead.
|
|
40
|
+
*/
|
|
41
|
+
function normalizeAllowedOrigins(allowedAuthorityOrigins) {
|
|
42
|
+
return allowedAuthorityOrigins.map((entry) => {
|
|
43
|
+
const parsed = typeof entry === "string" ? tryParseUrl(entry) : null;
|
|
44
|
+
if (!parsed ||
|
|
45
|
+
parsed.protocol !== "https:" ||
|
|
46
|
+
parsed.username ||
|
|
47
|
+
parsed.password) {
|
|
48
|
+
throwRelayError(INVALID_ALLOWED_ORIGIN_SUBERROR);
|
|
49
|
+
}
|
|
50
|
+
return parsed.origin;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Validates a navigation target taken from the relay page's hash before it can
|
|
55
|
+
* reach `window.open` or a form `action`.
|
|
56
|
+
*
|
|
57
|
+
* The hash is *not* authority: anyone can craft a link to the deployed relay
|
|
58
|
+
* page, so a target must be proven safe rather than assumed to have been built
|
|
59
|
+
* by MSAL. Only absolute `https:` URLs without embedded credentials are
|
|
60
|
+
* accepted, which rules out active/local schemes (`javascript:`, `data:`,
|
|
61
|
+
* `blob:`, `vbscript:`, `file:`) that would otherwise execute in — or read
|
|
62
|
+
* from — the relay page's own first-party security origin. `https:`-only also
|
|
63
|
+
* matches the scheme MSAL already requires of an authority, so it cannot reject
|
|
64
|
+
* a navigation MSAL would have been willing to build.
|
|
65
|
+
*
|
|
66
|
+
* When `allowedAuthorityOrigins` is omitted the origin check is skipped and any
|
|
67
|
+
* https target is accepted — the behavior every relay page had before this
|
|
68
|
+
* validation existed. An explicitly empty array means "allow nothing" and is
|
|
69
|
+
* honored as such rather than being treated as "unset".
|
|
70
|
+
*/
|
|
71
|
+
function validateNavigationTarget(raw, allowedAuthorityOrigins) {
|
|
72
|
+
if (typeof raw !== "string" || !raw) {
|
|
73
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
74
|
+
}
|
|
75
|
+
const parsed = tryParseUrl(raw);
|
|
76
|
+
if (!parsed ||
|
|
77
|
+
parsed.protocol !== "https:" ||
|
|
78
|
+
parsed.username ||
|
|
79
|
+
parsed.password) {
|
|
80
|
+
throwRelayError(UNSAFE_URL_SUBERROR);
|
|
81
|
+
}
|
|
82
|
+
if (allowedAuthorityOrigins !== undefined &&
|
|
83
|
+
!Array.isArray(allowedAuthorityOrigins)) {
|
|
84
|
+
throwRelayError(INVALID_ALLOWED_ORIGIN_SUBERROR);
|
|
85
|
+
}
|
|
86
|
+
const normalizedAllowedOrigins = allowedAuthorityOrigins === undefined
|
|
87
|
+
? undefined
|
|
88
|
+
: normalizeAllowedOrigins(allowedAuthorityOrigins);
|
|
89
|
+
if (normalizedAllowedOrigins &&
|
|
90
|
+
normalizedAllowedOrigins.indexOf(parsed.origin) < 0) {
|
|
91
|
+
throwRelayError(UNTRUSTED_AUTHORITY_SUBERROR);
|
|
92
|
+
}
|
|
93
|
+
/*
|
|
94
|
+
* Return the original string rather than `parsed.href`: `window.open` and
|
|
95
|
+
* `form.action` resolve it with the same URL parser used here, so the
|
|
96
|
+
* navigation is byte-identical to what MSAL built and no normalization can
|
|
97
|
+
* alter an authority's query encoding.
|
|
98
|
+
*/
|
|
99
|
+
return raw;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Parses and fully validates the relayed request carried in the relay page's
|
|
103
|
+
* hash. Every field is treated as attacker-controlled: the shape is checked
|
|
104
|
+
* exactly (no implicit GET fallback for an unknown `method`) and both
|
|
105
|
+
* navigation targets — the GET `url` and the POST `action` — are run through
|
|
106
|
+
* {@link validateNavigationTarget}.
|
|
107
|
+
*/
|
|
108
|
+
function parseRelayRequest(rawReq, allowedAuthorityOrigins) {
|
|
109
|
+
let parsed;
|
|
110
|
+
try {
|
|
111
|
+
parsed = JSON.parse(rawReq);
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
parsed = null;
|
|
115
|
+
}
|
|
116
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
117
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
118
|
+
}
|
|
119
|
+
const request = parsed;
|
|
120
|
+
const id = request.id;
|
|
121
|
+
if (typeof id !== "string" || !id) {
|
|
122
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
123
|
+
}
|
|
124
|
+
if (request.method === "GET") {
|
|
125
|
+
return {
|
|
126
|
+
id,
|
|
127
|
+
method: "GET",
|
|
128
|
+
url: validateNavigationTarget(request.url, allowedAuthorityOrigins),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (request.method === "POST") {
|
|
132
|
+
const action = validateNavigationTarget(request.action, allowedAuthorityOrigins);
|
|
133
|
+
const rawFields = request.fields;
|
|
134
|
+
if (typeof rawFields !== "object" ||
|
|
135
|
+
rawFields === null ||
|
|
136
|
+
Array.isArray(rawFields)) {
|
|
137
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
138
|
+
}
|
|
139
|
+
const fields = {};
|
|
140
|
+
Object.keys(rawFields).forEach((name) => {
|
|
141
|
+
const value = rawFields[name];
|
|
142
|
+
if (typeof value !== "string") {
|
|
143
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
144
|
+
}
|
|
145
|
+
fields[name] = value;
|
|
146
|
+
});
|
|
147
|
+
return { id, method: "POST", action, fields };
|
|
148
|
+
}
|
|
149
|
+
return throwRelayError(BAD_REQUEST_SUBERROR);
|
|
150
|
+
}
|
|
15
151
|
/**
|
|
16
152
|
* Builds the `window.open` features string for the IdP child popup from a
|
|
17
153
|
* {@link PopupWindowAttributes}, mirroring the shape used by
|
|
@@ -37,13 +173,19 @@ function buildChildPopupFeatures(attributes) {
|
|
|
37
173
|
*
|
|
38
174
|
* 1. Reads the IdP navigation MSAL passed in this page's hash (a GET URL, or a
|
|
39
175
|
* POST form for the form_post / EAR response modes), then scrubs the hash.
|
|
40
|
-
* 2.
|
|
176
|
+
* 2. Validates that navigation. The relay page is directly reachable, so the
|
|
177
|
+
* hash is untrusted input: the request shape is checked exactly and the
|
|
178
|
+
* navigation target must be an absolute `https:` URL (optionally pinned to
|
|
179
|
+
* {@link PopupRelayOptions.allowedAuthorityOrigins}). Anything else — in
|
|
180
|
+
* particular active schemes such as `javascript:` — is rejected before it
|
|
181
|
+
* can reach `window.open` or a form `action`.
|
|
182
|
+
* 3. Opens the IdP child popup and performs that navigation (the relay page
|
|
41
183
|
* stays put, so its `window.opener` link back to the embedded frame
|
|
42
184
|
* survives COOP).
|
|
43
|
-
*
|
|
185
|
+
* 4. Waits for the child's redirect URI page (which must run the redirect
|
|
44
186
|
* bridge, `broadcastResponseToMainFrame`) to broadcast the raw auth
|
|
45
187
|
* response over a same-origin `BroadcastChannel`.
|
|
46
|
-
*
|
|
188
|
+
* 5. Relays that raw response back to the embedded frame via
|
|
47
189
|
* `opener.postMessage`, posting only to its own (same) origin, then closes.
|
|
48
190
|
*
|
|
49
191
|
* The embedded frame keeps the PKCE verifier (and EAR private key) and exchanges
|
|
@@ -67,16 +209,11 @@ function runPopupRelay(options) {
|
|
|
67
209
|
if (!opener) {
|
|
68
210
|
throw createBrowserAuthError(popupRelayUnsupportedFlow, "", "popup_relay_no_opener");
|
|
69
211
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
throw createBrowserAuthError(popupRelayUnsupportedFlow, "", "popup_relay_bad_request");
|
|
76
|
-
}
|
|
77
|
-
if (!request || !request.id) {
|
|
78
|
-
throw createBrowserAuthError(popupRelayUnsupportedFlow, "", "popup_relay_bad_request");
|
|
79
|
-
}
|
|
212
|
+
/*
|
|
213
|
+
* Validate everything before opening anything: the relay page is directly
|
|
214
|
+
* reachable, so the hash is attacker-controlled input, not authority.
|
|
215
|
+
*/
|
|
216
|
+
const request = parseRelayRequest(rawReq, options?.allowedAuthorityOrigins);
|
|
80
217
|
const id = request.id;
|
|
81
218
|
const channel = new BroadcastChannel(id);
|
|
82
219
|
let settled = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/popup_relay/index.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.popupWindowError","BrowserAuthErrorCodes.userCancelled","BrowserAuthErrorCodes.timedOut"],"mappings":";;;;;;;AAAA;;;AAGG;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/popup_relay/index.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.popupWindowError","BrowserAuthErrorCodes.userCancelled","BrowserAuthErrorCodes.timedOut"],"mappings":";;;;;;;AAAA;;;AAGG;AAgDH,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAC9C,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AACvD,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AACrD,MAAM,4BAA4B,GAAG,iCAAiC,CAAC;AACvE,MAAM,+BAA+B,GAAG,oCAAoC,CAAC;AAE7E,SAAS,e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,CAAC,KAAK,EAAE,CAAC;AACtB,YAAA,CAAA;AAAC,YAAA,OAAO,CAAC,EAAE;;AAEX,YAAA,CAAA;YACD,KAAK,CAAC,EAAE,KAAK,EAAEC,QAA8B,EAAE,CAAC,CAAC;AACpD,QAAA,CAAA;AACL,IAAA,CAAC,EAAE,OAAO,EAAE,SAAS,IAAI,8BAA8B,CAAC,CAAC;AAC7D;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { createClientConfigurationError, ClientConfigurationErrorCodes, invokeAsync, RequestParameterBuilder, Constants, AuthorizeProtocol, ThrottlingUtils, ResponseHandler, PerformanceEvents, TimeUtils, ProtocolMode, AADServerParamKeys, ProtocolUtils } from '@azure/msal-common/browser';
|
|
4
4
|
import { GetStandardParams, HandleResponsePlatformBroker, HandleCodeResponse, DecryptEarResponse, NativeInteractionClientAcquireToken } from '../telemetry/BrowserPerformanceEvents.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { parseAuthResponseFromUrl, clearAuthResponseFromUrl, getHomepage } from '../utils/BrowserUtils.mjs';
|
|
4
4
|
import { InteractionType, TemporaryCacheKeys, ApiId, INTERACTION_TYPE } from '../utils/BrowserConstants.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { invokeAsync, ProtocolMode, Constants, createClientConfigurationError, ClientConfigurationErrorCodes, PopTokenGenerator, PerformanceEvents, JsonWebTokenAlgorithms } from '@azure/msal-common/browser';
|
|
4
4
|
import { InitializeBaseRequest } from '../telemetry/BrowserPerformanceEvents.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { RequestParameterBuilder, UrlUtils, UrlString, ProtocolUtils } from '@azure/msal-common/browser';
|
|
4
4
|
export { invoke, invokeAsync } from '@azure/msal-common/browser';
|
package/dist/utils/Helpers.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthError, ClientAuthError, ClientAuthErrorCodes, ServerError, InteractionRequiredAuthError } from '@azure/msal-common/browser';
|
|
4
4
|
import { WebBrokerBridgeErrorCode } from './WebBrokerBridgeError.mjs';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
|
+
'use strict';
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Promotes `extraParameters.resource` to the top-level `resource` field.
|
|
9
|
+
*
|
|
10
|
+
* Pre-5.5.0 embedded apps do not have a top-level `resource` field.
|
|
11
|
+
*
|
|
12
|
+
* @param request - The request to transform.
|
|
13
|
+
* @returns A new request with `resource` promoted if applicable.
|
|
14
|
+
*/
|
|
15
|
+
function normalizeResourceField(request) {
|
|
16
|
+
if (request.extraParameters?.resource) {
|
|
17
|
+
const { resource, ...remainingParams } = request.extraParameters;
|
|
18
|
+
const result = { ...request };
|
|
19
|
+
result.resource = resource;
|
|
20
|
+
result.extraParameters = remainingParams;
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
return request;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Demotes the top-level `resource` field into `extraParameters.resource`.
|
|
27
|
+
*
|
|
28
|
+
* Pre-5.5.0 embedded apps do not have a top-level `resource` field.
|
|
29
|
+
*
|
|
30
|
+
* @param request - The request to transform.
|
|
31
|
+
* @returns A new request with `resource` demoted if applicable.
|
|
32
|
+
*/
|
|
33
|
+
function addResourceField(request) {
|
|
34
|
+
if (request.resource) {
|
|
35
|
+
const resource = request.resource;
|
|
36
|
+
const result = { ...request };
|
|
37
|
+
result.extraParameters = {
|
|
38
|
+
...result.extraParameters,
|
|
39
|
+
resource,
|
|
40
|
+
};
|
|
41
|
+
delete result.resource;
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
return request;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Normalize an incoming request from any embedded-app version so that
|
|
48
|
+
* the broker PCA methods can consume it correctly.
|
|
49
|
+
*
|
|
50
|
+
* - Folds legacy field values into their current equivalents.
|
|
51
|
+
* - Strips legacy field names from the returned object.
|
|
52
|
+
* - Is idempotent: safe to call on requests that already use current names.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request from a broker auth request.
|
|
55
|
+
* @returns A new request with current field names only.
|
|
56
|
+
*/
|
|
57
|
+
function normalizeIncomingRequest(request) {
|
|
58
|
+
const normalized = normalizeResourceField(request);
|
|
59
|
+
const currentFields = { ...normalized };
|
|
60
|
+
const { tokenQueryParameters, tokenBodyParameters, authorizePostBodyParameters, } = currentFields;
|
|
61
|
+
delete currentFields.tokenQueryParameters;
|
|
62
|
+
delete currentFields.tokenBodyParameters;
|
|
63
|
+
delete currentFields.authorizePostBodyParameters;
|
|
64
|
+
/*
|
|
65
|
+
* tokenQueryParameters (removed in v5) → extraQueryParameters.
|
|
66
|
+
* Current values win on key conflicts.
|
|
67
|
+
*/
|
|
68
|
+
if (tokenQueryParameters) {
|
|
69
|
+
currentFields.extraQueryParameters = {
|
|
70
|
+
...tokenQueryParameters,
|
|
71
|
+
...currentFields.extraQueryParameters,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/*
|
|
75
|
+
* tokenBodyParameters (removed in v5) → extraParameters.
|
|
76
|
+
* Current values win on key conflicts.
|
|
77
|
+
*/
|
|
78
|
+
if (tokenBodyParameters) {
|
|
79
|
+
currentFields.extraParameters = {
|
|
80
|
+
...tokenBodyParameters,
|
|
81
|
+
...currentFields.extraParameters,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/*
|
|
85
|
+
* authorizePostBodyParameters (removed in v5) → extraParameters.
|
|
86
|
+
* Merged after tokenBodyParameters; current values still win.
|
|
87
|
+
*/
|
|
88
|
+
if (authorizePostBodyParameters) {
|
|
89
|
+
currentFields.extraParameters = {
|
|
90
|
+
...authorizePostBodyParameters,
|
|
91
|
+
...currentFields.extraParameters,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return currentFields;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Add legacy field aliases to an outgoing request so that an older broker
|
|
98
|
+
* can still consume the parameters.
|
|
99
|
+
*
|
|
100
|
+
* - Copies current field values into all known legacy field names.
|
|
101
|
+
* - Merges extraParameters into extraQueryParameters (extraParameters wins)
|
|
102
|
+
* so the v4 broker sees them on the /authorize query string.
|
|
103
|
+
* - Deliberately omits authorizePostBodyParameters.
|
|
104
|
+
* - Is idempotent: safe to call multiple times.
|
|
105
|
+
*
|
|
106
|
+
* @param request - The request about to be wrapped in a broker auth request.
|
|
107
|
+
* @returns A new request carrying both current and legacy field names.
|
|
108
|
+
*/
|
|
109
|
+
function addLegacyRequestFields(request) {
|
|
110
|
+
const result = {
|
|
111
|
+
...addResourceField(request),
|
|
112
|
+
};
|
|
113
|
+
// extraQueryParameters → also set legacy tokenQueryParameters (removed in v5)
|
|
114
|
+
if (result.extraQueryParameters) {
|
|
115
|
+
result.tokenQueryParameters = { ...result.extraQueryParameters };
|
|
116
|
+
}
|
|
117
|
+
// extraParameters → also set legacy field aliases (removed in v5)
|
|
118
|
+
if (result.extraParameters) {
|
|
119
|
+
// Token endpoint is always POST, so body params always apply.
|
|
120
|
+
result.tokenBodyParameters = { ...result.extraParameters };
|
|
121
|
+
/*
|
|
122
|
+
* In v5, extraParameters are sent on the /authorize query string (GET)
|
|
123
|
+
* or POST body depending on httpMethod. The v4 broker reads
|
|
124
|
+
* extraQueryParameters for both flows' query strings, so merging here
|
|
125
|
+
* covers both. We intentionally omit authorizePostBodyParameters
|
|
126
|
+
* because v4 throws if it is present without httpMethod === "POST",
|
|
127
|
+
* and the embedded app cannot expect control over how the request
|
|
128
|
+
* is made.
|
|
129
|
+
*/
|
|
130
|
+
result.extraQueryParameters = {
|
|
131
|
+
...result.extraQueryParameters,
|
|
132
|
+
...result.extraParameters,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export { addLegacyRequestFields, addResourceField, normalizeIncomingRequest, normalizeResourceField };
|
|
139
|
+
//# sourceMappingURL=CrossVersionRequestAdapter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrossVersionRequestAdapter.mjs","sources":["../../../src/webBrokerBridge/adapter/CrossVersionRequestAdapter.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AA6BH;;;;;;;AAOG;AACG,SAAU,sBAAsB,CAEpC,OAAiB,EAAA;AACf,IAAA,IAAI,OAAO,CAAC,eAAe,EAAE,QAAQ,EAAE;QACnC,MAAM,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;AACjE,QAAA,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;AAC9B,QAAA,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,QAAA,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;AACzC,QAAA,OAAO,MAAM,CAAC;AACjB,IAAA,CAAA;AACD,IAAA,OAAO,OAAO,CAAC;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,GAAG,2BAA2B;YAC9B,GAAG,aAAa,CAAC,eAAe;SACnC,CAAC;AACL,IAAA,CAAA;AAED,IAAA,OAAO,aAAa,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;AAYG;AACG,SAAU,sBAAsB,CAEpC,OAAiB,EAAA;AACf,IAAA,MAAM,MAAM,GAAkC;QAC1C,GAAG,gBAAgB,CAAC,OAAO,CAAC;KAC/B,CAAC;;IAGF,IAAI,MAAM,CAAC,oBAAoB,EAAE;QAC7B,MAAM,CAAC,oBAAoB,GAAG,EAAE,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;AACpE,IAAA,CAAA;;IAGD,IAAI,MAAM,CAAC,eAAe,EAAE;;QAExB,MAAM,CAAC,mBAAmB,GAAG,EAAE,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;AAE3D;;;;;;;;AAQG;QACH,MAAM,CAAC,oBAAoB,GAAG;YAC1B,GAAG,MAAM,CAAC,oBAAoB;YAC9B,GAAG,MAAM,CAAC,eAAe;SAC5B,CAAC;AACL,IAAA,CAAA;AAED,IAAA,OAAO,MAAM,CAAC;AAClB;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! @azure/msal-browser v5.22.0 2026-09-15 */
|
|
2
|
+
'use strict';
|
|
3
|
+
export { WebBrokerBridgeErrorCode } from './WebBrokerBridgeError.mjs';
|
|
4
|
+
export { toAuthError } from './WebBrokerBridgeErrorMap.mjs';
|
|
5
|
+
export { PendingRequestRegistry } from './PendingRequestRegistry.mjs';
|
|
6
|
+
export { addLegacyRequestFields, addResourceField, normalizeIncomingRequest, normalizeResourceField } from './adapter/CrossVersionRequestAdapter.mjs';
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|